]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
import gdb-1999-07-07 post reformat
authorJason Molenda <jmolenda@apple.com>
Wed, 7 Jul 1999 20:19:36 +0000 (20:19 +0000)
committerJason Molenda <jmolenda@apple.com>
Wed, 7 Jul 1999 20:19:36 +0000 (20:19 +0000)
643 files changed:
gdb/ChangeLog
gdb/a29k-tdep.c
gdb/a68v-nat.c
gdb/abug-rom.c
gdb/alpha-nat.c
gdb/alpha-tdep.c
gdb/altos-xdep.c
gdb/annotate.c
gdb/annotate.h
gdb/arc-tdep.c
gdb/arm-tdep.c
gdb/arm-xdep.c
gdb/ax-gdb.c
gdb/ax-gdb.h
gdb/ax-general.c
gdb/ax.h
gdb/bcache.c
gdb/bcache.h
gdb/blockframe.c
gdb/breakpoint.c
gdb/breakpoint.h
gdb/buildsym.c
gdb/buildsym.h
gdb/c-lang.c
gdb/c-lang.h
gdb/c-typeprint.c
gdb/c-valprint.c
gdb/call-cmds.h
gdb/ch-exp.c
gdb/ch-lang.c
gdb/ch-lang.h
gdb/ch-typeprint.c
gdb/ch-valprint.c
gdb/coff-solib.c
gdb/coff-solib.h
gdb/coffread.c
gdb/command.c
gdb/command.h
gdb/complaints.c
gdb/complaints.h
gdb/config/a29k/nm-ultra3.h
gdb/config/a29k/tm-a29k.h
gdb/config/a29k/tm-ultra3.h
gdb/config/a29k/tm-vx29k.h
gdb/config/a29k/xm-ultra3.h
gdb/config/alpha/nm-linux.h
gdb/config/alpha/nm-osf.h
gdb/config/alpha/nm-osf2.h
gdb/config/alpha/nm-osf3.h
gdb/config/alpha/tm-alpha.h
gdb/config/alpha/tm-alphalinux.h
gdb/config/alpha/xm-alphalinux.h
gdb/config/alpha/xm-alphaosf.h
gdb/config/arc/tm-arc.h
gdb/config/arm/nm-arm.h
gdb/config/arm/tm-arm.h
gdb/config/arm/xm-arm.h
gdb/config/convex/tm-convex.h
gdb/config/d10v/tm-d10v.h
gdb/config/d30v/tm-d30v.h
gdb/config/fr30/tm-fr30.h
gdb/config/gould/tm-np1.h
gdb/config/gould/tm-pn.h
gdb/config/gould/xm-np1.h
gdb/config/gould/xm-pn.h
gdb/config/h8300/tm-h8300.h
gdb/config/h8500/tm-h8500.h
gdb/config/i386/nm-fbsd.h
gdb/config/i386/nm-gnu.h
gdb/config/i386/nm-go32.h
gdb/config/i386/nm-i386aix.h
gdb/config/i386/nm-i386bsd.h
gdb/config/i386/nm-i386lynx.h
gdb/config/i386/nm-i386mach.h
gdb/config/i386/nm-i386sco.h
gdb/config/i386/nm-i386sco4.h
gdb/config/i386/nm-i386sco5.h
gdb/config/i386/nm-i386sol2.h
gdb/config/i386/nm-i386v.h
gdb/config/i386/nm-i386v4.h
gdb/config/i386/nm-i386v42mp.h
gdb/config/i386/nm-linux.h
gdb/config/i386/nm-m3.h
gdb/config/i386/nm-nbsd.h
gdb/config/i386/nm-ptx4.h
gdb/config/i386/nm-sun386.h
gdb/config/i386/nm-symmetry.h
gdb/config/i386/tm-cygwin.h
gdb/config/i386/tm-fbsd.h
gdb/config/i386/tm-go32.h
gdb/config/i386/tm-i386.h
gdb/config/i386/tm-i386aix.h
gdb/config/i386/tm-i386bsd.h
gdb/config/i386/tm-i386gnu.h
gdb/config/i386/tm-i386lynx.h
gdb/config/i386/tm-i386m3.h
gdb/config/i386/tm-i386mk.h
gdb/config/i386/tm-i386nw.h
gdb/config/i386/tm-i386os9k.h
gdb/config/i386/tm-i386sco5.h
gdb/config/i386/tm-i386sol2.h
gdb/config/i386/tm-i386v.h
gdb/config/i386/tm-i386v4.h
gdb/config/i386/tm-i386v42mp.h
gdb/config/i386/tm-linux.h
gdb/config/i386/tm-nbsd.h
gdb/config/i386/tm-ptx.h
gdb/config/i386/tm-ptx4.h
gdb/config/i386/tm-sun386.h
gdb/config/i386/tm-symmetry.h
gdb/config/i386/xm-cygwin.h
gdb/config/i386/xm-go32.h
gdb/config/i386/xm-i386aix.h
gdb/config/i386/xm-i386bsd.h
gdb/config/i386/xm-i386gnu.h
gdb/config/i386/xm-i386lynx.h
gdb/config/i386/xm-i386m3.h
gdb/config/i386/xm-i386mach.h
gdb/config/i386/xm-i386mk.h
gdb/config/i386/xm-i386sco.h
gdb/config/i386/xm-i386v.h
gdb/config/i386/xm-i386v32.h
gdb/config/i386/xm-i386v4.h
gdb/config/i386/xm-linux.h
gdb/config/i386/xm-nbsd.h
gdb/config/i386/xm-ptx.h
gdb/config/i386/xm-ptx4.h
gdb/config/i386/xm-sun386.h
gdb/config/i386/xm-symmetry.h
gdb/config/i386/xm-windows.h
gdb/config/i960/tm-i960.h
gdb/config/i960/tm-mon960.h
gdb/config/i960/tm-nindy960.h
gdb/config/i960/tm-vx960.h
gdb/config/m32r/tm-m32r.h
gdb/config/m68k/nm-apollo68b.h
gdb/config/m68k/nm-apollo68v.h
gdb/config/m68k/nm-delta68.h
gdb/config/m68k/nm-dpx2.h
gdb/config/m68k/nm-hp300bsd.h
gdb/config/m68k/nm-hp300hpux.h
gdb/config/m68k/nm-linux.h
gdb/config/m68k/nm-m68klynx.h
gdb/config/m68k/nm-nbsd.h
gdb/config/m68k/nm-news.h
gdb/config/m68k/nm-sun2.h
gdb/config/m68k/nm-sun3.h
gdb/config/m68k/nm-sysv4.h
gdb/config/m68k/tm-3b1.h
gdb/config/m68k/tm-apollo68b.h
gdb/config/m68k/tm-cisco.h
gdb/config/m68k/tm-delta68.h
gdb/config/m68k/tm-dpx2.h
gdb/config/m68k/tm-es1800.h
gdb/config/m68k/tm-hp300bsd.h
gdb/config/m68k/tm-hp300hpux.h
gdb/config/m68k/tm-isi.h
gdb/config/m68k/tm-linux.h
gdb/config/m68k/tm-m68k.h
gdb/config/m68k/tm-m68klynx.h
gdb/config/m68k/tm-m68kv4.h
gdb/config/m68k/tm-mac.h
gdb/config/m68k/tm-monitor.h
gdb/config/m68k/tm-nbsd.h
gdb/config/m68k/tm-news.h
gdb/config/m68k/tm-os68k.h
gdb/config/m68k/tm-st2000.h
gdb/config/m68k/tm-sun2.h
gdb/config/m68k/tm-sun2os4.h
gdb/config/m68k/tm-sun3.h
gdb/config/m68k/tm-sun3os4.h
gdb/config/m68k/tm-vx68.h
gdb/config/m68k/xm-3b1.h
gdb/config/m68k/xm-altos.h
gdb/config/m68k/xm-apollo68b.h
gdb/config/m68k/xm-apollo68v.h
gdb/config/m68k/xm-delta68.h
gdb/config/m68k/xm-dpx2.h
gdb/config/m68k/xm-hp300bsd.h
gdb/config/m68k/xm-hp300hpux.h
gdb/config/m68k/xm-isi.h
gdb/config/m68k/xm-linux.h
gdb/config/m68k/xm-m68k.h
gdb/config/m68k/xm-m68klynx.h
gdb/config/m68k/xm-m68kv4.h
gdb/config/m68k/xm-mpw.h
gdb/config/m68k/xm-nbsd.h
gdb/config/m68k/xm-news.h
gdb/config/m68k/xm-news1000.h
gdb/config/m68k/xm-sun2.h
gdb/config/m68k/xm-sun3.h
gdb/config/m68k/xm-sun3os4.h
gdb/config/m88k/nm-cxux.h
gdb/config/m88k/nm-delta88v4.h
gdb/config/m88k/nm-m88k.h
gdb/config/m88k/tm-cxux.h
gdb/config/m88k/tm-delta88.h
gdb/config/m88k/tm-delta88v4.h
gdb/config/m88k/tm-m88k.h
gdb/config/m88k/xm-cxux.h
gdb/config/m88k/xm-delta88.h
gdb/config/m88k/xm-delta88v4.h
gdb/config/m88k/xm-dgux.h
gdb/config/m88k/xm-m88k.h
gdb/config/mips/nm-irix3.h
gdb/config/mips/nm-irix4.h
gdb/config/mips/nm-irix5.h
gdb/config/mips/nm-mips.h
gdb/config/mips/nm-news-mips.h
gdb/config/mips/nm-riscos.h
gdb/config/mips/tm-bigmips.h
gdb/config/mips/tm-bigmips64.h
gdb/config/mips/tm-embed.h
gdb/config/mips/tm-embed64.h
gdb/config/mips/tm-embedl.h
gdb/config/mips/tm-embedl64.h
gdb/config/mips/tm-irix3.h
gdb/config/mips/tm-irix5.h
gdb/config/mips/tm-mips.h
gdb/config/mips/tm-mips64.h
gdb/config/mips/tm-mipsm3.h
gdb/config/mips/tm-mipsv4.h
gdb/config/mips/tm-tx39.h
gdb/config/mips/tm-tx39l.h
gdb/config/mips/tm-vr4100.h
gdb/config/mips/tm-vr4300.h
gdb/config/mips/tm-vr4300el.h
gdb/config/mips/tm-vr5000.h
gdb/config/mips/tm-vr5000el.h
gdb/config/mips/tm-vxmips.h
gdb/config/mips/xm-irix3.h
gdb/config/mips/xm-irix4.h
gdb/config/mips/xm-irix5.h
gdb/config/mips/xm-mips.h
gdb/config/mips/xm-mipsm3.h
gdb/config/mips/xm-mipsv4.h
gdb/config/mips/xm-news-mips.h
gdb/config/mips/xm-riscos.h
gdb/config/mn10200/tm-mn10200.h
gdb/config/mn10300/tm-mn10300.h
gdb/config/nm-gnu.h
gdb/config/nm-lynx.h
gdb/config/nm-m3.h
gdb/config/nm-nbsd.h
gdb/config/nm-sysv4.h
gdb/config/none/nm-none.h
gdb/config/none/tm-none.h
gdb/config/none/xm-none.h
gdb/config/ns32k/nm-nbsd.h
gdb/config/ns32k/nm-umax.h
gdb/config/ns32k/tm-merlin.h
gdb/config/ns32k/tm-nbsd.h
gdb/config/ns32k/tm-ns32km3.h
gdb/config/ns32k/tm-umax.h
gdb/config/ns32k/xm-merlin.h
gdb/config/ns32k/xm-nbsd.h
gdb/config/ns32k/xm-ns32km3.h
gdb/config/ns32k/xm-umax.h
gdb/config/pa/nm-hppab.h
gdb/config/pa/nm-hppah.h
gdb/config/pa/nm-hppah11.h
gdb/config/pa/nm-hppao.h
gdb/config/pa/tm-hppa.h
gdb/config/pa/tm-hppah.h
gdb/config/pa/tm-hppao.h
gdb/config/pa/xm-hppab.h
gdb/config/pa/xm-hppah.h
gdb/config/powerpc/nm-aix.h
gdb/config/powerpc/nm-macos.h
gdb/config/powerpc/nm-solaris.h
gdb/config/powerpc/tm-cygwin.h
gdb/config/powerpc/tm-macos.h
gdb/config/powerpc/tm-ppc-aix.h
gdb/config/powerpc/tm-ppc-eabi.h
gdb/config/powerpc/tm-ppc-nw.h
gdb/config/powerpc/tm-ppc-sim.h
gdb/config/powerpc/tm-ppcle-eabi.h
gdb/config/powerpc/tm-ppcle-sim.h
gdb/config/powerpc/tm-solaris.h
gdb/config/powerpc/xm-aix.h
gdb/config/powerpc/xm-cygwin.h
gdb/config/powerpc/xm-linux.h
gdb/config/powerpc/xm-mpw.h
gdb/config/powerpc/xm-solaris.h
gdb/config/pyr/tm-pyr.h
gdb/config/pyr/xm-pyr.h
gdb/config/romp/xm-rtbsd.h
gdb/config/rs6000/nm-rs6000.h
gdb/config/rs6000/nm-rs6000ly.h
gdb/config/rs6000/tm-rs6000-aix4.h
gdb/config/rs6000/tm-rs6000.h
gdb/config/rs6000/tm-rs6000ly.h
gdb/config/rs6000/xm-aix4.h
gdb/config/rs6000/xm-rs6000.h
gdb/config/rs6000/xm-rs6000ly.h
gdb/config/sh/tm-sh.h
gdb/config/sparc/nm-linux.h
gdb/config/sparc/nm-nbsd.h
gdb/config/sparc/nm-sparclynx.h
gdb/config/sparc/nm-sun4os4.h
gdb/config/sparc/nm-sun4sol2.h
gdb/config/sparc/tm-linux.h
gdb/config/sparc/tm-nbsd.h
gdb/config/sparc/tm-sp64.h
gdb/config/sparc/tm-sp64sim.h
gdb/config/sparc/tm-sparc.h
gdb/config/sparc/tm-sparclet.h
gdb/config/sparc/tm-sparclite.h
gdb/config/sparc/tm-sparclynx.h
gdb/config/sparc/tm-spc-em.h
gdb/config/sparc/tm-sun4os4.h
gdb/config/sparc/tm-sun4sol2.h
gdb/config/sparc/tm-vxsparc.h
gdb/config/sparc/xm-linux.h
gdb/config/sparc/xm-nbsd.h
gdb/config/sparc/xm-sparc.h
gdb/config/sparc/xm-sparclynx.h
gdb/config/sparc/xm-sun4os4.h
gdb/config/sparc/xm-sun4sol2.h
gdb/config/tahoe/tm-tahoe.h
gdb/config/tahoe/xm-tahoe.h
gdb/config/tic80/tm-tic80.h
gdb/config/tm-lynx.h
gdb/config/tm-nbsd.h
gdb/config/tm-sunos.h
gdb/config/tm-sysv4.h
gdb/config/tm-vxworks.h
gdb/config/v850/tm-v850.h
gdb/config/vax/nm-vax.h
gdb/config/vax/tm-vax.h
gdb/config/vax/xm-vax.h
gdb/config/vax/xm-vaxult.h
gdb/config/vax/xm-vaxult2.h
gdb/config/w65/tm-w65.h
gdb/config/xm-aix4.h
gdb/config/xm-lynx.h
gdb/config/xm-mpw.h
gdb/config/xm-nbsd.h
gdb/config/xm-sysv4.h
gdb/config/z8k/tm-z8k.h
gdb/convex-tdep.c
gdb/convex-xdep.c
gdb/core-aout.c
gdb/core-regset.c
gdb/core-sol2.c
gdb/corefile.c
gdb/corelow.c
gdb/cp-valprint.c
gdb/cpu32bug-rom.c
gdb/cxux-nat.c
gdb/d10v-tdep.c
gdb/d30v-tdep.c
gdb/dbug-rom.c
gdb/dbxread.c
gdb/dcache.c
gdb/dcache.h
gdb/defs.h
gdb/delta68-nat.c
gdb/demangle.c
gdb/dink32-rom.c
gdb/dpx2-nat.c
gdb/dsrec.c
gdb/dst.h
gdb/dstread.c
gdb/dve3900-rom.c
gdb/dwarf2read.c
gdb/dwarfread.c
gdb/elfread.c
gdb/environ.c
gdb/environ.h
gdb/eval.c
gdb/event-loop.c
gdb/event-loop.h
gdb/event-top.c
gdb/exec.c
gdb/expprint.c
gdb/expression.h
gdb/f-lang.c
gdb/f-lang.h
gdb/f-typeprint.c
gdb/f-valprint.c
gdb/findvar.c
gdb/fork-child.c
gdb/fr30-tdep.c
gdb/frame.h
gdb/gdb-stabs.h
gdb/gdb_stat.h
gdb/gdb_string.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbcmd.h
gdb/gdbcore.h
gdb/gdbserver/gdbreplay.c
gdb/gdbserver/low-hppabsd.c
gdb/gdbserver/low-linux.c
gdb/gdbserver/low-lynx.c
gdb/gdbserver/low-sim.c
gdb/gdbserver/low-sparc.c
gdb/gdbserver/low-sun3.c
gdb/gdbserver/remote-utils.c
gdb/gdbserver/server.c
gdb/gdbserver/server.h
gdb/gdbserver/utils.c
gdb/gdbthread.h
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/gnu-nat.c
gdb/gnu-nat.h
gdb/gnu-regex.c
gdb/gnu-regex.h
gdb/go32-nat.c
gdb/gould-tdep.c
gdb/gould-xdep.c
gdb/h8300-tdep.c
gdb/h8500-tdep.c
gdb/hp-psymtab-read.c
gdb/hp-symtab-read.c
gdb/hp300ux-nat.c
gdb/hppa-tdep.c
gdb/hppab-nat.c
gdb/hppah-nat.c
gdb/hppam3-nat.c
gdb/hpread.c
gdb/hpread.h
gdb/hpux-thread.c
gdb/i386-tdep.c
gdb/i386aix-nat.c
gdb/i386b-nat.c
gdb/i386gnu-nat.c
gdb/i386ly-tdep.c
gdb/i386m3-nat.c
gdb/i386mach-nat.c
gdb/i386v-nat.c
gdb/i386v4-nat.c
gdb/i387-tdep.c
gdb/i960-tdep.c
gdb/infcmd.c
gdb/inferior.h
gdb/inflow.c
gdb/infptrace.c
gdb/infrun.c
gdb/inftarg.c
gdb/infttrace.c
gdb/irix4-nat.c
gdb/irix5-nat.c
gdb/isi-xdep.c
gdb/jv-lang.c
gdb/jv-lang.h
gdb/jv-typeprint.c
gdb/jv-valprint.c
gdb/kdb-start.c
gdb/language.c
gdb/language.h
gdb/lynx-nat.c
gdb/m2-lang.c
gdb/m2-lang.h
gdb/m2-typeprint.c
gdb/m2-valprint.c
gdb/m3-nat.c
gdb/m32r-rom.c
gdb/m32r-tdep.c
gdb/m68k-tdep.c
gdb/m68klinux-nat.c
gdb/m68knbsd-nat.c
gdb/m88k-nat.c
gdb/m88k-tdep.c
gdb/mac-defs.h
gdb/mac-nat.c
gdb/mac-xdep.c
gdb/main.c
gdb/maint.c
gdb/mdebugread.c
gdb/mem-break.c
gdb/minimon.h
gdb/minsyms.c
gdb/mips-nat.c
gdb/mips-tdep.c
gdb/mipsm3-nat.c
gdb/mipsread.c
gdb/mipsv4-nat.c
gdb/mn10200-tdep.c
gdb/mn10300-tdep.c
gdb/mon960-rom.c
gdb/monitor.c
gdb/monitor.h
gdb/news-xdep.c
gdb/nindy-tdep.c
gdb/nlmread.c
gdb/ns32k-tdep.c
gdb/ns32km3-nat.c
gdb/ns32knbsd-nat.c
gdb/objfiles.c
gdb/objfiles.h
gdb/ocd.c
gdb/ocd.h
gdb/op50-rom.c
gdb/os9kread.c
gdb/osfsolib.c
gdb/parse.c
gdb/parser-defs.h
gdb/partial-stab.h
gdb/ppc-bdm.c
gdb/ppcbug-rom.c
gdb/printcmd.c
gdb/procfs.c
gdb/ptx4-nat.c
gdb/pyr-tdep.c
gdb/pyr-xdep.c
gdb/remote-adapt.c
gdb/remote-array.c
gdb/remote-bug.c
gdb/remote-d10v.c
gdb/remote-e7000.c
gdb/remote-eb.c
gdb/remote-es.c
gdb/remote-est.c
gdb/remote-hms.c
gdb/remote-mips.c
gdb/remote-mm.c
gdb/remote-nindy.c
gdb/remote-nrom.c
gdb/remote-os9k.c
gdb/remote-rdi.c
gdb/remote-rdp.c
gdb/remote-sds.c
gdb/remote-sim.c
gdb/remote-st.c
gdb/remote-udi.c
gdb/remote-utils.c
gdb/remote-utils.h
gdb/remote-vx.c
gdb/remote-vx29k.c
gdb/remote-vx68.c
gdb/remote-vx960.c
gdb/remote-vxmips.c
gdb/remote-vxsparc.c
gdb/remote.c
gdb/rom68k-rom.c
gdb/rs6000-nat.c
gdb/rs6000-tdep.c
gdb/scm-exp.c
gdb/scm-lang.c
gdb/scm-lang.h
gdb/scm-tags.h
gdb/scm-valprint.c
gdb/ser-e7kpc.c
gdb/ser-go32.c
gdb/ser-mac.c
gdb/ser-ocd.c
gdb/ser-tcp.c
gdb/ser-unix.c
gdb/serial.c
gdb/serial.h
gdb/sh-tdep.c
gdb/sh3-rom.c
gdb/signals.h
gdb/sol-thread.c
gdb/solib.c
gdb/solib.h
gdb/somread.c
gdb/somsolib.c
gdb/somsolib.h
gdb/source.c
gdb/sparc-nat.c
gdb/sparc-tdep.c
gdb/sparcl-tdep.c
gdb/sparclet-rom.c
gdb/srec.h
gdb/stabsread.c
gdb/stabsread.h
gdb/stack.c
gdb/standalone.c
gdb/stop-gdb.c
gdb/stuff.c
gdb/sun3-nat.c
gdb/sun386-nat.c
gdb/symfile.c
gdb/symfile.h
gdb/symm-nat.c
gdb/symm-tdep.c
gdb/symmisc.c
gdb/symtab.c
gdb/symtab.h
gdb/tahoe-tdep.c
gdb/target.c
gdb/target.h
gdb/terminal.h
gdb/thread.c
gdb/tic80-tdep.c
gdb/top.c
gdb/top.h
gdb/tracepoint.c
gdb/tracepoint.h
gdb/tui/tui.c
gdb/tui/tui.h
gdb/tui/tuiCommand.c
gdb/tui/tuiCommand.h
gdb/tui/tuiData.c
gdb/tui/tuiData.h
gdb/tui/tuiDataWin.c
gdb/tui/tuiDataWin.h
gdb/tui/tuiDisassem.c
gdb/tui/tuiDisassem.h
gdb/tui/tuiGeneralWin.c
gdb/tui/tuiGeneralWin.h
gdb/tui/tuiIO.c
gdb/tui/tuiIO.h
gdb/tui/tuiLayout.c
gdb/tui/tuiLayout.h
gdb/tui/tuiRegs.c
gdb/tui/tuiRegs.h
gdb/tui/tuiSource.c
gdb/tui/tuiSource.h
gdb/tui/tuiSourceWin.c
gdb/tui/tuiSourceWin.h
gdb/tui/tuiStack.c
gdb/tui/tuiStack.h
gdb/tui/tuiWin.c
gdb/tui/tuiWin.h
gdb/typeprint.c
gdb/typeprint.h
gdb/ultra3-nat.c
gdb/ultra3-xdep.c
gdb/umax-xdep.c
gdb/utils.c
gdb/v850-tdep.c
gdb/v850ice.c
gdb/valarith.c
gdb/valops.c
gdb/valprint.c
gdb/valprint.h
gdb/value.h
gdb/values.c
gdb/vax-tdep.c
gdb/w65-tdep.c
gdb/w89k-rom.c
gdb/win32-nat.c
gdb/xcoffread.c
gdb/xcoffsolib.c
gdb/xcoffsolib.h
gdb/xmodem.c
gdb/xmodem.h
gdb/z8k-tdep.c

index b1d8b8f1ad1da7848b1458c00784c38c5a3bebf2..e0e094d4919bf197dc32a1341020074f70b022da 100644 (file)
@@ -1,5 +1,9 @@
 1999-07-07  Stan Shebs  <shebs@andros.cygnus.com>
 
+       * All C files except *-stub.c and *-share/*: Indent to GNU
+       standard, using indent 1.9.1.
+       * defs.h: Make indent ignore this file, macros confuse it.
+
        * gnu-regex.c, gnu-regex.h: Don't let indent mess with these.
 
 Wed Jul  7 13:06:24 1999  Andrew Cagney  <cagney@b1.cygnus.com>
index 2aab6a45ecaf4a47fd12da0bea0a5385d8f90837..92474a11f15579c35775442598c5533394394fab 100644 (file)
@@ -3,21 +3,22 @@
    Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by Jim Kingdon.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -59,10 +60,10 @@ struct prologue_info
 {
   CORE_ADDR pc;                        /* First addr after fn prologue */
   unsigned rsize, msize;       /* register stack frame size, mem stack ditto */
-  unsigned mfp_used : 1;       /* memory frame pointer used */
-  unsigned rsize_valid : 1;    /* Validity bits for the above */
-  unsigned msize_valid : 1;
-  unsigned mfp_valid : 1;
+  unsigned mfp_used:1;         /* memory frame pointer used */
+  unsigned rsize_valid:1;      /* Validity bits for the above */
+  unsigned msize_valid:1;
+  unsigned mfp_valid:1;
 };
 
 /* Examine the prologue of a function which starts at PC.  Return
@@ -94,7 +95,7 @@ examine_prologue (pc, rsize, msize, mfp_used)
   struct prologue_info *mi = 0;
 
   if (msymbol != NULL)
-    mi = (struct prologue_info *) msymbol -> info;
+    mi = (struct prologue_info *) msymbol->info;
 
   if (mi != 0)
     {
@@ -124,21 +125,21 @@ examine_prologue (pc, rsize, msize, mfp_used)
     *msize = 0;
   if (mfp_used != NULL)
     *mfp_used = 0;
-  
+
   /* Prologue must start with subtracting a constant from gr1.
      Normally this is sub gr1,gr1,<rsize * 4>.  */
   insn = read_memory_integer (p, 4);
   if ((insn & 0xffffff00) != 0x25010100)
     {
       /* If the frame is large, instead of a single instruction it
-        might be a pair of instructions:
-        const <reg>, <rsize * 4>
-        sub gr1,gr1,<reg>
-        */
+         might be a pair of instructions:
+         const <reg>, <rsize * 4>
+         sub gr1,gr1,<reg>
+       */
       int reg;
       /* Possible value for rsize.  */
       unsigned int rsize0;
-      
+
       if ((insn & 0xff000000) != 0x03000000)
        {
          p = pc;
@@ -172,7 +173,7 @@ examine_prologue (pc, rsize, msize, mfp_used)
    * way down.
    */
   insn = read_memory_integer (p, 4);
-  if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM))
+  if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM))
     {
       p += 4;
     }
@@ -191,9 +192,9 @@ examine_prologue (pc, rsize, msize, mfp_used)
   else
     {
       /* However, for large frames it can be
-        const <reg>, <size *4>
-        add lr1,gr1,<reg>
-        */
+         const <reg>, <size *4>
+         add lr1,gr1,<reg>
+       */
       int reg;
       CORE_ADDR q;
 
@@ -221,8 +222,8 @@ examine_prologue (pc, rsize, msize, mfp_used)
      to be looking for a "sub" instruction here, but the mask was set
      up to lose all the time. */
   insn = read_memory_integer (p, 4);
-  if (((insn & 0xff80ffff) == (0x15800000|(MSP_HW_REGNUM<<8)))     /* add */
-   || ((insn & 0xff80ffff) == (0x81800000|(MSP_HW_REGNUM<<8))))    /* sll */
+  if (((insn & 0xff80ffff) == (0x15800000 | (MSP_HW_REGNUM << 8)))     /* add */
+      || ((insn & 0xff80ffff) == (0x81800000 | (MSP_HW_REGNUM << 8)))) /* sll */
     {
       p += 4;
       if (mfp_used != NULL)
@@ -238,24 +239,24 @@ examine_prologue (pc, rsize, msize, mfp_used)
 
      Normally this is just
      sub msp,msp,<msize>
-     */
+   */
   insn = read_memory_integer (p, 4);
-  if ((insn & 0xffffff00) == 
-               (0x25000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8)))
+  if ((insn & 0xffffff00) ==
+      (0x25000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8)))
     {
       p += 4;
-      if (msize != NULL) 
+      if (msize != NULL)
        *msize = insn & 0xff;
     }
   else
     {
       /* For large frames, instead of a single instruction it might
-        be
+         be
 
-        const <reg>, <msize>
-        consth <reg>, <msize>     ; optional
-        sub msp,msp,<reg>
-        */
+         const <reg>, <msize>
+         consth <reg>, <msize>     ; optional
+         sub msp,msp,<reg>
+       */
       int reg;
       unsigned msize0;
       CORE_ADDR q = p;
@@ -276,8 +277,8 @@ examine_prologue (pc, rsize, msize, mfp_used)
              insn = read_memory_integer (q, 4);
            }
          /* Check for sub msp,msp,<reg>.  */
-          if ((insn & 0xffffff00) == 
-               (0x24000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8))
+         if ((insn & 0xffffff00) ==
+             (0x24000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8))
              && (insn & 0xff) == reg)
            {
              p = q + 4;
@@ -295,19 +296,19 @@ examine_prologue (pc, rsize, msize, mfp_used)
    * way down after everything else.
    */
   insn = read_memory_integer (p, 4);
-  if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM))
+  if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM))
     {
       p += 4;
     }
 
- done:
+done:
   if (msymbol != NULL)
     {
       if (mi == 0)
        {
          /* Add a new cache entry.  */
-         mi = (struct prologue_info *)xmalloc (sizeof (struct prologue_info));
-         msymbol -> info = (char *)mi;
+         mi = (struct prologue_info *) xmalloc (sizeof (struct prologue_info));
+         msymbol->info = (char *) mi;
          mi->rsize_valid = 0;
          mi->msize_valid = 0;
          mi->mfp_valid = 0;
@@ -353,7 +354,7 @@ a29k_skip_prologue (pc)
  * msize is return in bytes.
  */
 
-static int     /* 0/1 - failure/success of finding the tag word  */
+static int                     /* 0/1 - failure/success of finding the tag word  */
 examine_tag (p, is_trans, argcount, msize, mfp_used)
      CORE_ADDR p;
      int *is_trans;
@@ -366,19 +367,20 @@ examine_tag (p, is_trans, argcount, msize, mfp_used)
   tag1 = read_memory_integer (p, 4);
   if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */
     return 0;
-  if (tag1 & (1<<23))                  /* A two word tag */
+  if (tag1 & (1 << 23))                /* A two word tag */
     {
-       tag2 = read_memory_integer (p-4, 4);
-       if (msize)
-        *msize = tag2 * 2;
+      tag2 = read_memory_integer (p - 4, 4);
+      if (msize)
+       *msize = tag2 * 2;
     }
-  else                                 /* A one word tag */
+  else
+    /* A one word tag */
     {
-       if (msize)
-        *msize = tag1 & 0x7ff;
+      if (msize)
+       *msize = tag1 & 0x7ff;
     }
   if (is_trans)
-    *is_trans = ((tag1 & (1<<21)) ? 1 : 0);
+    *is_trans = ((tag1 & (1 << 21)) ? 1 : 0);
   /* Note that this includes the frame pointer and the return address
      register, so the actual number of registers of arguments is two less.
      argcount can be zero, however, sometimes, for strange assembler
@@ -386,7 +388,7 @@ examine_tag (p, is_trans, argcount, msize, mfp_used)
   if (argcount)
     *argcount = (tag1 >> 16) & 0x1f;
   if (mfp_used)
-    *mfp_used = ((tag1 & (1<<22)) ? 1 : 0); 
+    *mfp_used = ((tag1 & (1 << 22)) ? 1 : 0);
   return 1;
 }
 
@@ -413,8 +415,8 @@ init_frame_info (innermost_frame, frame)
     frame->frame = read_register (GR1_REGNUM);
   else
     frame->frame = frame->next->frame + frame->next->rsize;
-  
-#if 0 /* CALL_DUMMY_LOCATION == ON_STACK */
+
+#if 0                          /* CALL_DUMMY_LOCATION == ON_STACK */
   This wont work;
 #else
   if (PC_IN_CALL_DUMMY (p, 0, 0))
@@ -422,34 +424,35 @@ init_frame_info (innermost_frame, frame)
     {
       frame->rsize = DUMMY_FRAME_RSIZE;
       /* This doesn't matter since we never try to get locals or args
-        from a dummy frame.  */
+         from a dummy frame.  */
       frame->msize = 0;
       /* Dummy frames always use a memory frame pointer.  */
-      frame->saved_msp = 
+      frame->saved_msp =
        read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4);
-      frame->flags |= (TRANSPARENT_FRAME|MFP_USED);
+      frame->flags |= (TRANSPARENT_FRAME | MFP_USED);
       return;
     }
-    
+
   func = find_pc_function (p);
   if (func != NULL)
     p = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
   else
     {
       /* Search backward to find the trace-back tag.  However,
-        do not trace back beyond the start of the text segment
-        (just as a sanity check to avoid going into never-never land).  */
+         do not trace back beyond the start of the text segment
+         (just as a sanity check to avoid going into never-never land).  */
 #if 1
       while (p >= text_start
-            && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
+         && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
        p -= 4;
 #else /* 0 */
-      char pat[4] = {0, 0, 0, 0};
+      char pat[4] =
+      {0, 0, 0, 0};
       char mask[4];
       char insn_raw[4];
       store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK);
       /* Enable this once target_search is enabled and tested.  */
-      target_search (4, pat, mask, p, -4, text_start, p+1, &p, &insn_raw);
+      target_search (4, pat, mask, p, -4, text_start, p + 1, &p, &insn_raw);
       insn = extract_unsigned_integer (insn_raw, 4);
 #endif /* 0 */
 
@@ -475,18 +478,18 @@ init_frame_info (innermost_frame, frame)
      If one doesn't exist, try using a more exhaustive search of
      the prologue.  */
 
-  if (examine_tag(p-4,&trans,(int *)NULL,&msize,&mfp_used)) /* Found good tag */
-      examine_prologue (p, &rsize, 0, 0);
-  else                                                 /* No tag try prologue */
-      examine_prologue (p, &rsize, &msize, &mfp_used);
+  if (examine_tag (p - 4, &trans, (int *) NULL, &msize, &mfp_used))    /* Found good tag */
+    examine_prologue (p, &rsize, 0, 0);
+  else                         /* No tag try prologue */
+    examine_prologue (p, &rsize, &msize, &mfp_used);
 
   frame->rsize = rsize;
   frame->msize = msize;
   frame->flags = 0;
   if (mfp_used)
-       frame->flags |= MFP_USED;
+    frame->flags |= MFP_USED;
   if (trans)
-       frame->flags |= TRANSPARENT_FRAME;
+    frame->flags |= TRANSPARENT_FRAME;
   if (innermost_frame)
     {
       frame->saved_msp = read_register (MSP_REGNUM) + msize;
@@ -494,10 +497,10 @@ init_frame_info (innermost_frame, frame)
   else
     {
       if (mfp_used)
-        frame->saved_msp =
-             read_register_stack_integer (frame->frame + rsize - 4, 4);
+       frame->saved_msp =
+         read_register_stack_integer (frame->frame + rsize - 4, 4);
       else
-           frame->saved_msp = frame->next->saved_msp + msize;
+       frame->saved_msp = frame->next->saved_msp + msize;
     }
 }
 
@@ -509,7 +512,8 @@ init_extra_frame_info (frame)
     /* Assume innermost frame.  May produce strange results for "info frame"
        but there isn't any way to tell the difference.  */
     init_frame_info (1, frame);
-  else {
+  else
+    {
       /* We're in get_prev_frame.
          Take care of everything in init_frame_pc.  */
       ;
@@ -522,7 +526,7 @@ init_frame_pc (fromleaf, frame)
      struct frame_info *frame;
 {
   frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) :
-            frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ());
+              frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ());
   init_frame_info (fromleaf, frame);
 }
 \f
@@ -534,7 +538,7 @@ CORE_ADDR
 frame_locals_address (fi)
      struct frame_info *fi;
 {
-  if (fi->flags & MFP_USED) 
+  if (fi->flags & MFP_USED)
     return fi->saved_msp;
   else
     return fi->saved_msp - fi->msize;
@@ -562,10 +566,11 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
   long rsp = read_register (RSP_REGNUM);
 
   /* If we don't do this 'info register' stops in the middle. */
-  if (memaddr >= rstack_high_address) 
+  if (memaddr >= rstack_high_address)
     {
       /* a bogus value */
-      static char val[] = {~0, ~0, ~0, ~0};
+      static char val[] =
+      {~0, ~0, ~0, ~0};
       /* It's in a local register, but off the end of the stack.  */
       int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
       if (myaddr != NULL)
@@ -573,7 +578,7 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
          /* Provide bogusness */
          memcpy (myaddr, val, 4);
        }
-      supply_register(regnum, val);    /* More bogusness */
+      supply_register (regnum, val);   /* More bogusness */
       if (lval != NULL)
        *lval = lval_register;
       if (actual_mem_addr != NULL)
@@ -599,7 +604,7 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
   else
     {
       /* It's in the memory portion of the register stack.  */
-      if (myaddr != NULL) 
+      if (myaddr != NULL)
        read_memory (memaddr, myaddr, 4);
       if (lval != NULL)
        *lval = lval_memory;
@@ -632,11 +637,11 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
   long rfb = read_register (RFB_REGNUM);
   long rsp = read_register (RSP_REGNUM);
   /* If we don't do this 'info register' stops in the middle. */
-  if (memaddr >= rstack_high_address) 
+  if (memaddr >= rstack_high_address)
     {
       /* It's in a register, but off the end of the stack.  */
       if (actual_mem_addr != NULL)
-       *actual_mem_addr = 0; 
+       *actual_mem_addr = 0;
     }
   else if (memaddr < rfb)
     {
@@ -645,7 +650,7 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
       if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127)
        error ("Attempt to read register stack out of range.");
       if (myaddr != NULL)
-       write_register (regnum, *(long *)myaddr);
+       write_register (regnum, *(long *) myaddr);
       if (actual_mem_addr != NULL)
        *actual_mem_addr = 0;
     }
@@ -733,7 +738,7 @@ a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
   else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128)
     {
       /* These registers are not saved over procedure calls,
-        so just print out the current values.  */
+         so just print out the current values.  */
       if (raw_buffer != NULL)
        read_register_gen (regnum, raw_buffer);
       if (lvalp != NULL)
@@ -742,7 +747,7 @@ a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
        *addrp = REGISTER_BYTE (regnum);
       return;
     }
-      
+
   addr = frame->frame + (regnum - LR0_REGNUM) * 4;
   if (raw_buffer != NULL)
     read_register_stack (addr, raw_buffer, &addr, &lval);
@@ -760,9 +765,9 @@ void
 pop_frame ()
 {
   struct frame_info *frame = get_current_frame ();
-  CORE_ADDR rfb = read_register (RFB_REGNUM);                
+  CORE_ADDR rfb = read_register (RFB_REGNUM);
   CORE_ADDR gr1 = frame->frame + frame->rsize;
-  CORE_ADDR lr1;                                                             
+  CORE_ADDR lr1;
   CORE_ADDR original_lr0;
   int must_fix_lr0 = 0;
   int i;
@@ -772,54 +777,54 @@ pop_frame ()
                        read_register (SP_REGNUM),
                        FRAME_FP (frame)))
     {
-      int lrnum = LR0_REGNUM + DUMMY_ARG/4;
+      int lrnum = LR0_REGNUM + DUMMY_ARG / 4;
       for (i = 0; i < DUMMY_SAVE_SR128; ++i)
-       write_register (SR_REGNUM (i + 128),read_register (lrnum++));
+       write_register (SR_REGNUM (i + 128), read_register (lrnum++));
       for (i = 0; i < DUMMY_SAVE_SR160; ++i)
-       write_register (SR_REGNUM(i+160), read_register (lrnum++));
+       write_register (SR_REGNUM (i + 160), read_register (lrnum++));
       for (i = 0; i < DUMMY_SAVE_GREGS; ++i)
        write_register (RETURN_REGNUM + i, read_register (lrnum++));
       /* Restore the PCs and prepare to restore LR0.  */
-      write_register(PC_REGNUM, read_register (lrnum++));
-      write_register(NPC_REGNUM, read_register (lrnum++));
-      write_register(PC2_REGNUM, read_register (lrnum++));
+      write_register (PC_REGNUM, read_register (lrnum++));
+      write_register (NPC_REGNUM, read_register (lrnum++));
+      write_register (PC2_REGNUM, read_register (lrnum++));
       original_lr0 = read_register (lrnum++);
       must_fix_lr0 = 1;
     }
 
   /* Restore the memory stack pointer.  */
   write_register (MSP_REGNUM, frame->saved_msp);
-  /* Restore the register stack pointer.  */                                 
+  /* Restore the register stack pointer.  */
   write_register (GR1_REGNUM, gr1);
 
   /* If we popped a dummy frame, restore lr0 now that gr1 has been restored. */
-  if (must_fix_lr0) 
+  if (must_fix_lr0)
     write_register (LR0_REGNUM, original_lr0);
 
-  /* Check whether we need to fill registers.  */                            
-  lr1 = read_register (LR0_REGNUM + 1);                                      
-  if (lr1 > rfb)                                                             
-    {                                                                        
-      /* Fill.  */                                                           
+  /* Check whether we need to fill registers.  */
+  lr1 = read_register (LR0_REGNUM + 1);
+  if (lr1 > rfb)
+    {
+      /* Fill.  */
       int num_bytes = lr1 - rfb;
-      int i;                                                                 
+      int i;
       long word;
-                                                     
-      write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);  
-      write_register (RFB_REGNUM, lr1);                                      
-      for (i = 0; i < num_bytes; i += 4)                                     
-        {
+
+      write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);
+      write_register (RFB_REGNUM, lr1);
+      for (i = 0; i < num_bytes; i += 4)
+       {
          /* Note: word is in host byte order.  */
-          word = read_memory_integer (rfb + i, 4);
-          write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
-        }                                                                    
+         word = read_memory_integer (rfb + i, 4);
+         write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
+       }
     }
-  flush_cached_frames ();                                                    
+  flush_cached_frames ();
 }
 
 /* Push an empty stack frame, to record the current PC, etc.  */
 
-void 
+void
 push_dummy_frame ()
 {
   long w;
@@ -827,13 +832,13 @@ push_dummy_frame ()
   CORE_ADDR msp = read_register (MSP_REGNUM);
   int lrnum, i;
   CORE_ADDR original_lr0;
-      
+
   /* Read original lr0 before changing gr1.  This order isn't really needed
      since GDB happens to have a snapshot of all the regs and doesn't toss
      it when gr1 is changed.  But it's The Right Thing To Do.  */
   original_lr0 = read_register (LR0_REGNUM);
 
-  /* Allocate the new frame. */ 
+  /* Allocate the new frame. */
   gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE;
   write_register (GR1_REGNUM, gr1);
 
@@ -877,7 +882,7 @@ push_dummy_frame ()
   write_register (MSP_REGNUM, msp - 16 * 4);
 
   /* Save registers.  */
-  lrnum = LR0_REGNUM + DUMMY_ARG/4;
+  lrnum = LR0_REGNUM + DUMMY_ARG / 4;
   for (i = 0; i < DUMMY_SAVE_SR128; ++i)
     write_register (lrnum++, read_register (SR_REGNUM (i + 128)));
   for (i = 0; i < DUMMY_SAVE_SR160; ++i)
@@ -918,7 +923,7 @@ setup_arbitrary_frame (argc, argv)
 
   if (!frame)
     fatal ("internal: create_new_frame returned invalid frame id");
-  
+
   /* Creating a new frame munges the `frame' value from the current
      GR1, so we restore it again here.  FIXME, untangle all this
      29K frame stuff...  */
@@ -991,25 +996,25 @@ a29k_get_processor_type ()
 
 #ifdef GET_LONGJMP_TARGET
 /* Figure out where the longjmp will land.  We expect that we have just entered
-  longjmp and haven't yet setup the stack frame, so the args are still in the
+   longjmp and haven't yet setup the stack frame, so the args are still in the
    output regs.  lr2 (LR2_REGNUM) points at the jmp_buf structure from which we
    extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
    This routine returns true on success */
 
 int
-get_longjmp_target(pc)
+get_longjmp_target (pc)
      CORE_ADDR *pc;
 {
   CORE_ADDR jb_addr;
-  char buf[sizeof(CORE_ADDR)];
+  char buf[sizeof (CORE_ADDR)];
 
-  jb_addr = read_register(LR2_REGNUM);
+  jb_addr = read_register (LR2_REGNUM);
 
-  if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf,
-                         sizeof(CORE_ADDR)))
+  if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf,
+                         sizeof (CORE_ADDR)))
     return 0;
 
-  *pc = extract_address ((PTR) buf, sizeof(CORE_ADDR));
+  *pc = extract_address ((PTR) buf, sizeof (CORE_ADDR));
   return 1;
 }
 #endif /* GET_LONGJMP_TARGET */
@@ -1024,7 +1029,7 @@ _initialize_a29k_tdep ()
   /* FIXME, there should be a way to make a CORE_ADDR variable settable. */
   add_show_from_set
     (add_set_cmd ("rstack_high_address", class_support, var_uinteger,
-                 (char *)&rstack_high_address,
+                 (char *) &rstack_high_address,
                  "Set top address in memory of the register stack.\n\
 Attempts to access registers saved above this address will be ignored\n\
 or will produce the value -1.", &setlist),
@@ -1033,8 +1038,8 @@ or will produce the value -1.", &setlist),
   /* FIXME, there should be a way to make a CORE_ADDR variable settable. */
   add_show_from_set
     (add_set_cmd ("call_scratch_address", class_support, var_uinteger,
-                 (char *)&text_end,
-"Set address in memory where small amounts of RAM can be used\n\
+                 (char *) &text_end,
+                 "Set address in memory where small amounts of RAM can be used\n\
 when making function calls into the inferior.", &setlist),
      &showlist);
 }
index deb9247beb8897c7036845e7e01cd2fe3e9251bb..3b4c27160ef31b9146201fb983dbdf530bfbcc46 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent code for Apollo-68ks for GDB, the GNU debugger.
    Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -30,40 +31,40 @@ extern int errno;
 
 void
 fetch_inferior_registers (ignored)
-    int ignored;
+     int ignored;
 {
   struct ptrace_$data_regs_m68k inferior_registers;
   struct ptrace_$floating_regs_m68k inferior_fp_registers;
   struct ptrace_$control_regs_m68k inferior_control_registers;
 
-  ptrace_$init_control(&inferior_control_registers);
-  inferior_fp_registers.size = sizeof(inferior_fp_registers);
+  ptrace_$init_control (&inferior_control_registers);
+  inferior_fp_registers.size = sizeof (inferior_fp_registers);
 
   registers_fetched ();
-  
+
   ptrace (PTRACE_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers,
+         (PTRACE_ARG3_TYPE) & inferior_registers,
          ptrace_$data_set,
-         (PTRACE_ARG3_TYPE) &inferior_registers,
+         (PTRACE_ARG3_TYPE) & inferior_registers,
          ptrace_$data_set);
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-       (PTRACE_ARG3_TYPE) &inferior_fp_registers,
-       ptrace_$floating_set_m68k,
-       (PTRACE_ARG3_TYPE) &inferior_fp_registers,
-       ptrace_$floating_set_m68k);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
+         ptrace_$floating_set_m68k,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
+         ptrace_$floating_set_m68k);
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-       (PTRACE_ARG3_TYPE) &inferior_control_registers,
-       ptrace_$control_set_m68k,
-       (PTRACE_ARG3_TYPE) &inferior_control_registers,
-       ptrace_$control_set_m68k);
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
+         ptrace_$control_set_m68k,
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
+         ptrace_$control_set_m68k);
 
   bcopy (&inferior_registers, registers, 16 * 4);
   bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
         sizeof inferior_fp_registers.regs);
-  *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr;
-  *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc;
+  *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr;
+  *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc;
 }
 
 /* Store our register values back into the inferior.
@@ -78,44 +79,44 @@ store_inferior_registers (regno)
   struct ptrace_$floating_regs_m68k inferior_fp_registers;
   struct ptrace_$control_regs_m68k inferior_control_registers;
 
-  ptrace_$init_control(&inferior_control_registers);
-  inferior_fp_registers.size = sizeof(inferior_fp_registers);
+  ptrace_$init_control (&inferior_control_registers);
+  inferior_fp_registers.size = sizeof (inferior_fp_registers);
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-       (PTRACE_ARG3_TYPE) &inferior_fp_registers,
-       ptrace_$floating_set_m68k,
-       (PTRACE_ARG3_TYPE) &inferior_fp_registers,
-       ptrace_$floating_set_m68k);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
+         ptrace_$floating_set_m68k,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
+         ptrace_$floating_set_m68k);
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-       (PTRACE_ARG3_TYPE) &inferior_control_registers,
-       ptrace_$control_set_m68k,
-       (PTRACE_ARG3_TYPE) &inferior_control_registers,
-       ptrace_$control_set_m68k);
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
+         ptrace_$control_set_m68k,
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
+         ptrace_$control_set_m68k);
 
-  bcopy (registers, &inferior_registers, sizeof(inferior_registers));
+  bcopy (registers, &inferior_registers, sizeof (inferior_registers));
 
   bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], inferior_fp_registers.regs,
         sizeof inferior_fp_registers.regs);
 
-  inferior_control_registers.sr = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
-  inferior_control_registers.pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+  inferior_control_registers.sr = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
+  inferior_control_registers.pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
 
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers,
+         (PTRACE_ARG3_TYPE) & inferior_registers,
          ptrace_$data_set_m68k,
-         (PTRACE_ARG3_TYPE) &inferior_registers,
+         (PTRACE_ARG3_TYPE) & inferior_registers,
          ptrace_$data_set_m68k);
 
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
          ptrace_$floating_set_m68k,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers,
          ptrace_$floating_set_m68k);
 
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_control_registers,
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
          ptrace_$control_set_m68k,
-         (PTRACE_ARG3_TYPE) &inferior_control_registers,
+         (PTRACE_ARG3_TYPE) & inferior_control_registers,
          ptrace_$control_set_m68k);
 }
index 97ff0f8d322615d403e22bab63bb7f06669d83d2..e1bd628a8d6964c324650199664f26637917f193 100644 (file)
@@ -3,21 +3,22 @@
 
    Written by Rob Savoye of Cygnus Support
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -92,61 +93,62 @@ static char *abug_regnames[NUM_REGS] =
 
 static struct target_ops abug_ops;
 
-static char *abug_inits[] = {"\r", NULL};
+static char *abug_inits[] =
+{"\r", NULL};
 
-static struct monitor_ops abug_cmds ;
+static struct monitor_ops abug_cmds;
 
-static void 
-init_abug_cmds(void)
+static void
+init_abug_cmds (void)
 {
-  abug_cmds.flags =   MO_CLR_BREAK_USES_ADDR;
-  abug_cmds.init =   abug_inits;                       /* Init strings */
-  abug_cmds.cont =   "g\r";                    /* continue command */
-  abug_cmds.step =   "t\r";                    /* single step */
-  abug_cmds.stop =   NULL;                             /* interrupt command */
-  abug_cmds.set_break =   "br %x\r";                   /* set a breakpoint */
-  abug_cmds.clr_break =   "nobr %x\r";                 /* clear a breakpoint */
-  abug_cmds.clr_all_break =   "nobr\r";                        /* clear all breakpoints */
-  abug_cmds.fill =   "bf %x:%x %x;b\r";                /* fill (start count val) */
-  abug_cmds.setmem.cmdb =     "ms %x %02x\r";          /* setmem.cmdb (addr, value) */
-  abug_cmds.setmem.cmdw =     "ms %x %04x\r";          /* setmem.cmdw (addr, value) */
-  abug_cmds.setmem.cmdl =     "ms %x %08x\r";          /* setmem.cmdl (addr, value) */
-  abug_cmds.setmem.cmdll =     NULL;                   /* setmem.cmdll (addr, value) */
-  abug_cmds.setmem.resp_delim =     NULL;                      /* setreg.resp_delim */
-  abug_cmds.setmem.term =     NULL;                    /* setreg.term */
-  abug_cmds.setmem.term_cmd =     NULL;                        /* setreg.term_cmd */
-  abug_cmds.getmem.cmdb =     "md %x:%x;b\r";          /* getmem.cmdb (addr, len) */
-  abug_cmds.getmem.cmdw =     "md %x:%x;b\r";          /* getmem.cmdw (addr, len) */
-  abug_cmds.getmem.cmdl =     "md %x:%x;b\r";          /* getmem.cmdl (addr, len) */
-  abug_cmds.getmem.cmdll =     NULL;                   /* getmem.cmdll (addr, len) */
-  abug_cmds.getmem.resp_delim =     " ";                       /* getmem.resp_delim */
-  abug_cmds.getmem.term =     NULL;                    /* getmem.term */
-  abug_cmds.getmem.term_cmd =     NULL;                        /* getmem.term_cmd */
-  abug_cmds.setreg.cmd =     "rm %s %x\r";             /* setreg.cmd (name, value) */
-  abug_cmds.setreg.resp_delim =     "=";                       /* setreg.resp_delim */
-  abug_cmds.setreg.term =     "? ";                    /* setreg.term */
-  abug_cmds.setreg.term_cmd =     ".\r"        ;               /* setreg.term_cmd */
-  abug_cmds.getreg.cmd =     "rm %s\r";                        /* getreg.cmd (name) */
-  abug_cmds.getreg.resp_delim =     "=";                       /* getreg.resp_delim */
-  abug_cmds.getreg.term =     "? ";                    /* getreg.term */
-  abug_cmds.getreg.term_cmd =     ".\r"        ;               /* getreg.term_cmd */
-    abug_cmds.dump_registers =   "rd\r";                       /* dump_registers */
-  abug_cmds.register_pattern =   "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
-  abug_cmds.supply_register =   abug_supply_register;  /* supply_register */
-  abug_cmds.load_routine =   NULL;                             /* load_routine (defaults to SRECs) */
-  abug_cmds.load =   "lo 0\r";                 /* download command */
-  abug_cmds.loadresp =   "\n";                         /* load response */
-  abug_cmds.prompt =   "135Bug>";                      /* monitor command prompt */
-  abug_cmds.line_term =   "\r";                                /* end-of-line terminator */
-  abug_cmds.cmd_end =   NULL;                          /* optional command terminator */
-  abug_cmds.target =   &abug_ops;                      /* target operations */
-  abug_cmds.stopbits =   SERIAL_1_STOPBITS;            /* number of stop bits */
-  abug_cmds.regnames =   abug_regnames;                /* registers names */
-  abug_cmds.magic =   MONITOR_OPS_MAGIC        ;       /* magic */
-}; 
+  abug_cmds.flags = MO_CLR_BREAK_USES_ADDR;
+  abug_cmds.init = abug_inits; /* Init strings */
+  abug_cmds.cont = "g\r";      /* continue command */
+  abug_cmds.step = "t\r";      /* single step */
+  abug_cmds.stop = NULL;       /* interrupt command */
+  abug_cmds.set_break = "br %x\r";     /* set a breakpoint */
+  abug_cmds.clr_break = "nobr %x\r";   /* clear a breakpoint */
+  abug_cmds.clr_all_break = "nobr\r";  /* clear all breakpoints */
+  abug_cmds.fill = "bf %x:%x %x;b\r";  /* fill (start count val) */
+  abug_cmds.setmem.cmdb = "ms %x %02x\r";      /* setmem.cmdb (addr, value) */
+  abug_cmds.setmem.cmdw = "ms %x %04x\r";      /* setmem.cmdw (addr, value) */
+  abug_cmds.setmem.cmdl = "ms %x %08x\r";      /* setmem.cmdl (addr, value) */
+  abug_cmds.setmem.cmdll = NULL;       /* setmem.cmdll (addr, value) */
+  abug_cmds.setmem.resp_delim = NULL;  /* setreg.resp_delim */
+  abug_cmds.setmem.term = NULL;        /* setreg.term */
+  abug_cmds.setmem.term_cmd = NULL;    /* setreg.term_cmd */
+  abug_cmds.getmem.cmdb = "md %x:%x;b\r";      /* getmem.cmdb (addr, len) */
+  abug_cmds.getmem.cmdw = "md %x:%x;b\r";      /* getmem.cmdw (addr, len) */
+  abug_cmds.getmem.cmdl = "md %x:%x;b\r";      /* getmem.cmdl (addr, len) */
+  abug_cmds.getmem.cmdll = NULL;       /* getmem.cmdll (addr, len) */
+  abug_cmds.getmem.resp_delim = " ";   /* getmem.resp_delim */
+  abug_cmds.getmem.term = NULL;        /* getmem.term */
+  abug_cmds.getmem.term_cmd = NULL;    /* getmem.term_cmd */
+  abug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */
+  abug_cmds.setreg.resp_delim = "=";   /* setreg.resp_delim */
+  abug_cmds.setreg.term = "? ";        /* setreg.term */
+  abug_cmds.setreg.term_cmd = ".\r";   /* setreg.term_cmd */
+  abug_cmds.getreg.cmd = "rm %s\r";    /* getreg.cmd (name) */
+  abug_cmds.getreg.resp_delim = "=";   /* getreg.resp_delim */
+  abug_cmds.getreg.term = "? ";        /* getreg.term */
+  abug_cmds.getreg.term_cmd = ".\r";   /* getreg.term_cmd */
+  abug_cmds.dump_registers = "rd\r";   /* dump_registers */
+  abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";   /* register_pattern */
+  abug_cmds.supply_register = abug_supply_register;    /* supply_register */
+  abug_cmds.load_routine = NULL;       /* load_routine (defaults to SRECs) */
+  abug_cmds.load = "lo 0\r";   /* download command */
+  abug_cmds.loadresp = "\n";   /* load response */
+  abug_cmds.prompt = "135Bug>";        /* monitor command prompt */
+  abug_cmds.line_term = "\r";  /* end-of-line terminator */
+  abug_cmds.cmd_end = NULL;    /* optional command terminator */
+  abug_cmds.target = &abug_ops;        /* target operations */
+  abug_cmds.stopbits = SERIAL_1_STOPBITS;      /* number of stop bits */
+  abug_cmds.regnames = abug_regnames;  /* registers names */
+  abug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
+};
 
 static void
-abug_open(args, from_tty)
+abug_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -156,7 +158,7 @@ abug_open(args, from_tty)
 void
 _initialize_abug_rom ()
 {
-  init_abug_cmds() ;
+  init_abug_cmds ();
   init_monitor_ops (&abug_ops);
 
   abug_ops.to_shortname = "abug";
index 59bd0d887e5156b10558abcad9b15aed0b9f4ad5..ebeb9bb613a3a4829c18dd473a292900334c58cc 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level Alpha interface, for GDB when running native.
    Copyright 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -23,10 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include <sys/ptrace.h>
 #ifdef __linux__
-# include <asm/reg.h>
-# include <alpha/ptrace.h>
+#include <asm/reg.h>
+#include <alpha/ptrace.h>
 #else
-# include <machine/reg.h>
+#include <machine/reg.h>
 #endif
 #include <sys/user.h>
 
@@ -62,13 +63,13 @@ get_longjmp_target (pc)
   CORE_ADDR jb_addr;
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
 
-  jb_addr = read_register(A0_REGNUM);
+  jb_addr = read_register (A0_REGNUM);
 
-  if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
-                        sizeof(CORE_ADDR)))
+  if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
+                         sizeof (CORE_ADDR)))
     return 0;
 
-  *pc = extract_address (raw_buffer, sizeof(CORE_ADDR));
+  *pc = extract_address (raw_buffer, sizeof (CORE_ADDR));
   return 1;
 }
 
@@ -78,11 +79,11 @@ get_longjmp_target (pc)
    CORE_REG_SECT points to the register values themselves, read into memory.
    CORE_REG_SIZE is the size of that area.
    WHICH says which set of registers we are handling (0 = int, 2 = float
-         on machines where they are discontiguous).
+   on machines where they are discontiguous).
    REG_ADDR is the offset from u.u_ar0 to the register values relative to
-            core_reg_sect.  This is used with old-fashioned core files to
-           locate the registers in a large upage-plus-stack ".reg" section.
-           Original upage address X is at location core_reg_sect+x+reg_addr.
+   core_reg_sect.  This is used with old-fashioned core files to
+   locate the registers in a large upage-plus-stack ".reg" section.
+   Original upage address X is at location core_reg_sect+x+reg_addr.
  */
 
 static void
@@ -101,17 +102,18 @@ fetch_osf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   static int core_reg_mapping[NUM_REGS] =
   {
 #define EFL (EF_SIZE / 8)
-       EF_V0,  EF_T0,  EF_T1,  EF_T2,  EF_T3,  EF_T4,  EF_T5,  EF_T6,
-       EF_T7,  EF_S0,  EF_S1,  EF_S2,  EF_S3,  EF_S4,  EF_S5,  EF_S6,
-       EF_A0,  EF_A1,  EF_A2,  EF_A3,  EF_A4,  EF_A5,  EF_T8,  EF_T9,
-       EF_T10, EF_T11, EF_RA,  EF_T12, EF_AT,  EF_GP,  EF_SP,  -1,
-       EFL+0,  EFL+1,  EFL+2,  EFL+3,  EFL+4,  EFL+5,  EFL+6,  EFL+7,
-       EFL+8,  EFL+9,  EFL+10, EFL+11, EFL+12, EFL+13, EFL+14, EFL+15,
-       EFL+16, EFL+17, EFL+18, EFL+19, EFL+20, EFL+21, EFL+22, EFL+23,
-       EFL+24, EFL+25, EFL+26, EFL+27, EFL+28, EFL+29, EFL+30, EFL+31,
-       EF_PC,  -1
+    EF_V0, EF_T0, EF_T1, EF_T2, EF_T3, EF_T4, EF_T5, EF_T6,
+    EF_T7, EF_S0, EF_S1, EF_S2, EF_S3, EF_S4, EF_S5, EF_S6,
+    EF_A0, EF_A1, EF_A2, EF_A3, EF_A4, EF_A5, EF_T8, EF_T9,
+    EF_T10, EF_T11, EF_RA, EF_T12, EF_AT, EF_GP, EF_SP, -1,
+    EFL + 0, EFL + 1, EFL + 2, EFL + 3, EFL + 4, EFL + 5, EFL + 6, EFL + 7,
+    EFL + 8, EFL + 9, EFL + 10, EFL + 11, EFL + 12, EFL + 13, EFL + 14, EFL + 15,
+    EFL + 16, EFL + 17, EFL + 18, EFL + 19, EFL + 20, EFL + 21, EFL + 22, EFL + 23,
+    EFL + 24, EFL + 25, EFL + 26, EFL + 27, EFL + 28, EFL + 29, EFL + 30, EFL + 31,
+    EF_PC, -1
   };
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   for (regno = 0; regno < NUM_REGS; regno++)
     {
@@ -144,7 +146,7 @@ fetch_elf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      int which;
      CORE_ADDR reg_addr;
 {
-  if (core_reg_size < 32*8)
+  if (core_reg_size < 32 * 8)
     {
       error ("Core file register section too small (%u bytes).", core_reg_size);
       return;
@@ -153,15 +155,15 @@ fetch_elf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   if (which == 2)
     {
       /* The FPU Registers.  */
-      memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31*8);
-      memset (&registers[REGISTER_BYTE (FP0_REGNUM+31)], 0, 8);
+      memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31 * 8);
+      memset (&registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
       memset (&register_valid[FP0_REGNUM], 1, 32);
     }
   else
     {
       /* The General Registers.  */
-      memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31*8);
-      memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect+31*8, 8);
+      memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31 * 8);
+      memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
       memset (&registers[REGISTER_BYTE (ZERO_REGNUM)], 0, 8);
       memset (&register_valid[V0_REGNUM], 1, 32);
       register_valid[PC_REGNUM] = 1;
@@ -201,18 +203,19 @@ kernel_u_size ()
  * See the comment in m68k-tdep.c regarding the utility of these functions.
  */
 
-void 
+void
 supply_gregset (gregsetp)
      gregset_t *gregsetp;
 {
   register int regi;
   register long *regp = ALPHA_REGSET_BASE (gregsetp);
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   for (regi = 0; regi < 31; regi++)
-    supply_register (regi, (char *)(regp + regi));
+    supply_register (regi, (char *) (regp + regi));
 
-  supply_register (PC_REGNUM, (char *)(regp + 31));
+  supply_register (PC_REGNUM, (char *) (regp + 31));
 
   /* Fill inaccessible registers with zero.  */
   supply_register (ZERO_REGNUM, zerobuf);
@@ -248,7 +251,7 @@ supply_fpregset (fpregsetp)
   register long *regp = ALPHA_REGSET_BASE (fpregsetp);
 
   for (regi = 0; regi < 32; regi++)
-    supply_register (regi + FP0_REGNUM, (char *)(regp + regi));
+    supply_register (regi + FP0_REGNUM, (char *) (regp + regi));
 }
 
 void
@@ -269,8 +272,8 @@ fill_fpregset (fpregsetp, regno)
     }
 }
 #endif
-
 \f
+
 /* Register that we are able to handle alpha core file formats. */
 
 static struct core_fns alpha_osf_core_fns =
index 7d851d94de3635f27e19b37f3a15b82b9040a5d9..664b131ab828d2f70b166455354a2f06efabb3c2 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
    Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -41,7 +42,7 @@ static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR));
 
 static alpha_extra_func_info_t heuristic_proc_desc PARAMS ((CORE_ADDR,
                                                            CORE_ADDR,
-                                                           struct frame_info *));
+                                                     struct frame_info *));
 
 static alpha_extra_func_info_t find_proc_desc PARAMS ((CORE_ADDR,
                                                       struct frame_info *));
@@ -57,7 +58,7 @@ static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc,
                                         alpha_extra_func_info_t proc_desc));
 
 static int alpha_in_prologue PARAMS ((CORE_ADDR pc,
-                               alpha_extra_func_info_t proc_desc));
+                                     alpha_extra_func_info_t proc_desc));
 
 static int alpha_about_to_return PARAMS ((CORE_ADDR pc));
 
@@ -67,7 +68,7 @@ void _initialize_alpha_tdep PARAMS ((void));
    time across a 2400 baud serial line.  Allows the user to limit this
    search.  */
 static unsigned int heuristic_fence_post = 0;
-
+/* *INDENT-OFF* */
 /* Layout of a stack frame on the alpha:
 
                 |                              |
@@ -110,13 +111,16 @@ static unsigned int heuristic_fence_post = 0;
    -------------|-------------------------------|<-- sp
                 |                              |
 */
+/* *INDENT-ON* */
+
+
 
-#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */
+#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr)  /* least address */
 /* These next two fields are kind of being hijacked.  I wonder if
    iline is too small for the values it needs to hold, if GDB is
    running on a 32-bit host.  */
-#define PROC_HIGH_ADDR(proc) ((proc)->pdr.iline) /* upper address bound */
-#define PROC_DUMMY_FRAME(proc) ((proc)->pdr.cbLineOffset) /*CALL_DUMMY frame */
+#define PROC_HIGH_ADDR(proc) ((proc)->pdr.iline)       /* upper address bound */
+#define PROC_DUMMY_FRAME(proc) ((proc)->pdr.cbLineOffset)      /*CALL_DUMMY frame */
 #define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset)
 #define PROC_FRAME_REG(proc) ((proc)->pdr.framereg)
 #define PROC_REG_MASK(proc) ((proc)->pdr.regmask)
@@ -131,21 +135,22 @@ static unsigned int heuristic_fence_post = 0;
 #define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_)
 
 struct linked_proc_info
-{
-  struct alpha_extra_func_info info;
-  struct linked_proc_info *next;
-} *linked_proc_desc_table = NULL;
-
+  {
+    struct alpha_extra_func_info info;
+    struct linked_proc_info *next;
+  }
+ *linked_proc_desc_table = NULL;
 \f
+
 /* Under GNU/Linux, signal handler invocations can be identified by the
    designated code sequence that is used to return from a signal
    handler.  In particular, the return address of a signal handler
    points to the following sequence (the first instruction is quadword
    aligned):
 
-       bis $30,$30,$16
-       addq $31,0x67,$0
-       call_pal callsys
+   bis $30,$30,$16
+   addq $31,0x67,$0
+   call_pal callsys
 
    Each instruction has a unique encoding, so we simply attempt to
    match the instruction the pc is pointing to with any of the above
@@ -159,7 +164,7 @@ struct linked_proc_info
    middle of the designated sequence, in which case there is no
    guarantee that we are in the middle of a sigreturn syscall.  Don't
    think this will be a problem in praxis, though.
-*/
+ */
 
 #ifndef TM_LINUXALPHA_H
 /* HACK: Provide a prototype when compiling this file for non
@@ -173,16 +178,23 @@ alpha_linux_sigtramp_offset (pc)
   unsigned int i[3], w;
   long off;
 
-  if (read_memory_nobpt(pc, (char *) &w, 4) != 0)
+  if (read_memory_nobpt (pc, (char *) &w, 4) != 0)
     return -1;
 
   off = -1;
   switch (w)
     {
-    case 0x47de0410: off = 0; break;   /* bis $30,$30,$16 */
-    case 0x43ecf400: off = 4; break;   /* addq $31,0x67,$0 */
-    case 0x00000083: off = 8; break;   /* call_pal callsys */
-    default:        return -1;
+    case 0x47de0410:
+      off = 0;
+      break;                   /* bis $30,$30,$16 */
+    case 0x43ecf400:
+      off = 4;
+      break;                   /* addq $31,0x67,$0 */
+    case 0x00000083:
+      off = 8;
+      break;                   /* call_pal callsys */
+    default:
+      return -1;
     }
   pc -= off;
   if (pc & 0x7)
@@ -191,7 +203,7 @@ alpha_linux_sigtramp_offset (pc)
       return -1;
     }
 
-  if (read_memory_nobpt(pc, (char *) i, sizeof(i)) != 0)
+  if (read_memory_nobpt (pc, (char *) i, sizeof (i)) != 0)
     return -1;
 
   if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083)
@@ -199,8 +211,8 @@ alpha_linux_sigtramp_offset (pc)
 
   return -1;
 }
-
 \f
+
 /* Under OSF/1, the __sigtramp routine is frameless and has a frame
    size of zero, but we are able to backtrace through it.  */
 CORE_ADDR
@@ -209,14 +221,14 @@ alpha_osf_skip_sigtramp_frame (frame, pc)
      CORE_ADDR pc;
 {
   char *name;
-  find_pc_partial_function (pc, &name, (CORE_ADDR *)NULL, (CORE_ADDR *)NULL);
+  find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
   if (IN_SIGTRAMP (pc, name))
     return frame->frame;
   else
     return 0;
 }
-
 \f
+
 /* Dynamically create a signal-handler caller procedure descriptor for
    the signal-handler return code starting at address LOW_ADDR.  The
    descriptor is added to the linked_proc_desc_table.  */
@@ -236,20 +248,20 @@ push_sigtramp_desc (low_addr)
   proc_desc = &link->info;
 
   proc_desc->numargs = 0;
-  PROC_LOW_ADDR (proc_desc)    = low_addr;
-  PROC_HIGH_ADDR (proc_desc)   = low_addr + 3 * 4;
-  PROC_DUMMY_FRAME (proc_desc) = 0;
-  PROC_FRAME_OFFSET (proc_desc)        = 0x298; /* sizeof(struct sigcontext_struct) */
-  PROC_FRAME_REG (proc_desc)   = SP_REGNUM;
-  PROC_REG_MASK (proc_desc)    = 0xffff;
-  PROC_FREG_MASK (proc_desc)   = 0xffff;
-  PROC_PC_REG (proc_desc)      = 26;
-  PROC_LOCALOFF (proc_desc)    = 0;
+  PROC_LOW_ADDR (proc_desc) = low_addr;
+  PROC_HIGH_ADDR (proc_desc) = low_addr + 3 * 4;
+  PROC_DUMMY_FRAME (proc_desc) = 0;
+  PROC_FRAME_OFFSET (proc_desc) = 0x298;       /* sizeof(struct sigcontext_struct) */
+  PROC_FRAME_REG (proc_desc) = SP_REGNUM;
+  PROC_REG_MASK (proc_desc) = 0xffff;
+  PROC_FREG_MASK (proc_desc) = 0xffff;
+  PROC_PC_REG (proc_desc) = 26;
+  PROC_LOCALOFF (proc_desc) = 0;
   SET_PROC_DESC_IS_DYN_SIGTRAMP (proc_desc);
   return (proc_desc);
 }
-
 \f
+
 /* Guaranteed to set frame->saved_regs to some values (it never leaves it
    NULL).  */
 
@@ -282,13 +294,13 @@ alpha_find_saved_regs (frame)
       sigcontext_addr = SIGCONTEXT_ADDR (frame);
       for (ireg = 0; ireg < 32; ireg++)
        {
-         reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
-         frame->saved_regs[ireg] = reg_position;
+         reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
+         frame->saved_regs[ireg] = reg_position;
        }
       for (ireg = 0; ireg < 32; ireg++)
        {
-         reg_position = sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + ireg * 8;
-         frame->saved_regs[FP0_REGNUM + ireg] = reg_position;
+         reg_position = sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + ireg * 8;
+         frame->saved_regs[FP0_REGNUM + ireg] = reg_position;
        }
       frame->saved_regs[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF;
       return;
@@ -315,11 +327,11 @@ alpha_find_saved_regs (frame)
     {
       frame->saved_regs[returnreg] = reg_position;
       reg_position += 8;
-      mask &= ~(1 << returnreg); /* Clear bit for RA so we
-                                   don't save again later. */
+      mask &= ~(1 << returnreg);       /* Clear bit for RA so we
+                                          don't save again later. */
     }
 
-  for (ireg = 0; ireg <= 31 ; ++ireg)
+  for (ireg = 0; ireg <= 31; ++ireg)
     if (mask & (1 << ireg))
       {
        frame->saved_regs[ireg] = reg_position;
@@ -332,10 +344,10 @@ alpha_find_saved_regs (frame)
   reg_position = frame->frame + PROC_FREG_OFFSET (proc_desc);
   mask = PROC_FREG_MASK (proc_desc);
 
-  for (ireg = 0; ireg <= 31 ; ++ireg)
+  for (ireg = 0; ireg <= 31; ++ireg)
     if (mask & (1 << ireg))
       {
-       frame->saved_regs[FP0_REGNUM+ireg] = reg_position;
+       frame->saved_regs[FP0_REGNUM + ireg] = reg_position;
        reg_position += 8;
       }
 
@@ -343,14 +355,14 @@ alpha_find_saved_regs (frame)
 }
 
 static CORE_ADDR
-read_next_frame_reg(fi, regno)
+read_next_frame_reg (fi, regno)
      struct frame_info *fi;
      int regno;
 {
   for (; fi; fi = fi->next)
     {
       /* We have to get the saved sp from the sigcontext
-        if it is a signal handler frame.  */
+         if it is a signal handler frame.  */
       if (regno == SP_REGNUM && !fi->signal_handler_caller)
        return fi->frame;
       else
@@ -358,14 +370,14 @@ read_next_frame_reg(fi, regno)
          if (fi->saved_regs == NULL)
            alpha_find_saved_regs (fi);
          if (fi->saved_regs[regno])
-           return read_memory_integer(fi->saved_regs[regno], 8);
+           return read_memory_integer (fi->saved_regs[regno], 8);
        }
     }
-  return read_register(regno);
+  return read_register (regno);
 }
 
 CORE_ADDR
-alpha_frame_saved_pc(frame)
+alpha_frame_saved_pc (frame)
      struct frame_info *frame;
 {
   alpha_extra_func_info_t proc_desc = frame->proc_desc;
@@ -373,10 +385,10 @@ alpha_frame_saved_pc(frame)
      if it is a signal handler frame.  */
   int pcreg = frame->signal_handler_caller ? PC_REGNUM : frame->pc_reg;
 
-  if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc))
-      return read_memory_integer(frame->frame - 8, 8);
+  if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
+    return read_memory_integer (frame->frame - 8, 8);
 
-  return read_next_frame_reg(frame, pcreg);
+  return read_next_frame_reg (frame, pcreg);
 }
 
 CORE_ADDR
@@ -423,177 +435,178 @@ alpha_about_to_return (pc)
    lines.  */
 
 static CORE_ADDR
-heuristic_proc_start(pc)
-    CORE_ADDR pc;
+heuristic_proc_start (pc)
+     CORE_ADDR pc;
 {
-    CORE_ADDR start_pc = pc;
-    CORE_ADDR fence = start_pc - heuristic_fence_post;
+  CORE_ADDR start_pc = pc;
+  CORE_ADDR fence = start_pc - heuristic_fence_post;
 
-    if (start_pc == 0) return 0;
+  if (start_pc == 0)
+    return 0;
 
-    if (heuristic_fence_post == UINT_MAX
-       || fence < VM_MIN_ADDRESS)
-      fence = VM_MIN_ADDRESS;
+  if (heuristic_fence_post == UINT_MAX
+      || fence < VM_MIN_ADDRESS)
+    fence = VM_MIN_ADDRESS;
 
-    /* search back for previous return */
-    for (start_pc -= 4; ; start_pc -= 4)
-       if (start_pc < fence)
+  /* search back for previous return */
+  for (start_pc -= 4;; start_pc -= 4)
+    if (start_pc < fence)
+      {
+       /* It's not clear to me why we reach this point when
+          stop_soon_quietly, but with this test, at least we
+          don't print out warnings for every child forked (eg, on
+          decstation).  22apr93 rich@cygnus.com.  */
+       if (!stop_soon_quietly)
          {
-           /* It's not clear to me why we reach this point when
-              stop_soon_quietly, but with this test, at least we
-              don't print out warnings for every child forked (eg, on
-              decstation).  22apr93 rich@cygnus.com.  */
-           if (!stop_soon_quietly)
+           static int blurb_printed = 0;
+
+           if (fence == VM_MIN_ADDRESS)
+             warning ("Hit beginning of text section without finding");
+           else
+             warning ("Hit heuristic-fence-post without finding");
+
+           warning ("enclosing function for address 0x%lx", pc);
+           if (!blurb_printed)
              {
-               static int blurb_printed = 0;
-
-               if (fence == VM_MIN_ADDRESS)
-                 warning("Hit beginning of text section without finding");
-               else
-                 warning("Hit heuristic-fence-post without finding");
-               
-               warning("enclosing function for address 0x%lx", pc);
-               if (!blurb_printed)
-                 {
-                   printf_filtered ("\
+               printf_filtered ("\
 This warning occurs if you are debugging a function without any symbols\n\
 (for example, in a stripped executable).  In that case, you may wish to\n\
 increase the size of the search with the `set heuristic-fence-post' command.\n\
 \n\
 Otherwise, you told GDB there was a function where there isn't one, or\n\
 (more likely) you have encountered a bug in GDB.\n");
-                   blurb_printed = 1;
-                 }
+               blurb_printed = 1;
              }
-
-           return 0; 
          }
-       else if (alpha_about_to_return (start_pc))
-         break;
 
-    start_pc += 4; /* skip return */
-    return start_pc;
+       return 0;
+      }
+    else if (alpha_about_to_return (start_pc))
+      break;
+
+  start_pc += 4;               /* skip return */
+  return start_pc;
 }
 
 static alpha_extra_func_info_t
-heuristic_proc_desc(start_pc, limit_pc, next_frame)
-    CORE_ADDR start_pc, limit_pc;
-    struct frame_info *next_frame;
+heuristic_proc_desc (start_pc, limit_pc, next_frame)
+     CORE_ADDR start_pc, limit_pc;
+     struct frame_info *next_frame;
 {
-    CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
-    CORE_ADDR cur_pc;
-    int frame_size;
-    int has_frame_reg = 0;
-    unsigned long reg_mask = 0;
-    int pcreg = -1;
-
-    if (start_pc == 0)
-      return NULL;
-    memset (&temp_proc_desc, '\0', sizeof(temp_proc_desc));
-    memset (&temp_saved_regs, '\0', sizeof(struct frame_saved_regs));
-    PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
-
-    if (start_pc + 200 < limit_pc)
-      limit_pc = start_pc + 200;
-    frame_size = 0;
-    for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4)
-      {
-        char buf[4];
-       unsigned long word;
-       int status;
+  CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
+  CORE_ADDR cur_pc;
+  int frame_size;
+  int has_frame_reg = 0;
+  unsigned long reg_mask = 0;
+  int pcreg = -1;
+
+  if (start_pc == 0)
+    return NULL;
+  memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
+  memset (&temp_saved_regs, '\0', sizeof (struct frame_saved_regs));
+  PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
+
+  if (start_pc + 200 < limit_pc)
+    limit_pc = start_pc + 200;
+  frame_size = 0;
+  for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4)
+    {
+      char buf[4];
+      unsigned long word;
+      int status;
 
-       status = read_memory_nobpt (cur_pc, buf, 4); 
-       if (status)
-         memory_error (status, cur_pc);
-       word = extract_unsigned_integer (buf, 4);
+      status = read_memory_nobpt (cur_pc, buf, 4);
+      if (status)
+       memory_error (status, cur_pc);
+      word = extract_unsigned_integer (buf, 4);
 
-       if ((word & 0xffff0000) == 0x23de0000)          /* lda $sp,n($sp) */
-         {
-           if (word & 0x8000)
-             frame_size += (-word) & 0xffff;
-           else
-             /* Exit loop if a positive stack adjustment is found, which
-                usually means that the stack cleanup code in the function
-                epilogue is reached.  */
-             break;
-         }
-       else if ((word & 0xfc1f0000) == 0xb41e0000      /* stq reg,n($sp) */
-                && (word & 0xffff0000) != 0xb7fe0000)  /* reg != $zero */
-         {
-           int reg = (word & 0x03e00000) >> 21;
-           reg_mask |= 1 << reg;
-           temp_saved_regs.regs[reg] = sp + (short)word;
-
-           /* Starting with OSF/1-3.2C, the system libraries are shipped
-              without local symbols, but they still contain procedure
-              descriptors without a symbol reference. GDB is currently
-              unable to find these procedure descriptors and uses
-              heuristic_proc_desc instead.
-              As some low level compiler support routines (__div*, __add*)
-              use a non-standard return address register, we have to
-              add some heuristics to determine the return address register,
-              or stepping over these routines will fail.
-              Usually the return address register is the first register
-              saved on the stack, but assembler optimization might
-              rearrange the register saves.
-              So we recognize only a few registers (t7, t9, ra) within
-              the procedure prologue as valid return address registers.
-              If we encounter a return instruction, we extract the
-              the return address register from it.
-
-              FIXME: Rewriting GDB to access the procedure descriptors,
-              e.g. via the minimal symbol table, might obviate this hack.  */
-           if (pcreg == -1
-               && cur_pc < (start_pc + 80)
-               && (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM))
-             pcreg = reg;
-         }
-       else if ((word & 0xffe0ffff) == 0x6be08001)     /* ret zero,reg,1 */
-         pcreg = (word >> 16) & 0x1f;
-       else if (word == 0x47de040f)                    /* bis sp,sp fp */
-         has_frame_reg = 1;
-      }
-    if (pcreg == -1)
-      {
-       /* If we haven't found a valid return address register yet,
-          keep searching in the procedure prologue.  */
-       while (cur_pc < (limit_pc + 80) && cur_pc < (start_pc + 80))
-         {
-           char buf[4];
-           unsigned long word;
+      if ((word & 0xffff0000) == 0x23de0000)   /* lda $sp,n($sp) */
+       {
+         if (word & 0x8000)
+           frame_size += (-word) & 0xffff;
+         else
+           /* Exit loop if a positive stack adjustment is found, which
+              usually means that the stack cleanup code in the function
+              epilogue is reached.  */
+           break;
+       }
+      else if ((word & 0xfc1f0000) == 0xb41e0000       /* stq reg,n($sp) */
+              && (word & 0xffff0000) != 0xb7fe0000)    /* reg != $zero */
+       {
+         int reg = (word & 0x03e00000) >> 21;
+         reg_mask |= 1 << reg;
+         temp_saved_regs.regs[reg] = sp + (short) word;
+
+         /* Starting with OSF/1-3.2C, the system libraries are shipped
+            without local symbols, but they still contain procedure
+            descriptors without a symbol reference. GDB is currently
+            unable to find these procedure descriptors and uses
+            heuristic_proc_desc instead.
+            As some low level compiler support routines (__div*, __add*)
+            use a non-standard return address register, we have to
+            add some heuristics to determine the return address register,
+            or stepping over these routines will fail.
+            Usually the return address register is the first register
+            saved on the stack, but assembler optimization might
+            rearrange the register saves.
+            So we recognize only a few registers (t7, t9, ra) within
+            the procedure prologue as valid return address registers.
+            If we encounter a return instruction, we extract the
+            the return address register from it.
+
+            FIXME: Rewriting GDB to access the procedure descriptors,
+            e.g. via the minimal symbol table, might obviate this hack.  */
+         if (pcreg == -1
+             && cur_pc < (start_pc + 80)
+             && (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM))
+           pcreg = reg;
+       }
+      else if ((word & 0xffe0ffff) == 0x6be08001)      /* ret zero,reg,1 */
+       pcreg = (word >> 16) & 0x1f;
+      else if (word == 0x47de040f)     /* bis sp,sp fp */
+       has_frame_reg = 1;
+    }
+  if (pcreg == -1)
+    {
+      /* If we haven't found a valid return address register yet,
+         keep searching in the procedure prologue.  */
+      while (cur_pc < (limit_pc + 80) && cur_pc < (start_pc + 80))
+       {
+         char buf[4];
+         unsigned long word;
 
-           if (read_memory_nobpt (cur_pc, buf, 4))
-             break;
-           cur_pc += 4;
-           word = extract_unsigned_integer (buf, 4);
+         if (read_memory_nobpt (cur_pc, buf, 4))
+           break;
+         cur_pc += 4;
+         word = extract_unsigned_integer (buf, 4);
 
-           if ((word & 0xfc1f0000) == 0xb41e0000       /* stq reg,n($sp) */
-               && (word & 0xffff0000) != 0xb7fe0000)   /* reg != $zero */
-             {
-               int reg = (word & 0x03e00000) >> 21;
-               if (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM)
-                 {
-                   pcreg = reg;
-                   break;
-                 }
-             }
-           else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */
-             {
-               pcreg = (word >> 16) & 0x1f;
-               break;
-             }
-         }
-      }
+         if ((word & 0xfc1f0000) == 0xb41e0000         /* stq reg,n($sp) */
+             && (word & 0xffff0000) != 0xb7fe0000)     /* reg != $zero */
+           {
+             int reg = (word & 0x03e00000) >> 21;
+             if (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM)
+               {
+                 pcreg = reg;
+                 break;
+               }
+           }
+         else if ((word & 0xffe0ffff) == 0x6be08001)   /* ret zero,reg,1 */
+           {
+             pcreg = (word >> 16) & 0x1f;
+             break;
+           }
+       }
+    }
 
-    if (has_frame_reg)
-      PROC_FRAME_REG(&temp_proc_desc) = GCC_FP_REGNUM;
-    else
-      PROC_FRAME_REG(&temp_proc_desc) = SP_REGNUM;
-    PROC_FRAME_OFFSET(&temp_proc_desc) = frame_size;
-    PROC_REG_MASK(&temp_proc_desc) = reg_mask;
-    PROC_PC_REG(&temp_proc_desc) = (pcreg == -1) ? RA_REGNUM : pcreg;
-    PROC_LOCALOFF(&temp_proc_desc) = 0;        /* XXX - bogus */
-    return &temp_proc_desc;
+  if (has_frame_reg)
+    PROC_FRAME_REG (&temp_proc_desc) = GCC_FP_REGNUM;
+  else
+    PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
+  PROC_FRAME_OFFSET (&temp_proc_desc) = frame_size;
+  PROC_REG_MASK (&temp_proc_desc) = reg_mask;
+  PROC_PC_REG (&temp_proc_desc) = (pcreg == -1) ? RA_REGNUM : pcreg;
+  PROC_LOCALOFF (&temp_proc_desc) = 0; /* XXX - bogus */
+  return &temp_proc_desc;
 }
 
 /* This returns the PC of the first inst after the prologue.  If we can't
@@ -616,7 +629,7 @@ after_prologue (pc, proc_desc)
        return PROC_LOW_ADDR (proc_desc);       /* "prologue" is in kernel */
 
       /* If function is frameless, then we need to do it the hard way.  I
-        strongly suspect that frameless always means prologueless... */
+         strongly suspect that frameless always means prologueless... */
       if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
          && PROC_FRAME_OFFSET (proc_desc) == 0)
        return 0;
@@ -657,8 +670,8 @@ alpha_in_prologue (pc, proc_desc)
 
 static alpha_extra_func_info_t
 find_proc_desc (pc, next_frame)
-    CORE_ADDR pc;
-    struct frame_info *next_frame;
+     CORE_ADDR pc;
+     struct frame_info *next_frame;
 {
   alpha_extra_func_info_t proc_desc;
   struct block *b;
@@ -693,7 +706,7 @@ find_proc_desc (pc, next_frame)
        return found_proc_desc;
     }
 
-  b = block_for_pc(pc);
+  b = block_for_pc (pc);
 
   find_pc_partial_function (pc, NULL, &startaddr, NULL);
   if (b == NULL)
@@ -717,57 +730,57 @@ find_proc_desc (pc, next_frame)
 
   if (sym)
     {
-       /* IF this is the topmost frame AND
-        * (this proc does not have debugging information OR
-        * the PC is in the procedure prologue)
-        * THEN create a "heuristic" proc_desc (by analyzing
-        * the actual code) to replace the "official" proc_desc.
-        */
-       proc_desc = (alpha_extra_func_info_t)SYMBOL_VALUE(sym);
-       if (next_frame == NULL)
-         {
-           if (PROC_DESC_IS_DUMMY (proc_desc) || alpha_in_prologue (pc, proc_desc))
-             {
-               alpha_extra_func_info_t found_heuristic =
-                 heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
-                                      pc, next_frame);
-               if (found_heuristic)
-                 {
-                   PROC_LOCALOFF (found_heuristic) =
-                     PROC_LOCALOFF (proc_desc);
-                   PROC_PC_REG (found_heuristic) = PROC_PC_REG (proc_desc);
-                   proc_desc = found_heuristic;
-                 }
-             }
-         }
+      /* IF this is the topmost frame AND
+       * (this proc does not have debugging information OR
+       * the PC is in the procedure prologue)
+       * THEN create a "heuristic" proc_desc (by analyzing
+       * the actual code) to replace the "official" proc_desc.
+       */
+      proc_desc = (alpha_extra_func_info_t) SYMBOL_VALUE (sym);
+      if (next_frame == NULL)
+       {
+         if (PROC_DESC_IS_DUMMY (proc_desc) || alpha_in_prologue (pc, proc_desc))
+           {
+             alpha_extra_func_info_t found_heuristic =
+             heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
+                                  pc, next_frame);
+             if (found_heuristic)
+               {
+                 PROC_LOCALOFF (found_heuristic) =
+                   PROC_LOCALOFF (proc_desc);
+                 PROC_PC_REG (found_heuristic) = PROC_PC_REG (proc_desc);
+                 proc_desc = found_heuristic;
+               }
+           }
+       }
     }
   else
     {
       long offset;
 
       /* Is linked_proc_desc_table really necessary?  It only seems to be used
-        by procedure call dummys.  However, the procedures being called ought
-        to have their own proc_descs, and even if they don't,
-        heuristic_proc_desc knows how to create them! */
+         by procedure call dummys.  However, the procedures being called ought
+         to have their own proc_descs, and even if they don't,
+         heuristic_proc_desc knows how to create them! */
 
       register struct linked_proc_info *link;
       for (link = linked_proc_desc_table; link; link = link->next)
-         if (PROC_LOW_ADDR(&link->info) <= pc
-             && PROC_HIGH_ADDR(&link->info) > pc)
-             return &link->info;
+       if (PROC_LOW_ADDR (&link->info) <= pc
+           && PROC_HIGH_ADDR (&link->info) > pc)
+         return &link->info;
 
       /* If PC is inside a dynamically generated sigtramp handler,
-        create and push a procedure descriptor for that code: */
+         create and push a procedure descriptor for that code: */
       offset = DYNAMIC_SIGTRAMP_OFFSET (pc);
       if (offset >= 0)
        return push_sigtramp_desc (pc - offset);
 
       /* If heuristic_fence_post is non-zero, determine the procedure
-        start address by examining the instructions.
-        This allows us to find the start address of static functions which
-        have no symbolic information, as startaddr would have been set to
-        the preceding global function start address by the
-        find_pc_partial_function call above.  */
+         start address by examining the instructions.
+         This allows us to find the start address of static functions which
+         have no symbolic information, as startaddr would have been set to
+         the preceding global function start address by the
+         find_pc_partial_function call above.  */
       if (startaddr == 0 || heuristic_fence_post != 0)
        startaddr = heuristic_proc_start (pc);
 
@@ -780,38 +793,38 @@ find_proc_desc (pc, next_frame)
 alpha_extra_func_info_t cached_proc_desc;
 
 CORE_ADDR
-alpha_frame_chain(frame)
-    struct frame_info *frame;
+alpha_frame_chain (frame)
+     struct frame_info *frame;
 {
-    alpha_extra_func_info_t proc_desc;
-    CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
-
-    if (saved_pc == 0 || inside_entry_file (saved_pc))
-      return 0;
-
-    proc_desc = find_proc_desc(saved_pc, frame);
-    if (!proc_desc)
-      return 0;
-
-    cached_proc_desc = proc_desc;
-
-    /* Fetch the frame pointer for a dummy frame from the procedure
-       descriptor.  */
-    if (PROC_DESC_IS_DUMMY(proc_desc))
-      return (CORE_ADDR) PROC_DUMMY_FRAME(proc_desc);
-
-    /* If no frame pointer and frame size is zero, we must be at end
-       of stack (or otherwise hosed).  If we don't check frame size,
-       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)
-      return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc);
-    else
-      return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
-            + PROC_FRAME_OFFSET(proc_desc);
+  alpha_extra_func_info_t proc_desc;
+  CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
+
+  if (saved_pc == 0 || inside_entry_file (saved_pc))
+    return 0;
+
+  proc_desc = find_proc_desc (saved_pc, frame);
+  if (!proc_desc)
+    return 0;
+
+  cached_proc_desc = proc_desc;
+
+  /* Fetch the frame pointer for a dummy frame from the procedure
+     descriptor.  */
+  if (PROC_DESC_IS_DUMMY (proc_desc))
+    return (CORE_ADDR) PROC_DUMMY_FRAME (proc_desc);
+
+  /* If no frame pointer and frame size is zero, we must be at end
+     of stack (or otherwise hosed).  If we don't check frame size,
+     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)
+    return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc);
+  else
+    return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc))
+      + PROC_FRAME_OFFSET (proc_desc);
 }
 
 void
@@ -820,7 +833,7 @@ init_extra_frame_info (frame)
 {
   /* Use proc_desc calculated in frame_chain */
   alpha_extra_func_info_t proc_desc =
-    frame->next ? cached_proc_desc : find_proc_desc(frame->pc, frame->next);
+  frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next);
 
   frame->saved_regs = NULL;
   frame->localoff = 0;
@@ -829,21 +842,21 @@ init_extra_frame_info (frame)
   if (proc_desc)
     {
       /* Get the locals offset and the saved pc register from the
-        procedure descriptor, they are valid even if we are in the
-        middle of the prologue.  */
-      frame->localoff = PROC_LOCALOFF(proc_desc);
-      frame->pc_reg = PROC_PC_REG(proc_desc);
+         procedure descriptor, they are valid even if we are in the
+         middle of the prologue.  */
+      frame->localoff = PROC_LOCALOFF (proc_desc);
+      frame->pc_reg = PROC_PC_REG (proc_desc);
 
       /* Fixup frame-pointer - only needed for top frame */
 
       /* Fetch the frame pointer for a dummy frame from the procedure
-        descriptor.  */
-      if (PROC_DESC_IS_DUMMY(proc_desc))
-       frame->frame = (CORE_ADDR) PROC_DUMMY_FRAME(proc_desc);
+         descriptor.  */
+      if (PROC_DESC_IS_DUMMY (proc_desc))
+       frame->frame = (CORE_ADDR) PROC_DUMMY_FRAME (proc_desc);
 
       /* This may not be quite right, if proc has a real frame register.
-        Get the value of the frame relative sp, procedure might have been
-        interrupted by a signal at it's very start.  */
+         Get the value of the frame relative sp, procedure might have been
+         interrupted by a signal at it's very start.  */
       else if (frame->pc == PROC_LOW_ADDR (proc_desc)
               && !PROC_DESC_IS_DYN_SIGTRAMP (proc_desc))
        frame->frame = read_next_frame_reg (frame->next, SP_REGNUM);
@@ -859,10 +872,10 @@ init_extra_frame_info (frame)
             alpha_find_saved_registers will do that for us.
             We can't use frame->signal_handler_caller, it is not yet set.  */
          find_pc_partial_function (frame->pc, &name,
-                                   (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+                                   (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
          if (!IN_SIGTRAMP (frame->pc, name))
            {
-             frame->saved_regs = (CORE_ADDR*)
+             frame->saved_regs = (CORE_ADDR *)
                frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
              memcpy (frame->saved_regs, temp_saved_regs.regs, SIZEOF_FRAME_SAVED_REGS);
              frame->saved_regs[PC_REGNUM]
@@ -919,9 +932,14 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
   int i;
   int accumulate_size = struct_return ? 8 : 0;
   int arg_regs_size = ALPHA_NUM_ARG_REGS * 8;
-  struct alpha_arg { char *contents; int len; int offset; };
+  struct alpha_arg
+    {
+      char *contents;
+      int len;
+      int offset;
+    };
   struct alpha_arg *alpha_args =
-      (struct alpha_arg*)alloca (nargs * sizeof (struct alpha_arg));
+  (struct alpha_arg *) alloca (nargs * sizeof (struct alpha_arg));
   register struct alpha_arg *m_arg;
   char raw_buffer[sizeof (CORE_ADDR)];
   int required_arg_regs;
@@ -950,7 +968,7 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
       m_arg->len = TYPE_LENGTH (arg_type);
       m_arg->offset = accumulate_size;
       accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
-      m_arg->contents = VALUE_CONTENTS(arg);
+      m_arg->contents = VALUE_CONTENTS (arg);
     }
 
   /* Determine required argument register loads, loading an argument register
@@ -961,15 +979,15 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
 
   /* Make room for the arguments on the stack.  */
   if (accumulate_size < arg_regs_size)
-    accumulate_size = arg_regs_size; 
+    accumulate_size = arg_regs_size;
   sp -= accumulate_size;
 
   /* Keep sp aligned to a multiple of 16 as the compiler does it too.  */
   sp &= ~15;
 
   /* `Push' arguments on the stack.  */
-  for (i = nargs; m_arg--, --i >= 0; )
-    write_memory(sp + m_arg->offset, m_arg->contents, m_arg->len);
+  for (i = nargs; m_arg--, --i >= 0;)
+    write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len);
   if (struct_return)
     {
       store_address (raw_buffer, sizeof (CORE_ADDR), struct_addr);
@@ -990,7 +1008,7 @@ alpha_push_arguments (nargs, args, sp, struct_return, struct_addr)
 }
 
 void
-alpha_push_dummy_frame()
+alpha_push_dummy_frame ()
 {
   int ireg;
   struct linked_proc_info *link;
@@ -1000,10 +1018,10 @@ alpha_push_dummy_frame()
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
   unsigned long mask;
 
-  link = (struct linked_proc_info *) xmalloc(sizeof (struct linked_proc_info));
+  link = (struct linked_proc_info *) xmalloc (sizeof (struct linked_proc_info));
   link->next = linked_proc_desc_table;
   linked_proc_desc_table = link;
+
   proc_desc = &link->info;
 
   /*
@@ -1013,15 +1031,15 @@ alpha_push_dummy_frame()
    *
    * Dummy frame layout:
    *  (high memory)
-   *   Saved PC
+   *    Saved PC
    *    Saved F30
    *    ...
    *    Saved F0
-   *   Saved R29
-   *   ...
-   *   Saved R0
-   *   Saved R26 (RA)
-   *   Parameter build area
+   *    Saved R29
+   *    ...
+   *    Saved R0
+   *    Saved R26 (RA)
+   *    Parameter build area
    *  (low memory)
    */
 
@@ -1035,27 +1053,27 @@ alpha_push_dummy_frame()
      alpha_frame_saved_pc knows where the pc is saved in a dummy frame.  */
 #define SPECIAL_REG_SAVE_COUNT 1
 
-  PROC_REG_MASK(proc_desc) = GEN_REG_SAVE_MASK;
-  PROC_FREG_MASK(proc_desc) = FLOAT_REG_SAVE_MASK;
+  PROC_REG_MASK (proc_desc) = GEN_REG_SAVE_MASK;
+  PROC_FREG_MASK (proc_desc) = FLOAT_REG_SAVE_MASK;
   /* PROC_REG_OFFSET is the offset from the dummy frame to the saved RA,
      but keep SP aligned to a multiple of 16.  */
-  PROC_REG_OFFSET(proc_desc) =
-    - ((8 * (SPECIAL_REG_SAVE_COUNT
+  PROC_REG_OFFSET (proc_desc) =
+    -((8 * (SPECIAL_REG_SAVE_COUNT
            + GEN_REG_SAVE_COUNT
            + FLOAT_REG_SAVE_COUNT)
-       + 15) & ~15);
-  PROC_FREG_OFFSET(proc_desc) =
-    PROC_REG_OFFSET(proc_desc) + 8 * GEN_REG_SAVE_COUNT;
+       + 15) & ~15);
+  PROC_FREG_OFFSET (proc_desc) =
+    PROC_REG_OFFSET (proc_desc) + 8 * GEN_REG_SAVE_COUNT;
 
   /* Save general registers.
      The return address register is the first saved register, all other
      registers follow in ascending order.
      The PC is saved immediately below the SP.  */
-  save_address = sp + PROC_REG_OFFSET(proc_desc);
+  save_address = sp + PROC_REG_OFFSET (proc_desc);
   store_address (raw_buffer, 8, read_register (RA_REGNUM));
   write_memory (save_address, raw_buffer, 8);
   save_address += 8;
-  mask = PROC_REG_MASK(proc_desc) & 0xffffffffL;
+  mask = PROC_REG_MASK (proc_desc) & 0xffffffffL;
   for (ireg = 0; mask; ireg++, mask >>= 1)
     if (mask & 1)
       {
@@ -1070,8 +1088,8 @@ alpha_push_dummy_frame()
   write_memory (sp - 8, raw_buffer, 8);
 
   /* Save floating point registers.  */
-  save_address = sp + PROC_FREG_OFFSET(proc_desc);
-  mask = PROC_FREG_MASK(proc_desc) & 0xffffffffL;
+  save_address = sp + PROC_FREG_OFFSET (proc_desc);
+  mask = PROC_FREG_MASK (proc_desc) & 0xffffffffL;
   for (ireg = 0; mask; ireg++, mask >>= 1)
     if (mask & 1)
       {
@@ -1092,21 +1110,21 @@ alpha_push_dummy_frame()
      is set to the virtual frame (pseudo) register, it's value will always
      be read as zero and will help us to catch any errors in the dummy frame
      retrieval code.  */
-  PROC_DUMMY_FRAME(proc_desc) = sp;
-  PROC_FRAME_REG(proc_desc) = FP_REGNUM;
-  PROC_FRAME_OFFSET(proc_desc) = 0;
-  sp += PROC_REG_OFFSET(proc_desc);
+  PROC_DUMMY_FRAME (proc_desc) = sp;
+  PROC_FRAME_REG (proc_desc) = FP_REGNUM;
+  PROC_FRAME_OFFSET (proc_desc) = 0;
+  sp += PROC_REG_OFFSET (proc_desc);
   write_register (SP_REGNUM, sp);
 
-  PROC_LOW_ADDR(proc_desc) = CALL_DUMMY_ADDRESS ();
-  PROC_HIGH_ADDR(proc_desc) = PROC_LOW_ADDR(proc_desc) + 4;
+  PROC_LOW_ADDR (proc_desc) = CALL_DUMMY_ADDRESS ();
+  PROC_HIGH_ADDR (proc_desc) = PROC_LOW_ADDR (proc_desc) + 4;
 
-  SET_PROC_DESC_IS_DUMMY(proc_desc);
-  PROC_PC_REG(proc_desc) = RA_REGNUM;
+  SET_PROC_DESC_IS_DUMMY (proc_desc);
+  PROC_PC_REG (proc_desc) = RA_REGNUM;
 }
 
 void
-alpha_pop_frame()
+alpha_pop_frame ()
 {
   register int regnum;
   struct frame_info *frame = get_current_frame ();
@@ -1117,31 +1135,31 @@ alpha_pop_frame()
   /* we need proc_desc to know how to restore the registers;
      if it is NULL, construct (a temporary) one */
   if (proc_desc == NULL)
-    proc_desc = find_proc_desc(frame->pc, frame->next);
+    proc_desc = find_proc_desc (frame->pc, frame->next);
 
   /* Question: should we copy this proc_desc and save it in
      frame->proc_desc?  If we do, who will free it?
      For now, we don't save a copy... */
 
-  write_register (PC_REGNUM, FRAME_SAVED_PC(frame));
+  write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
   if (frame->saved_regs == NULL)
     alpha_find_saved_regs (frame);
   if (proc_desc)
     {
-      for (regnum = 32; --regnum >= 0; )
-       if (PROC_REG_MASK(proc_desc) & (1 << regnum))
+      for (regnum = 32; --regnum >= 0;)
+       if (PROC_REG_MASK (proc_desc) & (1 << regnum))
          write_register (regnum,
                          read_memory_integer (frame->saved_regs[regnum],
                                               8));
-      for (regnum = 32; --regnum >= 0; )
-       if (PROC_FREG_MASK(proc_desc) & (1 << regnum))
+      for (regnum = 32; --regnum >= 0;)
+       if (PROC_FREG_MASK (proc_desc) & (1 << regnum))
          write_register (regnum + FP0_REGNUM,
-                         read_memory_integer (frame->saved_regs[regnum + FP0_REGNUM], 8));
+          read_memory_integer (frame->saved_regs[regnum + FP0_REGNUM], 8));
     }
   write_register (SP_REGNUM, new_sp);
   flush_cached_frames ();
 
-  if (proc_desc && (PROC_DESC_IS_DUMMY(proc_desc)
+  if (proc_desc && (PROC_DESC_IS_DUMMY (proc_desc)
                    || PROC_DESC_IS_DYN_SIGTRAMP (proc_desc)))
     {
       struct linked_proc_info *pi_ptr, *prev_ptr;
@@ -1180,74 +1198,74 @@ alpha_skip_prologue (pc, lenient)
      CORE_ADDR pc;
      int lenient;
 {
-    unsigned long inst;
-    int offset;
-    CORE_ADDR post_prologue_pc;
-    char buf[4];
+  unsigned long inst;
+  int offset;
+  CORE_ADDR post_prologue_pc;
+  char buf[4];
 
 #ifdef GDB_TARGET_HAS_SHARED_LIBS
-    /* Silently return the unaltered pc upon memory errors.
-       This could happen on OSF/1 if decode_line_1 tries to skip the
-       prologue for quickstarted shared library functions when the
-       shared library is not yet mapped in.
-       Reading target memory is slow over serial lines, so we perform
-       this check only if the target has shared libraries.  */
-    if (target_read_memory (pc, buf, 4))
-      return pc;
+  /* Silently return the unaltered pc upon memory errors.
+     This could happen on OSF/1 if decode_line_1 tries to skip the
+     prologue for quickstarted shared library functions when the
+     shared library is not yet mapped in.
+     Reading target memory is slow over serial lines, so we perform
+     this check only if the target has shared libraries.  */
+  if (target_read_memory (pc, buf, 4))
+    return pc;
 #endif
 
-    /* See if we can determine the end of the prologue via the symbol table.
-       If so, then return either PC, or the PC after the prologue, whichever
-       is greater.  */
-
-    post_prologue_pc = after_prologue (pc, NULL);
+  /* See if we can determine the end of the prologue via the symbol table.
+     If so, then return either PC, or the PC after the prologue, whichever
+     is greater.  */
 
-    if (post_prologue_pc != 0)
-      return max (pc, post_prologue_pc);
+  post_prologue_pc = after_prologue (pc, NULL);
 
-    /* Can't determine prologue from the symbol table, need to examine
-       instructions.  */
+  if (post_prologue_pc != 0)
+    return max (pc, post_prologue_pc);
 
-    /* Skip the typical prologue instructions. These are the stack adjustment
-       instruction and the instructions that save registers on the stack
-       or in the gcc frame.  */
-    for (offset = 0; offset < 100; offset += 4)
-      {
-       int status;
+  /* Can't determine prologue from the symbol table, need to examine
+     instructions.  */
 
-       status = read_memory_nobpt (pc + offset, buf, 4);
-       if (status)
-         memory_error (status, pc + offset);
-       inst = extract_unsigned_integer (buf, 4);
-
-       /* The alpha has no delay slots. But let's keep the lenient stuff,
-          we might need it for something else in the future.  */
-       if (lenient && 0)
-         continue;
-
-       if ((inst & 0xffff0000) == 0x27bb0000)  /* ldah $gp,n($t12) */
-           continue;
-       if ((inst & 0xffff0000) == 0x23bd0000)  /* lda $gp,n($gp) */
-           continue;
-       if ((inst & 0xffff0000) == 0x23de0000)  /* lda $sp,n($sp) */
-           continue;
-       if ((inst & 0xffe01fff) == 0x43c0153e)  /* subq $sp,n,$sp */
-           continue;
-
-       if ((inst & 0xfc1f0000) == 0xb41e0000
-           && (inst & 0xffff0000) != 0xb7fe0000)
-           continue;                           /* stq reg,n($sp) */
-                                               /* reg != $zero */
-       if ((inst & 0xfc1f0000) == 0x9c1e0000
-           && (inst & 0xffff0000) != 0x9ffe0000)
-           continue;                           /* stt reg,n($sp) */
-                                               /* reg != $zero */
-       if (inst == 0x47de040f)                 /* bis sp,sp,fp */
-           continue;
-
-       break;
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (offset = 0; offset < 100; offset += 4)
+    {
+      int status;
+
+      status = read_memory_nobpt (pc + offset, buf, 4);
+      if (status)
+       memory_error (status, pc + offset);
+      inst = extract_unsigned_integer (buf, 4);
+
+      /* The alpha has no delay slots. But let's keep the lenient stuff,
+         we might need it for something else in the future.  */
+      if (lenient && 0)
+       continue;
+
+      if ((inst & 0xffff0000) == 0x27bb0000)   /* ldah $gp,n($t12) */
+       continue;
+      if ((inst & 0xffff0000) == 0x23bd0000)   /* lda $gp,n($gp) */
+       continue;
+      if ((inst & 0xffff0000) == 0x23de0000)   /* lda $sp,n($sp) */
+       continue;
+      if ((inst & 0xffe01fff) == 0x43c0153e)   /* subq $sp,n,$sp */
+       continue;
+
+      if ((inst & 0xfc1f0000) == 0xb41e0000
+         && (inst & 0xffff0000) != 0xb7fe0000)
+       continue;               /* stq reg,n($sp) */
+      /* reg != $zero */
+      if ((inst & 0xfc1f0000) == 0x9c1e0000
+         && (inst & 0xffff0000) != 0x9ffe0000)
+       continue;               /* stt reg,n($sp) */
+      /* reg != $zero */
+      if (inst == 0x47de040f)  /* bis sp,sp,fp */
+       continue;
+
+      break;
     }
-    return pc + offset;
+  return pc + offset;
 }
 
 #if 0
@@ -1266,16 +1284,16 @@ alpha_in_lenient_prologue (startaddr, pc)
 
 /* The alpha needs a conversion between register and memory format if
    the register is a floating point register and
-      memory format is float, as the register format must be double
+   memory format is float, as the register format must be double
    or
-      memory format is an integer with 4 bytes or less, as the representation
-      of integers in floating point registers is different. */
+   memory format is an integer with 4 bytes or less, as the representation
+   of integers in floating point registers is different. */
 void
 alpha_register_convert_to_virtual (regnum, valtype, raw_buffer, virtual_buffer)
-    int regnum;
-    struct type *valtype;
-    char *raw_buffer;
-    char *virtual_buffer;
+     int regnum;
+     struct type *valtype;
+     char *raw_buffer;
+     char *virtual_buffer;
 {
   if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum))
     {
@@ -1301,10 +1319,10 @@ alpha_register_convert_to_virtual (regnum, valtype, raw_buffer, virtual_buffer)
 
 void
 alpha_register_convert_to_raw (valtype, regnum, virtual_buffer, raw_buffer)
-    struct type *valtype;
-    int regnum;
-    char *virtual_buffer;
-    char *raw_buffer;
+     struct type *valtype;
+     int regnum;
+     char *virtual_buffer;
+     char *raw_buffer;
 {
   if (TYPE_LENGTH (valtype) >= REGISTER_RAW_SIZE (regnum))
     {
@@ -1336,9 +1354,9 @@ alpha_register_convert_to_raw (valtype, regnum, virtual_buffer, raw_buffer)
 
 void
 alpha_extract_return_value (valtype, regbuf, valbuf)
-    struct type *valtype;
-    char regbuf[REGISTER_BYTES];
-    char *valbuf;
+     struct type *valtype;
+     char regbuf[REGISTER_BYTES];
+     char *valbuf;
 {
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     alpha_register_convert_to_virtual (FP0_REGNUM, valtype,
@@ -1353,13 +1371,13 @@ alpha_extract_return_value (valtype, regbuf, valbuf)
 
 void
 alpha_store_return_value (valtype, valbuf)
-    struct type *valtype;
-    char *valbuf;
+     struct type *valtype;
+     char *valbuf;
 {
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
   int regnum = V0_REGNUM;
   int length = TYPE_LENGTH (valtype);
-  
+
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     {
       regnum = FP0_REGNUM;
index 0704ddd5a299c1e82fc9066b53b15432af32086a..bc7245a9352277e22037250e3f7fd5e34f7a0986 100644 (file)
@@ -40,7 +40,7 @@
 /* OBSOLETE #endif */
 /* OBSOLETE  */
 /* OBSOLETE #include "gdbcore.h" */
-/* OBSOLETE #include <sys/user.h>              /* After a.out.h  *x/ */
+/* OBSOLETE #include <sys/user.h>               /* After a.out.h  *x/ */
 /* OBSOLETE #include <sys/file.h> */
 /* OBSOLETE #include "gdb_stat.h" */
 /* OBSOLETE  */
 /* OBSOLETE       make_cleanup (free, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
-/* OBSOLETE    error ("To look at a core file, you must kill the program with \"kill\"."); */
+/* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
 /* OBSOLETE       corechan = open (filename, O_RDONLY, 0); */
 /* OBSOLETE       if (corechan < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       /* 4.2-style (and perhaps also sysV-style) core dump file.  *x/ */
 /* OBSOLETE       { */
-/* OBSOLETE    struct user u; */
+/* OBSOLETE     struct user u; */
 /* OBSOLETE  */
-/* OBSOLETE    unsigned int reg_offset; */
+/* OBSOLETE     unsigned int reg_offset; */
 /* OBSOLETE  */
-/* OBSOLETE    val = myread (corechan, &u, sizeof u); */
-/* OBSOLETE    if (val < 0) */
-/* OBSOLETE      perror_with_name ("Not a core file: reading upage"); */
-/* OBSOLETE    if (val != sizeof u) */
-/* OBSOLETE      error ("Not a core file: could only read %d bytes", val); */
-/* OBSOLETE    data_start = exec_data_start; */
+/* OBSOLETE     val = myread (corechan, &u, sizeof u); */
+/* OBSOLETE     if (val < 0) */
+/* OBSOLETE       perror_with_name ("Not a core file: reading upage"); */
+/* OBSOLETE     if (val != sizeof u) */
+/* OBSOLETE       error ("Not a core file: could only read %d bytes", val); */
+/* OBSOLETE     data_start = exec_data_start; */
 /* OBSOLETE  */
 /* OBSOLETE #if !defined (NBPG) */
 /* OBSOLETE #define NBPG NBPP */
 /* OBSOLETE #define UPAGES USIZE */
 /* OBSOLETE #endif */
 /* OBSOLETE  */
-/* OBSOLETE    data_end = data_start + NBPG * u.u_dsize; */
-/* OBSOLETE    stack_start = stack_end - NBPG * u.u_ssize; */
-/* OBSOLETE    data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp *x/; */
-/* OBSOLETE    stack_offset = NBPG * (UPAGES + u.u_dsize); */
-/* OBSOLETE  */
-/* OBSOLETE    /* Some machines put an absolute address in here and some put */
-/* OBSOLETE       the offset in the upage of the regs.  *x/ */
-/* OBSOLETE    reg_offset = (int) u.u_state; */
-/* OBSOLETE    if (reg_offset > NBPG * UPAGES) */
-/* OBSOLETE      reg_offset -= KERNEL_U_ADDR; */
-/* OBSOLETE  */
-/* OBSOLETE    memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR)); */
-/* OBSOLETE    printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm); */
-/* OBSOLETE  */
-/* OBSOLETE    /* I don't know where to find this info. */
-/* OBSOLETE       So, for now, mark it as not available.  *x/ */
-/* OBSOLETE    N_SET_MAGIC (core_aouthdr, 0); */
-/* OBSOLETE  */
-/* OBSOLETE    /* Read the register values out of the core file and store */
-/* OBSOLETE       them where `read_register' will find them.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE    { */
-/* OBSOLETE      register int regno; */
-/* OBSOLETE  */
-/* OBSOLETE      for (regno = 0; regno < NUM_REGS; regno++) */
-/* OBSOLETE        { */
-/* OBSOLETE          char buf[MAX_REGISTER_RAW_SIZE]; */
-/* OBSOLETE  */
-/* OBSOLETE          val = lseek (corechan, register_addr (regno, reg_offset), 0); */
-/* OBSOLETE          if (val < 0 */
-/* OBSOLETE              || (val = myread (corechan, buf, sizeof buf)) < 0) */
-/* OBSOLETE            { */
-/* OBSOLETE              char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
-/* OBSOLETE                                               + 30); */
-/* OBSOLETE              strcpy (buffer, "Reading register "); */
-/* OBSOLETE              strcat (buffer, REGISTER_NAME (regno)); */
-/* OBSOLETE                                                */
-/* OBSOLETE              perror_with_name (buffer); */
-/* OBSOLETE            } */
-/* OBSOLETE  */
-/* OBSOLETE          supply_register (regno, buf); */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE     data_end = data_start + NBPG * u.u_dsize; */
+/* OBSOLETE     stack_start = stack_end - NBPG * u.u_ssize; */
+/* OBSOLETE     data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp *x/; */
+/* OBSOLETE     stack_offset = NBPG * (UPAGES + u.u_dsize); */
+/* OBSOLETE  */
+/* OBSOLETE     /* Some machines put an absolute address in here and some put */
+/* OBSOLETE        the offset in the upage of the regs.  *x/ */
+/* OBSOLETE     reg_offset = (int) u.u_state; */
+/* OBSOLETE     if (reg_offset > NBPG * UPAGES) */
+/* OBSOLETE       reg_offset -= KERNEL_U_ADDR; */
+/* OBSOLETE  */
+/* OBSOLETE     memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR)); */
+/* OBSOLETE     printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm); */
+/* OBSOLETE  */
+/* OBSOLETE     /* I don't know where to find this info. */
+/* OBSOLETE        So, for now, mark it as not available.  *x/ */
+/* OBSOLETE     N_SET_MAGIC (core_aouthdr, 0); */
+/* OBSOLETE  */
+/* OBSOLETE     /* Read the register values out of the core file and store */
+/* OBSOLETE        them where `read_register' will find them.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE     { */
+/* OBSOLETE       register int regno; */
+/* OBSOLETE  */
+/* OBSOLETE       for (regno = 0; regno < NUM_REGS; regno++) */
+/* OBSOLETE         { */
+/* OBSOLETE           char buf[MAX_REGISTER_RAW_SIZE]; */
+/* OBSOLETE  */
+/* OBSOLETE           val = lseek (corechan, register_addr (regno, reg_offset), 0); */
+/* OBSOLETE           if (val < 0 */
+/* OBSOLETE               || (val = myread (corechan, buf, sizeof buf)) < 0) */
+/* OBSOLETE             { */
+/* OBSOLETE               char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
+/* OBSOLETE                                                + 30); */
+/* OBSOLETE               strcpy (buffer, "Reading register "); */
+/* OBSOLETE               strcat (buffer, REGISTER_NAME (regno)); */
+/* OBSOLETE                                                 */
+/* OBSOLETE               perror_with_name (buffer); */
+/* OBSOLETE             } */
+/* OBSOLETE  */
+/* OBSOLETE           supply_register (regno, buf); */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE       } */
 /* OBSOLETE       if (filename[0] == '/') */
-/* OBSOLETE    corefile = savestring (filename, strlen (filename)); */
+/* OBSOLETE     corefile = savestring (filename, strlen (filename)); */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      corefile = concat (current_directory, "/", filename, NULL); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       corefile = concat (current_directory, "/", filename, NULL); */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       flush_cached_frames (); */
 /* OBSOLETE       select_frame (get_current_frame (), 0); */
index 3b4ab3c841117ce2de43b22d6d61ae0469f7540c..1c235a568e526cf75dd29f1177eca24606b1be60 100644 (file)
@@ -1,21 +1,22 @@
 /* Annotation routines for GDB.
    Copyright 1986, 89, 90, 91, 92, 95, 98, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "annotate.h"
@@ -92,9 +93,9 @@ annotate_starting ()
   else
     {
       if (annotation_level > 1)
-        {
-          printf_filtered ("\n\032\032starting\n");
-        }
+       {
+         printf_filtered ("\n\032\032starting\n");
+       }
     }
 }
 
@@ -106,7 +107,7 @@ annotate_stopped ()
   else
     {
       if (annotation_level > 1)
-        printf_filtered ("\n\032\032stopped\n");
+       printf_filtered ("\n\032\032stopped\n");
     }
 }
 
@@ -119,7 +120,7 @@ annotate_exited (exitstatus)
   else
     {
       if (annotation_level > 1)
-        printf_filtered ("\n\032\032exited %d\n", exitstatus);
+       printf_filtered ("\n\032\032exited %d\n", exitstatus);
     }
 }
 
index 406ee041386909c6d9f5881a4c446c15935e2c2a..1a509b16f176a54f0eab4a5dfed9773eb24ca2eb 100644 (file)
@@ -1,21 +1,22 @@
 /* Annotation routines for GDB.
    Copyright 1986, 1989, 1990, 1991, 1992, 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.  */
+   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 "symtab.h"
 #include "gdbtypes.h"
index 16e259b87ca076a29d6f9b5ee637539ff5dc712e..6e0cf8dc2aefe6c02bd0add5e1dacbf8c738a7a7 100644 (file)
@@ -1,21 +1,22 @@
 /* ARC target-dependent stuff.
    Copyright (C) 1995, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -32,12 +33,20 @@ char *arc_cpu_type;
 char *tmp_arc_cpu_type;
 
 /* Table of cpu names.  */
-struct {
-  char *name;
-  int value;
-} arc_cpu_type_table[] = {
-  { "base", bfd_mach_arc_base },
-  { NULL, 0 }
+struct
+  {
+    char *name;
+    int value;
+  }
+arc_cpu_type_table[] =
+{
+  {
+    "base", bfd_mach_arc_base
+  }
+  ,
+  {
+    NULL, 0
+  }
 };
 
 /* Used by simulator.  */
@@ -81,7 +90,7 @@ static void codestream_read PARAMS ((unsigned int *, int));
 static void codestream_seek PARAMS ((CORE_ADDR));
 static unsigned int codestream_fill PARAMS ((int));
 
-#define CODESTREAM_BUFSIZ 16 
+#define CODESTREAM_BUFSIZ 16
 static CORE_ADDR codestream_next_addr;
 static CORE_ADDR codestream_addr;
 static unsigned int codestream_buf[CODESTREAM_BUFSIZ];
@@ -99,9 +108,9 @@ static int codestream_cnt;
    ? codestream_fill (0) \
    : codestream_buf[codestream_off++])
 
-static unsigned int 
+static unsigned int
 codestream_fill (peek_flag)
-    int peek_flag;
+     int peek_flag;
 {
   codestream_addr = codestream_next_addr;
   codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]);
@@ -121,7 +130,7 @@ codestream_fill (peek_flag)
        for (j = 0; j < n / 2; ++j)
          tmp = p[j], p[j] = p[n - 1 - j], p[n - 1 - j] = tmp;
     }
-  
+
   if (peek_flag)
     return codestream_peek ();
   else
@@ -130,7 +139,7 @@ codestream_fill (peek_flag)
 
 static void
 codestream_seek (place)
-    CORE_ADDR place;
+     CORE_ADDR place;
 {
   codestream_next_addr = place / CODESTREAM_BUFSIZ;
   codestream_next_addr *= CODESTREAM_BUFSIZ;
@@ -203,16 +212,16 @@ arc_get_frame_setup (pc)
     {
       insn = codestream_get ();
       /* Frame may not be necessary, even though blink is saved.
-        At least this is something we recognize.  */
+         At least this is something we recognize.  */
       frame_size = 0;
     }
 
-  if ((insn & BUILD_INSN (-1, 0, -1, -1, -1))          /* st fp,[sp] */
+  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))
+         != BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0))
        return -1;
 
       /* Check for stack adjustment sub sp,sp,N.  */
@@ -229,7 +238,7 @@ arc_get_frame_setup (pc)
          if (frame_size < 0)
            return -1;
 
-          codestream_get ();
+         codestream_get ();
 
          /* This sequence is used to get the address of the return
             buffer for a function that returns a structure.  */
@@ -283,8 +292,8 @@ arc_skip_prologue (pc, frameless_p)
       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;                  /* not st insn */
+      if (!ARC_CALL_SAVED_REG (X_C (insn)))
        break;
       codestream_get ();
     }
@@ -360,11 +369,11 @@ frame_find_saved_regs (fip, fsrp)
   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) 
+  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++) 
+      for (i = 0; i < NUM_REGS; i++)
        {
          adr -= REGISTER_RAW_SIZE (i);
          fsrp->regs[i] = adr;
@@ -374,7 +383,7 @@ frame_find_saved_regs (fip, fsrp)
 
   locals = arc_get_frame_setup (get_pc_function_start (fip->pc));
 
-  if (locals >= 0) 
+  if (locals >= 0)
     {
       /* Set `adr' to the value of `sp'.  */
       adr = fip->frame - locals;
@@ -382,9 +391,9 @@ frame_find_saved_regs (fip, fsrp)
        {
          insn = codestream_get ();
          if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
-              != BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
+             != BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
            break;
-          regnum = X_C (insn);
+         regnum = X_C (insn);
          offset = X_D (insn);
          fsrp->regs[regnum] = adr + offset;
        }
@@ -402,7 +411,7 @@ push_dummy_frame ()
   char regbuf[MAX_REGISTER_RAW_SIZE];
 
   read_register_gen (PC_REGNUM, regbuf);
-  write_memory (sp+4, regbuf, REGISTER_SIZE);
+  write_memory (sp + 4, regbuf, REGISTER_SIZE);
   read_register_gen (FP_REGNUM, regbuf);
   write_memory (sp, regbuf, REGISTER_SIZE);
   write_register (FP_REGNUM, sp);
@@ -411,7 +420,7 @@ push_dummy_frame ()
       read_register_gen (regnum, regbuf);
       sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
     }
-  sp += (2*REGISTER_SIZE);
+  sp += (2 * REGISTER_SIZE);
   write_register (SP_REGNUM, sp);
 }
 
@@ -423,10 +432,10 @@ pop_frame ()
   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++) 
+  for (regnum = 0; regnum < NUM_REGS; regnum++)
     {
       CORE_ADDR adr;
       adr = fsr.regs[regnum];
@@ -447,11 +456,12 @@ pop_frame ()
 
 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;
+  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.  */
@@ -466,26 +476,30 @@ get_insn_type (insn, pc, target)
 
   switch (insn >> 27)
     {
-    case 0 : case 1 : case 2 : /* load/store insns */
+    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 */
+    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!  */
+         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 */
+    case 7:                    /* jump insns */
       if (LIMM_P (X_B (insn)))
        {
          limm = read_memory_integer (pc + 4, 4);
@@ -499,7 +513,7 @@ get_insn_type (insn, pc, target)
       if (X_Q (insn) == 0 && X_N (insn) == 0)
        return BRANCH4;
       return BRANCH8;
-    default : /* arithmetic insns, etc. */
+    default:                   /* arithmetic insns, etc. */
       if (LIMM_P (X_A (insn))
          || LIMM_P (X_B (insn))
          || LIMM_P (X_C (insn)))
@@ -518,7 +532,7 @@ get_insn_type (insn, pc, target)
 
 void
 arc_software_single_step (ignore, insert_breakpoints_p)
-     enum target_signal ignore; /* sig but we don't need it */
+     enum target_signal ignore;        /* sig but we don't need it */
      int insert_breakpoints_p;
 {
   static CORE_ADDR next_pc, target;
@@ -543,10 +557,10 @@ arc_software_single_step (ignore, insert_breakpoints_p)
       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.  */
+      /* 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;
@@ -575,7 +589,7 @@ arc_software_single_step (ignore, insert_breakpoints_p)
    This routine returns true on success. */
 
 int
-get_longjmp_target(pc)
+get_longjmp_target (pc)
      CORE_ADDR *pc;
 {
   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
@@ -583,7 +597,7 @@ get_longjmp_target(pc)
 
   sp = read_register (SP_REGNUM);
 
-  if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
+  if (target_read_memory (sp + SP_ARG0,                /* Offset of first arg on stack */
                          buf,
                          TARGET_PTR_BIT / TARGET_CHAR_BIT))
     return 0;
@@ -644,7 +658,7 @@ arc_set_cpu_type_command (args, from_tty)
 
       return;
     }
-  
+
   if (!arc_set_cpu_type (tmp_arc_cpu_type))
     {
       error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);
index 70db37eceb1ccbc4f81563a826f5c75032b2fad3..eb760af3c65350cd14759d23aac964111b098210 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1988, 1989, 1991, 1992, 1993, 1995-1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -28,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "coff/internal.h"     /* Internal format of COFF symbols in BFD */
 
 /*
-  The following macros are actually wrong.  Neither arm nor thumb can
-  or should set the lsb on addr.
-  The thumb addresses are mod 2, so (addr & 2) would be a good heuristic
-  to use when checking for thumb (see arm_pc_is_thumb() below).
-  Unfortunately, something else depends on these (incorrect) macros, so
-  fixing them actually breaks gdb.  I didn't have time to investigate. Z.R.
-*/
+   The following macros are actually wrong.  Neither arm nor thumb can
+   or should set the lsb on addr.
+   The thumb addresses are mod 2, so (addr & 2) would be a good heuristic
+   to use when checking for thumb (see arm_pc_is_thumb() below).
+   Unfortunately, something else depends on these (incorrect) macros, so
+   fixing them actually breaks gdb.  I didn't have time to investigate. Z.R.
+ */
 /* Thumb function addresses are odd (bit 0 is set).  Here are some
    macros to test, set, or clear bit 0 of addresses.  */
 #define IS_THUMB_ADDR(addr)    ((addr) & 1)
@@ -47,25 +48,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define ROUND_UP(n,a)          (((n) + (a) - 1) & ~((a) - 1))
 
 static char *APCS_register_names[] =
-{ "a1", "a2", "a3", "a4", /*  0  1  2  3 */
 "v1", "v2", "v3", "v4", /*  4  5  6  7 */
 "v5", "v6", "sl", "fp", /*  8  9 10 11 */
 "ip", "sp", "lr", "pc", /* 12 13 14 15 */
 "f0", "f1", "f2", "f3", /* 16 17 18 19 */
 "f4", "f5", "f6", "f7", /* 20 21 22 23 */
 "fps","ps" }            /* 24 25       */;
+{"a1", "a2", "a3", "a4",       /*  0  1  2  3 */
"v1", "v2", "v3", "v4",       /*  4  5  6  7 */
"v5", "v6", "sl", "fp",       /*  8  9 10 11 */
"ip", "sp", "lr", "pc",       /* 12 13 14 15 */
"f0", "f1", "f2", "f3",       /* 16 17 18 19 */
"f4", "f5", "f6", "f7",       /* 20 21 22 23 */
"fps", "ps"} /* 24 25       */ ;
 
 /* These names are the ones which gcc emits, and 
    I find them less confusing.  Toggle between them
    using the `othernames' command. */
 static char *additional_register_names[] =
-{ "r0", "r1", "r2", "r3", /*  0  1  2  3 */
 "r4", "r5", "r6", "r7",    /*  4  5  6  7 */
 "r8", "r9", "r10", "r11",  /*  8  9 10 11 */
 "r12", "r13", "r14", "pc", /* 12 13 14 15 */
 "f0", "f1", "f2", "f3",    /* 16 17 18 19 */
 "f4", "f5", "f6", "f7",    /* 20 21 22 23 */
 "fps","ps" }               /* 24 25       */;
+{"r0", "r1", "r2", "r3",       /*  0  1  2  3 */
"r4", "r5", "r6", "r7",       /*  4  5  6  7 */
"r8", "r9", "r10", "r11",     /*  8  9 10 11 */
"r12", "r13", "r14", "pc",    /* 12 13 14 15 */
"f0", "f1", "f2", "f3",       /* 16 17 18 19 */
"f4", "f5", "f6", "f7",       /* 20 21 22 23 */
"fps", "ps"} /* 24 25       */ ;
 
 /* By default use the APCS registers names */
 
@@ -86,7 +87,7 @@ arm_frame_chain_valid (chain, thisframe)
      CORE_ADDR chain;
      struct frame_info *thisframe;
 {
-#define LOWEST_PC 0x20  /* the first 0x20 bytes are the trap vectors. */
+#define LOWEST_PC 0x20         /* the first 0x20 bytes are the trap vectors. */
   return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC));
 }
 
@@ -113,7 +114,7 @@ int
 arm_pc_is_thumb (memaddr)
      bfd_vma memaddr;
 {
-  struct minimal_symbol * sym;
+  struct minimal_symbol *sym;
   CORE_ADDR sp;
 
   /* If bit 0 of the address is set, assume this is a Thumb address. */
@@ -124,7 +125,7 @@ arm_pc_is_thumb (memaddr)
   sym = lookup_minimal_symbol_by_pc (memaddr);
   if (sym)
     {
-      return (MSYMBOL_IS_SPECIAL(sym));
+      return (MSYMBOL_IS_SPECIAL (sym));
     }
   else
     return 0;
@@ -137,9 +138,9 @@ int
 arm_pc_is_thumb_dummy (memaddr)
      bfd_vma memaddr;
 {
-  CORE_ADDR sp = read_sp();
+  CORE_ADDR sp = read_sp ();
 
-  if (PC_IN_CALL_DUMMY (memaddr, sp, sp+64))
+  if (PC_IN_CALL_DUMMY (memaddr, sp, sp + 64))
     return caller_is_thumb;
   else
     return 0;
@@ -176,12 +177,12 @@ arm_frameless_function_invocation (fi)
 }
 
 /* A typical Thumb prologue looks like this:
-        push    {r7, lr}
-        add     sp, sp, #-28
-        add     r7, sp, #12
+   push    {r7, lr}
+   add     sp, sp, #-28
+   add     r7, sp, #12
    Sometimes the latter instruction may be replaced by:
-        mov     r7, sp 
-*/
+   mov     r7, sp 
+ */
 
 static CORE_ADDR
 thumb_skip_prologue (pc)
@@ -193,10 +194,10 @@ thumb_skip_prologue (pc)
     {
       unsigned short insn = read_memory_unsigned_integer (current_pc, 2);
 
-      if (   (insn & 0xfe00) != 0xb400         /* push {..., r7, lr} */
-         && (insn & 0xff00) != 0xb000          /* add sp, #simm */
-         && (insn & 0xff00) != 0xaf00          /* add r7, sp, #imm */
-         && insn != 0x466f                     /* mov r7, sp */
+      if ((insn & 0xfe00) != 0xb400    /* push {..., r7, lr} */
+         && (insn & 0xff00) != 0xb000  /* add sp, #simm */
+         && (insn & 0xff00) != 0xaf00  /* add r7, sp, #imm */
+         && insn != 0x466f     /* mov r7, sp */
          && (insn & 0xffc0) != 0x4640)         /* mov r0-r7, r8-r15 */
        break;
     }
@@ -206,15 +207,15 @@ thumb_skip_prologue (pc)
 
 /* APCS (ARM procedure call standard) defines the following prologue:
 
-   mov         ip, sp
-  [stmfd       sp!, {a1,a2,a3,a4}]
-   stmfd       sp!, {...,fp,ip,lr,pc}
-  [stfe                f7, [sp, #-12]!]
-  [stfe                f6, [sp, #-12]!]
-  [stfe                f5, [sp, #-12]!]
-  [stfe                f4, [sp, #-12]!]
-   sub         fp, ip, #nn     // nn == 20 or 4 depending on second ins
-*/
+   mov          ip, sp
+   [stmfd       sp!, {a1,a2,a3,a4}]
+   stmfd        sp!, {...,fp,ip,lr,pc}
+   [stfe                f7, [sp, #-12]!]
+   [stfe                f6, [sp, #-12]!]
+   [stfe                f5, [sp, #-12]!]
+   [stfe                f4, [sp, #-12]!]
+   sub          fp, ip, #nn     // nn == 20 or 4 depending on second ins
+ */
 
 CORE_ADDR
 arm_skip_prologue (pc)
@@ -226,7 +227,7 @@ arm_skip_prologue (pc)
   struct symtab_and_line sal;
 
   /* See what the symbol table says. */
-  if (find_pc_partial_function (pc, NULL, & func_addr, & func_end))
+  if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
     {
       sal = find_pc_line (func_addr, 0);
       if (sal.line != 0 && sal.end < func_end)
@@ -241,18 +242,18 @@ arm_skip_prologue (pc)
      by disassembling the instructions. */
   skip_pc = pc;
   inst = read_memory_integer (skip_pc, 4);
-  if (inst != 0xe1a0c00d)  /* mov ip, sp */
+  if (inst != 0xe1a0c00d)      /* mov ip, sp */
     return pc;
 
   skip_pc += 4;
   inst = read_memory_integer (skip_pc, 4);
-  if ((inst & 0xfffffff0) == 0xe92d0000)  /* stmfd sp!,{a1,a2,a3,a4}  */
+  if ((inst & 0xfffffff0) == 0xe92d0000)       /* stmfd sp!,{a1,a2,a3,a4}  */
     {
       skip_pc += 4;
       inst = read_memory_integer (skip_pc, 4);
     }
 
-  if ((inst & 0xfffff800) != 0xe92dd800)  /* stmfd sp!,{...,fp,ip,lr,pc} */
+  if ((inst & 0xfffff800) != 0xe92dd800)       /* stmfd sp!,{...,fp,ip,lr,pc} */
     return pc;
 
   skip_pc += 4;
@@ -264,28 +265,26 @@ arm_skip_prologue (pc)
 
   /* We may have either one sfmfd instruction here, or several stfe insns,
      depending on the version of floating point code we support.  */
-  if ((inst & 0xffbf0fff) == 0xec2d0200)  /* sfmfd fn, <cnt>, [sp]! */
+  if ((inst & 0xffbf0fff) == 0xec2d0200)       /* sfmfd fn, <cnt>, [sp]! */
     {
       skip_pc += 4;
       inst = read_memory_integer (skip_pc, 4);
     }
   else
     {
-      while ((inst & 0xffff8fff) == 0xed6d0103) /* stfe fn, [sp, #-12]! */
-        {
-          skip_pc += 4;
-          inst = read_memory_integer (skip_pc, 4);
-        }
+      while ((inst & 0xffff8fff) == 0xed6d0103)                /* stfe fn, [sp, #-12]! */
+       {
+         skip_pc += 4;
+         inst = read_memory_integer (skip_pc, 4);
+       }
     }
 
-  if ((inst & 0xfffff000) == 0xe24cb000) /* sub fp, ip, #nn */
+  if ((inst & 0xfffff000) == 0xe24cb000)       /* sub fp, ip, #nn */
     skip_pc += 4;
 
   return skip_pc;
 }
-
-
-
+/* *INDENT-OFF* */
 /* Function: thumb_scan_prologue (helper function for arm_scan_prologue)
    This function decodes a Thumb function prologue to determine:
      1) the size of the stack frame
@@ -306,29 +305,33 @@ arm_skip_prologue (pc)
      SP ->     -12  additional stack space (12 bytes)
    The frame size would thus be 36 bytes, and the frame offset would be
    12 bytes.  The frame register is R7.  */
-       
+/* *INDENT-ON* */
+
+
+
+
 static void
 thumb_scan_prologue (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   CORE_ADDR prologue_start;
   CORE_ADDR prologue_end;
   CORE_ADDR current_pc;
-  int       saved_reg[16];     /* which register has been copied to register n? */
-  int       i;
+  int saved_reg[16];           /* which register has been copied to register n? */
+  int i;
 
-  if (find_pc_partial_function (fi->pc, NULL, & prologue_start, & prologue_end))
+  if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end))
     {
       struct symtab_and_line sal = find_pc_line (prologue_start, 0);
 
-      if (sal.line == 0)               /* no line info, use current PC */
+      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)  */
+       prologue_end = sal.end; /* (probably means no prologue)  */
     }
   else
-    prologue_end = prologue_start + 40; /* We're in the boondocks: allow for */
-                                       /* 16 pushes, an add, and "mv fp,sp" */
+    prologue_end = prologue_start + 40;                /* We're in the boondocks: allow for */
+  /* 16 pushes, an add, and "mv fp,sp" */
 
   prologue_end = min (prologue_end, fi->pc);
 
@@ -349,7 +352,7 @@ thumb_scan_prologue (fi)
 
       insn = read_memory_unsigned_integer (current_pc, 2);
 
-      if ((insn & 0xfe00) == 0xb400)           /* push { rlist } */
+      if ((insn & 0xfe00) == 0xb400)   /* push { rlist } */
        {
          /* Bits 0-7 contain a mask for registers R0-R7.  Bit 8 says
             whether to save LR (R14).  */
@@ -358,7 +361,7 @@ thumb_scan_prologue (fi)
          /* Calculate offsets of saved R0-R7 and LR. */
          for (regno = LR_REGNUM; regno >= 0; regno--)
            if (mask & (1 << regno))
-             {
+             {
                fi->framesize += 4;
                fi->fsr.regs[saved_reg[regno]] = -(fi->framesize);
                saved_reg[regno] = regno;       /* reset saved register map */
@@ -366,17 +369,17 @@ thumb_scan_prologue (fi)
        }
       else if ((insn & 0xff00) == 0xb000)      /* add sp, #simm */
        {
-         offset = (insn & 0x7f) << 2;          /* get scaled offset */
-         if (insn & 0x80)                      /* is it signed? */
-            offset = -offset;
+         offset = (insn & 0x7f) << 2;  /* get scaled offset */
+         if (insn & 0x80)      /* is it signed? */
+           offset = -offset;
          fi->framesize -= offset;
        }
       else if ((insn & 0xff00) == 0xaf00)      /* add r7, sp, #imm */
        {
          fi->framereg = THUMB_FP_REGNUM;
-         fi->frameoffset = (insn & 0xff) << 2; /* get scaled offset */
+         fi->frameoffset = (insn & 0xff) << 2;         /* get scaled offset */
        }
-      else if (insn == 0x466f)                 /* mov r7, sp */
+      else if (insn == 0x466f) /* mov r7, sp */
        {
          fi->framereg = THUMB_FP_REGNUM;
          fi->frameoffset = 0;
@@ -384,12 +387,12 @@ thumb_scan_prologue (fi)
        }
       else if ((insn & 0xffc0) == 0x4640)      /* mov r0-r7, r8-r15 */
        {
-         int lo_reg = insn & 7;                /* dest. register (r0-r7) */
+         int lo_reg = insn & 7;        /* dest. register (r0-r7) */
          int hi_reg = ((insn >> 3) & 7) + 8;   /* source register (r8-15) */
-         saved_reg[lo_reg] = hi_reg;           /* remember hi reg was saved */
+         saved_reg[lo_reg] = hi_reg;   /* remember hi reg was saved */
        }
       else
-       break;                          /* anything else isn't prologue */
+       break;                  /* anything else isn't prologue */
     }
 }
 
@@ -399,23 +402,23 @@ thumb_scan_prologue (fi)
    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 frame register number;
+   * the size of the stack frame;
+   * the offsets of saved regs (relative to the old SP); and
+   * the offset from the stack pointer to the frame pointer
 
    The cache contains only one entry, since this is adequate
    for the typical sequence of prologue scan requests we get.
    When performing a backtrace, GDB will usually ask to scan
    the same function twice in a row (once to get the frame chain,
    and once to fill in the extra frame information).
-*/
+ */
 
 static struct frame_info prologue_cache;
 
 static int
 check_prologue_cache (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int i;
 
@@ -435,19 +438,19 @@ check_prologue_cache (fi)
 
 /* Function: save_prologue_cache
    Copy the prologue information from fi to the prologue cache.
-*/
+ */
 
 static void
 save_prologue_cache (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int i;
 
-  prologue_cache.pc          = fi->pc;
-  prologue_cache.framereg    = fi->framereg;
-  prologue_cache.framesize   = fi->framesize;
+  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];
 }
@@ -455,30 +458,30 @@ save_prologue_cache (fi)
 
 /* Function: arm_scan_prologue
    This function decodes an ARM function prologue to determine:
-     1) the size of the stack frame
-     2) which registers are saved on it
-     3) the offsets of saved regs
-     4) the offset from the stack pointer to the frame pointer
+   1) the size of the stack frame
+   2) which registers are saved on it
+   3) the offsets of saved regs
+   4) the offset from the stack pointer to the frame pointer
    This information is stored in the "extra" fields of the frame_info.
 
    A typical Arm function prologue might look like this:
-       mov    ip, sp
-       stmfd  sp!, {fp, ip, lr, pc}
-       sub    fp, ip, #4
-       sub    sp, sp, #16
+   mov    ip, sp
+   stmfd  sp!, {fp, ip, lr, pc}
+   sub    fp, ip, #4
+   sub    sp, sp, #16
    Which would create this stack frame (offsets relative to FP):
-     IP ->   4 (caller's stack)
-     FP ->   0 PC (points to address of stmfd instruction + 12 in callee)
-           -4  LR (return address in caller)
-           -8  IP (copy of caller's SP)
-          -12  FP (caller's FP)
-     SP -> -28 Local variables
+   IP ->   4    (caller's stack)
+   FP ->   0    PC (points to address of stmfd instruction + 12 in callee)
+   -4   LR (return address in caller)
+   -8   IP (copy of caller's SP)
+   -12  FP (caller's FP)
+   SP -> -28    Local variables
    The frame size would thus be 32 bytes, and the frame offset would be
    28 bytes.  */
 
 static void
 arm_scan_prologue (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int regno, sp_offset, fp_offset;
   CORE_ADDR prologue_start, prologue_end, current_pc;
@@ -488,8 +491,8 @@ arm_scan_prologue (fi)
     return;
 
   /* Assume there is no frame until proven otherwise.  */
-  fi->framereg    = SP_REGNUM;
-  fi->framesize   = 0;
+  fi->framereg = SP_REGNUM;
+  fi->framesize = 0;
   fi->frameoffset = 0;
 
   /* Check for Thumb prologue.  */
@@ -508,17 +511,17 @@ arm_scan_prologue (fi)
          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 */
+      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)  */
+       prologue_end = sal.end; /* (probably means no prologue)  */
     }
   else
     {
       /* Get address of the stmfd in the prologue of the callee; the saved
          PC is the address of the stmfd + 12.  */
-      prologue_start = ADDR_BITS_REMOVE(read_memory_integer (fi->frame, 4)) - 12;
-      prologue_end = prologue_start + 40; /* FIXME: should be big enough */
+      prologue_start = ADDR_BITS_REMOVE (read_memory_integer (fi->frame, 4)) - 12;
+      prologue_end = prologue_start + 40;      /* FIXME: should be big enough */
     }
 
   /* Now search the prologue looking for instructions that set up the
@@ -543,29 +546,29 @@ arm_scan_prologue (fi)
        }
       else if ((insn & 0xfffff000) == 0xe24cb000)      /* sub fp, ip #n */
        {
-         unsigned imm = insn & 0xff;                   /* immediate value */
-         unsigned rot = (insn & 0xf00) >> 7;           /* rotate amount */
-         imm = (imm >> rot) | (imm << (32-rot));
+         unsigned imm = insn & 0xff;   /* immediate value */
+         unsigned rot = (insn & 0xf00) >> 7;   /* rotate amount */
+         imm = (imm >> rot) | (imm << (32 - rot));
          fp_offset = -imm;
          fi->framereg = FP_REGNUM;
        }
       else if ((insn & 0xfffff000) == 0xe24dd000)      /* sub sp, sp #n */
        {
-         unsigned imm = insn & 0xff;                   /* immediate value */
-         unsigned rot = (insn & 0xf00) >> 7;           /* rotate amount */
-         imm = (imm >> rot) | (imm << (32-rot));
+         unsigned imm = insn & 0xff;   /* immediate value */
+         unsigned rot = (insn & 0xf00) >> 7;   /* rotate amount */
+         imm = (imm >> rot) | (imm << (32 - rot));
          sp_offset -= imm;
        }
-      else if ((insn & 0xffff7fff) == 0xed6d0103) /* stfe f?, [sp, -#c]! */
+      else if ((insn & 0xffff7fff) == 0xed6d0103)      /* stfe f?, [sp, -#c]! */
        {
          sp_offset -= 12;
          regno = F0_REGNUM + ((insn >> 12) & 0x07);
          fi->fsr.regs[regno] = sp_offset;
        }
-      else if (insn == 0xe1a0c00d)                     /* mov ip, sp */
+      else if (insn == 0xe1a0c00d)     /* mov ip, sp */
        continue;
       else
-       break;  /* not a recognized prologue instruction */
+       break;                  /* not a recognized prologue instruction */
     }
 
   /* The frame size is just the negative of the offset (from the original SP)
@@ -573,7 +576,7 @@ arm_scan_prologue (fi)
      [new FP] - [new SP].  */
   fi->framesize = -sp_offset;
   fi->frameoffset = fp_offset - sp_offset;
-  
+
   save_prologue_cache (fi);
 }
 
@@ -587,23 +590,22 @@ arm_scan_prologue (fi)
 
 static CORE_ADDR
 arm_find_callers_reg (fi, regnum)
-     struct frame_info * fi;
+     struct frame_info *fi;
      int regnum;
 {
   for (; fi; fi = fi->next)
-    
-#if 0  /* FIXME: enable this code if we convert to new call dummy scheme.  */
+
+#if 0                          /* FIXME: enable this code if we convert to new call dummy scheme.  */
     if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
       return generic_read_register_dummy (fi->pc, fi->frame, regnum);
     else
 #endif
-      if (fi->fsr.regs[regnum] != 0)
-       return read_memory_integer (fi->fsr.regs[regnum], 
-                                 REGISTER_RAW_SIZE(regnum));
+    if (fi->fsr.regs[regnum] != 0)
+      return read_memory_integer (fi->fsr.regs[regnum],
+                                 REGISTER_RAW_SIZE (regnum));
   return read_register (regnum);
 }
-
-
+/* *INDENT-OFF* */
 /* Function: frame_chain
    Given a GDB frame, determine the address of the calling function's frame.
    This will be used to create a new GDB frame struct, and then
@@ -619,27 +621,31 @@ arm_find_callers_reg (fi, regnum)
         read_memory_integer ((thisframe)->frame - 12, 4) :\
         0)
 */
+/* *INDENT-ON* */
+
+
+
 
 CORE_ADDR
 arm_frame_chain (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
-#if 0  /* FIXME: enable this code if we convert to new call dummy scheme.  */
+#if 0                          /* FIXME: enable this code if we convert to new call dummy scheme.  */
   CORE_ADDR fn_start, callers_pc, fp;
 
   /* is this a dummy frame? */
   if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
-    return fi->frame;  /* dummy frame same as caller's frame */
+    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: */
+  callers_pc = FRAME_SAVED_PC (fi);    /* find out who called us: */
   fp = arm_find_callers_reg (fi, FP_REGNUM);
-  if (PC_IN_CALL_DUMMY (callers_pc, fp, fp))   
-    return fp;         /* dummy frame's frame may bear no relation to ours */
+  if (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 */
+      return 0;                        /* in _start fn, don't chain further */
 #endif
   CORE_ADDR caller_pc, fn_start;
   struct frame_info caller_fi;
@@ -660,9 +666,9 @@ arm_frame_chain (fi)
      frame register number. */
   if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (fi->pc))
     {
-      memset (& caller_fi, 0, sizeof (caller_fi));
+      memset (&caller_fi, 0, sizeof (caller_fi));
       caller_fi.pc = caller_pc;
-      arm_scan_prologue (& caller_fi);
+      arm_scan_prologue (&caller_fi);
       framereg = caller_fi.framereg;
     }
 
@@ -683,7 +689,7 @@ arm_frame_chain (fi)
 
 void
 arm_init_extra_frame_info (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int reg;
 
@@ -692,29 +698,29 @@ arm_init_extra_frame_info (fi)
 
   memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
 
-#if 0  /* FIXME: enable this code if we convert to new call dummy scheme.  */
+#if 0                          /* FIXME: enable this code if we convert to new call dummy scheme.  */
   if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     {
       /* 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;
+         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;
     }
-  else 
+  else
 #endif
     {
       arm_scan_prologue (fi);
 
-      if (!fi->next)                   /* this is the innermost frame? */
+      if (!fi->next)           /* this is the innermost frame? */
        fi->frame = read_register (fi->framereg);
-      else                             /* not the innermost frame */
-       /* If we have an FP,  the callee saved it. */
-       if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM)
-         if (fi->next->fsr.regs[fi->framereg] != 0)
-           fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg],
-                                            4);
+      else
+       /* not the innermost frame */
+       /* If we have an FP,  the callee saved it. */ if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM)
+       if (fi->next->fsr.regs[fi->framereg] != 0)
+         fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg],
+                                          4);
 
       /* Calculate actual addresses of saved registers using offsets determined
          by arm_scan_prologue.  */
@@ -730,15 +736,15 @@ arm_init_extra_frame_info (fi)
    in the stack anywhere, otherwise we get it from the registers.
 
    The old definition of this function was a macro:
-     #define FRAME_SAVED_PC(FRAME) \
-       ADDR_BITS_REMOVE (read_memory_integer ((FRAME)->frame - 4, 4))
-*/
+   #define FRAME_SAVED_PC(FRAME) \
+   ADDR_BITS_REMOVE (read_memory_integer ((FRAME)->frame - 4, 4))
+ */
 
 CORE_ADDR
 arm_frame_saved_pc (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
-#if 0  /* FIXME: enable this code if we convert to new call dummy scheme.  */
+#if 0                          /* FIXME: enable this code if we convert to new call dummy scheme.  */
   if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
   else
@@ -759,7 +765,7 @@ arm_target_read_fp ()
   if (read_register (PS_REGNUM) & 0x20)                /* Bit 5 is Thumb state bit */
     return read_register (THUMB_FP_REGNUM);    /* R7 if Thumb */
   else
-    return read_register (FP_REGNUM);          /* R11 if ARM */
+    return read_register (FP_REGNUM);  /* R11 if ARM */
 }
 
 
@@ -792,13 +798,13 @@ arm_push_dummy_frame ()
      stm instruction stores the PC, it stores the address of the stm
      instruction itself plus 12.  */
   fp = sp = push_word (sp, prologue_start + 12);
-  sp = push_word (sp, read_register (PC_REGNUM)); /* FIXME: was PS_REGNUM */
+  sp = push_word (sp, read_register (PC_REGNUM));      /* FIXME: was PS_REGNUM */
   sp = push_word (sp, old_sp);
   sp = push_word (sp, read_register (FP_REGNUM));
-  
-  for (regnum = 10; regnum >= 0; regnum --)
+
+  for (regnum = 10; regnum >= 0; regnum--)
     sp = push_word (sp, read_register (regnum));
-  
+
   write_register (FP_REGNUM, fp);
   write_register (THUMB_FP_REGNUM, fp);
   write_register (SP_REGNUM, sp);
@@ -810,36 +816,36 @@ arm_push_dummy_frame ()
    different dummies:
 
    * ARM calling ARM: uses the call dummy in tm-arm.h, which has already
-     been copied into the dummy parameter to this function.
+   been copied into the dummy parameter to this function.
    * ARM calling Thumb: uses the call dummy in tm-arm.h, but with the
-     "mov pc,r4" instruction patched to be a "bx r4" instead.
+   "mov pc,r4" instruction patched to be a "bx r4" instead.
    * Thumb calling anything: uses the Thumb dummy defined below, which
-     works for calling both ARM and Thumb functions.
+   works for calling both ARM and Thumb functions.
 
    All three call dummies expect to receive the target function address
    in R4, with the low bit set if it's a Thumb function.
-*/
+ */
 
 void
 arm_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
-     char *        dummy;
-     CORE_ADDR     pc;
-     CORE_ADDR     fun;
-     int           nargs;
-     value_ptr *   args;
-     struct type * type;
-     int           gcc_p;
+     char *dummy;
+     CORE_ADDR pc;
+     CORE_ADDR fun;
+     int nargs;
+     value_ptr *args;
+     struct type *type;
+     int gcc_p;
 {
   static short thumb_dummy[4] =
   {
-    0xf000, 0xf801,    /*        bl      label */
-    0xdf18,            /*        swi     24 */
-    0x4720,            /* label: bx      r4 */
+    0xf000, 0xf801,            /*        bl      label */
+    0xdf18,                    /*        swi     24 */
+    0x4720,                    /* label: bx      r4 */
   };
   static unsigned long arm_bx_r4 = 0xe12fff14; /* bx r4 instruction */
 
   /* Set flag indicating whether the current PC is in a Thumb function. */
-  caller_is_thumb = arm_pc_is_thumb (read_pc());
+  caller_is_thumb = arm_pc_is_thumb (read_pc ());
 
   /* If the target function is Thumb, set the low bit of the function address.
      And if the CPU is currently in ARM mode, patch the second instruction
@@ -879,7 +885,7 @@ arm_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
    as a place-holder now.
 
    This implements the CALL_DUMMY_BREAK_OFFSET macro.
-*/
+ */
 
 int
 arm_call_dummy_breakpoint_offset ()
@@ -892,24 +898,25 @@ arm_call_dummy_breakpoint_offset ()
 
 
 CORE_ADDR
-arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
-     int         nargs;
-     value_ptr * args;
-     CORE_ADDR   sp;
-     int         struct_return;
-     CORE_ADDR   struct_addr;
+arm_push_arguments (nargs, args, sp, struct_return, struct_addr)
+     int nargs;
+     value_ptr *args;
+     CORE_ADDR sp;
+     int struct_return;
+     CORE_ADDR struct_addr;
 {
   int argreg;
   int float_argreg;
   int argnum;
   int stack_offset;
-  struct stack_arg {
+  struct stack_arg
+    {
       char *val;
       int len;
       int offset;
     };
   struct stack_arg *stack_args =
-      (struct stack_arg*)alloca (nargs * sizeof (struct stack_arg));
+  (struct stack_arg *) alloca (nargs * sizeof (struct stack_arg));
   int nstack_args = 0;
 
 
@@ -919,7 +926,7 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
 
   /* the struct_return pointer occupies the first parameter-passing reg */
   if (struct_return)
-      write_register (argreg++, struct_addr);
+    write_register (argreg++, struct_addr);
 
   /* The offset onto the stack at which we will start copying parameters
      (after the registers are used up) begins at 16 in the old ABI.
@@ -927,16 +934,16 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
   stack_offset = REGISTER_SIZE * 4;
 
   /* Process args from left to right.  Store as many as allowed in
-       registers, save the rest to be pushed on the stack */
-  for(argnum = 0; argnum < nargs; argnum++)
+     registers, save the rest to be pushed on the stack */
+  for (argnum = 0; argnum < nargs; argnum++)
     {
-      char *         val;
-      value_ptr      arg = args[argnum];
-      struct type *  arg_type = check_typedef (VALUE_TYPE (arg));
-      struct type *  target_type = TYPE_TARGET_TYPE (arg_type);
-      int            len = TYPE_LENGTH (arg_type);
+      char *val;
+      value_ptr arg = args[argnum];
+      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *target_type = TYPE_TARGET_TYPE (arg_type);
+      int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
-      CORE_ADDR      regval;
+      CORE_ADDR regval;
       int newarg;
 
       val = (char *) VALUE_CONTENTS (arg);
@@ -952,7 +959,7 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
            store_address (val, len, MAKE_THUMB_ADDR (regval));
        }
 
-#define MAPCS_FLOAT 0  /* --mapcs-float not implemented by the compiler yet */
+#define MAPCS_FLOAT 0          /* --mapcs-float not implemented by the compiler yet */
 #if MAPCS_FLOAT
       /* Up to four floating point arguments can be passed in floating
          point registers on ARM (not on Thumb).  */
@@ -975,15 +982,15 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
            {
              if (argreg <= ARM_LAST_ARG_REGNUM)
                {
-                 int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+                 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;
+                 len -= partial_len;
+                 val += partial_len;
                }
              else
                {
@@ -995,13 +1002,13 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
            }
        }
     }
-    /* 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);
-      }
+  /* 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;
@@ -1010,14 +1017,14 @@ arm_push_arguments(nargs, args, sp, struct_return, struct_addr)
 void
 arm_pop_frame ()
 {
-  struct frame_info *frame = get_current_frame();
+  struct frame_info *frame = get_current_frame ();
   int regnum;
   CORE_ADDR old_SP;
 
   old_SP = read_register (frame->framereg);
   for (regnum = 0; regnum < NUM_REGS; regnum++)
     if (frame->fsr.regs[regnum] != 0)
-      write_register (regnum, 
+      write_register (regnum,
                      read_memory_integer (frame->fsr.regs[regnum], 4));
 
   write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
@@ -1030,61 +1037,69 @@ static void
 print_fpu_flags (flags)
      int flags;
 {
-    if (flags & (1 << 0)) fputs ("IVO ", stdout);
-    if (flags & (1 << 1)) fputs ("DVZ ", stdout);
-    if (flags & (1 << 2)) fputs ("OFL ", stdout);
-    if (flags & (1 << 3)) fputs ("UFL ", stdout);
-    if (flags & (1 << 4)) fputs ("INX ", stdout);
-    putchar ('\n');
+  if (flags & (1 << 0))
+    fputs ("IVO ", stdout);
+  if (flags & (1 << 1))
+    fputs ("DVZ ", stdout);
+  if (flags & (1 << 2))
+    fputs ("OFL ", stdout);
+  if (flags & (1 << 3))
+    fputs ("UFL ", stdout);
+  if (flags & (1 << 4))
+    fputs ("INX ", stdout);
+  putchar ('\n');
 }
 
 void
 arm_float_info ()
 {
-    register unsigned long status = read_register (FPS_REGNUM);
-    int type;
-
-    type = (status >> 24) & 127;
-    printf ("%s FPU type %d\n",
-           (status & (1<<31)) ? "Hardware" : "Software",
-           type);
-    fputs ("mask: ", stdout);
-    print_fpu_flags (status >> 16);
-    fputs ("flags: ", stdout);
-    print_fpu_flags (status);
+  register unsigned long status = read_register (FPS_REGNUM);
+  int type;
+
+  type = (status >> 24) & 127;
+  printf ("%s FPU type %d\n",
+         (status & (1 << 31)) ? "Hardware" : "Software",
+         type);
+  fputs ("mask: ", stdout);
+  print_fpu_flags (status >> 16);
+  fputs ("flags: ", stdout);
+  print_fpu_flags (status);
 }
 
 static void
 arm_othernames ()
 {
 
-  if (arm_register_names ==  APCS_register_names) { 
-    arm_register_names =  additional_register_names;
-    arm_toggle_regnames ();
-  } else {
-    arm_register_names =  APCS_register_names;
-    arm_toggle_regnames ();
-  }    
-    
+  if (arm_register_names == APCS_register_names)
+    {
+      arm_register_names = additional_register_names;
+      arm_toggle_regnames ();
+    }
+  else
+    {
+      arm_register_names = APCS_register_names;
+      arm_toggle_regnames ();
+    }
+
 }
 
 /* FIXME:  Fill in with the 'right thing', see asm 
    template in arm-convert.s */
 
-void 
+void
 convert_from_extended (ptr, dbl)
-     void * ptr;
-     double * dbl;
+     void *ptr;
+     double *dbl;
 {
-  *dbl = *(double*)ptr;
+  *dbl = *(double *) ptr;
 }
 
-void 
+void
 convert_to_extended (dbl, ptr)
-     void * ptr;
-     double * dbl;
+     void *ptr;
+     double *dbl;
 {
-  *(double*)ptr = *dbl;
+  *(double *) ptr = *dbl;
 }
 
 static int
@@ -1123,10 +1138,10 @@ condition_true (cond, status_reg)
       return (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0));
     case INST_GT:
       return (((status_reg & FLAG_Z) == 0) &&
-             (((status_reg & FLAG_N) == 0) == ((status_reg & FLAG_V) == 0)));
+           (((status_reg & FLAG_N) == 0) == ((status_reg & FLAG_V) == 0)));
     case INST_LE:
       return (((status_reg & FLAG_Z) != 0) ||
-             (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0)));
+           (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0)));
     }
   return 1;
 }
@@ -1150,42 +1165,43 @@ shifted_reg_val (inst, carry, pc_val, status_reg)
   unsigned long res, shift;
   int rm = bits (inst, 0, 3);
   unsigned long shifttype = bits (inst, 5, 6);
-  if (bit(inst, 4))
+
+  if (bit (inst, 4))
     {
       int rs = bits (inst, 8, 11);
       shift = (rs == 15 ? pc_val + 8 : read_register (rs)) & 0xFF;
     }
   else
     shift = bits (inst, 7, 11);
-  res = (rm == 15 
+
+  res = (rm == 15
         ? ((pc_val | (ARM_PC_32 ? 0 : status_reg))
-           + (bit (inst, 4) ? 12 : 8)) 
+           + (bit (inst, 4) ? 12 : 8))
         : read_register (rm));
 
   switch (shifttype)
     {
-    case 0: /* LSL */
+    case 0:                    /* LSL */
       res = shift >= 32 ? 0 : res << shift;
       break;
-      
-    case 1: /* LSR */
+
+    case 1:                    /* LSR */
       res = shift >= 32 ? 0 : res >> shift;
       break;
 
-    case 2: /* ASR */
-      if (shift >= 32) shift = 31;
+    case 2:                    /* ASR */
+      if (shift >= 32)
+       shift = 31;
       res = ((res & 0x80000000L)
             ? ~((~res) >> shift) : res >> shift);
       break;
 
-    case 3: /* ROR/RRX */
+    case 3:                    /* ROR/RRX */
       shift &= 31;
       if (shift == 0)
        res = (res >> 1) | (carry ? 0x80000000L : 0);
       else
-       res = (res >> shift) | (res << (32-shift));
+       res = (res >> shift) | (res << (32 - shift));
       break;
     }
 
@@ -1201,7 +1217,7 @@ bitcount (val)
 {
   int nbits;
   for (nbits = 0; val != 0; nbits++)
-    val &= val - 1;    /* delete rightmost 1-bit in val */
+    val &= val - 1;            /* delete rightmost 1-bit in val */
   return nbits;
 }
 
@@ -1210,9 +1226,9 @@ static CORE_ADDR
 thumb_get_next_pc (pc)
      CORE_ADDR pc;
 {
-  unsigned long pc_val = ((unsigned long)pc) + 4;      /* PC after prefetch */
+  unsigned long pc_val = ((unsigned long) pc) + 4;     /* PC after prefetch */
   unsigned short inst1 = read_memory_integer (pc, 2);
-  CORE_ADDR nextpc = pc + 2;           /* default is next instruction */
+  CORE_ADDR nextpc = pc + 2;   /* default is next instruction */
   unsigned long offset;
 
   if ((inst1 & 0xff00) == 0xbd00)      /* pop {rlist, pc} */
@@ -1231,7 +1247,7 @@ thumb_get_next_pc (pc)
   else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */
     {
       unsigned long status = read_register (PS_REGNUM);
-      unsigned long cond = bits (inst1, 8, 11); 
+      unsigned long cond = bits (inst1, 8, 11);
       if (cond != 0x0f && condition_true (cond, status))       /* 0x0f = SWI */
        nextpc = pc_val + (sbits (inst1, 0, 7) << 1);
     }
@@ -1242,7 +1258,7 @@ thumb_get_next_pc (pc)
   else if ((inst1 & 0xf800) == 0xf000) /* long branch with link */
     {
       unsigned short inst2 = read_memory_integer (pc + 2, 2);
-      offset = (sbits (inst1, 0, 10) << 12) + (bits  (inst2, 0, 10) << 1);
+      offset = (sbits (inst1, 0, 10) << 12) + (bits (inst2, 0, 10) << 1);
       nextpc = pc_val + offset;
     }
 
@@ -1265,93 +1281,98 @@ arm_get_next_pc (pc)
   pc_val = (unsigned long) pc;
   this_instr = read_memory_integer (pc, 4);
   status = read_register (PS_REGNUM);
-  nextpc = (CORE_ADDR) (pc_val + 4);  /* Default case */
+  nextpc = (CORE_ADDR) (pc_val + 4);   /* Default case */
 
   if (condition_true (bits (this_instr, 28, 31), status))
     {
       switch (bits (this_instr, 24, 27))
        {
-       case 0x0: case 0x1: /* data processing */
-       case 0x2: case 0x3:
+       case 0x0:
+       case 0x1:               /* data processing */
+       case 0x2:
+       case 0x3:
          {
            unsigned long operand1, operand2, result = 0;
            unsigned long rn;
            int c;
+
            if (bits (this_instr, 12, 15) != 15)
              break;
 
            if (bits (this_instr, 22, 25) == 0
-               && bits (this_instr, 4, 7) == 9)  /* multiply */
+               && bits (this_instr, 4, 7) == 9)        /* multiply */
              error ("Illegal update to pc in instruction");
 
            /* Multiply into PC */
            c = (status & FLAG_C) ? 1 : 0;
            rn = bits (this_instr, 16, 19);
            operand1 = (rn == 15) ? pc_val + 8 : read_register (rn);
+
            if (bit (this_instr, 25))
              {
                unsigned long immval = bits (this_instr, 0, 7);
                unsigned long rotate = 2 * bits (this_instr, 8, 11);
-               operand2 = ((immval >> rotate) | (immval << (32-rotate)))
-                          & 0xffffffff;
+               operand2 = ((immval >> rotate) | (immval << (32 - rotate)))
+                 & 0xffffffff;
              }
-           else  /* operand 2 is a shifted register */
+           else                /* operand 2 is a shifted register */
              operand2 = shifted_reg_val (this_instr, c, pc_val, status);
+
            switch (bits (this_instr, 21, 24))
              {
-             case 0x0: /*and*/
+             case 0x0: /*and */
                result = operand1 & operand2;
                break;
 
-             case 0x1: /*eor*/
+             case 0x1: /*eor */
                result = operand1 ^ operand2;
                break;
 
-             case 0x2: /*sub*/
+             case 0x2: /*sub */
                result = operand1 - operand2;
                break;
 
-             case 0x3: /*rsb*/
+             case 0x3: /*rsb */
                result = operand2 - operand1;
                break;
 
-             case 0x4:  /*add*/
+             case 0x4: /*add */
                result = operand1 + operand2;
                break;
 
-             case 0x5: /*adc*/
+             case 0x5: /*adc */
                result = operand1 + operand2 + c;
                break;
 
-             case 0x6: /*sbc*/
+             case 0x6: /*sbc */
                result = operand1 - operand2 + c;
                break;
 
-             case 0x7: /*rsc*/
+             case 0x7: /*rsc */
                result = operand2 - operand1 + c;
                break;
 
-             case 0x8: case 0x9: case 0xa: case 0xb: /* tst, teq, cmp, cmn */
+             case 0x8:
+             case 0x9:
+             case 0xa:
+             case 0xb: /* tst, teq, cmp, cmn */
                result = (unsigned long) nextpc;
                break;
 
-             case 0xc: /*orr*/
+             case 0xc: /*orr */
                result = operand1 | operand2;
                break;
 
-             case 0xd: /*mov*/
+             case 0xd: /*mov */
                /* Always step into a function.  */
                result = operand2;
-                break;
+               break;
 
-             case 0xe: /*bic*/
+             case 0xe: /*bic */
                result = operand1 & ~operand2;
                break;
 
-             case 0xf: /*mvn*/
+             case 0xf: /*mvn */
                result = ~operand2;
                break;
              }
@@ -1361,18 +1382,20 @@ arm_get_next_pc (pc)
              error ("Infinite loop detected");
            break;
          }
-       case 0x4: case 0x5: /* data transfer */
-       case 0x6: case 0x7:
+
+       case 0x4:
+       case 0x5:               /* data transfer */
+       case 0x6:
+       case 0x7:
          if (bit (this_instr, 20))
            {
              /* load */
              if (bits (this_instr, 12, 15) == 15)
                {
                  /* rd == pc */
-                 unsigned long  rn;
+                 unsigned long rn;
                  unsigned long base;
+
                  if (bit (this_instr, 22))
                    error ("Illegal update to pc in instruction");
 
@@ -1384,18 +1407,18 @@ arm_get_next_pc (pc)
                      /* pre-indexed */
                      int c = (status & FLAG_C) ? 1 : 0;
                      unsigned long offset =
-                       (bit (this_instr, 25)
-                        ? shifted_reg_val (this_instr, c, pc_val)
-                        : bits (this_instr, 0, 11));
+                     (bit (this_instr, 25)
+                      ? shifted_reg_val (this_instr, c, pc_val)
+                      : bits (this_instr, 0, 11));
 
                      if (bit (this_instr, 23))
                        base += offset;
                      else
                        base -= offset;
                    }
-                 nextpc = (CORE_ADDR) read_memory_integer ((CORE_ADDR) base, 
+                 nextpc = (CORE_ADDR) read_memory_integer ((CORE_ADDR) base,
                                                            4);
+
                  nextpc = ADDR_BITS_REMOVE (nextpc);
 
                  if (nextpc == pc)
@@ -1403,8 +1426,9 @@ arm_get_next_pc (pc)
                }
            }
          break;
-       case 0x8: case 0x9: /* block transfer */
+
+       case 0x8:
+       case 0x9:               /* block transfer */
          if (bit (this_instr, 20))
            {
              /* LDM */
@@ -1418,18 +1442,18 @@ arm_get_next_pc (pc)
                      /* up */
                      unsigned long reglist = bits (this_instr, 0, 14);
                      offset = bitcount (reglist) * 4;
-                     if (bit (this_instr, 24)) /* pre */
+                     if (bit (this_instr, 24))         /* pre */
                        offset += 4;
                    }
                  else if (bit (this_instr, 24))
                    offset = -4;
+
                  {
-                   unsigned long rn_val = 
-                     read_register (bits (this_instr, 16, 19));
+                   unsigned long rn_val =
+                   read_register (bits (this_instr, 16, 19));
                    nextpc =
                      (CORE_ADDR) read_memory_integer ((CORE_ADDR) (rn_val
-                                                                   + offset),
+                                                                 + offset),
                                                       4);
                  }
                  nextpc = ADDR_BITS_REMOVE (nextpc);
@@ -1438,9 +1462,9 @@ arm_get_next_pc (pc)
                }
            }
          break;
-       case 0xb:           /* branch & link */
-       case 0xa:           /* branch */
+
+       case 0xb:               /* branch & link */
+       case 0xa:               /* branch */
          {
            nextpc = BranchDest (pc, this_instr);
 
@@ -1449,10 +1473,11 @@ arm_get_next_pc (pc)
              error ("Infinite loop detected");
            break;
          }
-       case 0xc: case 0xd:
-       case 0xe:           /* coproc ops */
-       case 0xf:           /* SWI */
+
+       case 0xc:
+       case 0xd:
+       case 0xe:               /* coproc ops */
+       case 0xf:               /* SWI */
          break;
 
        default:
@@ -1470,15 +1495,15 @@ arm_get_next_pc (pc)
 static int
 gdb_print_insn_arm (memaddr, info)
      bfd_vma memaddr;
-     disassemble_info * info;
+     disassemble_info *info;
 {
   if (arm_pc_is_thumb (memaddr))
     {
-      static asymbol *                  asym;
-      static combined_entry_type        ce;
-      static struct coff_symbol_struct  csym;
-      static struct _bfd                fake_bfd;
-      static bfd_target                 fake_target;
+      static asymbol *asym;
+      static combined_entry_type ce;
+      static struct coff_symbol_struct csym;
+      static struct _bfd fake_bfd;
+      static bfd_target fake_target;
 
       if (csym.native == NULL)
        {
@@ -1486,22 +1511,22 @@ gdb_print_insn_arm (memaddr, info)
             solely so that the code in print_insn_little_arm() and
             print_insn_big_arm() in opcodes/arm-dis.c will detect the presence
             of a Thumb symbol and switch to decoding Thumb instructions.  */
-            
-         fake_target.flavour  = bfd_target_coff_flavour;
-         fake_bfd.xvec        = & fake_target;
+
+         fake_target.flavour = bfd_target_coff_flavour;
+         fake_bfd.xvec = &fake_target;
          ce.u.syment.n_sclass = C_THUMBEXTFUNC;
-         csym.native          = & ce;
-         csym.symbol.the_bfd  = & fake_bfd;
-         csym.symbol.name     = "fake";
-         asym                 = (asymbol *) & csym;
+         csym.native = &ce;
+         csym.symbol.the_bfd = &fake_bfd;
+         csym.symbol.name = "fake";
+         asym = (asymbol *) & csym;
        }
-      
+
       memaddr = UNMAKE_THUMB_ADDR (memaddr);
-      info->symbols = & asym;
+      info->symbols = &asym;
     }
   else
     info->symbols = NULL;
-  
+
   if (TARGET_BYTE_ORDER == BIG_ENDIAN)
     return print_insn_big_arm (memaddr, info);
   else
@@ -1509,10 +1534,10 @@ gdb_print_insn_arm (memaddr, info)
 }
 
 /* Sequence of bytes for breakpoint instruction.  */
-#define ARM_LE_BREAKPOINT {0xFE,0xDE,0xFF,0xE7} /* Recognized illegal opcodes */
-#define ARM_BE_BREAKPOINT {0xE7,0xFF,0xDE,0xFE} 
-#define THUMB_LE_BREAKPOINT {0xfe,0xdf}       
-#define THUMB_BE_BREAKPOINT {0xdf,0xfe}       
+#define ARM_LE_BREAKPOINT {0xFE,0xDE,0xFF,0xE7}                /* Recognized illegal opcodes */
+#define ARM_BE_BREAKPOINT {0xE7,0xFF,0xDE,0xFE}
+#define THUMB_LE_BREAKPOINT {0xfe,0xdf}
+#define THUMB_BE_BREAKPOINT {0xdf,0xfe}
 
 /* The following has been superseded by BREAKPOINT_FOR_PC, but
    is defined merely to keep mem-break.c happy.  */
@@ -1528,40 +1553,40 @@ gdb_print_insn_arm (memaddr, info)
 
 unsigned char *
 arm_breakpoint_from_pc (pcptr, lenptr)
-     CORE_ADDR * pcptr;
-     int * lenptr;
+     CORE_ADDR *pcptr;
+     int *lenptr;
 {
   if (arm_pc_is_thumb (*pcptr) || arm_pc_is_thumb_dummy (*pcptr))
     {
       if (TARGET_BYTE_ORDER == BIG_ENDIAN)
-        {
-          static char thumb_breakpoint[] = THUMB_BE_BREAKPOINT;
-          *pcptr = UNMAKE_THUMB_ADDR (*pcptr);
-          *lenptr = sizeof (thumb_breakpoint);
-          return thumb_breakpoint;
-         }
+       {
+         static char thumb_breakpoint[] = THUMB_BE_BREAKPOINT;
+         *pcptr = UNMAKE_THUMB_ADDR (*pcptr);
+         *lenptr = sizeof (thumb_breakpoint);
+         return thumb_breakpoint;
+       }
       else
-        {
-          static char thumb_breakpoint[] = THUMB_LE_BREAKPOINT;
-          *pcptr = UNMAKE_THUMB_ADDR (*pcptr);
-          *lenptr = sizeof (thumb_breakpoint);
-          return thumb_breakpoint;
-        }
+       {
+         static char thumb_breakpoint[] = THUMB_LE_BREAKPOINT;
+         *pcptr = UNMAKE_THUMB_ADDR (*pcptr);
+         *lenptr = sizeof (thumb_breakpoint);
+         return thumb_breakpoint;
+       }
     }
   else
     {
       if (TARGET_BYTE_ORDER == BIG_ENDIAN)
-        {
-          static char arm_breakpoint[] = ARM_BE_BREAKPOINT;
-          *lenptr = sizeof (arm_breakpoint);
-          return arm_breakpoint;
-        }
+       {
+         static char arm_breakpoint[] = ARM_BE_BREAKPOINT;
+         *lenptr = sizeof (arm_breakpoint);
+         return arm_breakpoint;
+       }
       else
-        {
-          static char arm_breakpoint[] = ARM_LE_BREAKPOINT;
-          *lenptr = sizeof (arm_breakpoint);
-          return arm_breakpoint;
-        }
+       {
+         static char arm_breakpoint[] = ARM_LE_BREAKPOINT;
+         *lenptr = sizeof (arm_breakpoint);
+         return arm_breakpoint;
+       }
     }
 }
 /* Return non-zero if the PC is inside a call thunk (aka stub or trampoline).
@@ -1570,7 +1595,7 @@ arm_breakpoint_from_pc (pcptr, lenptr)
 int
 arm_in_call_stub (pc, name)
      CORE_ADDR pc;
-     char * name;
+     char *name;
 {
   CORE_ADDR start_addr;
 
@@ -1592,7 +1617,7 @@ CORE_ADDR
 arm_skip_stub (pc)
      CORE_ADDR pc;
 {
-  char * name;
+  char *name;
   CORE_ADDR start_addr;
 
   /* Find the starting address and name of the function containing the PC.  */
@@ -1604,50 +1629,50 @@ arm_skip_stub (pc)
     {
       /* Use the name suffix to determine which register contains
          the target PC.  */
-      static char *table[15] = 
-       { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-         "r8", "r9", "sl", "fp", "ip", "sp", "lr"
-       };
+      static char *table[15] =
+      {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+       "r8", "r9", "sl", "fp", "ip", "sp", "lr"
+      };
       int regno;
 
       for (regno = 0; regno <= 14; regno++)
        if (strcmp (&name[10], table[regno]) == 0)
          return read_register (regno);
     }
-  return 0;    /* not a stub */
+  return 0;                    /* not a stub */
 }
 
 
 void
 _initialize_arm_tdep ()
 {
-  int regname_is_APCS = (arm_register_names ==  APCS_register_names);
+  int regname_is_APCS = (arm_register_names == APCS_register_names);
 
   tm_print_insn = gdb_print_insn_arm;
-  
+
   /* Sync the opcode insn printer with our register viewer: */
 
   if (arm_toggle_regnames () != regname_is_APCS)
     arm_toggle_regnames ();
-     
+
   add_com ("othernames", class_obscure, arm_othernames,
           "Switch to the other set of register names.");
 
   /* ??? Maybe this should be a boolean.  */
   add_show_from_set (add_set_cmd ("apcs32", no_class,
-                                 var_zinteger, (char *)&arm_apcs_32,
-                                 "Set usage of ARM 32-bit mode.\n", &setlist),
-                    & showlist);
+                                 var_zinteger, (char *) &arm_apcs_32,
+                              "Set usage of ARM 32-bit mode.\n", &setlist),
+                    &showlist);
 
 }
 
 /* Test whether the coff symbol specific value corresponds to a Thumb function */
 int
-coff_sym_is_thumb(int val)
+coff_sym_is_thumb (int val)
 {
-       return (val == C_THUMBEXT ||
-      val == C_THUMBSTAT ||
-      val == C_THUMBEXTFUNC ||
-      val == C_THUMBSTATFUNC ||
-      val == C_THUMBLABEL);
+  return (val == C_THUMBEXT ||
+         val == C_THUMBSTAT ||
+         val == C_THUMBEXTFUNC ||
+         val == C_THUMBSTATFUNC ||
+         val == C_THUMBLABEL);
 }
index 19781c207137f5ef4e0b6e595b336c5a344e8385..48c416d32ef451472c1b57c34b0c73adaa0000e1 100644 (file)
@@ -1,21 +1,22 @@
 /* Acorn Risc Machine host machine support.
    Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -42,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 void
 fetch_inferior_registers (regno)
-     int regno;                /* Original value discarded */
+     int regno;                        /* Original value discarded */
 {
   register unsigned int regaddr;
   char buf[MAX_REGISTER_RAW_SIZE];
@@ -51,34 +52,35 @@ fetch_inferior_registers (regno)
   struct user u;
   unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
   offset = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0)
-      - KERNEL_U_ADDR;
+    - KERNEL_U_ADDR;
 
   registers_fetched ();
-  
+
   for (regno = 0; regno < 16; regno++)
     {
       regaddr = offset + regno * 4;
-      *(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid,
-                               (PTRACE_ARG3_TYPE) regaddr, 0);
+      *(int *) &buf[0] = ptrace (PT_READ_U, inferior_pid,
+                                (PTRACE_ARG3_TYPE) regaddr, 0);
       if (regno == PC_REGNUM)
-         *(int *)&buf[0] = GET_PC_PART(*(int *)&buf[0]);
+       *(int *) &buf[0] = GET_PC_PART (*(int *) &buf[0]);
       supply_register (regno, buf);
     }
-  *(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid,
-                           (PTRACE_ARG3_TYPE) (offset + PC*4), 0);
-  supply_register (PS_REGNUM, buf); /* set virtual register ps same as pc */
+  *(int *) &buf[0] = ptrace (PT_READ_U, inferior_pid,
+                            (PTRACE_ARG3_TYPE) (offset + PC * 4), 0);
+  supply_register (PS_REGNUM, buf);    /* set virtual register ps same as pc */
 
   /* read the floating point registers */
-  offset = (char *) &u.u_fp_regs - (char *)&u;
-  *(int *)buf = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0);
+  offset = (char *) &u.u_fp_regs - (char *) &u;
+  *(int *) buf = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0);
   supply_register (FPS_REGNUM, buf);
-  for (regno = 16; regno < 24; regno++) {
+  for (regno = 16; regno < 24; regno++)
+    {
       regaddr = offset + 4 + 12 * (regno - 16);
-      for (i = 0; i < 12; i += sizeof(int))
-         *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
-                                    (PTRACE_ARG3_TYPE) (regaddr + i), 0);
+      for (i = 0; i < 12; i += sizeof (int))
+        *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
+                                     (PTRACE_ARG3_TYPE) (regaddr + i), 0);
       supply_register (regno, buf);
-  }
+    }
 }
 
 /* Store our register values back into the inferior.
@@ -96,15 +98,17 @@ store_inferior_registers (regno)
   unsigned long value;
   unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
   offset = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0)
-      - KERNEL_U_ADDR;
+    - KERNEL_U_ADDR;
 
-  if (regno >= 0) {
-      if (regno >= 16) return;
+  if (regno >= 0)
+    {
+      if (regno >= 16)
+       return;
       regaddr = offset + 4 * regno;
       errno = 0;
-      value = read_register(regno);
+      value = read_register (regno);
       if (regno == PC_REGNUM)
-         value = SET_PC_PART(read_register (PS_REGNUM), value);
+       value = SET_PC_PART (read_register (PS_REGNUM), value);
       ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
       if (errno != 0)
        {
@@ -112,20 +116,21 @@ store_inferior_registers (regno)
          perror_with_name (buf);
        }
     }
-  else for (regno = 0; regno < 15; regno++)
-    {
-      regaddr = offset + regno * 4;
-      errno = 0;
-      value = read_register(regno);
-      if (regno == PC_REGNUM)
-         value = SET_PC_PART(read_register (PS_REGNUM), value);
-      ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
-      if (errno != 0)
-       {
-         sprintf (buf, "writing all regs, number %d", regno);
-         perror_with_name (buf);
-       }
-    }
+  else
+    for (regno = 0; regno < 15; regno++)
+      {
+       regaddr = offset + regno * 4;
+       errno = 0;
+       value = read_register (regno);
+       if (regno == PC_REGNUM)
+         value = SET_PC_PART (read_register (PS_REGNUM), value);
+       ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
+       if (errno != 0)
+         {
+           sprintf (buf, "writing all regs, number %d", regno);
+           perror_with_name (buf);
+         }
+      }
 }
 \f
 /* Work with core dump and executable files, for GDB. 
@@ -135,20 +140,21 @@ store_inferior_registers (regno)
    by the execfile.
    e.g. prog shares Xt which shares X11 which shares c. */
 
-struct shared_library {
-    struct exec_header header;
-    char name[SHLIBLEN];
-    CORE_ADDR text_start;      /* CORE_ADDR of 1st byte of text, this file */
-    long data_offset;          /* offset of data section in file */
-    int chan;                  /* file descriptor for the file */
-    struct shared_library *shares; /* library this one shares */
+struct shared_library
+{
+  struct exec_header header;
+  char name[SHLIBLEN];
+  CORE_ADDR text_start;                /* CORE_ADDR of 1st byte of text, this file */
+  long data_offset;            /* offset of data section in file */
+  int chan;                    /* file descriptor for the file */
+  struct shared_library *shares;       /* library this one shares */
 };
 static struct shared_library *shlib = 0;
 
 /* Hook for `exec_file_command' command to call.  */
 
 extern void (*exec_file_display_hook) ();
-   
+
 static CORE_ADDR unshared_text_start;
 
 /* extended header from exec file (for shared library info) */
@@ -184,7 +190,7 @@ core_file_command (filename, from_tty)
     {
       filename = tilde_expand (filename);
       make_cleanup (free, filename);
-      
+
       if (have_inferior_p ())
        error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
@@ -218,7 +224,7 @@ core_file_command (filename, from_tty)
        reg_offset = (int) u.u_ar0;
        if (reg_offset > NBPG * UPAGES)
          reg_offset -= KERNEL_U_ADDR;
-       fp_reg_offset = (char *) &u.u_fp_regs - (char *)&u;
+       fp_reg_offset = (char *) &u.u_fp_regs - (char *) &u;
 
        /* I don't know where to find this info.
           So, for now, mark it as not available.  */
@@ -235,26 +241,26 @@ core_file_command (filename, from_tty)
              char buf[MAX_REGISTER_RAW_SIZE];
 
              if (regno < 16)
-                 val = lseek (corechan, reg_offset + 4 * regno, 0);
+               val = lseek (corechan, reg_offset + 4 * regno, 0);
              else if (regno < 24)
-                 val = lseek (corechan, fp_reg_offset + 4 + 12*(regno - 24), 0);
+               val = lseek (corechan, fp_reg_offset + 4 + 12 * (regno - 24), 0);
              else if (regno == 24)
-                 val = lseek (corechan, fp_reg_offset, 0);
+               val = lseek (corechan, fp_reg_offset, 0);
              else if (regno == 25)
-                 val = lseek (corechan, reg_offset + 4 * PC, 0);
+               val = lseek (corechan, reg_offset + 4 * PC, 0);
              if (val < 0
                  || (val = myread (corechan, buf, sizeof buf)) < 0)
                {
-                 char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
-                                                  + 30);
+                 char *buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
+                                                 + 30);
                  strcpy (buffer, "Reading register ");
                  strcat (buffer, REGISTER_NAME (regno));
-                                                  
+
                  perror_with_name (buffer);
                }
 
              if (regno == PC_REGNUM)
-                 *(int *)buf = GET_PC_PART(*(int *)buf);
+               *(int *) buf = GET_PC_PART (*(int *) buf);
              supply_register (regno, buf);
            }
        }
@@ -282,20 +288,21 @@ core_file_command (filename, from_tty)
    by the execfile.
    e.g. prog shares Xt which shares X11 which shares c. */
 
-struct shared_library {
-    struct exec_header header;
-    char name[SHLIBLEN];
-    CORE_ADDR text_start;      /* CORE_ADDR of 1st byte of text, this file */
-    long data_offset;          /* offset of data section in file */
-    int chan;                  /* file descriptor for the file */
-    struct shared_library *shares; /* library this one shares */
+struct shared_library
+{
+  struct exec_header header;
+  char name[SHLIBLEN];
+  CORE_ADDR text_start;                /* CORE_ADDR of 1st byte of text, this file */
+  long data_offset;            /* offset of data section in file */
+  int chan;                    /* file descriptor for the file */
+  struct shared_library *shares;       /* library this one shares */
 };
 static struct shared_library *shlib = 0;
 
 /* Hook for `exec_file_command' command to call.  */
 
 extern void (*exec_file_display_hook) ();
-   
+
 static CORE_ADDR unshared_text_start;
 
 /* extended header from exec file (for shared library info) */
@@ -325,10 +332,11 @@ exec_file_command (filename, from_tty)
   if (execchan >= 0)
     close (execchan);
   execchan = -1;
-  if (shlib) {
-      close_shared_library(shlib);
+  if (shlib)
+    {
+      close_shared_library (shlib);
       shlib = 0;
-  }
+    }
 
   /* Now open and digest the file the user requested, if any.  */
 
@@ -348,7 +356,7 @@ exec_file_command (filename, from_tty)
 #ifdef HEADER_SEEK_FD
        HEADER_SEEK_FD (execchan);
 #endif
-       
+
        val = myread (execchan, &exec_header, sizeof exec_header);
        exec_aouthdr = exec_header.a_exec;
 
@@ -359,21 +367,23 @@ exec_file_command (filename, from_tty)
 
        /* Look for shared library if needed */
        if (exec_header.a_exec.a_magic & MF_USES_SL)
-           shlib = open_shared_library(exec_header.a_shlibname, text_start);
+         shlib = open_shared_library (exec_header.a_shlibname, text_start);
 
        text_offset = N_TXTOFF (exec_aouthdr);
        exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
 
-       if (shlib) {
-           unshared_text_start = shared_text_end(shlib) & ~0x7fff;
+       if (shlib)
+         {
+           unshared_text_start = shared_text_end (shlib) & ~0x7fff;
            stack_start = shlib->header.a_exec.a_sldatabase;
            stack_end = STACK_END_ADDR;
-       } else
-           unshared_text_start = 0x8000;
+         }
+       else
+         unshared_text_start = 0x8000;
        text_end = unshared_text_start + exec_aouthdr.a_text;
 
        exec_data_start = unshared_text_start + exec_aouthdr.a_text;
-        exec_data_end = exec_data_start + exec_aouthdr.a_data;
+       exec_data_end = exec_data_start + exec_aouthdr.a_data;
 
        data_start = exec_data_start;
        data_end += exec_data_start;
@@ -421,19 +431,19 @@ xfer_core_file (memaddr, myaddr, len)
       xferchan = 0;
 
       /* Determine which file the next bunch of addresses reside in,
-        and where in the file.  Set the file's read/write pointer
-        to point at the proper place for the desired address
-        and set xferfile and xferchan for the correct file.
+         and where in the file.  Set the file's read/write pointer
+         to point at the proper place for the desired address
+         and set xferfile and xferchan for the correct file.
 
-        If desired address is nonexistent, leave them zero.
+         If desired address is nonexistent, leave them zero.
 
-        i is set to the number of bytes that can be handled
-        along with the next address.
+         i is set to the number of bytes that can be handled
+         along with the next address.
 
-        We put the most likely tests first for efficiency.  */
+         We put the most likely tests first for efficiency.  */
 
       /* Note that if there is no core file
-        data_start and data_end are equal.  */
+         data_start and data_end are equal.  */
       if (memaddr >= data_start && memaddr < data_end)
        {
          i = min (len, data_end - memaddr);
@@ -442,29 +452,33 @@ xfer_core_file (memaddr, myaddr, len)
          xferchan = corechan;
        }
       /* Note that if there is no core file
-        stack_start and stack_end define the shared library data.  */
+         stack_start and stack_end define the shared library data.  */
       else if (memaddr >= stack_start && memaddr < stack_end)
        {
-           if (corechan < 0) {
-               struct shared_library *lib;
-               for (lib = shlib; lib; lib = lib->shares)
-                   if (memaddr >= lib->header.a_exec.a_sldatabase &&
-                       memaddr < lib->header.a_exec.a_sldatabase +
-                         lib->header.a_exec.a_data)
-                       break;
-               if (lib) {
-                   i = min (len, lib->header.a_exec.a_sldatabase +
-                            lib->header.a_exec.a_data - memaddr);
-                   fileptr = lib->data_offset + memaddr -
-                       lib->header.a_exec.a_sldatabase;
-                   xferfile = execfile;
-                   xferchan = lib->chan;
+         if (corechan < 0)
+           {
+             struct shared_library *lib;
+             for (lib = shlib; lib; lib = lib->shares)
+               if (memaddr >= lib->header.a_exec.a_sldatabase &&
+                   memaddr < lib->header.a_exec.a_sldatabase +
+                   lib->header.a_exec.a_data)
+                 break;
+             if (lib)
+               {
+                 i = min (len, lib->header.a_exec.a_sldatabase +
+                          lib->header.a_exec.a_data - memaddr);
+                 fileptr = lib->data_offset + memaddr -
+                   lib->header.a_exec.a_sldatabase;
+                 xferfile = execfile;
+                 xferchan = lib->chan;
                }
-           } else {
-               i = min (len, stack_end - memaddr);
-               fileptr = memaddr - stack_start + stack_offset;
-               xferfile = &corefile;
-               xferchan = corechan;
+           }
+         else
+           {
+             i = min (len, stack_end - memaddr);
+             fileptr = memaddr - stack_start + stack_offset;
+             xferfile = &corefile;
+             xferchan = corechan;
            }
        }
       else if (corechan < 0
@@ -477,22 +491,25 @@ xfer_core_file (memaddr, myaddr, len)
        }
       else if (memaddr >= text_start && memaddr < text_end)
        {
-           struct shared_library *lib;
-           for (lib = shlib; lib; lib = lib->shares)
-               if (memaddr >= lib->text_start &&
-                   memaddr < lib->text_start + lib->header.a_exec.a_text)
-                   break;
-           if (lib) {
-               i = min (len, lib->header.a_exec.a_text +
-                        lib->text_start - memaddr);
-               fileptr = memaddr - lib->text_start + text_offset;
-               xferfile = &execfile;
-               xferchan = lib->chan;
-           } else {
-               i = min (len, text_end - memaddr);
-               fileptr = memaddr - unshared_text_start + text_offset;
-               xferfile = &execfile;
-               xferchan = execchan;
+         struct shared_library *lib;
+         for (lib = shlib; lib; lib = lib->shares)
+           if (memaddr >= lib->text_start &&
+               memaddr < lib->text_start + lib->header.a_exec.a_text)
+             break;
+         if (lib)
+           {
+             i = min (len, lib->header.a_exec.a_text +
+                      lib->text_start - memaddr);
+             fileptr = memaddr - lib->text_start + text_offset;
+             xferfile = &execfile;
+             xferchan = lib->chan;
+           }
+         else
+           {
+             i = min (len, text_end - memaddr);
+             fileptr = memaddr - unshared_text_start + text_offset;
+             xferfile = &execfile;
+             xferchan = execchan;
            }
        }
       else if (memaddr < text_start)
@@ -500,7 +517,7 @@ xfer_core_file (memaddr, myaddr, len)
          i = min (len, text_start - memaddr);
        }
       else if (memaddr >= text_end
-              && memaddr < (corechan >= 0? data_start : exec_data_start))
+              && memaddr < (corechan >= 0 ? data_start : exec_data_start))
        {
          i = min (len, data_start - memaddr);
        }
@@ -511,11 +528,11 @@ xfer_core_file (memaddr, myaddr, len)
        }
       else if (corechan < 0 && memaddr >= exec_data_end)
        {
-         i = min (len, - memaddr);
+         i = min (len, -memaddr);
        }
       else if (memaddr >= stack_end && stack_end != 0)
        {
-         i = min (len, - memaddr);
+         i = min (len, -memaddr);
        }
       else
        {
@@ -525,7 +542,7 @@ xfer_core_file (memaddr, myaddr, len)
        }
 
       /* Now we know which file to use.
-        Set up its pointer and transfer the data.  */
+         Set up its pointer and transfer the data.  */
       if (xferfile)
        {
          if (*xferfile == 0)
@@ -541,8 +558,8 @@ xfer_core_file (memaddr, myaddr, len)
            perror_with_name (*xferfile);
        }
       /* If this address is for nonexistent memory,
-        read zeros if reading, or do nothing if writing.
-        Actually, we never right.  */
+         read zeros if reading, or do nothing if writing.
+         Actually, we never right.  */
       else
        {
          memset (myaddr, '\0', i);
index f9265e447137a8de2953022ff7a4e9d4fb2e874e..6dea775e7ff2e1e2a235a015bf3af716f9d34b44 100644 (file)
@@ -1,21 +1,22 @@
 /* GDB-specific functions for operating on agent expressions
    Copyright 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -43,20 +44,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    pay for the simplicity of this code with less-than-optimal bytecode
    strings.
 
-   Remember, "GBD" stands for "Great Britain, Dammit!"  So be careful.  */ 
+   Remember, "GBD" stands for "Great Britain, Dammit!"  So be careful.  */
+\f
 
 
-\f
 /* Prototypes for local functions. */
 
 /* There's a standard order to the arguments of these functions:
    union exp_element ** --- pointer into expression
    struct agent_expr * --- agent expression buffer to generate code into
    struct axs_value * --- describes value left on top of stack  */
-   
-static struct value *const_var_ref PARAMS ((struct symbol *var));
-static struct value *const_expr PARAMS ((union exp_element **pc));
-static struct value *maybe_const_expr PARAMS ((union exp_element **pc));
+
+static struct value *const_var_ref PARAMS ((struct symbol * var));
+static struct value *const_expr PARAMS ((union exp_element ** pc));
+static struct value *maybe_const_expr PARAMS ((union exp_element ** pc));
 
 static void gen_traced_pop PARAMS ((struct agent_expr *, struct axs_value *));
 
@@ -66,91 +67,91 @@ static void gen_fetch PARAMS ((struct agent_expr *, struct type *));
 static void gen_left_shift PARAMS ((struct agent_expr *, int));
 
 
-static void gen_frame_args_address   PARAMS ((struct agent_expr *));
+static void gen_frame_args_address PARAMS ((struct agent_expr *));
 static void gen_frame_locals_address PARAMS ((struct agent_expr *));
-static void gen_offset PARAMS ((struct agent_expr *ax, int offset));
+static void gen_offset PARAMS ((struct agent_expr * ax, int offset));
 static void gen_sym_offset PARAMS ((struct agent_expr *, struct symbol *));
-static void gen_var_ref PARAMS ((struct agent_expr *ax,
-                                struct axs_value *value,
-                                struct symbol *var));
-
-
-static void gen_int_literal PARAMS ((struct agent_expr *ax,
-                                    struct axs_value *value,
-                                    LONGEST k, struct type *type));
-
-
-static void require_rvalue PARAMS ((struct agent_expr *ax,
-                                   struct axs_value *value));
-static void gen_usual_unary PARAMS ((struct agent_expr *ax,
-                                    struct axs_value *value));
-static int type_wider_than PARAMS ((struct type *type1,
-                                   struct type *type2));
-static struct type *max_type PARAMS ((struct type *type1, 
-                                     struct type *type2));
-static void gen_conversion PARAMS ((struct agent_expr *ax,
-                                   struct type *from,
-                                   struct type *to));
-static int is_nontrivial_conversion PARAMS ((struct type *from,
-                                            struct type *to));
-static void gen_usual_arithmetic PARAMS ((struct agent_expr *ax,
-                                         struct axs_value *value1,
-                                         struct axs_value *value2));
-static void gen_integral_promotions PARAMS ((struct agent_expr *ax,
-                                            struct axs_value *value));
-static void gen_cast PARAMS ((struct agent_expr *ax,
-                             struct axs_value *value,
-                             struct type *type));
-static void gen_scale PARAMS ((struct agent_expr *ax,
+static void gen_var_ref PARAMS ((struct agent_expr * ax,
+                                struct axs_value * value,
+                                struct symbol * var));
+
+
+static void gen_int_literal PARAMS ((struct agent_expr * ax,
+                                    struct axs_value * value,
+                                    LONGEST k, struct type * type));
+
+
+static void require_rvalue PARAMS ((struct agent_expr * ax,
+                                   struct axs_value * value));
+static void gen_usual_unary PARAMS ((struct agent_expr * ax,
+                                    struct axs_value * value));
+static int type_wider_than PARAMS ((struct type * type1,
+                                   struct type * type2));
+static struct type *max_type PARAMS ((struct type * type1,
+                                     struct type * type2));
+static void gen_conversion PARAMS ((struct agent_expr * ax,
+                                   struct type * from,
+                                   struct type * to));
+static int is_nontrivial_conversion PARAMS ((struct type * from,
+                                            struct type * to));
+static void gen_usual_arithmetic PARAMS ((struct agent_expr * ax,
+                                         struct axs_value * value1,
+                                         struct axs_value * value2));
+static void gen_integral_promotions PARAMS ((struct agent_expr * ax,
+                                            struct axs_value * value));
+static void gen_cast PARAMS ((struct agent_expr * ax,
+                             struct axs_value * value,
+                             struct type * type));
+static void gen_scale PARAMS ((struct agent_expr * ax,
                               enum agent_op op,
-                              struct type *type));
-static void gen_add PARAMS ((struct agent_expr *ax,
-                            struct axs_value *value, 
-                            struct axs_value *value1,
-                            struct axs_value *value2,
+                              struct type * type));
+static void gen_add PARAMS ((struct agent_expr * ax,
+                            struct axs_value * value,
+                            struct axs_value * value1,
+                            struct axs_value * value2,
                             char *name));
-static void gen_sub PARAMS ((struct agent_expr *ax,
-                            struct axs_value *value, 
-                            struct axs_value *value1,
-                            struct axs_value *value2));
-static void gen_binop PARAMS ((struct agent_expr *ax,
-                              struct axs_value *value,
-                              struct axs_value *value1,
-                              struct axs_value *value2,
+static void gen_sub PARAMS ((struct agent_expr * ax,
+                            struct axs_value * value,
+                            struct axs_value * value1,
+                            struct axs_value * value2));
+static void gen_binop PARAMS ((struct agent_expr * ax,
+                              struct axs_value * value,
+                              struct axs_value * value1,
+                              struct axs_value * value2,
                               enum agent_op op,
                               enum agent_op op_unsigned,
                               int may_carry,
                               char *name));
-static void gen_logical_not PARAMS ((struct agent_expr *ax,
-                                    struct axs_value *value));
-static void gen_complement PARAMS ((struct agent_expr *ax,
-                                   struct axs_value *value));
+static void gen_logical_not PARAMS ((struct agent_expr * ax,
+                                    struct axs_value * value));
+static void gen_complement PARAMS ((struct agent_expr * ax,
+                                   struct axs_value * value));
 static void gen_deref PARAMS ((struct agent_expr *, struct axs_value *));
 static void gen_address_of PARAMS ((struct agent_expr *, struct axs_value *));
-static int find_field PARAMS ((struct type *type, char *name));
-static void gen_bitfield_ref PARAMS ((struct agent_expr *ax,
-                                     struct axs_value *value,
-                                     struct type *type,
+static int find_field PARAMS ((struct type * type, char *name));
+static void gen_bitfield_ref PARAMS ((struct agent_expr * ax,
+                                     struct axs_value * value,
+                                     struct type * type,
                                      int start, int end));
-static void gen_struct_ref PARAMS ((struct agent_expr *ax,
-                                   struct axs_value *value,
+static void gen_struct_ref PARAMS ((struct agent_expr * ax,
+                                   struct axs_value * value,
                                    char *field,
                                    char *operator_name,
                                    char *operand_name));
-static void gen_repeat PARAMS ((union exp_element **pc,
-                               struct agent_expr *ax,
-                               struct axs_value *value));
-static void gen_sizeof PARAMS ((union exp_element **pc,
-                               struct agent_expr *ax,
-                               struct axs_value *value));
-static void gen_expr PARAMS ((union exp_element **pc,
-                             struct agent_expr *ax,
-                             struct axs_value *value));
-
-static void print_axs_value PARAMS ((GDB_FILE *f, struct axs_value *value));
+static void gen_repeat PARAMS ((union exp_element ** pc,
+                               struct agent_expr * ax,
+                               struct axs_value * value));
+static void gen_sizeof PARAMS ((union exp_element ** pc,
+                               struct agent_expr * ax,
+                               struct axs_value * value));
+static void gen_expr PARAMS ((union exp_element ** pc,
+                             struct agent_expr * ax,
+                             struct axs_value * value));
+
+static void print_axs_value PARAMS ((GDB_FILE * f, struct axs_value * value));
 static void agent_command PARAMS ((char *exp, int from_tty));
-
 \f
+
 /* Detecting constant expressions.  */
 
 /* If the variable reference at *PC is a constant, return its value.
@@ -219,7 +220,7 @@ const_expr (pc)
        return v;
       }
 
-    /* We could add more operators in here.  */
+      /* We could add more operators in here.  */
 
     case UNOP_NEG:
       (*pc)++;
@@ -247,11 +248,11 @@ maybe_const_expr (pc)
   /* If we got a value, then update the real PC.  */
   if (v)
     *pc = tentative_pc;
+
   return v;
 }
-
 \f
+
 /* Generating bytecode from GDB expressions: general assumptions */
 
 /* Here are a few general assumptions made throughout the code; if you
@@ -259,43 +260,43 @@ maybe_const_expr (pc)
    better scan things pretty thoroughly.
 
    - We assume that all values occupy one stack element.  For example,
-     sometimes we'll swap to get at the left argument to a binary
-     operator.  If we decide that void values should occupy no stack
-     elements, or that synthetic arrays (whose size is determined at
-     run time, created by the `@' operator) should occupy two stack
-     elements (address and length), then this will cause trouble.
+   sometimes we'll swap to get at the left argument to a binary
+   operator.  If we decide that void values should occupy no stack
+   elements, or that synthetic arrays (whose size is determined at
+   run time, created by the `@' operator) should occupy two stack
+   elements (address and length), then this will cause trouble.
 
    - We assume the stack elements are infinitely wide, and that we
-     don't have to worry what happens if the user requests an
-     operation that is wider than the actual interpreter's stack.
-     That is, it's up to the interpreter to handle directly all the
-     integer widths the user has access to.  (Woe betide the language
-     with bignums!)
+   don't have to worry what happens if the user requests an
+   operation that is wider than the actual interpreter's stack.
+   That is, it's up to the interpreter to handle directly all the
+   integer widths the user has access to.  (Woe betide the language
+   with bignums!)
 
    - We don't support side effects.  Thus, we don't have to worry about
-     GCC's generalized lvalues, function calls, etc.
+   GCC's generalized lvalues, function calls, etc.
 
    - We don't support floating point.  Many places where we switch on
-     some type don't bother to include cases for floating point; there
-     may be even more subtle ways this assumption exists.  For
-     example, the arguments to % must be integers.
+   some type don't bother to include cases for floating point; there
+   may be even more subtle ways this assumption exists.  For
+   example, the arguments to % must be integers.
 
    - We assume all subexpressions have a static, unchanging type.  If
-     we tried to support convenience variables, this would be a
-     problem.
+   we tried to support convenience variables, this would be a
+   problem.
 
    - All values on the stack should always be fully zero- or
-     sign-extended.
-
-     (I wasn't sure whether to choose this or its opposite --- that
-     only addresses are assumed extended --- but it turns out that
-     neither convention completely eliminates spurious extend
-     operations (if everything is always extended, then you have to
-     extend after add, because it could overflow; if nothing is
-     extended, then you end up producing extends whenever you change
-     sizes), and this is simpler.)  */
-
+   sign-extended.
+
+   (I wasn't sure whether to choose this or its opposite --- that
+   only addresses are assumed extended --- but it turns out that
+   neither convention completely eliminates spurious extend
+   operations (if everything is always extended, then you have to
+   extend after add, because it could overflow; if nothing is
+   extended, then you end up producing extends whenever you change
+   sizes), and this is simpler.)  */
 \f
+
 /* Generating bytecode from GDB expressions: the `trace' kludge  */
 
 /* The compiler in this file is a general-purpose mechanism for
@@ -334,7 +335,7 @@ gen_traced_pop (ax, value)
       {
       case axs_rvalue:
        /* We don't trace rvalues, just the lvalues necessary to
-           produce them.  So just dispose of this value.  */
+          produce them.  So just dispose of this value.  */
        ax_simple (ax, aop_pop);
        break;
 
@@ -350,7 +351,7 @@ gen_traced_pop (ax, value)
          ax_const_l (ax, length);
          ax_simple (ax, aop_trace);
        }
-      break;
+       break;
 
       case axs_lvalue_register:
        /* We need to mention the register somewhere in the bytecode,
@@ -364,9 +365,9 @@ gen_traced_pop (ax, value)
     /* If we're not tracing, just pop the value.  */
     ax_simple (ax, aop_pop);
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: helper functions */
 
 /* Assume that the lower bits of the top of the stack is a value of
@@ -377,7 +378,7 @@ gen_sign_extend (ax, type)
      struct type *type;
 {
   /* Do we need to sign-extend this?  */
-  if (! TYPE_UNSIGNED (type))
+  if (!TYPE_UNSIGNED (type))
     ax_ext (ax, type->length * TARGET_CHAR_BIT);
 }
 
@@ -420,10 +421,18 @@ gen_fetch (ax, type)
          many bytes long is it?  */
       switch (type->length)
        {
-       case 8  / TARGET_CHAR_BIT: ax_simple (ax, aop_ref8 ); break;
-       case 16 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref16); break;
-       case 32 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref32); break;
-       case 64 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref64); break;
+       case 8 / TARGET_CHAR_BIT:
+         ax_simple (ax, aop_ref8);
+         break;
+       case 16 / TARGET_CHAR_BIT:
+         ax_simple (ax, aop_ref16);
+         break;
+       case 32 / TARGET_CHAR_BIT:
+         ax_simple (ax, aop_ref32);
+         break;
+       case 64 / TARGET_CHAR_BIT:
+         ax_simple (ax, aop_ref64);
+         break;
 
          /* Either our caller shouldn't have asked us to dereference
             that pointer (other code's fault), or we're not
@@ -438,9 +447,9 @@ gen_fetch (ax, type)
 
     default:
       /* Either our caller shouldn't have asked us to dereference that
-        pointer (other code's fault), or we're not implementing
-        something we should be (this code's fault).  In any case,
-        it's a bug the user shouldn't see.  */
+         pointer (other code's fault), or we're not implementing
+         something we should be (this code's fault).  In any case,
+         it's a bug the user shouldn't see.  */
       error ("GDB bug: ax-gdb.c (gen_fetch): bad type code");
     }
 }
@@ -465,9 +474,9 @@ gen_left_shift (ax, distance)
       ax_simple (ax, aop_rsh_unsigned);
     }
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: symbol references */
 
 /* Generate code to push the base address of the argument portion of
@@ -479,7 +488,7 @@ gen_frame_args_address (ax)
   long frame_reg, frame_offset;
 
   TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
-  ax_reg     (ax, frame_reg);
+  ax_reg (ax, frame_reg);
   gen_offset (ax, frame_offset);
 }
 
@@ -493,7 +502,7 @@ gen_frame_locals_address (ax)
   long frame_reg, frame_offset;
 
   TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
-  ax_reg     (ax, frame_reg);
+  ax_reg (ax, frame_reg);
   gen_offset (ax, frame_offset);
 }
 
@@ -620,9 +629,9 @@ gen_var_ref (ax, value, var)
       break;
 
       /* A lot like LOC_REF_ARG, but the pointer lives directly in a
-        register, not on the stack.  Simpler than LOC_REGISTER and
-        LOC_REGPARM, because it's just like any other case where the
-        thing has a real address.  */
+         register, not on the stack.  Simpler than LOC_REGISTER and
+         LOC_REGPARM, because it's just like any other case where the
+         thing has a real address.  */
     case LOC_REGPARM_ADDR:
       ax_reg (ax, SYMBOL_VALUE (var));
       value->kind = axs_lvalue_memory;
@@ -630,16 +639,16 @@ gen_var_ref (ax, value, var)
 
     case LOC_UNRESOLVED:
       {
-       struct minimal_symbol *msym 
-         = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
-       if (! msym)
+       struct minimal_symbol *msym
+       = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
+       if (!msym)
          error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var));
-       
+
        /* Push the address of the variable.  */
        ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
        value->kind = axs_lvalue_memory;
       }
-    break;
+      break;
 
     case LOC_OPTIMIZED_OUT:
       error ("The variable `%s' has been optimized out.",
@@ -652,9 +661,9 @@ gen_var_ref (ax, value, var)
       break;
     }
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: literals */
 
 static void
@@ -668,9 +677,9 @@ gen_int_literal (ax, value, k, type)
   value->kind = axs_rvalue;
   value->type = type;
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: unary conversions, casts */
 
 /* Take what's on the top of the stack (as described by VALUE), and
@@ -696,8 +705,8 @@ require_rvalue (ax, value)
       /* There's nothing on the stack, but value->u.reg is the
          register number containing the value.
 
-        When we add floating-point support, this is going to have to
-        change.  What about SPARC register pairs, for example?  */
+         When we add floating-point support, this is going to have to
+         change.  What about SPARC register pairs, for example?  */
       ax_reg (ax, value->u.reg);
       gen_extend (ax, value->type);
       break;
@@ -742,7 +751,7 @@ gen_usual_unary (ax, value)
       break;
 
       /* Arrays get converted to a pointer to their first element, and
-        are no longer an lvalue.  */
+         are no longer an lvalue.  */
     case TYPE_CODE_ARRAY:
       {
        struct type *elements = TYPE_TARGET_TYPE (value->type);
@@ -751,10 +760,10 @@ gen_usual_unary (ax, value)
        /* We don't need to generate any code; the address of the array
           is also the address of its first element.  */
       }
-    break;
+      break;
 
-    /* Don't try to convert structures and unions to rvalues.  Let the
-       consumer signal an error.  */
+      /* Don't try to convert structures and unions to rvalues.  Let the
+         consumer signal an error.  */
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
       return;
@@ -779,7 +788,7 @@ type_wider_than (type1, type2)
   return (TYPE_LENGTH (type1) > TYPE_LENGTH (type2)
          || (TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
              && TYPE_UNSIGNED (type1)
-             && ! TYPE_UNSIGNED (type2)));
+             && !TYPE_UNSIGNED (type2)));
 }
 
 
@@ -860,10 +869,10 @@ gen_usual_arithmetic (ax, value1, value2)
       && TYPE_CODE (value2->type) == TYPE_CODE_INT)
     {
       /* The ANSI integral promotions seem to work this way: Order the
-        integer types by size, and then by signedness: an n-bit
-        unsigned type is considered "wider" than an n-bit signed
-        type.  Promote to the "wider" of the two types, and always
-        promote at least to int.  */
+         integer types by size, and then by signedness: an n-bit
+         unsigned type is considered "wider" than an n-bit signed
+         type.  Promote to the "wider" of the two types, and always
+         promote at least to int.  */
       struct type *target = max_type (builtin_type_int,
                                      max_type (value1->type, value2->type));
 
@@ -893,12 +902,12 @@ gen_integral_promotions (ax, value)
      struct agent_expr *ax;
      struct axs_value *value;
 {
-  if (! type_wider_than (value->type, builtin_type_int))
+  if (!type_wider_than (value->type, builtin_type_int))
     {
       gen_conversion (ax, value->type, builtin_type_int);
       value->type = builtin_type_int;
     }
-  else if (! type_wider_than (value->type, builtin_type_unsigned_int))
+  else if (!type_wider_than (value->type, builtin_type_unsigned_int))
     {
       gen_conversion (ax, value->type, builtin_type_unsigned_int);
       value->type = builtin_type_unsigned_int;
@@ -940,16 +949,16 @@ gen_cast (ax, value, type)
          cast like this?  */
       value->type = type;
       break;
-      
+
     case TYPE_CODE_INT:
       gen_conversion (ax, value->type, type);
       break;
 
     case TYPE_CODE_VOID:
       /* We could pop the value, and rely on everyone else to check
-        the type and notice that this value doesn't occupy a stack
-        slot.  But for now, leave the value on the stack, and
-        preserve the "value == stack element" assumption.  */
+         the type and notice that this value doesn't occupy a stack
+         slot.  But for now, leave the value on the stack, and
+         preserve the "value == stack element" assumption.  */
       break;
 
     default:
@@ -958,9 +967,9 @@ gen_cast (ax, value, type)
 
   value->type = type;
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: arithmetic */
 
 /* Scale the integer on the top of the stack by the size of the target
@@ -1000,7 +1009,7 @@ gen_add (ax, value, value1, value2, name)
       ax_simple (ax, aop_swap);
       gen_scale (ax, aop_mul, value2->type);
       ax_simple (ax, aop_add);
-      gen_extend (ax, value2->type); /* Catch overflow.  */
+      gen_extend (ax, value2->type);   /* Catch overflow.  */
       value->type = value2->type;
     }
 
@@ -1010,7 +1019,7 @@ gen_add (ax, value, value1, value2, name)
     {
       gen_scale (ax, aop_mul, value1->type);
       ax_simple (ax, aop_add);
-      gen_extend (ax, value1->type); /* Catch overflow.  */
+      gen_extend (ax, value1->type);   /* Catch overflow.  */
       value->type = value1->type;
     }
 
@@ -1020,7 +1029,7 @@ gen_add (ax, value, value1, value2, name)
           && value2->type->code == TYPE_CODE_INT)
     {
       ax_simple (ax, aop_add);
-      gen_extend (ax, value1->type); /* Catch overflow.  */
+      gen_extend (ax, value1->type);   /* Catch overflow.  */
       value->type = value1->type;
     }
 
@@ -1049,20 +1058,20 @@ gen_sub (ax, value, value1, value2)
        {
          gen_scale (ax, aop_mul, value1->type);
          ax_simple (ax, aop_sub);
-         gen_extend (ax, value1->type); /* Catch overflow.  */
+         gen_extend (ax, value1->type);        /* Catch overflow.  */
          value->type = value1->type;
        }
 
       /* Is it PTR - PTR?  Strictly speaking, the types ought to
-        match, but this is what the normal GDB expression evaluator
-        tests for.  */
+         match, but this is what the normal GDB expression evaluator
+         tests for.  */
       else if (value2->type->code == TYPE_CODE_PTR
               && (TYPE_LENGTH (TYPE_TARGET_TYPE (value1->type))
                   == TYPE_LENGTH (TYPE_TARGET_TYPE (value2->type))))
        {
          ax_simple (ax, aop_sub);
          gen_scale (ax, aop_div_unsigned, value1->type);
-         value->type = builtin_type_long; /* FIXME --- should be ptrdiff_t */
+         value->type = builtin_type_long;      /* FIXME --- should be ptrdiff_t */
        }
       else
        error ("\
@@ -1075,10 +1084,10 @@ an integer nor a pointer of the same type.");
           && value2->type->code == TYPE_CODE_INT)
     {
       ax_simple (ax, aop_sub);
-      gen_extend (ax, value1->type); /* Catch overflow.  */
+      gen_extend (ax, value1->type);   /* Catch overflow.  */
       value->type = value1->type;
     }
-  
+
   else
     error ("Illegal combination of types in subtraction.");
 
@@ -1103,11 +1112,11 @@ gen_binop (ax, value, value1, value2, op, op_unsigned, may_carry, name)
   if ((value1->type->code != TYPE_CODE_INT)
       || (value2->type->code != TYPE_CODE_INT))
     error ("Illegal combination of types in %s.", name);
-  
+
   ax_simple (ax,
             TYPE_UNSIGNED (value1->type) ? op_unsigned : op);
   if (may_carry)
-    gen_extend (ax, value1->type); /* catch overflow */
+    gen_extend (ax, value1->type);     /* catch overflow */
   value->type = value1->type;
   value->kind = axs_rvalue;
 }
@@ -1141,9 +1150,9 @@ gen_complement (ax, value)
   ax_simple (ax, aop_bit_not);
   gen_extend (ax, value->type);
 }
+\f
 
 
-\f
 /* Generating bytecode from GDB expressions: * & . -> @ sizeof */
 
 /* Dereference the value on the top of the stack.  */
@@ -1247,7 +1256,8 @@ gen_bitfield_ref (ax, value, type, start, end)
 {
   /* Note that ops[i] fetches 8 << i bits.  */
   static enum agent_op ops[]
-    = { aop_ref8, aop_ref16, aop_ref32, aop_ref64 };
+  =
+  {aop_ref8, aop_ref16, aop_ref32, aop_ref64};
   static int num_ops = (sizeof (ops) / sizeof (ops[0]));
 
   /* We don't want to touch any byte that the bitfield doesn't
@@ -1258,19 +1268,19 @@ gen_bitfield_ref (ax, value, type, start, end)
      It takes some fancy footwork to get the stack to work the way
      we'd like.  Say we're retrieving a bitfield that requires three
      fetches.  Initially, the stack just contains the address:
-               addr
+     addr
      For the first fetch, we duplicate the address
-               addr addr
+     addr addr
      then add the byte offset, do the fetch, and shift and mask as
      needed, yielding a fragment of the value, properly aligned for
      the final bitwise or:
-                addr frag1
+     addr frag1
      then we swap, and repeat the process:
-                frag1 addr                    --- address on top
-               frag1 addr addr               --- duplicate it
-                frag1 addr frag2              --- get second fragment
-                frag1 frag2 addr              --- swap again
-                frag1 frag2 frag3             --- get third fragment
+     frag1 addr                    --- address on top
+     frag1 addr addr               --- duplicate it
+     frag1 addr frag2              --- get second fragment
+     frag1 frag2 addr              --- swap again
+     frag1 frag2 frag3             --- get third fragment
      Notice that, since the third fragment is the last one, we don't
      bother duplicating the address this time.  Now we have all the
      fragments on the stack, and we can simply `or' them together,
@@ -1279,9 +1289,9 @@ gen_bitfield_ref (ax, value, type, start, end)
   /* The first and one-after-last bits in the field, but rounded down
      and up to byte boundaries.  */
   int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
-  int bound_end   = (((end + TARGET_CHAR_BIT - 1)
-                     / TARGET_CHAR_BIT)
-                    * TARGET_CHAR_BIT);
+  int bound_end = (((end + TARGET_CHAR_BIT - 1)
+                   / TARGET_CHAR_BIT)
+                  * TARGET_CHAR_BIT);
 
   /* current bit offset within the structure */
   int offset;
@@ -1310,17 +1320,17 @@ gen_bitfield_ref (ax, value, type, start, end)
       int op_size = 8 << op;
 
       /* The stack at this point, from bottom to top, contains zero or
-        more fragments, then the address.  */
-      
+         more fragments, then the address.  */
+
       /* Does this fetch fit within the bitfield?  */
       if (offset + op_size <= bound_end)
        {
          /* Is this the last fragment?  */
          int last_frag = (offset + op_size == bound_end);
 
-         if (! last_frag)
-           ax_simple (ax, aop_dup); /* keep a copy of the address */
-         
+         if (!last_frag)
+           ax_simple (ax, aop_dup);    /* keep a copy of the address */
+
          /* Add the offset.  */
          gen_offset (ax, offset / TARGET_CHAR_BIT);
 
@@ -1332,47 +1342,47 @@ gen_bitfield_ref (ax, value, type, start, end)
 
          /* Perform the fetch.  */
          ax_simple (ax, ops[op]);
-       
-          /* Shift the bits we have to their proper position.
+
+         /* Shift the bits we have to their proper position.
             gen_left_shift will generate right shifts when the operand
             is negative.
 
-             A big-endian field diagram to ponder:
-              byte 0  byte 1  byte 2  byte 3  byte 4  byte 5  byte 6  byte 7
-             +------++------++------++------++------++------++------++------+
-             xxxxAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCxxxxxxxxxxx
-                             ^               ^               ^    ^
-             bit number      16              32              48   53
+            A big-endian field diagram to ponder:
+            byte 0  byte 1  byte 2  byte 3  byte 4  byte 5  byte 6  byte 7
+            +------++------++------++------++------++------++------++------+
+            xxxxAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCxxxxxxxxxxx
+            ^               ^               ^    ^
+            bit number      16              32              48   53
             These are bit numbers as supplied by GDB.  Note that the
             bit numbers run from right to left once you've fetched the
             value!
 
-             A little-endian field diagram to ponder:
-              byte 7  byte 6  byte 5  byte 4  byte 3  byte 2  byte 1  byte 0
-             +------++------++------++------++------++------++------++------+
-             xxxxxxxxxxxAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCxxxx
-                            ^               ^               ^           ^   ^
-             bit number     48              32              16          4   0
-
-             In both cases, the most significant end is on the left
-             (i.e. normal numeric writing order), which means that you
-             don't go crazy thinking about `left' and `right' shifts.
-
-             We don't have to worry about masking yet:
-             - If they contain garbage off the least significant end, then we
-               must be looking at the low end of the field, and the right
-               shift will wipe them out.
-             - If they contain garbage off the most significant end, then we
-               must be looking at the most significant end of the word, and
-               the sign/zero extension will wipe them out.
-             - If we're in the interior of the word, then there is no garbage
-               on either end, because the ref operators zero-extend.  */
+            A little-endian field diagram to ponder:
+            byte 7  byte 6  byte 5  byte 4  byte 3  byte 2  byte 1  byte 0
+            +------++------++------++------++------++------++------++------+
+            xxxxxxxxxxxAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCxxxx
+            ^               ^               ^           ^   ^
+            bit number     48              32              16          4   0
+
+            In both cases, the most significant end is on the left
+            (i.e. normal numeric writing order), which means that you
+            don't go crazy thinking about `left' and `right' shifts.
+
+            We don't have to worry about masking yet:
+            - If they contain garbage off the least significant end, then we
+            must be looking at the low end of the field, and the right
+            shift will wipe them out.
+            - If they contain garbage off the most significant end, then we
+            must be looking at the most significant end of the word, and
+            the sign/zero extension will wipe them out.
+            - If we're in the interior of the word, then there is no garbage
+            on either end, because the ref operators zero-extend.  */
          if (TARGET_BYTE_ORDER == BIG_ENDIAN)
            gen_left_shift (ax, end - (offset + op_size));
-         else 
+         else
            gen_left_shift (ax, offset - start);
 
-         if (! last_frag)
+         if (!last_frag)
            /* Bring the copy of the address up to the top.  */
            ax_simple (ax, aop_swap);
 
@@ -1433,7 +1443,7 @@ gen_struct_ref (ax, value, field, operator_name, operand_name)
     error ("Structure does not live in memory.");
 
   i = find_field (type, field);
-  
+
   /* Is this a bitfield?  */
   if (TYPE_FIELD_PACKED (type, i))
     gen_bitfield_ref (ax, value, TYPE_FIELD_TYPE (type, i),
@@ -1478,7 +1488,7 @@ gen_repeat (pc, ax, value)
     struct value *v = const_expr (pc);
     int length;
 
-    if (! v)
+    if (!v)
       error ("Right operand of `@' must be a constant, in agent expressions.");
     if (v->type->code != TYPE_CODE_INT)
       error ("Right operand of `@' must be an integer.");
@@ -1490,9 +1500,9 @@ gen_repeat (pc, ax, value)
        all we need to do is frob the type of the lvalue.  */
     {
       /* FIXME-type-allocation: need a way to free this type when we are
-        done with it.  */
+         done with it.  */
       struct type *range
-       = create_range_type (0, builtin_type_int, 0, length - 1);
+      = create_range_type (0, builtin_type_int, 0, length - 1);
       struct type *array = create_array_type (0, value1.type, range);
 
       value->kind = axs_lvalue_memory;
@@ -1521,13 +1531,13 @@ gen_sizeof (pc, ax, value)
 
   /* Throw away the code we just generated.  */
   ax->len = start;
-  
+
   ax_const_l (ax, TYPE_LENGTH (value->type));
   value->kind = axs_rvalue;
   value->type = builtin_type_int;
 }
-
 \f
+
 /* Generating bytecode from GDB expressions: general recursive thingy  */
 
 /* A gen_expr function written by a Gen-X'er guy.
@@ -1545,7 +1555,7 @@ gen_expr (pc, ax, value)
   /* If we're looking at a constant expression, just push its value.  */
   {
     struct value *v = maybe_const_expr (pc);
-    
+
     if (v)
       {
        ax_const_l (ax, value_as_long (v));
@@ -1617,28 +1627,28 @@ gen_expr (pc, ax, value)
 
        default:
          /* We should only list operators in the outer case statement
-             that we actually handle in the inner case statement.  */
+            that we actually handle in the inner case statement.  */
          error ("GDB bug: ax-gdb.c (gen_expr): op case sets don't match");
        }
       break;
 
       /* Note that we need to be a little subtle about generating code
-        for comma.  In C, we can do some optimizations here because
-        we know the left operand is only being evaluated for effect.
-        However, if the tracing kludge is in effect, then we always
-        need to evaluate the left hand side fully, so that all the
-        variables it mentions get traced.  */
+         for comma.  In C, we can do some optimizations here because
+         we know the left operand is only being evaluated for effect.
+         However, if the tracing kludge is in effect, then we always
+         need to evaluate the left hand side fully, so that all the
+         variables it mentions get traced.  */
     case BINOP_COMMA:
       (*pc)++;
       gen_expr (pc, ax, &value1);
       /* Don't just dispose of the left operand.  We might be tracing,
-        in which case we want to emit code to trace it if it's an
-        lvalue.  */
+         in which case we want to emit code to trace it if it's an
+         lvalue.  */
       gen_traced_pop (ax, &value1);
       gen_expr (pc, ax, value);
       /* It's the consumer's responsibility to trace the right operand.  */
       break;
-      
+
     case OP_LONG:              /* some integer constant */
       {
        struct type *type = (*pc)[1].type;
@@ -1646,7 +1656,7 @@ gen_expr (pc, ax, value)
        (*pc) += 4;
        gen_int_literal (ax, value, k, type);
       }
-    break;
+      break;
 
     case OP_VAR_VALUE:
       gen_var_ref (ax, value, (*pc)[2].symbol);
@@ -1661,12 +1671,12 @@ gen_expr (pc, ax, value)
        value->u.reg = reg;
        value->type = REGISTER_VIRTUAL_TYPE (reg);
       }
-    break;
+      break;
 
     case OP_INTERNALVAR:
       error ("GDB agent expressions cannot use convenience variables.");
 
-    /* Weirdo operator: see comments for gen_repeat for details.  */
+      /* Weirdo operator: see comments for gen_repeat for details.  */
     case BINOP_REPEAT:
       /* Note that gen_repeat handles its own argument evaluation.  */
       (*pc)++;
@@ -1680,7 +1690,7 @@ gen_expr (pc, ax, value)
        gen_expr (pc, ax, value);
        gen_cast (ax, value, type);
       }
-    break;
+      break;
 
     case UNOP_MEMVAL:
       {
@@ -1697,13 +1707,13 @@ gen_expr (pc, ax, value)
        value->type = type;
        value->kind = axs_lvalue_memory;
       }
-    break;
+      break;
 
     case UNOP_NEG:
       (*pc)++;
       /* -FOO is equivalent to 0 - FOO.  */
       gen_int_literal (ax, &value1, (LONGEST) 0, builtin_type_int);
-      gen_usual_unary (ax, &value1); /* shouldn't do much */
+      gen_usual_unary (ax, &value1);   /* shouldn't do much */
       gen_expr (pc, ax, &value2);
       gen_usual_unary (ax, &value2);
       gen_usual_arithmetic (ax, &value1, &value2);
@@ -1740,8 +1750,8 @@ gen_expr (pc, ax, value)
     case UNOP_SIZEOF:
       (*pc)++;
       /* Notice that gen_sizeof handles its own operand, unlike most
-        of the other unary operator functions.  This is because we
-        have to throw away the code we generate.  */
+         of the other unary operator functions.  This is because we
+         have to throw away the code we generate.  */
       gen_sizeof (pc, ax, value);
       break;
 
@@ -1760,10 +1770,10 @@ gen_expr (pc, ax, value)
                          "pointer to a structure or union");
        else
          /* If this `if' chain doesn't handle it, then the case list
-             shouldn't mention it, and we shouldn't be here.  */
+            shouldn't mention it, and we shouldn't be here.  */
          error ("GDB bug: ax-gdb.c (gen_expr): unhandled struct case");
       }
-    break;
+      break;
 
     case OP_TYPE:
       error ("Attempt to use a type name as an expression.");
@@ -1772,10 +1782,10 @@ gen_expr (pc, ax, value)
       error ("Unsupported operator in expression.");
     }
 }
-     
-
 \f
-#if 0  /* not used */
+
+
+#if 0                          /* not used */
 /* Generating bytecode from GDB expressions: driver */
 
 /* Given a GDB expression EXPR, produce a string of agent bytecode
@@ -1863,9 +1873,9 @@ gen_trace_for_expr (scope, expr)
   discard_cleanups (old_chain);
   return ax;
 }
+\f
 
 
-\f
 /* The "agent" command, for testing: compile and disassemble an expression.  */
 
 static void
@@ -1901,7 +1911,7 @@ agent_command (exp, from_tty)
   struct cleanup *old_chain = 0;
   struct expression *expr;
   struct agent_expr *agent;
-  struct frame_info *fi = get_current_frame ();        /* need current scope */
+  struct frame_info *fi = get_current_frame ();                /* need current scope */
 
   /* We don't deal with overlay debugging at the moment.  We need to
      think more carefully about this.  If you copy this code into
@@ -1912,7 +1922,7 @@ agent_command (exp, from_tty)
 
   if (exp == 0)
     error_no_arg ("expression to translate");
-  
+
   expr = parse_expression (exp);
   old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
   agent = gen_trace_for_expr (fi->pc, expr);
@@ -1925,8 +1935,8 @@ agent_command (exp, from_tty)
   do_cleanups (old_chain);
   dont_repeat ();
 }
-
 \f
+
 /* Initialization code.  */
 
 void _initialize_ax_gdb PARAMS ((void));
index feab1881b7b22d717fe4a61ff66a19bc0b677b87..3764b692e6426da93d8cb2859fba21a5cc3cf6e3 100644 (file)
@@ -1,26 +1,27 @@
 /* GDB-specific functions for operating on agent expressions
    Copyright 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef AX_GDB_H
 #define AX_GDB_H
-
 \f
+
 /* Types and enums */
 
 /* GDB stores expressions in the form of a flattened tree (struct
@@ -48,62 +49,66 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
 /* Different kinds of agent expression static values.  */
-enum axs_lvalue_kind {
-  /* We generated code to compute the subexpression's value.
-     Constants and arithmetic operators yield this.  */
-  axs_rvalue,
-
-  /* We generated code to yield the subexpression's value's address on
-     the top of the stack.  If the caller needs an rvalue, it should
-     call require_rvalue to produce the rvalue from this address.  */
-  axs_lvalue_memory,
-
-  /* We didn't generate any code, and the stack is undisturbed,
-     because the subexpression's value lives in a register; u.reg is
-     the register number.  If the caller needs an rvalue, it should
-     call require_rvalue to produce the rvalue from this register
-     number.  */
-  axs_lvalue_register
-};
+enum axs_lvalue_kind
+  {
+    /* We generated code to compute the subexpression's value.
+       Constants and arithmetic operators yield this.  */
+    axs_rvalue,
+
+    /* We generated code to yield the subexpression's value's address on
+       the top of the stack.  If the caller needs an rvalue, it should
+       call require_rvalue to produce the rvalue from this address.  */
+    axs_lvalue_memory,
+
+    /* We didn't generate any code, and the stack is undisturbed,
+       because the subexpression's value lives in a register; u.reg is
+       the register number.  If the caller needs an rvalue, it should
+       call require_rvalue to produce the rvalue from this register
+       number.  */
+    axs_lvalue_register
+  };
 
 /* Structure describing what we got from a subexpression.  Think of
    this as parallel to value.h's enum lval_type, except that we're
    describing a value which will exist when the expression is
    evaluated in the future, not a value we have in our hand.  */
-struct axs_value {
-  enum axs_lvalue_kind kind;   /* see above */
-
-  /* The type of the subexpression.  Even if lvalue == axs_lvalue_memory,
-     this is the type of the value itself; the value on the stack is a
-     "pointer to" an object of this type. */
-  struct type *type;
-
-  union {
-    /* if kind == axs_lvalue_register, this is the register number */
-    int reg;
-  } u;
-};
-
+struct axs_value
+  {
+    enum axs_lvalue_kind kind; /* see above */
+
+    /* The type of the subexpression.  Even if lvalue == axs_lvalue_memory,
+       this is the type of the value itself; the value on the stack is a
+       "pointer to" an object of this type. */
+    struct type *type;
+
+    union
+      {
+       /* if kind == axs_lvalue_register, this is the register number */
+       int reg;
+      }
+    u;
+  };
 \f
+
 /* Translating GDB expressions into agent expressions.  */
 
 /* Given a GDB expression EXPR, translate it into the agent bytecode,
    and return it.  FLAGS are from enum expr_to_agent_flags.  */
-extern struct agent_expr *expr_to_agent PARAMS ((struct expression *EXPR,
-                                                struct axs_value *VALUE));
+extern struct agent_expr *expr_to_agent PARAMS ((struct expression * EXPR,
+                                                struct axs_value * VALUE));
 
 /* Given a GDB expression EXPR denoting an lvalue in memory, produce a
    string of agent bytecode which will leave its address and size on
    the top of stack.  Return the agent expression.  */
 extern struct agent_expr *expr_to_address_and_size
-                         PARAMS ((struct expression *EXPR));
+  PARAMS ((struct expression * EXPR));
 
 /* Given a GDB expression EXPR, return bytecode to trace its value.
    The result will use the `trace' and `trace_quick' bytecodes to
    record the value of all memory touched by the expression, and leave
    no values on the stack.  The caller can then use the ax_reqs
    function to discover which registers the expression uses.  */
-extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR, 
+extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR,
                                                      struct expression *));
 
 #endif /* AX_GDB_H */
index 072817d73d42aba1ae305b92ad38e127f6ec9df5..6020ed7da1a62937a55a904763991b78e9bd33ea 100644 (file)
@@ -1,21 +1,22 @@
 /* Functions for manipulating expressions designed to be executed on the agent
    Copyright 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Despite what the above comment says about this file being part of
    GDB, we would like to keep these functions free of GDB
@@ -27,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "value.h"
 
-static void grow_expr PARAMS ((struct agent_expr *x, int n));
+static void grow_expr PARAMS ((struct agent_expr * x, int n));
 
-static void append_const PARAMS ((struct agent_expr *x, LONGEST val, int n));
+static void append_const PARAMS ((struct agent_expr * x, LONGEST val, int n));
 
-static LONGEST read_const PARAMS ((struct agent_expr *x, int o, int n));
+static LONGEST read_const PARAMS ((struct agent_expr * x, int o, int n));
 
-static void generic_ext PARAMS ((struct agent_expr *x, enum agent_op op, int n));
+static void generic_ext PARAMS ((struct agent_expr * x, enum agent_op op, int n));
 \f
 /* Functions for building expressions.  */
 
@@ -43,10 +44,10 @@ new_agent_expr (scope)
      CORE_ADDR scope;
 {
   struct agent_expr *x = xmalloc (sizeof (*x));
-  x->len  = 0;
+  x->len = 0;
   x->size = 1;                 /* Change this to a larger value once
                                   reallocation code is tested.  */
-  x->buf   = xmalloc (x->size);
+  x->buf = xmalloc (x->size);
   x->scope = scope;
 
   return x;
@@ -115,7 +116,7 @@ read_const (x, o, n)
 
   for (i = 0; i < n; i++)
     accum = (accum << 8) | x->buf[o + i];
-  
+
   return accum;
 }
 
@@ -194,7 +195,8 @@ ax_trace_quick (x, n)
    for the target, and return the offset in EXPR of that space, so we
    can backpatch it once we do know the target offset.  Use ax_label
    to do the backpatching.  */
-int ax_goto (x, op)
+int
+ax_goto (x, op)
      struct agent_expr *x;
      enum agent_op op;
 {
@@ -208,7 +210,7 @@ int ax_goto (x, op)
 
 /* Suppose a given call to ax_goto returns some value PATCH.  When you
    know the offset TARGET that goto should jump to, call
-       ax_label (EXPR, PATCH, TARGET)
+   ax_label (EXPR, PATCH, TARGET)
    to patch TARGET into the ax_goto instruction.  */
 void
 ax_label (x, patch, target)
@@ -220,7 +222,7 @@ ax_label (x, patch, target)
      offset; that's our magic sentinel value for unpatched branches.  */
   if (target < 0 || target >= 0xffff)
     error ("GDB bug: ax-general.c (ax_label): label target out of range");
-  
+
   x->buf[patch] = (target >> 8) & 0xff;
   x->buf[patch + 1] = target & 0xff;
 }
@@ -233,7 +235,8 @@ ax_const_l (x, l)
      LONGEST l;
 {
   static enum agent_op ops[]
-    = { aop_const8, aop_const16, aop_const32, aop_const64 };
+  =
+  {aop_const8, aop_const16, aop_const32, aop_const64};
   int size;
   int op;
 
@@ -270,7 +273,8 @@ ax_const_d (x, d)
 
 /* Assemble code to push the value of register number REG on the
    stack.  */
-void ax_reg (x, reg)
+void
+ax_reg (x, reg)
      struct agent_expr *x;
      int reg;
 {
@@ -278,67 +282,68 @@ void ax_reg (x, reg)
   if (reg < 0 || reg > 0xffff)
     error ("GDB bug: ax-general.c (ax_reg): register number out of range");
   grow_expr (x, 3);
-  x->buf[x->len    ] = aop_reg;
+  x->buf[x->len] = aop_reg;
   x->buf[x->len + 1] = (reg >> 8) & 0xff;
-  x->buf[x->len + 2] = (reg     ) & 0xff;
+  x->buf[x->len + 2] = (reg) & 0xff;
   x->len += 3;
 }
+\f
 
 
-\f
 /* Functions for disassembling agent expressions, and otherwise
    debugging the expression compiler.  */
 
-struct aop_map aop_map[] = {
-  { 0, 0, 0, 0, 0 },
-  { "float", 0, 0, 0, 0 },                /* 0x01 */
-  { "add", 0, 0, 2, 1 },                  /* 0x02 */
-  { "sub", 0, 0, 2, 1 },                  /* 0x03 */
-  { "mul", 0, 0, 2, 1 },                  /* 0x04 */
-  { "div_signed", 0, 0, 2, 1 },                   /* 0x05 */
-  { "div_unsigned", 0, 0, 2, 1 },         /* 0x06 */
-  { "rem_signed", 0, 0, 2, 1 },                   /* 0x07 */
-  { "rem_unsigned", 0, 0, 2, 1 },         /* 0x08 */
-  { "lsh", 0, 0, 2, 1 },                  /* 0x09 */
-  { "rsh_signed", 0, 0, 2, 1 },                   /* 0x0a */
-  { "rsh_unsigned", 0, 0, 2, 1 },         /* 0x0b */
-  { "trace", 0, 0, 2, 0 },                /* 0x0c */
-  { "trace_quick", 1, 0, 1, 1 },          /* 0x0d */
-  { "log_not", 0, 0, 1, 1 },              /* 0x0e */
-  { "bit_and", 0, 0, 2, 1 },              /* 0x0f */
-  { "bit_or", 0, 0, 2, 1 },               /* 0x10 */
-  { "bit_xor", 0, 0, 2, 1 },              /* 0x11 */
-  { "bit_not", 0, 0, 1, 1 },              /* 0x12 */
-  { "equal", 0, 0, 2, 1 },                /* 0x13 */
-  { "less_signed", 0, 0, 2, 1 },          /* 0x14 */
-  { "less_unsigned", 0, 0, 2, 1 },        /* 0x15 */
-  { "ext", 1, 0, 1, 1 },                  /* 0x16 */
-  { "ref8", 0, 8, 1, 1 },                 /* 0x17 */
-  { "ref16", 0, 16, 1, 1 },               /* 0x18 */
-  { "ref32", 0, 32, 1, 1 },               /* 0x19 */
-  { "ref64", 0, 64, 1, 1 },               /* 0x1a */
-  { "ref_float", 0, 0, 1, 1 },            /* 0x1b */
-  { "ref_double", 0, 0, 1, 1 },                   /* 0x1c */
-  { "ref_long_double", 0, 0, 1, 1 },      /* 0x1d */
-  { "l_to_d", 0, 0, 1, 1 },               /* 0x1e */
-  { "d_to_l", 0, 0, 1, 1 },               /* 0x1f */
-  { "if_goto", 2, 0, 1, 0 },              /* 0x20 */
-  { "goto", 2, 0, 0, 0 },                 /* 0x21 */
-  { "const8", 1, 8, 0, 1 },               /* 0x22 */
-  { "const16", 2, 16, 0, 1 },             /* 0x23 */
-  { "const32", 4, 32, 0, 1 },             /* 0x24 */
-  { "const64", 8, 64, 0, 1 },             /* 0x25 */
-  { "reg", 2, 0, 0, 1 },                  /* 0x26 */
-  { "end", 0, 0, 0, 0 },                  /* 0x27 */
-  { "dup", 0, 0, 1, 2 },                  /* 0x28 */
-  { "pop", 0, 0, 1, 0 },                  /* 0x29 */
-  { "zero_ext", 1, 0, 1, 1 },             /* 0x2a */
-  { "swap", 0, 0, 2, 2 },                 /* 0x2b */
-  { 0, 0, 0, 0, 0 },                      /* 0x2c */
-  { 0, 0, 0, 0, 0 },                      /* 0x2d */
-  { 0, 0, 0, 0, 0 },                      /* 0x2e */
-  { 0, 0, 0, 0, 0 },                      /* 0x2f */
-  { "trace16", 2, 0, 1, 1 },              /* 0x30 */
+struct aop_map aop_map[] =
+{
+  {0, 0, 0, 0, 0},
+  {"float", 0, 0, 0, 0},       /* 0x01 */
+  {"add", 0, 0, 2, 1},         /* 0x02 */
+  {"sub", 0, 0, 2, 1},         /* 0x03 */
+  {"mul", 0, 0, 2, 1},         /* 0x04 */
+  {"div_signed", 0, 0, 2, 1},  /* 0x05 */
+  {"div_unsigned", 0, 0, 2, 1},        /* 0x06 */
+  {"rem_signed", 0, 0, 2, 1},  /* 0x07 */
+  {"rem_unsigned", 0, 0, 2, 1},        /* 0x08 */
+  {"lsh", 0, 0, 2, 1},         /* 0x09 */
+  {"rsh_signed", 0, 0, 2, 1},  /* 0x0a */
+  {"rsh_unsigned", 0, 0, 2, 1},        /* 0x0b */
+  {"trace", 0, 0, 2, 0},       /* 0x0c */
+  {"trace_quick", 1, 0, 1, 1}, /* 0x0d */
+  {"log_not", 0, 0, 1, 1},     /* 0x0e */
+  {"bit_and", 0, 0, 2, 1},     /* 0x0f */
+  {"bit_or", 0, 0, 2, 1},      /* 0x10 */
+  {"bit_xor", 0, 0, 2, 1},     /* 0x11 */
+  {"bit_not", 0, 0, 1, 1},     /* 0x12 */
+  {"equal", 0, 0, 2, 1},       /* 0x13 */
+  {"less_signed", 0, 0, 2, 1}, /* 0x14 */
+  {"less_unsigned", 0, 0, 2, 1},       /* 0x15 */
+  {"ext", 1, 0, 1, 1},         /* 0x16 */
+  {"ref8", 0, 8, 1, 1},                /* 0x17 */
+  {"ref16", 0, 16, 1, 1},      /* 0x18 */
+  {"ref32", 0, 32, 1, 1},      /* 0x19 */
+  {"ref64", 0, 64, 1, 1},      /* 0x1a */
+  {"ref_float", 0, 0, 1, 1},   /* 0x1b */
+  {"ref_double", 0, 0, 1, 1},  /* 0x1c */
+  {"ref_long_double", 0, 0, 1, 1},     /* 0x1d */
+  {"l_to_d", 0, 0, 1, 1},      /* 0x1e */
+  {"d_to_l", 0, 0, 1, 1},      /* 0x1f */
+  {"if_goto", 2, 0, 1, 0},     /* 0x20 */
+  {"goto", 2, 0, 0, 0},                /* 0x21 */
+  {"const8", 1, 8, 0, 1},      /* 0x22 */
+  {"const16", 2, 16, 0, 1},    /* 0x23 */
+  {"const32", 4, 32, 0, 1},    /* 0x24 */
+  {"const64", 8, 64, 0, 1},    /* 0x25 */
+  {"reg", 2, 0, 0, 1},         /* 0x26 */
+  {"end", 0, 0, 0, 0},         /* 0x27 */
+  {"dup", 0, 0, 1, 2},         /* 0x28 */
+  {"pop", 0, 0, 1, 0},         /* 0x29 */
+  {"zero_ext", 1, 0, 1, 1},    /* 0x2a */
+  {"swap", 0, 0, 2, 2},                /* 0x2b */
+  {0, 0, 0, 0, 0},             /* 0x2c */
+  {0, 0, 0, 0, 0},             /* 0x2d */
+  {0, 0, 0, 0, 0},             /* 0x2e */
+  {0, 0, 0, 0, 0},             /* 0x2f */
+  {"trace16", 2, 0, 1, 1},     /* 0x30 */
 };
 
 
@@ -356,13 +361,13 @@ ax_print (f, x)
   if ((sizeof (aop_map) / sizeof (aop_map[0]))
       != aop_last)
     error ("GDB bug: ax-general.c (ax_print): opcode map out of sync");
-  
-  for (i = 0; i < x->len; )
+
+  for (i = 0; i < x->len;)
     {
       enum agent_op op = x->buf[i];
 
       if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
-         || ! aop_map[op].name)
+         || !aop_map[op].name)
        {
          fprintf_filtered (f, "%3d  <bad opcode %02x>\n", i, op);
          i++;
@@ -379,7 +384,7 @@ ax_print (f, x)
       if (aop_map[op].op_size > 0)
        {
          fputs_filtered (" ", f);
-         
+
          print_longest (f, 'd', 0,
                         read_const (x, i + 1, aop_map[op].op_size));
        }
@@ -440,13 +445,13 @@ ax_reqs (ax, reqs)
 
       op = &aop_map[ax->buf[i]];
 
-      if (! op->name)
+      if (!op->name)
        {
          reqs->flaw = agent_flaw_bad_instruction;
          free (reg_mask);
          return;
        }
-       
+
       if (i + 1 + op->op_size > ax->len)
        {
          reqs->flaw = agent_flaw_incomplete_instruction;
@@ -477,8 +482,8 @@ ax_reqs (ax, reqs)
        reqs->max_data_size = op->data_size;
 
       /* For jump instructions, check that the target is a valid
-        offset.  If it is, record the fact that that location is a
-        jump target, and record the height we expect there.  */
+         offset.  If it is, record the fact that that location is a
+         jump target, and record the height we expect there.  */
       if (aop_goto == op - aop_map
          || aop_if_goto == op - aop_map)
        {
@@ -505,13 +510,13 @@ ax_reqs (ax, reqs)
              heights[target] = height;
            }
        }
-      
+
       /* For unconditional jumps with a successor, check that the
          successor is a target, and pick up its stack height.  */
       if (aop_goto == op - aop_map
          && i + 3 < ax->len)
        {
-         if (! targets[i + 3])
+         if (!targets[i + 3])
            {
              reqs->flaw = agent_flaw_hole;
              free (reg_mask);
@@ -531,9 +536,9 @@ ax_reqs (ax, reqs)
          if (byte >= reg_mask_len)
            {
              /* It's not appropriate to double here.  This isn't a
-                 string buffer.  */
+                string buffer.  */
              int new_len = byte + 1;
-             reg_mask = xrealloc (reg_mask, 
+             reg_mask = xrealloc (reg_mask,
                                   new_len * sizeof (reg_mask[0]));
              memset (reg_mask + reg_mask_len, 0,
                      (new_len - reg_mask_len) * sizeof (reg_mask[0]));
index 069dd997509ac5128366c7386d39f4c83d348c62..0467626aeb2ced0c427b27cadda53357355f6c05 100644 (file)
--- a/gdb/ax.h
+++ b/gdb/ax.h
@@ -1,21 +1,22 @@
 /* Definitions for expressions designed to be executed on the agent
    Copyright 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef AGENTEXPR_H
 #define AGENTEXPR_H
@@ -47,8 +48,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    is independent of symbolic information.  This means the agent can
    evaluate them on the fly without reference to data only available
    to the host GDB.  */
-
 \f
+
 /* Agent expression data structures.  */
 
 /* The type of an element of the agent expression stack.
@@ -56,18 +57,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    the value itself has no typing information.  GDB generates all
    bytecode streams, so we don't have to worry about type errors.  */
 
-union agent_val {
-  LONGEST l;
-  DOUBLEST d;
-};
+union agent_val
+  {
+    LONGEST l;
+    DOUBLEST d;
+  };
 
 /* A buffer containing a agent expression.  */
-struct agent_expr {
-  unsigned char *buf;
-  int len;                     /* number of characters used */
-  int size;                    /* allocated size */
-  CORE_ADDR scope;
-};
+struct agent_expr
+  {
+    unsigned char *buf;
+    int len;                   /* number of characters used */
+    int size;                  /* allocated size */
+    CORE_ADDR scope;
+  };
 
 
 
@@ -82,56 +85,57 @@ struct agent_expr {
    agentexpr.h behaves like an opcode map.  If you want to see them
    grouped logically, see doc/agentexpr.texi.  */
 
-enum agent_op {
-  aop_float = 0x01,
-  aop_add = 0x02,
-  aop_sub = 0x03,
-  aop_mul = 0x04,
-  aop_div_signed = 0x05,
-  aop_div_unsigned = 0x06,
-  aop_rem_signed = 0x07,
-  aop_rem_unsigned = 0x08,
-  aop_lsh = 0x09,
-  aop_rsh_signed = 0x0a,
-  aop_rsh_unsigned = 0x0b,
-  aop_trace = 0x0c,
-  aop_trace_quick = 0x0d,
-  aop_log_not = 0x0e,
-  aop_bit_and = 0x0f,
-  aop_bit_or = 0x10,
-  aop_bit_xor = 0x11,
-  aop_bit_not = 0x12,
-  aop_equal = 0x13,
-  aop_less_signed = 0x14,
-  aop_less_unsigned = 0x15,
-  aop_ext = 0x16,
-  aop_ref8 = 0x17,
-  aop_ref16 = 0x18,
-  aop_ref32 = 0x19,
-  aop_ref64 = 0x1a,
-  aop_ref_float = 0x1b,
-  aop_ref_double = 0x1c,
-  aop_ref_long_double = 0x1d,
-  aop_l_to_d = 0x1e,
-  aop_d_to_l = 0x1f,
-  aop_if_goto = 0x20,
-  aop_goto = 0x21,
-  aop_const8 = 0x22,
-  aop_const16 = 0x23,
-  aop_const32 = 0x24,
-  aop_const64 = 0x25,
-  aop_reg = 0x26,
-  aop_end = 0x27,
-  aop_dup = 0x28,
-  aop_pop = 0x29,
-  aop_zero_ext = 0x2a,
-  aop_swap = 0x2b,
-  aop_trace16 = 0x30,
-  aop_last
-};
+enum agent_op
+  {
+    aop_float = 0x01,
+    aop_add = 0x02,
+    aop_sub = 0x03,
+    aop_mul = 0x04,
+    aop_div_signed = 0x05,
+    aop_div_unsigned = 0x06,
+    aop_rem_signed = 0x07,
+    aop_rem_unsigned = 0x08,
+    aop_lsh = 0x09,
+    aop_rsh_signed = 0x0a,
+    aop_rsh_unsigned = 0x0b,
+    aop_trace = 0x0c,
+    aop_trace_quick = 0x0d,
+    aop_log_not = 0x0e,
+    aop_bit_and = 0x0f,
+    aop_bit_or = 0x10,
+    aop_bit_xor = 0x11,
+    aop_bit_not = 0x12,
+    aop_equal = 0x13,
+    aop_less_signed = 0x14,
+    aop_less_unsigned = 0x15,
+    aop_ext = 0x16,
+    aop_ref8 = 0x17,
+    aop_ref16 = 0x18,
+    aop_ref32 = 0x19,
+    aop_ref64 = 0x1a,
+    aop_ref_float = 0x1b,
+    aop_ref_double = 0x1c,
+    aop_ref_long_double = 0x1d,
+    aop_l_to_d = 0x1e,
+    aop_d_to_l = 0x1f,
+    aop_if_goto = 0x20,
+    aop_goto = 0x21,
+    aop_const8 = 0x22,
+    aop_const16 = 0x23,
+    aop_const32 = 0x24,
+    aop_const64 = 0x25,
+    aop_reg = 0x26,
+    aop_end = 0x27,
+    aop_dup = 0x28,
+    aop_pop = 0x29,
+    aop_zero_ext = 0x2a,
+    aop_swap = 0x2b,
+    aop_trace16 = 0x30,
+    aop_last
+  };
+\f
 
 
-\f
 /* Functions for building expressions.  */
 
 /* Allocate a new, empty agent expression.  */
@@ -141,19 +145,19 @@ extern struct agent_expr *new_agent_expr PARAMS ((CORE_ADDR));
 extern void free_agent_expr PARAMS ((struct agent_expr *));
 
 /* Append a simple operator OP to EXPR.  */
-extern void ax_simple PARAMS ((struct agent_expr *EXPR, enum agent_op OP));
+extern void ax_simple PARAMS ((struct agent_expr * EXPR, enum agent_op OP));
 
 /* Append the floating-point prefix, for the next bytecode.  */
 #define ax_float(EXPR) (ax_simple ((EXPR), aop_float))
 
 /* Append a sign-extension instruction to EXPR, to extend an N-bit value.  */
-extern void ax_ext PARAMS ((struct agent_expr *EXPR, int N));
+extern void ax_ext PARAMS ((struct agent_expr * EXPR, int N));
 
 /* Append a zero-extension instruction to EXPR, to extend an N-bit value.  */
-extern void ax_zero_ext PARAMS ((struct agent_expr *EXPR, int N));
+extern void ax_zero_ext PARAMS ((struct agent_expr * EXPR, int N));
 
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
-extern void ax_trace_quick PARAMS ((struct agent_expr *EXPR, int N));
+extern void ax_trace_quick PARAMS ((struct agent_expr * EXPR, int N));
 
 /* Append a goto op to EXPR.  OP is the actual op (must be aop_goto or
    aop_if_goto).  We assume we don't know the target offset yet,
@@ -161,123 +165,126 @@ extern void ax_trace_quick PARAMS ((struct agent_expr *EXPR, int N));
    for the target, and return the offset in EXPR of that space, so we
    can backpatch it once we do know the target offset.  Use ax_label
    to do the backpatching.  */
-extern int ax_goto PARAMS ((struct agent_expr *EXPR, enum agent_op OP));
+extern int ax_goto PARAMS ((struct agent_expr * EXPR, enum agent_op OP));
 
 /* Suppose a given call to ax_goto returns some value PATCH.  When you
    know the offset TARGET that goto should jump to, call
-       ax_label (EXPR, PATCH, TARGET)
+   ax_label (EXPR, PATCH, TARGET)
    to patch TARGET into the ax_goto instruction.  */
-extern void ax_label PARAMS ((struct agent_expr *EXPR, int patch, int target));
+extern void ax_label PARAMS ((struct agent_expr * EXPR, int patch, int target));
 
 /* Assemble code to push a constant on the stack.  */
-extern void ax_const_l PARAMS ((struct agent_expr *EXPR, LONGEST l));
-extern void ax_const_d PARAMS ((struct agent_expr *EXPR, LONGEST d));
+extern void ax_const_l PARAMS ((struct agent_expr * EXPR, LONGEST l));
+extern void ax_const_d PARAMS ((struct agent_expr * EXPR, LONGEST d));
 
 /* Assemble code to push the value of register number REG on the
    stack.  */
-extern void ax_reg PARAMS ((struct agent_expr *EXPR, int REG));
-
+extern void ax_reg PARAMS ((struct agent_expr * EXPR, int REG));
 \f
+
 /* Functions for printing out expressions, and otherwise debugging
    things.  */
 
 /* Disassemble the expression EXPR, writing to F.  */
-extern void ax_print PARAMS ((GDB_FILE *f, struct agent_expr *EXPR));
+extern void ax_print PARAMS ((GDB_FILE * f, struct agent_expr * EXPR));
 
 /* An entry in the opcode map.  */
-struct aop_map {
+struct aop_map
+  {
 
-  /* The name of the opcode.  Null means that this entry is not a
-     valid opcode --- a hole in the opcode space.  */
-  char *name;
+    /* The name of the opcode.  Null means that this entry is not a
+       valid opcode --- a hole in the opcode space.  */
+    char *name;
 
-  /* All opcodes take no operands from the bytecode stream, or take
-     unsigned integers of various sizes.  If this is a positive number
-     n, then the opcode is followed by an n-byte operand, which should
-     be printed as an unsigned integer.  If this is zero, then the
-     opcode takes no operands from the bytecode stream.
+    /* All opcodes take no operands from the bytecode stream, or take
+       unsigned integers of various sizes.  If this is a positive number
+       n, then the opcode is followed by an n-byte operand, which should
+       be printed as an unsigned integer.  If this is zero, then the
+       opcode takes no operands from the bytecode stream.
 
-     If we get more complicated opcodes in the future, don't add other
-     magic values of this; that's a crock.  Add an `enum encoding'
-     field to this, or something like that.  */
-  int op_size;
+       If we get more complicated opcodes in the future, don't add other
+       magic values of this; that's a crock.  Add an `enum encoding'
+       field to this, or something like that.  */
+    int op_size;
 
-  /* The size of the data operated upon, in bits, for bytecodes that
-     care about that (ref and const).  Zero for all others.  */
-  int data_size;
+    /* The size of the data operated upon, in bits, for bytecodes that
+       care about that (ref and const).  Zero for all others.  */
+    int data_size;
 
-  /* Number of stack elements consumed, and number produced.  */
-  int consumed, produced;
-};
+    /* Number of stack elements consumed, and number produced.  */
+    int consumed, produced;
+  };
 
 /* Map of the bytecodes, indexed by bytecode number.  */
 extern struct aop_map aop_map[];
 
 /* Different kinds of flaws an agent expression might have, as
    detected by agent_reqs.  */
-enum agent_flaws {
-  agent_flaw_none = 0,         /* code is good */
+enum agent_flaws
+  {
+    agent_flaw_none = 0,       /* code is good */
 
-  /* There is an invalid instruction in the stream.  */
-  agent_flaw_bad_instruction,
+    /* There is an invalid instruction in the stream.  */
+    agent_flaw_bad_instruction,
 
-  /* There is an incomplete instruction at the end of the expression.  */
-  agent_flaw_incomplete_instruction,
+    /* There is an incomplete instruction at the end of the expression.  */
+    agent_flaw_incomplete_instruction,
 
-  /* agent_reqs was unable to prove that every jump target is to a
-     valid offset.  Valid offsets are within the bounds of the
-     expression, and to a valid instruction boundary.  */
-  agent_flaw_bad_jump,
+    /* agent_reqs was unable to prove that every jump target is to a
+       valid offset.  Valid offsets are within the bounds of the
+       expression, and to a valid instruction boundary.  */
+    agent_flaw_bad_jump,
 
-  /* agent_reqs was unable to prove to its satisfaction that, for each
-     jump target location, the stack will have the same height whether
-     that location is reached via a jump or by straight execution.  */
-  agent_flaw_height_mismatch,
+    /* agent_reqs was unable to prove to its satisfaction that, for each
+       jump target location, the stack will have the same height whether
+       that location is reached via a jump or by straight execution.  */
+    agent_flaw_height_mismatch,
 
-  /* agent_reqs was unable to prove that every instruction following
-     an unconditional jump was the target of some other jump.  */
-  agent_flaw_hole
-};
+    /* agent_reqs was unable to prove that every instruction following
+       an unconditional jump was the target of some other jump.  */
+    agent_flaw_hole
+  };
 
 /* Structure describing the requirements of a bytecode expression.  */
-struct agent_reqs {
+struct agent_reqs
+  {
+
+    /* If the following is not equal to agent_flaw_none, the rest of the
+       information in this structure is suspect.  */
+    enum agent_flaws flaw;
 
-  /* If the following is not equal to agent_flaw_none, the rest of the
-     information in this structure is suspect.  */
-  enum agent_flaws flaw;
+    /* Number of elements left on stack at end; may be negative if expr
+       only consumes elements.  */
+    int final_height;
 
-  /* Number of elements left on stack at end; may be negative if expr
-     only consumes elements.  */
-  int final_height;
+    /* Maximum and minimum stack height, relative to initial height.  */
+    int max_height, min_height;
 
-  /* Maximum and minimum stack height, relative to initial height.  */
-  int max_height, min_height;
+    /* Largest `ref' or `const' opcode used, in bits.  Zero means the
+       expression has no such instructions.  */
+    int max_data_size;
 
-  /* Largest `ref' or `const' opcode used, in bits.  Zero means the
-     expression has no such instructions.  */
-  int max_data_size;
+    /* Bit vector of registers used.  Register R is used iff
 
-  /* Bit vector of registers used.  Register R is used iff
-  
-       reg_mask[R / 8] & (1 << (R % 8))
+       reg_mask[R / 8] & (1 << (R % 8))
 
-     is non-zero.  Note!  You may not assume that this bitmask is long
-     enough to hold bits for all the registers of the machine; the
-     agent expression code has no idea how many registers the machine
-     has.  However, the bitmask is reg_mask_len bytes long, so the
-     valid register numbers run from 0 to reg_mask_len * 8 - 1.  
+       is non-zero.  Note!  You may not assume that this bitmask is long
+       enough to hold bits for all the registers of the machine; the
+       agent expression code has no idea how many registers the machine
+       has.  However, the bitmask is reg_mask_len bytes long, so the
+       valid register numbers run from 0 to reg_mask_len * 8 - 1.  
 
-     We're assuming eight-bit bytes.  So sue me.
+       We're assuming eight-bit bytes.  So sue me.
 
-     The caller should free reg_list when done.  */
-  int reg_mask_len;
-  unsigned char *reg_mask;
-};
+       The caller should free reg_list when done.  */
+    int reg_mask_len;
+    unsigned char *reg_mask;
+  };
 
 
 /* Given an agent expression AX, fill in an agent_reqs structure REQS
    describing it.  */
-extern void ax_reqs PARAMS ((struct agent_expr *ax,
-                            struct agent_reqs *reqs));
+extern void ax_reqs PARAMS ((struct agent_expr * ax,
+                            struct agent_reqs * reqs));
 
 #endif /* AGENTEXPR_H */
index 0d6d2058e7813aace6436e70e0b567fdf8c18376..97485ddda3a71ddc16406e1916b85aeca1567c7d 100644 (file)
@@ -2,21 +2,22 @@
    Written by Fred Fish (fnf@cygnus.com)
    Copyright 1995, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -30,8 +31,8 @@ static unsigned int hash PARAMS ((void *, int));
 static void *lookup_cache PARAMS ((void *, int, int, struct bcache *));
 
 /* FIXME:  Incredibly simplistic hash generator.  Probably way too expensive
- (consider long strings) and unlikely to have good distribution across hash
- values for typical input. */
  (consider long strings) and unlikely to have good distribution across hash
  values for typical input. */
 
 static unsigned int
 hash (bytes, count)
@@ -68,7 +69,7 @@ lookup_cache (bytes, count, hashval, bcachep)
   struct hashlink **hashtablep;
   struct hashlink *linkp;
 
-  hashtablep = bcachep -> indextable[count];
+  hashtablep = bcachep->indextable[count];
   if (hashtablep != NULL)
     {
       linkp = hashtablep[hashval];
@@ -79,7 +80,7 @@ lookup_cache (bytes, count, hashval, bcachep)
              location = BCACHE_DATA (linkp);
              break;
            }
-         linkp = linkp -> next;
+         linkp = linkp->next;
        }
     }
   return (location);
@@ -101,9 +102,9 @@ bcache (bytes, count, bcachep)
     {
       /* Rare enough to just stash unique copies */
       location = (void *) obstack_alloc (&bcachep->cache, count);
-      bcachep -> cache_bytes += count;
+      bcachep->cache_bytes += count;
       memcpy (location, bytes, count);
-      bcachep -> bcache_overflows++;
+      bcachep->bcache_overflows++;
     }
   else
     {
@@ -111,26 +112,26 @@ bcache (bytes, count, bcachep)
       location = lookup_cache (bytes, count, hashval, bcachep);
       if (location != NULL)
        {
-         bcachep -> cache_savings += count;
-         bcachep -> cache_hits++;
+         bcachep->cache_savings += count;
+         bcachep->cache_hits++;
        }
       else
        {
-         bcachep -> cache_misses++;
-         hashtablepp = &bcachep -> indextable[count];
+         bcachep->cache_misses++;
+         hashtablepp = &bcachep->indextable[count];
          if (*hashtablepp == NULL)
            {
              *hashtablepp = (struct hashlink **)
                obstack_alloc (&bcachep->cache, BCACHE_HASHSIZE * sizeof (struct hashlink *));
-             bcachep -> cache_bytes += BCACHE_HASHSIZE * sizeof (struct hashlink *);
+             bcachep->cache_bytes += BCACHE_HASHSIZE * sizeof (struct hashlink *);
              memset (*hashtablepp, 0, BCACHE_HASHSIZE * sizeof (struct hashlink *));
            }
          linkpp = &(*hashtablepp)[hashval];
          newlink = (struct hashlink *)
            obstack_alloc (&bcachep->cache, BCACHE_DATA_ALIGNMENT + count);
-         bcachep -> cache_bytes += BCACHE_DATA_ALIGNMENT + count;
+         bcachep->cache_bytes += BCACHE_DATA_ALIGNMENT + count;
          memcpy (BCACHE_DATA (newlink), bytes, count);
-         newlink -> next = *linkpp;
+         newlink->next = *linkpp;
          *linkpp = newlink;
          location = BCACHE_DATA (newlink);
        }
@@ -149,7 +150,7 @@ print_bcache_statistics (bcachep, id)
 
   for (lmax = lcount = tcount = hcount = tidx = 0; tidx < BCACHE_MAXLENGTH; tidx++)
     {
-      hashtablep = bcachep -> indextable[tidx];
+      hashtablep = bcachep->indextable[tidx];
       if (hashtablep != NULL)
        {
          tcount++;
@@ -159,7 +160,7 @@ print_bcache_statistics (bcachep, id)
              if (linkp != NULL)
                {
                  hcount++;
-                 for (temp = 0; linkp != NULL; linkp = linkp -> next)
+                 for (temp = 0; linkp != NULL; linkp = linkp->next)
                    {
                      lcount++;
                      temp++;
@@ -175,21 +176,21 @@ print_bcache_statistics (bcachep, id)
        }
     }
   printf_filtered ("  Cached '%s' statistics:\n", id);
-  printf_filtered ("    Cache hits: %d\n", bcachep -> cache_hits);
-  printf_filtered ("    Cache misses: %d\n", bcachep -> cache_misses);
+  printf_filtered ("    Cache hits: %d\n", bcachep->cache_hits);
+  printf_filtered ("    Cache misses: %d\n", bcachep->cache_misses);
   printf_filtered ("    Cache hit ratio: ");
-  if (bcachep -> cache_hits + bcachep -> cache_misses > 0)
+  if (bcachep->cache_hits + bcachep->cache_misses > 0)
     {
-      printf_filtered ("%d%%\n", ((bcachep -> cache_hits) * 100) /
-                      (bcachep -> cache_hits + bcachep -> cache_misses));
+      printf_filtered ("%d%%\n", ((bcachep->cache_hits) * 100) /
+                      (bcachep->cache_hits + bcachep->cache_misses));
     }
   else
     {
       printf_filtered ("(not applicable)\n");
     }
-  printf_filtered ("    Space used for caching: %d\n", bcachep -> cache_bytes);
-  printf_filtered ("    Space saved by cache hits: %d\n", bcachep -> cache_savings);
-  printf_filtered ("    Number of bcache overflows: %d\n", bcachep -> bcache_overflows);
+  printf_filtered ("    Space used for caching: %d\n", bcachep->cache_bytes);
+  printf_filtered ("    Space saved by cache hits: %d\n", bcachep->cache_savings);
+  printf_filtered ("    Number of bcache overflows: %d\n", bcachep->bcache_overflows);
   printf_filtered ("    Number of index buckets used: %d\n", tcount);
   printf_filtered ("    Number of hash table buckets used: %d\n", hcount);
   printf_filtered ("    Number of chained items: %d\n", lcount);
index 4b753be42dca5860fda285f79b74d13e2eaa70f6..ec383244a478988a7516fa8dd9eb56d8304ca4d8 100644 (file)
@@ -2,21 +2,22 @@
    Written by Fred Fish (fnf@cygnus.com)
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef BCACHE_H
 #define BCACHE_H 1
@@ -29,13 +30,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    it needs to have the same alignment  as the most strict alignment of 
    any type on the host machine.  So do it the same way obstack does. */
 
-struct hashlink {
-  struct hashlink *next;
-  union {
-    char data[1];
-    double dummy;
-  } d;
-};
+struct hashlink
+  {
+    struct hashlink *next;
+    union
+      {
+       char data[1];
+       double dummy;
+      }
+    d;
+  };
 
 /* BCACHE_DATA is used to get the address of the cached data. */
 
@@ -49,18 +53,19 @@ struct hashlink {
 #define BCACHE_DATA_ALIGNMENT \
        (((char *) BCACHE_DATA((struct hashlink*) 0) - (char *) 0))
 
-struct bcache {
-  struct obstack cache;
-  struct hashlink **indextable[BCACHE_MAXLENGTH];
-  int cache_hits;
-  int cache_misses;
-  int cache_bytes;
-  int cache_savings;
-  int bcache_overflows;
-};
+struct bcache
+  {
+    struct obstack cache;
+    struct hashlink **indextable[BCACHE_MAXLENGTH];
+    int cache_hits;
+    int cache_misses;
+    int cache_bytes;
+    int cache_savings;
+    int bcache_overflows;
+  };
 
 extern void *
-bcache PARAMS ((void *bytes, int count, struct bcache *bcachep));
+  bcache PARAMS ((void *bytes, int count, struct bcache * bcachep));
 
 extern void
 print_bcache_statistics PARAMS ((struct bcache *, char *));
index 87ce8bf5d1b0fa4dd56a0dd29e3248b5c4e84f1e..26a26ae6f9d9a1be5fffdec613958ff00e08cf07 100644 (file)
@@ -1,23 +1,24 @@
 /* Get info from stack frames;
    convert between frames, blocks, functions and pc values.
    Copyright 1986, 87, 88, 89, 91, 94, 95, 96, 97, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -45,14 +46,14 @@ default_frame_chain_valid (chain, thisframe)
      struct frame_info *thisframe;
 {
   return ((chain) != 0
-         && !inside_main_func ((thisframe) -> pc)
-         && !inside_entry_func ((thisframe) -> pc));
+         && !inside_main_func ((thisframe)->pc)
+         && !inside_entry_func ((thisframe)->pc));
 }
 
 /* Use the alternate method of avoiding running up off the end of the
    frame chain or following frames back into the startup code.  See
    the comments in objfiles.h. */
-   
+
 int
 alternate_frame_chain_valid (chain, thisframe)
      CORE_ADDR chain;
@@ -63,7 +64,7 @@ alternate_frame_chain_valid (chain, thisframe)
 }
 
 /* A very simple method of determining a valid frame */
-   
+
 int
 nonnull_frame_chain_valid (chain, thisframe)
      CORE_ADDR chain;
@@ -91,13 +92,13 @@ inside_entry_file (addr)
   if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
     {
       /* Do not stop backtracing if the pc is in the call dummy
-        at the entry point.  */
+         at the entry point.  */
       /* FIXME: Won't always work with zeros for the last two arguments */
-      if (PC_IN_CALL_DUMMY (addr, 0, 0))       
+      if (PC_IN_CALL_DUMMY (addr, 0, 0))
        return 0;
     }
-  return (addr >= symfile_objfile -> ei.entry_file_lowpc &&
-         addr <  symfile_objfile -> ei.entry_file_highpc);
+  return (addr >= symfile_objfile->ei.entry_file_lowpc &&
+         addr < symfile_objfile->ei.entry_file_highpc);
 }
 
 /* Test a specified PC value to see if it is in the range of addresses
@@ -110,7 +111,7 @@ inside_entry_file (addr)
 
 int
 inside_main_func (pc)
-CORE_ADDR pc;
+     CORE_ADDR pc;
 {
   if (pc == 0)
     return 1;
@@ -121,22 +122,22 @@ CORE_ADDR pc;
      This is for FRAME_CHAIN_VALID_ALTERNATE. I do this for coff, because
      it is unable to set it up and symbol reading time. */
 
-  if (symfile_objfile -> ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
-      symfile_objfile -> ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
+  if (symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
+      symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
     {
       struct symbol *mainsym;
 
       mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL);
-      if (mainsym && SYMBOL_CLASS(mainsym) == LOC_BLOCK)
-        {
-          symfile_objfile->ei.main_func_lowpc = 
+      if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
+       {
+         symfile_objfile->ei.main_func_lowpc =
            BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
-          symfile_objfile->ei.main_func_highpc = 
+         symfile_objfile->ei.main_func_highpc =
            BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
-        }
+       }
     }
-  return (symfile_objfile -> ei.main_func_lowpc  <= pc &&
-         symfile_objfile -> ei.main_func_highpc > pc);
+  return (symfile_objfile->ei.main_func_lowpc <= pc &&
+         symfile_objfile->ei.main_func_highpc > pc);
 }
 
 /* Test a specified PC value to see if it is in the range of addresses
@@ -158,13 +159,13 @@ inside_entry_func (pc)
   if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
     {
       /* Do not stop backtracing if the pc is in the call dummy
-        at the entry point.  */
+         at the entry point.  */
       /* FIXME: Won't always work with zeros for the last two arguments */
       if (PC_IN_CALL_DUMMY (pc, 0, 0))
        return 0;
     }
-  return (symfile_objfile -> ei.entry_func_lowpc  <= pc &&
-         symfile_objfile -> ei.entry_func_highpc > pc);
+  return (symfile_objfile->ei.entry_func_lowpc <= pc &&
+         symfile_objfile->ei.entry_func_highpc > pc);
 }
 
 /* Info about the innermost stack frame (contents of FP register) */
@@ -188,7 +189,7 @@ void
 frame_saved_regs_zalloc (fi)
      struct frame_info *fi;
 {
-  fi->saved_regs = (CORE_ADDR*)
+  fi->saved_regs = (CORE_ADDR *)
     frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
   memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
 }
@@ -237,7 +238,7 @@ create_new_frame (addr, pc)
   fi->prev = NULL;
   fi->frame = addr;
   fi->pc = pc;
-  find_pc_partial_function (pc, &name, (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+  find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
   fi->signal_handler_caller = IN_SIGTRAMP (fi->pc, name);
 
 #ifdef INIT_EXTRA_FRAME_INFO
@@ -266,7 +267,7 @@ flush_cached_frames ()
   obstack_free (&frame_cache_obstack, 0);
   obstack_init (&frame_cache_obstack);
 
-  current_frame = NULL;  /* Invalidate cache */
+  current_frame = NULL;                /* Invalidate cache */
   select_frame (NULL, -1);
   annotate_frames_invalid ();
 }
@@ -306,7 +307,7 @@ frameless_look_for_prologue (frame)
       after_prologue = func_start;
 #ifdef SKIP_PROLOGUE_FRAMELESS_P
       /* This is faster, since only care whether there *is* a prologue,
-        not how long it is.  */
+         not how long it is.  */
       after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
 #else
       after_prologue = SKIP_PROLOGUE (after_prologue);
@@ -360,9 +361,9 @@ get_prev_frame (next_frame)
     {
 #if 0
       /* This screws value_of_variable, which just wants a nice clean
-        NULL return from block_innermost_frame if there are no frames.
-        I don't think I've ever seen this message happen otherwise.
-        And returning NULL here is a perfectly legitimate thing to do.  */
+         NULL return from block_innermost_frame if there are no frames.
+         I don't think I've ever seen this message happen otherwise.
+         And returning NULL here is a perfectly legitimate thing to do.  */
       if (!current_frame)
        {
          error ("You haven't set up a process's stack to examine.");
@@ -395,18 +396,18 @@ get_prev_frame (next_frame)
   if (!fromleaf)
     {
       /* Two macros defined in tm.h specify the machine-dependent
-        actions to be performed here.
-        First, get the frame's chain-pointer.
-        If that is zero, the frame is the outermost frame or a leaf
-        called by the outermost frame.  This means that if start
-        calls main without a frame, we'll return 0 (which is fine
-        anyway).
-
-        Nope; there's a problem.  This also returns when the current
-        routine is a leaf of main.  This is unacceptable.  We move
-        this to after the ffi test; I'd rather have backtraces from
-        start go curfluy than have an abort called from main not show
-        main.  */
+         actions to be performed here.
+         First, get the frame's chain-pointer.
+         If that is zero, the frame is the outermost frame or a leaf
+         called by the outermost frame.  This means that if start
+         calls main without a frame, we'll return 0 (which is fine
+         anyway).
+
+         Nope; there's a problem.  This also returns when the current
+         routine is a leaf of main.  This is unacceptable.  We move
+         this to after the ffi test; I'd rather have backtraces from
+         start go curfluy than have an abort called from main not show
+         main.  */
       address = FRAME_CHAIN (next_frame);
       if (!FRAME_CHAIN_VALID (address, next_frame))
        return 0;
@@ -432,11 +433,11 @@ get_prev_frame (next_frame)
    after INIT_EXTRA_FRAME_INFO and come up with a simple way to
    express what goes on here.
 
-      INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
-               (where the PC is already set up) and here (where it isn't).
-      INIT_FRAME_PC is only called from here, always after
-               INIT_EXTRA_FRAME_INFO.
-   
+   INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
+   (where the PC is already set up) and here (where it isn't).
+   INIT_FRAME_PC is only called from here, always after
+   INIT_EXTRA_FRAME_INFO.
+
    The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the PC
    value (which hasn't been set yet).  Some other machines appear to
    require INIT_EXTRA_FRAME_INFO before they can do INIT_FRAME_PC.  Phoo.
@@ -448,24 +449,24 @@ get_prev_frame (next_frame)
    INIT_EXTRA_FRAME_INFO, one possible scheme:
 
    SETUP_INNERMOST_FRAME()
-     Default version is just create_new_frame (read_fp ()),
-     read_pc ()).  Machines with extra frame info would do that (or the
-     local equivalent) and then set the extra fields.
+   Default version is just create_new_frame (read_fp ()),
+   read_pc ()).  Machines with extra frame info would do that (or the
+   local equivalent) and then set the extra fields.
    SETUP_ARBITRARY_FRAME(argc, argv)
-     Only change here is that create_new_frame would no longer init extra
-     frame info; SETUP_ARBITRARY_FRAME would have to do that.
+   Only change here is that create_new_frame would no longer init extra
+   frame info; SETUP_ARBITRARY_FRAME would have to do that.
    INIT_PREV_FRAME(fromleaf, prev)
-     Replace INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC.  This should
-     also return a flag saying whether to keep the new frame, or
-     whether to discard it, because on some machines (e.g.  mips) it
-     is really awkward to have FRAME_CHAIN_VALID called *before*
-     INIT_EXTRA_FRAME_INFO (there is no good way to get information
-     deduced in FRAME_CHAIN_VALID into the extra fields of the new frame).
+   Replace INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC.  This should
+   also return a flag saying whether to keep the new frame, or
+   whether to discard it, because on some machines (e.g.  mips) it
+   is really awkward to have FRAME_CHAIN_VALID called *before*
+   INIT_EXTRA_FRAME_INFO (there is no good way to get information
+   deduced in FRAME_CHAIN_VALID into the extra fields of the new frame).
    std_frame_pc(fromleaf, prev)
-     This is the default setting for INIT_PREV_FRAME.  It just does what
-     the default INIT_FRAME_PC does.  Some machines will call it from
-     INIT_PREV_FRAME (either at the beginning, the end, or in the middle).
-     Some machines won't use it.
+   This is the default setting for INIT_PREV_FRAME.  It just does what
+   the default INIT_FRAME_PC does.  Some machines will call it from
+   INIT_PREV_FRAME (either at the beginning, the end, or in the middle).
+   Some machines won't use it.
    kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94.  */
 
 #ifdef INIT_FRAME_PC_FIRST
@@ -473,13 +474,13 @@ get_prev_frame (next_frame)
 #endif
 
 #ifdef INIT_EXTRA_FRAME_INFO
-  INIT_EXTRA_FRAME_INFO(fromleaf, prev);
+  INIT_EXTRA_FRAME_INFO (fromleaf, prev);
 #endif
 
   /* This entry is in the frame queue now, which is good since
      FRAME_SAVED_PC may use that queue to figure out its value
      (see tm-sparc.h).  We want the pc saved in the inferior frame. */
-  INIT_FRAME_PC(fromleaf, prev);
+  INIT_FRAME_PC (fromleaf, prev);
 
   /* If ->frame and ->pc are unchanged, we are in the process of getting
      ourselves into an infinite backtrace.  Some architectures check this
@@ -497,7 +498,7 @@ get_prev_frame (next_frame)
     }
 
   find_pc_partial_function (prev->pc, &name,
-                           (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+                           (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
   if (IN_SIGTRAMP (prev->pc, name))
     prev->signal_handler_caller = 1;
 
@@ -524,7 +525,7 @@ get_frame_saved_regs (frame, saved_regs_addr)
 {
   if (frame->saved_regs == NULL)
     {
-      frame->saved_regs = (CORE_ADDR*)
+      frame->saved_regs = (CORE_ADDR *)
        frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
     }
   if (saved_regs_addr == NULL)
@@ -618,13 +619,13 @@ blockvector_for_pc_sect (pc, section, pindex, symtab)
      struct sec *section;
      int *pindex;
      struct symtab *symtab;
-     
+
 {
   register struct block *b;
   register int bot, top, half;
   struct blockvector *bl;
 
-  if (symtab == 0)     /* if no symtab specified by caller */
+  if (symtab == 0)             /* if no symtab specified by caller */
     {
       /* First search all symtabs for one whose file contains our pc */
       if ((symtab = find_pc_sect_symtab (pc, section)) == 0)
@@ -733,19 +734,19 @@ find_pc_function (pc)
 /* These variables are used to cache the most recent result
  * of find_pc_partial_function. */
 
-static CORE_ADDR   cache_pc_function_low     = 0;
-static CORE_ADDR   cache_pc_function_high    = 0;
-static char       *cache_pc_function_name    = 0;
+static CORE_ADDR cache_pc_function_low = 0;
+static CORE_ADDR cache_pc_function_high = 0;
+static char *cache_pc_function_name = 0;
 static struct sec *cache_pc_function_section = NULL;
 
 /* Clear cache, e.g. when symbol table is discarded. */
 
 void
-clear_pc_function_cache()
+clear_pc_function_cache ()
 {
   cache_pc_function_low = 0;
   cache_pc_function_high = 0;
-  cache_pc_function_name = (char *)0;
+  cache_pc_function_name = (char *) 0;
   cache_pc_function_section = NULL;
 }
 
@@ -762,23 +763,23 @@ clear_pc_function_cache()
 
 int
 find_pc_sect_partial_function (pc, section, name, address, endaddr)
-     CORE_ADDR  pc;
-     asection  *section;
-     char     **name;
+     CORE_ADDR pc;
+     asection *section;
+     char **name;
      CORE_ADDR *address;
      CORE_ADDR *endaddr;
 {
   struct partial_symtab *pst;
-  struct symbol         *f;
+  struct symbol *f;
   struct minimal_symbol *msymbol;
   struct partial_symbol *psb;
-  struct obj_section    *osect;
+  struct obj_section *osect;
   int i;
   CORE_ADDR mapped_pc;
 
   mapped_pc = overlay_mapped_address (pc, section);
 
-  if (mapped_pc >= cache_pc_function_low && 
+  if (mapped_pc >= cache_pc_function_low &&
       mapped_pc < cache_pc_function_high &&
       section == cache_pc_function_section)
     goto return_cached_value;
@@ -786,11 +787,11 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
   /* If sigtramp is in the u area, it counts as a function (especially
      important for step_1).  */
 #if defined SIGTRAMP_START
-  if (IN_SIGTRAMP (mapped_pc, (char *)NULL))
+  if (IN_SIGTRAMP (mapped_pc, (char *) NULL))
     {
-      cache_pc_function_low     = SIGTRAMP_START (mapped_pc);
-      cache_pc_function_high    = SIGTRAMP_END (mapped_pc);
-      cache_pc_function_name    = "<sigtramp>";
+      cache_pc_function_low = SIGTRAMP_START (mapped_pc);
+      cache_pc_function_high = SIGTRAMP_END (mapped_pc);
+      cache_pc_function_name = "<sigtramp>";
       cache_pc_function_section = section;
       goto return_cached_value;
     }
@@ -819,9 +820,9 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
                  || (BLOCK_START (SYMBOL_BLOCK_VALUE (f))
                      >= SYMBOL_VALUE_ADDRESS (msymbol))))
            {
-             cache_pc_function_low     = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
-             cache_pc_function_high    = BLOCK_END   (SYMBOL_BLOCK_VALUE (f));
-             cache_pc_function_name    = SYMBOL_NAME (f);
+             cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
+             cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
+             cache_pc_function_name = SYMBOL_NAME (f);
              cache_pc_function_section = section;
              goto return_cached_value;
            }
@@ -872,21 +873,21 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
       return 0;
     }
 
-  cache_pc_function_low     = SYMBOL_VALUE_ADDRESS (msymbol);
-  cache_pc_function_name    = SYMBOL_NAME (msymbol);
+  cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
+  cache_pc_function_name = SYMBOL_NAME (msymbol);
   cache_pc_function_section = section;
 
   /* Use the lesser of the next minimal symbol in the same section, or
      the end of the section, as the end of the function.  */
-  
+
   /* Step over other symbols at this same address, and symbols in
      other sections, to find the next symbol in this section with
      a different address.  */
 
-  for (i=1; SYMBOL_NAME (msymbol+i) != NULL; i++)
+  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))
+      if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol)
+       && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
        break;
     }
 
@@ -898,33 +899,33 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
        So the end address is the end of the section.  */
     cache_pc_function_high = osect->endaddr;
 
- return_cached_value:
+return_cached_value:
 
   if (address)
     {
       if (pc_in_unmapped_range (pc, section))
-        *address = overlay_unmapped_address (cache_pc_function_low, section);
+       *address = overlay_unmapped_address (cache_pc_function_low, section);
       else
-        *address = cache_pc_function_low;
+       *address = cache_pc_function_low;
     }
-    
+
   if (name)
     *name = cache_pc_function_name;
 
   if (endaddr)
     {
       if (pc_in_unmapped_range (pc, section))
-        {
+       {
          /* Because the high address is actually beyond the end of
             the function (and therefore possibly beyond the end of
             the overlay), we must actually convert (high - 1)
             and then add one to that. */
 
-         *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1, 
+         *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
                                                   section);
-        }
+       }
       else
-        *endaddr = cache_pc_function_high;
+       *endaddr = cache_pc_function_high;
     }
 
   return 1;
@@ -934,12 +935,12 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
 
 int
 find_pc_partial_function (pc, name, address, endaddr)
-     CORE_ADDR  pc;
-     char     **name;
+     CORE_ADDR pc;
+     char **name;
      CORE_ADDR *address;
      CORE_ADDR *endaddr;
 {
-  asection     *section;
+  asection *section;
 
   section = find_pc_overlay (pc);
   return find_pc_sect_partial_function (pc, section, name, address, endaddr);
@@ -982,7 +983,7 @@ find_frame_addr_in_frame_chain (frame_addr)
 {
   struct frame_info *frame = NULL;
 
-  if (frame_addr == (CORE_ADDR)0)
+  if (frame_addr == (CORE_ADDR) 0)
     return NULL;
 
   while (1)
@@ -1015,7 +1016,7 @@ sigtramp_saved_pc (frame)
                                           ptrbytes);
   else
     sigcontext_addr = read_memory_integer (read_register (SP_REGNUM)
-                                           + sigcontext_offs,
+                                          + sigcontext_offs,
                                           ptrbytes);
 
   /* Don't cause a memory_error when accessing sigcontext in case the stack
@@ -1131,12 +1132,12 @@ static struct dummy_frame *dummy_frame_stack = NULL;
    Search the stack of dummy frames for one matching the given PC, FP and SP.
    This is the work-horse for pc_in_call_dummy and read_register_dummy     */
 
-char * 
+char *
 generic_find_dummy_frame (pc, fp)
      CORE_ADDR pc;
      CORE_ADDR fp;
 {
-  struct dummy_frame * dummyframe;
+  struct dummy_frame *dummyframe;
 
   if (pc != entry_point_address ())
     return 0;
@@ -1179,7 +1180,7 @@ generic_read_register_dummy (pc, fp, regno)
 
   if (dummy_regs)
     return extract_address (&dummy_regs[REGISTER_BYTE (regno)],
-                           REGISTER_RAW_SIZE(regno));
+                           REGISTER_RAW_SIZE (regno));
   else
     return 0;
 }
@@ -1216,10 +1217,10 @@ generic_push_dummy_frame ()
   dummy_frame = xmalloc (sizeof (struct dummy_frame));
   dummy_frame->registers = xmalloc (REGISTER_BYTES);
 
-  dummy_frame->pc   = read_register (PC_REGNUM);
-  dummy_frame->sp   = read_register (SP_REGNUM);
-  dummy_frame->top  = dummy_frame->sp;
-  dummy_frame->fp   = fp;
+  dummy_frame->pc = read_register (PC_REGNUM);
+  dummy_frame->sp = read_register (SP_REGNUM);
+  dummy_frame->top = dummy_frame->sp;
+  dummy_frame->fp = fp;
   read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
   dummy_frame->next = dummy_frame_stack;
   dummy_frame_stack = dummy_frame;
@@ -1238,10 +1239,10 @@ generic_save_dummy_frame_tos (sp)
 
 void
 generic_pop_current_frame (pop)
-  void (*pop) PARAMS ((struct frame_info *frame));
+     void (*pop) PARAMS ((struct frame_info * frame));
 {
   struct frame_info *frame = get_current_frame ();
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     generic_pop_dummy_frame ();
   else
     pop (frame);
@@ -1271,20 +1272,20 @@ generic_pop_dummy_frame ()
 /* Function: frame_chain_valid 
    Returns true for a user frame or a call_function_by_hand dummy frame,
    and false for the CRT0 start-up frame.  Purpose is to terminate backtrace */
+
 int
 generic_frame_chain_valid (fp, fi)
      CORE_ADDR fp;
      struct frame_info *fi;
 {
-  if (PC_IN_CALL_DUMMY(FRAME_SAVED_PC(fi), fp, fp))
-    return 1;   /* don't prune CALL_DUMMY frames */
-  else          /* fall back to default algorithm (see frame.h) */
+  if (PC_IN_CALL_DUMMY (FRAME_SAVED_PC (fi), fp, fp))
+    return 1;                  /* don't prune CALL_DUMMY frames */
+  else                         /* fall back to default algorithm (see frame.h) */
     return (fp != 0
            && (INNER_THAN (fi->frame, fp) || fi->frame == fp)
-           && !inside_entry_file (FRAME_SAVED_PC(fi)));
+           && !inside_entry_file (FRAME_SAVED_PC (fi)));
 }
+
 /* Function: fix_call_dummy
    Stub function.  Generic dumy frames typically do not need to fix
    the frame being created */
@@ -1342,7 +1343,7 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
   if (optimized != NULL)
     *optimized = 0;
 
-  if (addrp)           /* default assumption: not found in memory */
+  if (addrp)                   /* default assumption: not found in memory */
     *addrp = 0;
 
   /* Note: since the current frame's registers could only have been
@@ -1354,34 +1355,34 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
     {
       if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
        {
-         if (lval)                     /* found it in a CALL_DUMMY frame */
+         if (lval)             /* found it in a CALL_DUMMY frame */
            *lval = not_lval;
          if (raw_buffer)
-           memcpy (raw_buffer, 
-                   generic_find_dummy_frame (frame->pc, frame->frame) + 
+           memcpy (raw_buffer,
+                   generic_find_dummy_frame (frame->pc, frame->frame) +
                    REGISTER_BYTE (regnum),
                    REGISTER_RAW_SIZE (regnum));
-             return;
+         return;
        }
 
       FRAME_INIT_SAVED_REGS (frame);
       if (frame->saved_regs != NULL
          && frame->saved_regs[regnum] != 0)
        {
-         if (lval)                     /* found it saved on the stack */
+         if (lval)             /* found it saved on the stack */
            *lval = lval_memory;
          if (regnum == SP_REGNUM)
            {
-             if (raw_buffer)           /* SP register treated specially */
-               store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), 
+             if (raw_buffer)   /* SP register treated specially */
+               store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
                               frame->saved_regs[regnum]);
            }
          else
            {
-             if (addrp)                /* any other register */
+             if (addrp)        /* any other register */
                *addrp = frame->saved_regs[regnum];
              if (raw_buffer)
-               read_memory (frame->saved_regs[regnum], raw_buffer, 
+               read_memory (frame->saved_regs[regnum], raw_buffer,
                             REGISTER_RAW_SIZE (regnum));
            }
          return;
@@ -1391,7 +1392,7 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
   /* If we get thru the loop to this point, it means the register was
      not saved in any frame.  Return the actual live-register value.  */
 
-  if (lval)                            /* found it in a live register */
+  if (lval)                    /* found it in a live register */
     *lval = lval_register;
   if (addrp)
     *addrp = REGISTER_BYTE (regnum);
index 16a3ad68f7c878aedbca2c0089f8eaa65b05cf82..ef9dfb8bc1bcd6db498bf87e3539bb5ffca66e22 100644 (file)
@@ -1,22 +1,23 @@
 /* Everything about breakpoints, for GDB.
    Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <ctype.h>
@@ -63,7 +64,7 @@ static void
 enable_command PARAMS ((char *, int));
 
 static void
-map_breakpoint_numbers PARAMS ((char *,        void (*)(struct breakpoint *)));
+map_breakpoint_numbers PARAMS ((char *, void (*)(struct breakpoint *)));
 
 static void
 ignore_command PARAMS ((char *, int));
@@ -103,7 +104,7 @@ static void
 mention PARAMS ((struct breakpoint *));
 
 struct breakpoint *
-set_raw_breakpoint PARAMS ((struct symtab_and_line));
+  set_raw_breakpoint PARAMS ((struct symtab_and_line));
 
 static void
 check_duplicates PARAMS ((CORE_ADDR, asection *));
@@ -118,7 +119,7 @@ static void
 breakpoint_1 PARAMS ((int, int));
 
 static bpstat
-bpstat_alloc PARAMS ((struct breakpoint *, bpstat));
+  bpstat_alloc PARAMS ((struct breakpoint *, bpstat));
 
 static int breakpoint_cond_eval PARAMS ((PTR));
 
@@ -139,23 +140,27 @@ set_breakpoint_count PARAMS ((int));
 
 #if 0
 static struct breakpoint *
-create_temp_exception_breakpoint PARAMS ((CORE_ADDR));
+  create_temp_exception_breakpoint PARAMS ((CORE_ADDR));
 #endif
 
-typedef enum {
-  mark_inserted,
-  mark_uninserted
-} insertion_state_t;
+typedef enum
+  {
+    mark_inserted,
+    mark_uninserted
+  }
+insertion_state_t;
 
 static int
 remove_breakpoint PARAMS ((struct breakpoint *, insertion_state_t));
 
 static int print_it_normal PARAMS ((bpstat));
 
-typedef struct {
-  enum exception_event_kind kind;
-  int enable;
-} args_for_catchpoint_enable;
+typedef struct
+  {
+    enum exception_event_kind kind;
+    int enable;
+  }
+args_for_catchpoint_enable;
 
 static int watchpoint_check PARAMS ((PTR));
 
@@ -187,9 +192,9 @@ static void awatch_command PARAMS ((char *, int));
 
 static void do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp));
 
-static void create_solib_load_unload_event_breakpoint PARAMS ((char *hookname, int  tempflag, char *dll_pathname, char *cond_string, enum bptype bp_kind));
+static void create_solib_load_unload_event_breakpoint PARAMS ((char *hookname, int tempflag, char *dll_pathname, char *cond_string, enum bptype bp_kind));
 
-static void create_fork_vfork_event_catchpoint PARAMS ((int  tempflag, char *  cond_string, enum bptype bp_kind));
+static void create_fork_vfork_event_catchpoint PARAMS ((int tempflag, char *cond_string, enum bptype bp_kind));
 
 static void break_at_finish_at_depth_command_1 PARAMS ((char *arg, int flag, int from_tty));
 
@@ -209,7 +214,7 @@ static char *ep_parse_optional_filename PARAMS ((char **arg));
 
 static void catch_exec_command_1 PARAMS ((char *arg, int tempflag, int from_tty));
 
-static void create_exception_catchpoint PARAMS ((int tempflag, char *cond_string, enum exception_event_kind ex_event, struct symtab_and_line *sal));
+static void create_exception_catchpoint PARAMS ((int tempflag, char *cond_string, enum exception_event_kind ex_event, struct symtab_and_line * sal));
 
 static void catch_exception_command_1 PARAMS ((enum exception_event_kind ex_event, char *arg, int tempflag, int from_tty));
 
@@ -235,7 +240,7 @@ void _initialize_breakpoint PARAMS ((void));
 
 void set_breakpoint_count PARAMS ((int));
 
-extern int addressprint;               /* Print machine addresses? */
+extern int addressprint;       /* Print machine addresses? */
 
 #if defined (GET_LONGJMP_TARGET) || defined (SOLIB_ADD)
 static int internal_breakpoint_number = -1;
@@ -263,7 +268,7 @@ int must_shift_inst_regs =
 #else
 0
 #endif
-;
+ ;
 
 /* True if breakpoint hit counts should be displayed in breakpoint info.  */
 
@@ -277,13 +282,13 @@ struct breakpoint *breakpoint_chain;
 
 int breakpoint_count;
 
-/* Pointer to current exception event record */ 
-static struct exception_event_record * current_exception_event;
+/* Pointer to current exception event record */
+static struct exception_event_record *current_exception_event;
 
 /* Indicator of whether exception catchpoints should be nuked
    between runs of a program */
 int exception_catchpoints_are_fragile = 0;
+
 /* Indicator of when exception catchpoints set-up should be
    reinitialized -- e.g. when program is re-run */
 int exception_support_initialized = 0;
@@ -394,7 +399,7 @@ get_number (pp)
   else if (*p == '$')
     {
       /* Make a copy of the name, so we can null-terminate it
-        to pass to lookup_internalvar().  */
+         to pass to lookup_internalvar().  */
       char *varname;
       char *start = ++p;
       value_ptr val;
@@ -407,8 +412,8 @@ get_number (pp)
       val = value_of_internalvar (lookup_internalvar (varname));
       if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_INT)
        error (
-"Convenience variables used to specify breakpoints must have integer values."
-              );
+               "Convenience variables used to specify breakpoints must have integer values."
+         );
       retval = (int) value_as_long (val);
     }
   else
@@ -449,35 +454,35 @@ condition_command (arg, from_tty)
 
   ALL_BREAKPOINTS (b)
     if (b->number == bnum)
-      {
-       if (b->cond)
-         {
-           free ((PTR)b->cond);
-           b->cond = 0;
-         }
-       if (b->cond_string != NULL)
-         free ((PTR)b->cond_string);
+    {
+      if (b->cond)
+       {
+         free ((PTR) b->cond);
+         b->cond = 0;
+       }
+      if (b->cond_string != NULL)
+       free ((PTR) b->cond_string);
 
-       if (*p == 0)
-         {
-           b->cond = 0;
-           b->cond_string = NULL;
-           if (from_tty)
-             printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
-         }
-       else
-         {
-           arg = p;
-           /* I don't know if it matters whether this is the string the user
-              typed in or the decompiled expression.  */
-           b->cond_string = savestring (arg, strlen (arg));
-           b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
-           if (*arg)
-             error ("Junk at end of expression");
-         }
-       breakpoints_changed ();
-       return;
-      }
+      if (*p == 0)
+       {
+         b->cond = 0;
+         b->cond_string = NULL;
+         if (from_tty)
+           printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
+       }
+      else
+       {
+         arg = p;
+         /* I don't know if it matters whether this is the string the user
+            typed in or the decompiled expression.  */
+         b->cond_string = savestring (arg, strlen (arg));
+         b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
+         if (*arg)
+           error ("Junk at end of expression");
+       }
+      breakpoints_changed ();
+      return;
+    }
 
   error ("No breakpoint number %d.", bnum);
 }
@@ -504,18 +509,18 @@ commands_command (arg, from_tty)
   bnum = get_number (&p);
   if (p && *p)
     error ("Unexpected extra arguments following breakpoint number.");
-      
+
   ALL_BREAKPOINTS (b)
     if (b->number == bnum)
-      {
-       char tmpbuf[128];
-       sprintf (tmpbuf, "Type commands for when breakpoint %d is hit, one per line.", bnum);
-       l = read_command_lines (tmpbuf, from_tty);
-       free_command_lines (&b->commands);
-       b->commands = l;
-       breakpoints_changed ();
-       return;
-      }
+    {
+      char tmpbuf[128];
+      sprintf (tmpbuf, "Type commands for when breakpoint %d is hit, one per line.", bnum);
+      l = read_command_lines (tmpbuf, from_tty);
+      free_command_lines (&b->commands);
+      b->commands = l;
+      breakpoints_changed ();
+      return;
+    }
   error ("No breakpoint number %d.", bnum);
 }
 \f
@@ -541,91 +546,91 @@ read_memory_nobpt (memaddr, myaddr, len)
   if (BREAKPOINT_FROM_PC (&bp_addr, &bp_size) == NULL)
     /* No breakpoints on this machine. */
     return target_read_memory (memaddr, myaddr, len);
-  
+
   ALL_BREAKPOINTS (b)
+  {
+    if (b->type == bp_none)
+      warning ("attempted to read through apparently deleted breakpoint #%d?\n", b->number);
+
+    /* memory breakpoint? */
+    if (b->type == bp_watchpoint
+       || b->type == bp_hardware_watchpoint
+       || b->type == bp_read_watchpoint
+       || b->type == bp_access_watchpoint)
+      continue;
+    /* bp in memory? */
+    if (!b->inserted)
+      continue;
+    /* Addresses and length of the part of the breakpoint that
+       we need to copy.  */
+    /* XXXX The m68k, sh and h8300 have different local and remote
+       breakpoint values.  BREAKPOINT_FROM_PC still manages to
+       correctly determine the breakpoints memory address and size
+       for these targets. */
+    bp_addr = b->address;
+    bp_size = 0;
+    if (BREAKPOINT_FROM_PC (&bp_addr, &bp_size) == NULL)
+      continue;
+    if (bp_size == 0)
+      /* bp isn't valid */
+      continue;
+    if (bp_addr + bp_size <= memaddr)
+      /* The breakpoint is entirely before the chunk of memory we
+         are reading.  */
+      continue;
+    if (bp_addr >= memaddr + len)
+      /* The breakpoint is entirely after the chunk of memory we are
+         reading. */
+      continue;
+    /* Copy the breakpoint from the shadow contents, and recurse for
+       the things before and after.  */
     {
-      if (b->type == bp_none)
-        warning ("attempted to read through apparently deleted breakpoint #%d?\n", b->number);
+      /* Offset within shadow_contents.  */
+      int bptoffset = 0;
 
-      /* memory breakpoint? */
-      if (b->type == bp_watchpoint
-         || b->type == bp_hardware_watchpoint
-         || b->type == bp_read_watchpoint
-         || b->type == bp_access_watchpoint)
-       continue;
-      /* bp in memory? */
-      if (!b->inserted)
-       continue;
-      /* Addresses and length of the part of the breakpoint that
-        we need to copy.  */
-      /* XXXX The m68k, sh and h8300 have different local and remote
-        breakpoint values.  BREAKPOINT_FROM_PC still manages to
-        correctly determine the breakpoints memory address and size
-        for these targets. */
-      bp_addr = b->address;
-      bp_size = 0;
-      if (BREAKPOINT_FROM_PC (&bp_addr, &bp_size) == NULL)
-       continue;
-      if (bp_size == 0)
-       /* bp isn't valid */
-       continue;
-      if (bp_addr + bp_size <= memaddr)
-       /* The breakpoint is entirely before the chunk of memory we
-          are reading.  */
-       continue;
-      if (bp_addr >= memaddr + len)
-       /* The breakpoint is entirely after the chunk of memory we are
-          reading. */
-       continue;
-      /* Copy the breakpoint from the shadow contents, and recurse for
-        the things before and after.  */
-      {
-       /* Offset within shadow_contents.  */
-       int bptoffset = 0;
-         
-       if (bp_addr < memaddr)
-         {
-           /* Only copy the second part of the breakpoint.  */
-           bp_size -= memaddr - bp_addr;
-           bptoffset = memaddr - bp_addr;
-           bp_addr = memaddr;
-         }
-       
-       if (bp_addr + bp_size > memaddr + len)
-         {
-           /* Only copy the first part of the breakpoint.  */
-           bp_size -= (bp_addr + bp_size) - (memaddr + len);
-         }
-       
-       memcpy (myaddr + bp_addr - memaddr, 
-               b->shadow_contents + bptoffset, bp_size);
-       
-       if (bp_addr > memaddr)
-         {
-           /* Copy the section of memory before the breakpoint.  */
-           status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr);
-           if (status != 0)
-             return status;
-         }
-       
-       if (bp_addr + bp_size < memaddr + len)
-         {
-           /* Copy the section of memory after the breakpoint.  */
-           status = read_memory_nobpt
-             (bp_addr + bp_size,
-              myaddr + bp_addr + bp_size - memaddr,
-              memaddr + len - (bp_addr + bp_size));
-           if (status != 0)
-             return status;
-         }
-       return 0;
-      }
+      if (bp_addr < memaddr)
+       {
+         /* Only copy the second part of the breakpoint.  */
+         bp_size -= memaddr - bp_addr;
+         bptoffset = memaddr - bp_addr;
+         bp_addr = memaddr;
+       }
+
+      if (bp_addr + bp_size > memaddr + len)
+       {
+         /* Only copy the first part of the breakpoint.  */
+         bp_size -= (bp_addr + bp_size) - (memaddr + len);
+       }
+
+      memcpy (myaddr + bp_addr - memaddr,
+             b->shadow_contents + bptoffset, bp_size);
+
+      if (bp_addr > memaddr)
+       {
+         /* Copy the section of memory before the breakpoint.  */
+         status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr);
+         if (status != 0)
+           return status;
+       }
+
+      if (bp_addr + bp_size < memaddr + len)
+       {
+         /* Copy the section of memory after the breakpoint.  */
+         status = read_memory_nobpt
+           (bp_addr + bp_size,
+            myaddr + bp_addr + bp_size - memaddr,
+            memaddr + len - (bp_addr + bp_size));
+         if (status != 0)
+           return status;
+       }
+      return 0;
     }
+  }
   /* Nothing overlaps.  Just call read_memory_noerr.  */
   return target_read_memory (memaddr, myaddr, len);
 }
-
 \f
+
 /* insert_breakpoints is used when starting or continuing the program.
    remove_breakpoints is used when the program stops.
    Both return zero if successful,
@@ -643,110 +648,110 @@ insert_breakpoints ()
 
 
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      if (b->type != bp_watchpoint
-         && b->type != bp_hardware_watchpoint
-         && b->type != bp_read_watchpoint
-         && b->type != bp_access_watchpoint
-         && b->type != bp_catch_fork
-         && b->type != bp_catch_vfork
-         && b->type != bp_catch_exec
-          && b->type != bp_catch_throw
-          && b->type != bp_catch_catch
-         && b->enable != disabled
-         && b->enable != shlib_disabled
-          && b->enable != call_disabled
-         && ! b->inserted
-         && ! b->duplicate)
-       {
-         if (b->type == bp_hardware_breakpoint)
-           val = target_insert_hw_breakpoint(b->address, b->shadow_contents);
-         else
-           {
-             /* Check to see if breakpoint is in an overlay section;
-                if so, we should set the breakpoint at the LMA address.
-                Only if the section is currently mapped should we ALSO
-                set a break at the VMA address. */
-             if (overlay_debugging && b->section &&
-                 section_is_overlay (b->section))
-               {
-                 CORE_ADDR addr;
-
-                 addr = overlay_unmapped_address (b->address, b->section);
-                 val = target_insert_breakpoint (addr, b->shadow_contents);
-                 /* This would be the time to check val, to see if the
-                    breakpoint write to the load address succeeded.  
-                    However, this might be an ordinary occurrance, eg. if 
-                    the unmapped overlay is in ROM.  */
-                 val = 0;      /* in case unmapped address failed */
-                 if (section_is_mapped (b->section))
-                   val = target_insert_breakpoint (b->address, 
-                                                   b->shadow_contents);
-               }
-             else /* ordinary (non-overlay) address */
-               val = target_insert_breakpoint(b->address, b->shadow_contents);
-           }
-         if (val)
-           {
-             /* Can't set the breakpoint.  */
+  {
+    if (b->type != bp_watchpoint
+       && b->type != bp_hardware_watchpoint
+       && b->type != bp_read_watchpoint
+       && b->type != bp_access_watchpoint
+       && b->type != bp_catch_fork
+       && b->type != bp_catch_vfork
+       && b->type != bp_catch_exec
+       && b->type != bp_catch_throw
+       && b->type != bp_catch_catch
+       && b->enable != disabled
+       && b->enable != shlib_disabled
+       && b->enable != call_disabled
+       && !b->inserted
+       && !b->duplicate)
+      {
+       if (b->type == bp_hardware_breakpoint)
+         val = target_insert_hw_breakpoint (b->address, b->shadow_contents);
+       else
+         {
+           /* Check to see if breakpoint is in an overlay section;
+              if so, we should set the breakpoint at the LMA address.
+              Only if the section is currently mapped should we ALSO
+              set a break at the VMA address. */
+           if (overlay_debugging && b->section &&
+               section_is_overlay (b->section))
+             {
+               CORE_ADDR addr;
+
+               addr = overlay_unmapped_address (b->address, b->section);
+               val = target_insert_breakpoint (addr, b->shadow_contents);
+               /* This would be the time to check val, to see if the
+                  breakpoint write to the load address succeeded.  
+                  However, this might be an ordinary occurrance, eg. if 
+                  the unmapped overlay is in ROM.  */
+               val = 0;        /* in case unmapped address failed */
+               if (section_is_mapped (b->section))
+                 val = target_insert_breakpoint (b->address,
+                                                 b->shadow_contents);
+             }
+           else                /* ordinary (non-overlay) address */
+             val = target_insert_breakpoint (b->address, b->shadow_contents);
+         }
+       if (val)
+         {
+           /* Can't set the breakpoint.  */
 #if defined (DISABLE_UNSETTABLE_BREAK)
-             if (DISABLE_UNSETTABLE_BREAK (b->address))
-               {
-                  /* See also: disable_breakpoints_in_shlibs. */
-                 val = 0;
-                 b->enable = shlib_disabled;
-                 if (!disabled_breaks)
-                   {
-                     target_terminal_ours_for_output ();
-                     fprintf_unfiltered (gdb_stderr,
-                                         "Cannot insert breakpoint %d:\n", b->number);
-                     printf_filtered ("Temporarily disabling shared library breakpoints:\n");
-                   }
-                 disabled_breaks = 1;
-                 printf_filtered ("%d ", b->number);
-               }
-             else
+           if (DISABLE_UNSETTABLE_BREAK (b->address))
+             {
+               /* See also: disable_breakpoints_in_shlibs. */
+               val = 0;
+               b->enable = shlib_disabled;
+               if (!disabled_breaks)
+                 {
+                   target_terminal_ours_for_output ();
+                   fprintf_unfiltered (gdb_stderr,
+                              "Cannot insert breakpoint %d:\n", b->number);
+                   printf_filtered ("Temporarily disabling shared library breakpoints:\n");
+                 }
+               disabled_breaks = 1;
+               printf_filtered ("%d ", b->number);
+             }
+           else
 #endif
-               {
-                 target_terminal_ours_for_output ();
-                 fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
+             {
+               target_terminal_ours_for_output ();
+               fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
 #ifdef ONE_PROCESS_WRITETEXT
-                 fprintf_unfiltered (gdb_stderr,
-                                     "The same program may be running in another process.\n");
+               fprintf_unfiltered (gdb_stderr,
+                  "The same program may be running in another process.\n");
 #endif
-                 memory_error (val, b->address);       /* which bombs us out */
-               }
-           }
-         else
-            b->inserted = 1;
-       }
+               memory_error (val, b->address);         /* which bombs us out */
+             }
+         }
+       else
+         b->inserted = 1;
+      }
     else if (ep_is_exception_catchpoint (b)
-             && b->enable != disabled
-             && b->enable != shlib_disabled
-             && b->enable != call_disabled
-             && ! b->inserted
-             && ! b->duplicate)
+            && b->enable != disabled
+            && b->enable != shlib_disabled
+            && b->enable != call_disabled
+            && !b->inserted
+            && !b->duplicate)
 
       {
-         /* If we get here, we must have a callback mechanism for exception
-            events -- with g++ style embedded label support, we insert
-            ordinary breakpoints and not catchpoints. */ 
-        sprintf (message, message1, b->number); /* Format possible error message */
-        val = target_insert_breakpoint(b->address, b->shadow_contents);
-        if (val)
-          {
-           /* Couldn't set breakpoint for some reason */ 
-           target_terminal_ours_for_output ();
-           fprintf_unfiltered (gdb_stderr,
-                        "Cannot insert catchpoint %d; disabling it\n", b->number);
-           b->enable = disabled;
-          }
-        else
-          {
-              /* Bp set, now make sure callbacks are enabled */ 
+       /* If we get here, we must have a callback mechanism for exception
+          events -- with g++ style embedded label support, we insert
+          ordinary breakpoints and not catchpoints. */
+       sprintf (message, message1, b->number);         /* Format possible error message */
+
+       val = target_insert_breakpoint (b->address, b->shadow_contents);
+       if (val)
+         {
+           /* Couldn't set breakpoint for some reason */
+           target_terminal_ours_for_output ();
+           fprintf_unfiltered (gdb_stderr,
+                 "Cannot insert catchpoint %d; disabling it\n", b->number);
+           b->enable = disabled;
+         }
+       else
+         {
+           /* Bp set, now make sure callbacks are enabled */
            int val;
-           args_for_catchpoint_enable args;  
+           args_for_catchpoint_enable args;
            args.kind = b->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW;
            args.enable = 1;
            val = catch_errors (cover_target_enable_exception_callback,
@@ -756,140 +761,140 @@ insert_breakpoints ()
              {
                b->inserted = 1;
              }
-           /* Check if something went wrong; val == 0 can be ignored */ 
+           /* Check if something went wrong; val == 0 can be ignored */
            if (val == -1)
              {
-               /* something went wrong */ 
+               /* something went wrong */
                target_terminal_ours_for_output ();
                fprintf_unfiltered (gdb_stderr, "Cannot insert catchpoint %d; disabling it\n", b->number);
                b->enable = disabled;
              }
-          }
+         }
       }
 
-      else if ((b->type == bp_hardware_watchpoint ||
-               b->type == bp_read_watchpoint ||
-               b->type == bp_access_watchpoint)
-              && b->enable == enabled
-              && ! b->inserted
-              && ! b->duplicate)
-       {
-         struct frame_info *saved_frame;
-         int saved_level, within_current_scope;
-         value_ptr mark = value_mark ();
-         value_ptr v;
-
-         /* Save the current frame and level so we can restore it after
-            evaluating the watchpoint expression on its own frame.  */
-         saved_frame = selected_frame;
-         saved_level = selected_frame_level;
-
-         /* Determine if the watchpoint is within scope.  */
-         if (b->exp_valid_block == NULL)
-           within_current_scope = 1;
-         else
-           {
-             struct frame_info *fi;
-
-             /* There might be no current frame at this moment if we are
-                resuming from a step over a breakpoint.
-                Set up current frame before trying to find the watchpoint
-                frame.  */
-             get_current_frame ();
-             fi = find_frame_addr_in_frame_chain (b->watchpoint_frame);
-             within_current_scope = (fi != NULL);
-             if (within_current_scope)
-               select_frame (fi, -1);
-           }
-       
-         if (within_current_scope)
-           {
-             /* Evaluate the expression and cut the chain of values
-                produced off from the value chain.  */
-             v = evaluate_expression (b->exp);
-             value_release_to_mark (mark);
-           
-             b->val_chain = v;
-             b->inserted = 1;
-
-             /* Look at each value on the value chain.  */
-             for ( ; v; v=v->next)
-               {
-                 /* If it's a memory location, then we must watch it.  */
-                 if (v->lval == lval_memory)
-                   {
-                     int addr, len, type;
-                   
-                     addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
-                     len = TYPE_LENGTH (VALUE_TYPE (v));
-                     type = 0;
-                     if (b->type == bp_read_watchpoint)
-                       type = 1;
-                     else if (b->type == bp_access_watchpoint)
-                       type = 2;
-
-                     val = target_insert_watchpoint (addr, len, type);
-                     if (val == -1)
-                       {
-                         b->inserted = 0;
-                         break;
-                       }
-                     val = 0;
-                   }
-               }
-             /* Failure to insert a watchpoint on any memory value in the
-                value chain brings us here.  */
-             if (!b->inserted)
-               warning ("Hardware watchpoint %d: Could not insert watchpoint\n",
-                        b->number);
-           }
-         else
-           {
-             printf_filtered ("\
+    else if ((b->type == bp_hardware_watchpoint ||
+             b->type == bp_read_watchpoint ||
+             b->type == bp_access_watchpoint)
+            && b->enable == enabled
+            && !b->inserted
+            && !b->duplicate)
+      {
+       struct frame_info *saved_frame;
+       int saved_level, within_current_scope;
+       value_ptr mark = value_mark ();
+       value_ptr v;
+
+       /* Save the current frame and level so we can restore it after
+          evaluating the watchpoint expression on its own frame.  */
+       saved_frame = selected_frame;
+       saved_level = selected_frame_level;
+
+       /* Determine if the watchpoint is within scope.  */
+       if (b->exp_valid_block == NULL)
+         within_current_scope = 1;
+       else
+         {
+           struct frame_info *fi;
+
+           /* There might be no current frame at this moment if we are
+              resuming from a step over a breakpoint.
+              Set up current frame before trying to find the watchpoint
+              frame.  */
+           get_current_frame ();
+           fi = find_frame_addr_in_frame_chain (b->watchpoint_frame);
+           within_current_scope = (fi != NULL);
+           if (within_current_scope)
+             select_frame (fi, -1);
+         }
+
+       if (within_current_scope)
+         {
+           /* Evaluate the expression and cut the chain of values
+              produced off from the value chain.  */
+           v = evaluate_expression (b->exp);
+           value_release_to_mark (mark);
+
+           b->val_chain = v;
+           b->inserted = 1;
+
+           /* Look at each value on the value chain.  */
+           for (; v; v = v->next)
+             {
+               /* If it's a memory location, then we must watch it.  */
+               if (v->lval == lval_memory)
+                 {
+                   int addr, len, type;
+
+                   addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+                   len = TYPE_LENGTH (VALUE_TYPE (v));
+                   type = 0;
+                   if (b->type == bp_read_watchpoint)
+                     type = 1;
+                   else if (b->type == bp_access_watchpoint)
+                     type = 2;
+
+                   val = target_insert_watchpoint (addr, len, type);
+                   if (val == -1)
+                     {
+                       b->inserted = 0;
+                       break;
+                     }
+                   val = 0;
+                 }
+             }
+           /* Failure to insert a watchpoint on any memory value in the
+              value chain brings us here.  */
+           if (!b->inserted)
+             warning ("Hardware watchpoint %d: Could not insert watchpoint\n",
+                      b->number);
+         }
+       else
+         {
+           printf_filtered ("\
 Hardware watchpoint %d deleted because the program has left the block in\n\
 which its expression is valid.\n", b->number);
-             if (b->related_breakpoint)
-               b->related_breakpoint->disposition = del_at_next_stop;
-             b->disposition = del_at_next_stop;
-           }
+           if (b->related_breakpoint)
+             b->related_breakpoint->disposition = del_at_next_stop;
+           b->disposition = del_at_next_stop;
+         }
 
-         /* Restore the frame and level.  */
-         if ((saved_frame != selected_frame) ||
-             (saved_level != selected_frame_level))
-           select_and_print_frame (saved_frame, saved_level);
-       } 
-      else if ((b->type == bp_catch_fork
-                || b->type == bp_catch_vfork
-                || b->type == bp_catch_exec)
-               && b->enable == enabled
-               && ! b->inserted
-               && ! b->duplicate)
-       {
-         val = -1;
-          switch (b->type)
-            {
-           case bp_catch_fork :
-             val = target_insert_fork_catchpoint (inferior_pid);
-             break;
-           case bp_catch_vfork :
-             val = target_insert_vfork_catchpoint (inferior_pid);
-             break;
-           case bp_catch_exec :
-             val = target_insert_exec_catchpoint (inferior_pid);
-             break;
-           default:
-             warning ("GDB bug: breakpoint.c (insert_breakpoints): enclosing `if' does not protect `switch'");
-             break;
-            }
-          if (val < 0)
-            {
-              target_terminal_ours_for_output ();
-              fprintf_unfiltered (gdb_stderr, "Cannot insert catchpoint %d:\n", b->number);
-            }
-          else
-            b->inserted = 1;
-        }
-    }
+       /* Restore the frame and level.  */
+       if ((saved_frame != selected_frame) ||
+           (saved_level != selected_frame_level))
+         select_and_print_frame (saved_frame, saved_level);
+      }
+    else if ((b->type == bp_catch_fork
+             || b->type == bp_catch_vfork
+             || b->type == bp_catch_exec)
+            && b->enable == enabled
+            && !b->inserted
+            && !b->duplicate)
+      {
+       val = -1;
+       switch (b->type)
+         {
+         case bp_catch_fork:
+           val = target_insert_fork_catchpoint (inferior_pid);
+           break;
+         case bp_catch_vfork:
+           val = target_insert_vfork_catchpoint (inferior_pid);
+           break;
+         case bp_catch_exec:
+           val = target_insert_exec_catchpoint (inferior_pid);
+           break;
+         default:
+           warning ("GDB bug: breakpoint.c (insert_breakpoints): enclosing `if' does not protect `switch'");
+           break;
+         }
+       if (val < 0)
+         {
+           target_terminal_ours_for_output ();
+           fprintf_unfiltered (gdb_stderr, "Cannot insert catchpoint %d:\n", b->number);
+         }
+       else
+         b->inserted = 1;
+      }
+  }
   if (disabled_breaks)
     printf_filtered ("\n");
 
@@ -904,42 +909,42 @@ remove_breakpoints ()
   int val;
 
   ALL_BREAKPOINTS (b)
-    {
-      if (b->inserted)
-       {
-         val = remove_breakpoint (b, mark_uninserted);
-         if (val != 0)
-           return val;
-       }
-    }
+  {
+    if (b->inserted)
+      {
+       val = remove_breakpoint (b, mark_uninserted);
+       if (val != 0)
+         return val;
+      }
+  }
   return 0;
 }
 
 int
 reattach_breakpoints (pid)
-  int  pid;
+     int pid;
 {
   register struct breakpoint *b;
   int val;
-  int  saved_inferior_pid = inferior_pid;
+  int saved_inferior_pid = inferior_pid;
 
-  inferior_pid = pid;  /* Because remove_breakpoint will use this global. */
+  inferior_pid = pid;          /* Because remove_breakpoint will use this global. */
   ALL_BREAKPOINTS (b)
-    {
-      if (b->inserted)
-       {
-          remove_breakpoint (b, mark_inserted);
-          if (b->type == bp_hardware_breakpoint)
-            val = target_insert_hw_breakpoint(b->address, b->shadow_contents);
-          else
-            val = target_insert_breakpoint(b->address, b->shadow_contents);
-         if (val != 0)
-            {
-              inferior_pid = saved_inferior_pid;
-              return val;
-            }
-        }
-    }
+  {
+    if (b->inserted)
+      {
+       remove_breakpoint (b, mark_inserted);
+       if (b->type == bp_hardware_breakpoint)
+         val = target_insert_hw_breakpoint (b->address, b->shadow_contents);
+       else
+         val = target_insert_breakpoint (b->address, b->shadow_contents);
+       if (val != 0)
+         {
+           inferior_pid = saved_inferior_pid;
+           return val;
+         }
+      }
+  }
   inferior_pid = saved_inferior_pid;
   return 0;
 }
@@ -947,8 +952,8 @@ reattach_breakpoints (pid)
 void
 update_breakpoints_after_exec ()
 {
-  struct breakpoint *  b;
-  struct breakpoint *  temp;
+  struct breakpoint *b;
+  struct breakpoint *temp;
 
   /* Doing this first prevents the badness of having delete_breakpoint()
      write a breakpoint's current "shadow contents" to lift the bp.  That
@@ -956,124 +961,124 @@ update_breakpoints_after_exec ()
   mark_breakpoints_out ();
 
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      /* Solib breakpoints must be explicitly reset after an exec(). */
-      if (b->type == bp_shlib_event)
-        {
-          delete_breakpoint (b);
-          continue;
-        }
-
-      /* Step-resume breakpoints are meaningless after an exec(). */
-      if (b->type == bp_step_resume)
-        {
-          delete_breakpoint (b);
-          continue;
-        }
-
-      /* Ditto the sigtramp handler breakpoints. */
-      if (b->type == bp_through_sigtramp)
-        {
-          delete_breakpoint (b);
-          continue;
-        }
-
-      /* Ditto the exception-handling catchpoints. */
-      if ((b->type == bp_catch_catch) || (b->type == bp_catch_throw))
-        {
-          delete_breakpoint (b);
-          continue;
-        }
-
-      /* Don't delete an exec catchpoint, because else the inferior
-         won't stop when it ought!
-
-         Similarly, we probably ought to keep vfork catchpoints, 'cause
-         on this target, we may not be able to stop when the vfork is seen,
-         but only when the subsequent exec is seen.  (And because deleting
-         fork catchpoints here but not vfork catchpoints will seem mysterious
-         to users, keep those too.)
-
-         ??rehrauer: Let's hope that merely clearing out this catchpoint's
-         target address field, if any, is sufficient to have it be reset
-         automagically.  Certainly on HP-UX that's true. */
-      if ((b->type == bp_catch_exec) ||
-          (b->type == bp_catch_vfork) ||
-          (b->type == bp_catch_fork))
-        {
-          b->address = (CORE_ADDR) NULL;
-          continue;
-        }
-
-      /* bp_finish is a special case.  The only way we ought to be able
-         to see one of these when an exec() has happened, is if the user
-         caught a vfork, and then said "finish".  Ordinarily a finish just
-         carries them to the call-site of the current callee, by setting
-         a temporary bp there and resuming.  But in this case, the finish
-         will carry them entirely through the vfork & exec.
-
-         We don't want to allow a bp_finish to remain inserted now.  But
-         we can't safely delete it, 'cause finish_command has a handle to
-         the bp on a bpstat, and will later want to delete it.  There's a
-         chance (and I've seen it happen) that if we delete the bp_finish
-         here, that its storage will get reused by the time finish_command
-         gets 'round to deleting the "use to be a bp_finish" breakpoint.
-         We really must allow finish_command to delete a bp_finish.
-
-         In the absense of a general solution for the "how do we know it's
-         safe to delete something others may have handles to?" problem, what
-         we'll do here is just uninsert the bp_finish, and let finish_command
-         delete it.
-
-         (We know the bp_finish is "doomed" in the sense that it's momentary,
-         and will be deleted as soon as finish_command sees the inferior stopped.
-         So it doesn't matter that the bp's address is probably bogus in the
-         new a.out, unlike e.g., the solib breakpoints.)  */
-      if (b->type == bp_finish)
-        {
-          continue;
-        }
-
-      /* Without a symbolic address, we have little hope of the
-         pre-exec() address meaning the same thing in the post-exec()
-         a.out. */
-      if (b->addr_string == NULL)
-        {
-          delete_breakpoint (b);
-          continue;
-        }
+  {
+    /* Solib breakpoints must be explicitly reset after an exec(). */
+    if (b->type == bp_shlib_event)
+      {
+       delete_breakpoint (b);
+       continue;
+      }
 
-      /* If this breakpoint has survived the above battery of checks, then
-         it must have a symbolic address.  Be sure that it gets reevaluated
-         to a target address, rather than reusing the old evaluation.  */
-      b->address = (CORE_ADDR) NULL;
-    }
+    /* Step-resume breakpoints are meaningless after an exec(). */
+    if (b->type == bp_step_resume)
+      {
+       delete_breakpoint (b);
+       continue;
+      }
+
+    /* Ditto the sigtramp handler breakpoints. */
+    if (b->type == bp_through_sigtramp)
+      {
+       delete_breakpoint (b);
+       continue;
+      }
+
+    /* Ditto the exception-handling catchpoints. */
+    if ((b->type == bp_catch_catch) || (b->type == bp_catch_throw))
+      {
+       delete_breakpoint (b);
+       continue;
+      }
+
+    /* Don't delete an exec catchpoint, because else the inferior
+       won't stop when it ought!
+
+       Similarly, we probably ought to keep vfork catchpoints, 'cause
+       on this target, we may not be able to stop when the vfork is seen,
+       but only when the subsequent exec is seen.  (And because deleting
+       fork catchpoints here but not vfork catchpoints will seem mysterious
+       to users, keep those too.)
+
+       ??rehrauer: Let's hope that merely clearing out this catchpoint's
+       target address field, if any, is sufficient to have it be reset
+       automagically.  Certainly on HP-UX that's true. */
+    if ((b->type == bp_catch_exec) ||
+       (b->type == bp_catch_vfork) ||
+       (b->type == bp_catch_fork))
+      {
+       b->address = (CORE_ADDR) NULL;
+       continue;
+      }
+
+    /* bp_finish is a special case.  The only way we ought to be able
+       to see one of these when an exec() has happened, is if the user
+       caught a vfork, and then said "finish".  Ordinarily a finish just
+       carries them to the call-site of the current callee, by setting
+       a temporary bp there and resuming.  But in this case, the finish
+       will carry them entirely through the vfork & exec.
+
+       We don't want to allow a bp_finish to remain inserted now.  But
+       we can't safely delete it, 'cause finish_command has a handle to
+       the bp on a bpstat, and will later want to delete it.  There's a
+       chance (and I've seen it happen) that if we delete the bp_finish
+       here, that its storage will get reused by the time finish_command
+       gets 'round to deleting the "use to be a bp_finish" breakpoint.
+       We really must allow finish_command to delete a bp_finish.
+
+       In the absense of a general solution for the "how do we know it's
+       safe to delete something others may have handles to?" problem, what
+       we'll do here is just uninsert the bp_finish, and let finish_command
+       delete it.
+
+       (We know the bp_finish is "doomed" in the sense that it's momentary,
+       and will be deleted as soon as finish_command sees the inferior stopped.
+       So it doesn't matter that the bp's address is probably bogus in the
+       new a.out, unlike e.g., the solib breakpoints.)  */
+    if (b->type == bp_finish)
+      {
+       continue;
+      }
+
+    /* Without a symbolic address, we have little hope of the
+       pre-exec() address meaning the same thing in the post-exec()
+       a.out. */
+    if (b->addr_string == NULL)
+      {
+       delete_breakpoint (b);
+       continue;
+      }
+
+    /* If this breakpoint has survived the above battery of checks, then
+       it must have a symbolic address.  Be sure that it gets reevaluated
+       to a target address, rather than reusing the old evaluation.  */
+    b->address = (CORE_ADDR) NULL;
+  }
 }
 
 int
 detach_breakpoints (pid)
-  int  pid;
+     int pid;
 {
   register struct breakpoint *b;
   int val;
-  int  saved_inferior_pid = inferior_pid;
+  int saved_inferior_pid = inferior_pid;
+
   if (pid == inferior_pid)
     error ("Cannot detach breakpoints of inferior_pid");
-  inferior_pid = pid;  /* Because remove_breakpoint will use this global. */
+
+  inferior_pid = pid;          /* Because remove_breakpoint will use this global. */
   ALL_BREAKPOINTS (b)
-    {
-      if (b->inserted)
-        {
-          val = remove_breakpoint (b, mark_inserted);
-          if (val != 0)
-            {
-              inferior_pid = saved_inferior_pid;
-              return val;
-            }
-        }
-    }
+  {
+    if (b->inserted)
+      {
+       val = remove_breakpoint (b, mark_inserted);
+       if (val != 0)
+         {
+           inferior_pid = saved_inferior_pid;
+           return val;
+         }
+      }
+  }
   inferior_pid = saved_inferior_pid;
   return 0;
 }
@@ -1081,10 +1086,10 @@ detach_breakpoints (pid)
 static int
 remove_breakpoint (b, is)
      struct breakpoint *b;
-     insertion_state_t  is;
+     insertion_state_t is;
 {
   int val;
-  
+
   if (b->type == bp_none)
     warning ("attempted to remove apparently deleted breakpoint #%d?\n", b->number);
 
@@ -1097,17 +1102,17 @@ remove_breakpoint (b, is)
       && b->type != bp_catch_exec
       && b->type != bp_catch_catch
       && b->type != bp_catch_throw)
-      
+
     {
       if (b->type == bp_hardware_breakpoint)
-        val = target_remove_hw_breakpoint(b->address, b->shadow_contents);
+       val = target_remove_hw_breakpoint (b->address, b->shadow_contents);
       else
        {
          /* Check to see if breakpoint is in an overlay section;
             if so, we should remove the breakpoint at the LMA address.
             If that is not equal to the raw address, then we should 
             presumable remove the breakpoint there as well.  */
-         if (overlay_debugging && b->section && 
+         if (overlay_debugging && b->section &&
              section_is_overlay (b->section))
            {
              CORE_ADDR addr;
@@ -1115,29 +1120,29 @@ remove_breakpoint (b, is)
              addr = overlay_unmapped_address (b->address, b->section);
              val = target_remove_breakpoint (addr, b->shadow_contents);
              /* This would be the time to check val, to see if the
-                shadow breakpoint write to the load address succeeded.  
-                However, this might be an ordinary occurrance, eg. if 
-                the unmapped overlay is in ROM.  */
-             val = 0;  /* in case unmapped address failed */
+                shadow breakpoint write to the load address succeeded.  
+                However, this might be an ordinary occurrance, eg. if 
+                the unmapped overlay is in ROM.  */
+             val = 0;          /* in case unmapped address failed */
              if (section_is_mapped (b->section))
-               val = target_remove_breakpoint (b->address, 
+               val = target_remove_breakpoint (b->address,
                                                b->shadow_contents);
            }
-         else /* ordinary (non-overlay) address */
-           val = target_remove_breakpoint(b->address, b->shadow_contents);
+         else                  /* ordinary (non-overlay) address */
+           val = target_remove_breakpoint (b->address, b->shadow_contents);
        }
       if (val)
        return val;
       b->inserted = (is == mark_inserted);
     }
   else if ((b->type == bp_hardware_watchpoint ||
-            b->type == bp_read_watchpoint ||
-           b->type == bp_access_watchpoint)
+           b->type == bp_read_watchpoint ||
+           b->type == bp_access_watchpoint)
           && b->enable == enabled
-          && ! b->duplicate)
+          && !b->duplicate)
     {
       value_ptr v, n;
-      
+
       b->inserted = (is == mark_inserted);
       /* Walk down the saved value chain.  */
       for (v = b->val_chain; v; v = v->next)
@@ -1147,7 +1152,7 @@ remove_breakpoint (b, is)
          if (v->lval == lval_memory)
            {
              int addr, len, type;
-             
+
              addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
              len = TYPE_LENGTH (VALUE_TYPE (v));
              type = 0;
@@ -1166,9 +1171,9 @@ remove_breakpoint (b, is)
       if ((is == mark_uninserted) && (b->inserted))
        warning ("Hardware watchpoint %d: Could not remove watchpoint\n",
                 b->number);
-      
+
       /* Free the saved value chain.  We will construct a new one
-        the next time the watchpoint is inserted.  */
+         the next time the watchpoint is inserted.  */
       for (v = b->val_chain; v; v = n)
        {
          n = v->next;
@@ -1177,52 +1182,52 @@ remove_breakpoint (b, is)
       b->val_chain = NULL;
     }
   else if ((b->type == bp_catch_fork ||
-            b->type == bp_catch_vfork ||
-           b->type == bp_catch_exec)
+           b->type == bp_catch_vfork ||
+           b->type == bp_catch_exec)
           && b->enable == enabled
-          && ! b->duplicate)
+          && !b->duplicate)
     {
       val = -1;
       switch (b->type)
-        {
-          case bp_catch_fork:
-            val = target_remove_fork_catchpoint (inferior_pid);
-            break;
-          case bp_catch_vfork :
-            val = target_remove_vfork_catchpoint (inferior_pid);
-            break;
-          case bp_catch_exec :
-            val = target_remove_exec_catchpoint (inferior_pid);
-            break;
+       {
+       case bp_catch_fork:
+         val = target_remove_fork_catchpoint (inferior_pid);
+         break;
+       case bp_catch_vfork:
+         val = target_remove_vfork_catchpoint (inferior_pid);
+         break;
+       case bp_catch_exec:
+         val = target_remove_exec_catchpoint (inferior_pid);
+         break;
        default:
          warning ("GDB bug: breakpoint.c (remove_breakpoint): enclosing `if' does not protect `switch'");
          break;
-        }
+       }
       if (val)
        return val;
       b->inserted = (is == mark_inserted);
     }
   else if ((b->type == bp_catch_catch ||
-            b->type == bp_catch_throw)
-           && b->enable == enabled
-           && ! b->duplicate)
+           b->type == bp_catch_throw)
+          && b->enable == enabled
+          && !b->duplicate)
     {
 
-      val = target_remove_breakpoint(b->address, b->shadow_contents);
+      val = target_remove_breakpoint (b->address, b->shadow_contents);
       if (val)
-        return val;
+       return val;
       b->inserted = (is == mark_inserted);
     }
   else if (ep_is_exception_catchpoint (b)
-           && b->inserted /* sometimes previous insert doesn't happen */ 
-           && b->enable == enabled
-           && ! b->duplicate)
+          && b->inserted       /* sometimes previous insert doesn't happen */
+          && b->enable == enabled
+          && !b->duplicate)
     {
 
-      val = target_remove_breakpoint(b->address, b->shadow_contents);
+      val = target_remove_breakpoint (b->address, b->shadow_contents);
       if (val)
-          return val;
-      
+       return val;
+
       b->inserted = (is == mark_inserted);
     }
 
@@ -1247,65 +1252,65 @@ mark_breakpoints_out ()
    between runs.
 
    Note: this function gets called at the end of a run (by generic_mourn_inferior)
-   and when a run begins (by init_wait_for_inferior). */ 
+   and when a run begins (by init_wait_for_inferior). */
 
 
 
 void
 breakpoint_init_inferior (context)
-  enum inf_context context;
+     enum inf_context context;
 {
   register struct breakpoint *b, *temp;
   static int warning_needed = 0;
 
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      b->inserted = 0;
+  {
+    b->inserted = 0;
 
-      switch (b->type)
-       {
-       case bp_call_dummy:
-       case bp_watchpoint_scope:
+    switch (b->type)
+      {
+      case bp_call_dummy:
+      case bp_watchpoint_scope:
 
-         /* If the call dummy breakpoint is at the entry point it will
-            cause problems when the inferior is rerun, so we better
-            get rid of it. 
+       /* If the call dummy breakpoint is at the entry point it will
+          cause problems when the inferior is rerun, so we better
+          get rid of it. 
 
-            Also get rid of scope breakpoints.  */
-         delete_breakpoint (b);
-         break;
+          Also get rid of scope breakpoints.  */
+       delete_breakpoint (b);
+       break;
 
-       case bp_watchpoint:
-       case bp_hardware_watchpoint:
-       case bp_read_watchpoint:
-       case bp_access_watchpoint:
+      case bp_watchpoint:
+      case bp_hardware_watchpoint:
+      case bp_read_watchpoint:
+      case bp_access_watchpoint:
 
-         /* Likewise for watchpoints on local expressions.  */
-         if (b->exp_valid_block != NULL)
+       /* Likewise for watchpoints on local expressions.  */
+       if (b->exp_valid_block != NULL)
+         delete_breakpoint (b);
+       break;
+      default:
+       /* Likewise for exception catchpoints in dynamic-linked
+          executables where required */
+       if (ep_is_exception_catchpoint (b) &&
+           exception_catchpoints_are_fragile)
+         {
+           warning_needed = 1;
            delete_breakpoint (b);
-         break;
-       default:
-         /* Likewise for exception catchpoints in dynamic-linked
-         executables where required */
-         if (ep_is_exception_catchpoint (b) &&
-            exception_catchpoints_are_fragile)
-          {
-            warning_needed = 1;
-            delete_breakpoint (b);
-          }
-          break;
-       }
-    }
+         }
+       break;
+      }
+  }
 
   if (exception_catchpoints_are_fragile)
     exception_support_initialized = 0;
 
-  /* Don't issue the warning unless it's really needed... */ 
+  /* Don't issue the warning unless it's really needed... */
   if (warning_needed && (context != inf_exited))
     {
       warning ("Exception catchpoints from last run were deleted, you must reinsert them explicitly");
       warning_needed = 0;
-    }  
+    }
 }
 
 /* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC.
@@ -1323,14 +1328,14 @@ breakpoint_here_p (pc)
        && b->enable != shlib_disabled
        && b->enable != call_disabled
        && b->address == pc)    /* bp is enabled and matches pc */
-      {
-        if (overlay_debugging &&
-           section_is_overlay (b->section) &&
-           !section_is_mapped (b->section))
-         continue;             /* unmapped overlay -- can't be a match */
-        else
-         return 1;
-      }
+    {
+      if (overlay_debugging &&
+         section_is_overlay (b->section) &&
+         !section_is_mapped (b->section))
+       continue;               /* unmapped overlay -- can't be a match */
+      else
+       return 1;
+    }
 
   return 0;
 }
@@ -1347,14 +1352,14 @@ breakpoint_inserted_here_p (pc)
   ALL_BREAKPOINTS (b)
     if (b->inserted
        && b->address == pc)    /* bp is inserted and matches pc */
-      {
-        if (overlay_debugging &&
-           section_is_overlay (b->section) &&
-           !section_is_mapped (b->section))
-         continue;             /* unmapped overlay -- can't be a match */
-        else
-         return 1;
-      }
+    {
+      if (overlay_debugging &&
+         section_is_overlay (b->section) &&
+         !section_is_mapped (b->section))
+       continue;               /* unmapped overlay -- can't be a match */
+      else
+       return 1;
+    }
 
   return 0;
 }
@@ -1370,24 +1375,24 @@ frame_in_dummy (frame)
 {
   struct breakpoint *b;
 
-  if (! CALL_DUMMY_P)
+  if (!CALL_DUMMY_P)
     return 0;
 
   if (USE_GENERIC_DUMMY_FRAMES)
     return generic_pc_in_call_dummy (frame->pc, frame->frame, frame->frame);
-  
+
   ALL_BREAKPOINTS (b)
-    {
-      if (b->type == bp_call_dummy
-         && b->frame == frame->frame
-         /* We need to check the PC as well as the frame on the sparc,
-            for signals.exp in the testsuite.  */
-         && (frame->pc
-             >= (b->address
-                 - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
-         && frame->pc <= b->address)
-       return 1;
-    }
+  {
+    if (b->type == bp_call_dummy
+       && b->frame == frame->frame
+    /* We need to check the PC as well as the frame on the sparc,
+       for signals.exp in the testsuite.  */
+       && (frame->pc
+           >= (b->address
+             - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
+       && frame->pc <= b->address)
+      return 1;
+  }
   return 0;
 }
 
@@ -1410,25 +1415,25 @@ breakpoint_thread_match (pc, pid)
        && b->enable != call_disabled
        && b->address == pc
        && (b->thread == -1 || b->thread == thread))
-      {
-        if (overlay_debugging &&
-           section_is_overlay (b->section) &&
-           !section_is_mapped (b->section))
-         continue;             /* unmapped overlay -- can't be a match */
-        else
-         return 1;
-      }
+    {
+      if (overlay_debugging &&
+         section_is_overlay (b->section) &&
+         !section_is_mapped (b->section))
+       continue;               /* unmapped overlay -- can't be a match */
+      else
+       return 1;
+    }
 
   return 0;
 }
-
 \f
+
 /* bpstat stuff.  External routines' interfaces are documented
    in breakpoint.h.  */
 
 int
 ep_is_catchpoint (ep)
-  struct breakpoint *  ep;
+     struct breakpoint *ep;
 {
   return
     (ep->type == bp_catch_load)
@@ -1440,13 +1445,13 @@ ep_is_catchpoint (ep)
     || (ep->type == bp_catch_throw)
 
 
-    /* ??rehrauer: Add more kinds here, as are implemented... */
+  /* ??rehrauer: Add more kinds here, as are implemented... */
     ;
 }
+
 int
 ep_is_shlib_catchpoint (ep)
-  struct breakpoint *  ep;
+     struct breakpoint *ep;
 {
   return
     (ep->type == bp_catch_load)
@@ -1456,7 +1461,7 @@ ep_is_shlib_catchpoint (ep)
 
 int
 ep_is_exception_catchpoint (ep)
-  struct breakpoint *  ep;
+     struct breakpoint *ep;
 {
   return
     (ep->type == bp_catch_catch)
@@ -1482,7 +1487,7 @@ bpstat_clear (bsp)
       q = p->next;
       if (p->old_val != NULL)
        value_free (p->old_val);
-      free ((PTR)p);
+      free ((PTR) p);
       p = q;
     }
   *bsp = NULL;
@@ -1520,15 +1525,18 @@ bpstat_copy (bs)
 /* Find the bpstat associated with this breakpoint */
 
 bpstat
-bpstat_find_breakpoint(bsp, breakpoint)
+bpstat_find_breakpoint (bsp, breakpoint)
      bpstat bsp;
      struct breakpoint *breakpoint;
 {
-  if (bsp == NULL) return NULL;
+  if (bsp == NULL)
+    return NULL;
 
-  for (;bsp != NULL; bsp = bsp->next) {
-    if (bsp->breakpoint_at == breakpoint) return bsp;
-  }
+  for (; bsp != NULL; bsp = bsp->next)
+    {
+      if (bsp->breakpoint_at == breakpoint)
+       return bsp;
+    }
   return NULL;
 }
 
@@ -1542,7 +1550,7 @@ bpstat_find_breakpoint(bsp, breakpoint)
    See wait_for_inferior's use of this function.  */
 struct breakpoint *
 bpstat_find_step_resume_breakpoint (bsp)
-  bpstat  bsp;
+     bpstat bsp;
 {
   if (bsp == NULL)
     error ("Internal error (bpstat_find_step_resume_breakpoint)");
@@ -1550,8 +1558,8 @@ bpstat_find_step_resume_breakpoint (bsp)
   for (; bsp != NULL; bsp = bsp->next)
     {
       if ((bsp->breakpoint_at != NULL) &&
-          (bsp->breakpoint_at->type == bp_step_resume))
-        return bsp->breakpoint_at;
+         (bsp->breakpoint_at->type == bp_step_resume))
+       return bsp->breakpoint_at;
     }
 
   error ("Internal error (no step_resume breakpoint found)");
@@ -1579,7 +1587,7 @@ bpstat_num (bsp)
       if (b == NULL)
        return -1;              /* breakpoint that's been deleted since */
       else
-        return b->number;      /* We have its number */
+       return b->number;       /* We have its number */
     }
 }
 
@@ -1678,13 +1686,13 @@ top:
    calling the print_it function for each one. The default
    print_it function, used for breakpoints, is print_it_normal().
    (Also see print_it_noop() and print_it_done()).
-   
+
    Return values from this routine (used by bpstat_print() to
    decide what to do):
    1: Means we printed something, and we do *not* desire that
-      something to be followed by a location.
+   something to be followed by a location.
    0: Means we printed something, and we *do*  desire that
-      something to be followed by a location.
+   something to be followed by a location.
    -1: Means we printed nothing.  */
 
 static int
@@ -1695,13 +1703,13 @@ print_it_normal (bs)
      which has since been deleted.  */
   if (bs->breakpoint_at == NULL
       || (bs->breakpoint_at->type != bp_breakpoint
-          && bs->breakpoint_at->type != bp_catch_load
-          && bs->breakpoint_at->type != bp_catch_unload
-          && bs->breakpoint_at->type != bp_catch_fork
-          && bs->breakpoint_at->type != bp_catch_vfork
-          && bs->breakpoint_at->type != bp_catch_exec
-          && bs->breakpoint_at->type != bp_catch_catch
-          && bs->breakpoint_at->type != bp_catch_throw
+         && bs->breakpoint_at->type != bp_catch_load
+         && bs->breakpoint_at->type != bp_catch_unload
+         && bs->breakpoint_at->type != bp_catch_fork
+         && bs->breakpoint_at->type != bp_catch_vfork
+         && bs->breakpoint_at->type != bp_catch_exec
+         && bs->breakpoint_at->type != bp_catch_catch
+         && bs->breakpoint_at->type != bp_catch_throw
          && bs->breakpoint_at->type != bp_hardware_breakpoint
          && bs->breakpoint_at->type != bp_watchpoint
          && bs->breakpoint_at->type != bp_read_watchpoint
@@ -1714,21 +1722,21 @@ print_it_normal (bs)
       annotate_catchpoint (bs->breakpoint_at->number);
       printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
       if (bs->breakpoint_at->type == bp_catch_load)
-        printf_filtered ("loaded");
+       printf_filtered ("loaded");
       else if (bs->breakpoint_at->type == bp_catch_unload)
-        printf_filtered ("unloaded");
+       printf_filtered ("unloaded");
       printf_filtered (" %s), ", bs->breakpoint_at->triggered_dll_pathname);
       return 0;
     }
   else if (bs->breakpoint_at->type == bp_catch_fork ||
-      bs->breakpoint_at->type == bp_catch_vfork)
+          bs->breakpoint_at->type == bp_catch_vfork)
     {
       annotate_catchpoint (bs->breakpoint_at->number);
       printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number);
       if (bs->breakpoint_at->type == bp_catch_fork)
-        printf_filtered ("forked");
+       printf_filtered ("forked");
       else if (bs->breakpoint_at->type == bp_catch_vfork)
-        printf_filtered ("vforked");
+       printf_filtered ("vforked");
       printf_filtered (" process %d), ", bs->breakpoint_at->forked_inferior_pid);
       return 0;
     }
@@ -1736,84 +1744,84 @@ print_it_normal (bs)
     {
       annotate_catchpoint (bs->breakpoint_at->number);
       printf_filtered ("\nCatchpoint %d (exec'd %s), ",
-                       bs->breakpoint_at->number,
-                       bs->breakpoint_at->exec_pathname);
+                      bs->breakpoint_at->number,
+                      bs->breakpoint_at->exec_pathname);
       return 0;
     }
- else if (bs->breakpoint_at->type == bp_catch_catch)
 else if (bs->breakpoint_at->type == bp_catch_catch)
     {
       if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
-        {
-          annotate_catchpoint (bs->breakpoint_at->number);
-          printf_filtered ("\nCatchpoint %d (exception caught), ", bs->breakpoint_at->number);
-          printf_filtered ("throw location ");
-          if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
-                printf_filtered ("%s:%d",
-                                 CURRENT_EXCEPTION_THROW_FILE,
-                                 CURRENT_EXCEPTION_THROW_LINE);
-          else
-            printf_filtered ("unknown");
-          
-          printf_filtered (", catch location ");
-          if (CURRENT_EXCEPTION_CATCH_PC  && CURRENT_EXCEPTION_CATCH_LINE)
-            printf_filtered ("%s:%d",
-                             CURRENT_EXCEPTION_CATCH_FILE,
-                             CURRENT_EXCEPTION_CATCH_LINE);
-          else
-            printf_filtered ("unknown");
-          
-          printf_filtered ("\n");
-          return 1;   /* don't bother to print location frame info */ 
-        }
+       {
+         annotate_catchpoint (bs->breakpoint_at->number);
+         printf_filtered ("\nCatchpoint %d (exception caught), ", bs->breakpoint_at->number);
+         printf_filtered ("throw location ");
+         if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
+           printf_filtered ("%s:%d",
+                            CURRENT_EXCEPTION_THROW_FILE,
+                            CURRENT_EXCEPTION_THROW_LINE);
+         else
+           printf_filtered ("unknown");
+
+         printf_filtered (", catch location ");
+         if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
+           printf_filtered ("%s:%d",
+                            CURRENT_EXCEPTION_CATCH_FILE,
+                            CURRENT_EXCEPTION_CATCH_LINE);
+         else
+           printf_filtered ("unknown");
+
+         printf_filtered ("\n");
+         return 1;             /* don't bother to print location frame info */
+       }
       else
-        {
-          return -1;  /* really throw, some other bpstat will handle it */
-        }
+       {
+         return -1;            /* really throw, some other bpstat will handle it */
+       }
     }
   else if (bs->breakpoint_at->type == bp_catch_throw)
     {
       if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
-        {
-          annotate_catchpoint (bs->breakpoint_at->number);
-          printf_filtered ("\nCatchpoint %d (exception thrown), ", bs->breakpoint_at->number);
-          printf_filtered ("throw location ");
-          if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
-                printf_filtered ("%s:%d",
-                                 CURRENT_EXCEPTION_THROW_FILE,
-                                 CURRENT_EXCEPTION_THROW_LINE);
-          else
-            printf_filtered ("unknown");
-          
-          printf_filtered (", catch location ");
-          if (CURRENT_EXCEPTION_CATCH_PC  && CURRENT_EXCEPTION_CATCH_LINE)
-            printf_filtered ("%s:%d",
-                             CURRENT_EXCEPTION_CATCH_FILE,
-                             CURRENT_EXCEPTION_CATCH_LINE);
-          else
-            printf_filtered ("unknown");
-          
-          printf_filtered ("\n");
-          return 1;   /* don't bother to print location frame info */ 
-        }
+       {
+         annotate_catchpoint (bs->breakpoint_at->number);
+         printf_filtered ("\nCatchpoint %d (exception thrown), ", bs->breakpoint_at->number);
+         printf_filtered ("throw location ");
+         if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
+           printf_filtered ("%s:%d",
+                            CURRENT_EXCEPTION_THROW_FILE,
+                            CURRENT_EXCEPTION_THROW_LINE);
+         else
+           printf_filtered ("unknown");
+
+         printf_filtered (", catch location ");
+         if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
+           printf_filtered ("%s:%d",
+                            CURRENT_EXCEPTION_CATCH_FILE,
+                            CURRENT_EXCEPTION_CATCH_LINE);
+         else
+           printf_filtered ("unknown");
+
+         printf_filtered ("\n");
+         return 1;             /* don't bother to print location frame info */
+       }
       else
-        {
-          return -1;  /* really catch, some other bpstat willhandle it */
-        }
+       {
+         return -1;            /* really catch, some other bpstat willhandle it */
+       }
     }
 
   else if (bs->breakpoint_at->type == bp_breakpoint ||
-      bs->breakpoint_at->type == bp_hardware_breakpoint)
+          bs->breakpoint_at->type == bp_hardware_breakpoint)
     {
       /* I think the user probably only wants to see one breakpoint
-        number, not all of them.  */
+         number, not all of them.  */
       annotate_breakpoint (bs->breakpoint_at->number);
       printf_filtered ("\nBreakpoint %d, ", bs->breakpoint_at->number);
       return 0;
     }
   else if ((bs->old_val != NULL) &&
-       (bs->breakpoint_at->type == bp_watchpoint ||
-        bs->breakpoint_at->type == bp_access_watchpoint ||
-        bs->breakpoint_at->type == bp_hardware_watchpoint))
+          (bs->breakpoint_at->type == bp_watchpoint ||
+           bs->breakpoint_at->type == bp_access_watchpoint ||
+           bs->breakpoint_at->type == bp_hardware_watchpoint))
     {
       annotate_watchpoint (bs->breakpoint_at->number);
       mention (bs->breakpoint_at);
@@ -1834,7 +1842,7 @@ print_it_normal (bs)
       mention (bs->breakpoint_at);
       printf_filtered ("\nValue = ");
       value_print (bs->breakpoint_at->val, gdb_stdout, 0,
-                   Val_pretty_default);
+                  Val_pretty_default);
       printf_filtered ("\n");
       return -1;
     }
@@ -1853,27 +1861,27 @@ print_it_normal (bs)
 
    -1: Means we printed nothing
    0: Means we printed something, and expect subsequent
-      code to print the location. An example is 
-      "Breakpoint 1, " which should be followed by
-      the location.
+   code to print the location. An example is 
+   "Breakpoint 1, " which should be followed by
+   the location.
    1 : Means we printed something, but there is no need
-       to also print the location part of the message.
-       An example is the catch/throw messages, which
-       don't require a location appended to the end.  */ 
+   to also print the location part of the message.
+   An example is the catch/throw messages, which
+   don't require a location appended to the end.  */
 
 int
 bpstat_print (bs)
      bpstat bs;
 {
   int val;
-  
+
   if (bs == NULL)
     return -1;
 
   val = (*bs->print_it) (bs);
   if (val >= 0)
     return val;
-  
+
   /* Maybe another breakpoint in the chain caused us to stop.
      (Currently all watchpoints go on the bpstat whether hit or
      not.  That probably could (should) be changed, provided care is taken
@@ -1895,7 +1903,7 @@ breakpoint_cond_eval (exp)
      PTR exp;
 {
   value_ptr mark = value_mark ();
-  int i = !value_true (evaluate_expression ((struct expression *)exp));
+  int i = !value_true (evaluate_expression ((struct expression *) exp));
   value_free_to_mark (mark);
   return i;
 }
@@ -1905,7 +1913,7 @@ breakpoint_cond_eval (exp)
 static bpstat
 bpstat_alloc (b, cbs)
      register struct breakpoint *b;
-     bpstat cbs;                       /* Current "bs" value */
+     bpstat cbs;               /* Current "bs" value */
 {
   bpstat bs;
 
@@ -1949,9 +1957,9 @@ watchpoint_check (p)
   else
     {
       /* There is no current frame at this moment.  If we're going to have
-        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();
+         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);
       within_current_scope = (fr != NULL);
       if (within_current_scope)
@@ -1960,13 +1968,13 @@ watchpoint_check (p)
           the user.  */
        select_frame (fr, -1);
     }
-      
+
   if (within_current_scope)
     {
       /* We use value_{,free_to_}mark because it could be a
          *long* time before we return to the command level and
-        call free_all_values.  We can't call free_all_values because
-        we might be in the middle of evaluating a function call.  */
+         call free_all_values.  We can't call free_all_values because
+         we might be in the middle of evaluating a function call.  */
 
       value_ptr mark = value_mark ();
       value_ptr new_val = evaluate_expression (bs->breakpoint_at->exp);
@@ -1990,13 +1998,13 @@ watchpoint_check (p)
   else
     {
       /* This seems like the only logical thing to do because
-        if we temporarily ignored the watchpoint, then when
-        we reenter the block in which it is valid it contains
-        garbage (in the case of a function, it may have two
-        garbage values, one before and one after the prologue).
-        So we can't even detect the first assignment to it and
-        watch after that (since the garbage may or may not equal
-        the first value assigned).  */
+         if we temporarily ignored the watchpoint, then when
+         we reenter the block in which it is valid it contains
+         garbage (in the case of a function, it may have two
+         garbage values, one before and one after the prologue).
+         So we can't even detect the first assignment to it and
+         watch after that (since the garbage may or may not equal
+         the first value assigned).  */
       printf_filtered ("\
 Watchpoint %d deleted because the program has left the block in\n\
 which its expression is valid.\n", bs->breakpoint_at->number);
@@ -2051,16 +2059,16 @@ print_it_noop (bs)
 /* Determine whether we stopped at a breakpoint, etc, or whether we
    don't understand this stop.  Result is a chain of bpstat's such that:
 
-       if we don't understand the stop, the result is a null pointer.
+   if we don't understand the stop, the result is a null pointer.
 
-       if we understand why we stopped, the result is not null.
+   if we understand why we stopped, the result is not null.
 
-       Each element of the chain refers to a particular breakpoint or
-       watchpoint at which we have stopped.  (We may have stopped for
-       several reasons concurrently.)
+   Each element of the chain refers to a particular breakpoint or
+   watchpoint at which we have stopped.  (We may have stopped for
+   several reasons concurrently.)
 
-       Each element of the chain has valid next, breakpoint_at,
-       commands, FIXME??? fields.  */
+   Each element of the chain has valid next, breakpoint_at,
+   commands, FIXME??? fields.  */
 
 bpstat
 bpstat_stop_status (pc, not_a_breakpoint)
@@ -2076,94 +2084,149 @@ bpstat_stop_status (pc, not_a_breakpoint)
   /* Pointer to the last thing in the chain currently.  */
   bpstat bs = root_bs;
   static char message1[] =
-            "Error evaluating expression for watchpoint %d\n";
-  char message[sizeof (message1) + 30 /* slop */];
+  "Error evaluating expression for watchpoint %d\n";
+  char message[sizeof (message1) + 30 /* slop */ ];
 
   /* Get the address where the breakpoint would have been.  */
   bp_addr = *pc - DECR_PC_AFTER_BREAK;
 
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      if (b->enable == disabled
-         || b->enable == shlib_disabled
-          || b->enable == call_disabled)
-       continue;
-
-      if (b->type != bp_watchpoint
-         && b->type != bp_hardware_watchpoint
-          && b->type != bp_read_watchpoint
-          && b->type != bp_access_watchpoint
-         && b->type != bp_hardware_breakpoint
-          && b->type != bp_catch_fork
-          && b->type != bp_catch_vfork
-          && b->type != bp_catch_exec
-          && b->type != bp_catch_catch
-          && b->type != bp_catch_throw)         /* a non-watchpoint bp */
-       if (b->address != bp_addr ||            /* address doesn't match or */
-           (overlay_debugging &&               /* overlay doesn't match */
-            section_is_overlay (b->section) &&
-            !section_is_mapped (b->section)))
-         continue;
-
-      if (b->type == bp_hardware_breakpoint
-         && b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
-       continue;
-
-      if (b->type != bp_watchpoint
-         && b->type != bp_hardware_watchpoint
-         && b->type != bp_read_watchpoint
-         && b->type != bp_access_watchpoint
-         && not_a_breakpoint)
+  {
+    if (b->enable == disabled
+       || b->enable == shlib_disabled
+       || b->enable == call_disabled)
+      continue;
+
+    if (b->type != bp_watchpoint
+       && b->type != bp_hardware_watchpoint
+       && b->type != bp_read_watchpoint
+       && b->type != bp_access_watchpoint
+       && b->type != bp_hardware_breakpoint
+       && b->type != bp_catch_fork
+       && b->type != bp_catch_vfork
+       && b->type != bp_catch_exec
+       && b->type != bp_catch_catch
+       && b->type != bp_catch_throw)   /* a non-watchpoint bp */
+      if (b->address != bp_addr ||     /* address doesn't match or */
+         (overlay_debugging && /* overlay doesn't match */
+          section_is_overlay (b->section) &&
+          !section_is_mapped (b->section)))
        continue;
 
-      /* Is this a catchpoint of a load or unload?  If so, did we
-         get a load or unload of the specified library?  If not,
-         ignore it. */
-      if ((b->type == bp_catch_load)
+    if (b->type == bp_hardware_breakpoint
+       && b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
+      continue;
+
+    if (b->type != bp_watchpoint
+       && b->type != bp_hardware_watchpoint
+       && b->type != bp_read_watchpoint
+       && b->type != bp_access_watchpoint
+       && not_a_breakpoint)
+      continue;
+
+    /* Is this a catchpoint of a load or unload?  If so, did we
+       get a load or unload of the specified library?  If not,
+       ignore it. */
+    if ((b->type == bp_catch_load)
 #if defined(SOLIB_HAVE_LOAD_EVENT)
-          && (!SOLIB_HAVE_LOAD_EVENT(inferior_pid)
-              || ((b->dll_pathname != NULL)
-                  && (strcmp (b->dll_pathname, SOLIB_LOADED_LIBRARY_PATHNAME(inferior_pid)) != 0)))
+       && (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
+           || ((b->dll_pathname != NULL)
+               && (strcmp (b->dll_pathname, SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid)) != 0)))
 #endif
-                 )
-        continue;
-      if ((b->type == bp_catch_unload)
+      )
+      continue;
+
+    if ((b->type == bp_catch_unload)
 #if defined(SOLIB_HAVE_UNLOAD_EVENT)
-          && (!SOLIB_HAVE_UNLOAD_EVENT(inferior_pid)
-              || ((b->dll_pathname != NULL)
-                  && (strcmp (b->dll_pathname, SOLIB_UNLOADED_LIBRARY_PATHNAME(inferior_pid)) != 0)))
+       && (!SOLIB_HAVE_UNLOAD_EVENT (inferior_pid)
+           || ((b->dll_pathname != NULL)
+               && (strcmp (b->dll_pathname, SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid)) != 0)))
 #endif
-         )
-        continue;
-      if ((b->type == bp_catch_fork)
-          && ! target_has_forked (inferior_pid, &b->forked_inferior_pid))
-          continue;
-      if ((b->type == bp_catch_vfork)
-          && ! target_has_vforked (inferior_pid, &b->forked_inferior_pid))
-          continue;
-      if ((b->type == bp_catch_exec)
-         && ! target_has_execd (inferior_pid, &b->exec_pathname))
-       continue;
+      )
+      continue;
 
-      if (ep_is_exception_catchpoint (b) &&
-          !(current_exception_event = target_get_current_exception_event ()))
-        continue;
+    if ((b->type == bp_catch_fork)
+       && !target_has_forked (inferior_pid, &b->forked_inferior_pid))
+      continue;
 
-      /* Come here if it's a watchpoint, or if the break address matches */
+    if ((b->type == bp_catch_vfork)
+       && !target_has_vforked (inferior_pid, &b->forked_inferior_pid))
+      continue;
 
-      bs = bpstat_alloc (b, bs);       /* Alloc a bpstat to explain stop */
+    if ((b->type == bp_catch_exec)
+       && !target_has_execd (inferior_pid, &b->exec_pathname))
+      continue;
 
-      /* Watchpoints may change this, if not found to have triggered. */
-      bs->stop = 1;
-      bs->print = 1;
+    if (ep_is_exception_catchpoint (b) &&
+       !(current_exception_event = target_get_current_exception_event ()))
+      continue;
 
-      sprintf (message, message1, b->number);
-      if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint)
-       {
+    /* Come here if it's a watchpoint, or if the break address matches */
+
+    bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */
+
+    /* Watchpoints may change this, if not found to have triggered. */
+    bs->stop = 1;
+    bs->print = 1;
+
+    sprintf (message, message1, b->number);
+    if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint)
+      {
+       switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL))
+         {
+         case WP_DELETED:
+           /* We've already printed what needs to be printed.  */
+           bs->print_it = print_it_done;
+           /* Stop.  */
+           break;
+         case WP_VALUE_CHANGED:
+           /* Stop.  */
+           ++(b->hit_count);
+           break;
+         case WP_VALUE_NOT_CHANGED:
+           /* Don't stop.  */
+           bs->print_it = print_it_noop;
+           bs->stop = 0;
+           /* Don't consider this a hit.  */
+           --(b->hit_count);
+           continue;
+         default:
+           /* Can't happen.  */
+           /* FALLTHROUGH */
+         case 0:
+           /* Error from catch_errors.  */
+           printf_filtered ("Watchpoint %d deleted.\n", b->number);
+           if (b->related_breakpoint)
+             b->related_breakpoint->disposition = del_at_next_stop;
+           b->disposition = del_at_next_stop;
+           /* We've already printed what needs to be printed.  */
+           bs->print_it = print_it_done;
+
+           /* Stop.  */
+           break;
+         }
+      }
+    else if (b->type == bp_read_watchpoint || b->type == bp_access_watchpoint)
+      {
+       CORE_ADDR addr;
+       value_ptr v;
+       int found = 0;
+
+       addr = target_stopped_data_address ();
+       if (addr == 0)
+         continue;
+       for (v = b->val_chain; v; v = v->next)
+         {
+           if (v->lval == lval_memory)
+             {
+               CORE_ADDR vaddr;
+
+               vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+               if (addr == vaddr)
+                 found = 1;
+             }
+         }
+       if (found)
          switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL))
            {
            case WP_DELETED:
@@ -2172,19 +2235,12 @@ bpstat_stop_status (pc, not_a_breakpoint)
              /* Stop.  */
              break;
            case WP_VALUE_CHANGED:
+           case WP_VALUE_NOT_CHANGED:
              /* Stop.  */
              ++(b->hit_count);
              break;
-           case WP_VALUE_NOT_CHANGED:
-             /* Don't stop.  */
-             bs->print_it = print_it_noop;
-             bs->stop = 0;
-             /* Don't consider this a hit.  */
-             --(b->hit_count);
-             continue;
            default:
              /* Can't happen.  */
-             /* FALLTHROUGH */
            case 0:
              /* Error from catch_errors.  */
              printf_filtered ("Watchpoint %d deleted.\n", b->number);
@@ -2193,126 +2249,79 @@ bpstat_stop_status (pc, not_a_breakpoint)
              b->disposition = del_at_next_stop;
              /* We've already printed what needs to be printed.  */
              bs->print_it = print_it_done;
-
-             /* Stop.  */
              break;
            }
-       }
-      else if (b->type == bp_read_watchpoint || b->type == bp_access_watchpoint)
-        {
-         CORE_ADDR addr;
-         value_ptr v;
-          int found = 0;
-
-         addr = target_stopped_data_address();
-         if (addr == 0) continue;
-          for (v = b->val_chain; v; v = v->next)
-            {
-              if (v->lval == lval_memory)
-                {
-                  CORE_ADDR vaddr;
-
-                  vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
-                 if (addr == vaddr)
-                   found = 1;
-                }
-            }
-         if (found) 
-           switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL))
-             {
-                case WP_DELETED:
-                  /* We've already printed what needs to be printed.  */
-                  bs->print_it = print_it_done;
-                  /* Stop.  */
-                  break;
-                case WP_VALUE_CHANGED:
-                case WP_VALUE_NOT_CHANGED:
-                  /* Stop.  */
-                 ++(b->hit_count);
-                  break;
-                default:
-                  /* Can't happen.  */
-                case 0:
-                  /* Error from catch_errors.  */
-                  printf_filtered ("Watchpoint %d deleted.\n", b->number);
-                 if (b->related_breakpoint)
-                   b->related_breakpoint->disposition = del_at_next_stop;
-                 b->disposition = del_at_next_stop;
-                  /* We've already printed what needs to be printed.  */
-                  bs->print_it = print_it_done;
-                  break;
-             }
-        }
-      else 
-        {
-          /* By definition, an encountered breakpoint is a triggered
-             breakpoint. */
-          ++(b->hit_count);
-
-         real_breakpoint = 1;
-        }
-
-      if (b->frame && b->frame != (get_current_frame ())->frame &&
-          (b->type == bp_step_resume && 
-           (INNER_THAN (get_current_frame ()->frame, b->frame))))
-       bs->stop = 0;
-      else
-       {
-         int value_is_zero = 0;
+      }
+    else
+      {
+       /* By definition, an encountered breakpoint is a triggered
+          breakpoint. */
+       ++(b->hit_count);
 
-         if (b->cond)
-           {
-             /* Need to select the frame, with all that implies
-                so that the conditions will have the right context.  */
-             select_frame (get_current_frame (), 0);
-             value_is_zero
-               = catch_errors (breakpoint_cond_eval, (b->cond),
-                               "Error in testing breakpoint condition:\n",
-                               RETURN_MASK_ALL);
-                               /* FIXME-someday, should give breakpoint # */
-             free_all_values ();
-           }
-         if (b->cond && value_is_zero)
-           {
-             bs->stop = 0;
-             /* Don't consider this a hit.  */
-             --(b->hit_count);
-           }
-         else if (b->ignore_count > 0)
-           {
-             b->ignore_count--;
-             bs->stop = 0;
-           }
-         else
-           {
-             /* We will stop here */
-             if (b->disposition == disable)
-               b->enable = disabled;
-             bs->commands = b->commands;
-             if (b->silent)
+       real_breakpoint = 1;
+      }
+
+    if (b->frame && b->frame != (get_current_frame ())->frame &&
+       (b->type == bp_step_resume &&
+        (INNER_THAN (get_current_frame ()->frame, b->frame))))
+      bs->stop = 0;
+    else
+      {
+       int value_is_zero = 0;
+
+       if (b->cond)
+         {
+           /* Need to select the frame, with all that implies
+              so that the conditions will have the right context.  */
+           select_frame (get_current_frame (), 0);
+           value_is_zero
+             = catch_errors (breakpoint_cond_eval, (b->cond),
+                             "Error in testing breakpoint condition:\n",
+                             RETURN_MASK_ALL);
+           /* FIXME-someday, should give breakpoint # */
+           free_all_values ();
+         }
+       if (b->cond && value_is_zero)
+         {
+           bs->stop = 0;
+           /* Don't consider this a hit.  */
+           --(b->hit_count);
+         }
+       else if (b->ignore_count > 0)
+         {
+           b->ignore_count--;
+           bs->stop = 0;
+         }
+       else
+         {
+           /* We will stop here */
+           if (b->disposition == disable)
+             b->enable = disabled;
+           bs->commands = b->commands;
+           if (b->silent)
+             bs->print = 0;
+           if (bs->commands &&
+               (STREQ ("silent", bs->commands->line) ||
+                (xdb_commands && STREQ ("Q", bs->commands->line))))
+             {
+               bs->commands = bs->commands->next;
                bs->print = 0;
-             if (bs->commands &&
-                 (STREQ ("silent", bs->commands->line) ||
-                  (xdb_commands && STREQ ("Q", bs->commands->line))))
-               {
-                 bs->commands = bs->commands->next;
-                 bs->print = 0;
-               }
-           }
-       }
-      /* Print nothing for this entry if we dont stop or if we dont print.  */
-      if (bs->stop == 0 || bs->print == 0)
-       bs->print_it = print_it_noop;
-    }
+             }
+         }
+      }
+    /* Print nothing for this entry if we dont stop or if we dont print.  */
+    if (bs->stop == 0 || bs->print == 0)
+      bs->print_it = print_it_noop;
+  }
 
   bs->next = NULL;             /* Terminate the chain */
   bs = root_bs->next;          /* Re-grab the head of the chain */
 
   if (real_breakpoint && bs)
     {
-      if (bs->breakpoint_at->type == bp_hardware_breakpoint) 
+      if (bs->breakpoint_at->type == bp_hardware_breakpoint)
        {
-         if (DECR_PC_AFTER_HW_BREAK != 0) 
+         if (DECR_PC_AFTER_HW_BREAK != 0)
            {
              *pc = *pc - DECR_PC_AFTER_HW_BREAK;
              write_pc (*pc);
@@ -2324,7 +2333,7 @@ bpstat_stop_status (pc, not_a_breakpoint)
            {
              *pc = bp_addr;
 #if defined (SHIFT_INST_REGS)
-             SHIFT_INST_REGS();
+             SHIFT_INST_REGS ();
 #else /* No SHIFT_INST_REGS.  */
              write_pc (bp_addr);
 #endif /* No SHIFT_INST_REGS.  */
@@ -2334,7 +2343,7 @@ bpstat_stop_status (pc, not_a_breakpoint)
 
   /* The value of a hardware watchpoint hasn't changed, but the
      intermediate memory locations we are watching may have.  */
-  if (bs && ! bs->stop &&
+  if (bs && !bs->stop &&
       (bs->breakpoint_at->type == bp_hardware_watchpoint ||
        bs->breakpoint_at->type == bp_read_watchpoint ||
        bs->breakpoint_at->type == bp_access_watchpoint))
@@ -2351,45 +2360,46 @@ bpstat_what (bs)
      bpstat bs;
 {
   /* Classify each bpstat as one of the following.  */
-  enum class {
-    /* This bpstat element has no effect on the main_action.  */
-    no_effect = 0,
+  enum class
+    {
+      /* This bpstat element has no effect on the main_action.  */
+      no_effect = 0,
+
+      /* There was a watchpoint, stop but don't print.  */
+      wp_silent,
 
-    /* There was a watchpoint, stop but don't print.  */
-    wp_silent,
+      /* There was a watchpoint, stop and print.  */
+      wp_noisy,
 
-    /* There was a watchpoint, stop and print.  */
-    wp_noisy,
+      /* There was a breakpoint but we're not stopping.  */
+      bp_nostop,
 
-    /* There was a breakpoint but we're not stopping.  */
-    bp_nostop,
+      /* There was a breakpoint, stop but don't print.  */
+      bp_silent,
 
-    /* There was a breakpoint, stop but don't print.  */
-    bp_silent,
+      /* There was a breakpoint, stop and print.  */
+      bp_noisy,
 
-    /* There was a breakpoint, stop and print.  */
-    bp_noisy,
+      /* We hit the longjmp breakpoint.  */
+      long_jump,
 
-    /* We hit the longjmp breakpoint.  */
-    long_jump,
+      /* We hit the longjmp_resume breakpoint.  */
+      long_resume,
 
-    /* We hit the longjmp_resume breakpoint.  */
-    long_resume,
+      /* We hit the step_resume breakpoint.  */
+      step_resume,
 
-    /* We hit the step_resume breakpoint.  */
-    step_resume,
+      /* We hit the through_sigtramp breakpoint.  */
+      through_sig,
 
-    /* We hit the through_sigtramp breakpoint.  */
-    through_sig,
+      /* We hit the shared library event breakpoint.  */
+      shlib_event,
 
-    /* We hit the shared library event breakpoint.  */
-    shlib_event,
+      /* We caught a shared library event.  */
+      catch_shlib_event,
 
-    /* We caught a shared library event.  */
-    catch_shlib_event,
-    /* This is just used to count how many enums there are.  */
-    class_last
+      /* This is just used to count how many enums there are.  */
+      class_last
     };
 
   /* Here is the table which drives this routine.  So that we can
@@ -2426,18 +2436,18 @@ bpstat_what (bs)
      back and decide something of a lower priority is better.  The
      ordering is:
 
-       kc   < clr sgl shl slr sn sr ss ts
-       sgl  < clrs shl shlr slr sn sr ss ts
-       slr  < err shl shlr sn sr ss ts
-       clr  < clrs err shl shlr sn sr ss ts
-       clrs < err shl shlr sn sr ss ts
-       ss   < shl shlr sn sr ts
-       sn   < shl shlr sr ts
-       sr   < shl shlr ts
-       shl  < shlr
-       ts   < 
-       shlr <
-       
+     kc   < clr sgl shl slr sn sr ss ts
+     sgl  < clrs shl shlr slr sn sr ss ts
+     slr  < err shl shlr sn sr ss ts
+     clr  < clrs err shl shlr sn sr ss ts
+     clrs < err shl shlr sn sr ss ts
+     ss   < shl shlr sn sr ts
+     sn   < shl shlr sr ts
+     sr   < shl shlr ts
+     shl  < shlr
+     ts   < 
+     shlr <
+
      What I think this means is that we don't need a damned table
      here.  If you just put the rows and columns in the right order,
      it'd look awfully regular.  We could simply walk the bpstat list
@@ -2453,24 +2463,36 @@ bpstat_what (bs)
      one of those and a step_resume_breakpoint is probably very rare (?).  */
 
   static const enum bpstat_what_main_action
-    table[(int)class_last][(int)BPSTAT_WHAT_LAST] =
-      {
-       /*                              old action */
-        /*       kc    ss    sn    sgl    slr   clr    clrs   sr    ts   shl   shlr
-         */
-/*no_effect*/   {kc,   ss,   sn,   sgl,   slr,  clr,   clrs,  sr,   ts,  shl,  shlr},
-/*wp_silent*/   {ss,   ss,   sn,   ss,    ss,   ss,    ss,    sr,   ts,  shl,  shlr},
-/*wp_noisy*/    {sn,   sn,   sn,   sn,    sn,   sn,    sn,    sr,   ts,  shl,  shlr},
-/*bp_nostop*/   {sgl,  ss,   sn,   sgl,   slr,  clrs,  clrs,  sr,   ts,  shl,  shlr},
-/*bp_silent*/   {ss,   ss,   sn,   ss,    ss,   ss,    ss,    sr,   ts,  shl,  shlr},
-/*bp_noisy*/    {sn,   sn,   sn,   sn,    sn,   sn,    sn,    sr,   ts,  shl,  shlr},
-/*long_jump*/   {slr,  ss,   sn,   slr,   err,  err,   err,   sr,   ts,  shl,  shlr},
-/*long_resume*/ {clr,  ss,   sn,   clrs,  err,  err,   err,   sr,   ts,  shl,  shlr},
-/*step_resume*/ {sr,   sr,   sr,   sr,    sr,   sr,    sr,    sr,   ts,  shl,  shlr},
-/*through_sig*/ {ts,   ts,   ts,   ts,    ts,   ts,    ts,    ts,   ts,  shl,  shlr},
-/*shlib*/       {shl,  shl,  shl,  shl,   shl,  shl,   shl,   shl,  ts,  shl,  shlr},
-/*catch_shlib*/ {shlr, shlr, shlr, shlr,  shlr, shlr,  shlr,  shlr, ts,  shlr, shlr}
-              };
+    table[(int) class_last][(int) BPSTAT_WHAT_LAST] =
+  {
+  /*                              old action */
+  /*       kc    ss    sn    sgl    slr   clr    clrs   sr    ts   shl   shlr
+   */
+/*no_effect */
+    {kc, ss, sn, sgl, slr, clr, clrs, sr, ts, shl, shlr},
+/*wp_silent */
+    {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl, shlr},
+/*wp_noisy */
+    {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl, shlr},
+/*bp_nostop */
+    {sgl, ss, sn, sgl, slr, clrs, clrs, sr, ts, shl, shlr},
+/*bp_silent */
+    {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl, shlr},
+/*bp_noisy */
+    {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl, shlr},
+/*long_jump */
+    {slr, ss, sn, slr, err, err, err, sr, ts, shl, shlr},
+/*long_resume */
+    {clr, ss, sn, clrs, err, err, err, sr, ts, shl, shlr},
+/*step_resume */
+    {sr, sr, sr, sr, sr, sr, sr, sr, ts, shl, shlr},
+/*through_sig */
+    {ts, ts, ts, ts, ts, ts, ts, ts, ts, shl, shlr},
+/*shlib */
+    {shl, shl, shl, shl, shl, shl, shl, shl, ts, shl, shlr},
+/*catch_shlib */
+    {shlr, shlr, shlr, shlr, shlr, shlr, shlr, shlr, ts, shlr, shlr}
+  };
 
 #undef kc
 #undef ss
@@ -2551,46 +2573,46 @@ bpstat_what (bs)
        case bp_watchpoint_scope:
          bs_class = bp_nostop;
          break;
-       case bp_shlib_event:
-         bs_class = shlib_event;
+       case bp_shlib_event:
+         bs_class = shlib_event;
+         break;
+       case bp_catch_load:
+       case bp_catch_unload:
+         /* Only if this catchpoint triggered should we cause the
+            step-out-of-dld behaviour.  Otherwise, we ignore this
+            catchpoint.  */
+         if (bs->stop)
+           bs_class = catch_shlib_event;
+         else
+           bs_class = no_effect;
+         break;
+       case bp_catch_fork:
+       case bp_catch_vfork:
+       case bp_catch_exec:
+         if (bs->stop)
+           {
+             if (bs->print)
+               bs_class = bp_noisy;
+             else
+               bs_class = bp_silent;
+           }
+         else
+           /* There was a catchpoint, but we're not stopping.  This requires
+              no further action.  */
+           bs_class = no_effect;
+         break;
+       case bp_catch_catch:
+         if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_CATCH)
+           bs_class = bp_nostop;
+         else if (bs->stop)
+           bs_class = bs->print ? bp_noisy : bp_silent;
+         break;
+       case bp_catch_throw:
+         if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_THROW)
+           bs_class = bp_nostop;
+         else if (bs->stop)
+           bs_class = bs->print ? bp_noisy : bp_silent;
          break;
-        case bp_catch_load:
-        case bp_catch_unload:
-          /* Only if this catchpoint triggered should we cause the
-             step-out-of-dld behaviour.  Otherwise, we ignore this
-             catchpoint.  */
-          if (bs->stop)
-            bs_class = catch_shlib_event;
-          else
-            bs_class = no_effect;
-          break;
-        case bp_catch_fork:
-        case bp_catch_vfork:
-       case bp_catch_exec:
-          if (bs->stop)
-            {
-              if (bs->print)
-                bs_class = bp_noisy;
-              else
-                bs_class = bp_silent;
-            }
-          else
-            /* There was a catchpoint, but we're not stopping.  This requires
-               no further action.  */
-            bs_class = no_effect;
-          break;
-        case bp_catch_catch:
-          if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_CATCH)
-            bs_class = bp_nostop;
-          else if (bs->stop)
-            bs_class = bs->print ? bp_noisy : bp_silent;
-          break;
-        case bp_catch_throw:
-          if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_THROW)
-            bs_class = bp_nostop;
-          else if (bs->stop)
-            bs_class = bs->print ? bp_noisy : bp_silent;
-          break;
        case bp_call_dummy:
          /* Make sure the action is stop (silent or noisy), so infrun.c
             pops the dummy frame.  */
@@ -2598,7 +2620,7 @@ bpstat_what (bs)
          retval.call_dummy = 1;
          break;
        }
-      current_action = table[(int)bs_class][(int)current_action];
+      current_action = table[(int) bs_class][(int) current_action];
     }
   retval.main_action = current_action;
   return retval;
@@ -2608,13 +2630,13 @@ bpstat_what (bs)
    without hardware support).  This isn't related to a specific bpstat,
    just to things like whether watchpoints are set.  */
 
-int 
+int
 bpstat_should_step ()
 {
   struct breakpoint *b;
   ALL_BREAKPOINTS (b)
     if (b->enable == enabled && b->type == bp_watchpoint)
-      return 1;
+    return 1;
   return 0;
 }
 
@@ -2625,49 +2647,49 @@ bpstat_have_active_hw_watchpoints ()
   struct breakpoint *b;
   ALL_BREAKPOINTS (b)
     if ((b->enable == enabled) &&
-        (b->inserted) &&
-        ((b->type == bp_hardware_watchpoint) ||
-         (b->type == bp_read_watchpoint) ||
-         (b->type == bp_access_watchpoint)))
-      return 1;
+       (b->inserted) &&
+       ((b->type == bp_hardware_watchpoint) ||
+        (b->type == bp_read_watchpoint) ||
+        (b->type == bp_access_watchpoint)))
+    return 1;
   return 0;
 }
-
 \f
+
 /* Given a bpstat that records zero or more triggered eventpoints, this
    function returns another bpstat which contains only the catchpoints
    on that first list, if any. */
 void
 bpstat_get_triggered_catchpoints (ep_list, cp_list)
-  bpstat  ep_list;
-  bpstat *  cp_list;
-{
-  struct bpstats  root_bs[1];
-  bpstat  bs = root_bs;
-  struct breakpoint *  ep;
-  char *  dll_pathname;
+     bpstat ep_list;
+     bpstat *cp_list;
+{
+  struct bpstats root_bs[1];
+  bpstat bs = root_bs;
+  struct breakpoint *ep;
+  char *dll_pathname;
+
   bpstat_clear (cp_list);
   root_bs->next = NULL;
-  for (; ep_list != NULL; ep_list = ep_list->next )
+
+  for (; ep_list != NULL; ep_list = ep_list->next)
     {
       /* Is this eventpoint a catchpoint?  If not, ignore it. */
       ep = ep_list->breakpoint_at;
       if (ep == NULL)
-        break;
-      if ((ep->type != bp_catch_load) && 
-          (ep->type != bp_catch_unload) &&
-          (ep->type != bp_catch_catch) &&
-          (ep->type != bp_catch_throw))   /* pai: (temp) ADD fork/vfork here!!  */
-        continue;
+       break;
+      if ((ep->type != bp_catch_load) &&
+         (ep->type != bp_catch_unload) &&
+         (ep->type != bp_catch_catch) &&
+         (ep->type != bp_catch_throw))         /* pai: (temp) ADD fork/vfork here!!  */
+       continue;
+
       /* Yes; add it to the list. */
       bs = bpstat_alloc (ep, bs);
       *bs = *ep_list;
       bs->next = NULL;
       bs = root_bs->next;
+
 #if defined(SOLIB_ADD)
       /* Also, for each triggered catchpoint, tag it with the name of
          the library that caused this trigger.  (We copy the name now,
@@ -2675,11 +2697,11 @@ bpstat_get_triggered_catchpoints (ep_list, cp_list)
          catchpoint triggers.  Clients who may wish to know the name
          later must get it from the catchpoint itself.) */
       if (ep->triggered_dll_pathname != NULL)
-        free (ep->triggered_dll_pathname);
+       free (ep->triggered_dll_pathname);
       if (ep->type == bp_catch_load)
-        dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
+       dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
       else
-        dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid);
+       dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid);
 #else
       dll_pathname = NULL;
 #endif
@@ -2691,7 +2713,7 @@ bpstat_get_triggered_catchpoints (ep_list, cp_list)
       else
        ep->triggered_dll_pathname = NULL;
     }
+
   *cp_list = bs;
 }
 
@@ -2699,10 +2721,12 @@ bpstat_get_triggered_catchpoints (ep_list, cp_list)
    If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS
    is nonzero, process only watchpoints.  */
 
-typedef struct {
-  enum bptype  type;
-  char *  description;
-} ep_type_description_t;
+typedef struct
+{
+  enum bptype type;
+  char *description;
+}
+ep_type_description_t;
 
 static void
 breakpoint_1 (bnum, allflag)
@@ -2712,36 +2736,37 @@ breakpoint_1 (bnum, allflag)
   register struct breakpoint *b;
   register struct command_line *l;
   register struct symbol *sym;
-  CORE_ADDR last_addr = (CORE_ADDR)-1;
+  CORE_ADDR last_addr = (CORE_ADDR) - 1;
   int found_a_breakpoint = 0;
-  static ep_type_description_t  bptypes[] =
+  static ep_type_description_t bptypes[] =
   {
-    {bp_none,                "?deleted?"},
-    {bp_breakpoint,          "breakpoint"},
+    {bp_none, "?deleted?"},
+    {bp_breakpoint, "breakpoint"},
     {bp_hardware_breakpoint, "hw breakpoint"},
-    {bp_until,               "until"},
-    {bp_finish,              "finish"},
-    {bp_watchpoint,          "watchpoint"},
+    {bp_until, "until"},
+    {bp_finish, "finish"},
+    {bp_watchpoint, "watchpoint"},
     {bp_hardware_watchpoint, "hw watchpoint"},
-    {bp_read_watchpoint,     "read watchpoint"},
-    {bp_access_watchpoint,   "acc watchpoint"},
-    {bp_longjmp,             "longjmp"},
-    {bp_longjmp_resume,      "longjmp resume"},
-    {bp_step_resume,         "step resume"},
-    {bp_through_sigtramp,    "sigtramp"},
-    {bp_watchpoint_scope,    "watchpoint scope"},
-    {bp_call_dummy,          "call dummy"},
-    {bp_shlib_event,         "shlib events"},
-    {bp_catch_load,          "catch load"},
-    {bp_catch_unload,        "catch unload"},
-    {bp_catch_fork,          "catch fork"},
-    {bp_catch_vfork,         "catch vfork"},
-    {bp_catch_exec,          "catch exec"},
-    {bp_catch_catch,         "catch catch"},
-    {bp_catch_throw,         "catch throw"}
-   };
-
-  static char *bpdisps[] = {"del", "dstp", "dis", "keep"};
+    {bp_read_watchpoint, "read watchpoint"},
+    {bp_access_watchpoint, "acc watchpoint"},
+    {bp_longjmp, "longjmp"},
+    {bp_longjmp_resume, "longjmp resume"},
+    {bp_step_resume, "step resume"},
+    {bp_through_sigtramp, "sigtramp"},
+    {bp_watchpoint_scope, "watchpoint scope"},
+    {bp_call_dummy, "call dummy"},
+    {bp_shlib_event, "shlib events"},
+    {bp_catch_load, "catch load"},
+    {bp_catch_unload, "catch unload"},
+    {bp_catch_fork, "catch fork"},
+    {bp_catch_vfork, "catch vfork"},
+    {bp_catch_exec, "catch exec"},
+    {bp_catch_catch, "catch catch"},
+    {bp_catch_throw, "catch throw"}
+  };
+
+  static char *bpdisps[] =
+  {"del", "dstp", "dis", "keep"};
   static char bpenables[] = "nyn";
   char wrap_indent[80];
 
@@ -2749,236 +2774,236 @@ breakpoint_1 (bnum, allflag)
   ALL_BREAKPOINTS (b)
     if (bnum == -1
        || bnum == b->number)
-      {
+    {
 /*  We only print out user settable breakpoints unless the allflag is set. */
-       if (!allflag
-           && b->type != bp_breakpoint
-            && b->type != bp_catch_load
-            && b->type != bp_catch_unload
-            && b->type != bp_catch_fork
-            && b->type != bp_catch_vfork
-            && b->type != bp_catch_exec
-           && b->type != bp_catch_catch
-           && b->type != bp_catch_throw
-           && b->type != bp_hardware_breakpoint
-           && b->type != bp_watchpoint
-           && b->type != bp_read_watchpoint
-           && b->type != bp_access_watchpoint
-           && b->type != bp_hardware_watchpoint)
-         continue;
+      if (!allflag
+         && b->type != bp_breakpoint
+         && b->type != bp_catch_load
+         && b->type != bp_catch_unload
+         && b->type != bp_catch_fork
+         && b->type != bp_catch_vfork
+         && b->type != bp_catch_exec
+         && b->type != bp_catch_catch
+         && b->type != bp_catch_throw
+         && b->type != bp_hardware_breakpoint
+         && b->type != bp_watchpoint
+         && b->type != bp_read_watchpoint
+         && b->type != bp_access_watchpoint
+         && b->type != bp_hardware_watchpoint)
+       continue;
 
-       if (!found_a_breakpoint++)
-         {
-            annotate_breakpoints_headers ();
-  
-            annotate_field (0);
-            printf_filtered ("Num ");
-            annotate_field (1);
-            printf_filtered ("Type           ");
-            annotate_field (2);
-            printf_filtered ("Disp ");
-            annotate_field (3);
-            printf_filtered ("Enb ");
-            if (addressprint)
-              {
-                annotate_field (4);
-                printf_filtered ("Address    ");
-              }
-            annotate_field (5);
-            printf_filtered ("What\n");
-  
-            annotate_breakpoints_table ();
-          }
-  
-        annotate_record ();
-        annotate_field (0);
-        printf_filtered ("%-3d ", b->number);
-        annotate_field (1);
-        if ((int)b->type > (sizeof(bptypes)/sizeof(bptypes[0])))
-          error ("bptypes table does not describe type #%d.", (int)b->type);
-        if ((int)b->type != bptypes[(int)b->type].type)
-          error ("bptypes table does not describe type #%d?", (int)b->type);
-        printf_filtered ("%-14s ", bptypes[(int)b->type].description);
-        annotate_field (2);
-        printf_filtered ("%-4s ", bpdisps[(int)b->disposition]);
-        annotate_field (3);
-       printf_filtered ("%-3c ", bpenables[(int)b->enable]);
-
-       strcpy (wrap_indent, "                           ");
-       if (addressprint)
-         strcat (wrap_indent, "           ");
-       switch (b->type)
-         {
-         case bp_watchpoint:
-         case bp_hardware_watchpoint:
-         case bp_read_watchpoint:
-         case bp_access_watchpoint:
-           /* Field 4, the address, is omitted (which makes the columns
-              not line up too nicely with the headers, but the effect
-              is relatively readable).  */
-           annotate_field (5);
-           print_expression (b->exp, gdb_stdout);
-           break;
-          case bp_catch_load:
-          case bp_catch_unload:
-            /* Field 4, the address, is omitted (which makes the columns
-               not line up too nicely with the headers, but the effect
-               is relatively readable).  */
-            annotate_field (5);
-            if (b->dll_pathname == NULL)
-              printf_filtered ("<any library> ");
-            else
-              printf_filtered ("library \"%s\" ", b->dll_pathname);
-            break;
-
-          case bp_catch_fork:
-          case bp_catch_vfork:
-           /* Field 4, the address, is omitted (which makes the columns
-              not line up too nicely with the headers, but the effect
-              is relatively readable).  */
-           annotate_field (5);
-           if (b->forked_inferior_pid != 0)
-             printf_filtered ("process %d ", b->forked_inferior_pid);
-            break;
-
-          case bp_catch_exec:
-           /* Field 4, the address, is omitted (which makes the columns
-              not line up too nicely with the headers, but the effect
-              is relatively readable).  */
-           annotate_field (5);
-           if (b->exec_pathname != NULL)
-             printf_filtered ("program \"%s\" ", b->exec_pathname);
-            break;
-          case bp_catch_catch:
-           /* Field 4, the address, is omitted (which makes the columns
-              not line up too nicely with the headers, but the effect
-              is relatively readable).  */
-           annotate_field (5);
-            printf_filtered ("exception catch ");
-            break;
-          case bp_catch_throw:
-           /* Field 4, the address, is omitted (which makes the columns
-              not line up too nicely with the headers, but the effect
-              is relatively readable).  */
-           annotate_field (5);
-            printf_filtered ("exception throw ");
-            break;
-
-         case bp_breakpoint:
-         case bp_hardware_breakpoint:
-         case bp_until:
-         case bp_finish:
-         case bp_longjmp:
-         case bp_longjmp_resume:
-         case bp_step_resume:
-         case bp_through_sigtramp:
-         case bp_watchpoint_scope:
-         case bp_call_dummy:
-         case bp_shlib_event:
-           if (addressprint)
-             {
-               annotate_field (4);
-               /* FIXME-32x64: need a print_address_numeric with
-                   field width */
-               printf_filtered
-                 ("%s ",
-                  local_hex_string_custom
-                  ((unsigned long) b->address, "08l"));
-             }
+      if (!found_a_breakpoint++)
+       {
+         annotate_breakpoints_headers ();
+
+         annotate_field (0);
+         printf_filtered ("Num ");
+         annotate_field (1);
+         printf_filtered ("Type           ");
+         annotate_field (2);
+         printf_filtered ("Disp ");
+         annotate_field (3);
+         printf_filtered ("Enb ");
+         if (addressprint)
+           {
+             annotate_field (4);
+             printf_filtered ("Address    ");
+           }
+         annotate_field (5);
+         printf_filtered ("What\n");
 
-           annotate_field (5);
+         annotate_breakpoints_table ();
+       }
 
-           last_addr = b->address;
-           if (b->source_file)
-             {
-               sym = find_pc_sect_function (b->address, b->section);
-               if (sym)
-                 {
-                   fputs_filtered ("in ", gdb_stdout);
-                   fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
-                   wrap_here (wrap_indent);
-                   fputs_filtered (" at ", gdb_stdout);
-                 }
-               fputs_filtered (b->source_file, gdb_stdout);
-               printf_filtered (":%d", b->line_number);
-             }
-           else
-             print_address_symbolic (b->address, gdb_stdout, demangle, " ");
-           break;
-         }
+      annotate_record ();
+      annotate_field (0);
+      printf_filtered ("%-3d ", b->number);
+      annotate_field (1);
+      if ((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0])))
+       error ("bptypes table does not describe type #%d.", (int) b->type);
+      if ((int) b->type != bptypes[(int) b->type].type)
+       error ("bptypes table does not describe type #%d?", (int) b->type);
+      printf_filtered ("%-14s ", bptypes[(int) b->type].description);
+      annotate_field (2);
+      printf_filtered ("%-4s ", bpdisps[(int) b->disposition]);
+      annotate_field (3);
+      printf_filtered ("%-3c ", bpenables[(int) b->enable]);
+
+      strcpy (wrap_indent, "                           ");
+      if (addressprint)
+       strcat (wrap_indent, "           ");
+      switch (b->type)
+       {
+       case bp_watchpoint:
+       case bp_hardware_watchpoint:
+       case bp_read_watchpoint:
+       case bp_access_watchpoint:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         print_expression (b->exp, gdb_stdout);
+         break;
 
-        if (b->thread != -1)
-            printf_filtered (" thread %d", b->thread );
+       case bp_catch_load:
+       case bp_catch_unload:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         if (b->dll_pathname == NULL)
+           printf_filtered ("<any library> ");
+         else
+           printf_filtered ("library \"%s\" ", b->dll_pathname);
+         break;
 
-       printf_filtered ("\n");
+       case bp_catch_fork:
+       case bp_catch_vfork:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         if (b->forked_inferior_pid != 0)
+           printf_filtered ("process %d ", b->forked_inferior_pid);
+         break;
 
-       if (b->frame)
-         {
-            annotate_field (6);
+       case bp_catch_exec:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         if (b->exec_pathname != NULL)
+           printf_filtered ("program \"%s\" ", b->exec_pathname);
+         break;
+       case bp_catch_catch:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         printf_filtered ("exception catch ");
+         break;
+       case bp_catch_throw:
+         /* Field 4, the address, is omitted (which makes the columns
+            not line up too nicely with the headers, but the effect
+            is relatively readable).  */
+         annotate_field (5);
+         printf_filtered ("exception throw ");
+         break;
 
-           printf_filtered ("\tstop only in stack frame at ");
-           print_address_numeric (b->frame, 1, gdb_stdout);
-           printf_filtered ("\n");
-         }
+       case bp_breakpoint:
+       case bp_hardware_breakpoint:
+       case bp_until:
+       case bp_finish:
+       case bp_longjmp:
+       case bp_longjmp_resume:
+       case bp_step_resume:
+       case bp_through_sigtramp:
+       case bp_watchpoint_scope:
+       case bp_call_dummy:
+       case bp_shlib_event:
+         if (addressprint)
+           {
+             annotate_field (4);
+             /* FIXME-32x64: need a print_address_numeric with
+                field width */
+             printf_filtered
+               ("%s ",
+                local_hex_string_custom
+                ((unsigned long) b->address, "08l"));
+           }
 
-       if (b->cond)
-         {
-            annotate_field (7);
+         annotate_field (5);
 
-           printf_filtered ("\tstop only if ");
-           print_expression (b->cond, gdb_stdout);
-           printf_filtered ("\n");
-         }
+         last_addr = b->address;
+         if (b->source_file)
+           {
+             sym = find_pc_sect_function (b->address, b->section);
+             if (sym)
+               {
+                 fputs_filtered ("in ", gdb_stdout);
+                 fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
+                 wrap_here (wrap_indent);
+                 fputs_filtered (" at ", gdb_stdout);
+               }
+             fputs_filtered (b->source_file, gdb_stdout);
+             printf_filtered (":%d", b->line_number);
+           }
+         else
+           print_address_symbolic (b->address, gdb_stdout, demangle, " ");
+         break;
+       }
 
-       if (b->thread != -1)
-         {
-           /* FIXME should make an annotation for this */
-           printf_filtered ("\tstop only in thread %d\n", b->thread);
-         }
+      if (b->thread != -1)
+       printf_filtered (" thread %d", b->thread);
 
-        if (show_breakpoint_hit_counts && b->hit_count)
-         {
-           /* FIXME should make an annotation for this */
-            if (ep_is_catchpoint (b))
-              printf_filtered ("\tcatchpoint");
-            else
-              printf_filtered ("\tbreakpoint");
-            printf_filtered (" already hit %d time%s\n",
-                             b->hit_count, (b->hit_count == 1 ? "" : "s"));
-         }
+      printf_filtered ("\n");
 
-       if (b->ignore_count)
-         {
-            annotate_field (8);
+      if (b->frame)
+       {
+         annotate_field (6);
 
-           printf_filtered ("\tignore next %d hits\n", b->ignore_count);
-         }
+         printf_filtered ("\tstop only in stack frame at ");
+         print_address_numeric (b->frame, 1, gdb_stdout);
+         printf_filtered ("\n");
+       }
 
-       if ((l = b->commands))
-         {
-            annotate_field (9);
+      if (b->cond)
+       {
+         annotate_field (7);
 
-           while (l)
-             {
-               print_command_line (l, 4, gdb_stdout);
-               l = l->next;
-             }
-         }
-      }
+         printf_filtered ("\tstop only if ");
+         print_expression (b->cond, gdb_stdout);
+         printf_filtered ("\n");
+       }
+
+      if (b->thread != -1)
+       {
+         /* FIXME should make an annotation for this */
+         printf_filtered ("\tstop only in thread %d\n", b->thread);
+       }
+
+      if (show_breakpoint_hit_counts && b->hit_count)
+       {
+         /* FIXME should make an annotation for this */
+         if (ep_is_catchpoint (b))
+           printf_filtered ("\tcatchpoint");
+         else
+           printf_filtered ("\tbreakpoint");
+         printf_filtered (" already hit %d time%s\n",
+                          b->hit_count, (b->hit_count == 1 ? "" : "s"));
+       }
+
+      if (b->ignore_count)
+       {
+         annotate_field (8);
+
+         printf_filtered ("\tignore next %d hits\n", b->ignore_count);
+       }
+
+      if ((l = b->commands))
+       {
+         annotate_field (9);
+
+         while (l)
+           {
+             print_command_line (l, 4, gdb_stdout);
+             l = l->next;
+           }
+       }
+    }
 
   if (!found_a_breakpoint)
     {
       if (bnum == -1)
-        printf_filtered ("No breakpoints or watchpoints.\n");
+       printf_filtered ("No breakpoints or watchpoints.\n");
       else
-        printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
+       printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
     }
   else
     /* Compare against (CORE_ADDR)-1 in case some compiler decides
        that a comparison of an unsigned with -1 is always false.  */
-    if (last_addr != (CORE_ADDR)-1)
-      set_next_address (last_addr);
+  if (last_addr != (CORE_ADDR) - 1)
+    set_next_address (last_addr);
 
   annotate_breakpoints_table_end ();
 }
@@ -3023,25 +3048,25 @@ describe_other_breakpoints (pc, section)
 
   ALL_BREAKPOINTS (b)
     if (b->address == pc)
-      if (overlay_debugging == 0 ||
-         b->section == section)
-       others++;
+    if (overlay_debugging == 0 ||
+       b->section == section)
+      others++;
   if (others > 0)
     {
       printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
       ALL_BREAKPOINTS (b)
        if (b->address == pc)
-         if (overlay_debugging == 0 ||
-             b->section == section)
-           {
-             others--;
-             printf_filtered
-               ("%d%s%s ",
-                b->number,
-                ((b->enable == disabled || b->enable == shlib_disabled || b->enable == call_disabled)
-                 ? " (disabled)" : ""),
-                (others > 1) ? "," : ((others == 1) ? " and" : ""));
-           }
+       if (overlay_debugging == 0 ||
+           b->section == section)
+         {
+           others--;
+           printf_filtered
+             ("%d%s%s ",
+              b->number,
+              ((b->enable == disabled || b->enable == shlib_disabled || b->enable == call_disabled)
+               ? " (disabled)" : ""),
+              (others > 1) ? "," : ((others == 1) ? " and" : ""));
+         }
       printf_filtered ("also set at pc ");
       print_address_numeric (pc, 1, gdb_stdout);
       printf_filtered (".\n");
@@ -3085,10 +3110,10 @@ check_duplicates (address, section)
        && b->enable != call_disabled
        && b->address == address
        && (overlay_debugging == 0 || b->section == section))
-      {
-       count++;
-       b->duplicate = count > 1;
-      }
+    {
+      count++;
+      b->duplicate = count > 1;
+    }
 }
 
 /* Low level routine to set a breakpoint.
@@ -3160,12 +3185,12 @@ create_longjmp_breakpoint (func_name)
   struct symtab_and_line sal;
   struct breakpoint *b;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
+  INIT_SAL (&sal);             /* initialize to zeroes */
   if (func_name != NULL)
     {
       struct minimal_symbol *m;
 
-      m = lookup_minimal_symbol_text (func_name, NULL, (struct objfile *)NULL);
+      m = lookup_minimal_symbol_text (func_name, NULL, (struct objfile *) NULL);
       if (m)
        sal.pc = SYMBOL_VALUE_ADDRESS (m);
       else
@@ -3173,48 +3198,49 @@ create_longjmp_breakpoint (func_name)
     }
   sal.section = find_pc_overlay (sal.pc);
   b = set_raw_breakpoint (sal);
-  if (!b) return;
+  if (!b)
+    return;
 
   b->type = func_name != NULL ? bp_longjmp : bp_longjmp_resume;
   b->disposition = donttouch;
   b->enable = disabled;
   b->silent = 1;
   if (func_name)
-    b->addr_string = strsave(func_name);
+    b->addr_string = strsave (func_name);
   b->number = internal_breakpoint_number--;
 }
 
-#endif /* #ifdef GET_LONGJMP_TARGET */
+#endif /* #ifdef GET_LONGJMP_TARGET */
 
 /* Call this routine when stepping and nexting to enable a breakpoint if we do
    a longjmp().  When we hit that breakpoint, call
    set_longjmp_resume_breakpoint() to figure out where we are going. */
 
 void
-enable_longjmp_breakpoint()
+enable_longjmp_breakpoint ()
 {
   register struct breakpoint *b;
 
   ALL_BREAKPOINTS (b)
     if (b->type == bp_longjmp)
-      {
-       b->enable = enabled;
-       check_duplicates (b->address, b->section);
-      }
+    {
+      b->enable = enabled;
+      check_duplicates (b->address, b->section);
+    }
 }
 
 void
-disable_longjmp_breakpoint()
+disable_longjmp_breakpoint ()
 {
   register struct breakpoint *b;
 
   ALL_BREAKPOINTS (b)
-    if (   b->type == bp_longjmp
+    if (b->type == bp_longjmp
        || b->type == bp_longjmp_resume)
-      {
-       b->enable = disabled;
-       check_duplicates (b->address, b->section);
-      }
+    {
+      b->enable = disabled;
+      check_duplicates (b->address, b->section);
+    }
 }
 
 #ifdef SOLIB_ADD
@@ -3225,7 +3251,7 @@ remove_solib_event_breakpoints ()
 
   ALL_BREAKPOINTS_SAFE (b, temp)
     if (b->type == bp_shlib_event)
-      delete_breakpoint (b);
+    delete_breakpoint (b);
 }
 
 void
@@ -3235,7 +3261,7 @@ create_solib_event_breakpoint (address)
   struct breakpoint *b;
   struct symtab_and_line sal;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
+  INIT_SAL (&sal);             /* initialize to zeroes */
   sal.pc = address;
   sal.section = find_pc_overlay (sal.pc);
   b = set_raw_breakpoint (sal);
@@ -3248,34 +3274,34 @@ void
 disable_breakpoints_in_shlibs (silent)
      int silent;
 {
-  struct breakpoint *  b;
-  int  disabled_shlib_breaks = 0;
+  struct breakpoint *b;
+  int disabled_shlib_breaks = 0;
 
   /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
   ALL_BREAKPOINTS (b)
-    {
+  {
 #if defined (PC_SOLIB)
-      if (((b->type == bp_breakpoint) ||
-           (b->type == bp_hardware_breakpoint)) &&
-          (b->enable != shlib_disabled) &&
-          (b->enable != call_disabled) &&
-          ! b->duplicate &&
-          PC_SOLIB (b->address))
-        {
-          b->enable = shlib_disabled;
-         if (!silent)
-           {
-             if (!disabled_shlib_breaks)
-               {
-                 target_terminal_ours_for_output ();
-                 printf_filtered ("Temporarily disabling shared library breakpoints:\n");
-               }
-             disabled_shlib_breaks = 1;
-             printf_filtered ("%d ", b->number);
-           }
-        }
+    if (((b->type == bp_breakpoint) ||
+        (b->type == bp_hardware_breakpoint)) &&
+       (b->enable != shlib_disabled) &&
+       (b->enable != call_disabled) &&
+       !b->duplicate &&
+       PC_SOLIB (b->address))
+      {
+       b->enable = shlib_disabled;
+       if (!silent)
+         {
+           if (!disabled_shlib_breaks)
+             {
+               target_terminal_ours_for_output ();
+               printf_filtered ("Temporarily disabling shared library breakpoints:\n");
+             }
+           disabled_shlib_breaks = 1;
+           printf_filtered ("%d ", b->number);
+         }
+      }
 #endif
-    }
+  }
   if (disabled_shlib_breaks && !silent)
     printf_filtered ("\n");
 }
@@ -3288,14 +3314,14 @@ re_enable_breakpoints_in_shlibs ()
 
   ALL_BREAKPOINTS (b)
     if (b->enable == shlib_disabled)
-      {
-       char buf[1];
+    {
+      char buf[1];
 
-       /* Do not reenable the breakpoint if the shared library
-          is still not mapped in.  */
-       if (target_read_memory (b->address, buf, 1) == 0)
-         b->enable = enabled;
-      }
+      /* Do not reenable the breakpoint if the shared library
+         is still not mapped in.  */
+      if (target_read_memory (b->address, buf, 1) == 0)
+       b->enable = enabled;
+    }
 }
 
 #endif
@@ -3308,21 +3334,21 @@ create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, con
      char *cond_string;
      enum bptype bp_kind;
 {
-  struct breakpoint *  b;
+  struct breakpoint *b;
   struct symtabs_and_lines sals;
-  struct symtab_and_line  sal;
-  struct cleanup *  old_chain;
-  struct cleanup *  canonical_strings_chain = NULL;
-  int  i;
-  char *  addr_start = hookname;
-  char *  addr_end = NULL;
-  char **  canonical = (char **) NULL;
-  int  thread = -1;  /* All threads. */
+  struct symtab_and_line sal;
+  struct cleanup *old_chain;
+  struct cleanup *canonical_strings_chain = NULL;
+  int i;
+  char *addr_start = hookname;
+  char *addr_end = NULL;
+  char **canonical = (char **) NULL;
+  int thread = -1;             /* All threads. */
+
   /* Set a breakpoint on the specified hook. */
   sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical);
   addr_end = hookname;
+
   if (sals.nelts == 0)
     {
       warning ("Unable to set a breakpoint on dynamic linker callback.");
@@ -3340,35 +3366,35 @@ create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, con
   /* Make sure that all storage allocated in decode_line_1 gets freed in case
      the following errors out.  */
   old_chain = make_cleanup (free, sals.sals);
-  if (canonical != (char **)NULL)
+  if (canonical != (char **) NULL)
     {
       make_cleanup (free, canonical);
       canonical_strings_chain = make_cleanup (null_cleanup, 0);
       if (canonical[0] != NULL)
-        make_cleanup (free, canonical[0]);
+       make_cleanup (free, canonical[0]);
     }
+
   resolve_sal_pc (&sals.sals[0]);
+
   /* Remove the canonical strings from the cleanup, they are needed below.  */
-  if (canonical != (char **)NULL)
+  if (canonical != (char **) NULL)
     discard_cleanups (canonical_strings_chain);
+
   b = set_raw_breakpoint (sals.sals[0]);
   set_breakpoint_count (breakpoint_count + 1);
   b->number = breakpoint_count;
   b->cond = NULL;
   b->cond_string = (cond_string == NULL) ? NULL : savestring (cond_string, strlen (cond_string));
   b->thread = thread;
-  if (canonical != (char **)NULL && canonical[0] != NULL)
+
+  if (canonical != (char **) NULL && canonical[0] != NULL)
     b->addr_string = canonical[0];
   else if (addr_start)
     b->addr_string = savestring (addr_start, addr_end - addr_start);
+
   b->enable = enabled;
   b->disposition = tempflag ? del : donttouch;
+
   if (dll_pathname == NULL)
     b->dll_pathname = NULL;
   else
@@ -3377,37 +3403,37 @@ create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, con
       strcpy (b->dll_pathname, dll_pathname);
     }
   b->type = bp_kind;
+
   mention (b);
   do_cleanups (old_chain);
 }
 
 void
 create_solib_load_event_breakpoint (hookname, tempflag, dll_pathname, cond_string)
-  char *  hookname;
-  int  tempflag;
-  char *  dll_pathname;
-  char *  cond_string;
+     char *hookname;
+     int tempflag;
+     char *dll_pathname;
+     char *cond_string;
 {
   create_solib_load_unload_event_breakpoint (hookname,
-                                             tempflag,
-                                             dll_pathname,
-                                             cond_string,
-                                             bp_catch_load);
+                                            tempflag,
+                                            dll_pathname,
+                                            cond_string,
+                                            bp_catch_load);
 }
 
 void
 create_solib_unload_event_breakpoint (hookname, tempflag, dll_pathname, cond_string)
-  char *  hookname;
-  int  tempflag;
-  char *  dll_pathname;
-  char *  cond_string;
+     char *hookname;
+     int tempflag;
+     char *dll_pathname;
+     char *cond_string;
 {
   create_solib_load_unload_event_breakpoint (hookname,
-                                             tempflag,
-                                             dll_pathname,
-                                             cond_string,
-                                             bp_catch_unload);
+                                            tempflag,
+                                            dll_pathname,
+                                            cond_string,
+                                            bp_catch_unload);
 }
 
 static void
@@ -3416,15 +3442,15 @@ create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_kind)
      char *cond_string;
      enum bptype bp_kind;
 {
-  struct symtab_and_line  sal;
-  struct breakpoint *  b;
-  int  thread = -1;  /* All threads. */
-  INIT_SAL(&sal);
+  struct symtab_and_line sal;
+  struct breakpoint *b;
+  int thread = -1;             /* All threads. */
+
+  INIT_SAL (&sal);
   sal.pc = 0;
   sal.symtab = NULL;
   sal.line = 0;
+
   b = set_raw_breakpoint (sal);
   set_breakpoint_count (breakpoint_count + 1);
   b->number = breakpoint_count;
@@ -3435,38 +3461,38 @@ create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_kind)
   b->enable = enabled;
   b->disposition = tempflag ? del : donttouch;
   b->forked_inferior_pid = 0;
+
   b->type = bp_kind;
+
   mention (b);
 }
 
 void
 create_fork_event_catchpoint (tempflag, cond_string)
-  int  tempflag;
-  char *  cond_string;
+     int tempflag;
+     char *cond_string;
 {
   create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_fork);
 }
+
 void
 create_vfork_event_catchpoint (tempflag, cond_string)
-  int  tempflag;
-  char *  cond_string;
+     int tempflag;
+     char *cond_string;
 {
   create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_vfork);
 }
 
 void
 create_exec_event_catchpoint (tempflag, cond_string)
-  int  tempflag;
-  char *  cond_string;
+     int tempflag;
+     char *cond_string;
 {
-  struct symtab_and_line  sal;
-  struct breakpoint *  b;
-  int  thread = -1;  /* All threads. */
+  struct symtab_and_line sal;
+  struct breakpoint *b;
+  int thread = -1;             /* All threads. */
 
-  INIT_SAL(&sal);
+  INIT_SAL (&sal);
   sal.pc = 0;
   sal.symtab = NULL;
   sal.line = 0;
@@ -3487,41 +3513,42 @@ create_exec_event_catchpoint (tempflag, cond_string)
 }
 
 static int
-hw_breakpoint_used_count()
+hw_breakpoint_used_count ()
 {
   register struct breakpoint *b;
   int i = 0;
 
   ALL_BREAKPOINTS (b)
-    {
-      if (b->type == bp_hardware_breakpoint && b->enable == enabled)
-       i++;
-    }
+  {
+    if (b->type == bp_hardware_breakpoint && b->enable == enabled)
+      i++;
+  }
 
   return i;
 }
 
 static int
-hw_watchpoint_used_count(type, other_type_used)
-    enum bptype type;
-    int *other_type_used;
+hw_watchpoint_used_count (type, other_type_used)
+     enum bptype type;
+     int *other_type_used;
 {
   register struct breakpoint *b;
   int i = 0;
 
   *other_type_used = 0;
   ALL_BREAKPOINTS (b)
-    {
-      if (b->enable == enabled)
-       {
-          if (b->type == type) i++;
-          else if ((b->type == bp_hardware_watchpoint ||
-              b->type == bp_read_watchpoint ||
-              b->type == bp_access_watchpoint)
-              && b->enable == enabled)
-           *other_type_used = 1;
-        }
-    }
+  {
+    if (b->enable == enabled)
+      {
+       if (b->type == type)
+         i++;
+       else if ((b->type == bp_hardware_watchpoint ||
+                 b->type == bp_read_watchpoint ||
+                 b->type == bp_access_watchpoint)
+                && b->enable == enabled)
+         *other_type_used = 1;
+      }
+  }
   return i;
 }
 
@@ -3532,7 +3559,7 @@ hw_watchpoint_used_count(type, other_type_used)
    deleted automatically... */
 
 void
-set_longjmp_resume_breakpoint(pc, frame)
+set_longjmp_resume_breakpoint (pc, frame)
      CORE_ADDR pc;
      struct frame_info *frame;
 {
@@ -3540,56 +3567,56 @@ set_longjmp_resume_breakpoint(pc, frame)
 
   ALL_BREAKPOINTS (b)
     if (b->type == bp_longjmp_resume)
-      {
-       b->address = pc;
-       b->enable = enabled;
-       if (frame != NULL)
-         b->frame = frame->frame;
-       else
-         b->frame = 0;
-       check_duplicates (b->address, b->section);
-       return;
-      }
+    {
+      b->address = pc;
+      b->enable = enabled;
+      if (frame != NULL)
+       b->frame = frame->frame;
+      else
+       b->frame = 0;
+      check_duplicates (b->address, b->section);
+      return;
+    }
 }
 
 void
 disable_watchpoints_before_interactive_call_start ()
 {
-  struct breakpoint *  b;
+  struct breakpoint *b;
 
   ALL_BREAKPOINTS (b)
-    {
-      if (((b->type == bp_watchpoint)
-           || (b->type == bp_hardware_watchpoint)
-           || (b->type == bp_read_watchpoint)
-           || (b->type == bp_access_watchpoint)
-           || ep_is_exception_catchpoint (b))
-          && (b->enable == enabled))
-        {
-          b->enable = call_disabled;
-          check_duplicates (b->address, b->section);
-        }
-    }
+  {
+    if (((b->type == bp_watchpoint)
+        || (b->type == bp_hardware_watchpoint)
+        || (b->type == bp_read_watchpoint)
+        || (b->type == bp_access_watchpoint)
+        || ep_is_exception_catchpoint (b))
+       && (b->enable == enabled))
+      {
+       b->enable = call_disabled;
+       check_duplicates (b->address, b->section);
+      }
+  }
 }
 
 void
 enable_watchpoints_after_interactive_call_stop ()
 {
-  struct breakpoint *  b;
+  struct breakpoint *b;
 
   ALL_BREAKPOINTS (b)
-    {
-      if (((b->type == bp_watchpoint)
-           || (b->type == bp_hardware_watchpoint)
-           || (b->type == bp_read_watchpoint)
-           || (b->type == bp_access_watchpoint)
-           || ep_is_exception_catchpoint (b))
-          && (b->enable == call_disabled))
-        {
-          b->enable = enabled;
-          check_duplicates (b->address, b->section);
-        }
-    }
+  {
+    if (((b->type == bp_watchpoint)
+        || (b->type == bp_hardware_watchpoint)
+        || (b->type == bp_read_watchpoint)
+        || (b->type == bp_access_watchpoint)
+        || ep_is_exception_catchpoint (b))
+       && (b->enable == call_disabled))
+      {
+       b->enable = enabled;
+       check_duplicates (b->address, b->section);
+      }
+  }
 }
 
 
@@ -3618,8 +3645,8 @@ set_momentary_breakpoint (sal, frame, type)
 
   return b;
 }
-
 \f
+
 /* Tell the user we have just set a breakpoint B.  */
 
 static void
@@ -3654,7 +3681,7 @@ mention (b)
       print_expression (b->exp, gdb_stdout);
       break;
     case bp_access_watchpoint:
-      printf_filtered ("Hardware access (read/write) watchpoint %d: ",b->number);
+      printf_filtered ("Hardware access (read/write) watchpoint %d: ", b->number);
       print_expression (b->exp, gdb_stdout);
       break;
     case bp_breakpoint:
@@ -3668,25 +3695,25 @@ mention (b)
     case bp_catch_load:
     case bp_catch_unload:
       printf_filtered ("Catchpoint %d (%s %s)",
-                       b->number,
-                       (b->type == bp_catch_load) ? "load" : "unload",
-                       (b->dll_pathname != NULL) ? b->dll_pathname : "<any library>");
+                      b->number,
+                      (b->type == bp_catch_load) ? "load" : "unload",
+            (b->dll_pathname != NULL) ? b->dll_pathname : "<any library>");
       break;
     case bp_catch_fork:
     case bp_catch_vfork:
       printf_filtered ("Catchpoint %d (%s)",
-                       b->number,
-                       (b->type == bp_catch_fork) ? "fork" : "vfork");
+                      b->number,
+                      (b->type == bp_catch_fork) ? "fork" : "vfork");
       break;
     case bp_catch_exec:
       printf_filtered ("Catchpoint %d (exec)",
-                       b->number);
+                      b->number);
       break;
     case bp_catch_catch:
     case bp_catch_throw:
       printf_filtered ("Catchpoint %d (%s)",
-                       b->number,
-                       (b->type == bp_catch_catch) ? "catch" : "throw");
+                      b->number,
+                      (b->type == bp_catch_catch) ? "catch" : "throw");
       break;
 
     case bp_until:
@@ -3710,16 +3737,16 @@ mention (b)
       if (b->source_file)
        printf_filtered (": file %s, line %d.",
                         b->source_file, b->line_number);
-      TUIDO(((TuiOpaqueFuncPtr)tui_vAllSetHasBreakAt, b, 1));
-      TUIDO(((TuiOpaqueFuncPtr)tuiUpdateAllExecInfos));
+      TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, b, 1));
+      TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
     }
   printf_filtered ("\n");
 }
-
 \f
+
 /* Set a breakpoint according to ARG (function, linenum or *address)
    flag: first bit  : 0 non-temporary, 1 temporary.
-        second bit : 0 normal breakpoint, 1 hardware breakpoint. */
+   second bit : 0 normal breakpoint, 1 hardware breakpoint. */
 
 static void
 break_command_1 (arg, flag, from_tty)
@@ -3741,7 +3768,7 @@ break_command_1 (arg, flag, from_tty)
   char *addr_end = NULL;
   struct cleanup *old_chain;
   struct cleanup *canonical_strings_chain = NULL;
-  char **canonical = (char **)NULL;
+  char **canonical = (char **) NULL;
   int i;
   int thread;
 
@@ -3751,21 +3778,21 @@ break_command_1 (arg, flag, from_tty)
   sals.sals = NULL;
   sals.nelts = 0;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
+  INIT_SAL (&sal);             /* initialize to zeroes */
 
   /* If no arg given, or if first arg is 'if ', use the default breakpoint. */
 
-  if (!arg || (arg[0] == 'i' && arg[1] == 'f' 
+  if (!arg || (arg[0] == 'i' && arg[1] == 'f'
               && (arg[2] == ' ' || arg[2] == '\t')))
     {
       if (default_breakpoint_valid)
        {
-         sals.sals = (struct symtab_and_line *) 
+         sals.sals = (struct symtab_and_line *)
            xmalloc (sizeof (struct symtab_and_line));
          sal.pc = default_breakpoint_address;
          sal.line = default_breakpoint_line;
          sal.symtab = default_breakpoint_symtab;
-         sal.section  = find_pc_overlay (sal.pc);
+         sal.section = find_pc_overlay (sal.pc);
          sals.sals[0] = sal;
          sals.nelts = 1;
        }
@@ -3777,27 +3804,27 @@ break_command_1 (arg, flag, from_tty)
       addr_start = arg;
 
       /* Force almost all breakpoints to be in terms of the
-        current_source_symtab (which is decode_line_1's default).  This
-        should produce the results we want almost all of the time while
-        leaving default_breakpoint_* alone.  */
+         current_source_symtab (which is decode_line_1's default).  This
+         should produce the results we want almost all of the time while
+         leaving default_breakpoint_* alone.  */
       if (default_breakpoint_valid
          && (!current_source_symtab
              || (arg && (*arg == '+' || *arg == '-'))))
        sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
                              default_breakpoint_line, &canonical);
       else
-       sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0, &canonical);
+       sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical);
 
       addr_end = arg;
     }
-  
-  if (! sals.nelts) 
+
+  if (!sals.nelts)
     return;
 
   /* Make sure that all storage allocated in decode_line_1 gets freed in case
      the following `for' loop errors out.  */
   old_chain = make_cleanup (free, sals.sals);
-  if (canonical != (char **)NULL)
+  if (canonical != (char **) NULL)
     {
       make_cleanup (free, canonical);
       canonical_strings_chain = make_cleanup (null_cleanup, 0);
@@ -3832,11 +3859,11 @@ break_command_1 (arg, flag, from_tty)
 
          Give the target a chance to bless sals.sals[i].pc before we
          try to make a breakpoint for it. */
-      if (PC_REQUIRES_RUN_BEFORE_USE(sals.sals[i].pc))
-        {
-          error ("Cannot break on %s without a running program.", addr_start);
-        }
-      
+      if (PC_REQUIRES_RUN_BEFORE_USE (sals.sals[i].pc))
+       {
+         error ("Cannot break on %s without a running program.", addr_start);
+       }
+
       tok = arg;
 
       while (tok && *tok)
@@ -3877,17 +3904,17 @@ break_command_1 (arg, flag, from_tty)
     {
       int i, target_resources_ok;
 
-      i = hw_breakpoint_used_count ();  
+      i = hw_breakpoint_used_count ();
       target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
-               bp_hardware_breakpoint, i + sals.nelts, 0);
+                                bp_hardware_breakpoint, i + sals.nelts, 0);
       if (target_resources_ok == 0)
        error ("No hardware breakpoint support in the target.");
       else if (target_resources_ok < 0)
-        error ("Hardware breakpoints used exceeds limit.");
+       error ("Hardware breakpoints used exceeds limit.");
     }
 
   /* Remove the canonical strings from the cleanup, they are needed below.  */
-  if (canonical != (char **)NULL)
+  if (canonical != (char **) NULL)
     discard_cleanups (canonical_strings_chain);
 
   /* Now set all the breakpoints.  */
@@ -3906,14 +3933,14 @@ break_command_1 (arg, flag, from_tty)
       b->thread = thread;
 
       /* If a canonical line spec is needed use that instead of the
-        command string.  */
-      if (canonical != (char **)NULL && canonical[i] != NULL)
+         command string.  */
+      if (canonical != (char **) NULL && canonical[i] != NULL)
        b->addr_string = canonical[i];
       else if (addr_start)
        b->addr_string = savestring (addr_start, addr_end - addr_start);
       if (cond_start)
        b->cond_string = savestring (cond_start, cond_end - cond_start);
-                                    
+
       b->enable = enabled;
       b->disposition = tempflag ? del : donttouch;
       mention (b);
@@ -3982,12 +4009,12 @@ break_at_finish_at_depth_command_1 (arg, flag, from_tty)
   if (if_arg)
     {
       extra_args = arg;
-      extra_args_len = strlen (arg); 
+      extra_args_len = strlen (arg);
     }
 
   if (selected_pc)
     {
-      if (find_pc_partial_function(selected_pc, (char **)NULL, &low, &high))
+      if (find_pc_partial_function (selected_pc, (char **) NULL, &low, &high))
        {
          addr_string = (char *) xmalloc (26 + extra_args_len);
          if (extra_args_len)
@@ -4047,33 +4074,32 @@ break_at_finish_command_1 (arg, flag, from_tty)
   if (if_arg)
     {
       extra_args = arg;
-      extra_args_len = strlen (arg); 
+      extra_args_len = strlen (arg);
+    }
+  else if (arg)
+    {
+      /* get the stuff after the function name or address */
+      extra_args = strchr (arg, ' ');
+      if (extra_args)
+       {
+         extra_args++;
+         extra_args_len = strlen (extra_args);
+       }
     }
-  else
-    if (arg)
-      {
-       /* get the stuff after the function name or address */
-       extra_args = strchr (arg, ' ');
-        if (extra_args)
-         {
-           extra_args++;
-           extra_args_len = strlen (extra_args);
-          }
-      }
 
   sals.sals = NULL;
   sals.nelts = 0;
 
-  beg_addr_string = addr_string;  
-  sals = decode_line_1 (&addr_string, 1, (struct symtab *)NULL, 0, 
-                       (char ***)NULL);
+  beg_addr_string = addr_string;
+  sals = decode_line_1 (&addr_string, 1, (struct symtab *) NULL, 0,
+                       (char ***) NULL);
 
   free (beg_addr_string);
   old_chain = make_cleanup (free, sals.sals);
   for (i = 0; (i < sals.nelts); i++)
     {
       sal = sals.sals[i];
-      if (find_pc_partial_function (sal.pc, (char **)NULL, &low, &high))
+      if (find_pc_partial_function (sal.pc, (char **) NULL, &low, &high))
        {
          break_string = (char *) xmalloc (extra_args_len + 26);
          if (extra_args_len)
@@ -4081,7 +4107,7 @@ break_at_finish_command_1 (arg, flag, from_tty)
          else
            sprintf (break_string, "*0x%x", high);
          break_command_1 (break_string, flag, from_tty);
-         free(break_string);
+         free (break_string);
        }
       else
        error ("No function contains the specified address");
@@ -4091,7 +4117,7 @@ break_at_finish_command_1 (arg, flag, from_tty)
       printf_filtered ("Multiple breakpoints were set.\n");
       printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
     }
-  do_cleanups(old_chain);
+  do_cleanups (old_chain);
 }
 
 
@@ -4114,14 +4140,14 @@ resolve_sal_pc (sal)
   if (sal->section == 0 && sal->symtab != NULL)
     {
       struct blockvector *bv;
-      struct block       *b;
-      struct symbol      *sym;
-      int                 index;
+      struct block *b;
+      struct symbol *sym;
+      int index;
 
-      bv  = blockvector_for_pc_sect (sal->pc, 0, &index, sal->symtab);
+      bv = blockvector_for_pc_sect (sal->pc, 0, &index, sal->symtab);
       if (bv != NULL)
        {
-         b   = BLOCKVECTOR_BLOCK (bv, index);
+         b = BLOCKVECTOR_BLOCK (bv, index);
          sym = block_function (b);
          if (sym != NULL)
            {
@@ -4131,11 +4157,11 @@ resolve_sal_pc (sal)
          else
            {
              /* It really is worthwhile to have the section, so we'll just
-                have to look harder. This case can be executed if we have 
-                line numbers but no functions (as can happen in assembly 
-                source).  */
+                have to look harder. This case can be executed if we have 
+                line numbers but no functions (as can happen in assembly 
+                source).  */
 
-             struct minimal_symbol *msym; 
+             struct minimal_symbol *msym;
 
              msym = lookup_minimal_symbol_by_pc (sal->pc);
              if (msym)
@@ -4218,7 +4244,7 @@ stopin_command (arg, from_tty)
 {
   int badInput = 0;
 
-  if (arg == (char *)NULL)
+  if (arg == (char *) NULL)
     badInput = 1;
   else if (*arg != '*')
     {
@@ -4226,22 +4252,22 @@ stopin_command (arg, from_tty)
       int hasColon = 0;
 
       /* look for a ':'.  If this is a line number specification, then say
-        it is bad, otherwise, it should be an address or function/method
-        name */
+         it is bad, otherwise, it should be an address or function/method
+         name */
       while (*argptr && !hasColon)
-        {
-          hasColon = (*argptr == ':');
-          argptr++;
-        }
+       {
+         hasColon = (*argptr == ':');
+         argptr++;
+       }
 
       if (hasColon)
-        badInput = (*argptr != ':'); /* Not a class::method */
+       badInput = (*argptr != ':');    /* Not a class::method */
       else
-        badInput = isdigit(*arg); /* a simple line number */
+       badInput = isdigit (*arg);      /* a simple line number */
     }
 
   if (badInput)
-    printf_filtered("Usage: stop in <function | address>\n");
+    printf_filtered ("Usage: stop in <function | address>\n");
   else
     break_command_1 (arg, 0, from_tty);
 }
@@ -4253,7 +4279,7 @@ stopat_command (arg, from_tty)
 {
   int badInput = 0;
 
-  if (arg == (char *)NULL || *arg == '*') /* no line number */
+  if (arg == (char *) NULL || *arg == '*')     /* no line number */
     badInput = 1;
   else
     {
@@ -4261,21 +4287,21 @@ stopat_command (arg, from_tty)
       int hasColon = 0;
 
       /* look for a ':'.  If there is a '::' then get out, otherwise
-        it is probably a line number. */
+         it is probably a line number. */
       while (*argptr && !hasColon)
-        {
-          hasColon = (*argptr == ':');
-          argptr++;
-        }
+       {
+         hasColon = (*argptr == ':');
+         argptr++;
+       }
 
       if (hasColon)
-        badInput = (*argptr == ':'); /* we have class::method */
+       badInput = (*argptr == ':');    /* we have class::method */
       else
-        badInput = !isdigit(*arg); /* not a line number */
+       badInput = !isdigit (*arg);     /* not a line number */
     }
 
   if (badInput)
-    printf_filtered("Usage: stop at <line>\n");
+    printf_filtered ("Usage: stop at <line>\n");
   else
     break_command_1 (arg, 0, from_tty);
 }
@@ -4306,8 +4332,8 @@ watch_command_1 (arg, accessflag, from_tty)
   enum bptype bp_type;
   int mem_cnt = 0;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
-  
+  INIT_SAL (&sal);             /* initialize to zeroes */
+
   /* Parse arguments.  */
   innermost_block = NULL;
   exp_start = arg;
@@ -4336,27 +4362,31 @@ watch_command_1 (arg, accessflag, from_tty)
       cond_end = tok;
     }
   if (*tok)
-    error("Junk at end of command.");
+    error ("Junk at end of command.");
 
-  if (accessflag == 1) bp_type = bp_read_watchpoint;
-  else if (accessflag == 2) bp_type = bp_access_watchpoint;
-  else bp_type = bp_hardware_watchpoint;
+  if (accessflag == 1)
+    bp_type = bp_read_watchpoint;
+  else if (accessflag == 2)
+    bp_type = bp_access_watchpoint;
+  else
+    bp_type = bp_hardware_watchpoint;
 
   mem_cnt = can_use_hardware_watchpoint (val);
   if (mem_cnt == 0 && bp_type != bp_hardware_watchpoint)
     error ("Expression cannot be implemented with read/access watchpoint.");
-  if (mem_cnt != 0) { 
-    i = hw_watchpoint_used_count (bp_type, &other_type_used);
-    target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
-               bp_type, i + mem_cnt, other_type_used);
-    if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint)
-      error ("Target does not have this type of hardware watchpoint support.");
-    if (target_resources_ok < 0 && bp_type != bp_hardware_watchpoint)
-      error ("Target resources have been allocated for other types of watchpoints.");
-  }
+  if (mem_cnt != 0)
+    {
+      i = hw_watchpoint_used_count (bp_type, &other_type_used);
+      target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
+                                    bp_type, i + mem_cnt, other_type_used);
+      if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint)
+       error ("Target does not have this type of hardware watchpoint support.");
+      if (target_resources_ok < 0 && bp_type != bp_hardware_watchpoint)
+       error ("Target resources have been allocated for other types of watchpoints.");
+    }
 
 #if defined(HPUXHPPA)
- /*  On HP-UX if you set a h/w
 /*  On HP-UX if you set a h/w
      watchpoint before the "run" command, the inferior dies with a e.g.,
      SIGILL once you start it.  I initially believed this was due to a
      bad interaction between page protection traps and the initial
@@ -4370,13 +4400,13 @@ watch_command_1 (arg, accessflag, from_tty)
      Until I figure out what's happening, I'm disallowing watches altogether
      before the "run" or "attach" command.  We'll tell the user they must
      set watches after getting the program started. */
-  if (! target_has_execution)
+  if (!target_has_execution)
     {
       warning ("can't do that without a running program; try \"break main\", \"run\" first");
       return;
     }
 #endif /* HPUXHPPA */
-  
+
   /* Now set up the breakpoint.  */
   b = set_raw_breakpoint (sal);
   set_breakpoint_count (breakpoint_count + 1);
@@ -4391,7 +4421,7 @@ watch_command_1 (arg, accessflag, from_tty)
     b->cond_string = savestring (cond_start, cond_end - cond_start);
   else
     b->cond_string = 0;
-         
+
   frame = block_innermost_frame (exp_valid_block);
   if (frame)
     {
@@ -4399,7 +4429,7 @@ watch_command_1 (arg, accessflag, from_tty)
       b->watchpoint_frame = frame->frame;
     }
   else
-    b->watchpoint_frame = (CORE_ADDR)0;
+    b->watchpoint_frame = (CORE_ADDR) 0;
 
   if (mem_cnt && target_resources_ok > 0)
     b->type = bp_type;
@@ -4417,7 +4447,7 @@ watch_command_1 (arg, accessflag, from_tty)
          struct symtab_and_line scope_sal;
 
          INIT_SAL (&scope_sal);        /* initialize to zeroes */
-         scope_sal.pc      = get_frame_pc (prev_frame);
+         scope_sal.pc = get_frame_pc (prev_frame);
          scope_sal.section = find_pc_overlay (scope_sal.pc);
 
          scope_breakpoint = set_raw_breakpoint (scope_sal);
@@ -4461,20 +4491,20 @@ can_use_hardware_watchpoint (v)
   int found_memory_cnt = 0;
 
   /* Did the user specifically forbid us to use hardware watchpoints? */
-  if (! can_use_hw_watchpoints)
+  if (!can_use_hw_watchpoints)
     return 0;
-       
+
   /* Make sure all the intermediate values are in memory.  Also make sure
      we found at least one memory expression.  Guards against watch 0x12345,
      which is meaningless, but could cause errors if one tries to insert a 
      hardware watchpoint for the constant expression.  */
-  for ( ; v; v = v->next)
+  for (; v; v = v->next)
     {
       if (v->lval == lval_memory)
        {
          if (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (TYPE_LENGTH (VALUE_TYPE (v))))
            found_memory_cnt++;
-        }
+       }
       else if (v->lval != not_lval && v->modifiable == 0)
        return 0;
     }
@@ -4484,28 +4514,31 @@ can_use_hardware_watchpoint (v)
   return found_memory_cnt;
 }
 
-static void watch_command (arg, from_tty)
+static void
+watch_command (arg, from_tty)
      char *arg;
      int from_tty;
 {
   watch_command_1 (arg, 0, from_tty);
 }
 
-static void rwatch_command (arg, from_tty)
+static void
+rwatch_command (arg, from_tty)
      char *arg;
      int from_tty;
 {
   watch_command_1 (arg, 1, from_tty);
 }
 
-static void awatch_command (arg, from_tty)
+static void
+awatch_command (arg, from_tty)
      char *arg;
      int from_tty;
 {
   watch_command_1 (arg, 2, from_tty);
 }
-
 \f
+
 /* Helper routines for the until_command routine in infcmd.c.  Here
    because it uses the mechanisms of breakpoints.  */
 
@@ -4540,26 +4573,26 @@ until_break_command (arg, from_tty)
 
   /* Set a breakpoint where the user wants it and at return from
      this function */
-  
+
   if (default_breakpoint_valid)
     sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
-                         default_breakpoint_line, (char ***)NULL);
+                         default_breakpoint_line, (char ***) NULL);
   else
-    sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0, (char ***)NULL);
-  
+    sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, (char ***) NULL);
+
   if (sals.nelts != 1)
     error ("Couldn't get information on specified line.");
-  
+
   sal = sals.sals[0];
-  free ((PTR)sals.sals);               /* malloc'd, so freed */
-  
+  free ((PTR) sals.sals);      /* malloc'd, so freed */
+
   if (*arg)
     error ("Junk at end of arguments.");
-  
+
   resolve_sal_pc (&sal);
-  
+
   breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
-  
+
   if (!async_p || !target_has_async)
     old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
   else
@@ -4575,14 +4608,14 @@ until_break_command (arg, from_tty)
   if (async_p && target_has_async)
     {
       /* In this case we don't need args for the continuation, because
-        all it needs to do is do the cleanups in the
-        exec_cleanup_chain, which will be only those inserted by this
-        function. We can get away by using ALL_CLEANUPS. */
+         all it needs to do is do the cleanups in the
+         exec_cleanup_chain, which will be only those inserted by this
+         function. We can get away by using ALL_CLEANUPS. */
       add_continuation (until_break_command_continuation, NULL);
     }
 
   /* Keep within the current frame */
-  
+
   if (prev_frame)
     {
       sal = find_pc_line (prev_frame->pc, 0);
@@ -4593,12 +4626,12 @@ until_break_command (arg, from_tty)
       else
        make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
     }
-  
+
   proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
   /* Do the cleanups now, anly if we are not running asynchronously,
      of if we are, but the target is still synchronous. */
   if (!async_p || !target_has_async)
-    do_cleanups(old_chain);
+    do_cleanups (old_chain);
 }
 \f
 #if 0
@@ -4643,7 +4676,7 @@ struct sal_chain
 static struct symtabs_and_lines
 map_catch_names (args, function)
      char *args;
-     int (*function)();
+     int (*function) ();
 {
   register char *p = args;
   register char *p1;
@@ -4681,7 +4714,7 @@ map_catch_names (args, function)
       if (function (p))
        {
          struct sal_chain *next = (struct sal_chain *)
-           alloca (sizeof (struct sal_chain));
+         alloca (sizeof (struct sal_chain));
          next->next = sal_chain;
          next->sal = get_catch_sal (p);
          sal_chain = next;
@@ -4693,7 +4726,8 @@ map_catch_names (args, function)
     win:
 #endif
       p = p1;
-      while (*p == ' ' || *p == '\t') p++;
+      while (*p == ' ' || *p == '\t')
+       p++;
     }
 }
 #endif
@@ -4770,7 +4804,7 @@ get_catch_sals (this_level_only)
                  if (SYMBOL_CLASS (sym) == LOC_LABEL)
                    {
                      struct sal_chain *next = (struct sal_chain *)
-                       alloca (sizeof (struct sal_chain));
+                     alloca (sizeof (struct sal_chain));
                      next->next = sal_chain;
                      next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
                      sal_chain = next;
@@ -4786,8 +4820,8 @@ get_catch_sals (this_level_only)
        break;
 
       /* After handling the function's top-level block, stop.
-        Don't continue to its superblock, the block of
-        per-file symbols.  */
+         Don't continue to its superblock, the block of
+         per-file symbols.  */
       if (BLOCK_FUNCTION (block))
        break;
       block = BLOCK_SUPERBLOCK (block);
@@ -4816,12 +4850,12 @@ static void
 ep_skip_leading_whitespace (s)
      char **s;
 {
-   if ((s == NULL) || (*s == NULL))
-       return;
-   while (isspace(**s))
-       *s += 1;
+  if ((s == NULL) || (*s == NULL))
+    return;
+  while (isspace (**s))
+    *s += 1;
 }
+
 /* This function examines a string, and attempts to find a token
    that might be an event name in the leading characters.  If a
    possible match is found, a pointer to the last character of
@@ -4830,31 +4864,31 @@ static char *
 ep_find_event_name_end (arg)
      char *arg;
 {
-  char *  s = arg;
-  char *  event_name_end = NULL;
+  char *s = arg;
+  char *event_name_end = NULL;
+
   /* If we could depend upon the presense of strrpbrk, we'd use that... */
   if (arg == NULL)
     return NULL;
+
   /* We break out of the loop when we find a token delimiter.
-   Basically, we're looking for alphanumerics and underscores;
-   anything else delimites the token. */
+     Basically, we're looking for alphanumerics and underscores;
+     anything else delimites the token. */
   while (*s != '\0')
     {
-      if (! isalnum(*s) && (*s != '_'))
-        break;
+      if (!isalnum (*s) && (*s != '_'))
+       break;
       event_name_end = s;
       s++;
     }
+
   return event_name_end;
 }
 
+
 /* This function attempts to parse an optional "if <cond>" clause
    from the arg string.  If one is not found, it returns NULL.
+
    Else, it returns a pointer to the condition string.  (It does not
    attempt to evaluate the string against a particular block.)  And,
    it updates arg to point to the first character following the parsed
@@ -4863,67 +4897,71 @@ static char *
 ep_parse_optional_if_clause (arg)
      char **arg;
 {
-  char *  cond_string;
-  if (((*arg)[0] != 'i') || ((*arg)[1] != 'f') || !isspace((*arg)[2]))
+  char *cond_string;
+
+  if (((*arg)[0] != 'i') || ((*arg)[1] != 'f') || !isspace ((*arg)[2]))
     return NULL;
+
   /* Skip the "if" keyword. */
   (*arg) += 2;
+
   /* Skip any extra leading whitespace, and record the start of the
      condition string. */
   ep_skip_leading_whitespace (arg);
   cond_string = *arg;
+
   /* Assume that the condition occupies the remainder of the arg string. */
   (*arg) += strlen (cond_string);
+
   return cond_string;
 }
+
 /* This function attempts to parse an optional filename from the arg
    string.  If one is not found, it returns NULL.
+
    Else, it returns a pointer to the parsed filename.  (This function
    makes no attempt to verify that a file of that name exists, or is
    accessible.)  And, it updates arg to point to the first character
    following the parsed filename in the arg string.
+
    Note that clients needing to preserve the returned filename for
    future access should copy it to their own buffers. */
 static char *
 ep_parse_optional_filename (arg)
      char **arg;
 {
-  static char  filename [1024];
-  char *  arg_p = *arg;
-  int  i;
-  char  c;
+  static char filename[1024];
+  char *arg_p = *arg;
+  int i;
+  char c;
+
   if ((*arg_p == '\0') || isspace (*arg_p))
     return NULL;
-  for (i=0; ; i++)
+
+  for (i = 0;; i++)
     {
       c = *arg_p;
       if (isspace (c))
-        c = '\0';
+       c = '\0';
       filename[i] = c;
       if (c == '\0')
-        break;
+       break;
       arg_p++;
     }
   *arg = arg_p;
+
   return filename;
 }
+
 /* Commands to deal with catching events, such as signals, exceptions,
    process start/exit, etc.  */
-typedef enum {catch_fork, catch_vfork} catch_fork_kind;
+
+typedef enum
+{
+  catch_fork, catch_vfork
+}
+catch_fork_kind;
+
 static void catch_fork_command_1 PARAMS ((catch_fork_kind fork_kind, char *arg, int tempflag, int from_tty));
 
 static void
@@ -4933,33 +4971,34 @@ catch_fork_command_1 (fork_kind, arg, tempflag, from_tty)
      int tempflag;
      int from_tty;
 {
-  char *  cond_string = NULL;
+  char *cond_string = NULL;
+
   ep_skip_leading_whitespace (&arg);
+
   /* The allowed syntax is:
-        catch [v]fork
-        catch [v]fork if <cond>
+     catch [v]fork
+     catch [v]fork if <cond>
+
      First, check if there's an if clause. */
   cond_string = ep_parse_optional_if_clause (&arg);
+
   if ((*arg != '\0') && !isspace (*arg))
     error ("Junk at end of arguments.");
+
   /* If this target supports it, create a fork or vfork catchpoint
      and enable reporting of such events. */
-  switch (fork_kind) {
-    case catch_fork :
+  switch (fork_kind)
+    {
+    case catch_fork:
       create_fork_event_catchpoint (tempflag, cond_string);
       break;
-    case catch_vfork :
+    case catch_vfork:
       create_vfork_event_catchpoint (tempflag, cond_string);
       break;
-    default :
+    default:
       error ("unsupported or unknown fork kind; cannot catch it");
       break;
-  }
+    }
 }
 
 static void
@@ -4968,13 +5007,13 @@ catch_exec_command_1 (arg, tempflag, from_tty)
      int tempflag;
      int from_tty;
 {
-  char *  cond_string = NULL;
+  char *cond_string = NULL;
 
   ep_skip_leading_whitespace (&arg);
 
   /* The allowed syntax is:
-        catch exec
-        catch exec if <cond>
+     catch exec
+     catch exec if <cond>
 
      First, check if there's an if clause. */
   cond_string = ep_parse_optional_if_clause (&arg);
@@ -4986,34 +5025,34 @@ catch_exec_command_1 (arg, tempflag, from_tty)
      and enable reporting of such events. */
   create_exec_event_catchpoint (tempflag, cond_string);
 }
+
 #if defined(SOLIB_ADD)
 static void
 catch_load_command_1 (arg, tempflag, from_tty)
-  char *  arg;
-  int  tempflag;
-  int  from_tty;
+     char *arg;
+     int tempflag;
+     int from_tty;
 {
-  char *  dll_pathname = NULL;
-  char *  cond_string = NULL;
+  char *dll_pathname = NULL;
+  char *cond_string = NULL;
+
   ep_skip_leading_whitespace (&arg);
+
   /* The allowed syntax is:
-        catch load
-        catch load if <cond>
-        catch load <filename>
-        catch load <filename> if <cond>
+     catch load
+     catch load if <cond>
+     catch load <filename>
+     catch load <filename> if <cond>
+
      The user is not allowed to specify the <filename> after an
      if clause.
+
      We'll ignore the pathological case of a file named "if".
+
      First, check if there's an if clause.  If so, then there
      cannot be a filename. */
   cond_string = ep_parse_optional_if_clause (&arg);
+
   /* If there was an if clause, then there cannot be a filename.
      Else, there might be a filename and an if clause. */
   if (cond_string == NULL)
@@ -5022,42 +5061,42 @@ catch_load_command_1 (arg, tempflag, from_tty)
       ep_skip_leading_whitespace (&arg);
       cond_string = ep_parse_optional_if_clause (&arg);
     }
+
   if ((*arg != '\0') && !isspace (*arg))
     error ("Junk at end of arguments.");
+
   /* Create a load breakpoint that only triggers when a load of
      the specified dll (or any dll, if no pathname was specified)
      occurs. */
   SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag, dll_pathname, cond_string);
 }
+
 static void
 catch_unload_command_1 (arg, tempflag, from_tty)
-  char *  arg;
-  int  tempflag;
-  int  from_tty;
+     char *arg;
+     int tempflag;
+     int from_tty;
 {
-  char *  dll_pathname = NULL;
-  char *  cond_string = NULL;
+  char *dll_pathname = NULL;
+  char *cond_string = NULL;
+
   ep_skip_leading_whitespace (&arg);
+
   /* The allowed syntax is:
-        catch unload
-        catch unload if <cond>
-        catch unload <filename>
-        catch unload <filename> if <cond>
+     catch unload
+     catch unload if <cond>
+     catch unload <filename>
+     catch unload <filename> if <cond>
+
      The user is not allowed to specify the <filename> after an
      if clause.
+
      We'll ignore the pathological case of a file named "if".
+
      First, check if there's an if clause.  If so, then there
      cannot be a filename. */
   cond_string = ep_parse_optional_if_clause (&arg);
+
   /* If there was an if clause, then there cannot be a filename.
      Else, there might be a filename and an if clause. */
   if (cond_string == NULL)
@@ -5066,10 +5105,10 @@ catch_unload_command_1 (arg, tempflag, from_tty)
       ep_skip_leading_whitespace (&arg);
       cond_string = ep_parse_optional_if_clause (&arg);
     }
+
   if ((*arg != '\0') && !isspace (*arg))
     error ("Junk at end of arguments.");
+
   /* Create an unload breakpoint that only triggers when an unload of
      the specified dll (or any dll, if no pathname was specified)
      occurs. */
@@ -5080,7 +5119,7 @@ catch_unload_command_1 (arg, tempflag, from_tty)
 /* Commands to deal with catching exceptions.  */
 
 /* Set a breakpoint at the specified callback routine for an
-   exception event callback */ 
+   exception event callback */
 
 static void
 create_exception_catchpoint (tempflag, cond_string, ex_event, sal)
@@ -5089,11 +5128,11 @@ create_exception_catchpoint (tempflag, cond_string, ex_event, sal)
      enum exception_event_kind ex_event;
      struct symtab_and_line *sal;
 {
-  struct breakpoint *  b;
-  int  i;
-  int  thread = -1;  /* All threads. */
+  struct breakpoint *b;
+  int i;
+  int thread = -1;             /* All threads. */
 
-  if (!sal) /* no exception support? */
+  if (!sal)                    /* no exception support? */
     return;
 
   b = set_raw_breakpoint (*sal);
@@ -5107,21 +5146,21 @@ create_exception_catchpoint (tempflag, cond_string, ex_event, sal)
   b->disposition = tempflag ? del : donttouch;
   switch (ex_event)
     {
-      case EX_EVENT_THROW:
-        b->type = bp_catch_throw;
-        break;
-      case EX_EVENT_CATCH:
-        b->type = bp_catch_catch;
-        break;
-      default: /* error condition */ 
-        b->type = bp_none;
-        b->enable = disabled;
-        error ("Internal error -- invalid catchpoint kind");
+    case EX_EVENT_THROW:
+      b->type = bp_catch_throw;
+      break;
+    case EX_EVENT_CATCH:
+      b->type = bp_catch_catch;
+      break;
+    default:                   /* error condition */
+      b->type = bp_none;
+      b->enable = disabled;
+      error ("Internal error -- invalid catchpoint kind");
     }
   mention (b);
 }
 
-/* Deal with "catch catch" and "catch throw" commands */ 
+/* Deal with "catch catch" and "catch throw" commands */
 
 static void
 catch_exception_command_1 (ex_event, arg, tempflag, from_tty)
@@ -5130,11 +5169,11 @@ catch_exception_command_1 (ex_event, arg, tempflag, from_tty)
      int tempflag;
      int from_tty;
 {
-  char * cond_string = NULL;
-  struct symtab_and_line * sal = NULL;
-  
+  char *cond_string = NULL;
+  struct symtab_and_line *sal = NULL;
+
   ep_skip_leading_whitespace (&arg);
-  
+
   cond_string = ep_parse_optional_if_clause (&arg);
 
   if ((*arg != '\0') && !isspace (*arg))
@@ -5147,31 +5186,31 @@ catch_exception_command_1 (ex_event, arg, tempflag, from_tty)
   /* See if we can find a callback routine */
   sal = target_enable_exception_callback (ex_event, 1);
 
-  if (sal) 
+  if (sal)
     {
       /* We have callbacks from the runtime system for exceptions.
-         Set a breakpoint on the sal found, if no errors */ 
+         Set a breakpoint on the sal found, if no errors */
       if (sal != (struct symtab_and_line *) -1)
-        create_exception_catchpoint (tempflag, cond_string, ex_event, sal);
+       create_exception_catchpoint (tempflag, cond_string, ex_event, sal);
       else
-        return; /* something went wrong with setting up callbacks */ 
+       return;                 /* something went wrong with setting up callbacks */
     }
-  else  
+  else
     {
       /* No callbacks from runtime system for exceptions.
          Try GNU C++ exception breakpoints using labels in debug info. */
       if (ex_event == EX_EVENT_CATCH)
-        {
-          handle_gnu_4_16_catch_command (arg, tempflag, from_tty);
-        }
+       {
+         handle_gnu_4_16_catch_command (arg, tempflag, from_tty);
+       }
       else if (ex_event == EX_EVENT_THROW)
-        {
-          /* Set a breakpoint on __raise_exception () */
-          
-          fprintf_filtered (gdb_stderr, "Unsupported with this platform/compiler combination.\n");
-          fprintf_filtered (gdb_stderr, "Perhaps you can achieve the effect you want by setting\n");
-          fprintf_filtered (gdb_stderr, "a breakpoint on __raise_exception().\n");
-        }
+       {
+         /* Set a breakpoint on __raise_exception () */
+
+         fprintf_filtered (gdb_stderr, "Unsupported with this platform/compiler combination.\n");
+         fprintf_filtered (gdb_stderr, "Perhaps you can achieve the effect you want by setting\n");
+         fprintf_filtered (gdb_stderr, "a breakpoint on __raise_exception().\n");
+       }
     }
 }
 
@@ -5180,7 +5219,7 @@ catch_exception_command_1 (ex_event, arg, tempflag, from_tty)
 
 static int
 cover_target_enable_exception_callback (arg)
-  PTR arg;
+     PTR arg;
 {
   args_for_catchpoint_enable *args = arg;
   struct symtab_and_line *sal;
@@ -5190,7 +5229,7 @@ cover_target_enable_exception_callback (arg)
   else if (sal == (struct symtab_and_line *) -1)
     return -1;
   else
-    return 1; /*is valid*/
+    return 1;                  /*is valid */
 }
 
 
@@ -5203,7 +5242,7 @@ cover_target_enable_exception_callback (arg)
    Note: Only the "catch" flavour of GDB 4.16 is handled here.  The
    "catch NAME" is now no longer allowed in catch_command_1().  Also,
    there was no code in GDB 4.16 for "catch throw". 
-  
+
    Called from catch_exception_command_1 () */
 
 
@@ -5223,12 +5262,12 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
   char *save_arg;
   int i;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
+  INIT_SAL (&sal);             /* initialize to zeroes */
 
   /* If no arg given, or if first arg is 'if ', all active catch clauses
      are breakpointed. */
 
-  if (!arg || (arg[0] == 'i' && arg[1] == 'f' 
+  if (!arg || (arg[0] == 'i' && arg[1] == 'f'
               && (arg[2] == ' ' || arg[2] == '\t')))
     {
       /* Grab all active catch clauses.  */
@@ -5243,26 +5282,26 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
       /* Not sure why this code has been disabled. I'm leaving
          it disabled.  We can never come here now anyway
          since we don't allow the "catch NAME" syntax.
-         pai/1997-07-11 */ 
+         pai/1997-07-11 */
 
       /* This isn't used; I don't know what it was for.  */
       sals = map_catch_names (arg, catch_breakpoint);
 #endif
     }
 
-  if (! sals.nelts) 
+  if (!sals.nelts)
     return;
 
   save_arg = arg;
   for (i = 0; i < sals.nelts; i++)
     {
       resolve_sal_pc (&sals.sals[i]);
-      
+
       while (arg && *arg)
        {
          if (arg[0] == 'i' && arg[1] == 'f'
              && (arg[2] == ' ' || arg[2] == '\t'))
-           cond = parse_exp_1 ((arg += 2, &arg), 
+           cond = parse_exp_1 ((arg += 2, &arg),
                                block_for_pc (sals.sals[i].pc), 0);
          else
            error ("Junk at end of arguments.");
@@ -5280,12 +5319,12 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
       b = set_raw_breakpoint (sal);
       set_breakpoint_count (breakpoint_count + 1);
       b->number = breakpoint_count;
-      b->type = bp_breakpoint; /* Important -- this is an ordinary breakpoint.
-                                  For platforms with callback support for exceptions,
-                                  create_exception_catchpoint() will create special
-                                  bp types (bp_catch_catch and bp_catch_throw), and
-                                  there is code in insert_breakpoints() and elsewhere
-                                  that depends on that. */
+      b->type = bp_breakpoint; /* Important -- this is an ordinary breakpoint.
+                                  For platforms with callback support for exceptions,
+                                  create_exception_catchpoint() will create special
+                                  bp types (bp_catch_catch and bp_catch_throw), and
+                                  there is code in insert_breakpoints() and elsewhere
+                                  that depends on that. */
 
       b->cond = cond;
       b->enable = enabled;
@@ -5299,7 +5338,7 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
       printf_unfiltered ("Multiple breakpoints were set.\n");
       printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
     }
-  free ((PTR)sals.sals);
+  free ((PTR) sals.sals);
 }
 
 #if 0
@@ -5307,12 +5346,12 @@ handle_gnu_4_16_catch_command (arg, tempflag, from_tty)
    just to placate infrun */
 static struct breakpoint *
 create_temp_exception_breakpoint (pc)
-  CORE_ADDR pc;
+     CORE_ADDR pc;
 {
   struct symtab_and_line sal;
   struct breakpoint *b;
 
-  INIT_SAL(&sal);
+  INIT_SAL (&sal);
   sal.pc = pc;
   sal.symtab = NULL;
   sal.line = 0;
@@ -5332,27 +5371,27 @@ create_temp_exception_breakpoint (pc)
 
 static void
 catch_command_1 (arg, tempflag, from_tty)
-  char *arg;
-  int tempflag;
-  int from_tty;
+     char *arg;
+     int tempflag;
+     int from_tty;
 {
+
   /* The first argument may be an event name, such as "start" or "load".
      If so, then handle it as such.  If it doesn't match an event name,
      then attempt to interpret it as an exception name.  (This latter is
      the v4.16-and-earlier GDB meaning of the "catch" command.)
+
      First, try to find the bounds of what might be an event name. */
-  char *  arg1_start = arg;
-  char *  arg1_end;
-  int  arg1_length;
+  char *arg1_start = arg;
+  char *arg1_end;
+  int arg1_length;
+
   if (arg1_start == NULL)
     {
-      /* Old behaviour was to use pre-v-4.16 syntax */ 
+      /* Old behaviour was to use pre-v-4.16 syntax */
       /* catch_throw_command_1 (arg1_start, tempflag, from_tty); */
       /* return; */
-      /* Now, this is not allowed */ 
+      /* Now, this is not allowed */
       error ("Catch requires an event name.");
 
     }
@@ -5360,7 +5399,7 @@ catch_command_1 (arg, tempflag, from_tty)
   if (arg1_end == NULL)
     error ("catch requires an event");
   arg1_length = arg1_end + 1 - arg1_start;
+
   /* Try to match what we found against known event names. */
   if (strncmp (arg1_start, "signal", arg1_length) == 0)
     {
@@ -5368,11 +5407,11 @@ catch_command_1 (arg, tempflag, from_tty)
     }
   else if (strncmp (arg1_start, "catch", arg1_length) == 0)
     {
-      catch_exception_command_1 (EX_EVENT_CATCH, arg1_end+1, tempflag, from_tty); 
+      catch_exception_command_1 (EX_EVENT_CATCH, arg1_end + 1, tempflag, from_tty);
     }
   else if (strncmp (arg1_start, "throw", arg1_length) == 0)
     {
-      catch_exception_command_1 (EX_EVENT_THROW, arg1_end+1, tempflag, from_tty);
+      catch_exception_command_1 (EX_EVENT_THROW, arg1_end + 1, tempflag, from_tty);
     }
   else if (strncmp (arg1_start, "thread_start", arg1_length) == 0)
     {
@@ -5397,7 +5436,7 @@ catch_command_1 (arg, tempflag, from_tty)
   else if (strncmp (arg1_start, "fork", arg1_length) == 0)
     {
 #if defined(CHILD_INSERT_FORK_CATCHPOINT)
-      catch_fork_command_1 (catch_fork, arg1_end+1, tempflag, from_tty);
+      catch_fork_command_1 (catch_fork, arg1_end + 1, tempflag, from_tty);
 #else
       error ("Catch of fork not yet implemented");
 #endif
@@ -5405,7 +5444,7 @@ catch_command_1 (arg, tempflag, from_tty)
   else if (strncmp (arg1_start, "vfork", arg1_length) == 0)
     {
 #if defined(CHILD_INSERT_VFORK_CATCHPOINT)
-      catch_fork_command_1 (catch_vfork, arg1_end+1, tempflag, from_tty);
+      catch_fork_command_1 (catch_vfork, arg1_end + 1, tempflag, from_tty);
 #else
       error ("Catch of vfork not yet implemented");
 #endif
@@ -5413,7 +5452,7 @@ catch_command_1 (arg, tempflag, from_tty)
   else if (strncmp (arg1_start, "exec", arg1_length) == 0)
     {
 #if defined(CHILD_INSERT_EXEC_CATCHPOINT)
-      catch_exec_command_1 (arg1_end+1, tempflag, from_tty);
+      catch_exec_command_1 (arg1_end + 1, tempflag, from_tty);
 #else
       error ("Catch of exec not yet implemented");
 #endif
@@ -5421,7 +5460,7 @@ catch_command_1 (arg, tempflag, from_tty)
   else if (strncmp (arg1_start, "load", arg1_length) == 0)
     {
 #if defined(SOLIB_ADD)
-      catch_load_command_1 (arg1_end+1, tempflag, from_tty);
+      catch_load_command_1 (arg1_end + 1, tempflag, from_tty);
 #else
       error ("Catch of load not implemented");
 #endif
@@ -5429,7 +5468,7 @@ catch_command_1 (arg, tempflag, from_tty)
   else if (strncmp (arg1_start, "unload", arg1_length) == 0)
     {
 #if defined(SOLIB_ADD)
-      catch_unload_command_1 (arg1_end+1, tempflag, from_tty);
+      catch_unload_command_1 (arg1_end + 1, tempflag, from_tty);
 #else
       error ("Catch of load not implemented");
 #endif
@@ -5438,15 +5477,15 @@ catch_command_1 (arg, tempflag, from_tty)
     {
       error ("Catch of stop not yet implemented");
     }
+
   /* This doesn't appear to be an event name */
 
   else
     {
       /* Pre-v.4.16 behaviour was to treat the argument
-         as the name of an exception */ 
+         as the name of an exception */
       /* catch_throw_command_1 (arg1_start, tempflag, from_tty); */
-      /* Now this is not allowed */ 
+      /* Now this is not allowed */
       error ("Unknown event kind specified for catch");
 
     }
@@ -5532,9 +5571,9 @@ clear_command (arg, from_tty)
     }
   else
     {
-      sals.sals = (struct symtab_and_line *) 
+      sals.sals = (struct symtab_and_line *)
        xmalloc (sizeof (struct symtab_and_line));
-      INIT_SAL (&sal); /* initialize to zeroes */
+      INIT_SAL (&sal);         /* initialize to zeroes */
       sal.line = default_breakpoint_line;
       sal.symtab = default_breakpoint_symtab;
       sal.pc = default_breakpoint_address;
@@ -5558,37 +5597,37 @@ clear_command (arg, from_tty)
   for (i = 0; i < sals.nelts; i++)
     {
       /* If exact pc given, clear bpts at that pc.
-        If line given (pc == 0), clear all bpts on specified line.
-        If defaulting, clear all bpts on default line
+         If line given (pc == 0), clear all bpts on specified line.
+         If defaulting, clear all bpts on default line
          or at default pc.
-       
-               defaulting    sal.pc != 0    tests to do
-       
-                0              1             pc
-                1              1             pc _and_ line
-                0              0             line
-                1              0             <can't happen> */
+
+         defaulting    sal.pc != 0    tests to do
+
+         0              1             pc
+         1              1             pc _and_ line
+         0              0             line
+         1              0             <can't happen> */
 
       sal = sals.sals[i];
       found = (struct breakpoint *) 0;
 
 
       while (breakpoint_chain
-             /* Why don't we check here that this is not
-               a watchpoint, etc., as we do below?
-               I can't make it fail, but don't know
-               what's stopping the failure: a watchpoint
-               of the same address as "sal.pc" should
-               wind up being deleted. */
-             && (  ((sal.pc && (breakpoint_chain->address == sal.pc)) &&
-                   (overlay_debugging == 0 ||
-                    breakpoint_chain->section == sal.section))
-                || ((default_match || (0 == sal.pc))
-                   && breakpoint_chain->source_file != NULL
-                   && sal.symtab != NULL
-                   && STREQ (breakpoint_chain->source_file, sal.symtab->filename)
-                   && breakpoint_chain->line_number == sal.line)))
+      /* Why don't we check here that this is not
+         a watchpoint, etc., as we do below?
+         I can't make it fail, but don't know
+         what's stopping the failure: a watchpoint
+         of the same address as "sal.pc" should
+         wind up being deleted. */
+
+            && (((sal.pc && (breakpoint_chain->address == sal.pc)) &&
+                 (overlay_debugging == 0 ||
+                  breakpoint_chain->section == sal.section))
+                || ((default_match || (0 == sal.pc))
+                    && breakpoint_chain->source_file != NULL
+                    && sal.symtab != NULL
+             && STREQ (breakpoint_chain->source_file, sal.symtab->filename)
+                    && breakpoint_chain->line_number == sal.line)))
 
        {
          b1 = breakpoint_chain;
@@ -5599,28 +5638,28 @@ clear_command (arg, from_tty)
 
       ALL_BREAKPOINTS (b)
 
-      while (b->next
-             && b->next->type != bp_none
-             && b->next->type != bp_watchpoint
-             && b->next->type != bp_hardware_watchpoint
-             && b->next->type != bp_read_watchpoint
-             && b->next->type != bp_access_watchpoint
-             && (  ((sal.pc && (b->next->address == sal.pc)) &&
-                   (overlay_debugging == 0 ||
-                    b->next->section == sal.section))
-                || ((default_match || (0 == sal.pc))
-                   && b->next->source_file != NULL
-                   && sal.symtab != NULL
-                   && STREQ (b->next->source_file, sal.symtab->filename)
-                   && b->next->line_number == sal.line)))
+       while (b->next
+              && b->next->type != bp_none
+              && b->next->type != bp_watchpoint
+              && b->next->type != bp_hardware_watchpoint
+              && b->next->type != bp_read_watchpoint
+              && b->next->type != bp_access_watchpoint
+              && (((sal.pc && (b->next->address == sal.pc)) &&
+                   (overlay_debugging == 0 ||
+                    b->next->section == sal.section))
+                  || ((default_match || (0 == sal.pc))
+                      && b->next->source_file != NULL
+                      && sal.symtab != NULL
+                      && STREQ (b->next->source_file, sal.symtab->filename)
+                      && b->next->line_number == sal.line)))
 
 
-         {
-           b1 = b->next;
-           b->next = b1->next;
-           b1->next = found;
-           found = b1;
-         }
+       {
+         b1 = b->next;
+         b->next = b1->next;
+         b1->next = found;
+         found = b1;
+       }
 
       if (found == 0)
        {
@@ -5630,19 +5669,23 @@ clear_command (arg, from_tty)
            error ("No breakpoint at this line.");
        }
 
-      if (found->next) from_tty = 1; /* Always report if deleted more than one */
-      if (from_tty) printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
+      if (found->next)
+       from_tty = 1;           /* Always report if deleted more than one */
+      if (from_tty)
+       printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
       breakpoints_changed ();
       while (found)
        {
-         if (from_tty) printf_unfiltered ("%d ", found->number);
+         if (from_tty)
+           printf_unfiltered ("%d ", found->number);
          b1 = found->next;
          delete_breakpoint (found);
          found = b1;
        }
-      if (from_tty) putchar_unfiltered ('\n');
+      if (from_tty)
+       putchar_unfiltered ('\n');
     }
-  free ((PTR)sals.sals);
+  free ((PTR) sals.sals);
 }
 \f
 /* Delete breakpoint in BS if they are `delete' breakpoints and
@@ -5656,15 +5699,15 @@ breakpoint_auto_delete (bs)
   struct breakpoint *b, *temp;
 
   for (; bs; bs = bs->next)
-    if (bs->breakpoint_at && bs->breakpoint_at->disposition == del 
+    if (bs->breakpoint_at && bs->breakpoint_at->disposition == del
        && bs->stop)
       delete_breakpoint (bs->breakpoint_at);
 
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      if (b->disposition == del_at_next_stop)
-       delete_breakpoint (b);
-    }
+  {
+    if (b->disposition == del_at_next_stop)
+      delete_breakpoint (b);
+  }
 }
 
 /* Delete a breakpoint and clean up all traces of it in the data structures. */
@@ -5701,7 +5744,7 @@ delete_breakpoint (bpt)
 
   if (bpt->inserted)
     remove_breakpoint (bpt, mark_uninserted);
-      
+
   if (breakpoint_chain == bpt)
     breakpoint_chain = bpt->next;
 
@@ -5710,14 +5753,14 @@ delete_breakpoint (bpt)
      isn't actually running.  target_enable_exception_callback for a
      null target ops vector gives an undesirable error message, so we
      check here and avoid it. Since currently (1997-09-17) only HP-UX aCC's
-     exceptions are supported in this way, it's OK for now. FIXME */ 
+     exceptions are supported in this way, it's OK for now. FIXME */
   if (ep_is_exception_catchpoint (bpt) && target_has_execution)
     {
       static char message1[] = "Error in deleting catchpoint %d:\n";
       static char message[sizeof (message1) + 30];
       args_for_catchpoint_enable args;
 
-      sprintf (message, message1, bpt->number);        /* Format possible error msg */
+      sprintf (message, message1, bpt->number);                /* Format possible error msg */
       args.kind = bpt->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW;
       args.enable = 0;
       catch_errors (cover_target_enable_exception_callback, &args,
@@ -5727,10 +5770,10 @@ delete_breakpoint (bpt)
 
   ALL_BREAKPOINTS (b)
     if (b->next == bpt)
-      {
-       b->next = bpt->next;
-       break;
-      }
+    {
+      b->next = bpt->next;
+      break;
+    }
 
   /* Before turning off the visuals for the bp, check to see that
      there are no other bps at the same address. */
@@ -5739,17 +5782,17 @@ delete_breakpoint (bpt)
       int clearIt;
 
       ALL_BREAKPOINTS (b)
-        {
-          clearIt = (b->address != bpt->address);
-          if (!clearIt)
-            break;
-        }
+      {
+       clearIt = (b->address != bpt->address);
+       if (!clearIt)
+         break;
+      }
 
       if (clearIt)
-        {
-          TUIDO(((TuiOpaqueFuncPtr)tui_vAllSetHasBreakAt, bpt, 0));
-          TUIDO(((TuiOpaqueFuncPtr)tuiUpdateAllExecInfos));
-        }
+       {
+         TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, bpt, 0));
+         TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
+       }
     }
 
   check_duplicates (bpt->address, bpt->section);
@@ -5770,18 +5813,18 @@ delete_breakpoint (bpt)
            && b->enable != disabled
            && b->enable != shlib_disabled
            && b->enable != call_disabled)
-         {
-           int val;
-           val = target_insert_breakpoint (b->address, b->shadow_contents);
-           if (val != 0)
-             {
-               target_terminal_ours_for_output ();
-               fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
-               memory_error (val, b->address); /* which bombs us out */
-             }
-           else
-             b->inserted = 1;
-         }
+       {
+         int val;
+         val = target_insert_breakpoint (b->address, b->shadow_contents);
+         if (val != 0)
+           {
+             target_terminal_ours_for_output ();
+             fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
+             memory_error (val, b->address);   /* which bombs us out */
+           }
+         else
+           b->inserted = 1;
+       }
     }
 
   free_command_lines (&bpt->commands);
@@ -5826,7 +5869,7 @@ delete_breakpoint (bpt)
      bp, we mark it as deleted before freeing its storage. */
   bpt->type = bp_none;
 
-  free ((PTR)bpt);
+  free ((PTR) bpt);
 }
 
 void
@@ -5841,27 +5884,27 @@ delete_command (arg, from_tty)
       int breaks_to_delete = 0;
 
       /* Delete all breakpoints if no argument.
-        Do not delete internal or call-dummy breakpoints, these
-        have to be deleted with an explicit breakpoint number argument.  */
-      ALL_BREAKPOINTS (b) 
-       {
-         if (b->type != bp_call_dummy && 
-              b->type != bp_shlib_event && 
-              b->number >= 0)
-           breaks_to_delete = 1;
-       }
+         Do not delete internal or call-dummy breakpoints, these
+         have to be deleted with an explicit breakpoint number argument.  */
+      ALL_BREAKPOINTS (b)
+      {
+       if (b->type != bp_call_dummy &&
+           b->type != bp_shlib_event &&
+           b->number >= 0)
+         breaks_to_delete = 1;
+      }
 
       /* Ask user only if there are some breakpoints to delete.  */
       if (!from_tty
          || (breaks_to_delete && query ("Delete all breakpoints? ")))
        {
-         ALL_BREAKPOINTS_SAFE (b, temp) 
-           {
-             if (b->type != bp_call_dummy &&
-                  b->type != bp_shlib_event &&
-                  b->number >= 0)
-               delete_breakpoint (b);
-           }
+         ALL_BREAKPOINTS_SAFE (b, temp)
+         {
+           if (b->type != bp_call_dummy &&
+               b->type != bp_shlib_event &&
+               b->number >= 0)
+             delete_breakpoint (b);
+         }
        }
     }
   else
@@ -5876,7 +5919,7 @@ static int
 breakpoint_re_set_one (bint)
      PTR bint;
 {
-  struct breakpoint *b = (struct breakpoint *)bint;  /* get past catch_errs */
+  struct breakpoint *b = (struct breakpoint *) bint;   /* get past catch_errs */
   struct value *mark;
   int i;
   struct symtabs_and_lines sals;
@@ -5899,14 +5942,14 @@ breakpoint_re_set_one (bint)
          return 0;
        }
       /* In case we have a problem, disable this breakpoint.  We'll restore
-        its status if we succeed.  */
+         its status if we succeed.  */
       save_enable = b->enable;
       b->enable = disabled;
 
       set_language (b->language);
       input_radix = b->input_radix;
       s = b->addr_string;
-      sals = decode_line_1 (&s, 1, (struct symtab *)NULL, 0, (char ***)NULL);
+      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL);
       for (i = 0; i < sals.nelts; i++)
        {
          resolve_sal_pc (&sals.sals[i]);
@@ -5917,23 +5960,23 @@ breakpoint_re_set_one (bint)
            {
              s = b->cond_string;
              if (b->cond)
-               free ((PTR)b->cond);
+               free ((PTR) b->cond);
              b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
            }
 
-         /* We need to re-set the breakpoint if the address changes...*/
+         /* We need to re-set the breakpoint if the address changes... */
          if (b->address != sals.sals[i].pc
-             /* ...or new and old breakpoints both have source files, and
-                the source file name or the line number changes...  */
+         /* ...or new and old breakpoints both have source files, and
+            the source file name or the line number changes...  */
              || (b->source_file != NULL
                  && sals.sals[i].symtab != NULL
                  && (!STREQ (b->source_file, sals.sals[i].symtab->filename)
                      || b->line_number != sals.sals[i].line)
-                 )
-             /* ...or we switch between having a source file and not having
-                one.  */
-             || ((b->source_file == NULL) != (sals.sals[i].symtab == NULL))
              )
+         /* ...or we switch between having a source file and not having
+            one.  */
+             || ((b->source_file == NULL) != (sals.sals[i].symtab == NULL))
+           )
            {
              if (b->source_file != NULL)
                free (b->source_file);
@@ -5946,26 +5989,26 @@ breakpoint_re_set_one (bint)
              b->line_number = sals.sals[i].line;
              b->address = sals.sals[i].pc;
 
-             /* Used to check for duplicates here, but that can
-               cause trouble, as it doesn't check for disable
-                breakpoints. */
+             /* Used to check for duplicates here, but that can
+                cause trouble, as it doesn't check for disable
+                breakpoints. */
 
              mention (b);
 
              /* Might be better to do this just once per breakpoint_re_set,
-                rather than once for every breakpoint.  */
+                rather than once for every breakpoint.  */
              breakpoints_changed ();
            }
          b->section = sals.sals[i].section;
          b->enable = save_enable;      /* Restore it, this worked. */
 
 
-          /* Now that this is re-enabled, check_duplicates
+         /* Now that this is re-enabled, check_duplicates
             can be used. */
-          check_duplicates (b->address, b->section);
+         check_duplicates (b->address, b->section);
 
        }
-      free ((PTR)sals.sals);
+      free ((PTR) sals.sals);
       break;
 
     case bp_watchpoint:
@@ -5974,15 +6017,15 @@ breakpoint_re_set_one (bint)
     case bp_access_watchpoint:
       innermost_block = NULL;
       /* The issue arises of what context to evaluate this in.  The same
-        one as when it was set, but what does that mean when symbols have
-        been re-read?  We could save the filename and functionname, but
-        if the context is more local than that, the best we could do would
-        be something like how many levels deep and which index at that
-        particular level, but that's going to be less stable than filenames
-        or functionnames.  */
+         one as when it was set, but what does that mean when symbols have
+         been re-read?  We could save the filename and functionname, but
+         if the context is more local than that, the best we could do would
+         be something like how many levels deep and which index at that
+         particular level, but that's going to be less stable than filenames
+         or functionnames.  */
       /* So for now, just use a global context.  */
       if (b->exp)
-       free ((PTR)b->exp);
+       free ((PTR) b->exp);
       b->exp = parse_expression (b->exp_string);
       b->exp_valid_block = innermost_block;
       mark = value_mark ();
@@ -5997,42 +6040,42 @@ breakpoint_re_set_one (bint)
        {
          s = b->cond_string;
          if (b->cond)
-           free ((PTR)b->cond);
-         b->cond = parse_exp_1 (&s, (struct block *)0, 0);
+           free ((PTR) b->cond);
+         b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
        }
       if (b->enable == enabled)
        mention (b);
       value_free_to_mark (mark);
       break;
-    case bp_catch_catch:  
-    case bp_catch_throw:  
+    case bp_catch_catch:
+    case bp_catch_throw:
       break;
-    /* We needn't really do anything to reset these, since the mask
-       that requests them is unaffected by e.g., new libraries being
-       loaded. */
+      /* We needn't really do anything to reset these, since the mask
+         that requests them is unaffected by e.g., new libraries being
+         loaded. */
     case bp_catch_fork:
     case bp_catch_vfork:
     case bp_catch_exec:
       break;
+
     default:
       printf_filtered ("Deleting unknown breakpoint type %d\n", b->type);
       /* fall through */
-    /* Delete longjmp breakpoints, they will be reset later by
-       breakpoint_re_set.  */
+      /* Delete longjmp breakpoints, they will be reset later by
+         breakpoint_re_set.  */
     case bp_longjmp:
     case bp_longjmp_resume:
       delete_breakpoint (b);
       break;
 
-    /* This breakpoint is special, it's set up when the inferior
-       starts and we really don't want to touch it.  */
+      /* This breakpoint is special, it's set up when the inferior
+         starts and we really don't want to touch it.  */
     case bp_shlib_event:
 
-    /* Keep temporary breakpoints, which can be encountered when we step
-       over a dlopen call and SOLIB_ADD is resetting the breakpoints.
-       Otherwise these should have been blown away via the cleanup chain
-       or by breakpoint_init_inferior when we rerun the executable.  */
+      /* Keep temporary breakpoints, which can be encountered when we step
+         over a dlopen call and SOLIB_ADD is resetting the breakpoints.
+         Otherwise these should have been blown away via the cleanup chain
+         or by breakpoint_init_inferior when we rerun the executable.  */
     case bp_until:
     case bp_finish:
     case bp_watchpoint_scope:
@@ -6052,15 +6095,15 @@ breakpoint_re_set ()
   enum language save_language;
   int save_input_radix;
   static char message1[] = "Error in re-setting breakpoint %d:\n";
-  char message[sizeof (message1) + 30 /* slop */];
-  
+  char message[sizeof (message1) + 30 /* slop */ ];
+
   save_language = current_language->la_language;
   save_input_radix = input_radix;
   ALL_BREAKPOINTS_SAFE (b, temp)
-    {
-      sprintf (message, message1, b->number);  /* Format possible error msg */
-      catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL);
-    }
+  {
+    sprintf (message, message1, b->number);    /* Format possible error msg */
+    catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL);
+  }
   set_language (save_language);
   input_radix = save_input_radix;
 
@@ -6090,12 +6133,12 @@ breakpoint_re_set ()
    - Else, reset it to the current thread for inferior_pid. */
 void
 breakpoint_re_set_thread (b)
-  struct breakpoint *  b;
+     struct breakpoint *b;
 {
   if (b->thread != -1)
     {
       if (in_thread_list (inferior_pid))
-        b->thread = pid_to_thread_id (inferior_pid);
+       b->thread = pid_to_thread_id (inferior_pid);
     }
 }
 
@@ -6110,22 +6153,22 @@ set_ignore_count (bptnum, count, from_tty)
 
   ALL_BREAKPOINTS (b)
     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);
-       breakpoints_changed ();
+    {
+      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);
+      breakpoints_changed ();
+      return;
+    }
 
   error ("No breakpoint number %d.", bptnum);
 }
@@ -6152,7 +6195,7 @@ ignore_command (args, from_tty)
 
   if (p == 0)
     error_no_arg ("a breakpoint number");
-  
+
   num = get_number (&p);
 
   if (*p == 0)
@@ -6184,18 +6227,18 @@ map_breakpoint_numbers (args, function)
   while (*p)
     {
       p1 = p;
-      
+
       num = get_number (&p1);
 
       ALL_BREAKPOINTS (b)
        if (b->number == num)
-         {
-           struct breakpoint *related_breakpoint = b->related_breakpoint;
-           function (b);
-           if (related_breakpoint)
-             function (related_breakpoint);
-           goto win;
-         }
+       {
+         struct breakpoint *related_breakpoint = b->related_breakpoint;
+         function (b);
+         if (related_breakpoint)
+           function (related_breakpoint);
+         goto win;
+       }
       printf_unfiltered ("No breakpoint number %d.\n", num);
     win:
       p = p1;
@@ -6230,27 +6273,27 @@ disable_command (args, from_tty)
   if (args == 0)
     ALL_BREAKPOINTS (bpt)
       switch (bpt->type)
-       {
-        case bp_none:
-          warning ("attempted to disable apparently deleted breakpoint #%d?\n", bpt->number);
-          continue;
-       case bp_breakpoint:
-        case bp_catch_load:
-        case bp_catch_unload:
-        case bp_catch_fork:
-        case bp_catch_vfork:
-        case bp_catch_exec:
-       case bp_catch_catch:
-       case bp_catch_throw:
-        case bp_hardware_breakpoint:
-        case bp_watchpoint:
-        case bp_hardware_watchpoint:
-        case bp_read_watchpoint:
-        case bp_access_watchpoint:
-         disable_breakpoint (bpt);
-       default:
-         continue;
-       }
+      {
+      case bp_none:
+       warning ("attempted to disable apparently deleted breakpoint #%d?\n", bpt->number);
+       continue;
+      case bp_breakpoint:
+      case bp_catch_load:
+      case bp_catch_unload:
+      case bp_catch_fork:
+      case bp_catch_vfork:
+      case bp_catch_exec:
+      case bp_catch_catch:
+      case bp_catch_throw:
+      case bp_hardware_breakpoint:
+      case bp_watchpoint:
+      case bp_hardware_watchpoint:
+      case bp_read_watchpoint:
+      case bp_access_watchpoint:
+       disable_breakpoint (bpt);
+      default:
+       continue;
+      }
   else
     map_breakpoint_numbers (args, disable_breakpoint);
 }
@@ -6268,13 +6311,13 @@ do_enable_breakpoint (bpt, disposition)
   if (bpt->type == bp_hardware_breakpoint)
     {
       int i;
-      i = hw_breakpoint_used_count();
-      target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
-               bp_hardware_breakpoint, i+1, 0);
+      i = hw_breakpoint_used_count ();
+      target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
+                                         bp_hardware_breakpoint, i + 1, 0);
       if (target_resources_ok == 0)
-        error ("No hardware breakpoint support in the target.");
+       error ("No hardware breakpoint support in the target.");
       else if (target_resources_ok < 0)
-        error ("Hardware breakpoints used exceeds limit.");
+       error ("Hardware breakpoints used exceeds limit.");
     }
 
   bpt->enable = enabled;
@@ -6289,11 +6332,11 @@ do_enable_breakpoint (bpt, disposition)
        {
          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);
+         /* Ensure that we have the current frame.  Else, this
+            next query may pessimistically be answered as, "No,
+            not within current scope". */
+         get_current_frame ();
+         fr = find_frame_addr_in_frame_chain (bpt->watchpoint_frame);
          if (fr == NULL)
            {
              printf_filtered ("\
@@ -6316,28 +6359,28 @@ is valid is not currently in scope.\n", bpt->number);
        value_fetch_lazy (bpt->val);
 
       if (bpt->type == bp_hardware_watchpoint ||
-           bpt->type == bp_read_watchpoint ||
-           bpt->type == bp_access_watchpoint)
-      {
-        int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
-        int mem_cnt = can_use_hardware_watchpoint (bpt->val);
-
-        /* Hack around 'unused var' error for some targets here */
-        (void) mem_cnt, i;
-        target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
-                bpt->type, i + mem_cnt, other_type_used);
-        /* we can consider of type is bp_hardware_watchpoint, convert to 
-          bp_watchpoint in the following condition */
-        if (target_resources_ok < 0)
-         {
-             printf_filtered("\
+         bpt->type == bp_read_watchpoint ||
+         bpt->type == bp_access_watchpoint)
+       {
+         int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
+         int mem_cnt = can_use_hardware_watchpoint (bpt->val);
+
+         /* Hack around 'unused var' error for some targets here */
+         (void) mem_cnt, i;
+         target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
+                                  bpt->type, i + mem_cnt, other_type_used);
+         /* we can consider of type is bp_hardware_watchpoint, convert to 
+            bp_watchpoint in the following condition */
+         if (target_resources_ok < 0)
+           {
+             printf_filtered ("\
 Cannot enable watchpoint %d because target watch resources\n\
 have been allocated for other watchpoints.\n", bpt->number);
-            bpt->enable = disabled;
-            value_free_to_mark (mark);
-            return;
-          }
-      }
+             bpt->enable = disabled;
+             value_free_to_mark (mark);
+             return;
+           }
+       }
 
       if (save_selected_frame_level >= 0)
        select_and_print_frame (save_selected_frame, save_selected_frame_level);
@@ -6368,27 +6411,27 @@ enable_command (args, from_tty)
   if (args == 0)
     ALL_BREAKPOINTS (bpt)
       switch (bpt->type)
-       {
-        case bp_none:
-          warning ("attempted to enable apparently deleted breakpoint #%d?\n", bpt->number);
-          continue;
-       case bp_breakpoint:
-        case bp_catch_load:
-        case bp_catch_unload:
-        case bp_catch_fork:
-        case bp_catch_vfork:
-        case bp_catch_exec:
-       case bp_catch_catch:
-       case bp_catch_throw:
-       case bp_hardware_breakpoint:
-       case bp_watchpoint:
-       case bp_hardware_watchpoint:
-       case bp_read_watchpoint:
-       case bp_access_watchpoint:
-         enable_breakpoint (bpt);
-       default:
-         continue;
-       }
+      {
+      case bp_none:
+       warning ("attempted to enable apparently deleted breakpoint #%d?\n", bpt->number);
+       continue;
+      case bp_breakpoint:
+      case bp_catch_load:
+      case bp_catch_unload:
+      case bp_catch_fork:
+      case bp_catch_vfork:
+      case bp_catch_exec:
+      case bp_catch_catch:
+      case bp_catch_throw:
+      case bp_hardware_breakpoint:
+      case bp_watchpoint:
+      case bp_hardware_watchpoint:
+      case bp_read_watchpoint:
+      case bp_access_watchpoint:
+       enable_breakpoint (bpt);
+      default:
+       continue;
+      }
   else
     map_breakpoint_numbers (args, enable_breakpoint);
 }
@@ -6438,10 +6481,10 @@ decode_line_spec_1 (string, funfirstline)
   if (default_breakpoint_valid)
     sals = decode_line_1 (&string, funfirstline,
                          default_breakpoint_symtab, default_breakpoint_line,
-                         (char ***)NULL);
+                         (char ***) NULL);
   else
     sals = decode_line_1 (&string, funfirstline,
-                         (struct symtab *)NULL, 0, (char ***)NULL);
+                         (struct symtab *) NULL, 0, (char ***) NULL);
   if (*string)
     error ("Junk at end of line specification: %s", string);
   return sals;
@@ -6461,7 +6504,7 @@ _initialize_breakpoint ()
           "Set ignore-count of breakpoint number N to COUNT.\n\
 Usage is `ignore N COUNT'.");
   if (xdb_commands)
-    add_com_alias("bc", "ignore", class_breakpoint, 1);
+    add_com_alias ("bc", "ignore", class_breakpoint, 1);
 
   add_com ("commands", class_breakpoint, commands_command,
           "Set commands to be executed when a breakpoint is hit.\n\
@@ -6482,8 +6525,8 @@ expression to be evaluated whenever breakpoint N is reached.  ");
 Like \"break\" except the breakpoint is only temporary,\n\
 so it will be deleted when hit.  Equivalent to \"break\" followed\n\
 by using \"enable delete\" on the breakpoint number.");
-  add_com("txbreak", class_breakpoint, tbreak_at_finish_command,
-          "Set temporary breakpoint at procedure exit.  Either there should\n\
+  add_com ("txbreak", class_breakpoint, tbreak_at_finish_command,
+          "Set temporary breakpoint at procedure exit.  Either there should\n\
 be no argument or the argument must be a depth.\n");
 
   add_com ("hbreak", class_breakpoint, hbreak_command,
@@ -6504,8 +6547,8 @@ This is used to cancel the effect of the \"disable\" command.\n\
 With a subcommand you can enable temporarily.",
                  &enablelist, "enable ", 1, &cmdlist);
   if (xdb_commands)
-      add_com("ab", class_breakpoint, enable_command,
-                     "Enable some breakpoints.\n\
+    add_com ("ab", class_breakpoint, enable_command,
+            "Enable some breakpoints.\n\
 Give breakpoint numbers (separated by spaces) as arguments.\n\
 With no subcommand, breakpoints are enabled until you command otherwise.\n\
 This is used to cancel the effect of the \"disable\" command.\n\
@@ -6514,11 +6557,11 @@ With a subcommand you can enable temporarily.");
   add_com_alias ("en", "enable", class_breakpoint, 1);
 
   add_abbrev_prefix_cmd ("breakpoints", class_breakpoint, enable_command,
-                 "Enable some breakpoints.\n\
+                        "Enable some breakpoints.\n\
 Give breakpoint numbers (separated by spaces) as arguments.\n\
 This is used to cancel the effect of the \"disable\" command.\n\
 May be abbreviated to simply \"enable\".\n",
-                 &enablebreaklist, "enable breakpoints ", 1, &enablelist);
+                  &enablebreaklist, "enable breakpoints ", 1, &enablelist);
 
   add_cmd ("once", no_class, enable_once_command,
           "Enable breakpoints for one hit.  Give breakpoint numbers.\n\
@@ -6541,7 +6584,7 @@ If a breakpoint is hit while enabled in this fashion, it becomes disabled.",
           &enablelist);
 
   add_prefix_cmd ("disable", class_breakpoint, disable_command,
-          "Disable some breakpoints.\n\
+                 "Disable some breakpoints.\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To disable all breakpoints, give no argument.\n\
 A disabled breakpoint is not forgotten, but has no effect until reenabled.",
@@ -6549,8 +6592,8 @@ A disabled breakpoint is not forgotten, but has no effect until reenabled.",
   add_com_alias ("dis", "disable", class_breakpoint, 1);
   add_com_alias ("disa", "disable", class_breakpoint, 1);
   if (xdb_commands)
-    add_com("sb", class_breakpoint, disable_command,
-               "Disable some breakpoints.\n\
+    add_com ("sb", class_breakpoint, disable_command,
+            "Disable some breakpoints.\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To disable all breakpoints, give no argument.\n\
 A disabled breakpoint is not forgotten, but has no effect until reenabled.");
@@ -6564,7 +6607,7 @@ This command may be abbreviated \"disable\".",
           &disablelist);
 
   add_prefix_cmd ("delete", class_breakpoint, delete_command,
-          "Delete some breakpoints or auto-display expressions.\n\
+                 "Delete some breakpoints or auto-display expressions.\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To delete all breakpoints, give no argument.\n\
 \n\
@@ -6574,7 +6617,7 @@ The \"unset\" command is also an alias for \"delete\".",
   add_com_alias ("d", "delete", class_breakpoint, 1);
   if (xdb_commands)
     add_com ("db", class_breakpoint, delete_command,
-          "Delete some breakpoints.\n\
+            "Delete some breakpoints.\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To delete all breakpoints, give no argument.\n");
 
@@ -6591,7 +6634,7 @@ Argument may be line number, function name, or \"*\" and an address.\n\
 If line number is specified, all breakpoints in that line are cleared.\n\
 If function is specified, breakpoints at beginning of function are cleared.\n\
 If an address is specified, breakpoints at that address are cleared.\n\n",
-"With no argument, clears all breakpoints in the line that the selected frame\n\
+                  "With no argument, clears all breakpoints in the line that the selected frame\n\
 is executing in.\n\
 \n\
 See also the \"delete\" command which clears breakpoints by number.", NULL));
@@ -6602,7 +6645,7 @@ Argument may be line number, function name, or \"*\" and an address.\n\
 If line number is specified, break at start of code for that line.\n\
 If function is specified, break at start of code for that function.\n\
 If an address is specified, break at that exact address.\n",
-"With no arg, uses current execution address of selected stack frame.\n\
+                  "With no arg, uses current execution address of selected stack frame.\n\
 This is useful for breaking on return to a stack frame.\n\
 \n\
 Multiple breakpoints at one place are permitted, and useful if conditional.\n\
@@ -6613,13 +6656,13 @@ Do \"help breakpoints\" for info on other commands dealing with breakpoints.", N
   add_com_alias ("bre", "break", class_run, 1);
   add_com_alias ("brea", "break", class_run, 1);
 
-  add_com("xbreak", class_breakpoint, break_at_finish_command,
-          concat("Set breakpoint at procedure exit. \n\
+  add_com ("xbreak", class_breakpoint, break_at_finish_command,
+          concat ("Set breakpoint at procedure exit. \n\
 Argument may be function name, or \"*\" and an address.\n\
 If function is specified, break at end of code for that function.\n\
 If an address is specified, break at the end of the function that contains \n\
 that exact address.\n",
-"With no arg, uses current execution address of selected stack frame.\n\
+                  "With no arg, uses current execution address of selected stack frame.\n\
 This is useful for breaking on return to a stack frame.\n\
 \n\
 Multiple breakpoints at one place are permitted, and useful if conditional.\n\
@@ -6635,21 +6678,21 @@ Do \"help breakpoints\" for info on other commands dealing with breakpoints.", N
       add_com_alias ("ba", "break", class_breakpoint, 1);
       add_com_alias ("bu", "ubreak", class_breakpoint, 1);
       add_com ("bx", class_breakpoint, break_at_finish_at_depth_command,
-          "Set breakpoint at procedure exit.  Either there should\n\
+              "Set breakpoint at procedure exit.  Either there should\n\
 be no argument or the argument must be a depth.\n");
     }
 
   if (dbx_commands)
     {
-      add_abbrev_prefix_cmd("stop", class_breakpoint, stop_command, 
-           "Break in function/address or break at a line in the current file.",
-           &stoplist, "stop ", 1, &cmdlist);
-      add_cmd("in", class_breakpoint, stopin_command,
-              "Break in function or address.\n", &stoplist);
-      add_cmd("at", class_breakpoint, stopat_command,
-              "Break at a line in the current file.\n", &stoplist);
-      add_com("status", class_info, breakpoints_info, 
-           concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\
+      add_abbrev_prefix_cmd ("stop", class_breakpoint, stop_command,
+       "Break in function/address or break at a line in the current file.",
+                            &stoplist, "stop ", 1, &cmdlist);
+      add_cmd ("in", class_breakpoint, stopin_command,
+              "Break in function or address.\n", &stoplist);
+      add_cmd ("at", class_breakpoint, stopat_command,
+              "Break at a line in the current file.\n", &stoplist);
+      add_com ("status", class_info, breakpoints_info,
+              concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\
 The \"Type\" column indicates one of:\n\
 \tbreakpoint     - normal breakpoint\n\
 \twatchpoint     - watchpoint\n\
@@ -6657,7 +6700,7 @@ The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\
 the disposition of the breakpoint after it gets hit.  \"dis\" means that the\n\
 breakpoint will be disabled.  The \"Address\" and \"What\" columns indicate the\n\
 address and file/line number respectively.\n\n",
-"Convenience variable \"$_\" and default examine address for \"x\"\n\
+                      "Convenience variable \"$_\" and default examine address for \"x\"\n\
 are set to the address of the last breakpoint listed.\n\n\
 Convenience variable \"$bpnum\" contains the number of the last\n\
 breakpoint set.", NULL));
@@ -6672,14 +6715,14 @@ The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\
 the disposition of the breakpoint after it gets hit.  \"dis\" means that the\n\
 breakpoint will be disabled.  The \"Address\" and \"What\" columns indicate the\n\
 address and file/line number respectively.\n\n",
-"Convenience variable \"$_\" and default examine address for \"x\"\n\
+                   "Convenience variable \"$_\" and default examine address for \"x\"\n\
 are set to the address of the last breakpoint listed.\n\n\
 Convenience variable \"$bpnum\" contains the number of the last\n\
 breakpoint set.", NULL));
 
   if (xdb_commands)
-    add_com("lb", class_breakpoint, breakpoints_info,
-           concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\
+    add_com ("lb", class_breakpoint, breakpoints_info,
+            concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\
 The \"Type\" column indicates one of:\n\
 \tbreakpoint     - normal breakpoint\n\
 \twatchpoint     - watchpoint\n\
@@ -6687,13 +6730,13 @@ The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\
 the disposition of the breakpoint after it gets hit.  \"dis\" means that the\n\
 breakpoint will be disabled.  The \"Address\" and \"What\" columns indicate the\n\
 address and file/line number respectively.\n\n",
-"Convenience variable \"$_\" and default examine address for \"x\"\n\
+                    "Convenience variable \"$_\" and default examine address for \"x\"\n\
 are set to the address of the last breakpoint listed.\n\n\
 Convenience variable \"$bpnum\" contains the number of the last\n\
 breakpoint set.", NULL));
 
   add_cmd ("breakpoints", class_maintenance, maintenance_info_breakpoints,
-           concat ("Status of all breakpoints, or breakpoint number NUMBER.\n\
+          concat ("Status of all breakpoints, or breakpoint number NUMBER.\n\
 The \"Type\" column indicates one of:\n\
 \tbreakpoint     - normal breakpoint\n\
 \twatchpoint     - watchpoint\n\
@@ -6701,18 +6744,18 @@ The \"Type\" column indicates one of:\n\
 \tlongjmp resume - internal breakpoint at the target of longjmp()\n\
 \tuntil          - internal breakpoint used by the \"until\" command\n\
 \tfinish         - internal breakpoint used by the \"finish\" command\n",
-"The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\
+                  "The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\
 the disposition of the breakpoint after it gets hit.  \"dis\" means that the\n\
 breakpoint will be disabled.  The \"Address\" and \"What\" columns indicate the\n\
 address and file/line number respectively.\n\n",
-"Convenience variable \"$_\" and default examine address for \"x\"\n\
+                  "Convenience variable \"$_\" and default examine address for \"x\"\n\
 are set to the address of the last breakpoint listed.\n\n\
 Convenience variable \"$bpnum\" contains the number of the last\n\
 breakpoint set.", NULL),
           &maintenanceinfolist);
 
   add_com ("catch", class_breakpoint, catch_command,
-         "Set catchpoints to catch events.\n\
+          "Set catchpoints to catch events.\n\
 Raised signals may be caught:\n\
 \tcatch signal              - all signals\n\
 \tcatch signal <signame>    - a particular signal\n\
@@ -6745,15 +6788,15 @@ C++ exceptions may be caught:\n\
 Do \"help set follow-fork-mode\" for info on debugging your program\n\
 after a fork or vfork is caught.\n\n\
 Do \"help breakpoints\" for info on other commands dealing with breakpoints.");
+
   add_com ("tcatch", class_breakpoint, tcatch_command,
-         "Set temporary catchpoints to catch events.\n\
+          "Set temporary catchpoints to catch events.\n\
 Args like \"catch\" command.\n\
 Like \"catch\" except the catchpoint is only temporary,\n\
 so it will be deleted when hit.  Equivalent to \"catch\" followed\n\
 by using \"enable delete\" on the catchpoint number.");
-add_com ("watch", class_breakpoint, watch_command,
+
+  add_com ("watch", class_breakpoint, watch_command,
 
           "Set a watchpoint for an expression.\n\
 A watchpoint stops execution of your program whenever the value of\n\
@@ -6774,13 +6817,13 @@ an expression is either read or written.");
 
 
   c = add_set_cmd ("can-use-hw-watchpoints", class_support, var_zinteger,
-                   (char *) &can_use_hw_watchpoints,
-                   "Set debugger's willingness to use watchpoint hardware.\n\
+                  (char *) &can_use_hw_watchpoints,
+                  "Set debugger's willingness to use watchpoint hardware.\n\
 If zero, gdb will not use hardware for new watchpoints, even if\n\
 such is available.  (However, any hardware watchpoints that were\n\
 created before setting this to nonzero, will continue to use watchpoint\n\
 hardware.)",
-               &setlist);
+                  &setlist);
   add_show_from_set (c, &showlist);
 
   can_use_hw_watchpoints = 1;
index 8eec1f5759ee8b42585cb52bed4e19db2b855e96..8061e86feb1ed13502d46d2fff9e3f750db584d8 100644 (file)
@@ -1,21 +1,22 @@
 /* Data structures associated with breakpoints in GDB.
    Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (BREAKPOINT_H)
 #define BREAKPOINT_H 1
@@ -34,33 +35,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    here.  This includes:
 
    * single-step (for machines where we have to simulate single stepping)
-      (probably, though perhaps it is better for it to look as much as
-      possible like a single-step to wait_for_inferior).  */
-
-enum bptype {
-  bp_none = 0,                  /* Eventpoint has been deleted. */
-  bp_breakpoint,               /* Normal breakpoint */
-  bp_hardware_breakpoint,      /* Hardware assisted breakpoint */
-  bp_until,                    /* used by until command */
-  bp_finish,                   /* used by finish command */
-  bp_watchpoint,               /* Watchpoint */
-  bp_hardware_watchpoint,      /* Hardware assisted watchpoint */
-  bp_read_watchpoint,          /* read watchpoint, (hardware assisted) */
-  bp_access_watchpoint,                /* access watchpoint, (hardware assisted) */
-  bp_longjmp,                  /* secret breakpoint to find longjmp() */
-  bp_longjmp_resume,           /* secret breakpoint to escape longjmp() */
-
-  /* Used by wait_for_inferior for stepping over subroutine calls, for
-     stepping over signal handlers, and for skipping prologues.  */
-  bp_step_resume,
-
-  /* Used by wait_for_inferior for stepping over signal handlers.  */
-  bp_through_sigtramp,
-
-  /* Used to detect when a watchpoint expression has gone out of
-     scope.  These breakpoints are usually not visible to the user.
-
-     This breakpoint has some interesting properties:
+   (probably, though perhaps it is better for it to look as much as
+   possible like a single-step to wait_for_inferior).  */
+
+enum bptype
+  {
+    bp_none = 0,               /* Eventpoint has been deleted. */
+    bp_breakpoint,             /* Normal breakpoint */
+    bp_hardware_breakpoint,    /* Hardware assisted breakpoint */
+    bp_until,                  /* used by until command */
+    bp_finish,                 /* used by finish command */
+    bp_watchpoint,             /* Watchpoint */
+    bp_hardware_watchpoint,    /* Hardware assisted watchpoint */
+    bp_read_watchpoint,                /* read watchpoint, (hardware assisted) */
+    bp_access_watchpoint,      /* access watchpoint, (hardware assisted) */
+    bp_longjmp,                        /* secret breakpoint to find longjmp() */
+    bp_longjmp_resume,         /* secret breakpoint to escape longjmp() */
+
+    /* Used by wait_for_inferior for stepping over subroutine calls, for
+       stepping over signal handlers, and for skipping prologues.  */
+    bp_step_resume,
+
+    /* Used by wait_for_inferior for stepping over signal handlers.  */
+    bp_through_sigtramp,
+
+    /* Used to detect when a watchpoint expression has gone out of
+       scope.  These breakpoints are usually not visible to the user.
+
+       This breakpoint has some interesting properties:
 
        1) There's always a 1:1 mapping between watchpoints
        on local variables and watchpoint_scope breakpoints.
@@ -69,78 +71,80 @@ enum bptype {
        associated with when hit.
 
        3) It can never be disabled.  */
-  bp_watchpoint_scope,
-
-  /* The breakpoint at the end of a call dummy.  */
-  /* FIXME: What if the function we are calling longjmp()s out of the
-     call, or the user gets out with the "return" command?  We currently
-     have no way of cleaning up the breakpoint in these (obscure) situations.
-     (Probably can solve this by noticing longjmp, "return", etc., it's
-     similar to noticing when a watchpoint on a local variable goes out
-     of scope (with hardware support for watchpoints)).  */
-  bp_call_dummy,
-
-  /* Some dynamic linkers (HP, maybe Solaris) can arrange for special
-     code in the inferior to run when significant events occur in the
-     dynamic linker (for example a library is loaded or unloaded).
-
-     By placing a breakpoint in this magic code GDB will get control
-     when these significant events occur.  GDB can then re-examine
-     the dynamic linker's data structures to discover any newly loaded
-     dynamic libraries.  */
-  bp_shlib_event,
-  /* These breakpoints are used to implement the "catch load" command
-     on platforms whose dynamic linkers support such functionality.  */
-  bp_catch_load,
-  /* These breakpoints are used to implement the "catch unload" command
-     on platforms whose dynamic linkers support such functionality.  */
-  bp_catch_unload,
-  /* These are not really breakpoints, but are catchpoints that
-     implement the "catch fork", "catch vfork" and "catch exec" commands
-     on platforms whose kernel support such functionality.  (I.e.,
-     kernels which can raise an event when a fork or exec occurs, as
-     opposed to the debugger setting breakpoints on functions named
-     "fork" or "exec".) */
-  bp_catch_fork,
-  bp_catch_vfork,
-  bp_catch_exec,
-
-  /* These are catchpoints to implement "catch catch" and "catch throw"
-     commands for C++ exception handling. */
-  bp_catch_catch,
-  bp_catch_throw
-
-};
+    bp_watchpoint_scope,
+
+    /* The breakpoint at the end of a call dummy.  */
+    /* FIXME: What if the function we are calling longjmp()s out of the
+       call, or the user gets out with the "return" command?  We currently
+       have no way of cleaning up the breakpoint in these (obscure) situations.
+       (Probably can solve this by noticing longjmp, "return", etc., it's
+       similar to noticing when a watchpoint on a local variable goes out
+       of scope (with hardware support for watchpoints)).  */
+    bp_call_dummy,
+
+    /* Some dynamic linkers (HP, maybe Solaris) can arrange for special
+       code in the inferior to run when significant events occur in the
+       dynamic linker (for example a library is loaded or unloaded).
+
+       By placing a breakpoint in this magic code GDB will get control
+       when these significant events occur.  GDB can then re-examine
+       the dynamic linker's data structures to discover any newly loaded
+       dynamic libraries.  */
+    bp_shlib_event,
+
+    /* These breakpoints are used to implement the "catch load" command
+       on platforms whose dynamic linkers support such functionality.  */
+    bp_catch_load,
+
+    /* These breakpoints are used to implement the "catch unload" command
+       on platforms whose dynamic linkers support such functionality.  */
+    bp_catch_unload,
+
+    /* These are not really breakpoints, but are catchpoints that
+       implement the "catch fork", "catch vfork" and "catch exec" commands
+       on platforms whose kernel support such functionality.  (I.e.,
+       kernels which can raise an event when a fork or exec occurs, as
+       opposed to the debugger setting breakpoints on functions named
+       "fork" or "exec".) */
+    bp_catch_fork,
+    bp_catch_vfork,
+    bp_catch_exec,
+
+    /* These are catchpoints to implement "catch catch" and "catch throw"
+       commands for C++ exception handling. */
+    bp_catch_catch,
+    bp_catch_throw
+
+
+  };
 
 /* States of enablement of breakpoint. */
 
-enum enable { 
-  disabled,           /* The eventpoint is inactive, and cannot trigger. */
-  enabled,            /* The eventpoint is active, and can trigger. */
-  shlib_disabled,     /* The eventpoint's address is within an unloaded solib.
-                         The eventpoint will be automatically enabled & reset
-                         when that solib is loaded. */
-  call_disabled       /* The eventpoint has been disabled while a call into
-                         the inferior is "in flight", because some eventpoints
-                         interfere with the implementation of a call on some
-                         targets.  The eventpoint will be automatically enabled
-                         & reset when the call "lands" (either completes, or
-                         stops at another eventpoint). */
-};
+enum enable
+  {
+    disabled,                  /* The eventpoint is inactive, and cannot trigger. */
+    enabled,                   /* The eventpoint is active, and can trigger. */
+    shlib_disabled,            /* The eventpoint's address is within an unloaded solib.
+                                  The eventpoint will be automatically enabled & reset
+                                  when that solib is loaded. */
+    call_disabled              /* The eventpoint has been disabled while a call into
+                                  the inferior is "in flight", because some eventpoints
+                                  interfere with the implementation of a call on some
+                                  targets.  The eventpoint will be automatically enabled
+                                  & reset when the call "lands" (either completes, or
+                                  stops at another eventpoint). */
+  };
 
 
 /* Disposition of breakpoint.  Ie: what to do after hitting it. */
 
-enum bpdisp {
-  del,                         /* Delete it */
-  del_at_next_stop,            /* Delete at next stop, whether hit or not */
-  disable,                     /* Disable it */
-  donttouch                    /* Leave it alone */
-};
+enum bpdisp
+  {
+    del,                       /* Delete it */
+    del_at_next_stop,          /* Delete at next stop, whether hit or not */
+    disable,                   /* Disable it */
+    donttouch                  /* Leave it alone */
+  };
 
 /* Note that the ->silent field is not currently used by any commands
    (though the code is in there if it was to be, and set_raw_breakpoint
@@ -151,118 +155,118 @@ enum bpdisp {
 /* This is for a breakpoint or a watchpoint.  */
 
 struct breakpoint
-{
-  struct breakpoint *next;
-  /* Type of breakpoint. */
-  enum bptype type;
-  /* Zero means disabled; remember the info but don't break here.  */
-  enum enable enable;
-  /* What to do with this breakpoint after we hit it. */
-  enum bpdisp disposition;
-  /* Number assigned to distinguish breakpoints.  */
-  int number;
-
-  /* Address to break at, or NULL if not a breakpoint.  */
-  CORE_ADDR address;
-
-  /* Line number of this address.  Only matters if address is
-     non-NULL.  */
-
-  int line_number;
-
-  /* Source file name of this address.  Only matters if address is
-     non-NULL.  */
-
-  char *source_file;
-
-  /* Non-zero means a silent breakpoint (don't print frame info
-     if we stop here). */
-  unsigned char silent;
-  /* Number of stops at this breakpoint that should
-     be continued automatically before really stopping.  */
-  int ignore_count;
-  /* "Real" contents of byte where breakpoint has been inserted.
-     Valid only when breakpoints are in the program.  Under the complete
-     control of the target insert_breakpoint and remove_breakpoint routines.
-     No other code should assume anything about the value(s) here.  */
-  char shadow_contents[BREAKPOINT_MAX];
-  /* Nonzero if this breakpoint is now inserted.  Only matters if address
-     is non-NULL.  */
-  char inserted;
-  /* Nonzero if this is not the first breakpoint in the list
-     for the given address.  Only matters if address is non-NULL.  */
-  char duplicate;
-  /* Chain of command lines to execute when this breakpoint is hit.  */
-  struct command_line *commands;
-  /* Stack depth (address of frame).  If nonzero, break only if fp
-     equals this.  */
-  CORE_ADDR frame;
-  /* Conditional.  Break only if this expression's value is nonzero.  */
-  struct expression *cond;
-
-  /* String we used to set the breakpoint (malloc'd).  Only matters if
-     address is non-NULL.  */
-  char *addr_string;
-  /* Language we used to set the breakpoint.  */
-  enum language language;
-  /* Input radix we used to set the breakpoint.  */
-  int input_radix;
-  /* String form of the breakpoint condition (malloc'd), or NULL if there
-     is no condition.  */
-  char *cond_string;
-  /* String form of exp (malloc'd), or NULL if none.  */
-  char *exp_string;
-
-  /* The expression we are watching, or NULL if not a watchpoint.  */
-  struct expression *exp;
-  /* The largest block within which it is valid, or NULL if it is
-     valid anywhere (e.g. consists just of global symbols).  */
-  struct block *exp_valid_block;
-  /* Value of the watchpoint the last time we checked it.  */
-  value_ptr val;
-
-  /* Holds the value chain for a hardware watchpoint expression.  */
-  value_ptr val_chain;
-
-  /* Holds the address of the related watchpoint_scope breakpoint
-     when using watchpoints on local variables (might the concept
-     of a related breakpoint be useful elsewhere, if not just call
-     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;
-
-  /* Thread number for thread-specific breakpoint, or -1 if don't care */
-  int thread;
-
-  /* Count of the number of times this breakpoint was taken, dumped
-     with the info, but not used for anything else.  Useful for
-     seeing how many times you hit a break prior to the program
-     aborting, so you can back up to just before the abort.  */
-  int hit_count;
-
-  /* Filename of a dynamically-linked library (dll), used for bp_catch_load
-     and bp_catch_unload (malloc'd), or NULL if any library is significant.  */
-  char *  dll_pathname;
-  /* Filename of a dll whose state change (e.g., load or unload)
-     triggered this catchpoint.  This field is only vaid immediately
-     after this catchpoint has triggered.  */
-  char *  triggered_dll_pathname;
-  /* Process id of a child process whose forking triggered this catchpoint.
-     This field is only vaid immediately after this catchpoint has triggered.  */
-  int  forked_inferior_pid;
-  /* Filename of a program whose exec triggered this catchpoint.  This
-     field is only vaid immediately after this catchpoint has triggered.  */
-  char *  exec_pathname;
-  
-  asection *section;
-};
+  {
+    struct breakpoint *next;
+    /* Type of breakpoint. */
+    enum bptype type;
+    /* Zero means disabled; remember the info but don't break here.  */
+    enum enable enable;
+    /* What to do with this breakpoint after we hit it. */
+    enum bpdisp disposition;
+    /* Number assigned to distinguish breakpoints.  */
+    int number;
+
+    /* Address to break at, or NULL if not a breakpoint.  */
+    CORE_ADDR address;
+
+    /* Line number of this address.  Only matters if address is
+       non-NULL.  */
+
+    int line_number;
+
+    /* Source file name of this address.  Only matters if address is
+       non-NULL.  */
+
+    char *source_file;
+
+    /* Non-zero means a silent breakpoint (don't print frame info
+       if we stop here). */
+    unsigned char silent;
+    /* Number of stops at this breakpoint that should
+       be continued automatically before really stopping.  */
+    int ignore_count;
+    /* "Real" contents of byte where breakpoint has been inserted.
+       Valid only when breakpoints are in the program.  Under the complete
+       control of the target insert_breakpoint and remove_breakpoint routines.
+       No other code should assume anything about the value(s) here.  */
+    char shadow_contents[BREAKPOINT_MAX];
+    /* Nonzero if this breakpoint is now inserted.  Only matters if address
+       is non-NULL.  */
+    char inserted;
+    /* Nonzero if this is not the first breakpoint in the list
+       for the given address.  Only matters if address is non-NULL.  */
+    char duplicate;
+    /* Chain of command lines to execute when this breakpoint is hit.  */
+    struct command_line *commands;
+    /* Stack depth (address of frame).  If nonzero, break only if fp
+       equals this.  */
+    CORE_ADDR frame;
+    /* Conditional.  Break only if this expression's value is nonzero.  */
+    struct expression *cond;
+
+    /* String we used to set the breakpoint (malloc'd).  Only matters if
+       address is non-NULL.  */
+    char *addr_string;
+    /* Language we used to set the breakpoint.  */
+    enum language language;
+    /* Input radix we used to set the breakpoint.  */
+    int input_radix;
+    /* String form of the breakpoint condition (malloc'd), or NULL if there
+       is no condition.  */
+    char *cond_string;
+    /* String form of exp (malloc'd), or NULL if none.  */
+    char *exp_string;
+
+    /* The expression we are watching, or NULL if not a watchpoint.  */
+    struct expression *exp;
+    /* The largest block within which it is valid, or NULL if it is
+       valid anywhere (e.g. consists just of global symbols).  */
+    struct block *exp_valid_block;
+    /* Value of the watchpoint the last time we checked it.  */
+    value_ptr val;
+
+    /* Holds the value chain for a hardware watchpoint expression.  */
+    value_ptr val_chain;
+
+    /* Holds the address of the related watchpoint_scope breakpoint
+       when using watchpoints on local variables (might the concept
+       of a related breakpoint be useful elsewhere, if not just call
+       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;
+
+    /* Thread number for thread-specific breakpoint, or -1 if don't care */
+    int thread;
+
+    /* Count of the number of times this breakpoint was taken, dumped
+       with the info, but not used for anything else.  Useful for
+       seeing how many times you hit a break prior to the program
+       aborting, so you can back up to just before the abort.  */
+    int hit_count;
+
+    /* Filename of a dynamically-linked library (dll), used for bp_catch_load
+       and bp_catch_unload (malloc'd), or NULL if any library is significant.  */
+    char *dll_pathname;
+
+    /* Filename of a dll whose state change (e.g., load or unload)
+       triggered this catchpoint.  This field is only vaid immediately
+       after this catchpoint has triggered.  */
+    char *triggered_dll_pathname;
+
+    /* Process id of a child process whose forking triggered this catchpoint.
+       This field is only vaid immediately after this catchpoint has triggered.  */
+    int forked_inferior_pid;
+
+    /* Filename of a program whose exec triggered this catchpoint.  This
+       field is only vaid immediately after this catchpoint has triggered.  */
+    char *exec_pathname;
+
+    asection *section;
+  };
 \f
 /* The following stuff is an abstract data type "bpstat" ("breakpoint status").
    This provides the ability to determine whether we have stopped at a
@@ -284,71 +288,73 @@ extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, int));
 /* This bpstat_what stuff tells wait_for_inferior what to do with a
    breakpoint (a challenging task).  */
 
-enum bpstat_what_main_action {
-  /* Perform various other tests; that is, this bpstat does not
-     say to perform any action (e.g. failed watchpoint and nothing
-     else).  */
-  BPSTAT_WHAT_KEEP_CHECKING,
-
-  /* Rather than distinguish between noisy and silent stops here, it
-     might be cleaner to have bpstat_print make that decision (also
-     taking into account stop_print_frame and source_only).  But the
-     implications are a bit scary (interaction with auto-displays, etc.),
-     so I won't try it.  */
-     
-  /* Stop silently.  */
-  BPSTAT_WHAT_STOP_SILENT,
-
-  /* Stop and print.  */
-  BPSTAT_WHAT_STOP_NOISY,
-
-  /* Remove breakpoints, single step once, then put them back in and
-     go back to what we were doing.  It's possible that this should be
-     removed from the main_action and put into a separate field, to more
-     cleanly handle BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE.  */
-  BPSTAT_WHAT_SINGLE,
-
-  /* Set longjmp_resume breakpoint, remove all other breakpoints,
-     and continue.  The "remove all other breakpoints" part is required
-     if we are also stepping over another breakpoint as well as doing
-     the longjmp handling.  */
-  BPSTAT_WHAT_SET_LONGJMP_RESUME,
-
-  /* Clear longjmp_resume breakpoint, then handle as
-     BPSTAT_WHAT_KEEP_CHECKING.  */
-  BPSTAT_WHAT_CLEAR_LONGJMP_RESUME,
-
-  /* Clear longjmp_resume breakpoint, then handle as BPSTAT_WHAT_SINGLE.  */
-  BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE,
-
-  /* Clear step resume breakpoint, and keep checking.  */
-  BPSTAT_WHAT_STEP_RESUME,
-
-  /* Clear through_sigtramp breakpoint, muck with trap_expected, and keep
-     checking.  */
-  BPSTAT_WHAT_THROUGH_SIGTRAMP,
-
-  /* Check the dynamic linker's data structures for new libraries, then
-     keep checking.  */
-  BPSTAT_WHAT_CHECK_SHLIBS,
-
-  /* Check the dynamic linker's data structures for new libraries, then
-     resume out of the dynamic linker's callback, stop and print.  */
-  BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK,
-
-  /* This is just used to keep track of how many enums there are.  */
-  BPSTAT_WHAT_LAST
-};
-
-struct bpstat_what {
-  enum bpstat_what_main_action main_action;
-
-  /* Did we hit a call dummy breakpoint?  This only goes with a main_action
-     of BPSTAT_WHAT_STOP_SILENT or BPSTAT_WHAT_STOP_NOISY (the concept of
-     continuing from a call dummy without popping the frame is not a
-     useful one).  */
-  int call_dummy;
-};
+enum bpstat_what_main_action
+  {
+    /* Perform various other tests; that is, this bpstat does not
+       say to perform any action (e.g. failed watchpoint and nothing
+       else).  */
+    BPSTAT_WHAT_KEEP_CHECKING,
+
+    /* Rather than distinguish between noisy and silent stops here, it
+       might be cleaner to have bpstat_print make that decision (also
+       taking into account stop_print_frame and source_only).  But the
+       implications are a bit scary (interaction with auto-displays, etc.),
+       so I won't try it.  */
+
+    /* Stop silently.  */
+    BPSTAT_WHAT_STOP_SILENT,
+
+    /* Stop and print.  */
+    BPSTAT_WHAT_STOP_NOISY,
+
+    /* Remove breakpoints, single step once, then put them back in and
+       go back to what we were doing.  It's possible that this should be
+       removed from the main_action and put into a separate field, to more
+       cleanly handle BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE.  */
+    BPSTAT_WHAT_SINGLE,
+
+    /* Set longjmp_resume breakpoint, remove all other breakpoints,
+       and continue.  The "remove all other breakpoints" part is required
+       if we are also stepping over another breakpoint as well as doing
+       the longjmp handling.  */
+    BPSTAT_WHAT_SET_LONGJMP_RESUME,
+
+    /* Clear longjmp_resume breakpoint, then handle as
+       BPSTAT_WHAT_KEEP_CHECKING.  */
+    BPSTAT_WHAT_CLEAR_LONGJMP_RESUME,
+
+    /* Clear longjmp_resume breakpoint, then handle as BPSTAT_WHAT_SINGLE.  */
+    BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE,
+
+    /* Clear step resume breakpoint, and keep checking.  */
+    BPSTAT_WHAT_STEP_RESUME,
+
+    /* Clear through_sigtramp breakpoint, muck with trap_expected, and keep
+       checking.  */
+    BPSTAT_WHAT_THROUGH_SIGTRAMP,
+
+    /* Check the dynamic linker's data structures for new libraries, then
+       keep checking.  */
+    BPSTAT_WHAT_CHECK_SHLIBS,
+
+    /* Check the dynamic linker's data structures for new libraries, then
+       resume out of the dynamic linker's callback, stop and print.  */
+    BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK,
+
+    /* This is just used to keep track of how many enums there are.  */
+    BPSTAT_WHAT_LAST
+  };
+
+struct bpstat_what
+  {
+    enum bpstat_what_main_action main_action;
+
+    /* Did we hit a call dummy breakpoint?  This only goes with a main_action
+       of BPSTAT_WHAT_STOP_SILENT or BPSTAT_WHAT_STOP_NOISY (the concept of
+       continuing from a call dummy without popping the frame is not a
+       useful one).  */
+    int call_dummy;
+  };
 
 /* Tell what to do about this bpstat.  */
 struct bpstat_what bpstat_what PARAMS ((bpstat));
@@ -364,9 +370,9 @@ bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *));
    step_resume breakpoint.
 
    See wait_for_inferior's use of this function.
  */
+ */
 extern struct breakpoint *
-bpstat_find_step_resume_breakpoint PARAMS ((bpstat));
+  bpstat_find_step_resume_breakpoint PARAMS ((bpstat));
 
 /* Nonzero if a signal that we got in wait() was due to circumstances
    explained by the BS.  */
@@ -405,45 +411,45 @@ extern void bpstat_clear_actions PARAMS ((bpstat));
 /* Given a bpstat that records zero or more triggered eventpoints, this
    function returns another bpstat which contains only the catchpoints
    on that first list, if any.
  */
+ */
 extern void bpstat_get_triggered_catchpoints PARAMS ((bpstat, bpstat *));
+
 /* Implementation:  */
 struct bpstats
-{
-  /* Linked list because there can be two breakpoints at the
-     same place, and a bpstat reflects the fact that both have been hit.  */
-  bpstat next;
-  /* Breakpoint that we are at.  */
-  struct breakpoint *breakpoint_at;
-  /* Commands left to be done.  */
-  struct command_line *commands;
-  /* Old value associated with a watchpoint.  */
-  value_ptr old_val;
-
-  /* Nonzero if this breakpoint tells us to print the frame.  */
-  char print;
-
-  /* Nonzero if this breakpoint tells us to stop.  */
-  char stop;
-
-  /* Function called by bpstat_print to print stuff associated with
-     this element of the bpstat chain.  Returns 0 or 1 just like
-     bpstat_print, or -1 if it can't deal with it.  */
-  int (*print_it) PARAMS((bpstat bs));
-};
+  {
+    /* Linked list because there can be two breakpoints at the
+       same place, and a bpstat reflects the fact that both have been hit.  */
+    bpstat next;
+    /* Breakpoint that we are at.  */
+    struct breakpoint *breakpoint_at;
+    /* Commands left to be done.  */
+    struct command_line *commands;
+    /* Old value associated with a watchpoint.  */
+    value_ptr old_val;
+
+    /* Nonzero if this breakpoint tells us to print the frame.  */
+    char print;
+
+    /* Nonzero if this breakpoint tells us to stop.  */
+    char stop;
+
+    /* Function called by bpstat_print to print stuff associated with
+       this element of the bpstat chain.  Returns 0 or 1 just like
+       bpstat_print, or -1 if it can't deal with it.  */
+    int (*print_it) PARAMS ((bpstat bs));
+  };
 
 enum inf_context
-{
-  inf_starting,
-  inf_running,
-  inf_exited
-};
-
+  {
+    inf_starting,
+    inf_running,
+    inf_exited
+  };
 \f
+
 /* Prototypes for breakpoint-related functions.  */
 
-#ifdef __STDC__                /* Forward declarations for prototypes */
+#ifdef __STDC__                        /* Forward declarations for prototypes */
 struct frame_info;
 #endif
 
@@ -500,16 +506,16 @@ extern int reattach_breakpoints PARAMS ((int));
 
    This function causes the following:
 
-     - All eventpoints are marked "not inserted".
-     - All eventpoints with a symbolic address are reset such that
-       the symbolic address must be reevaluated before the eventpoints
-       can be reinserted.
-     - The solib breakpoints are explicitly removed from the breakpoint
-       list.
-     - A step-resume breakpoint, if any, is explicitly removed from the
-       breakpoint list.
-     - All eventpoints without a symbolic address are removed from the
-       breakpoint list. */
+   - All eventpoints are marked "not inserted".
+   - All eventpoints with a symbolic address are reset such that
+   the symbolic address must be reevaluated before the eventpoints
+   can be reinserted.
+   - The solib breakpoints are explicitly removed from the breakpoint
+   list.
+   - A step-resume breakpoint, if any, is explicitly removed from the
+   breakpoint list.
+   - All eventpoints without a symbolic address are removed from the
+   breakpoint list. */
 extern void update_breakpoints_after_exec PARAMS ((void));
 
 /* This function can be used to physically remove hardware breakpoints
@@ -518,11 +524,11 @@ extern void update_breakpoints_after_exec PARAMS ((void));
    those targets which support following the processes of a fork() or
    vfork() system call, when one of the resulting two processes is to
    be detached and allowed to run free.
+
    It is an error to use this function on the process whose id is
    inferior_pid.  */
 extern int detach_breakpoints PARAMS ((int));
+
 extern void enable_longjmp_breakpoint PARAMS ((void));
 
 extern void disable_longjmp_breakpoint PARAMS ((void));
@@ -556,7 +562,7 @@ disable_watchpoints_before_interactive_call_start PARAMS ((void));
 extern void
 enable_watchpoints_after_interactive_call_stop PARAMS ((void));
 
+
 extern void clear_breakpoint_hit_counts PARAMS ((void));
 
 /* The following are for displays, which aren't really breakpoints, but
@@ -583,23 +589,23 @@ extern void disable_breakpoints_in_shlibs PARAMS ((int silent));
 extern void re_enable_breakpoints_in_shlibs PARAMS ((void));
 
 extern void create_solib_load_event_breakpoint PARAMS ((char *, int, char *, char *));
+
 extern void create_solib_unload_event_breakpoint PARAMS ((char *, int, char *, char *));
+
 extern void create_fork_event_catchpoint PARAMS ((int, char *));
+
 extern void create_vfork_event_catchpoint PARAMS ((int, char *));
 
 extern void create_exec_event_catchpoint PARAMS ((int, char *));
+
 /* This function returns TRUE if ep is a catchpoint. */
 extern int ep_is_catchpoint PARAMS ((struct breakpoint *));
+
 /* This function returns TRUE if ep is a catchpoint of a
    shared library (aka dynamically-linked library) event,
    such as a library load or unload. */
 extern int ep_is_shlib_catchpoint PARAMS ((struct breakpoint *));
+
 extern struct breakpoint *set_breakpoint_sal PARAMS ((struct symtab_and_line));
 
 #endif /* !defined (BREAKPOINT_H) */
index 24b64bead2e055eb27d4a026961aef3f1b2c5963..860f4aaa075704a43ee5829e9139364b3daf2a99 100644 (file)
@@ -1,21 +1,22 @@
 /* Support routines for building symbol tables in GDB's internal format.
    Copyright 1986-1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module provides subroutines used for creating and adding to
    the symbol table.  These routines are called from various symbol-
@@ -35,7 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdb_string.h"
 
 /* Ask buildsym.h to define the vars it normally declares `extern'.  */
-#define        EXTERN                  /**/
+#define        EXTERN
+/**/
 #include "buildsym.h"          /* Our own declarations */
 #undef EXTERN
 
@@ -220,7 +222,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
     }
 
   block = (struct block *) obstack_alloc (&objfile->symbol_obstack,
-    (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
+           (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
 
   /* Copy the symbols into the block.  */
 
@@ -382,7 +384,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
              else
                {
                  complain (&innerblock_anon_complaint, BLOCK_START (pblock->block),
-                    BLOCK_END (pblock->block), BLOCK_START (block),
+                           BLOCK_END (pblock->block), BLOCK_START (block),
                            BLOCK_END (block));
                }
              if (BLOCK_START (pblock->block) < BLOCK_START (block))
@@ -569,7 +571,7 @@ start_subfile (char *name, char *dirname)
      program.  But to demangle we need to set the language to C++.  We
      can distinguish cfront code by the fact that it has #line
      directives which specify a file name ending in .C.
-  
+
      So if the filename of this subfile ends in .C, then change the
      language of any pending subfiles from C to C++.  We also accept
      any other C++ suffixes accepted by deduce_language_from_filename
@@ -695,7 +697,7 @@ record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
       subfile->line_vector_length = INITIAL_LINE_VECTOR_LENGTH;
       subfile->line_vector = (struct linetable *)
        xmalloc (sizeof (struct linetable)
-                + subfile->line_vector_length * sizeof (struct linetable_entry));
+          + subfile->line_vector_length * sizeof (struct linetable_entry));
       subfile->line_vector->nitems = 0;
       have_line_numbers = 1;
     }
@@ -855,7 +857,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
   /* Cleanup any undefined types that have been left hanging around
      (this needs to be done before the finish_blocks so that
      file_symbols is still good).
-  
+
      Both cleanup_undefined_types and finish_global_stabs are stabs
      specific, but harmless for other symbol readers, since on gdb
      startup or when finished reading stabs, the state is set so these
@@ -921,7 +923,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
              if (objfile->flags & OBJF_REORDERED)
                qsort (subfile->line_vector->item,
                       subfile->line_vector->nitems,
-                      sizeof (struct linetable_entry), compare_line_numbers);
+                    sizeof (struct linetable_entry), compare_line_numbers);
            }
 
          /* Now, allocate a symbol table.  */
@@ -968,8 +970,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
          if (subfile->debugformat != NULL)
            {
              symtab->debugformat = obsavestring (subfile->debugformat,
-                                     strlen (subfile->debugformat),
-                                         &objfile->symbol_obstack);
+                                             strlen (subfile->debugformat),
+                                                 &objfile->symbol_obstack);
            }
 
          /* All symtabs for the main file and the subfiles share a
@@ -1025,7 +1027,7 @@ push_context (int desc, CORE_ADDR valu)
       context_stack_size *= 2;
       context_stack = (struct context_stack *)
        xrealloc ((char *) context_stack,
-             (context_stack_size * sizeof (struct context_stack)));
+                 (context_stack_size * sizeof (struct context_stack)));
     }
 
   new = &context_stack[context_stack_depth++];
index e3a34c9d0805b09277aba7290bd4729ddda62743..f16ffc57748b1742e3b61df3eedc11a177dc89da 100644 (file)
@@ -1,21 +1,22 @@
 /* Build symbol tables in GDB's internal format.
    Copyright 1986-1993, 1996-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.  */
+   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 (BUILDSYM_H)
 #define BUILDSYM_H 1
index efed49dbdf8f9fc73fc4b86626795606c79aa108..308f8d46c6bc1cfe1349a07e577fc2c141bac9d8 100644 (file)
@@ -1,21 +1,22 @@
 /* C language support routines for GDB, the GNU debugger.
    Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -26,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "c-lang.h"
 
 extern void _initialize_c_language PARAMS ((void));
-static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+static void c_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
 
 /* Print the character C on STREAM as part of the contents of a literal
    string whose delimiter is QUOTER.  Note that that format for printing
@@ -117,7 +118,7 @@ c_printstr (stream, string, length, width, force_ellipses)
      style.  */
   if (!force_ellipses
       && length > 0
-      && extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
+  && extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
     length--;
 
   if (length == 0)
@@ -129,7 +130,7 @@ c_printstr (stream, string, length, width, force_ellipses)
   for (i = 0; i < length && things_printed < print_max; ++i)
     {
       /* 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;
@@ -149,7 +150,7 @@ c_printstr (stream, string, length, width, force_ellipses)
       reps = 1;
       while (rep1 < length
             && extract_unsigned_integer (string + rep1 * width, width)
-               == current_char)
+            == current_char)
        {
          ++rep1;
          ++reps;
@@ -231,191 +232,192 @@ c_create_fundamental_type (objfile, typeid)
 
   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 C/C++ 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_BOOLEAN:
-        type = init_type (TYPE_CODE_BOOL,
-                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                          0, "bool", objfile);
-                          
-        break;
-      case FT_CHAR:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                         0, "char", objfile);
-        TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
-       break;
-      case FT_SIGNED_CHAR:
-       type = init_type (TYPE_CODE_INT,
-                         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", objfile);
-       break;
-      case FT_SIGNED_SHORT:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-                         0, "short", objfile); /* FIXME-fnf */
-       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, "int", objfile);
-       break;
-      case FT_SIGNED_INTEGER:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
-                         0, "int", 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", objfile);
-       break;
-      case FT_SIGNED_LONG:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
-                         0, "long", objfile); /* FIXME -fnf */
-       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", objfile);
-       break;
-      case FT_SIGNED_LONG_LONG:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                         0, "signed long long", 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, "double", objfile);
-       break;
-      case FT_EXT_PREC_FLOAT:
-       type = init_type (TYPE_CODE_FLT,
-                         TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-                         0, "long double", objfile);
-        break;
-      case FT_TEMPLATE_ARG:
-        type = init_type (TYPE_CODE_TEMPLATE_ARG,
-                         0,
-                         0, "<template arg>", 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 C/C++ 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_BOOLEAN:
+      type = init_type (TYPE_CODE_BOOL,
+                       TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                       0, "bool", objfile);
+
+      break;
+    case FT_CHAR:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                       0, "char", objfile);
+      TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
+      break;
+    case FT_SIGNED_CHAR:
+      type = init_type (TYPE_CODE_INT,
+                       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", objfile);
+      break;
+    case FT_SIGNED_SHORT:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       0, "short", objfile);   /* FIXME-fnf */
+      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, "int", objfile);
+      break;
+    case FT_SIGNED_INTEGER:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       0, "int", 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", objfile);
+      break;
+    case FT_SIGNED_LONG:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       0, "long", objfile);    /* FIXME -fnf */
+      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", objfile);
+      break;
+    case FT_SIGNED_LONG_LONG:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       0, "signed long long", 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, "double", objfile);
+      break;
+    case FT_EXT_PREC_FLOAT:
+      type = init_type (TYPE_CODE_FLT,
+                       TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+                       0, "long double", objfile);
+      break;
+    case FT_TEMPLATE_ARG:
+      type = init_type (TYPE_CODE_TEMPLATE_ARG,
+                       0,
+                       0, "<template arg>", objfile);
+
+      break;
+    }
   return (type);
 }
-
 \f
+
 /* Table mapping opcodes into strings for printing operators
    and precedences of the operators.  */
 
 const struct op_print c_op_print_tab[] =
-  {
-    {",",  BINOP_COMMA, PREC_COMMA, 0},
-    {"=",  BINOP_ASSIGN, PREC_ASSIGN, 1},
-    {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
-    {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
-    {"|",  BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
-    {"^",  BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
-    {"&",  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_MUL, PREC_MUL, 0},
-    {"/",  BINOP_DIV, PREC_MUL, 0},
-    {"%",  BINOP_REM, PREC_MUL, 0},
-    {"@",  BINOP_REPEAT, PREC_REPEAT, 0},
-    {"-",  UNOP_NEG, PREC_PREFIX, 0},
-    {"!",  UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
-    {"~",  UNOP_COMPLEMENT, PREC_PREFIX, 0},
-    {"*",  UNOP_IND, PREC_PREFIX, 0},
-    {"&",  UNOP_ADDR, PREC_PREFIX, 0},
-    {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
-    {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
-    {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
+{
+  {",", BINOP_COMMA, PREC_COMMA, 0},
+  {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+  {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+  {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+  {"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
+  {"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
+  {"&", 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_MUL, PREC_MUL, 0},
+  {"/", BINOP_DIV, PREC_MUL, 0},
+  {"%", BINOP_REM, PREC_MUL, 0},
+  {"@", BINOP_REPEAT, PREC_REPEAT, 0},
+  {"-", UNOP_NEG, PREC_PREFIX, 0},
+  {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+  {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
+  {"*", UNOP_IND, PREC_PREFIX, 0},
+  {"&", UNOP_ADDR, PREC_PREFIX, 0},
+  {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
+  {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
+  {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
     /* C++  */
-    {"::", BINOP_SCOPE, PREC_PREFIX, 0},
-    {NULL, 0, 0, 0}
+  {"::", BINOP_SCOPE, PREC_PREFIX, 0},
+  {NULL, 0, 0, 0}
 };
 \f
-struct type ** CONST_PTR (c_builtin_types[]) = 
+struct type **CONST_PTR (c_builtin_types[]) =
 {
   &builtin_type_int,
-  &builtin_type_long,
-  &builtin_type_short,
-  &builtin_type_char,
-  &builtin_type_float,
-  &builtin_type_double,
-  &builtin_type_void,
-  &builtin_type_long_long,
-  &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_long,
+    &builtin_type_short,
+    &builtin_type_char,
+    &builtin_type_float,
+    &builtin_type_double,
+    &builtin_type_void,
+    &builtin_type_long_long,
+    &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
 };
 
-const struct language_defn c_language_defn = {
+const struct language_defn c_language_defn =
+{
   "c",                         /* Language name */
   language_c,
   c_builtin_types,
@@ -431,42 +433,43 @@ const struct language_defn c_language_defn = {
   c_print_type,                        /* Print a type using appropriate syntax */
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
-  {"",     "",    "",  ""},    /* Binary format info */
-  {"0%lo",  "0",   "o", ""},   /* Octal format info */
-  {"%ld",   "",    "d", ""},   /* Decimal format info */
-  {"0x%lx", "0x",  "x", ""},   /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
-struct type ** const (cplus_builtin_types[]) = 
+struct type **const (cplus_builtin_types[]) =
 {
   &builtin_type_int,
-  &builtin_type_long,
-  &builtin_type_short,
-  &builtin_type_char,
-  &builtin_type_float,
-  &builtin_type_double,
-  &builtin_type_void,
-  &builtin_type_long_long,
-  &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,
-  &builtin_type_bool,
-  0
+    &builtin_type_long,
+    &builtin_type_short,
+    &builtin_type_char,
+    &builtin_type_float,
+    &builtin_type_double,
+    &builtin_type_void,
+    &builtin_type_long_long,
+    &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,
+    &builtin_type_bool,
+    0
 };
 
-const struct language_defn cplus_language_defn = {
-  "c++",                               /* Language name */
+const struct language_defn cplus_language_defn =
+{
+  "c++",                       /* Language name */
   language_cplus,
   cplus_builtin_types,
   range_check_off,
@@ -481,18 +484,19 @@ const struct language_defn cplus_language_defn = {
   c_print_type,                        /* Print a type using appropriate syntax */
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
-  {"",      "",    "",   ""},  /* Binary format info */
-  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
-  {"%ld",    "",    "d",  ""}, /* Decimal format info */
-  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
-const struct language_defn asm_language_defn = {
+const struct language_defn asm_language_defn =
+{
   "asm",                       /* Language name */
   language_asm,
   c_builtin_types,
@@ -508,14 +512,14 @@ const struct language_defn asm_language_defn = {
   c_print_type,                        /* Print a type using appropriate syntax */
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
-  {"",     "",    "",  ""},    /* Binary format info */
-  {"0%lo",  "0",   "o", ""},   /* Octal format info */
-  {"%ld",   "",    "d", ""},   /* Decimal format info */
-  {"0x%lx", "0x",  "x", ""},   /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
index 28486fd73b36042f80ccc00eb2936b714b919367..62b5880b2948bc51f00013ee486a38e68c650901 100644 (file)
@@ -1,21 +1,22 @@
 /* C language support definitions for GDB, the GNU debugger.
    Copyright 1992, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #if !defined (C_LANG_H)
@@ -42,15 +43,15 @@ c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
 
 /* These are in c-lang.c: */
 
-extern void c_printchar PARAMS ((int, GDB_FILE*));
+extern void c_printchar PARAMS ((int, GDB_FILE *));
 
-extern void c_printstr PARAMS ((GDB_FILE *stream, char *string,
+extern void c_printstr PARAMS ((GDB_FILE * stream, char *string,
                                unsigned int length, int width,
                                int force_ellipses));
 
-extern struct type * c_create_fundamental_type PARAMS ((struct objfile*, int));
+extern struct type *c_create_fundamental_type PARAMS ((struct objfile *, int));
 
-extern struct type ** CONST_PTR (c_builtin_types[]);
+extern struct type **CONST_PTR (c_builtin_types[]);
 
 /* These are in c-typeprint.c: */
 
@@ -75,7 +76,7 @@ cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
 extern void
 cp_print_value_fields PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR,
                               GDB_FILE *, int, int, enum val_prettyprint,
-                              struct type**, int));
+                              struct type **, int));
 
 extern int
 cp_is_vtbl_ptr_type PARAMS ((struct type *));
@@ -84,4 +85,4 @@ extern int
 cp_is_vtbl_member PARAMS ((struct type *));
 
 
-#endif /* !defined (C_LANG_H) */
+#endif /* !defined (C_LANG_H) */
index 52569f8fc53c6ba37c4567d4704b4ec25cb0c633..d6eca3042b7846e04b0c5cd04618f873d30cebfd 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -41,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Flag indicating target was compiled by HP compiler */
 extern int hp_som_som_object_present;
 
-static void cp_type_print_method_args PARAMS ((struct type **args, char *prefix, char *varstring, int staticp, GDB_FILE *stream));
+static void cp_type_print_method_args PARAMS ((struct type ** args, char *prefix, char *varstring, int staticp, GDB_FILE * stream));
 
 static void
 c_type_print_args PARAMS ((struct type *, GDB_FILE *));
@@ -54,58 +55,58 @@ c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
 
 static void
 c_type_print_cv_qualifier PARAMS ((struct type *, GDB_FILE *, int, int));
+\f
 
 
-\f
 /* Print a description of a type in the format of a 
    typedef for the current language.
    NEW is the new name for a type TYPE. */
 
 void
 c_typedef_print (type, new, stream)
-   struct type *type;
-   struct symbol *new;
-   GDB_FILE *stream;
+     struct type *type;
+     struct symbol *new;
+     GDB_FILE *stream;
 {
   CHECK_TYPEDEF (type);
-   switch (current_language->la_language)
-   {
+  switch (current_language->la_language)
+    {
 #ifdef _LANG_c
-   case language_c:
-   case language_cplus:
-      fprintf_filtered(stream, "typedef ");
-      type_print(type,"",stream,0);
-      if(TYPE_NAME ((SYMBOL_TYPE (new))) == 0
-        || !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
-       fprintf_filtered(stream,  " %s", SYMBOL_SOURCE_NAME(new));
+    case language_c:
+    case language_cplus:
+      fprintf_filtered (stream, "typedef ");
+      type_print (type, "", stream, 0);
+      if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
+         || !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
+       fprintf_filtered (stream, " %s", SYMBOL_SOURCE_NAME (new));
       break;
 #endif
 #ifdef _LANG_m2
-   case language_m2:
-      fprintf_filtered(stream, "TYPE ");
-      if(!TYPE_NAME(SYMBOL_TYPE(new)) ||
-        !STREQ (TYPE_NAME(SYMBOL_TYPE(new)), SYMBOL_NAME(new)))
-       fprintf_filtered(stream, "%s = ", SYMBOL_SOURCE_NAME(new));
+    case language_m2:
+      fprintf_filtered (stream, "TYPE ");
+      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);
+       fprintf_filtered (stream, "<builtin> = ");
+      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));
+    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);
+       fprintf_filtered (stream, "<builtin> = ");
+      type_print (type, "", stream, 0);
       break;
 #endif
-   default:
-      error("Language not supported.");
-   }
-   fprintf_filtered(stream, ";\n");
+    default:
+      error ("Language not supported.");
+    }
+  fprintf_filtered (stream, ";\n");
 }
 
 
@@ -129,8 +130,8 @@ c_print_type (type, varstring, stream, show, level)
   code = TYPE_CODE (type);
   if ((varstring != NULL && *varstring != '\0')
       ||
-      /* Need a space if going to print stars or brackets;
-        but not if we will print just a type name.  */
+  /* Need a space if going to print stars or brackets;
+     but not if we will print just a type name.  */
       ((show > 0 || TYPE_NAME (type) == 0)
        &&
        (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
@@ -146,33 +147,33 @@ c_print_type (type, varstring, stream, show, level)
       fputs_filtered (varstring, stream);
 
       /* For demangled function names, we have the arglist as part of the name,
-        so don't print an additional pair of ()'s */
+         so don't print an additional pair of ()'s */
 
-      demangled_args = strchr(varstring, '(') != NULL;
+      demangled_args = strchr (varstring, '(') != NULL;
       c_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
     }
 }
-  
+
 /* If TYPE is a derived type, then print out derivation information.
    Print only the actual base classes of this type, not the base classes
    of the base classes.  I.E.  for the derivation hierarchy:
 
-       class A { int a; };
-       class B : public A {int b; };
-       class C : public B {int c; };
+   class A { int a; };
+   class B : public A {int b; };
+   class C : public B {int c; };
 
    Print the type of class C as:
 
-       class C : public B {
-               int c;
-       }
+   class C : public B {
+   int c;
+   }
 
    Not as the following (like gdb used to), which is not legal C++ syntax for
    derived types and may be confused with the multiple inheritance form:
 
-       class C : public B : public A {
-               int c;
-       }
+   class C : public B : public A {
+   int c;
+   }
 
    In general, gdb should try to print the types as closely as possible to
    the form that they appear in the source code. 
@@ -192,9 +193,9 @@ cp_type_print_derivation_info (stream, type)
     {
       fputs_filtered (i == 0 ? ": " : ", ", stream);
       fprintf_filtered (stream, "%s%s ",
-                       BASETYPE_VIA_PUBLIC (type, i) ? "public" 
-                       : (TYPE_FIELD_PROTECTED (type, i) ? "protected" : "private"),
-                       BASETYPE_VIA_VIRTUAL(type, i) ? " virtual" : "");
+                       BASETYPE_VIA_PUBLIC (type, i) ? "public"
+              : (TYPE_FIELD_PROTECTED (type, i) ? "protected" : "private"),
+                       BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
       name = type_name_no_tag (TYPE_BASECLASS (type, i));
       fprintf_filtered (stream, "%s", name ? name : "(null)");
     }
@@ -204,7 +205,7 @@ cp_type_print_derivation_info (stream, type)
     }
 }
 /* Print the C++ method arguments ARGS to the file STREAM.  */
+
 static void
 cp_type_print_method_args (args, prefix, varstring, staticp, stream)
      struct type **args;
@@ -214,33 +215,34 @@ cp_type_print_method_args (args, prefix, varstring, staticp, stream)
      GDB_FILE *stream;
 {
   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] && args[!staticp]->code != TYPE_CODE_VOID)
     {
-      i = !staticp;             /* skip the class variable */
+      i = !staticp;            /* skip the class variable */
       while (1)
-        {
-          type_print (args[i++], "", stream, 0);
-          if (!args[i])
-            {
-              fprintf_filtered (stream, " ...");
-              break;
-            }
-          else if (args[i]->code != TYPE_CODE_VOID)
-            {
-              fprintf_filtered (stream, ", ");
-            }
-          else break;
-        }
+       {
+         type_print (args[i++], "", stream, 0);
+         if (!args[i])
+           {
+             fprintf_filtered (stream, " ...");
+             break;
+           }
+         else if (args[i]->code != TYPE_CODE_VOID)
+           {
+             fprintf_filtered (stream, ", ");
+           }
+         else
+           break;
+       }
     }
   else if (current_language->la_language == language_cplus)
     {
       fprintf_filtered (stream, "void");
     }
+
   fprintf_filtered (stream, ")");
 }
 
@@ -286,7 +288,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
       if (name)
        fputs_filtered (name, stream);
       else
-        c_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
+       c_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
       fprintf_filtered (stream, "::");
       break;
 
@@ -337,7 +339,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
     case TYPE_CODE_COMPLEX:
     case TYPE_CODE_TYPEDEF:
       /* These types need no prefix.  They are listed here so that
-        gcc -Wall will reveal any types that haven't been handled.  */
+         gcc -Wall will reveal any types that haven't been handled.  */
       break;
     }
 }
@@ -349,25 +351,25 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
 
 static void
 c_type_print_cv_qualifier (type, stream, need_pre_space, need_post_space)
-  struct type *type;
-  GDB_FILE *stream;
-  int need_pre_space;
-  int need_post_space;
+     struct type *type;
+     GDB_FILE *stream;
+     int need_pre_space;
+     int need_post_space;
 {
   int flag = 0;
-  
+
   if (TYPE_CONST (type))
     {
       if (need_pre_space)
-        fprintf_filtered (stream, " ");
+       fprintf_filtered (stream, " ");
       fprintf_filtered (stream, "const");
       flag = 1;
     }
-  
+
   if (TYPE_VOLATILE (type))
     {
       if (flag || need_pre_space)
-        fprintf_filtered (stream, " ");
+       fprintf_filtered (stream, " ");
       fprintf_filtered (stream, "volatile");
       flag = 1;
     }
@@ -396,10 +398,10 @@ c_type_print_args (type, stream)
          fprintf_filtered (stream, "...");
        }
       else if ((args[1]->code == TYPE_CODE_VOID) &&
-               (current_language->la_language == language_cplus))
-        {
-          fprintf_filtered (stream, "void");
-        }
+              (current_language->la_language == language_cplus))
+       {
+         fprintf_filtered (stream, "void");
+       }
       else
        {
          for (i = 1;
@@ -407,11 +409,11 @@ c_type_print_args (type, stream)
               i++)
            {
              c_print_type (args[i], "", stream, -1, 0);
-             if (args[i+1] == NULL)
+             if (args[i + 1] == NULL)
                {
                  fprintf_filtered (stream, "...");
                }
-             else if (args[i+1]->code != TYPE_CODE_VOID)
+             else if (args[i + 1]->code != TYPE_CODE_VOID)
                {
                  fprintf_filtered (stream, ",");
                  wrap_here ("    ");
@@ -423,7 +425,7 @@ c_type_print_args (type, stream)
     {
       fprintf_filtered (stream, "void");
     }
-  
+
   fprintf_filtered (stream, ")");
 }
 
@@ -452,15 +454,15 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
     case TYPE_CODE_ARRAY:
       if (passed_a_ptr)
        fprintf_filtered (stream, ")");
-      
+
       fprintf_filtered (stream, "[");
       if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
-         && TYPE_ARRAY_UPPER_BOUND_TYPE(type) != BOUND_CANNOT_BE_DETERMINED)
+       && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
        fprintf_filtered (stream, "%d",
                          (TYPE_LENGTH (type)
                           / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
       fprintf_filtered (stream, "]");
-      
+
       c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
       break;
 
@@ -489,22 +491,23 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
       if (passed_a_ptr)
        fprintf_filtered (stream, ")");
       if (!demangled_args)
-       { int i, len = TYPE_NFIELDS (type);
+       {
+         int i, len = TYPE_NFIELDS (type);
          fprintf_filtered (stream, "(");
-          if ((len == 0) && (current_language->la_language == language_cplus))
-            {
-              fprintf_filtered (stream, "void");
-            }
-          else
-            for (i = 0; i < len; i++)
-              {
-                if (i > 0)
-                  {
-                    fputs_filtered (", ", stream);
-                    wrap_here ("    ");
-                  }
-                c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
-              }
+         if ((len == 0) && (current_language->la_language == language_cplus))
+           {
+             fprintf_filtered (stream, "void");
+           }
+         else
+           for (i = 0; i < len; i++)
+             {
+               if (i > 0)
+                 {
+                   fputs_filtered (", ", stream);
+                   wrap_here ("    ");
+                 }
+               c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
+             }
          fprintf_filtered (stream, ")");
        }
       c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
@@ -528,7 +531,7 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
     case TYPE_CODE_COMPLEX:
     case TYPE_CODE_TYPEDEF:
       /* These types do not need a suffix.  They are listed so that
-        gcc -Wall will report types that may not have been considered.  */
+         gcc -Wall will report types that may not have been considered.  */
       break;
     }
 }
@@ -562,7 +565,11 @@ c_type_print_base (type, stream, show, level)
   char *mangled_name;
   char *demangled_name;
   char *demangled_no_static;
-  enum {s_none, s_public, s_private, s_protected} section_type;
+  enum
+    {
+      s_none, s_public, s_private, s_protected
+    }
+  section_type;
   int need_access_label = 0;
   int j, len2;
 
@@ -590,7 +597,7 @@ c_type_print_base (type, stream, show, level)
     }
 
   CHECK_TYPEDEF (type);
-         
+
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_TYPEDEF:
@@ -608,28 +615,32 @@ c_type_print_base (type, stream, show, level)
       /* Note TYPE_CODE_STRUCT and TYPE_CODE_CLASS have the same value,
        * so we use another means for distinguishing them.
        */
-      if (HAVE_CPLUS_STRUCT (type)) {
-        switch (TYPE_DECLARED_TYPE(type)) {
-          case DECLARED_TYPE_CLASS:
-           fprintf_filtered (stream, "class ");
-            break;
-          case DECLARED_TYPE_UNION:
-            fprintf_filtered (stream, "union ");
-            break;
-          case DECLARED_TYPE_STRUCT:
-            fprintf_filtered (stream, "struct ");
-            break;
-          default:
-            /* If there is a CPLUS_STRUCT, assume class if not
-             * otherwise specified in the declared_type field.
-             */
-           fprintf_filtered (stream, "class ");
-            break;
-        } /* switch */
-      } else {
-        /* If not CPLUS_STRUCT, then assume it's a C struct */ 
-        fprintf_filtered (stream, "struct ");
-      }
+      if (HAVE_CPLUS_STRUCT (type))
+       {
+         switch (TYPE_DECLARED_TYPE (type))
+           {
+           case DECLARED_TYPE_CLASS:
+             fprintf_filtered (stream, "class ");
+             break;
+           case DECLARED_TYPE_UNION:
+             fprintf_filtered (stream, "union ");
+             break;
+           case DECLARED_TYPE_STRUCT:
+             fprintf_filtered (stream, "struct ");
+             break;
+           default:
+             /* If there is a CPLUS_STRUCT, assume class if not
+              * otherwise specified in the declared_type field.
+              */
+             fprintf_filtered (stream, "class ");
+             break;
+           }                   /* switch */
+       }
+      else
+       {
+         /* If not CPLUS_STRUCT, then assume it's a C struct */
+         fprintf_filtered (stream, "struct ");
+       }
       goto struct_union;
 
     case TYPE_CODE_UNION:
@@ -645,7 +656,7 @@ c_type_print_base (type, stream, show, level)
        * want to print.
        */
       if (TYPE_TAG_NAME (type) != NULL &&
-          strncmp(TYPE_TAG_NAME(type), "{unnamed", 8))
+         strncmp (TYPE_TAG_NAME (type), "{unnamed", 8))
        {
          fputs_filtered (TYPE_TAG_NAME (type), stream);
          if (show > 0)
@@ -661,7 +672,7 @@ c_type_print_base (type, stream, show, level)
       else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
        {
          cp_type_print_derivation_info (stream, type);
-         
+
          fprintf_filtered (stream, "{\n");
          if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
            {
@@ -677,71 +688,71 @@ c_type_print_base (type, stream, show, level)
 
          section_type = s_none;
 
-          /* For a class, if all members are private, there's no need
-             for a "private:" label; similarly, for a struct or union
-             masquerading as a class, if all members are public, there's
-             no need for a "public:" label. */ 
-
-          if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_CLASS) ||
-               (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_TEMPLATE))
-            {
-              QUIT;
-              len = TYPE_NFIELDS (type);
-              for (i = TYPE_N_BASECLASSES (type); i < len; i++)
-                if (!TYPE_FIELD_PRIVATE (type, i))
-                  {
-                    need_access_label = 1;
-                    break;
-                  }
-              QUIT;
-              if (!need_access_label)
-                {
-                  len2 = TYPE_NFN_FIELDS (type);
-                  for (j = 0; j < len2; j++)
-                    {
-                      len = TYPE_FN_FIELDLIST_LENGTH (type, j);
-                      for (i = 0; i < len; i++)
-                        if (!TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i))
-                          {
-                            need_access_label = 1;
-                            break;
-                          }
-                      if (need_access_label)
-                        break;
-                    }
-                }
-            }
-          else if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_STRUCT) ||
-                   (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION))
-            {
-              QUIT;
-              len = TYPE_NFIELDS (type);
-              for (i = TYPE_N_BASECLASSES (type); i < len; i++)
-                if (TYPE_FIELD_PRIVATE (type, i) || TYPE_FIELD_PROTECTED (type, i))
-                  {
-                    need_access_label = 1;
-                    break;
-                  }
-              QUIT;
-              if (!need_access_label)
-                {
-                  len2 = TYPE_NFN_FIELDS (type);
-                  for (j = 0; j < len2; j++)
-                    {
-                      QUIT;
-                      len = TYPE_FN_FIELDLIST_LENGTH (type, j);
-                      for (i = 0; i < len; i++)
-                        if (TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i) ||
-                            TYPE_FN_FIELD_PROTECTED (TYPE_FN_FIELDLIST1 (type, j), i))
-                          {
-                            need_access_label = 1;
-                            break;
-                          }
-                      if (need_access_label)
-                        break;
-                    }
-                }
-            }
+         /* For a class, if all members are private, there's no need
+            for a "private:" label; similarly, for a struct or union
+            masquerading as a class, if all members are public, there's
+            no need for a "public:" label. */
+
+         if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_CLASS) ||
+             (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_TEMPLATE))
+           {
+             QUIT;
+             len = TYPE_NFIELDS (type);
+             for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+               if (!TYPE_FIELD_PRIVATE (type, i))
+                 {
+                   need_access_label = 1;
+                   break;
+                 }
+             QUIT;
+             if (!need_access_label)
+               {
+                 len2 = TYPE_NFN_FIELDS (type);
+                 for (j = 0; j < len2; j++)
+                   {
+                     len = TYPE_FN_FIELDLIST_LENGTH (type, j);
+                     for (i = 0; i < len; i++)
+                       if (!TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i))
+                         {
+                           need_access_label = 1;
+                           break;
+                         }
+                     if (need_access_label)
+                       break;
+                   }
+               }
+           }
+         else if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_STRUCT) ||
+                  (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION))
+           {
+             QUIT;
+             len = TYPE_NFIELDS (type);
+             for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+               if (TYPE_FIELD_PRIVATE (type, i) || TYPE_FIELD_PROTECTED (type, i))
+                 {
+                   need_access_label = 1;
+                   break;
+                 }
+             QUIT;
+             if (!need_access_label)
+               {
+                 len2 = TYPE_NFN_FIELDS (type);
+                 for (j = 0; j < len2; j++)
+                   {
+                     QUIT;
+                     len = TYPE_FN_FIELDLIST_LENGTH (type, j);
+                     for (i = 0; i < len; i++)
+                       if (TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i) ||
+                           TYPE_FN_FIELD_PROTECTED (TYPE_FN_FIELDLIST1 (type, j), i))
+                         {
+                           need_access_label = 1;
+                           break;
+                         }
+                     if (need_access_label)
+                       break;
+                   }
+               }
+           }
 
          /* If there is a base class for this type,
             do not print the field that it occupies.  */
@@ -751,17 +762,17 @@ c_type_print_base (type, stream, show, level)
            {
              QUIT;
              /* Don't print out virtual function table.  */
-              /* HP ANSI C++ case */
-              if (TYPE_HAS_VTABLE(type) && (STREQN (TYPE_FIELD_NAME (type, i), "__vfp", 5)))
-                 continue;
-              /* Other compilers */
-              /* pai:: FIXME : check for has_vtable < 0 */
+             /* HP ANSI C++ case */
+             if (TYPE_HAS_VTABLE (type) && (STREQN (TYPE_FIELD_NAME (type, i), "__vfp", 5)))
+               continue;
+             /* Other compilers */
+             /* pai:: FIXME : check for has_vtable < 0 */
              if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
                  && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
                continue;
 
              /* If this is a C++ class we can print the various C++ section
-                labels. */
+                labels. */
 
              if (HAVE_CPLUS_STRUCT (type) && need_access_label)
                {
@@ -817,7 +828,7 @@ c_type_print_base (type, stream, show, level)
          /* If there are both fields and methods, put a space between. */
          len = TYPE_NFN_FIELDS (type);
          if (len && section_type != s_none)
-            fprintf_filtered (stream, "\n");
+           fprintf_filtered (stream, "\n");
 
          /* C++: print out the methods */
          for (i = 0; i < len; i++)
@@ -826,16 +837,16 @@ c_type_print_base (type, stream, show, level)
              int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
              char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
              char *name = type_name_no_tag (type);
-             int is_constructor = name && STREQ(method_name, name);
+             int is_constructor = name && STREQ (method_name, name);
              for (j = 0; j < len2; j++)
                {
                  char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
-                 int is_full_physname_constructor = 
-                   ((physname[0] == '_' && physname[1] == '_'
-                     && strchr ("0123456789Qt", physname[2]))
-                    || STREQN (physname, "__ct__", 6)
-                    || DESTRUCTOR_PREFIX_P (physname)
-                    || STREQN (physname, "__dt__", 6));
+                 int is_full_physname_constructor =
+                 ((physname[0] == '_' && physname[1] == '_'
+                   && strchr ("0123456789Qt", physname[2]))
+                  || STREQN (physname, "__ct__", 6)
+                  || DESTRUCTOR_PREFIX_P (physname)
+                  || STREQN (physname, "__dt__", 6));
 
                  QUIT;
                  if (TYPE_FN_FIELD_PROTECTED (f, j))
@@ -873,13 +884,13 @@ c_type_print_base (type, stream, show, level)
                    {
                      /* Keep GDB from crashing here.  */
                      fprintf_filtered (stream, "<undefined type> %s;\n",
-                              TYPE_FN_FIELD_PHYSNAME (f, j));
+                                       TYPE_FN_FIELD_PHYSNAME (f, j));
                      break;
                    }
-                 else if (!is_constructor &&                  /* constructors don't have declared types */
-                           !is_full_physname_constructor &&    /*    " "  */ 
-                           !strstr (method_name, "operator ")) /* Not a type conversion operator */
-                                                               /* (note space -- other operators don't have it) */ 
+                 else if (!is_constructor &&   /* constructors don't have declared types */
+                          !is_full_physname_constructor &&     /*    " "  */
+                          !strstr (method_name, "operator "))  /* Not a type conversion operator */
+                   /* (note space -- other operators don't have it) */
                    {
                      type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
                                  "", stream, -1);
@@ -897,14 +908,14 @@ c_type_print_base (type, stream, show, level)
                  if (demangled_name == NULL)
                    {
                      /* in some cases (for instance with the HP demangling),
-                        if a function has more than 10 arguments, 
-                        the demangling will fail.
-                        Let's try to reconstruct the function signature from 
-                        the symbol information */
+                        if a function has more than 10 arguments, 
+                        the demangling will fail.
+                        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),
+                                             TYPE_FN_FIELD_STATIC_P (f, j),
                                                   stream);
                      else
                        fprintf_filtered (stream, "<badly mangled name '%s'>",
@@ -914,7 +925,7 @@ c_type_print_base (type, stream, show, level)
                    {
                      char *p;
                      char *demangled_no_class = demangled_name;
-                     
+
                      while ((p = strchr (demangled_no_class, ':')))
                        {
                          demangled_no_class = p;
@@ -928,7 +939,7 @@ c_type_print_base (type, stream, show, level)
                          int length = p - demangled_no_class;
                          demangled_no_static = (char *) xmalloc (length + 1);
                          strncpy (demangled_no_static, demangled_no_class, length);
-                          *(demangled_no_static + length) = '\0';
+                         *(demangled_no_static + length) = '\0';
                          fputs_filtered (demangled_no_static, stream);
                          free (demangled_no_static);
                        }
@@ -944,40 +955,40 @@ c_type_print_base (type, stream, show, level)
                }
            }
 
-      if (TYPE_LOCALTYPE_PTR (type) && show >= 0)
-        fprintfi_filtered (level, stream, " (Local at %s:%d)\n",
-                           TYPE_LOCALTYPE_FILE (type),
-                           TYPE_LOCALTYPE_LINE (type));
+         if (TYPE_LOCALTYPE_PTR (type) && show >= 0)
+           fprintfi_filtered (level, stream, " (Local at %s:%d)\n",
+                              TYPE_LOCALTYPE_FILE (type),
+                              TYPE_LOCALTYPE_LINE (type));
 
          fprintfi_filtered (level, stream, "}");
        }
-      if (TYPE_CODE(type) == TYPE_CODE_TEMPLATE)
-        goto go_back;
+      if (TYPE_CODE (type) == TYPE_CODE_TEMPLATE)
+       goto go_back;
       break;
 
     case TYPE_CODE_ENUM:
       c_type_print_cv_qualifier (type, stream, 0, 1);
       /* HP C supports sized enums */
       if (hp_som_som_object_present)
-        switch (TYPE_LENGTH (type))
-          {
-            case 1:
-              fputs_filtered ("char ", stream);
-              break;
-            case 2:
-              fputs_filtered ("short ", stream);
-              break;
-            default:
-              break;
-          }
-       fprintf_filtered (stream, "enum ");
+       switch (TYPE_LENGTH (type))
+         {
+         case 1:
+           fputs_filtered ("char ", stream);
+           break;
+         case 2:
+           fputs_filtered ("short ", stream);
+           break;
+         default:
+           break;
+         }
+      fprintf_filtered (stream, "enum ");
       /* Print the tag name if it exists.
          The aCC compiler emits a spurious 
          "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
          tag for unnamed struct/union/enum's, which we don't
          want to print. */
       if (TYPE_TAG_NAME (type) != NULL &&
-          strncmp(TYPE_TAG_NAME(type), "{unnamed", 8))
+         strncmp (TYPE_TAG_NAME (type), "{unnamed", 8))
        {
          fputs_filtered (TYPE_TAG_NAME (type), stream);
          if (show > 0)
@@ -999,7 +1010,8 @@ c_type_print_base (type, stream, show, level)
          for (i = 0; i < len; i++)
            {
              QUIT;
-             if (i) fprintf_filtered (stream, ", ");
+             if (i)
+               fprintf_filtered (stream, ", ");
              wrap_here ("    ");
              fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
              if (lastval != TYPE_FIELD_BITPOS (type, i))
@@ -1033,41 +1045,45 @@ c_type_print_base (type, stream, show, level)
     case TYPE_CODE_TEMPLATE:
       /* Called on "ptype t" where "t" is a template.
          Prints the template header (with args), e.g.:
-           template <class T1, class T2> class "
+         template <class T1, class T2> class "
          and then merges with the struct/union/class code to
          print the rest of the definition. */
       c_type_print_cv_qualifier (type, stream, 0, 1);
       fprintf_filtered (stream, "template <");
-      for (i = 0; i < TYPE_NTEMPLATE_ARGS(type); i++) {
-        struct template_arg templ_arg;
-        templ_arg = TYPE_TEMPLATE_ARG(type, i);
-        fprintf_filtered (stream, "class %s", templ_arg.name);
-        if (i < TYPE_NTEMPLATE_ARGS(type)-1)
-          fprintf_filtered (stream, ", ");
-      }
+      for (i = 0; i < TYPE_NTEMPLATE_ARGS (type); i++)
+       {
+         struct template_arg templ_arg;
+         templ_arg = TYPE_TEMPLATE_ARG (type, i);
+         fprintf_filtered (stream, "class %s", templ_arg.name);
+         if (i < TYPE_NTEMPLATE_ARGS (type) - 1)
+           fprintf_filtered (stream, ", ");
+       }
       fprintf_filtered (stream, "> class ");
       /* Yuck, factor this out to a subroutine so we can call
          it and return to the point marked with the "goback:" label... - RT */
-      goto struct_union; 
-go_back:
-      if (TYPE_NINSTANTIATIONS(type) > 0) {
-        fprintf_filtered (stream, "\ntemplate instantiations:\n");
-        for (i = 0; i < TYPE_NINSTANTIATIONS(type); i++) {
-          fprintf_filtered(stream, "  ");
-          c_type_print_base (TYPE_INSTANTIATION(type, i), stream, 0, level);
-          if (i < TYPE_NINSTANTIATIONS(type)-1) fprintf_filtered(stream, "\n");
-        }
-      }
+      goto struct_union;
+    go_back:
+      if (TYPE_NINSTANTIATIONS (type) > 0)
+       {
+         fprintf_filtered (stream, "\ntemplate instantiations:\n");
+         for (i = 0; i < TYPE_NINSTANTIATIONS (type); i++)
+           {
+             fprintf_filtered (stream, "  ");
+             c_type_print_base (TYPE_INSTANTIATION (type, i), stream, 0, level);
+             if (i < TYPE_NINSTANTIATIONS (type) - 1)
+               fprintf_filtered (stream, "\n");
+           }
+       }
       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. */
+         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)
        {
-          c_type_print_cv_qualifier (type, stream, 0, 1);
+         c_type_print_cv_qualifier (type, stream, 0, 1);
          fputs_filtered (TYPE_NAME (type), stream);
        }
       else
@@ -1080,12 +1096,3 @@ go_back:
       break;
     }
 }
-
-
-
-
-
-
-
-
-
index 7a9c6bec0d68f1cfb72c19fe6eef669989c8df46..f791e4c20deb2f8f20aa93980433da5ac96f3d53 100644 (file)
@@ -1,22 +1,23 @@
 /* Support for printing C values for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -27,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "valprint.h"
 #include "language.h"
 #include "c-lang.h"
-
 \f
+
 /* 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
@@ -55,7 +56,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
      int recurse;
      enum val_prettyprint pretty;
 {
-  register unsigned int i = 0;         /* Number of characters printed */
+  register unsigned int i = 0; /* Number of characters printed */
   unsigned len;
   struct type *elttype;
   unsigned eltlen;
@@ -83,11 +84,11 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
              && (format == 0 || format == 's'))
            {
              /* 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;
                       (valaddr + embedded_offset)[temp_len]
@@ -95,7 +96,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
                       temp_len++);
                  len = temp_len;
                }
-             
+
              LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0);
              i = len;
            }
@@ -103,7 +104,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
            {
              fprintf_filtered (stream, "{");
              /* If this is a virtual function table, print the 0th
-                entry specially, and the rest of the members normally.  */
+                entry specially, and the rest of the members normally.  */
              if (cp_is_vtbl_ptr_type (elttype))
                {
                  i = 1;
@@ -114,7 +115,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
                  i = 0;
                }
              val_print_array_elements (type, valaddr + embedded_offset, address, stream,
-                                       format, deref_ref, recurse, pretty, i);
+                                    format, deref_ref, recurse, pretty, i);
              fprintf_filtered (stream, "}");
            }
          break;
@@ -129,13 +130,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
          print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
          break;
        }
-      if (vtblprint && cp_is_vtbl_ptr_type(type))
+      if (vtblprint && cp_is_vtbl_ptr_type (type))
        {
-          /* Print the unmangled name if desired.  */
+         /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if we ARE using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_STRUCT.) */
-         print_address_demangle(extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
-                                stream, demangle);
+         print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
+                                 stream, demangle);
          break;
        }
       elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -153,7 +154,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
        {
          addr = unpack_pointer (type, valaddr + embedded_offset);
        print_unpacked_pointer:
-          elttype = check_typedef (TYPE_TARGET_TYPE (type));
+         elttype = check_typedef (TYPE_TARGET_TYPE (type));
 
          if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
            {
@@ -179,13 +180,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
            {
              i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
            }
-         else if (cp_is_vtbl_member(type))
-           {
+         else if (cp_is_vtbl_member (type))
+           {
              /* print vtbl's nicely */
              CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset);
 
              struct minimal_symbol *msymbol =
-               lookup_minimal_symbol_by_pc (vt_address);
+             lookup_minimal_symbol_by_pc (vt_address);
              if ((msymbol != NULL) &&
                  (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
                {
@@ -194,25 +195,25 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
                  fputs_filtered (">", stream);
                }
              if (vt_address && vtblprint)
-               {
+               {
                  value_ptr vt_val;
-                 struct symbol *wsym = (struct symbol *)NULL;
-                 struct type *wtype;
+                 struct symbol *wsym = (struct symbol *) NULL;
+                 struct type *wtype;
                  struct symtab *s;
-                 struct block *block = (struct block *)NULL;
+                 struct block *block = (struct block *) NULL;
                  int is_this_fld;
 
                  if (msymbol != NULL)
-                   wsym = lookup_symbol (SYMBOL_NAME(msymbol), block, 
-                               VAR_NAMESPACE, &is_this_fld, &s);
+                   wsym = lookup_symbol (SYMBOL_NAME (msymbol), block,
+                                         VAR_NAMESPACE, &is_this_fld, &s);
+
                  if (wsym)
                    {
-                     wtype = SYMBOL_TYPE(wsym);
+                     wtype = SYMBOL_TYPE (wsym);
                    }
                  else
                    {
-                     wtype = TYPE_TARGET_TYPE(type);
+                     wtype = TYPE_TARGET_TYPE (type);
                    }
                  vt_val = value_at (wtype, vt_address, NULL);
                  val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
@@ -223,8 +224,8 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
                      fprintf_filtered (stream, "\n");
                      print_spaces_filtered (2 + 2 * recurse, stream);
                    }
-               }
-             }
+               }
+           }
 
          /* Return number of characters printed, including the terminating
             '\0' if we reached the end.  val_print_string takes care including
@@ -240,41 +241,41 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
     case TYPE_CODE_REF:
       elttype = check_typedef (TYPE_TARGET_TYPE (type));
       if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
-        {
+       {
          cp_print_class_member (valaddr + embedded_offset,
                                 TYPE_DOMAIN_TYPE (elttype),
                                 stream, "");
          break;
        }
       if (addressprint)
-        {
+       {
          fprintf_filtered (stream, "@");
          print_address_numeric
            (extract_address (valaddr + embedded_offset,
                              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)
            {
              value_ptr deref_val =
-               value_at
-                 (TYPE_TARGET_TYPE (type),
-                  unpack_pointer (lookup_pointer_type (builtin_type_void),
-                                  valaddr + embedded_offset),
-                  NULL);
+             value_at
+             (TYPE_TARGET_TYPE (type),
+              unpack_pointer (lookup_pointer_type (builtin_type_void),
+                              valaddr + embedded_offset),
+              NULL);
              val_print (VALUE_TYPE (deref_val),
-                        VALUE_CONTENTS (deref_val), 
-                         0,
-                        VALUE_ADDRESS (deref_val), 
-                         stream, 
-                         format,
-                        deref_ref, 
-                         recurse, 
-                         pretty);
+                        VALUE_CONTENTS (deref_val),
+                        0,
+                        VALUE_ADDRESS (deref_val),
+                        stream,
+                        format,
+                        deref_ref,
+                        recurse,
+                        pretty);
            }
          else
            fputs_filtered ("???", stream);
@@ -289,16 +290,16 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
        }
       /* Fall through.  */
     case TYPE_CODE_STRUCT:
-      if (vtblprint && cp_is_vtbl_ptr_type(type))
+      if (vtblprint && cp_is_vtbl_ptr_type (type))
        {
-          /* Print the unmangled name if desired.  */
+         /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if NOT using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_PTR.) */
-          print_address_demangle (extract_address (
-               valaddr + embedded_offset + 
-                TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
-               TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
-              stream, demangle);
+         print_address_demangle (extract_address (
+                                                valaddr + embedded_offset +
+                          TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+                 TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
+                                 stream, demangle);
        }
       else
        cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format,
@@ -338,7 +339,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
          break;
        }
       /* FIXME, we should consider, at least for ANSI C language, eliminating
-        the distinction made between FUNCs and POINTERs to FUNCs.  */
+         the distinction made between FUNCs and POINTERs to FUNCs.  */
       fprintf_filtered (stream, "{");
       type_print (type, "", stream, -1);
       fprintf_filtered (stream, "} ");
@@ -364,12 +365,12 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
 
     case TYPE_CODE_RANGE:
       /* FIXME: create_range_type does not set the unsigned bit in a
-        range type (I think it probably should copy it from the target
-        type), so we won't print values which are too large to
-        fit in a signed integer correctly.  */
+         range type (I think it probably should copy it from the target
+         type), so we won't print values which are too large to
+         fit in a signed integer correctly.  */
       /* FIXME: Doesn't handle ranges of enums correctly.  (Can't just
-        print with the target type, though, because the size of our type
-        and the target type might differ).  */
+         print with the target type, though, because the size of our type
+         and the target type might differ).  */
       /* FALLTHROUGH */
 
     case TYPE_CODE_INT:
@@ -434,8 +435,8 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
 
     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.  */
+         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;
 
@@ -454,9 +455,9 @@ c_value_print (val, stream, format, pretty)
      enum val_prettyprint pretty;
 {
   struct type *type = VALUE_TYPE (val);
-  struct type * real_type;
+  struct type *real_type;
   int full, top, using_enc;
+
   /* If it is a pointer, indicate what it points to.
 
      Print type also if it is a reference.
@@ -467,7 +468,7 @@ c_value_print (val, stream, format, pretty)
       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_NAME (type) == NULL &&
          TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL &&
@@ -476,28 +477,28 @@ c_value_print (val, stream, format, pretty)
          /* Print nothing */
        }
       else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
-        {
-          /* Pointer to class, check real type of object */
+       {
+         /* Pointer to class, check real type of object */
          fprintf_filtered (stream, "(");
-          type = value_rtti_target_type (val, &full, &top, &using_enc);
-          if (type) 
-            {
-              /* RTTI entry found */
-              type = lookup_pointer_type (type);
-              type_print (type, "", stream, -1);
-            }
-          else
-            {
-              /* No RTTI fields, do whatever we can */
-              type = VALUE_ENCLOSING_TYPE (val);
-              type_print (type, "", stream, -1);
-              fprintf_filtered (stream, " ?");
-            }
+         type = value_rtti_target_type (val, &full, &top, &using_enc);
+         if (type)
+           {
+             /* RTTI entry found */
+             type = lookup_pointer_type (type);
+             type_print (type, "", stream, -1);
+           }
+         else
+           {
+             /* No RTTI fields, do whatever we can */
+             type = VALUE_ENCLOSING_TYPE (val);
+             type_print (type, "", stream, -1);
+             fprintf_filtered (stream, " ?");
+           }
          fprintf_filtered (stream, ") ");
-        }
+       }
       else
        {
-          /* normal case */ 
+         /* normal case */
          fprintf_filtered (stream, "(");
          type_print (type, "", stream, -1);
          fprintf_filtered (stream, ") ");
@@ -507,29 +508,29 @@ c_value_print (val, stream, format, pretty)
     {
       /* Attempt to determine real type of object */
       real_type = value_rtti_type (val, &full, &top, &using_enc);
-      if (real_type) 
-        {
-          /* We have RTTI information, so use it */
-          val = value_full_object (val, real_type, full, top, using_enc);
-          fprintf_filtered (stream, "(%s%s) ",
-                            TYPE_NAME (real_type),
-                            full ? "" : " [incomplete object]");
-          /* Print out object: enclosing type is same as real_type if full */
-          return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
-                            VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
-        }
+      if (real_type)
+       {
+         /* We have RTTI information, so use it */
+         val = value_full_object (val, real_type, full, top, using_enc);
+         fprintf_filtered (stream, "(%s%s) ",
+                           TYPE_NAME (real_type),
+                           full ? "" : " [incomplete object]");
+         /* Print out object: enclosing type is same as real_type if full */
+         return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
+                        VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+       }
       else if (type != VALUE_ENCLOSING_TYPE (val))
-        {
-          /* No RTTI information, so let's do our best */
-          fprintf_filtered (stream, "(%s ?) ",
-                            TYPE_NAME (VALUE_ENCLOSING_TYPE (val)));
-          return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
-                            VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
-        }
+       {
+         /* No RTTI information, so let's do our best */
+         fprintf_filtered (stream, "(%s ?) ",
+                           TYPE_NAME (VALUE_ENCLOSING_TYPE (val)));
+         return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
+                        VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+       }
       /* Otherwise, we end up at the return outside this "if" */
     }
-  
-   return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
+
+  return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
                    VALUE_ADDRESS (val),
                    stream, format, 1, 0, pretty);
 }
index 4c02004f0753daa635459be71bea5946273b1c70..40bf5d2f8ef7744f2cff81989c42843c9d890c7b 100644 (file)
@@ -1,19 +1,20 @@
 /* Prototypes for GDB commands that are called internally by other functions.
    Copyright 1992 Free Software Foundation, Inc.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 extern void
 initialize_all_files PARAMS ((void));
index 45436a3bee8f2316eea816f2d64ab53cd1cdf430..62e9bfd1b79aa8964485ca0ca06d8f7fbc3f40e1 100644 (file)
@@ -1,21 +1,22 @@
 /* Parser for GNU CHILL (CCITT High-Level Language)  -*- C -*-
    Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Parse a Chill expression from text in a string,
    and return the result as a  struct expression  pointer.
@@ -51,9 +52,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #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 */
+#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__
@@ -64,75 +65,79 @@ typedef union
   {
     LONGEST lval;
     ULONGEST ulval;
-    struct {
-      LONGEST val;
-      struct type *type;
-    } typed_val;
+    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
-};
+  }
+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. */
 
@@ -177,7 +182,7 @@ static void parse_expr PARAMS ((void));
 static void parse_primval PARAMS ((void));
 static void parse_untyped_expr PARAMS ((void));
 static int parse_opt_untyped_expr PARAMS ((void));
-static void parse_if_expression_body PARAMS((void));
+static void parse_if_expression_body PARAMS ((void));
 static enum ch_terminal ch_lex PARAMS ((void));
 INLINE static enum ch_terminal PEEK_TOKEN PARAMS ((void));
 static enum ch_terminal peek_token_ PARAMS ((int));
@@ -186,15 +191,16 @@ static void require PARAMS ((enum ch_terminal));
 static int check_token PARAMS ((enum ch_terminal));
 
 #define MAX_LOOK_AHEAD 2
-static enum ch_terminal terminal_buffer[MAX_LOOK_AHEAD+1] = {
+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];
+static YYSTYPE val_buffer[MAX_LOOK_AHEAD + 1];
 
-/*int current_token, lookahead_token;*/
+/*int current_token, lookahead_token; */
 
 INLINE static enum ch_terminal
-PEEK_TOKEN()
+PEEK_TOKEN ()
 {
   if (terminal_buffer[0] == TOKEN_NOT_READ)
     {
@@ -231,10 +237,10 @@ pushback_token (code, node)
   if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
     fatal ("internal error - cannot pushback token");
   for (i = MAX_LOOK_AHEAD; i > 0; i--)
-    { 
-      terminal_buffer[i] = terminal_buffer[i - 1]; 
+    {
+      terminal_buffer[i] = terminal_buffer[i - 1];
       val_buffer[i] = val_buffer[i - 1];
-  }
+    }
   terminal_buffer[0] = code;
   val_buffer[0] = node;
 }
@@ -242,13 +248,13 @@ pushback_token (code, node)
 #endif
 
 static void
-forward_token_()
+forward_token_ ()
 {
   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[i] = terminal_buffer[i + 1];
+      val_buffer[i] = val_buffer[i + 1];
     }
   terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ;
 }
@@ -258,23 +264,23 @@ forward_token_()
    if it isn't TOKEN, the parser is broken. */
 
 static void
-require(token)
+require (token)
      enum ch_terminal token;
 {
-  if (PEEK_TOKEN() != token)
+  if (PEEK_TOKEN () != token)
     {
       char buf[80];
-      sprintf (buf, "internal parser error - expected token %d", (int)token);
-      fatal(buf);
+      sprintf (buf, "internal parser error - expected token %d", (int) token);
+      fatal (buf);
     }
-  FORWARD_TOKEN();
+  FORWARD_TOKEN ();
 }
 
 static int
 check_token (token)
      enum ch_terminal token;
 {
-  if (PEEK_TOKEN() != token)
+  if (PEEK_TOKEN () != token)
     return 0;
   FORWARD_TOKEN ();
   return 1;
@@ -282,13 +288,13 @@ check_token (token)
 
 /* return 0 if expected token was not found,
    else return 1.
-*/
+ */
 static int
 expect (token, message)
      enum ch_terminal token;
      char *message;
 {
-  if (PEEK_TOKEN() != token)
+  if (PEEK_TOKEN () != token)
     {
       if (message)
        error (message);
@@ -299,16 +305,16 @@ expect (token, message)
       return 0;
     }
   else
-    FORWARD_TOKEN();
+    FORWARD_TOKEN ();
   return 1;
 }
 
 #if 0
 static tree
 parse_opt_name_string (allow_all)
-     int allow_all; /* 1 if ALL is allowed as a postfix */
+     int allow_all;            /* 1 if ALL is allowed as a postfix */
 {
-  int token = PEEK_TOKEN();
+  int token = PEEK_TOKEN ();
   tree name;
   if (token != NAME)
     {
@@ -319,17 +325,17 @@ parse_opt_name_string (allow_all)
        }
       return NULL_TREE;
     }
-  name = PEEK_LVAL();
+  name = PEEK_LVAL ();
   for (;;)
     {
       FORWARD_TOKEN ();
-      token = PEEK_TOKEN();
+      token = PEEK_TOKEN ();
       if (token != '!')
        return name;
-      FORWARD_TOKEN();
-      token = PEEK_TOKEN();
+      FORWARD_TOKEN ();
+      token = PEEK_TOKEN ();
       if (token == ALL && allow_all)
-       return get_identifier3(IDENTIFIER_POINTER (name), "!", "*");
+       return get_identifier3 (IDENTIFIER_POINTER (name), "!", "*");
       if (token != NAME)
        {
          if (pass == 1)
@@ -337,15 +343,15 @@ parse_opt_name_string (allow_all)
                   IDENTIFIER_POINTER (name));
          return name;
        }
-      name = get_identifier3(IDENTIFIER_POINTER(name),
-                            "!", IDENTIFIER_POINTER(PEEK_LVAL()));
+      name = get_identifier3 (IDENTIFIER_POINTER (name),
+                             "!", IDENTIFIER_POINTER (PEEK_LVAL ()));
     }
 }
 
 static tree
 parse_simple_name_string ()
 {
-  int token = PEEK_TOKEN();
+  int token = PEEK_TOKEN ();
   tree name;
   if (token != NAME)
     {
@@ -394,7 +400,7 @@ parse_name ()
        return convert_from_reference (decl);
       else
        return decl;
-    } 
+    }
 }
 #endif
 
@@ -461,7 +467,7 @@ parse_mode_call ()
   expect ('(', NULL);
   if (PEEK_TOKEN () != TYPENAME)
     error ("expect MODENAME here `%s'", lexptr);
-  type = PEEK_LVAL().tsym.type;
+  type = PEEK_LVAL ().tsym.type;
   FORWARD_TOKEN ();
   expect (')', NULL);
   return type;
@@ -477,7 +483,7 @@ parse_mode_or_normal_call ()
   expect ('(', NULL);
   if (PEEK_TOKEN () == TYPENAME)
     {
-      type = PEEK_LVAL().tsym.type;
+      type = PEEK_LVAL ().tsym.type;
       FORWARD_TOKEN ();
     }
   else
@@ -675,7 +681,7 @@ parse_primval ()
   char *op_name;
   switch (PEEK_TOKEN ())
     {
-    case INTEGER_LITERAL: 
+    case INTEGER_LITERAL:
     case CHARACTER_LITERAL:
       write_exp_elt_opcode (OP_LONG);
       write_exp_elt_type (PEEK_LVAL ().typed_val.type);
@@ -718,12 +724,12 @@ parse_primval ()
     case ARRAY:
       FORWARD_TOKEN ();
       /* This is pseudo-Chill, similar to C's '(TYPE[])EXPR'
-        which casts to an artificial array. */
+         which casts to an artificial array. */
       expect ('(', NULL);
       expect (')', NULL);
       if (PEEK_TOKEN () != TYPENAME)
        error ("missing MODENAME after ARRAY()");
-      type = PEEK_LVAL().tsym.type;
+      type = PEEK_LVAL ().tsym.type;
       FORWARD_TOKEN ();
       expect ('(', NULL);
       parse_expr ();
@@ -731,7 +737,7 @@ parse_primval ()
       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;
+      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);
@@ -739,7 +745,7 @@ parse_primval ()
 #if 0
     case CONST:
     case EXPR:
-      val = PEEK_LVAL();
+      val = PEEK_LVAL ();
       FORWARD_TOKEN ();
       break;
 #endif
@@ -759,7 +765,7 @@ parse_primval ()
       write_exp_elt_opcode (OP_VAR_VALUE);
       FORWARD_TOKEN ();
       break;
-    case GDB_VARIABLE: /* gdb specific */
+    case GDB_VARIABLE:         /* gdb specific */
       FORWARD_TOKEN ();
       break;
     case NUM:
@@ -780,9 +786,15 @@ parse_primval ()
       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;
+    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);
@@ -794,7 +806,8 @@ parse_primval ()
     case SIZE:
       type = parse_mode_or_normal_call ();
       if (type)
-       { write_exp_elt_opcode (OP_LONG);
+       {
+         write_exp_elt_opcode (OP_LONG);
          write_exp_elt_type (builtin_type_int);
          CHECK_TYPEDEF (type);
          write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (type));
@@ -820,7 +833,7 @@ parse_primval ()
     case TYPENAME:
       type = PEEK_LVAL ().tsym.type;
       FORWARD_TOKEN ();
-      switch (PEEK_TOKEN())
+      switch (PEEK_TOKEN ())
        {
        case '[':
          parse_tuple (type);
@@ -837,8 +850,8 @@ parse_primval ()
          error ("typename in invalid context");
        }
       break;
-      
-    default: 
+
+    default:
       error ("invalid expression syntax at `%s'", lexptr);
     }
   for (;;)
@@ -944,11 +957,11 @@ parse_operand6 ()
       write_exp_elt_opcode (UNOP_ADDR);
     }
   else
-    parse_primval();
+    parse_primval ();
 }
 
 static void
-parse_operand5()
+parse_operand5 ()
 {
   enum exp_opcode op;
   /* We are supposed to be looking for a <string repetition operator>,
@@ -960,16 +973,20 @@ parse_operand5()
      Is that a function call or string repetition?
      Instead, we handle string repetition in parse_primval,
      and build_generalized_call. */
-  switch (PEEK_TOKEN())
+  switch (PEEK_TOKEN ())
     {
-    case NOT:  op = UNOP_LOGICAL_NOT; break;
-    case '-':  op = UNOP_NEG; break;
+    case NOT:
+      op = UNOP_LOGICAL_NOT;
+      break;
+    case '-':
+      op = UNOP_NEG;
+      break;
     default:
       op = OP_NULL;
     }
   if (op != OP_NULL)
-    FORWARD_TOKEN();
-  parse_operand6();
+    FORWARD_TOKEN ();
+  parse_operand6 ();
   if (op != OP_NULL)
     write_exp_elt_opcode (op);
 }
@@ -978,20 +995,28 @@ static void
 parse_operand4 ()
 {
   enum exp_opcode op;
-  parse_operand5();
+  parse_operand5 ();
   for (;;)
     {
-      switch (PEEK_TOKEN())
+      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;
+       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();
+      FORWARD_TOKEN ();
+      parse_operand5 ();
       write_exp_elt_opcode (op);
     }
 }
@@ -1003,16 +1028,22 @@ parse_operand3 ()
   parse_operand4 ();
   for (;;)
     {
-      switch (PEEK_TOKEN())
+      switch (PEEK_TOKEN ())
        {
-       case '+':    op = BINOP_ADD; break;
-       case '-':    op = BINOP_SUB; break;
-       case SLASH_SLASH: op = BINOP_CONCAT; break;
+       case '+':
+         op = BINOP_ADD;
+         break;
+       case '-':
+         op = BINOP_SUB;
+         break;
+       case SLASH_SLASH:
+         op = BINOP_CONCAT;
+         break;
        default:
          return;
        }
-      FORWARD_TOKEN();
-      parse_operand4();
+      FORWARD_TOKEN ();
+      parse_operand4 ();
       write_exp_elt_opcode (op);
     }
 }
@@ -1026,24 +1057,36 @@ parse_operand2 ()
     {
       if (check_token (IN))
        {
-         parse_operand3();
+         parse_operand3 ();
          write_exp_elt_opcode (BINOP_IN);
        }
       else
        {
-         switch (PEEK_TOKEN())
+         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;
+           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();
+         FORWARD_TOKEN ();
+         parse_operand3 ();
          write_exp_elt_opcode (op);
        }
     }
@@ -1056,36 +1099,46 @@ parse_operand1 ()
   parse_operand2 ();
   for (;;)
     {
-      switch (PEEK_TOKEN())
+      switch (PEEK_TOKEN ())
        {
-       case LOGAND: op = BINOP_BITWISE_AND; break;
-       case ANDIF:  op = BINOP_LOGICAL_AND; break;
+       case LOGAND:
+         op = BINOP_BITWISE_AND;
+         break;
+       case ANDIF:
+         op = BINOP_LOGICAL_AND;
+         break;
        default:
          return;
        }
-      FORWARD_TOKEN();
-      parse_operand2();
+      FORWARD_TOKEN ();
+      parse_operand2 ();
       write_exp_elt_opcode (op);
     }
 }
 
 static void
 parse_operand0 ()
-{ 
+{
   enum exp_opcode op;
-  parse_operand1();
+  parse_operand1 ();
   for (;;)
     {
-      switch (PEEK_TOKEN())
+      switch (PEEK_TOKEN ())
        {
-       case LOGIOR:  op = BINOP_BITWISE_IOR; break;
-       case LOGXOR:  op = BINOP_BITWISE_XOR; break;
-       case ORIF:    op = BINOP_LOGICAL_OR; break;
+       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();
+      FORWARD_TOKEN ();
+      parse_operand1 ();
       write_exp_elt_opcode (op);
     }
 }
@@ -1147,7 +1200,7 @@ parse_if_expression ()
 static void
 parse_untyped_expr ()
 {
-  switch (PEEK_TOKEN())
+  switch (PEEK_TOKEN ())
     {
     case IF:
       parse_if_expression ();
@@ -1155,7 +1208,7 @@ parse_untyped_expr ()
     case CASE:
       error ("not implemented:  CASE expression");
     case '(':
-      switch (PEEK_TOKEN1())
+      switch (PEEK_TOKEN1 ())
        {
        case IF:
        case CASE:
@@ -1166,7 +1219,7 @@ parse_untyped_expr ()
          parse_untyped_expr ();
          expect (')', "missing ')'");
          return;
-       default: ;
+       default:;
          /* fall through */
        }
     default:
@@ -1180,9 +1233,9 @@ chill_parse ()
   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);
+      write_exp_elt_opcode (OP_TYPE);
+      write_exp_elt_type (PEEK_LVAL ().tsym.type);
+      write_exp_elt_opcode (OP_TYPE);
       FORWARD_TOKEN ();
     }
   else
@@ -1190,7 +1243,7 @@ chill_parse ()
   if (terminal_buffer[0] != END_TOKEN)
     {
       if (comma_terminates && terminal_buffer[0] == ',')
-       lexptr--;  /* Put the comma back.  */
+       lexptr--;               /* Put the comma back.  */
       else
        error ("Junk after end of expression.");
     }
@@ -1249,9 +1302,11 @@ match_simple_name_string ()
   if (isalpha (*tokptr) || *tokptr == '_')
     {
       char *result;
-      do {
-       tokptr++;
-      } while (isalnum (*tokptr) || (*tokptr == '_'));
+      do
+       {
+         tokptr++;
+       }
+      while (isalnum (*tokptr) || (*tokptr == '_'));
       yylval.sval.ptr = lexptr;
       yylval.sval.length = tokptr - lexptr;
       lexptr = tokptr;
@@ -1266,12 +1321,12 @@ match_simple_name_string ()
    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 (base, tokptrptr, ivalptr)
-  int base;
-  char **tokptrptr;
-  LONGEST *ivalptr;
+     int base;
+     char **tokptrptr;
+     LONGEST *ivalptr;
 {
   char *tokptr = *tokptrptr;
   int temp;
@@ -1281,17 +1336,30 @@ decode_integer_value (base, tokptrptr, ivalptr)
     {
       temp = *tokptr;
       if (isupper (temp))
-        temp = tolower (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':
+       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':
+       case 'a':
+       case 'b':
+       case 'c':
+       case 'd':
+       case 'e':
+       case 'f':
          temp -= 'a';
          temp += 10;
          break;
@@ -1308,15 +1376,15 @@ decode_integer_value (base, tokptrptr, ivalptr)
       else
        {
          /* Found something not in domain for current base. */
-         tokptr--;     /* Unconsume what gave us indigestion. */
+         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);
@@ -1330,16 +1398,16 @@ decode_integer_value (base, tokptrptr, ivalptr)
 
 static int
 decode_integer_literal (valptr, tokptrptr)
-  LONGEST *valptr;
-  char **tokptrptr;
+     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':
@@ -1370,15 +1438,15 @@ decode_integer_literal (valptr, tokptrptr)
       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
@@ -1404,15 +1472,15 @@ decode_integer_literal (valptr, tokptrptr)
 }
 
 /*  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. */
-    
+   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 ()
 {
@@ -1421,12 +1489,12 @@ match_float_literal ()
   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
@@ -1450,26 +1518,26 @@ match_float_literal ()
 
   switch (*tokptr++)
     {
-      case '.':
-        /* Accept and then look for fractional part and/or exponent. */
-       *copy++ = '.';
-       break;
+    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;
+    case 'e':
+    case 'E':
+    case 'd':
+    case 'D':
+      if (copy == buf)
+       {
+         return (0);
+       }
+      *copy++ = 'e';
+      goto collect_exponent;
+      break;
 
-      default:
-       return (0);
-        break;
+    default:
+      return (0);
+      break;
     }
 
   /* We found a '.', copy any fractional digits to the conversion buffer, up
@@ -1490,21 +1558,21 @@ match_float_literal ()
 
   switch (*tokptr)
     {
-      case 'e':
-      case 'E':
-      case 'd':
-      case 'D':
-       *copy++ = 'e';
-       tokptr++;
-       break;
-      default:
-       goto convert_float;
-       break;
+    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:
+collect_exponent:
   if (*tokptr == '+' || *tokptr == '-')
     {
       *copy++ = *tokptr++;
@@ -1522,18 +1590,18 @@ match_float_literal ()
      contents as a floating point value.  If any characters remain, then we
      must not have a valid floating point string. */
 
-  convert_float:
+convert_float:
   *copy = '\0';
   if (copy != buf)
-      {
-        dval = strtod (buf, &copy);
-        if (*copy == '\0')
-         {
-           yylval.dval = dval;
-           lexptr = tokptr;
-           return (FLOAT_LITERAL);
-         }
-      }
+    {
+      dval = strtod (buf, &copy);
+      if (*copy == '\0')
+       {
+         yylval.dval = dval;
+         lexptr = tokptr;
+         return (FLOAT_LITERAL);
+       }
+    }
   return (0);
 }
 
@@ -1553,7 +1621,7 @@ match_string_literal ()
   for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
     {
       CHECKBUF (1);
-    tryagain: ;
+    tryagain:;
       if (in_ctrlseq)
        {
          /* skip possible whitespaces */
@@ -1608,7 +1676,7 @@ match_string_literal ()
   if (in_ctrlseq)
     error ("Invalid control sequence");
 
-  if (*tokptr == '\0'                                  /* no terminator */
+  if (*tokptr == '\0'          /* no terminator */
       || (tempbufindex == 1 && *tokptr == '\''))       /* char literal */
     {
       return (0);
@@ -1637,19 +1705,19 @@ match_string_literal ()
    a string literal.
 
    Returns CHARACTER_LITERAL if a match is found.
  */
+ */
 
 static enum ch_terminal
 match_character_literal ()
 {
   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. */
+         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 != '\''))
        {
@@ -1662,15 +1730,15 @@ match_character_literal ()
       tokptr++;
 
       /* Determine which form we have, either a control sequence or the
-        single character form. */
-      
+         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 ')'. */
+                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++ != ')'))
                {
@@ -1698,8 +1766,8 @@ match_character_literal ()
        }
 
       /* The trailing quote has not yet been consumed.  If we don't find
-        it, then we have no match. */
-      
+         it, then we have no match. */
+
       if (*tokptr++ != '\'')
        {
          return (0);
@@ -1726,16 +1794,16 @@ match_integer_literal ()
 {
   char *tokptr = lexptr;
   LONGEST ival;
-  
+
   if (!decode_integer_literal (&ival, &tokptr))
     {
       return (0);
     }
-  else 
+  else
     {
       yylval.typed_val.val = ival;
 #if defined(CC_HAS_LONG_LONG) && defined(__STDC__)
-      if (ival > (LONGEST)2147483647U || ival < -(LONGEST)2147483648U)
+      if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U)
        yylval.typed_val.type = builtin_type_long_long;
       else
 #endif
@@ -1758,13 +1826,13 @@ match_bitstring_literal ()
   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':
@@ -1785,33 +1853,46 @@ match_bitstring_literal ()
     }
 
   /* 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);
+       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;
+       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)
        {
@@ -1830,21 +1911,21 @@ match_bitstring_literal ()
                {
                  tempbuf[tempbufindex] |=
                    (TARGET_BYTE_ORDER == BIG_ENDIAN)
-                     ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
-                       : (1 << bitoffset);
+                   ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
+                   : (1 << bitoffset);
                }
              bitoffset++;
              if (bitoffset == HOST_CHAR_BIT)
                {
                  bitoffset = 0;
                  tempbufindex++;
-                 CHECKBUF(1);
+                 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). */
 
@@ -1852,7 +1933,7 @@ match_bitstring_literal ()
     {
       return (0);
     }
-  else 
+  else
     {
       yylval.sval.ptr = tempbuf;
       yylval.sval.length = bitcount;
@@ -1869,40 +1950,40 @@ struct 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 }
+  {"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 }
+  {":=", GDB_ASSIGNMENT},
+  {"//", SLASH_SLASH},
+  {"->", POINTER},
+  {"/=", NOTEQUAL},
+  {"<=", LEQ},
+  {">=", GEQ}
 };
 
 /* Read one token, getting characters through lexptr.  */
@@ -1912,240 +1993,243 @@ static const struct token tokentab2[] =
 static enum ch_terminal
 ch_lex ()
 {
-    unsigned int i;
-    enum ch_terminal token;
-    char *inputname;
-    struct symbol *sym;
+  unsigned int i;
+  enum ch_terminal token;
+  char *inputname;
+  struct symbol *sym;
 
-    /* Skip over any leading whitespace. */
-    while (isspace (*lexptr))
+  /* 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)
        {
-           lexptr++;
+         return (token);
        }
-    /* Look for special single character cases which can't be the first
-       character of some other multicharacter token. */
-    switch (*lexptr)
+      if (*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)
+      break;
+    case 'C':
+    case 'c':
+      token = match_character_literal ();
+      if (token != 0)
        {
-           return (token);
+         return (token);
        }
-    token = match_bitstring_literal ();
-    if (token != 0)
+      break;
+    case '$':
+      yylval.sval.ptr = lexptr;
+      do
        {
-           return (token);
+         lexptr++;
        }
-    token = match_integer_literal ();
-    if (token != 0)
+      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))
        {
-           return (token);
+         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. */
+  /* 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 ();
+  inputname = match_simple_name_string ();
 
-    if (inputname != NULL)
-      {
-       char *simplename = (char*) alloca (strlen (inputname) + 1);
+  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';
+      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++)
+      /* See if it is a reserved identifier. */
+      for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
+       {
+         if (STREQ (simplename, idtokentab[i].operator))
            {
-               if (STREQ (simplename, idtokentab[i].operator))
-                   {
-                       return (idtokentab[i].token);
-                   }
+             return (idtokentab[i].token);
            }
+       }
 
-       /* Look for other special tokens. */
-       if (STREQ (simplename, "true"))
-           {
-               yylval.ulval = 1;
-               return (BOOLEAN_LITERAL);
-           }
-       if (STREQ (simplename, "false"))
+      /* 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))
            {
-               yylval.ulval = 0;
-               return (BOOLEAN_LITERAL);
+           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;
+           case LOC_UNRESOLVED:
+             error ("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);
+       }
+    }
 
-       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;
-             case LOC_UNRESOLVED:
-               error ("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. */
+  /* 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;
-      }
+  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);
+  return (ILLEGAL_TOKEN);
 }
 
 static void
 write_lower_upper_value (opcode, type)
-     enum exp_opcode opcode;  /* Either UNOP_LOWER or UNOP_UPPER */
+     enum exp_opcode opcode;   /* Either UNOP_LOWER or UNOP_UPPER */
      struct type *type;
 {
   if (type == NULL)
index d151749f03fffcdf1633f8ccaaa07f0ec386d54d..c3a3d90719ef739eb3002a8f4f28ea46969a6f96 100644 (file)
@@ -1,21 +1,22 @@
 /* Chill language support routines for GDB, the GNU debugger.
    Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -29,22 +30,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern void _initialize_chill_language PARAMS ((void));
 
 static value_ptr
-evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));
+  evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));
 
 static value_ptr
-value_chill_max_min PARAMS ((enum exp_opcode, value_ptr));
+  value_chill_max_min PARAMS ((enum exp_opcode, value_ptr));
 
 static value_ptr
-value_chill_card PARAMS ((value_ptr));
+  value_chill_card PARAMS ((value_ptr));
 
 static value_ptr
- value_chill_length PARAMS ((value_ptr));
 value_chill_length PARAMS ((value_ptr));
 
 static struct type *
-chill_create_fundamental_type PARAMS ((struct objfile *, int));
+  chill_create_fundamental_type PARAMS ((struct objfile *, int));
 
 static void
-chill_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+chill_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
 
 static void
 chill_printchar PARAMS ((int, GDB_FILE *));
@@ -110,7 +111,7 @@ chill_printchar (c, stream)
    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 (stream, string, length, width, force_ellipses)
@@ -138,7 +139,7 @@ chill_printstr (stream, string, length, width, force_ellipses)
   for (i = 0; i < length && things_printed < print_max; ++i)
     {
       /* 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;
@@ -177,7 +178,7 @@ chill_printstr (stream, string, length, width, force_ellipses)
        }
       else
        {
-         if (! in_literal_form && ! in_control_form)
+         if (!in_literal_form && !in_control_form)
            fputs_filtered ("\"", stream);
          if (PRINT_LITERAL_FORM (c))
            {
@@ -239,90 +240,91 @@ chill_create_fundamental_type (objfile, typeid)
 
   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;
-      }
+    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);
 }
-
 \f
+
 /* 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}
+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}
 };
 \f
 /* The built-in types of Chill.  */
@@ -333,14 +335,14 @@ struct type *builtin_type_chill_long;
 struct type *builtin_type_chill_ulong;
 struct type *builtin_type_chill_real;
 
-struct type ** CONST_PTR (chill_builtin_types[]) = 
+struct type **CONST_PTR (chill_builtin_types[]) =
 {
   &builtin_type_chill_bool,
-  &builtin_type_chill_char,
-  &builtin_type_chill_long,
-  &builtin_type_chill_ulong,
-  &builtin_type_chill_real,
-  0
+    &builtin_type_chill_char,
+    &builtin_type_chill_long,
+    &builtin_type_chill_ulong,
+    &builtin_type_chill_real,
+    0
 };
 
 /* Calculate LOWER or UPPER of TYPE.
@@ -349,7 +351,7 @@ struct type ** CONST_PTR (chill_builtin_types[]) =
 
 LONGEST
 type_lower_upper (op, type, result_type)
-     enum exp_opcode op;  /* Either UNOP_LOWER or UNOP_UPPER */
+     enum exp_opcode op;       /* Either UNOP_LOWER or UNOP_UPPER */
      struct type *type;
      struct type **result_type;
 {
@@ -366,7 +368,7 @@ type_lower_upper (op, type, result_type)
     case TYPE_CODE_ARRAY:
     case TYPE_CODE_BITSTRING:
     case TYPE_CODE_STRING:
-      type = TYPE_FIELD_TYPE (type, 0);  /* Get index type */
+      type = TYPE_FIELD_TYPE (type, 0);                /* Get index type */
 
       /* ... fall through ... */
     case TYPE_CODE_RANGE:
@@ -505,8 +507,8 @@ value_chill_max_min (op, val)
     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,
+                            ? TYPE_TARGET_TYPE (elttype)
+                            : elttype,
                             tmp);
 }
 
@@ -560,12 +562,12 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
          for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
            {
              argvec[tem]
-               = evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem-1),
+               = 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 */
+         argvec[tem] = 0;      /* signal end of arglist */
 
          return call_function_by_hand (argvec[0], nargs, argvec + 1);
        default:
@@ -616,11 +618,12 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
     }
 
   return evaluate_subexp_standard (expect_type, exp, pos, noside);
- nosideret:
+nosideret:
   return value_from_longest (builtin_type_long, (LONGEST) 1);
 }
 
-const struct language_defn chill_language_defn = {
+const struct language_defn chill_language_defn =
+{
   "chill",
   language_chill,
   chill_builtin_types,
@@ -632,18 +635,18 @@ const struct language_defn chill_language_defn = {
   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_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 */
+  {"", "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 */ 
+  &builtin_type_chill_char,    /* Type of string elements */
   LANG_MAGIC
 };
 
index 6525c3066c69d1d7235e8edf24a86511c45bf39f..764d32132e188dc4786fa13532912cbe0add98f7 100644 (file)
@@ -1,23 +1,24 @@
 /* Chill language support definitions for GDB, the GNU debugger.
    Copyright 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct value;
 #endif
 
@@ -39,4 +40,4 @@ chill_value_print PARAMS ((struct value *, GDB_FILE *,
                           int, enum val_prettyprint));
 
 extern LONGEST
-type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));
+  type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));
index a6b1944d3870f8886ec06a3d75a22792e0ad57a0..b088ddea7f134474a4142ad871510b76ca002ff7 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for printing Chill types for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -104,243 +105,246 @@ chill_type_print_base (type, stream, show, level)
 
   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);
+    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_FLAGS (type) & TYPE_FLAG_STUB)
+               {
+                 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
-         {
-           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 ("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_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 (");
+      }
+      break;
+
+    case TYPE_CODE_ENUM:
+      {
+       register int lastval = 0;
+       fprintf_filtered (stream, "SET (");
        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)
+           QUIT;
+           if (i)
+             fprintf_filtered (stream, ", ");
+           wrap_here ("    ");
+           fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
+           if (lastval != TYPE_FIELD_BITPOS (type, i))
              {
-               chill_type_print_base (TYPE_TARGET_TYPE (param_type),
-                                      stream, 0, level);
-               fputs_filtered (" LOC", stream);
+               fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
+               lastval = TYPE_FIELD_BITPOS (type, i);
              }
-           else
-             chill_type_print_base (param_type, stream, show, level);
+           lastval++;
          }
        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;
+      }
+      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 ");
+    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;
 
-           fprintf_filtered (stream, "(\n");
-           if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
-             {
-               if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
-                 {
-                   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;
+    default:
 
-      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;
+      /* 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. */
 
-      case TYPE_CODE_ENUM:
+      if (TYPE_NAME (type) != NULL)
        {
-         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, ")");
+         fputs_filtered (TYPE_NAME (type), 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;
-      }
+      else
+       {
+         error ("Unrecognized type code (%d) in symbol table.",
+                TYPE_CODE (type));
+       }
+      break;
+    }
 }
index 663ba6428c1af867083d96ee30bfb71b5caa847e..77f9018d0d626949022ba4cf9fb375f23a06807f 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "value.h"
 #include "language.h"
 #include "demangle.h"
-#include "c-lang.h" /* For c_val_print */
+#include "c-lang.h"            /* For c_val_print */
 #include "typeprint.h"
 #include "ch-lang.h"
 #include "annotate.h"
@@ -41,9 +42,9 @@ chill_print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
 
 static void
 chill_val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
-                                       int, int, int, enum val_prettyprint));
-
+                                     int, int, int, enum val_prettyprint));
 \f
+
 /* 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
@@ -120,8 +121,8 @@ chill_val_print_array_elements (type, valaddr, address, stream,
   unsigned int rep1;
   /* Number of repetitions we have detected so far.  */
   unsigned int reps;
-  LONGEST low_bound =  TYPE_FIELD_BITPOS (range_type, 0);
-      
+  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;
@@ -146,7 +147,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
 
       rep1 = i + 1;
       reps = 1;
-      while ((rep1 < len) && 
+      while ((rep1 < len) &&
             !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
        {
          ++reps;
@@ -198,7 +199,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
 
 int
 chill_val_print (type, valaddr, embedded_offset, address,
-                 stream, format, deref_ref, recurse, pretty)
+                stream, format, deref_ref, recurse, pretty)
      struct type *type;
      char *valaddr;
      int embedded_offset;
@@ -227,7 +228,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
            }
          fprintf_filtered (stream, "[");
          chill_val_print_array_elements (type, valaddr, address, stream,
-                                         format, deref_ref, recurse, pretty);
+                                       format, deref_ref, recurse, pretty);
          fprintf_filtered (stream, "]");
        }
       else
@@ -288,8 +289,8 @@ chill_val_print (type, valaddr, embedded_offset, address,
 
     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.  */
+         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;
 
@@ -308,7 +309,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
          fputs_filtered ("NULL", stream);
          return 0;
        }
-      
+
       if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
        {
          /* Try to print what function it points to.  */
@@ -320,20 +321,20 @@ chill_val_print (type, valaddr, embedded_offset, address,
        {
          print_address_numeric (addr, 1, stream);
        }
-      
+
       /* For a pointer to char or unsigned char, also print the string
-        pointed to, unless pointer is null.  */
+         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.  */
+         &&                    /* 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".  */
+         terminating null if we have "reached the end".  */
       return (i + (print_max && i != print_max));
       break;
 
@@ -341,7 +342,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
       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".  */
+         null if we have "reached the end".  */
       return (i + (print_max && i != print_max));
       break;
 
@@ -393,11 +394,11 @@ chill_val_print (type, valaddr, embedded_offset, address,
                need_comma = 1;
 
                /* Look for a continuous range of true elements. */
-               if (i+1 <= high_bound && value_bit_index (type, valaddr, ++i))
+               if (i + 1 <= high_bound && value_bit_index (type, valaddr, ++i))
                  {
-                   int j = i; /* j is the upper bound so far of the range */
+                   int j = i;  /* j is the upper bound so far of the range */
                    fputs_filtered (":", stream);
-                   while (i+1 <= high_bound
+                   while (i + 1 <= high_bound
                           && value_bit_index (type, valaddr, ++i))
                      j = i;
                    chill_print_type_scalar (range, (LONGEST) j, stream);
@@ -418,14 +419,14 @@ chill_val_print (type, valaddr, embedded_offset, address,
          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*",
+                       "<dynamic length %ld > static length %d> *invalid*",
                                    length, TYPE_LENGTH (type));
 
                  /* Don't print the string; doing so might produce a
@@ -444,7 +445,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
 
     case TYPE_CODE_REF:
       if (addressprint)
-        {
+       {
          fprintf_filtered (stream, "LOC(");
          print_address_numeric
            (extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT),
@@ -453,21 +454,21 @@ chill_val_print (type, valaddr, embedded_offset, address,
          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)
            {
              value_ptr deref_val =
-               value_at
-                 (TYPE_TARGET_TYPE (type),
-                  unpack_pointer (lookup_pointer_type (builtin_type_void),
-                                  valaddr),
-                  NULL);
+             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,
+                        0,
                         VALUE_ADDRESS (deref_val), stream, format,
                         deref_ref, recurse + 1, pretty);
            }
@@ -494,7 +495,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
     case TYPE_CODE_ERROR:
     default:
       /* Let's defer printing to the C printer, rather than
-        print an error message.  FIXME! */
+         print an error message.  FIXME! */
       c_val_print (type, valaddr, 0, address, stream, format,
                   deref_ref, recurse, pretty);
     }
@@ -547,7 +548,7 @@ chill_print_value_fields (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));
            }
@@ -560,16 +561,16 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
              value_ptr v;
 
              /* Bitfields require special handling, especially due to byte
-                order problems.  */
+                order problems.  */
              v = value_from_longest (TYPE_FIELD_TYPE (type, i),
-                                     unpack_field_as_long (type, valaddr, 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), 
+             chill_val_print (TYPE_FIELD_TYPE (type, i),
                               valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
                               0, stream, format, 0, recurse + 1, pretty);
            }
@@ -591,7 +592,7 @@ chill_value_print (val, stream, format, pretty)
      enum val_prettyprint pretty;
 {
   struct type *type = VALUE_TYPE (val);
-  struct type *real_type = check_typedef  (type);
+  struct type *real_type = check_typedef (type);
 
   /* If it is a pointer, indicate what it points to.
 
@@ -626,5 +627,3 @@ chill_value_print (val, stream, format, pretty)
   return (val_print (type, VALUE_CONTENTS (val), 0,
                     VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
 }
-
-
index 6be68697928f14ac2ebba7d7128db5cc6a287449..b25a26ce6c04fe9e2cee4a62da2ead719412f05e 100644 (file)
@@ -1,21 +1,22 @@
 /* Handle COFF SVR3 shared libraries for GDB, the GNU Debugger.
    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 file is part of GDB.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is free software; you can 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.
 
-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 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"
@@ -27,31 +28,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       coff_solib_add -- add a shared library files to the symtab list.  We
-       examine the `.lib' section of the exec file and determine the names of
-       the shared libraries.
+   coff_solib_add -- add a shared library files to the symtab list.  We
+   examine the `.lib' section of the exec file and determine the names of
+   the shared libraries.
 
-       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.
+   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.
 
-SYNOPSIS
+   SYNOPSIS
 
-       void coff_solib_add (char *arg_string, int from_tty,
-                            struct target_ops *target)
+   void coff_solib_add (char *arg_string, int from_tty,
+   struct target_ops *target)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 void
 coff_solib_add (arg_string, from_tty, target)
      char *arg_string;
      int from_tty;
      struct target_ops *target;
-{      
+{
   asection *libsect;
 
   libsect = bfd_get_section_by_name (exec_bfd, ".lib");
@@ -79,7 +80,7 @@ coff_solib_add (arg_string, from_tty, target)
          int len, nameoffset;
          char *filename;
 
-         ent = (struct libent *)lib;
+         ent = (struct libent *) lib;
 
          len = bfd_get_32 (exec_bfd, ent->len);
 
@@ -88,47 +89,47 @@ coff_solib_add (arg_string, from_tty, target)
          if (len <= 0)
            break;
 
-         filename = (char *)ent + nameoffset * 4;
+         filename = (char *) ent + nameoffset * 4;
 
          objfile = symbol_file_add (filename, from_tty,
-                                    0, /* addr */
-                                    0, /* not mainline */
-                                    0, /* not mapped */
-                                    0, /* Not readnow */
-                                     0, /* Not user loaded */
-                                     1); /* Is a solib */
+                                    0,         /* addr */
+                                    0,         /* not mainline */
+                                    0,         /* not mapped */
+                                    0,         /* Not readnow */
+                                    0,         /* Not user loaded */
+                                    1);        /* Is a solib */
 
          libsize -= len * 4;
          lib += len * 4;
        }
 
       /* Getting new symbols may change our opinion about what is
-        frameless.  */
+         frameless.  */
       reinit_frame_cache ();
     }
 }
 
 /*
-  
-GLOBAL FUNCTION
-  
-       coff_solib_create_inferior_hook -- shared library startup support
-  
-SYNOPSIS
-  
-       void coff_solib_create_inferior_hook()
-  
-DESCRIPTION
-  
-       When gdb starts up the inferior, the kernel maps in the shared
-       libraries.  We get here with the target stopped at it's first
-       instruction, and the libraries already mapped.  At this point, this
-       function gets called via expansion of the macro
-       SOLIB_CREATE_INFERIOR_HOOK.
 */
-
-void 
-coff_solib_create_inferior_hook()
+
+   GLOBAL FUNCTION
+
+   coff_solib_create_inferior_hook -- shared library startup support
+
+   SYNOPSIS
+
+   void coff_solib_create_inferior_hook()
+
+   DESCRIPTION
+
+   When gdb starts up the inferior, the kernel maps in the shared
+   libraries.  We get here with the target stopped at it's first
+   instruction, and the libraries already mapped.  At this      point, this
+   function gets called via expansion of the macro
+   SOLIB_CREATE_INFERIOR_HOOK.
+ */
+
+void
+coff_solib_create_inferior_hook ()
 {
   coff_solib_add ((char *) 0, 0, (struct target_ops *) 0);
 }
index 43375ccd460a97962da24f519a3ce77d91f9ef6d..71f707fbf298768a5505bc3df8afb38a0b70f388 100644 (file)
@@ -1,23 +1,24 @@
 /* COFF (SVR3) Shared library declarations for GDB, the GNU Debugger.
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decl's for prototypes */
+#ifdef __STDC__                        /* Forward decl's for prototypes */
 struct target_ops;
 #endif
 
@@ -47,7 +48,7 @@ coff_solib_add PARAMS ((char *, int, struct target_ops *));
 #define SOLIB_CREATE_INFERIOR_HOOK(PID)        coff_solib_create_inferior_hook()
 
 extern void
-coff_solib_create_inferior_hook PARAMS((void));        /* solib.c */
+coff_solib_create_inferior_hook PARAMS ((void));       /* solib.c */
 
 /* Function to be called to remove the connection between debugger and
    dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
@@ -55,7 +56,7 @@ coff_solib_create_inferior_hook PARAMS((void));       /* solib.c */
    the debugger, as CLEAR_SOLIB does.)
 
    This functionality is presently not implemented for this target.
  */
+ */
 #define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0)
 
 /* This function is called by the "catch load" command.  It allows
@@ -63,7 +64,7 @@ coff_solib_create_inferior_hook PARAMS((void));       /* solib.c */
    library file (or any library file, if filename is NULL) is loaded.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string) \
    error("catch of library loads/unloads not yet implemented on this platform")
 
@@ -72,7 +73,7 @@ coff_solib_create_inferior_hook PARAMS((void));       /* solib.c */
    library file (or any library file, if filename is NULL) is unloaded.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename,cond_string) \
    error("catch of library loads/unloads not yet implemented on this platform")
 
@@ -83,11 +84,11 @@ coff_solib_create_inferior_hook PARAMS((void));     /* solib.c */
    the dynamic linker hook, or undefined results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 /*
-#define SOLIB_HAVE_LOAD_EVENT(pid) \
+   #define SOLIB_HAVE_LOAD_EVENT(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_HAVE_LOAD_EVENT(pid) \
 (0)
@@ -104,12 +105,12 @@ coff_solib_create_inferior_hook PARAMS((void));   /* solib.c */
    string if they wish to continue the inferior and then access the string.
 
    Presently, this functionality is not implemented.
  */
+ */
 
 /*
-#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
+   #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
 (0)
@@ -121,11 +122,11 @@ coff_solib_create_inferior_hook PARAMS((void));   /* solib.c */
    the dynamic linker hook, or undefined results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 /*
-#define SOLIB_HAVE_UNLOAD_EVENT(pid) \
+   #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
 (0)
@@ -142,11 +143,11 @@ coff_solib_create_inferior_hook PARAMS((void));   /* solib.c */
    string if they wish to continue the inferior and then access the string.
 
    Presently, this functionality is not implemented.
  */
+ */
 /*
-#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
+   #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
 (0)
@@ -160,12 +161,12 @@ coff_solib_create_inferior_hook PARAMS((void));   /* solib.c */
    results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 
 /*
-#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
+   #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
 (0)
@@ -175,7 +176,7 @@ coff_solib_create_inferior_hook PARAMS((void));     /* solib.c */
    any symbol tables.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_RESTART() \
   (0)
 
@@ -186,5 +187,5 @@ coff_solib_create_inferior_hook PARAMS((void));     /* solib.c */
 #define DISABLE_UNSETTABLE_BREAK(addr) coff_solib_address(addr)
 
 extern int
-solib_address PARAMS ((CORE_ADDR));            /* solib.c */
+solib_address PARAMS ((CORE_ADDR));    /* solib.c */
 #endif
index 1a63cfb755280e6c66c589b712a63afc4208c605..1a923ebff6600d755967cbb27d778f59d063421e 100644 (file)
@@ -1,23 +1,24 @@
 /* Read coff symbol tables and convert to internal format, for GDB.
    Copyright 1987, 88, 89, 90, 91, 92, 93, 94, 96, 97, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
    Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -44,16 +45,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 extern void _initialize_coffread PARAMS ((void));
 
-struct coff_symfile_info {
-  file_ptr min_lineno_offset;          /* Where in file lowest line#s are */
-  file_ptr max_lineno_offset;          /* 1+last byte of line#s in file */
+struct coff_symfile_info
+  {
+    file_ptr min_lineno_offset;        /* Where in file lowest line#s are */
+    file_ptr max_lineno_offset;        /* 1+last byte of line#s in file */
 
-  CORE_ADDR textaddr;                  /* Addr of .text section. */
-  unsigned int textsize;               /* Size of .text section. */
-  struct stab_section_list *stabsects; /* .stab sections.  */
-  asection *stabstrsect;               /* Section pointer for .stab section */
-  char *stabstrdata;
-};
+    CORE_ADDR textaddr;                /* Addr of .text section. */
+    unsigned int textsize;     /* Size of .text section. */
+    struct stab_section_list *stabsects;       /* .stab sections.  */
+    asection *stabstrsect;     /* Section pointer for .stab section */
+    char *stabstrdata;
+  };
 
 /* Translate an external name string into a user-visible name.  */
 #define        EXTERNAL_NAME(string, abfd) \
@@ -71,7 +73,7 @@ struct coff_symfile_info {
    to map one to one onto the sdb register numbers.  */
 
 #ifndef SDB_REG_TO_REGNUM
-# define SDB_REG_TO_REGNUM(value)     (value)
+#define SDB_REG_TO_REGNUM(value)     (value)
 #endif
 
 /* Core address of start and end of text of current source file.
@@ -98,24 +100,24 @@ static char *temp_aux;
    internally to the BTYPE, ISPTR, ISFCN, ISARY, ISTAG, and DECREF
    macros from include/coff/internal.h .  */
 
-static unsigned        local_n_btmask;
-static unsigned        local_n_btshft;
-static unsigned        local_n_tmask;
-static unsigned        local_n_tshift;
+static unsigned local_n_btmask;
+static unsigned local_n_btshft;
+static unsigned local_n_tmask;
+static unsigned local_n_tshift;
 
 #define        N_BTMASK        local_n_btmask
 #define        N_BTSHFT        local_n_btshft
 #define        N_TMASK         local_n_tmask
 #define        N_TSHIFT        local_n_tshift
+
 /* Local variables that hold the sizes in the file of various COFF structures.
    (We only need to know this to read them from the file -- BFD will then
    translate the data in them, into `internal_xxx' structs in the right
    byte order, alignment, etc.)  */
 
-static unsigned        local_linesz;
-static unsigned        local_symesz;
-static unsigned        local_auxesz;
+static unsigned local_linesz;
+static unsigned local_symesz;
+static unsigned local_auxesz;
 
 /* This is set if this is a PE format file.  */
 
@@ -128,50 +130,51 @@ static struct symbol *opaque_type_chain[HASHSIZE];
 
 /* Complaints about various problems in the file being read  */
 
-struct complaint ef_complaint = 
-  {"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
+struct complaint ef_complaint =
+{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
 
-struct complaint ef_stack_complaint = 
-  {"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0};
+struct complaint ef_stack_complaint =
+{"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0};
 
-struct complaint eb_stack_complaint = 
-  {"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0};
+struct complaint eb_stack_complaint =
+{"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0};
 
 struct complaint bf_no_aux_complaint =
-  {"`.bf' symbol %d has no aux entry", 0, 0};
+{"`.bf' symbol %d has no aux entry", 0, 0};
 
 struct complaint ef_no_aux_complaint =
-  {"`.ef' symbol %d has no aux entry", 0, 0};
+{"`.ef' symbol %d has no aux entry", 0, 0};
 
 struct complaint lineno_complaint =
-  {"Line number pointer %d lower than start of line numbers", 0, 0};
+{"Line number pointer %d lower than start of line numbers", 0, 0};
 
 struct complaint unexpected_type_complaint =
-  {"Unexpected type for symbol %s", 0, 0};
+{"Unexpected type for symbol %s", 0, 0};
 
 struct complaint bad_sclass_complaint =
-  {"Bad n_sclass for symbol %s", 0, 0};
+{"Bad n_sclass for symbol %s", 0, 0};
 
 struct complaint misordered_blocks_complaint =
-  {"Blocks out of order at address %x", 0, 0};
+{"Blocks out of order at address %x", 0, 0};
 
 struct complaint tagndx_bad_complaint =
-  {"Symbol table entry for %s has bad tagndx value", 0, 0};
+{"Symbol table entry for %s has bad tagndx value", 0, 0};
 
-struct complaint eb_complaint = 
-  {"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
+struct complaint eb_complaint =
+{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
 
 /* Simplified internal version of coff symbol table information */
 
-struct coff_symbol {
-  char *c_name;
-  int c_symnum;                /* symbol number of this entry */
-  int c_naux;          /* 0 if syment only, 1 if syment + auxent, etc */
-  long c_value;
-  int c_sclass;
-  int c_secnum;
-  unsigned int c_type;
-};
+struct coff_symbol
+  {
+    char *c_name;
+    int c_symnum;              /* symbol number of this entry */
+    int c_naux;                        /* 0 if syment only, 1 if syment + auxent, etc */
+    long c_value;
+    int c_sclass;
+    int c_secnum;
+    unsigned int c_type;
+  };
 
 static struct type *coff_read_struct_type PARAMS ((int, int, int));
 
@@ -286,7 +289,7 @@ coff_locate_sections (abfd, sectp, csip)
       /* We can have multiple .stab sections if linked with
          --split-by-reloc.  */
       for (s = name + sizeof ".stab" - 1; *s != '\0'; s++)
-       if (! isdigit (*s))
+       if (!isdigit (*s))
          break;
       if (*s == '\0')
        {
@@ -301,8 +304,8 @@ coff_locate_sections (abfd, sectp, csip)
          *pn = n;
 
          /* This will be run after coffstab_build_psymtabs is called
-             in coff_symfile_read, at which point we no longer need
-             the information.  */
+            in coff_symfile_read, at which point we no longer need
+            the information.  */
          make_cleanup (free, n);
        }
     }
@@ -311,19 +314,21 @@ coff_locate_sections (abfd, sectp, csip)
 /* Return the section_offsets* that CS points to.  */
 static int cs_to_section PARAMS ((struct coff_symbol *, struct objfile *));
 
-struct find_targ_sec_arg {
-  int targ_index;
-  asection **resultp;
-};
+struct find_targ_sec_arg
+  {
+    int targ_index;
+    asection **resultp;
+  };
 
 static void find_targ_sec PARAMS ((bfd *, asection *, void *));
 
-static void find_targ_sec (abfd, sect, obj)
+static void
+find_targ_sec (abfd, sect, obj)
      bfd *abfd;
      asection *sect;
      PTR obj;
 {
-  struct find_targ_sec_arg *args = (struct find_targ_sec_arg *)obj;
+  struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
   if (sect->target_index == args->targ_index)
     *args->resultp = sect;
 }
@@ -391,14 +396,14 @@ coff_lookup_type (index)
       int old_vector_length = type_vector_length;
 
       type_vector_length *= 2;
-      if (index /* is still */ >= type_vector_length)
+      if (index /* is still */  >= type_vector_length)
        type_vector_length = index * 2;
 
       type_vector = (struct type **)
        xrealloc ((char *) type_vector,
                  type_vector_length * sizeof (struct type *));
       memset (&type_vector[old_vector_length], 0,
-            (type_vector_length - old_vector_length) * sizeof(struct type *));
+        (type_vector_length - old_vector_length) * sizeof (struct type *));
     }
   return &type_vector[index];
 }
@@ -431,19 +436,19 @@ coff_alloc_type (index)
 
 static void
 coff_start_symtab (name)
-    char *name;
+     char *name;
 {
   start_symtab (
-               /* We fill in the filename later.  start_symtab puts
-                  this pointer into last_source_file and we put it in
-                  subfiles->name, which end_symtab frees; that's why
-                  it must be malloc'd.  */
-               savestring (name, strlen(name)),
-               /* We never know the directory name for COFF.  */
-               NULL,
-               /* The start address is irrelevant, since we set
-                  last_source_start_addr in coff_end_symtab.  */
-               0);
+  /* We fill in the filename later.  start_symtab puts
+     this pointer into last_source_file and we put it in
+     subfiles->name, which end_symtab frees; that's why
+     it must be malloc'd.  */
+                savestring (name, strlen (name)),
+  /* We never know the directory name for COFF.  */
+                NULL,
+  /* The start address is irrelevant, since we set
+     last_source_start_addr in coff_end_symtab.  */
+                0);
   record_debugformat ("COFF");
 }
 
@@ -454,9 +459,9 @@ coff_start_symtab (name)
 
 static void
 complete_symtab (name, start_addr, size)
-    char *name;
-    CORE_ADDR start_addr;
-    unsigned int size;
+     char *name;
+     CORE_ADDR start_addr;
+     unsigned int size;
 {
   if (last_source_file != NULL)
     free (last_source_file);
@@ -464,11 +469,11 @@ complete_symtab (name, start_addr, size)
   current_source_start_addr = start_addr;
   current_source_end_addr = start_addr + size;
 
-  if (current_objfile -> ei.entry_point >= current_source_start_addr &&
-      current_objfile -> ei.entry_point <  current_source_end_addr)
+  if (current_objfile->ei.entry_point >= current_source_start_addr &&
+      current_objfile->ei.entry_point < current_source_end_addr)
     {
-      current_objfile -> ei.entry_file_lowpc = current_source_start_addr;
-      current_objfile -> ei.entry_file_highpc = current_source_end_addr;
+      current_objfile->ei.entry_file_lowpc = current_source_start_addr;
+      current_objfile->ei.entry_file_highpc = current_source_end_addr;
     }
 }
 
@@ -502,7 +507,8 @@ record_minimal_symbol (name, address, type, objfile)
      struct objfile *objfile;
 {
   /* We don't want TDESC entry points in the minimal symbol table */
-  if (name[0] == '@') return;
+  if (name[0] == '@')
+    return;
 
   prim_record_minimal_symbol (name, address, type, objfile);
 }
@@ -567,7 +573,7 @@ find_linenos (abfd, asect, vpinfo)
     return;
   size = count * local_linesz;
 
-  info = (struct coff_symfile_info *)vpinfo;
+  info = (struct coff_symfile_info *) vpinfo;
 /* WARNING WILL ROBINSON!  ACCESSING BFD-PRIVATE DATA HERE!  FIXME!  */
   offset = asect->line_filepos;
 /* End of warning */
@@ -607,30 +613,30 @@ coff_symfile_read (objfile, section_offsets, mainline)
   struct cleanup *back_to;
   int stabstrsize;
 
-  info = (struct coff_symfile_info *) objfile -> sym_private;
+  info = (struct coff_symfile_info *) objfile->sym_private;
   dbxinfo = objfile->sym_stab_info;
-  symfile_bfd = abfd;                  /* Kludge for swap routines */
+  symfile_bfd = abfd;          /* Kludge for swap routines */
 
 /* WARNING WILL ROBINSON!  ACCESSING BFD-PRIVATE DATA HERE!  FIXME!  */
-   num_symbols = bfd_get_symcount (abfd);      /* How many syms */
-   symtab_offset = cdata->sym_filepos;         /* Symbol table file offset */
-   stringtab_offset = symtab_offset +          /* String table file offset */
-                     num_symbols * cdata->local_symesz;
+  num_symbols = bfd_get_symcount (abfd);       /* How many syms */
+  symtab_offset = cdata->sym_filepos;  /* Symbol table file offset */
+  stringtab_offset = symtab_offset +   /* String table file offset */
+    num_symbols * cdata->local_symesz;
 
   /* Set a few file-statics that give us specific information about
      the particular COFF file format we're reading.  */
   local_n_btmask = cdata->local_n_btmask;
   local_n_btshft = cdata->local_n_btshft;
-  local_n_tmask  = cdata->local_n_tmask;
+  local_n_tmask = cdata->local_n_tmask;
   local_n_tshift = cdata->local_n_tshift;
-  local_linesz   = cdata->local_linesz;
-  local_symesz   = cdata->local_symesz;
-  local_auxesz   = cdata->local_auxesz;
+  local_linesz = cdata->local_linesz;
+  local_symesz = cdata->local_symesz;
+  local_auxesz = cdata->local_auxesz;
 
   /* Allocate space for raw symbol and aux entries, based on their
      space requirements as reported by BFD.  */
   temp_sym = (char *) xmalloc
-        (cdata->local_symesz + cdata->local_auxesz);
+    (cdata->local_symesz + cdata->local_auxesz);
   temp_aux = temp_sym + cdata->local_symesz;
   back_to = make_cleanup ((make_cleanup_func) free_current_contents, &temp_sym);
 
@@ -649,7 +655,7 @@ coff_symfile_read (objfile, section_offsets, mainline)
   bfd_map_over_sections (abfd, find_linenos, (PTR) info);
 
   make_cleanup ((make_cleanup_func) free_linetab, 0);
-  val = init_lineno (abfd, info->min_lineno_offset, 
+  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);
@@ -675,7 +681,7 @@ coff_symfile_read (objfile, section_offsets, mainline)
   {
     struct symtab *s;
 
-    for (s = objfile -> symtabs; s != NULL; s = s -> next)
+    for (s = objfile->symtabs; s != NULL; s = s->next)
       sort_symtab_syms (s);
   }
 
@@ -688,19 +694,19 @@ coff_symfile_read (objfile, section_offsets, mainline)
 
   if (info->stabsects)
     {
-      if (! info->stabstrsect)
+      if (!info->stabstrsect)
        {
          error_begin ();
          fprintf_filtered
            (gdb_stderr,
             ("The debugging information in `%s' is corrupted.\n"
-             "The file has a `.stabs' section, but no `.stabstr' section.\n"),
+          "The file has a `.stabs' section, but no `.stabstr' section.\n"),
             name);
          return_to_top_level (RETURN_ERROR);
        }
 
       /* FIXME: dubious.  Why can't we use something normal like
-        bfd_get_section_contents?  */
+         bfd_get_section_contents?  */
       bfd_seek (abfd, abfd->where, 0);
 
       stabstrsize = bfd_section_size (abfd, info->stabstrsect);
@@ -731,13 +737,13 @@ static void
 coff_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (objfile -> sym_private != NULL)
+  if (objfile->sym_private != NULL)
     {
-      mfree (objfile -> md, objfile -> sym_private);
+      mfree (objfile->md, objfile->sym_private);
     }
 }
-
 \f
+
 /* Given pointers to a symbol table in coff style exec file,
    analyze them and create struct symtab's describing the symbols.
    NSYMS is the number of symbols in the symbol table.
@@ -800,7 +806,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
   last_source_file = NULL;
   memset (opaque_type_chain, 0, sizeof opaque_type_chain);
 
-  if (type_vector)                     /* Get rid of previous one */
+  if (type_vector)             /* Get rid of previous one */
     free ((PTR) type_vector);
   type_vector_length = 160;
   type_vector = (struct type **)
@@ -848,50 +854,51 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
 
       switch (cs->c_sclass)
        {
-         case C_EFCN:
-         case C_EXTDEF:
-         case C_ULABEL:
-         case C_USTATIC:
-         case C_LINE:
-         case C_ALIAS:
-         case C_HIDDEN:
-           complain (&bad_sclass_complaint, cs->c_name);
-           break;
-
-         case C_FILE:
-           /* c_value field contains symnum of next .file entry in table
-              or symnum of first global after last .file.  */
-           next_file_symnum = cs->c_value;
-           if (cs->c_naux > 0)
-             filestring = coff_getfilename (&main_aux);
-           else
-             filestring = "";
+       case C_EFCN:
+       case C_EXTDEF:
+       case C_ULABEL:
+       case C_USTATIC:
+       case C_LINE:
+       case C_ALIAS:
+       case C_HIDDEN:
+         complain (&bad_sclass_complaint, cs->c_name);
+         break;
 
-           /* Complete symbol table for last object file
-              containing debugging information.  */
-           if (last_source_file)
-             {
-               coff_end_symtab (objfile);
-               coff_start_symtab (filestring);
-             }
-           in_source_file = 1;
-           break;
+       case C_FILE:
+         /* c_value field contains symnum of next .file entry in table
+            or symnum of first global after last .file.  */
+         next_file_symnum = cs->c_value;
+         if (cs->c_naux > 0)
+           filestring = coff_getfilename (&main_aux);
+         else
+           filestring = "";
+
+         /* Complete symbol table for last object file
+            containing debugging information.  */
+         if (last_source_file)
+           {
+             coff_end_symtab (objfile);
+             coff_start_symtab (filestring);
+           }
+         in_source_file = 1;
+         break;
 
          /* C_LABEL is used for labels and static functions.  Including
             it here allows gdb to see static functions when no debug
             info is available.  */
-         case C_LABEL:
-           /* However, labels within a function can make weird backtraces,
-              so filter them out (from phdm@macqel.be). */
-           if (within_function)
-             break;
-          case C_STAT:
-         case C_THUMBLABEL:
-         case C_THUMBSTAT:
-         case C_THUMBSTATFUNC:
-           if (cs->c_name[0] == '.')
-             {
-               if (STREQ (cs->c_name, ".text")) {
+       case C_LABEL:
+         /* However, labels within a function can make weird backtraces,
+            so filter them out (from phdm@macqel.be). */
+         if (within_function)
+           break;
+       case C_STAT:
+       case C_THUMBLABEL:
+       case C_THUMBSTAT:
+       case C_THUMBSTATFUNC:
+         if (cs->c_name[0] == '.')
+           {
+             if (STREQ (cs->c_name, ".text"))
+               {
                  /* FIXME:  don't wire in ".text" as section name
                     or symbol name! */
                  /* Check for in_source_file deals with case of
@@ -899,247 +906,247 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
                     followed by a later file with no symbols.  */
                  if (in_source_file)
                    complete_symtab (filestring,
-                                    cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT),
+                   cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT),
                                     main_aux.x_scn.x_scnlen);
                  in_source_file = 0;
                }
-               /* flush rest of '.' symbols */
-               break;
-             }
-           else if (!SDB_TYPE (cs->c_type)
-                    && cs->c_name[0] == 'L'
-                    && (strncmp (cs->c_name, "LI%", 3) == 0
-                        || strncmp (cs->c_name, "LF%", 3) == 0
-                        || strncmp (cs->c_name,"LC%",3) == 0
-                        || strncmp (cs->c_name,"LP%",3) == 0
-                        || strncmp (cs->c_name,"LPB%",4) == 0
-                        || strncmp (cs->c_name,"LBB%",4) == 0
-                        || strncmp (cs->c_name,"LBE%",4) == 0
-                        || strncmp (cs->c_name,"LPBX%",5) == 0))
-             /* At least on a 3b1, gcc generates swbeg and string labels
-                that look like this.  Ignore them.  */
+             /* flush rest of '.' symbols */
              break;
-           /* fall in for static symbols that don't start with '.' */
-         case C_THUMBEXT:
-         case C_THUMBEXTFUNC:
-         case C_EXT:
-           {
-             /* Record it in the minimal symbols regardless of
-                SDB_TYPE.  This parallels what we do for other debug
-                formats, and probably is needed to make
-                print_address_symbolic work right without the (now
-                gone) "set fast-symbolic-addr off" kludge.  */
+           }
+         else if (!SDB_TYPE (cs->c_type)
+                  && cs->c_name[0] == 'L'
+                  && (strncmp (cs->c_name, "LI%", 3) == 0
+                      || strncmp (cs->c_name, "LF%", 3) == 0
+                      || strncmp (cs->c_name, "LC%", 3) == 0
+                      || strncmp (cs->c_name, "LP%", 3) == 0
+                      || strncmp (cs->c_name, "LPB%", 4) == 0
+                      || strncmp (cs->c_name, "LBB%", 4) == 0
+                      || strncmp (cs->c_name, "LBE%", 4) == 0
+                      || strncmp (cs->c_name, "LPBX%", 5) == 0))
+           /* At least on a 3b1, gcc generates swbeg and string labels
+              that look like this.  Ignore them.  */
+           break;
+         /* fall in for static symbols that don't start with '.' */
+       case C_THUMBEXT:
+       case C_THUMBEXTFUNC:
+       case C_EXT:
+         {
+           /* Record it in the minimal symbols regardless of
+              SDB_TYPE.  This parallels what we do for other debug
+              formats, and probably is needed to make
+              print_address_symbolic work right without the (now
+              gone) "set fast-symbolic-addr off" kludge.  */
 
-             /* FIXME: should use mst_abs, and not relocate, if absolute.  */
-             enum minimal_symbol_type ms_type;
-             int sec;
+           /* FIXME: should use mst_abs, and not relocate, if absolute.  */
+           enum minimal_symbol_type ms_type;
+           int sec;
 
-             if (cs->c_secnum == N_UNDEF)
-               {
-                 /* This is a common symbol.  See if the target
-                    environment knows where it has been relocated to.  */
-                 CORE_ADDR reladdr;
-                 if (target_lookup_symbol (cs->c_name, &reladdr))
-                   {
-                     /* Error in lookup; ignore symbol.  */
-                     break;
-                   }
-                 tmpaddr = reladdr;
-                 /* The address has already been relocated; make sure that
-                    objfile_relocate doesn't relocate it again.  */
-                 sec = -2;
-                 ms_type = cs->c_sclass == C_EXT
-                           || cs->c_sclass == C_THUMBEXT ?
-                              mst_bss : mst_file_bss;
-               }
-             else
-               {
-                 sec = cs_to_section (cs, objfile);
-                 tmpaddr = cs->c_value;
-                 if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
-                     || cs->c_sclass == C_THUMBEXT)
-                   tmpaddr += ANOFFSET (section_offsets, sec);
+           if (cs->c_secnum == N_UNDEF)
+             {
+               /* This is a common symbol.  See if the target
+                  environment knows where it has been relocated to.  */
+               CORE_ADDR reladdr;
+               if (target_lookup_symbol (cs->c_name, &reladdr))
+                 {
+                   /* Error in lookup; ignore symbol.  */
+                   break;
+                 }
+               tmpaddr = reladdr;
+               /* The address has already been relocated; make sure that
+                  objfile_relocate doesn't relocate it again.  */
+               sec = -2;
+               ms_type = cs->c_sclass == C_EXT
+                 || cs->c_sclass == C_THUMBEXT ?
+                 mst_bss : mst_file_bss;
+             }
+           else
+             {
+               sec = cs_to_section (cs, objfile);
+               tmpaddr = cs->c_value;
+               if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
+                   || cs->c_sclass == C_THUMBEXT)
+                 tmpaddr += ANOFFSET (section_offsets, sec);
 
-                 switch (sec)
-                   {
-                   case SECT_OFF_TEXT:
-                   case SECT_OFF_RODATA:
-                     ms_type =
-                       cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
-                                       || cs->c_sclass == C_THUMBEXT ?
-                                         mst_text : mst_file_text;
+               switch (sec)
+                 {
+                 case SECT_OFF_TEXT:
+                 case SECT_OFF_RODATA:
+                   ms_type =
+                     cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
+                     || cs->c_sclass == C_THUMBEXT ?
+                     mst_text : mst_file_text;
 #ifdef SMASH_TEXT_ADDRESS
-                     if (tmpaddr & 1)  /* FIXME: delete this line */
-                       SMASH_TEXT_ADDRESS (tmpaddr);
+                   if (tmpaddr & 1)    /* FIXME: delete this line */
+                     SMASH_TEXT_ADDRESS (tmpaddr);
 #endif
-                     break;
-                   case SECT_OFF_DATA:
-                     ms_type =
-                       cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
-                         mst_data : mst_file_data;
-                     break;
-                   case SECT_OFF_BSS:
-                     ms_type =
-                       cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
-                         mst_data : mst_file_data;
-                     break;
-                   default:
-                     ms_type = mst_unknown;
-                     break;
-                   }
-               }
+                   break;
+                 case SECT_OFF_DATA:
+                   ms_type =
+                     cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
+                     mst_data : mst_file_data;
+                   break;
+                 case SECT_OFF_BSS:
+                   ms_type =
+                     cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
+                     mst_data : mst_file_data;
+                   break;
+                 default:
+                   ms_type = mst_unknown;
+                   break;
+                 }
+             }
 
-             if (cs->c_name[0] != '@' /* Skip tdesc symbols */)
-               {
-                 struct minimal_symbol *msym;
+           if (cs->c_name[0] != '@' /* Skip tdesc symbols */ )
+             {
+               struct minimal_symbol *msym;
 
-                 msym = prim_record_minimal_symbol_and_info
-                 (cs->c_name, tmpaddr, ms_type, (char *)cs->c_sclass, sec,
+               msym = prim_record_minimal_symbol_and_info
+                 (cs->c_name, tmpaddr, ms_type, (char *) cs->c_sclass, sec,
                   NULL, objfile);
 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
-                 if(msym)
-                   COFF_MAKE_MSYMBOL_SPECIAL(cs->c_sclass, msym);              
+               if (msym)
+                 COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym);
 #endif
+             }
+           if (SDB_TYPE (cs->c_type))
+             {
+               struct symbol *sym;
+               sym = process_coff_symbol
+                 (cs, &main_aux, section_offsets, objfile);
+               SYMBOL_VALUE (sym) = tmpaddr;
+               SYMBOL_SECTION (sym) = sec;
+             }
+         }
+         break;
+
+       case C_FCN:
+         if (STREQ (cs->c_name, ".bf"))
+           {
+             within_function = 1;
+
+             /* value contains address of first non-init type code */
+             /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
+                contains line number of '{' } */
+             if (cs->c_naux != 1)
+               complain (&bf_no_aux_complaint, cs->c_symnum);
+             fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
+             fcn_first_line_addr = cs->c_value;
+
+             /* Might want to check that locals are 0 and
+                context_stack_depth is zero, and complain if not.  */
+
+             depth = 0;
+             new = push_context (depth, fcn_start_addr);
+             fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
+             new->name =
+               process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved,
+                                    section_offsets, objfile);
+           }
+         else if (STREQ (cs->c_name, ".ef"))
+           {
+             /* the value of .ef is the address of epilogue code;
+                not useful for gdb.  */
+             /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
+                contains number of lines to '}' */
+
+             if (context_stack_depth <= 0)
+               {               /* We attempted to pop an empty context stack */
+                 complain (&ef_stack_complaint, cs->c_symnum);
+                 within_function = 0;
+                 break;
                }
-             if (SDB_TYPE (cs->c_type))
+
+             new = pop_context ();
+             /* Stack must be empty now.  */
+             if (context_stack_depth > 0 || new == NULL)
                {
-                 struct symbol *sym;
-                 sym = process_coff_symbol
-                   (cs, &main_aux, section_offsets, objfile);
-                 SYMBOL_VALUE (sym) = tmpaddr;
-                 SYMBOL_SECTION (sym) = sec;
+                 complain (&ef_complaint, cs->c_symnum);
+                 within_function = 0;
+                 break;
                }
-           }
-           break;
-
-         case C_FCN:
-           if (STREQ (cs->c_name, ".bf"))
-             {
-               within_function = 1;
-
-               /* value contains address of first non-init type code */
-               /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
-                           contains line number of '{' } */
-               if (cs->c_naux != 1)
-                 complain (&bf_no_aux_complaint, cs->c_symnum);
-               fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
-               fcn_first_line_addr = cs->c_value;
-
-               /* Might want to check that locals are 0 and
-                  context_stack_depth is zero, and complain if not.  */
-
-               depth = 0;
-               new = push_context (depth, fcn_start_addr);
-               fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
-               new->name =
-                 process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved,
-                                      section_offsets, objfile);
-             }
-           else if (STREQ (cs->c_name, ".ef"))
-             {
-               /* the value of .ef is the address of epilogue code;
-                  not useful for gdb.  */
-               /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
-                           contains number of lines to '}' */
-
-               if (context_stack_depth <= 0)
-                 {             /* We attempted to pop an empty context stack */
-                   complain (&ef_stack_complaint, cs->c_symnum);
-                   within_function = 0;
-                   break;
-                 }
+             if (cs->c_naux != 1)
+               {
+                 complain (&ef_no_aux_complaint, cs->c_symnum);
+                 fcn_last_line = 0x7FFFFFFF;
+               }
+             else
+               {
+                 fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
+               }
+             /* fcn_first_line is the line number of the opening '{'.
+                Do not record it - because it would affect gdb's idea
+                of the line number of the first statement of the function -
+                except for one-line functions, for which it is also the line
+                number of all the statements and of the closing '}', and
+                for which we do not have any other statement-line-number. */
+             if (fcn_last_line == 1)
+               record_line (current_subfile, fcn_first_line,
+                            fcn_first_line_addr);
+             else
+               enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
+                              section_offsets);
 
-               new = pop_context ();
-               /* Stack must be empty now.  */
-               if (context_stack_depth > 0 || new == NULL)
-                 {
-                   complain (&ef_complaint, cs->c_symnum);
-                   within_function = 0;
-                   break;
-                 }
-               if (cs->c_naux != 1)
-                 {
-                   complain (&ef_no_aux_complaint, cs->c_symnum);
-                   fcn_last_line = 0x7FFFFFFF;
-                 }
-               else
-                 {
-                   fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
-                 }
-               /* fcn_first_line is the line number of the opening '{'.
-                  Do not record it - because it would affect gdb's idea
-                  of the line number of the first statement of the function -
-                  except for one-line functions, for which it is also the line
-                  number of all the statements and of the closing '}', and
-                  for which we do not have any other statement-line-number. */
-               if (fcn_last_line == 1)
-                 record_line (current_subfile, fcn_first_line,
-                              fcn_first_line_addr);
-               else
-                 enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
-                                section_offsets);
-
-               finish_block (new->name, &local_symbols, new->old_blocks,
-                             new->start_addr,
+             finish_block (new->name, &local_symbols, new->old_blocks,
+                           new->start_addr,
 #if defined (FUNCTION_EPILOGUE_SIZE)
-                             /* This macro should be defined only on
-                                machines where the
-                                fcn_aux_saved.x_sym.x_misc.x_fsize
-                                field is always zero.
-                                So use the .bf record information that
-                                points to the epilogue and add the size
-                                of the epilogue.  */
-                             cs->c_value
-                             + FUNCTION_EPILOGUE_SIZE
-                             + ANOFFSET (section_offsets, SECT_OFF_TEXT),
+             /* This macro should be defined only on
+                machines where the
+                fcn_aux_saved.x_sym.x_misc.x_fsize
+                field is always zero.
+                So use the .bf record information that
+                points to the epilogue and add the size
+                of the epilogue.  */
+                           cs->c_value
+                           + FUNCTION_EPILOGUE_SIZE
+                           + ANOFFSET (section_offsets, SECT_OFF_TEXT),
 #else
-                             fcn_cs_saved.c_value
-                             + fcn_aux_saved.x_sym.x_misc.x_fsize
-                             + ANOFFSET (section_offsets, SECT_OFF_TEXT),
+                           fcn_cs_saved.c_value
+                           + fcn_aux_saved.x_sym.x_misc.x_fsize
+                           + ANOFFSET (section_offsets, SECT_OFF_TEXT),
 #endif
-                             objfile
-                             );
-               within_function = 0;
-             }
-           break;
+                           objfile
+               );
+             within_function = 0;
+           }
+         break;
 
-         case C_BLOCK:
-           if (STREQ (cs->c_name, ".bb"))
-             {
-               tmpaddr = cs->c_value;
-               tmpaddr += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-               push_context (++depth, tmpaddr);
-             }
-           else if (STREQ (cs->c_name, ".eb"))
-             {
-               if (context_stack_depth <= 0)
-                 {             /* We attempted to pop an empty context stack */
-                   complain (&eb_stack_complaint, cs->c_symnum);
-                   break;
-                 }
+       case C_BLOCK:
+         if (STREQ (cs->c_name, ".bb"))
+           {
+             tmpaddr = cs->c_value;
+             tmpaddr += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+             push_context (++depth, tmpaddr);
+           }
+         else if (STREQ (cs->c_name, ".eb"))
+           {
+             if (context_stack_depth <= 0)
+               {               /* We attempted to pop an empty context stack */
+                 complain (&eb_stack_complaint, cs->c_symnum);
+                 break;
+               }
 
-               new = pop_context ();
-               if (depth-- != new->depth)
-                 {
-                   complain (&eb_complaint, symnum);
-                   break;
-                 }
-               if (local_symbols && context_stack_depth > 0)
-                 {
-                   tmpaddr =
-                     cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT);
-                   /* Make a block for the local symbols within.  */
-                   finish_block (0, &local_symbols, new->old_blocks,
-                                 new->start_addr, tmpaddr, objfile);
-                 }
-               /* Now pop locals of block just finished.  */
-               local_symbols = new->locals;
-             }
-           break;
+             new = pop_context ();
+             if (depth-- != new->depth)
+               {
+                 complain (&eb_complaint, symnum);
+                 break;
+               }
+             if (local_symbols && context_stack_depth > 0)
+               {
+                 tmpaddr =
+                   cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT);
+                 /* Make a block for the local symbols within.  */
+                 finish_block (0, &local_symbols, new->old_blocks,
+                               new->start_addr, tmpaddr, objfile);
+               }
+             /* Now pop locals of block just finished.  */
+             local_symbols = new->locals;
+           }
+         break;
 
-         default:
-           process_coff_symbol (cs, &main_aux, section_offsets, objfile);
-           break;
+       default:
+         process_coff_symbol (cs, &main_aux, section_offsets, objfile);
+         break;
        }
     }
 
@@ -1162,25 +1169,25 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
 
 static void
 read_one_sym (cs, sym, aux)
-    register struct coff_symbol *cs;
-    register struct internal_syment *sym;
-    register union internal_auxent *aux;
+     register struct coff_symbol *cs;
+     register struct internal_syment *sym;
+     register union internal_auxent *aux;
 {
   int i;
 
   cs->c_symnum = symnum;
   bfd_read (temp_sym, local_symesz, 1, nlist_bfd_global);
-  bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *)sym);
+  bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
   cs->c_naux = sym->n_numaux & 0xff;
   if (cs->c_naux >= 1)
     {
-    bfd_read (temp_aux, local_auxesz, 1, nlist_bfd_global);
-    bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
-                         0, cs->c_naux, (char *)aux);
-    /* If more than one aux entry, read past it (only the first aux
-       is important). */
-    for (i = 1; i < cs->c_naux; i++)
       bfd_read (temp_aux, local_auxesz, 1, nlist_bfd_global);
+      bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
+                           0, cs->c_naux, (char *) aux);
+      /* If more than one aux entry, read past it (only the first aux
+         is important). */
+      for (i = 1; i < cs->c_naux; i++)
+       bfd_read (temp_aux, local_auxesz, 1, nlist_bfd_global);
     }
   cs->c_name = getsymname (sym);
   cs->c_value = sym->n_value;
@@ -1192,7 +1199,7 @@ read_one_sym (cs, sym, aux)
 
 #if 0
   if (cs->c_sclass & 128)
-    printf("thumb symbol %s, class 0x%x\n", cs->c_name, cs->c_sclass);
+    printf ("thumb symbol %s, class 0x%x\n", cs->c_name, cs->c_sclass);
 #endif
 
   symnum += 1 + cs->c_naux;
@@ -1232,8 +1239,8 @@ static char *stringtab = NULL;
 
 static int
 init_stringtab (abfd, offset)
-    bfd *abfd;
-    long offset;
+     bfd *abfd;
+     long offset;
 {
   long length;
   int val;
@@ -1249,9 +1256,9 @@ init_stringtab (abfd, offset)
   if (bfd_seek (abfd, offset, 0) < 0)
     return -1;
 
-  val = bfd_read ((char *)lengthbuf, sizeof lengthbuf, 1, abfd);
+  val = bfd_read ((char *) lengthbuf, sizeof lengthbuf, 1, abfd);
   length = bfd_h_get_32 (symfile_bfd, lengthbuf);
-       
+
   /* If no string table is needed, then the file may end immediately
      after the symbols.  Just return with `stringtab' set to null. */
   if (val != sizeof lengthbuf || length < sizeof lengthbuf)
@@ -1261,7 +1268,7 @@ init_stringtab (abfd, offset)
   /* This is in target format (probably not very useful, and not currently
      used), not host format.  */
   memcpy (stringtab, lengthbuf, sizeof lengthbuf);
-  if (length == sizeof length)         /* Empty table -- just the count */
+  if (length == sizeof length) /* Empty table -- just the count */
     return 0;
 
   val = bfd_read (stringtab + sizeof lengthbuf, length - sizeof lengthbuf, 1, abfd);
@@ -1281,15 +1288,15 @@ free_stringtab ()
 
 static char *
 getsymname (symbol_entry)
-    struct internal_syment *symbol_entry;
+     struct internal_syment *symbol_entry;
 {
-  static char buffer[SYMNMLEN+1];
+  static char buffer[SYMNMLEN + 1];
   char *result;
 
   if (symbol_entry->_n._n_n._n_zeroes == 0)
     {
       /* FIXME: Probably should be detecting corrupt symbol files by
-        seeing whether offset points to within the stringtab.  */
+         seeing whether offset points to within the stringtab.  */
       result = stringtab + symbol_entry->_n._n_n._n_offset;
     }
   else
@@ -1307,7 +1314,7 @@ getsymname (symbol_entry)
 
 static char *
 coff_getfilename (aux_entry)
-    union internal_auxent *aux_entry;
+     union internal_auxent *aux_entry;
 {
   static char buffer[BUFSIZ];
   register char *temp;
@@ -1339,26 +1346,26 @@ 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_lineno (abfd, offset, size)
-    bfd *abfd;
-    long offset;
-    int size;
+     bfd *abfd;
+     long offset;
+     int size;
 {
   int val;
 
   linetab_offset = offset;
   linetab_size = size;
 
-  free_linetab();
+  free_linetab ();
 
   if (size == 0)
     return 0;
 
   if (bfd_seek (abfd, offset, 0) < 0)
     return -1;
-  
+
   /* Allocate the desired table, plus a sentinel */
   linetab = (char *) xmalloc (size + local_linesz);
 
@@ -1395,15 +1402,15 @@ enter_linenos (file_offset, first_line, last_line, section_offsets)
   struct internal_lineno lptr;
 
   if (!linetab)
-    return ;
+    return;
   if (file_offset < linetab_offset)
     {
       complain (&lineno_complaint, file_offset);
       if (file_offset > linetab_size)  /* Too big to be an offset? */
        return;
-      file_offset += linetab_offset;  /* Try reading at that linetab offset */
+      file_offset += linetab_offset;   /* Try reading at that linetab offset */
     }
-  
+
   rawptr = &linetab[file_offset - linetab_offset];
 
   /* skip first line entry for each function */
@@ -1411,23 +1418,24 @@ enter_linenos (file_offset, first_line, last_line, section_offsets)
   /* line numbers start at one for the first line of the function */
   first_line--;
 
-  for (;;) {
-    bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
-    rawptr += local_linesz;
-    /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
-    if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
-      record_line (current_subfile, first_line + L_LNNO32 (&lptr),
-                       lptr.l_addr.l_paddr
-                       + ANOFFSET (section_offsets, SECT_OFF_TEXT));
-    else
-      break;
-  } 
+  for (;;)
+    {
+      bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
+      rawptr += local_linesz;
+      /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
+      if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
+       record_line (current_subfile, first_line + L_LNNO32 (&lptr),
+                    lptr.l_addr.l_paddr
+                    + ANOFFSET (section_offsets, SECT_OFF_TEXT));
+      else
+       break;
+    }
 }
 \f
 static void
 patch_type (type, real_type)
-    struct type *type;
-    struct type *real_type;
+     struct type *type;
+     struct type *real_type;
 {
   register struct type *target = TYPE_TARGET_TYPE (type);
   register struct type *real_target = TYPE_TARGET_TYPE (real_type);
@@ -1457,15 +1465,15 @@ patch_opaque_types (s)
   register struct block *b;
   register int i;
   register struct symbol *real_sym;
-  
+
   /* Go through the per-file symbols only */
   b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
   for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--)
     {
       /* 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.  */
+         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 &&
@@ -1475,7 +1483,7 @@ patch_opaque_types (s)
          register char *name = SYMBOL_NAME (real_sym);
          register int hash = hashname (name);
          register struct symbol *sym, *prev;
-         
+
          prev = 0;
          for (sym = opaque_type_chain[hash]; sym;)
            {
@@ -1490,9 +1498,9 @@ patch_opaque_types (s)
                    {
                      opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
                    }
-                 
+
                  patch_type (SYMBOL_TYPE (sym), SYMBOL_TYPE (real_sym));
-                 
+
                  if (prev)
                    {
                      sym = SYMBOL_VALUE_CHAIN (prev);
@@ -1520,8 +1528,8 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
      struct objfile *objfile;
 {
   register struct symbol *sym
-    = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
-                                      sizeof (struct symbol));
+  = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+                                    sizeof (struct symbol));
   char *name;
 
   memset (sym, 0, sizeof (struct symbol));
@@ -1540,8 +1548,8 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
   if (ISFCN (cs->c_type))
     {
       SYMBOL_VALUE (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-       SYMBOL_TYPE(sym) = 
-        lookup_function_type (decode_function_type (cs, cs->c_type, aux));
+      SYMBOL_TYPE (sym) =
+       lookup_function_type (decode_function_type (cs, cs->c_type, aux));
 
       SYMBOL_CLASS (sym) = LOC_BLOCK;
       if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT
@@ -1556,181 +1564,183 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
       SYMBOL_TYPE (sym) = decode_type (cs, cs->c_type, aux);
       switch (cs->c_sclass)
        {
-         case C_NULL:
-           break;
+       case C_NULL:
+         break;
 
-         case C_AUTO:
-           SYMBOL_CLASS (sym) = LOC_LOCAL;
-           add_symbol_to_list (sym, &local_symbols);
-           break;
+       case C_AUTO:
+         SYMBOL_CLASS (sym) = LOC_LOCAL;
+         add_symbol_to_list (sym, &local_symbols);
+         break;
 
-         case C_THUMBEXT:
-         case C_THUMBEXTFUNC:
-         case C_EXT:
-           SYMBOL_CLASS (sym) = LOC_STATIC;
-           SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
-           SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-           add_symbol_to_list (sym, &global_symbols);
-           break;
+       case C_THUMBEXT:
+       case C_THUMBEXTFUNC:
+       case C_EXT:
+         SYMBOL_CLASS (sym) = LOC_STATIC;
+         SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
+         SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+         add_symbol_to_list (sym, &global_symbols);
+         break;
 
-         case C_THUMBSTAT:
-         case C_THUMBSTATFUNC:
-         case C_STAT:
-           SYMBOL_CLASS (sym) = LOC_STATIC;
-           SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
-           SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-           if (within_function) {
+       case C_THUMBSTAT:
+       case C_THUMBSTATFUNC:
+       case C_STAT:
+         SYMBOL_CLASS (sym) = LOC_STATIC;
+         SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
+         SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+         if (within_function)
+           {
              /* Static symbol of local scope */
              add_symbol_to_list (sym, &local_symbols);
            }
-           else {
+         else
+           {
              /* Static symbol at top level of file */
              add_symbol_to_list (sym, &file_symbols);
            }
-           break;
+         break;
 
 #ifdef C_GLBLREG               /* AMD coff */
-         case C_GLBLREG:
+       case C_GLBLREG:
 #endif
-         case C_REG:
-           SYMBOL_CLASS (sym) = LOC_REGISTER;
-           SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM(cs->c_value);
-           add_symbol_to_list (sym, &local_symbols);
-           break;
+       case C_REG:
+         SYMBOL_CLASS (sym) = LOC_REGISTER;
+         SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM (cs->c_value);
+         add_symbol_to_list (sym, &local_symbols);
+         break;
 
-         case C_THUMBLABEL:
-         case C_LABEL:
-           break;
+       case C_THUMBLABEL:
+       case C_LABEL:
+         break;
 
-         case C_ARG:
-           SYMBOL_CLASS (sym) = LOC_ARG;
-           add_symbol_to_list (sym, &local_symbols);
+       case C_ARG:
+         SYMBOL_CLASS (sym) = LOC_ARG;
+         add_symbol_to_list (sym, &local_symbols);
 #if !defined (BELIEVE_PCC_PROMOTION)
-           if (TARGET_BYTE_ORDER == BIG_ENDIAN)
-             {
-               /* If PCC says a parameter is a short or a char,
-                  aligned on an int boundary, realign it to the
-                  "little end" of the int.  */
-               struct type *temptype;
-               temptype = lookup_fundamental_type (current_objfile,
-                                                   FT_INTEGER);
-               if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype)
-                   && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT
-                   && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (temptype))
-                 {
-                   SYMBOL_VALUE (sym) +=
-                     TYPE_LENGTH (temptype)
-                       - TYPE_LENGTH (SYMBOL_TYPE (sym));
-                 }
-             }
+         if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+           {
+             /* If PCC says a parameter is a short or a char,
+                aligned on an int boundary, realign it to the
+                "little end" of the int.  */
+             struct type *temptype;
+             temptype = lookup_fundamental_type (current_objfile,
+                                                 FT_INTEGER);
+             if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype)
+                 && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT
+                 && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (temptype))
+               {
+                 SYMBOL_VALUE (sym) +=
+                   TYPE_LENGTH (temptype)
+                   - TYPE_LENGTH (SYMBOL_TYPE (sym));
+               }
+           }
 #endif
-           break;
+         break;
 
-         case C_REGPARM:
-           SYMBOL_CLASS (sym) = LOC_REGPARM;
-           SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM(cs->c_value);
-           add_symbol_to_list (sym, &local_symbols);
+       case C_REGPARM:
+         SYMBOL_CLASS (sym) = LOC_REGPARM;
+         SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM (cs->c_value);
+         add_symbol_to_list (sym, &local_symbols);
 #if !defined (BELIEVE_PCC_PROMOTION)
-           /* FIXME:  This should retain the current type, since it's just
-              a register value.  gnu@adobe, 26Feb93 */
+         /* FIXME:  This should retain the current type, since it's just
+            a register value.  gnu@adobe, 26Feb93 */
+         {
+           /* If PCC says a parameter is a short or a char,
+              it is really an int.  */
+           struct type *temptype;
+           temptype =
+             lookup_fundamental_type (current_objfile, FT_INTEGER);
+           if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype)
+               && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
              {
-               /* If PCC says a parameter is a short or a char,
-                  it is really an int.  */
-               struct type *temptype;
-               temptype =
-                 lookup_fundamental_type (current_objfile, FT_INTEGER);
-               if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (temptype)
-                   && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
-                 {
-                   SYMBOL_TYPE (sym) =
-                     (TYPE_UNSIGNED (SYMBOL_TYPE (sym))
-                      ? lookup_fundamental_type (current_objfile,
-                                                 FT_UNSIGNED_INTEGER)
-                      : temptype);
-                 }
+               SYMBOL_TYPE (sym) =
+                 (TYPE_UNSIGNED (SYMBOL_TYPE (sym))
+                  ? lookup_fundamental_type (current_objfile,
+                                             FT_UNSIGNED_INTEGER)
+                  : temptype);
              }
+         }
 #endif
-           break;
-           
-         case C_TPDEF:
-           SYMBOL_CLASS (sym) = LOC_TYPEDEF;
-           SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+         break;
 
-           /* If type has no name, give it one */
-           if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
-             {
-               if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
-                   || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
-                 {
-                   /* If we are giving a name to a type such as "pointer to
-                      foo" or "function returning foo", we better not set
-                      the TYPE_NAME.  If the program contains "typedef char
-                      *caddr_t;", we don't want all variables of type char
-                      * to print as caddr_t.  This is not just a
-                      consequence of GDB's type management; CC and GCC (at
-                      least through version 2.4) both output variables of
-                      either type char * or caddr_t with the type
-                      refering to the C_TPDEF symbol for caddr_t.  If a future
-                      compiler cleans this up it GDB is not ready for it
-                      yet, but if it becomes ready we somehow need to
-                      disable this check (without breaking the PCC/GCC2.4
-                      case).
-
-                      Sigh.
-
-                      Fortunately, this check seems not to be necessary
-                      for anything except pointers or functions.  */
-                   ;
-                 }
-               else
-                 TYPE_NAME (SYMBOL_TYPE (sym)) =
-                   concat (SYMBOL_NAME (sym), NULL);
-             }
+       case C_TPDEF:
+         SYMBOL_CLASS (sym) = LOC_TYPEDEF;
+         SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+
+         /* If type has no name, give it one */
+         if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
+           {
+             if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
+                 || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
+               {
+                 /* If we are giving a name to a type such as "pointer to
+                    foo" or "function returning foo", we better not set
+                    the TYPE_NAME.  If the program contains "typedef char
+                    *caddr_t;", we don't want all variables of type char
+                    * to print as caddr_t.  This is not just a
+                    consequence of GDB's type management; CC and GCC (at
+                    least through version 2.4) both output variables of
+                    either type char * or caddr_t with the type
+                    refering to the C_TPDEF symbol for caddr_t.  If a future
+                    compiler cleans this up it GDB is not ready for it
+                    yet, but if it becomes ready we somehow need to
+                    disable this check (without breaking the PCC/GCC2.4
+                    case).
+
+                    Sigh.
+
+                    Fortunately, this check seems not to be necessary
+                    for anything except pointers or functions.  */
+                 ;
+               }
+             else
+               TYPE_NAME (SYMBOL_TYPE (sym)) =
+                 concat (SYMBOL_NAME (sym), NULL);
+           }
 #ifdef CXUX_TARGET
-           /* Ignore vendor section for Harris CX/UX targets. */
-            else if (cs->c_name[0] == '$') 
-             break;
+         /* Ignore vendor section for Harris CX/UX targets. */
+         else if (cs->c_name[0] == '$')
+           break;
 #endif /* CXUX_TARGET */
 
-           /* Keep track of any type which points to empty structured type,
-               so it can be filled from a definition from another file.  A
-               simple forward reference (TYPE_CODE_UNDEF) is not an
-               empty structured type, though; the forward references
-               work themselves out via the magic of coff_lookup_type.  */
-           if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR &&
-               TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0 &&
-               TYPE_CODE   (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) !=
-                                               TYPE_CODE_UNDEF)
-             {
-               register int i = hashname (SYMBOL_NAME (sym));
-
-               SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
-               opaque_type_chain[i] = sym;
-             }
-           add_symbol_to_list (sym, &file_symbols);
-           break;
+         /* Keep track of any type which points to empty structured type,
+            so it can be filled from a definition from another file.  A
+            simple forward reference (TYPE_CODE_UNDEF) is not an
+            empty structured type, though; the forward references
+            work themselves out via the magic of coff_lookup_type.  */
+         if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR &&
+             TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0 &&
+             TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) !=
+             TYPE_CODE_UNDEF)
+           {
+             register int i = hashname (SYMBOL_NAME (sym));
 
-         case C_STRTAG:
-         case C_UNTAG:
-         case C_ENTAG:
-           SYMBOL_CLASS (sym) = LOC_TYPEDEF;
-           SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
-
-            /* Some compilers try to be helpful by inventing "fake"
-               names for anonymous enums, structures, and unions, like
-               "~0fake" or ".0fake".  Thanks, but no thanks... */
-           if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
-             if (SYMBOL_NAME(sym) != NULL
-                 && *SYMBOL_NAME(sym) != '~'
-                 && *SYMBOL_NAME(sym) != '.')
-               TYPE_TAG_NAME (SYMBOL_TYPE (sym)) =
-                 concat (SYMBOL_NAME (sym), NULL);
+             SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
+             opaque_type_chain[i] = sym;
+           }
+         add_symbol_to_list (sym, &file_symbols);
+         break;
 
-           add_symbol_to_list (sym, &file_symbols);
-           break;
+       case C_STRTAG:
+       case C_UNTAG:
+       case C_ENTAG:
+         SYMBOL_CLASS (sym) = LOC_TYPEDEF;
+         SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+
+         /* Some compilers try to be helpful by inventing "fake"
+            names for anonymous enums, structures, and unions, like
+            "~0fake" or ".0fake".  Thanks, but no thanks... */
+         if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
+           if (SYMBOL_NAME (sym) != NULL
+               && *SYMBOL_NAME (sym) != '~'
+               && *SYMBOL_NAME (sym) != '.')
+             TYPE_TAG_NAME (SYMBOL_TYPE (sym)) =
+               concat (SYMBOL_NAME (sym), NULL);
+
+         add_symbol_to_list (sym, &file_symbols);
+         break;
 
-         default:
-           break;
+       default:
+         break;
        }
     }
   return sym;
@@ -1826,7 +1836,7 @@ decode_function_type (cs, c_type, aux)
      register union internal_auxent *aux;
 {
   if (aux->x_sym.x_tagndx.l == 0)
-    cs->c_naux = 0;    /* auxent refers to function, not base type */
+    cs->c_naux = 0;            /* auxent refers to function, not base type */
 
   return decode_type (cs, DECREF (c_type), aux);
 }
@@ -1843,140 +1853,140 @@ decode_base_type (cs, c_type, aux)
 
   switch (c_type)
     {
-      case T_NULL:
-        /* shows up with "void (*foo)();" structure members */
-       return lookup_fundamental_type (current_objfile, FT_VOID);
+    case T_NULL:
+      /* shows up with "void (*foo)();" structure members */
+      return lookup_fundamental_type (current_objfile, FT_VOID);
 
 #if 0
 /* DGUX actually defines both T_ARG and T_VOID to the same value.  */
 #ifdef T_ARG
-      case T_ARG:
-       /* Shows up in DGUX, I think.  Not sure where.  */
-       return lookup_fundamental_type (current_objfile, FT_VOID);      /* shouldn't show up here */
+    case T_ARG:
+      /* Shows up in DGUX, I think.  Not sure where.  */
+      return lookup_fundamental_type (current_objfile, FT_VOID);       /* shouldn't show up here */
 #endif
 #endif /* 0 */
 
 #ifdef T_VOID
-      case T_VOID:
-       /* Intel 960 COFF has this symbol and meaning.  */
-       return lookup_fundamental_type (current_objfile, FT_VOID);
+    case T_VOID:
+      /* Intel 960 COFF has this symbol and meaning.  */
+      return lookup_fundamental_type (current_objfile, FT_VOID);
 #endif
 
-      case T_CHAR:
-       return lookup_fundamental_type (current_objfile, FT_CHAR);
-
-      case T_SHORT:
-       return lookup_fundamental_type (current_objfile, FT_SHORT);
+    case T_CHAR:
+      return lookup_fundamental_type (current_objfile, FT_CHAR);
 
-      case T_INT:
-       return lookup_fundamental_type (current_objfile, FT_INTEGER);
+    case T_SHORT:
+      return lookup_fundamental_type (current_objfile, FT_SHORT);
 
-      case T_LONG:
-       if (cs->c_sclass == C_FIELD
-           && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
-         return lookup_fundamental_type (current_objfile, FT_LONG_LONG);
-       else
-         return lookup_fundamental_type (current_objfile, FT_LONG);
+    case T_INT:
+      return lookup_fundamental_type (current_objfile, FT_INTEGER);
 
-      case T_FLOAT:
-       return lookup_fundamental_type (current_objfile, FT_FLOAT);
+    case T_LONG:
+      if (cs->c_sclass == C_FIELD
+         && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+       return lookup_fundamental_type (current_objfile, FT_LONG_LONG);
+      else
+       return lookup_fundamental_type (current_objfile, FT_LONG);
 
-      case T_DOUBLE:
-       return lookup_fundamental_type (current_objfile, FT_DBL_PREC_FLOAT);
+    case T_FLOAT:
+      return lookup_fundamental_type (current_objfile, FT_FLOAT);
 
-      case T_LNGDBL:
-       return lookup_fundamental_type (current_objfile, FT_EXT_PREC_FLOAT);
+    case T_DOUBLE:
+      return lookup_fundamental_type (current_objfile, FT_DBL_PREC_FLOAT);
 
-      case T_STRUCT:
-       if (cs->c_naux != 1)
-         {
-           /* anonymous structure type */
-           type = coff_alloc_type (cs->c_symnum);
-           TYPE_CODE (type) = TYPE_CODE_STRUCT;
-           TYPE_NAME (type) = NULL;
-           /* This used to set the tag to "<opaque>".  But I think setting it
-              to NULL is right, and the printing code can print it as
-              "struct {...}".  */
-           TYPE_TAG_NAME (type) = NULL;
-           INIT_CPLUS_SPECIFIC(type);
-           TYPE_LENGTH (type) = 0;
-           TYPE_FIELDS (type) = 0;
-           TYPE_NFIELDS (type) = 0;
-         }
-       else
-         {
-           type = coff_read_struct_type (cs->c_symnum,
-                                   aux->x_sym.x_misc.x_lnsz.x_size,
-                                   aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
-         }
-       return type;
+    case T_LNGDBL:
+      return lookup_fundamental_type (current_objfile, FT_EXT_PREC_FLOAT);
 
-      case T_UNION:
-       if (cs->c_naux != 1)
-         {
-           /* anonymous union type */
-           type = coff_alloc_type (cs->c_symnum);
-           TYPE_NAME (type) = NULL;
-           /* This used to set the tag to "<opaque>".  But I think setting it
-              to NULL is right, and the printing code can print it as
-              "union {...}".  */
-           TYPE_TAG_NAME (type) = NULL;
-           INIT_CPLUS_SPECIFIC(type);
-           TYPE_LENGTH (type) = 0;
-           TYPE_FIELDS (type) = 0;
-           TYPE_NFIELDS (type) = 0;
-         }
-       else
-         {
-           type = coff_read_struct_type (cs->c_symnum,
-                                   aux->x_sym.x_misc.x_lnsz.x_size,
-                                   aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
-         }
-       TYPE_CODE (type) = TYPE_CODE_UNION;
-       return type;
+    case T_STRUCT:
+      if (cs->c_naux != 1)
+       {
+         /* anonymous structure type */
+         type = coff_alloc_type (cs->c_symnum);
+         TYPE_CODE (type) = TYPE_CODE_STRUCT;
+         TYPE_NAME (type) = NULL;
+         /* This used to set the tag to "<opaque>".  But I think setting it
+            to NULL is right, and the printing code can print it as
+            "struct {...}".  */
+         TYPE_TAG_NAME (type) = NULL;
+         INIT_CPLUS_SPECIFIC (type);
+         TYPE_LENGTH (type) = 0;
+         TYPE_FIELDS (type) = 0;
+         TYPE_NFIELDS (type) = 0;
+       }
+      else
+       {
+         type = coff_read_struct_type (cs->c_symnum,
+                                       aux->x_sym.x_misc.x_lnsz.x_size,
+                                     aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
+       }
+      return type;
 
-      case T_ENUM:
-       if (cs->c_naux != 1)
-         {
-           /* anonymous enum type */
-           type = coff_alloc_type (cs->c_symnum);
-           TYPE_CODE (type) = TYPE_CODE_ENUM;
-           TYPE_NAME (type) = NULL;
-           /* This used to set the tag to "<opaque>".  But I think setting it
-              to NULL is right, and the printing code can print it as
-              "enum {...}".  */
-           TYPE_TAG_NAME (type) = NULL;
-           TYPE_LENGTH (type) = 0;
-           TYPE_FIELDS (type) = 0;
-           TYPE_NFIELDS(type) = 0;
-         }
-       else
-         {
-           type = coff_read_enum_type (cs->c_symnum,
+    case T_UNION:
+      if (cs->c_naux != 1)
+       {
+         /* anonymous union type */
+         type = coff_alloc_type (cs->c_symnum);
+         TYPE_NAME (type) = NULL;
+         /* This used to set the tag to "<opaque>".  But I think setting it
+            to NULL is right, and the printing code can print it as
+            "union {...}".  */
+         TYPE_TAG_NAME (type) = NULL;
+         INIT_CPLUS_SPECIFIC (type);
+         TYPE_LENGTH (type) = 0;
+         TYPE_FIELDS (type) = 0;
+         TYPE_NFIELDS (type) = 0;
+       }
+      else
+       {
+         type = coff_read_struct_type (cs->c_symnum,
                                        aux->x_sym.x_misc.x_lnsz.x_size,
-                                       aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
-         }
-       return type;
+                                     aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
+       }
+      TYPE_CODE (type) = TYPE_CODE_UNION;
+      return type;
 
-      case T_MOE:
-       /* shouldn't show up here */
-       break;
+    case T_ENUM:
+      if (cs->c_naux != 1)
+       {
+         /* anonymous enum type */
+         type = coff_alloc_type (cs->c_symnum);
+         TYPE_CODE (type) = TYPE_CODE_ENUM;
+         TYPE_NAME (type) = NULL;
+         /* This used to set the tag to "<opaque>".  But I think setting it
+            to NULL is right, and the printing code can print it as
+            "enum {...}".  */
+         TYPE_TAG_NAME (type) = NULL;
+         TYPE_LENGTH (type) = 0;
+         TYPE_FIELDS (type) = 0;
+         TYPE_NFIELDS (type) = 0;
+       }
+      else
+       {
+         type = coff_read_enum_type (cs->c_symnum,
+                                     aux->x_sym.x_misc.x_lnsz.x_size,
+                                     aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
+       }
+      return type;
+
+    case T_MOE:
+      /* shouldn't show up here */
+      break;
 
-      case T_UCHAR:
-       return lookup_fundamental_type (current_objfile, FT_UNSIGNED_CHAR);
+    case T_UCHAR:
+      return lookup_fundamental_type (current_objfile, FT_UNSIGNED_CHAR);
 
-      case T_USHORT:
-       return lookup_fundamental_type (current_objfile, FT_UNSIGNED_SHORT);
+    case T_USHORT:
+      return lookup_fundamental_type (current_objfile, FT_UNSIGNED_SHORT);
 
-      case T_UINT:
-       return lookup_fundamental_type (current_objfile, FT_UNSIGNED_INTEGER);
+    case T_UINT:
+      return lookup_fundamental_type (current_objfile, FT_UNSIGNED_INTEGER);
 
-      case T_ULONG:
-       if (cs->c_sclass == C_FIELD
-           && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
-         return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG_LONG);
-       else
-         return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
+    case T_ULONG:
+      if (cs->c_sclass == C_FIELD
+         && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+       return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG_LONG);
+      else
+       return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
     }
   complain (&unexpected_type_complaint, cs->c_name);
   return lookup_fundamental_type (current_objfile, FT_VOID);
@@ -2013,7 +2023,7 @@ coff_read_struct_type (index, length, lastsym)
 
   type = coff_alloc_type (index);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
-  INIT_CPLUS_SPECIFIC(type);
+  INIT_CPLUS_SPECIFIC (type);
   TYPE_LENGTH (type) = length;
 
   while (!done && symnum < lastsym && symnum < nlist_nsyms_global)
@@ -2024,46 +2034,46 @@ coff_read_struct_type (index, length, lastsym)
 
       switch (ms->c_sclass)
        {
-         case C_MOS:
-         case C_MOU:
-
-           /* Get space to record the next field's data.  */
-           new = (struct nextfield *) alloca (sizeof (struct nextfield));
-           new->next = list;
-           list = new;
-
-           /* Save the data.  */
-           list->field.name =
-             obsavestring (name,
-                           strlen (name),
-                           &current_objfile->symbol_obstack);
-           FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
-           FIELD_BITPOS (list->field) = 8 * ms->c_value;
-           FIELD_BITSIZE (list->field) = 0;
-           nfields++;
-           break;
+       case C_MOS:
+       case C_MOU:
+
+         /* Get space to record the next field's data.  */
+         new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         new->next = list;
+         list = new;
+
+         /* Save the data.  */
+         list->field.name =
+           obsavestring (name,
+                         strlen (name),
+                         &current_objfile->symbol_obstack);
+         FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
+         FIELD_BITPOS (list->field) = 8 * ms->c_value;
+         FIELD_BITSIZE (list->field) = 0;
+         nfields++;
+         break;
 
-         case C_FIELD:
-
-           /* Get space to record the next field's data.  */
-           new = (struct nextfield *) alloca (sizeof (struct nextfield));
-           new->next = list;
-           list = new;
-
-           /* Save the data.  */
-           list->field.name =
-             obsavestring (name,
-                           strlen (name),
-                           &current_objfile->symbol_obstack);
-           FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
-           FIELD_BITPOS (list->field) = ms->c_value;
-           FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
-           nfields++;
-           break;
+       case C_FIELD:
+
+         /* Get space to record the next field's data.  */
+         new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         new->next = list;
+         list = new;
+
+         /* Save the data.  */
+         list->field.name =
+           obsavestring (name,
+                         strlen (name),
+                         &current_objfile->symbol_obstack);
+         FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
+         FIELD_BITPOS (list->field) = ms->c_value;
+         FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
+         nfields++;
+         break;
 
-         case C_EOS:
-           done = 1;
-           break;
+       case C_EOS:
+         done = 1;
+         break;
        }
     }
   /* Now create the vector of fields, and record how big it is.  */
@@ -2122,28 +2132,28 @@ coff_read_enum_type (index, length, lastsym)
 
       switch (ms->c_sclass)
        {
-         case C_MOE:
-           sym = (struct symbol *) obstack_alloc
-             (&current_objfile->symbol_obstack,
-              sizeof (struct symbol));
-           memset (sym, 0, sizeof (struct symbol));
-
-           SYMBOL_NAME (sym) =
-             obsavestring (name, strlen (name),
-                           &current_objfile->symbol_obstack);
-           SYMBOL_CLASS (sym) = LOC_CONST;
-           SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-           SYMBOL_VALUE (sym) = ms->c_value;
-           add_symbol_to_list (sym, symlist);
-           nsyms++;
-           break;
+       case C_MOE:
+         sym = (struct symbol *) obstack_alloc
+           (&current_objfile->symbol_obstack,
+            sizeof (struct symbol));
+         memset (sym, 0, sizeof (struct symbol));
+
+         SYMBOL_NAME (sym) =
+           obsavestring (name, strlen (name),
+                         &current_objfile->symbol_obstack);
+         SYMBOL_CLASS (sym) = LOC_CONST;
+         SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+         SYMBOL_VALUE (sym) = ms->c_value;
+         add_symbol_to_list (sym, symlist);
+         nsyms++;
+         break;
 
-         case C_EOS:
-           /* Sometimes the linker (on 386/ix 2.0.2 at least) screws
-              up the count of how many symbols to read.  So stop
-              on .eos.  */
-           done = 1;
-           break;
+       case C_EOS:
+         /* Sometimes the linker (on 386/ix 2.0.2 at least) screws
+            up the count of how many symbols to read.  So stop
+            on .eos.  */
+         done = 1;
+         break;
        }
     }
 
@@ -2152,7 +2162,7 @@ coff_read_enum_type (index, length, lastsym)
   if (length > 0)
     TYPE_LENGTH (type) = length;
   else
-    TYPE_LENGTH (type) = TARGET_INT_BIT / TARGET_CHAR_BIT; /* Assume ints */
+    TYPE_LENGTH (type) = TARGET_INT_BIT / TARGET_CHAR_BIT;     /* Assume ints */
   TYPE_CODE (type) = TYPE_CODE_ENUM;
   TYPE_NFIELDS (type) = nsyms;
   TYPE_FIELDS (type) = (struct field *)
@@ -2172,7 +2182,7 @@ coff_read_enum_type (index, length, lastsym)
 
       if (syms == osyms)
        j = o_nsyms;
-      for (; j < syms->nsyms; j++,n++)
+      for (; j < syms->nsyms; j++, n++)
        {
          struct symbol *xsym = syms->symbol[j];
          SYMBOL_TYPE (xsym) = type;
@@ -2197,13 +2207,13 @@ coff_read_enum_type (index, length, lastsym)
 static struct sym_fns coff_sym_fns =
 {
   bfd_target_coff_flavour,
-  coff_new_init,       /* sym_new_init: init anything gbl to entire symtab */
-  coff_symfile_init,   /* sym_init: read initial info, setup for sym_read() */
-  coff_symfile_read,   /* sym_read: read a symbol file into symtab */
-  coff_symfile_finish, /* sym_finish: finished with file, cleanup */
+  coff_new_init,               /* sym_new_init: init anything gbl to entire symtab */
+  coff_symfile_init,           /* sym_init: read initial info, setup for sym_read() */
+  coff_symfile_read,           /* sym_read: read a symbol file into symtab */
+  coff_symfile_finish,         /* sym_finish: finished with file, cleanup */
   default_symfile_offsets,
                        /* sym_offsets:  xlate external to internal form */
-  NULL                 /* next: pointer to next struct sym_fns */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
index 0b095d9afad59e2ffdbcd3bf937f36d064646ba7..ad3e7e490b286ef49c480e27ed131791eb4970e5 100644 (file)
@@ -1,19 +1,20 @@
 /* Handle lists of commands, their decoding and documentation, for GDB.
    Copyright 1986, 1989, 1990, 1991, 1998 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcmd.h"
@@ -26,11 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif
 
 #ifdef HAVE_WAIT_H
-# include <wait.h>
+#include <wait.h>
 #else
-# ifdef HAVE_SYS_WAIT_H
-#  include <sys/wait.h>
-# endif
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
 #endif
 
 #include "wait.h"
@@ -53,7 +54,7 @@ static void print_doc_line PARAMS ((GDB_FILE *, char *));
 
 static struct cmd_list_element *find_cmd PARAMS ((char *command,
                                                  int len,
-                                                 struct cmd_list_element *clist,
+                                           struct cmd_list_element * clist,
                                                  int ignore_help_classes,
                                                  int *nfound));
 
@@ -85,7 +86,7 @@ add_cmd (name, class, fun, doc, list)
      struct cmd_list_element **list;
 {
   register struct cmd_list_element *c
-    = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
+  = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
   struct cmd_list_element *p;
 
   delete_cmd (name, list);
@@ -99,9 +100,9 @@ add_cmd (name, class, fun, doc, list)
     {
       p = *list;
       while (p->next && STRCMP (p->next->name, name) <= 0)
-        {
-          p = p->next;
-        }
+       {
+         p = p->next;
+       }
       c->next = p->next;
       p->next = c;
     }
@@ -129,7 +130,7 @@ add_cmd (name, class, fun, doc, list)
 
 /* Same as above, except that the abbrev_flag is set. */
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 struct cmd_list_element *
 add_abbrev_cmd (name, class, fun, doc, list)
@@ -140,7 +141,7 @@ add_abbrev_cmd (name, class, fun, doc, list)
      struct cmd_list_element **list;
 {
   register struct cmd_list_element *c
-    = add_cmd (name, class, fun, doc, list);
+  = add_cmd (name, class, fun, doc, list);
 
   c->abbrev_flag = 1;
   return c;
@@ -162,7 +163,7 @@ add_alias_cmd (name, oldname, class, abbrev_flag, list)
   register struct cmd_list_element *c;
   copied_name = (char *) alloca (strlen (oldname) + 1);
   strcpy (copied_name, oldname);
-  old  = lookup_cmd (&copied_name, *list, "", 1, 1);
+  old = lookup_cmd (&copied_name, *list, "", 1, 1);
 
   if (old == 0)
     {
@@ -204,7 +205,7 @@ add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
 }
 
 /* Like add_prefix_cmd but sets the abbrev_flag on the new command. */
-   
+
 struct cmd_list_element *
 add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
                       allow_unknown, list)
@@ -261,7 +262,7 @@ add_set_cmd (name, class, var_type, var, doc, list)
      struct cmd_list_element **list;
 {
   struct cmd_list_element *c
-    = add_cmd (name, class, NO_FUNCTION, doc, list);
+  = add_cmd (name, class, NO_FUNCTION, doc, list);
 
   c->type = set_cmd;
   c->var_type = var_type;
@@ -277,7 +278,7 @@ add_set_cmd (name, class, var_type, var, doc, list)
    CLASS is as in add_cmd.
    ENUMLIST is a list of strings which may follow NAME.
    VAR is address of the variable which will contain the matching string
-     (from ENUMLIST).
+   (from ENUMLIST).
    DOC is the documentation string.  */
 
 struct cmd_list_element *
@@ -290,7 +291,7 @@ add_set_enum_cmd (name, class, enumlist, var, doc, list)
      struct cmd_list_element **list;
 {
   struct cmd_list_element *c
-    = add_set_cmd (name, class, var_enum, var, doc, list);
+  = add_set_cmd (name, class, var_enum, var, doc, list);
   c->enums = enumlist;
 
   return c;
@@ -305,21 +306,21 @@ add_show_from_set (setcmd, list)
      struct cmd_list_element **list;
 {
   struct cmd_list_element *showcmd =
-    (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
+  (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
   struct cmd_list_element *p;
 
   memcpy (showcmd, setcmd, sizeof (struct cmd_list_element));
   delete_cmd (showcmd->name, list);
   showcmd->type = show_cmd;
-  
+
   /* Replace "set " at start of docstring with "show ".  */
   if (setcmd->doc[0] == 'S' && setcmd->doc[1] == 'e'
       && setcmd->doc[2] == 't' && setcmd->doc[3] == ' ')
     showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL);
   else
     fprintf_unfiltered (gdb_stderr, "GDB internal error: Bad docstring for set command\n");
-  
-    if (*list == NULL || STRCMP ((*list)->name, showcmd->name) >= 0)
+
+  if (*list == NULL || STRCMP ((*list)->name, showcmd->name) >= 0)
     {
       showcmd->next = *list;
       *list = showcmd;
@@ -328,9 +329,9 @@ add_show_from_set (setcmd, list)
     {
       p = *list;
       while (p->next && STRCMP (p->next->name, showcmd->name) <= 0)
-        {
-          p = p->next;
-        }
+       {
+         p = p->next;
+       }
       showcmd->next = p->next;
       p->next = showcmd;
     }
@@ -353,7 +354,7 @@ delete_cmd (name, list)
       if ((*list)->hookee)
        (*list)->hookee->hook = 0;      /* Hook slips out of its mouth */
       p = (*list)->next;
-      free ((PTR)*list);
+      free ((PTR) * list);
       *list = p;
     }
 
@@ -363,9 +364,9 @@ delete_cmd (name, list)
        if (STREQ (c->next->name, name))
          {
            if (c->next->hookee)
-             c->next->hookee->hook = 0;  /* hooked cmd gets away.  */
+             c->next->hookee->hook = 0;        /* hooked cmd gets away.  */
            p = c->next->next;
-           free ((PTR)c->next);
+           free ((PTR) c->next);
            c->next = p;
          }
        else
@@ -406,10 +407,10 @@ help_cmd (command, stream)
   /* There are three cases here.
      If c->prefixlist is nonzero, we have a prefix command.
      Print its documentation, then list its subcommands.
-     
+
      If c->function is nonzero, we really have a command.
      Print its documentation and return.
-     
+
      If c->function is zero, we have a class name.
      Print its documentation (as if it were a command)
      and then set class to the number of this class
@@ -456,7 +457,7 @@ help_list (list, cmdtype, class, stream)
 {
   int len;
   char *cmdtype1, *cmdtype2;
-  
+
   /* If CMDTYPE is "foo ", CMDTYPE1 gets " foo" and CMDTYPE2 gets "foo sub"  */
   len = strlen (cmdtype);
   cmdtype1 = (char *) alloca (len + 1);
@@ -477,19 +478,19 @@ help_list (list, cmdtype, class, stream)
   else
     fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
 
-  help_cmd_list (list, class, cmdtype, (int)class >= 0, stream);
+  help_cmd_list (list, class, cmdtype, (int) class >= 0, stream);
 
   if (class == all_classes)
     fprintf_filtered (stream, "\n\
 Type \"help%s\" followed by a class name for a list of commands in that class.",
-            cmdtype1);
+                     cmdtype1);
 
   fprintf_filtered (stream, "\n\
 Type \"help%s\" followed by %scommand name for full documentation.\n\
 Command name abbreviations are allowed if unambiguous.\n",
-          cmdtype1, cmdtype2);
+                   cmdtype1, cmdtype2);
 }
-     
+
 /* Print only the first line of STR on STREAM.  */
 static void
 print_doc_line (stream, str)
@@ -512,7 +513,7 @@ print_doc_line (stream, str)
   if (p - str > line_size - 1)
     {
       line_size = p - str + 1;
-      free ((PTR)line_buffer);
+      free ((PTR) line_buffer);
       line_buffer = (char *) xmalloc (line_size);
     }
   strncpy (line_buffer, str, p - str);
@@ -529,10 +530,10 @@ print_doc_line (stream, str)
  * PREFIX is the prefix to print before each command name.
  * STREAM is the stream upon which the output should be written.
  * CLASS should be:
- *     A non-negative class number to list only commands in that
+ *      A non-negative class number to list only commands in that
  * class.
- *     ALL_COMMANDS to list all commands in list.
- *     ALL_CLASSES  to list all classes in list.
+ *      ALL_COMMANDS to list all commands in list.
+ *      ALL_CLASSES  to list all classes in list.
  *
  *   Note that RECURSE will be active on *all* sublists, not just the
  * ones selected by the criteria above (ie. the selection mechanism
@@ -552,8 +553,8 @@ help_cmd_list (list, class, prefix, recurse, stream)
     {
       if (c->abbrev_flag == 0 &&
          (class == all_commands
-         || (class == all_classes && c->function.cfunc == NULL)
-         || (class == c->class && c->function.cfunc != NULL)))
+          || (class == all_classes && c->function.cfunc == NULL)
+          || (class == c->class && c->function.cfunc != NULL)))
        {
          fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
          print_doc_line (stream, c->doc);
@@ -565,14 +566,14 @@ help_cmd_list (list, class, prefix, recurse, stream)
        help_cmd_list (*c->prefixlist, class, c->prefixname, 1, stream);
     }
 }
-
 \f
+
 /* Search the input clist for 'command'.  Return the command if
    found (or NULL if not), and return the number of commands
    found in nfound */
 
 static struct cmd_list_element *
-find_cmd(command, len, clist, ignore_help_classes, nfound)
+find_cmd (command, len, clist, ignore_help_classes, nfound)
      char *command;
      int len;
      struct cmd_list_element *clist;
@@ -581,19 +582,19 @@ find_cmd(command, len, clist, ignore_help_classes, nfound)
 {
   struct cmd_list_element *found, *c;
 
-  found = (struct cmd_list_element *)NULL;
+  found = (struct cmd_list_element *) NULL;
   *nfound = 0;
   for (c = clist; c; c = c->next)
     if (!strncmp (command, c->name, len)
-        && (!ignore_help_classes || c->function.cfunc))
+       && (!ignore_help_classes || c->function.cfunc))
       {
-        found = c;
-        (*nfound)++;
-        if (c->name[len] == '\0')
-          {
-            *nfound = 1;
-            break;
-          }
+       found = c;
+       (*nfound)++;
+       if (c->name[len] == '\0')
+         {
+           *nfound = 1;
+           break;
+         }
       }
   return found;
 }
@@ -629,7 +630,7 @@ find_cmd(command, len, clist, ignore_help_classes, nfound)
    affect the operation).
 
    This routine does *not* modify the text pointed to by TEXT.
-   
+
    If IGNORE_HELP_CLASSES is nonzero, ignore any command list elements which
    are actually help classes rather than commands (i.e. the function field of
    the struct cmd_list_element is NULL).  */
@@ -651,7 +652,7 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
      so that "set args_foo()" doesn't get interpreted as
      "set args _foo()".  */
   for (p = *text;
-       *p && (isalnum(*p) || *p == '-' || *p == '_' ||
+       *p && (isalnum (*p) || *p == '-' || *p == '_' ||
              (tui_version &&
               (*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
              (xdb_commands && (*p == '!' || *p == '/' || *p == '?')));
@@ -661,7 +662,7 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
   /* If nothing but whitespace, return 0.  */
   if (p == *text)
     return 0;
-  
+
   len = p - *text;
 
   /* *text and p now bracket the first command word to lookup (and
@@ -679,20 +680,20 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
   /* Look it up.  */
   found = 0;
   nfound = 0;
-  found = find_cmd(command, len, clist, ignore_help_classes, &nfound);
+  found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
 
   /* 
-  ** We didn't find the command in the entered case, so lower case it
-  ** and search again.
-  */
+     ** We didn't find the command in the entered case, so lower case it
+     ** and search again.
+   */
   if (!found || nfound == 0)
     {
       for (tmp = 0; tmp < len; tmp++)
-        {
-          char x = command[tmp];
-          command[tmp] = isupper(x) ? tolower(x) : x;
-        }
-      found = find_cmd(command, len, clist, ignore_help_classes, &nfound);
+       {
+         char x = command[tmp];
+         command[tmp] = isupper (x) ? tolower (x) : x;
+       }
+      found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
     }
 
   /* If nothing matches, we have a simple failure.  */
@@ -704,8 +705,8 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
       if (result_list != NULL)
        /* Will be modified in calling routine
           if we know what the prefix command is.  */
-       *result_list = 0;               
-      return (struct cmd_list_element *) -1; /* Ambiguous.  */
+       *result_list = 0;
+      return (struct cmd_list_element *) -1;   /* Ambiguous.  */
     }
 
   /* We've matched something on this list.  Move text pointer forward. */
@@ -738,9 +739,9 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
          if (result_list != NULL)
            if (!*result_list)
              /* This used to say *result_list = *found->prefixlist
-                If that was correct, need to modify the documentation
-                at the top of this function to clarify what is supposed
-                to be going on.  */
+                If that was correct, need to modify the documentation
+                at the top of this function to clarify what is supposed
+                to be going on.  */
              *result_list = found;
          return c;
        }
@@ -765,11 +766,11 @@ undef_cmd_error (cmdtype, q)
      char *cmdtype, *q;
 {
   error ("Undefined %scommand: \"%s\".  Try \"help%s%.*s\".",
-    cmdtype,
-    q,
-    *cmdtype? " ": "",
-    strlen(cmdtype)-1,
-    cmdtype);
+        cmdtype,
+        q,
+        *cmdtype ? " " : "",
+        strlen (cmdtype) - 1,
+        cmdtype);
 }
 
 /* Look up the contents of *LINE as a command in the command list LIST.
@@ -796,7 +797,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
 {
   struct cmd_list_element *last_list = 0;
   struct cmd_list_element *c =
-    lookup_cmd_1 (line, list, &last_list, ignore_help_classes);
+  lookup_cmd_1 (line, list, &last_list, ignore_help_classes);
 #if 0
   /* This is wrong for complete_command.  */
   char *ptr = (*line) + strlen (*line) - 1;
@@ -806,7 +807,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
     ptr--;
   *(ptr + 1) = '\0';
 #endif
-  
+
   if (!c)
     {
       if (!allow_unknown)
@@ -817,7 +818,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
            {
              char *p = *line, *q;
 
-             while (isalnum(*p) || *p == '-')
+             while (isalnum (*p) || *p == '-')
                p++;
 
              q = (char *) alloca (p - *line + 1);
@@ -832,13 +833,13 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
   else if (c == (struct cmd_list_element *) -1)
     {
       /* Ambigous.  Local values should be off prefixlist or called
-        values.  */
+         values.  */
       int local_allow_unknown = (last_list ? last_list->allow_unknown :
                                 allow_unknown);
       char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
       struct cmd_list_element *local_list =
-       (last_list ? *(last_list->prefixlist) : list);
-      
+      (last_list ? *(last_list->prefixlist) : list);
+
       if (local_allow_unknown < 0)
        {
          if (last_list)
@@ -857,12 +858,12 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
                && (*line)[amb_len] != '\t');
               amb_len++)
            ;
-         
+
          ambbuf[0] = 0;
          for (c = local_list; c; c = c->next)
            if (!strncmp (*line, c->name, amb_len))
              {
-               if (strlen (ambbuf) + strlen (c->name) + 6 < (int)sizeof ambbuf)
+               if (strlen (ambbuf) + strlen (c->name) + 6 < (int) sizeof ambbuf)
                  {
                    if (strlen (ambbuf))
                      strcat (ambbuf, ", ");
@@ -894,7 +895,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
     }
   return 0;
 }
-       
+
 #if 0
 /* Look up the contents of *LINE as a command in the command list LIST.
    LIST is a chain of struct cmd_list_element's.
@@ -935,7 +936,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
   /* Find end of command name.  */
 
   p = *line;
-  while (*p == '-' || isalnum(*p))
+  while (*p == '-' || isalnum (*p))
     p++;
 
   /* Look up the command name.
@@ -950,18 +951,18 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
        error ("Lack of needed %scommand", cmdtype);
       return 0;
     }
-  
+
   /* Copy over to a local buffer, converting to lowercase on the way.
      This is in case the command being parsed is a subcommand which
      doesn't match anything, and that's ok.  We want the original
      untouched for the routine of the original command.  */
-  
+
   processed_cmd = (char *) alloca (p - *line + 1);
   for (cmd_len = 0; cmd_len < p - *line; cmd_len++)
     {
       char x = (*line)[cmd_len];
-      if (isupper(x))
-       processed_cmd[cmd_len] = tolower(x);
+      if (isupper (x))
+       processed_cmd[cmd_len] = tolower (x);
       else
        processed_cmd[cmd_len] = x;
     }
@@ -1016,7 +1017,8 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
 
   /* Skip whitespace before the argument.  */
 
-  while (*p == ' ' || *p == '\t') p++;
+  while (*p == ' ' || *p == '\t')
+    p++;
   *line = p;
 
   if (found->prefixlist && *p)
@@ -1066,12 +1068,12 @@ complete_on_cmdlist (list, text, word)
        if (matches == sizeof_matchlist)
          {
            sizeof_matchlist *= 2;
-           matchlist = (char **) xrealloc ((char *)matchlist,
+           matchlist = (char **) xrealloc ((char *) matchlist,
                                            (sizeof_matchlist
                                             * sizeof (char *)));
          }
 
-       matchlist[matches] = (char *) 
+       matchlist[matches] = (char *)
          xmalloc (strlen (word) + strlen (ptr->name) + 1);
        if (word == text)
          strcpy (matchlist[matches], ptr->name);
@@ -1092,13 +1094,13 @@ complete_on_cmdlist (list, text, word)
 
   if (matches == 0)
     {
-      free ((PTR)matchlist);
+      free ((PTR) matchlist);
       matchlist = 0;
     }
   else
     {
-      matchlist = (char **) xrealloc ((char *)matchlist, ((matches + 1)
-                                               * sizeof (char *)));
+      matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
+                                                       * sizeof (char *)));
       matchlist[matches] = (char *) 0;
     }
 
@@ -1138,12 +1140,12 @@ complete_on_enum (enumlist, text, word)
        if (matches == sizeof_matchlist)
          {
            sizeof_matchlist *= 2;
-           matchlist = (char **) xrealloc ((char *)matchlist,
+           matchlist = (char **) xrealloc ((char *) matchlist,
                                            (sizeof_matchlist
                                             * sizeof (char *)));
          }
 
-       matchlist[matches] = (char *) 
+       matchlist[matches] = (char *)
          xmalloc (strlen (word) + strlen (name) + 1);
        if (word == text)
          strcpy (matchlist[matches], name);
@@ -1164,13 +1166,13 @@ complete_on_enum (enumlist, text, word)
 
   if (matches == 0)
     {
-      free ((PTR)matchlist);
+      free ((PTR) matchlist);
       matchlist = 0;
     }
   else
     {
-      matchlist = (char **) xrealloc ((char *)matchlist, ((matches + 1)
-                                               * sizeof (char *)));
+      matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
+                                                       * sizeof (char *)));
       matchlist[matches] = (char *) 0;
     }
 
@@ -1195,16 +1197,15 @@ parse_binary_operation (arg)
       || !strncmp (arg, "1", length)
       || !strncmp (arg, "yes", length))
     return 1;
+  else if (!strncmp (arg, "off", length)
+          || !strncmp (arg, "0", length)
+          || !strncmp (arg, "no", length))
+    return 0;
   else
-    if (!strncmp (arg, "off", length)
-       || !strncmp (arg, "0", length)
-       || !strncmp (arg, "no", length))
+    {
+      error ("\"on\" or \"off\" expected.");
       return 0;
-    else 
-      {
-       error ("\"on\" or \"off\" expected.");
-       return 0;
-      }
+    }
 }
 
 /* Do a "set" or "show" command.  ARG is NULL if no argument, or the text
@@ -1227,11 +1228,12 @@ do_setshow_command (arg, from_tty, c)
            char *p;
            char *q;
            int ch;
-           
+
            if (arg == NULL)
              arg = "";
            new = (char *) xmalloc (strlen (arg) + 2);
-           p = arg; q = new;
+           p = arg;
+           q = new;
            while ((ch = *p++) != '\000')
              {
                if (ch == '\\')
@@ -1247,7 +1249,7 @@ do_setshow_command (arg, from_tty, c)
                      break;
                    ch = parse_escape (&p);
                    if (ch == 0)
-                     break; /* C loses */
+                     break;    /* C loses */
                    else if (ch > 0)
                      *q++ = ch;
                  }
@@ -1260,24 +1262,24 @@ do_setshow_command (arg, from_tty, c)
 #endif
            *q++ = '\0';
            new = (char *) xrealloc (new, q - new);
-           if (*(char **)c->var != NULL)
-             free (*(char **)c->var);
+           if (*(char **) c->var != NULL)
+             free (*(char **) c->var);
            *(char **) c->var = new;
          }
          break;
        case var_string_noescape:
          if (arg == NULL)
            arg = "";
-         if (*(char **)c->var != NULL)
-           free (*(char **)c->var);
+         if (*(char **) c->var != NULL)
+           free (*(char **) c->var);
          *(char **) c->var = savestring (arg, strlen (arg));
          break;
        case var_filename:
          if (arg == NULL)
            error_no_arg ("filename to set it to.");
-         if (*(char **)c->var != NULL)
-           free (*(char **)c->var);
-         *(char **)c->var = tilde_expand (arg);
+         if (*(char **) c->var != NULL)
+           free (*(char **) c->var);
+         *(char **) c->var = tilde_expand (arg);
          break;
        case var_boolean:
          *(int *) c->var = parse_binary_operation (arg);
@@ -1332,7 +1334,7 @@ do_setshow_command (arg, from_tty, c)
              }
 
            p = strchr (arg, ' ');
-           
+
            if (p)
              len = p - arg;
            else
@@ -1352,7 +1354,7 @@ do_setshow_command (arg, from_tty, c)
            if (nmatches > 1)
              error ("Ambiguous item \"%s\".", arg);
 
-           *(char **)c->var = match;
+           *(char **) c->var = match;
          }
          break;
        default:
@@ -1363,54 +1365,55 @@ do_setshow_command (arg, from_tty, c)
     {
       /* Print doc minus "show" at start.  */
       print_doc_line (gdb_stdout, c->doc + 5);
-      
+
       fputs_filtered (" is ", gdb_stdout);
       wrap_here ("    ");
       switch (c->var_type)
        {
-      case var_string:
-       {
-         unsigned char *p;
+       case var_string:
+         {
+           unsigned char *p;
 
+           fputs_filtered ("\"", gdb_stdout);
+           if (*(unsigned char **) c->var)
+             for (p = *(unsigned char **) c->var; *p != '\0'; p++)
+               gdb_printchar (*p, gdb_stdout, '"');
+           fputs_filtered ("\"", gdb_stdout);
+         }
+         break;
+       case var_string_noescape:
+       case var_filename:
+       case var_enum:
          fputs_filtered ("\"", gdb_stdout);
-         if (*(unsigned char **)c->var)
-           for (p = *(unsigned char **) c->var; *p != '\0'; p++)
-             gdb_printchar (*p, gdb_stdout, '"');
+         if (*(char **) c->var)
+           fputs_filtered (*(char **) c->var, gdb_stdout);
          fputs_filtered ("\"", gdb_stdout);
-       }
-       break;
-      case var_string_noescape:
-      case var_filename:
-      case var_enum:
-       fputs_filtered ("\"", gdb_stdout);
-       if (*(char **)c->var)
-         fputs_filtered (*(char **) c->var, gdb_stdout);
-       fputs_filtered ("\"", gdb_stdout);
-       break;
-      case var_boolean:
-       fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
-       break;
-      case var_uinteger:
-       if (*(unsigned int *) c->var == UINT_MAX) {
-         fputs_filtered ("unlimited", gdb_stdout);
          break;
+       case var_boolean:
+         fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
+         break;
+       case var_uinteger:
+         if (*(unsigned int *) c->var == UINT_MAX)
+           {
+             fputs_filtered ("unlimited", gdb_stdout);
+             break;
+           }
+         /* else fall through */
+       case var_zinteger:
+         fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
+         break;
+       case var_integer:
+         if (*(int *) c->var == INT_MAX)
+           {
+             fputs_filtered ("unlimited", gdb_stdout);
+           }
+         else
+           fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
+         break;
+
+       default:
+         error ("gdb internal error: bad var_type in do_setshow_command");
        }
-       /* else fall through */
-      case var_zinteger:
-       fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
-       break;
-      case var_integer:
-       if (*(int *) c->var == INT_MAX)
-         {
-           fputs_filtered ("unlimited", gdb_stdout);
-         }
-       else
-         fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
-       break;
-           
-      default:
-       error ("gdb internal error: bad var_type in do_setshow_command");
-      }
       fputs_filtered (".\n", gdb_stdout);
     }
   else
@@ -1426,19 +1429,20 @@ cmd_show_list (list, from_tty, prefix)
      int from_tty;
      char *prefix;
 {
-  for (; list != NULL; list = list->next) {
-    /* If we find a prefix, run its list, prefixing our output by its
-       prefix (with "show " skipped).  */
-    if (list->prefixlist && !list->abbrev_flag)
-      cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
-    if (list->type == show_cmd)
-      {
-       fputs_filtered (prefix, gdb_stdout);
-       fputs_filtered (list->name, gdb_stdout);
-       fputs_filtered (":  ", gdb_stdout);
-       do_setshow_command ((char *)NULL, from_tty, list);
-      }
-  }
+  for (; list != NULL; list = list->next)
+    {
+      /* If we find a prefix, run its list, prefixing our output by its
+         prefix (with "show " skipped).  */
+      if (list->prefixlist && !list->abbrev_flag)
+       cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+      if (list->type == show_cmd)
+       {
+         fputs_filtered (prefix, gdb_stdout);
+         fputs_filtered (list->name, gdb_stdout);
+         fputs_filtered (":  ", gdb_stdout);
+         do_setshow_command ((char *) NULL, from_tty, list);
+       }
+    }
 }
 
 /* ARGSUSED */
@@ -1464,7 +1468,7 @@ shell_escape (arg, from_tty)
   else
     p++;                       /* Get past '/' */
 
-  if ((pid = fork()) == 0)
+  if ((pid = fork ()) == 0)
     {
       if (!arg)
        execl (user_shell, p, 0);
@@ -1496,11 +1500,11 @@ make_command (arg, from_tty)
     p = "make";
   else
     {
-      p = xmalloc (sizeof("make ") + strlen(arg));
+      p = xmalloc (sizeof ("make ") + strlen (arg));
       strcpy (p, "make ");
-      strcpy (p + sizeof("make ")-1, arg);
+      strcpy (p + sizeof ("make ") - 1, arg);
     }
-  
+
   shell_escape (p, from_tty);
 }
 
@@ -1560,11 +1564,11 @@ _initialize_command ()
 With no arguments, run an inferior shell.");
 
   if (xdb_commands)
-    add_com_alias("!", "shell", class_support, 0);
+    add_com_alias ("!", "shell", class_support, 0);
 
   add_com ("make", class_support, make_command,
-          "Run the ``make'' program using the rest of the line as arguments.");
-  add_cmd ("user", no_class, show_user, 
+       "Run the ``make'' program using the rest of the line as arguments.");
+  add_cmd ("user", no_class, show_user,
           "Show definitions of user defined commands.\n\
 Argument is the name of the user defined command.\n\
 With no argument, show definitions of all user defined commands.", &showlist);
index 5a209234e08e8b1f3048f96eb44ba7dc7ced4b71..c7b8e5ea90253c7b5250982b6e64bc80b0022ed6 100644 (file)
@@ -1,19 +1,20 @@
 /* Header file for command-reading library command.c.
    Copyright (C) 1986, 1989, 1990 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (COMMAND_H)
 #define COMMAND_H 1
@@ -21,42 +22,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Not a set/show command.  Note that some commands which begin with
    "set" or "show" might be in this category, if their syntax does
    not fall into one of the following categories.  */
-typedef enum cmd_types {
-  not_set_cmd,
-  set_cmd,
-  show_cmd
-} cmd_types;
+typedef enum cmd_types
+  {
+    not_set_cmd,
+    set_cmd,
+    show_cmd
+  }
+cmd_types;
 
 /* Types of "set" or "show" command.  */
-typedef enum var_types {
-  /* "on" or "off".  *VAR is an integer which is nonzero for on,
-     zero for off.  */
-  var_boolean,
-  /* Unsigned Integer.  *VAR is an unsigned int.  The user can type 0
-     to mean "unlimited", which is stored in *VAR as UINT_MAX.  */
-  var_uinteger,
-
-  /* Like var_uinteger but signed.  *VAR is an int.  The user can type 0
-     to mean "unlimited", which is stored in *VAR as INT_MAX.  */
-  var_integer,
-
-  /* String which the user enters with escapes (e.g. the user types \n and
-     it is a real newline in the stored string).
-     *VAR is a malloc'd string, or NULL if the string is empty.  */
-  var_string,
-  /* String which stores what the user types verbatim.
-     *VAR is a malloc'd string, or NULL if the string is empty.  */
-  var_string_noescape,
-  /* String which stores a filename.
-     *VAR is a malloc'd string, or NULL if the string is empty.  */
-  var_filename,
-  /* ZeroableInteger.  *VAR is an int.  Like Unsigned Integer except
-     that zero really means zero.  */
-  var_zinteger,
-  /* Enumerated type.  Can only have one of the specified values.  *VAR is a
-     char pointer to the name of the element that we find.  */
-  var_enum
-} var_types;
+typedef enum var_types
+  {
+    /* "on" or "off".  *VAR is an integer which is nonzero for on,
+       zero for off.  */
+    var_boolean,
+    /* Unsigned Integer.  *VAR is an unsigned int.  The user can type 0
+       to mean "unlimited", which is stored in *VAR as UINT_MAX.  */
+    var_uinteger,
+
+    /* Like var_uinteger but signed.  *VAR is an int.  The user can type 0
+       to mean "unlimited", which is stored in *VAR as INT_MAX.  */
+    var_integer,
+
+    /* String which the user enters with escapes (e.g. the user types \n and
+       it is a real newline in the stored string).
+       *VAR is a malloc'd string, or NULL if the string is empty.  */
+    var_string,
+    /* String which stores what the user types verbatim.
+       *VAR is a malloc'd string, or NULL if the string is empty.  */
+    var_string_noescape,
+    /* String which stores a filename.
+       *VAR is a malloc'd string, or NULL if the string is empty.  */
+    var_filename,
+    /* ZeroableInteger.  *VAR is an int.  Like Unsigned Integer except
+       that zero really means zero.  */
+    var_zinteger,
+    /* Enumerated type.  Can only have one of the specified values.  *VAR is a
+       char pointer to the name of the element that we find.  */
+    var_enum
+  }
+var_types;
 
 /* This structure records one command'd definition.  */
 
@@ -82,9 +87,10 @@ struct cmd_list_element
        /* If type is cmd_set or show_cmd, first set the variables, and
           then call this.  */
        void (*sfunc) PARAMS ((char *args, int from_tty,
-                              struct cmd_list_element *c));
-      } function;
-#   define NO_FUNCTION ((void (*) PARAMS((char *args, int from_tty))) 0)
+                              struct cmd_list_element * c));
+      }
+    function;
+#define NO_FUNCTION ((void (*) PARAMS((char *args, int from_tty))) 0)
 
     /* Documentation of this command (or help topic).
        First line is brief documentation; remaining lines form, with it,
@@ -129,7 +135,7 @@ struct cmd_list_element
        returned relative to this position.  For example, suppose TEXT is "foo"
        and we want to complete to "foobar".  If WORD is "oo", return
        "oobar"; if WORD is "baz/foo", return "baz/foobar".  */
-    char ** (*completer) PARAMS ((char *text, char *word));
+    char **(*completer) PARAMS ((char *text, char *word));
 
     /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
        or "show").  */
@@ -160,33 +166,33 @@ struct cmd_list_element
 /* Forward-declarations of the entry-points of command.c.  */
 
 extern struct cmd_list_element *
-add_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
-                char *, struct cmd_list_element **));
+  add_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
+                  char *, struct cmd_list_element **));
 
 extern struct cmd_list_element *
-add_alias_cmd PARAMS ((char *, char *, enum command_class, int,
-                      struct cmd_list_element **));
+  add_alias_cmd PARAMS ((char *, char *, enum command_class, int,
+                        struct cmd_list_element **));
 
 extern struct cmd_list_element *
-add_prefix_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
-                       char *, struct cmd_list_element **, char *, int,
-                       struct cmd_list_element **));
+  add_prefix_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
+                         char *, struct cmd_list_element **, char *, int,
+                         struct cmd_list_element **));
 
 extern struct cmd_list_element *
-add_abbrev_prefix_cmd PARAMS ((char *, enum command_class,
-                              void (*fun) (char *, int), char *,
-                              struct cmd_list_element **, char *, int,
-                              struct cmd_list_element **));
+  add_abbrev_prefix_cmd PARAMS ((char *, enum command_class,
+                                void (*fun) (char *, int), char *,
+                                struct cmd_list_element **, char *, int,
+                                struct cmd_list_element **));
 
 extern struct cmd_list_element *
-lookup_cmd PARAMS ((char **, struct cmd_list_element *, char *, int, int));
+  lookup_cmd PARAMS ((char **, struct cmd_list_element *, char *, int, int));
 
 extern struct cmd_list_element *
-lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *,
-                     struct cmd_list_element **, int));
+  lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *,
+                       struct cmd_list_element **, int));
 
 extern void
-add_com PARAMS ((char *, enum command_class, void (*fun)(char *, int),
+add_com PARAMS ((char *, enum command_class, void (*fun) (char *, int),
                 char *));
 
 extern void
@@ -199,10 +205,10 @@ extern void
 add_info_alias PARAMS ((char *, char *, int));
 
 extern char **
-complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *));
+  complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *));
 
 extern char **
-complete_on_enum PARAMS ((char **enumlist, char *, char *));
+  complete_on_enum PARAMS ((char **enumlist, char *, char *));
 
 extern void
 delete_cmd PARAMS ((char *, struct cmd_list_element **));
@@ -219,16 +225,16 @@ help_cmd_list PARAMS ((struct cmd_list_element *, enum command_class, char *,
                       int, GDB_FILE *));
 
 extern struct cmd_list_element *
-add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
-                    struct cmd_list_element **));
+  add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
+                      struct cmd_list_element **));
 
 extern struct cmd_list_element *
-add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[],
-                         char *var, char *doc, struct cmd_list_element **c));
+  add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[],
+                      char *var, char *doc, struct cmd_list_element ** c));
 
 extern struct cmd_list_element *
-add_show_from_set PARAMS ((struct cmd_list_element *,
-                          struct cmd_list_element **));
+  add_show_from_set PARAMS ((struct cmd_list_element *,
+                            struct cmd_list_element **));
 
 /* Do a "set" or "show" command.  ARG is NULL if no argument, or the text
    of the argument, and FROM_TTY is nonzero if this command is being entered
index 0a838a3a709a9956e326324e4b712c45a4a2f595..3c05912911de4760c7bff4fbffedb6856ab9fc27 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for complaint handling during symbol reading in GDB.
    Copyright (C) 1990, 1991, 1992  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "complaints.h"
@@ -25,11 +26,12 @@ extern void _initialize_complaints PARAMS ((void));
 
 /* Structure to manage complaints about symbol file contents.  */
 
-struct complaint complaint_root[1] = {
+struct complaint complaint_root[1] =
+{
   {
-    (char *) NULL,     /* Complaint message */
-    0,                 /* Complaint counter */
-    complaint_root     /* Next complaint. */
+    (char *) NULL,             /* Complaint message */
+    0,                         /* Complaint counter */
+    complaint_root             /* Next complaint. */
   }
 };
 
@@ -44,15 +46,15 @@ static unsigned int stop_whining = 0;
    case 0:  self explanatory message.
    case 1:  First message of a series that must start off with explanation.
    case 2:  Subsequent message, when user already knows we are reading
-            symbols and we can just state our piece.  */
+   symbols and we can just state our piece.  */
 
 static int complaint_series = 0;
 
 /* External variables and functions referenced. */
 
 extern int info_verbose;
-
 \f
+
 /* Functions to handle complaints during symbol reading.  */
 
 /* Print a complaint about the input symbols, and link the complaint block
@@ -61,7 +63,7 @@ extern int info_verbose;
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-complain (struct complaint *complaint, ...)
+complain (struct complaint *complaint,...)
 #else
 complain (va_alist)
      va_dcl
@@ -77,13 +79,13 @@ complain (va_alist)
   complaint = va_arg (args, struct complaint *);
 #endif
 
-  complaint -> counter++;
-  if (complaint -> next == NULL)
+  complaint->counter++;
+  if (complaint->next == NULL)
     {
-      complaint -> next = complaint_root -> next;
-      complaint_root -> next = complaint;
+      complaint->next = complaint_root->next;
+      complaint_root->next = complaint;
     }
-  if (complaint -> counter > stop_whining)
+  if (complaint->counter > stop_whining)
     {
       return;
     }
@@ -93,31 +95,31 @@ complain (va_alist)
     {
 
       /* Isolated messages, must be self-explanatory.  */
-      case 0:
-        begin_line ();
-        puts_filtered ("During symbol reading, ");
-       wrap_here ("");
-       vprintf_filtered (complaint -> message, args);
-       puts_filtered (".\n");
-       break;
+    case 0:
+      begin_line ();
+      puts_filtered ("During symbol reading, ");
+      wrap_here ("");
+      vprintf_filtered (complaint->message, args);
+      puts_filtered (".\n");
+      break;
 
       /* First of a series, without `set verbose'.  */
-      case 1:
-        begin_line ();
-       puts_filtered ("During symbol reading...");
-       vprintf_filtered (complaint -> message, args);
-       puts_filtered ("...");
-       wrap_here ("");
-       complaint_series++;
-       break;
+    case 1:
+      begin_line ();
+      puts_filtered ("During symbol reading...");
+      vprintf_filtered (complaint->message, args);
+      puts_filtered ("...");
+      wrap_here ("");
+      complaint_series++;
+      break;
 
       /* Subsequent messages of a series, or messages under `set verbose'.
-        (We'll already have produced a "Reading in symbols for XXX..."
-        message and will clean up at the end with a newline.)  */
-      default:
-       vprintf_filtered (complaint -> message, args);
-       puts_filtered ("...");
-       wrap_here ("");
+         (We'll already have produced a "Reading in symbols for XXX..."
+         message and will clean up at the end with a newline.)  */
+    default:
+      vprintf_filtered (complaint->message, args);
+      puts_filtered ("...");
+      wrap_here ("");
     }
   /* If GDB dumps core, we'd like to see the complaints first.  Presumably
      GDB will not be sending so many complaints that this becomes a
@@ -141,9 +143,9 @@ clear_complaints (sym_reading, noisy)
 {
   struct complaint *p;
 
-  for (p = complaint_root -> next; p != complaint_root; p = p -> next)
+  for (p = complaint_root->next; p != complaint_root; p = p->next)
     {
-      p -> counter = 0;
+      p->counter = 0;
     }
 
   if (!sym_reading && !noisy && complaint_series > 1)
index 4b9b5de5236bc1e6255d5d959e8248400a504ed1..d65b037c3b52b055ee3aec137490e28dfed19a7f 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for complaint handling during symbol reading in GDB.
    Copyright (C) 1990, 1991, 1992  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #if !defined (COMPLAINTS_H)
@@ -30,11 +31,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    if verbose, we report how many of each problem we had.  */
 
 struct complaint
-{
-  char *message;
-  unsigned counter;
-  struct complaint *next;
-};
+  {
+    char *message;
+    unsigned counter;
+    struct complaint *next;
+  };
 
 /* Root of the chain of complaints that have at some point been issued. 
    This is used to reset the counters, and/or report the total counts.  */
@@ -44,10 +45,10 @@ extern struct complaint complaint_root[1];
 /* Functions that handle complaints.  (in complaints.c)  */
 
 extern void
-complain PARAMS ((struct complaint *, ...));
+complain PARAMS ((struct complaint *,...));
 
 extern void
 clear_complaints PARAMS ((int, int));
 
 
-#endif /* !defined (COMPLAINTS_H) */
+#endif /* !defined (COMPLAINTS_H) */
index a3bc47452c4bd54cccff3e309129d3d40777f639..1e3cb0760b283f7559719ea69dedc65c69a64803 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
    Contributed by David Wood (wood@lab.ultra.nyu.edu).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* If we ever *do* end up using the standard fetch_inferior_registers,
    this is the right value for U_REGS_OFFSET.  */
index 8eb476e3cb2c5fb1fdcad098af28278dfa884a06..5d759e79bf5fb9874baa99ae4876a69ac99fdea3 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 1991, 1993, 1994 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by Jim Kingdon.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Parameters for an EB29K (a board which plugs into a PC and is
    accessed through EBMON software running on the PC, which we
@@ -135,7 +136,7 @@ CORE_ADDR a29k_skip_prologue ();
 /*
  * Converts an sdb register number to an internal gdb register number.
  * Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or...
- *                     gr64->0...gr95->31, lr0->32...lr127->159.
+ *                      gr64->0...gr95->31, lr0->32...lr127->159.
  */
 #define SDB_REG_TO_REGNUM(value) \
   (((value) >= 96 && (value) <= 127) ? ((value) - 96) : \
@@ -148,8 +149,8 @@ CORE_ADDR a29k_skip_prologue ();
  * register sets.  Namely, gcc can compile (-mkernel-registers) so that
  * it uses gr64-gr95 in stead of gr96-gr127.
  */
-#define MSP_HW_REGNUM  125             /* gr125 */
-#define RAB_HW_REGNUM  126             /* gr126 */
+#define MSP_HW_REGNUM  125     /* gr125 */
+#define RAB_HW_REGNUM  126     /* gr126 */
 
 /* Convert Processor Special register #x to REGISTER_NAMES register # */
 #define SR_REGNUM(x) \
@@ -170,7 +171,7 @@ CORE_ADDR a29k_skip_prologue ();
 /* This needs to be the memory stack pointer, not the register stack pointer,
    to make call_function work right.  */
 #define SP_REGNUM MSP_REGNUM
-#define FP_REGNUM 33 /* lr1 */
+#define FP_REGNUM 33           /* lr1 */
 
 /* Return register for transparent calling convention (gr122).  */
 #define TPC_REGNUM (122 - 96 + GR96_REGNUM)
@@ -207,8 +208,8 @@ CORE_ADDR a29k_skip_prologue ();
 #define RBP_REGNUM (VAB_REGNUM + 7)
 #define TMC_REGNUM (VAB_REGNUM + 8)
 #define TMR_REGNUM (VAB_REGNUM + 9)
-#define NPC_REGNUM (VAB_REGNUM + 10)  /* pc0 */
-#define PC_REGNUM  (VAB_REGNUM + 11)  /* pc1 */
+#define NPC_REGNUM (VAB_REGNUM + 10)   /* pc0 */
+#define PC_REGNUM  (VAB_REGNUM + 11)   /* pc1 */
 #define PC2_REGNUM (VAB_REGNUM + 12)
 #define MMU_REGNUM (VAB_REGNUM + 13)
 #define LRU_REGNUM (VAB_REGNUM + 14)
@@ -223,7 +224,7 @@ CORE_ADDR a29k_skip_prologue ();
 #define IPA_REGNUM (VAB_REGNUM + 22)
 #define IPB_REGNUM (VAB_REGNUM + 23)
 
-#endif /* !defined(REGISTER_NAMES) */
+#endif /* !defined(REGISTER_NAMES) */
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -309,8 +310,7 @@ extern use_struct_convention_fn a29k_use_struct_convention;
     write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF),  \
                          TYPE_LENGTH (TYPE));                            \
   }
-\f
-/* *INDENT-OFF* */
+\f/* *INDENT-OFF* */
 /* The a29k user's guide documents well what the stacks look like.
    But what isn't so clear there is how this interracts with the
    symbols, or with GDB.
@@ -321,10 +321,10 @@ extern use_struct_convention_fn a29k_use_struct_convention;
    alloca()), the result of the calculation msp + msize.
 
    LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp.
-     For high C, these are relative to msp (making alloca impossible).
+   For high C, these are relative to msp (making alloca impossible).
    LOC_REGISTER, LOC_REGPARM - The register number is the number at the
-     time the function is running (after the prologue), or in the case
-     of LOC_REGPARM, may be a register number in the range 160-175.
+   time the function is running (after the prologue), or in the case
+   of LOC_REGPARM, may be a register number in the range 160-175.
 
    The compilers do things like store an argument into memory, and then put out
    a LOC_ARG for it, or put it into global registers and put out a
@@ -349,74 +349,75 @@ extern use_struct_convention_fn a29k_use_struct_convention;
    registers need to be filled in the function epilogue.
 
    Consider the code:
-              < call bar>
-               loc1: . . .
-        bar:  sub gr1,gr1,rsize_b
-             . . .
-             add mfp,msp,0
-             sub msp,msp,msize_b
-             . . .
-             < call foo >
-       loc2: . . .
-        foo:  sub gr1,gr1,rsize_f
-             . . .
-             add mfp,msp,0
-             sub msp,msp,msize_f
-             . . .
-        loc3: < suppose the inferior stops here >
-
-                   memory stack      register stack
-                  |           |     |____________|
-                  |           |     |____loc1____|
-         +------->|___________|     |            |   ^
-         |        | ^         |     |  locals_b  |   |
-         |        | |         |     |____________|   |
-         |        | |         |     |            |   | rsize_b
-         |        | | msize_b |     | args_to_f  |   |
-         |        | |         |     |____________|   |
-         |        | |         |     |____lr1_____|   V
-         |        | V         |     |____loc2____|<----------------+
-         |   +--->|___________|<---------mfp     |   ^             |
-         |   |    | ^         |     |  locals_f  |   |             |
-         |   |    | | msize_f |     |____________|   |             |
-         |   |    | |         |     |            |   | rsize_f     |
-         |   |    | V         |     |   args     |   |             |
-         |   |    |___________|<msp |____________|   |             |
-         |   |                      |_____lr1____|   V             |
-         |   |                      |___garbage__| <- gr1 <----+   |
-         |   |                                                 |   |
-          |   |                                                |   |
-         |   |                      pc=loc3                    |   |
-         |   |                                                 |   |
-         |   |                                                 |   |
-         |   |            frame cache                          |   |
-          |   |       |_________________|                      |   |
-          |   |       |rsize=rsize_b    |                      |   |
-          |   |       |msize=msize_b    |                      |   |
-          +---|--------saved_msp        |                      |   |
-              |       |frame------------------------------------|---+
-              |       |pc=loc2          |                       |
-              |       |_________________|                       |
-              |       |rsize=rsize_f    |                       |
-              |       |msize=msize_f    |                       |
-              +--------saved_msp        |                       |
-                      |frame------------------------------------+
-                      |pc=loc3          |
-                      |_________________|
+   < call bar>
+   loc1: . . .
+   bar:  sub gr1,gr1,rsize_b
+   . . .
+   add mfp,msp,0
+   sub msp,msp,msize_b
+   . . .
+   < call foo >
+   loc2: . . .
+   foo:  sub gr1,gr1,rsize_f
+   . . .
+   add mfp,msp,0
+   sub msp,msp,msize_f
+   . . .
+   loc3: < suppose the inferior stops here >
+
+   memory stack      register stack
+   |           |     |____________|
+   |           |     |____loc1____|
+   +------->|___________|     |            |   ^
+   |        | ^         |     |  locals_b  |   |
+   |        | |         |     |____________|   |
+   |        | |         |     |            |   | rsize_b
+   |        | | msize_b |     | args_to_f  |   |
+   |        | |         |     |____________|   |
+   |        | |         |     |____lr1_____|   V
+   |        | V         |     |____loc2____|<----------------+
+   |   +--->|___________|<---------mfp     |   ^             |
+   |   |    | ^         |     |  locals_f  |   |             |
+   |   |    | | msize_f |     |____________|   |             |
+   |   |    | |         |     |            |   | rsize_f     |
+   |   |    | V         |     |   args     |   |             |
+   |   |    |___________|<msp |____________|   |             |
+   |   |                      |_____lr1____|   V             |
+   |   |                      |___garbage__| <- gr1 <----+   |
+   |   |                                                |   |
+   |   |                                                |   |
+   |   |                             pc=loc3                    |   |
+   |   |                                                |   |
+   |   |                                                |   |
+   |   |            frame cache                         |   |
+   |   |       |_________________|                      |   |
+   |   |       |rsize=rsize_b    |                      |   |
+   |   |       |msize=msize_b    |                      |   |
+   +---|--------saved_msp        |                      |   |
+   |       |frame------------------------------------|---+
+   |       |pc=loc2          |                       |
+   |       |_________________|                       |
+   |       |rsize=rsize_f    |                       |
+   |       |msize=msize_f    |                       |
+   +--------saved_msp        |                       |
+   |frame------------------------------------+
+   |pc=loc3          |
+   |_________________|
 
    So, is that sufficiently confusing?  Welcome to the 29000.
    Notes:
    * The frame for foo uses a memory frame pointer but the frame for
-     bar does not.  In the latter case the saved_msp is
-     computed by adding msize to the saved_msp of the
-     next frame.
+   bar does not.  In the latter case the saved_msp is
+   computed by adding msize to the saved_msp of the
+   next frame.
    * msize is in the frame cache only for high C's sake.  */
 /* *INDENT-ON* */
 
+
 void read_register_stack ();
 long read_register_stack_integer ();
 \f
-#define FRAME_INIT_SAVED_REGS(fi) /*no-op*/
+#define FRAME_INIT_SAVED_REGS(fi)      /*no-op */
 
 #define EXTRA_FRAME_INFO  \
   CORE_ADDR saved_msp;    \
@@ -436,8 +437,8 @@ void init_extra_frame_info ();
 
 #define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci)
 void init_frame_pc ();
-
 \f
+
 /* FRAME_CHAIN takes a FRAME
    and produces the frame's chain-pointer.
 
@@ -510,7 +511,7 @@ extern CORE_ADDR frame_locals_address ();
 enum lval_type;
 struct frame_info;
 #endif
-void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lvalp));
+void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lvalp));
 #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
       a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
 \f
@@ -567,6 +568,8 @@ void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADD
    retaddr_dummy:  This points to a breakpoint instruction in the dummy.  */
 /* *INDENT-ON* */
 \f
+
+
 /* Rsize for dummy frame, in bytes.  */
 
 /* Bytes for outgoing args, lr1, and retaddr.  */
@@ -603,14 +606,14 @@ extern void pop_frame ();
    mtsrim cr, 15
    loadm 0, 0, lr2, msp     ; load first 16 words of arguments into registers
    add msp, msp, 16 * 4     ; point to the remaining arguments
- CONST_INSN:
-   const lr0,inf               ; (replaced by       half of target addr)
-   consth lr0,inf              ; (replaced by other half of target addr)
  CONST_INSN:
+   const lr0,inf                ; (replaced by       half of target addr)
+   consth lr0,inf               ; (replaced by other half of target addr)
    calli lr0, lr0 
    aseq 0x40,gr1,gr1   ; nop
- BREAKPT_INSN:
-   asneq 0x50,gr1,gr1  ; breakpoint    (replaced by local breakpoint insn)
  */
  BREAKPT_INSN:
+   asneq 0x50,gr1,gr1  ; breakpoint     (replaced by local breakpoint insn)
+ */
 
 #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
 #define BS(const)      const
@@ -635,7 +638,7 @@ extern void pop_frame ();
                BS(0x72500101)}
 #define CALL_DUMMY_LENGTH (8 * 4)
 
-#define CALL_DUMMY_START_OFFSET 0  /* Start execution at beginning of dummy */
+#define CALL_DUMMY_START_OFFSET 0      /* Start execution at beginning of dummy */
 
 /* Helper macro for FIX_CALL_DUMMY.  WORDP is a long * which points to a
    word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with
@@ -650,9 +653,9 @@ extern void pop_frame ();
 #else /* Target is little endian.  */
 #define STUFF_I16(WORDP, DATA) \
   {
-    *(char *)(WORDP) = ((DATA) & 0xff);
-    *((char *)(WORDP) + 2) = (((DATA) >> 8) & 0xff);
-  }
+*(char *) (WORDP) = ((DATA) & 0xff);
+*((char *) (WORDP) + 2) = (((DATA) >> 8) & 0xff);
+}
 #endif /* Target is little endian.  */
 
 /* Insert the specified number of args and function address
@@ -696,7 +699,8 @@ extern void pop_frame ();
                 (num), SYMBOL_SOURCE_NAME (sym)), (num)        \
           : (num))
 
-extern enum a29k_processor_types {
+extern enum a29k_processor_types
+{
   a29k_unknown,
 
   /* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000,
@@ -705,7 +709,8 @@ extern enum a29k_processor_types {
 
   /* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050.  */
   a29k_freeze_mode
-} processor_type;
+}
+processor_type;
 
 /* We need three arguments for a general frame specification for the
    "frame" or "info frame" command.  */
index 8b96210e475eae7bcca8d9f9520f4b0be615dee8..d7314bfbe1251d6eabd3ae48080ec7a7ca40e8f9 100644 (file)
@@ -1,22 +1,23 @@
 /* Parameters for NYU Ultracomputer 29000 target, for GDB, the GNU debugger.
    Copyright 1990, 1991 Free Software Foundation, Inc.
    Contributed by David Wood @ New York University (wood@nyu.edu). 
-   
-This file is part of GDB.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This file is part of GDB.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is free software; you can 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.
 
-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 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 includes tm-a29k.h, but predefines REGISTER_NAMES and
    related macros.  The file supports a a29k running our flavor of
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Initializer for an array of names of registers.
    There should be NUM_REGS strings in this initializer.
  */
-#define NUM_REGS   (EXO_REGNUM + 1)    
+#define NUM_REGS   (EXO_REGNUM + 1)
 
 #define REGISTER_NAMES {                                                \
  "gr1",                                                                         \
@@ -62,14 +63,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
 #ifdef KERNEL_DEBUGGING
-# define       PADDR_U_REGNUM  22              /* gr86 */
-# define       RETURN_REGNUM   GR64_REGNUM     
+#define        PADDR_U_REGNUM  22      /* gr86 */
+#define        RETURN_REGNUM   GR64_REGNUM
 #else
-# define       RETURN_REGNUM   GR96_REGNUM     
-#endif /* KERNEL_DEBUGGING */
+#define        RETURN_REGNUM   GR96_REGNUM
+#endif /* KERNEL_DEBUGGING */
 
 
-/* Should rename all GR96_REGNUM to RETURN_REGNUM */ 
+/* Should rename all GR96_REGNUM to RETURN_REGNUM */
 #define GR1_REGNUM     (0)
 #define GR64_REGNUM    1
 #define GR96_REGNUM    (GR64_REGNUM + 32)
@@ -90,41 +91,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define RFB_REGNUM (127 - 96 + RETURN_REGNUM)
 /* Register Stack Pointer.  */
 #define RSP_REGNUM GR1_REGNUM
-#define LR0_REGNUM ( 32 +  GR96_REGNUM) 
+#define LR0_REGNUM ( 32 +  GR96_REGNUM)
 
 /* Protected Special registers */
 #define VAB_REGNUM (LR0_REGNUM +  128)
-#define OPS_REGNUM (VAB_REGNUM + 1)  
-#define CPS_REGNUM (VAB_REGNUM + 2)  
-#define CFG_REGNUM (VAB_REGNUM + 3)  
-#define CHA_REGNUM (VAB_REGNUM + 4)  
-#define CHD_REGNUM (VAB_REGNUM + 5)  
-#define CHC_REGNUM (VAB_REGNUM + 6)  
-#define RBP_REGNUM (VAB_REGNUM + 7)  
-#define TMC_REGNUM (VAB_REGNUM + 8)  
-#define TMR_REGNUM (VAB_REGNUM + 9)  
+#define OPS_REGNUM (VAB_REGNUM + 1)
+#define CPS_REGNUM (VAB_REGNUM + 2)
+#define CFG_REGNUM (VAB_REGNUM + 3)
+#define CHA_REGNUM (VAB_REGNUM + 4)
+#define CHD_REGNUM (VAB_REGNUM + 5)
+#define CHC_REGNUM (VAB_REGNUM + 6)
+#define RBP_REGNUM (VAB_REGNUM + 7)
+#define TMC_REGNUM (VAB_REGNUM + 8)
+#define TMR_REGNUM (VAB_REGNUM + 9)
 #define NPC_REGNUM (VAB_REGNUM + 10)   /* pc0 */
-#define PC_REGNUM  (VAB_REGNUM + 11)   /* pc1 */
-#define PC2_REGNUM (VAB_REGNUM + 12)   /* pc2 */
+#define PC_REGNUM  (VAB_REGNUM + 11)   /* pc1 */
+#define PC2_REGNUM (VAB_REGNUM + 12)   /* pc2 */
 #define MMU_REGNUM (VAB_REGNUM + 13)
 #define LRU_REGNUM (VAB_REGNUM + 14)
        /* Register sequence gap */
 /* Unprotected Special registers */
-#define IPC_REGNUM (LRU_REGNUM + 1) 
-#define IPA_REGNUM (IPC_REGNUM + 1) 
-#define IPB_REGNUM (IPC_REGNUM + 2) 
-#define Q_REGNUM   (IPC_REGNUM + 3) 
-#define ALU_REGNUM (IPC_REGNUM + 4) 
+#define IPC_REGNUM (LRU_REGNUM + 1)
+#define IPA_REGNUM (IPC_REGNUM + 1)
+#define IPB_REGNUM (IPC_REGNUM + 2)
+#define Q_REGNUM   (IPC_REGNUM + 3)
+#define ALU_REGNUM (IPC_REGNUM + 4)
 #define PS_REGNUM  ALU_REGNUM
-#define BP_REGNUM  (IPC_REGNUM + 5) 
-#define FC_REGNUM  (IPC_REGNUM + 6) 
-#define CR_REGNUM  (IPC_REGNUM + 7) 
+#define BP_REGNUM  (IPC_REGNUM + 5)
+#define FC_REGNUM  (IPC_REGNUM + 6)
+#define CR_REGNUM  (IPC_REGNUM + 7)
        /* Register sequence gap */
-#define FPE_REGNUM (CR_REGNUM  + 1) 
-#define INT_REGNUM (FPE_REGNUM + 1) 
-#define FPS_REGNUM (FPE_REGNUM + 2) 
+#define FPE_REGNUM (CR_REGNUM  + 1)
+#define INT_REGNUM (FPE_REGNUM + 1)
+#define FPS_REGNUM (FPE_REGNUM + 2)
        /* Register sequence gap */
-#define EXO_REGNUM (FPS_REGNUM + 1) 
+#define EXO_REGNUM (FPS_REGNUM + 1)
 
 /* Special register #x.  */
 #define SR_REGNUM(x) \
@@ -160,7 +161,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /*
  * Converts an sdb register number to an internal gdb register number.
  * Currently under gcc, gr96->0...gr128->31...lr0->32...lr127->159, or...
- *                     gr64->0...gr95->31, lr0->32...lr127->159.
+ *                      gr64->0...gr95->31, lr0->32...lr127->159.
  */
 #define SDB_REG_TO_REGNUM(value) (((value)<32) ? ((value)+RETURN_REGNUM) : \
                                                 ((value)-32+LR0_REGNUM))
@@ -168,7 +169,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifdef KERNEL_DEBUGGING
   /* ublock virtual address as defined in our sys/param.h */
   /* FIXME: Should get this from sys/param.h */
-# define UVADDR        ((32*0x100000)-8192)    
+#define UVADDR ((32*0x100000)-8192)
 #endif
 
 /*
@@ -177,11 +178,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  */
 #if !defined(KERNEL_DEBUGGING)
 #ifdef SYM1
-# define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name))
+#define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name))
 #else
-        Need to define IN_SIGTRAMP() for sym2.
+Need to define
+IN_SIGTRAMP () for sym2.
 #endif
-#endif /* !KERNEL_DEBUGGING */
+#endif                         /* !KERNEL_DEBUGGING */
 
 #include "a29k/tm-a29k.h"
 
@@ -191,36 +193,35 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    mtsrim cr, 15
    loadm 0, 0, lr2, msp     ; load first 16 words of arguments into registers
    add msp, msp, 16 * 4     ; point to the remaining arguments
-  CONST_INSN:
+   CONST_INSN:
    const gr96,inf
    consth gr96,inf
    calli lr0, gr96
    aseq 0x40,gr1,gr1   ; nop
    asneq 0x50,gr1,gr1  ; breakpoint
    When KERNEL_DEBUGGIN is defined, msp -> gr93, gr96 -> gr64,
-                                    7d  -> 5d,    60  -> 40
  */
+   7d  -> 5d,    60  -> 40
+ */
 
 /* Position of the "const" instruction within CALL_DUMMY in bytes.  */
 #undef CALL_DUMMY
 #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
-#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */
-#  define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff,    \
+#ifdef KERNEL_DEBUGGING                /* gr96 -> gr64 */
+#define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff,    \
                     0x02ff40ff, 0xc8008040, 0x70400101, 0x72500101}
 #else
-#  define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff,    \
+#define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff,    \
                     0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101}
-#endif /* KERNEL_DEBUGGING */
-#else /* Byte order differs.  */
-  you lose
-#endif /* Byte order differs.  */
+#endif                         /* KERNEL_DEBUGGING */
+#else                          /* Byte order differs.  */
+you lose
+#endif                         /* Byte order differs.  */
 
 #if !defined(KERNEL_DEBUGGING)
-# ifdef SYM1
-#  undef  DECR_PC_AFTER_BREAK
-#  define DECR_PC_AFTER_BREAK 0        /* Sym1 kernel does the decrement */
-# else
-    ->"ULTRA3 running other than sym1 OS"!;
-# endif
+#ifdef SYM1
+#undef  DECR_PC_AFTER_BREAK
+#define DECR_PC_AFTER_BREAK 0  /* Sym1 kernel does the decrement */
+#else
+->"ULTRA3 running other than sym1 OS" !;
+#endif
 #endif /* !KERNEL_DEBUGGING */
-
index 140df051682525d0356f2f56684fbafe1939962e..5d9866f349ecb55555ca4b4eceeef28be4c3620f 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1994, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "a29k/tm-a29k.h"
 #include "tm-vxworks.h"
@@ -68,9 +69,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    want the inferior to stop after the function call has completed.
    call_function_by_hand () sets a breakpoint here (via CALL_DUMMY_BREAK_SET),
    which POP_FRAME later deletes (via CALL_DUMMY_BREAK_DELETE).  */
+
 #define CALL_DUMMY_STOP_OFFSET (7 * 4)
+
 /* The offset of the first instruction of the CALL_DUMMY code fragment
    relative to the frame pointer for a dummy frame.  This is equal to
    the size of the CALL_DUMMY plus the arg_slop area size (see the diagram
@@ -118,12 +119,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    frame pointer in the dummy frame.
 
    NOTE: in the both of the following definitions, we take advantage of
-        knowledge of the implementation of the target breakpoint operation,
-        in that we pass a null pointer as the second argument.  It seems
-        reasonable to assume that any target requiring the use of 
-        CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint
-        shadow contents in GDB; in any case, this assumption is vaild
-        for all VxWorks-related targets.  */
+   knowledge of the implementation of the target breakpoint operation,
+   in that we pass a null pointer as the second argument.  It seems
+   reasonable to assume that any target requiring the use of 
+   CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint
+   shadow contents in GDB; in any case, this assumption is vaild
+   for all VxWorks-related targets.  */
 
 #define CALL_DUMMY_BREAK_SET(call_dummy_addr) \
   target_insert_breakpoint ((call_dummy_addr) + CALL_DUMMY_STOP_OFFSET, \
@@ -146,7 +147,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    the CALL_DUMMY handling for all targets (at least, a clean solution
    would probably require this).  Arguably, this should go in "tm-29k.h"
    rather than here.  */
-   
+
 #define STRUCT_VAL_ARGS_UNSUPPORTED
 
 #define BKPT_OFFSET    (7 * 4)
@@ -159,16 +160,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\
     *(int *)((char *)dummyname + BKPT_OFFSET) = BKPT_INSTR;\
   }
-
 \f
+
 /* Offsets into jmp_buf.  They are derived from VxWorks' REG_SET struct
    (see VxWorks' setjmp.h). Note that Sun2, Sun3 and SunOS4 and VxWorks have
    different REG_SET structs, hence different layouts for the jmp_buf struct.
    Only JB_PC is needed for getting the saved PC value.  */
 
-#define JB_ELEMENT_SIZE 4       /* size of each element in jmp_buf */
+#define JB_ELEMENT_SIZE 4      /* size of each element in jmp_buf */
 #define JB_PC          3       /* offset of pc (pc1) in jmp_buf */
+
 /* Figure out where the longjmp will land.  We expect that we have just entered
    longjmp and haven't yet setup the stack frame, so the args are still in the
    output regs.  lr2 (LR2_REGNUM) points at the jmp_buf structure from which we
@@ -179,14 +180,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern int get_longjmp_target PARAMS ((CORE_ADDR *));
 
 /* VxWorks adjusts the PC after a breakpoint has been hit.  */
+
 #undef DECR_PC_AFTER_BREAK
 #define DECR_PC_AFTER_BREAK 0
 
 /* Do whatever promotions are appropriate on a value being returned
    from a function.  VAL is the user-supplied value, and FUNC_TYPE
    is the return type of the function if known, else 0.
+
    For the Am29k, as far as I understand, if the function return type is known,
    cast the value to that type; otherwise, ensure that integer return values
    fill all of gr96.
@@ -195,7 +196,7 @@ extern int get_longjmp_target PARAMS ((CORE_ADDR *));
    to most Am29K-based systems; but once moved into that file, it might
    need to be redefined for all Am29K-based targets that also redefine
    STORE_RETURN_VALUE.  For now, to be safe, we define it here.  */
+
 #define PROMOTE_RETURN_VALUE(val, func_type) \
   do {                                                                  \
       if (func_type)                                                    \
index ec0b1081cf2d33c0dbb5c92aaf0ac5a0be66394a..b2773e31e5360384004cbff7c2a0e2d5918bffae 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
    Contributed by David Wood (wood@lab.ultra.nyu.edu).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Here at NYU we have what we call an ULTRA3 PE board.  So
    ifdefs for ULTRA3 are my doing.  At this point in time,
@@ -27,22 +28,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define HAVE_WAIT_STRUCT
 
 #ifndef L_SET
-# define L_SET   0 /* set the seek pointer */
-# define L_INCR  1 /* increment the seek pointer */
-# define L_XTND  2 /* extend the file size */
+#define L_SET   0              /* set the seek pointer */
+#define L_INCR  1              /* increment the seek pointer */
+#define L_XTND  2              /* extend the file size */
 #endif
 
 #ifndef O_RDONLY
-# define O_RDONLY 0
-# define O_WRONLY 1
-# define O_RDWR          2
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR   2
 #endif
 
 #ifndef F_OK
-# define R_OK 4
-# define W_OK 2
-# define X_OK 1
-# define F_OK 0
+#define R_OK 4
+#define W_OK 2
+#define X_OK 1
+#define F_OK 0
 #endif
 
 /* System doesn't provide siginterrupt().  */
index 1c167306422460d6d1034de4e27920263f9ec5a7..99df5c681e0c5749dc649b37354bccb9e9c09d70 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for alpha running Linux.
    Copyright (C) 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.  */
+   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.  */
 
 /* Figure out where the longjmp will land.  We expect that we have just entered
    longjmp and haven't yet setup the stack frame, so the args are still in the
index e06140d95a4717f465080d7c99a89db07329f263..df0030a27613fa7604866e650e76ae55788a0e0f 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for alpha running OSF/1.
    Copyright (C) 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.  */
+   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.  */
 
 /* Figure out where the longjmp will land.  We expect that we have just entered
    longjmp and haven't yet setup the stack frame, so the args are still in the
index 01725efd5ce9cc873f77b262957e1c42d8caf091..dfbff819681bab92ab940da5ede8f3ca04589ddb 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for alpha running OSF/1-2.x, using procfs.
    Copyright (C) 1995 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 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 OSF/1 definitions.  */
 #include "alpha/nm-osf.h"
index a1871a6813650b1a3e9991cee467c054004dec7c..4a6118a478cad4081e15fa5d1cb0ef2f728b8c50 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for alpha running OSF/1-3.x and higher, using procfs.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* OSF/1-3.x fixes some OSF/1-2.x procfs peculiarities and adds
    a new one.  */
index bbfd2d846e07868fa9bf1174c22d89cbc7359966..aaa2a825725f0bb88e0a8299342cd1bcb18bf383 100644 (file)
@@ -2,21 +2,22 @@
    also used by the Alpha/Netware and Alpha/Linux targets.
    Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_ALPHA_H
 #define TM_ALPHA_H
@@ -69,7 +70,7 @@ extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));
 
 #define SAVED_PC_AFTER_CALL(frame)     alpha_saved_pc_after_call(frame)
 extern CORE_ADDR
-alpha_saved_pc_after_call PARAMS ((struct frame_info *));
+  alpha_saved_pc_after_call PARAMS ((struct frame_info *));
 
 /* Are we currently handling a signal ?  */
 
@@ -79,7 +80,7 @@ alpha_saved_pc_after_call PARAMS ((struct frame_info *));
 
 #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
 
-#define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt */
+#define BREAKPOINT {0x80, 0, 0, 0}     /* call_pal bpt */
 
 /* Amount PC must be decremented by after a breakpoint.
    This is often the number of bytes in BREAKPOINT
@@ -130,8 +131,8 @@ alpha_saved_pc_after_call PARAMS ((struct frame_info *));
 #define SP_REGNUM 30           /* Contains address of top of stack */
 #define RA_REGNUM 26           /* Contains return address value */
 #define ZERO_REGNUM 31         /* Read-only register, always 0 */
-#define FP0_REGNUM 32           /* Floating point register 0 */
-#define FPA0_REGNUM 48          /* First float arg during a subr call */
+#define FP0_REGNUM 32          /* Floating point register 0 */
+#define FPA0_REGNUM 48         /* First float arg during a subr call */
 #define FPCR_REGNUM 63         /* Floating point control register */
 #define PC_REGNUM 64           /* Contains program counter */
 #define FP_REGNUM 65           /* Virtual frame pointer */
@@ -172,10 +173,10 @@ alpha_saved_pc_after_call PARAMS ((struct frame_info *));
    from raw format to virtual format.
    The alpha needs a conversion between register and memory format if
    the register is a floating point register and
-      memory format is float, as the register format must be double
+   memory format is float, as the register format must be double
    or
-      memory format is an integer with 4 bytes or less, as the representation
-      of integers in floating point registers is different. */
+   memory format is an integer with 4 bytes or less, as the representation
+   of integers in floating point registers is different. */
 
 #define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) < FP0_REGNUM + 31)
 
@@ -205,7 +206,8 @@ alpha_register_convert_to_raw PARAMS ((struct type *, int, char *, char *));
 /* Store the address of the place in which to copy the structure the
    subroutine will return.  Handled by alpha_push_arguments.  */
 
-#define STORE_STRUCT_RETURN(addr, sp)  /**/
+#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,
@@ -238,8 +240,8 @@ alpha_store_return_value PARAMS ((struct type *, char *));
 
 /* Structures are returned by ref in extra arg0 */
 #define USE_STRUCT_CONVENTION(gcc_p, type)     1
-
 \f
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -262,7 +264,7 @@ extern CORE_ADDR alpha_frame_chain PARAMS ((struct frame_info *));
 
 #define FRAME_SAVED_PC(FRAME)  (alpha_frame_saved_pc(FRAME))
 extern CORE_ADDR
-alpha_frame_saved_pc PARAMS ((struct frame_info *));
+  alpha_frame_saved_pc PARAMS ((struct frame_info *));
 
 /* The alpha has two different virtual pointers for arguments and locals.
 
@@ -306,14 +308,14 @@ extern void alpha_find_saved_regs PARAMS ((struct frame_info *));
       alpha_find_saved_regs (frame_info); \
     (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
   } while (0)
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
   (alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
 extern CORE_ADDR
-alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
+  alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
 
 /* Push an empty stack frame, to record the current PC, etc.  */
 
@@ -366,7 +368,7 @@ extern CORE_ADDR alpha_call_dummy_address PARAMS ((void));
 /* There's a mess in stack frame creation.  See comments in blockframe.c
    near reference to INIT_FRAME_PC_FIRST.  */
 
-#define        INIT_FRAME_PC(fromleaf, prev) /* nada */
+#define        INIT_FRAME_PC(fromleaf, prev)   /* nada */
 
 #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
   (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
@@ -382,10 +384,12 @@ extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
    This overlays the ALPHA's PDR records, 
    alpharead.c (ab)uses this to save memory */
 
-typedef struct alpha_extra_func_info {
-       long    numargs;        /* number of args to procedure (was iopt) */
-       PDR     pdr;            /* Procedure descriptor record */
-} *alpha_extra_func_info_t;
+typedef struct alpha_extra_func_info
+  {
+    long numargs;              /* number of args to procedure (was iopt) */
+    PDR pdr;                   /* Procedure descriptor record */
+  }
+ *alpha_extra_func_info_t;
 
 /* Define the extra_func_info that mipsread.c needs.
    FIXME: We should define our own PDR interface, perhaps in a separate
index d836a7054c8f19a128ee0d0806a585c6dd240189..313667e7828551b3c7efae9c32ac9c00bbdfff96 100644 (file)
@@ -2,21 +2,22 @@
    definitions here are used when the _target_ system is running Linux.
    Copyright 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.  */
+   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_LINUXALPHA_H
 #define TM_LINUXALPHA_H
index fb4316b44f5c37d028183e390aa0649dabf59477..d72378b15f851645173c6e623ad8c67711ad5a94 100644 (file)
@@ -1,21 +1,22 @@
 /* Host definitions for GDB running on an Alpha under Linux
    Copyright (C) 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (HOST_BYTE_ORDER)
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
index e143538a23d84dd338282926c2498b73e4575e3b..2b8f4894266d20f2d7b45d0a57a915a28061881d 100644 (file)
@@ -1,21 +1,22 @@
 /* Host definitions for GDB running on an alpha under OSF/1
    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (HOST_BYTE_ORDER)
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
index 6eb5d81139e6951002769a5c479fb764f11283ca..90949e369218cac1495bdb9305e9995206d5ef8d 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1995 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Used by arc-tdep.c to set the default cpu type.  */
 #define DEFAULT_ARC_CPU_TYPE "base"
@@ -116,15 +117,15 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
 /* 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 */
+#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
@@ -158,8 +159,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
       0 \
     } \
 }
-   
-#define PFP_REGNUM R0_REGNUM   /* Previous frame pointer       */
+
+#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'.  */
@@ -184,8 +185,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
-
 \f
+
 /* Macros for understanding function return values... */
 
 /* Does the specified function use the "struct returning" convention
@@ -207,7 +208,7 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
    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))
 
@@ -228,8 +229,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
    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")
-
 \f
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -275,7 +276,7 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
    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 */
+struct frame_info;             /* in case frame.h not included yet */
 CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
 
 /* If the argument is on the stack, it will be here.
@@ -304,9 +305,9 @@ CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
 
 #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 */
-
+extern void frame_find_saved_regs ();  /* See arc-tdep.c */
 \f
+
 /* Things needed for making calls to functions in the inferior process */
 #define PUSH_DUMMY_FRAME \
        push_dummy_frame ()
@@ -316,14 +317,14 @@ extern void frame_find_saved_regs();              /* See arc-tdep.c */
        pop_frame ()
 
 /* This sequence of words is the instructions  bl xxxx, flag 1 */
-#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }   
+#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }
 #define CALL_DUMMY_LENGTH 8
 
 /* Start execution at beginning of dummy */
-#define CALL_DUMMY_START_OFFSET 0 
+#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'.*/  
+   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; \
@@ -336,4 +337,3 @@ extern void frame_find_saved_regs();                /* See arc-tdep.c */
         *((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \
         *((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \
 }
-
index 970a885363fdabbf8045f7a2385a8fa3ad4c3d6b..45ef76c32886d702268c14129a16de7fc2c14cc0 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is the amount to subtract from u.u_ar0
    to get the offset in the core file of the register values.  */
index cc3a27f66c4a2722a668fd837bbe53f6c3ef0a95..8a3553ff622b659d5446dd63e3e6bb734fefca53 100644 (file)
@@ -1,23 +1,24 @@
 /* Definitions to make GDB target for an ARM
    Copyright 1986-1989, 1991, 1993-1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct type;
 struct value;
 #endif
@@ -199,7 +200,7 @@ extern char **arm_register_names;
 
 /* Largest value REGISTER_RAW_SIZE can have.  */
 
-#define MAX_REGISTER_RAW_SIZE 12 
+#define MAX_REGISTER_RAW_SIZE 12
 
 /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
 
@@ -275,8 +276,8 @@ extern use_struct_convention_fn arm_use_struct_convention;
    lexical context are listed after the beginning LBRAC instead of
    before in the executables list of symbols.  */
 #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
-
 \f
+
 /* Define other aspects of the stack frame. 
    We keep the offsets of all saved registers, 'cause we need 'em a lot!
    We also keep the current size of the stack frame, and the offset of
@@ -289,7 +290,7 @@ extern use_struct_convention_fn arm_use_struct_convention;
   int frameoffset;             \
   int framereg;
 
-extern void arm_init_extra_frame_info PARAMS ((struct frame_info *fi));
+extern void arm_init_extra_frame_info PARAMS ((struct frame_info * fi));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) arm_init_extra_frame_info (fi)
 
 /* Return the frame address.  On ARM, it is R11; on Thumb it is R7.  */
@@ -315,7 +316,7 @@ extern int arm_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
 
 /* 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 arm_frameless_function_invocation PARAMS ((struct frame_info *frame));
+extern int arm_frameless_function_invocation PARAMS ((struct frame_info * frame));
 #define FRAMELESS_FUNCTION_INVOCATION(FI) (arm_frameless_function_invocation (FI))
 
 /* Saved Pc.  */
@@ -344,13 +345,13 @@ extern CORE_ADDR arm_frame_saved_pc PARAMS ((struct frame_info *));
 
 struct frame_saved_regs;
 struct frame_info;
-void frame_find_saved_regs PARAMS((struct frame_info *fi,
-                                  struct frame_saved_regs *fsr));
+void frame_find_saved_regs PARAMS ((struct frame_info * fi,
+                                   struct frame_saved_regs * fsr));
 
 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
  arm_frame_find_saved_regs (frame_info, &(frame_saved_regs));
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
@@ -371,15 +372,15 @@ void arm_pop_frame PARAMS ((void));
 
 /* This sequence of words is the instructions
 
-     mov       lr,pc
-     mov       pc,r4
-     illegal
+   mov  lr,pc
+   mov  pc,r4
+   illegal
 
    Note this is 12 bytes.  */
 
 #define CALL_DUMMY {0xe1a0e00f, 0xe1a0f004, 0xE7FFDEFE}
 
-#define CALL_DUMMY_START_OFFSET 0  /* Start execution at beginning of dummy */
+#define CALL_DUMMY_START_OFFSET 0      /* Start execution at beginning of dummy */
 
 #define CALL_DUMMY_BREAKPOINT_OFFSET arm_call_dummy_breakpoint_offset()
 extern int arm_call_dummy_breakpoint_offset PARAMS ((void));
@@ -391,15 +392,15 @@ extern int arm_call_dummy_breakpoint_offset PARAMS ((void));
    arm_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
 
 void arm_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun,
-                                int nargs, struct value **args,
-                                struct type *type, int gcc_p));
+                                int nargs, struct value ** args,
+                                struct type * type, int gcc_p));
 
 CORE_ADDR arm_get_next_pc PARAMS ((CORE_ADDR));
 
 /* Functions for dealing with Thumb call thunks.  */
 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name)     arm_in_call_stub (pc, name)
 #define SKIP_TRAMPOLINE_CODE(pc)               arm_skip_stub (pc)
-extern int arm_in_call_stub PARAMS ((CORE_ADDR pc,  char *name));
+extern int arm_in_call_stub PARAMS ((CORE_ADDR pc, char *name));
 extern CORE_ADDR arm_skip_stub PARAMS ((CORE_ADDR pc));
 
 /* Function to determine whether MEMADDR is in a Thumb function.  */
@@ -414,18 +415,18 @@ extern int arm_pc_is_thumb_dummy PARAMS ((bfd_vma memaddr));
    "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.
+
    COFF_MAKE_MSYMBOL_SPECIAL
-   ELF_MAKE_MSYMBOL_SPECIAL    tests whether the COFF or ELF symbol corresponds 
-                        to a thumb function, and sets a "special" bit in a
-                        minimal symbol to indicate that it does
-   MSYMBOL_SET_SPECIAL actually sets the "special" bit
+   ELF_MAKE_MSYMBOL_SPECIAL     tests whether the COFF or ELF symbol corresponds 
+   to a thumb function, and sets a "special" bit in a
+   minimal symbol to indicate that it does
+   MSYMBOL_SET_SPECIAL  actually sets the "special" bit
    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
-*/
-extern int coff_sym_is_thumb(int val);
+   the "info" field with the "special" bit masked out
+ */
+
+extern int coff_sym_is_thumb (int val);
 #define MSYMBOL_SET_SPECIAL(msym) \
     MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000)
 #define MSYMBOL_IS_SPECIAL(msym) \
@@ -437,7 +438,7 @@ extern int coff_sym_is_thumb(int val);
 #define ELF_MAKE_MSYMBOL_SPECIAL(sym,msym) \
  { if(ELF_ST_TYPE(((elf_symbol_type *)(sym))->internal_elf_sym.st_info) == STT_LOPROC) \
        MSYMBOL_SET_SPECIAL(msym); }
-  
+
 #define COFF_MAKE_MSYMBOL_SPECIAL(val,msym) \
  { if(coff_sym_is_thumb(val)) MSYMBOL_SET_SPECIAL(msym); }
 
index 34c0bd376b5999b484f3d63cfc1a0e80f56cb0a3..d73095a3eee9548bca7f02dc41c40a2d9d39ff3e 100644 (file)
@@ -1,25 +1,26 @@
 /* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
-
 \f
+
 #if 0
 /* Interface definitions for kernel debugger KDB.  */
 
index 953f767c04497ca6df1d23f6535ee73a1d57b64d..f41b72695b23a17895c7421c9425b80e8052af54 100644 (file)
 /* OBSOLETE /* Advance PC across any function entry prologue instructions */
 /* OBSOLETE    to reach some "real" code. */
 /* OBSOLETE    Convex prolog is: */
-/* OBSOLETE        [sub.w #-,sp]               in one of 3 possible sizes */
-/* OBSOLETE        [mov psw,-          fc/vc main program prolog */
-/* OBSOLETE         and #-,-             (skip it because the "mov psw" saves the */
-/* OBSOLETE    mov -,psw]                 T bit, so continue gets a surprise trap) */
-/* OBSOLETE        [and #-,sp]         fc/vc O2 main program prolog */
-/* OBSOLETE        [ld.- -(ap),-]              pcc/gcc register arg loads */
+/* OBSOLETE        [sub.w #-,sp]                in one of 3 possible sizes */
+/* OBSOLETE        [mov psw,-           fc/vc main program prolog */
+/* OBSOLETE         and #-,-              (skip it because the "mov psw" saves the */
+/* OBSOLETE     mov -,psw]                 T bit, so continue gets a surprise trap) */
+/* OBSOLETE        [and #-,sp]          fc/vc O2 main program prolog */
+/* OBSOLETE        [ld.- -(ap),-]               pcc/gcc register arg loads */
 /* OBSOLETE *x/ */
 /* OBSOLETE  */
 /* OBSOLETE extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc)); */
@@ -78,9 +78,9 @@
 /* OBSOLETE  */
 /* OBSOLETE /* We need to manipulate trap bits in the psw *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define PSW_TRAP_FLAGS     0x69670000 */
-/* OBSOLETE #define PSW_T_BIT  0x08000000 */
-/* OBSOLETE #define PSW_S_BIT  0x01000000 */
+/* OBSOLETE #define PSW_TRAP_FLAGS      0x69670000 */
+/* OBSOLETE #define PSW_T_BIT   0x08000000 */
+/* OBSOLETE #define PSW_S_BIT   0x01000000 */
 /* OBSOLETE  */
 /* OBSOLETE /* Stack grows downward.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE    There should be NUM_REGS strings in this initializer.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\ */
-/* OBSOLETE                    "s7","s6","s5","s4","s3","s2","s1","s0",\ */
-/* OBSOLETE                    "S7","S6","S5","S4","S3","S2","S1","S0"} */
+/* OBSOLETE                     "s7","s6","s5","s4","s3","s2","s1","s0",\ */
+/* OBSOLETE                     "S7","S6","S5","S4","S3","S2","S1","S0"} */
 /* OBSOLETE  */
 /* OBSOLETE /* Register numbers of various important registers. */
 /* OBSOLETE    Note that some of these values are "real" register numbers, */
 /* 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.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define S0_REGNUM 25               /* the real S regs *x/ */
+/* OBSOLETE #define S0_REGNUM 25                /* the real S regs *x/ */
 /* OBSOLETE #define S7_REGNUM 18 */
-/* OBSOLETE #define s0_REGNUM 17               /* low-order halves of S regs *x/ */
+/* OBSOLETE #define s0_REGNUM 17                /* low-order halves of S regs *x/ */
 /* OBSOLETE #define s7_REGNUM 10 */
-/* OBSOLETE #define SP_REGNUM 9                /* A regs *x/ */
+/* OBSOLETE #define SP_REGNUM 9                 /* A regs *x/ */
 /* OBSOLETE #define A1_REGNUM 8 */
 /* OBSOLETE #define A5_REGNUM 4 */
 /* OBSOLETE #define AP_REGNUM 3 */
-/* OBSOLETE #define FP_REGNUM 2                /* Contains address of executing stack frame *x/ */
-/* OBSOLETE #define PS_REGNUM 1                /* Contains processor status *x/ */
-/* OBSOLETE #define PC_REGNUM 0                /* Contains program counter *x/ */
+/* OBSOLETE #define FP_REGNUM 2         /* Contains address of executing stack frame *x/ */
+/* OBSOLETE #define PS_REGNUM 1         /* Contains processor status *x/ */
+/* OBSOLETE #define PC_REGNUM 0         /* Contains program counter *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* convert dbx stab register number (from `r' declaration) to a gdb REGNUM *x/ */
 /* OBSOLETE  */
 /* OBSOLETE    NB: must match structure of struct syscall_context for correct operation *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \ */
-/* OBSOLETE                      (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \ */
-/* OBSOLETE                                        40 + 8 * ((N)-S7_REGNUM)) */
+/* OBSOLETE                       (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \ */
+/* OBSOLETE                                         40 + 8 * ((N)-S7_REGNUM)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of bytes of storage in the actual machine representation */
 /* OBSOLETE    for register N. *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
 /* OBSOLETE   memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \ */
-/* OBSOLETE                         8 - TYPE_LENGTH (TYPE)],\ */
-/* OBSOLETE     TYPE_LENGTH (TYPE)) */
+/* OBSOLETE                          8 - TYPE_LENGTH (TYPE)],\ */
+/* OBSOLETE      TYPE_LENGTH (TYPE)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Write into appropriate registers a function return value */
 /* OBSOLETE    of type TYPE, given in virtual format.  *x/ */
 /* OBSOLETE /* We need the boundaries of the text in the exec file, as a kludge, */
 /* OBSOLETE    for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define    NEED_TEXT_START_END 1 */
+/* OBSOLETE #define     NEED_TEXT_START_END 1 */
 /* 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    random load as a saved register; this is harmless.  vc does not */
 /* OBSOLETE    declare its register allocation actions in the stabs.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)                \ */
-/* OBSOLETE { register int regnum;                                                     \ */
-/* OBSOLETE   register int frame_length =      /* 3 short, 2 long, 1 extended, 0 context *x/\ */
-/* OBSOLETE       (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3;        \ */
-/* OBSOLETE   register CORE_ADDR frame_fp =                                            \ */
-/* OBSOLETE       read_memory_integer ((frame_info)->frame + 8, 4);                    \ */
-/* OBSOLETE   register CORE_ADDR next_addr;                                            \ */
-/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                       \ */
-/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0;            \ */
-/* OBSOLETE   (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4;            \ */
-/* OBSOLETE   (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8;            \ */
-/* OBSOLETE   (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12;                      \ */
-/* OBSOLETE   next_addr = (frame_info)->frame + 12;                                    \ */
-/* OBSOLETE   if (frame_length < 3)                                                    \ */
-/* OBSOLETE     for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum)         \ */
-/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 4);          \ */
-/* OBSOLETE   if (frame_length < 2)                                                    \ */
-/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4);         \ */
-/* OBSOLETE   next_addr -= 4;                                                  \ */
-/* OBSOLETE   if (frame_length < 3)                                                    \ */
-/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum)         \ */
-/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 8);          \ */
-/* OBSOLETE   if (frame_length < 2)                                                    \ */
-/* OBSOLETE     (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8);         \ */
-/* OBSOLETE   else                                                                     \ */
-/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8;                    \ */
-/* OBSOLETE   if (frame_length == 3) {                                         \ */
-/* OBSOLETE     CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4);   \ */
-/* OBSOLETE     int op, ix, disp;                                                      \ */
-/* OBSOLETE     op = read_memory_integer (pc, 2);                                      \ */
-/* OBSOLETE     if ((op & 0xffc7) == 0x1480) pc += 4;  /* add.w #-,sp *x/      \ */
-/* OBSOLETE     else if ((op & 0xffc7) == 0x58c0) pc += 2;     /* add.w #-,sp *x/      \ */
-/* OBSOLETE     op = read_memory_integer (pc, 2);                                      \ */
-/* OBSOLETE     if ((op & 0xffc7) == 0x2a06) pc += 4;  /* ld.w -,ap *x/                \ */
-/* OBSOLETE     for (;;) {                                                             \ */
-/* OBSOLETE       op = read_memory_integer (pc, 2);                                    \ */
-/* OBSOLETE       ix = (op >> 3) & 7;                                          \ */
-/* OBSOLETE       if ((op & 0xfcc0) == 0x2800) {               /* ld.- -,ak *x/                \ */
-/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                     \ */
-/* OBSOLETE    disp = read_memory_integer (pc + 2, 2);                         \ */
-/* OBSOLETE    pc += 4;}                                                       \ */
-/* OBSOLETE       else if ((op & 0xfcc0) == 0x2840) {  /* ld.- -,ak *x/                \ */
-/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                     \ */
-/* OBSOLETE    disp = read_memory_integer (pc + 2, 4);                         \ */
-/* OBSOLETE    pc += 6;}                                                       \ */
-/* OBSOLETE       if ((op & 0xfcc0) == 0x3000) {               /* ld.- -,sk *x/                \ */
-/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                     \ */
-/* OBSOLETE    disp = read_memory_integer (pc + 2, 2);                         \ */
-/* OBSOLETE    pc += 4;}                                                       \ */
-/* OBSOLETE       else if ((op & 0xfcc0) == 0x3040) {  /* ld.- -,sk *x/                \ */
-/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                     \ */
-/* OBSOLETE    disp = read_memory_integer (pc + 2, 4);                         \ */
-/* OBSOLETE    pc += 6;}                                                       \ */
-/* OBSOLETE       else if ((op & 0xff00) == 0x7100) {  /* br crossjump *x/     \ */
-/* OBSOLETE         pc += 2 * (char) op;                                               \ */
-/* OBSOLETE         continue;}                                                 \ */
-/* OBSOLETE       else if (op == 0x0140) {                     /* jmp crossjump *x/    \ */
-/* OBSOLETE         pc = read_memory_integer (pc + 2, 4);                              \ */
-/* OBSOLETE         continue;}                                                 \ */
-/* OBSOLETE       else break;                                                  \ */
-/* OBSOLETE       if ((frame_saved_regs).regs[regnum])                         \ */
-/* OBSOLETE    break;                                                          \ */
-/* OBSOLETE       if (ix == 7) disp += frame_fp;                                       \ */
-/* OBSOLETE       else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4);    \ */
-/* OBSOLETE       else if (ix != 0) break;                                             \ */
-/* OBSOLETE       (frame_saved_regs).regs[regnum] =                                    \ */
-/* OBSOLETE    disp - 8 + (1 << ((op >> 8) & 3));                              \ */
-/* OBSOLETE       if (regnum >= S7_REGNUM)                                             \ */
-/* OBSOLETE         (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] =  \ */
-/* OBSOLETE      disp - 4 + (1 << ((op >> 8) & 3));                            \ */
-/* OBSOLETE     }                                                                      \ */
-/* OBSOLETE   }                                                                        \ */
+/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)         \ */
+/* OBSOLETE { register int regnum;                                                      \ */
+/* OBSOLETE   register int frame_length =       /* 3 short, 2 long, 1 extended, 0 context *x/\ */
+/* OBSOLETE       (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \ */
+/* OBSOLETE   register CORE_ADDR frame_fp =                                             \ */
+/* OBSOLETE       read_memory_integer ((frame_info)->frame + 8, 4);                     \ */
+/* OBSOLETE   register CORE_ADDR next_addr;                                             \ */
+/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                        \ */
+/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0;             \ */
+/* OBSOLETE   (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4;             \ */
+/* OBSOLETE   (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8;             \ */
+/* OBSOLETE   (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12;                       \ */
+/* OBSOLETE   next_addr = (frame_info)->frame + 12;                                     \ */
+/* OBSOLETE   if (frame_length < 3)                                                     \ */
+/* OBSOLETE     for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum)          \ */
+/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 4);           \ */
+/* OBSOLETE   if (frame_length < 2)                                                     \ */
+/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4);          \ */
+/* OBSOLETE   next_addr -= 4;                                                   \ */
+/* OBSOLETE   if (frame_length < 3)                                                     \ */
+/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum)          \ */
+/* OBSOLETE       (frame_saved_regs).regs[regnum] = (next_addr += 8);           \ */
+/* OBSOLETE   if (frame_length < 2)                                                     \ */
+/* OBSOLETE     (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8);          \ */
+/* OBSOLETE   else                                                                      \ */
+/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8;                     \ */
+/* OBSOLETE   if (frame_length == 3) {                                          \ */
+/* OBSOLETE     CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4);    \ */
+/* OBSOLETE     int op, ix, disp;                                                       \ */
+/* OBSOLETE     op = read_memory_integer (pc, 2);                                       \ */
+/* OBSOLETE     if ((op & 0xffc7) == 0x1480) pc += 4;   /* add.w #-,sp *x/      \ */
+/* OBSOLETE     else if ((op & 0xffc7) == 0x58c0) pc += 2;      /* add.w #-,sp *x/      \ */
+/* OBSOLETE     op = read_memory_integer (pc, 2);                                       \ */
+/* OBSOLETE     if ((op & 0xffc7) == 0x2a06) pc += 4;   /* ld.w -,ap *x/                \ */
+/* OBSOLETE     for (;;) {                                                              \ */
+/* OBSOLETE       op = read_memory_integer (pc, 2);                                     \ */
+/* OBSOLETE       ix = (op >> 3) & 7;                                           \ */
+/* OBSOLETE       if ((op & 0xfcc0) == 0x2800) {                /* ld.- -,ak *x/                \ */
+/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                      \ */
+/* OBSOLETE     disp = read_memory_integer (pc + 2, 2);                         \ */
+/* OBSOLETE     pc += 4;}                                                       \ */
+/* OBSOLETE       else if ((op & 0xfcc0) == 0x2840) {   /* ld.- -,ak *x/                \ */
+/* OBSOLETE         regnum = SP_REGNUM - (op & 7);                                      \ */
+/* OBSOLETE     disp = read_memory_integer (pc + 2, 4);                         \ */
+/* OBSOLETE     pc += 6;}                                                       \ */
+/* OBSOLETE       if ((op & 0xfcc0) == 0x3000) {                /* ld.- -,sk *x/                \ */
+/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                      \ */
+/* OBSOLETE     disp = read_memory_integer (pc + 2, 2);                         \ */
+/* OBSOLETE     pc += 4;}                                                       \ */
+/* OBSOLETE       else if ((op & 0xfcc0) == 0x3040) {   /* ld.- -,sk *x/                \ */
+/* OBSOLETE         regnum = S0_REGNUM - (op & 7);                                      \ */
+/* OBSOLETE     disp = read_memory_integer (pc + 2, 4);                         \ */
+/* OBSOLETE     pc += 6;}                                                       \ */
+/* OBSOLETE       else if ((op & 0xff00) == 0x7100) {   /* br crossjump *x/     \ */
+/* OBSOLETE         pc += 2 * (char) op;                                                \ */
+/* OBSOLETE         continue;}                                                  \ */
+/* OBSOLETE       else if (op == 0x0140) {                      /* jmp crossjump *x/    \ */
+/* OBSOLETE         pc = read_memory_integer (pc + 2, 4);                               \ */
+/* OBSOLETE         continue;}                                                  \ */
+/* OBSOLETE       else break;                                                   \ */
+/* OBSOLETE       if ((frame_saved_regs).regs[regnum])                          \ */
+/* OBSOLETE     break;                                                          \ */
+/* OBSOLETE       if (ix == 7) disp += frame_fp;                                        \ */
+/* OBSOLETE       else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4);     \ */
+/* OBSOLETE       else if (ix != 0) break;                                              \ */
+/* OBSOLETE       (frame_saved_regs).regs[regnum] =                                     \ */
+/* OBSOLETE     disp - 8 + (1 << ((op >> 8) & 3));                              \ */
+/* OBSOLETE       if (regnum >= S7_REGNUM)                                              \ */
+/* OBSOLETE         (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] =   \ */
+/* OBSOLETE       disp - 4 + (1 << ((op >> 8) & 3));                            \ */
+/* OBSOLETE     }                                                                       \ */
+/* OBSOLETE   }                                                                 \ */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /* Things needed for making the inferior call functions.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define    CALL_DUMMY_LOCATION     BEFORE_TEXT_END */
+/* OBSOLETE #define     CALL_DUMMY_LOCATION     BEFORE_TEXT_END */
 /* OBSOLETE  */
 /* OBSOLETE /* Push an empty stack frame, to record the current PC, etc.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define PUSH_DUMMY_FRAME \ */
-/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);                       \ */
-/* OBSOLETE   register int regnum;                                                     \ */
-/* OBSOLETE   char buf[8];                                                             \ */
-/* OBSOLETE   long word;                                                               \ */
-/* OBSOLETE   for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) {                \ */
-/* OBSOLETE     read_register_bytes (REGISTER_BYTE (regnum), buf, 8);          \ */
-/* OBSOLETE     sp = push_bytes (sp, buf, 8);}                                 \ */
-/* OBSOLETE   for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) {                \ */
-/* OBSOLETE     word = read_register (regnum);                                 \ */
-/* OBSOLETE     sp = push_bytes (sp, &word, 4);}                                       \ */
-/* OBSOLETE   word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25);         \ */
-/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                  \ */
-/* OBSOLETE   word = read_register (PC_REGNUM);                                        \ */
-/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                          \ */
-/* OBSOLETE   write_register (SP_REGNUM, sp);                                  \ */
-/* OBSOLETE   write_register (FP_REGNUM, sp);                                  \ */
+/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);                        \ */
+/* OBSOLETE   register int regnum;                                                      \ */
+/* OBSOLETE   char buf[8];                                                              \ */
+/* OBSOLETE   long word;                                                                \ */
+/* OBSOLETE   for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) {                 \ */
+/* OBSOLETE     read_register_bytes (REGISTER_BYTE (regnum), buf, 8);           \ */
+/* OBSOLETE     sp = push_bytes (sp, buf, 8);}                                  \ */
+/* OBSOLETE   for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) {                 \ */
+/* OBSOLETE     word = read_register (regnum);                                  \ */
+/* OBSOLETE     sp = push_bytes (sp, &word, 4);}                                        \ */
+/* OBSOLETE   word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25);          \ */
+/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                   \ */
+/* OBSOLETE   word = read_register (PC_REGNUM);                                 \ */
+/* OBSOLETE   sp = push_bytes (sp, &word, 4);                                           \ */
+/* OBSOLETE   write_register (SP_REGNUM, sp);                                   \ */
+/* OBSOLETE   write_register (FP_REGNUM, sp);                                   \ */
 /* OBSOLETE   write_register (AP_REGNUM, sp);} */
 /* OBSOLETE  */
 /* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define POP_FRAME  do {\ */
-/* OBSOLETE   register CORE_ADDR fp = read_register (FP_REGNUM);           \ */
-/* OBSOLETE   register int regnum;                                         \ */
-/* OBSOLETE   register int frame_length =      /* 3 short, 2 long, 1 extended, 0 context *x/ \ */
+/* OBSOLETE   register CORE_ADDR fp = read_register (FP_REGNUM);            \ */
+/* OBSOLETE   register int regnum;                                          \ */
+/* OBSOLETE   register int frame_length =       /* 3 short, 2 long, 1 extended, 0 context *x/ \ */
 /* OBSOLETE       (read_memory_integer (fp + 4, 4) >> 25) & 3;          \ */
-/* OBSOLETE   char buf[8];                                                 \ */
+/* OBSOLETE   char buf[8];                                                  \ */
 /* OBSOLETE   write_register (PC_REGNUM, read_memory_integer (fp, 4));  \ */
 /* OBSOLETE   write_register (PS_REGNUM, read_memory_integer (fp += 4, 4));  \ */
 /* OBSOLETE   write_register (FP_REGNUM, read_memory_integer (fp += 4, 4));  \ */
 /* OBSOLETE   write_register (AP_REGNUM, read_memory_integer (fp += 4, 4));  \ */
-/* OBSOLETE   if (frame_length < 3)                                 \ */
+/* OBSOLETE   if (frame_length < 3)                                  \ */
 /* OBSOLETE     for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum)   \ */
 /* OBSOLETE       write_register (regnum, read_memory_integer (fp += 4, 4)); \ */
-/* OBSOLETE   if (frame_length < 2)                                         \ */
+/* OBSOLETE   if (frame_length < 2)                                          \ */
 /* OBSOLETE     write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
-/* OBSOLETE   fp -= 4;                                                 \ */
-/* OBSOLETE   if (frame_length < 3)                                    \ */
-/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) {       \ */
-/* OBSOLETE       read_memory (fp += 8, buf, 8);                               \ */
+/* OBSOLETE   fp -= 4;                                                  \ */
+/* OBSOLETE   if (frame_length < 3)                                     \ */
+/* OBSOLETE     for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) {        \ */
+/* OBSOLETE       read_memory (fp += 8, buf, 8);                                \ */
 /* OBSOLETE       write_register_bytes (REGISTER_BYTE (regnum), buf, 8);}   \ */
-/* OBSOLETE   if (frame_length < 2)    {                                       \ */
-/* OBSOLETE     read_memory (fp += 8, buf, 8);                         \ */
+/* OBSOLETE   if (frame_length < 2)     {                                       \ */
+/* OBSOLETE     read_memory (fp += 8, buf, 8);                          \ */
 /* OBSOLETE     write_register_bytes (REGISTER_BYTE (regnum), buf, 8);}     \ */
-/* OBSOLETE   else write_register (SP_REGNUM, fp + 8);                 \ */
-/* OBSOLETE   flush_cached_frames ();                                  \ */
+/* OBSOLETE   else write_register (SP_REGNUM, fp + 8);                  \ */
+/* OBSOLETE   flush_cached_frames ();                                   \ */
 /* OBSOLETE } while (0) */
 /* OBSOLETE  */
 /* OBSOLETE /* This sequence of words is the instructions */
 /* OBSOLETE    into a call sequence of the above form stored at DUMMYNAME.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p)   \ */
-/* OBSOLETE { *(int *)((char *) dummyname + 4) = nargs;        \ */
+/* OBSOLETE { *(int *)((char *) dummyname + 4) = nargs; \ */
 /* OBSOLETE   *(int *)((char *) dummyname + 10) = fun; } */
 /* OBSOLETE \f */
 /* OBSOLETE /* Defs to read soff symbol tables, see dbxread.c *x/ */
 /* OBSOLETE     (BUFFER = STRING_TABLE_SIZE) */
 /* OBSOLETE  */
 /* OBSOLETE #define DECLARE_FILE_HEADERS \ */
-/* OBSOLETE   FILEHDR filehdr;                                                 \ */
-/* OBSOLETE   OPTHDR opthdr;                                                   \ */
+/* OBSOLETE   FILEHDR filehdr;                                                  \ */
+/* OBSOLETE   OPTHDR opthdr;                                                    \ */
 /* OBSOLETE   SCNHDR txthdr */
 /* OBSOLETE  */
 /* OBSOLETE #define READ_FILE_HEADERS(DESC,NAME) \ */
-/* OBSOLETE {                                                                  \ */
-/* OBSOLETE   int n;                                                           \ */
-/* OBSOLETE   val = myread (DESC, &filehdr, sizeof filehdr);                   \ */
-/* OBSOLETE   if (val < 0)                                                             \ */
-/* OBSOLETE     perror_with_name (NAME);                                               \ */
-/* OBSOLETE   if (! IS_SOFF_MAGIC (filehdr.h_magic))                           \ */
-/* OBSOLETE     error ("%s: not an executable file.", NAME);                   \ */
-/* OBSOLETE   lseek (DESC, 0L, 0);                                                     \ */
-/* OBSOLETE   if (myread (DESC, &filehdr, sizeof filehdr) < 0)                 \ */
-/* OBSOLETE     perror_with_name (NAME);                                               \ */
-/* OBSOLETE   if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0)                       \ */
-/* OBSOLETE     perror_with_name (NAME);                                               \ */
-/* OBSOLETE   for (n = 0; n < filehdr.h_nscns; n++)                                    \ */
-/* OBSOLETE     {                                                                      \ */
-/* OBSOLETE       if (myread (DESC, &txthdr, sizeof txthdr) < 0)                       \ */
-/* OBSOLETE    perror_with_name (NAME);                                        \ */
-/* OBSOLETE       if ((txthdr.s_flags & S_TYPMASK) == S_TEXT)                  \ */
-/* OBSOLETE    break;                                                          \ */
-/* OBSOLETE     }                                                                      \ */
+/* OBSOLETE {                                                                   \ */
+/* OBSOLETE   int n;                                                            \ */
+/* OBSOLETE   val = myread (DESC, &filehdr, sizeof filehdr);                    \ */
+/* OBSOLETE   if (val < 0)                                                              \ */
+/* OBSOLETE     perror_with_name (NAME);                                                \ */
+/* OBSOLETE   if (! IS_SOFF_MAGIC (filehdr.h_magic))                            \ */
+/* OBSOLETE     error ("%s: not an executable file.", NAME);                    \ */
+/* OBSOLETE   lseek (DESC, 0L, 0);                                                      \ */
+/* OBSOLETE   if (myread (DESC, &filehdr, sizeof filehdr) < 0)                  \ */
+/* OBSOLETE     perror_with_name (NAME);                                                \ */
+/* OBSOLETE   if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0)                        \ */
+/* OBSOLETE     perror_with_name (NAME);                                                \ */
+/* OBSOLETE   for (n = 0; n < filehdr.h_nscns; n++)                                     \ */
+/* OBSOLETE     {                                                                       \ */
+/* OBSOLETE       if (myread (DESC, &txthdr, sizeof txthdr) < 0)                        \ */
+/* OBSOLETE     perror_with_name (NAME);                                        \ */
+/* OBSOLETE       if ((txthdr.s_flags & S_TYPMASK) == S_TEXT)                   \ */
+/* OBSOLETE     break;                                                          \ */
+/* OBSOLETE     }                                                                       \ */
 /* OBSOLETE } */
index 8dfa9fd3d172e19fa3ef1f0df90e5b79212754b8..1983f690ac6dcd574d144828a3ac32e5fb0c43f0 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-specific definition for the Mitsubishi D10V
    Copyright (C) 1996,1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Contributed by Martin Hunt, hunt@cygnus.com */
 
@@ -86,7 +87,7 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
 #define REGISTER_SIZE 2
 
 /* Say how much memory is needed to store a copy of the register set */
-#define REGISTER_BYTES    ((37/*NUM_REGS*/-2)*2+16) 
+#define REGISTER_BYTES    ((37/*NUM_REGS*/-2)*2+16)
 
 /* Index within `registers' of the first byte of the space for
    register N.  */
@@ -99,7 +100,7 @@ extern int d10v_register_raw_size PARAMS ((int reg_nr));
 #define REGISTER_RAW_SIZE(N) (d10v_register_raw_size (N))
 
 /* Number of bytes of storage in the program's representation
-   for register N.  */   
+   for register N.  */
 extern int d10v_register_virtual_size PARAMS ((int reg_nr));
 #define REGISTER_VIRTUAL_SIZE(N) (d10v_register_virtual_size (N))
 
@@ -119,8 +120,8 @@ extern struct type *d10v_register_virtual_type PARAMS ((int reg_nr));
 
 /* convert $pc and $sp to/from virtual addresses */
 extern int d10v_register_convertible PARAMS ((int nr));
-extern void d10v_register_convert_to_virtual PARAMS ((int regnum, struct type *type, char *from, char *to));
-extern void d10v_register_convert_to_raw PARAMS ((struct type *type, int regnum, char *from, char *to));
+extern void d10v_register_convert_to_virtual PARAMS ((int regnum, struct type * type, char *from, char *to));
+extern void d10v_register_convert_to_raw PARAMS ((struct type * type, int regnum, char *from, char *to));
 #define REGISTER_CONVERTIBLE(N) (d10v_register_convertible ((N)))
 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
   d10v_register_convert_to_virtual ((REGNUM), (TYPE), (FROM), (TO))
@@ -157,7 +158,7 @@ extern void d10v_store_struct_return PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
 
    Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */
 
-extern void d10v_store_return_value PARAMS ((struct type *type, char *valbuf));
+extern void d10v_store_return_value PARAMS ((struct type * type, char *valbuf));
 #define STORE_RETURN_VALUE(TYPE,VALBUF) d10v_store_return_value ((TYPE), (VALBUF))
 
 
@@ -177,15 +178,15 @@ extern CORE_ADDR d10v_extract_struct_value_address PARAMS ((char *regbuf));
 
 extern use_struct_convention_fn d10v_use_struct_convention;
 #define USE_STRUCT_CONVENTION(gcc_p, type) d10v_use_struct_convention (gcc_p, type)
-
 \f
+
 /* 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 */
 
-extern void d10v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info *fi));
+extern void d10v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info * fi));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
-    d10v_init_extra_frame_info(fromleaf, fi) 
+    d10v_init_extra_frame_info(fromleaf, 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
@@ -194,24 +195,24 @@ extern void d10v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info
 #define FRAMELESS_FUNCTION_INVOCATION(FI) \
   (frameless_look_for_prologue (FI))
 
-extern CORE_ADDR d10v_frame_chain PARAMS ((struct frame_info *frame));
+extern CORE_ADDR d10v_frame_chain PARAMS ((struct frame_info * frame));
 #define FRAME_CHAIN(FRAME)       d10v_frame_chain(FRAME)
 extern int d10v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
 #define FRAME_CHAIN_VALID(chain, thisframe) d10v_frame_chain_valid (chain, thisframe)
-extern CORE_ADDR d10v_frame_saved_pc PARAMS ((struct frame_info *fi));
+extern CORE_ADDR d10v_frame_saved_pc PARAMS ((struct frame_info * fi));
 #define FRAME_SAVED_PC(fi) (d10v_frame_saved_pc ((fi)))
-extern CORE_ADDR d10v_frame_args_address PARAMS ((struct frame_info *fi));
+extern CORE_ADDR d10v_frame_args_address PARAMS ((struct frame_info * fi));
 #define FRAME_ARGS_ADDRESS(fi) (d10v_frame_args_address ((fi)))
-extern CORE_ADDR d10v_frame_locals_address PARAMS ((struct frame_info *fi));
+extern CORE_ADDR d10v_frame_locals_address PARAMS ((struct frame_info * fi));
 #define FRAME_LOCALS_ADDRESS(fi) (d10v_frame_locals_address ((fi)))
 
 /* Immediately after a function call, return the saved pc.  We can't */
 /* use frame->return_pc beause that is determined by reading R13 off the */
 /*stack and that may not be written yet. */
 
-extern CORE_ADDR d10v_saved_pc_after_call PARAMS ((struct frame_info *frame));
+extern CORE_ADDR d10v_saved_pc_after_call PARAMS ((struct frame_info * frame));
 #define SAVED_PC_AFTER_CALL(frame) (d10v_saved_pc_after_call ((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 */
@@ -297,13 +298,13 @@ CORE_ADDR d10v_read_fp PARAMS ((void));
 #define TARGET_PTR_BIT (4 * TARGET_CHAR_BIT)
 #define TARGET_DOUBLE_BIT (4 * TARGET_CHAR_BIT)
 #define TARGET_LONG_DOUBLE_BIT (8 * TARGET_CHAR_BIT)
-
 \f
+
 /* For the d10v when talking to the remote d10v board, GDB addresses
    need to be translated into a format that the d10v rom monitor
    understands. */
 
-extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
+extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len));
 #define REMOTE_TRANSLATE_XFER_ADDRESS(GDB_ADDR, GDB_LEN, REM_ADDR, REM_LEN) \
  remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), (REM_ADDR), (REM_LEN))
 
index 124b8b4e673c8ce6ca03ff73c35e2a9867c95595..f823f94685557588e8e1826802a7dbac3bbe465a 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-specific definition for the Mitsubishi D30V
    Copyright (C) 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_D30V_H
 #define TM_D30V_H
@@ -33,12 +34,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* and instruction memory to. */
 
 #define DMEM_START     0x20000000
-#define IMEM_START     0x00000000 /* was 0x10000000 */
+#define IMEM_START     0x00000000      /* was 0x10000000 */
 #define STACK_START    0x20007ffe
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct frame_info;
-struct frame_saved_regs; 
+struct frame_saved_regs;
 struct type;
 struct value;
 #endif
@@ -93,9 +94,9 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
 #define SPU_REGNUM     65      /* User stack pointer */
 #define CREGS_START    66
 
-#define PSW_REGNUM     (CREGS_START + 0) /* psw, bpsw, or dpsw??? */
+#define PSW_REGNUM     (CREGS_START + 0)       /* psw, bpsw, or dpsw??? */
 #define     PSW_SM (((unsigned long)0x80000000) >> 0)  /* Stack mode: 0/SPI */
-                                                       /*             1/SPU */
+                                                       /*             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 */
@@ -111,25 +112,25 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
 #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 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 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) 
+#define REGISTER_BYTES    ((NUM_REGS - 2) * 4 + 2 * 8)
 
 /* Index within `registers' of the first byte of the space for
    register N.  */
@@ -143,7 +144,7 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
 #define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 4 )
 
 /* Number of bytes of storage in the program's representation
-   for register N.  */   
+   for register N.  */
 #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
 
 /* Largest value REGISTER_RAW_SIZE can have.  */
@@ -204,9 +205,9 @@ void d30v_do_registers_info PARAMS ((int regnum, int fpregs));
     int size;
 
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
-    d30v_init_extra_frame_info(fromleaf, fi) 
+    d30v_init_extra_frame_info(fromleaf, fi)
 
-extern void d30v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info *fi ));
+extern void d30v_init_extra_frame_info PARAMS ((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
@@ -218,7 +219,7 @@ extern void d30v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info
 #define FRAME_CHAIN(FRAME)       d30v_frame_chain(FRAME)
 extern int d30v_frame_chain_valid PARAMS ((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_SAVED_PC(FRAME)    ((FRAME)->return_pc)
 #define FRAME_ARGS_ADDRESS(fi)   (fi)->frame
 #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
 
@@ -230,7 +231,7 @@ extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
 /* 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 */
@@ -263,9 +264,9 @@ extern void d30v_frame_find_saved_regs PARAMS ((struct frame_info *, struct fram
    When it hits the breakpoint, clear the break point and pop the old
    register contents off the stack. */
 
-#define CALL_DUMMY             { 0 }  
+#define CALL_DUMMY             { 0 }
 #define PUSH_DUMMY_FRAME
-#define CALL_DUMMY_START_OFFSET        0       
+#define CALL_DUMMY_START_OFFSET        0
 #define CALL_DUMMY_LOCATION    AT_ENTRY_POINT
 #define CALL_DUMMY_BREAKPOINT_OFFSET (0)
 
@@ -278,8 +279,8 @@ 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 PARAMS ((char *, CORE_ADDR, CORE_ADDR,
-                                          int, struct value **,
-                                          struct type *, int));
+                                             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 PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
@@ -291,14 +292,14 @@ extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, i
 
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
 d30v_extract_return_value(TYPE, REGBUF, VALBUF)
-  extern void
+extern void
 d30v_extract_return_value PARAMS ((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 PARAMS((void));
+extern void d30v_pop_frame PARAMS ((void));
 
 #define REGISTER_SIZE 4
 
index 93aa9cb8f7f7742044e71c65c8bf835d57f3767a..2dd8a8ee7e0be268753777e799154074afa70254 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Fujitsu FR30 processor.
    Copyright 1999, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define FR30_GENREGS           16
 #define FR30_DEDICATEDREGS     8
@@ -84,7 +85,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define REGISTER_RAW_SIZE(N) FR30_REGSIZE
 
 /* Largest value REGISTER_RAW_SIZE can have.  */
-#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE 
+#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
 
 /* Number of bytes of storage in the program's representation
    for register N.  */
@@ -137,7 +138,7 @@ extern void fr30_pop_frame PARAMS ((void));
    Can return -1, meaning no way to tell.  */
 #define FRAME_NUM_ARGS(fi) (-1)
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct frame_info;
 struct frame_saved_regs;
 struct type;
@@ -150,10 +151,10 @@ struct value;
   int frameoffset;             \
   int framereg;
 
-extern CORE_ADDR fr30_frame_chain PARAMS ((struct frame_info *fi));
+extern CORE_ADDR fr30_frame_chain PARAMS ((struct frame_info * fi));
 #define FRAME_CHAIN(fi) fr30_frame_chain (fi)
 
-extern CORE_ADDR fr30_frame_saved_pc   PARAMS ((struct frame_info *));
+extern CORE_ADDR fr30_frame_saved_pc PARAMS ((struct frame_info *));
 #define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi))
 
 #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
@@ -165,7 +166,7 @@ extern CORE_ADDR fr30_skip_prologue PARAMS ((CORE_ADDR pc));
    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 PARAMS ((struct type *type, char *valbuf));
+extern void fr30_store_return_value PARAMS ((struct type * type, char *valbuf));
 
 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
   (fr30_store_return_value ((TYPE), (VALBUF)))
@@ -192,18 +193,18 @@ extern void fr30_store_return_value PARAMS ((struct type *type, char *valbuf));
 
 /* 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 PARAMS ((struct frame_info *frame));
+extern int fr30_frameless_function_invocation PARAMS ((struct frame_info * frame));
 #define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
 
-extern void fr30_init_extra_frame_info PARAMS ((struct frame_info *fi));
+extern void fr30_init_extra_frame_info PARAMS ((struct frame_info * fi));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
 
 #define FRAME_CHAIN_VALID(FP, FI)      generic_frame_chain_valid (FP, FI)
 
 extern CORE_ADDR
-fr30_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
-                            int struct_return,
-                            CORE_ADDR struct_addr));
+  fr30_push_arguments PARAMS ((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))
 
index cbd05b1bb97dbc8b8788874a4b15ed4aa8504ae9..9971c891ca2796b1ddf193820248f9bf91df7755 100644 (file)
 /* OBSOLETE #define NO_GNU_STABS */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for text-offset and data info (in NPL a.out format).  *x/ */
-/* OBSOLETE #define    TEXTINFO                                                \ */
-/* OBSOLETE         text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr);       \ */
+/* OBSOLETE #define     TEXTINFO                                                \ */
+/* OBSOLETE         text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr);        \ */
 /* OBSOLETE         exec_data_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr)\ */
 /* OBSOLETE                 + exec_aouthdr.a_text */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for number of symbol table entries *x/ */
-/* OBSOLETE #define NUMBER_OF_SYMBOLS                                  \ */
-/* OBSOLETE    (coffhdr.f_nsyms) */
+/* OBSOLETE #define NUMBER_OF_SYMBOLS                                   \ */
+/* OBSOLETE     (coffhdr.f_nsyms) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for file-offset of symbol table (in NPL a.out format).  *x/ */
-/* OBSOLETE #define SYMBOL_TABLE_OFFSET                                        \ */
-/* OBSOLETE    N_SYMOFF (coffhdr) */
+/* OBSOLETE #define SYMBOL_TABLE_OFFSET                                 \ */
+/* OBSOLETE     N_SYMOFF (coffhdr) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for file-offset of string table (in NPL a.out format).  *x/ */
-/* OBSOLETE #define STRING_TABLE_OFFSET                                        \ */
-/* OBSOLETE    (N_STROFF (coffhdr)) */
+/* OBSOLETE #define STRING_TABLE_OFFSET                                 \ */
+/* OBSOLETE     (N_STROFF (coffhdr)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to store the length of the string table data in INTO.  *x/ */
-/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO)                               \ */
-/* OBSOLETE    { INTO = hdr.a_stsize; } */
+/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO)                                \ */
+/* OBSOLETE     { INTO = hdr.a_stsize; } */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to declare variables to hold the file's header data.  *x/ */
-/* OBSOLETE #define DECLARE_FILE_HEADERS  struct exec hdr;                     \ */
-/* OBSOLETE                          FILHDR coffhdr */
+/* OBSOLETE #define DECLARE_FILE_HEADERS  struct exec hdr;                      \ */
+/* OBSOLETE                           FILHDR coffhdr */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */
 /* OBSOLETE    NAME is the file name, for error messages.  *x/ */
-/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME)                              \ */
-/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr);           \ */
-/* OBSOLETE   if (val < 0)                                                     \ */
-/* OBSOLETE     perror_with_name (NAME);                                       \ */
-/* OBSOLETE   val = myread (DESC, &hdr, sizeof hdr);                   \ */
-/* OBSOLETE   if (val < 0)                                                     \ */
-/* OBSOLETE     perror_with_name (NAME);                                       \ */
-/* OBSOLETE   if (coffhdr.f_magic != GNP1MAGIC)                                \ */
-/* OBSOLETE     error ("File \"%s\" not in coff executable format.", NAME);    \ */
-/* OBSOLETE   if (N_BADMAG (hdr))                                              \ */
+/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME)                               \ */
+/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr);            \ */
+/* OBSOLETE   if (val < 0)                                                      \ */
+/* OBSOLETE     perror_with_name (NAME);                                        \ */
+/* OBSOLETE   val = myread (DESC, &hdr, sizeof hdr);                    \ */
+/* OBSOLETE   if (val < 0)                                                      \ */
+/* OBSOLETE     perror_with_name (NAME);                                        \ */
+/* OBSOLETE   if (coffhdr.f_magic != GNP1MAGIC)                         \ */
+/* OBSOLETE     error ("File \"%s\" not in coff executable format.", NAME);     \ */
+/* OBSOLETE   if (N_BADMAG (hdr))                                               \ */
 /* OBSOLETE     error ("File \"%s\" not in executable format.", NAME); } */
 /* OBSOLETE  */
 /* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */
-/* OBSOLETE #define    NS32GMAGIC      GNP1MAGIC */
-/* OBSOLETE #define    NS32SMAGIC      GPNMAGIC */
+/* OBSOLETE #define     NS32GMAGIC      GNP1MAGIC */
+/* OBSOLETE #define     NS32SMAGIC      GPNMAGIC */
 /* OBSOLETE  */
 /* OBSOLETE /* Address of blocks in N_LBRAC and N_RBRAC symbols are absolute addresses, */
 /* OBSOLETE    not relative to start of source address.  *x/ */
@@ -80,7 +80,7 @@
 /* OBSOLETE  */
 /* OBSOLETE /* Offset from address of function to start of its code. */
 /* OBSOLETE    Zero on most machines.  *x/ */
-/* OBSOLETE #define FUNCTION_START_OFFSET      8 */
+/* OBSOLETE #define FUNCTION_START_OFFSET       8 */
 /* OBSOLETE  */
 /* OBSOLETE /* Advance PC across any function entry prologue instructions */
 /* OBSOLETE    to reach some "real" code.  One NPL we can have one two startup */
 /* OBSOLETE      or */
 /* OBSOLETE    Optional "stw r2,8(b3)"   (Gould first argument register passing) */
 /* OBSOLETE  *x/ */
-/* OBSOLETE #define SKIP_PROLOGUE(pc) {                                                \ */
-/* OBSOLETE    register int op = read_memory_integer ((pc), 4);                \ */
-/* OBSOLETE    if ((op & 0xffff0000) == 0xFA0B0000) {                          \ */
-/* OBSOLETE        pc += 4;                                                    \ */
-/* OBSOLETE        op = read_memory_integer ((pc), 4);                         \ */
-/* OBSOLETE        if ((op & 0xffff0000) == 0x59400000) {                      \ */
-/* OBSOLETE            pc += 4;                                                \ */
-/* OBSOLETE            op = read_memory_integer ((pc), 4);                     \ */
-/* OBSOLETE            if ((op & 0xffff0000) == 0x5F000000) {                  \ */
-/* OBSOLETE                pc += 4;                                            \ */
-/* OBSOLETE                op = read_memory_integer ((pc), 4);                 \ */
-/* OBSOLETE                if (op == 0xD4820008) {                             \ */
-/* OBSOLETE                    pc += 4;                                        \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 4);             \ */
-/* OBSOLETE                    if (op == 0x5582000C) {                         \ */
-/* OBSOLETE                        pc += 4;                                    \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 2);         \ */
-/* OBSOLETE                        if (op == 0x2fa0) {                         \ */
-/* OBSOLETE                            pc += 2;                                \ */
-/* OBSOLETE                        } else {                                    \ */
-/* OBSOLETE                            op = read_memory_integer ((pc), 4);     \ */
-/* OBSOLETE                            if (op == 0xd5030008) {                 \ */
-/* OBSOLETE                                pc += 4;                            \ */
-/* OBSOLETE                            }                                       \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    } else {                                        \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 2);         \ */
-/* OBSOLETE                        if (op == 0x2fa0) {                         \ */
-/* OBSOLETE                            pc += 2;                                \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                }                                                   \ */
-/* OBSOLETE            }                                                       \ */
-/* OBSOLETE        }                                                           \ */
-/* OBSOLETE    }                                                               \ */
-/* OBSOLETE    if ((op & 0xffff0000) == 0x59000000) {                          \ */
-/* OBSOLETE        pc += 4;                                                    \ */
-/* OBSOLETE        op = read_memory_integer ((pc), 4);                         \ */
-/* OBSOLETE        if ((op & 0xffff0000) == 0x5F000000) {                      \ */
-/* OBSOLETE            pc += 4;                                                \ */
-/* OBSOLETE            op = read_memory_integer ((pc), 4);                     \ */
-/* OBSOLETE            if (op == 0xD4820008) {                                 \ */
-/* OBSOLETE                pc += 4;                                            \ */
-/* OBSOLETE                op = read_memory_integer ((pc), 4);                 \ */
-/* OBSOLETE                if (op == 0x5582000C) {                             \ */
-/* OBSOLETE                    pc += 4;                                        \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 2);             \ */
-/* OBSOLETE                    if (op == 0x2fa0) {                             \ */
-/* OBSOLETE                        pc += 2;                                    \ */
-/* OBSOLETE                    } else {                                        \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 4);         \ */
-/* OBSOLETE                        if (op == 0xd5030008) {                     \ */
-/* OBSOLETE                            pc += 4;                                \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                } else {                                            \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 2);             \ */
-/* OBSOLETE                    if (op == 0x2fa0) {                             \ */
-/* OBSOLETE                        pc += 2;                                    \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                }                                                   \ */
-/* OBSOLETE            }                                                       \ */
-/* OBSOLETE        }                                                           \ */
-/* OBSOLETE    }                                                               \ */
+/* OBSOLETE #define SKIP_PROLOGUE(pc) {                                                 \ */
+/* OBSOLETE     register int op = read_memory_integer ((pc), 4);                \ */
+/* OBSOLETE     if ((op & 0xffff0000) == 0xFA0B0000) {                          \ */
+/* OBSOLETE         pc += 4;                                                    \ */
+/* OBSOLETE         op = read_memory_integer ((pc), 4);                         \ */
+/* OBSOLETE         if ((op & 0xffff0000) == 0x59400000) {                      \ */
+/* OBSOLETE             pc += 4;                                                \ */
+/* OBSOLETE             op = read_memory_integer ((pc), 4);                     \ */
+/* OBSOLETE             if ((op & 0xffff0000) == 0x5F000000) {                  \ */
+/* OBSOLETE                 pc += 4;                                            \ */
+/* OBSOLETE                 op = read_memory_integer ((pc), 4);                 \ */
+/* OBSOLETE                 if (op == 0xD4820008) {                             \ */
+/* OBSOLETE                     pc += 4;                                        \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 4);             \ */
+/* OBSOLETE                     if (op == 0x5582000C) {                         \ */
+/* OBSOLETE                         pc += 4;                                    \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 2);         \ */
+/* OBSOLETE                         if (op == 0x2fa0) {                         \ */
+/* OBSOLETE                             pc += 2;                                \ */
+/* OBSOLETE                         } else {                                    \ */
+/* OBSOLETE                             op = read_memory_integer ((pc), 4);     \ */
+/* OBSOLETE                             if (op == 0xd5030008) {                 \ */
+/* OBSOLETE                                 pc += 4;                            \ */
+/* OBSOLETE                             }                                       \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     } else {                                        \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 2);         \ */
+/* OBSOLETE                         if (op == 0x2fa0) {                         \ */
+/* OBSOLETE                             pc += 2;                                \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 }                                                   \ */
+/* OBSOLETE             }                                                       \ */
+/* OBSOLETE         }                                                           \ */
+/* OBSOLETE     }                                                               \ */
+/* OBSOLETE     if ((op & 0xffff0000) == 0x59000000) {                          \ */
+/* OBSOLETE         pc += 4;                                                    \ */
+/* OBSOLETE         op = read_memory_integer ((pc), 4);                         \ */
+/* OBSOLETE         if ((op & 0xffff0000) == 0x5F000000) {                      \ */
+/* OBSOLETE             pc += 4;                                                \ */
+/* OBSOLETE             op = read_memory_integer ((pc), 4);                     \ */
+/* OBSOLETE             if (op == 0xD4820008) {                                 \ */
+/* OBSOLETE                 pc += 4;                                            \ */
+/* OBSOLETE                 op = read_memory_integer ((pc), 4);                 \ */
+/* OBSOLETE                 if (op == 0x5582000C) {                             \ */
+/* OBSOLETE                     pc += 4;                                        \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 2);             \ */
+/* OBSOLETE                     if (op == 0x2fa0) {                             \ */
+/* OBSOLETE                         pc += 2;                                    \ */
+/* OBSOLETE                     } else {                                        \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 4);         \ */
+/* OBSOLETE                         if (op == 0xd5030008) {                     \ */
+/* OBSOLETE                             pc += 4;                                \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 } else {                                            \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 2);             \ */
+/* OBSOLETE                     if (op == 0x2fa0) {                             \ */
+/* OBSOLETE                         pc += 2;                                    \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 }                                                   \ */
+/* OBSOLETE             }                                                       \ */
+/* OBSOLETE         }                                                           \ */
+/* OBSOLETE     }                                                               \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Immediately after a function call, return the saved pc. */
 /* OBSOLETE    some instructions.  True on NPL! Return address is in R1. */
 /* OBSOLETE    The true return address is REALLY 4 past that location! *x/ */
 /* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
-/* OBSOLETE    (read_register(R1_REGNUM) + 4) */
+/* OBSOLETE     (read_register(R1_REGNUM) + 4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Address of end of stack space.  *x/ */
-/* OBSOLETE #define STACK_END_ADDR             0x7fffc000 */
+/* OBSOLETE #define STACK_END_ADDR              0x7fffc000 */
 /* OBSOLETE  */
 /* OBSOLETE /* Stack grows downward.  *x/ */
 /* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
 /* OBSOLETE    This is padded out to the size of a machine word.  When it was just */
 /* OBSOLETE    {0x28, 0x09} it gave problems if hit breakpoint on returning from a */
 /* OBSOLETE    function call.  *x/ */
-/* OBSOLETE #define BREAKPOINT                 {0x28, 0x09, 0x0, 0x0} */
+/* OBSOLETE #define BREAKPOINT          {0x28, 0x09, 0x0, 0x0} */
 /* 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.  *x/ */
-/* OBSOLETE #define DECR_PC_AFTER_BREAK        2 */
+/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
 /* OBSOLETE  */
 /* OBSOLETE /* Return 1 if P points to an invalid floating point value.  *x/ */
-/* OBSOLETE #define INVALID_FLOAT(p, len)      ((*(short *)p & 0xff80) == 0x8000) */
+/* OBSOLETE #define INVALID_FLOAT(p, len)       ((*(short *)p & 0xff80) == 0x8000) */
 /* 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 #define REGISTER_SIZE 4 */
 /* OBSOLETE  */
 /* OBSOLETE /* Size of bytes of vector register (NP1 only), 32 elements * sizeof(int) *x/ */
-/* OBSOLETE #define VR_SIZE                    128 */
+/* OBSOLETE #define VR_SIZE                     128 */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of machine registers *x/ */
-/* OBSOLETE #define NUM_REGS           27 */
-/* OBSOLETE #define NUM_GEN_REGS               16 */
-/* OBSOLETE #define NUM_CPU_REGS               4 */
-/* OBSOLETE #define NUM_VECTOR_REGS            7 */
+/* OBSOLETE #define NUM_REGS            27 */
+/* OBSOLETE #define NUM_GEN_REGS                16 */
+/* OBSOLETE #define NUM_CPU_REGS                4 */
+/* OBSOLETE #define NUM_VECTOR_REGS             7 */
 /* OBSOLETE  */
 /* OBSOLETE /* Initializer for an array of names of registers. */
 /* OBSOLETE    There should be NUM_REGS strings in this initializer.  *x/ */
 /* 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.  *x/ */
-/* OBSOLETE #define R1_REGNUM  1       /* Gr1 => return address of caller *x/ */
-/* OBSOLETE #define R2_REGNUM  2       /* Gr2 => return value from function *x/ */
-/* OBSOLETE #define R4_REGNUM  4       /* Gr4 => register save area *x/ */
-/* OBSOLETE #define R5_REGNUM  5       /* Gr5 => register save area *x/ */
-/* OBSOLETE #define R6_REGNUM  6       /* Gr6 => register save area *x/ */
-/* OBSOLETE #define R7_REGNUM  7       /* Gr7 => register save area *x/ */
-/* OBSOLETE #define B1_REGNUM  9       /* Br1 => start of this code routine *x/ */
-/* OBSOLETE #define SP_REGNUM  10      /* Br2 == (sp) *x/ */
-/* OBSOLETE #define AP_REGNUM  11      /* Br3 == (ap) *x/ */
-/* OBSOLETE #define FP_REGNUM  16      /* A copy of Br2 saved in trap *x/ */
-/* OBSOLETE #define PS_REGNUM  17      /* Contains processor status *x/ */
-/* OBSOLETE #define PC_REGNUM  18      /* Contains program counter *x/ */
-/* OBSOLETE #define VE_REGNUM  19      /* Vector end (user setup) register *x/ */
-/* OBSOLETE #define V1_REGNUM  20      /* First vector register *x/ */
-/* OBSOLETE #define V7_REGNUM  26      /* First vector register *x/ */
+/* OBSOLETE #define R1_REGNUM   1       /* Gr1 => return address of caller *x/ */
+/* OBSOLETE #define R2_REGNUM   2       /* Gr2 => return value from function *x/ */
+/* OBSOLETE #define R4_REGNUM   4       /* Gr4 => register save area *x/ */
+/* OBSOLETE #define R5_REGNUM   5       /* Gr5 => register save area *x/ */
+/* OBSOLETE #define R6_REGNUM   6       /* Gr6 => register save area *x/ */
+/* OBSOLETE #define R7_REGNUM   7       /* Gr7 => register save area *x/ */
+/* OBSOLETE #define B1_REGNUM   9       /* Br1 => start of this code routine *x/ */
+/* OBSOLETE #define SP_REGNUM   10      /* Br2 == (sp) *x/ */
+/* OBSOLETE #define AP_REGNUM   11      /* Br3 == (ap) *x/ */
+/* OBSOLETE #define FP_REGNUM   16      /* A copy of Br2 saved in trap *x/ */
+/* OBSOLETE #define PS_REGNUM   17      /* Contains processor status *x/ */
+/* OBSOLETE #define PC_REGNUM   18      /* Contains program counter *x/ */
+/* OBSOLETE #define VE_REGNUM   19      /* Vector end (user setup) register *x/ */
+/* OBSOLETE #define V1_REGNUM   20      /* First vector register *x/ */
+/* OBSOLETE #define V7_REGNUM   26      /* First vector register *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
 /* OBSOLETE    register state, the array `registers'.  *x/ */
 /* OBSOLETE #define REGISTER_BYTES \ */
-/* OBSOLETE    (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4) */
+/* OBSOLETE     (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Index within `registers' of the first byte of the space for */
 /* OBSOLETE    register N.  *x/ */
 /* OBSOLETE #define REGISTER_BYTE(N)  \ */
-/* OBSOLETE    (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80) */
+/* OBSOLETE     (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80) */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of bytes of storage in the actual machine representation */
 /* OBSOLETE    for register N.  On the NP1, all normal regs are 4 bytes, but */
 /* OBSOLETE    the vector registers are VR_SIZE*4 bytes long. *x/ */
 /* OBSOLETE #define REGISTER_RAW_SIZE(N) \ */
-/* OBSOLETE    (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
+/* OBSOLETE     (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of bytes of storage in the program's representation */
 /* OBSOLETE    for register N.  On the NP1, all regs are 4 bytes. *x/ */
 /* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) \ */
-/* OBSOLETE    (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
+/* OBSOLETE     (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
 /* OBSOLETE  */
 /* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  *x/ */
-/* OBSOLETE #define MAX_REGISTER_RAW_SIZE              VR_SIZE */
+/* OBSOLETE #define MAX_REGISTER_RAW_SIZE               VR_SIZE */
 /* OBSOLETE  */
 /* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  *x/ */
-/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE  VR_SIZE */
+/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE   VR_SIZE */
 /* OBSOLETE  */
 /* OBSOLETE /* Return the GDB type object for the "standard" data type */
 /* OBSOLETE    of data in register N.  *x/ */
-/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N)   \ */
+/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N)    \ */
 /* OBSOLETE   ((N) > VE_REGNUM ? builtin_type_np1_vector : builtin_type_int) */
 /* OBSOLETE extern struct type *builtin_type_np1_vector; */
 /* OBSOLETE  */
 /* OBSOLETE    into VALBUF. *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
-/* OBSOLETE    memcpy (VALBUF, ((int *)(REGBUF)) + 2, TYPE_LENGTH (TYPE)) */
+/* OBSOLETE     memcpy (VALBUF, ((int *)(REGBUF)) + 2, TYPE_LENGTH (TYPE)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Write into appropriate registers a function return value */
 /* OBSOLETE    of type TYPE, given in virtual format.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
-/* OBSOLETE    write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF,      \ */
-/* OBSOLETE                          TYPE_LENGTH (TYPE)) */
+/* OBSOLETE     write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF,      \ */
+/* OBSOLETE                           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 /* In the case of the NPL, the frame's norminal address is Br2 and the  */
 /* OBSOLETE    previous routines frame is up the stack X bytes, where X is the */
 /* OBSOLETE    value stored in the code function header xA(Br1). *x/ */
-/* OBSOLETE #define FRAME_CHAIN(thisframe)             (findframe(thisframe)) */
+/* OBSOLETE #define FRAME_CHAIN(thisframe)              (findframe(thisframe)) */
 /* OBSOLETE  */
 /* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */
 /* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */
 /* OBSOLETE  */
 /* OBSOLETE /* Define other aspects of the stack frame on NPL.  *x/ */
 /* OBSOLETE #define FRAME_SAVED_PC(FRAME) \ */
-/* OBSOLETE    (read_memory_integer ((FRAME)->frame + 8, 4)) */
+/* OBSOLETE     (read_memory_integer ((FRAME)->frame + 8, 4)) */
 /* OBSOLETE  */
 /* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */
-/* OBSOLETE    ((fi)->next ? \ */
-/* OBSOLETE     read_memory_integer ((fi)->frame + 12, 4) : \ */
-/* OBSOLETE     read_register (AP_REGNUM)) */
+/* OBSOLETE     ((fi)->next ? \ */
+/* OBSOLETE      read_memory_integer ((fi)->frame + 12, 4) : \ */
+/* OBSOLETE      read_register (AP_REGNUM)) */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)   ((fi)->frame) */
+/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)    ((fi)->frame) */
 /* 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.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* We can check the stab info to see how */
 /* OBSOLETE    many arg we have.  No info in stack will tell us *x/ */
-/* OBSOLETE #define FRAME_NUM_ARGS(fi)         (findarg(fi)) */
+/* OBSOLETE #define FRAME_NUM_ARGS(fi)          (findarg(fi)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Return number of bytes at start of arglist that are not really args.  *x/ */
-/* OBSOLETE #define FRAME_ARGS_SKIP                    8 */
+/* OBSOLETE #define FRAME_ARGS_SKIP                     8 */
 /* 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    ways in the stack frame.  sp is even more special: */
 /* OBSOLETE    the address we return for it IS the sp for the next frame.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)                \ */
+/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)         \ */
 /* OBSOLETE {                                                                       \ */
-/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                       \ */
+/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                        \ */
 /* OBSOLETE   (frame_saved_regs).regs[SP_REGNUM] = framechain (frame_info);         \ */
-/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8;            \ */
-/* OBSOLETE   (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
+/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8;             \ */
+/* OBSOLETE   (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C;  \ */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /* Things needed for making the inferior call functions.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define CALL_DUMMY_LOCATION        BEFORE_TEXT_END */
-/* OBSOLETE #define    NEED_TEXT_START_END 1 */
+/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */
+/* OBSOLETE #define     NEED_TEXT_START_END 1 */
 /* OBSOLETE  */
 /* OBSOLETE /* Push an empty stack frame, to record the current PC, etc.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE    *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define CALL_DUMMY {0x00000000,  \ */
-/* OBSOLETE                0x00000000,  \ */
-/* OBSOLETE                0x59000000,  \ */
-/* OBSOLETE                0x598a0000,  \ */
-/* OBSOLETE                0xb5030008,  \ */
-/* OBSOLETE                0x5c820000,  \ */
-/* OBSOLETE                0x44810008,  \ */
-/* OBSOLETE                0x00000000,  \ */
-/* OBSOLETE                0x590a0000,  \ */
-/* OBSOLETE                0x28090000 } */
+/* OBSOLETE                 0x00000000,  \ */
+/* OBSOLETE                 0x59000000,  \ */
+/* OBSOLETE                 0x598a0000,  \ */
+/* OBSOLETE                 0xb5030008,  \ */
+/* OBSOLETE                 0x5c820000,  \ */
+/* OBSOLETE                 0x44810008,  \ */
+/* OBSOLETE                 0x00000000,  \ */
+/* OBSOLETE                 0x590a0000,  \ */
+/* OBSOLETE                 0x28090000 } */
 /* OBSOLETE  */
 /* OBSOLETE #define CALL_DUMMY_LENGTH 40 */
 /* OBSOLETE  */
 /* OBSOLETE       int arg_len = 0, total_len;\ */
 /* OBSOLETE       old_sp = push_word(old_sp,fun);\ */
 /* OBSOLETE       for(i = nargs - 1;i >= 0;i--)\ */
-/* OBSOLETE    arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\ */
+/* OBSOLETE     arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\ */
 /* OBSOLETE       if(struct_return)\ */
-/* OBSOLETE    arg_len += TYPE_LENGTH(value_type);\ */
+/* OBSOLETE     arg_len += TYPE_LENGTH(value_type);\ */
 /* OBSOLETE       total_len = DUMMY_FRAME_SIZE+CALL_DUMMY_STACK_ADJUST+4+arg_len;\ */
 /* OBSOLETE       dummyname[0] += total_len;\ */
 /* OBSOLETE       dummyname[2] += total_len;\ */
index 6d685d6e400c70f2b756b6dfa0ffaeac40a71a9b..3c6d174882b6e0c23f7c6d5f389540f68bec2c0b 100644 (file)
 /* OBSOLETE #define NO_GNU_STABS */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for text-offset and data info (in PN a.out format).  *x/ */
-/* OBSOLETE #define    TEXTINFO                                                \ */
-/* OBSOLETE    text_offset = N_TXTOFF (exec_coffhdr);                  \ */
-/* OBSOLETE    exec_data_offset = N_TXTOFF (exec_coffhdr)              \ */
-/* OBSOLETE            + exec_aouthdr.a_text */
+/* OBSOLETE #define     TEXTINFO                                                \ */
+/* OBSOLETE     text_offset = N_TXTOFF (exec_coffhdr);                  \ */
+/* OBSOLETE     exec_data_offset = N_TXTOFF (exec_coffhdr)              \ */
+/* OBSOLETE             + exec_aouthdr.a_text */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for number of symbol table entries (this used to be checked */
 /* OBSOLETE    in dbxread.c and caused the last psymtab to use this as the end of */
 /* OBSOLETE    text.  I'm not sure whether it would still be necessary).  *x/ */
-/* OBSOLETE #define END_OF_TEXT_DEFAULT                                        \ */
-/* OBSOLETE    (0xffffff) */
+/* OBSOLETE #define END_OF_TEXT_DEFAULT                                 \ */
+/* OBSOLETE     (0xffffff) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for number of symbol table entries *x/ */
-/* OBSOLETE #define NUMBER_OF_SYMBOLS                                  \ */
-/* OBSOLETE    (coffhdr.f_nsyms) */
+/* OBSOLETE #define NUMBER_OF_SYMBOLS                                   \ */
+/* OBSOLETE     (coffhdr.f_nsyms) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for file-offset of symbol table (in usual a.out format).  *x/ */
-/* OBSOLETE #define SYMBOL_TABLE_OFFSET                                        \ */
-/* OBSOLETE    N_SYMOFF (coffhdr) */
+/* OBSOLETE #define SYMBOL_TABLE_OFFSET                                 \ */
+/* OBSOLETE     N_SYMOFF (coffhdr) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro for file-offset of string table (in usual a.out format).  *x/ */
-/* OBSOLETE #define STRING_TABLE_OFFSET                                        \ */
-/* OBSOLETE    (N_STROFF (coffhdr) + sizeof(int)) */
+/* OBSOLETE #define STRING_TABLE_OFFSET                                 \ */
+/* OBSOLETE     (N_STROFF (coffhdr) + sizeof(int)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to store the length of the string table data in INTO.  *x/ */
-/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO)                               \ */
-/* OBSOLETE    { INTO = hdr.a_stsize; } */
+/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO)                                \ */
+/* OBSOLETE     { INTO = hdr.a_stsize; } */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to declare variables to hold the file's header data.  *x/ */
-/* OBSOLETE #define DECLARE_FILE_HEADERS  struct old_exec hdr;         \ */
-/* OBSOLETE                          FILHDR coffhdr */
+/* OBSOLETE #define DECLARE_FILE_HEADERS  struct old_exec hdr;          \ */
+/* OBSOLETE                           FILHDR coffhdr */
 /* OBSOLETE  */
 /* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */
 /* OBSOLETE    NAME is the file name, for error messages.  *x/ */
-/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME)                              \ */
-/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr);           \ */
-/* OBSOLETE   if (val < 0)                                                     \ */
-/* OBSOLETE     perror_with_name (NAME);                                       \ */
-/* OBSOLETE   val = myread (DESC, &hdr, sizeof hdr);                   \ */
-/* OBSOLETE   if (val < 0)                                                     \ */
-/* OBSOLETE     perror_with_name (NAME);                                       \ */
-/* OBSOLETE   if (coffhdr.f_magic != GNP1MAGIC)                                \ */
-/* OBSOLETE     error ("File \"%s\" not in coff executable format.", NAME);    \ */
-/* OBSOLETE   if (N_BADMAG (hdr))                                              \ */
+/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME)                               \ */
+/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr);            \ */
+/* OBSOLETE   if (val < 0)                                                      \ */
+/* OBSOLETE     perror_with_name (NAME);                                        \ */
+/* OBSOLETE   val = myread (DESC, &hdr, sizeof hdr);                    \ */
+/* OBSOLETE   if (val < 0)                                                      \ */
+/* OBSOLETE     perror_with_name (NAME);                                        \ */
+/* OBSOLETE   if (coffhdr.f_magic != GNP1MAGIC)                         \ */
+/* OBSOLETE     error ("File \"%s\" not in coff executable format.", NAME);     \ */
+/* OBSOLETE   if (N_BADMAG (hdr))                                               \ */
 /* OBSOLETE     error ("File \"%s\" not in executable format.", NAME); } */
 /* OBSOLETE  */
 /* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */
-/* OBSOLETE #define    NS32GMAGIC      GDPMAGIC */
-/* OBSOLETE #define    NS32SMAGIC      PN_MAGIC */
+/* OBSOLETE #define     NS32GMAGIC      GDPMAGIC */
+/* OBSOLETE #define     NS32SMAGIC      PN_MAGIC */
 /* OBSOLETE  */
 /* OBSOLETE /* Offset from address of function to start of its code. */
 /* OBSOLETE    Zero on most machines.  *x/ */
-/* OBSOLETE #define FUNCTION_START_OFFSET      4 */
+/* OBSOLETE #define FUNCTION_START_OFFSET       4 */
 /* OBSOLETE  */
 /* OBSOLETE /* Advance PC across any function entry prologue instructions */
 /* OBSOLETE    to reach some "real" code.  One PN we can have one or two startup */
 /* OBSOLETE      or */
 /* OBSOLETE    Optional "stw r2,8(b3)"   (Gould first argument register passing) */
 /* OBSOLETE  *x/ */
-/* OBSOLETE #define SKIP_PROLOGUE(pc) {                                                \ */
-/* OBSOLETE    register int op = read_memory_integer ((pc), 4);                \ */
-/* OBSOLETE    if ((op & 0xffff0000) == 0x580B0000) {                          \ */
-/* OBSOLETE        pc += 4;                                                    \ */
-/* OBSOLETE        op = read_memory_integer ((pc), 4);                         \ */
-/* OBSOLETE        if ((op & 0xffff0000) == 0x59400000) {                      \ */
-/* OBSOLETE            pc += 4;                                                \ */
-/* OBSOLETE            op = read_memory_integer ((pc), 4);                     \ */
-/* OBSOLETE            if ((op & 0xffff0000) == 0x5F000000) {                  \ */
-/* OBSOLETE                pc += 4;                                            \ */
-/* OBSOLETE                op = read_memory_integer ((pc), 4);                 \ */
-/* OBSOLETE                if (op == 0xD4820008) {                             \ */
-/* OBSOLETE                    pc += 4;                                        \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 4);             \ */
-/* OBSOLETE                    if (op == 0x5582000C) {                         \ */
-/* OBSOLETE                        pc += 4;                                    \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 2);         \ */
-/* OBSOLETE                        if (op == 0x2fa0) {                         \ */
-/* OBSOLETE                            pc += 2;                                \ */
-/* OBSOLETE                        } else {                                    \ */
-/* OBSOLETE                            op = read_memory_integer ((pc), 4);     \ */
-/* OBSOLETE                            if (op == 0xd5030008) {                 \ */
-/* OBSOLETE                                pc += 4;                            \ */
-/* OBSOLETE                            }                                       \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    } else {                                        \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 2);         \ */
-/* OBSOLETE                        if (op == 0x2fa0) {                         \ */
-/* OBSOLETE                            pc += 2;                                \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                }                                                   \ */
-/* OBSOLETE            }                                                       \ */
-/* OBSOLETE        }                                                           \ */
-/* OBSOLETE    }                                                               \ */
-/* OBSOLETE    if ((op & 0xffff0000) == 0x59000000) {                          \ */
-/* OBSOLETE        pc += 4;                                                    \ */
-/* OBSOLETE        op = read_memory_integer ((pc), 4);                         \ */
-/* OBSOLETE        if ((op & 0xffff0000) == 0x5F000000) {                      \ */
-/* OBSOLETE            pc += 4;                                                \ */
-/* OBSOLETE            op = read_memory_integer ((pc), 4);                     \ */
-/* OBSOLETE            if (op == 0xD4820008) {                                 \ */
-/* OBSOLETE                pc += 4;                                            \ */
-/* OBSOLETE                op = read_memory_integer ((pc), 4);                 \ */
-/* OBSOLETE                if (op == 0x5582000C) {                             \ */
-/* OBSOLETE                    pc += 4;                                        \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 2);             \ */
-/* OBSOLETE                    if (op == 0x2fa0) {                             \ */
-/* OBSOLETE                        pc += 2;                                    \ */
-/* OBSOLETE                    } else {                                        \ */
-/* OBSOLETE                        op = read_memory_integer ((pc), 4);         \ */
-/* OBSOLETE                        if (op == 0xd5030008) {                     \ */
-/* OBSOLETE                            pc += 4;                                \ */
-/* OBSOLETE                        }                                           \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                } else {                                            \ */
-/* OBSOLETE                    op = read_memory_integer ((pc), 2);             \ */
-/* OBSOLETE                    if (op == 0x2fa0) {                             \ */
-/* OBSOLETE                        pc += 2;                                    \ */
-/* OBSOLETE                    }                                               \ */
-/* OBSOLETE                }                                                   \ */
-/* OBSOLETE            }                                                       \ */
-/* OBSOLETE        }                                                           \ */
-/* OBSOLETE    }                                                               \ */
+/* OBSOLETE #define SKIP_PROLOGUE(pc) {                                                 \ */
+/* OBSOLETE     register int op = read_memory_integer ((pc), 4);                \ */
+/* OBSOLETE     if ((op & 0xffff0000) == 0x580B0000) {                          \ */
+/* OBSOLETE         pc += 4;                                                    \ */
+/* OBSOLETE         op = read_memory_integer ((pc), 4);                         \ */
+/* OBSOLETE         if ((op & 0xffff0000) == 0x59400000) {                      \ */
+/* OBSOLETE             pc += 4;                                                \ */
+/* OBSOLETE             op = read_memory_integer ((pc), 4);                     \ */
+/* OBSOLETE             if ((op & 0xffff0000) == 0x5F000000) {                  \ */
+/* OBSOLETE                 pc += 4;                                            \ */
+/* OBSOLETE                 op = read_memory_integer ((pc), 4);                 \ */
+/* OBSOLETE                 if (op == 0xD4820008) {                             \ */
+/* OBSOLETE                     pc += 4;                                        \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 4);             \ */
+/* OBSOLETE                     if (op == 0x5582000C) {                         \ */
+/* OBSOLETE                         pc += 4;                                    \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 2);         \ */
+/* OBSOLETE                         if (op == 0x2fa0) {                         \ */
+/* OBSOLETE                             pc += 2;                                \ */
+/* OBSOLETE                         } else {                                    \ */
+/* OBSOLETE                             op = read_memory_integer ((pc), 4);     \ */
+/* OBSOLETE                             if (op == 0xd5030008) {                 \ */
+/* OBSOLETE                                 pc += 4;                            \ */
+/* OBSOLETE                             }                                       \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     } else {                                        \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 2);         \ */
+/* OBSOLETE                         if (op == 0x2fa0) {                         \ */
+/* OBSOLETE                             pc += 2;                                \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 }                                                   \ */
+/* OBSOLETE             }                                                       \ */
+/* OBSOLETE         }                                                           \ */
+/* OBSOLETE     }                                                               \ */
+/* OBSOLETE     if ((op & 0xffff0000) == 0x59000000) {                          \ */
+/* OBSOLETE         pc += 4;                                                    \ */
+/* OBSOLETE         op = read_memory_integer ((pc), 4);                         \ */
+/* OBSOLETE         if ((op & 0xffff0000) == 0x5F000000) {                      \ */
+/* OBSOLETE             pc += 4;                                                \ */
+/* OBSOLETE             op = read_memory_integer ((pc), 4);                     \ */
+/* OBSOLETE             if (op == 0xD4820008) {                                 \ */
+/* OBSOLETE                 pc += 4;                                            \ */
+/* OBSOLETE                 op = read_memory_integer ((pc), 4);                 \ */
+/* OBSOLETE                 if (op == 0x5582000C) {                             \ */
+/* OBSOLETE                     pc += 4;                                        \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 2);             \ */
+/* OBSOLETE                     if (op == 0x2fa0) {                             \ */
+/* OBSOLETE                         pc += 2;                                    \ */
+/* OBSOLETE                     } else {                                        \ */
+/* OBSOLETE                         op = read_memory_integer ((pc), 4);         \ */
+/* OBSOLETE                         if (op == 0xd5030008) {                     \ */
+/* OBSOLETE                             pc += 4;                                \ */
+/* OBSOLETE                         }                                           \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 } else {                                            \ */
+/* OBSOLETE                     op = read_memory_integer ((pc), 2);             \ */
+/* OBSOLETE                     if (op == 0x2fa0) {                             \ */
+/* OBSOLETE                         pc += 2;                                    \ */
+/* OBSOLETE                     }                                               \ */
+/* OBSOLETE                 }                                                   \ */
+/* OBSOLETE             }                                                       \ */
+/* OBSOLETE         }                                                           \ */
+/* OBSOLETE     }                                                               \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Immediately after a function call, return the saved pc. */
 /* OBSOLETE    some instructions.  True on PN!  Return address is in R1. */
 /* OBSOLETE    Note: true return location is 4 bytes past R1! *x/ */
 /* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
-/* OBSOLETE    (read_register(R1_REGNUM) + 4) */
+/* OBSOLETE     (read_register(R1_REGNUM) + 4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Address of end of stack space.  *x/ */
-/* OBSOLETE #define STACK_END_ADDR             0x480000 */
+/* OBSOLETE #define STACK_END_ADDR              0x480000 */
 /* OBSOLETE  */
 /* OBSOLETE /* Stack grows downward.  *x/ */
 /* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Sequence of bytes for breakpoint instruction.  *x/ */
-/* OBSOLETE #define BREAKPOINT                 {0x28, 0x09} */
+/* OBSOLETE #define BREAKPOINT          {0x28, 0x09} */
 /* 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.  *x/ */
-/* OBSOLETE #define DECR_PC_AFTER_BREAK        2 */
+/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
 /* OBSOLETE  */
 /* OBSOLETE /* Return 1 if P points to an invalid floating point value.  *x/ */
-/* OBSOLETE #define INVALID_FLOAT(p, len)      ((*(short *)p & 0xff80) == 0x8000) */
+/* OBSOLETE #define INVALID_FLOAT(p, len)       ((*(short *)p & 0xff80) == 0x8000) */
 /* 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 #define REGISTER_SIZE 4 */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of machine registers *x/ */
-/* OBSOLETE #define NUM_REGS           19 */
-/* OBSOLETE #define NUM_GEN_REGS               16 */
-/* OBSOLETE #define NUM_CPU_REGS               3 */
+/* OBSOLETE #define NUM_REGS            19 */
+/* OBSOLETE #define NUM_GEN_REGS                16 */
+/* OBSOLETE #define NUM_CPU_REGS                3 */
 /* OBSOLETE  */
 /* OBSOLETE /* Initializer for an array of names of registers. */
 /* OBSOLETE    There should be NUM_REGS strings in this initializer.  *x/ */
 /* 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.  *x/ */
-/* OBSOLETE #define R1_REGNUM  1       /* Gr1 => return address of caller *x/ */
-/* OBSOLETE #define R4_REGNUM  4       /* Gr4 => register save area *x/ */
-/* OBSOLETE #define R5_REGNUM  5       /* Gr5 => register save area *x/ */
-/* OBSOLETE #define R6_REGNUM  6       /* Gr6 => register save area *x/ */
-/* OBSOLETE #define R7_REGNUM  7       /* Gr7 => register save area *x/ */
-/* OBSOLETE #define B1_REGNUM  9       /* Br1 => start of this code routine *x/ */
-/* OBSOLETE #define FP_REGNUM  10      /* Br2 == (sp) *x/ */
-/* OBSOLETE #define AP_REGNUM  11      /* Br3 == (ap) *x/ */
-/* OBSOLETE #define SP_REGNUM  16      /* A copy of Br2 saved in trap *x/ */
-/* OBSOLETE #define PS_REGNUM  17      /* Contains processor status *x/ */
-/* OBSOLETE #define PC_REGNUM  18      /* Contains program counter *x/ */
+/* OBSOLETE #define R1_REGNUM   1       /* Gr1 => return address of caller *x/ */
+/* OBSOLETE #define R4_REGNUM   4       /* Gr4 => register save area *x/ */
+/* OBSOLETE #define R5_REGNUM   5       /* Gr5 => register save area *x/ */
+/* OBSOLETE #define R6_REGNUM   6       /* Gr6 => register save area *x/ */
+/* OBSOLETE #define R7_REGNUM   7       /* Gr7 => register save area *x/ */
+/* OBSOLETE #define B1_REGNUM   9       /* Br1 => start of this code routine *x/ */
+/* OBSOLETE #define FP_REGNUM   10      /* Br2 == (sp) *x/ */
+/* OBSOLETE #define AP_REGNUM   11      /* Br3 == (ap) *x/ */
+/* OBSOLETE #define SP_REGNUM   16      /* A copy of Br2 saved in trap *x/ */
+/* OBSOLETE #define PS_REGNUM   17      /* Contains processor status *x/ */
+/* OBSOLETE #define PC_REGNUM   18      /* Contains program counter *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
 /* OBSOLETE    register state, the array `registers'.  *x/ */
-/* OBSOLETE #define REGISTER_BYTES                     (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */
+/* OBSOLETE #define REGISTER_BYTES                      (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Index within `registers' of the first byte of the space for */
 /* OBSOLETE    register N.  *x/ */
-/* OBSOLETE #define REGISTER_BYTE(N)           ((N) * 4) */
+/* OBSOLETE #define REGISTER_BYTE(N)            ((N) * 4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of bytes of storage in the actual machine representation */
 /* OBSOLETE    for register N.  On the PN, all normal regs are 4 bytes. *x/ */
-/* OBSOLETE #define REGISTER_RAW_SIZE(N)               (4) */
+/* OBSOLETE #define REGISTER_RAW_SIZE(N)                (4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Number of bytes of storage in the program's representation */
 /* OBSOLETE    for register N.  On the PN, all regs are 4 bytes. *x/ */
-/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N)   (4) */
+/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N)    (4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have.  *x/ */
-/* OBSOLETE #define MAX_REGISTER_RAW_SIZE              (4) */
+/* OBSOLETE #define MAX_REGISTER_RAW_SIZE               (4) */
 /* OBSOLETE  */
 /* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have.  *x/ */
-/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE  (4) */
+/* 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.  *x/ */
-/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N)   (builtin_type_int) */
+/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N)    (builtin_type_int) */
 /* 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    into VALBUF. *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
-/* OBSOLETE    memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
+/* OBSOLETE     memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Write into appropriate registers a function return value */
 /* OBSOLETE    of type TYPE, given in virtual format.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
-/* OBSOLETE    write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) */
+/* OBSOLETE     write_register_bytes (0, VALBUF, 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 /* In the case of the NPL, the frame's norminal address is Br2 and the  */
 /* OBSOLETE    previous routines frame is up the stack X bytes, where X is the */
 /* OBSOLETE    value stored in the code function header xA(Br1). *x/ */
-/* OBSOLETE #define FRAME_CHAIN(thisframe)             (findframe(thisframe)) */
+/* OBSOLETE #define FRAME_CHAIN(thisframe)              (findframe(thisframe)) */
 /* OBSOLETE  */
 /* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */
 /* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */
 /* OBSOLETE  */
 /* OBSOLETE /* Define other aspects of the stack frame on NPL.  *x/ */
 /* OBSOLETE #define FRAME_SAVED_PC(frame) \ */
-/* OBSOLETE    (read_memory_integer ((frame)->frame + 8, 4)) */
+/* OBSOLETE     (read_memory_integer ((frame)->frame + 8, 4)) */
 /* OBSOLETE  */
 /* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */
-/* OBSOLETE    ((fi)->next ? \ */
-/* OBSOLETE     read_memory_integer ((fi)->frame + 12, 4) : \ */
-/* OBSOLETE     read_register (AP_REGNUM)) */
+/* OBSOLETE     ((fi)->next ? \ */
+/* OBSOLETE      read_memory_integer ((fi)->frame + 12, 4) : \ */
+/* OBSOLETE      read_register (AP_REGNUM)) */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)   ((fi)->frame + 80) */
+/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi)    ((fi)->frame + 80) */
 /* 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.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* We can check the stab info to see how */
 /* OBSOLETE    many arg we have.  No info in stack will tell us *x/ */
-/* OBSOLETE #define FRAME_NUM_ARGS(fi)         (findarg(fi)) */
+/* OBSOLETE #define FRAME_NUM_ARGS(fi)          (findarg(fi)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Return number of bytes at start of arglist that are not really args.  *x/ */
-/* OBSOLETE #define FRAME_ARGS_SKIP                    8 */
+/* OBSOLETE #define FRAME_ARGS_SKIP                     8 */
 /* 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    ways in the stack frame.  sp is even more special: */
 /* OBSOLETE    the address we return for it IS the sp for the next frame.  *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)                \ */
+/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)         \ */
 /* OBSOLETE {                                                                       \ */
-/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                       \ */
-/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8;            \ */
-/* OBSOLETE   (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
-/* OBSOLETE   (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
+/* OBSOLETE   memset (&frame_saved_regs, '\0', sizeof frame_saved_regs);                        \ */
+/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8;             \ */
+/* OBSOLETE   (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38;  \ */
+/* OBSOLETE   (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C;  \ */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /* Things needed for making the inferior call functions.  *x/ */
 /* OBSOLETE /* Push an empty stack frame, to record the current PC, etc.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define PUSH_DUMMY_FRAME \ */
-/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);                       \ */
-/* OBSOLETE   register int regnum;                                                     \ */
-/* OBSOLETE   sp = push_word (sp, read_register (PC_REGNUM));                  \ */
-/* OBSOLETE   sp = push_word (sp, read_register (FP_REGNUM));                  \ */
-/* OBSOLETE   write_register (FP_REGNUM, sp);                                  \ */
-/* OBSOLETE   for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)                      \ */
-/* OBSOLETE     sp = push_word (sp, read_register (regnum));                   \ */
-/* OBSOLETE   sp = push_word (sp, read_register (PS_REGNUM));                  \ */
+/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);                        \ */
+/* OBSOLETE   register int regnum;                                                      \ */
+/* OBSOLETE   sp = push_word (sp, read_register (PC_REGNUM));                   \ */
+/* OBSOLETE   sp = push_word (sp, read_register (FP_REGNUM));                   \ */
+/* OBSOLETE   write_register (FP_REGNUM, sp);                                   \ */
+/* OBSOLETE   for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)                       \ */
+/* OBSOLETE     sp = push_word (sp, read_register (regnum));                    \ */
+/* OBSOLETE   sp = push_word (sp, read_register (PS_REGNUM));                   \ */
 /* OBSOLETE   write_register (SP_REGNUM, sp);  } */
 /* OBSOLETE  */
 /* OBSOLETE /* Discard from the stack the innermost frame,  */
 /* OBSOLETE    restoring all saved registers.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define POP_FRAME  \ */
-/* OBSOLETE { register struct frame_info *frame = get_current_frame ();         \ */
-/* OBSOLETE   register CORE_ADDR fp;                                    \ */
-/* OBSOLETE   register int regnum;                                              \ */
-/* OBSOLETE   struct frame_saved_regs fsr;                                      \ */
-/* OBSOLETE   struct frame_info *fi;                                    \ */
-/* OBSOLETE   fp = frame->frame;                                                \ */
-/* OBSOLETE   get_frame_saved_regs (frame, &fsr);                               \ */
-/* OBSOLETE   for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)               \ */
-/* OBSOLETE     if (fsr.regs[regnum])                                   \ */
+/* OBSOLETE { register struct frame_info *frame = get_current_frame ();  \ */
+/* OBSOLETE   register CORE_ADDR fp;                                     \ */
+/* OBSOLETE   register int regnum;                                               \ */
+/* OBSOLETE   struct frame_saved_regs fsr;                                       \ */
+/* OBSOLETE   struct frame_info *fi;                                     \ */
+/* OBSOLETE   fp = frame->frame;                                                 \ */
+/* OBSOLETE   get_frame_saved_regs (frame, &fsr);                                \ */
+/* OBSOLETE   for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)                \ */
+/* OBSOLETE     if (fsr.regs[regnum])                                    \ */
 /* OBSOLETE       write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ */
-/* OBSOLETE   if (fsr.regs[PS_REGNUM])                                  \ */
+/* OBSOLETE   if (fsr.regs[PS_REGNUM])                                   \ */
 /* OBSOLETE     write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \ */
-/* OBSOLETE   write_register (FP_REGNUM, read_memory_integer (fp, 4));  \ */
+/* 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   write_register (SP_REGNUM, fp + 8);                                \ */
+/* OBSOLETE   flush_cached_frames ();                                    \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* This sequence of words is the instructions: */
 /* OBSOLETE      halt */
 /* OBSOLETE      halt */
 /* OBSOLETE      halt */
-/* OBSOLETE      suabr b2, #<stacksize> */
-/* OBSOLETE      lwbr  b6, #con */
-/* OBSOLETE      stw   r1, 8(b2)       - save caller address, do we care? */
-/* OBSOLETE      lw            r2, 60(b2)      - arg1 */
-/* OBSOLETE      labr  b3, 50(b2) */
-/* OBSOLETE      std   r4, 30(b2)      - save r4-r7 */
-/* OBSOLETE      std   r6, 38(b2) */
-/* OBSOLETE      lwbr  b1, #<func>     - load function call address */
-/* OBSOLETE      brlnk r1, 8(b1)       - call function */
+/* OBSOLETE      suabr  b2, #<stacksize> */
+/* OBSOLETE      lwbr   b6, #con */
+/* OBSOLETE      stw    r1, 8(b2)       - save caller address, do we care? */
+/* OBSOLETE      lw             r2, 60(b2)      - arg1 */
+/* OBSOLETE      labr   b3, 50(b2) */
+/* OBSOLETE      std    r4, 30(b2)      - save r4-r7 */
+/* OBSOLETE      std    r6, 38(b2) */
+/* OBSOLETE      lwbr   b1, #<func>     - load function call address */
+/* OBSOLETE      brlnk  r1, 8(b1)       - call function */
 /* OBSOLETE      halt */
 /* OBSOLETE      halt */
-/* OBSOLETE      ld            r4, 30(b2)      - restore r4-r7 */
-/* OBSOLETE      ld            r6, 38(b2) */
+/* OBSOLETE      ld             r4, 30(b2)      - restore r4-r7 */
+/* OBSOLETE      ld             r6, 38(b2) */
 /* OBSOLETE  */
 /* OBSOLETE    Setup our stack frame, load argumemts, call and then restore registers. */
 /* OBSOLETE *x/ */
index 63bc4501d9f736158e5e0a23370449b1d39d2f90..b7af92c8b1e8fb40c4bb6303bd2d1a2b63810b89 100644 (file)
 /* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
 /* OBSOLETE  */
 /* OBSOLETE /* Address of U in kernel space *x/ */
-/* OBSOLETE #define    KERNEL_U_ADDR           0x7fffc000 */
+/* OBSOLETE #define     KERNEL_U_ADDR           0x7fffc000 */
 /* OBSOLETE  */
 /* OBSOLETE /* This is a piece of magic that is given a register number REGNO */
 /* OBSOLETE    and as BLOCKEND the address in the system of the end of the user structure */
 /* OBSOLETE    and stores in ADDR the address in the kernel or core dump */
 /* OBSOLETE    of that register. *x/ */
-/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) {                   \ */
-/* OBSOLETE    addr = blockend + regno * 4;                                    \ */
-/* OBSOLETE    if (regno == VE_REGNUM) addr = blockend - 9 * 4;                \ */
-/* OBSOLETE    if (regno == PC_REGNUM) addr = blockend - 8 * 4;                \ */
-/* OBSOLETE    if (regno == PS_REGNUM) addr = blockend - 7 * 4;                \ */
-/* OBSOLETE    if (regno == FP_REGNUM) addr = blockend - 6 * 4;                \ */
-/* OBSOLETE    if (regno >= V1_REGNUM)                                         \ */
-/* OBSOLETE        addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE;   \ */
+/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) {                    \ */
+/* OBSOLETE     addr = blockend + regno * 4;                                    \ */
+/* OBSOLETE     if (regno == VE_REGNUM) addr = blockend - 9 * 4;                \ */
+/* OBSOLETE     if (regno == PC_REGNUM) addr = blockend - 8 * 4;                \ */
+/* OBSOLETE     if (regno == PS_REGNUM) addr = blockend - 7 * 4;                \ */
+/* OBSOLETE     if (regno == FP_REGNUM) addr = blockend - 6 * 4;                \ */
+/* OBSOLETE     if (regno >= V1_REGNUM)                                         \ */
+/* OBSOLETE         addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE;   \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Don't try to write the frame pointer.  *x/ */
@@ -80,8 +80,8 @@
 /* OBSOLETE    The fault code will be on the stack beyond the last register.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define PUSH_REGISTERS        \ */
-/* OBSOLETE { asm ("clrw -(sp)");            \ */
-/* OBSOLETE   asm ("pea 10(sp)");            \ */
+/* OBSOLETE { asm ("clrw -(sp)");             \ */
+/* OBSOLETE   asm ("pea 10(sp)");             \ */
 /* OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); } */
 /* OBSOLETE  */
 /* OBSOLETE /* Assuming the registers (including processor status) have been */
index 2540cfc1203028c4638abbabe042c8993a4cd0e7..a59588b79589cdc901dca85003f5ccd303a0bf4c 100644 (file)
 /* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
 /* OBSOLETE  */
 /* OBSOLETE /* Address of U in kernel space *x/ */
-/* OBSOLETE #define    KERNEL_U_ADDR           0x3fc000 */
+/* OBSOLETE #define     KERNEL_U_ADDR           0x3fc000 */
 /* OBSOLETE  */
 /* OBSOLETE /* This is a piece of magic that is given a register number REGNO */
 /* OBSOLETE    and as BLOCKEND the address in the system of the end of the user structure */
 /* OBSOLETE    and stores in ADDR the address in the kernel or core dump */
 /* OBSOLETE    of that register. *x/ */
-/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) {                   \ */
-/* OBSOLETE    addr = blockend + regno * 4;                                    \ */
-/* OBSOLETE    if (regno == PC_REGNUM) addr = blockend - 8 * 4;                \ */
-/* OBSOLETE    if (regno == PS_REGNUM) addr = blockend - 7 * 4;                \ */
-/* OBSOLETE    if (regno == SP_REGNUM) addr = blockend - 6 * 4;                \ */
+/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) {                    \ */
+/* OBSOLETE     addr = blockend + regno * 4;                                    \ */
+/* OBSOLETE     if (regno == PC_REGNUM) addr = blockend - 8 * 4;                \ */
+/* OBSOLETE     if (regno == PS_REGNUM) addr = blockend - 7 * 4;                \ */
+/* OBSOLETE     if (regno == SP_REGNUM) addr = blockend - 6 * 4;                \ */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /* No KDB support, Yet! *x/ */
@@ -73,8 +73,8 @@
 /* OBSOLETE    The fault code will be on the stack beyond the last register.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define PUSH_REGISTERS        \ */
-/* OBSOLETE { asm ("clrw -(sp)");            \ */
-/* OBSOLETE   asm ("pea 10(sp)");            \ */
+/* OBSOLETE { asm ("clrw -(sp)");             \ */
+/* OBSOLETE   asm ("pea 10(sp)");             \ */
 /* OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); } */
 /* OBSOLETE  */
 /* OBSOLETE /* Assuming the registers (including processor status) have been */
index b402181905da5919e011e064b3d84480f6ca7d3d..5ca6f8745dfcdcbf646eae819d4beb075eb37780 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a H8/300 series machine.
    Copyright 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Contributed by Steve Chamberlain sac@cygnus.com */
 
@@ -84,9 +85,9 @@ extern CORE_ADDR h8300_skip_prologue ();
 
 #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
 
-/*#define BREAKPOINT {0x7A, 0xFF}*/
-#define BREAKPOINT {0x01, 0x80}  /* Sleep */
-#define REMOTE_BREAKPOINT { 0x57, 0x30}  /* trapa #3 */
+/*#define BREAKPOINT {0x7A, 0xFF} */
+#define BREAKPOINT {0x01, 0x80}        /* Sleep */
+#define REMOTE_BREAKPOINT { 0x57, 0x30}                /* trapa #3 */
 /* If your kernel resets the pc after the trap happens you may need to
    define this before including this file.    */
 
@@ -96,7 +97,7 @@ extern CORE_ADDR h8300_skip_prologue ();
 
 #define REGISTER_SIZE 4
 
-#define NUM_REGS 13  
+#define NUM_REGS 13
 
 #define REGISTER_BYTES (NUM_REGS * 4)
 
@@ -160,7 +161,7 @@ extern char **h8300_register_names;
 
 /* FIXME: Won't work with both h8/300's.  */
 
-extern void h8300_extract_return_value PARAMS((struct type *, char *, char *));
+extern void h8300_extract_return_value PARAMS ((struct type *, char *, char *));
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
     h8300_extract_return_value (TYPE, (char *)(REGBUF), (char *)(VALBUF))
 
@@ -169,7 +170,7 @@ extern void h8300_extract_return_value PARAMS((struct type *, char *, char *));
    in d0/d1.  */
 /* FIXME: Won't work with both h8/300's.  */
 
-extern void h8300_store_return_value PARAMS((struct type *, char *));
+extern void h8300_store_return_value PARAMS ((struct type *, char *));
 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
     h8300_store_return_value(TYPE, (char *) (VALBUF))
 
@@ -186,7 +187,7 @@ extern void h8300_store_return_value PARAMS((struct type *, char *));
 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
      extract_address (REGBUF + REGISTER_BYTE (0), \
                      REGISTER_RAW_SIZE (0))
-     
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -225,7 +226,7 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
    SAVED FP   <-FP POINTS HERE
    LOCALS0
    LOCALS1    <-SP POINTS HERE
  */
+ */
 
 #define FRAME_SAVED_PC(FRAME) h8300_frame_saved_pc(FRAME)
 
@@ -263,7 +264,7 @@ typedef unsigned short INSN_WORD;
 #define GDB_TARGET_IS_H8300
 
 #define NUM_REALREGS 10
-#define NOP { 0x01, 0x80} /* A sleep insn */
+#define NOP { 0x01, 0x80}      /* A sleep insn */
 
 #define BELIEVE_PCC_PROMOTION 1
 
@@ -279,8 +280,8 @@ typedef unsigned short INSN_WORD;
 #define CALL_DUMMY_START_OFFSET                (0)
 #define CALL_DUMMY_BREAKPOINT_OFFSET   (0)
 
-extern CORE_ADDR h8300_push_arguments PARAMS ((int nargs, 
-                                              struct value **args, 
+extern CORE_ADDR h8300_push_arguments PARAMS ((int nargs,
+                                              struct value ** args,
                                               CORE_ADDR sp,
                                               unsigned char struct_return,
                                               CORE_ADDR struct_addr));
@@ -300,6 +301,3 @@ extern CORE_ADDR h8300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
    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)
-
-
-
index 46ce2c3be9e7f5f0c24ab0aa4e6bd91d1ff3bc61..eb21a5c6fb1777a24659096348b3d20cfa98ea85 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a H8/500 series machine.
    Copyright (C) 1993, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Contributed by Steve Chamberlain sac@cygnus.com */
 
@@ -74,7 +75,7 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((void));
 
 /* Say how much memory is needed to store a copy of the register set */
 
-#define REGISTER_BYTES    (NUM_REGS * 4) 
+#define REGISTER_BYTES    (NUM_REGS * 4)
 
 /* Index within `registers' of the first byte of the space for
    register N.  */
@@ -148,8 +149,8 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
 
 #define NUM_REGS       22
 
-#define SP_REGNUM       PR7_REGNUM /* Contains address of top of stack */
-#define FP_REGNUM       PR6_REGNUM /* Contains address of executing stack frame */
+#define SP_REGNUM       PR7_REGNUM     /* Contains address of top of stack */
+#define FP_REGNUM       PR6_REGNUM     /* Contains address of executing stack frame */
 
 #define PTR_SIZE (minimum_mode ? 2 : 4)
 #define PTR_MASK (minimum_mode ? 0x0000ffff : 0x00ffffff)
@@ -158,7 +159,7 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
    subroutine will return.  This is called from call_function. */
 
 /*#define STORE_STRUCT_RETURN(ADDR, SP) \
-  { write_register (0, (ADDR)); abort(); }*/
+   { write_register (0, (ADDR)); abort(); } */
 
 /* Extract from an array REGBUF containing the (raw) register state
    a function return value of type TYPE, and copy that, in virtual format,
@@ -178,8 +179,8 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
    as a CORE_ADDR (or an expression that can be used as one).  */
 
 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
-
 \f
+
 /* Define other aspects of the stack frame.  */
 
 /* A macro that tells us whether the function invocation represented
@@ -198,18 +199,18 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
    SAVED FP   <-FP POINTS HERE
    LOCALS0
    LOCALS1    <-SP POINTS HERE
-   
  */
+
+ */
 
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fci)  ;
-/*       (fci)->frame |= read_register(SEG_T_REGNUM) << 16;*/
+/*       (fci)->frame |= read_register(SEG_T_REGNUM) << 16; */
 
 #define FRAME_CHAIN(FRAME) h8500_frame_chain(FRAME)
 struct frame_info;
 extern CORE_ADDR h8500_frame_chain PARAMS ((struct frame_info *));
 
 #define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
-extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *frame));
+extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame));
 
 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
 
@@ -236,7 +237,7 @@ extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *frame));
 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)        \
    frame_find_saved_regs(frame_info, &(frame_saved_regs))
 struct frame_saved_regs;
-extern void frame_find_saved_regs PARAMS ((struct frame_info *frame_info, struct frame_saved_regs *frame_saved_regs));
+extern void frame_find_saved_regs PARAMS ((struct frame_info * frame_info, struct frame_saved_regs * frame_saved_regs));
 \f
 
 /* Discard from the stack the innermost frame, restoring all registers.  */
@@ -267,10 +268,10 @@ extern int minimum_mode;
 extern int h8500_is_trapped_internalvar PARAMS ((char *name));
 
 #define VALUE_OF_TRAPPED_INTERNALVAR h8500_value_of_trapped_internalvar
-extern struct value * h8500_value_of_trapped_internalvar (/* struct internalvar *var */);
+extern struct value *h8500_value_of_trapped_internalvar ( /* struct internalvar *var */ );
 
 #define SET_TRAPPED_INTERNALVAR h8500_set_trapped_internalvar
-extern void h8500_set_trapped_internalvar (/* struct internalvar *var, value newval, int bitpos, int bitsize, int offset */);
+extern void h8500_set_trapped_internalvar ( /* struct internalvar *var, value newval, int bitpos, int bitsize, int offset */ );
 
 extern CORE_ADDR h8500_read_sp PARAMS ((void));
 extern void h8500_write_sp PARAMS ((CORE_ADDR));
index 727623c0a4099303af68e2bb59db6998c522b7ff..a2d1e3d1da4026ddfdb91adf95ef2a06973d7b20 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
    Copyright 1986, 1987, 1989, 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.  */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_FREEBSD_H
 #define NM_FREEBSD_H
index 95f25a52e3d592aea50c7f847fee1f45d65e6f9f..86dc51a6de84220e2ff581692fbcce1e24bc8517 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running the GNU Hurd
    Copyright 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Include the generic hurd definitions.  */
 
index 183b60fa18145dc4291f2457834adc6813f855a6..ba79c1b0ea98f4622cc257523b0c3248e96c31ae 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for Intel x86 running DJGPP.
    Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define NO_PTRACE_H
 
@@ -44,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define target_insert_hw_breakpoint(addr, shadow)  \
   go32_insert_hw_breakpoint(addr, shadow)
-  
+
 #define target_remove_hw_breakpoint(addr, shadow)  \
   go32_remove_hw_breakpoint(addr, shadow)
 
@@ -54,4 +55,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define FLOAT_INFO { i386_go32_float_info (); }
 
 extern void i386_go32_float_info (void);
-
index 42403939637fd9ffc4278f1dd7bdc4eb5d140115..4a6ffc1acfa90d517f095e2fe3d1b256256656e1 100644 (file)
@@ -1,25 +1,26 @@
 /* Native support for i386 aix ps/2.
    Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
- * Revision:    5-May-93 00:11:35
+ * Revision:     5-May-93 00:11:35
  */
 
 #ifndef NM_I386AIX_H
index 7366f2d17bff0c25b20e02966795ece7dbe1911e..41a414c76ba667466bb7534239c8a815217a2d76 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_I386BSD_H
 #define NM_I386BSD_H
@@ -26,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <machine/vmparam.h>
 #define KERNEL_U_ADDR USRSTACK
 
-#undef FLOAT_INFO      /* No float info yet */
+#undef FLOAT_INFO              /* No float info yet */
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
        (addr) = i386_register_u_addr ((blockend),(regno));
index e29821f29ddff425dd72d8a93b09cce4d51987d3..5d0d41de2670f96509af10a6633202cc1d3076d0 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_I386LYNX_H
 #define NM_I386LYNX_H
index f01d2b142b176b106553c94fb0631b596ef04d68..be1152ed20bf0bc3f6db8509ec5d8c163ff5cce0 100644 (file)
@@ -1,24 +1,25 @@
 /* Native definitions for Mach on an Intel 386
    Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Do implement the attach and detach commands.  */
-/* #define ATTACH_DETACH       1 */
+/* #define ATTACH_DETACH        1 */
 
 /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
 #define FETCH_INFERIOR_REGISTERS
index 33ab6de4060558473c8a298ecfbdc9c725050d83..5b56ad6e21b3c057d8a798a50d9f8d51c28b713e 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
    Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if 0
 /* code to execute to print interesting information about the
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    do this unless we *know* we aren't cross-debugging.  FIXME.
  */
 #define FLOAT_INFO { i386_float_info (); }
-#endif /*0*/
+#endif /*0 */
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
        (addr) = i386_register_u_addr ((blockend),(regno));
index 41daef5b9268ef68ca5d41f806053dc78f2999e7..6947f3febb1fee0eb78d016bfffe264a864ce3bf 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Cygnus Support.  By Ian Lance Taylor
    <ian@cygnus.com> based on work by Martin Walker <maw@netcom.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 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.  */
 
 /* SCO 3.2v4 is actually just like SCO 3.2v2, except that it
    additionally supports attaching to a process.  */
index 155336cb13c910d634560195b923c212a2accc21..db2880c01ba3a9f55cc1ac30b0f84d8abbbd72ea 100644 (file)
@@ -5,28 +5,29 @@
    work by Ian Lance Taylor <ian@cygnus.com> and 
    Martin Walker <maw@netcom.com>.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Basically, its a lot like the older versions ... */
 #include "i386/nm-i386sco.h"
 
 /* ... 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
 
@@ -35,5 +36,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define PTRACE_ATTACH 10
 #define PTRACE_DETACH 11
-
-
index 2ae966ca52a004b7970fc11ad7bd1add41fa098c..68d61fcbbd780b5bfaa8c146eba23b9b4de9c7c4 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for i386 running Solaris 2.
    Copyright 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "nm-sysv4.h"
 
@@ -27,7 +28,7 @@ struct objfile;
 
 #define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
 
-void sol_thread_new_objfile PARAMS ((struct objfile *objfile));
+void sol_thread_new_objfile PARAMS ((struct objfile * objfile));
 
 #define FIND_NEW_THREADS sol_find_new_threads
 void sol_find_new_threads PARAMS ((void));
index 8e6877e7a447c67beef77bbf6eedc756a3efe1f6..76b526b50150d282b273cc4787f845e2f9fe4f68 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
    Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if 0
 /* code to execute to print interesting information about the
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    do this unless we *know* we aren't cross-debugging.  FIXME.
  */
 #define FLOAT_INFO { i386_float_info (); }
-#endif /*0*/
+#endif /*0 */
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
        (addr) = i386_register_u_addr ((blockend),(regno));
index 8722a40b131e7d0b1cc7fc5ce5dce53bd78d1c7c..9d9aed6ad24c58ce5249e27b4214a3fc40e1c6db 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
    Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "nm-sysv4.h"
 
index 6ffd128d4b7fb280071a7faf3196a1cdaaf1168c..7f4161e9a27e9278ade06f01e482f0614bbbafbc 100644 (file)
@@ -2,21 +2,21 @@
    Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
    Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "nm-sysv4.h"
-
index ad0b8db716c39a591b1463f197f03a1fceb69361..d3238386b69697b0468fe81926175adcd5384128 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1992, 1996, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_LINUX_H
 #define NM_LINUX_H
@@ -64,7 +65,7 @@ extern int kernel_u_size PARAMS ((void));
 #endif
 
 extern CORE_ADDR
-i386_stopped_by_watchpoint PARAMS ((int));
+  i386_stopped_by_watchpoint PARAMS ((int));
 extern int
 i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw));
 extern int
index 51270917422d6ff9822042bec3c49ce793a20874..00128cf9ce8b3092b54b9d81b19737100b647b1a 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running Mach 3.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Include the generic Mach 3 definitions.  */
 
index b59fec682142ac42b7a481b657e266e94c911b93..ca9e3cccedc7b24fa7255b665f444a6ee6d80298 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
    Copyright 1986, 1987, 1989, 1992, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_NBSD_H
 #define NM_NBSD_H
@@ -23,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Get generic NetBSD native definitions. */
 #include "nm-nbsd.h"
 
-/* #define FLOAT_INFO  { i386_float_info(); } */
+/* #define FLOAT_INFO   { i386_float_info(); } */
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
        (addr) = i386_register_u_addr ((blockend),(regno));
index 5e6cd569f8cfa3acf820b55353a504cfffcd4a9a..289ffe067528686b32588193c0df7116927adde8 100644 (file)
@@ -2,21 +2,22 @@
    with Weitek 1167 and i387 support.
    Copyright 1986, 1987, 1989, 1992  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "nm-sysv4.h"
 
@@ -49,7 +50,7 @@ extern int child_wait PARAMS ((int, struct target_waitstatus *));
  * enable attach/detach.  If you turn it on anyway, it will mostly
  * work, but has a number of bugs. -fubar, 2/94.
  */
-/*#define ATTACH_DETACH 1*/
+/*#define ATTACH_DETACH 1 */
 #undef ATTACH_DETACH
 #define PTRACE_ATTACH XPT_DEBUG
 #define PTRACE_DETACH XPT_UNDEBUG
index f7a904b4f1a3df2b8af86a30a99c7b31f4d76b47..0418e487b53cd3dea64167d6483d7f4741eabe20 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for Sun 386i, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
index 80cf09779df38ba3b6dc1523f429b3625f5714b7..781adf2aedd2a9bd4df0e62d850068f1ad4979be 100644 (file)
@@ -2,21 +2,22 @@
    with Weitek 1167 and i387 support.
    Copyright 1986, 1987, 1989, 1992  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
 
@@ -40,7 +41,7 @@ extern int child_wait PARAMS ((int, struct target_waitstatus *));
 #include <sys/mc_vmparam.h>
 /* VA_UAREA is defined in <sys/mc_vmparam.h>, and is dependant upon 
    sizeof(struct user) */
-#define KERNEL_U_ADDR (VA_UAREA) /* ptx */
+#define KERNEL_U_ADDR (VA_UAREA)       /* ptx */
 #else
 #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))   /* dynix */
 #endif
index acca6b96cbb52f262c1a2aa4fa6497c9fd4bae86..309e1ff8df9b295946c97df3811f13255128bc59 100644 (file)
@@ -15,7 +15,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "i386/tm-i386v.h"
index 419993db2fe07b02cb5c995ca9b7246bbfad1541..0e2df32c52bdaf18cc9f43b539b6c77cebb302d2 100644 (file)
@@ -1,21 +1,22 @@
 /* Target macro definitions for i386 running FreeBSD
    Copyright (C) 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 "i386/tm-i386bsd.h"
 
index 3387ac23cc00b9f6aea30e7621aae8af5da75d03..579355252aec3ef00b73a13829cb0ef18933a328 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent definitions for Intel x86 running DJGPP.
    Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 "i386/tm-i386v.h"
 
index 11a7a2023d21e40051c7abe28d272fe0153a47c0..ee9017b6963cc8b094d34a03e916cc37916365fa 100644 (file)
@@ -1,26 +1,27 @@
 /* Macro definitions for GDB on an Intel i[345]86.
    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386_H
 #define TM_I386_H 1
 
-#ifdef __STDC__                /* Forward decl's for prototypes */
+#ifdef __STDC__                        /* Forward decl's for prototypes */
 struct frame_info;
 struct frame_saved_regs;
 struct type;
@@ -78,7 +79,7 @@ extern int i386_skip_prologue PARAMS ((int));
 
 /* Number of machine registers */
 
-#define NUM_FREGS 0 /*8*/              /* Number of FP regs */
+#define NUM_FREGS 0 /*8*/      /* Number of FP regs */
 #define NUM_REGS (16 + NUM_FREGS)      /* Basic i*86 regs + FP regs */
 
 /* Initializer for an array of names of registers.  There should be at least
@@ -102,13 +103,13 @@ extern int i386_skip_prologue PARAMS ((int));
    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 */
+#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 */
 
-#define FP0_REGNUM 16   /* (st0) 387 register */
-#define FPC_REGNUM 25  /* 80387 control register */
+#define FP0_REGNUM 16          /* (st0) 387 register */
+#define FPC_REGNUM 25          /* 80387 control register */
 
 /* Total amount of space needed to store our copies of the machine's register
    state, the array `registers'. */
@@ -119,7 +120,7 @@ extern int i386_skip_prologue PARAMS ((int));
 
 #define REGISTER_BYTE(N) \
   (((N) < FP0_REGNUM) ? ((N) * 4) : ((((N) - FP0_REGNUM) * 10) + 64))
+
 /* 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. */
@@ -166,7 +167,7 @@ extern int i386_skip_prologue PARAMS ((int));
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
    i386_extract_return_value ((TYPE),(REGBUF),(VALBUF))
 
-extern void i386_extract_return_value PARAMS ((struct type *, char [], char *));
+extern void i386_extract_return_value PARAMS ((struct type *, char[], char *));
 
 /* Write into appropriate registers a function return value of type TYPE, given
    in virtual format.  */
@@ -246,8 +247,8 @@ extern int i386_frame_num_args PARAMS ((struct frame_info *));
 
 extern void i386_frame_find_saved_regs PARAMS ((struct frame_info *,
                                                struct frame_saved_regs *));
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 /* Push an empty stack frame, to record the current PC, etc.  */
@@ -261,8 +262,8 @@ extern void i386_push_dummy_frame PARAMS ((void));
 #define POP_FRAME  { i386_pop_frame (); }
 
 extern void i386_pop_frame PARAMS ((void));
-
 \f
+
 /* this is 
  *   call 11223344 (32 bit relative)
  *   int3
@@ -272,7 +273,7 @@ extern void i386_pop_frame PARAMS ((void));
 
 #define CALL_DUMMY_LENGTH 8
 
-#define CALL_DUMMY_START_OFFSET 0  /* Start execution at beginning of dummy */
+#define CALL_DUMMY_START_OFFSET 0      /* Start execution at beginning of dummy */
 
 #define CALL_DUMMY_BREAKPOINT_OFFSET 5
 
index b0121fa92df3ddfc002c367aada68c81912d744c..c309bdc2819a559a1c47e6777f1c77a9cf5a649a 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro defintions for IBM AIX PS/2 (i386).
    Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com).  */
 
@@ -26,10 +27,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/reg.h>
 
 #ifndef I386
-# define I386 1
+#define I386 1
 #endif
 #ifndef I386_AIX_TARGET
-# define I386_AIX_TARGET 1
+#define I386_AIX_TARGET 1
 #endif
 
 /* Nonzero if register N requires conversion
index 8b8c3a9708a45e050a753b1a957996f3d6c425ff..967311bca9a8dce3916b6aa9797de330ee2f0019 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386 running under BSD Unix.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386BSD_H
 #define TM_I386BSD_H 1
@@ -40,4 +41,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Offset to saved PC in sigcontext, from <sys/signal.h>.  */
 #define SIGCONTEXT_PC_OFFSET 20
 
-#endif  /* ifndef TM_I386BSD_H */
+#endif /* ifndef TM_I386BSD_H */
index 3dc15a37aec05efa51203bb9ee7451c19085cdd8..aa34094f4338cc96c6997e69d68867f2df8aabf3 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386, GNU Hurd
    Copyright (C) 1992, 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.  */
+   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
index 9e732b32e6b7506bbc2495f1a82f6ef8cec3d56b..10f37e7b7193dfdfa92f2608545e829e413a1155 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Intel 386 running under LynxOS.
    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 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_I386LYNX_H
 #define TM_I386LYNX_H
index 523dabbf9471fdc505e259052b3bdab3200033fa..a75cec36b5b41ec8c265a8192208466c2e5f6686 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386, Mach 3.0
    Copyright (C) 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.  */
+   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"
index 3625efbf6df62fd700ab525d5414ce6fe008efdb..cb18e3c1875ddd85e84aed268de1ebc350a2b575 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386, Mach 3.0, OSF 1/MK
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Until OSF switches to a newer Mach kernel that has
  * a different get_emul_vector() interface.
index e5cdadecb4764025204dda96033e7a3453895df7..1000b77c2fd04f31cd7a3b4f123d03b09b147151 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386 running NetWare.
    Copyright 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386NW_H
 #define TM_I386NW_H 1
@@ -45,5 +46,4 @@ get_longjmp_target PARAMS ((CORE_ADDR *));
 
 #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
 
-#endif  /* ifndef TM_I386NW_H */
-
+#endif /* ifndef TM_I386NW_H */
index 2b486419659daa402ae6e826a922950a413ea955..0890c2cd2c8c0085bcf9f1301a160d9e89c107c4 100644 (file)
@@ -2,19 +2,20 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386OS9K_H
 #define TM_I386OS9K_H 1
@@ -24,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Number of machine registers */
 
 #undef  NUM_REGS
-#define NUM_REGS (16)  /* Basic i*86 regs */
+#define NUM_REGS (16)          /* Basic i*86 regs */
 
 /* Initializer for an array of names of registers.  There should be at least
    NUM_REGS strings in this initializer.  Any excess ones are simply ignored.
@@ -39,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
                          "ds", "es", "fs", "gs", \
                          }
 
-#define DATABASE_REG   3               /* ebx */
+#define DATABASE_REG   3       /* ebx */
 
 /* Amount PC must be decremented by after a breakpoint.  This is often the
    number of bytes in BREAKPOINT but not always (such as now). */
@@ -60,4 +61,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define BELIEVE_PCC_PROMOTION 1
 
-#endif /* #ifndef TM_I386OS9K_H */
+#endif /* #ifndef TM_I386OS9K_H */
index ffac5b3b5611afa36aa5dedc32a1aeda3b64721d..ebad936a1074ccf9e39855ebf6dd44726464b865 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1998 Free Software Foundation, Inc.
    Written by J. Kean Johnston (jkj@sco.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386SCO5_H
 #define TM_I386SCO5_H 1
@@ -59,4 +60,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define target_remove_watchpoint(addr, len, type)  \
   i386_remove_watchpoint (inferior_pid, addr, len)
 
-#endif  /* ifndef TM_I386SCO5_H */
+#endif /* ifndef TM_I386SCO5_H */
index dbd6317b65b5809b7a6fbc9b47056773619f74c8..6fcfceff55d505bf8c536f7dacc56f424d688a6a 100644 (file)
@@ -1,27 +1,28 @@
 /* Macro definitions for GDB on an Intel i386 running Solaris 2.
    Copyright (C) 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386SOL2_H
 #define TM_I386SOL2_H 1
 
 #include "i386/tm-i386v4.h"
+
 /* 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.  */
@@ -61,4 +62,4 @@ extern char *procfs_pid_to_str PARAMS ((int pid));
 
 #endif
 
-#endif  /* ifndef TM_I386SOL2_H */
+#endif /* ifndef TM_I386SOL2_H */
index 05caf9bbe066a60e8216639f2e2ea9004d1ed91e..1e6a2b282146943849740b1de535319452453d18 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386, Unix System V.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386V_H
 #define TM_I386V_H 1
@@ -119,8 +120,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #undef  STORE_RETURN_VALUE
 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
   write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
 \f
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -152,7 +153,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #undef  FRAME_NUM_ARGS
 #define FRAME_NUM_ARGS(fi) (-1)
 
-#ifdef __STDC__                /* Forward decl's for prototypes */
+#ifdef __STDC__                        /* Forward decl's for prototypes */
 struct frame_info;
 struct frame_saved_regs;
 #endif
@@ -160,4 +161,4 @@ struct frame_saved_regs;
 extern int
 i386_frame_num_args PARAMS ((struct frame_info *));
 
-#endif /* ifndef TM_I386V_H */
+#endif /* ifndef TM_I386V_H */
index eafff0178c073edbae5582ba9ccd2d03ed4206dd..7680a882621e50fd336ab9a666c424f8e33ad95b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1991, 1994 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386V4_H
 #define TM_I386V4_H 1
@@ -47,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define JB_ESP 4
 #define JB_EDX 5
 
-#define JB_PC  JB_EDX  /* Setjmp()'s return PC saved in EDX */
+#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
@@ -75,4 +76,4 @@ get_longjmp_target PARAMS ((CORE_ADDR *));
 #define sigtramp_saved_pc i386v4_sigtramp_saved_pc
 extern CORE_ADDR i386v4_sigtramp_saved_pc PARAMS ((struct frame_info *));
 
-#endif  /* ifndef TM_I386V4_H */
+#endif /* ifndef TM_I386V4_H */
index 81df85bcbbe9d7733625b89049a22dc7b2da312b..29c4ba0495ede2f712ecae6b70841c520a4cc782 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1991, 1994 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_I386V42MP_H
 #define TM_I386V42MP_H 1
@@ -26,14 +27,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "i386/tm-i386v4.h"
 
 /* procfs on this architecture has multiple fds (ctl, as, map, status)
-       including a control fd */
+   including a control fd */
 
 #ifndef HAVE_MULTIPLE_PROC_FDS
 #define HAVE_MULTIPLE_PROC_FDS
 #endif
 
 /* procfs on this architecture communicates with read/write instead
-       of ioctl */
+   of ioctl */
 
 #define PROCFS_USE_READ_WRITE
 
@@ -41,4 +42,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define UNIXWARE
 
-#endif  /* ifndef TM_I386V42MP_H */
+#endif /* ifndef TM_I386V42MP_H */
index 417d1514d75e9a906502f0211c39843e01035ea8..e39dc047cb144e74226654b96a9f0f79b4ffb0e8 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to target GDB to GNU/Linux on 386.
    Copyright 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_LINUX_H
 #define TM_LINUX_H
@@ -35,4 +36,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* The following works around a problem with /usr/include/sys/procfs.h  */
 #define sys_quotactl 1
 
-#endif  /* #ifndef TM_LINUX_H */
+#endif /* #ifndef TM_LINUX_H */
index cf5159f2655e613ceff3231d18abad3b3368529f..c826d5b0439c1e2197bc757677e94480fd6f6e77 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386 running under NetBSD.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_NBSD_H
 #define TM_NBSD_H
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define NUM_REGS 16
 
 #define JB_ELEMENT_SIZE sizeof(int)    /* jmp_buf[_JBLEN] is array of ints */
-#define JB_PC  0                       /* Setjmp()'s return PC saved here */
+#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
index c9f67d7f6d8d7bd12ed6c521e08e7e035bed1f50..14491a4dd2ccd46013e0e8dbea8269a7aa234063 100644 (file)
@@ -3,21 +3,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
    Symmetry version by Jay Vosburgh (fubar@sequent.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_PTX_H
 #define TM_PTX_H 1
@@ -48,8 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define DECR_PC_AFTER_BREAK 0
 
 #if 0
- --- this code can't be used unless we know we are running native,
-     since it uses host specific ptrace calls.
+-- -this code can 't be used unless we know we are running native,
+since it uses host specific ptrace calls.
 /* code for 80387 fpu.  Functions are from i386-dep.c, copied into
  * symm-dep.c.
  */
@@ -179,10 +180,10 @@ ptx_register_u_addr PARAMS ((int, int));
 ((N < ST0_REGNUM) ? 0 : \
  (N < FP1_REGNUM) ? 1 : \
  0)
-  
+
 /* Convert data from raw format for register REGNUM
    to virtual format for register REGNUM.  */
-extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
+extern const struct floatformat floatformat_i387_ext;  /* from floatformat.h */
 
 #undef REGISTER_CONVERT_TO_VIRTUAL
 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)       \
@@ -190,7 +191,7 @@ extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
  (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
                                                       (FROM),(TO)) : \
  (void)memcpy ((TO), (FROM), 4))
+
 /* Convert data from virtual format for register REGNUM
    to raw format for register REGNUM.  */
 
@@ -224,9 +225,9 @@ extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
   symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
 
 /*
-#undef  FRAME_FIND_SAVED_REGS
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
-*/
+   #undef  FRAME_FIND_SAVED_REGS
+   #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+   { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
+ */
 
-#endif  /* ifndef TM_PTX_H */
+#endif /* ifndef TM_PTX_H */
index a576accb46bbe5ec5e67465965801a5e6fb996fe..39809c4e96b8c30fe1ce364a635000e3f11bb0bb 100644 (file)
@@ -3,21 +3,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
    Symmetry version by Jay Vosburgh (fubar@sequent.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define SEQUENT_PTX4
 
index 1f60b982714acd940d84df80325414e9ce7ce056..5d4c39ce73f88db9e7bd403c95f2c3da70fab48c 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for a Sun 386i target machine, for GDB, the GNU debugger.
    Copyright 1986, 1987, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (TM_SUN386_H)
 #define TM_SUN386_H 1
@@ -75,17 +76,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    but do serve to get the desired values when passed to read_register.  */
 
 #undef  FP_REGNUM
-#define FP_REGNUM   6  /* (ebp) Contains address of executing stack frame */
+#define FP_REGNUM   6          /* (ebp) Contains address of executing stack frame */
 #undef  SP_REGNUM
-#define SP_REGNUM  18  /* (usp) Contains address of top of stack */
+#define SP_REGNUM  18          /* (usp) Contains address of top of stack */
 #undef  PS_REGNUM
-#define PS_REGNUM  17  /* (ps)  Contains processor status */
+#define PS_REGNUM  17          /* (ps)  Contains processor status */
 #undef  PC_REGNUM
-#define PC_REGNUM  15  /* (eip) Contains program counter */
+#define PC_REGNUM  15          /* (eip) Contains program counter */
 #undef  FP0_REGNUM
-#define FP0_REGNUM 20  /* Floating point register 0 */
+#define FP0_REGNUM 20          /* Floating point register 0 */
 #undef  FPC_REGNUM
-#define FPC_REGNUM 28  /* 80387 control register */
+#define FPC_REGNUM 28          /* 80387 control register */
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -202,4 +203,3 @@ double_to_i387 PARAMS ((char *, char *));
 }
 
 #endif /* !defined (TM_SUN386_H) */
-
index 11931d41724f522b33b71ad4f6f01af7a1c3a83d..4cd99875096d4fec08fddd97bffc7f4358f44d50 100644 (file)
@@ -4,21 +4,22 @@
    Free Software Foundation, Inc.
    Symmetry version by Jay Vosburgh (fubar@sequent.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_SYMMETRY_H
 #define TM_SYMMETRY_H 1
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if 0
 /* --- this code can't be used unless we know we are running native,
-       since it uses host specific ptrace calls. */
+   since it uses host specific ptrace calls. */
 /* code for 80387 fpu.  Functions are from i386-dep.c, copied into
  * symm-dep.c.
  */
@@ -101,16 +102,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Get %fp2 - %fp31 by addition, since they are contiguous */
 
 #undef  SP_REGNUM
-#define SP_REGNUM 14   /* (usp) Contains address of top of stack */
+#define SP_REGNUM 14           /* (usp) Contains address of top of stack */
 #define ESP_REGNUM 14
 #undef  FP_REGNUM
-#define FP_REGNUM 15   /* (ebp) Contains address of executing stack frame */
+#define FP_REGNUM 15           /* (ebp) Contains address of executing stack frame */
 #define EBP_REGNUM 15
 #undef  PC_REGNUM
-#define PC_REGNUM 16   /* (eip) Contains program counter */
+#define PC_REGNUM 16           /* (eip) Contains program counter */
 #define EIP_REGNUM 16
 #undef  PS_REGNUM
-#define PS_REGNUM 17   /* (ps)  Contains processor status */
+#define PS_REGNUM 17           /* (ps)  Contains processor status */
 #define EFLAGS_REGNUM 17
 
 /*
@@ -317,5 +318,4 @@ switch (regno) { \
 /* Offset to saved PC in sigcontext, from <signal.h>.  */
 #define SIGCONTEXT_PC_OFFSET 16
 
-#endif /* ifndef TM_SYMMETRY_H */
-
+#endif /* ifndef TM_SYMMETRY_H */
index f0b8227d2d3a2aace0d8763ee7d58da909d8dccb..863992c22afafa1618786bf9b8046f96e67006df 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for hosting on WIN32, for GDB.
    Copyright 1995, 1996, 1997, 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.  */
+   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 HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 562d457924a47c8179c467003064fe109c7a00c5..cb8fc780c1729df47b86039e08aceaa151653f23 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for Intel x86 running DJGPP.
    Copyright 1993-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.  */
+   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 HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 652a149d6cbe8166d140ce6f5774c3c5b9e2f621..83d6d5933352db6e3c49adb41f4b39c700156f2a 100644 (file)
@@ -1,25 +1,26 @@
 /* Macro defintions for AIX PS/2 (i386)
    Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com)
- * Revision:   23-Oct-92 17:42:49
+ * Revision:    23-Oct-92 17:42:49
  */
 
 #include "i386/xm-i386v.h"
index e5c4c89f07f2c2f90bb1f90b130f243e8642bec3..da6ed924314cc2143ebe91aa6321bb0d128e2665 100644 (file)
@@ -1,22 +1,23 @@
 /* Host-dependent definitions for Intel 386 running BSD Unix, for GDB.
    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
-#include <machine/limits.h>            /* for INT_MIN */
+#include <machine/limits.h>    /* for INT_MIN */
index 60307b21183e452f9c046d1cefbade3e6172cfbc..19abdaa6c7044ec9ddea71976aa2280662ef4997 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on the GNU Hurd on an Intel 386
    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 6078cb6f2cba944153b447f3004cc7d0109aba98..c9cc69d784469c1f2466e6813f8f54d507852bdf 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for Intel 386 running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
index b667409f0da5065cc7c39e4168eb1972f097cb1a..888501cd29c3ff82d02ed22b5ddb2ef7aa667faf 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on Mach 3 on an Intel 386
    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 HOST_BYTE_ORDER LITTLE_ENDIAN
 
index eb47bfb06f4b9eccde38a1f577e56147bedd7527..094660a17d37f1a49e62b14eae9655acee78ce90 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on Mach on an Intel 386
    Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
@@ -27,4 +28,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* <errno.h> only defines this if __STDC__!!! */
 extern int errno;
 
-extern char *strdup();
+extern char *strdup ();
index 661c9cbd36cfcd3c70ae1703bc128ee2f2437a55..5c005d52389ed5d5e53eb8f93f3fcaaa56ab587d 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HAVE_TERMIO    1
 
index 31fa7e6b9807e7e1d2dc13378e60c30e8177e2b6..d245f9dc95ee980a57040773511a7695e2e83dbb 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro defintions for i386, running SCO Unix System V/386 3.2.
    Copyright (C) 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 /* In 3.2v4 <sys/user.h> requires on <sys/dir.h>.  */
 #include <sys/types.h>
index 480dfd671a046709785bd1043bfa73b871a7d5dd..4476b6970ba26e54c400916149c634178815ef22 100644 (file)
@@ -2,35 +2,36 @@
    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
    Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
 /* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
-Sys V/386 3.2.
-
-On some machines, gdb crashes when it's starting up while calling the
-vendor's termio tgetent() routine.  It always works when run under
-itself (actually, under 3.2, it's not an infinitely recursive bug.)
-After some poking around, it appears that depending on the environment
-size, or whether you're running YP, or the phase of the moon or something,
-the stack is not always long-aligned when main() is called, and tgetent()
-takes strong offense at that.  On some machines this bug never appears, but
-on those where it does, it occurs quite reliably.  */
+   Sys V/386 3.2.
+
+   On some machines, gdb crashes when it's starting up while calling the
+   vendor's termio tgetent() routine.  It always works when run under
+   itself (actually, under 3.2, it's not an infinitely recursive bug.)
+   After some poking around, it appears that depending on the environment
+   size, or whether you're running YP, or the phase of the moon or something,
+   the stack is not always long-aligned when main() is called, and tgetent()
+   takes strong offense at that.  On some machines this bug never appears, but
+   on those where it does, it occurs quite reliably.  */
 #define ALIGN_STACK_ON_STARTUP
 
 /* define USG if you are using sys5 /usr/include's */
@@ -42,4 +43,3 @@ on those where it does, it occurs quite reliably.  */
    to get the offset in the core file of the register values.  */
 
 #define KERNEL_U_ADDR 0xe0000000
-
index daaac8047c56204742567f3c40450bbc78c58e8d..706822f30dd97f68fb4f3d165a32bb6c51ffc62f 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro defintions for i386, running System V 3.2.
    Copyright (C) 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "i386/xm-i386v.h"
 
index 7f782db24964502572eb5c04942e82b41292acee..720b218c1eeff8e00c390f5dde2aed028e98b702 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.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 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.  */
 
 /* Pick up most of what we need from the generic i386 host include file. */
 
index 217c6d4d0949d00151b84128db07a9feba9c6958..b788b6779481a3128dcff58e9d3dcd170edbd32b 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for GNU/Linux, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef XM_LINUX_H
 #define XM_LINUX_H
@@ -33,4 +34,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Need R_OK etc, but USG isn't defined.  */
 #include <unistd.h>
 
-#endif /* #ifndef XM_LINUX_H */
+#endif /* #ifndef XM_LINUX_H */
index b5624acc60f5050418c41cafda26da8429f5aa24..9d746289f715112e1c76703b7aa659e73da420c1 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a i386 running NetBSD, for GDB.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Get generic NetBSD host definitions. */
 #include "xm-nbsd.h"
index 99b46ccd149cc050acf89a3cee59ac498e633846..425b72cc1a7b0d0bdf6066d5fb76d79e60bee5d1 100644 (file)
@@ -3,21 +3,22 @@
    Copyright 1986, 1987, 1989, 1992, 1993, 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.  */
+   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.  */
 
 /* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
 
index bdbdefd6ec81bf2770f851700e6e53ace5c400bc..3f8a84e5f08943fb066cb082539e1bb60431bb6d 100644 (file)
@@ -2,21 +2,22 @@
    Weitek 1167 and i387 support.  Copyright 1986, 1987, 1989, 1992,
    1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
 
index 51c3b58c11b6c03835b2d57ddfce78113304283f..e2196ae97de0c2718d484e1c9cdc7552d6afb175 100644 (file)
@@ -1,20 +1,21 @@
 /* Host support for Sun 386i, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
index 52e9a9a2341e3c95cac873b27d1199710d178360..5f07fa5bd25b0366621e898dc1080c55491df0a7 100644 (file)
@@ -2,21 +2,22 @@
    dynix 3.1, with Weitek 1167 and i387 support.
    Copyright 1986, 1987, 1989, 1992, 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.  */
+   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.  */
 
 /* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
 
index e083010067cdfaa1d72810373e5beca4c949a36e..65680f053852cfc1fde5cf374df9babace93408c 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for hosting on WIN32, built with Microsoft Visual C/C++, for GDB.
    Copyright 1996, 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.  */
+   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 "i386/xm-cygwin.h"
 
index d5b78f264b47a00eda2ebbecf8a82952a3e9354d..3a6e2342ee1c5ff545fbb6191ad8b43a2462a475 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for target machine Intel 960, for GDB, the GNU debugger.
    Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Definitions to target GDB to any i960.  */
 
@@ -87,24 +88,24 @@ extern CORE_ADDR saved_pc_after_call ();
 /* 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 */
+#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       */
+#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'.  */
@@ -124,7 +125,7 @@ extern CORE_ADDR saved_pc_after_call ();
    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
@@ -230,7 +231,7 @@ extern use_struct_convention_fn i960_use_struct_convention;
 
 /* 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) \
@@ -291,7 +292,7 @@ extern use_struct_convention_fn i960_use_struct_convention;
 
 /* 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).  */
 
@@ -327,12 +328,12 @@ extern CORE_ADDR frame_args_address ();           /* i960-tdep.c */
 
 #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 */
+extern void frame_find_saved_regs ();  /* See i960-tdep.c */
 \f
 /* 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       \
@@ -345,14 +346,14 @@ error("Function calls into the inferior process are not supported on the i960")
 
 
 /* This sequence of words is the instructions
-  
-       callx 0x00000000
-       fmark
+
+   callx 0x00000000
+   fmark
  */
 
 /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
 
-/* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
+                                                                                                                                                           /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
 
 /* Indicate that we don't support calling inferior child functions.  */
 
@@ -360,7 +361,7 @@ error("Function calls into the inferior process are not supported on the i960")
 
 /* 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 */
index e441e052b5a0fcff43778485739205e683967366..21c4812c8c46826f464a76ff844b7c503c673327 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1990-1991 Free Software Foundation, Inc.
    Contributed by Intel Corporation and Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*****************************************************************************
  * Definitions to target GDB to an i960 debugged over a serial line.
@@ -31,12 +32,12 @@ struct frame_info;
 
 /* redefined from tm-i960.h */
 /* Number of machine registers */
-#undef NUM_REGS 
+#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 
+#undef REGISTER_NAMES
 #define REGISTER_NAMES { \
        /*  0 */ "pfp", "sp",  "rip", "r3",  "r4",  "r5",  "r6",  "r7", \
        /*  8 */ "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",\
index d0c46c0a39f247712d5269afceae1ee9f91fa99e..1a0b5624e76e9b90b2997f6c051ebdba30c23110 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1990-1991 Free Software Foundation, Inc.
    Contributed by Intel Corporation and Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*****************************************************************************
  * Definitions to target GDB to an i960 debugged over a serial line.
@@ -44,7 +45,7 @@ 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 */
+       {"ser", required_argument, 0, 1004},    /* 1004 is magic cookie for ADDL_CASES */
 
 #define        ADDITIONAL_OPTION_CASES \
        case 1004:      /* -ser option:  remote nindy auto-start */     \
@@ -76,7 +77,7 @@ extern char *nindy_ttyname;   /* Name of serial port to talk to nindy */
   nindy_before_main_loop();
 
 extern void
-nindy_before_main_loop();              /* In remote-nindy.c */
+  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.
@@ -89,7 +90,7 @@ extern int nindy_frame_chain_valid PARAMS ((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 */
+  nindy_frame_chain_valid ();  /* See nindy-tdep.c */
 
 /* Sequence of bytes for breakpoint instruction */
 
index e6cade073de089a4274880521706adc58084d04c..a62bab60c773c7e02d2aee777cd03f18df0bc641 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986-1991, 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.  */
+   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"
index 5c8fb237ee4da82d9939d4a3583e6f3ed1f7b3c3..e0c8c230f899f87ecdc77d1195083dd51cf964b5 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Mitsubishi m32r processor.
    Copyright 1996, 1997 Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Used by mswin.  */
 #define TARGET_M32R 1
@@ -108,15 +109,15 @@ struct value;
   int using_frame_pointer;
 
 
-extern void m32r_init_extra_frame_info PARAMS ((struct frame_info *fi));
+extern void m32r_init_extra_frame_info PARAMS ((struct frame_info * fi));
 /* mvs_check  INIT_EXTRA_FRAME_INFO */
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) m32r_init_extra_frame_info (fi)
 /* mvs_no_check  INIT_FRAME_PC */
 #define INIT_FRAME_PC          /* Not necessary */
 
-extern void 
-m32r_frame_find_saved_regs PARAMS ((struct frame_info *fi, 
-                                   struct frame_saved_regs *regaddr));
+extern void
+m32r_frame_find_saved_regs PARAMS ((struct frame_info * fi,
+                                   struct frame_saved_regs * regaddr));
 
 /* Put here the code to store, into a struct frame_saved_regs,
    the addresses of the saved registers of frame described by FRAME_INFO.
@@ -128,15 +129,15 @@ m32r_frame_find_saved_regs PARAMS ((struct frame_info *fi,
 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)        \
    m32r_frame_find_saved_regs(frame_info, &(frame_saved_regs))
 
-extern CORE_ADDR m32r_frame_chain PARAMS ((struct frame_info *fi));
+extern CORE_ADDR m32r_frame_chain PARAMS ((struct frame_info * fi));
 /* mvs_check  FRAME_CHAIN */
 #define FRAME_CHAIN(fi)                m32r_frame_chain (fi)
 
 #define FRAME_CHAIN_VALID(fp, frame)   generic_frame_chain_valid (fp, frame)
 
-extern CORE_ADDR m32r_find_callers_reg PARAMS ((struct frame_info *fi, 
+extern CORE_ADDR m32r_find_callers_reg PARAMS ((struct frame_info * fi,
                                                int regnum));
-extern CORE_ADDR m32r_frame_saved_pc PARAMS((struct frame_info *));
+extern CORE_ADDR m32r_frame_saved_pc PARAMS ((struct frame_info *));
 /* mvs_check  FRAME_SAVED_PC */
 #define FRAME_SAVED_PC(fi)             m32r_frame_saved_pc (fi)
 
@@ -198,7 +199,7 @@ extern use_struct_convention_fn m32r_use_struct_convention;
 
 /* target-specific dummy_frame stuff */
 
-extern struct frame_info *m32r_pop_frame PARAMS ((struct frame_info *frame));
+extern struct frame_info *m32r_pop_frame PARAMS ((struct frame_info * frame));
 /* mvs_check  POP_FRAME */
 #define POP_FRAME m32r_pop_frame (get_current_frame ())
 
@@ -206,8 +207,8 @@ extern struct frame_info *m32r_pop_frame PARAMS ((struct frame_info *frame));
 /* #define STACK_ALIGN(x) ((x + 3) & ~3) */
 
 extern CORE_ADDR m32r_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
-extern CORE_ADDR m32r_push_arguments PARAMS ((int nargs, 
-                                             struct value **args, 
+extern CORE_ADDR m32r_push_arguments PARAMS ((int nargs,
+                                             struct value ** args,
                                              CORE_ADDR sp,
                                              unsigned char struct_return,
                                              CORE_ADDR struct_addr));
index 4048a8b4ad3dec9f835c1debdf936542f2a35c33..27a4a3421d08e48a6b60e8691a5c14d0dae2e7ee 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro defintions for an Apollo m68k in BSD mode
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define        FETCH_INFERIOR_REGISTERS
 
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define KERNEL_U_ADDR 0
 
-#undef FLOAT_INFO      /* No float info yet */
+#undef FLOAT_INFO              /* No float info yet */
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
        (addr) = (6 + 4 * (regno))
index 3a56f4a019276fe7649791d3477f577ae85a42b4..496e105d303d673b0dea41215b81b3fcfdd4c17a 100644 (file)
@@ -1,20 +1,21 @@
 /* Macro defintions for an Apollo.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define        FETCH_INFERIOR_REGISTERS
index cb7ffbf2be850e2e187998b861191116770f2aee..c55be1e203a31aa549970d3d0981e2e3b9d1e9ea 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for a Motorola Delta Series sysV68 R3V7.1.
    Copyright (C) 1993, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #define KERNEL_U_SIZE kernel_u_size()
index 50da268f4aefe992c4e7fd6f8641e8fcf8e323b6..b24e7c282bc87d8b381a8c398f181759d9fcf855 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for a Bull DPX2.
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 /* KERNEL_U_ADDR is determined upon startup in dpx2-xdep.c. */
 
index 7aacbb18b35f4bc54777c2f43665d0b8ea40d209..552dede5dfdae4c0dbb53af8e80b29f9c872a9cd 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for Hewlett-Packard 9000/300 native support under bsd.
    Copyright 1986, 1987, 1989, 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.  */
+   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.  */
 
 /* Detect whether this is 4.3 or 4.4.  */
 
index 83e7b2bfba8c1939cd3771f910e18d13b6843079..0aad97661a001c4885eeb168f69c65aec27235bb 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for native support on HP 9000 model 320, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
index d7a44ec3bb43550f5799a99560c469c4a9c6c796..197076e54034bcc5a443a4497956b06532c81642 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for linux, for GDB, the GNU debugger.
    Copyright (C) 1996,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.  */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_LINUX_H
 #define NM_LINUX_H
index 62b8d243ec8d1416369cf320028abc3b44b60972..49114fc4df9aa6df797395b6e390518305db15b7 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Motorola 680x0 running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_M68KLYNX_H
 #define NM_M68KLYNX_H
index ce22c4d5e28782f8a2470c955501cdff6fe36b50..b73b0ef71e540cb2ed95960c15ded59df52c9840 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Motorola m68k running NetBSD, for GDB.
    Copyright 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Get generic NetBSD native definitions. */
 #include "nm-nbsd.h"
index 643d217c3490129f829fd0250b59e0e28e947cf7..3591ddb41ae1bf32f9c0b51a2a943f33f3aa6d34 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
    Copyright 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_HEWS_H
 #define NM_NEWS_H 1
@@ -23,4 +24,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Supply missing typedef needed in inftarg.c */
 typedef int pid_t;
 
-#endif /* NM_NEWS_H */
+#endif /* NM_NEWS_H */
index 90352504ebf716db0a1b8897acf308855b241474..5d55caf216595e304451ff8c8dc5cd66fbd20904 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sun2, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
index e4ef8f4a56c8b81c88217a7d7d1dcadeb295dec2..ca73c49984095588a1b88252a36221807e6c9478 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 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.  */
+   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.  */
 
index 67731313d285d1d541ed51fd38d4b6792821f48c..a7d0bdd3bda4c351d14b68b2ac0251be98bff95c 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Motorola 680x0 running SVR4.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Include the generic SVR4 definitions.  */
 
index f917760755bfe37757d05e65c3e131883f79d473..90888c66655ea25ac9fd25c99da6481d43d31a1f 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for targeting GDB to a 3b1.
    Copyright 1986, 1987, 1989, 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.  */
+   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.  */
 
 /* The child target can't deal with floating registers.  */
 #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
index ee10410d3292d2d89edeac45c1134cd13fa14af7..7fe0785cb920bdf51709367a2865ca7991d47dc8 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1991 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.  */
+   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.  */
 
 /* Apollos use vector 0xb for the breakpoint vector */
 
index c3628d00fe4e9c8ed13090c14800966389e095d7..ae8de6602e56dca695f7fc72dd73a51437afc0f7 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for CISCO m68k.
    Copyright (C) 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.  */
+   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 GDBINIT_FILENAME       ".cisco-gdbinit"        /* Init file */
 
index 8e7723439e58daabb77224685bcf1cb2da0f128e..260f7332225ac6f38ceadacf1cdb6bb3dc63140d 100644 (file)
@@ -1,21 +1,22 @@
 /* Target definitions for delta68.
    Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Define BPT_VECTOR if it is different than the default.
    This is the vector number used by traps to indicate a breakpoint. */
@@ -75,7 +76,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int delta68_frame_num_args PARAMS ((struct frame_info *fi));
+extern int delta68_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
 
 /* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
index 8b1bfdad9aab8cfb069c934e0f72300f40121b60..763a0583256c143f82e92d8108d049b3eb85e520 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for targeting to a Bull DPX2.
    Copyright (C) 1986, 1987, 1989, 1991, 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.  */
+   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 BPT_VECTOR if it is different than the default.
    This is the vector number used by traps to indicate a breakpoint. */
index ce2af1d627d8432adc856a946f246c8743d49afe..ad1f2352ee3e96ee727036b0b5d53eacd3cfaf1c 100644 (file)
@@ -4,21 +4,22 @@
    by Jan Norden TX/DK.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-GDB is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
-
-GDB is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   This file is part of GDB.
+
+   GDB is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 1, or (at your option)
+   any later version.
+
+   GDB is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define        GDBINIT_FILENAME        ".esgdbinit"
 
index cdd75dc881afd3d77690d3990488a2b0e5e7d628..07992a564356717d4bb7336b1e954c3923942910 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for target machine Hewlett-Packard 9000/300, running bsd.
    Copyright 1986, 1987, 1989, 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.  */
+   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.  */
 
 /* Configuration file for HP9000/300 series machine running BSD,
    including Utah, Mt. Xinu or Berkeley variants.  This is NOT for HP-UX.
index fce0d99df7212c5e8c05fede173824c2fc41455c..5ebdb7ca78834707a0fa209c810ea2d0ae54732e 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger.
    Copyright 1986, 1987, 1989, 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.  */
+   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.  */
 
 /* GCC is the only compiler used for stabs on this OS.  So get this
    right even if the code which detects gcc2_compiled. is still
index 5653fe657ddc943a5e1896e45c19f428d18fbbc9..1442d178f5b35e920fd7c1e50db532622d0b68d0 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to target GDB on an ISI Optimum V (3.05) under 4.3bsd.
    Copyright (C) 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This has not been tested on ISI's running BSD 4.2, but it will probably
    work.  */
@@ -36,12 +37,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    On the ISI, the kernel resets the pc to the trap instr */
 
 #define DECR_PC_AFTER_BREAK 0
-
 \f
+
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int isi_frame_num_args PARAMS ((struct frame_info *fi));
+extern int isi_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (isi_frame_num_args ((fi)))
 
 /* Put here the code to store, into a struct frame_saved_regs,
index 6c119982ff5dfb663f735bd9b19e57777e0f040c..9f597348143ca204b4bad303715f0a72648ebcc7 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to target GDB to Linux on m680x0
    Copyright (C) 1996,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.  */
+   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.  */
 
 /* 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
index 4835b39872ec0b8276fc85f49dde63663040d2c5..da80f107569a0f6cc67a3c5a83273dabb8b4cc94 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a 68000 series machine.
    Copyright 1986, 1987, 1989, 1990, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Generic 68000 stuff, to be included by other tm-*.h files.  */
 
@@ -322,8 +323,8 @@ do                                                                  \
 #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.  */
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 /* The CALL_DUMMY macro is the sequence of instructions, as disassembled
@@ -332,20 +333,20 @@ do                                                                        \
    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
+   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
+   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).
 
@@ -357,8 +358,8 @@ do                                                                  \
    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_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
index fbe57076f3ced865e45a3dc8245faaf3df8b71ac..cfc462f54a48e980c3c5eedba9efcc8ef856eba5 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Motorola 680x0 running under LynxOS.
    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 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_M68KLYNX_H
 #define TM_M68KLYNX_H
index 67306073c80b41a79ac566c40fd43d00ae2cdaec..9fd246075c5e523272a92c86fdacddc4b0b6644a 100644 (file)
@@ -3,21 +3,22 @@
    Copyright (C) 1991, 1995 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygint)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Define BPT_VECTOR if it is different than the default.
    This is the vector number used by traps to indicate a breakpoint. */
@@ -26,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* How much to decrement the PC after a trap.  Depends on kernel. */
 
-#define DECR_PC_AFTER_BREAK 0          /* No decrement required */
+#define DECR_PC_AFTER_BREAK 0  /* No decrement required */
 
 /* Use the alternate method of determining valid frame chains. */
 
@@ -56,7 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define JB_A6  11
 #define JB_A7  12
 
-#define JB_PC  JB_A1   /* Setjmp()'s return PC saved in A1 */
+#define JB_PC  JB_A1           /* Setjmp()'s return PC saved in A1 */
 
 /* 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
index 90b4fabf5cb7c5510dc31a5ae479ca01585e75cb..3d8b9ec8529d45fe96137b9ce8f84d61bc1378e5 100644 (file)
@@ -1,20 +1,21 @@
 /* Target-dependent definitions for Mac running MacOS.
    Copyright (C) 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m68k/tm-m68k.h"
index 7a48d9c9a49f495997a43352f24b3af8e387f622..24c044d119b1b02d83d2c739b1f67b25816349b9 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine definitions for a generic m68k monitor/emulator.
    Copyright (C) 1986, 1987, 1989, 1993, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The definitions here are appropriate for several embedded m68k-based
    targets, including IDP (rom68k), BCC (cpu32bug), and EST's emulator.  */
@@ -32,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* No float registers.  */
 
-/*#define NUM_REGS 18*/
+/*#define NUM_REGS 18 */
 
 #include "m68k/tm-m68k.h"
 
index cc86cc8d4d2f0f22ae585e6a2cf9be9237614457..fa8941755dcb275cff052b5c2f4c803b9795cdfe 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for i386 running under NetBSD.
    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.  */
+   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_NBSD_H
 #define TM_NBSD_H
index d844682b8713502eed0c9028af67c3144c53fdd0..ff9230b50f1d1e55d3e27dbffa479f72419a226b 100644 (file)
@@ -1,30 +1,31 @@
 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
    Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* See following cpu type determination macro to get the machine type.
 
-Here is an m-news.h file for gdb.  It supports the 68881 registers.
-                                           by hikichi@srava.sra.junet
+   Here is an m-news.h file for gdb.  It supports the 68881 registers.
+   by hikichi@srava.sra.junet
 
-* Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
-* After NEWS OS version 3.2, some of ptrace's bug is fixed.
-  But we cannot change the floating register(see adb(1) in OS 3.2) yet.  */
+   * Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
+   * After NEWS OS version 3.2, some of ptrace's bug is fixed.
+   But we cannot change the floating register(see adb(1) in OS 3.2) yet.  */
 
 /* Extract from an array REGBUF containing the (raw) register state
    a function return value of type TYPE, and copy that, in virtual format,
@@ -59,7 +60,7 @@ Here is an m-news.h file for gdb.  It supports the 68881 registers.
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int news_frame_num_args PARAMS ((struct frame_info *fi));
+extern int news_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi)))
 
 #include "m68k/tm-m68k.h"
index a69573f761b57cc6365746f14b15503e3e85d820..5a9bfe88210878490e7e7479b3ced486b6bc0cc6 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1991 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.  */
+   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        GDBINIT_FILENAME        ".os68gdbinit"
 
index 8ddf0e9aeadd0a6f107bf6797f4e6d10e34c5484..4d7a2b19bf92b25601eb34f774b630cc57d84b2b 100644 (file)
@@ -1,20 +1,21 @@
 /* Parameters for a Tandem ST2000 phone switch.
    Copyright (C) 1986, 1987, 1989, 199 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m68k/tm-m68k.h"
index 9970f1ef5c28f2a2b43bf6051ef26219bb7ac4ed..e839bea7f5ae7ae5cbc078059ff2591732941fb1 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sun, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The child target can't deal with floating registers.  */
 #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
index 76c7f99f2173b339a4ec1c4c407a13baeeefb351..496c32955b3c6963f94aa43369fea23d0844f8f5 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1990, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m68k/tm-sun2.h"
 #include "tm-sunos.h"
index be45db4cf8ce71b415c1fe91ea19b47f4d237053..ce88045c7d7f0dfa2aa74cd34164a4d50da23825 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sun, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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_SUN3_H
 #define TM_SUN3_H
index 927587b781951bb0b87a642ce103abfb45c569ad..d4bc74fd8e7059c1e1a918ebafc28a20faa819bf 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine parameters for Sun-3 under SunOS 4.x, for GDB.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m68k/tm-sun3.h"
 #include "tm-sunos.h"
index fbec915b4633c7eb520b672bcf146ed48f5eb68c..743220ed63e7b2b768fe386b758186f65a32eb7a 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 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.  */
+   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.  */
 
 /* GCC is probably the only compiler used on this configuration.  So
    get this right even if the code which detects gcc2_compiled. is
index ad4b5b7c57aeb1983e43296f5f1af1c4c70be8f2..a07fcd28c9d6f08a6e454eaecac5453e024ef3d2 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a 3b1.
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 HOST_BYTE_ORDER BIG_ENDIAN
 
index 008f769eaa0367b90da4ac169160ad83ef92ae7e..084c7b01a85c6645e9f3bf36778850f248716c83 100644 (file)
@@ -31,7 +31,7 @@
 /* OBSOLETE  */
 /* OBSOLETE #define HAVE_TERMIO */
 /* OBSOLETE  */
-/* OBSOLETE #define CBREAK XTABS       /* It takes all kinds... *x/ */
+/* OBSOLETE #define CBREAK XTABS        /* It takes all kinds... *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #ifndef R_OK */
 /* OBSOLETE #define R_OK 4 */
 /* OBSOLETE  */
 /* OBSOLETE #define KERNEL_U_ADDR 0x1fbf000 */
 /* OBSOLETE  */
-/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)             \ */
-/* OBSOLETE {  if (regno <= SP_REGNUM) \ */
-/* OBSOLETE      addr = blockend + regno * 4; \ */
-/* OBSOLETE    else if (regno == PS_REGNUM) \ */
-/* OBSOLETE      addr = blockend + regno * 4 + 4; \ */
-/* OBSOLETE    else if (regno == PC_REGNUM) \ */
-/* OBSOLETE      addr = blockend + regno * 4 + 2; \ */
+/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)              \ */
+/* OBSOLETE {   if (regno <= SP_REGNUM) \ */
+/* OBSOLETE       addr = blockend + regno * 4; \ */
+/* OBSOLETE     else if (regno == PS_REGNUM) \ */
+/* OBSOLETE       addr = blockend + regno * 4 + 4; \ */
+/* OBSOLETE     else if (regno == PC_REGNUM) \ */
+/* OBSOLETE       addr = blockend + regno * 4 + 2; \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
-/* OBSOLETE #define REGISTER_ADDR(u_ar0, regno)                                        \ */
-/* OBSOLETE   (((regno) < PS_REGNUM)                                           \ */
-/* OBSOLETE    ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ */
-/* OBSOLETE    : (((regno) == PS_REGNUM)                                               \ */
-/* OBSOLETE       ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS))            \ */
+/* OBSOLETE #define REGISTER_ADDR(u_ar0, regno)                                 \ */
+/* OBSOLETE   (((regno) < PS_REGNUM)                                            \ */
+/* OBSOLETE    ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)])  \ */
+/* OBSOLETE    : (((regno) == PS_REGNUM)                                                \ */
+/* OBSOLETE       ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS))             \ */
 /* OBSOLETE       : (&((struct exception_stack *) (u_ar0))->e_PC))) */
 /* OBSOLETE  */
-/* OBSOLETE #define FP_REGISTER_ADDR(u, regno)                                 \ */
-/* OBSOLETE   (((char *)                                                               \ */
-/* OBSOLETE     (((regno) < FPC_REGNUM)                                                \ */
+/* OBSOLETE #define FP_REGISTER_ADDR(u, regno)                                  \ */
+/* OBSOLETE   (((char *)                                                                \ */
+/* OBSOLETE     (((regno) < FPC_REGNUM)                                         \ */
 /* OBSOLETE      ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ */
-/* OBSOLETE      : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)])))       \ */
+/* OBSOLETE      : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)])))        \ */
 /* OBSOLETE    - ((char *) (& u))) */
 /* OBSOLETE  */
 /* OBSOLETE \f */
 /* OBSOLETE  */
 /* OBSOLETE #ifdef MOTOROLA */
 /* OBSOLETE #define PUSH_REGISTERS        \ */
-/* OBSOLETE { asm ("clr.w -(sp)");           \ */
-/* OBSOLETE   asm ("pea (10,sp)");           \ */
+/* OBSOLETE { asm ("clr.w -(sp)");            \ */
+/* OBSOLETE   asm ("pea (10,sp)");            \ */
 /* OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); } */
 /* OBSOLETE #else */
 /* OBSOLETE #ifdef ALTOS_AS */
 /* OBSOLETE #define PUSH_REGISTERS        \ */
-/* OBSOLETE { asm ("clr.w -(%sp)");          \ */
-/* OBSOLETE   asm ("pea (10,%sp)");          \ */
+/* OBSOLETE { asm ("clr.w -(%sp)");           \ */
+/* OBSOLETE   asm ("pea (10,%sp)");           \ */
 /* OBSOLETE   asm ("movm.l &0xfffe,-(%sp)"); } */
 /* OBSOLETE #else */
 /* OBSOLETE #define PUSH_REGISTERS        \ */
-/* OBSOLETE { asm ("clrw -(sp)");            \ */
-/* OBSOLETE   asm ("pea 10(sp)");            \ */
+/* OBSOLETE { asm ("clrw -(sp)");             \ */
+/* OBSOLETE   asm ("pea 10(sp)");             \ */
 /* OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); } */
 /* OBSOLETE #endif */
 /* OBSOLETE #endif */
index f0defdaa91d58b53c883e83f53e361acb3199685..8509c3259bf072385379d8aeeac0b7b7f5c0ed1c 100644 (file)
@@ -1,24 +1,25 @@
 /* Macro definitions for an Apollo m68k in BSD mode
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
 #define ALIGN_STACK_ON_STARTUP
 
-extern char *strdup();
+extern char *strdup ();
index c87ff478390e009c6ac50bdfed4b7460c7a40c27..264076baa8ed1cc962a521784f9c9783de5f3ecd 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro defintions for an Apollo.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
@@ -25,20 +26,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
 /* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
-Sys V/386 3.2.
-
-On some machines, gdb crashes when it's starting up while calling the
-vendor's termio tgetent() routine.  It always works when run under
-itself (actually, under 3.2, it's not an infinitely recursive bug.)
-After some poking around, it appears that depending on the environment
-size, or whether you're running YP, or the phase of the moon or something,
-the stack is not always long-aligned when main() is called, and tgetent()
-takes strong offense at that.  On some machines this bug never appears, but
-on those where it does, it occurs quite reliably.  */
+   Sys V/386 3.2.
+
+   On some machines, gdb crashes when it's starting up while calling the
+   vendor's termio tgetent() routine.  It always works when run under
+   itself (actually, under 3.2, it's not an infinitely recursive bug.)
+   After some poking around, it appears that depending on the environment
+   size, or whether you're running YP, or the phase of the moon or something,
+   the stack is not always long-aligned when main() is called, and tgetent()
+   takes strong offense at that.  On some machines this bug never appears, but
+   on those where it does, it occurs quite reliably.  */
 #define ALIGN_STACK_ON_STARTUP
 
 /* define USG if you are using sys5 /usr/include's */
 #define USG
 
 #define HAVE_TERMIO
-
index 6ce705cf85fc9dbd7a80dccbb3ecba02c87b8145..d1375459cd2e502f24b09a0fcf1567e0f314af2b 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for a Delta.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 HOST_BYTE_ORDER BIG_ENDIAN
 
index e5532e7229c2ed4f7c20e4ec44b31db39eb482d9..f17d7143adb8f0ac6ce0dea7f212fef9f41c3625 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Bull DPX2.
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
index 5e67792dad1ebcd96830c94d6d34dd38b5d42676..0da48bcf766d2ff28bb830a0c1de47f872fd3763 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Configuration file for HP9000/300 series machine running
@@ -25,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define        HOST_BYTE_ORDER BIG_ENDIAN
 
-#include <sys/param.h> /* For INT_MIN */
+#include <sys/param.h>         /* For INT_MIN */
 
 /* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
 #define        ONE_PROCESS_WRITETEXT
index b6d75d611e42003fededc7fa8e5bfbff26c6b273..5f9d9747ddbeb2a0ad7f79199768dbe9898a0b1a 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for HP 9000 model 320 hosting, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
@@ -35,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* #define HPUX_VERSION_5 */
 
 /* define USG if you are using sys5 /usr/include's */
-#undef USG     /* In case it was defined in the Makefile for cplus-dem.c */
+#undef USG                     /* In case it was defined in the Makefile for cplus-dem.c */
 #define USG
 
 #define HAVE_TERMIOS
index 4e75333fcbb0985d3c81748df8fdb26480af3340..d21d243cb70a7c984a5ef3bd7e2035b5406c62d0 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on an ISI Optimum V (3.05) under 4.3bsd.
    Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
@@ -25,11 +26,11 @@ 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 0x10800000*/
+/*#define KERNEL_U_ADDR 0x10800000 */
 #define KERNEL_U_ADDR 0
 
 /* expects blockend to be u.u_ar0 */
-extern int rloc[];     /* Defined in isi-dep.c */
+extern int rloc[];             /* Defined in isi-dep.c */
 #define REGISTER_U_ADDR(addr, blockend, regno)                  \
 {       blockend &= UPAGES*NBPG - 1;                            \
        if (regno < 18) addr = (int)blockend + rloc[regno]*4;   \
index 7266cffdfa28338009f3a83bdc300594bd63d476..704b781940d7ad594e36f95e7f8b14b052ca9d99 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for linux, for GDB, the GNU debugger.
    Copyright (C) 1996,1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef XM_LINUX_H
 #define XM_LINUX_H
@@ -37,4 +38,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Need R_OK etc, but USG isn't defined.  */
 #include <unistd.h>
 
-#endif /* #ifndef XM_LINUX_H */
+#endif /* #ifndef XM_LINUX_H */
index 547940877f13a324ae3414430912e74131f97b0e..a751f0ee089ce47c66d1fb8bce603a663a65cafa 100644 (file)
@@ -2,21 +2,21 @@
    Copyright (C) 1991, Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygint)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
-
index ded6844c907bd56229cd0e60f4a8123713adc171..1247b5d76032564fd9f22abce584198ac497ce83 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for Motorola 680x0 running LynxOS, for GDB.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
index 2149c8ffd65f2c5a26602314e3752daa7188dc05..8c927c8e90bd1dec0d755a938858a5a8abb12673 100644 (file)
@@ -3,21 +3,22 @@
    Copyright 1991, 1992 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.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 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.  */
 
 /* Pick up most of what we need from the generic m68k host include file. */
 
index f0585b38a3a7efde9c1e70fab3b5ce6f75a0eb47..1555c7d8659bbad67e9f1e99cd52319454fc2a87 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running GDB on Apple 68k-based Macintoshes.
    Copyright (C) 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
index aa28e19bdf7fcd19598a34bc6dfc5fd906afc8e5..c266a99e6282de841fff6e903f4c8e68d7d7d4f4 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Motorola m68k running NetBSD, for GDB.
    Copyright 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Get generic NetBSD host definitions. */
 #include "xm-nbsd.h"
index 081337bcf3387cdb16a9e1f0de870f1f22ed0f59..d6f1ff4c923ad2bf61e66b52a894c1d3cec03a1a 100644 (file)
@@ -1,25 +1,26 @@
 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
    Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
-#include <sys/param.h> /* For INT_MIN */
+#include <sys/param.h>         /* For INT_MIN */
 
 #define HAVE_WAIT_STRUCT
 
index b70234c058a07acee47c21c0d20934c3d2e29079..56fee6e7fd33da8e6b4cdbc6ad3c642eeaee936c 100644 (file)
@@ -2,21 +2,22 @@
    for GDB, the GNU debugger.
    Copyright (C) 1990 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is required by Sony include files like <sys/user.h> so we
    get the right offset into the u area.  Relying on the compiler
index 457451c4d749513a567a846f0456383c3b59598e..d50f713d60146bb0e83b5814a804818955983dd4 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sun, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
@@ -23,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    to get the offset in the core file of the register values.  */
 
 #define KERNEL_U_ADDR 0x2800
-
 \f
+
 /* Interface definitions for kernel debugger KDB.  */
 
 /* Map machine fault codes into signal numbers.
index 3de7446d184d932b03a0b54e0e77a3d9437e38f9..ffb4a96ac0b7b1d925ea3d0cbb03b53c3ccd2982 100644 (file)
@@ -1,25 +1,26 @@
 /* Parameters for execution on a Sun, for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
-
 \f
+
 /* Interface definitions for kernel debugger KDB.  */
 
 /* Map machine fault codes into signal numbers.
index faf3b7de7ed2d5d2d162831e1880837d8faf769d..79170041319dbcf02c11cede034c95d3acb52fcd 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for a sun 3 running os 4.
    Copyright (C) 1989, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m68k/xm-sun3.h"
 #define FPU
index fec953650c8a311b1857fbd07558f707a1edebda..8a8eaef9aaa4e9e0bfdeee4c13d636671dccc132 100644 (file)
@@ -1,21 +1,22 @@
 /* Native definitions for Motorola 88K running Harris CX/UX
    Copyright 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Override the standard fetch/store definitions.  */
 
@@ -28,5 +29,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define PTRACE_ATTACH 128
 #define PTRACE_DETACH 129
-
-
index 9c1a30eb2bc355555d23f99ea73241b9da12f000..1f8e3ee862a8b7873f20c17e759323410b8a2c3a 100644 (file)
@@ -1,21 +1,22 @@
 /* Native machine description for Motorola Delta 88 box, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m88k/nm-m88k.h"
 #include "nm-sysv4.h"
index 95eca0a00f96b08bf7865c0af049fcf8dc6da83c..4c402bd112772bba4e373fb27e20ab5360081369 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define FETCH_INFERIOR_REGISTERS
 
index e59c6dabfb9e3740e92ef3303f2f21fb2d9b79e8..b74f1224f5102182d3777317e798f6c4e06cbf05 100644 (file)
@@ -1,21 +1,22 @@
 /* Target definitions for m88k running Harris CX/UX.
    Copyright 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HARRIS_TARGET 1
 
@@ -23,9 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Type of X registers, as supplied by the OS */
 
-typedef struct {
-   long w1, w2, w3, w4;
-} X_REGISTER_RAW_TYPE;
+typedef struct
+  {
+    long w1, w2, w3, w4;
+  }
+X_REGISTER_RAW_TYPE;
 
 #define X_REGISTER_VIRTUAL_TYPE double
 
index c0a9c4a4f73593908168b50895e2e93297d06d34..cc6bab6478c1b81763108f54457e61714d6d2e07 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for Motorola Delta 88 box, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m88k/tm-m88k.h"
 
index 112a4a6d65b1eae8c8dbf24084ff31f016d85b1d..6804d9804df76e210cc65bc9066863287526867c 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for Motorola Delta 88 box, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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
 
index 0259c0b629197e4085f6344502aea0a78a4baded..1acb83e9584a309492a6ace92a948cbb61c3821e 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* g++ support is not yet included.  */
 
@@ -266,9 +267,9 @@ extern CORE_ADDR m88k_addr_bits_remove PARAMS ((CORE_ADDR));
 
 #define PC_REGNUM SXIP_REGNUM  /* Program Counter */
 #define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */
-#define NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
+#define NNPC_REGNUM SFIP_REGNUM        /* Next Next Program Counter */
 
-#define PSR_REGNUM 32           /* Processor Status Register */
+#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 */
@@ -502,18 +503,18 @@ extern CORE_ADDR frame_locals_address ();
    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 PARAMS((struct frame_info *fi,
-                                  struct frame_saved_regs *fsr));
+void frame_find_saved_regs PARAMS ((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)
-
 \f
+
 #define POP_FRAME pop_frame ()
 extern void pop_frame ();
 
@@ -521,7 +522,7 @@ extern void pop_frame ();
 
 #define CALL_DUMMY_LOCATION AFTER_TEXT_END
 
-extern void m88k_push_dummy_frame();
+extern void m88k_push_dummy_frame ();
 #define PUSH_DUMMY_FRAME       m88k_push_dummy_frame()
 
 #define CALL_DUMMY {                           \
@@ -597,11 +598,11 @@ extern void m88k_push_dummy_frame();
 /* 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.
+   ... 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
@@ -610,8 +611,8 @@ extern void m88k_push_dummy_frame();
    (presumably) give it a totally bogus value.
 
    -- Kevin Buettner
-*/
+ */
+
 #define TARGET_WRITE_PC(val, pid) { \
   write_register_pid(SXIP_REGNUM, (long) val, pid); \
   write_register_pid(SNIP_REGNUM, (long) val | 2, pid); \
index 582c613436be3da1266b554c7288f07eebca137d..86e209a3d84945249cf3b360789ceee9756de4a0 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m88k/xm-m88k.h"
 
@@ -32,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define x_fname _x_name
 #define USER ptrace_user
 /*
-#define _BSD_WAIT_FLAVOR
-*/
+   #define _BSD_WAIT_FLAVOR
+ */
 
 #define HAVE_TERMIO
 
@@ -63,4 +64,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define CORE_REGISTER_ADDR(regno, reg_ptr) \
    m88k_harris_core_register_addr(regno, reg_ptr)
-
index 21669473e606a2e0719a612bbd940b8692c93921..035abde1e95667ebc6b7725b53db8f726b50df80 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m88k/xm-m88k.h"
 
@@ -29,8 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define HAVE_TERMIO
 
-/*#define USIZE 2048*/
-/*#define NBPG NBPC*/
+/*#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 */
index 55c9e2de538c4051a6b9531e32483aadba24c5bb..ca4bd073a7699cfa2f83c55bddfb099d8ba13179 100644 (file)
@@ -1,21 +1,22 @@
 /* Host machine description for Motorola Delta 88 box, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "m88k/xm-m88k.h"
 
index b3608e7d5c7011d880364e8d72022ddb5daa4729..c96acb63000828e51b9141050f39227826f4299f 100644 (file)
@@ -2,21 +2,22 @@
    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.  */
+   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/xm-m88k.h"
 
index 35620a0ce01782be1c372dde551ee1dc27a0be84..68ae055417773a9291b43ecbe018d76faca63687 100644 (file)
@@ -1,20 +1,21 @@
 /* Host-machine dependent parameters for Motorola 88000, for GDB.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
index 3f4b06463c9e515fb595cb68fadce8f52375095e..ab195fb0cc88407dc1e2db7e923b5b78ffde9614 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for SGI irix3 native support.
    Copyright 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 /* Don't need special routines for Irix v3 -- we can use infptrace.c */
 #undef FETCH_INFERIOR_REGISTERS
index 017695ca295eed6aa4149a9ef18b172510f8a012..189dafe378e2c6e29a621446c7485b41c22936b5 100644 (file)
@@ -1,22 +1,23 @@
 /* Definitions for native support of irix4.
 
-Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Let's use /debug instead of all this dangerous mucking about
index 90d454bb418dd8d2af69860948bd1a5b3cebc1c4..3ab4d25a359ec8185b8089fd8d56f362c0a34bcc 100644 (file)
@@ -1,22 +1,23 @@
 /* Definitions for native support of irix5.
 
-Copyright (C) 1993, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "nm-sysv4.h"
 #undef IN_SOLIB_DYNSYM_RESOLVE_CODE
index 6418b86ee922282ff70f4a19f428114ea9d0f80f..5b4cfa85c39f68adb165208d0a4cbf0e772747d8 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin(af@cs.cmu.edu) at CMU
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
 #define FETCH_INFERIOR_REGISTERS
index 1ab63ba2b121ca7ffbb83aa53432e714b78ecf93..4cc4c98fcf85a9e3a2feabc085b86c0be65ac4b6 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin(af@cs.cmu.edu) at CMU
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_NEWS_MIPS_H
 #define NM_NEWS_MIPS_H 1
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define REGISTER_U_ADDR(addr, blockend, regno)                 \
        if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
-       else addr = 0; /* ..somewhere in the pcb */
+       else addr = 0;          /* ..somewhere in the pcb */
 
 /* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
 #define        ONE_PROCESS_WRITETEXT
@@ -39,4 +40,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Apparently not in <sys/types.h> */
 typedef int pid_t;
 
-#endif /* NM_NEWS_MIPS_H */
+#endif /* NM_NEWS_MIPS_H */
index 2d543455827437d5d432110a48570422bc9d6bf7..7f68b677092cdee208270c97587147694c7a426b 100644 (file)
@@ -1,16 +1,17 @@
 /* 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.  */
+   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.  */
 
 /* MIPS running RISC/os 4.52C.  */
 
index 271ceb0b363f119064fde28f70c0eaddf86429a8..7035b98e09ab0a8a6999471f7def8ede1917c90c 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1990 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
 
index 8b255a5a3260cf5082961e2a34196e8ce190b56e..a456d2004a735518c40dd53934cfc62edce5d22c 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1994 Free Software Foundation, Inc.
    Contributed by Ian Lance Taylor (ian@cygnus.com)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
 
index 7bf17597706aca9019cc424aeef5d40f23b262bf..af51a7fc138de4530a8472ee1360938e8248b08e 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 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 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 TARGET_BYTE_ORDER_SELECTABLE_P 1
 
index df90f58fa98b4717cf1d9fedfea5b7e674d3f68d..d1467d0ce0f8fc6fec6b2316ae0c0c85497bfe71 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 
index 23abcd9db84a42f3699bd9234420bdc4132a7b14..416a7e30510f2f977b8a1cf82418fc96b490e564 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 
index c7dca19532443930c9f0c2878b8253474e8f1116..77e368de90fc3aa2e112e9531a971f8310859394 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 
index c8a4775ef3f2fc95484f9b6ef48275650d4ab9a7..57c344e770e493b387e346f2f4bc811646e9df3f 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for SGI Iris under Irix, for GDB.
    Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "mips/tm-bigmips.h"
 
@@ -75,7 +76,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Offsets for register values in _sigtramp frame.
    sigcontext is immediately above the _sigtramp frame on Irix.  */
-#define SIGFRAME_BASE          0x0 
+#define SIGFRAME_BASE          0x0
 #define SIGFRAME_PC_OFF                (SIGFRAME_BASE + 2 * 4)
 #define SIGFRAME_REGSAVE_OFF   (SIGFRAME_BASE + 3 * 4)
 #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4)
index ad98e881859821641733d05ae8eec7720ff1cb1c..7f828c3aa9710e9f8d27e54758d574d481d48cda 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for SGI Iris under Irix 5, for GDB.
    Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "mips/tm-irix3.h"
 
@@ -43,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
         : builtin_type_int)
 
 #undef  MIPS_LAST_ARG_REGNUM
-#define MIPS_LAST_ARG_REGNUM 11  /* N32 uses R4 through R11 for args */
+#define MIPS_LAST_ARG_REGNUM 11        /* N32 uses R4 through R11 for args */
 
 #undef  MIPS_NUM_ARG_REGS
 #define MIPS_NUM_ARG_REGS 8
index 99a54498727293ea80cbb4948829408542029a93..fd0ae23e3e3474405eb7d61f83edf6f4779d1bce 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin (af@cs.cmu.edu) at CMU..
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_MIPS_H
 #define TM_MIPS_H 1
@@ -187,32 +188,32 @@ extern char *mips_register_name PARAMS ((int regnr));
 #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 */
-#  define MIPS_NUM_ARG_REGS 8
+#define MIPS_LAST_ARG_REGNUM 11        /* EABI uses R4 through R11 for args */
+#define MIPS_NUM_ARG_REGS 8
 #else
-#  define MIPS_LAST_ARG_REGNUM 7  /* old ABI uses R4 through R7 for args */
-#  define MIPS_NUM_ARG_REGS 4
+#define MIPS_LAST_ARG_REGNUM 7 /* old ABI uses R4 through R7 for args */
+#define MIPS_NUM_ARG_REGS 4
 #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 */
 #define PS_REGNUM 32           /* Contains processor status */
-#define HI_REGNUM 34            /* Multiple/divide temp */
-#define LO_REGNUM 33            /* ... */
+#define HI_REGNUM 34           /* Multiple/divide temp */
+#define LO_REGNUM 33           /* ... */
 #define BADVADDR_REGNUM 35     /* bad vaddr for addressing exception */
 #define CAUSE_REGNUM 36                /* describes last exception */
 #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 */
+#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)
-#  define MIPS_NUM_FP_ARG_REGS 8
-#else                          /* old ABI uses F12 through F15 for args */
-#  define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+15)
-#  define MIPS_NUM_FP_ARG_REGS 4
+#define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+19)
+#define MIPS_NUM_FP_ARG_REGS 8
+#else /* old ABI uses F12 through F15 for args */
+#define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+15)
+#define MIPS_NUM_FP_ARG_REGS 4
 #endif
-#define FCRCS_REGNUM 70         /* FP control/status */
-#define FCRIR_REGNUM 71         /* FP implementation/revision */
+#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 */
 #define        UNUSED_REGNUM 73        /* Never used, FIXME */
 #define        FIRST_EMBED_REGNUM 74   /* First CP0 register for embedded use */
@@ -294,7 +295,8 @@ extern void mips_do_registers_info PARAMS ((int, int));
 /* 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)  /**/
+#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,
@@ -303,7 +305,7 @@ extern void mips_do_registers_info PARAMS ((int, int));
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   mips_extract_return_value(TYPE, REGBUF, VALBUF)
 extern void
-mips_extract_return_value PARAMS ((struct type *, char [], char *));
+mips_extract_return_value PARAMS ((struct type *, char[], char *));
 
 /* Write into appropriate registers a function return value
    of type TYPE, given in virtual format.  */
@@ -378,8 +380,8 @@ extern int mips_frame_num_args PARAMS ((struct frame_info *));
     (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
   } while (0)
 extern void mips_find_saved_regs PARAMS ((struct frame_info *));
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 /* Stack must be aligned on 32-bit boundaries when synthesizing
@@ -422,7 +424,7 @@ extern CORE_ADDR mips_call_dummy_address PARAMS ((void));
 /* There's a mess in stack frame creation.  See comments in blockframe.c
    near reference to INIT_FRAME_PC_FIRST.  */
 
-#define        INIT_FRAME_PC(fromleaf, prev) /* nada */
+#define        INIT_FRAME_PC(fromleaf, prev)   /* nada */
 
 #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
    mips_init_frame_pc_first(fromleaf, prev)
@@ -438,18 +440,20 @@ extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
    This overlays the MIPS's PDR records, 
    mipsread.c (ab)uses this to save memory */
 
-typedef struct mips_extra_func_info {
-       long    numargs;        /* number of args to procedure (was iopt) */
-       bfd_vma high_addr;      /* upper address bound */
-       long    frame_adjust;   /* offset of FP from SP (used on MIPS16) */
-       PDR     pdr;            /* Procedure descriptor record */
-} *mips_extra_func_info_t;
+typedef struct mips_extra_func_info
+  {
+    long numargs;              /* number of args to procedure (was iopt) */
+    bfd_vma high_addr;         /* upper address bound */
+    long frame_adjust;         /* offset of FP from SP (used on MIPS16) */
+    PDR pdr;                   /* Procedure descriptor record */
+  }
+ *mips_extra_func_info_t;
 
 extern void mips_init_extra_frame_info PARAMS ((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 PARAMS ((struct frame_info *frame));
+extern void mips_print_extra_frame_info PARAMS ((struct frame_info * frame));
 #define        PRINT_EXTRA_FRAME_INFO(fi) \
   mips_print_extra_frame_info (fi)
 
@@ -508,8 +512,8 @@ extern char *mips_read_processor_type PARAMS ((void));
 #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 PARAMS ((CORE_ADDR pc,  char *name));
-extern int mips_in_return_stub PARAMS ((CORE_ADDR pc,  char *name));
+extern int mips_in_call_stub PARAMS ((CORE_ADDR pc, char *name));
+extern int mips_in_return_stub PARAMS ((CORE_ADDR pc, char *name));
 extern CORE_ADDR mips_skip_stub PARAMS ((CORE_ADDR pc));
 extern int mips_ignore_helper PARAMS ((CORE_ADDR pc));
 
@@ -519,7 +523,7 @@ extern int mips_ignore_helper PARAMS ((CORE_ADDR pc));
 
 /* Definitions and declarations used by mips-tdep.c and remote-mips.c  */
 #define MIPS_INSTLEN 4         /* Length of an instruction */
-#define MIPS16_INSTLEN 2       /* Length of an instruction on MIPS16*/
+#define MIPS16_INSTLEN 2       /* Length of an instruction on MIPS16 */
 #define MIPS_NUMREGS 32                /* Number of integer or float registers */
 typedef unsigned long t_inst;  /* Integer big enough to hold an instruction */
 
@@ -529,7 +533,7 @@ typedef unsigned long t_inst;       /* Integer big enough to hold an instruction */
 #define MAKE_MIPS16_ADDR(addr)  ((addr) | 1)
 #define UNMAKE_MIPS16_ADDR(addr) ((addr) & ~1)
 
-#endif /* TM_MIPS_H */
+#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
@@ -538,13 +542,13 @@ typedef unsigned long t_inst;     /* Integer big enough to hold an instruction */
    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
-*/
+   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) \
  { \
@@ -553,7 +557,7 @@ typedef unsigned long t_inst;       /* Integer big enough to hold an instruction */
     SYMBOL_VALUE_ADDRESS (msym) |= 1; \
   } \
  }
-   
+
 #define MSYMBOL_IS_SPECIAL(msym) \
   (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
 #define MSYMBOL_SIZE(msym) \
index 56a8927314dda88b66401f01eb934566b15d43ee..0031695ad089dde3b41bfdae6a47b29ecd331bcb 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1994, 1996 Free Software Foundation, Inc.
    Contributed by Ian Lance Taylor (ian@cygnus.com)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define GDB_TARGET_IS_MIPS64 1
 
@@ -31,8 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
         : builtin_type_long_long)
 
 /* Load double words in CALL_DUMMY.  */
-#define OP_LDFPR 065   /* ldc1 */
-#define OP_LDGPR 067   /* ld */
+#define OP_LDFPR 065           /* ldc1 */
+#define OP_LDGPR 067           /* ld */
 
 #if defined(MIPS_EABI) && (MIPS_EABI != 0)
 /* Define sizes for 64-bit data types, allow specific targets to override
index f73660479ffb4faa2c63784768eacd0becaec757..d1d0ea04a8b56a7730d8270d32e116b6ad2e5429 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on a mips box under Mach 3.0
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Mach specific definitions for little endian mips (e.g. pmax)
  * running Mach 3.0
@@ -43,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define MACHINE_CPROC_FP_OFFSET SAVED_FP
 
 /* Thread flavors used in setting the Trace state.
- *
+
  * In <mach/machine/thread_status.h>
  */
 #define TRACE_FLAVOR           MIPS_EXC_STATE
index dd7aaa16d9bdafd303b87ef21b270e2750072a5f..02e188c0b6c0a7e660175c491f3c7c23aa93d6cf 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for MIPS running SVR4, for GDB.
    Copyright 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "mips/tm-bigmips.h"
 #include "tm-sysv4.h"
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* The signal handler trampoline is called _sigtramp.  */
 #undef IN_SIGTRAMP
 #define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name))
+
 /* On entry to the signal handler trampoline, an ucontext is already
    pushed on the stack. We can get at the saved registers via the
    mcontext which is contained within the ucontext.  */
index 36d9e2b2888589e503594b9eda95d3c01c355884..e212a51d31b117eb9205c5fb4888cce6c10f728d 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define MIPS_EABI 1
index 8889553cc848b5cfd26dc44b2ec66ffa48cbb68d..5488830b5d757b9bf1916c916e250febe2c13ce3 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define MIPS_EABI 1
index 843f49c2222d12cbeb66381adf2b7ad595a0d868..c139f9743f1bef08e8a637e0e8ff587f219b6ec1 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define MIPS_EABI 1
index 541ca44611de0602155036ac07e6d2db28713149..273161ecc3049b08069576992e0df0b66aaea596 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define TARGET_MONITOR_PROMPT "<RISQ> "
index 75e8693dfbb6fd1ee7014f6b511fd08f95e182a1..1a938f3e6e75ccbd42f953cd04d2a74a8eea66a1 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define TARGET_MONITOR_PROMPT "<RISQ> "
index b834a7762fc8a588e4bf89721d9f7bf0338d6a38..39663102d8acbd5ac398a2013cc820c4a033d36b 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define TARGET_MONITOR_PROMPT "<RISQ> "
index c6897d12ee1dbf3592fe8ca61dd4d3b6493fbcf0..eae580450915d5a696f1323da444470844b61441 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER_SELECTABLE_P 1
 #define TARGET_MONITOR_PROMPT "<RISQ> "
index 3f45d7eed5c1d6bb6409f3922f71754957cd930d..e4ef2b6a2bd14b442ccb0ff4e0f7381c4ff5ccdc 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1996, 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.  */
+   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 "mips/tm-mips.h"
 #include "tm-vxworks.h"
index d096594c6be034d55a3ce352678c4e1c2f94aa78..a8fff39b4345435a41ea3776dac103dcb172cefc 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is for the iris. */
 
@@ -28,4 +29,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   if (regno < PC_REGNUM)                               \
       addr = regno;                                    \
   else                                                 \
-      addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
+      addr = regno + NSIG_HNDLRS;      /* Skip over signal handlers */
index 14d21f04fea6d384ef10d556fb3f30d2762e0207..5be86ed03691520e005adcd2cdbe6be41aa8b4da 100644 (file)
@@ -1,22 +1,23 @@
 /* Definitions for irix4 hosting support.
 
-Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is for the iris. */
 
index a64277b3142823e35c088defa66348ee336b22f8..9fe67861559280398ea060cce9b9792280b3a402 100644 (file)
@@ -1,22 +1,23 @@
 /* Definitions for irix5 hosting support.
 
-Copyright (C) 1993, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "xm-sysv4.h"
 
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   if (regno < PC_REGNUM)                               \
       addr = regno;                                    \
   else                                                 \
-      addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
+      addr = regno + NSIG_HNDLRS;      /* Skip over signal handlers */
 
 /* This enables reliable signals (and the associated setjmp/longjmp), and gives
    bsdish prototypes for getpgrp/setpgrg/setgroups and initgroups.  */
index a2e9a5099150bcb4506868171b3884d2ec78250f..2fad12b0ab78784780cac225653675bae63222c7 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin(af@cs.cmu.edu) at CMU
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (HOST_BYTE_ORDER)
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
@@ -35,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif
 
 #if ! defined (__STDC__) && ! defined (offsetof)
-# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
 #endif
 
 /* Only used for core files on DECstations.
index 6a5a73cd83347a5023a5e72c479569978a6506e7..5bb60096a200d7cc8c22d3fd2d6600f3ba180704 100644 (file)
@@ -3,30 +3,31 @@
    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin(af@cs.cmu.edu) at CMU
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (HOST_BYTE_ORDER)
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 #endif
 
-#define KERNEL_U_ADDR 0 /* Not needed. */
+#define KERNEL_U_ADDR 0                /* Not needed. */
 
 /* Only used for core files on DECstations. */
 
 #define REGISTER_U_ADDR(addr, blockend, regno)                 \
        if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
-       else addr = 0; /* ..somewhere in the pcb */
+       else addr = 0;          /* ..somewhere in the pcb */
index d80ba433e293e9e6ef5d8026e93b06a60ce2294a..d49593ff1135dfdc12267aaf5a71639c4c80500c 100644 (file)
@@ -1,22 +1,23 @@
 /* Definitions for MIPS running SVR4 hosting support.
 
-Copyright (C) 1994 Free Software Foundation, Inc.
+   Copyright (C) 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "xm-sysv4.h"
 
index 06aac1ad3b784ae7a6f9d21cc5c4720a4a93de10..25a2755ef9095548a4fd2836624ee7318da8aa4f 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
    and by Alessandro Forin(af@cs.cmu.edu) at CMU
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (HOST_BYTE_ORDER)
 #define HOST_BYTE_ORDER BIG_ENDIAN
index 467f32ac11bed235990319d8aa06b0a0a6f594bc..ae87de9393dab2bcd87ad984eae4deb0aa46f87b 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 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 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
 
index 94cd6ea336764551a26c43c15ab82e50efc90a34..082ab0eab6151fbe1b0bf346c589559e93f8c958 100644 (file)
@@ -3,21 +3,22 @@
 
    Contributed by Geoffrey Noer <noer@cygnus.com>
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The mn10200 is little endian.  */
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
@@ -105,7 +106,7 @@ extern void mn10200_init_extra_frame_info PARAMS ((struct frame_info *));
 #define INIT_FRAME_PC(x,y)
 
 extern void mn10200_frame_find_saved_regs PARAMS ((struct frame_info *,
-                                                  struct frame_saved_regs *));
+                                               struct frame_saved_regs *));
 #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
 
 extern CORE_ADDR mn10200_frame_chain PARAMS ((struct frame_info *));
@@ -113,7 +114,7 @@ extern CORE_ADDR mn10200_frame_chain PARAMS ((struct frame_info *));
 #define FRAME_CHAIN_VALID(FP, FI)      generic_frame_chain_valid (FP, FI)
 
 extern CORE_ADDR mn10200_find_callers_reg PARAMS ((struct frame_info *, int));
-extern CORE_ADDR mn10200_frame_saved_pc   PARAMS ((struct frame_info *));
+extern CORE_ADDR mn10200_frame_saved_pc PARAMS ((struct frame_info *));
 #define FRAME_SAVED_PC(FI) (mn10200_frame_saved_pc (FI))
 
 /* Extract from an array REGBUF containing the (raw) register state
@@ -191,8 +192,8 @@ extern CORE_ADDR mn10200_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 #define PUSH_DUMMY_FRAME       generic_push_dummy_frame ()
 
 extern CORE_ADDR
-mn10200_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
-                            unsigned char, CORE_ADDR));
+  mn10200_push_arguments PARAMS ((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))
 
index 20f93f4aa034dde9d7feee375bed15edef7ad02b..7a4482b5c57855e7801bf531fedd5f8398a209c1 100644 (file)
@@ -3,21 +3,22 @@
 
    Contributed by Geoffrey Noer <noer@cygnus.com>
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The mn10300 is little endian.  */
 #define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN
@@ -65,7 +66,7 @@ extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc;
 
 #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
 
-extern CORE_ADDR mn10300_saved_pc_after_call PARAMS ((struct frame_info *frame));
+extern CORE_ADDR mn10300_saved_pc_after_call PARAMS ((struct frame_info * frame));
 #define SAVED_PC_AFTER_CALL(frame) \
   mn10300_saved_pc_after_call (frame)
 
@@ -79,21 +80,21 @@ extern void mn10300_init_extra_frame_info PARAMS ((struct frame_info *));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi)
 #define INIT_FRAME_PC          /* Not necessary */
 
-#define FRAME_INIT_SAVED_REGS(fi) /* handled by init_extra_frame_info */
+#define FRAME_INIT_SAVED_REGS(fi)      /* handled by init_extra_frame_info */
 
 extern CORE_ADDR mn10300_frame_chain PARAMS ((struct frame_info *));
 #define FRAME_CHAIN(fi) mn10300_frame_chain (fi)
 #define FRAME_CHAIN_VALID(FP, FI)      generic_frame_chain_valid (FP, FI)
 
 extern CORE_ADDR mn10300_find_callers_reg PARAMS ((struct frame_info *, int));
-extern CORE_ADDR mn10300_frame_saved_pc   PARAMS ((struct frame_info *));
+extern CORE_ADDR mn10300_frame_saved_pc PARAMS ((struct frame_info *));
 #define FRAME_SAVED_PC(FI) (mn10300_frame_saved_pc (FI))
 
 /* 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. */
 
-extern void mn10300_extract_return_value PARAMS ((struct type *type, char *regbuf, char *valbuf));
+extern void mn10300_extract_return_value PARAMS ((struct type * type, char *regbuf, char *valbuf));
 #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
   mn10300_extract_return_value (TYPE, REGBUF, VALBUF)
 
@@ -101,7 +102,7 @@ CORE_ADDR mn10300_extract_struct_value_address PARAMS ((char *regbuf));
 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
   mn10300_extract_struct_value_address (REGBUF)
 
-void mn10300_store_return_value PARAMS ((struct type *type, char *valbuf));
+void mn10300_store_return_value PARAMS ((struct type * type, char *valbuf));
 #define STORE_RETURN_VALUE(TYPE, VALBUF) \
   mn10300_store_return_value (TYPE, VALBUF)
 
@@ -137,8 +138,8 @@ extern CORE_ADDR mn10300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 #define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP)
 
 extern CORE_ADDR
-mn10300_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
-                               unsigned char, CORE_ADDR ));
+  mn10300_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
+                                 unsigned char, CORE_ADDR));
 #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
   (mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
 
index 38a85f7accfcf5a6b0a1d5af2c60954b4e2f1eb6..acd75212d60f6423bcaed543f5ace15559bc4a91 100644 (file)
@@ -16,7 +16,8 @@
 
    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. */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA. */
 
 #ifndef __NM_GNU_H__
 #define __NM_GNU_H__
index 2daf0faaef8c0676390895923d8e0a4914b8a95f..e97b886971a90a662119df60e103d6a8cf937d4a 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_LYNX_H
 #define NM_LYNX_H
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define KERNEL_U_ADDR USRSTACK
 
-#undef FLOAT_INFO      /* No float info yet */
+#undef FLOAT_INFO              /* No float info yet */
 
 /* As of LynxOS 2.2.2 (beta 8/15/94), this is int.  Previous versions seem to
    have had no prototype, so I'm not sure why GDB used to define this to
@@ -69,7 +70,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "target.h"
 
-extern int child_wait PARAMS ((int pid, struct target_waitstatus *status));
+extern int child_wait PARAMS ((int pid, struct target_waitstatus * status));
 
 /* Lynx needs a special definition of this so that we can
    print out the pid and thread number seperatly.  */
index 6ea52565b947b72019418c75b25714c2cbafe052..5d89b63028ca4b53593a69ac399608d9ff0913d4 100644 (file)
@@ -2,21 +2,22 @@
 
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_M3_H
 #define NM_M3_H
@@ -42,7 +43,7 @@ extern int must_suspend_thread;
 #define PREPARE_TO_PROCEED(select_it) mach3_prepare_to_proceed(select_it)
 
 /* Try to get the privileged host port for authentication to machid
- *
+
  * If you can get this, you may debug anything on this host.
  *
  * If you can't, gdb gives it's own task port as the
@@ -93,10 +94,11 @@ extern int must_suspend_thread;
 /*
  * Top of emulator stack holds link and reply port.
  */
-struct emul_stack_top {
-       struct emul_stack_top   *link;
-       mach_port_t             reply_port;
-};
+struct emul_stack_top
+  {
+    struct emul_stack_top *link;
+    mach_port_t reply_port;
+  };
 
 #define EMULATOR_STACK_SIZE (4096*4)
 
index bc1d6a621ac71b7a87aca85d1a89a847186db88c..c7c1fb5c4d2cf098dbf27762880c0b4f959df234 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for NetBSD.
    Copyright 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is the amount to subtract from u.u_ar0
    to get the offset in the core file of the register values.  */
@@ -30,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define ATTACH_DETACH
 
-#include "solib.h"      /* Support for shared libraries. */
+#include "solib.h"             /* Support for shared libraries. */
 
 /* make structure definitions match up with those expected in solib.c */
 #define link_object    sod
index b891d4d91381119e48e4106a78390a088a3353ba..ea63e6874346f53ad0252a7110d4276068187fa2 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992, 1998 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.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 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.  */
 
 /* Use SVR4 style shared library support */
 
index 9d630f36e4ea276e834f0cf9c6e07879d0c693f9..4ee9a0be1f353e8f4b60c8747a694ba617e46734 100644 (file)
@@ -1,18 +1,19 @@
 /* Defines needed when configuring for "none".
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
index 4b16b3bc141053a43ef409074a43ce5afeb9d6b6..2cd7baf2f8ea676e344a1e8be578154837fea6e9 100644 (file)
@@ -1,21 +1,22 @@
 /* Defines needed when configuring for "none".
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This define is needed so that "gcc -MM" doesn't get errors and fail on
    source files that use the value of INNER_THAN in preprocessor lines. */
index 9d630f36e4ea276e834f0cf9c6e07879d0c693f9..4ee9a0be1f353e8f4b60c8747a694ba617e46734 100644 (file)
@@ -1,18 +1,19 @@
 /* Defines needed when configuring for "none".
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
index cef536e4050ec5b742bb9e9df1678303de7dbf62..e4aa02e25335afcc0c37b1795ba91c60cc65f2c3 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for ns32k running NetBSD, for GDB.
    Copyright 1986, 1987, 1989, 1992, 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.  */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_NBSD_H
 #define NM_NBSD_H
index add6e70f31b56ca8819849cce7bb756a0b793099..76f0c4193d2b31b69c1ba7ee7fcb02f5980ebbf7 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on an encore under umax 4.2
    Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Do implement the attach and detach commands...  */
 #define ATTACH_DETACH
index 907179fe68ad62150b300be85e2f53e5a685f15e..5fa06b8078c4d4b5342a99ef2e2f434e99604a15 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to target GDB to a merlin under utek 2.1
    Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
 
@@ -137,7 +138,7 @@ extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR));
     ((N) >= LP0_REGNUM ?       \
      builtin_type_double       \
      : builtin_type_float)     \
-   : builtin_type_int) 
+   : builtin_type_int)
 
 /* Store the address of the place in which to copy the structure the
    subroutine will return.  This is called from call_function.
@@ -192,7 +193,7 @@ extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR));
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
+extern int merlin_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (merlin_frame_num_args ((fi)))
 
 /* Return number of bytes at start of arglist that are not really args.  */
@@ -222,8 +223,8 @@ extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
   (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4;        \
   (frame_saved_regs).regs[FP_REGNUM]                           \
      = read_memory_integer ((frame_info)->frame, 4); }
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 /* Push an empty stack frame, to record the current PC, etc.  */
@@ -259,10 +260,10 @@ extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
 }
 
 /* This sequence of words is the instructions
-     enter     0xff,0          82 ff 00
-     jsr       @0x00010203     7f ae c0 01 02 03
-     adjspd    0x69696969      7f a5 01 02 03 04
-     bpt                       f2
+   enter        0xff,0          82 ff 00
+   jsr  @0x00010203     7f ae c0 01 02 03
+   adjspd       0x69696969      7f a5 01 02 03 04
+   bpt                  f2
    Note this is 16 bytes.  */
 
 #define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
index 6e61de31e5691fb7e9a97584f0eb939a08ecd078..e21de58742cedd35464367c2665345f33b7924f6 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for ns32k running under NetBSD.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Override number of expected traps from sysv. */
 #define START_INFERIOR_TRAPS_EXPECTED 2
@@ -76,4 +77,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define REGISTER_BYTE(N) (((N) < LP0_REGNUM? (N)\
                           : ((N) - LP0_REGNUM) & 1? (N) - 1 \
                           : ((N) - LP0_REGNUM + FP0_REGNUM)) * 4)
-
index 27d07d75cd5228af9033391469011617376da315..1d08aa7f59952fe2c97188906c2f34de2cb408ab 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for ns532, Mach 3.0
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Include common definitions for Mach3 systems */
 #include "nm-m3.h"
index dd59388a005cf929d76526bf5fcbaa53aff0ec51..392d3285cf059320bb24e222f04e3f7793760bfb 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on an encore under umax 4.2
    Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is also included by tm-ns32km3.h, as well as being used by umax.  */
 
@@ -64,11 +65,11 @@ extern CORE_ADDR umax_skip_prologue PARAMS ((CORE_ADDR));
 
 #define DECR_PC_AFTER_BREAK 0
 
-#if 0 /* Disable until fixed *correctly*.  */
+#if 0                          /* Disable until fixed *correctly*.  */
 #ifndef INVALID_FLOAT
 #ifndef NaN
 #include <nan.h>
-#endif NaN
+#endif /* NaN */
 
 /* Return 1 if P points to an invalid floating point value.  */
 /* Surely wrong for cross-debugging.  */
@@ -231,7 +232,7 @@ extern CORE_ADDR ns32k_get_enter_addr ();
    ways in the stack frame.  sp is even more special:
    the address we return for it IS the sp for the next frame.  */
 
-extern int umax_frame_num_args PARAMS ((struct frame_info *fi));
+extern int umax_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (umax_frame_num_args ((fi)))
 \f
 /* Things needed for making the inferior call functions.  */
@@ -269,10 +270,10 @@ extern int umax_frame_num_args PARAMS ((struct frame_info *fi));
 }
 
 /* This sequence of words is the instructions
-     enter     0xff,0          82 ff 00
-     jsr       @0x00010203     7f ae c0 01 02 03
-     adjspd    0x69696969      7f a5 01 02 03 04
-     bpt                       f2
+   enter        0xff,0          82 ff 00
+   jsr  @0x00010203     7f ae c0 01 02 03
+   adjspd       0x69696969      7f a5 01 02 03 04
+   bpt                  f2
    Note this is 16 bytes.  */
 
 #define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
index b8329f65d1bd31c620ff4bd66506eac4280473c4..83a810cafffd5d6f2c7c002a302f967fa171ba6c 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on a merlin under utek 2.1
    Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <machine/reg.h>
 
index db8c0bcff1a09c2c935d49e55370dbd52b538ebd..23a0650d280bc367966ffa912b6882f45fcda8de 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a ns32k running NetBSD, for GDB.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Get generic NetBSD host definitions. */
 #include "xm-nbsd.h"
index 3d08e67c82d71d1fe1b821badccca6cd409c84b7..45ec771005612f238ad829c1ac3b5cc119c8ac09 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on Mach 3 on an National ns32k
    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 1bb00714daffbb2d01be7c855bfea62b26502117..b7f4dad6dc10ac5fdfa35af683ac455a06e60afb 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on an encore under umax 4.2
    Copyright 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
 
@@ -23,4 +24,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Doesn't have siginterupt.  */
 #define NO_SIGINTERRUPT
-
index 6b6367419c0e463484a45a0faa4ebda8029114df..bf008e5c6f17959ad1a54994573e77754f9f68e9 100644 (file)
@@ -1,21 +1,22 @@
 /* HPPA PA-RISC machine native support for BSD, for GDB.
    Copyright 1991, 1992 Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "somsolib.h"
 
@@ -74,7 +75,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    it possible for the kernel to easily decide if a trap was caused
    by a watchpoint or by the user writing to protected memory and can
    signal the user program differently in each case.  
-   
+
    Second, the PA has a bit in the processor status word which causes
    data memory breakpoints (aka watchpoints) to be disabled for a single
    instruction.  This bit can be used to avoid the overhead of unprotecting
@@ -97,7 +98,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    fired because of a write to an address on the same page as a watchpoint,
    but no write to the watched address occured).  */
 
-#define TARGET_HAS_HARDWARE_WATCHPOINTS        /* Enable the code in procfs.c */
+#define TARGET_HAS_HARDWARE_WATCHPOINTS                /* Enable the code in procfs.c */
 
 /* The PA can watch any number of locations, there's no need for it to reject
    anything (generic routines already check that all intermediates are
index c14c0648b91071b255ada0cc615f4d8a58d792a3..9d0866ce1a861c4bf3d51f5d5557aa3c0298d5bd 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for HPPA-RISC machine running HPUX, for GDB.
    Copyright 1991, 1992 Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define U_REGS_OFFSET 0
 
@@ -57,7 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* While this is for use by threaded programs, it doesn't appear
  * to hurt non-threaded ones.  This is used in infrun.c: */
 #define PREPARE_TO_PROCEED(select_it) hppa_prepare_to_proceed()
-extern int hppa_prepare_to_proceed PARAMS(( void ));
+extern int hppa_prepare_to_proceed PARAMS ((void));
 
 /* In infptrace.c or infttrace.c: */
 #define CHILD_PID_TO_EXEC_FILE
@@ -82,7 +83,7 @@ extern int hppa_prepare_to_proceed PARAMS(( void ));
 extern int hppa_require_attach PARAMS ((int));
 
 #define REQUIRE_DETACH(pid,signal) hppa_require_detach(pid,signal)
-extern int hppa_require_detach PARAMS ((int,int));
+extern int hppa_require_detach PARAMS ((int, int));
 
 /* So we can cleanly use code in infptrace.c.  */
 #define PT_KILL                PT_EXIT
@@ -193,14 +194,14 @@ extern int hppa_require_detach PARAMS ((int,int));
 
    infptrace.c supplies dummy versions of these; infttrace.c is where the
    meaningful implementations are.
  */
+ */
 #define TARGET_ENABLE_HW_WATCHPOINTS(pid) \
         hppa_enable_page_protection_events (pid)
-extern void  hppa_enable_page_protection_events PARAMS ((int));
+extern void hppa_enable_page_protection_events PARAMS ((int));
 
 #define TARGET_DISABLE_HW_WATCHPOINTS(pid) \
         hppa_disable_page_protection_events (pid)
-extern void  hppa_disable_page_protection_events PARAMS ((int));
+extern void hppa_disable_page_protection_events PARAMS ((int));
 
 /* Use these macros for watchpoint insertion/deletion.  */
 #define target_insert_watchpoint(addr, len, type) \
@@ -215,11 +216,11 @@ extern void  hppa_disable_page_protection_events PARAMS ((int));
  */
 #define target_pid_to_str( pid ) \
         hppa_pid_to_str( pid )
-extern char * hppa_pid_to_str PARAMS ((pid_t));
+extern char *hppa_pid_to_str PARAMS ((pid_t));
 
 #define target_tid_to_str( pid ) \
         hppa_tid_to_str( pid )
-extern char * hppa_tid_to_str PARAMS ((pid_t));
+extern char *hppa_tid_to_str PARAMS ((pid_t));
 
 /* For this, ID can be either a process or thread ID, and the function
    will describe it appropriately, returning the description as a printable
@@ -227,10 +228,10 @@ extern char * hppa_tid_to_str PARAMS ((pid_t));
 
    The function that implements this macro is defined in infptrace.c and
    infttrace.c.
  */
+ */
 #define target_pid_or_tid_to_str(ID) \
         hppa_pid_or_tid_to_str (ID)
-extern char * hppa_pid_or_tid_to_str PARAMS ((pid_t));
+extern char *hppa_pid_or_tid_to_str PARAMS ((pid_t));
 
 /* This is used when handling events caused by a call to vfork().  On ptrace-
    based HP-UXs, when you resume the vforked child, the parent automagically
@@ -240,15 +241,15 @@ extern char * hppa_pid_or_tid_to_str PARAMS ((pid_t));
 
    1. the vfork event for the new child process
    2. the exit or exec event of the new child process (actually, you get
-      two exec events on ptrace-based HP-UXs)
+   two exec events on ptrace-based HP-UXs)
    3. the vfork event for the original parent process
 
    The first is always received first.  The other two may be received in any
    order; HP-UX doesn't guarantee an order.
  */
+ */
 #define ENSURE_VFORKING_PARENT_REMAINS_STOPPED(PID) \
         hppa_ensure_vforking_parent_remains_stopped (PID)
-extern void  hppa_ensure_vforking_parent_remains_stopped PARAMS((int));
+extern void hppa_ensure_vforking_parent_remains_stopped PARAMS ((int));
 
 /* This is used when handling events caused by a call to vfork().
 
@@ -259,10 +260,10 @@ extern void  hppa_ensure_vforking_parent_remains_stopped PARAMS((int));
    On ptrace-based HP-UXs, you must resume the child after its exec event is
    delivered or you won't get the parent's vfork.  I.e., you can't just wait()
    and get the parent vfork, after receiving the child exec.
  */
+ */
 #define RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK() \
         hppa_resume_execd_vforking_child_to_get_parent_vfork ()
-extern int  hppa_resume_execd_vforking_child_to_get_parent_vfork PARAMS ((void));
+extern int hppa_resume_execd_vforking_child_to_get_parent_vfork PARAMS ((void));
 
 #ifdef HAVE_HPUX_THREAD_SUPPORT
 
@@ -270,7 +271,7 @@ extern int  hppa_resume_execd_vforking_child_to_get_parent_vfork PARAMS ((void))
 struct objfile;
 #endif
 
-void hpux_thread_new_objfile PARAMS ((struct objfile *objfile));
+void hpux_thread_new_objfile PARAMS ((struct objfile * objfile));
 #define target_new_objfile(OBJFILE) hpux_thread_new_objfile (OBJFILE)
 
 extern char *hpux_pid_to_str PARAMS ((int pid));
@@ -285,4 +286,3 @@ extern char *hpux_pid_to_str PARAMS ((int pid));
 #define MAY_FOLLOW_EXEC (1)
 
 #define USE_THREAD_STEP_NEEDED (1)
-
index 7a73c241b7e1b7581e7e91add89dc3e44f6fc225..2c2b507a4366de99b77d4050abaf4e108e42cbf9 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for HPPA-RISC machine running HPUX 11.x, for GDB.
    Copyright 1998 Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define GDB_NATIVE_HPUX_11
 
index a09dfd1c14c61b319745178cf038fedc24b4f06b..c0d755eb4681cda04769f388c39354c43feb72a5 100644 (file)
@@ -1,21 +1,22 @@
 /* HPPA PA-RISC machine native support for Lites, for GDB.
    Copyright 1995 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 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 "nm-m3.h"
 #define U_REGS_OFFSET 0
index ec83395d656a6a16f7bccf092a70b75905bc9142..f284a18900414fcd855447b0c11d3ec7e58471f1 100644 (file)
@@ -5,21 +5,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Forward declarations of some types we use in prototypes */
 
@@ -68,7 +69,7 @@ struct inferior_status;
    Zero on most machines.  */
 
 #define FUNCTION_START_OFFSET 0
-     
+
 /* Advance PC across any function entry prologue instructions
    to reach some "real" code.  */
 
@@ -105,10 +106,10 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *));
 
 /* elz: adjust the quantity to the next highest value which is 64-bit aligned.
    This is used in valops.c, when the sp is adjusted.
-   On hppa the sp must always be kept 64-bit aligned*/
+   On hppa the sp must always be kept 64-bit aligned */
 
 #define STACK_ALIGN(arg) ( ((arg)%8) ? (((arg)+7)&-8) : (arg))
-#define NO_EXTRA_ALIGNMENT_NEEDED 1 
+#define NO_EXTRA_ALIGNMENT_NEEDED 1
 
 /* Sequence of bytes for breakpoint instruction.  */
 
@@ -145,11 +146,11 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *));
    is of these "really, truly negative" addresses that come from the
    minimal symbols, I'm resorting to the gross hack of checking the
    top byte of the address for all 1's.  Sigh.
  */
+ */
 #define PC_REQUIRES_RUN_BEFORE_USE(pc) \
   (! target_has_stack && (pc & 0xFF000000))
 
-/* return instruction is bv r0(rp) or bv,n r0(rp)*/
+/* return instruction is bv r0(rp) or bv,n r0(rp) */
 
 #define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 4) | 0x2) == 0xE840C002)
 
@@ -212,14 +213,14 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *));
 #define RCR_REGNUM 51          /* Recover Counter (also known as cr0) */
 #define CCR_REGNUM 54          /* Coprocessor Configuration Register */
 #define TR0_REGNUM 57          /* Temporary Registers (cr24 -> cr31) */
-#define CR27_REGNUM 60          /* Base register for thread-local storage, cr27 */
-#define FP0_REGNUM 64          /* floating point reg. 0 (fspr)*/
+#define CR27_REGNUM 60         /* Base register for thread-local storage, cr27 */
+#define FP0_REGNUM 64          /* floating point reg. 0 (fspr) */
 #define FP4_REGNUM 72
 
-#define ARG0_REGNUM 26          /* The first argument of a callee. */
-#define ARG1_REGNUM 25          /* The second argument of a callee. */
-#define ARG2_REGNUM 24          /* The third argument of a callee. */
-#define ARG3_REGNUM 23          /* The fourth argument of a callee. */
+#define ARG0_REGNUM 26         /* The first argument of a callee. */
+#define ARG1_REGNUM 25         /* The second argument of a callee. */
+#define ARG2_REGNUM 24         /* The third argument of a callee. */
+#define ARG3_REGNUM 23         /* The fourth argument of a callee. */
 
 /* compatibility with the rest of gdb. */
 #define PC_REGNUM PCOQ_HEAD_REGNUM
@@ -229,22 +230,22 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *));
  * Processor Status Word Masks
  */
 
-#define PSW_T   0x01000000      /* Taken Branch Trap Enable */
-#define PSW_H   0x00800000      /* Higher-Privilege Transfer Trap Enable */
-#define PSW_L   0x00400000      /* Lower-Privilege Transfer Trap Enable */
-#define PSW_N   0x00200000      /* PC Queue Front Instruction Nullified */
-#define PSW_X   0x00100000      /* Data Memory Break Disable */
-#define PSW_B   0x00080000      /* Taken Branch in Previous Cycle */
-#define PSW_C   0x00040000      /* Code Address Translation Enable */
-#define PSW_V   0x00020000      /* Divide Step Correction */
-#define PSW_M   0x00010000      /* High-Priority Machine Check Disable */
-#define PSW_CB  0x0000ff00      /* Carry/Borrow Bits */
-#define PSW_R   0x00000010      /* Recovery Counter Enable */
-#define PSW_Q   0x00000008      /* Interruption State Collection Enable */
-#define PSW_P   0x00000004      /* Protection ID Validation Enable */
-#define PSW_D   0x00000002      /* Data Address Translation Enable */
-#define PSW_I   0x00000001      /* External, Power Failure, Low-Priority */
-                                /* Machine Check Interruption Enable */
+#define PSW_T   0x01000000     /* Taken Branch Trap Enable */
+#define PSW_H   0x00800000     /* Higher-Privilege Transfer Trap Enable */
+#define PSW_L   0x00400000     /* Lower-Privilege Transfer Trap Enable */
+#define PSW_N   0x00200000     /* PC Queue Front Instruction Nullified */
+#define PSW_X   0x00100000     /* Data Memory Break Disable */
+#define PSW_B   0x00080000     /* Taken Branch in Previous Cycle */
+#define PSW_C   0x00040000     /* Code Address Translation Enable */
+#define PSW_V   0x00020000     /* Divide Step Correction */
+#define PSW_M   0x00010000     /* High-Priority Machine Check Disable */
+#define PSW_CB  0x0000ff00     /* Carry/Borrow Bits */
+#define PSW_R   0x00000010     /* Recovery Counter Enable */
+#define PSW_Q   0x00000008     /* Interruption State Collection Enable */
+#define PSW_P   0x00000004     /* Protection ID Validation Enable */
+#define PSW_D   0x00000002     /* Data Address Translation Enable */
+#define PSW_I   0x00000001     /* External, Power Failure, Low-Priority */
+                               /* Machine Check Interruption Enable */
 
 /* When fetching register values from an inferior or a core file,
    clean them up using this macro.  BUF is a char pointer to
@@ -347,7 +348,7 @@ extern void pa_do_strcat_registers_info PARAMS ((int, int, GDB_FILE *, enum prec
     fr4: floating point up to 64 bits
     sr1: space identifier (32-bit)
     stack: any lager than 64-bit, with the address in r28
- */
 */
 extern use_struct_convention_fn hppa_use_struct_convention;
 #define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
 
@@ -384,7 +385,7 @@ extern use_struct_convention_fn hppa_use_struct_convention;
    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.
-*/
+ */
 #define VALUE_RETURNED_FROM_STACK(valtype,addr) \
   hppa_value_returned_from_stack (valtype, addr)
 
@@ -441,7 +442,7 @@ extern int hppa_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
   (frameless_function_invocation (FI))
 extern int frameless_function_invocation PARAMS ((struct frame_info *));
 
-extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info *frame));
+extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info * frame));
 #define FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
 
 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
@@ -463,8 +464,8 @@ extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info *frame));
 extern void
 hppa_frame_find_saved_regs PARAMS ((struct frame_info *,
                                    struct frame_saved_regs *));
-
 \f
+
 /* Things needed for making the inferior call functions.  */
 
 /* Push an empty stack frame, to record the current PC, etc. */
@@ -486,40 +487,40 @@ extern void hppa_pop_frame PARAMS ((void));
 
 /* This sequence of words is the instructions
 
-; Call stack frame has already been built by gdb. Since we could be calling 
-; a varargs function, and we do not have the benefit of a stub to put things in
-; the right place, we load the first 4 word of arguments into both the general
-; and fp registers.
-call_dummy
-       ldw -36(sp), arg0
-       ldw -40(sp), arg1
-       ldw -44(sp), arg2
-       ldw -48(sp), arg3
-       ldo -36(sp), r1
-       fldws 0(0, r1), fr4
-       fldds -4(0, r1), fr5
-       fldws -8(0, r1), fr6
-       fldds -12(0, r1), fr7
-       ldil 0, r22                     ; FUNC_LDIL_OFFSET must point here
-       ldo 0(r22), r22                 ; FUNC_LDO_OFFSET must point here
-       ldsid (0,r22), r4
-       ldil 0, r1                      ; SR4EXPORT_LDIL_OFFSET must point here
-       ldo 0(r1), r1                   ; SR4EXPORT_LDO_OFFSET must point here
-       ldsid (0,r1), r20
-       combt,=,n r4, r20, text_space   ; If target is in data space, do a
-       ble 0(sr5, r22)                 ; "normal" procedure call
-       copy r31, r2
-       break 4, 8 
-       mtsp r21, sr0
-       ble,n 0(sr0, r22)
-text_space                             ; Otherwise, go through _sr4export,
-       ble (sr4, r1)                   ; which will return back here.
-       stw r31,-24(r30)
-       break 4, 8
-       mtsp r21, sr0
-       ble,n 0(sr0, r22)
-       nop                             ; To avoid kernel bugs 
-       nop                             ; and keep the dummy 8 byte aligned
+   ; Call stack frame has already been built by gdb. Since we could be calling 
+   ; a varargs function, and we do not have the benefit of a stub to put things in
+   ; the right place, we load the first 4 word of arguments into both the general
+   ; and fp registers.
+   call_dummy
+   ldw -36(sp), arg0
+   ldw -40(sp), arg1
+   ldw -44(sp), arg2
+   ldw -48(sp), arg3
+   ldo -36(sp), r1
+   fldws 0(0, r1), fr4
+   fldds -4(0, r1), fr5
+   fldws -8(0, r1), fr6
+   fldds -12(0, r1), fr7
+   ldil 0, r22                  ; FUNC_LDIL_OFFSET must point here
+   ldo 0(r22), r22                      ; FUNC_LDO_OFFSET must point here
+   ldsid (0,r22), r4
+   ldil 0, r1                   ; SR4EXPORT_LDIL_OFFSET must point here
+   ldo 0(r1), r1                        ; SR4EXPORT_LDO_OFFSET must point here
+   ldsid (0,r1), r20
+   combt,=,n r4, r20, text_space        ; If target is in data space, do a
+   ble 0(sr5, r22)                      ; "normal" procedure call
+   copy r31, r2
+   break 4, 8 
+   mtsp r21, sr0
+   ble,n 0(sr0, r22)
+   text_space                           ; Otherwise, go through _sr4export,
+   ble (sr4, r1)                        ; which will return back here.
+   stw r31,-24(r30)
+   break 4, 8
+   mtsp r21, sr0
+   ble,n 0(sr0, r22)
+   nop                          ; To avoid kernel bugs 
+   nop                          ; and keep the dummy 8 byte aligned
 
    The dummy decides if the target is in text space or data space. If
    it's in data space, there's no problem because the target can
@@ -570,21 +571,21 @@ text_space                                ; Otherwise, go through _sr4export,
    registers (or floating point??), so we skip all that inter-space call stuff,
    and avoid touching the fp regs.
 
-call_dummy
-
-       ldw -36(%sp), %arg0
-       ldw -40(%sp), %arg1
-       ldw -44(%sp), %arg2
-       ldw -48(%sp), %arg3
-       ldil 0, %r31                    ; FUNC_LDIL_OFFSET must point here
-       ldo 0(%r31), %r31               ; FUNC_LDO_OFFSET must point here
-       ble 0(%sr0, %r31)
-       copy %r31, %r2
-       break 4, 8 
-       nop                             ; restore_pc_queue expects these
-       bv,n 0(%r22)                    ; instructions to be here...
-       nop
-*/
+   call_dummy
+
+   ldw -36(%sp), %arg0
+   ldw -40(%sp), %arg1
+   ldw -44(%sp), %arg2
+   ldw -48(%sp), %arg3
+   ldil 0, %r31                 ; FUNC_LDIL_OFFSET must point here
+   ldo 0(%r31), %r31            ; FUNC_LDO_OFFSET must point here
+   ble 0(%sr0, %r31)
+   copy %r31, %r2
+   break 4, 8 
+   nop                          ; restore_pc_queue expects these
+   bv,n 0(%r22)                 ; instructions to be here...
+   nop
+ */
 
 /* Define offsets into the call dummy for the target function address */
 #define FUNC_LDIL_OFFSET (INSTRUCTION_SIZE * 4)
@@ -620,14 +621,14 @@ call_dummy
 #define FIX_CALL_DUMMY hppa_fix_call_dummy
 
 extern CORE_ADDR
-hppa_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, int,
-                            struct value **, struct type *, int));
+  hppa_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, int,
+                              struct value **, struct type *, int));
 
 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
   (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
 extern CORE_ADDR
-hppa_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int,
-                            CORE_ADDR));
+  hppa_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int,
+                              CORE_ADDR));
 \f
 /* The low two bits of the PC on the PA contain the privilege level.  Some
    genius implementing a (non-GCC) compiler apparently decided this means
@@ -645,51 +646,54 @@ hppa_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int,
  * Unwind table and descriptor.
  */
 
-struct unwind_table_entry {
-  unsigned int region_start;
-  unsigned int region_end;
-
-  unsigned int Cannot_unwind         :  1;                      /* 0 */
-  unsigned int Millicode             :  1;                      /* 1 */
-  unsigned int Millicode_save_sr0    :  1;                      /* 2 */
-  unsigned int Region_description    :  2;                      /* 3..4 */
-  unsigned int reserved1             :  1;                      /* 5 */
-  unsigned int Entry_SR              :  1;                      /* 6 */
-  unsigned int Entry_FR              :  4; /* number saved */   /* 7..10 */
-  unsigned int Entry_GR              :  5; /* number saved */   /* 11..15 */
-  unsigned int Args_stored           :  1;                      /* 16 */
-  unsigned int Variable_Frame       :  1;                      /* 17 */
-  unsigned int Separate_Package_Body :  1;                      /* 18 */
-  unsigned int Frame_Extension_Millicode:1;                     /* 19 */
-  unsigned int Stack_Overflow_Check  :  1;                      /* 20 */
-  unsigned int Two_Instruction_SP_Increment:1;                  /* 21 */
-  unsigned int Ada_Region           :  1;                      /* 22 */
-  unsigned int cxx_info              :  1;                      /* 23 */
-  unsigned int cxx_try_catch         :  1;                      /* 24 */
-  unsigned int sched_entry_seq       :  1;                      /* 25 */
-  unsigned int reserved2            :  1;                      /* 26 */
-  unsigned int Save_SP               :  1;                      /* 27 */
-  unsigned int Save_RP               :  1;                      /* 28 */
-  unsigned int Save_MRP_in_frame     :  1;                      /* 29 */
-  unsigned int extn_ptr_defined      :  1;                      /* 30 */
-  unsigned int Cleanup_defined       :  1;                      /* 31 */
-
-  unsigned int MPE_XL_interrupt_marker: 1;                      /* 0 */
-  unsigned int HP_UX_interrupt_marker:  1;                      /* 1 */
-  unsigned int Large_frame          :  1;                      /* 2 */
-  unsigned int Pseudo_SP_Set         :  1;                      /* 3 */
-  unsigned int reserved4             :  1;                      /* 4 */
-  unsigned int Total_frame_size      : 27;                      /* 5..31 */
-
-  /* This is *NOT* part of an actual unwind_descriptor in an object
-     file.  It is *ONLY* part of the "internalized" descriptors that
-     we create from those in a file.
+struct unwind_table_entry
+  {
+    unsigned int region_start;
+    unsigned int region_end;
+
+    unsigned int Cannot_unwind:1;      /* 0 */
+    unsigned int Millicode:1;  /* 1 */
+    unsigned int Millicode_save_sr0:1; /* 2 */
+    unsigned int Region_description:2; /* 3..4 */
+    unsigned int reserved1:1;  /* 5 */
+    unsigned int Entry_SR:1;   /* 6 */
+    unsigned int Entry_FR:4;   /* number saved *//* 7..10 */
+    unsigned int Entry_GR:5;   /* number saved *//* 11..15 */
+    unsigned int Args_stored:1;        /* 16 */
+    unsigned int Variable_Frame:1;     /* 17 */
+    unsigned int Separate_Package_Body:1;      /* 18 */
+    unsigned int Frame_Extension_Millicode:1;  /* 19 */
+    unsigned int Stack_Overflow_Check:1;       /* 20 */
+    unsigned int Two_Instruction_SP_Increment:1;       /* 21 */
+    unsigned int Ada_Region:1; /* 22 */
+    unsigned int cxx_info:1;   /* 23 */
+    unsigned int cxx_try_catch:1;      /* 24 */
+    unsigned int sched_entry_seq:1;    /* 25 */
+    unsigned int reserved2:1;  /* 26 */
+    unsigned int Save_SP:1;    /* 27 */
+    unsigned int Save_RP:1;    /* 28 */
+    unsigned int Save_MRP_in_frame:1;  /* 29 */
+    unsigned int extn_ptr_defined:1;   /* 30 */
+    unsigned int Cleanup_defined:1;    /* 31 */
+
+    unsigned int MPE_XL_interrupt_marker:1;    /* 0 */
+    unsigned int HP_UX_interrupt_marker:1;     /* 1 */
+    unsigned int Large_frame:1;        /* 2 */
+    unsigned int Pseudo_SP_Set:1;      /* 3 */
+    unsigned int reserved4:1;  /* 4 */
+    unsigned int Total_frame_size:27;  /* 5..31 */
+
+    /* This is *NOT* part of an actual unwind_descriptor in an object
+       file.  It is *ONLY* part of the "internalized" descriptors that
+       we create from those in a file.
      */
-  struct {
-    unsigned int  stub_type          : 4;                       /* 0..3 */
-    unsigned int  padding            : 28;                      /* 4..31 */
-  } stub_unwind;
-};
+    struct
+      {
+       unsigned int stub_type:4;       /* 0..3 */
+       unsigned int padding:28;        /* 4..31 */
+      }
+    stub_unwind;
+  };
 
 /* HP linkers also generate unwinds for various linker-generated stubs.
    GDB reads in the stubs from the $UNWIND_END$ subspace, then 
@@ -697,19 +701,19 @@ struct unwind_table_entry {
    fields to store the stub type.  */
 
 struct stub_unwind_entry
-{
-  /* The offset within the executable for the associated stub.  */
-  unsigned stub_offset;
+  {
+    /* The offset within the executable for the associated stub.  */
+    unsigned stub_offset;
 
-  /* The type of stub this unwind entry describes.  */
-  char type;
+    /* The type of stub this unwind entry describes.  */
+    char type;
 
-  /* Unknown.  Not needed by GDB at this time.  */
-  char prs_info;
+    /* Unknown.  Not needed by GDB at this time.  */
+    char prs_info;
 
-  /* Length (in instructions) of the associated stub.  */
-  short stub_length;
-};
+    /* Length (in instructions) of the associated stub.  */
+    short stub_length;
+  };
 
 /* Sizes (in bytes) of the native unwind entries.  */
 #define UNWIND_ENTRY_SIZE 16
@@ -718,61 +722,65 @@ struct stub_unwind_entry
 /* The gaps represent linker stubs used in MPE and space for future
    expansion.  */
 enum unwind_stub_types
-{
-  LONG_BRANCH = 1,
-  PARAMETER_RELOCATION = 2,
-  EXPORT = 10,
-  IMPORT = 11,
-  IMPORT_SHLIB = 12,
-};
+  {
+    LONG_BRANCH = 1,
+    PARAMETER_RELOCATION = 2,
+    EXPORT = 10,
+    IMPORT = 11,
+    IMPORT_SHLIB = 12,
+  };
 
 /* We use the objfile->obj_private pointer for two things:
- *
+
  * 1.  An unwind table;
  *
  * 2.  A pointer to any associated shared library object.
  *
  * #defines are used to help refer to these objects.
  */
+
 /* Info about the unwind table associated with an object file.
- *
+
  * This is hung off of the "objfile->obj_private" pointer, and
  * is allocated in the objfile's psymbol obstack.  This allows
  * us to have unique unwind info for each executable and shared
  * library that we are debugging.
  */
-struct obj_unwind_info {
-  struct unwind_table_entry *table; /* Pointer to unwind info */
-  struct unwind_table_entry *cache; /* Pointer to last entry we found */
-  int last;                        /* Index of last entry */
-};
-
-typedef struct obj_private_struct {
-   struct obj_unwind_info *unwind_info; /* a pointer */
-   struct so_list         *so_info;     /* a pointer  */
-} obj_private_data_t;
+struct obj_unwind_info
+  {
+    struct unwind_table_entry *table;  /* Pointer to unwind info */
+    struct unwind_table_entry *cache;  /* Pointer to last entry we found */
+    int last;                  /* Index of last entry */
+  };
+
+typedef struct obj_private_struct
+  {
+    struct obj_unwind_info *unwind_info;       /* a pointer */
+    struct so_list *so_info;   /* a pointer  */
+  }
+obj_private_data_t;
 
 #if 0
-extern void target_write_pc PARAMS ((CORE_ADDR, int))
-extern CORE_ADDR target_read_pc PARAMS ((int));
-extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *));
+extern void target_write_pc
+PARAMS ((CORE_ADDR, int))
+     extern CORE_ADDR target_read_pc PARAMS ((int));
+     extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *));
 #endif
 
 #define TARGET_READ_PC(pid) target_read_pc (pid)
-extern CORE_ADDR target_read_pc PARAMS ((int));
+     extern CORE_ADDR target_read_pc PARAMS ((int));
 
 #define TARGET_WRITE_PC(v,pid) target_write_pc (v,pid)
-extern void target_write_pc PARAMS ((CORE_ADDR, int));
+     extern void target_write_pc PARAMS ((CORE_ADDR, int));
 
 #define TARGET_READ_FP() target_read_fp (inferior_pid)
-extern CORE_ADDR  target_read_fp PARAMS ((int));
+     extern CORE_ADDR target_read_fp PARAMS ((int));
 
 /* For a number of horrible reasons we may have to adjust the location
    of variables on the stack.  Ugh.  */
 #define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
 
-extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR));
+     extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR));
 
 /* If the current gcc for for this target does not produce correct debugging
    information for float parameters, both prototyped and unprototyped, then
index a8f11668c57774bd3f81c1005cca74467b5d205c..d6906bf09256d56d6975546ac969f23734946b9e 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 HPUX_SNAP1
 #define HPUX_SNAP2
index 7df4247474469979ef0ebb1a6e448637fb980740..2e87efa9c45ebbb07727aad072e4a7342c37fb4a 100644 (file)
@@ -12,7 +12,7 @@
 /*
  * Software defined PSW masks.
  */
-#define PSW_SS  0x10000000      /* Kernel managed single step */
+#define PSW_SS  0x10000000     /* Kernel managed single step */
 
 /* Thread flavors used in re-setting the T bit.
  * @@ this is also bad for cross debugging.
@@ -89,7 +89,7 @@
         write_register(IPSW_REGNUM, ipsw & ~(PSW_N | PSW_B | PSW_X)); \
         stop_pc = pcoqt; \
       } \
-   }), 0) 
+   }), 0)
 
 /* It's mostly just the common stuff.  */
 
index 9f6467fcf0aca9184d5fa048c6eb3e4c9cbd3e64..d3b6b7aae4279655985cadd46bf41715c103a43b 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 a big-endian host.  */
 
index 2cd47ddcf03215eab588ab96cc82559839f9df5a..1542d327035a50df0b35195d684199d808e3a3f6 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Host is big-endian. */
 #define        HOST_BYTE_ORDER BIG_ENDIAN
@@ -40,10 +41,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define MALLOC_INCOMPATIBLE
 
 extern void *
-malloc PARAMS ((size_t));
+  malloc PARAMS ((size_t));
 
 extern void *
-realloc PARAMS ((void *, size_t));
+  realloc PARAMS ((void *, size_t));
 
 extern void
 free PARAMS ((void *));
index c771e8c1288dc5c8f2e4de3fd63c626038c31a75..d73c0714da05b555370d61d96802c781d2b7af72 100644 (file)
@@ -1,21 +1,22 @@
 /* IBM PowerPC native-dependent macros for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "rs6000/nm-rs6000.h"
 
index a1a3d9e6c3d0cc94e17c38999e796ea40f2fe740..9a710d11dbaf376dd1c4101d34dea5fa55e88356 100644 (file)
@@ -1,20 +1,21 @@
 /* PowerMac native-dependent macros for GDB, the GNU debugger.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Nothing needed, at least so far.  */
index b276a7151ef7cb6f551d6211d3585c7a42b5394e..2496f1ec6c05a9597e0372469745fd51e8217c8b 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for PowerPC running Solaris.
    Copyright 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.  */
+   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 SVR4 definitions.  */
 
index 27ae24aefcd548d231ea7b3d53a06e5a7ee6284e..39ef275492e25aee550e81e0e933ffef212bee89 100644 (file)
@@ -15,7 +15,7 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "powerpc/tm-ppcle-eabi.h"
-
index d32d0de1cd835cf61f3e4b0f1b4a47ed70f7fb1c..bfd7a73f726abaf405a22dd6f825dab4b4a8172b 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running MacOS.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Use generic RS6000 definitions. */
 #include "rs6000/tm-rs6000.h"
index 521b9afa349e8e8a19cb154b77b504635bd8c2ab..d3afbd5d0a797c2a27c5f0a97623a727457b665c 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running AIX.
    Copyright 1995 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 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_PPC_AIX_H
 #define TM_PPC_AIX_H
index 41b80a82a8122eaf1879ecba230d2af4e0afca29..a90543bbab8ebf75ad24cbe386591a3e815ea9e9 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running embedded ABI.
    Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_PPC_EABI_H
 #define TM_PPC_EABI_H
@@ -53,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* target-specific dummy_frame stuff */
 
-extern struct frame_info *rs6000_pop_frame PARAMS ((struct frame_info *frame));
+extern struct frame_info *rs6000_pop_frame PARAMS ((struct frame_info * frame));
 
 extern CORE_ADDR ppc_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 
index 38f72112bb44ddedde598e0bff5c56e2869b39ab..7306ea00d7ccbc092f4e4b78dc1419abc2972962 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running Netware.
    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.  */
+   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_PPC_NW_H
 #define TM_PPC_NW_H
index e4116bcc686545c1ef035a653352c09b14b47248..9fa11861e1aa16c6161d587be8a469e1c84b3736 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running embedded ABI under the simulator.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_PPC_SIM_H
 #define TM_PPC_SIM_H
@@ -23,4 +24,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "powerpc/tm-ppc-eabi.h"
 
 #endif /* TM_PPC_SIM_H */
-
index 355195d8a0e8d0381e1c3841dcf26af8975f804d..412b4c9331ff6eed5b1434ffbb7ead838be855f1 100644 (file)
@@ -2,21 +2,22 @@
    in little endian mode.
    Copyright 1995 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 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_PPCLE_EABI_H
 #define TM_PPCLE_EABI_H
index 76564f2cdc3eab0f64529a65cc9f11aaf950bcbe..02707f4001924bf578599d08e63f5d12d4c85c08 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Power PC running embedded ABI under the simulator.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_PPCLE_SIM_H
 #define TM_PPCLE_SIM_H
@@ -23,4 +24,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "powerpc/tm-ppcle-eabi.h"
 
 #endif /* TM_PPCLE_SIM_H */
-
index bd9373fad874a250c8fe04355488e5b1c1848775..67ddb5296bb4c1cc2e03d40d912479f2acad4e11 100644 (file)
@@ -1,36 +1,37 @@
 /* Macro definitions for GDB for a PowerPC running Solaris 2
    Copyright 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "powerpc/tm-ppc-eabi.h"
+
 /* There are two different signal handler trampolines in Solaris2.  */
 #define IN_SIGTRAMP(pc, name) \
   ((name) \
    && (STREQ ("sigacthandler", name) || STREQ ("ucbsigvechandler", name)))
+
 /* The signal handler gets a pointer to an ucontext as third argument
    if it is called from sigacthandler.  This is the offset to the saved
    PC within it.  sparc_frame_saved_pc knows how to deal with
-   ucbsigvechandler.  */  
+   ucbsigvechandler.  */
 #define SIGCONTEXT_PC_OFFSET 44
 
-#if 0  /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
+#if 0                          /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
 
 /* Offsets into jmp_buf.  Not defined by Sun, but at least documented in a
    comment in <machine/setjmp.h>! */
@@ -57,7 +58,7 @@ extern int
 get_longjmp_target PARAMS ((CORE_ADDR *));
 
 #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-#endif  /* 0 */
+#endif /* 0 */
 
 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
    and for SunPRO 3.0, N_FUN symbols too.  */
index e616d9ee6fd50f739edaaa31e61e58d02ec2912f..c5a5ca969d42379d3cabb00f63affdd2dd06d356 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1995 Free Software Foundation, Inc.
    Contributed by Cygnus Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "xm-aix4.h"
 
index 82aa0fb2b628fde2c1404d71c1f5e03da6c606ef..2993606285f7d90d0ada4a73ae090bf961d32bb6 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for hosting on WIN32, for GDB.
    Copyright 1995, 1996, 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.  */
+   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 HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 41c8ba71dc5eae34227536856e62dfff784f3157..754f8589ae56c504f3272f4bd20f864a3a936070 100644 (file)
@@ -2,20 +2,21 @@
    Copyright 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
index 6b33ca206ba1284f61227d954b424b4d7d8967ae..92c9a762aedc7bb1573404a8846a8ab8ef64d46d 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running GDB on Apple Power Macintoshes.
    Copyright (C) 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
index 9ead87a3887da77efb6bdaa32e94b7849cc17676..d14ea343067fc1fd8d70f5ddd5d8859446f519cd 100644 (file)
@@ -2,20 +2,21 @@
    Copyright 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER LITTLE_ENDIAN
index e28d6fb201920d72b19ad0ff61d2756845638c37..2647e1565e1d8eb8e282efabf37fb3aebcd80e6a 100644 (file)
 /* OBSOLETE    but do serve to get the desired values when passed to read_register.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* pseudo-registers: *x/ */
-/* OBSOLETE #define PS_REGNUM 64               /* Contains processor status *x/ */
-/* OBSOLETE #define PSW_REGNUM 64              /* Contains current psw, whatever it is.*x/ */
-/* OBSOLETE #define CSP_REGNUM 65              /* address of this control stack frame*x/ */
-/* OBSOLETE #define KSP_REGNUM 66              /* Contains process's Kernel Stack Pointer *x/ */
+/* OBSOLETE #define PS_REGNUM 64                /* Contains processor status *x/ */
+/* OBSOLETE #define PSW_REGNUM 64               /* Contains current psw, whatever it is.*x/ */
+/* OBSOLETE #define CSP_REGNUM 65               /* address of this control stack frame*x/ */
+/* OBSOLETE #define KSP_REGNUM 66               /* Contains process's Kernel Stack Pointer *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define CFP_REGNUM 13              /* Current data-stack frame ptr *x/ */
-/* OBSOLETE #define TR0_REGNUM 48              /* After function call, contains */
-/* OBSOLETE                               function result *x/ */
+/* OBSOLETE #define CFP_REGNUM 13               /* Current data-stack frame ptr *x/ */
+/* OBSOLETE #define TR0_REGNUM 48               /* After function call, contains */
+/* OBSOLETE                                function result *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* Registers interesting to the machine-independent part of gdb*x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define FP_REGNUM CSP_REGNUM       /* Contains address of executing (control) */
-/* OBSOLETE                               stack frame *x/ */
-/* OBSOLETE #define SP_REGNUM 14               /* Contains address of top of stack -??*x/ */
-/* OBSOLETE #define PC_REGNUM 15               /* Contains program counter *x/ */
+/* OBSOLETE #define FP_REGNUM CSP_REGNUM        /* Contains address of executing (control) */
+/* OBSOLETE                                stack frame *x/ */
+/* OBSOLETE #define SP_REGNUM 14                /* Contains address of top of stack -??*x/ */
+/* OBSOLETE #define PC_REGNUM 15                /* Contains program counter *x/ */
 /* OBSOLETE  */
 /* OBSOLETE /* Define DO_REGISTERS_INFO() to do machine-specific formatting */
 /* OBSOLETE    of register dumps. *x/ */
 /* OBSOLETE    registers shifting into ins counts) upon subroutine calls and thus */
 /* OBSOLETE    there is no need to search more than one stack frame for it. *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define REGISTER_IN_WINDOW_P(regnum)       \ */
+/* OBSOLETE #define REGISTER_IN_WINDOW_P(regnum)        \ */
 /* OBSOLETE   ((regnum) >= 16 && (regnum) < 64) */
 /* OBSOLETE  */
 /* OBSOLETE /* Index within `registers' of the first byte of the space for */
 /* OBSOLETE    (its caller).  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define EXTRA_FRAME_INFO \ */
-/* OBSOLETE    CORE_ADDR bottom;       \ */
-/* OBSOLETE    CORE_ADDR frame_cfp;    \ */
-/* OBSOLETE    CORE_ADDR frame_window_addr; */
+/* OBSOLETE     CORE_ADDR bottom;       \ */
+/* OBSOLETE     CORE_ADDR frame_cfp;    \ */
+/* OBSOLETE     CORE_ADDR frame_window_addr; */
 /* OBSOLETE  */
 /* OBSOLETE /* The bottom field is misnamed, since it might imply that memory from */
 /* OBSOLETE    bottom to frame contains this frame.  That need not be true if */
 /* OBSOLETE    stack, some on a heap in the data segment).  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fci)  \ */
-/* OBSOLETE do {                                                               \ */
-/* OBSOLETE   (fci)->frame_window_addr = (fci)->frame;                 \ */
-/* OBSOLETE   (fci)->bottom =                                          \ */
-/* OBSOLETE      ((fci)->next ?                                        \ */
-/* OBSOLETE       ((fci)->frame == (fci)->next->frame ?                        \ */
-/* OBSOLETE        (fci)->next->bottom : (fci)->next->frame) :         \ */
-/* OBSOLETE       read_register (SP_REGNUM));                          \ */
-/* OBSOLETE   (fci)->frame_cfp =                                               \ */
-/* OBSOLETE      read_register (CFP_REGNUM);                           \ */
-/* OBSOLETE   /***fprintf (stderr,                                             \ */
-/* OBSOLETE       "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n",   \ */
-/* OBSOLETE       (fci)->frame, (fci)->pc,(fci)->frame_cfp);*x/                \ */
+/* OBSOLETE do {                                                                \ */
+/* OBSOLETE   (fci)->frame_window_addr = (fci)->frame;                  \ */
+/* OBSOLETE   (fci)->bottom =                                           \ */
+/* OBSOLETE       ((fci)->next ?                                        \ */
+/* OBSOLETE        ((fci)->frame == (fci)->next->frame ?                        \ */
+/* OBSOLETE         (fci)->next->bottom : (fci)->next->frame) :         \ */
+/* OBSOLETE        read_register (SP_REGNUM));                          \ */
+/* OBSOLETE   (fci)->frame_cfp =                                                \ */
+/* OBSOLETE       read_register (CFP_REGNUM);                           \ */
+/* OBSOLETE   /***fprintf (stderr,                                              \ */
+/* OBSOLETE        "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n",   \ */
+/* OBSOLETE        (fci)->frame, (fci)->pc,(fci)->frame_cfp);*x/                \ */
 /* OBSOLETE } while (0); */
 /* OBSOLETE  */
 /* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */
 /* OBSOLETE /* In the case of the pyr, the frame's nominal address is the address */
 /* OBSOLETE    of parameter register 0.  The previous frame is found 32 words up.   *x/ */
 /* OBSOLETE  */
-/* OBSOLETE #define FRAME_CHAIN(thisframe)     \ */
+/* OBSOLETE #define FRAME_CHAIN(thisframe)      \ */
 /* OBSOLETE   ( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE) */
 /* OBSOLETE  */
 /* OBSOLETE  /*((thisframe) >= CONTROL_STACK_ADDR))*x/ */
 /* OBSOLETE    compiler and gcc currently ignore them, so it's not an issue.   *x/  */
 /* OBSOLETE  */
 /* OBSOLETE #define FRAME_FIND_SAVED_REGS(fi_p, frame_saved_regs) \ */
-/* OBSOLETE {  register int regnum;                                                    \ */
-/* OBSOLETE   register CORE_ADDR pc;                                           \ */
-/* OBSOLETE   register CORE_ADDR fn_start_pc;                                  \ */
-/* OBSOLETE   register int first_insn;                                         \ */
-/* OBSOLETE   register CORE_ADDR prev_cf_addr;                                 \ */
-/* OBSOLETE   register int window_ptr;                                         \ */
-/* OBSOLETE   if (!fi_p) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS");     \ */
-/* OBSOLETE   memset (&(frame_saved_regs), '\0', sizeof (frame_saved_regs));           \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   window_ptr = prev_cf_addr = FRAME_FP(fi_p);                              \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4)          \ */
-/* OBSOLETE   {                                                                        \ */
-/* OBSOLETE     (frame_saved_regs).regs[regnum] = window_ptr;                  \ */
-/* OBSOLETE   }                                                                        \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   /* In each window, psw, and pc are "saved" in tr14,tr15. *x/             \ */
-/* OBSOLETE   /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) *x/             \ */
-/* OBSOLETE   (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4);    \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE /*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*x/     \ */
-/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4);       \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   /* Functions that allocate a frame save sp *where*? *x/          \ */
+/* OBSOLETE {  register int regnum;                                                     \ */
+/* OBSOLETE   register CORE_ADDR pc;                                            \ */
+/* OBSOLETE   register CORE_ADDR fn_start_pc;                                   \ */
+/* OBSOLETE   register int first_insn;                                          \ */
+/* OBSOLETE   register CORE_ADDR prev_cf_addr;                                  \ */
+/* OBSOLETE   register int window_ptr;                                          \ */
+/* OBSOLETE   if (!fi_p) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS");      \ */
+/* OBSOLETE   memset (&(frame_saved_regs), '\0', sizeof (frame_saved_regs));            \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   window_ptr = prev_cf_addr = FRAME_FP(fi_p);                               \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4)           \ */
+/* OBSOLETE   {                                                                 \ */
+/* OBSOLETE     (frame_saved_regs).regs[regnum] = window_ptr;                   \ */
+/* OBSOLETE   }                                                                 \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   /* In each window, psw, and pc are "saved" in tr14,tr15. *x/              \ */
+/* OBSOLETE   /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) *x/              \ */
+/* OBSOLETE   (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4);     \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE /*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*x/      \ */
+/* OBSOLETE   (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4);        \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   /* Functions that allocate a frame save sp *where*? *x/           \ */
 /* OBSOLETE /*first_insn = read_memory_integer (get_pc_function_start ((fi_p)->pc),4); *x/ \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   fn_start_pc = (get_pc_function_start ((fi_p)->pc));                      \ */
-/* OBSOLETE   first_insn = read_memory_integer(fn_start_pc, 4);                        \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   if (0x08 == ((first_insn >> 20) &0x0ff)) {                               \ */
-/* OBSOLETE     /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp            \ */
-/* OBSOLETE        in this frame is only visible in this frame's callers.              \ */
-/* OBSOLETE        That means the cfp we mark saved is my caller's cfp, ie pr13.       \ */
-/* OBSOLETE        I don't understand why we don't have to do that for pc, too.  *x/   \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE     (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4);   \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] =                           \ */
-/* OBSOLETE      read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4);           \ */
-/* OBSOLETE   }                                                                        \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE /*                                                                 \ */
-/* OBSOLETE  *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61];       \ */
-/* OBSOLETE  * (frame_saved_regs).regs[SP_REGNUM] =                                    \ */
-/* OBSOLETE  *   read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4);           \ */
-/* OBSOLETE  *x/                                                                       \ */
-/* OBSOLETE                                                                    \ */
-/* OBSOLETE   (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr;                      \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   fn_start_pc = (get_pc_function_start ((fi_p)->pc));                       \ */
+/* OBSOLETE   first_insn = read_memory_integer(fn_start_pc, 4);                 \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   if (0x08 == ((first_insn >> 20) &0x0ff)) {                                \ */
+/* OBSOLETE     /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp             \ */
+/* OBSOLETE        in this frame is only visible in this frame's callers.               \ */
+/* OBSOLETE        That means the cfp we mark saved is my caller's cfp, ie pr13.        \ */
+/* OBSOLETE        I don't understand why we don't have to do that for pc, too.  *x/    \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE     (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4);    \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE     (frame_saved_regs).regs[SP_REGNUM] =                            \ */
+/* OBSOLETE       read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4);           \ */
+/* OBSOLETE   }                                                                 \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE /*                                                                  \ */
+/* OBSOLETE  *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61];        \ */
+/* OBSOLETE  * (frame_saved_regs).regs[SP_REGNUM] =                                     \ */
+/* OBSOLETE  *    read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4);           \ */
+/* OBSOLETE  *x/                                                                        \ */
+/* OBSOLETE                                                                     \ */
+/* OBSOLETE   (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr;                       \ */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /* Things needed for making the inferior call functions.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define PUSH_DUMMY_FRAME \ */
 /* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM);\ */
-/* OBSOLETE   register int regnum;                                 \ */
-/* OBSOLETE   sp = push_word (sp, 0); /* arglist *x/               \ */
-/* OBSOLETE   for (regnum = 11; regnum >= 0; regnum--)     \ */
+/* OBSOLETE   register int regnum;                                  \ */
+/* OBSOLETE   sp = push_word (sp, 0); /* arglist *x/                \ */
+/* OBSOLETE   for (regnum = 11; regnum >= 0; regnum--)      \ */
 /* OBSOLETE     sp = push_word (sp, read_register (regnum));    \ */
 /* OBSOLETE   sp = push_word (sp, read_register (PC_REGNUM));   \ */
 /* OBSOLETE   sp = push_word (sp, read_register (FP_REGNUM));   \ */
 /* OBSOLETE /*  sp = push_word (sp, read_register (AP_REGNUM));*x/   \ */
 /* OBSOLETE   sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef)   \ */
-/* OBSOLETE                  + 0x2fff0000);                \ */
-/* OBSOLETE   sp = push_word (sp, 0);                      \ */
-/* OBSOLETE   write_register (SP_REGNUM, sp);              \ */
-/* OBSOLETE   write_register (FP_REGNUM, sp);              \ */
+/* OBSOLETE                   + 0x2fff0000);                \ */
+/* OBSOLETE   sp = push_word (sp, 0);                       \ */
+/* OBSOLETE   write_register (SP_REGNUM, sp);               \ */
+/* OBSOLETE   write_register (FP_REGNUM, sp);               \ */
 /* OBSOLETE /*  write_register (AP_REGNUM, sp + 17 * sizeof (int));*x/ } */
 /* OBSOLETE  */
 /* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define POP_FRAME  \ */
-/* OBSOLETE { register CORE_ADDR fp = read_register (FP_REGNUM);                \ */
-/* OBSOLETE   register int regnum;                                              \ */
-/* OBSOLETE   register int regmask = read_memory_integer (fp + 4, 4);   \ */
-/* OBSOLETE   write_register (PS_REGNUM,                                        \ */
-/* OBSOLETE              (regmask & 0xffff)                             \ */
-/* OBSOLETE              | (read_register (PS_REGNUM) & 0xffff0000));   \ */
+/* OBSOLETE { register CORE_ADDR fp = read_register (FP_REGNUM);                 \ */
+/* OBSOLETE   register int regnum;                                               \ */
+/* OBSOLETE   register int regmask = read_memory_integer (fp + 4, 4);    \ */
+/* OBSOLETE   write_register (PS_REGNUM,                                         \ */
+/* OBSOLETE               (regmask & 0xffff)                             \ */
+/* OBSOLETE               | (read_register (PS_REGNUM) & 0xffff0000));   \ */
 /* OBSOLETE   write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));  \ */
 /* OBSOLETE   write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));  \ */
 /* OBSOLETE /*  write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));*x/   \ */
-/* OBSOLETE   fp += 16;                                                         \ */
-/* OBSOLETE   for (regnum = 0; regnum < 12; regnum++)                   \ */
-/* OBSOLETE     if (regmask & (0x10000 << regnum))                              \ */
+/* OBSOLETE   fp += 16;                                                  \ */
+/* OBSOLETE   for (regnum = 0; regnum < 12; regnum++)                    \ */
+/* OBSOLETE     if (regmask & (0x10000 << regnum))                               \ */
 /* OBSOLETE       write_register (regnum, read_memory_integer (fp += 4, 4)); \ */
-/* OBSOLETE   fp = fp + 4 + ((regmask >> 30) & 3);                              \ */
-/* OBSOLETE   if (regmask & 0x20000000)                                         \ */
-/* OBSOLETE     { regnum = read_memory_integer (fp, 4);                         \ */
-/* OBSOLETE       fp += (regnum + 1) * 4; }                                     \ */
-/* OBSOLETE   write_register (SP_REGNUM, fp);                           \ */
+/* OBSOLETE   fp = fp + 4 + ((regmask >> 30) & 3);                               \ */
+/* OBSOLETE   if (regmask & 0x20000000)                                  \ */
+/* OBSOLETE     { regnum = read_memory_integer (fp, 4);                  \ */
+/* OBSOLETE       fp += (regnum + 1) * 4; }                                      \ */
+/* OBSOLETE   write_register (SP_REGNUM, fp);                            \ */
 /* OBSOLETE   set_current_frame (read_register (FP_REGNUM)); } */
 /* OBSOLETE  */
 /* OBSOLETE /* This sequence of words is the instructions */
 /* OBSOLETE    into a call sequence of the above form stored at DUMMYNAME.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p)   \ */
-/* OBSOLETE { *((char *) dummyname + 1) = nargs;               \ */
+/* OBSOLETE { *((char *) dummyname + 1) = nargs;                \ */
 /* OBSOLETE   *(int *)((char *) dummyname + 3) = fun; } */
 /* OBSOLETE #endif /* 0 *x/ */
 /* OBSOLETE  */
index d10afc5c7e8f261dd488ea53ccf31c89d230fdd6..9fb56b877436c9185616bdbee260bdab53981672 100644 (file)
 /* OBSOLETE #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) */
 /* OBSOLETE  */
 /* OBSOLETE /* Define offsets of registers in the core file (or maybe u area) *x/ */
-/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)     \ */
-/* OBSOLETE { struct user __u;                                 \ */
-/* OBSOLETE   addr = blockend  + (regno - 16 ) * 4;                    \ */
-/* OBSOLETE   if (regno == 67) {                                       \ */
-/* OBSOLETE       printf("\\geting reg 67\\");                 \ */
-/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;       \ */
-/* OBSOLETE   } else if (regno == KSP_REGNUM) {                        \ */
-/* OBSOLETE       printf("\\geting KSP (reg %d)\\", KSP_REGNUM);       \ */
-/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u;       \ */
-/* OBSOLETE   } else if (regno == CSP_REGNUM) {                        \ */
-/* OBSOLETE       printf("\\geting CSP (reg %d\\",CSP_REGNUM); \ */
-/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;       \ */
-/* OBSOLETE   } else if (regno == 64) {                                \ */
-/* OBSOLETE       printf("\\geting reg 64\\");                 \ */
-/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;       \ */
-/* OBSOLETE    } else if (regno == PS_REGNUM)                  \ */
-/* OBSOLETE       addr = blockend - 4;                         \ */
-/* OBSOLETE   else if (1 && ((16 > regno) && (regno > 11)))            \ */
-/* OBSOLETE       addr = last_frame_offset + (4 *(regno+32));  \ */
-/* OBSOLETE   else if (0 && (12 > regno))                              \ */
-/* OBSOLETE       addr = global_reg_offset + (4 *regno);               \ */
-/* OBSOLETE   else if (16 > regno)                                     \ */
-/* OBSOLETE       addr = global_reg_offset + (4 *regno);               \ */
-/* OBSOLETE  else                                                      \ */
-/* OBSOLETE       addr = blockend  + (regno - 16 ) * 4;                \ */
+/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)      \ */
+/* OBSOLETE { struct user __u;                                  \ */
+/* OBSOLETE   addr = blockend  + (regno - 16 ) * 4;                     \ */
+/* OBSOLETE   if (regno == 67) {                                        \ */
+/* OBSOLETE       printf("\\geting reg 67\\");                  \ */
+/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;        \ */
+/* OBSOLETE   } else if (regno == KSP_REGNUM) {                 \ */
+/* OBSOLETE       printf("\\geting KSP (reg %d)\\", KSP_REGNUM);        \ */
+/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u;        \ */
+/* OBSOLETE   } else if (regno == CSP_REGNUM) {                 \ */
+/* OBSOLETE       printf("\\geting CSP (reg %d\\",CSP_REGNUM);  \ */
+/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;        \ */
+/* OBSOLETE   } else if (regno == 64) {                         \ */
+/* OBSOLETE       printf("\\geting reg 64\\");                  \ */
+/* OBSOLETE       addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u;        \ */
+/* OBSOLETE    } else if (regno == PS_REGNUM)                   \ */
+/* OBSOLETE       addr = blockend - 4;                          \ */
+/* OBSOLETE   else if (1 && ((16 > regno) && (regno > 11)))             \ */
+/* OBSOLETE       addr = last_frame_offset + (4 *(regno+32));   \ */
+/* OBSOLETE   else if (0 && (12 > regno))                               \ */
+/* OBSOLETE       addr = global_reg_offset + (4 *regno);                \ */
+/* OBSOLETE   else if (16 > regno)                                      \ */
+/* OBSOLETE       addr = global_reg_offset + (4 *regno);                \ */
+/* OBSOLETE  else                                                       \ */
+/* OBSOLETE       addr = blockend  + (regno - 16 ) * 4;         \ */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  *x/ */
index d99b57f44aed1a3644e41235bd08953e1cc31bae..5781d7528568ff02d995cc0d15adaba9470b4550 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992  Free Software Foundation, Inc.
    Contributed by David Wood @ New York University (wood@lab.ultra.nyu.edu).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This machine is most significant byte first */
 #define HOST_BYTE_ORDER BIG_ENDIAN
@@ -30,11 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  * 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 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)
 #else
-# include      "GDB for the RT is not included in the distribution" 
+#include       "GDB for the RT is not included in the distribution"
 #endif
-
index cf0d53dde3574503021442af3a451bfe4249ced3..1d6f970c760838d8072bc98e10928541fce53507 100644 (file)
@@ -1,21 +1,22 @@
 /* IBM RS/6000 native-dependent macros for GDB, the GNU debugger.
    Copyright 1986, 1987, 1989, 1991, 1992, 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.  */
+   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.  */
 
index 4159822e20c76199988d6c56f51e2ec69bdd3fae..7bc1267d2661d0e09d2dc21b883d1ed9946e834d 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for RS6000 running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_RS6000LYNX_H
 #define NM_RS6000LYNX_H
index c7889e4ceb8e0f871bcd324a6d454d4ccfca863b..243befe7d6fbe482741b0162edf8a827270f24b3 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for RS/6000 running AIX4.
    Copyright 1995, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_RS6000_AIX4_H
 #define TM_RS6000_AIX4_H
index 34fe391d849a429fc4d2a134093bdaf4e3cb825c..d45fe9bd3f94754e63c3d763bf5e880c8fe715bf 100644 (file)
@@ -3,23 +3,24 @@
    Free Software Foundation, Inc.
    Contributed by IBM Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct frame_info;
 struct type;
 struct value;
@@ -52,33 +53,36 @@ extern int inferior_pid;
 
 /* We are missing register descriptions in the system header files. Sigh! */
 
-struct regs {
-       int     gregs [32];             /* general purpose registers */
-       int     pc;                     /* program conter       */
-       int     ps;                     /* processor status, or machine state */
-};
+struct regs
+  {
+    int gregs[32];             /* general purpose registers */
+    int pc;                    /* program conter       */
+    int ps;                    /* processor status, or machine state */
+  };
 
-struct fp_status {
-       double  fpregs [32];            /* floating GP registers */
-};
+struct fp_status
+  {
+    double fpregs[32];         /* floating GP registers */
+  };
 
 
 /* To be used by skip_prologue. */
 
-struct rs6000_framedata {
-  int  offset;                         /* total size of frame --- the distance
-                                          by which we decrement sp to allocate
-                                          the frame */
-  int  saved_gpr;                      /* smallest # of saved gpr */
-  int  saved_fpr;                      /* smallest # of saved fpr */
-  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  lr_offset;                      /* offset of saved lr */
-  int  cr_offset;                      /* offset of saved cr */
-};
+struct rs6000_framedata
+  {
+    int offset;                        /* total size of frame --- the distance
+                                  by which we decrement sp to allocate
+                                  the frame */
+    int saved_gpr;             /* smallest # of saved gpr */
+    int saved_fpr;             /* smallest # of saved fpr */
+    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 lr_offset;             /* offset of saved lr */
+    int cr_offset;             /* offset of saved cr */
+  };
 
 /* Define the byte order of the machine.  */
 
@@ -100,7 +104,7 @@ struct rs6000_framedata {
 extern CORE_ADDR rs6000_skip_prologue PARAMS ((CORE_ADDR));
 #define SKIP_PROLOGUE(pc) (rs6000_skip_prologue (pc))
 
-extern CORE_ADDR skip_prologue PARAMS((CORE_ADDR, struct rs6000_framedata *));
+extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR, struct rs6000_framedata *));
 
 
 /* If PC is in some function-call trampoline code, return the PC
@@ -134,7 +138,7 @@ extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR));
 
 #define        PROCESS_LINENUMBER_HOOK()       aix_process_linenos ()
 extern void aix_process_linenos PARAMS ((void));
-   
+
 /* 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
@@ -198,13 +202,13 @@ extern char *rs6000_register_name (int reg);
 #define FP0_REGNUM 32          /* Floating point register 0 */
 #define        GP0_REGNUM 0            /* GPR register 0 */
 #define FP0_REGNUM 32          /* FPR (Floating point) register 0 */
-#define FPLAST_REGNUM 63       /* Last floating point register */  
+#define FPLAST_REGNUM 63       /* Last floating point register */
 
 /* Special purpose registers... */
 /* P.S. keep these in the same order as in /usr/mstsave.h `mstsave'
    structure, for easier processing */
 
-#define PC_REGNUM 64           /* Program counter (instruction address %iar)*/
+#define PC_REGNUM 64           /* Program counter (instruction address %iar) */
 #define PS_REGNUM 65           /* Processor (or machine) status (%msr) */
 #define        CR_REGNUM 66            /* Condition register */
 #define        LR_REGNUM 67            /* Link register */
@@ -223,11 +227,11 @@ extern char *rs6000_register_name (int reg);
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.
-            32 4-byte gpr's
-            32 8-byte fpr's
-            7  4-byte UISA special purpose registers, 
-            16 4-byte segment registers,
-            32 4-byte standard OEA special-purpose registers,
+   32 4-byte gpr's
+   32 8-byte fpr's
+   7  4-byte UISA special purpose registers, 
+   16 4-byte segment registers,
+   32 4-byte standard OEA special-purpose registers,
    and up to 64 4-byte non-standard OEA special purpose regs.
    total: (+ (* 32 4) (* 32 8) (* 7 4) (* 16 4) (* 32 4) (* 64 4)) 860 bytes
    Keep some extra space for now, in case to add more. */
@@ -327,11 +331,11 @@ extern CORE_ADDR rs6000_struct_return_address;
    into VALBUF.  */
 
 /* #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
-  memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
+   memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
 
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   extract_return_value(TYPE,REGBUF,VALBUF)
-extern void extract_return_value PARAMS ((struct type *, char [], char *));
+extern void extract_return_value PARAMS ((struct type *, char[], char *));
 
 /* Write into appropriate registers a function return value
    of type TYPE, given in virtual format.  */
@@ -380,12 +384,12 @@ CORE_ADDR rs6000_frame_chain PARAMS ((struct frame_info *));
 #define FRAMELESS_FUNCTION_INVOCATION(FI) \
   (frameless_function_invocation (FI))
 
-extern int frameless_function_invocation PARAMS((struct frame_info *));
+extern int frameless_function_invocation PARAMS ((struct frame_info *));
 
 #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
   prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
              prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
-#define INIT_FRAME_PC(fromleaf, prev) /* nothing */
+#define INIT_FRAME_PC(fromleaf, prev)  /* nothing */
 extern void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *);
 #define        INIT_EXTRA_FRAME_INFO(fromleaf, fi) rs6000_init_extra_frame_info (fromleaf, fi)
 
@@ -454,39 +458,39 @@ extern void pop_frame PARAMS ((void));
 
 /* This sequence of words is the instructions:
 
-       mflr    r0              // 0x7c0802a6
-                               // save fpr's
-       stfd    r?, num(r1)     // 0xd8010000 there should be 32 of this??
-                               // save gpr's
-       stm     r0, num(r1)     // 0xbc010000
-       stu     r1, num(r1)     // 0x94210000
-
-       // the function we want to branch might be in a different load 
-       // segment. reset the toc register. Note that the actual toc address
-       // will be fix by fix_call_dummy () along with function address.
-
-       st      r2, 0x14(r1)    // 0x90410014 save toc register
-       liu     r2, 0x1234      // 0x3c401234 reset a new toc value 0x12345678
-       oril    r2, r2,0x5678   // 0x60425678   
-
-                               // load absolute address 0x12345678 to r0
-       liu     r0, 0x1234      // 0x3c001234
-       oril    r0, r0,0x5678   // 0x60005678
-       mtctr   r0              // 0x7c0903a6 ctr <- r0
-       bctrl                   // 0x4e800421 jump subroutine 0x12345678 (%ctr)
-       cror    0xf, 0xf, 0xf   // 0x4def7b82
-       brpt                    // 0x7d821008, breakpoint
-       cror    0xf, 0xf, 0xf   // 0x4def7b82 (for 8 byte alignment)
-
-
-  We actually start executing by saving the toc register first, since the pushing 
-  of the registers is done by PUSH_DUMMY_FRAME.  If this were real code,
-  the arguments for the function called by the `bctrl' would be pushed
-  between the `stu' and the `bctrl', and we could allow it to execute through.
-  But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is done,
-  and we cannot allow to push the registers again.
-*/
-       
+   mflr r0              // 0x7c0802a6
+   // save fpr's
+   stfd r?, num(r1)     // 0xd8010000 there should be 32 of this??
+   // save gpr's
+   stm  r0, num(r1)     // 0xbc010000
+   stu  r1, num(r1)     // 0x94210000
+
+   // the function we want to branch might be in a different load 
+   // segment. reset the toc register. Note that the actual toc address
+   // will be fix by fix_call_dummy () along with function address.
+
+   st   r2, 0x14(r1)    // 0x90410014 save toc register
+   liu  r2, 0x1234      // 0x3c401234 reset a new toc value 0x12345678
+   oril r2, r2,0x5678   // 0x60425678   
+
+   // load absolute address 0x12345678 to r0
+   liu  r0, 0x1234      // 0x3c001234
+   oril r0, r0,0x5678   // 0x60005678
+   mtctr        r0              // 0x7c0903a6 ctr <- r0
+   bctrl                        // 0x4e800421 jump subroutine 0x12345678 (%ctr)
+   cror 0xf, 0xf, 0xf   // 0x4def7b82
+   brpt                 // 0x7d821008, breakpoint
+   cror 0xf, 0xf, 0xf   // 0x4def7b82 (for 8 byte alignment)
+
+
+   We actually start executing by saving the toc register first, since the pushing 
+   of the registers is done by PUSH_DUMMY_FRAME.  If this were real code,
+   the arguments for the function called by the `bctrl' would be pushed
+   between the `stu' and the `bctrl', and we could allow it to execute through.
+   But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is done,
+   and we cannot allow to push the registers again.
+ */
+
 #define CALL_DUMMY {0x7c0802a6, 0xd8010000, 0xbc010000, 0x94210000, \
                    0x90410014, 0x3c401234, 0x60425678,             \
                    0x3c001234, 0x60005678, 0x7c0903a6, 0x4e800421, \
@@ -509,16 +513,17 @@ extern void rs6000_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR,
 
 /* Hook in rs6000-tdep.c for determining the TOC address when
    calling functions in the inferior.  */
-extern CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR));
+extern
+CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR));
 
 /* xcoffread.c provides a function to determine the TOC offset
    for a given object file.
    It is used under native AIX configurations for determining the
    TOC address when calling functions in the inferior.  */
 #ifdef __STDC__
-struct objfile;
+     struct objfile;
 #endif
-extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *));
+     extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *));
 
 /* Usually a function pointer's representation is simply the address
    of the function. On the RS/6000 however, a function pointer is
@@ -536,7 +541,7 @@ extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *));
 
 #define CONVERT_FROM_FUNC_PTR_ADDR(ADDR) \
   (is_magic_function_pointer (ADDR) ? read_memory_integer (ADDR, 4) : (ADDR))
-extern int is_magic_function_pointer PARAMS ((CORE_ADDR));
+     extern int is_magic_function_pointer PARAMS ((CORE_ADDR));
 
 /* Flag for machine-specific stuff in shared files.  FIXME */
 #define IBM6000_TARGET
@@ -544,7 +549,7 @@ extern int is_magic_function_pointer PARAMS ((CORE_ADDR));
 /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
 
 #define SOFTWARE_SINGLE_STEP_P 1
-extern void rs6000_software_single_step PARAMS ((unsigned int, int));
+     extern void rs6000_software_single_step PARAMS ((unsigned int, int));
 #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
 
 /* If the current gcc for for this target does not produce correct debugging
index 0946b0f476ac504fedde4954f48d63718bb0eeff..ce555139c85812817dcf3c8c4dbff4e9bdc45ba2 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for RS6000 running under LynxOS.
    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 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_RS6000LYNX_H
 #define TM_RS6000LYNX_H
index 1bc5cae932645e919710049d600d8741d4d1a959..c0a6f8fa59c01f34296e6412cd2f3934b4728c22 100644 (file)
@@ -2,25 +2,25 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
    Contributed by IBM Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "xm-aix4.h"
 
 /* AIX 4.x uses nonstandard "int *" as type of third argument to ptrace() */
 
 #define PTRACE_ARG3_TYPE int*
-
index 44b8b244e9479599b532d25bf3bc0d1f4012c699..9efeaa6f7f5a81a3153f5b445a5698d4544b903c 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986-87, 1989, 1991-96, 1998 Free Software Foundation, Inc.
    Contributed by IBM Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The following text is taken from config/rs6000.mh:
  * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says
@@ -104,4 +105,3 @@ aix_resizewindow (signo)                    \
 /* setpgrp() messes up controling terminal. The other version of it
    requires libbsd.a. */
 #define        setpgrp(XX,YY)          setpgid (XX, YY)
-
index f75cfab139fb8a083b98a001b60948d07a416eab..39f7e481f021977be7994f1ccfd06fa6e06d65d6 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for RS6000 running LynxOS, for GDB.
    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 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 XM_RS6000LYNX_H
 #define XM_RS6000LYNX_H
index 2a94f5858d2967b38534dadb87640f84fa3ea130..f39f30874a87bf769fee7ca180f9d4e73fa24870 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-specific definition for a Hitachi Super-H.
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Contributed by Steve Chamberlain sac@cygnus.com */
 
@@ -62,8 +63,8 @@ extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR));
 /* Illegal instruction - used by the simulator for breakpoint
    detection */
 
-#define BREAKPOINT {0xc3, 0xc3}  /* 0xc3c3 is trapa #c3, and it works in big
-                                   and little endian modes  */
+#define BREAKPOINT {0xc3, 0xc3}        /* 0xc3c3 is trapa #c3, and it works in big
+                                  and little endian modes  */
 
 #define BIG_REMOTE_BREAKPOINT    { 0xc3, 0x20 }
 #define LITTLE_REMOTE_BREAKPOINT { 0x20, 0xc3 }
@@ -215,8 +216,8 @@ extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *));
 
 #define FRAME_ARGS_SKIP 0
 
-extern void sh_frame_find_saved_regs PARAMS ((struct frame_info *fi,
-                                             struct frame_saved_regs *fsr));
+extern void sh_frame_find_saved_regs PARAMS ((struct frame_info * fi,
+                                           struct frame_saved_regs * fsr));
 
 /* Put here the code to store, into a struct frame_saved_regs,
    the addresses of the saved registers of frame described by FRAME_INFO.
@@ -230,7 +231,7 @@ extern void sh_frame_find_saved_regs PARAMS ((struct frame_info *fi,
 typedef unsigned short INSN_WORD;
 
 extern CORE_ADDR sh_push_arguments PARAMS ((int nargs,
-                                           struct value **args,
+                                           struct value ** args,
                                            CORE_ADDR sp,
                                            unsigned char struct_return,
                                            CORE_ADDR struct_addr));
@@ -243,7 +244,7 @@ extern CORE_ADDR sh_push_arguments PARAMS ((int nargs,
 #define FIX_CALL_DUMMY(DUMMY, STARTADDR, FUNADDR, NARGS, ARGS, TYPE, GCCP)
 #define CALL_DUMMY_LOCATION          AT_ENTRY_POINT
 #define CALL_DUMMY_ADDRESS()         entry_point_address ()
-extern CORE_ADDR sh_push_return_address   PARAMS ((CORE_ADDR, CORE_ADDR));
+extern CORE_ADDR sh_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 #define PUSH_RETURN_ADDRESS(PC, SP)  sh_push_return_address (PC, SP)
 
 
index b2b2a917f3e85d56a6f7d6353a814d9dc97e0113..f6f26bcf8a11b40997094f8e662c238d0ca09e23 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running gdb on a Sparc running Linux.
    Copyright (C) 1989, 1992, 1996, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <nm-sysv4.h>
 #include "solib.h"
@@ -28,4 +29,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern int kernel_u_size PARAMS ((void));
 
 /* Linux is svr4ish but not that much */
-#undef USE_PROC_FS      
+#undef USE_PROC_FS
index 016772ae372846ea093e24d471b6db45e3f14028..7668f9f58e3ff7e62c3e0fe338edfd106d517c87 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1986, 1987, 1989, 1992, 1995, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_NBSD_H
 #define NM_NBSD_H
index 24011dca6491da5c4688228c98e2aa6031602aae..d5dd867a0fdbdcccdbdd68bcfaedccc99c140775 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Sparc running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef NM_SPARCLYNX_H
 #define NM_SPARCLYNX_H
index 9da96be5ddc64e95cf6410958499a30747e3f145..dcd20fb0fe960f94720e14960f71155adfadfe69 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running gdb on a Sun 4 running sunos 4.
    Copyright (C) 1989, 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.  */
+   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.  */
 
index f6833f42a616050a5d13ff29f89639db486c8dcc..a1de6e4e63bcd75b940bca58e29caa5e12ab0093 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent definitions for Sparc running SVR4.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Include the generic SVR4 definitions.  */
 
@@ -37,7 +38,7 @@ struct objfile;
 
 #define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
 
-void sol_thread_new_objfile PARAMS ((struct objfile *objfile));
+void sol_thread_new_objfile PARAMS ((struct objfile * objfile));
 
 #define FIND_NEW_THREADS sol_find_new_threads
 void sol_find_new_threads PARAMS ((void));
index 2cc708aa080249394a84abfc8298c8f7550d4f6f..8822f1dfed0b97fd2e0243972b68d3ad1e2757fd 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for GDB for a Sparc running Linux.
    Copyright 1989, 1992, 1994, 1995, 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.  */
+   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_SPARCLINUX_H
 #define TM_SPARCLINUX_H
index 1a3108441947f7b4f43e9657cd0e464db77ed023..b434efe8dbd53457df7baebb10f6ec63bcf8484d 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Sparc running under NetBSD.
    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.  */
+   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_NBSD_H
 #define TM_NBSD_H
index 693fa08268548b65a2c4ca9161d8c9f56d996d0b..bba364dc697ee428f3733f5d4c772001f46b48eb 100644 (file)
@@ -5,21 +5,22 @@
    Contributed by Doug Evans (dje@cygnus.com).
    Further modified by Bob Manson (manson@cygnus.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define GDB_TARGET_IS_SPARC64
 
@@ -69,7 +70,7 @@ struct value;
    ta  1
    nop
    nop
  */
+ */
 
 #define CALL_DUMMY {            0x9de3bec0fd3fa7f7LL, 0xf93fa7eff53fa7e7LL,\
                                 0xf13fa7dfed3fa7d7LL, 0xe93fa7cfe53fa7c7LL,\
@@ -156,8 +157,8 @@ struct value;
    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.  */
 
-#if 0 /* defined in tm-sparc.h, replicated for doc purposes */
-#define        G0_REGNUM 0             /* %g0 */
+#if 0                          /* defined in tm-sparc.h, replicated for doc purposes */
+#define        G0_REGNUM 0             /* %g0 */
 #define        G1_REGNUM 1             /* %g1 */
 #define O0_REGNUM 8            /* %o0 */
 #define        SP_REGNUM 14            /* Contains address of top of stack, \
@@ -188,38 +189,38 @@ struct value;
 
 /* v9 misc. and priv. regs */
 
-#define C0_REGNUM FP_MAX_REGNUM                        /* Start of control registers */
-#define PC_REGNUM (C0_REGNUM + 0)              /* Current PC */
-#define NPC_REGNUM (C0_REGNUM + 1)             /* Next PC */
-#define CCR_REGNUM (C0_REGNUM + 2)             /* Condition Code Register (%xcc,%icc) */
-#define FSR_REGNUM (C0_REGNUM + 3)             /* Floating Point State */
-#define FPRS_REGNUM (C0_REGNUM + 4)            /* Floating Point Registers State */
-#define        Y_REGNUM (C0_REGNUM + 5)                /* Temp register for multiplication, etc.  */
-#define ASI_REGNUM (C0_REGNUM + 6)             /* Alternate Space Identifier */
-#define VER_REGNUM (C0_REGNUM + 7)             /* Version register */
-#define TICK_REGNUM (C0_REGNUM + 8)            /* Tick register */
-#define PIL_REGNUM (C0_REGNUM + 9)             /* Processor Interrupt Level */
-#define PSTATE_REGNUM (C0_REGNUM + 10)         /* Processor State */
-#define TSTATE_REGNUM (C0_REGNUM + 11)         /* Trap State */
-#define TBA_REGNUM (C0_REGNUM + 12)            /* Trap Base Address */
-#define TL_REGNUM (C0_REGNUM + 13)             /* Trap Level */
-#define TT_REGNUM (C0_REGNUM + 14)             /* Trap Type */
-#define TPC_REGNUM (C0_REGNUM + 15)            /* Trap pc */
-#define TNPC_REGNUM (C0_REGNUM + 16)           /* Trap npc */
-#define WSTATE_REGNUM (C0_REGNUM + 17)         /* Window State */
-#define CWP_REGNUM (C0_REGNUM + 18)            /* Current Window Pointer */
+#define C0_REGNUM FP_MAX_REGNUM        /* Start of control registers */
+#define PC_REGNUM (C0_REGNUM + 0)      /* Current PC */
+#define NPC_REGNUM (C0_REGNUM + 1)     /* Next PC */
+#define CCR_REGNUM (C0_REGNUM + 2)     /* Condition Code Register (%xcc,%icc) */
+#define FSR_REGNUM (C0_REGNUM + 3)     /* Floating Point State */
+#define FPRS_REGNUM (C0_REGNUM + 4)    /* Floating Point Registers State */
+#define        Y_REGNUM (C0_REGNUM + 5)        /* Temp register for multiplication, etc.  */
+#define ASI_REGNUM (C0_REGNUM + 6)     /* Alternate Space Identifier */
+#define VER_REGNUM (C0_REGNUM + 7)     /* Version register */
+#define TICK_REGNUM (C0_REGNUM + 8)    /* Tick register */
+#define PIL_REGNUM (C0_REGNUM + 9)     /* Processor Interrupt Level */
+#define PSTATE_REGNUM (C0_REGNUM + 10) /* Processor State */
+#define TSTATE_REGNUM (C0_REGNUM + 11) /* Trap State */
+#define TBA_REGNUM (C0_REGNUM + 12)    /* Trap Base Address */
+#define TL_REGNUM (C0_REGNUM + 13)     /* Trap Level */
+#define TT_REGNUM (C0_REGNUM + 14)     /* Trap Type */
+#define TPC_REGNUM (C0_REGNUM + 15)    /* Trap pc */
+#define TNPC_REGNUM (C0_REGNUM + 16)   /* Trap npc */
+#define WSTATE_REGNUM (C0_REGNUM + 17) /* Window State */
+#define CWP_REGNUM (C0_REGNUM + 18)    /* Current Window Pointer */
 #define CANSAVE_REGNUM (C0_REGNUM + 19)                /* Savable Windows */
 #define CANRESTORE_REGNUM (C0_REGNUM + 20)     /* Restorable Windows */
 #define CLEANWIN_REGNUM (C0_REGNUM + 21)       /* Clean Windows */
 #define OTHERWIN_REGNUM (C0_REGNUM + 22)       /* Other Windows */
 #define ASR_REGNUM(n) (C0_REGNUM+(23-16)+(n))  /* Ancillary State Register
                                                   (n = 16...31) */
-#define ICC_REGNUM (C0_REGNUM + 39)            /* 32 bit condition codes */
-#define XCC_REGNUM (C0_REGNUM + 40)            /* 64 bit condition codes */
-#define FCC0_REGNUM (C0_REGNUM + 41)           /* fp cc reg 0 */
-#define FCC1_REGNUM (C0_REGNUM + 42)           /* fp cc reg 1 */
-#define FCC2_REGNUM (C0_REGNUM + 43)           /* fp cc reg 2 */
-#define FCC3_REGNUM (C0_REGNUM + 44)           /* fp cc reg 3 */
+#define ICC_REGNUM (C0_REGNUM + 39)    /* 32 bit condition codes */
+#define XCC_REGNUM (C0_REGNUM + 40)    /* 64 bit condition codes */
+#define FCC0_REGNUM (C0_REGNUM + 41)   /* fp cc reg 0 */
+#define FCC1_REGNUM (C0_REGNUM + 42)   /* fp cc reg 1 */
+#define FCC2_REGNUM (C0_REGNUM + 43)   /* fp cc reg 2 */
+#define FCC3_REGNUM (C0_REGNUM + 44)   /* fp cc reg 3 */
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.
@@ -375,4 +376,4 @@ CORE_ADDR sp64_push_arguments PARAMS ((int, struct value **, CORE_ADDR, unsigned
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   sparc64_extract_return_value(TYPE, REGBUF, VALBUF, 0)
 extern void
-sparc64_extract_return_value PARAMS ((struct type *, char [], char *, int));
+sparc64_extract_return_value PARAMS ((struct type *, char[], char *, int));
index 4545f32b4f4c7f568d365f61c99539d94fcb4985..8d83db1eebf8280ea02031e4bb75dfe46764d804 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for GDB with the SPARC64 Simulator.
    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 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 based on tm-spc-em.h.  Our contents are probably bogus
    but it's a good start.  */
index f3a9c662d746382ab94edc6f38ba2f58b5b772d1..ab0ad16e5ff04a7b52b3ff271be9f3d3dca81cb9 100644 (file)
@@ -4,21 +4,22 @@
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@mcc.com)
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifdef __STDC__
 struct frame_info;
@@ -158,7 +159,7 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
    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        G0_REGNUM 0             /* %g0 */
+#define        G0_REGNUM 0             /* %g0 */
 #define        G1_REGNUM 1             /* %g1 */
 #define O0_REGNUM 8            /* %o0 */
 #define        SP_REGNUM 14            /* Contains address of top of stack, \
@@ -178,7 +179,7 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
 #define        WIM_REGNUM 66           /* Window Invalid Mask (not really supported) */
 #define        TBR_REGNUM 67           /* Trap Base Register (not really supported) */
 #define        PC_REGNUM 68            /* Contains program counter */
-#define        NPC_REGNUM 69           /* Contains next PC */
+#define        NPC_REGNUM 69           /* Contains next PC */
 #define        FPS_REGNUM 70           /* Floating point status register */
 #define        CPS_REGNUM 71           /* Coprocessor status register */
 
@@ -208,7 +209,7 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
 struct frame_info;
 enum lval_type;
 #endif
-void sparc_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lvalp));
+void sparc_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lvalp));
 #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
       sparc_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
 
@@ -262,7 +263,7 @@ void sparc_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_AD
 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   sparc_extract_return_value(TYPE, REGBUF, VALBUF)
 extern void
-sparc_extract_return_value PARAMS ((struct type *, char [], char *));
+sparc_extract_return_value PARAMS ((struct type *, char[], char *));
 
 /* Write into appropriate registers a function return value
    of type TYPE, given in virtual format.  */
@@ -278,9 +279,9 @@ extern void sparc_store_return_value PARAMS ((struct type *, char *));
   (sparc_extract_struct_value_address (REGBUF))
 
 extern CORE_ADDR
-sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
-
+  sparc_extract_struct_value_address PARAMS ((char[REGISTER_BYTES]));
 \f
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -334,11 +335,11 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
   /* time of the register saves.  */ \
   int sp_offset;
 
-#define FRAME_INIT_SAVED_REGS(fp) /*no-op*/
+#define FRAME_INIT_SAVED_REGS(fp)      /*no-op */
 
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
   sparc_init_extra_frame_info (fromleaf, fci)
-extern void sparc_init_extra_frame_info PARAMS((int, struct frame_info *));
+extern void sparc_init_extra_frame_info PARAMS ((int, struct frame_info *));
 
 #define        PRINT_EXTRA_FRAME_INFO(fi) \
   { \
@@ -352,7 +353,7 @@ extern CORE_ADDR sparc_frame_chain PARAMS ((struct frame_info *));
 
 /* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames.  */
 
-#define        INIT_FRAME_PC(fromleaf, prev) /* nothing */
+#define        INIT_FRAME_PC(fromleaf, prev)   /* nothing */
 #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
   (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
              (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ());
@@ -473,24 +474,24 @@ void sparc_push_dummy_frame PARAMS ((void)), sparc_pop_frame PARAMS ((void));
    4:   9d e3 80 00     save  %sp, %g0, %sp
    8:   bc 10 00 02     mov  %g2, %fp
    c:   be 10 00 03     mov  %g3, %i7
-  10:   da 03 a0 58     ld  [ %sp + 0x58 ], %o5
-  14:   d8 03 a0 54     ld  [ %sp + 0x54 ], %o4
-  18:   d6 03 a0 50     ld  [ %sp + 0x50 ], %o3
-  1c:   d4 03 a0 4c     ld  [ %sp + 0x4c ], %o2
-  20:   d2 03 a0 48     ld  [ %sp + 0x48 ], %o1
-  24:   40 00 00 00     call  <fun>
-  28:   d0 03 a0 44     ld  [ %sp + 0x44 ], %o0
-  2c:   01 00 00 00     nop 
-  30:   91 d0 20 01     ta  1
-  34:   01 00 00 00     nop
+   10:   da 03 a0 58     ld  [ %sp + 0x58 ], %o5
+   14:   d8 03 a0 54     ld  [ %sp + 0x54 ], %o4
+   18:   d6 03 a0 50     ld  [ %sp + 0x50 ], %o3
+   1c:   d4 03 a0 4c     ld  [ %sp + 0x4c ], %o2
+   20:   d2 03 a0 48     ld  [ %sp + 0x48 ], %o1
+   24:   40 00 00 00     call  <fun>
+   28:   d0 03 a0 44     ld  [ %sp + 0x44 ], %o0
+   2c:   01 00 00 00     nop 
+   30:   91 d0 20 01     ta  1
+   34:   01 00 00 00     nop
 
    NOTES:
-       * the first four instructions are necessary only on the simulator.
-       * this is a multiple of 8 (not only 4) bytes.
-       * the `call' insn is a relative, not an absolute call.
-       * the `nop' at the end is needed to keep the trap from
-         clobbering things (if NPC pointed to garbage instead).
-*/
+   * the first four instructions are necessary only on the simulator.
+   * this is a multiple of 8 (not only 4) bytes.
+   * the `call' insn is a relative, not an absolute call.
+   * the `nop' at the end is needed to keep the trap from
+   clobbering things (if NPC pointed to garbage instead).
+ */
 
 #define CALL_DUMMY { 0xbc100001, 0x9de38000, 0xbc100002, 0xbe100003,   \
                     0xda03a058, 0xd803a054, 0xd603a050, 0xd403a04c,    \
@@ -523,7 +524,7 @@ void sparc_push_dummy_frame PARAMS ((void)), sparc_pop_frame PARAMS ((void));
 #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
  sparc_fix_call_dummy (dummyname, pc, fun, type, gcc_p)
 void sparc_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun,
-                                  struct type *value_type, int using_gcc));
+                                  struct type * value_type, int using_gcc));
 
 /* The Sparc returns long doubles on the stack.  */
 
@@ -585,4 +586,4 @@ extern int deferred_stores;
 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
   (sparc_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
 extern CORE_ADDR
-sparc_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
+  sparc_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
index bc430830b8ba775b663d4fe34f2c056b48e3eca9..2cec5128b08fc0c5b7502dace84a779935bf3aa9 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine definitions for GDB for an embedded SPARC.
    Copyright 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "sparc/tm-sparc.h"
 
@@ -37,11 +38,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
 #define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91}
 
-#undef  NUM_REGS /* formerly "72" */
+#undef  NUM_REGS               /* formerly "72" */
 /*                WIN  FP   CPU  CCP  ASR  AWR  APSR */
 #define NUM_REGS (32 + 32 + 8  + 8  + 8/*+ 32 + 1*/)
 
-#undef  REGISTER_BYTES /* formerly "(32*4 + 32*4 + 8*4)" */
+#undef  REGISTER_BYTES         /* formerly "(32*4 + 32*4 + 8*4)" */
 #define REGISTER_BYTES (32*4 + 32*4 + 8*4 + 8*4 + 8*4/* + 32*4 + 1*4*/)
 
 /* Initializer for an array of names of registers.
@@ -78,9 +79,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 }
 
 /* Remove FP dependant code which was defined in tm-sparc.h */
-#undef FP0_REGNUM /* Floating point register 0 */
-#undef FPS_REGNUM /* Floating point status register */
-#undef         CPS_REGNUM /* Coprocessor status register */
+#undef FP0_REGNUM              /* Floating point register 0 */
+#undef FPS_REGNUM              /* Floating point status register */
+#undef         CPS_REGNUM              /* Coprocessor status register */
 
 /* sparclet register numbers */
 #define CCSR_REGNUM 72
index d841f89c356738286aafb7b3d1630a9dbee5cb24..e419fe9dff1b38378802f702a9bfe6c63f49c0c4 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for GDB for a Fujitsu SPARClite.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_SPARCLITE 1
 
@@ -40,8 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define FRAME_CHAIN_VALID(fp,fi) alternate_frame_chain_valid (fp, fi)
 
-#undef NUM_REGS 
-#define NUM_REGS 80 
+#undef NUM_REGS
+#define NUM_REGS 80
 
 #undef REGISTER_BYTES
 #define REGISTER_BYTES (32*4+32*4+8*4+8*4)
@@ -61,14 +62,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr",        \
   "dia1", "dia2", "dda1", "dda2", "ddv1", "ddv2", "dcr", "dsr" }
 
-#define DIA1_REGNUM 72          /* debug instr address register 1 */
-#define DIA2_REGNUM 73          /* debug instr address register 2 */
-#define DDA1_REGNUM 74          /* debug data address register 1 */
-#define DDA2_REGNUM 75          /* debug data address register 2 */
-#define DDV1_REGNUM 76          /* debug data value register 1 */
-#define DDV2_REGNUM 77          /* debug data value register 2 */
-#define DCR_REGNUM 78           /* debug control register */
-#define DSR_REGNUM 79           /* debug status regsiter */
+#define DIA1_REGNUM 72         /* debug instr address register 1 */
+#define DIA2_REGNUM 73         /* debug instr address register 2 */
+#define DDA1_REGNUM 74         /* debug data address register 1 */
+#define DDA2_REGNUM 75         /* debug data address register 2 */
+#define DDV1_REGNUM 76         /* debug data value register 1 */
+#define DDV2_REGNUM 77         /* debug data value register 2 */
+#define DCR_REGNUM 78          /* debug control register */
+#define DSR_REGNUM 79          /* debug status regsiter */
 
 #define TARGET_HW_BREAK_LIMIT 2
 #define TARGET_HW_WATCH_LIMIT 2
@@ -84,11 +85,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    instruction which caused the watchpoint.  It will be necessary for
    GDB to step over the watchpoint. ***
 
-#define STOPPED_BY_WATCHPOINT(W) \
-  ((W).kind == TARGET_WAITKIND_STOPPED \
+   #define STOPPED_BY_WATCHPOINT(W) \
+   ((W).kind == TARGET_WAITKIND_STOPPED \
    && (W).value.sig == TARGET_SIGNAL_TRAP \
    && ((int) read_register (IPSW_REGNUM) & 0x00100000))
-*/
+ */
 
 /* Use these macros for watchpoint insertion/deletion.  */
 #define target_insert_watchpoint(addr, len, type) sparclite_insert_watchpoint (addr, len, type)
index 5a0d908c65858a31067e7db83163b84156b7649d..36924df371fe3300bdc247dd24ad5014a46cba90 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for Sparc running under LynxOS.
    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 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_SPARCLYNX_H
 #define TM_SPARCLYNX_H
index 3a9b4572c53a3dbc1a8f74498f8abb3611927dfa..2391f83f215fe8cefd50ef0bc8d1454da70bb2ed 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine definitions for GDB for an embedded SPARC.
    Copyright 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.  */
+   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 "sparc/tm-sparc.h"
 
index 985e18c45a9d2b8a5a7091b576187d5ff72ddbb1..5acc70fc8452dcb0fe86a28d0eb0f9444206e8d3 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for GDB for a Sun 4 running sunos 4.
    Copyright 1989, 1992, 1994, 1995 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 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 "sparc/tm-sparc.h"
 #include "tm-sunos.h"
index 7bab6e6778a0030d80c6501276a76688232dcac5..74c2d4ec21b65e42b75cfe3db580ac5f7bb49da7 100644 (file)
@@ -2,37 +2,38 @@
    Copyright 1989, 1992, 1993, 1994, 1995, 1997, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "sparc/tm-sparc.h"
 #include "tm-sysv4.h"
+
 /* There are two different signal handler trampolines in Solaris2.  */
 #define IN_SIGTRAMP(pc, name) \
   ((name) \
    && (STREQ ("sigacthandler", name) || STREQ ("ucbsigvechandler", name)))
+
 /* The signal handler gets a pointer to an ucontext as third argument
    if it is called from sigacthandler.  This is the offset to the saved
    PC within it.  sparc_frame_saved_pc knows how to deal with
-   ucbsigvechandler.  */  
+   ucbsigvechandler.  */
 #define SIGCONTEXT_PC_OFFSET 44
 
-#if 0  /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
+#if 0                          /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
 
 /* Offsets into jmp_buf.  Not defined by Sun, but at least documented in a
    comment in <machine/setjmp.h>! */
@@ -59,7 +60,7 @@ extern int
 get_longjmp_target PARAMS ((CORE_ADDR *));
 
 #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-#endif  /* 0 */
+#endif /* 0 */
 
 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
    and for SunPRO 3.0, N_FUN symbols too.  */
index 06a98fce661431cc926adfa5da98efdf0aefa18b..b6529f75b7f3e1735ab36f1c5c86d17b65f2f2aa 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1993, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "sparc/tm-spc-em.h"
 #include "tm-vxworks.h"
@@ -30,4 +31,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Number of registers in a ptrace_getfpregs call. */
 
 /* #define VX_SIZE_FPREGS (don't know how many) */
-
index 7d68b63b73c80e977b14b3d8fa75b3fd26905c70..87b2ee6d9f53f0b88a526714430575852d831406 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1989, 1993, 1994, 1995, 1996, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef XM_SPARCLINUX_H
 #define XM_SPARCLINUX_H
@@ -42,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    is a kludge.
    FIXME:  Make this more automatic. */
 
-#define MMAP_BASE_ADDRESS      0xE0000000      /* First mapping here */
-#define MMAP_INCREMENT         0x01000000      /* Increment to next mapping */
+#define MMAP_BASE_ADDRESS      0xE0000000      /* First mapping here */
+#define MMAP_INCREMENT         0x01000000      /* Increment to next mapping */
 
 #endif /* _XM_SPARCLINUX_H */
index 95fe8464c64f3cae8ee035e8b9438a2d19302c49..e469aabc1b47c19d8a3f533f3e060a44b6e9c570 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a Sparc running NetBSD, for GDB.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Get generic NetBSD host definitions. */
 #include "xm-nbsd.h"
index 06c247ea9c7cd25981b4d30d38b7c80cba0ea335..28f806f96be2d33142d6b9f24ac829b008377c49 100644 (file)
@@ -3,20 +3,21 @@
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@mcc.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
index 7e62628e4e1327f1541b98914e4f9a17a3ed66d2..7777bc7f9e039a6793bccdf89cadb551bed26001 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for Sparc running LynxOS, for GDB.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define HOST_BYTE_ORDER BIG_ENDIAN
 
index e50a2132f8ae669f1b95e09eeb5e6dbb508c751f..de781595a7d67893bdf5be6c13657b467b39de73 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1989, 1993, 1994, 1995, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 "sparc/xm-sparc.h"
 
index bc49ce418d483f633d597eb6eb9ab058adcbd7a5..01218fd2d23df8f8c22d2957d6db7d37395ac426 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running gdb on a Sun 4 running Solaris 2.
    Copyright 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 /* Most of what we know is generic to SPARC hosts.  */
 
index 8711d2457a4e6f908f7adaf44ee18e09d41e398c..6028337cc9c4def2903c0b990c788d93fd1c6b44 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB target for a tahoe running 4.3-Reno.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Ported by the State University of New York at Buffalo by the Distributed
@@ -189,7 +190,7 @@ extern CORE_ADDR tahoe_skip_prologue PARAMS ((CORE_ADDR));
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int tahoe_frame_num_args PARAMS ((struct frame_info *fi));
+extern int tahoe_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (tahoe_frame_num_args ((fi)))
 
 /* Return number of bytes at start of arglist that are not really args.  */
@@ -251,8 +252,8 @@ printf("POP_FRAME\n");                                                      \
 }
 
 /* This sequence of words is the instructions
-     calls #69, @#32323232
-     bpt
+   calls #69, @#32323232
+   bpt
    Note this is 8 bytes.  */
 
 #define CALL_DUMMY {0xbf699f32, 0x32323230}
@@ -268,4 +269,3 @@ printf("POP_FRAME\n");                                                      \
 { int temp = (int) fun;                                \
   *((char *) dummyname + 1) = nargs;           \
   memcpy((char *)dummyname+3,&temp,4); }
-
index 99af344c17c151a7d11e1d6bd394266b739d3697..c9e18d8c6103b76bb2fbbc0184da937b1112b6a9 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by the State University of New York at Buffalo, by the
    Distributed Computer Systems Lab, Department of Computer Science, 1991.
 
-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 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.  */
 
 /* Make sure the system include files define BIG_ENDIAN, UINT_MAX, const,
    etc, rather than GDB's files.  */
index 89aab87e76ad48cc193e2deb43c2bba8c9607129..0ec4887458a9c83f1ac25f9a9164507c4d74ba76 100644 (file)
@@ -2,26 +2,27 @@
    Copyright 1997
    Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef TM_TIC80_H
 #define TM_TIC80_H
 
-#ifdef __STDC__                /* Forward declare structs used in prototypes */
+#ifdef __STDC__                        /* Forward declare structs used in prototypes */
 struct frame_info;
 struct type;
 struct value;
@@ -56,9 +57,9 @@ struct frame_saved_regs;
 #define A0_REGNUM 34           /* Accumulator register 0 */
 #define A3_REGNUM 37           /* Accumulator register 1 */
 
-#define R0_REGNUM 0             /* General Purpose Register 0 - for sim */
-#define Rn_REGNUM 31            /* Last General Purpose Register - for sim */
-#define An_REGNUM A3_REGNUM     /* Last Accumulator register - for sim */
+#define R0_REGNUM 0            /* General Purpose Register 0 - for sim */
+#define Rn_REGNUM 31           /* Last General Purpose Register - for sim */
+#define An_REGNUM A3_REGNUM    /* Last Accumulator register - for sim */
 
 /* Total amount of space needed to store our copies of the machine's
    register state, the array `registers'.  */
@@ -116,12 +117,12 @@ struct frame_saved_regs;
    This is often the number of bytes in BREAKPOINT
    but not always.  */
 
-#define DECR_PC_AFTER_BREAK    0                       /* FIXME! */
+#define DECR_PC_AFTER_BREAK    0       /* FIXME! */
 
 /* Discard from the stack the innermost frame, restoring all registers.  */
 
 #define POP_FRAME tic80_pop_frame(get_current_frame ())
-extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info *frame));
+extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info * frame));
 
 /* Return number of bytes at start of arglist that are not really args.  */
 
@@ -149,7 +150,7 @@ extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info *frame));
   int frameoffset;             \
   int framereg;
 
-extern void tic80_init_extra_frame_info PARAMS ((struct frame_info *fi));
+extern void tic80_init_extra_frame_info PARAMS ((struct frame_info * fi));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) tic80_init_extra_frame_info (fi)
 #define INIT_FRAME_PC          /* Not necessary */
 
@@ -217,8 +218,8 @@ extern CORE_ADDR tic80_frame_saved_pc PARAMS ((struct frame_info *));
 
 
 /* PUSH_ARGUMENTS */
-extern CORE_ADDR tic80_push_arguments PARAMS ((int nargs, 
-                                              struct value **args, 
+extern CORE_ADDR tic80_push_arguments PARAMS ((int nargs,
+                                              struct value ** args,
                                               CORE_ADDR sp,
                                               unsigned char struct_return,
                                               CORE_ADDR struct_addr));
@@ -249,4 +250,4 @@ extern CORE_ADDR tic80_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 #define PUSH_DUMMY_FRAME             generic_push_dummy_frame ()
 #define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
 
-#endif /* TM_TIC80_H */
+#endif /* TM_TIC80_H */
index 7107241420c95f5036e88bb9c3c8827cb9380463..b990be65a0d9e2250840ddf5c112916dc0c84d35 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for LynxOS targets.
    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 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_LYNX_H
 #define TM_LYNX_H
index e295d85ea2d947eb2fd89281a594af153871bdee..e8701be274a5702a8f37910e907310bfbf27c340 100644 (file)
@@ -2,18 +2,19 @@
    This is included by other tm-*.h files to specify NetBSD-specific stuff.
    Copyright 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
index 26ec3cff866e7dc519405537503148391e89f6b0..c8db07e865e1a1cb305643bf891ccc8ec827a0d3 100644 (file)
@@ -2,23 +2,24 @@
    This is included by other tm-*.h files to specify SunOS-specific stuff.
    Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#include "solib.h"     /* Support for shared libraries. */
+#include "solib.h"             /* Support for shared libraries. */
 
 /* Return non-zero if we are in a shared library trampoline code stub. */
 
index 2c085410c0920cea37d31379062355c123c6476e..61f2568f2a51e9b3cc6599c3db9ce3af799389ba 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.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 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 SVR4 shared libraries, each call to a library routine goes through
    a small piece of trampoline code in the ".plt" section.
index 8653f88911cd4fb609ee8e6a1e185075c085213f..9afc0b4fc79cda1a3a6898b69cf974908796d32f 100644 (file)
@@ -1,21 +1,22 @@
 /* Target machine description for VxWorks, for GDB, the GNU debugger.
    Copyright 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define        GDBINIT_FILENAME        ".vxgdbinit"
 
index 05fa79db36afb957611038ee317c4f0c238580fb..ecea72d3ea6a77b3d75c04b38d2023bcb6065613 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1996
    Free Software Foundation, Inc. 
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
 
@@ -81,7 +82,7 @@ extern char **v850_register_names;
 
 #define MAX_REGISTER_VIRTUAL_SIZE 4
 
-#define BREAKPOINT {0x40, 0xF8} /* little-ended */
+#define BREAKPOINT {0x40, 0xF8}        /* little-ended */
 
 #define FUNCTION_START_OFFSET 0
 
@@ -100,19 +101,19 @@ struct value;
 
 #define EXTRA_FRAME_INFO struct frame_saved_regs fsr;
 
-extern void v850_init_extra_frame_info PARAMS ((struct frame_info *fi));
+extern void v850_init_extra_frame_info PARAMS ((struct frame_info * fi));
 #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) v850_init_extra_frame_info (fi)
 #define INIT_FRAME_PC          /* Not necessary */
 
-extern void v850_frame_find_saved_regs PARAMS ((struct frame_info *fi, struct frame_saved_regs *regaddr));
+extern void v850_frame_find_saved_regs PARAMS ((struct frame_info * fi, struct frame_saved_regs * regaddr));
 #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
 
-extern CORE_ADDR v850_frame_chain PARAMS ((struct frame_info *fi));
+extern CORE_ADDR v850_frame_chain PARAMS ((struct frame_info * fi));
 #define FRAME_CHAIN(fi) v850_frame_chain (fi)
 #define FRAME_CHAIN_VALID(FP, FI)      generic_frame_chain_valid (FP, FI)
 
-extern CORE_ADDR v850_find_callers_reg PARAMS ((struct frame_info *fi, int regnum));
-extern CORE_ADDR v850_frame_saved_pc   PARAMS ((struct frame_info *));
+extern CORE_ADDR v850_find_callers_reg PARAMS ((struct frame_info * fi, int regnum));
+extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *));
 #define FRAME_SAVED_PC(FI) (v850_frame_saved_pc (FI))
 
 #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
@@ -134,7 +135,7 @@ extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc));
 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
 #define FRAME_NUM_ARGS(fi) (-1)
 
-extern void v850_pop_frame PARAMS ((struct frame_info *frame));
+extern void v850_pop_frame PARAMS ((struct frame_info * frame));
 #define POP_FRAME v850_pop_frame (get_current_frame ())
 
 #define USE_GENERIC_DUMMY_FRAMES 1
@@ -151,9 +152,9 @@ extern CORE_ADDR v850_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
 #define PUSH_DUMMY_FRAME       generic_push_dummy_frame ()
 
 extern CORE_ADDR
-v850_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
-                            unsigned char struct_return,
-                            CORE_ADDR struct_addr));
+  v850_push_arguments PARAMS ((int nargs, struct value ** args, CORE_ADDR sp,
+                              unsigned char struct_return,
+                              CORE_ADDR struct_addr));
 #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
   (v850_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
 
index 11f7dc9f64fb3fb7ee147c050b144d6218c4bb78..c2baef18fa699f176a47f357ad96683829284aeb 100644 (file)
@@ -1,21 +1,22 @@
 /* Common definitions for GDB native support on Vaxen under 4.2bsd and Ultrix.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define REGISTER_U_ADDR(addr, blockend, regno)         \
 { addr = blockend - 0110 + regno * 4;                  \
@@ -24,5 +25,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   if (regno == FP_REGNUM) addr = blockend - 0120;      \
   if (regno == AP_REGNUM) addr = blockend - 0124;      \
   if (regno == SP_REGNUM) addr = blockend - 20; }
-
-
index 277aa8b8a41919dd09b7f1057ec0b88cdfc9167b..607ee7460993a96abe2c8c442201489571fb3237 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on a vax under 4.2bsd.
    Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
@@ -151,8 +152,8 @@ extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR));
    as a CORE_ADDR (or an expression that can be used as one).  */
 
 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
 \f
+
 /* Describe the pointer in each stack frame to the previous stack frame
    (its caller).  */
 
@@ -213,7 +214,7 @@ extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR));
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
-extern int vax_frame_num_args PARAMS ((struct frame_info *fi));
+extern int vax_frame_num_args PARAMS ((struct frame_info * fi));
 #define FRAME_NUM_ARGS(fi) (vax_frame_num_args ((fi)))
 
 /* Return number of bytes at start of arglist that are not really args.  */
@@ -290,13 +291,13 @@ extern int vax_frame_num_args PARAMS ((struct frame_info *fi));
 }
 
 /* This sequence of words is the instructions
-     calls #69, @#32323232
-     bpt
+   calls #69, @#32323232
+   bpt
    Note this is 8 bytes.  */
 
 #define CALL_DUMMY {0x329f69fb, 0x03323232}
 
-#define CALL_DUMMY_START_OFFSET 0  /* Start execution at beginning of dummy */
+#define CALL_DUMMY_START_OFFSET 0      /* Start execution at beginning of dummy */
 
 #define CALL_DUMMY_BREAKPOINT_OFFSET 7
 
index fea11c715d57a6683bf307803551a626fca4d6be..3512d5b18aa5d06638dedf8a75ab25268e357d5b 100644 (file)
@@ -1,21 +1,22 @@
 /* Common definitions to make GDB run on Vaxen under 4.2bsd and Ultrix.
    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 HOST_BYTE_ORDER LITTLE_ENDIAN
 
index 24c643706018d46124d90dd9e3b5d29c3a89af29..5b9020a55247f015ab5811c56fdbb5f696760bbf 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions to make GDB run on a vax under Ultrix. */
 
 #include "vax/xm-vax.h"
-extern char *strdup();
+extern char *strdup ();
 
 /* This is required for Ultrix 3.1b, not for later versions.  Ultrix
    3.1b can't just use xm-vaxult2.h because Ultrix 3.1b does define
index d0d3d62c7aa50039d680e8069b0084021840898a..3d039ce95f6603a991a18c77ce26136248d599bc 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions to make GDB run on a vax under Ultrix. */
 
 #include "vax/xm-vax.h"
-extern char *strdup();
+extern char *strdup ();
 
 #define NO_PTRACE_H
 
index 412624dacc4fd5c62cc2110e741be1296c792e40..b1fe4eddcebcb8ebc789ea4afa2473332b069e36 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a WDC 65816 machine.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Contributed by Steve Chamberlain sac@cygnus.com */
 
@@ -60,7 +61,7 @@ extern CORE_ADDR w65_skip_prologue ();
 /* Illegal instruction - used by the simulator for breakpoint
    detection */
 
-#define BREAKPOINT {0xcb} /* WAI */
+#define BREAKPOINT {0xcb}      /* WAI */
 
 /* If your kernel resets the pc after the trap happens you may need to
    define this before including this file.  */
@@ -68,13 +69,13 @@ extern CORE_ADDR w65_skip_prologue ();
 
 /* Return 1 if P points to an invalid floating point value.  */
 
-#define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
+#define INVALID_FLOAT(p, len) 0        /* Just a first guess; not checked */
 
 /* Say how long registers are.  */
-/*#define REGISTER_TYPE  int*/
+/*#define REGISTER_TYPE  int */
 
 /* Say how much memory is needed to store a copy of the register set */
-#define REGISTER_BYTES    (NUM_REGS*4) 
+#define REGISTER_BYTES    (NUM_REGS*4)
 
 /* Index within `registers' of the first byte of the space for
    register N.  */
index 87062f77e5f80f4d809f1280e318579573fced1b..14d62448c653cff0bb83cf81058a7f0008178a75 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1995, 1998 Free Software Foundation, Inc.
    Contributed by Cygnus Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The following text is taken from config/rs6000.mh:
  * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says
@@ -67,7 +68,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define        vfork   fork
 
-char *termdef();
+char *termdef ();
 
 /* Signal handler for SIGWINCH `window size changed'. */
 
index d73e2c1061903154b56073e40a9248b002fa945a..e85fb2b5e9a92c10c64be414b63c4beab420666f 100644 (file)
@@ -1,20 +1,21 @@
 /* Host-dependent definitions for any CPU running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#include <limits.h>    /* for INT_MIN */
+#include <limits.h>            /* for INT_MIN */
index 0c473d7557266b9c8c46288862ee933954bed2cc..f6aa90ecc29a587b968879afce063c73c5bd49ed 100644 (file)
@@ -1,21 +1,22 @@
 /* Macro definitions for running GDB on Apple Macintoshes.
    Copyright (C) 1994, 1995 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 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 "mpw.h"
 
index 2332bb520a435002ee2dcdac2fbaf9cae4994612..18a668d3bf8a2b9d42e8ce781c3a8ede16611715 100644 (file)
@@ -1,21 +1,22 @@
 /* Host-dependent definitions for any CPU running NetBSD.
    Copyright 1993, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* We have to include these files now, so that GDB will not make
    competing definitions in defs.h.  */
index 06215e64057ebb5b5dbc50d08ac4dddd873b942f..e82e9289ceb323bb11896e6c4c745fb972390465 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.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 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.  */
 
 /* SVR4 has termios facilities. */
 
index 3b38d75f1b00e753403fff10672c24acfa2dd48d..4f0ec94fe4fa7a7fb06243b3d39d38061812e692 100644 (file)
@@ -1,21 +1,22 @@
 /* Parameters for execution on a z8000 series machine.
    Copyright 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define IEEE_FLOAT 1
 
@@ -68,8 +69,8 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
 
 #define REGISTER_TYPE unsigned int
 
-#define NUM_REGS       23   /* 16 registers + 1 ccr + 1 pc + 3 debug
-                               regs + fake fp + fake sp*/
+#define NUM_REGS       23      /* 16 registers + 1 ccr + 1 pc + 3 debug
+                                  regs + fake fp + fake sp */
 #define REGISTER_BYTES  (NUM_REGS *4)
 
 /* Index within `registers' of the first byte of the space for
@@ -87,7 +88,7 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
 /* Number of bytes of storage in the program's representation
    for register N.  */
 
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) 
+#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
 
 /* Largest value REGISTER_RAW_SIZE can have.  */
 
@@ -103,7 +104,7 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
 #define REGISTER_VIRTUAL_TYPE(N) \
  (REGISTER_VIRTUAL_SIZE(N) == 2? builtin_type_unsigned_int : builtin_type_long)
 
-/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y)*/
+/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y) */
 /* Initializer for an array of names of registers.
    Entries beyond the first NUM_REGS are ignored.  */
 
@@ -202,8 +203,8 @@ struct frame_info;
 #endif
 extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *));
 #define FRAME_INIT_SAVED_REGS(fi) z8k_frame_init_saved_regs (fi)
-
 \f
+
 /* Things needed for making the inferior call functions.
    It seems like every m68k based machine has almost identical definitions
    in the individual machine's configuration files.  Most other cpu types
@@ -214,20 +215,20 @@ extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *));
 /* The CALL_DUMMY macro is the sequence of instructions, as disassembled
    by gdb itself:
 
-       fmovemx fp0-fp7,sp@-                    0xf227 0xe0ff
-       moveml d0-a5,sp@-                       0x48e7 0xfffc
-       clrw sp@-                               0x4267
-       movew ccr,sp@-                          0x42e7
+   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.  *../
+   /..* 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.  *../
 
-       jsr @#0x32323232                        0x4eb9 0x3232 0x3232
-       addal #0x69696969,sp                    0xdffc 0x6969 0x6969
-       trap #<your BPT_VECTOR number here>     0x4e4?
-       nop                                     0x4e71
+   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).
    We actually start executing at the jsr, since the pushing of the
@@ -240,8 +241,8 @@ extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *));
 
 
 #define CALL_DUMMY { 0 }
-#define CALL_DUMMY_LENGTH 24           /* Size of CALL_DUMMY */
-#define CALL_DUMMY_START_OFFSET 8      /* Offset to jsr instruction*/
+#define CALL_DUMMY_LENGTH 24   /* Size of CALL_DUMMY */
+#define CALL_DUMMY_START_OFFSET 8      /* Offset to jsr instruction */
 
 
 /* Insert the specified number of args and function address
@@ -284,4 +285,3 @@ int sim_z8001_mode;
   z8k_set_pointer_size(objfile->obfd->arch_info->bits_per_address);
 
 #define REGISTER_SIZE 4
-
index 4e388d1a63c8bc1969a1082f27193f18be84e26f..f37af52d8e460dc68e76b8bbc64fe292981299f1 100644 (file)
 /* OBSOLETE       op = read_memory_integer (pc, 2); */
 /* OBSOLETE       ix = (op >> 3) & 7; */
 /* OBSOLETE       if (ix != 6) */
-/* OBSOLETE    break; */
+/* OBSOLETE     break; */
 /* OBSOLETE       if ((op & 0xfcc0) == 0x3000) */
-/* OBSOLETE    pc += 4; */
+/* OBSOLETE     pc += 4; */
 /* OBSOLETE       else if ((op & 0xfcc0) == 0x3040) */
-/* OBSOLETE    pc += 6; */
+/* OBSOLETE     pc += 6; */
 /* OBSOLETE       else if ((op & 0xfcc0) == 0x2800) */
-/* OBSOLETE    pc += 4; */
+/* OBSOLETE     pc += 4; */
 /* OBSOLETE       else if ((op & 0xfcc0) == 0x2840) */
-/* OBSOLETE    pc += 6; */
+/* OBSOLETE     pc += 6; */
 /* OBSOLETE       else */
-/* OBSOLETE    break; */
+/* OBSOLETE     break; */
 /* OBSOLETE     } */
 /* OBSOLETE   return pc; */
 /* OBSOLETE } */
@@ -88,7 +88,7 @@
 /* OBSOLETE   extern CORE_ADDR text_start, text_end; */
 /* OBSOLETE   CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI); */
 /* OBSOLETE   frameless = (call_addr >= text_start && call_addr < text_end */
-/* OBSOLETE           && read_memory_integer (call_addr - 6, 1) == 0x22); */
+/* OBSOLETE            && read_memory_integer (call_addr - 6, 1) == 0x22); */
 /* OBSOLETE   return frameless; */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE       make_cleanup (free, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, */
-/* OBSOLETE                    &execfile); */
+/* OBSOLETE                     &execfile); */
 /* OBSOLETE       if (execchan < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (myread (execchan, &filehdr, sizeof filehdr) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (! IS_SOFF_MAGIC (filehdr.h_magic)) */
-/* OBSOLETE    error ("%s: not an executable file.", filename); */
+/* OBSOLETE     error ("%s: not an executable file.", filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (myread (execchan, &opthdr, filehdr.h_opthdr) <= 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       /* Read through the section headers. */
-/* OBSOLETE     For text, data, etc, record an entry in the exec file map. */
-/* OBSOLETE     Record text_start and text_end.  *x/ */
+/* OBSOLETE      For text, data, etc, record an entry in the exec file map. */
+/* OBSOLETE      Record text_start and text_end.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       lseek (execchan, (long) filehdr.h_scnptr, 0); */
 /* OBSOLETE  */
 /* OBSOLETE       for (n = 0; n < filehdr.h_nscns; n++) */
-/* OBSOLETE    { */
-/* OBSOLETE      if (myread (execchan, &scnhdr, sizeof scnhdr) < 0) */
-/* OBSOLETE        perror_with_name (filename); */
-/* OBSOLETE  */
-/* OBSOLETE      if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */
-/* OBSOLETE          && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */
-/* OBSOLETE        { */
-/* OBSOLETE          exec_map[n_exec].mem_addr = scnhdr.s_vaddr; */
-/* OBSOLETE          exec_map[n_exec].mem_end = scnhdr.s_vaddr + scnhdr.s_size; */
-/* OBSOLETE          exec_map[n_exec].file_addr = scnhdr.s_scnptr; */
-/* OBSOLETE          exec_map[n_exec].type = scnhdr.s_flags & S_TYPMASK; */
-/* OBSOLETE          n_exec++; */
-/* OBSOLETE  */
-/* OBSOLETE          if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT) */
-/* OBSOLETE            { */
-/* OBSOLETE              text_start = scnhdr.s_vaddr; */
-/* OBSOLETE              text_end =  scnhdr.s_vaddr + scnhdr.s_size; */
-/* OBSOLETE            } */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       if (myread (execchan, &scnhdr, sizeof scnhdr) < 0) */
+/* OBSOLETE         perror_with_name (filename); */
+/* OBSOLETE  */
+/* OBSOLETE       if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */
+/* OBSOLETE           && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */
+/* OBSOLETE         { */
+/* OBSOLETE           exec_map[n_exec].mem_addr = scnhdr.s_vaddr; */
+/* OBSOLETE           exec_map[n_exec].mem_end = scnhdr.s_vaddr + scnhdr.s_size; */
+/* OBSOLETE           exec_map[n_exec].file_addr = scnhdr.s_scnptr; */
+/* OBSOLETE           exec_map[n_exec].type = scnhdr.s_flags & S_TYPMASK; */
+/* OBSOLETE           n_exec++; */
+/* OBSOLETE  */
+/* OBSOLETE           if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT) */
+/* OBSOLETE             { */
+/* OBSOLETE               text_start = scnhdr.s_vaddr; */
+/* OBSOLETE               text_end =  scnhdr.s_vaddr + scnhdr.s_size; */
+/* OBSOLETE             } */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       fstat (execchan, &st_exec); */
 /* OBSOLETE       exec_mtime = st_exec.st_mtime; */
 /* OBSOLETE       xferchan = 0; */
 /* OBSOLETE  */
 /* OBSOLETE       /* Determine which file the next bunch of addresses reside in, */
-/* OBSOLETE     and where in the file.  Set the file's read/write pointer */
-/* OBSOLETE     to point at the proper place for the desired address */
-/* OBSOLETE     and set xferfile and xferchan for the correct file. */
-/* OBSOLETE     If desired address is nonexistent, leave them zero. */
-/* OBSOLETE     i is set to the number of bytes that can be handled */
-/* OBSOLETE     along with the next address.  *x/ */
+/* OBSOLETE      and where in the file.  Set the file's read/write pointer */
+/* OBSOLETE      to point at the proper place for the desired address */
+/* OBSOLETE      and set xferfile and xferchan for the correct file. */
+/* OBSOLETE      If desired address is nonexistent, leave them zero. */
+/* OBSOLETE      i is set to the number of bytes that can be handled */
+/* OBSOLETE      along with the next address.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       i = len; */
 /* OBSOLETE  */
 /* OBSOLETE       for (n = 0; n < n_core; n++) */
-/* OBSOLETE    { */
-/* OBSOLETE      if (memaddr >= core_map[n].mem_addr && memaddr < core_map[n].mem_end */
-/* OBSOLETE          && (core_map[n].thread == -1 */
-/* OBSOLETE              || core_map[n].thread == inferior_thread)) */
-/* OBSOLETE        { */
-/* OBSOLETE          i = min (len, core_map[n].mem_end - memaddr); */
-/* OBSOLETE          fileptr = core_map[n].file_addr + memaddr - core_map[n].mem_addr; */
-/* OBSOLETE          if (core_map[n].file_addr) */
-/* OBSOLETE            { */
-/* OBSOLETE              xferfile = &corefile; */
-/* OBSOLETE              xferchan = corechan; */
-/* OBSOLETE            } */
-/* OBSOLETE          break; */
-/* OBSOLETE        } */
-/* OBSOLETE      else if (core_map[n].mem_addr >= memaddr */
-/* OBSOLETE               && core_map[n].mem_addr < memaddr + i) */
-/* OBSOLETE        i = core_map[n].mem_addr - memaddr; */
+/* OBSOLETE     { */
+/* OBSOLETE       if (memaddr >= core_map[n].mem_addr && memaddr < core_map[n].mem_end */
+/* OBSOLETE           && (core_map[n].thread == -1 */
+/* OBSOLETE               || core_map[n].thread == inferior_thread)) */
+/* OBSOLETE         { */
+/* OBSOLETE           i = min (len, core_map[n].mem_end - memaddr); */
+/* OBSOLETE           fileptr = core_map[n].file_addr + memaddr - core_map[n].mem_addr; */
+/* OBSOLETE           if (core_map[n].file_addr) */
+/* OBSOLETE             { */
+/* OBSOLETE               xferfile = &corefile; */
+/* OBSOLETE               xferchan = corechan; */
+/* OBSOLETE             } */
+/* OBSOLETE           break; */
+/* OBSOLETE         } */
+/* OBSOLETE       else if (core_map[n].mem_addr >= memaddr */
+/* OBSOLETE                && core_map[n].mem_addr < memaddr + i) */
+/* OBSOLETE         i = core_map[n].mem_addr - memaddr; */
 /* OBSOLETE         } */
 /* OBSOLETE  */
 /* OBSOLETE       if (!xferfile)  */
-/* OBSOLETE    for (n = 0; n < n_exec; n++) */
-/* OBSOLETE      { */
-/* OBSOLETE        if (memaddr >= exec_map[n].mem_addr */
-/* OBSOLETE            && memaddr < exec_map[n].mem_end) */
-/* OBSOLETE          { */
-/* OBSOLETE            i = min (len, exec_map[n].mem_end - memaddr); */
-/* OBSOLETE            fileptr = exec_map[n].file_addr + memaddr */
-/* OBSOLETE              - exec_map[n].mem_addr; */
-/* OBSOLETE            if (exec_map[n].file_addr) */
-/* OBSOLETE              { */
-/* OBSOLETE                xferfile = &execfile; */
-/* OBSOLETE                xferchan = execchan; */
-/* OBSOLETE              } */
-/* OBSOLETE            break; */
-/* OBSOLETE          } */
-/* OBSOLETE        else if (exec_map[n].mem_addr >= memaddr */
-/* OBSOLETE                 && exec_map[n].mem_addr < memaddr + i) */
-/* OBSOLETE          i = exec_map[n].mem_addr - memaddr; */
-/* OBSOLETE      } */
+/* OBSOLETE     for (n = 0; n < n_exec; n++) */
+/* OBSOLETE       { */
+/* OBSOLETE         if (memaddr >= exec_map[n].mem_addr */
+/* OBSOLETE             && memaddr < exec_map[n].mem_end) */
+/* OBSOLETE           { */
+/* OBSOLETE             i = min (len, exec_map[n].mem_end - memaddr); */
+/* OBSOLETE             fileptr = exec_map[n].file_addr + memaddr */
+/* OBSOLETE               - exec_map[n].mem_addr; */
+/* OBSOLETE             if (exec_map[n].file_addr) */
+/* OBSOLETE               { */
+/* OBSOLETE                 xferfile = &execfile; */
+/* OBSOLETE                 xferchan = execchan; */
+/* OBSOLETE               } */
+/* OBSOLETE             break; */
+/* OBSOLETE           } */
+/* OBSOLETE         else if (exec_map[n].mem_addr >= memaddr */
+/* OBSOLETE                  && exec_map[n].mem_addr < memaddr + i) */
+/* OBSOLETE           i = exec_map[n].mem_addr - memaddr; */
+/* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE       /* Now we know which file to use. */
-/* OBSOLETE     Set up its pointer and transfer the data.  *x/ */
+/* OBSOLETE      Set up its pointer and transfer the data.  *x/ */
 /* OBSOLETE       if (xferfile) */
-/* OBSOLETE    { */
-/* OBSOLETE      if (*xferfile == 0) */
-/* OBSOLETE        if (xferfile == &execfile) */
-/* OBSOLETE          error ("No program file to examine."); */
-/* OBSOLETE        else */
-/* OBSOLETE          error ("No core dump file or running program to examine."); */
-/* OBSOLETE      val = lseek (xferchan, fileptr, 0); */
-/* OBSOLETE      if (val < 0) */
-/* OBSOLETE        perror_with_name (*xferfile); */
-/* OBSOLETE      val = myread (xferchan, myaddr, i); */
-/* OBSOLETE      if (val < 0) */
-/* OBSOLETE        perror_with_name (*xferfile); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       if (*xferfile == 0) */
+/* OBSOLETE         if (xferfile == &execfile) */
+/* OBSOLETE           error ("No program file to examine."); */
+/* OBSOLETE         else */
+/* OBSOLETE           error ("No core dump file or running program to examine."); */
+/* OBSOLETE       val = lseek (xferchan, fileptr, 0); */
+/* OBSOLETE       if (val < 0) */
+/* OBSOLETE         perror_with_name (*xferfile); */
+/* OBSOLETE       val = myread (xferchan, myaddr, i); */
+/* OBSOLETE       if (val < 0) */
+/* OBSOLETE         perror_with_name (*xferfile); */
+/* OBSOLETE     } */
 /* OBSOLETE       /* If this address is for nonexistent memory, */
-/* OBSOLETE     read zeros if reading, or do nothing if writing.  *x/ */
+/* OBSOLETE      read zeros if reading, or do nothing if writing.  *x/ */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      memset (myaddr, '\0', i); */
-/* OBSOLETE      returnval = EIO; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       memset (myaddr, '\0', i); */
+/* OBSOLETE       returnval = EIO; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       memaddr += i; */
 /* OBSOLETE       myaddr += i; */
 /* OBSOLETE     { */
 /* OBSOLETE       struct pmap *p = &ptrs[n]; */
 /* OBSOLETE       if (n > 0) */
-/* OBSOLETE    { */
-/* OBSOLETE      if (p->mem_addr < ptrs[n-1].mem_end) */
-/* OBSOLETE        p->mem_addr = ptrs[n-1].mem_end; */
-/* OBSOLETE      if (p->mem_addr >= p->mem_end) */
-/* OBSOLETE        continue; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       if (p->mem_addr < ptrs[n-1].mem_end) */
+/* OBSOLETE         p->mem_addr = ptrs[n-1].mem_end; */
+/* OBSOLETE       if (p->mem_addr >= p->mem_end) */
+/* OBSOLETE         continue; */
+/* OBSOLETE     } */
 /* OBSOLETE       printf_filtered ("%08x .. %08x  %-6s  %s\n", */
-/* OBSOLETE                   p->mem_addr, p->mem_end, idstr[p->type], */
-/* OBSOLETE                   p->which ? execfile : corefile); */
+/* OBSOLETE                    p->mem_addr, p->mem_end, idstr[p->type], */
+/* OBSOLETE                    p->which ? execfile : corefile); */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE      char *name; */
 /* OBSOLETE { */
 /* OBSOLETE     if ((name[0] == 'c' || name[0] == 'C') */
-/* OBSOLETE    && name[1] >= '0' && name[1] <= '9' */
-/* OBSOLETE    && (name[2] == '\0' */
-/* OBSOLETE        || (name[2] >= '0' && name[2] <= '9' */
-/* OBSOLETE            && name[3] == '\0' && name[1] != '0')) */
-/* OBSOLETE    && atoi (&name[1]) < 64) return 1; */
+/* OBSOLETE     && name[1] >= '0' && name[1] <= '9' */
+/* OBSOLETE     && (name[2] == '\0' */
+/* OBSOLETE         || (name[2] >= '0' && name[2] <= '9' */
+/* OBSOLETE             && name[3] == '\0' && name[1] != '0')) */
+/* OBSOLETE     && atoi (&name[1]) < 64) return 1; */
 /* OBSOLETE  */
 /* OBSOLETE   if ((name[0] == 'v' || name[0] == 'V') */
 /* OBSOLETE       && (((name[1] & -8) == '0' && name[2] == '\0') */
-/* OBSOLETE      || STREQ (name, "vl") */
-/* OBSOLETE      || STREQ (name, "vs")  */
-/* OBSOLETE      || STREQ (name, "vm"))) */
+/* OBSOLETE       || STREQ (name, "vl") */
+/* OBSOLETE       || STREQ (name, "vs")  */
+/* OBSOLETE       || STREQ (name, "vm"))) */
 /* OBSOLETE     return 1; */
 /* OBSOLETE   else return 0; */
 /* OBSOLETE } */
 /* OBSOLETE   if (STREQ (name, "vl")) */
 /* OBSOLETE     { */
 /* OBSOLETE       val = value_from_longest (builtin_type_int, */
-/* OBSOLETE                         (LONGEST) *read_vector_register_1 (VL_REGNUM)); */
+/* OBSOLETE                          (LONGEST) *read_vector_register_1 (VL_REGNUM)); */
 /* OBSOLETE     } */
 /* OBSOLETE   else if (STREQ (name, "vs")) */
 /* OBSOLETE     { */
 /* OBSOLETE       val = value_from_longest (builtin_type_int, */
-/* OBSOLETE                         (LONGEST) *read_vector_register_1 (VS_REGNUM)); */
+/* OBSOLETE                          (LONGEST) *read_vector_register_1 (VS_REGNUM)); */
 /* OBSOLETE     } */
 /* OBSOLETE   else if (STREQ (name, "vm")) */
 /* OBSOLETE     { */
 /* OBSOLETE       long i, *p; */
 /* OBSOLETE       memcpy (vm, read_vector_register_1 (VM_REGNUM), sizeof vm); */
 /* OBSOLETE       range_type = */
-/* OBSOLETE    create_range_type ((struct type *) NULL, builtin_type_int, 0, len - 1); */
+/* OBSOLETE     create_range_type ((struct type *) NULL, builtin_type_int, 0, len - 1); */
 /* OBSOLETE       type = */
-/* OBSOLETE    create_array_type ((struct type *) NULL, builtin_type_int, range_type); */
+/* OBSOLETE     create_array_type ((struct type *) NULL, builtin_type_int, range_type); */
 /* OBSOLETE       val = allocate_value (type); */
 /* OBSOLETE       p = (long *) VALUE_CONTENTS (val); */
 /* OBSOLETE       for (i = 0; i < len; i++)  */
-/* OBSOLETE    *p++ = !! (vm[3 - (i >> 5)] & (1 << (i & 037))); */
+/* OBSOLETE     *p++ = !! (vm[3 - (i >> 5)] & (1 << (i & 037))); */
 /* OBSOLETE     } */
 /* OBSOLETE   else if (name[0] == 'V') */
 /* OBSOLETE     { */
 /* OBSOLETE       range_type = */
-/* OBSOLETE    create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */
+/* OBSOLETE     create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */
 /* OBSOLETE       type = */
-/* OBSOLETE    create_array_type ((struct type *) NULL, builtin_type_long_long, */
-/* OBSOLETE                       range_type); */
+/* OBSOLETE     create_array_type ((struct type *) NULL, builtin_type_long_long, */
+/* OBSOLETE                        range_type); */
 /* OBSOLETE       val = allocate_value (type); */
 /* OBSOLETE       memcpy (VALUE_CONTENTS (val), */
-/* OBSOLETE         read_vector_register_1 (name[1] - '0'), */
-/* OBSOLETE         TYPE_LENGTH (type)); */
+/* OBSOLETE          read_vector_register_1 (name[1] - '0'), */
+/* OBSOLETE          TYPE_LENGTH (type)); */
 /* OBSOLETE     } */
 /* OBSOLETE   else if (name[0] == 'v') */
 /* OBSOLETE     { */
 /* OBSOLETE       long *p1, *p2; */
 /* OBSOLETE       range_type = */
-/* OBSOLETE    create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */
+/* OBSOLETE     create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); */
 /* OBSOLETE       type = */
-/* OBSOLETE    create_array_type ((struct type *) NULL, builtin_type_long, */
-/* OBSOLETE                       range_type); */
+/* OBSOLETE     create_array_type ((struct type *) NULL, builtin_type_long, */
+/* OBSOLETE                        range_type); */
 /* OBSOLETE       val = allocate_value (type); */
 /* OBSOLETE       p1 = read_vector_register_1 (name[1] - '0'); */
 /* OBSOLETE       p2 = (long *) VALUE_CONTENTS (val); */
 /* OBSOLETE  */
 /* OBSOLETE   else if (name[0] == 'c') */
 /* OBSOLETE     val = value_from_longest (builtin_type_int, */
-/* OBSOLETE                       read_comm_register (atoi (&name[1]))); */
+/* OBSOLETE                        read_comm_register (atoi (&name[1]))); */
 /* OBSOLETE   else if (name[0] == 'C') */
 /* OBSOLETE     val = value_from_longest (builtin_type_long_long, */
-/* OBSOLETE                       read_comm_register (atoi (&name[1]))); */
+/* OBSOLETE                        read_comm_register (atoi (&name[1]))); */
 /* OBSOLETE  */
 /* OBSOLETE   VALUE_LVAL (val) = lval_internalvar; */
 /* OBSOLETE   VALUE_INTERNALVAR (val) = var; */
 /* OBSOLETE     { */
 /* OBSOLETE     case 0: */
 /* OBSOLETE       if ((lv == val || (unsigned) lv == val) */
-/* OBSOLETE      && ((lv & 0xf0000000) == 0x80000000 */
-/* OBSOLETE          || ((lv & 0xf0000000) == 0xf0000000 && lv < STACK_END_ADDR))) */
-/* OBSOLETE    { */
-/* OBSOLETE      print_longest (stream, "x", 0, val); */
-/* OBSOLETE      return; */
-/* OBSOLETE    } */
+/* OBSOLETE       && ((lv & 0xf0000000) == 0x80000000 */
+/* OBSOLETE           || ((lv & 0xf0000000) == 0xf0000000 && lv < STACK_END_ADDR))) */
+/* OBSOLETE     { */
+/* OBSOLETE       print_longest (stream, "x", 0, val); */
+/* OBSOLETE       return; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE     case 10: */
 /* OBSOLETE       print_longest (stream, TYPE_UNSIGNED (type) ? "u" : "d", 0, val); */
 /* OBSOLETE     { */
 /* OBSOLETE       new_radix = atoi (arg); */
 /* OBSOLETE       if (new_radix != 10 && new_radix != 16 && new_radix != 8)  */
-/* OBSOLETE    error ("base must be 8, 10 or 16, or null"); */
+/* OBSOLETE     error ("base must be 8, 10 or 16, or null"); */
 /* OBSOLETE       else output_radix = new_radix; */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE     if (!arg) */
 /* OBSOLETE       error_no_arg ("newname oldname"); */
-/* OBSOLETE     */
+/* OBSOLETE      */
 /* OBSOLETE     new = lookup_cmd (&arg, cmdlist, "", -1); */
 /* OBSOLETE     if (new && !strncmp (newname, new->name, strlen (new->name))) */
 /* OBSOLETE       { */
-/* OBSOLETE    newname = new->name; */
-/* OBSOLETE    if (!(*arg == '-'  */
-/* OBSOLETE          || (*arg >= 'a' && *arg <= 'z') */
-/* OBSOLETE          || (*arg >= 'A' && *arg <= 'Z') */
-/* OBSOLETE          || (*arg >= '0' && *arg <= '9'))) */
-/* OBSOLETE      error (aliaserr); */
+/* OBSOLETE     newname = new->name; */
+/* OBSOLETE     if (!(*arg == '-'  */
+/* OBSOLETE           || (*arg >= 'a' && *arg <= 'z') */
+/* OBSOLETE           || (*arg >= 'A' && *arg <= 'Z') */
+/* OBSOLETE           || (*arg >= '0' && *arg <= '9'))) */
+/* OBSOLETE       error (aliaserr); */
 /* OBSOLETE       } */
 /* OBSOLETE     else */
 /* OBSOLETE       { */
-/* OBSOLETE    arg = newname; */
-/* OBSOLETE    while (*arg == '-'  */
-/* OBSOLETE           || (*arg >= 'a' && *arg <= 'z') */
-/* OBSOLETE           || (*arg >= 'A' && *arg <= 'Z') */
-/* OBSOLETE           || (*arg >= '0' && *arg <= '9')) */
-/* OBSOLETE      arg++; */
-/* OBSOLETE    if (*arg != ' ' && *arg != '\t') */
-/* OBSOLETE      error (aliaserr); */
-/* OBSOLETE    *arg = '\0'; */
-/* OBSOLETE    arg++; */
+/* OBSOLETE     arg = newname; */
+/* OBSOLETE     while (*arg == '-'  */
+/* OBSOLETE            || (*arg >= 'a' && *arg <= 'z') */
+/* OBSOLETE            || (*arg >= 'A' && *arg <= 'Z') */
+/* OBSOLETE            || (*arg >= '0' && *arg <= '9')) */
+/* OBSOLETE       arg++; */
+/* OBSOLETE     if (*arg != ' ' && *arg != '\t') */
+/* OBSOLETE       error (aliaserr); */
+/* OBSOLETE     *arg = '\0'; */
+/* OBSOLETE     arg++; */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE     old = lookup_cmd (&arg, cmdlist, "", 0); */
 /* OBSOLETE  */
 /* OBSOLETE     if (new && !strncmp (newname, new->name, strlen (new->name))) */
 /* OBSOLETE       { */
-/* OBSOLETE    char *tem; */
-/* OBSOLETE    if (new->class == (int) class_user || new->class == (int) class_alias) */
-/* OBSOLETE      tem = "Redefine command \"%s\"? "; */
-/* OBSOLETE    else */
-/* OBSOLETE      tem = "Really redefine built-in command \"%s\"? "; */
-/* OBSOLETE    if (!query (tem, new->name)) */
-/* OBSOLETE      error ("Command \"%s\" not redefined.", new->name); */
+/* OBSOLETE     char *tem; */
+/* OBSOLETE     if (new->class == (int) class_user || new->class == (int) class_alias) */
+/* OBSOLETE       tem = "Redefine command \"%s\"? "; */
+/* OBSOLETE     else */
+/* OBSOLETE       tem = "Really redefine built-in command \"%s\"? "; */
+/* OBSOLETE     if (!query (tem, new->name)) */
+/* OBSOLETE       error ("Command \"%s\" not redefined.", new->name); */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE     add_com (newname, class_alias, old->function, old->doc); */
 /* OBSOLETE   /* FIXME: stop_signal is from target.h but stop_sigcode is a */
 /* OBSOLETE      convex-specific thing.  *x/ */
 /* OBSOLETE   printf_filtered ("Current thread %d stopped with signal %d.%d (%s).\n", */
-/* OBSOLETE               inferior_thread, stop_signal, stop_sigcode, */
-/* OBSOLETE               subsig_name (stop_signal, stop_sigcode)); */
+/* OBSOLETE                inferior_thread, stop_signal, stop_sigcode, */
+/* OBSOLETE                subsig_name (stop_signal, stop_sigcode)); */
 /* OBSOLETE    */
 /* OBSOLETE   for (p = signal_stack; p->pid; p--) */
 /* OBSOLETE     printf_filtered ("Thread %d stopped with signal %d.%d (%s).\n", */
-/* OBSOLETE                 p->thread, p->signo, p->subsig, */
-/* OBSOLETE                 subsig_name (p->signo, p->subsig)); */
-/* OBSOLETE             */
+/* OBSOLETE                  p->thread, p->signo, p->subsig, */
+/* OBSOLETE                  subsig_name (p->signo, p->subsig)); */
+/* OBSOLETE              */
 /* OBSOLETE   if (iscrlbit (comm_registers.crctl.lbits.cc, 64+13)) */
 /* OBSOLETE     printf_filtered ("New thread start pc %#x\n", */
-/* OBSOLETE                 (long) (comm_registers.crreg.pcpsw >> 32)); */
+/* OBSOLETE                  (long) (comm_registers.crreg.pcpsw >> 32)); */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Return string describing a signal.subcode number *x/ */
 /* OBSOLETE   for (t = 0; t < n_threads; t++) */
 /* OBSOLETE     if (thread_state[t] == PI_TALIVE) */
 /* OBSOLETE       { */
-/* OBSOLETE    printf_filtered ("%d%c %08x%c %d.%d ", t, */
-/* OBSOLETE                     (t == inferior_thread ? '*' : ' '), thread_pc[t], */
-/* OBSOLETE                     (thread_is_in_kernel[t] ? '#' : ' '), */
-/* OBSOLETE                     thread_signal[t], thread_sigcode[t]); */
-/* OBSOLETE    print_insn (thread_pc[t], stdout); */
-/* OBSOLETE    printf_filtered ("\n"); */
+/* OBSOLETE     printf_filtered ("%d%c %08x%c %d.%d ", t, */
+/* OBSOLETE                      (t == inferior_thread ? '*' : ' '), thread_pc[t], */
+/* OBSOLETE                      (thread_is_in_kernel[t] ? '#' : ' '), */
+/* OBSOLETE                      thread_signal[t], thread_sigcode[t]); */
+/* OBSOLETE     print_insn (thread_pc[t], stdout); */
+/* OBSOLETE     printf_filtered ("\n"); */
 /* OBSOLETE       } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE  */
 /* OBSOLETE     if (!arg) */
 /* OBSOLETE       { */
-/* OBSOLETE    threadstat (); */
-/* OBSOLETE    return; */
+/* OBSOLETE     threadstat (); */
+/* OBSOLETE     return; */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE     thread = parse_and_eval_address (arg); */
 /* OBSOLETE   if (arg) */
 /* OBSOLETE     { */
 /* OBSOLETE              if (sscanf (arg, "$c%d", &regnum) == 1) { */
-/* OBSOLETE    ; */
+/* OBSOLETE     ; */
 /* OBSOLETE       } else if (sscanf (arg, "$C%d", &regnum) == 1) { */
-/* OBSOLETE    ; */
+/* OBSOLETE     ; */
 /* OBSOLETE       } else { */
-/* OBSOLETE    regnum = parse_and_eval_address (arg); */
-/* OBSOLETE    if (regnum > 0) */
-/* OBSOLETE      regnum &= ~0x8000; */
+/* OBSOLETE     regnum = parse_and_eval_address (arg); */
+/* OBSOLETE     if (regnum > 0) */
+/* OBSOLETE       regnum &= ~0x8000; */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE       if (regnum >= 64) */
-/* OBSOLETE    error ("%s: invalid register name.", arg); */
+/* OBSOLETE     error ("%s: invalid register name.", arg); */
 /* OBSOLETE  */
 /* OBSOLETE       /* if we got a (user) address, examine the resource struct there *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       if (regnum < 0) */
-/* OBSOLETE    { */
-/* OBSOLETE      static int buf[3]; */
-/* OBSOLETE      read_memory (regnum, buf, sizeof buf); */
-/* OBSOLETE      printf_filtered ("%08x  %08x%08x%s\n", regnum, buf[1], buf[2], */
-/* OBSOLETE                       buf[0] & 0xff ? " locked" : ""); */
-/* OBSOLETE      return; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       static int buf[3]; */
+/* OBSOLETE       read_memory (regnum, buf, sizeof buf); */
+/* OBSOLETE       printf_filtered ("%08x  %08x%08x%s\n", regnum, buf[1], buf[2], */
+/* OBSOLETE                        buf[0] & 0xff ? " locked" : ""); */
+/* OBSOLETE       return; */
+/* OBSOLETE     } */
 /* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE   ps.pi_buffer = (char *) &comm_registers; */
 /* OBSOLETE   for (i = 0; i < 64; i++) */
 /* OBSOLETE     if (!arg || i == regnum) */
 /* OBSOLETE       printf_filtered ("%2d 0x8%03x %016llx%s\n", i, i, */
-/* OBSOLETE                   comm_registers.crreg.r4[i], */
-/* OBSOLETE                   (iscrlbit (comm_registers.crctl.lbits.cc, i) */
-/* OBSOLETE                    ? " locked" : "")); */
+/* OBSOLETE                    comm_registers.crreg.r4[i], */
+/* OBSOLETE                    (iscrlbit (comm_registers.crctl.lbits.cc, i) */
+/* OBSOLETE                     ? " locked" : "")); */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Print the psw *x/ */
 /* OBSOLETE   for (p = pswbit; p->bit; p++) */
 /* OBSOLETE     { */
 /* OBSOLETE       if (p->pos < 0) */
-/* OBSOLETE    printf_filtered ("%08x  %s  %s\n", p->bit, */
-/* OBSOLETE                     (psw & p->bit) ? "yes" : "no ", p->text); */
+/* OBSOLETE     printf_filtered ("%08x  %s  %s\n", p->bit, */
+/* OBSOLETE                      (psw & p->bit) ? "yes" : "no ", p->text); */
 /* OBSOLETE       else */
-/* OBSOLETE    printf_filtered ("%08x %3d   %s\n", p->bit, */
-/* OBSOLETE                     (psw & p->bit) >> p->pos, p->text); */
+/* OBSOLETE     printf_filtered ("%08x %3d   %s\n", p->bit, */
+/* OBSOLETE                      (psw & p->bit) >> p->pos, p->text); */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE \f */
 /* OBSOLETE union inst { */
 /* OBSOLETE     struct { */
-/* OBSOLETE    unsigned   : 7; */
-/* OBSOLETE    unsigned i : 3; */
-/* OBSOLETE    unsigned j : 3; */
-/* OBSOLETE    unsigned k : 3; */
-/* OBSOLETE    unsigned   : 16; */
-/* OBSOLETE    unsigned   : 32; */
+/* OBSOLETE     unsigned   : 7; */
+/* OBSOLETE     unsigned i : 3; */
+/* OBSOLETE     unsigned j : 3; */
+/* OBSOLETE     unsigned k : 3; */
+/* OBSOLETE     unsigned   : 16; */
+/* OBSOLETE     unsigned   : 32; */
 /* OBSOLETE     } f0; */
 /* OBSOLETE     struct { */
-/* OBSOLETE    unsigned   : 8; */
-/* OBSOLETE    unsigned indir : 1; */
-/* OBSOLETE    unsigned len : 1; */
-/* OBSOLETE    unsigned j : 3; */
-/* OBSOLETE    unsigned k : 3; */
-/* OBSOLETE    unsigned   : 16; */
-/* OBSOLETE    unsigned   : 32; */
+/* OBSOLETE     unsigned   : 8; */
+/* OBSOLETE     unsigned indir : 1; */
+/* OBSOLETE     unsigned len : 1; */
+/* OBSOLETE     unsigned j : 3; */
+/* OBSOLETE     unsigned k : 3; */
+/* OBSOLETE     unsigned   : 16; */
+/* OBSOLETE     unsigned   : 32; */
 /* OBSOLETE     } f1; */
 /* OBSOLETE     unsigned char byte[8]; */
 /* OBSOLETE     unsigned short half[4]; */
 /* OBSOLETE }; */
 /* OBSOLETE  */
 /* OBSOLETE struct opform { */
-/* OBSOLETE     int mask;                      /* opcode mask *x/ */
-/* OBSOLETE     int shift;                     /* opcode align *x/ */
-/* OBSOLETE     struct formstr *formstr[3];    /* ST, E0, E1 *x/ */
+/* OBSOLETE     int mask;                       /* opcode mask *x/ */
+/* OBSOLETE     int shift;                      /* opcode align *x/ */
+/* OBSOLETE     struct formstr *formstr[3];     /* ST, E0, E1 *x/ */
 /* OBSOLETE }; */
 /* OBSOLETE  */
 /* OBSOLETE struct formstr { */
-/* OBSOLETE     unsigned lop:8, rop:5; /* opcode *x/ */
-/* OBSOLETE     unsigned fmt:5;                /* inst format *x/ */
-/* OBSOLETE     unsigned i:5, j:5, k:2;        /* operand formats *x/ */
+/* OBSOLETE     unsigned lop:8, rop:5;  /* opcode *x/ */
+/* OBSOLETE     unsigned fmt:5;         /* inst format *x/ */
+/* OBSOLETE     unsigned i:5, j:5, k:2; /* operand formats *x/ */
 /* OBSOLETE }; */
 /* OBSOLETE  */
 /* OBSOLETE #include "opcode/convex.h" */
 /* OBSOLETE   if (format == 9) */
 /* OBSOLETE     { */
 /* OBSOLETE       if (pfx) */
-/* OBSOLETE    fmt = formatx; */
+/* OBSOLETE     fmt = formatx; */
 /* OBSOLETE       else if (inst.f1.j == 0) */
-/* OBSOLETE    fmt = &format1a[op1]; */
+/* OBSOLETE     fmt = &format1a[op1]; */
 /* OBSOLETE       else if (inst.f1.j == 1) */
-/* OBSOLETE    fmt = &format1b[op1]; */
+/* OBSOLETE     fmt = &format1b[op1]; */
 /* OBSOLETE       else */
-/* OBSOLETE    fmt = formatx; */
+/* OBSOLETE     fmt = formatx; */
 /* OBSOLETE     } */
 /* OBSOLETE   else */
 /* OBSOLETE     fmt = &opdecode[format].formstr[pfx][op1]; */
 /* OBSOLETE     pfx = 2; */
 /* OBSOLETE  */
 /* OBSOLETE   fprintf (stream, "%s%s%s", lop[fmt->lop], rop[fmt->rop], */
-/* OBSOLETE       &"        "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]); */
+/* OBSOLETE        &"        "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]); */
 /* OBSOLETE  */
 /* OBSOLETE   switch (fmt->fmt) */
 /* OBSOLETE     { */
-/* OBSOLETE     case rrr:                      /* three register *x/ */
+/* OBSOLETE     case rrr:                       /* three register *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s,%s", reg(i,i), reg(j,j), reg(k,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case rr:                       /* two register *x/ */
+/* OBSOLETE     case rr:                        /* two register *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s", reg(i,j), reg(j,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case rxr:                      /* two register, reversed i and j fields *x/ */
+/* OBSOLETE     case rxr:                       /* two register, reversed i and j fields *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s", reg(i,k), reg(j,j)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case r:                        /* one register *x/ */
+/* OBSOLETE     case r:                 /* one register *x/ */
 /* OBSOLETE       fprintf (stream, "%s", reg(i,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case nops:                     /* no operands *x/ */
+/* OBSOLETE     case nops:                      /* no operands *x/ */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case nr:                       /* short immediate, one register *x/ */
+/* OBSOLETE     case nr:                        /* short immediate, one register *x/ */
 /* OBSOLETE       fprintf (stream, "#%d,%s", inst.f0.j, reg(i,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case pcrel:                    /* pc relative *x/ */
+/* OBSOLETE     case pcrel:                     /* pc relative *x/ */
 /* OBSOLETE       print_address (memaddr + 2 * inst.signed_byte[1], stream); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case lr:                       /* literal, one register *x/ */
+/* OBSOLETE     case lr:                        /* literal, one register *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s", lit(i), reg(j,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case rxl:                      /* one register, literal *x/ */
+/* OBSOLETE     case rxl:                       /* one register, literal *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s", reg(i,k), lit(j)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case rlr:                      /* register, literal, register *x/ */
+/* OBSOLETE     case rlr:                       /* register, literal, register *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s,%s", reg(i,j), lit(j), reg(k,k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case rrl:                      /* register, register, literal *x/ */
+/* OBSOLETE     case rrl:                       /* register, register, literal *x/ */
 /* OBSOLETE       fprintf (stream, "%s,%s,%s", reg(i,j), reg(j,k), lit(k)); */
 /* OBSOLETE       return pfx + 2; */
 /* OBSOLETE  */
-/* OBSOLETE     case iml:                      /* immediate, literal *x/ */
+/* OBSOLETE     case iml:                       /* immediate, literal *x/ */
 /* OBSOLETE       if (inst.f1.len) */
-/* OBSOLETE    { */
-/* OBSOLETE      fprintf (stream, "#%#x,%s", */
-/* OBSOLETE               (inst.signed_half[1] << 16) + inst.half[2], lit(i)); */
-/* OBSOLETE      return pfx + 6; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       fprintf (stream, "#%#x,%s", */
+/* OBSOLETE                (inst.signed_half[1] << 16) + inst.half[2], lit(i)); */
+/* OBSOLETE       return pfx + 6; */
+/* OBSOLETE     } */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i)); */
-/* OBSOLETE      return pfx + 4; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i)); */
+/* OBSOLETE       return pfx + 4; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
-/* OBSOLETE     case imr:                      /* immediate, register *x/ */
+/* OBSOLETE     case imr:                       /* immediate, register *x/ */
 /* OBSOLETE       if (inst.f1.len) */
-/* OBSOLETE    { */
-/* OBSOLETE      fprintf (stream, "#%#x,%s", */
-/* OBSOLETE               (inst.signed_half[1] << 16) + inst.half[2], reg(i,k)); */
-/* OBSOLETE      return pfx + 6; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       fprintf (stream, "#%#x,%s", */
+/* OBSOLETE                (inst.signed_half[1] << 16) + inst.half[2], reg(i,k)); */
+/* OBSOLETE       return pfx + 6; */
+/* OBSOLETE     } */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k)); */
-/* OBSOLETE      return pfx + 4; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k)); */
+/* OBSOLETE       return pfx + 4; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
-/* OBSOLETE     case a1r:                      /* memory, register *x/ */
+/* OBSOLETE     case a1r:                       /* memory, register *x/ */
 /* OBSOLETE       l = print_effa (inst, stream); */
 /* OBSOLETE       fprintf (stream, ",%s", reg(i,k)); */
 /* OBSOLETE       return pfx + l; */
 /* OBSOLETE  */
-/* OBSOLETE     case a1l:                      /* memory, literal  *x/ */
+/* OBSOLETE     case a1l:                       /* memory, literal  *x/ */
 /* OBSOLETE       l = print_effa (inst, stream); */
 /* OBSOLETE       fprintf (stream, ",%s", lit(i)); */
 /* OBSOLETE       return pfx + l; */
 /* OBSOLETE  */
-/* OBSOLETE     case a2r:                      /* register, memory *x/ */
+/* OBSOLETE     case a2r:                       /* register, memory *x/ */
 /* OBSOLETE       fprintf (stream, "%s,", reg(i,k)); */
 /* OBSOLETE       return pfx + print_effa (inst, stream); */
 /* OBSOLETE  */
-/* OBSOLETE     case a2l:                      /* literal, memory *x/ */
+/* OBSOLETE     case a2l:                       /* literal, memory *x/ */
 /* OBSOLETE       fprintf (stream, "%s,", lit(i)); */
 /* OBSOLETE       return pfx + print_effa (inst, stream); */
 /* OBSOLETE  */
-/* OBSOLETE     case a3:                       /* memory *x/ */
+/* OBSOLETE     case a3:                        /* memory *x/ */
 /* OBSOLETE       return pfx + print_effa (inst, stream); */
 /* OBSOLETE  */
-/* OBSOLETE     case a4:                       /* system call *x/ */
+/* OBSOLETE     case a4:                        /* system call *x/ */
 /* OBSOLETE       l = 29; goto a4a5; */
-/* OBSOLETE     case a5:                       /* trap *x/ */
+/* OBSOLETE     case a5:                        /* trap *x/ */
 /* OBSOLETE       l = 27; */
 /* OBSOLETE     a4a5: */
 /* OBSOLETE       if (inst.f1.len) */
-/* OBSOLETE    { */
-/* OBSOLETE      unsigned int m = (inst.signed_half[1] << 16) + inst.half[2]; */
-/* OBSOLETE      fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */
-/* OBSOLETE      return pfx + 6; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       unsigned int m = (inst.signed_half[1] << 16) + inst.half[2]; */
+/* OBSOLETE       fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */
+/* OBSOLETE       return pfx + 6; */
+/* OBSOLETE     } */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      unsigned int m = inst.signed_half[1]; */
-/* OBSOLETE      fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */
-/* OBSOLETE      return pfx + 4; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       unsigned int m = inst.signed_half[1]; */
+/* OBSOLETE       fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); */
+/* OBSOLETE       return pfx + 4; */
+/* OBSOLETE     } */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE       n = inst.signed_half[1]; */
 /* OBSOLETE       l = 4; */
 /* OBSOLETE     } */
-/* OBSOLETE     */
+/* OBSOLETE      */
 /* OBSOLETE   if (inst.f1.indir) */
 /* OBSOLETE     printf ("@"); */
 /* OBSOLETE  */
 /* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE   fprintf (stream, (n & 0xf0000000) == 0x80000000 ? "%#x(%s)" : "%d(%s)", */
-/* OBSOLETE       n, aj[inst.f1.j]); */
+/* OBSOLETE        n, aj[inst.f1.j]); */
 /* OBSOLETE  */
 /* OBSOLETE   return l; */
 /* OBSOLETE } */
 /* OBSOLETE _initialize_convex_dep () */
 /* OBSOLETE { */
 /* OBSOLETE   add_com ("alias", class_support, alias_command, */
-/* OBSOLETE       "Add a new name for an existing command."); */
+/* OBSOLETE        "Add a new name for an existing command."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_cmd ("base", class_vars, set_base_command, */
-/* OBSOLETE       "Change the integer output radix to 8, 10 or 16\n\ */
+/* OBSOLETE        "Change the integer output radix to 8, 10 or 16\n\ */
 /* OBSOLETE or use just `set base' with no args to return to the ad-hoc default,\n\ */
 /* OBSOLETE which is 16 for integers that look like addresses, 10 otherwise.", */
-/* OBSOLETE       &setlist); */
+/* OBSOLETE        &setlist); */
 /* OBSOLETE  */
 /* OBSOLETE   add_cmd ("pipeline", class_run, set_pipelining_command, */
-/* OBSOLETE       "Enable or disable overlapped execution of instructions.\n\ */
+/* OBSOLETE        "Enable or disable overlapped execution of instructions.\n\ */
 /* OBSOLETE With `set pipe off', exceptions are reported with\n\ */
 /* OBSOLETE $pc pointing at the instruction after the faulting one.\n\ */
 /* OBSOLETE The default is `set pipe on', which runs faster.", */
-/* OBSOLETE       &setlist); */
+/* OBSOLETE        &setlist); */
 /* OBSOLETE  */
 /* OBSOLETE   add_cmd ("parallel", class_run, set_parallel_command, */
-/* OBSOLETE       "Enable or disable multi-threaded execution of parallel code.\n\ */
+/* OBSOLETE        "Enable or disable multi-threaded execution of parallel code.\n\ */
 /* OBSOLETE `set parallel off' means run the program on a single CPU.\n\ */
 /* OBSOLETE `set parallel fixed' means run the program with all CPUs assigned to it.\n\ */
 /* OBSOLETE `set parallel on' means run the program on any CPUs that are available.", */
-/* OBSOLETE       &setlist); */
+/* OBSOLETE        &setlist); */
 /* OBSOLETE  */
 /* OBSOLETE   add_com ("1cont", class_run, one_cont_command, */
-/* OBSOLETE       "Continue the program, activating only the current thread.\n\ */
+/* OBSOLETE        "Continue the program, activating only the current thread.\n\ */
 /* OBSOLETE Args are the same as the `cont' command."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_com ("thread", class_run, set_thread_command, */
-/* OBSOLETE       "Change the current thread, the one under scrutiny and control.\n\ */
+/* OBSOLETE        "Change the current thread, the one under scrutiny and control.\n\ */
 /* OBSOLETE With no arg, show the active threads, the current one marked with *."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_info ("threads", thread_info, */
-/* OBSOLETE        "List status of active threads."); */
+/* OBSOLETE         "List status of active threads."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_info ("comm-registers", comm_registers_info, */
-/* OBSOLETE        "List communication registers and their contents.\n\ */
+/* OBSOLETE         "List communication registers and their contents.\n\ */
 /* OBSOLETE A communication register name as argument means describe only that register.\n\ */
 /* OBSOLETE An address as argument means describe the resource structure at that address.\n\ */
 /* OBSOLETE `Locked' means that the register has been sent to but not yet received from."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_info ("psw", psw_info,  */
-/* OBSOLETE        "Display $ps, the processor status word, bit by bit.\n\ */
+/* OBSOLETE         "Display $ps, the processor status word, bit by bit.\n\ */
 /* OBSOLETE An argument means display that value's interpretation as a psw."); */
 /* OBSOLETE  */
 /* OBSOLETE   add_cmd ("convex", no_class, 0, "Convex-specific commands.\n\ */
 /* OBSOLETE 32-bit registers  $pc $ps $sp $ap $fp $a1-5 $s0-7 $v0-7 $vl $vs $vm $c0-63\n\ */
 /* OBSOLETE 64-bit registers  $S0-7 $V0-7 $C0-63\n\ */
 /* OBSOLETE \n\ */
-/* OBSOLETE info threads           display info on stopped threads waiting to signal\n\ */
-/* OBSOLETE thread                 display list of active threads\n\ */
-/* OBSOLETE thread N       select thread N (its registers, stack, memory, etc.)\n\ */
+/* OBSOLETE info threads            display info on stopped threads waiting to signal\n\ */
+/* OBSOLETE thread                  display list of active threads\n\ */
+/* OBSOLETE thread N        select thread N (its registers, stack, memory, etc.)\n\ */
 /* OBSOLETE step, next, etc     step selected thread only\n\ */
-/* OBSOLETE 1cont                  continue selected thread only\n\ */
-/* OBSOLETE cont                   continue all threads\n\ */
+/* OBSOLETE 1cont                   continue selected thread only\n\ */
+/* OBSOLETE cont                    continue all threads\n\ */
 /* OBSOLETE info comm-registers display contents of comm register(s) or a resource struct\n\ */
-/* OBSOLETE info psw       display processor status word $ps\n\ */
-/* OBSOLETE set base N     change integer radix used by `print' without a format\n\ */
+/* OBSOLETE info psw        display processor status word $ps\n\ */
+/* OBSOLETE set base N      change integer radix used by `print' without a format\n\ */
 /* OBSOLETE set pipeline off    exceptions are precise, $pc points after the faulting insn\n\ */
 /* OBSOLETE set pipeline on     normal mode, $pc is somewhere ahead of faulting insn\n\ */
 /* OBSOLETE set parallel off    program runs on a single CPU\n\ */
 /* OBSOLETE set parallel fixed  all CPUs are assigned to the program\n\ */
 /* OBSOLETE set parallel on     normal mode, parallel execution on random available CPUs\n\ */
 /* OBSOLETE ", */
-/* OBSOLETE       &cmdlist); */
+/* OBSOLETE        &cmdlist); */
 /* OBSOLETE  */
 /* OBSOLETE } */
index 60117ce7ceb0a49f548372073cda3c3fd161a3e5..857701dfc4288799a8c2497f09908ed47f30f61c 100644 (file)
@@ -55,7 +55,7 @@
 /* OBSOLETE static int n_threads; */
 /* OBSOLETE  */
 /* OBSOLETE #define MAXTHREADS 8 */
-/* OBSOLETE             */
+/* OBSOLETE              */
 /* OBSOLETE /* Thread state.  The remaining data is valid only if this is PI_TALIVE.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE static int thread_state[MAXTHREADS]; */
@@ -64,7 +64,7 @@
 /* OBSOLETE  */
 /* OBSOLETE static int thread_pc[MAXTHREADS]; */
 /* OBSOLETE static int thread_signal[MAXTHREADS]; */
-/* OBSOLETE static int thread_sigcode[MAXTHREADS];      */
+/* OBSOLETE static int thread_sigcode[MAXTHREADS];       */
 /* OBSOLETE  */
 /* OBSOLETE /* Thread registers. */
 /* OBSOLETE    If thread is selected, the regs are in registers[] instead.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE struct pmap  */
 /* OBSOLETE { */
-/* OBSOLETE     long mem_addr;         /* process start address *x/ */
-/* OBSOLETE     long mem_end;          /* process end+1 address *x/ */
-/* OBSOLETE     long file_addr;                /* file start address *x/ */
-/* OBSOLETE     long thread;           /* -1 shared; 0,1,... thread-local *x/ */
-/* OBSOLETE     long type;                     /* S_TEXT S_DATA S_BSS S_TBSS etc *x/ */
-/* OBSOLETE     long which;                    /* used to sort map for info files *x/ */
+/* OBSOLETE     long mem_addr;          /* process start address *x/ */
+/* OBSOLETE     long mem_end;           /* process end+1 address *x/ */
+/* OBSOLETE     long file_addr;         /* file start address *x/ */
+/* OBSOLETE     long thread;            /* -1 shared; 0,1,... thread-local *x/ */
+/* OBSOLETE     long type;                      /* S_TEXT S_DATA S_BSS S_TBSS etc *x/ */
+/* OBSOLETE     long which;                     /* used to sort map for info files *x/ */
 /* OBSOLETE }; */
 /* OBSOLETE  */
 /* OBSOLETE static int n_exec, n_core; */
 /* OBSOLETE       ps.pi_thread = inferior_thread; */
 /* OBSOLETE       ioctl (inferior_fd, PIXRDVREGS, &ps); */
 /* OBSOLETE       if (errno) */
-/* OBSOLETE    memset (&vector_registers, '\0', sizeof vector_registers); */
+/* OBSOLETE     memset (&vector_registers, '\0', sizeof vector_registers); */
 /* OBSOLETE     } */
 /* OBSOLETE   else if (corechan >= 0) */
 /* OBSOLETE     { */
 /* OBSOLETE       lseek (corechan, tcontext_offset[inferior_thread], 0); */
 /* OBSOLETE       if (myread (corechan, &tc, sizeof tc) < 0) */
-/* OBSOLETE    perror_with_name (corefile); */
+/* OBSOLETE     perror_with_name (corefile); */
 /* OBSOLETE       lseek (corechan, tc.core_thread_p, 0); */
 /* OBSOLETE       if (myread (corechan, &th, sizeof th) < 0) */
-/* OBSOLETE    perror_with_name (corefile); */
+/* OBSOLETE     perror_with_name (corefile); */
 /* OBSOLETE       lseek (corechan, tc.core_vregs_p, 0); */
 /* OBSOLETE       if (myread (corechan, &vector_registers, 16*128) < 0) */
-/* OBSOLETE    perror_with_name (corefile); */
+/* OBSOLETE     perror_with_name (corefile); */
 /* OBSOLETE       vector_registers.vm[0] = th.t_vect_ctx.vc_vm[0]; */
 /* OBSOLETE       vector_registers.vm[1] = th.t_vect_ctx.vc_vm[1]; */
 /* OBSOLETE       vector_registers.vls = th.t_vect_ctx.vc_vls; */
 /* OBSOLETE       ioctl (inferior_fd, PIXRDVREGS, &ps); */
 /* OBSOLETE  */
 /* OBSOLETE       switch (reg) */
-/* OBSOLETE    { */
-/* OBSOLETE    case VL_REGNUM: */
-/* OBSOLETE      vector_registers.vls = */
-/* OBSOLETE        (vector_registers.vls & 0xffffffff00000000LL) */
-/* OBSOLETE          + (unsigned long) val; */
-/* OBSOLETE      break; */
-/* OBSOLETE  */
-/* OBSOLETE    case VS_REGNUM: */
-/* OBSOLETE      vector_registers.vls = */
-/* OBSOLETE        (val << 32) + (unsigned long) vector_registers.vls; */
-/* OBSOLETE      break; */
-/* OBSOLETE         */
-/* OBSOLETE    default: */
-/* OBSOLETE      vector_registers.vr[reg].el[element] = val; */
-/* OBSOLETE      break; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE     case VL_REGNUM: */
+/* OBSOLETE       vector_registers.vls = */
+/* OBSOLETE         (vector_registers.vls & 0xffffffff00000000LL) */
+/* OBSOLETE           + (unsigned long) val; */
+/* OBSOLETE       break; */
+/* OBSOLETE  */
+/* OBSOLETE     case VS_REGNUM: */
+/* OBSOLETE       vector_registers.vls = */
+/* OBSOLETE         (val << 32) + (unsigned long) vector_registers.vls; */
+/* OBSOLETE       break; */
+/* OBSOLETE          */
+/* OBSOLETE     default: */
+/* OBSOLETE       vector_registers.vr[reg].el[element] = val; */
+/* OBSOLETE       break; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       ioctl (inferior_fd, PIXWRVREGS, &ps); */
 /* OBSOLETE  */
 /* OBSOLETE       if (errno) */
-/* OBSOLETE    perror_with_name ("writing vector register"); */
+/* OBSOLETE     perror_with_name ("writing vector register"); */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE   for (n = 0; n < n_threads; n++) */
 /* OBSOLETE     if (thread_state[n] == PI_TALIVE) */
 /* OBSOLETE       { */
-/* OBSOLETE    select_thread (n); */
-/* OBSOLETE  */
-/* OBSOLETE    if ((thread < 0 || n == thread) && ! thread_is_in_kernel[n]) */
-/* OBSOLETE      { */
-/* OBSOLETE        /* Blam the trace bits in the stack's saved psws to match  */
-/* OBSOLETE           the desired step mode.  This is required so that */
-/* OBSOLETE           single-stepping a return doesn't restore a psw with a */
-/* OBSOLETE           clear trace bit and fly away, and conversely, */
-/* OBSOLETE           proceeding through a return in a routine that was */
-/* OBSOLETE           stepped into doesn't cause a phantom break by restoring */
-/* OBSOLETE           a psw with the trace bit set. *x/ */
-/* OBSOLETE        scan_stack (PSW_T_BIT, step); */
-/* OBSOLETE        scan_stack (PSW_S_BIT, sequential); */
-/* OBSOLETE      } */
-/* OBSOLETE  */
-/* OBSOLETE    ps.pi_buffer = registers; */
-/* OBSOLETE    ps.pi_nbytes = REGISTER_BYTES; */
-/* OBSOLETE    ps.pi_offset = 0; */
-/* OBSOLETE    ps.pi_thread = n; */
-/* OBSOLETE    if (! thread_is_in_kernel[n]) */
-/* OBSOLETE      if (ioctl (inferior_fd, PIXWRREGS, &ps)) */
-/* OBSOLETE        perror_with_name ("PIXWRREGS"); */
-/* OBSOLETE  */
-/* OBSOLETE    if (thread < 0 || n == thread) */
-/* OBSOLETE      { */
-/* OBSOLETE        ps.pi_pc = 1; */
-/* OBSOLETE        ps.pi_signo = signal; */
-/* OBSOLETE        if (ioctl (inferior_fd, step ? PIXSTEP : PIXCONTINUE, &ps) < 0) */
-/* OBSOLETE          perror_with_name ("PIXCONTINUE"); */
-/* OBSOLETE      } */
+/* OBSOLETE     select_thread (n); */
+/* OBSOLETE  */
+/* OBSOLETE     if ((thread < 0 || n == thread) && ! thread_is_in_kernel[n]) */
+/* OBSOLETE       { */
+/* OBSOLETE         /* Blam the trace bits in the stack's saved psws to match  */
+/* OBSOLETE            the desired step mode.  This is required so that */
+/* OBSOLETE            single-stepping a return doesn't restore a psw with a */
+/* OBSOLETE            clear trace bit and fly away, and conversely, */
+/* OBSOLETE            proceeding through a return in a routine that was */
+/* OBSOLETE            stepped into doesn't cause a phantom break by restoring */
+/* OBSOLETE            a psw with the trace bit set. *x/ */
+/* OBSOLETE         scan_stack (PSW_T_BIT, step); */
+/* OBSOLETE         scan_stack (PSW_S_BIT, sequential); */
+/* OBSOLETE       } */
+/* OBSOLETE  */
+/* OBSOLETE     ps.pi_buffer = registers; */
+/* OBSOLETE     ps.pi_nbytes = REGISTER_BYTES; */
+/* OBSOLETE     ps.pi_offset = 0; */
+/* OBSOLETE     ps.pi_thread = n; */
+/* OBSOLETE     if (! thread_is_in_kernel[n]) */
+/* OBSOLETE       if (ioctl (inferior_fd, PIXWRREGS, &ps)) */
+/* OBSOLETE         perror_with_name ("PIXWRREGS"); */
+/* OBSOLETE  */
+/* OBSOLETE     if (thread < 0 || n == thread) */
+/* OBSOLETE       { */
+/* OBSOLETE         ps.pi_pc = 1; */
+/* OBSOLETE         ps.pi_signo = signal; */
+/* OBSOLETE         if (ioctl (inferior_fd, step ? PIXSTEP : PIXCONTINUE, &ps) < 0) */
+/* OBSOLETE           perror_with_name ("PIXCONTINUE"); */
+/* OBSOLETE       } */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE   if (ioctl (inferior_fd, PIXRUN, &ps) < 0) */
 /* OBSOLETE       pid = wait3 (w, 0, 0); */
 /* OBSOLETE  */
 /* OBSOLETE       if (!WIFSTOPPED (*w) || pid != inferior_pid) */
-/* OBSOLETE    return pid; */
+/* OBSOLETE     return pid; */
 /* OBSOLETE  */
 /* OBSOLETE       /* The inferior has done something and stopped.  Read in all the */
-/* OBSOLETE     threads' registers, and queue up any signals that happened.  *x/ */
+/* OBSOLETE      threads' registers, and queue up any signals that happened.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       if (ioctl (inferior_fd, PIXGETTHCOUNT, &ps) < 0) */
-/* OBSOLETE    perror_with_name ("PIXGETTHCOUNT"); */
+/* OBSOLETE     perror_with_name ("PIXGETTHCOUNT"); */
 /* OBSOLETE        */
 /* OBSOLETE       n_threads = ps.pi_othdcnt; */
 /* OBSOLETE       for (thread = 0; thread < n_threads; thread++) */
-/* OBSOLETE    { */
-/* OBSOLETE      ps.pi_thread = thread; */
-/* OBSOLETE      if (ioctl (inferior_fd, PIXGETSUBCODE, &ps) < 0) */
-/* OBSOLETE        perror_with_name ("PIXGETSUBCODE"); */
-/* OBSOLETE      thread_state[thread] = ps.pi_otstate; */
-/* OBSOLETE  */
-/* OBSOLETE      if (ps.pi_otstate == PI_TALIVE) */
-/* OBSOLETE        { */
-/* OBSOLETE          select_thread (thread); */
-/* OBSOLETE          ps.pi_buffer = registers; */
-/* OBSOLETE          ps.pi_nbytes = REGISTER_BYTES; */
-/* OBSOLETE          ps.pi_offset = 0; */
-/* OBSOLETE          ps.pi_thread = thread; */
-/* OBSOLETE          if (ioctl (inferior_fd, PIXRDREGS, &ps) < 0) */
-/* OBSOLETE            perror_with_name ("PIXRDREGS"); */
-/* OBSOLETE  */
-/* OBSOLETE          registers_fetched (); */
-/* OBSOLETE  */
-/* OBSOLETE          thread_pc[thread] = read_pc (); */
-/* OBSOLETE          thread_signal[thread] = ps.pi_osigno; */
-/* OBSOLETE          thread_sigcode[thread] = ps.pi_osigcode; */
-/* OBSOLETE  */
-/* OBSOLETE          /* If the thread's stack has a context frame */
-/* OBSOLETE             on top, something fucked is going on.  I do not */
-/* OBSOLETE             know what, but do I know this: the only thing you */
-/* OBSOLETE             can do with such a thread is continue it.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE          thread_is_in_kernel[thread] =  */
-/* OBSOLETE            ((read_register (PS_REGNUM) >> 25) & 3) == 0; */
-/* OBSOLETE  */
-/* OBSOLETE          /* Signals push an extended frame and then fault */
-/* OBSOLETE             with a ridiculous pc.  Pop the frame.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE          if (thread_pc[thread] > STACK_END_ADDR) */
-/* OBSOLETE            { */
-/* OBSOLETE              POP_FRAME; */
-/* OBSOLETE              if (is_break_pc (thread_pc[thread])) */
-/* OBSOLETE                thread_pc[thread] = read_pc () - 2; */
-/* OBSOLETE              else */
-/* OBSOLETE                thread_pc[thread] = read_pc (); */
-/* OBSOLETE              write_register (PC_REGNUM, thread_pc[thread]); */
-/* OBSOLETE            } */
-/* OBSOLETE           */
-/* OBSOLETE          if (ps.pi_osigno || ps.pi_osigcode) */
-/* OBSOLETE            { */
-/* OBSOLETE              signal_stack++; */
-/* OBSOLETE              signal_stack->pid = pid; */
-/* OBSOLETE              signal_stack->thread = thread; */
-/* OBSOLETE              signal_stack->signo = thread_signal[thread]; */
-/* OBSOLETE              signal_stack->subsig = thread_sigcode[thread]; */
-/* OBSOLETE              signal_stack->pc = thread_pc[thread]; */
-/* OBSOLETE            } */
-/* OBSOLETE  */
-/* OBSOLETE          /* The following hackery is caused by a unix 7.1 feature: */
-/* OBSOLETE             the inferior's fixed scheduling mode is cleared when */
-/* OBSOLETE             it execs the shell (since the shell is not a parallel */
-/* OBSOLETE             program).  So, note the 5.4 trap we get when */
-/* OBSOLETE             the shell does its exec, then catch the 5.0 trap  */
-/* OBSOLETE             that occurs when the debuggee starts, and set fixed */
-/* OBSOLETE             scheduling mode properly.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE          if (ps.pi_osigno == 5 && ps.pi_osigcode == 4) */
-/* OBSOLETE            exec_trap_timer = 1; */
-/* OBSOLETE          else */
-/* OBSOLETE            exec_trap_timer--; */
-/* OBSOLETE           */
-/* OBSOLETE          if (ps.pi_osigno == 5 && exec_trap_timer == 0) */
-/* OBSOLETE            set_fixed_scheduling (pid, parallel == 2); */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       ps.pi_thread = thread; */
+/* OBSOLETE       if (ioctl (inferior_fd, PIXGETSUBCODE, &ps) < 0) */
+/* OBSOLETE         perror_with_name ("PIXGETSUBCODE"); */
+/* OBSOLETE       thread_state[thread] = ps.pi_otstate; */
+/* OBSOLETE  */
+/* OBSOLETE       if (ps.pi_otstate == PI_TALIVE) */
+/* OBSOLETE         { */
+/* OBSOLETE           select_thread (thread); */
+/* OBSOLETE           ps.pi_buffer = registers; */
+/* OBSOLETE           ps.pi_nbytes = REGISTER_BYTES; */
+/* OBSOLETE           ps.pi_offset = 0; */
+/* OBSOLETE           ps.pi_thread = thread; */
+/* OBSOLETE           if (ioctl (inferior_fd, PIXRDREGS, &ps) < 0) */
+/* OBSOLETE             perror_with_name ("PIXRDREGS"); */
+/* OBSOLETE  */
+/* OBSOLETE           registers_fetched (); */
+/* OBSOLETE  */
+/* OBSOLETE           thread_pc[thread] = read_pc (); */
+/* OBSOLETE           thread_signal[thread] = ps.pi_osigno; */
+/* OBSOLETE           thread_sigcode[thread] = ps.pi_osigcode; */
+/* OBSOLETE  */
+/* OBSOLETE           /* If the thread's stack has a context frame */
+/* OBSOLETE              on top, something fucked is going on.  I do not */
+/* OBSOLETE              know what, but do I know this: the only thing you */
+/* OBSOLETE              can do with such a thread is continue it.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE           thread_is_in_kernel[thread] =  */
+/* OBSOLETE             ((read_register (PS_REGNUM) >> 25) & 3) == 0; */
+/* OBSOLETE  */
+/* OBSOLETE           /* Signals push an extended frame and then fault */
+/* OBSOLETE              with a ridiculous pc.  Pop the frame.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE           if (thread_pc[thread] > STACK_END_ADDR) */
+/* OBSOLETE             { */
+/* OBSOLETE               POP_FRAME; */
+/* OBSOLETE               if (is_break_pc (thread_pc[thread])) */
+/* OBSOLETE                 thread_pc[thread] = read_pc () - 2; */
+/* OBSOLETE               else */
+/* OBSOLETE                 thread_pc[thread] = read_pc (); */
+/* OBSOLETE               write_register (PC_REGNUM, thread_pc[thread]); */
+/* OBSOLETE             } */
+/* OBSOLETE            */
+/* OBSOLETE           if (ps.pi_osigno || ps.pi_osigcode) */
+/* OBSOLETE             { */
+/* OBSOLETE               signal_stack++; */
+/* OBSOLETE               signal_stack->pid = pid; */
+/* OBSOLETE               signal_stack->thread = thread; */
+/* OBSOLETE               signal_stack->signo = thread_signal[thread]; */
+/* OBSOLETE               signal_stack->subsig = thread_sigcode[thread]; */
+/* OBSOLETE               signal_stack->pc = thread_pc[thread]; */
+/* OBSOLETE             } */
+/* OBSOLETE  */
+/* OBSOLETE           /* The following hackery is caused by a unix 7.1 feature: */
+/* OBSOLETE              the inferior's fixed scheduling mode is cleared when */
+/* OBSOLETE              it execs the shell (since the shell is not a parallel */
+/* OBSOLETE              program).  So, note the 5.4 trap we get when */
+/* OBSOLETE              the shell does its exec, then catch the 5.0 trap  */
+/* OBSOLETE              that occurs when the debuggee starts, and set fixed */
+/* OBSOLETE              scheduling mode properly.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE           if (ps.pi_osigno == 5 && ps.pi_osigcode == 4) */
+/* OBSOLETE             exec_trap_timer = 1; */
+/* OBSOLETE           else */
+/* OBSOLETE             exec_trap_timer--; */
+/* OBSOLETE            */
+/* OBSOLETE           if (ps.pi_osigno == 5 && exec_trap_timer == 0) */
+/* OBSOLETE             set_fixed_scheduling (pid, parallel == 2); */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       if (signal_stack_is_empty ()) */
-/* OBSOLETE    error ("no active threads?!"); */
+/* OBSOLETE     error ("no active threads?!"); */
 /* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE   /* Select the thread that stopped, and return *w saying why.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       fp = read_register (FP_REGNUM); */
 /* OBSOLETE       while (fp & 0x80000000) */
-/* OBSOLETE    { */
-/* OBSOLETE      ps = read_memory_integer (fp + 4, 4); */
-/* OBSOLETE      if (val ? (ps & bit) : !(ps & bit)) */
-/* OBSOLETE        break; */
-/* OBSOLETE      ps ^= bit; */
-/* OBSOLETE      write_memory (fp + 4, &ps, 4); */
-/* OBSOLETE      fp = read_memory_integer (fp + 8, 4); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       ps = read_memory_integer (fp + 4, 4); */
+/* OBSOLETE       if (val ? (ps & bit) : !(ps & bit)) */
+/* OBSOLETE         break; */
+/* OBSOLETE       ps ^= bit; */
+/* OBSOLETE       write_memory (fp + 4, &ps, 4); */
+/* OBSOLETE       fp = read_memory_integer (fp + 8, 4); */
+/* OBSOLETE     } */
 /* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE       make_cleanup (free, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
-/* OBSOLETE    error ("To look at a core file, you must kill the program with \"kill\"."); */
+/* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
 /* OBSOLETE       corechan = open (filename, O_RDONLY, 0); */
 /* OBSOLETE       if (corechan < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (myread (corechan, &filehdr, sizeof filehdr) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (!IS_CORE_SOFF_MAGIC (filehdr.h_magic)) */
-/* OBSOLETE    error ("%s: not a core file.\n", filename); */
+/* OBSOLETE     error ("%s: not a core file.\n", filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (myread (corechan, &opthdr, filehdr.h_opthdr) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE  */
 /* OBSOLETE       /* Read through the section headers. */
-/* OBSOLETE     For text, data, etc, record an entry in the core file map. */
-/* OBSOLETE     For context and tcontext, record the file address of */
-/* OBSOLETE     the context blocks.  *x/ */
+/* OBSOLETE      For text, data, etc, record an entry in the core file map. */
+/* OBSOLETE      For context and tcontext, record the file address of */
+/* OBSOLETE      the context blocks.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       lseek (corechan, (long) filehdr.h_scnptr, 0); */
 /* OBSOLETE  */
 /* OBSOLETE       n_threads = 0; */
 /* OBSOLETE       for (n = 0; n < filehdr.h_nscns; n++) */
-/* OBSOLETE    { */
-/* OBSOLETE      if (myread (corechan, &scnhdr, sizeof scnhdr) < 0) */
-/* OBSOLETE        perror_with_name (filename); */
-/* OBSOLETE      if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */
-/* OBSOLETE          && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */
-/* OBSOLETE        { */
-/* OBSOLETE          core_map[n_core].mem_addr = scnhdr.s_vaddr; */
-/* OBSOLETE          core_map[n_core].mem_end = scnhdr.s_vaddr + scnhdr.s_size; */
-/* OBSOLETE          core_map[n_core].file_addr = scnhdr.s_scnptr; */
-/* OBSOLETE          core_map[n_core].type = scnhdr.s_flags & S_TYPMASK; */
-/* OBSOLETE          if (core_map[n_core].type != S_TBSS */
-/* OBSOLETE              && core_map[n_core].type != S_TDATA */
-/* OBSOLETE              && core_map[n_core].type != S_TTEXT) */
-/* OBSOLETE            core_map[n_core].thread = -1; */
-/* OBSOLETE          else if (n_core == 0 */
-/* OBSOLETE                   || core_map[n_core-1].mem_addr != scnhdr.s_vaddr) */
-/* OBSOLETE            core_map[n_core].thread = 0; */
-/* OBSOLETE          else  */
-/* OBSOLETE            core_map[n_core].thread = core_map[n_core-1].thread + 1; */
-/* OBSOLETE          n_core++; */
-/* OBSOLETE        } */
-/* OBSOLETE      else if ((scnhdr.s_flags & S_TYPMASK) == S_CONTEXT) */
-/* OBSOLETE        context_offset = scnhdr.s_scnptr; */
-/* OBSOLETE      else if ((scnhdr.s_flags & S_TYPMASK) == S_TCONTEXT)  */
-/* OBSOLETE        tcontext_offset[n_threads++] = scnhdr.s_scnptr; */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       if (myread (corechan, &scnhdr, sizeof scnhdr) < 0) */
+/* OBSOLETE         perror_with_name (filename); */
+/* OBSOLETE       if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT */
+/* OBSOLETE           && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) */
+/* OBSOLETE         { */
+/* OBSOLETE           core_map[n_core].mem_addr = scnhdr.s_vaddr; */
+/* OBSOLETE           core_map[n_core].mem_end = scnhdr.s_vaddr + scnhdr.s_size; */
+/* OBSOLETE           core_map[n_core].file_addr = scnhdr.s_scnptr; */
+/* OBSOLETE           core_map[n_core].type = scnhdr.s_flags & S_TYPMASK; */
+/* OBSOLETE           if (core_map[n_core].type != S_TBSS */
+/* OBSOLETE               && core_map[n_core].type != S_TDATA */
+/* OBSOLETE               && core_map[n_core].type != S_TTEXT) */
+/* OBSOLETE             core_map[n_core].thread = -1; */
+/* OBSOLETE           else if (n_core == 0 */
+/* OBSOLETE                    || core_map[n_core-1].mem_addr != scnhdr.s_vaddr) */
+/* OBSOLETE             core_map[n_core].thread = 0; */
+/* OBSOLETE           else  */
+/* OBSOLETE             core_map[n_core].thread = core_map[n_core-1].thread + 1; */
+/* OBSOLETE           n_core++; */
+/* OBSOLETE         } */
+/* OBSOLETE       else if ((scnhdr.s_flags & S_TYPMASK) == S_CONTEXT) */
+/* OBSOLETE         context_offset = scnhdr.s_scnptr; */
+/* OBSOLETE       else if ((scnhdr.s_flags & S_TYPMASK) == S_TCONTEXT)  */
+/* OBSOLETE         tcontext_offset[n_threads++] = scnhdr.s_scnptr; */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       /* Read the context block, struct user, struct proc, */
-/* OBSOLETE     and the comm regs.  *x/ */
+/* OBSOLETE      and the comm regs.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       lseek (corechan, context_offset, 0); */
 /* OBSOLETE       if (myread (corechan, &c, sizeof c) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       lseek (corechan, c.core_user_p, 0); */
 /* OBSOLETE       if (myread (corechan, &u, sizeof u) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       lseek (corechan, c.core_proc_p, 0); */
 /* OBSOLETE       if (myread (corechan, &pr, sizeof pr) < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       comm_registers = pr.p_creg; */
 /* OBSOLETE  */
 /* OBSOLETE       /* Core file apparently is really there.  Make it really exist */
-/* OBSOLETE     for xfer_core_file so we can do read_memory on it. *x/ */
+/* OBSOLETE      for xfer_core_file so we can do read_memory on it. *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       if (filename[0] == '/') */
-/* OBSOLETE    corefile = savestring (filename, strlen (filename)); */
+/* OBSOLETE     corefile = savestring (filename, strlen (filename)); */
 /* OBSOLETE       else */
-/* OBSOLETE    corefile = concat (current_directory, "/", filename, NULL); */
+/* OBSOLETE     corefile = concat (current_directory, "/", filename, NULL); */
 /* OBSOLETE  */
 /* OBSOLETE       printf_filtered ("Program %s ", u.u_comm); */
 /* OBSOLETE  */
 /* OBSOLETE       /* Read the thread registers and fill in the thread_xxx[] data.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       for (n = 0; n < n_threads; n++) */
-/* OBSOLETE    { */
-/* OBSOLETE      select_thread (n); */
-/* OBSOLETE  */
-/* OBSOLETE      lseek (corechan, tcontext_offset[n], 0); */
-/* OBSOLETE      if (myread (corechan, &tc, sizeof tc) < 0) */
-/* OBSOLETE        perror_with_name (corefile); */
-/* OBSOLETE      lseek (corechan, tc.core_thread_p, 0); */
-/* OBSOLETE      if (myread (corechan, &th, sizeof th) < 0) */
-/* OBSOLETE        perror_with_name (corefile); */
-/* OBSOLETE  */
-/* OBSOLETE      lseek (corechan, tc.core_syscall_context_p, 0); */
-/* OBSOLETE      if (myread (corechan, registers, REGISTER_BYTES) < 0) */
-/* OBSOLETE        perror_with_name (corefile); */
-/* OBSOLETE  */
-/* OBSOLETE      thread_signal[n] = th.t_cursig; */
-/* OBSOLETE      thread_sigcode[n] = th.t_code; */
-/* OBSOLETE      thread_state[n] = th.t_state; */
-/* OBSOLETE      thread_pc[n] = read_pc (); */
-/* OBSOLETE  */
-/* OBSOLETE      if (thread_pc[n] > STACK_END_ADDR) */
-/* OBSOLETE        { */
-/* OBSOLETE          POP_FRAME; */
-/* OBSOLETE          if (is_break_pc (thread_pc[n])) */
-/* OBSOLETE            thread_pc[n] = read_pc () - 2; */
-/* OBSOLETE          else */
-/* OBSOLETE            thread_pc[n] = read_pc (); */
-/* OBSOLETE          write_register (PC_REGNUM, thread_pc[n]); */
-/* OBSOLETE        } */
-/* OBSOLETE  */
-/* OBSOLETE      printf_filtered ("thread %d received signal %d, %s\n", */
-/* OBSOLETE                       n, thread_signal[n], */
-/* OBSOLETE                       safe_strsignal (thread_signal[n])); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       select_thread (n); */
+/* OBSOLETE  */
+/* OBSOLETE       lseek (corechan, tcontext_offset[n], 0); */
+/* OBSOLETE       if (myread (corechan, &tc, sizeof tc) < 0) */
+/* OBSOLETE         perror_with_name (corefile); */
+/* OBSOLETE       lseek (corechan, tc.core_thread_p, 0); */
+/* OBSOLETE       if (myread (corechan, &th, sizeof th) < 0) */
+/* OBSOLETE         perror_with_name (corefile); */
+/* OBSOLETE  */
+/* OBSOLETE       lseek (corechan, tc.core_syscall_context_p, 0); */
+/* OBSOLETE       if (myread (corechan, registers, REGISTER_BYTES) < 0) */
+/* OBSOLETE         perror_with_name (corefile); */
+/* OBSOLETE  */
+/* OBSOLETE       thread_signal[n] = th.t_cursig; */
+/* OBSOLETE       thread_sigcode[n] = th.t_code; */
+/* OBSOLETE       thread_state[n] = th.t_state; */
+/* OBSOLETE       thread_pc[n] = read_pc (); */
+/* OBSOLETE  */
+/* OBSOLETE       if (thread_pc[n] > STACK_END_ADDR) */
+/* OBSOLETE         { */
+/* OBSOLETE           POP_FRAME; */
+/* OBSOLETE           if (is_break_pc (thread_pc[n])) */
+/* OBSOLETE             thread_pc[n] = read_pc () - 2; */
+/* OBSOLETE           else */
+/* OBSOLETE             thread_pc[n] = read_pc (); */
+/* OBSOLETE           write_register (PC_REGNUM, thread_pc[n]); */
+/* OBSOLETE         } */
+/* OBSOLETE  */
+/* OBSOLETE       printf_filtered ("thread %d received signal %d, %s\n", */
+/* OBSOLETE                        n, thread_signal[n], */
+/* OBSOLETE                        safe_strsignal (thread_signal[n])); */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       /* Select an interesting thread -- also-rans died with SIGKILL, */
-/* OBSOLETE     so find one that didn't.  *x/ */
+/* OBSOLETE      so find one that didn't.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       for (n = 0; n < n_threads; n++) */
-/* OBSOLETE    if (thread_signal[n] != 0 && thread_signal[n] != SIGKILL) */
-/* OBSOLETE      { */
-/* OBSOLETE        select_thread (n); */
-/* OBSOLETE        stop_signal = thread_signal[n]; */
-/* OBSOLETE        stop_sigcode = thread_sigcode[n]; */
-/* OBSOLETE        break; */
-/* OBSOLETE      } */
+/* OBSOLETE     if (thread_signal[n] != 0 && thread_signal[n] != SIGKILL) */
+/* OBSOLETE       { */
+/* OBSOLETE         select_thread (n); */
+/* OBSOLETE         stop_signal = thread_signal[n]; */
+/* OBSOLETE         stop_sigcode = thread_sigcode[n]; */
+/* OBSOLETE         break; */
+/* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE       core_aouthdr.a_magic = 0; */
 /* OBSOLETE  */
index 3c1d499256e251ff3ce5f4ff48457540a42145da..cb99b0f0135af86bbef666d3888cc83e2a762ffa 100644 (file)
@@ -1,21 +1,22 @@
 /* Extract registers from a "standard" core file, for GDB.
    Copyright (C) 1988-1998  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Typically used on systems that have a.out format executables.
    corefile.c is supposed to contain the more machine-independent
@@ -25,18 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "defs.h"
 
 #ifdef HAVE_PTRACE_H
-# include <ptrace.h>
+#include <ptrace.h>
 #else
-# ifdef HAVE_SYS_PTRACE_H
-#  include <sys/ptrace.h>
-# endif
+#ifdef HAVE_SYS_PTRACE_H
+#include <sys/ptrace.h>
+#endif
 #endif
 
 #include <sys/types.h>
 #include <sys/param.h>
 #include "gdbcore.h"
-#include "value.h" /* For supply_register.  */
-#include "inferior.h" /* For ARCH_NUM_REGS. */
+#include "value.h"             /* For supply_register.  */
+#include "inferior.h"          /* For ARCH_NUM_REGS. */
 
 /* These are needed on various systems to expand REGISTER_U_ADDR.  */
 #ifndef USG
@@ -64,11 +65,11 @@ void _initialize_core_aout PARAMS ((void));
    CORE_REG_SECT points to the register values themselves, read into memory.
    CORE_REG_SIZE is the size of that area.
    WHICH says which set of registers we are handling (0 = int, 2 = float
-         on machines where they are discontiguous).
+   on machines where they are discontiguous).
    REG_ADDR is the offset from u.u_ar0 to the register values relative to
-            core_reg_sect.  This is used with old-fashioned core files to
-           locate the registers in a large upage-plus-stack ".reg" section.
-           Original upage address X is at location core_reg_sect+x+reg_addr.
+   core_reg_sect.  This is used with old-fashioned core files to
+   locate the registers in a large upage-plus-stack ".reg" section.
+   Original upage address X is at location core_reg_sect+x+reg_addr.
  */
 
 static void
@@ -81,7 +82,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   int regno;
   CORE_ADDR addr;
   int bad_reg = -1;
-  CORE_ADDR reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
+  CORE_ADDR reg_ptr = -reg_addr;       /* Original u.u_ar0 is -reg_addr. */
   int numregs = ARCH_NUM_REGS;
 
   /* If u.u_ar0 was an absolute address in the core file, relativize it now,
@@ -99,8 +100,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
       if (addr >= core_reg_size
          && bad_reg < 0)
        bad_reg = regno;
-    else
-      supply_register (regno, core_reg_sect + addr);
+      else
+       supply_register (regno, core_reg_sect + addr);
     }
 
   if (bad_reg >= 0)
@@ -129,8 +130,8 @@ register_addr (regno, blockend)
 }
 
 #endif /* REGISTER_U_ADDR */
-
 \f
+
 /* Register that we are able to handle aout (trad-core) file formats.  */
 
 static struct core_fns aout_core_fns =
index d925abea74682af2da48f7c6ea606f7224169a38..71a4a79eb82b5230f6abd6d60ad710783cd6e5d5 100644 (file)
@@ -1,34 +1,35 @@
 /* Machine independent GDB support for core files on systems using "regsets".
    Copyright 1993-1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
-/*                     N  O  T  E  S
+/*                      N  O  T  E  S
 
-This file is used by most systems that implement /proc.  For these systems,
-the general registers are laid out the same way in both the core file and
-the gregset_p structure.  The current exception to this is Irix-4.*, where
-the gregset_p structure is split up into two pieces in the core file.
+   This file is used by most systems that implement /proc.  For these systems,
+   the general registers are laid out the same way in both the core file and
+   the gregset_p structure.  The current exception to this is Irix-4.*, where
+   the gregset_p structure is split up into two pieces in the core file.
 
-The general register and floating point register sets are manipulated by
-separate ioctl's.  This file makes the assumption that if FP0_REGNUM is
-defined, then support for the floating point register set is desired,
-regardless of whether or not the actual target has floating point hardware.
+   The general register and floating point register sets are manipulated by
+   separate ioctl's.  This file makes the assumption that if FP0_REGNUM is
+   defined, then support for the floating point register set is desired,
+   regardless of whether or not the actual target has floating point hardware.
 
  */
 
@@ -53,28 +54,28 @@ void _initialize_core_regset PARAMS ((void));
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       fetch_core_registers -- fetch current registers from core file
+   fetch_core_registers -- fetch current registers from core file
 
-SYNOPSIS
+   SYNOPSIS
 
-       void fetch_core_registers (char *core_reg_sect,
-                                         unsigned core_reg_size,
-                                         int which, CORE_ADDR reg_addr)
+   void fetch_core_registers (char *core_reg_sect,
+   unsigned core_reg_size,
+   int which, CORE_ADDR reg_addr)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Read the values of either the general register set (WHICH equals 0)
-       or the floating point register set (WHICH equals 2) from the core
-       file data (pointed to by CORE_REG_SECT), and update gdb's idea of
-       their current values.  The CORE_REG_SIZE parameter is ignored.
+   Read the values of either the general register set (WHICH equals 0)
+   or the floating point register set (WHICH equals 2) from the core
+   file data (pointed to by CORE_REG_SECT), and update gdb's idea of
+   their current values.  The CORE_REG_SIZE parameter is ignored.
 
-NOTES
+   NOTES
 
-       Use the indicated sizes to validate the gregset and fpregset
-       structures.
-*/
+   Use the indicated sizes to validate the gregset and fpregset
+   structures.
+ */
 
 static void
 fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
@@ -113,10 +114,10 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 #endif
        }
     }
-#endif /* defined(HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T) */
+#endif /* defined(HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T) */
 }
-
 \f
+
 /* Register that we are able to handle ELF file formats using standard
    procfs "regset" structures.  */
 
index 3c69e63612d2cff3680851eb5ac60ed02ef528c6..75d4792659864ac7e54bc999c513e866948e2636 100644 (file)
@@ -1,21 +1,22 @@
 /* Machine independent support for Solaris 2 core files for GDB.
    Copyright 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 /* Solaris comes with two flavours of core files, cores generated by
@@ -62,15 +63,15 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
        {
 #define gregs ((struct regs *)core_reg_sect)
          /* G0 *always* holds 0.  */
-         *(int *)&registers[REGISTER_BYTE (0)] = 0;
+         *(int *) &registers[REGISTER_BYTE (0)] = 0;
 
          /* The globals and output registers.  */
-         memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1, 
+         memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
                  15 * REGISTER_RAW_SIZE (G1_REGNUM));
-         *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
-         *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
-         *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
-         *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
+         *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
+         *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
+         *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
+         *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
 
          /* My best guess at where to get the locals and input
             registers is exactly where they usually are, right above
@@ -80,9 +81,9 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
          {
            int sp;
 
-           sp = *(int *)&registers[REGISTER_BYTE (SP_REGNUM)];
+           sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
            if (0 != target_read_memory (sp,
-                                        &registers[REGISTER_BYTE (L0_REGNUM)], 
+                                     &registers[REGISTER_BYTE (L0_REGNUM)],
                                         16 * REGISTER_RAW_SIZE (L0_REGNUM)))
              {
                warning ("couldn't read input and local registers from core file\n");
@@ -115,8 +116,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
        }
     }
 }
-
 \f
+
 /* Register that we are able to handle solaris core file formats. */
 
 static struct core_fns solaris_core_fns =
index b720b50323a0b07aeb44631775517c6c017d005e..ce897e1c243615bd57a72fb2e4173e75367791cd 100644 (file)
@@ -2,28 +2,29 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
-#include "frame.h"  /* required by inferior.h */
+#include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "symtab.h"
 #include "command.h"
@@ -52,15 +53,15 @@ static void call_extra_exec_file_hooks PARAMS ((char *filename));
 
 typedef void (*hook_type) PARAMS ((char *));
 
-hook_type exec_file_display_hook;              /* the original hook */
+hook_type exec_file_display_hook;      /* the original hook */
 static hook_type *exec_file_extra_hooks;       /* array of additional hooks */
-static int exec_file_hook_count = 0;           /* size of array */
+static int exec_file_hook_count = 0;   /* size of array */
 
 /* Binary file diddling handle for the core file.  */
 
 bfd *core_bfd = NULL;
-
 \f
+
 /* Backward compatability with old way of specifying core files.  */
 
 void
@@ -70,7 +71,7 @@ core_file_command (filename, from_tty)
 {
   struct target_ops *t;
 
-  dont_repeat ();                      /* Either way, seems bogus. */
+  dont_repeat ();              /* Either way, seems bogus. */
 
   t = find_core_target ();
   if (t != NULL)
@@ -78,33 +79,33 @@ core_file_command (filename, from_tty)
       (t->to_detach) (filename, from_tty);
     else
       {
-        /* Yes, we were given the path of a core file.  Do we already
-           have a symbol file?  If not, can we determine it from the
-           core file?  If we can, do so.
-           */
+       /* Yes, we were given the path of a core file.  Do we already
+          have a symbol file?  If not, can we determine it from the
+          core file?  If we can, do so.
+        */
 #ifdef HPUXHPPA
-        if (symfile_objfile == NULL)
-          {
-            char *  symfile;
-            symfile = t->to_core_file_to_sym_file (filename);
-            if (symfile)
-              {
-                char *  symfile_copy = strdup (symfile);
-
-                make_cleanup (free, symfile_copy);
-                symbol_file_command (symfile_copy, from_tty);
-              }
-            else
-              warning ("Unknown symbols for '%s'; use the 'symbol-file' command.", filename);
-          }
+       if (symfile_objfile == NULL)
+         {
+           char *symfile;
+           symfile = t->to_core_file_to_sym_file (filename);
+           if (symfile)
+             {
+               char *symfile_copy = strdup (symfile);
+
+               make_cleanup (free, symfile_copy);
+               symbol_file_command (symfile_copy, from_tty);
+             }
+           else
+             warning ("Unknown symbols for '%s'; use the 'symbol-file' command.", filename);
+         }
 #endif
-        (t->to_open) (filename, from_tty);
+       (t->to_open) (filename, from_tty);
       }
   else
     error ("GDB can't read core files on this machine.");
 }
-
 \f
+
 /* If there are two or more functions that wish to hook into exec_file_command,
  * this function will call all of the hook functions. */
 
@@ -115,7 +116,7 @@ call_extra_exec_file_hooks (filename)
   int i;
 
   for (i = 0; i < exec_file_hook_count; i++)
-    (*exec_file_extra_hooks[i])(filename);
+    (*exec_file_extra_hooks[i]) (filename);
 }
 
 /* Call this to specify the hook for exec_file_command to call back.
@@ -134,7 +135,7 @@ specify_exec_file_hook (hook)
       if (exec_file_hook_count == 0)
        {
          /* If this is the first extra hook, initialize the hook array. */
-         exec_file_extra_hooks = (hook_type *) xmalloc (sizeof(hook_type));
+         exec_file_extra_hooks = (hook_type *) xmalloc (sizeof (hook_type));
          exec_file_extra_hooks[0] = exec_file_display_hook;
          exec_file_display_hook = call_extra_exec_file_hooks;
          exec_file_hook_count = 1;
@@ -146,7 +147,7 @@ specify_exec_file_hook (hook)
       exec_file_hook_count++;
       new_array =
        (hook_type *) xrealloc (exec_file_extra_hooks,
-                               exec_file_hook_count * sizeof(hook_type));
+                               exec_file_hook_count * sizeof (hook_type));
       exec_file_extra_hooks = new_array;
       exec_file_extra_hooks[exec_file_hook_count - 1] = hook;
     }
@@ -161,7 +162,7 @@ specify_exec_file_hook (hook)
 void
 close_exec_file ()
 {
-#if 0 /* FIXME */
+#if 0                          /* FIXME */
   if (exec_bfd)
     bfd_tempclose (exec_bfd);
 #endif
@@ -170,7 +171,7 @@ close_exec_file ()
 void
 reopen_exec_file ()
 {
-#if 0 /* FIXME */
+#if 0                          /* FIXME */
   if (exec_bfd)
     bfd_reopen (exec_bfd);
 #else
@@ -182,11 +183,11 @@ reopen_exec_file ()
   /* Don't do anything if the current target isn't exec. */
   if (exec_bfd == NULL || strcmp (target_shortname, "exec") != 0)
     return;
+
   /* If the timestamp of the exec file has changed, reopen it. */
   filename = strdup (bfd_get_filename (exec_bfd));
   make_cleanup (free, filename);
-  mtime = bfd_get_mtime(exec_bfd);
+  mtime = bfd_get_mtime (exec_bfd);
   res = stat (filename, &st);
 
   if (mtime && mtime != st.st_mtime)
@@ -204,7 +205,7 @@ validate_files ()
     {
       if (!core_file_matches_executable_p (core_bfd, exec_bfd))
        warning ("core file may not match specified executable file.");
-      else if (bfd_get_mtime(exec_bfd) > bfd_get_mtime(core_bfd))
+      else if (bfd_get_mtime (exec_bfd) > bfd_get_mtime (core_bfd))
        warning ("exec file is newer than core file.");
     }
 }
@@ -217,15 +218,17 @@ char *
 get_exec_file (err)
      int err;
 {
-  if (exec_bfd) return bfd_get_filename(exec_bfd);
-  if (!err)     return NULL;
+  if (exec_bfd)
+    return bfd_get_filename (exec_bfd);
+  if (!err)
+    return NULL;
 
   error ("No executable file specified.\n\
 Use the \"file\" or \"exec-file\" command.");
   return NULL;
 }
-
 \f
+
 /* Report a memory error with error().  */
 
 void
@@ -236,7 +239,7 @@ memory_error (status, memaddr)
   if (status == EIO)
     {
       /* Actually, address between memaddr and memaddr + len
-        was out of bounds. */
+         was out of bounds. */
       error_begin ();
       printf_filtered ("Cannot access memory at address ");
       print_address_numeric (memaddr, 1, gdb_stdout);
@@ -249,7 +252,7 @@ memory_error (status, memaddr)
       printf_filtered ("Error accessing memory address ");
       print_address_numeric (memaddr, 1, gdb_stdout);
       printf_filtered (": %s.\n",
-                        safe_strerror (status));
+                      safe_strerror (status));
       return_to_top_level (RETURN_ERROR);
     }
 }
@@ -352,10 +355,10 @@ read_memory_unsigned_integer (memaddr, len)
 void
 read_memory_string (memaddr, buffer, max_len)
      CORE_ADDR memaddr;
-     char * buffer;
+     char *buffer;
      int max_len;
 {
-  register char * cp;
+  register char *cp;
   register int i;
   int cnt;
 
@@ -363,23 +366,23 @@ read_memory_string (memaddr, buffer, max_len)
   while (1)
     {
       if (cp - buffer >= max_len)
-        {
-          buffer[max_len - 1] = '\0';
-          break;
-        }
+       {
+         buffer[max_len - 1] = '\0';
+         break;
+       }
       cnt = max_len - (cp - buffer);
       if (cnt > 8)
        cnt = 8;
       read_memory (memaddr + (int) (cp - buffer), cp, cnt);
       for (i = 0; i < cnt && *cp; i++, cp++)
-        ; /* null body */
+       ;                       /* null body */
 
       if (i < cnt && !*cp)
-        break;
+       break;
     }
 }
-
 \f
+
 #if 0
 /* Enable after 4.12.  It is not tested.  */
 
@@ -415,7 +418,7 @@ generic_search (len, data, mask, startaddr, increment, lorange, hirange
     try_again:
       curaddr += increment;
     }
-  *addr_found = (CORE_ADDR)0;
+  *addr_found = (CORE_ADDR) 0;
   return;
 }
 #endif /* 0 */
@@ -454,7 +457,7 @@ set_gnutarget (newtarget)
 }
 
 void
-_initialize_core()
+_initialize_core ()
 {
   struct cmd_list_element *c;
   c = add_cmd ("core-file", class_files, core_file_command,
@@ -464,10 +467,10 @@ No arg means have no core file.  This command has been superseded by the\n\
   c->completer = filename_completer;
 
   c = add_set_cmd ("gnutarget", class_files, var_string_noescape,
-                 (char *) &gnutarget_string,
-                 "Set the current BFD target.\n\
+                  (char *) &gnutarget_string,
+                  "Set the current BFD target.\n\
 Use `set gnutarget auto' to specify automatic detection.",
-                 &setlist);
+                  &setlist);
   c->function.sfunc = set_gnutarget_command;
   add_show_from_set (c, &showlist);
 
index 0cff040127237723567c100b1c3b290ef8e6da30..3e405dee1bc3b89f9dc0cd9bfe57859bb673cb1e 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -24,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <signal.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include "frame.h"  /* required by inferior.h */
+#include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "symtab.h"
 #include "command.h"
@@ -76,7 +77,7 @@ void
 add_core_fns (cf)
      struct core_fns *cf;
 {
-  cf -> next = core_file_fns;
+  cf->next = core_file_fns;
   core_file_fns = cf;
 }
 
@@ -96,7 +97,7 @@ core_close (quitting)
       inferior_pid = 0;                /* Avoid confusion from thread stuff */
 
       /* Clear out solib state while the bfd is still open. See
-        comments in clear_solib in solib.c. */
+         comments in clear_solib in solib.c. */
 #ifdef CLEAR_SOLIB
       CLEAR_SOLIB ();
 #endif
@@ -109,7 +110,7 @@ core_close (quitting)
       core_bfd = NULL;
       if (core_ops.to_sections)
        {
-         free ((PTR)core_ops.to_sections);
+         free ((PTR) core_ops.to_sections);
          core_ops.to_sections = NULL;
          core_ops.to_sections_end = NULL;
        }
@@ -120,11 +121,11 @@ core_close (quitting)
 /* Stub function for catch_errors around shared library hacking.  FROM_TTYP
    is really an int * which points to from_tty.  */
 
-static int 
+static int
 solib_add_stub (from_ttyp)
      PTR from_ttyp;
 {
-  SOLIB_ADD (NULL, *(int *)from_ttyp, &current_target);
+  SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target);
   re_enable_breakpoints_in_shlibs ();
   return 0;
 }
@@ -152,7 +153,7 @@ add_to_thread_list (abfd, asect, reg_sect_arg)
 /* Warning, Will Robinson, looking at BFD private data! */
 
   if (reg_sect != NULL
-      && asect->filepos == reg_sect->filepos) /* Did we find .reg? */
+      && asect->filepos == reg_sect->filepos)  /* Did we find .reg? */
     inferior_pid = thread_id;  /* Yes, make it current */
 }
 
@@ -174,9 +175,9 @@ core_open (filename, from_tty)
   target_preopen (from_tty);
   if (!filename)
     {
-      error (core_bfd ? 
-       "No core file specified.  (Use `detach' to stop debugging a core file.)"
-     : "No core file specified.");
+      error (core_bfd ?
+            "No core file specified.  (Use `detach' to stop debugging a core file.)"
+            : "No core file specified.");
     }
 
   filename = tilde_expand (filename);
@@ -201,8 +202,8 @@ core_open (filename, from_tty)
     {
       /* Do it after the err msg */
       /* FIXME: should be checking for errors from bfd_close (for one thing,
-        on error it does not free all the storage associated with the
-        bfd).  */
+         on error it does not free all the storage associated with the
+         bfd).  */
       make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
       error ("\"%s\" is not a core dump: %s",
             filename, bfd_errmsg (bfd_get_error ()));
@@ -210,7 +211,7 @@ core_open (filename, from_tty)
 
   /* Looks semi-reasonable.  Toss the old core file and work on the new.  */
 
-  discard_cleanups (old_chain);                /* Don't free filename any more */
+  discard_cleanups (old_chain);        /* Don't free filename any more */
   unpush_target (&core_ops);
   core_bfd = temp_bfd;
   old_chain = make_cleanup ((make_cleanup_func) core_close, core_bfd);
@@ -248,7 +249,7 @@ core_open (filename, from_tty)
 
       /* Add symbols and section mappings for any shared libraries.  */
 #ifdef SOLIB_ADD
-      catch_errors (solib_add_stub, &from_tty, (char *)0,
+      catch_errors (solib_add_stub, &from_tty, (char *) 0,
                    RETURN_MASK_ALL);
 #endif
 
@@ -260,7 +261,7 @@ core_open (filename, from_tty)
   else
     {
       warning (
-"you won't be able to access this core file until you terminate\n\
+               "you won't be able to access this core file until you terminate\n\
 your %s; do ``info files''", target_longname);
     }
 }
@@ -299,7 +300,7 @@ get_core_registers (regno)
   if (core_file_fns == NULL)
     {
       fprintf_filtered (gdb_stderr,
-                       "Can't fetch registers from this type of core file\n");
+                    "Can't fetch registers from this type of core file\n");
       return;
     }
 
@@ -321,9 +322,9 @@ get_core_registers (regno)
   the_regs = alloca (size);
   /* Look for the core functions that match this flavor.  Default to the
      first one if nothing matches. */
-  for (cf = core_file_fns; cf != NULL; cf = cf -> next)
+  for (cf = core_file_fns; cf != NULL; cf = cf->next)
     {
-      if (our_flavour == cf -> core_flavour)
+      if (our_flavour == cf->core_flavour)
        {
          break;
        }
@@ -333,15 +334,15 @@ get_core_registers (regno)
       cf = core_file_fns;
     }
   if (cf != NULL &&
-      bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0, size) &&
-      cf -> core_read_registers != NULL)
+      bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr) 0, size) &&
+      cf->core_read_registers != NULL)
     {
-      (cf -> core_read_registers (the_regs, size, 0,
-                                 (unsigned) bfd_section_vma (abfd,reg_sec)));
+      (cf->core_read_registers (the_regs, size, 0,
+                               (unsigned) bfd_section_vma (abfd, reg_sec)));
     }
   else
     {
-cant:
+    cant:
       fprintf_filtered (gdb_stderr,
                        "Couldn't fetch registers from core file: %s\n",
                        bfd_errmsg (bfd_get_error ()));
@@ -354,16 +355,16 @@ cant:
       size = bfd_section_size (core_bfd, reg_sec);
       the_regs = alloca (size);
       if (cf != NULL &&
-         bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0, size) &&
-         cf -> core_read_registers != NULL)
+         bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr) 0, size) &&
+         cf->core_read_registers != NULL)
        {
-         (cf -> core_read_registers (the_regs, size, 2,
-                                     (unsigned) bfd_section_vma (abfd,reg_sec)));
+         (cf->core_read_registers (the_regs, size, 2,
+                              (unsigned) bfd_section_vma (abfd, reg_sec)));
        }
       else
        {
-         fprintf_filtered (gdb_stderr, 
-                           "Couldn't fetch register set 2 from core file: %s\n",
+         fprintf_filtered (gdb_stderr,
+                      "Couldn't fetch register set 2 from core file: %s\n",
                            bfd_errmsg (bfd_get_error ()));
        }
     }
@@ -372,15 +373,15 @@ cant:
 
 static char *
 core_file_to_sym_file (core)
-  char *  core;
+     char *core;
 {
-  CONST char *  failing_command;
-  char *  p;
-  char *  temp;
-  bfd *  temp_bfd;
-  int  scratch_chan;
+  CONST char *failing_command;
+  char *p;
+  char *temp;
+  bfd *temp_bfd;
+  int scratch_chan;
 
-  if (! core)
+  if (!core)
     error ("No core file specified.");
 
   core = tilde_expand (core);
@@ -402,8 +403,8 @@ core_file_to_sym_file (core)
     {
       /* Do it after the err msg */
       /* FIXME: should be checking for errors from bfd_close (for one thing,
-        on error it does not free all the storage associated with the
-        bfd).  */
+         on error it does not free all the storage associated with the
+         bfd).  */
       make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
       error ("\"%s\" is not a core dump: %s",
             core, bfd_errmsg (bfd_get_error ()));
@@ -425,7 +426,7 @@ core_file_to_sym_file (core)
      than trying to be sauve about finding it, just check if the file
      exists where we are now.  If not, then punt and tell our client
      we couldn't find the sym file.
-     */
+   */
   p = (char *) failing_command;
   if ((p != NULL) && (access (p, F_OK) != 0))
     p = NULL;
@@ -435,7 +436,7 @@ core_file_to_sym_file (core)
 
 static void
 core_files_info (t)
-  struct target_ops *t;
+     struct target_ops *t;
 {
   print_section_info (t, core_bfd);
 }
@@ -457,10 +458,10 @@ ignore (addr, contents)
    that each & every one is alive, then we don't get any of them
    to appear in an "info thread" command, which is quite a useful
    behaviour.
  */
+ */
 static int
 core_file_thread_alive (tid)
-  int  tid;
+     int tid;
 {
   return 1;
 }
@@ -493,7 +494,7 @@ init_core_ops ()
   core_ops.to_has_memory = 1;
   core_ops.to_has_stack = 1;
   core_ops.to_has_registers = 1;
-  core_ops.to_magic = OPS_MAGIC;       
+  core_ops.to_magic = OPS_MAGIC;
 }
 
 /* non-zero if we should not do the add_target call in
index ecec1d900dda0b65c460e051d8ef936c2af3f55d..ff2bec865a83b9c11501f17552d8ba360dbe220b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1988, 1989, 1991, 1994, 1995, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -32,14 +33,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "c-lang.h"
 #include "target.h"
 
-/* Indication of presence of HP-compiled object files */ 
-extern int hp_som_som_object_present; /* defined in symtab.c */
+/* Indication of presence of HP-compiled object files */
+extern int hp_som_som_object_present;  /* defined in symtab.c */
 
 
 int vtblprint;                 /* Controls printing of vtbl's */
 int objectprint;               /* Controls looking up an object's derived type
                                   using what we find in its vtables.  */
-int static_field_print;        /* Controls printing of static fields. */
+int static_field_print;                /* Controls printing of static fields. */
 
 static struct obstack dont_print_vb_obstack;
 static struct obstack dont_print_statmem_obstack;
@@ -56,7 +57,7 @@ cp_print_value PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR, GD
 
 static void
 cp_print_hpacc_virtual_table_entries PARAMS ((struct type *, int *, value_ptr, GDB_FILE *,
-                                              int, int, enum val_prettyprint));
+                                          int, int, enum val_prettyprint));
 
 
 void
@@ -78,7 +79,7 @@ cp_print_class_method (valaddr, type, stream)
   struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
 
   domain = TYPE_DOMAIN_TYPE (target_type);
-  if (domain == (struct type *)NULL)
+  if (domain == (struct type *) NULL)
     {
       fprintf_filtered (stream, "<unknown>");
       return;
@@ -92,7 +93,7 @@ cp_print_class_method (valaddr, type, stream)
        {
          f = TYPE_FN_FIELDLIST1 (domain, i);
          len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
-         
+
          for (j = 0; j < len2; j++)
            {
              QUIT;
@@ -111,12 +112,12 @@ cp_print_class_method (valaddr, type, stream)
       sym = find_pc_function (addr);
       if (sym == 0)
        {
-          /* 1997-08-01 Currently unsupported with HP aCC */
-          if (hp_som_som_object_present)
-            {
-              fputs_filtered ("?? <not supported with HP aCC>", stream);
-              return;
-            }
+         /* 1997-08-01 Currently unsupported with HP aCC */
+         if (hp_som_som_object_present)
+           {
+             fputs_filtered ("?? <not supported with HP aCC>", stream);
+             return;
+           }
          error ("invalid pointer to member function");
        }
       len = TYPE_NFN_FIELDS (domain);
@@ -124,7 +125,7 @@ cp_print_class_method (valaddr, type, stream)
        {
          f = TYPE_FN_FIELDLIST1 (domain, i);
          len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
-         
+
          for (j = 0; j < len2; j++)
            {
              QUIT;
@@ -137,7 +138,7 @@ cp_print_class_method (valaddr, type, stream)
            }
        }
     }
-  common:
+common:
   if (i < len)
     {
       char *demangled_name;
@@ -165,23 +166,23 @@ cp_print_class_method (valaddr, type, stream)
 
 /* This was what it was for gcc 2.4.5 and earlier.  */
 static const char vtbl_ptr_name_old[] =
-  { CPLUS_MARKER,'v','t','b','l','_','p','t','r','_','t','y','p','e', 0 };
+{CPLUS_MARKER, 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_', 't', 'y', 'p', 'e', 0};
 /* It was changed to this after 2.4.5.  */
 const char vtbl_ptr_name[] =
-  { '_','_','v','t','b','l','_','p','t','r','_','t','y','p','e', 0 };
+{'_', '_', 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_', 't', 'y', 'p', 'e', 0};
 
 /* HP aCC uses different names */
 const char hpacc_vtbl_ptr_name[] =
-  { '_', '_', 'v', 'f', 'p', 0 };
+{'_', '_', 'v', 'f', 'p', 0};
 const char hpacc_vtbl_ptr_type_name[] =
-  { '_', '_', 'v', 'f', 't', 'y', 'p', 0 };
+{'_', '_', 'v', 'f', 't', 'y', 'p', 0};
 
 
 /* Return truth value for assertion that TYPE is of the type
    "pointer to virtual function".  */
 
 int
-cp_is_vtbl_ptr_type(type)
+cp_is_vtbl_ptr_type (type)
      struct type *type;
 {
   char *typename = type_name_no_tag (type);
@@ -195,7 +196,7 @@ cp_is_vtbl_ptr_type(type)
    "pointer to virtual function table".  */
 
 int
-cp_is_vtbl_member(type)
+cp_is_vtbl_member (type)
      struct type *type;
 {
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
@@ -204,11 +205,11 @@ cp_is_vtbl_member(type)
       if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
        {
          type = TYPE_TARGET_TYPE (type);
-         if (TYPE_CODE (type) == TYPE_CODE_STRUCT /* if not using thunks */
-             || TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
+         if (TYPE_CODE (type) == TYPE_CODE_STRUCT      /* if not using thunks */
+             || TYPE_CODE (type) == TYPE_CODE_PTR)     /* if using thunks */
            {
              /* Virtual functions tables are full of pointers
-                to virtual functions. */
+                to virtual functions. */
              return cp_is_vtbl_ptr_type (type);
            }
        }
@@ -218,7 +219,7 @@ cp_is_vtbl_member(type)
 
 /* Mutually recursive subroutines of cp_print_value and c_val_print to
    print out a structure's fields: cp_print_value_fields and cp_print_value.
-  
+
    TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
    same meanings as in cp_print_value and c_val_print.
 
@@ -259,16 +260,16 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
 
   if (n_baseclasses > 0)
     cp_print_value (type, real_type, valaddr, offset, address, stream,
-                   format, recurse+1, pretty, dont_print_vb);
+                   format, recurse + 1, pretty, dont_print_vb);
 
   /* Second, print out data fields */
 
   /* If there are no data fields, or if the only field is the
-   * vtbl pointer, skip this part */ 
+   * vtbl pointer, skip this part */
   if ((len == n_baseclasses) ||
       ((len - n_baseclasses == 1) &&
-       TYPE_HAS_VTABLE(type) &&
-       STREQN(TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5)) || 
+       TYPE_HAS_VTABLE (type) &&
+  STREQN (TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5)) ||
       !len)
     fprintf_filtered (stream, "<No data fields>");
   else
@@ -290,10 +291,10 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
          if (!static_field_print && TYPE_FIELD_STATIC (type, i))
            continue;
 
-          /* If a vtable pointer appears, we'll print it out later */ 
-          if (TYPE_HAS_VTABLE(type) && STREQN(TYPE_FIELD_NAME (type, i), hpacc_vtbl_ptr_name, 5))
-            continue;
-  
+         /* If a vtable pointer appears, we'll print it out later */
+         if (TYPE_HAS_VTABLE (type) && STREQN (TYPE_FIELD_NAME (type, i), hpacc_vtbl_ptr_name, 5))
+           continue;
+
          if (fields_seen)
            fprintf_filtered (stream, ", ");
          else if (n_baseclasses > 0)
@@ -314,7 +315,7 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
              fprintf_filtered (stream, "\n");
              print_spaces_filtered (2 + 2 * recurse, stream);
            }
-         else 
+         else
            {
              wrap_here (n_spaces (2 + 2 * recurse));
            }
@@ -356,25 +357,25 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
              value_ptr v;
 
              /* Bitfields require special handling, especially due to byte
-                order problems.  */
+                order problems.  */
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                  fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_filtered ("<optimized out or zero length>", stream);
                }
              else
                {
-                  v = value_from_longest (TYPE_FIELD_TYPE (type, i),
-                                  unpack_field_as_long (type, valaddr + offset, i));
+                 v = value_from_longest (TYPE_FIELD_TYPE (type, i),
+                         unpack_field_as_long (type, valaddr + offset, i));
 
-                   val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0, 0,
-                             stream, format, 0, recurse + 1, pretty);
+                 val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
+                            stream, format, 0, recurse + 1, pretty);
                }
            }
          else
            {
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                  fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_filtered ("<optimized out or zero length>", stream);
                }
              else if (TYPE_FIELD_STATIC (type, i))
                {
@@ -388,10 +389,10 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
                }
              else
                {
-                  val_print (TYPE_FIELD_TYPE (type, i), 
-                             valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
-                             address + TYPE_FIELD_BITPOS (type, i) / 8,
-                             stream, format, 0, recurse + 1, pretty);
+                 val_print (TYPE_FIELD_TYPE (type, i),
+                         valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
+                            address + TYPE_FIELD_BITPOS (type, i) / 8,
+                            stream, format, 0, recurse + 1, pretty);
                }
            }
          annotate_field_end ();
@@ -410,12 +411,12 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
          fprintf_filtered (stream, "\n");
          print_spaces_filtered (2 * recurse, stream);
        }
-    } /* if there are data fields */
-  /* Now print out the virtual table pointer if there is one */ 
-  if (TYPE_HAS_VTABLE(type) && STREQN(TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5))
+    }                          /* if there are data fields */
+  /* Now print out the virtual table pointer if there is one */
+  if (TYPE_HAS_VTABLE (type) && STREQN (TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5))
     {
       value_ptr v;
-      /* First get the virtual table pointer and print it out*/ 
+      /* First get the virtual table pointer and print it out */
 
 #if 0
       fputs_filtered ("__vfp = ", stream);
@@ -427,55 +428,55 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
       /* Not sure what the best notation is in the case where there is no
          baseclass name.  */
       v = value_from_longest (lookup_pointer_type (builtin_type_unsigned_long),
-                              * (unsigned long *) (valaddr + offset));
+                             *(unsigned long *) (valaddr + offset));
 
       val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
-                 stream, format, 0, recurse + 1, pretty);
+                stream, format, 0, recurse + 1, pretty);
       fields_seen = 1;
 
       if (vtblprint)
-        {
-          /* Print out function pointers in vtable. */
+       {
+         /* Print out function pointers in vtable. */
 
-          /* FIXME: then-clause is for non-RRBC layout of virtual
-           * table.  The RRBC case in the else-clause is yet to be
-           * implemented.  The if (1) below should be changed to a
-           * test for whether the executable we have was compiled
-           * with a version of HP aCC that doesn't have RRBC
-           * support. */
+         /* FIXME: then-clause is for non-RRBC layout of virtual
+          * table.  The RRBC case in the else-clause is yet to be
+          * implemented.  The if (1) below should be changed to a
+          * test for whether the executable we have was compiled
+          * with a version of HP aCC that doesn't have RRBC
+          * support. */
 
-          if (1) 
-            {
-              /* no RRBC support; function pointers embedded directly in vtable */
+         if (1)
+           {
+             /* no RRBC support; function pointers embedded directly in vtable */
 
-              int vfuncs = count_virtual_fns (real_type);
+             int vfuncs = count_virtual_fns (real_type);
 
-              fputs_filtered (" {", stream);
+             fputs_filtered (" {", stream);
 
-              /* FIXME : doesn't work at present */           
+             /* FIXME : doesn't work at present */
 #if 0
-              fprintf_filtered (stream, "%d entr%s: ", vfuncs, vfuncs == 1 ? "y" : "ies");
+             fprintf_filtered (stream, "%d entr%s: ", vfuncs, vfuncs == 1 ? "y" : "ies");
 #else
-              fputs_filtered ("not implemented", stream);
+             fputs_filtered ("not implemented", stream);
 
 
 #endif
 
-              /* recursive function that prints all virtual function entries */ 
+             /* recursive function that prints all virtual function entries */
 #if 0
-              cp_print_hpacc_virtual_table_entries (real_type, &vfuncs, v, stream, format, recurse, pretty);
+             cp_print_hpacc_virtual_table_entries (real_type, &vfuncs, v, stream, format, recurse, pretty);
 #endif
-              fputs_filtered ("}", stream);
-            } /* non-RRBC case */
-          else
-            {
-              /* FIXME -- seem comments above */ 
-              /* RRBC support present; function pointers are found
-               * by indirection through the class segment entries. */
-
-              
-            } /* RRBC case */ 
-        } /* if vtblprint */ 
+             fputs_filtered ("}", stream);
+           }                   /* non-RRBC case */
+         else
+           {
+             /* FIXME -- seem comments above */
+             /* RRBC support present; function pointers are found
+              * by indirection through the class segment entries. */
+
+
+           }                   /* RRBC case */
+       }                       /* if vtblprint */
 
       if (pretty)
        {
@@ -483,8 +484,8 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format
          print_spaces_filtered (2 * recurse, stream);
        }
 
-    } /* if vtable exists */ 
-  
+    }                          /* if vtable exists */
+
   fprintf_filtered (stream, "}");
 }
 
@@ -507,14 +508,14 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
 {
   struct obstack tmp_obstack;
   struct type **last_dont_print
-    = (struct type **)obstack_next_free (&dont_print_vb_obstack);
+  = (struct type **) obstack_next_free (&dont_print_vb_obstack);
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
 
   if (dont_print_vb == 0)
     {
       /* If we're at top level, carve out a completely fresh
-        chunk of the obstack and use that until this particular
-        invocation returns.  */
+         chunk of the obstack and use that until this particular
+         invocation returns.  */
       tmp_obstack = dont_print_vb_obstack;
       /* Bump up the high-water mark.  Now alpha is omega.  */
       obstack_finish (&dont_print_vb_obstack);
@@ -531,10 +532,10 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
       if (BASETYPE_VIA_VIRTUAL (type, i))
        {
          struct type **first_dont_print
-           = (struct type **)obstack_base (&dont_print_vb_obstack);
+         = (struct type **) obstack_base (&dont_print_vb_obstack);
 
-         int j = (struct type **)obstack_next_free (&dont_print_vb_obstack)
-           - first_dont_print;
+         int j = (struct type **) obstack_next_free (&dont_print_vb_obstack)
+         - first_dont_print;
 
          while (--j >= 0)
            if (baseclass == first_dont_print[j])
@@ -544,37 +545,37 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
        }
 
       if (TYPE_HAS_VTABLE (type) && BASETYPE_VIA_VIRTUAL (type, i))
-        {
-          /* Assume HP/Taligent runtime convention */ 
-          find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
-                                valaddr, offset, &boffset, &skip);
-          if (skip >= 0)
-            error ("Virtual base class offset not found from vtable while printing");
-          base_valaddr = valaddr;
-        }
+       {
+         /* Assume HP/Taligent runtime convention */
+         find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
+                               valaddr, offset, &boffset, &skip);
+         if (skip >= 0)
+           error ("Virtual base class offset not found from vtable while printing");
+         base_valaddr = valaddr;
+       }
       else
-        {
-          boffset = baseclass_offset (type, i , valaddr + offset, address + offset);
-          skip = ((boffset == -1) || (boffset+offset) < 0 ) ? 1 : -1;
+       {
+         boffset = baseclass_offset (type, i, valaddr + offset, address + offset);
+         skip = ((boffset == -1) || (boffset + offset) < 0) ? 1 : -1;
 
-          if (BASETYPE_VIA_VIRTUAL (type, i))
-            {
-              /* The virtual base class pointer might have been clobbered by the
+         if (BASETYPE_VIA_VIRTUAL (type, i))
+           {
+             /* The virtual base class pointer might have been clobbered by the
                 user program. Make sure that it still points to a valid memory
                 location.  */
 
-             if (boffset != -1 && ((boffset+offset) < 0 || (boffset+offset) >= TYPE_LENGTH (type)))
-              {
-                base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
-                if (target_read_memory (address + boffset, base_valaddr,
-                                     TYPE_LENGTH (baseclass)) != 0)
-                  skip = 1;
-              }
-             else
-               base_valaddr = valaddr;
-            }
-          else
-             base_valaddr = valaddr;
+             if (boffset != -1 && ((boffset + offset) < 0 || (boffset + offset) >= TYPE_LENGTH (type)))
+               {
+                 base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
+                 if (target_read_memory (address + boffset, base_valaddr,
+                                         TYPE_LENGTH (baseclass)) != 0)
+                   skip = 1;
+               }
+             else
+               base_valaddr = valaddr;
+           }
+         else
+           base_valaddr = valaddr;
        }
 
       /* now do the printing */
@@ -585,7 +586,7 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
        }
       fputs_filtered ("<", stream);
       /* Not sure what the best notation is in the case where there is no
-        baseclass name.  */
+         baseclass name.  */
       fputs_filtered (basename ? basename : "", stream);
       fputs_filtered ("> = ", stream);
 
@@ -595,7 +596,7 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
       else
        cp_print_value_fields (baseclass, real_type, base_valaddr, offset + boffset, address,
                               stream, format, recurse, pretty,
-                              (struct type **) obstack_base (&dont_print_vb_obstack),
+                    (struct type **) obstack_base (&dont_print_vb_obstack),
                               0);
       fputs_filtered (", ", stream);
 
@@ -606,10 +607,10 @@ cp_print_value (type, real_type, valaddr, offset, address, stream, format, recur
   if (dont_print_vb == 0)
     {
       /* Free the space used to deal with the printing
-        of this type from top level.  */
+         of this type from top level.  */
       obstack_free (&dont_print_vb_obstack, last_dont_print);
       /* Reset watermark so that we can continue protecting
-        ourselves from whatever we were protecting ourselves.  */
+         ourselves from whatever we were protecting ourselves.  */
       dont_print_vb_obstack = tmp_obstack;
     }
 }
@@ -638,8 +639,8 @@ cp_print_static_field (type, val, stream, format, recurse, pretty)
       int i;
 
       first_dont_print
-       = (CORE_ADDR *)obstack_base (&dont_print_statmem_obstack);
-      i = (CORE_ADDR *)obstack_next_free (&dont_print_statmem_obstack)
+       = (CORE_ADDR *) obstack_base (&dont_print_statmem_obstack);
+      i = (CORE_ADDR *) obstack_next_free (&dont_print_statmem_obstack)
        - first_dont_print;
 
       while (--i >= 0)
@@ -671,7 +672,7 @@ cp_print_class_member (valaddr, domain, stream, prefix)
      GDB_FILE *stream;
      char *prefix;
 {
-  
+
   /* VAL is a byte offset into the structure type DOMAIN.
      Find the name of the field for that offset and
      print it.  */
@@ -687,8 +688,8 @@ cp_print_class_member (valaddr, domain, stream, prefix)
      shifted out in the code below -- joyous happenstance! */
 
   /* Note: HP cfront uses a constant bias of 1; if we support this
-     compiler ever, we will have to adjust the computation below */ 
-  
+     compiler ever, we will have to adjust the computation below */
+
   LONGEST val = unpack_long (builtin_type_int, valaddr) << 3;
   for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
     {
@@ -714,7 +715,7 @@ cp_print_class_member (valaddr, domain, stream, prefix)
       fprintf_filtered (stream, prefix);
       name = type_name_no_tag (domain);
       if (name)
-        fputs_filtered (name, stream);
+       fputs_filtered (name, stream);
       else
        c_type_print_base (domain, stream, 0, 0);
       fprintf_filtered (stream, "::");
@@ -740,17 +741,17 @@ cp_print_class_member (valaddr, domain, stream, prefix)
  * this currently has only the code for non-RRBC layouts generated by
  * the HP aCC compiler; RRBC code is stubbed out and will have to be
  * added later. */
+
 
 static void
 cp_print_hpacc_virtual_table_entries (type, vfuncs, v, stream, format, recurse, pretty)
-  struct type * type;
-  int * vfuncs;
-  value_ptr v;
-  GDB_FILE *stream;
-  int format;
-  int recurse;
-  enum val_prettyprint pretty;
+     struct type *type;
+     int *vfuncs;
+     value_ptr v;
+     GDB_FILE *stream;
+     int format;
+     int recurse;
+     enum val_prettyprint pretty;
 {
   int fn, oi;
 
@@ -758,38 +759,38 @@ cp_print_hpacc_virtual_table_entries (type, vfuncs, v, stream, format, recurse,
    * virtual function only once (latest redefinition in class hierarchy)
    */
 
-  /* Recursion on other classes that can share the same vtable */ 
-  struct type * pbc = primary_base_class (type);
+  /* Recursion on other classes that can share the same vtable */
+  struct type *pbc = primary_base_class (type);
   if (pbc)
     cp_print_hpacc_virtual_table_entries (pbc, vfuncs, v, stream, format, recurse, pretty);
-      
+
   /* Now deal with vfuncs declared in this class */
   for (fn = 0; fn < TYPE_NFN_FIELDS (type); fn++)
     for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (type, fn); oi++)
       if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (type, fn), oi))
-        {
-          char * vf_name;
-
-          /* virtual function offset */
-          int vx = TYPE_FN_FIELD_VOFFSET (TYPE_FN_FIELDLIST1 (type, fn), oi) - 1;
-
-          /* Get the address of the vfunction entry */ 
-          value_ptr vf = value_copy (v);
-          if (VALUE_LAZY (vf))
-            (void) value_fetch_lazy (vf);
-          vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);  /* adjust by offset */ 
-          vf = value_ind (vf);               /* get the entry */ 
-          VALUE_TYPE (vf) = VALUE_TYPE (v);  /* make it a pointer */ 
-
-          /* print out the entry */ 
-          val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0,
-                     stream, format, 0, recurse + 1, pretty);
-          vf_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi),
-                                    DMGL_ARM);  /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */
-          fprintf_filtered (stream, " %s", vf_name);
-          if (--(*vfuncs) > 0)
-            fputs_filtered (", ", stream);
-        }
+       {
+         char *vf_name;
+
+         /* virtual function offset */
+         int vx = TYPE_FN_FIELD_VOFFSET (TYPE_FN_FIELDLIST1 (type, fn), oi) - 1;
+
+         /* Get the address of the vfunction entry */
+         value_ptr vf = value_copy (v);
+         if (VALUE_LAZY (vf))
+           (void) value_fetch_lazy (vf);
+         vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);     /* adjust by offset */
+         vf = value_ind (vf);  /* get the entry */
+         VALUE_TYPE (vf) = VALUE_TYPE (v);     /* make it a pointer */
+
+         /* print out the entry */
+         val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0,
+                    stream, format, 0, recurse + 1, pretty);
+         vf_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi),
+                                   DMGL_ARM);  /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */
+         fprintf_filtered (stream, " %s", vf_name);
+         if (--(*vfuncs) > 0)
+           fputs_filtered (", ", stream);
+       }
 }
 
 
@@ -799,7 +800,7 @@ _initialize_cp_valprint ()
 {
   add_show_from_set
     (add_set_cmd ("static-members", class_support, var_boolean,
-                 (char *)&static_field_print,
+                 (char *) &static_field_print,
                  "Set printing of C++ static members.",
                  &setprintlist),
      &showprintlist);
@@ -807,14 +808,14 @@ _initialize_cp_valprint ()
   static_field_print = 1;
 
   add_show_from_set
-    (add_set_cmd ("vtbl", class_support, var_boolean, (char *)&vtblprint,
+    (add_set_cmd ("vtbl", class_support, var_boolean, (char *) &vtblprint,
                  "Set printing of C++ virtual function tables.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
-    (add_set_cmd ("object", class_support, var_boolean, (char *)&objectprint,
-         "Set printing of object's derived type based on vtable info.",
+    (add_set_cmd ("object", class_support, var_boolean, (char *) &objectprint,
+             "Set printing of object's derived type based on vtable info.",
                  &setprintlist),
      &showprintlist);
 
index 758c8caad9e6bc633a060bc596121a13a6cd6e80..f0a4396205446498d274d448a2a2e514723c16c1 100644 (file)
@@ -3,21 +3,22 @@
 
    Written by Stu Grossman of Cygnus Support
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -90,61 +91,62 @@ static char *cpu32bug_regnames[NUM_REGS] =
 
 static struct target_ops cpu32bug_ops;
 
-static char *cpu32bug_inits[] = {"\r", NULL};
+static char *cpu32bug_inits[] =
+{"\r", NULL};
 
-static struct monitor_ops cpu32bug_cmds ;
+static struct monitor_ops cpu32bug_cmds;
 
-static void 
-init_cpu32bug_cmds(void)
+static void
+init_cpu32bug_cmds (void)
 {
-  cpu32bug_cmds.flags =   MO_CLR_BREAK_USES_ADDR;
-  cpu32bug_cmds.init =   cpu32bug_inits;               /* Init strings */
-  cpu32bug_cmds.cont =   "g\r";                        /* continue command */
-  cpu32bug_cmds.step =   "t\r";                        /* single step */
-  cpu32bug_cmds.stop =   NULL;                         /* interrupt command */
-  cpu32bug_cmds.set_break =   "br %x\r";                       /* set a breakpoint */
-  cpu32bug_cmds.clr_break =   "nobr %x\r";                     /* clear a breakpoint */
-  cpu32bug_cmds.clr_all_break =   "nobr\r";                    /* clear all breakpoints */
-  cpu32bug_cmds.fill =   "bf %x:%x %x;b\r";            /* fill (start count val) */
-  cpu32bug_cmds.setmem.cmdb =     "ms %x %02x\r";              /* setmem.cmdb (addr, value) */
-  cpu32bug_cmds.setmem.cmdw =     "ms %x %04x\r";              /* setmem.cmdw (addr, value) */
-  cpu32bug_cmds.setmem.cmdl =     "ms %x %08x\r";              /* setmem.cmdl (addr, value) */
-  cpu32bug_cmds.setmem.cmdll =     NULL;                       /* setmem.cmdll (addr, value) */
-  cpu32bug_cmds.setmem.resp_delim =     NULL;                  /* setreg.resp_delim */
-  cpu32bug_cmds.setmem.term =     NULL;                        /* setreg.term */
-  cpu32bug_cmds.setmem.term_cmd =     NULL;                    /* setreg.term_cmd */
-  cpu32bug_cmds.getmem.cmdb =     "md %x:%x;b\r";              /* getmem.cmdb (addr, len) */
-  cpu32bug_cmds.getmem.cmdw =     "md %x:%x;b\r";              /* getmem.cmdw (addr, len) */
-  cpu32bug_cmds.getmem.cmdl =     "md %x:%x;b\r";              /* getmem.cmdl (addr, len) */
-  cpu32bug_cmds.getmem.cmdll =     NULL;                       /* getmem.cmdll (addr, len) */
-  cpu32bug_cmds.getmem.resp_delim =     " ";                   /* getmem.resp_delim */
-  cpu32bug_cmds.getmem.term =     NULL;                        /* getmem.term */
-  cpu32bug_cmds.getmem.term_cmd =     NULL;                    /* getmem.term_cmd */
-  cpu32bug_cmds.setreg.cmd =     "rs %s %x\r";         /* setreg.cmd (name, value) */
-  cpu32bug_cmds.setreg.resp_delim =     NULL;                  /* setreg.resp_delim */
-  cpu32bug_cmds.setreg.term =     NULL;                        /* setreg.term */
-  cpu32bug_cmds.setreg.term_cmd =     NULL;                    /* setreg.term_cmd */
-  cpu32bug_cmds.getreg.cmd =     "rs %s\r";                    /* getreg.cmd (name) */
-  cpu32bug_cmds.getreg.resp_delim =     "=";                   /* getreg.resp_delim */
-  cpu32bug_cmds.getreg.term =     NULL;                        /* getreg.term */
-  cpu32bug_cmds.getreg.term_cmd =     NULL ;                   /* getreg.term_cmd */
-  cpu32bug_cmds.dump_registers =   "rd\r";                     /* dump_registers */
-  cpu32bug_cmds.register_pattern =   "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
-  cpu32bug_cmds.supply_register =   cpu32bug_supply_register;  /* supply_register */
-  cpu32bug_cmds.load_routine =   NULL;                         /* load_routine (defaults to SRECs) */
-  cpu32bug_cmds.load =   "lo\r";                       /* download command */
-  cpu32bug_cmds.loadresp =   "\n";                             /* load response */
-  cpu32bug_cmds.prompt =   "CPU32Bug>";                        /* monitor command prompt */
-  cpu32bug_cmds.line_term =   "\r";                            /* end-of-line terminator */
-  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.magic =   MONITOR_OPS_MAGIC;           /* magic */
-}; /* init_cpu32bug_cmds */
+  cpu32bug_cmds.flags = MO_CLR_BREAK_USES_ADDR;
+  cpu32bug_cmds.init = cpu32bug_inits; /* Init strings */
+  cpu32bug_cmds.cont = "g\r";  /* continue command */
+  cpu32bug_cmds.step = "t\r";  /* single step */
+  cpu32bug_cmds.stop = NULL;   /* interrupt command */
+  cpu32bug_cmds.set_break = "br %x\r"; /* set a breakpoint */
+  cpu32bug_cmds.clr_break = "nobr %x\r";       /* clear a breakpoint */
+  cpu32bug_cmds.clr_all_break = "nobr\r";      /* clear all breakpoints */
+  cpu32bug_cmds.fill = "bf %x:%x %x;b\r";      /* fill (start count val) */
+  cpu32bug_cmds.setmem.cmdb = "ms %x %02x\r";  /* setmem.cmdb (addr, value) */
+  cpu32bug_cmds.setmem.cmdw = "ms %x %04x\r";  /* setmem.cmdw (addr, value) */
+  cpu32bug_cmds.setmem.cmdl = "ms %x %08x\r";  /* setmem.cmdl (addr, value) */
+  cpu32bug_cmds.setmem.cmdll = NULL;   /* setmem.cmdll (addr, value) */
+  cpu32bug_cmds.setmem.resp_delim = NULL;      /* setreg.resp_delim */
+  cpu32bug_cmds.setmem.term = NULL;    /* setreg.term */
+  cpu32bug_cmds.setmem.term_cmd = NULL;                /* setreg.term_cmd */
+  cpu32bug_cmds.getmem.cmdb = "md %x:%x;b\r";  /* getmem.cmdb (addr, len) */
+  cpu32bug_cmds.getmem.cmdw = "md %x:%x;b\r";  /* getmem.cmdw (addr, len) */
+  cpu32bug_cmds.getmem.cmdl = "md %x:%x;b\r";  /* getmem.cmdl (addr, len) */
+  cpu32bug_cmds.getmem.cmdll = NULL;   /* getmem.cmdll (addr, len) */
+  cpu32bug_cmds.getmem.resp_delim = " ";       /* getmem.resp_delim */
+  cpu32bug_cmds.getmem.term = NULL;    /* getmem.term */
+  cpu32bug_cmds.getmem.term_cmd = NULL;                /* getmem.term_cmd */
+  cpu32bug_cmds.setreg.cmd = "rs %s %x\r";     /* setreg.cmd (name, value) */
+  cpu32bug_cmds.setreg.resp_delim = NULL;      /* setreg.resp_delim */
+  cpu32bug_cmds.setreg.term = NULL;    /* setreg.term */
+  cpu32bug_cmds.setreg.term_cmd = NULL;                /* setreg.term_cmd */
+  cpu32bug_cmds.getreg.cmd = "rs %s\r";                /* getreg.cmd (name) */
+  cpu32bug_cmds.getreg.resp_delim = "=";       /* getreg.resp_delim */
+  cpu32bug_cmds.getreg.term = NULL;    /* getreg.term */
+  cpu32bug_cmds.getreg.term_cmd = NULL;                /* getreg.term_cmd */
+  cpu32bug_cmds.dump_registers = "rd\r";       /* dump_registers */
+  cpu32bug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";       /* register_pattern */
+  cpu32bug_cmds.supply_register = cpu32bug_supply_register;    /* supply_register */
+  cpu32bug_cmds.load_routine = NULL;   /* load_routine (defaults to SRECs) */
+  cpu32bug_cmds.load = "lo\r"; /* download command */
+  cpu32bug_cmds.loadresp = "\n";       /* load response */
+  cpu32bug_cmds.prompt = "CPU32Bug>";  /* monitor command prompt */
+  cpu32bug_cmds.line_term = "\r";      /* end-of-line terminator */
+  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.magic = MONITOR_OPS_MAGIC;     /* magic */
+};                             /* init_cpu32bug_cmds */
 
 static void
-cpu32bug_open(args, from_tty)
+cpu32bug_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -154,7 +156,7 @@ cpu32bug_open(args, from_tty)
 void
 _initialize_cpu32bug_rom ()
 {
-  init_cpu32bug_cmds() ;
+  init_cpu32bug_cmds ();
   init_monitor_ops (&cpu32bug_ops);
 
   cpu32bug_ops.to_shortname = "cpu32bug";
index f693a30a0452c45cc727cd287a0b11b2ea4efa21..88a9b626d3d62fa97751940f98f30292e340d72b 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for Motorola 88k running Harris CX/UX.
    Copyright 1988, 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -58,7 +59,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define XREGADDR(r) (((char *)&u.pt_x0-(char *)&u) + \
                      ((r)-X0_REGNUM)*sizeof(X_REGISTER_RAW_TYPE))
 
-extern int have_symbol_file_p();
+extern int have_symbol_file_p ();
 
 extern jmp_buf stack_jmp;
 
@@ -66,7 +67,7 @@ extern int errno;
 
 void
 fetch_inferior_registers (regno)
-     int regno;                /* Original value discarded */
+     int regno;                        /* Original value discarded */
 {
   register unsigned int regaddr;
   char buf[MAX_REGISTER_RAW_SIZE];
@@ -75,62 +76,62 @@ fetch_inferior_registers (regno)
   struct USER u;
   unsigned int offset;
 
-  offset = (char *) &u.pt_r0 - (char *) &u; 
-  regaddr = offset; /* byte offset to r0;*/
+  offset = (char *) &u.pt_r0 - (char *) &u;
+  regaddr = offset;            /* byte offset to r0; */
 
 /*  offset = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */
   for (regno = 0; regno < PC_REGNUM; regno++)
     {
-      /*regaddr = register_addr (regno, offset);*/
-       /* 88k enhancement  */
-        
+      /*regaddr = register_addr (regno, offset); */
+      /* 88k enhancement  */
+
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
-       {
-         *(int *) &buf[i] = ptrace (3, inferior_pid,
+       {
+         *(int *) &buf[i] = ptrace (3, inferior_pid,
                                     (PTRACE_ARG3_TYPE) regaddr, 0);
-         regaddr += sizeof (int);
-       }
+         regaddr += sizeof (int);
+       }
       supply_register (regno, buf);
     }
-    /* now load up registers 32-37; special pc registers */
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) PSR_OFFSET,0);
-    supply_register (PSR_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) FPSR_OFFSET,0);
-    supply_register (FPSR_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) FPCR_OFFSET,0);
-    supply_register (FPCR_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3,inferior_pid,
-                              (PTRACE_ARG3_TYPE) SXIP_OFFSET ,0);
-    supply_register (SXIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) SNIP_OFFSET,0);
-    supply_register (SNIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) SFIP_OFFSET,0);
-    supply_register (SFIP_REGNUM, buf);
-
-    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, inferior_pid,
-                                        (PTRACE_ARG3_TYPE) regaddr, 0);
-            *(int *) &xval.w2 = ptrace (3, inferior_pid,
-                                        (PTRACE_ARG3_TYPE) (regaddr+4), 0);
-            *(int *) &xval.w3 = ptrace (3, inferior_pid,
-                                        (PTRACE_ARG3_TYPE) (regaddr+8), 0);
-            *(int *) &xval.w4 = ptrace (3, inferior_pid,
-                                        (PTRACE_ARG3_TYPE) (regaddr+12), 0);
-            supply_register(regno, (void *)&xval);
-          }
-      }
+  /* now load up registers 32-37; special pc registers */
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) PSR_OFFSET, 0);
+  supply_register (PSR_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) FPSR_OFFSET, 0);
+  supply_register (FPSR_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) FPCR_OFFSET, 0);
+  supply_register (FPCR_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0);
+  supply_register (SXIP_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0);
+  supply_register (SNIP_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0);
+  supply_register (SFIP_REGNUM, buf);
+
+  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, inferior_pid,
+                                     (PTRACE_ARG3_TYPE) regaddr, 0);
+         *(int *) &xval.w2 = ptrace (3, inferior_pid,
+                                     (PTRACE_ARG3_TYPE) (regaddr + 4), 0);
+         *(int *) &xval.w3 = ptrace (3, inferior_pid,
+                                     (PTRACE_ARG3_TYPE) (regaddr + 8), 0);
+         *(int *) &xval.w4 = ptrace (3, inferior_pid,
+                                     (PTRACE_ARG3_TYPE) (regaddr + 12), 0);
+         supply_register (regno, (void *) &xval);
+       }
+    }
 }
 
 /* Store our register values back into the inferior.
@@ -157,7 +158,7 @@ store_inferior_registers (regno)
     {
       /*      regaddr = register_addr (regno, offset); */
       if (regno < PC_REGNUM)
-       { 
+       {
          regaddr = offset + regno * sizeof (int);
          errno = 0;
          ptrace (6, inferior_pid,
@@ -169,40 +170,40 @@ store_inferior_registers (regno)
            }
        }
       else if (regno == PSR_REGNUM)
-        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register(regno));
+       ptrace (6, inferior_pid,
+               (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno));
       else if (regno == FPSR_REGNUM)
-        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register(regno));
+       ptrace (6, inferior_pid,
+               (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno));
       else if (regno == FPCR_REGNUM)
-        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register(regno));
+       ptrace (6, inferior_pid,
+               (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno));
       else if (regno == SXIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register(regno));
+               (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno));
       else if (regno == SNIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register(regno));
+               (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno));
       else if (regno == SFIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register(regno));
+               (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, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, xval.w1);
-          ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr+4, xval.w2);
-          ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr+8, xval.w3);
-          ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr+12, xval.w4);
-        }
+       {
+         X_REGISTER_RAW_TYPE xval;
+
+         read_register_bytes (REGISTER_BYTE (regno), (char *) &xval,
+                              sizeof (X_REGISTER_RAW_TYPE));
+         regaddr = XREGADDR (regno);
+         ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, xval.w1);
+         ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr + 4, xval.w2);
+         ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr + 8, xval.w3);
+         ptrace (6, inferior_pid, (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); */
@@ -217,32 +218,32 @@ store_inferior_registers (regno)
            }
        }
       ptrace (6, inferior_pid,
-              (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register(regno));
+             (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM));
       ptrace (6, inferior_pid,
-              (PTRACE_ARG3_TYPE) FPSR_OFFSET,read_register(regno));
+             (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM));
       ptrace (6, inferior_pid,
-              (PTRACE_ARG3_TYPE) FPCR_OFFSET,read_register(regno));
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SXIP_OFFSET,read_register(SXIP_REGNUM));
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SNIP_OFFSET,read_register(SNIP_REGNUM));
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SFIP_OFFSET,read_register(SFIP_REGNUM));
+             (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, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, xval.w1);
-              ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr+4), xval.w2);
-              ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr+8), xval.w3);
-              ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr+12), xval.w4);
-            }
-        }
+       {
+         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, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, xval.w1);
+             ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr + 4), xval.w2);
+             ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr + 8), xval.w3);
+             ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) (regaddr + 12), xval.w4);
+           }
+       }
     }
 }
 
@@ -255,25 +256,25 @@ m88k_register_u_addr (blockend, regnum)
   int ustart = blockend - sizeof (struct USER);
 
   if (regnum < PSR_REGNUM)
-      return (ustart + ((int) &u.pt_r0 - (int) &u) +
-              REGISTER_SIZE * 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);
+    return (ustart + ((int) &u.pt_psr) - (int) &u);
   else if (regnum == FPSR_REGNUM)
-      return (ustart + ((int) &u.pt_fpsr) - (int) &u);
+    return (ustart + ((int) &u.pt_fpsr) - (int) &u);
   else if (regnum == FPCR_REGNUM)
-      return (ustart + ((int) &u.pt_fpcr) - (int) &u);
+    return (ustart + ((int) &u.pt_fpcr) - (int) &u);
   else if (regnum == SXIP_REGNUM)
-      return (ustart + SXIP_OFFSET);
+    return (ustart + SXIP_OFFSET);
   else if (regnum == SNIP_REGNUM)
-      return (ustart + SNIP_OFFSET);
+    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));
+    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);
+    return (blockend + REGISTER_SIZE * regnum);
 }
 
 #ifdef USE_PROC_FS
@@ -281,25 +282,25 @@ m88k_register_u_addr (blockend, regnum)
 #include <sys/procfs.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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 void
 supply_gregset (gregsetp)
      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));
+  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
@@ -307,25 +308,25 @@ fill_gregset (gregsetp, regno)
      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)];
+  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 */
@@ -335,7 +336,8 @@ fill_gregset (gregsetp, regno)
    the dynamic linker's link map and reads the minimal symbols
    from each shared object file listed in the map. */
 
-struct link_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 */
@@ -356,11 +358,11 @@ add_shared_symbol_files ()
 {
   void *desc;
   struct link_map *ld_map, *lm, lms;
-  struct minimal_symbol *minsym; 
+  struct minimal_symbol *minsym;
   struct objfile *objfile;
   char *path_name;
 
-  if (! inferior_pid)
+  if (!inferior_pid)
     {
       warning ("The program has not yet been started.");
       return;
@@ -370,24 +372,24 @@ add_shared_symbol_files ()
   minsym = lookup_minimal_symbol (LINKS_MAP_POINTER, objfile);
 
   ld_map = (struct link_map *)
-    read_memory_integer (((int)SYMBOL_VALUE_ADDRESS(minsym) + SHARED_OFFSET), 4);
+    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));
+      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))
+         if (target_read_string ((CORE_ADDR) lms.l_name, &path_name,
+                                 PATH_MAX, &local_errno))
            {
              symbol_file_add (path_name, 1, lms.l_addr, 0, 0, 0, 0, 0);
-              free(path_name);
+             free (path_name);
            }
        }
       /* traverse links in reverse order so that we get the
-        the symbols the user actually gets. */
+         the symbols the user actually gets. */
       lm = lms.l_prev;
     }
 
@@ -404,49 +406,49 @@ unsigned int
 m88k_harris_core_register_addr (regno, reg_ptr)
      int regno, 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);
+  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()
+_initialize_m88k_nat ()
 {
 #ifdef _ES_MP
-   /* Enable 88110 support, as we don't support the 88100 under ES/MP.  */
+  /* Enable 88110 support, as we don't support the 88100 under ES/MP.  */
 
-   target_is_m88110 = 1;
+  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);
+  /* Determine whether we're running on an 88100 or an 88110.  */
+  target_is_m88110 = (sinfo (SYSMACHINE, 0) == SYS5800);
 #endif /* _CX_UX */
 }
 
@@ -462,11 +464,11 @@ supply_gregset (gregsetp)
   register int regi;
   register greg_t *regp = (greg_t *) gregsetp;
 
-  for (regi = 0 ; regi < R_R31 ; regi++)
+  for (regi = 0; regi < R_R31; regi++)
     {
       supply_register (regi, (char *) (regp + regi));
     }
-  supply_register (PSR_REGNUM,  (char *) (regp + R_EPSR));
+  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));
@@ -478,16 +480,16 @@ supply_gregset (gregsetp)
    (fpregset_t *), unpack the register contents and supply them as gdb's
    idea of the current floating point register values.  */
 
-void 
+void
 supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
   register int regi;
   char *from;
-  
-  for (regi = FP0_REGNUM ; regi <= FPLAST_REGNUM ; regi++)
+
+  for (regi = FP0_REGNUM; regi <= FPLAST_REGNUM; regi++)
     {
-      from = (char *) &((*fpregsetp)[regi-FP0_REGNUM]);
+      from = (char *) &((*fpregsetp)[regi - FP0_REGNUM]);
       supply_register (regi, from);
     }
 }
@@ -498,24 +500,38 @@ supply_fpregset (fpregsetp)
 
 #include <sys/regset.h>
 
-unsigned int m88k_harris_core_register_addr(int regno, int reg_ptr)
+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);
+  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 */
index 861533f400320e883ca398941fee06d8f16b3568..5d191a3685ccda36c3526f7d486383829502c0cb 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for Mitsubishi D10V, for GDB.
    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*  Contributed by Martin Hunt, hunt@cygnus.com */
 
@@ -29,16 +30,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdb_string.h"
 #include "value.h"
 #include "inferior.h"
-#include "dis-asm.h"  
+#include "dis-asm.h"
 #include "symfile.h"
 #include "objfiles.h"
 
 struct frame_extra_info
-{
-  CORE_ADDR return_pc;
-  int frameless;
-  int size;
-};
+  {
+    CORE_ADDR return_pc;
+    int frameless;
+    int size;
+  };
 
 /* these are the addresses the D10V-EVA board maps data */
 /* and instruction memory to. */
@@ -61,19 +62,19 @@ static void d10v_eva_prepare_to_trace PARAMS ((void));
 
 static void d10v_eva_get_trace_data PARAMS ((void));
 
-static int prologue_find_regs PARAMS ((unsigned short op, struct frame_info *fi, CORE_ADDR addr));
+static int prologue_find_regs PARAMS ((unsigned short op, struct frame_info * fi, CORE_ADDR addr));
 
 extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *));
 
-static void do_d10v_pop_frame PARAMS ((struct frame_info *fi));
+static void do_d10v_pop_frame PARAMS ((struct frame_info * fi));
 
 /* FIXME */
-extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
+extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len));
 
 int
 d10v_frame_chain_valid (chain, frame)
      CORE_ADDR chain;
-     struct frame_info *frame;      /* not used here */
+     struct frame_info *frame; /* not used here */
 {
   return ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START);
 }
@@ -100,7 +101,8 @@ d10v_breakpoint_from_pc (pcptr, lenptr)
      CORE_ADDR *pcptr;
      int *lenptr;
 {
-  static unsigned char breakpoint [] = {0x2f, 0x90, 0x5e, 0x00};
+  static unsigned char breakpoint[] =
+  {0x2f, 0x90, 0x5e, 0x00};
   *lenptr = sizeof (breakpoint);
   return breakpoint;
 }
@@ -109,18 +111,19 @@ char *
 d10v_register_name (reg_nr)
      int reg_nr;
 {
-  static char *register_names[] = {
-    "r0", "r1", "r2", "r3", "r4", "r5",  "r6", "r7",
-    "r8", "r9", "r10","r11","r12", "r13", "r14","r15",
-    "psw","bpsw","pc","bpc", "cr4", "cr5", "cr6", "rpt_c",
-    "rpt_s","rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",
-    "imap0","imap1","dmap","a0", "a1"
+  static char *register_names[] =
+  {
+    "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+    "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+    "psw", "bpsw", "pc", "bpc", "cr4", "cr5", "cr6", "rpt_c",
+    "rpt_s", "rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",
+    "imap0", "imap1", "dmap", "a0", "a1"
   };
   if (reg_nr < 0)
     return NULL;
   if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
     return NULL;
-  return register_names [reg_nr];
+  return register_names[reg_nr];
 }
 
 
@@ -255,7 +258,7 @@ d10v_convert_iaddr_to_raw (x)
 }
 
 CORE_ADDR
-d10v_convert_daddr_to_raw(x)
+d10v_convert_daddr_to_raw (x)
      CORE_ADDR x;
 {
   return ((x) & 0xffff);
@@ -281,7 +284,7 @@ d10v_store_struct_return (addr, sp)
    Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */
 
 void
-d10v_store_return_value (type,valbuf)
+d10v_store_return_value (type, valbuf)
      struct type *type;
      char *valbuf;
 {
@@ -332,7 +335,7 @@ CORE_ADDR
 d10v_saved_pc_after_call (frame)
      struct frame_info *frame;
 {
-  return ((read_register(LR_REGNUM) << 2)
+  return ((read_register (LR_REGNUM) << 2)
          | IMEM_START);
 }
 
@@ -357,26 +360,26 @@ do_d10v_pop_frame (fi)
   /* fill out fsr with the address of where each */
   /* register was stored in the frame */
   d10v_frame_init_saved_regs (fi);
-  
+
   /* now update the current registers with the old values */
-  for (regnum = A0_REGNUM; regnum < A0_REGNUM+2 ; regnum++)
+  for (regnum = A0_REGNUM; regnum < A0_REGNUM + 2; regnum++)
     {
       if (fi->saved_regs[regnum])
        {
-         read_memory (fi->saved_regs[regnum], raw_buffer,  REGISTER_RAW_SIZE(regnum));
-         write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,  REGISTER_RAW_SIZE(regnum));
+         read_memory (fi->saved_regs[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum));
+         write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, REGISTER_RAW_SIZE (regnum));
        }
     }
   for (regnum = 0; regnum < SP_REGNUM; regnum++)
     {
       if (fi->saved_regs[regnum])
        {
-         write_register (regnum, read_memory_unsigned_integer (fi->saved_regs[regnum], REGISTER_RAW_SIZE(regnum)));
+         write_register (regnum, read_memory_unsigned_integer (fi->saved_regs[regnum], REGISTER_RAW_SIZE (regnum)));
        }
     }
   if (fi->saved_regs[PSW_REGNUM])
     {
-      write_register (PSW_REGNUM, read_memory_unsigned_integer (fi->saved_regs[PSW_REGNUM], REGISTER_RAW_SIZE(PSW_REGNUM)));
+      write_register (PSW_REGNUM, read_memory_unsigned_integer (fi->saved_regs[PSW_REGNUM], REGISTER_RAW_SIZE (PSW_REGNUM)));
     }
 
   write_register (PC_REGNUM, read_register (LR_REGNUM));
@@ -385,7 +388,7 @@ do_d10v_pop_frame (fi)
   flush_cached_frames ();
 }
 
-static int 
+static int
 check_prologue (op)
      unsigned short op;
 {
@@ -414,8 +417,8 @@ check_prologue (op)
     return 1;
 
   /* st2w  rn, @sp */
- if ((op & 0x7E3F) == 0x3A1E)
-   return 1;
 if ((op & 0x7E3F) == 0x3A1E)
+    return 1;
 
   return 0;
 }
@@ -434,22 +437,22 @@ d10v_skip_prologue (pc)
   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)
+      if (sal.end && sal.end < func_end)
        return sal.end;
     }
-  
-  if (target_read_memory (pc, (char *)&op, 4))
+
+  if (target_read_memory (pc, (char *) &op, 4))
     return pc;                 /* Can't access it -- assume no prologue. */
 
   while (1)
     {
-      op = (unsigned long)read_memory_integer (pc, 4);
+      op = (unsigned long) read_memory_integer (pc, 4);
       if ((op & 0xC0000000) == 0xC0000000)
        {
          /* long instruction */
-         if ( ((op & 0x3FFF0000) != 0x01FF0000) &&   /* add3 sp,sp,n */
-              ((op & 0x3F0F0000) != 0x340F0000) &&   /* st  rn, @(offset,sp) */
-              ((op & 0x3F1F0000) != 0x350F0000))     /* st2w  rn, @(offset,sp) */
+         if (((op & 0x3FFF0000) != 0x01FF0000) &&      /* add3 sp,sp,n */
+             ((op & 0x3F0F0000) != 0x340F0000) &&      /* st  rn, @(offset,sp) */
+             ((op & 0x3F1F0000) != 0x350F0000))        /* st2w  rn, @(offset,sp) */
            break;
        }
       else
@@ -459,15 +462,15 @@ d10v_skip_prologue (pc)
            {
              op2 = (op & 0x3FFF8000) >> 15;
              op1 = op & 0x7FFF;
-           } 
-         else 
+           }
+         else
            {
              op1 = (op & 0x3FFF8000) >> 15;
              op2 = op & 0x7FFF;
            }
-         if (check_prologue(op1))
+         if (check_prologue (op1))
            {
-             if (!check_prologue(op2))
+             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 */
@@ -487,7 +490,7 @@ d10v_skip_prologue (pc)
 /* Given a GDB frame, determine the address of the calling function's frame.
    This will be used to create a new GDB frame struct, and then
    INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
-*/
+ */
 
 CORE_ADDR
 d10v_frame_chain (fi)
@@ -497,28 +500,28 @@ d10v_frame_chain (fi)
 
   if (fi->extra_info->return_pc == IMEM_START
       || inside_entry_file (fi->extra_info->return_pc))
-    return (CORE_ADDR)0;
+    return (CORE_ADDR) 0;
 
   if (!fi->saved_regs[FP_REGNUM])
     {
       if (!fi->saved_regs[SP_REGNUM]
          || fi->saved_regs[SP_REGNUM] == STACK_START)
-       return (CORE_ADDR)0;
-      
+       return (CORE_ADDR) 0;
+
       return fi->saved_regs[SP_REGNUM];
     }
 
-  if (!read_memory_unsigned_integer(fi->saved_regs[FP_REGNUM],
-                                   REGISTER_RAW_SIZE(FP_REGNUM)))
-    return (CORE_ADDR)0;
+  if (!read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM],
+                                    REGISTER_RAW_SIZE (FP_REGNUM)))
+    return (CORE_ADDR) 0;
 
   return D10V_MAKE_DADDR (read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM],
-                                                       REGISTER_RAW_SIZE (FP_REGNUM)));
-}  
+                                           REGISTER_RAW_SIZE (FP_REGNUM)));
+}
 
 static int next_addr, uses_frame;
 
-static int 
+static int
 prologue_find_regs (op, fi, addr)
      unsigned short op;
      struct frame_info *fi;
@@ -541,7 +544,7 @@ prologue_find_regs (op, fi, addr)
       n = (op & 0x1E0) >> 5;
       next_addr -= 4;
       fi->saved_regs[n] = next_addr;
-      fi->saved_regs[n+1] = next_addr+2;
+      fi->saved_regs[n + 1] = next_addr + 2;
       return 1;
     }
 
@@ -579,7 +582,7 @@ prologue_find_regs (op, fi, addr)
     {
       n = (op & 0x1E0) >> 5;
       fi->saved_regs[n] = next_addr;
-      fi->saved_regs[n+1] = next_addr+2;
+      fi->saved_regs[n + 1] = next_addr + 2;
       return 1;
     }
 
@@ -610,7 +613,7 @@ d10v_frame_init_saved_regs (fi)
   uses_frame = 0;
   while (1)
     {
-      op = (unsigned long)read_memory_integer (pc, 4);
+      op = (unsigned long) read_memory_integer (pc, 4);
       if ((op & 0xC0000000) == 0xC0000000)
        {
          /* long instruction */
@@ -633,7 +636,7 @@ d10v_frame_init_saved_regs (fi)
              short offset = op & 0xFFFF;
              short n = (op >> 20) & 0xF;
              fi->saved_regs[n] = next_addr + offset;
-             fi->saved_regs[n+1] = next_addr + offset + 2;
+             fi->saved_regs[n + 1] = next_addr + offset + 2;
            }
          else
            break;
@@ -645,27 +648,27 @@ d10v_frame_init_saved_regs (fi)
            {
              op2 = (op & 0x3FFF8000) >> 15;
              op1 = op & 0x7FFF;
-           } 
-         else 
+           }
+         else
            {
              op1 = (op & 0x3FFF8000) >> 15;
              op2 = op & 0x7FFF;
            }
-         if (!prologue_find_regs(op1, fi, pc) || !prologue_find_regs(op2, fi, pc))
+         if (!prologue_find_regs (op1, fi, pc) || !prologue_find_regs (op2, fi, pc))
            break;
        }
       pc += 4;
     }
-  
+
   fi->extra_info->size = -next_addr;
 
   if (!(fp & 0xffff))
-    fp = D10V_MAKE_DADDR (read_register(SP_REGNUM));
+    fp = D10V_MAKE_DADDR (read_register (SP_REGNUM));
 
-  for (i=0; i<NUM_REGS-1; i++)
+  for (i = 0; i < NUM_REGS - 1; i++)
     if (fi->saved_regs[i])
       {
-       fi->saved_regs[i] = fp - (next_addr - fi->saved_regs[i]); 
+       fi->saved_regs[i] = fp - (next_addr - fi->saved_regs[i]);
       }
 
   if (fi->saved_regs[LR_REGNUM])
@@ -675,16 +678,16 @@ d10v_frame_init_saved_regs (fi)
     }
   else
     {
-      fi->extra_info->return_pc = D10V_MAKE_IADDR (read_register(LR_REGNUM));
+      fi->extra_info->return_pc = D10V_MAKE_IADDR (read_register (LR_REGNUM));
     }
-  
+
   /* th SP is not normally (ever?) saved, but check anyway */
   if (!fi->saved_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)
-       fi->saved_regs[SP_REGNUM] = read_register(FP_REGNUM) + fi->extra_info->size;
+       fi->saved_regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->extra_info->size;
       else
        {
          fi->saved_regs[SP_REGNUM] = fp + fi->extra_info->size;
@@ -726,40 +729,40 @@ show_regs (args, from_tty)
 {
   int a;
   printf_filtered ("PC=%04x (0x%x) PSW=%04x RPT_S=%04x RPT_E=%04x RPT_C=%04x\n",
-                   read_register (PC_REGNUM), D10V_MAKE_IADDR (read_register (PC_REGNUM)),
-                   read_register (PSW_REGNUM),
-                   read_register (24),
-                   read_register (25),
-                   read_register (23));
+     read_register (PC_REGNUM), D10V_MAKE_IADDR (read_register (PC_REGNUM)),
+                  read_register (PSW_REGNUM),
+                  read_register (24),
+                  read_register (25),
+                  read_register (23));
   printf_filtered ("R0-R7  %04x %04x %04x %04x %04x %04x %04x %04x\n",
-                   read_register (0),
-                   read_register (1),
-                   read_register (2),
-                   read_register (3),
-                   read_register (4),
-                   read_register (5),
-                   read_register (6),
-                   read_register (7));
+                  read_register (0),
+                  read_register (1),
+                  read_register (2),
+                  read_register (3),
+                  read_register (4),
+                  read_register (5),
+                  read_register (6),
+                  read_register (7));
   printf_filtered ("R8-R15 %04x %04x %04x %04x %04x %04x %04x %04x\n",
-                   read_register (8), 
-                   read_register (9),
-                   read_register (10),
-                   read_register (11),
-                   read_register (12),
-                   read_register (13),
-                   read_register (14),
-                   read_register (15));
+                  read_register (8),
+                  read_register (9),
+                  read_register (10),
+                  read_register (11),
+                  read_register (12),
+                  read_register (13),
+                  read_register (14),
+                  read_register (15));
   printf_filtered ("IMAP0 %04x    IMAP1 %04x    DMAP %04x\n",
-                   read_register (IMAP0_REGNUM),
-                   read_register (IMAP1_REGNUM),
-                   read_register (DMAP_REGNUM));
+                  read_register (IMAP0_REGNUM),
+                  read_register (IMAP1_REGNUM),
+                  read_register (DMAP_REGNUM));
   printf_filtered ("A0-A1");
   for (a = A0_REGNUM; a <= A0_REGNUM + 1; a++)
     {
       char num[MAX_REGISTER_RAW_SIZE];
       int i;
       printf_filtered ("  ");
-      read_register_gen (a, (char *)&num);
+      read_register_gen (a, (char *) &num);
       for (i = 0; i < MAX_REGISTER_RAW_SIZE; i++)
        {
          printf_filtered ("%02x", (num[i] & 0xff));
@@ -820,13 +823,13 @@ d10v_write_fp (val)
 CORE_ADDR
 d10v_read_fp ()
 {
-  return (D10V_MAKE_DADDR (read_register(FP_REGNUM)));
+  return (D10V_MAKE_DADDR (read_register (FP_REGNUM)));
 }
 
 /* Function: push_return_address (pc)
    Set up the return address for the inferior function call.
    Needed for targets where we don't actually execute a JSR/BSR instruction */
+
 CORE_ADDR
 d10v_push_return_address (pc, sp)
      CORE_ADDR pc;
@@ -835,7 +838,7 @@ d10v_push_return_address (pc, sp)
   write_register (LR_REGNUM, D10V_CONVERT_IADDR_TO_RAW (CALL_DUMMY_ADDRESS ()));
   return sp;
 }
+
 
 /* When arguments must be pushed onto the stack, they go on in reverse
    order.  The below implements a FILO (stack) to do this. */
@@ -847,7 +850,7 @@ struct stack_item
   void *data;
 };
 
-static struct stack_item *push_stack_item PARAMS ((struct stack_item *prev, void *contents, int len));
+static struct stack_item *push_stack_item PARAMS ((struct stack_item * prev, void *contents, int len));
 static struct stack_item *
 push_stack_item (prev, contents, len)
      struct stack_item *prev;
@@ -863,7 +866,7 @@ push_stack_item (prev, contents, len)
   return si;
 }
 
-static struct stack_item *pop_stack_item PARAMS ((struct stack_item *si));
+static struct stack_item *pop_stack_item PARAMS ((struct stack_item * si));
 static struct stack_item *
 pop_stack_item (si)
      struct stack_item *si;
@@ -887,7 +890,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
   int i;
   int regnum = ARG1_REGNUM;
   struct stack_item *si = NULL;
-  
+
   /* Fill in registers and arg lists */
   for (i = 0; i < nargs; i++)
     {
@@ -939,7 +942,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
            }
          else if (len <= (ARGN_REGNUM - aligned_regnum + 1) * 2)
            /* value fits in remaining registers, store keeping left
-               aligned */
+              aligned */
            {
              int b;
              regnum = aligned_regnum;
@@ -957,7 +960,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
          else
            {
              /* arg will go onto stack */
-             regnum = ARGN_REGNUM + 1; 
+             regnum = ARGN_REGNUM + 1;
              si = push_stack_item (si, contents, len);
            }
        }
@@ -969,7 +972,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
       write_memory (sp, si->data, si->len);
       si = pop_stack_item (si);
     }
-  
+
   return sp;
 }
 
@@ -993,15 +996,15 @@ d10v_extract_return_value (type, regbuf, valbuf)
       int num;
       short snum;
       snum = extract_address (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM));
-      store_address ( valbuf, 4, D10V_MAKE_IADDR(snum));
+      store_address (valbuf, 4, D10V_MAKE_IADDR (snum));
     }
-  else if (TYPE_CODE(type) == TYPE_CODE_PTR)
+  else if (TYPE_CODE (type) == TYPE_CODE_PTR)
     {
       /* pointer to data */
       int num;
       short snum;
       snum = extract_address (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM));
-      store_address ( valbuf, 4, D10V_MAKE_DADDR(snum));
+      store_address (valbuf, 4, D10V_MAKE_DADDR (snum));
     }
   else
     {
@@ -1016,10 +1019,10 @@ d10v_extract_return_value (type, regbuf, valbuf)
       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. */
+            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);
        }
     }
@@ -1077,11 +1080,13 @@ static int trace_display;
 
 static int default_trace_show_source = 1;
 
-struct trace_buffer {
-  int size;
-  short *counts;
-  CORE_ADDR *addrs;
-} trace_data;
+struct trace_buffer
+  {
+    int size;
+    short *counts;
+    CORE_ADDR *addrs;
+  }
+trace_data;
 
 static void
 trace_command (args, from_tty)
@@ -1091,9 +1096,9 @@ trace_command (args, 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));
+    trace_data.counts = (short *) xmalloc (65536 * sizeof (short));
   if (trace_data.addrs == NULL)
-    trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof(CORE_ADDR));
+    trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof (CORE_ADDR));
 
   tracing = 1;
 
@@ -1177,7 +1182,7 @@ d10v_eva_get_trace_data ()
   if (!tracing)
     return;
 
-  tmpspace = xmalloc (65536 * sizeof(unsigned int));
+  tmpspace = xmalloc (65536 * sizeof (unsigned int));
 
   last_trace = read_memory_unsigned_integer (DBBC_ADDR, 2) << 2;
 
@@ -1271,7 +1276,7 @@ display_trace (low, high)
   CORE_ADDR next_address;
 
   trace_show_source = default_trace_show_source;
-  if (!have_full_symbols () && !have_partial_symbols())
+  if (!have_full_symbols () && !have_partial_symbols ())
     {
       trace_show_source = 0;
       printf_filtered ("No symbol table is loaded.  Use the \"file\" command.\n");
@@ -1283,7 +1288,7 @@ display_trace (low, high)
   for (i = low; i < high; ++i)
     {
       next_address = trace_data.addrs[i];
-      count = trace_data.counts[i]; 
+      count = trace_data.counts[i];
       while (count-- > 0)
        {
          QUIT;
@@ -1305,7 +1310,7 @@ display_trace (low, high)
                  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));
+                                local_hex_string ((unsigned long) sal.pc));
                  suppress = 1;
                }
            }
@@ -1328,7 +1333,8 @@ d10v_gdbarch_init (info, arches)
      struct gdbarch_info info;
      struct gdbarch_list *arches;
 {
-  static LONGEST d10v_call_dummy_words[] = { 0 };
+  static LONGEST d10v_call_dummy_words[] =
+  {0};
   struct gdbarch *gdbarch;
   int d10v_num_regs = 37;
 
@@ -1460,12 +1466,12 @@ as reported by info trace (NOT addresses!).");
            "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),
+                                 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),
+                          var_integer, (char *) &default_trace_show_source,
+                     "Set display of source code with trace.\n", &setlist),
                     &showlist);
 
-} 
+}
index ec46463314119b1ee8ec8ba866122f04e7c18c36..862566fbd1396447e96735cf51a9a88dd2194468 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for Mitsubishi D30V, for GDB.
    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*  Contributed by Martin Hunt, hunt@cygnus.com */
 
@@ -29,15 +30,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdb_string.h"
 #include "value.h"
 #include "inferior.h"
-#include "dis-asm.h"  
+#include "dis-asm.h"
 #include "symfile.h"
 #include "objfiles.h"
 
-void d30v_frame_find_saved_regs PARAMS ((struct frame_info *fi,
-                                        struct frame_saved_regs *fsr));
-void d30v_frame_find_saved_regs_offsets PARAMS ((struct frame_info *fi,
-                                                struct frame_saved_regs *fsr));
-static void d30v_pop_dummy_frame PARAMS ((struct frame_info *fi));
+void d30v_frame_find_saved_regs PARAMS ((struct frame_info * fi,
+                                        struct frame_saved_regs * fsr));
+void d30v_frame_find_saved_regs_offsets PARAMS ((struct frame_info * fi,
+                                           struct frame_saved_regs * fsr));
+static void d30v_pop_dummy_frame PARAMS ((struct frame_info * fi));
 static void d30v_print_flags PARAMS ((void));
 static void print_flags_command PARAMS ((char *, int));
 
@@ -45,40 +46,40 @@ static void print_flags_command PARAMS ((char *, int));
    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_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_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_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_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 */
+#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_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
@@ -96,7 +97,7 @@ static void print_flags_command PARAMS ((char *, int));
 int
 d30v_frame_chain_valid (chain, fi)
      CORE_ADDR chain;
-     struct frame_info *fi;      /* not used here */
+     struct frame_info *fi;    /* not used here */
 {
 #if 0
   return ((chain) != 0 && (fi) != 0 && (fi)->return_pc != 0);
@@ -120,16 +121,16 @@ d30v_pop_frame ()
   fp = FRAME_FP (frame);
   if (frame->dummy)
     {
-      d30v_pop_dummy_frame(frame);
+      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++)
+  for (regnum = A0_REGNUM; regnum < A0_REGNUM + 2; regnum++)
     {
       if (fsr.regs[regnum])
        {
@@ -149,13 +150,13 @@ d30v_pop_frame ()
       write_register (PSW_REGNUM, read_memory_unsigned_integer (fsr.regs[PSW_REGNUM], 4));
     }
 
-  write_register (PC_REGNUM, read_register(LR_REGNUM));
+  write_register (PC_REGNUM, read_register (LR_REGNUM));
   write_register (SP_REGNUM, fp + frame->size);
   target_store_registers (-1);
   flush_cached_frames ();
 }
 
-static int 
+static int
 check_prologue (op)
      unsigned long op;
 {
@@ -184,36 +185,36 @@ check_prologue (op)
     return 1;
 
   /* st2w  Ra,@(sp,r0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_R0)
-   return 1;
 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;
 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 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 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,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 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;
 /* 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;
 /* 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)
@@ -247,17 +248,17 @@ d30v_skip_prologue (pc)
   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)
+      if (sal.end && sal.end < func_end)
        return sal.end;
     }
-  
-  if (target_read_memory (pc, (char *)&op[0], 8))
+
+  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);
+      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);
@@ -271,10 +272,10 @@ d30v_skip_prologue (pc)
       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) */
+         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
@@ -284,15 +285,15 @@ d30v_skip_prologue (pc)
            {
              op1 = opr;
              op2 = opl;
-           } 
-         else 
+           }
+         else
            {
              op1 = opl;
              op2 = opr;
            }
-         if (check_prologue(op1))
+         if (check_prologue (op1))
            {
-             if (!check_prologue(op2))
+             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 */
@@ -314,7 +315,7 @@ 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 (frame)
@@ -325,29 +326,29 @@ d30v_frame_chain (frame)
   d30v_frame_find_saved_regs (frame, &fsr);
 
   if (end_of_stack)
-    return (CORE_ADDR)0;
+    return (CORE_ADDR) 0;
 
   if (frame->return_pc == IMEM_START)
-    return (CORE_ADDR)0;
+    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 (CORE_ADDR) 0;
+
       return fsr.regs[SP_REGNUM];
     }
 
-  if (!read_memory_unsigned_integer(fsr.regs[FP_REGNUM],4))
-    return (CORE_ADDR)0;
+  if (!read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4))
+    return (CORE_ADDR) 0;
 
-  return read_memory_unsigned_integer(fsr.regs[FP_REGNUM],4);
-}  
+  return read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4);
+}
 
 static int next_addr, uses_frame;
 static int frame_size;
 
-static int 
+static int
 prologue_find_regs (op, fsr, addr)
      unsigned long op;
      struct frame_saved_regs *fsr;
@@ -359,8 +360,8 @@ prologue_find_regs (op, fsr, addr)
   /* add sp,sp,imm -- observed */
   if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
     {
-      offset = EXTRACT_IMM6(op);
-      /*next_addr += offset;*/
+      offset = EXTRACT_IMM6 (op);
+      /*next_addr += offset; */
       frame_size += -offset;
       return 1;
     }
@@ -368,7 +369,7 @@ prologue_find_regs (op, fsr, addr)
   /* add r22,sp,imm -- observed */
   if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM)
     {
-      offset = EXTRACT_IMM6(op);
+      offset = EXTRACT_IMM6 (op);
       next_addr = (offset - frame_size);
       return 1;
     }
@@ -376,8 +377,8 @@ prologue_find_regs (op, fsr, addr)
   /* stw Ra, @(fp, offset) -- observed */
   if ((op & OP_MASK_OP_AND_RB) == OP_STW_FP_IMM)
     {
-      n = EXTRACT_RA(op);
-      offset = EXTRACT_IMM6(op);
+      n = EXTRACT_RA (op);
+      offset = EXTRACT_IMM6 (op);
       fsr->regs[n] = (offset - frame_size);
       return 1;
     }
@@ -385,8 +386,8 @@ prologue_find_regs (op, fsr, addr)
   /* 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);
+      n = EXTRACT_RA (op);
+      fsr->regs[n] = (-frame_size);
       return 1;
     }
 
@@ -406,7 +407,7 @@ prologue_find_regs (op, fsr, addr)
   /* stw Ra,@(r22+,r0) -- observed */
   if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_R22P_R0)
     {
-      n = EXTRACT_RA(op);
+      n = EXTRACT_RA (op);
       fsr->regs[n] = next_addr;
       next_addr += 4;
       return 1;
@@ -415,7 +416,7 @@ prologue_find_regs (op, fsr, addr)
   /* stw fp,@(r22+,r0) -- observed */
   if (op == OP_STW_FP_R22P_R0)
     {
-      fsr->regs[FP_REGNUM] = next_addr;        /* XXX */
+      fsr->regs[FP_REGNUM] = next_addr;                /* XXX */
       next_addr += 4;
       return 1;
     }
@@ -431,9 +432,9 @@ prologue_find_regs (op, fsr, addr)
   /* st2w Ra,@(r22+,r0) -- observed */
   if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_R22P_R0)
     {
-      n = EXTRACT_RA(op);
+      n = EXTRACT_RA (op);
       fsr->regs[n] = next_addr;
-      fsr->regs[n+1] = next_addr + 4;
+      fsr->regs[n + 1] = next_addr + 4;
       next_addr += 8;
       return 1;
     }
@@ -441,7 +442,7 @@ prologue_find_regs (op, fsr, addr)
   /* stw  rn, @(sp-) */
   if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SPM)
     {
-      n = EXTRACT_RA(op);
+      n = EXTRACT_RA (op);
       fsr->regs[n] = next_addr;
       next_addr -= 4;
       return 1;
@@ -450,9 +451,9 @@ prologue_find_regs (op, fsr, addr)
   /* st2w  Ra, @(sp-) */
   else if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SPM)
     {
-      n = EXTRACT_RA(op);
+      n = EXTRACT_RA (op);
       fsr->regs[n] = next_addr;
-      fsr->regs[n+1] = next_addr+4;
+      fsr->regs[n + 1] = next_addr + 4;
       next_addr -= 8;
       return 1;
     }
@@ -460,7 +461,7 @@ prologue_find_regs (op, fsr, addr)
   /* sub  sp,sp,imm */
   if ((op & OP_MASK_ALL_BUT_IMM) == OP_SUB_SP_IMM)
     {
-      offset = EXTRACT_IMM6(op);
+      offset = EXTRACT_IMM6 (op);
       frame_size += -offset;
       return 1;
     }
@@ -469,8 +470,8 @@ prologue_find_regs (op, fsr, addr)
   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);
+      n = EXTRACT_RA (op);
+      fsr->regs[n] = (-frame_size);
       return 1;
     }
 
@@ -478,16 +479,16 @@ prologue_find_regs (op, fsr, addr)
   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;
+      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);
+      offset = EXTRACT_IMM6 (op);
       fsr->regs[FP_REGNUM] = (offset - frame_size);
       return 1;
     }
@@ -519,30 +520,30 @@ d30v_frame_find_saved_regs (fi, fsr)
   uses_frame = 0;
 
   d30v_frame_find_saved_regs_offsets (fi, fsr);
-  
+
   fi->size = frame_size;
 
   if (!fp)
-    fp = read_register(SP_REGNUM);
+    fp = read_register (SP_REGNUM);
 
-  for (i=0; i<NUM_REGS-1; i++)
+  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);
+    fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4);
   else
-    fi->return_pc = read_register(LR_REGNUM);
-  
+    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;
+       fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size;
       else
        {
          fsr->regs[SP_REGNUM] = fp + fi->size;
@@ -574,8 +575,8 @@ d30v_frame_find_saved_regs_offsets (fi, fsr)
   uses_frame = 0;
   while (pc < fi->pc)
     {
-      opl = (unsigned long)read_memory_integer (pc, 4);
-      opr = (unsigned long)read_memory_integer (pc+4, 4);
+      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);
@@ -589,29 +590,29 @@ d30v_frame_find_saved_regs_offsets (fi, fsr)
          if ((opl & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
            {
              /* add sp,sp,n */
-             long offset = EXTRACT_IMM32(opl, opr);
+             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);
+             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);
+             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);
+             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;
+             fsr->regs[n + 1] = (offset - frame_size) + 4;
            }
          else if ((opl & OP_MASK_ALL_BUT_IMM) == OP_OR_SP_R0_IMM)
            {
@@ -627,42 +628,42 @@ d30v_frame_find_saved_regs_offsets (fi, fsr)
            {
              op2 = opl;
              op1 = opr;
-           } 
-         else 
+           }
+         else
            {
              op1 = opl;
              op2 = opr;
            }
-         if (!prologue_find_regs(op1,fsr,pc) || !prologue_find_regs(op2,fsr,pc))
+         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);
+    fp = read_register (SP_REGNUM);
 
-  for (i=0; i<NUM_REGS-1; i++)
+  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);
+    fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4);
   else
-    fi->return_pc = read_register(LR_REGNUM);
-  
+    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;
+       fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size;
       else
        {
          fsr->regs[SP_REGNUM] = fp + fi->size;
@@ -681,7 +682,7 @@ d30v_init_extra_frame_info (fromleaf, fi)
   struct frame_saved_regs dummy;
 
   if (fi->next && (fi->pc == 0))
-    fi->pc = fi->next->return_pc; 
+    fi->pc = fi->next->return_pc;
 
   d30v_frame_find_saved_regs_offsets (fi, &dummy);
 
@@ -699,10 +700,10 @@ d30v_init_extra_frame_info (fromleaf, fi)
     {
       /* 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);
+      fi->return_pc = read_memory_unsigned_integer (dummy.regs[LR_REGNUM], 4);
     }
   else
-    fi->return_pc = read_register(LR_REGNUM);
+    fi->return_pc = read_register (LR_REGNUM);
 }
 
 void
@@ -744,7 +745,7 @@ d30v_print_register (regnum, tabular)
        {
          printf_filtered ("    ");
          val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
-                gdb_stdout, 'd', 1, 0, Val_pretty_default);
+                    gdb_stdout, 'd', 1, 0, Val_pretty_default);
        }
     }
 }
@@ -896,18 +897,18 @@ d30v_fix_call_dummy (dummyname, start_sp, fun, nargs, args, type, gcc_p)
   char buffer[MAX_REGISTER_RAW_SIZE];
   struct frame_info *frame = get_current_frame ();
   frame->dummy = start_sp;
-  /*start_sp |= DMEM_START;*/
+  /*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));
+      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);
+  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());  
+  write_register (LR_REGNUM, (LONGEST) d30v_call_dummy_address ());
   return sp;
 }
 
@@ -920,10 +921,10 @@ d30v_pop_dummy_frame (fi)
 
   for (regnum = 0; regnum < NUM_REGS; regnum++)
     {
-      sp -= REGISTER_RAW_SIZE(regnum);
-      write_register(regnum, read_memory_unsigned_integer (sp, REGISTER_RAW_SIZE(regnum)));
+      sp -= REGISTER_RAW_SIZE (regnum);
+      write_register (regnum, read_memory_unsigned_integer (sp, REGISTER_RAW_SIZE (regnum)));
     }
-  flush_cached_frames (); /* needed? */
+  flush_cached_frames ();      /* needed? */
 }
 
 
@@ -935,7 +936,7 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
      int struct_return;
      CORE_ADDR struct_addr;
 {
-  int i, len, index=0, regnum=2;
+  int i, len, index = 0, regnum = 2;
   char buffer[4], *contents;
   LONGEST val;
   CORE_ADDR ptrs[10];
@@ -947,7 +948,7 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
       value_ptr arg = args[i];
       struct type *arg_type = check_typedef (VALUE_TYPE (arg));
       len = TYPE_LENGTH (arg_type);
-      contents = VALUE_CONTENTS(arg);
+      contents = VALUE_CONTENTS (arg);
       val = extract_signed_integer (contents, len);
       if (len > 4)
        {
@@ -965,7 +966,7 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
       value_ptr arg = args[i];
       struct type *arg_type = check_typedef (VALUE_TYPE (arg));
       len = TYPE_LENGTH (arg_type);
-      contents = VALUE_CONTENTS(arg);
+      contents = VALUE_CONTENTS (arg);
       if (len > 4)
        {
          /* we need multiple registers */
@@ -982,9 +983,9 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
                  write_register (regnum++, val);
 
                  if (len >= 8)
-                   val = extract_signed_integer (&contents[ndx+4], 4);
+                   val = extract_signed_integer (&contents[ndx + 4], 4);
                  else
-                   val = extract_signed_integer (&contents[ndx+4], len-4);
+                   val = extract_signed_integer (&contents[ndx + 4], len - 4);
                  write_register (regnum++, val);
                }
              else
@@ -992,11 +993,11 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
                  /* 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 */
+                    and start on an 8 byte boundary */
                  if (sp & 7)
-                   sp -= (sp & 7); /* align it */
+                   sp -= (sp & 7);     /* align it */
 
-                 sp -= ((len + 7) & ~7); /* allocate space */
+                 sp -= ((len + 7) & ~7);       /* allocate space */
                  write_memory (sp, &contents[ndx], len);
                  break;
                }
@@ -1004,7 +1005,7 @@ d30v_push_arguments (nargs, args, sp, struct_return, struct_addr)
        }
       else
        {
-         if (regnum < 18 )
+         if (regnum < 18)
            {
              val = extract_signed_integer (contents, len);
              write_register (regnum++, val);
@@ -1113,11 +1114,13 @@ static int trace_display;
 
 static int default_trace_show_source = 1;
 
-struct trace_buffer {
-  int size;
-  short *counts;
-  CORE_ADDR *addrs;
-} trace_data;
+struct trace_buffer
+  {
+    int size;
+    short *counts;
+    CORE_ADDR *addrs;
+  }
+trace_data;
 
 static void
 trace_command (args, from_tty)
@@ -1127,9 +1130,9 @@ trace_command (args, 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));
+    trace_data.counts = (short *) xmalloc (65536 * sizeof (short));
   if (trace_data.addrs == NULL)
-    trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof(CORE_ADDR));
+    trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof (CORE_ADDR));
 
   tracing = 1;
 
@@ -1213,7 +1216,7 @@ d30v_eva_get_trace_data ()
   if (!tracing)
     return;
 
-  tmpspace = xmalloc (65536 * sizeof(unsigned int));
+  tmpspace = xmalloc (65536 * sizeof (unsigned int));
 
   last_trace = read_memory_unsigned_integer (DBBC_ADDR, 2) << 2;
 
@@ -1307,7 +1310,7 @@ display_trace (low, high)
   CORE_ADDR next_address;
 
   trace_show_source = default_trace_show_source;
-  if (!have_full_symbols () && !have_partial_symbols())
+  if (!have_full_symbols () && !have_partial_symbols ())
     {
       trace_show_source = 0;
       printf_filtered ("No symbol table is loaded.  Use the \"file\" command.\n");
@@ -1319,7 +1322,7 @@ display_trace (low, high)
   for (i = low; i < high; ++i)
     {
       next_address = trace_data.addrs[i];
-      count = trace_data.counts[i]; 
+      count = trace_data.counts[i];
       while (count-- > 0)
        {
          QUIT;
@@ -1341,7 +1344,7 @@ display_trace (low, high)
                  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));
+                                local_hex_string ((unsigned long) sal.pc));
                  suppress = 1;
                }
            }
@@ -1374,7 +1377,7 @@ _initialize_d30v_tdep ()
           "Enable tracing of instruction execution.");
 
   add_com ("untrace", class_support, untrace_command,
-          "Disable tracing of instruction execution.");
+          "Disable tracing of instruction execution.");
 
   add_com ("tdisassemble", class_vars, tdisassemble_command,
           "Disassemble the trace buffer.\n\
@@ -1385,12 +1388,12 @@ as reported by info trace (NOT addresses!).");
            "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),
+                                 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),
+                          var_integer, (char *) &default_trace_show_source,
+                     "Set display of source code with trace.\n", &setlist),
                     &showlist);
 
-} 
+}
index 494bd4465a13724807d36a703a7bf21f04705f0b..6b9787f4d4a77f589e75e5b4a4164a1cd6dc5743 100644 (file)
@@ -3,21 +3,22 @@
 
    Written by Stan Shebs of Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* dBUG is a monitor supplied on various Motorola boards, including
    m68k, ColdFire, and PowerPC-based designs.  The code here assumes
@@ -86,62 +87,63 @@ static char *dbug_regnames[NUM_REGS] =
   /* no float registers */
 };
 static struct target_ops dbug_ops;
-static struct monitor_ops dbug_cmds ;
+static struct monitor_ops dbug_cmds;
 
-static char *dbug_inits[] = {"\r", NULL};
+static char *dbug_inits[] =
+{"\r", NULL};
 
 
-static void 
-init_dbug_cmds(void)
+static void
+init_dbug_cmds (void)
 {
-  dbug_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR;
-  dbug_cmds.init =   dbug_inits;                       /* Init strings */
-  dbug_cmds.cont =   "go\r";                   /* continue command */
-  dbug_cmds.step =   "trace\r";                        /* single step */
-  dbug_cmds.stop =   NULL;                             /* interrupt command */
-  dbug_cmds.set_break =   "br %x\r";                   /* set a breakpoint */
-  dbug_cmds.clr_break =   "br -r %x\r";                        /* clear a breakpoint */
-  dbug_cmds.clr_all_break =   "br -r\r";                       /* clear all breakpoints */
-  dbug_cmds.fill =   "bf.b %x %x %x\r";                /* fill (start end val) */
-  dbug_cmds.setmem.cmdb =     "mm.b %x %x\r";          /* setmem.cmdb (addr, value) */
-  dbug_cmds.setmem.cmdw =     "mm.w %x %x\r";          /* setmem.cmdw (addr, value) */
-  dbug_cmds.setmem.cmdl =     "mm.l %x %x\r";          /* setmem.cmdl (addr, value) */
-  dbug_cmds.setmem.cmdll =     NULL;                   /* setmem.cmdll (addr, value) */
-  dbug_cmds.setmem.resp_delim =     NULL;                      /* setmem.resp_delim */
-  dbug_cmds.setmem.term =     NULL;                    /* setmem.term */
-  dbug_cmds.setmem.term_cmd =     NULL;                        /* setmem.term_cmd */
-  dbug_cmds.getmem.cmdb =     "md.b %x %x\r";          /* getmem.cmdb (addr, addr2) */
-  dbug_cmds.getmem.cmdw =     "md.w %x %x\r";          /* getmem.cmdw (addr, addr2) */
-  dbug_cmds.getmem.cmdl =     "md.l %x %x\r";          /* getmem.cmdl (addr, addr2) */
-  dbug_cmds.getmem.cmdll =     NULL;                   /* getmem.cmdll (addr, addr2) */
-  dbug_cmds.getmem.resp_delim =     ":";                       /* getmem.resp_delim */
-  dbug_cmds.getmem.term =     NULL;                    /* getmem.term */
-  dbug_cmds.getmem.term_cmd =     NULL;                        /* getmem.term_cmd */
-  dbug_cmds.setreg.cmd =     "rm %s %x\r";             /* setreg.cmd (name, value) */
-  dbug_cmds.setreg.resp_delim =     NULL;                      /* setreg.resp_delim */
-  dbug_cmds.setreg.term =     NULL;                    /* setreg.term */
-  dbug_cmds.setreg.term_cmd =     NULL;                        /* setreg.term_cmd */
-  dbug_cmds.getreg.cmd =     "rd %s\r";                        /* getreg.cmd (name) */
-  dbug_cmds.getreg.resp_delim =     ":";                       /* getreg.resp_delim */
-  dbug_cmds.getreg.term =     NULL;                    /* getreg.term */
-  dbug_cmds.getreg.term_cmd =     NULL;                        /* getreg.term_cmd */
-  dbug_cmds.dump_registers =   "rd\r";                 /* dump_registers */
-  dbug_cmds.register_pattern =   "\\(\\w+\\) +:\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
-  dbug_cmds.supply_register =   dbug_supply_register;          /* supply_register */
-  dbug_cmds.load_routine =   NULL;                             /* load_routine (defaults to SRECs) */
-  dbug_cmds.load =   "dl\r";                   /* download command */
-  dbug_cmds.loadresp =   "\n";                         /* load response */
-  dbug_cmds.prompt =   "dBUG>";                        /* monitor command prompt */
-  dbug_cmds.line_term =   "\r";                                /* end-of-line terminator */
-  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.magic =   MONITOR_OPS_MAGIC        ;       /* magic */
-} /* init_debug_ops */
+  dbug_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR;
+  dbug_cmds.init = dbug_inits; /* Init strings */
+  dbug_cmds.cont = "go\r";     /* continue command */
+  dbug_cmds.step = "trace\r";  /* single step */
+  dbug_cmds.stop = NULL;       /* interrupt command */
+  dbug_cmds.set_break = "br %x\r";     /* set a breakpoint */
+  dbug_cmds.clr_break = "br -r %x\r";  /* clear a breakpoint */
+  dbug_cmds.clr_all_break = "br -r\r"; /* clear all breakpoints */
+  dbug_cmds.fill = "bf.b %x %x %x\r";  /* fill (start end val) */
+  dbug_cmds.setmem.cmdb = "mm.b %x %x\r";      /* setmem.cmdb (addr, value) */
+  dbug_cmds.setmem.cmdw = "mm.w %x %x\r";      /* setmem.cmdw (addr, value) */
+  dbug_cmds.setmem.cmdl = "mm.l %x %x\r";      /* setmem.cmdl (addr, value) */
+  dbug_cmds.setmem.cmdll = NULL;       /* setmem.cmdll (addr, value) */
+  dbug_cmds.setmem.resp_delim = NULL;  /* setmem.resp_delim */
+  dbug_cmds.setmem.term = NULL;        /* setmem.term */
+  dbug_cmds.setmem.term_cmd = NULL;    /* setmem.term_cmd */
+  dbug_cmds.getmem.cmdb = "md.b %x %x\r";      /* getmem.cmdb (addr, addr2) */
+  dbug_cmds.getmem.cmdw = "md.w %x %x\r";      /* getmem.cmdw (addr, addr2) */
+  dbug_cmds.getmem.cmdl = "md.l %x %x\r";      /* getmem.cmdl (addr, addr2) */
+  dbug_cmds.getmem.cmdll = NULL;       /* getmem.cmdll (addr, addr2) */
+  dbug_cmds.getmem.resp_delim = ":";   /* getmem.resp_delim */
+  dbug_cmds.getmem.term = NULL;        /* getmem.term */
+  dbug_cmds.getmem.term_cmd = NULL;    /* getmem.term_cmd */
+  dbug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */
+  dbug_cmds.setreg.resp_delim = NULL;  /* setreg.resp_delim */
+  dbug_cmds.setreg.term = NULL;        /* setreg.term */
+  dbug_cmds.setreg.term_cmd = NULL;    /* setreg.term_cmd */
+  dbug_cmds.getreg.cmd = "rd %s\r";    /* getreg.cmd (name) */
+  dbug_cmds.getreg.resp_delim = ":";   /* getreg.resp_delim */
+  dbug_cmds.getreg.term = NULL;        /* getreg.term */
+  dbug_cmds.getreg.term_cmd = NULL;    /* getreg.term_cmd */
+  dbug_cmds.dump_registers = "rd\r";   /* dump_registers */
+  dbug_cmds.register_pattern = "\\(\\w+\\) +:\\([0-9a-fA-F]+\\b\\)";   /* register_pattern */
+  dbug_cmds.supply_register = dbug_supply_register;    /* supply_register */
+  dbug_cmds.load_routine = NULL;       /* load_routine (defaults to SRECs) */
+  dbug_cmds.load = "dl\r";     /* download command */
+  dbug_cmds.loadresp = "\n";   /* load response */
+  dbug_cmds.prompt = "dBUG>";  /* monitor command prompt */
+  dbug_cmds.line_term = "\r";  /* end-of-line terminator */
+  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.magic = MONITOR_OPS_MAGIC; /* magic */
+}                              /* init_debug_ops */
 
 static void
-dbug_open(args, from_tty)
+dbug_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -151,7 +153,7 @@ dbug_open(args, from_tty)
 void
 _initialize_dbug_rom ()
 {
-  init_dbug_cmds() ;
+  init_dbug_cmds ();
   init_monitor_ops (&dbug_ops);
 
   dbug_ops.to_shortname = "dbug";
index e61bef926cdbc0bd0a081a4791c97570d6732e48..285d1548d843be6282d62afcae52ab520937023b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module provides three functions: dbx_symfile_init,
    which initializes to read a symbol file; dbx_new_init, which 
@@ -48,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "command.h"
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
-#include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
+#include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
 #include "symfile.h"
 #include "objfiles.h"
 #include "buildsym.h"
@@ -60,8 +61,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"     /* We always use GNU stabs, not native, now */
-
 \f
+
 /* This macro returns the size field of a minimal symbol, which is normally
    stored in the "info" field.  The macro can be overridden for specific
    targets (e.g. MIPS16) that use the info field for other purposes.  */
@@ -73,32 +74,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.  */
 
-struct symloc {
+struct symloc
+  {
 
-  /* Offset within the file symbol table of first local symbol for this
-     file.  */
+    /* Offset within the file symbol table of first local symbol for this
+       file.  */
 
-  int ldsymoff;
+    int ldsymoff;
 
-  /* Length (in bytes) 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).  If ldsymlen is 0, the only
-     reason for this thing's existence is the dependency list.  Nothing
-     else will happen when it is read in.  */
+    /* Length (in bytes) 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).  If ldsymlen is 0, the only
+       reason for this thing's existence is the dependency list.  Nothing
+       else will happen when it is read in.  */
 
-  int ldsymlen;
+    int ldsymlen;
 
-  /* The size of each symbol in the symbol file (in external form).  */
+    /* The size of each symbol in the symbol file (in external form).  */
 
-  int symbol_size;
+    int symbol_size;
 
-  /* Further information needed to locate the symbols if they are in
-     an ELF file.  */
+    /* Further information needed to locate the symbols if they are in
+       an ELF file.  */
 
-  int symbol_offset;
-  int string_offset;
-  int file_string_offset;
-};
+    int symbol_offset;
+    int string_offset;
+    int file_string_offset;
+  };
 
 #define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
 #define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
@@ -107,8 +109,8 @@ struct symloc {
 #define SYMBOL_OFFSET(p) (SYMLOC(p)->symbol_offset)
 #define STRING_OFFSET(p) (SYMLOC(p)->string_offset)
 #define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
-
 \f
+
 /* Remember what we deduced to be the source language of this psymtab. */
 
 static enum language psymtab_language = language_unknown;
@@ -170,32 +172,32 @@ static int has_line_numbers;
 
 /* Complaints about the symbols we have encountered.  */
 
-struct complaint lbrac_complaint = 
-  {"bad block start address patched", 0, 0};
+struct complaint lbrac_complaint =
+{"bad block start address patched", 0, 0};
 
 struct complaint string_table_offset_complaint =
-  {"bad string table offset in symbol %d", 0, 0};
+{"bad string table offset in symbol %d", 0, 0};
 
 struct complaint unknown_symtype_complaint =
-  {"unknown symbol type %s", 0, 0};
+{"unknown symbol type %s", 0, 0};
 
 struct complaint unknown_symchar_complaint =
-  {"unknown symbol descriptor `%c'", 0, 0};
+{"unknown symbol descriptor `%c'", 0, 0};
 
 struct complaint lbrac_rbrac_complaint =
-  {"block start larger than block end", 0, 0};
+{"block start larger than block end", 0, 0};
 
 struct complaint lbrac_unmatched_complaint =
-  {"unmatched N_LBRAC before symtab pos %d", 0, 0};
+{"unmatched N_LBRAC before symtab pos %d", 0, 0};
 
 struct complaint lbrac_mismatch_complaint =
-  {"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
+{"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
 
 struct complaint repeated_header_complaint =
-  {"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
+{"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
 
 struct complaint unclaimed_bincl_complaint =
-  {"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
+{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
 \f
 /* find_text_range --- find start and end of loadable code sections
 
@@ -207,12 +209,12 @@ struct complaint unclaimed_bincl_complaint =
    table, in some cases.  */
 
 static void
-find_text_range (bfd *sym_bfd, struct objfile *objfile)
+find_text_range (bfd * sym_bfd, struct objfile *objfile)
 {
   asection *sec;
   int found_any = 0;
   CORE_ADDR start, end;
-  
+
   for (sec = sym_bfd->sections; sec; sec = sec->next)
     if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
       {
@@ -221,8 +223,10 @@ find_text_range (bfd *sym_bfd, struct objfile *objfile)
 
        if (found_any)
          {
-           if (sec_start < start) start = sec_start;
-           if (sec_end > end) end = sec_end;
+           if (sec_start < start)
+             start = sec_start;
+           if (sec_end > end)
+             end = sec_end;
          }
        else
          {
@@ -233,15 +237,15 @@ find_text_range (bfd *sym_bfd, struct objfile *objfile)
        found_any = 1;
       }
 
-  if (! found_any)
+  if (!found_any)
     error ("Can't find any code sections in symbol file");
 
   DBX_TEXT_ADDR (objfile) = start;
   DBX_TEXT_SIZE (objfile) = end - start;
 }
+\f
 
 
-\f
 /* During initial symbol readin, we need to have a structure to keep
    track of which psymtabs have which bincls in them.  This structure
    is used during readin to setup the list of dependencies within each
@@ -263,7 +267,7 @@ static int bincls_allocated;
 
 extern void _initialize_dbxread PARAMS ((void));
 
-static void 
+static void
 process_now PARAMS ((struct objfile *));
 
 static void
@@ -283,7 +287,7 @@ dbx_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
 
 static void
 read_dbx_dynamic_symtab PARAMS ((struct section_offsets *,
-                                struct objfile *objfile));
+                                struct objfile * objfile));
 
 static void
 read_dbx_symtab PARAMS ((struct section_offsets *, struct objfile *,
@@ -293,7 +297,7 @@ static void
 free_bincl_list PARAMS ((struct objfile *));
 
 static struct partial_symtab *
-find_corresponding_bincl_psymtab PARAMS ((char *, int));
+  find_corresponding_bincl_psymtab PARAMS ((char *, int));
 
 static void
 add_bincl_to_list PARAMS ((struct partial_symtab *, char *, int));
@@ -302,7 +306,7 @@ static void
 init_bincl_list PARAMS ((int, struct objfile *));
 
 static char *
-dbx_next_symbol_text PARAMS ((struct objfile *));
+  dbx_next_symbol_text PARAMS ((struct objfile *));
 
 static void
 fill_symbuf PARAMS ((bfd *));
@@ -338,7 +342,7 @@ free_header_files ()
 {
   if (this_object_header_files)
     {
-      free ((PTR)this_object_header_files);
+      free ((PTR) this_object_header_files);
       this_object_header_files = NULL;
     }
   n_allocated_this_object_header_files = 0;
@@ -365,7 +369,7 @@ add_this_object_header_file (i)
       n_allocated_this_object_header_files *= 2;
       this_object_header_files
        = (int *) xrealloc ((char *) this_object_header_files,
-                           n_allocated_this_object_header_files * sizeof (int));
+                      n_allocated_this_object_header_files * sizeof (int));
     }
 
   this_object_header_files[n_this_object_header_files++] = i;
@@ -438,7 +442,7 @@ add_new_header_file (name, instance)
 
   i = N_HEADER_FILES (current_objfile)++;
   hfile = HEADER_FILES (current_objfile) + i;
-  hfile->name = savestring (name, strlen(name));
+  hfile->name = savestring (name, strlen (name));
   hfile->instance = instance;
   hfile->length = 10;
   hfile->vector
@@ -461,7 +465,7 @@ explicit_lookup_type (real_filenum, index)
       f->vector = (struct type **)
        xrealloc (f->vector, f->length * sizeof (struct type *));
       memset (&f->vector[f->length / 2],
-            '\0', f->length * sizeof (struct type *) / 2);
+             '\0', f->length * sizeof (struct type *) / 2);
     }
   return &f->vector[index];
 }
@@ -508,8 +512,8 @@ record_minimal_symbol (name, address, type, objfile)
       break;
     case N_SETV:
       /* I don't think this type actually exists; since a N_SETV is the result
-        of going over many .o files, it doesn't make sense to have one
-        file local.  */
+         of going over many .o files, it doesn't make sense to have one
+         file local.  */
       ms_type = mst_file_data;
       section = SECT_OFF_DATA;
       bfd_section = DBX_DATA_SECTION (objfile);
@@ -527,9 +531,9 @@ record_minimal_symbol (name, address, type, objfile)
       ms_type = mst_file_data;
 
       /* Check for __DYNAMIC, which is used by Sun shared libraries. 
-        Record it as global even if it's local, not global, so
-        lookup_minimal_symbol can find it.  We don't check symbol_leading_char
-        because for SunOS4 it always is '_'.  */
+         Record it as global even if it's local, not global, so
+         lookup_minimal_symbol can find it.  We don't check symbol_leading_char
+         because for SunOS4 it always is '_'.  */
       if (name[8] == 'C' && STREQ ("__DYNAMIC", name))
        ms_type = mst_data;
 
@@ -554,7 +558,7 @@ record_minimal_symbol (name, address, type, objfile)
       section = -1;
       bfd_section = NULL;
       break;
-  }
+    }
 
   if ((ms_type == mst_file_text || ms_type == mst_text)
       && address < lowest_text_address)
@@ -578,7 +582,7 @@ static void
 dbx_symfile_read (objfile, section_offsets, mainline)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
-     int mainline;     /* FIXME comments above */
+     int mainline;             /* FIXME comments above */
 {
   bfd *sym_bfd;
   int val;
@@ -670,7 +674,7 @@ dbx_new_init (ignore)
    be called unless this is an a.out (or very similar) file. 
    FIXME, there should be a cleaner peephole into the BFD environment here.  */
 
-#define DBX_STRINGTAB_SIZE_SIZE sizeof(long)   /* FIXME */
+#define DBX_STRINGTAB_SIZE_SIZE sizeof(long)   /* FIXME */
 
 static void
 dbx_symfile_init (objfile)
@@ -684,7 +688,7 @@ dbx_symfile_init (objfile)
 
   /* Allocate struct to keep track of the symfile */
   objfile->sym_stab_info = (struct dbx_symfile_info *)
-    xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
+    xmmalloc (objfile->md, sizeof (struct dbx_symfile_info));
   memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
 
   DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
@@ -698,7 +702,7 @@ dbx_symfile_init (objfile)
   /* FIXME POKING INSIDE BFD DATA STRUCTURES */
 
   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 symbol file");
@@ -726,8 +730,8 @@ dbx_symfile_init (objfile)
   if (STRING_TABLE_OFFSET == 0)
     {
       /* It appears that with the existing bfd code, STRING_TABLE_OFFSET
-        will never be zero, even when there is no string table.  This
-        would appear to be a bug in bfd. */
+         will never be zero, even when there is no string table.  This
+         would appear to be a bug in bfd. */
       DBX_STRINGTAB_SIZE (objfile) = 0;
       DBX_STRINGTAB (objfile) = NULL;
     }
@@ -736,7 +740,7 @@ dbx_symfile_init (objfile)
       val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET);
       if (val < 0)
        perror_with_name (name);
-      
+
       memset ((PTR) size_temp, 0, sizeof (size_temp));
       val = bfd_read ((PTR) size_temp, sizeof (size_temp), 1, sym_bfd);
       if (val < 0)
@@ -761,19 +765,19 @@ dbx_symfile_init (objfile)
             bfd can't tell us there is no string table, the sanity checks may
             or may not catch this. */
          DBX_STRINGTAB_SIZE (objfile) = bfd_h_get_32 (sym_bfd, size_temp);
-         
+
          if (DBX_STRINGTAB_SIZE (objfile) < sizeof (size_temp)
              || DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
            error ("ridiculous string table size (%d bytes).",
                   DBX_STRINGTAB_SIZE (objfile));
-         
+
          DBX_STRINGTAB (objfile) =
-           (char *) obstack_alloc (&objfile -> psymbol_obstack,
+           (char *) obstack_alloc (&objfile->psymbol_obstack,
                                    DBX_STRINGTAB_SIZE (objfile));
          OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile));
-         
+
          /* Now read in the string table in one big gulp.  */
-         
+
          val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET);
          if (val < 0)
            perror_with_name (name);
@@ -803,17 +807,17 @@ dbx_symfile_finish (objfile)
 
          while (--i >= 0)
            {
-             free (hfiles [i].name);
-             free (hfiles [i].vector);
+             free (hfiles[i].name);
+             free (hfiles[i].vector);
            }
          free ((PTR) hfiles);
        }
-      mfree (objfile -> md, objfile->sym_stab_info);
+      mfree (objfile->md, objfile->sym_stab_info);
     }
   free_header_files ();
 }
-
 \f
+
 /* Buffer for reading the symbol table entries.  */
 static struct external_nlist symbuf[4096];
 static int symbuf_idx;
@@ -822,11 +826,11 @@ static int symbuf_end;
 /* cont_elem is used for continuing information in cfront.
    It saves information about which types need to be fixed up and 
    completed after all the stabs are read.  */
-struct cont_elem 
+struct cont_elem
   {
     /* sym and stabsstring for continuing information in cfront */
-    struct symbol * sym;
-    char * stabs;
+    struct symbol *sym;
+    char *stabs;
     /* state dependancies (statics that must be preserved) */
     int sym_idx;
     int sym_end;
@@ -834,11 +838,11 @@ struct cont_elem
     int (*func) PARAMS ((struct objfile *, struct symbol *, char *));
     /* other state dependancies include:
        (assumption is that these will not change since process_now FIXME!!)
-        stringtab_global
-        n_stabs
-        objfile
-        symfile_bfd */
-};
+       stringtab_global
+       n_stabs
+       objfile
+       symfile_bfd */
+  };
 
 static struct cont_elem *cont_list = 0;
 static int cont_limit = 0;
@@ -846,24 +850,24 @@ static int cont_count = 0;
 
 /* Arrange for function F to be called with arguments SYM and P later
    in the stabs reading process.  */
-void 
+void
 process_later (sym, p, f)
-  struct symbol *sym;
-  char *p;
-  int (*f) PARAMS ((struct objfile *, struct symbol *, char *));
+     struct symbol *sym;
+     char *p;
+     int (*f) PARAMS ((struct objfile *, struct symbol *, char *));
 {
 
   /* Allocate more space for the deferred list.  */
   if (cont_count >= cont_limit - 1)
     {
-      cont_limit += 32;        /* chunk size */
+      cont_limit += 32;                /* chunk size */
 
       cont_list
-       = (struct cont_elem *) xrealloc (cont_list, 
-                                         (cont_limit
-                                          * sizeof (struct cont_elem)));
+       = (struct cont_elem *) xrealloc (cont_list,
+                                        (cont_limit
+                                         * sizeof (struct cont_elem)));
       if (!cont_list)
-        error ("Virtual memory exhausted\n");
+       error ("Virtual memory exhausted\n");
     }
 
   /* Save state variables so we can process these stabs later.  */
@@ -878,9 +882,9 @@ process_later (sym, p, f)
 
 /* Call deferred funtions in CONT_LIST.  */
 
-static void 
-process_now (objfile) 
-  struct objfile *objfile;
+static void
+process_now (objfile)
+     struct objfile *objfile;
 {
   int i;
   int save_symbuf_idx;
@@ -902,8 +906,8 @@ process_now (objfile)
     {
       /* Restore the state for this deferred stab.  */
       symbuf_idx = cont_list[i].sym_idx;
-      symbuf_end = cont_list[i].sym_end;  
-      symnum = cont_list[i].symnum;  
+      symbuf_end = cont_list[i].sym_end;
+      symnum = cont_list[i].symnum;
       sym = cont_list[i].sym;
       stabs = cont_list[i].stabs;
       func = cont_list[i].func;
@@ -974,7 +978,7 @@ fill_symbuf (sym_bfd)
        count = sizeof (symbuf);
     }
 
-  nbytes = bfd_read ((PTR)symbuf, count, 1, sym_bfd);
+  nbytes = bfd_read ((PTR) symbuf, count, 1, sym_bfd);
   if (nbytes < 0)
     perror_with_name (bfd_get_filename (sym_bfd));
   else if (nbytes == 0)
@@ -1022,7 +1026,7 @@ dbx_next_symbol_text (objfile)
     fill_symbuf (symfile_bfd);
 
   symnum++;
-  INTERNALIZE_SYMBOL(nlist, &symbuf[symbuf_idx], symfile_bfd);
+  INTERNALIZE_SYMBOL (nlist, &symbuf[symbuf_idx], symfile_bfd);
   OBJSTAT (objfile, n_stabs++);
 
   symbuf_idx++;
@@ -1040,7 +1044,7 @@ init_bincl_list (number, objfile)
 {
   bincls_allocated = number;
   next_bincl = bincl_list = (struct header_file_location *)
-    xmmalloc (objfile -> md, bincls_allocated * sizeof(struct header_file_location));
+    xmmalloc (objfile->md, bincls_allocated * sizeof (struct header_file_location));
 }
 
 /* Add a bincl to the list.  */
@@ -1056,8 +1060,8 @@ add_bincl_to_list (pst, name, instance)
       int offset = next_bincl - bincl_list;
       bincls_allocated *= 2;
       bincl_list = (struct header_file_location *)
-       xmrealloc (pst->objfile->md, (char *)bincl_list,
-                 bincls_allocated * sizeof (struct header_file_location));
+       xmrealloc (pst->objfile->md, (char *) bincl_list,
+                  bincls_allocated * sizeof (struct header_file_location));
       next_bincl = bincl_list + offset;
     }
   next_bincl->pst = pst;
@@ -1091,7 +1095,7 @@ static void
 free_bincl_list (objfile)
      struct objfile *objfile;
 {
-  mfree (objfile -> md, (PTR)bincl_list);
+  mfree (objfile->md, (PTR) bincl_list);
   bincls_allocated = 0;
 }
 
@@ -1193,7 +1197,7 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
       do_cleanups (back_to);
       return;
     }
-  
+
   dynrels = (arelent **) xmalloc (dynrel_size);
   make_cleanup (free, dynrels);
 
@@ -1210,7 +1214,7 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
     {
       arelent *rel = *relptr;
       CORE_ADDR address =
-       rel->address + ANOFFSET (section_offsets, SECT_OFF_DATA);
+      rel->address + ANOFFSET (section_offsets, SECT_OFF_DATA);
 
       switch (bfd_get_arch (abfd))
        {
@@ -1283,7 +1287,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
   next_file_string_table_offset = 0;
 
   stringtab_global = DBX_STRINGTAB (objfile);
-  
+
   pst = (struct partial_symtab *) 0;
 
   includes_allocated = 30;
@@ -1303,7 +1307,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
 
   last_source_file = NULL;
 
-  lowest_text_address = (CORE_ADDR)-1;
+  lowest_text_address = (CORE_ADDR) - 1;
 
   symfile_bfd = objfile->obfd; /* For next_text_symbol */
   abfd = objfile->obfd;
@@ -1315,7 +1319,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
   for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
     {
       /* Get the symbol for this run and pull out some info */
-      QUIT;    /* allow this to be interruptable */
+      QUIT;                    /* allow this to be interruptable */
       if (symbuf_idx == symbuf_end)
        fill_symbuf (abfd);
       bufp = &symbuf[symbuf_idx++];
@@ -1337,13 +1341,13 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
          like duplicating code, I will do my penance here, and
          describe the code which is duplicated:
 
-        *) The assignment to namestring.
-        *) The call to strchr.
-        *) The addition of a partial symbol the the two partial
-           symbol lists.  This last is a large section of code, so
-           I've imbedded it in the following macro.
-        */
-      
+         *) The assignment to namestring.
+         *) The call to strchr.
+         *) The addition of a partial symbol the the two partial
+         symbol lists.  This last is a large section of code, so
+         I've imbedded it in the following macro.
+       */
+
 /* Set namestring based on nlist.  If the string table index is invalid, 
    give a fake name, and print a single error message per symbol file read,
    rather than abort the symbol reading or flood the user with messages.  */
@@ -1371,24 +1375,24 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
     }
 
   /* If there's stuff to be cleaned up, clean it up.  */
-  if (DBX_SYMCOUNT (objfile) > 0                       /* We have some syms */
+  if (DBX_SYMCOUNT (objfile) > 0       /* We have some syms */
 /*FIXME, does this have a bug at start address 0? */
       && last_o_file_start
-      && objfile -> ei.entry_point < nlist.n_value
-      && objfile -> ei.entry_point >= last_o_file_start)
+      && objfile->ei.entry_point < nlist.n_value
+      && objfile->ei.entry_point >= last_o_file_start)
     {
-      objfile -> ei.entry_file_lowpc = last_o_file_start;
-      objfile -> ei.entry_file_highpc = nlist.n_value;
+      objfile->ei.entry_file_lowpc = last_o_file_start;
+      objfile->ei.entry_file_highpc = nlist.n_value;
     }
 
   if (pst)
     {
       /* Don't set pst->texthigh lower than it already is.  */
       CORE_ADDR text_end =
-       (lowest_text_address == (CORE_ADDR)-1
-        ? (text_addr + section_offsets->offsets[SECT_OFF_TEXT])
-        : lowest_text_address)
-       + text_size;
+      (lowest_text_address == (CORE_ADDR) - 1
+       ? (text_addr + section_offsets->offsets[SECT_OFF_TEXT])
+       : lowest_text_address)
+      + text_size;
 
       end_psymtab (pst, psymtab_include_list, includes_used,
                   symnum * symbol_size,
@@ -1419,17 +1423,17 @@ start_psymtab (objfile, section_offsets,
      struct partial_symbol **static_syms;
 {
   struct partial_symtab *result =
-      start_psymtab_common(objfile, section_offsets,
-                          filename, textlow, global_syms, static_syms);
+  start_psymtab_common (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;
+    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+  LDSYMOFF (result) = ldsymoff;
   result->read_symtab = dbx_psymtab_to_symtab;
-  SYMBOL_SIZE(result) = symbol_size;
-  SYMBOL_OFFSET(result) = symbol_table_offset;
-  STRING_OFFSET(result) = string_table_offset;
-  FILE_STRING_OFFSET(result) = file_string_table_offset;
+  SYMBOL_SIZE (result) = symbol_size;
+  SYMBOL_OFFSET (result) = symbol_table_offset;
+  STRING_OFFSET (result) = string_table_offset;
+  FILE_STRING_OFFSET (result) = file_string_table_offset;
 
   /* If we're handling an ELF file, drag some section-relocation info
      for this source file out of the ELF symbol table, to compensate for
@@ -1450,7 +1454,7 @@ start_psymtab (objfile, section_offsets,
 
 struct partial_symtab *
 end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
-            capping_text, dependency_list, number_dependencies, textlow_not_set)
+       capping_text, dependency_list, number_dependencies, textlow_not_set)
      struct partial_symtab *pst;
      char **include_list;
      int num_includes;
@@ -1461,10 +1465,10 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
      int textlow_not_set;
 {
   int i;
-  struct objfile *objfile = pst -> objfile;
+  struct objfile *objfile = pst->objfile;
 
   if (capping_symbol_offset != -1)
-    LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
+    LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
   pst->texthigh = capping_text;
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -1496,7 +1500,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
       p = alloca (n + 2);
       strncpy (p, last_function_name, n);
       p[n] = 0;
-    
+
       minsym = lookup_minimal_symbol (p, pst->filename, objfile);
       if (minsym == NULL)
        {
@@ -1522,21 +1526,21 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
       struct partial_symtab *p1;
 
       /* 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.  */
+         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.  */
 
       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;
-           }
-       }
+      {
+       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.  */
@@ -1552,9 +1556,9 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
     {
       pst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+                   number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
-            number_dependencies * sizeof (struct partial_symtab *));
+             number_dependencies * sizeof (struct partial_symtab *));
     }
   else
     pst->dependencies = 0;
@@ -1562,19 +1566,19 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
   for (i = 0; i < num_includes; i++)
     {
       struct partial_symtab *subpst =
-       allocate_psymtab (include_list[i], objfile);
+      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) =
-       LDSYMLEN(subpst) =
-         subpst->textlow =
-           subpst->texthigh = 0;
+       (char *) obstack_alloc (&objfile->psymbol_obstack,
+                               sizeof (struct symloc));
+      LDSYMOFF (subpst) =
+       LDSYMLEN (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.  */
+         shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
                       sizeof (struct partial_symtab *));
@@ -1583,8 +1587,8 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
 
       subpst->globals_offset =
        subpst->n_global_syms =
-         subpst->statics_offset =
-           subpst->n_static_syms = 0;
+       subpst->statics_offset =
+       subpst->n_static_syms = 0;
 
       subpst->readin = 0;
       subpst->symtab = 0;
@@ -1605,17 +1609,17 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
       && has_line_numbers == 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.  */
+         it is on the obstack, but we can forget to chain it on the list.  */
       /* Empty psymtabs happen as a result of header files which don't have
-        any symbols in them.  There can be a lot of them.  But this check
-        is wrong, in that a psymtab with N_SLINE entries but nothing else
-        is not empty, but we don't realize that.  Fixing that without slowing
-        things down might be tricky.  */
+         any symbols in them.  There can be a lot of them.  But this check
+         is wrong, in that a psymtab with N_SLINE entries but nothing else
+         is not empty, but we don't realize that.  Fixing that without slowing
+         things down might be tricky.  */
 
       discard_psymtab (pst);
 
       /* Indicate that psymtab was thrown away.  */
-      pst = (struct partial_symtab *)NULL;
+      pst = (struct partial_symtab *) NULL;
     }
   return pst;
 }
@@ -1626,14 +1630,14 @@ dbx_psymtab_to_symtab_1 (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);
+                         pst->filename);
       return;
     }
 
@@ -1649,13 +1653,13 @@ dbx_psymtab_to_symtab_1 (pst)
            fputs_filtered ("and ", gdb_stdout);
            wrap_here ("");
            printf_filtered ("%s...", pst->dependencies[i]->filename);
-           wrap_here ("");             /* Flush output */
+           wrap_here ("");     /* Flush output */
            gdb_flush (gdb_stdout);
          }
        dbx_psymtab_to_symtab_1 (pst->dependencies[i]);
       }
 
-  if (LDSYMLEN(pst))           /* Otherwise it's a dummy */
+  if (LDSYMLEN (pst))          /* Otherwise it's a dummy */
     {
       /* Init stuff necessary for reading in symbols */
       stabsread_init ();
@@ -1690,14 +1694,14 @@ dbx_psymtab_to_symtab (pst)
   if (pst->readin)
     {
       fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in.  Shouldn't happen.\n",
-              pst->filename);
+                         pst->filename);
       return;
     }
 
-  if (LDSYMLEN(pst) || pst->number_of_dependencies)
+  if (LDSYMLEN (pst) || pst->number_of_dependencies)
     {
       /* Print the message now, before reading the string table,
-        to avoid disconcerting pauses.  */
+         to avoid disconcerting pauses.  */
       if (info_verbose)
        {
          printf_filtered ("Reading in symbols for %s...", pst->filename);
@@ -1721,7 +1725,7 @@ dbx_psymtab_to_symtab (pst)
 }
 
 /* Read in a defined section of a specific object file's symbols. */
-  
+
 static void
 read_ofile_symtab (pst)
      struct partial_symtab *pst;
@@ -1740,8 +1744,8 @@ read_ofile_symtab (pst)
   struct section_offsets *section_offsets;
 
   objfile = pst->objfile;
-  sym_offset = LDSYMOFF(pst);
-  sym_size = LDSYMLEN(pst);
+  sym_offset = LDSYMOFF (pst);
+  sym_size = LDSYMLEN (pst);
   text_offset = pst->textlow;
   text_size = pst->texthigh - pst->textlow;
   section_offsets = pst->section_offsets;
@@ -1762,7 +1766,7 @@ read_ofile_symtab (pst)
 
      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)
+  if (!processing_acc_compilation && sym_offset >= (int) symbol_size)
     {
       bfd_seek (symfile_bfd, sym_offset - symbol_size, SEEK_CUR);
       fill_symbuf (abfd);
@@ -1788,7 +1792,7 @@ read_ofile_symtab (pst)
        }
 
       /* Try to select a C++ demangling based on the compilation unit
-        producer. */
+         producer. */
 
       if (processing_gcc_compilation)
        {
@@ -1801,8 +1805,8 @@ read_ofile_symtab (pst)
   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.  */
+         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;
     }
@@ -1811,7 +1815,7 @@ read_ofile_symtab (pst)
     fill_symbuf (abfd);
   bufp = &symbuf[symbuf_idx];
   if (bfd_h_get_8 (abfd, bufp->e_type) != N_SO)
-    error("First symbol in segment of executable not a source symbol");
+    error ("First symbol in segment of executable not a source symbol");
 
   max_symnum = sym_size / symbol_size;
 
@@ -1821,7 +1825,7 @@ read_ofile_symtab (pst)
     {
       QUIT;                    /* Allow this to be interruptable */
       if (symbuf_idx == symbuf_end)
-       fill_symbuf(abfd);
+       fill_symbuf (abfd);
       bufp = &symbuf[symbuf_idx++];
       INTERNALIZE_SYMBOL (nlist, bufp, abfd);
       OBJSTAT (objfile, n_stabs++);
@@ -1830,10 +1834,11 @@ read_ofile_symtab (pst)
 
       SET_NAMESTRING ();
 
-      if (type & N_STAB) {
+      if (type & N_STAB)
+       {
          process_one_symbol (type, nlist.n_desc, nlist.n_value,
                              namestring, section_offsets, objfile);
-      }
+       }
       /* We skip checking for a new .o or -l file; that should never
          happen in this routine. */
       else if (type == N_TEXT)
@@ -1854,9 +1859,10 @@ read_ofile_symtab (pst)
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
        }
-      else if (type & N_EXT || type == (unsigned char)N_TEXT
-              || type == (unsigned char)N_NBTEXT
-              ) {
+      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
@@ -1867,7 +1873,7 @@ read_ofile_symtab (pst)
             be satisfied in each file as it appears. So we skip this
             section. */
          ;
-        }
+       }
     }
 
   current_objfile = NULL;
@@ -1888,12 +1894,12 @@ read_ofile_symtab (pst)
 
   /* Process items which we had to "process_later" due to dependancies 
      on other stabs.  */
-  process_now (objfile);       
+  process_now (objfile);
 
   end_stabs ();
 }
-
 \f
+
 /* This handles a single symbol from the symbol-file, building symbols
    into a GDB symtab.  It takes these arguments and an implicit argument.
 
@@ -1902,11 +1908,11 @@ read_ofile_symtab (pst)
    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.
+   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.  */
+   It is used in end_symtab.  */
 
 void
 process_one_symbol (type, desc, valu, name, section_offsets, objfile)
@@ -1951,12 +1957,12 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
   /* Something is wrong if we see real data before
      seeing a source file name.  */
 
-  if (last_source_file == NULL && type != (unsigned char)N_SO)
+  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 ().  */
+         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;
     }
 
@@ -1994,7 +2000,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     case N_LBRAC:
       /* This "symbol" just indicates the start of an inner lexical
-        context within a function.  */
+         context within a function.  */
 
       /* Ignore extra outermost context from SunPRO cc and acc.  */
       if (n_opt_found && desc == 1)
@@ -2009,18 +2015,19 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
        valu += last_source_start_addr;
 
 #ifdef SUN_FIXED_LBRAC_BUG
-      if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address) {
-       /* Patch current LBRAC pc value to match last handy pc value */
-       complain (&lbrac_complaint);
-       valu = last_pc_address;
-      }
+      if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address)
+       {
+         /* Patch current LBRAC pc value to match last handy pc value */
+         complain (&lbrac_complaint);
+         valu = last_pc_address;
+       }
 #endif
       new = push_context (desc, valu);
       break;
 
     case N_RBRAC:
       /* This "symbol" just indicates the end of an inner lexical
-        context that was started with N_LBRAC.  */
+         context that was started with N_LBRAC.  */
 
       /* Ignore extra outermost context from SunPRO cc and acc.  */
       if (n_opt_found && desc == 1)
@@ -2034,26 +2041,26 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
           N_SO, the linker did not relocate them (sigh).  */
        valu += last_source_start_addr;
 
-      new = pop_context();
+      new = pop_context ();
       if (desc != new->depth)
        complain (&lbrac_mismatch_complaint, symnum);
 
       /* Some compilers put the variable decls inside of an
          LBRAC/RBRAC block.  This macro should be nonzero if this
-        is true.  DESC is N_DESC from the N_RBRAC symbol.
-        GCC_P is true if we've detected the GCC_COMPILED_SYMBOL
-        or the GCC2_COMPILED_SYMBOL.  */
+         is true.  DESC is N_DESC from the N_RBRAC symbol.
+         GCC_P is true if we've detected the GCC_COMPILED_SYMBOL
+         or the GCC2_COMPILED_SYMBOL.  */
 #if !defined (VARIABLES_INSIDE_BLOCK)
 #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 0
 #endif
 
       /* Can only use new->locals as local symbols here if we're in
          gcc or on a machine that puts them before the lbrack.  */
-      if (!VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
+      if (!VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
        local_symbols = new->locals;
 
       if (context_stack_depth
-         > !VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
+         > !VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
        {
          /* This is not the outermost LBRAC...RBRAC pair in the function,
             its local symbols preceded it, and are the ones just recovered
@@ -2064,7 +2071,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          if (local_symbols != NULL)
            {
              /* Muzzle a compiler bug that makes end < start.  (which
-                compilers?  Is this ever harmful?).  */
+                compilers?  Is this ever harmful?).  */
              if (new->start_addr > valu)
                {
                  complain (&lbrac_rbrac_complaint);
@@ -2084,7 +2091,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          within_function = 0;
        }
 
-      if (VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
+      if (VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
        /* Now pop locals of block just finished.  */
        local_symbols = new->locals;
       break;
@@ -2098,9 +2105,9 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     case N_SO:
       /* This type of symbol indicates the start of data
-        for one source file.
-        Finish the symbol table of the previous source file
-        (if any) and start accumulating a new symbol table.  */
+         for one source file.
+         Finish the symbol table of the previous source file
+         (if any) and start accumulating a new symbol table.  */
       /* Relocate for dynamic loading */
       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 
@@ -2123,7 +2130,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          /* Check if previous symbol was also an N_SO (with some
             sanity checks).  If so, that one was actually the directory
             name, and the current one is the real file name.
-            Patch things up. */           
+            Patch things up. */
          if (previous_stab_code == (unsigned char) N_SO)
            {
              patch_subfile_names (current_subfile, name);
@@ -2134,12 +2141,12 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
        }
 
       /* Null name means this just marks the end of text for this .o file.
-        Don't start a new symtab in this case.  */
+         Don't start a new symtab in this case.  */
       if (*name == '\000')
        break;
 
       if (block_address_function_relative)
-        function_start_offset = 0;
+       function_start_offset = 0;
 
       start_stabs ();
       start_symtab (name, NULL, valu);
@@ -2148,9 +2155,9 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     case N_SOL:
       /* This type of symbol indicates the start of data for
-        a sub-source-file, one whose contents were copied or
-        included in the compilation of the main source file
-        (whose name was given in the N_SO symbol.)  */
+         a sub-source-file, one whose contents were copied or
+         included in the compilation of the main source file
+         (whose name was given in the N_SO symbol.)  */
       /* Relocate for dynamic loading */
       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
       start_subfile (name, current_subfile->dirname);
@@ -2172,8 +2179,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     case N_SLINE:
       /* This type of "symbol" really just records
-        one line-number -- core-address correspondence.
-        Enter it in the line list for this symbol table.  */
+         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 += function_start_offset;
@@ -2192,21 +2199,21 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       common_block_end (objfile);
       break;
 
-    /* The following symbol types need to have the appropriate offset added
-       to their value; then we process symbol definitions in the name.  */
+      /* The following symbol types need to have the appropriate offset added
+         to their value; then we process symbol definitions in the name.  */
 
     case N_STSYM:              /* Static symbol in data seg */
     case N_LCSYM:              /* Static symbol in BSS seg */
     case N_ROSYM:              /* Static symbol in Read-only data seg */
-     /* HORRID HACK DEPT.  However, it's Sun's furgin' fault.
-       Solaris2's stabs-in-elf makes *most* symbols relative
-       but leaves a few absolute (at least for Solaris 2.1 and version
-       2.0.1 of the SunPRO compiler).  N_STSYM and friends sit on the fence.
-       .stab "foo:S...",N_STSYM        is absolute (ld relocates it)
-       .stab "foo:V...",N_STSYM        is relative (section base subtracted).
-       This leaves us no choice but to search for the 'S' or 'V'...
-       (or pass the whole section_offsets stuff down ONE MORE function
-       call level, which we really don't want to do).  */
+      /* HORRID HACK DEPT.  However, it's Sun's furgin' fault.
+         Solaris2's stabs-in-elf makes *most* symbols relative
+         but leaves a few absolute (at least for Solaris 2.1 and version
+         2.0.1 of the SunPRO compiler).  N_STSYM and friends sit on the fence.
+         .stab "foo:S...",N_STSYM        is absolute (ld relocates it)
+         .stab "foo:V...",N_STSYM        is relative (section base subtracted).
+         This leaves us no choice but to search for the 'S' or 'V'...
+         (or pass the whole section_offsets stuff down ONE MORE function
+         call level, which we really don't want to do).  */
       {
        char *p;
 
@@ -2235,12 +2242,17 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
              }
          }
        /* Since it's not the kludge case, re-dispatch to the right handler. */
-       switch (type) {
-       case N_STSYM:   goto case_N_STSYM;
-       case N_LCSYM:   goto case_N_LCSYM;
-       case N_ROSYM:   goto case_N_ROSYM;
-       default:        abort();
-       }
+       switch (type)
+         {
+         case N_STSYM:
+           goto case_N_STSYM;
+         case N_LCSYM:
+           goto case_N_LCSYM;
+         case N_ROSYM:
+           goto case_N_ROSYM;
+         default:
+           abort ();
+         }
       }
 
     case_N_STSYM:              /* Static symbol in data seg */
@@ -2250,7 +2262,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     case_N_LCSYM:              /* Static symbol in BSS seg */
     case N_BSLINE:             /* Source line number, bss seg */
-    /*   N_BROWS:      overlaps with N_BSLINE */
+      /*   N_BROWS:       overlaps with N_BSLINE */
       valu += ANOFFSET (section_offsets, SECT_OFF_BSS);
       goto define_a_symbol;
 
@@ -2263,14 +2275,14 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
       goto define_a_symbol;
 
-    /* The following symbol types we don't know how to process.  Handle
-       them in a "default" way, but complain to people who care.  */
+      /* The following symbol types we don't know how to process.  Handle
+         them in a "default" way, but complain to people who care.  */
     default:
     case N_CATCH:              /* Exception handler catcher */
     case N_EHDECL:             /* Exception handler name */
     case N_PC:                 /* Global symbol in Pascal */
-    case N_M2C:                        /* Modula-2 compilation unit */
-    /*   N_MOD2:       overlaps with N_EHDECL */
+    case N_M2C:                /* Modula-2 compilation unit */
+      /*   N_MOD2:        overlaps with N_EHDECL */
     case N_SCOPE:              /* Modula-2 scope information */
     case N_ECOML:              /* End common (local name) */
     case N_NBTEXT:             /* Gould Non-Base-Register symbols??? */
@@ -2281,8 +2293,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       complain (&unknown_symtype_complaint, local_hex_string (type));
       /* FALLTHROUGH */
 
-    /* The following symbol types don't need the address field relocated,
-       since it is either unused, or is absolute.  */
+      /* The following symbol types don't need the address field relocated,
+         since it is either unused, or is absolute.  */
     define_a_symbol:
     case N_GSYM:               /* Global variable */
     case N_NSYMS:              /* Number of symbols (ultrix) */
@@ -2310,7 +2322,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
              /* Deal with the SunPRO 3.0 compiler which omits the address
-                 from N_FUN symbols.  */
+                from N_FUN symbols.  */
              if (type == N_FUN
                  && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT))
                {
@@ -2331,8 +2343,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
                  if (msym == NULL)
                    {
                      /* Sun Fortran appends an underscore to the minimal
-                        symbol name, try again with an appended underscore
-                        if the minimal symbol was not found.  */
+                        symbol name, try again with an appended underscore
+                        if the minimal symbol was not found.  */
                      p[n] = '_';
                      p[n + 1] = 0;
                      msym = lookup_minimal_symbol (p, last_source_file,
@@ -2345,28 +2357,28 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
 #ifdef SUN_FIXED_LBRAC_BUG
              /* The Sun acc compiler, under SunOS4, puts out
-                functions with N_GSYM or N_STSYM.  The problem is
-                that the address of the symbol is no good (for N_GSYM
-                it doesn't even attept an address; for N_STSYM it
-                puts out an address but then it gets relocated
-                relative to the data segment, not the text segment).
-                Currently we can't fix this up later as we do for
-                some types of symbol in scan_file_globals.
-                Fortunately we do have a way of finding the address -
-                we know that the value in last_pc_address is either
-                the one we want (if we're dealing with the first
-                function in an object file), or somewhere in the
-                previous function. This means that we can use the
-                minimal symbol table to get the address.  */
+                functions with N_GSYM or N_STSYM.  The problem is
+                that the address of the symbol is no good (for N_GSYM
+                it doesn't even attept an address; for N_STSYM it
+                puts out an address but then it gets relocated
+                relative to the data segment, not the text segment).
+                Currently we can't fix this up later as we do for
+                some types of symbol in scan_file_globals.
+                Fortunately we do have a way of finding the address -
+                we know that the value in last_pc_address is either
+                the one we want (if we're dealing with the first
+                function in an object file), or somewhere in the
+                previous function. This means that we can use the
+                minimal symbol table to get the address.  */
 
              /* Starting with release 3.0, the Sun acc compiler,
-                under SunOS4, puts out functions with N_FUN and a value
-                of zero. This gets relocated to the start of the text
-                segment of the module, which is no good either.
-                Under SunOS4 we can deal with this as N_SLINE and N_SO
-                entries contain valid absolute addresses.
-                Release 3.0 acc also puts out N_OPT entries, which makes
-                it possible to discern acc from cc or gcc.  */
+                under SunOS4, puts out functions with N_FUN and a value
+                of zero. This gets relocated to the start of the text
+                segment of the module, which is no good either.
+                Under SunOS4 we can deal with this as N_SLINE and N_SO
+                entries contain valid absolute addresses.
+                Release 3.0 acc also puts out N_OPT entries, which makes
+                it possible to discern acc from cc or gcc.  */
 
              if (type == N_GSYM || type == N_STSYM
                  || (type == N_FUN
@@ -2377,14 +2389,14 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
                  m = lookup_minimal_symbol_by_pc (last_pc_address);
                  if (m && STREQN (SYMBOL_NAME (m), name, l)
-                     && SYMBOL_NAME (m) [l] == '\0')
+                     && SYMBOL_NAME (m)[l] == '\0')
                    /* last_pc_address was in this function */
                    valu = SYMBOL_VALUE (m);
-                 else if (m && SYMBOL_NAME (m+1)
-                          && STREQN (SYMBOL_NAME (m+1), name, l)
-                          && SYMBOL_NAME (m+1) [l] == '\0')
+                 else if (m && SYMBOL_NAME (m + 1)
+                          && STREQN (SYMBOL_NAME (m + 1), name, l)
+                          && SYMBOL_NAME (m + 1)[l] == '\0')
                    /* last_pc_address was in last function */
-                   valu = SYMBOL_VALUE (m+1);
+                   valu = SYMBOL_VALUE (m + 1);
                  else
                    /* Not found - use last_pc_address (for finish_block) */
                    valu = last_pc_address;
@@ -2400,7 +2412,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
                   Solaris 2.0, these addresses are just absolute, or
                   relative to the N_SO, depending on
                   BLOCK_ADDRESS_ABSOLUTE.  */
-               function_start_offset = valu;   
+               function_start_offset = valu;
 
              within_function = 1;
              if (context_stack_depth > 0)
@@ -2425,16 +2437,16 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
        }
       break;
 
-    /* We use N_OPT to carry the gcc2_compiled flag.  Sun uses it
-       for a bunch of other flags, too.  Someday we may parse their
-       flags; for now we ignore theirs and hope they'll ignore ours.  */
-    case N_OPT:                        /* Solaris 2:  Compiler options */
+      /* We use N_OPT to carry the gcc2_compiled flag.  Sun uses it
+         for a bunch of other flags, too.  Someday we may parse their
+         flags; for now we ignore theirs and hope they'll ignore ours.  */
+    case N_OPT:                /* Solaris 2:  Compiler options */
       if (name)
        {
          if (STREQ (name, GCC2_COMPILED_FLAG_SYMBOL))
            {
              processing_gcc_compilation = 2;
-#if 1        /* Works, but is experimental.  -fnf */
+#if 1                          /* Works, but is experimental.  -fnf */
              if (AUTO_DEMANGLING)
                {
                  set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
@@ -2446,11 +2458,11 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
        }
       break;
 
-    /* The following symbol types can be ignored.  */
-    case N_OBJ:                        /* Solaris 2:  Object file dir and name */
-    /*   N_UNDF:                  Solaris 2:  file separator mark */
-    /*   N_UNDF: -- we will never encounter it, since we only process one
-                   file's symbols at once.  */
+      /* The following symbol types can be ignored.  */
+    case N_OBJ:                /* Solaris 2:  Object file dir and name */
+      /*   N_UNDF:                   Solaris 2:  file separator mark */
+      /*   N_UNDF: -- we will never encounter it, since we only process one
+         file's symbols at once.  */
     case N_ENDM:               /* Solaris 2:  End of module */
     case N_MAIN:               /* Name of main routine.  */
     case N_ALIAS:              /* SunPro F77: alias name, ignore for now.  */
@@ -2461,7 +2473,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
      related symbol.
 
      Generally this is used so that an alias can refer to its main
-     symbol.  */  
+     symbol.  */
   if (name[0] == '#')
     {
       /* Initialize symbol reference names and determine if this is 
@@ -2472,10 +2484,10 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       int refnum;
 
       /* If this stab defines a new reference ID that is not on the
-        reference list, then put it on the reference list.
+         reference list, then put it on the reference list.
 
-        We go ahead and advance NAME past the reference, even though
-        it is not strictly necessary at this time.  */
+         We go ahead and advance NAME past the reference, even though
+         it is not strictly necessary at this time.  */
       refnum = symbol_reference_defined (&s);
       if (refnum >= 0)
        if (!ref_search (refnum))
@@ -2513,17 +2525,17 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
    adjusted for coff details. */
 
 void
-coffstab_build_psymtabs (objfile, section_offsets, mainline, 
-                              textaddr, textsize, stabsects,
-                              stabstroffset, stabstrsize)
-      struct objfile *objfile;
-      struct section_offsets *section_offsets;
-      int mainline;
-      CORE_ADDR textaddr;
-      unsigned int textsize;
-      struct stab_section_list *stabsects;
-      file_ptr stabstroffset;
-      unsigned int stabstrsize;
+coffstab_build_psymtabs (objfile, section_offsets, mainline,
+                        textaddr, textsize, stabsects,
+                        stabstroffset, stabstrsize)
+     struct objfile *objfile;
+     struct section_offsets *section_offsets;
+     int mainline;
+     CORE_ADDR textaddr;
+     unsigned int textsize;
+     struct stab_section_list *stabsects;
+     file_ptr stabstroffset;
+     unsigned int stabstrsize;
 {
   int val;
   bfd *sym_bfd = objfile->obfd;
@@ -2539,14 +2551,14 @@ coffstab_build_psymtabs (objfile, section_offsets, mainline,
   DBX_TEXT_SIZE (objfile) = textsize;
 
 #define        COFF_STABS_SYMBOL_SIZE  12      /* XXX FIXME XXX */
-  DBX_SYMBOL_SIZE    (objfile) = COFF_STABS_SYMBOL_SIZE;
+  DBX_SYMBOL_SIZE (objfile) = COFF_STABS_SYMBOL_SIZE;
   DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
-  
+
   if (stabstrsize > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", stabstrsize);
   DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, stabstrsize+1);
-  OBJSTAT (objfile, sz_strtab += stabstrsize+1);
+    obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+  OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
 
   /* Now read in the string table in one big gulp.  */
 
@@ -2615,16 +2627,16 @@ coffstab_build_psymtabs (objfile, section_offsets, mainline,
    adjusted for elf details. */
 
 void
-elfstab_build_psymtabs (objfile, section_offsets, mainline, 
-                              staboffset, stabsize,
-                              stabstroffset, stabstrsize)
-      struct objfile *objfile;
-      struct section_offsets *section_offsets;
-      int mainline;
-      file_ptr staboffset;
-      unsigned int stabsize;
-      file_ptr stabstroffset;
-      unsigned int stabstrsize;
+elfstab_build_psymtabs (objfile, section_offsets, mainline,
+                       staboffset, stabsize,
+                       stabstroffset, stabstrsize)
+     struct objfile *objfile;
+     struct section_offsets *section_offsets;
+     int mainline;
+     file_ptr staboffset;
+     unsigned int stabsize;
+     file_ptr stabstroffset;
+     unsigned int stabstrsize;
 {
   int val;
   bfd *sym_bfd = objfile->obfd;
@@ -2641,16 +2653,16 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
   find_text_range (sym_bfd, objfile);
 
 #define        ELF_STABS_SYMBOL_SIZE   12      /* XXX FIXME XXX */
-  DBX_SYMBOL_SIZE    (objfile) = ELF_STABS_SYMBOL_SIZE;
-  DBX_SYMCOUNT       (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile);
+  DBX_SYMBOL_SIZE (objfile) = ELF_STABS_SYMBOL_SIZE;
+  DBX_SYMCOUNT (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile);
   DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
-  DBX_SYMTAB_OFFSET  (objfile) = staboffset;
-  
+  DBX_SYMTAB_OFFSET (objfile) = staboffset;
+
   if (stabstrsize > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", stabstrsize);
   DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, stabstrsize+1);
-  OBJSTAT (objfile, sz_strtab += stabstrsize+1);
+    obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+  OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
 
   /* Now read in the string table in one big gulp.  */
 
@@ -2684,9 +2696,9 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
 
    OBJFILE is the object file we are reading symbols from.
    ADDR is the address relative to which the symbols are (e.g. the base address
-       of the text segment).
+   of the text segment).
    MAINLINE is true if we are reading the main symbol table (as opposed to a
-           shared lib or dynamically loaded file).
+   shared lib or dynamically loaded file).
    STAB_NAME is the name of the section that contains the stabs.
    STABSTR_NAME is the name of the section that contains the stab strings.
 
@@ -2729,12 +2741,12 @@ stabsect_build_psymtabs (objfile, section_offsets, mainline, stab_name,
   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) = sizeof (struct external_nlist);
-  DBX_SYMCOUNT       (objfile) = bfd_section_size (sym_bfd, stabsect)
+  DBX_SYMBOL_SIZE (objfile) = sizeof (struct external_nlist);
+  DBX_SYMCOUNT (objfile) = bfd_section_size (sym_bfd, stabsect)
     / DBX_SYMBOL_SIZE (objfile);
   DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (sym_bfd, stabstrsect);
-  DBX_SYMTAB_OFFSET  (objfile) = stabsect->filepos; /* XXX - FIXME: POKING INSIDE BFD DATA STRUCTURES */
-  
+  DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;     /* XXX - FIXME: POKING INSIDE BFD DATA STRUCTURES */
+
   if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", DBX_STRINGTAB_SIZE (objfile));
   DBX_STRINGTAB (objfile) = (char *)
@@ -2743,11 +2755,11 @@ stabsect_build_psymtabs (objfile, section_offsets, mainline, stab_name,
 
   /* Now read in the string table in one big gulp.  */
 
-  val = bfd_get_section_contents (sym_bfd, /* bfd */
-                                 stabstrsect, /* bfd section */
-                                 DBX_STRINGTAB (objfile), /* input buffer */
-                                 0, /* offset into section */
-                                 DBX_STRINGTAB_SIZE (objfile)); /* amount to read */
+  val = bfd_get_section_contents (sym_bfd,     /* bfd */
+                                 stabstrsect,  /* bfd section */
+                                 DBX_STRINGTAB (objfile),      /* input buffer */
+                                 0,    /* offset into section */
+                                 DBX_STRINGTAB_SIZE (objfile));        /* amount to read */
 
   if (!val)
     perror_with_name (name);
@@ -2767,17 +2779,17 @@ stabsect_build_psymtabs (objfile, section_offsets, mainline, stab_name,
 static struct sym_fns aout_sym_fns =
 {
   bfd_target_aout_flavour,
-  dbx_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  dbx_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  dbx_symfile_read,    /* sym_read: read a symbol file into symtab */
-  dbx_symfile_finish,  /* sym_finish: finished with file, cleanup */
+  dbx_new_init,                        /* sym_new_init: init anything gbl to entire symtab */
+  dbx_symfile_init,            /* sym_init: read initial info, setup for sym_read() */
+  dbx_symfile_read,            /* sym_read: read a symbol file into symtab */
+  dbx_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 */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
 _initialize_dbxread ()
 {
-  add_symtab_fns(&aout_sym_fns);
+  add_symtab_fns (&aout_sym_fns);
 }
index a97a940a4a68293c35dc94d4b01e8e01d0f545aa..821eb13ceecb296449d390ef1fe4d2264f6b2ef9 100644 (file)
@@ -17,7 +17,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "dcache.h"
@@ -78,7 +79,7 @@
    read the cache line in the first place.
 
 
 */
+ */
 
 
 /* This value regulates the number of cache blocks stored.
    line, and reduce memory requirements, but increase the risk
    of a line not being in memory */
 
-#define DCACHE_SIZE 64 
+#define DCACHE_SIZE 64
 
 /* This value regulates the size of a cache line.  Smaller values
    reduce the time taken to read a single byte, but reduce overall
    throughput.  */
 
-#define LINE_SIZE_POWER (5) 
+#define LINE_SIZE_POWER (5)
 #define LINE_SIZE (1 << LINE_SIZE_POWER)
 
 /* Each cache block holds LINE_SIZE bytes of data
    starting at a multiple-of-LINE_SIZE address.  */
 
-#define LINE_SIZE_MASK  ((LINE_SIZE - 1))      
+#define LINE_SIZE_MASK  ((LINE_SIZE - 1))
 #define XFORM(x)       ((x) & LINE_SIZE_MASK)
 #define MASK(x)         ((x) & ~LINE_SIZE_MASK)
 
 
-#define ENTRY_BAD   0  /* data at this byte is wrong */
-#define ENTRY_DIRTY 1  /* data at this byte needs to be written back */
-#define ENTRY_OK    2  /* data at this byte is same as in memory */
+#define ENTRY_BAD   0          /* data at this byte is wrong */
+#define ENTRY_DIRTY 1          /* data at this byte needs to be written back */
+#define ENTRY_OK    2          /* data at this byte is same as in memory */
 
 
 struct dcache_block
-{
-  struct dcache_block *p;      /* next in list */
-  CORE_ADDR addr;              /* Address for which data is recorded.  */
-  char data[LINE_SIZE];                /* bytes at given address */
-  unsigned char state[LINE_SIZE]; /* what state the data is in */
+  {
+    struct dcache_block *p;    /* next in list */
+    CORE_ADDR addr;            /* Address for which data is recorded.  */
+    char data[LINE_SIZE];      /* bytes at given address */
+    unsigned char state[LINE_SIZE];    /* what state the data is in */
 
-  /* whether anything in state is dirty - used to speed up the 
-     dirty scan. */
-  int anydirty;                        
+    /* whether anything in state is dirty - used to speed up the 
+       dirty scan. */
+    int anydirty;
 
-  int refs;
-};
+    int refs;
+  };
 
 
-struct dcache_struct 
-{
-  /* Function to actually read the target memory. */
-  memxferfunc read_memory;
+struct dcache_struct
+  {
+    /* Function to actually read the target memory. */
+    memxferfunc read_memory;
 
-  /* Function to actually write the target memory */
-  memxferfunc write_memory;
+    /* Function to actually write the target memory */
+    memxferfunc write_memory;
 
-  /* free list */
-  struct dcache_block *free_head;
-  struct dcache_block *free_tail;
+    /* free list */
+    struct dcache_block *free_head;
+    struct dcache_block *free_tail;
 
-  /* in use list */
-  struct dcache_block *valid_head;
-  struct dcache_block *valid_tail;
+    /* in use list */
+    struct dcache_block *valid_head;
+    struct dcache_block *valid_tail;
 
-  /* The cache itself. */
-  struct dcache_block *the_cache;
+    /* The cache itself. */
+    struct dcache_block *the_cache;
 
-  /* potentially, if the cache was enabled, and then turned off, and
-     then turned on again, the stuff in it could be stale, so this is
-     used to mark it */
-  int cache_has_stuff;
-;
+    /* potentially, if the cache was enabled, and then turned off, and
+       then turned on again, the stuff in it could be stale, so this is
+       used to mark it */
+    int cache_has_stuff;
+  };
 
-static int dcache_poke_byte PARAMS ((DCACHE *dcache, CORE_ADDR addr, 
-                                     char *ptr));
+static int dcache_poke_byte PARAMS ((DCACHE * dcache, CORE_ADDR addr,
+                                    char *ptr));
 
-static int dcache_peek_byte PARAMS ((DCACHE *dcache, CORE_ADDR addr, 
-                                     char *ptr));
+static int dcache_peek_byte PARAMS ((DCACHE * dcache, CORE_ADDR addr,
+                                    char *ptr));
 
-static struct dcache_block *dcache_hit PARAMS ((DCACHE *dcache, 
-                                                CORE_ADDR addr));
+static struct dcache_block *dcache_hit PARAMS ((DCACHE * dcache,
+                                               CORE_ADDR addr));
 
-static int dcache_write_line PARAMS ((DCACHE *dcache,struct dcache_block *db));
+static int dcache_write_line PARAMS ((DCACHE * dcache, struct dcache_block * db));
 
-static struct dcache_block *dcache_alloc PARAMS ((DCACHE *dcache));
+static struct dcache_block *dcache_alloc PARAMS ((DCACHE * dcache));
 
-static int dcache_writeback PARAMS ((DCACHE *dcache));
+static int dcache_writeback PARAMS ((DCACHE * dcache));
 
 static void dcache_info PARAMS ((char *exp, int tty));
 
@@ -169,7 +170,7 @@ void _initialize_dcache PARAMS ((void));
 
 int remote_dcache = 0;
 
-DCACHE *last_cache; /* Used by info dcache */
+DCACHE *last_cache;            /* Used by info dcache */
 
 
 /* Free all the data cache blocks, thus discarding all cached data.  */
@@ -217,7 +218,7 @@ dcache_hit (dcache, addr)
 
   while (db)
     {
-      if (MASK(addr) == db->addr)
+      if (MASK (addr) == db->addr)
        {
          db->refs++;
          return db;
@@ -246,21 +247,22 @@ dcache_write_line (dcache, db)
          if (db->state[s] == ENTRY_DIRTY)
            {
              int len = 0;
-             for (e = s ; e < LINE_SIZE; e++, len++)
+             for (e = s; e < LINE_SIZE; e++, len++)
                if (db->state[e] != ENTRY_DIRTY)
                  break;
              {
                /* all bytes from s..s+len-1 need to
                   be written out */
                int done = 0;
-               while (done < len) {
-                 int t = dcache->write_memory (db->addr + s + done,
-                                               db->data + s + done,
-                                               len - done);
-                 if (t == 0)
-                   return 0;
-                 done += t;
-               }
+               while (done < len)
+                 {
+                   int t = dcache->write_memory (db->addr + s + done,
+                                                 db->data + s + done,
+                                                 len - done);
+                   if (t == 0)
+                     return 0;
+                   done += t;
+                 }
                memset (db->state + s, ENTRY_OK, len);
                s = e;
              }
@@ -327,7 +329,7 @@ dcache_peek_byte (dcache, addr, ptr)
      char *ptr;
 {
   register struct dcache_block *db = dcache_hit (dcache, addr);
-  int ok=1;
+  int ok = 1;
   int done = 0;
   if (db == 0
       || db->state[XFORM (addr)] == ENTRY_BAD)
@@ -336,23 +338,23 @@ dcache_peek_byte (dcache, addr, ptr)
        {
          dcache_write_line (dcache, db);
        }
-    else
-      db = dcache_alloc (dcache);
+      else
+       db = dcache_alloc (dcache);
       immediate_quit++;
       db->addr = MASK (addr);
-      while (done < LINE_SIZE) 
+      while (done < LINE_SIZE)
        {
          int try =
-           (*dcache->read_memory)
-             (db->addr + done,
-              db->data + done,
-              LINE_SIZE - done);
+         (*dcache->read_memory)
+         (db->addr + done,
+          db->data + done,
+          LINE_SIZE - done);
          if (try == 0)
            return 0;
          done += try;
        }
       immediate_quit--;
-     
+
       memset (db->state, ENTRY_OK, sizeof (db->data));
       db->anydirty = 0;
     }
@@ -388,7 +390,7 @@ dcache_fetch (dcache, addr)
 {
   int res;
 
-  if (dcache_xfer_memory (dcache, addr, (char *)&res, sizeof res, 0) != sizeof res)
+  if (dcache_xfer_memory (dcache, addr, (char *) &res, sizeof res, 0) != sizeof res)
     memory_error (EIO, addr);
 
   return res;
@@ -430,7 +432,7 @@ dcache_poke (dcache, addr, data)
      CORE_ADDR addr;
      int data;
 {
-  if (dcache_xfer_memory (dcache, addr, (char *)&data, sizeof data, 1) != sizeof data)
+  if (dcache_xfer_memory (dcache, addr, (char *) &data, sizeof data, 1) != sizeof data)
     return 0;
 
   return dcache_writeback (dcache);
@@ -477,9 +479,9 @@ dcache_xfer_memory (dcache, memaddr, myaddr, len, should_write)
 {
   int i;
 
-  if (remote_dcache) 
+  if (remote_dcache)
     {
-      int (*xfunc) PARAMS ((DCACHE *dcache, CORE_ADDR addr, char *ptr));
+      int (*xfunc) PARAMS ((DCACHE * dcache, CORE_ADDR addr, char *ptr));
       xfunc = should_write ? dcache_poke_byte : dcache_peek_byte;
 
       for (i = 0; i < len; i++)
@@ -490,7 +492,7 @@ dcache_xfer_memory (dcache, memaddr, myaddr, len, should_write)
       dcache->cache_has_stuff = 1;
       dcache_writeback (dcache);
     }
-  else 
+  else
     {
       memxferfunc xfunc;
       xfunc = should_write ? dcache->write_memory : dcache->read_memory;
@@ -503,7 +505,7 @@ dcache_xfer_memory (dcache, memaddr, myaddr, len, should_write)
   return len;
 }
 
-static void 
+static void
 dcache_info (exp, tty)
      char *exp;
      int tty;
index a0b762a2e13466ce43cc269e651407d1a63e1c42..0a80cab19e68b88a37f247ff82988bb27390262d 100644 (file)
@@ -3,48 +3,49 @@
 
    Copyright 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef DCACHE_H
 #define DCACHE_H
 
-typedef int (*memxferfunc) PARAMS((CORE_ADDR memaddr,
-                            char *myaddr,
-                            int len));
+typedef int (*memxferfunc) PARAMS ((CORE_ADDR memaddr,
+                                   char *myaddr,
+                                   int len));
 
 typedef struct dcache_struct DCACHE;
 
 /* Using the data cache DCACHE return the contents of the word at
    address ADDR in the remote machine.  */
-int dcache_fetch PARAMS((DCACHE *dcache, CORE_ADDR addr));
+int dcache_fetch PARAMS ((DCACHE * dcache, CORE_ADDR addr));
 
 /* Flush DCACHE. */
-void dcache_flush PARAMS((DCACHE *dcache));
+void dcache_flush PARAMS ((DCACHE * dcache));
 
 /* Initialize DCACHE. */
-DCACHE *dcache_init PARAMS((memxferfunc reading, memxferfunc writing));
+DCACHE *dcache_init PARAMS ((memxferfunc reading, memxferfunc writing));
 
 /* Write the word at ADDR both in the data cache and in the remote machine.  */
-int dcache_poke PARAMS((DCACHE *dcache, CORE_ADDR addr, int data));
+int dcache_poke PARAMS ((DCACHE * dcache, CORE_ADDR addr, int data));
 
 /* Simple to call from <remote>_xfer_memory */
 
-int dcache_xfer_memory PARAMS((DCACHE *cache, CORE_ADDR mem, char *my, int len, int should_write));
+int dcache_xfer_memory PARAMS ((DCACHE * cache, CORE_ADDR mem, char *my, int len, int should_write));
 
 /* Write the bytes at ADDR into the data cache and the remote machine. */
-int dcache_poke_block PARAMS((DCACHE *cache, CORE_ADDR mem, char* my, int len));
+int dcache_poke_block PARAMS ((DCACHE * cache, CORE_ADDR mem, char *my, int len));
 #endif /* DCACHE_H */
index fe112f0897c1d909f8fab783983ecdeb03fe9244..6ec961d593378b93c1d4a91096b9f4e4624c45eb 100644 (file)
@@ -1,23 +1,24 @@
 /* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
 /* Basic, host-specific, and target-specific definitions for GDB.
-   Copyright (C) 1986, 89, 91, 92, 93, 94, 95, 96, 1998
+   Copyright (C) 1986, 89, 91, 92, 93, 94, 95, 96, 98, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef DEFS_H
 #define DEFS_H
@@ -1225,4 +1226,3 @@ extern int use_windows;
 #endif
 
 #endif /* #ifndef DEFS_H */
-/* *INDENT-ON* */
index 3995b235e04752956fe1c600232a50dfa144444c..f54f1b8db4d7f48b318ada406a6ad209465e7130 100644 (file)
@@ -1,26 +1,27 @@
 /* Functions specific to running gdb native on a Motorola Delta Series sysV68.
    Copyright (C) 1993, 1997-98, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include <sys/signal.h>        /* for MAXSIG in sys/user.h */
-#include <sys/types.h> /* for ushort in sys/dir.h */
-#include <sys/dir.h>   /* for struct direct in sys/user.h */
+#include <sys/signal.h>                /* for MAXSIG in sys/user.h */
+#include <sys/types.h>         /* for ushort in sys/dir.h */
+#include <sys/dir.h>           /* for struct direct in sys/user.h */
 #include <sys/user.h>
 
 #include <nlist.h>
@@ -34,14 +35,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 CORE_ADDR
 register_addr (regno, blockend)
-     int       regno;
-     CORE_ADDR blockend;
+     int regno;
+     CORE_ADDR blockend;
 {
-  static int   sysv68reg[] =
-    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16 };
+  static int sysv68reg[] =
+  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16};
 
-  if (regno >= 0 && regno < sizeof(sysv68reg) / sizeof(sysv68reg[0]))
-    return blockend + sysv68reg[regno] * 4; 
+  if (regno >= 0 && regno < sizeof (sysv68reg) / sizeof (sysv68reg[0]))
+    return blockend + sysv68reg[regno] * 4;
   else if (regno < FPC_REGNUM)
     return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]);
   else if (regno == FPC_REGNUM)
@@ -54,7 +55,7 @@ register_addr (regno, blockend)
     {
       fprintf_unfiltered (gdb_stderr, "\
 Internal error: invalid register number %d in REGISTER_U_ADDR\n",
-              regno);
+                         regno);
       return blockend;
     }
 }
@@ -80,8 +81,8 @@ _initialize_delta68_nat ()
 
 clear_insn_cache ()
 {
-#ifdef MCT_TEXT /* in sys/signal.h on sysV68 R3V7.1 */
-  memctl(0, 4096, MCT_TEXT);
+#ifdef MCT_TEXT                        /* in sys/signal.h on sysV68 R3V7.1 */
+  memctl (0, 4096, MCT_TEXT);
 #endif
 }
 
index 0f054ba66f8ab9585b4ce8aaa122d947c3c544c3..29174f5f956731172a8b1d4691ec5bf0471b1530 100644 (file)
@@ -16,7 +16,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 /*  This file contains support code for C++ demangling that is common
@@ -211,7 +212,8 @@ set_demangling_style (style)
    ensuring that it is the character that terminates the gcc<n>_compiled
    marker symbol (FIXME). */
 
-static char cplus_markers[] = {CPLUS_MARKER, '.', '$', '\0'};
+static char cplus_markers[] =
+{CPLUS_MARKER, '.', '$', '\0'};
 
 int
 is_cplus_marker (c)
index c0c2e51020276e3060d2128fae7b416eab341573..2d60d67209fe9c9e246da21732e556840b921563 100644 (file)
@@ -2,21 +2,22 @@
    GDB, the GNU debugger.
    Copyright 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -110,7 +111,7 @@ dink32_load (monops, filename, from_tty)
   if (exec_bfd)
     write_pc (bfd_get_start_address (exec_bfd));
 
-  inferior_pid = 0;             /* No process now */
+  inferior_pid = 0;            /* No process now */
 }
 
 
@@ -121,22 +122,23 @@ dink32_load (monops, filename, from_tty)
 
 static char *dink32_regnames[NUM_REGS] =
 {
-  "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",
+  "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",
 
-  "f0",   "f1",   "f2",   "f3",   "f4",   "f5",   "f6",   "f7",
-  "f8",   "f9",   "f10",  "f11",  "f12",  "f13",  "f14",  "f15",
-  "f16",  "f17",  "f18",  "f19",  "f20",  "f21",  "f22",  "f23",
-  "f24",  "f25",  "f26",  "f27",  "f28",  "f29",  "f30",  "f31",
+  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+  "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+  "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+  "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
 
-  "srr0", "msr",  "cr",   "lr",   "ctr",  "xer",  "xer"
+  "srr0", "msr", "cr", "lr", "ctr", "xer", "xer"
 };
 
 static struct target_ops dink32_ops;
 
-static char *dink32_inits[] = {"\r", NULL};
+static char *dink32_inits[] =
+{"\r", NULL};
 
 static struct monitor_ops dink32_cmds;
 
@@ -157,7 +159,7 @@ _initialize_dink32_rom ()
   dink32_cmds.step = "tr +\r";
   dink32_cmds.set_break = "bp 0x%x\r";
   dink32_cmds.clr_break = "bp %d\r";
-#if 0 /* Would need to follow strict alignment rules.. */
+#if 0                          /* Would need to follow strict alignment rules.. */
   dink32_cmds.fill = "mf %x %x %x\r";
 #endif
   dink32_cmds.setmem.cmdb = "mm -b %x\r";
@@ -176,7 +178,7 @@ _initialize_dink32_rom ()
   /* S-record download, via "keyboard port".  */
   dink32_cmds.load = "dl -k\r";
   dink32_cmds.loadresp = "Set Input Port : set to Keyboard Port\r";
-#if 0 /* slow load routine not needed if S-records work... */
+#if 0                          /* slow load routine not needed if S-records work... */
   dink32_cmds.load_routine = dink32_load;
 #endif
   dink32_cmds.prompt = "DINK32_603 >>";
index 21dc13571746eb722af1d3be55215f5c9c7feacb..d039a1375525a4b39e5b8e50a4c9f600e9f82122 100644 (file)
@@ -1,21 +1,22 @@
 /* DPX2 host interface.
    Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -28,11 +29,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/user.h>
 #include <sys/reg.h>
 #include <sys/utsname.h>
-
 \f
+
 /* this table must line up with REGISTER_NAMES in tm-68k.h */
 /* symbols like 'A0' come from <sys/reg.h> */
-static int regmap[] = 
+static int regmap[] =
 {
   R0, R1, R2, R3, R4, R5, R6, R7,
   A0, A1, A2, A3, A4, A5, A6, SP,
@@ -53,7 +54,7 @@ dpx2_register_u_addr (blockend, regnum)
   if (regnum < FP0_REGNUM)
     return (blockend + 4 * regmap[regnum]);
   else
-    return (int) &(((struct user *)0)->u_fpstate[regmap[regnum]]);
+    return (int) &(((struct user *) 0)->u_fpstate[regmap[regnum]]);
 }
 
 /* This is the amount to subtract from u.u_ar0
index 06c2929df5389bdc1e439ff7217fe4a00719de44..9fae3416d0031adc0c983ec3c8db0d1289265408 100644 (file)
@@ -1,21 +1,22 @@
 /* S-record download support for GDB, the GNU debugger.
    Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -27,21 +28,21 @@ extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t))
 
 extern int remote_debug;
 
-static int make_srec PARAMS ((char *srec, CORE_ADDR targ_addr, bfd *abfd,
-                             asection *sect, int sectoff, int *maxrecsize,
+static int make_srec PARAMS ((char *srec, CORE_ADDR targ_addr, bfd * abfd,
+                             asection * sect, int sectoff, int *maxrecsize,
                              int flags));
 
 /* Download an executable by converting it to S records.  DESC is a
-    serial_t to send the data to.  FILE is the name of the file to be
-    loaded.  LOAD_OFFSET is the offset into memory to load data into.
-    It is usually specified by the user and is useful with the a.out
-    file format.  MAXRECSIZE is the length in chars of the largest
-    S-record the host can accomodate.  This is measured from the
-    starting `S' to the last char of the checksum.  FLAGS is various
-    random flags, and HASHMARK is non-zero to cause a `#' to be
-    printed out for each record loaded.  WAITACK, if non-NULL, is a
-    function that waits for an acknowledgement after each S-record,
-    and returns non-zero if the ack is read correctly.  */
+   serial_t to send the data to.  FILE is the name of the file to be
+   loaded.  LOAD_OFFSET is the offset into memory to load data into.
+   It is usually specified by the user and is useful with the a.out
+   file format.  MAXRECSIZE is the length in chars of the largest
+   S-record the host can accomodate.  This is measured from the
+   starting `S' to the last char of the checksum.  FLAGS is various
+   random flags, and HASHMARK is non-zero to cause a `#' to be
+   printed out for each record loaded.  WAITACK, if non-NULL, is a
+   function that waits for an acknowledgement after each S-record,
+   and returns non-zero if the ack is read correctly.  */
 
 void
 load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
@@ -82,7 +83,7 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
      is no data, so len is 0.  */
 
   reclen = maxrecsize;
-  make_srec (srec, 0, NULL, (asection *)1, 0, &reclen, flags);
+  make_srec (srec, 0, NULL, (asection *) 1, 0, &reclen, flags);
   if (remote_debug)
     {
       srec[reclen] = '\0';
@@ -96,7 +97,7 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
        int numbytes;
        bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset;
        bfd_size_type size = bfd_get_section_size_before_reloc (s);
-       char * section_name = (char *)bfd_get_section_name (abfd, s);
+       char *section_name = (char *) bfd_get_section_name (abfd, s);
        printf_filtered ("%s\t: 0x%08x .. 0x%08x  ",
                         section_name, (int) addr, (int) addr + size);
        gdb_flush (gdb_stdout);
@@ -119,7 +120,7 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
               acknowledgement is sent back.  */
            do
              {
-               SERIAL_WRITE (desc, srec, reclen);
+               SERIAL_WRITE (desc, srec, reclen);
                if (ui_load_progress_hook)
                  if (ui_load_progress_hook (section_name, (unsigned long) i))
                    error ("Canceled the download");
@@ -139,11 +140,11 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
        putchar_unfiltered ('\n');
       }
 
-  if (hashmark) 
+  if (hashmark)
     putchar_unfiltered ('\n');
 
   end_time = time (NULL);
-  
+
   /* Write a terminator record.  */
 
   reclen = maxrecsize;
@@ -169,19 +170,19 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
 
 /*
  * make_srec -- make an srecord. This writes each line, one at a
- *     time, each with it's own header and trailer line.
- *     An srecord looks like this:
+ *      time, each with it's own header and trailer line.
+ *      An srecord looks like this:
  *
  * byte count-+     address
  * start ---+ |        |       data        +- checksum
- *         | |        |                   |
- *       S01000006F6B692D746573742E73726563E4
- *       S315000448600000000000000000FC00005900000000E9
- *       S31A0004000023C1400037DE00F023604000377B009020825000348D
- *       S30B0004485A0000000000004E
- *       S70500040000F6
+ *          | |        |                   |
+ *        S01000006F6B692D746573742E73726563E4
+ *        S315000448600000000000000000FC00005900000000E9
+ *        S31A0004000023C1400037DE00F023604000377B009020825000348D
+ *        S30B0004485A0000000000004E
+ *        S70500040000F6
  *
- *     S<type><length><address><data><checksum>
+ *      S<type><length><address><data><checksum>
  *
  *      Where
  *      - length
@@ -204,7 +205,7 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
  *      - data
  *        is the data.
  *      - checksum
- *       is the sum of all the raw byte data in the record, from the length
+ *        is the sum of all the raw byte data in the record, from the length
  *        upwards, modulo 256 and subtracted from 255.
  *
  * This routine returns the length of the S-record.
@@ -227,9 +228,10 @@ make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags)
   const static char data_code_table[] = "123";
   const static char term_code_table[] = "987";
   const static char header_code_table[] = "000";
-  const static char *formats[] = { "S%c%02X%04X",
-                                  "S%c%02X%06X",
-                                  "S%c%02X%08X" };
+  const static char *formats[] =
+  {"S%c%02X%04X",
+   "S%c%02X%06X",
+   "S%c%02X%08X"};
   char const *code_table;
   int addr_size;
   int payload_size;
@@ -240,11 +242,11 @@ make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags)
     {
       tmp = flags;             /* Data or header record */
       code_table = abfd ? data_code_table : header_code_table;
-      binbuf = alloca (*maxrecsize/2);
+      binbuf = alloca (*maxrecsize / 2);
     }
   else
     {
-      tmp = flags >> SREC_TERM_SHIFT; /* Term record */
+      tmp = flags >> SREC_TERM_SHIFT;  /* Term record */
       code_table = term_code_table;
     }
 
@@ -274,20 +276,20 @@ make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags)
   /* Output the header.  */
 
   sprintf (srec, formats[addr_size - 2], code_table[addr_size - 2],
-          addr_size + payload_size + 1, (int)targ_addr);
+          addr_size + payload_size + 1, (int) targ_addr);
 
   /* Note that the checksum is calculated on the raw data, not the
      hexified data.  It includes the length, address and the data
      portions of the packet.  */
 
   checksum = 0;
-  
+
   checksum += (payload_size + addr_size + 1    /* Packet length */
-              + (targ_addr & 0xff)             /* Address... */
-              + ((targ_addr >>  8) & 0xff)
+              + (targ_addr & 0xff)     /* Address... */
+              + ((targ_addr >> 8) & 0xff)
               + ((targ_addr >> 16) & 0xff)
               + ((targ_addr >> 24) & 0xff));
-  
+
   p = srec + 1 + 1 + 2 + addr_size * 2;
 
   /* Build the Srecord.  */
@@ -296,8 +298,8 @@ make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags)
       unsigned char k;
 
       k = binbuf[tmp];
-      *p++ = hextab [k >> 4];
-      *p++ = hextab [k & 0xf];
+      *p++ = hextab[k >> 4];
+      *p++ = hextab[k & 0xf];
       checksum += k;
     }
 
index 252a3a86b8b10cab7e4a0025927d2c49b1bc579e..31261d198d4901169339e3b00d7c19cbcc8cc597 100644 (file)
--- a/gdb/dst.h
+++ b/gdb/dst.h
@@ -2,13 +2,13 @@
 /* Apollo object module DST (debug symbol table) description */
 
 #ifndef apollo_dst_h
-#define 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 */
+#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    
+ */
+#define dst_version_major    1
+#define dst_version_minor    3
 
 
 /*
-** Enumeration of debug record types appearing in .blocks and .symbols ...
-*/
+   ** 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_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_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_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_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_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_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_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;
+  }
+dst_rec_type_t;
 
 
 /*
-** Dummy bounds for variably dimensioned arrays:
-*/
+   ** 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.
-*/
+   ** 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;
+typedef long dst_rel_offset_t ALIGNED1;
 
 
 /* FIXME: Here and many places we make assumptions about sizes of host
@@ -109,116 +109,116 @@ typedef long dst_rel_offset_t  ALIGNED1;
    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.
-*/
+   ** 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;
+  {
+    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.
-*/
+   ** 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;
+  {
+    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.
-*/
+   ** 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_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;
+  }
+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.
-*/
+   ** 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;
-   
+      {
+       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;
+      {
+       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 )
 
@@ -236,44 +236,44 @@ typedef union
 */
 
 typedef enum
-    { 
-    dst_pc_code_locs,          /* ranges in loc strings are pc ranges */
+  {
+    dst_pc_code_locs,          /* ranges in loc strings are pc ranges */
     dst_comp_unit_END_OF_ENUM
-    }    
-    dst_comp_unit_flag_t;
+  }
+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_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;
+  }
+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;
+      {
+       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;
 
 
 /*--------------------
@@ -286,11 +286,11 @@ typedef struct
 */
 
 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;
+  {
+    unsigned short number_of_sections; /* size of array: */
+    unsigned long section_base[dst_dummy_array_size] ALIGNED1;
+  }
+dst_rec_section_tab_t ALIGNED1;
 
 
 /*-----------------
@@ -303,18 +303,18 @@ typedef struct
 */
 
 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;
+  {
+    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;
+  {
+    unsigned short number_of_files;    /* size of array: */
+    dst_file_desc_t files[dst_dummy_array_size] ALIGNED1;
+  }
+dst_rec_file_tab_t ALIGNED1;
 
 
 /*-----------------
@@ -327,11 +327,11 @@ typedef struct
 */
 
 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;
+  {
+    unsigned short number_of_names;    /* size of array: */
+    dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1;
+  }
+dst_rec_name_tab_t ALIGNED1;
 
 
 /*--------------
@@ -346,63 +346,63 @@ typedef struct
    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_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;
+  }
+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_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;
+  }
+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;
+  {
+    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;
+  {
+    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;
 
 
 /*--------------------------
@@ -415,12 +415,12 @@ typedef struct
 */
 
 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;
+  {
+    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 ==========*/
@@ -433,60 +433,60 @@ typedef struct
 */
 
 typedef struct
-    {
-    float    r;      /* real part */
-    float    i;      /* imaginary part */
-    }
-    dst_complex_t;
+  {
+    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;
+  {
+    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;
+  {
+    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) */
+  {
+    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;
+      {
+       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;
+  {
+    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
@@ -496,27 +496,27 @@ typedef struct
 
 /* 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_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;
+  }
+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;
+  {
+    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;
 
 
 /*----------------
@@ -526,7 +526,7 @@ typedef struct
 */
 
 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 */
@@ -538,8 +538,8 @@ typedef enum
     dst_var_loc_pc_rel,                /* PC relative. Really. */
     dst_var_loc_external,      /* External */
     dst_var_loc_END_OF_ENUM
-    }
-    dst_var_loc_t;
+  }
+dst_var_loc_t;
 
 /* Locations come in two versions. The sort, and the long. The difference
  * between the short and the long is the addition of a statement number
@@ -548,42 +548,46 @@ typedef enum
  * 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: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;
+  {
+    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. */
+  {
+    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;
+      }
+    locs;
+  }
+dst_rec_var_t;
 
 /*----------------
   old LABEL record
@@ -592,12 +596,12 @@ typedef struct
 */
 
 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;
+  {
+    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
@@ -606,12 +610,12 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*-------------
@@ -642,33 +646,33 @@ typedef struct
 */
 
 typedef enum
-    {
-    dst_use_span_field,  
+  {
+    dst_use_span_field,
     dst_compute_from_prev,
-    dst_compute_from_next,        
+    dst_compute_from_next,
     dst_span_comp_END_OF_ENUM
-    }
-    dst_span_comp_t;
+  }
+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;
+  {
+    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;
 
 
 /*-----------------
@@ -680,18 +684,18 @@ typedef struct
 /* 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;
+  {
+    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;
 
 
 /*---------------
@@ -703,19 +707,19 @@ typedef struct
 /* 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;
+  {
+    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;
 
 
 /*---------------
@@ -725,14 +729,14 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*-----------------------------
@@ -743,15 +747,15 @@ typedef struct
 */
 
 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) */
+  {
+    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;
+    dst_rel_offset_t elem_noffsets[dst_dummy_array_size];
+  }
+dst_rec_implicit_enum_t ALIGNED1;
 
 
 /*-----------------------------
@@ -762,22 +766,22 @@ typedef struct
 */
 
 typedef struct
-    {
-    dst_rel_offset_t   noffset;       /* offset to element name string */
-    long               value;         /* element value */
-    }
-    dst_enum_elem_t;
+  {
+    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) */
+  {
+    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;
+    dst_enum_elem_t elems[dst_dummy_array_size];
+  }
+dst_rec_explicit_enum_t ALIGNED1;
 
 
 /*-----------------------
@@ -797,38 +801,38 @@ typedef struct
    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;
+  {
+    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;
+  {
+    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;
+  }
+dst_field_format_t;
 
 /*
    Record field descriptor, long form.  The format of the field information
@@ -838,60 +842,63 @@ typedef enum
    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 */
+  {
+    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;
+      {
+       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 */
+  {
+    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;
+      {
+       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;
 
 
 /*-------------
@@ -901,12 +908,12 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*---------------
@@ -918,18 +925,18 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*--------------
@@ -939,12 +946,12 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*------------------
@@ -955,38 +962,38 @@ typedef struct
 
 /* 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_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;
+  }
+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;
+  {
+    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;
+  {
+    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
@@ -997,12 +1004,12 @@ typedef struct
 */
 
 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;
+  {
+    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
@@ -1017,15 +1024,15 @@ typedef struct
 */
 
 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;
+  {
+    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
@@ -1034,13 +1041,13 @@ typedef struct
  */
 
 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;
+  {
+    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 
@@ -1049,12 +1056,12 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*-----------------------
@@ -1065,10 +1072,10 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned long  size;       /* size (bytes) */
-    }
-    dst_rec_aux_size_t ALIGNED1;
+  {
+    unsigned long size;                /* size (bytes) */
+  }
+dst_rec_aux_size_t ALIGNED1;
 
 
 /*-----------------------
@@ -1079,10 +1086,10 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned short    alignment;  /* # of low order zero bits */
-    }
-    dst_rec_aux_align_t ALIGNED1;
+  {
+    unsigned short alignment;  /* # of low order zero bits */
+  }
+dst_rec_aux_align_t ALIGNED1;
 
 
 /*-----------------------------
@@ -1093,11 +1100,11 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned short field_no;       /* field number */
-    unsigned long  size;           /* size (bits) */
-    }
-    dst_rec_aux_field_size_t ALIGNED1;
+  {
+    unsigned short field_no;   /* field number */
+    unsigned long size;                /* size (bits) */
+  }
+dst_rec_aux_field_size_t ALIGNED1;
 
 
 
@@ -1109,11 +1116,11 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned short field_no;       /* field number */
-    unsigned long  foffset;        /* offset */
-    }
-    dst_rec_aux_field_off_t ALIGNED1;
+  {
+    unsigned short field_no;   /* field number */
+    unsigned long foffset;     /* offset */
+  }
+dst_rec_aux_field_off_t ALIGNED1;
 
 
 /*-----------------------------
@@ -1124,11 +1131,11 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned short field_no;       /* field number */
-    unsigned short alignment;      /* number of low order zero bits */
-    }
-    dst_rec_aux_field_align_t ALIGNED1;
+  {
+    unsigned short field_no;   /* field number */
+    unsigned short alignment;  /* number of low order zero bits */
+  }
+dst_rec_aux_field_align_t ALIGNED1;
 
 
 /*----------------------------
@@ -1139,19 +1146,19 @@ typedef struct
 */
 
 typedef enum
-    {
-    dst_low_bound,       /* the low bound is variable */
-    dst_high_bound,      /* the high bound is variable */
+  {
+    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;
+  }
+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;
+  {
+    unsigned short which;      /* which bound */
+    dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */
+  }
+dst_rec_aux_var_bound_t ALIGNED1;
 
 
 /*----------------------------------
@@ -1170,13 +1177,13 @@ typedef struct
 */
 
 typedef struct
-    {
-    dst_type_t     parent_type;             /* reference to inherited type */
+  {
+    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;
+    boolean orig_is_pointer:1;
+    int unused:15;             /* must be zero */
+  }
+dst_rec_aux_type_deriv_t ALIGNED1;
 
 
 /*------------------------------------
@@ -1187,10 +1194,10 @@ typedef struct
 */
 
 typedef struct
-    {
+  {
     dst_rel_offset_t loffset;
-    }
-    dst_rec_aux_lifetime_t ALIGNED1;
+  }
+dst_rec_aux_lifetime_t ALIGNED1;
 
 
 /*-------------------------------
@@ -1206,10 +1213,10 @@ typedef struct
 */
 
 typedef struct
-    {
+  {
     dst_rel_offset_t voffset;
-    }
-    dst_rec_aux_ptr_base_t ALIGNED1;
+  }
+dst_rec_aux_ptr_base_t ALIGNED1;
 
 
 /*---------------------------------
@@ -1228,11 +1235,11 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*==========================================================*/
@@ -1255,11 +1262,11 @@ typedef struct
 */
 
 typedef struct
-    {
-    unsigned long length;               
-    char          text[dst_dummy_array_size];
-    }
-    dst_rec_string_tab_t ALIGNED1;
+  {
+    unsigned long length;
+    char text[dst_dummy_array_size];
+  }
+dst_rec_string_tab_t ALIGNED1;
 
 
 /*-----------------------
@@ -1270,10 +1277,10 @@ typedef struct
 */
 
 typedef struct
-    {
-    dst_rel_offset_t   lang_qual_name;
-    }
-    dst_rec_aux_qual_t ALIGNED1;
+  {
+    dst_rel_offset_t lang_qual_name;
+  }
+dst_rec_aux_qual_t ALIGNED1;
 
 
 /*----------------
@@ -1284,10 +1291,10 @@ typedef struct
 */
 
 typedef struct
-    {
-    dst_rel_offset_t   rec_off;
-    }
-    dst_rec_forward_t ALIGNED1;
+  {
+    dst_rel_offset_t rec_off;
+  }
+dst_rec_forward_t ALIGNED1;
 
 
 /*-------------------------------
@@ -1298,11 +1305,11 @@ typedef struct
 */
 
 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;
+  {
+    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;
 
 
 /*------------------
@@ -1313,216 +1320,218 @@ typedef struct
 */
 
 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;
+  {
+    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.
-*/
+   ** 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;
+  }
+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;
+  {
+    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.
-*/
+   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    
+#define dst_ln_escape_flag    -8
 
 /*
-  Escape function codes:
-*/
+   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_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;
+  }
+dst_ln_escape_t;
 
 /*
-  Line number table entry
-*/
+   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;
-    
+      {
+       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];
+      {
+       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;
+typedef struct dst_sec_struct
+  {
+    char *buffer;
+    long position;
+    long size;
+    long base;
+  }
+dst_sec;
 
 
 /* Macros for access to the data */
@@ -1578,7 +1587,7 @@ typedef struct dst_sec_struct {
 /*
  * Type codes for loc strings. I'm not entirely certain about all of
  * these, but they seem to work.
- *                             troy@cbme.unsw.EDU.AU
+ *                              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
@@ -1596,45 +1605,46 @@ typedef struct dst_sec_struct {
  * 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
+  {
+    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
+    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;
+    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
@@ -1644,16 +1654,18 @@ typedef enum
 #define        dst_multiply_256        ((char) 0x73)
 
 typedef struct
-{
-       char    code : 5;
-       char    arg : 3;
-} dst_loc_header_t ALIGNED1;
+  {
+    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;
+  {
+    dst_loc_header_t header;
+    char data;
+  }
+dst_loc_entry_t ALIGNED1;
 
 #undef ALIGNED1
-#endif  /* apollo_dst_h */
+#endif /* apollo_dst_h */
index d23f9f6ed415d4c8ad81d39b7e9881b38b5b59d0..1561586bf215fc1b67d9480223b5646306d4d59d 100644 (file)
@@ -2,21 +2,22 @@
    Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
    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 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.  */
 \f
 #include "defs.h"
 #include "symtab.h"
@@ -33,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "dst.h"
 
 CORE_ADDR cur_src_start_addr, cur_src_end_addr;
-dst_sec        blocks_info, lines_info, symbols_info;
+dst_sec blocks_info, lines_info, symbols_info;
 
 /* Vector of line number information.  */
 
@@ -105,7 +106,8 @@ dst_record_line (line, pc)
     }
 
   e = line_vector->item + line_vector_index++;
-  e->line = line; e->pc = pc;
+  e->line = line;
+  e->pc = pc;
 }
 \f
 /* Start a new symtab for a new source file.
@@ -118,7 +120,7 @@ dst_start_symtab ()
   /* Initialize the source file line number information for this file.  */
 
   if (line_vector)             /* Unlikely, but maybe possible? */
-    free ((PTR)line_vector);
+    free ((PTR) line_vector);
   line_vector_index = 0;
   line_vector_length = 1000;
   prev_line_number = -2;       /* Force first line number to be explicit */
@@ -134,19 +136,19 @@ dst_start_symtab ()
 
 static void
 complete_symtab (name, start_addr, size)
-    char *name;
-    CORE_ADDR start_addr;
-    unsigned int size;
+     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)
+  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;
+      current_objfile->ei.entry_file_lowpc = cur_src_start_addr;
+      current_objfile->ei.entry_file_highpc = cur_src_end_addr;
     }
 }
 
@@ -178,12 +180,12 @@ dst_end_symtab (objfile)
   symtab->filename = last_source_file;
   symtab->dirname = NULL;
   symtab->debugformat = obsavestring ("Apollo DST", 10,
-                                     &objfile -> symbol_obstack);
+                                     &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)));
+                           + lv->nitems * sizeof (struct linetable_entry)));
 
   free_named_symtabs (symtab->filename);
 
@@ -206,7 +208,7 @@ static void
 dst_symfile_init (objfile)
      struct objfile *objfile;
 {
-  asection     *section;
+  asection *section;
   bfd *abfd = objfile->obfd;
 
   init_entry_point_info (objfile);
@@ -236,11 +238,11 @@ find_dst_sections (abfd, asect, vpinfo)
 /* End of warning */
 
   section = NULL;
-  if (!strcmp(asect->name, ".blocks"))
+  if (!strcmp (asect->name, ".blocks"))
     section = &blocks_info;
-  else if (!strcmp(asect->name, ".lines"))
+  else if (!strcmp (asect->name, ".lines"))
     section = &lines_info;
-  else if (!strcmp(asect->name, ".symbols"))
+  else if (!strcmp (asect->name, ".symbols"))
     section = &symbols_info;
   if (!section)
     return;
@@ -274,13 +276,13 @@ dst_symfile_read (objfile, section_offsets, mainline)
   int symtab_offset;
   int stringtab_offset;
 
-  symfile_bfd = abfd;                  /* Kludge for swap routines */
+  symfile_bfd = abfd;          /* Kludge for swap routines */
 
 /* WARNING WILL ROBINSON!  ACCESSING BFD-PRIVATE DATA HERE!  FIXME!  */
-   desc = fileno ((FILE *)(abfd->iostream));   /* File descriptor */
+  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);
+  bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL);
 
   val = init_dst_sections (desc);
   if (val < 0)
@@ -298,7 +300,7 @@ dst_symfile_read (objfile, section_offsets, mainline)
 
   {
     struct symtab *s;
-    for (s = objfile -> symtabs; s != NULL; s = s -> next)
+    for (s = objfile->symtabs; s != NULL; s = s->next)
       {
        sort_symtab_syms (s);
       }
@@ -314,7 +316,7 @@ static void
 dst_new_init (ignore)
      struct objfile *ignore;
 {
-       /* Nothin' to do */
+  /* Nothin' to do */
 }
 
 /* Perform any local cleanups required when we are done with a particular
@@ -326,10 +328,10 @@ static void
 dst_symfile_finish (objfile)
      struct objfile *objfile;
 {
-    /* Nothing to do */
+  /* Nothing to do */
 }
-
 \f
+
 /* Get the next line number from the DST. Returns 0 when we hit an
  * end directive or cannot continue for any other reason.
  *
@@ -337,1171 +339,1174 @@ dst_symfile_finish (objfile)
  * this is what was really intended.
  */
 static int
-get_dst_line(buffer, pc)
-    signed char **buffer;
-    long *pc;
+get_dst_line (buffer, pc)
+     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;
+  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)
+  while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag)
+    {
+      switch (entry->esc.esc_code)
        {
-               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;
+       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;
        }
-       last_line += dst_ln_ln_delta(*entry);
-       last_pc += entry->delta.pc_delta * 2;
-       (*buffer)++;
-       dst_record_line(last_line, last_pc);
-       return 1;
+      *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(buffer, address)
-    char *buffer;
-    long address;
+static void
+enter_all_lines (buffer, address)
+     char *buffer;
+     long address;
 {
-    if (buffer)
-       while (get_dst_line(&buffer, &address));
+  if (buffer)
+    while (get_dst_line (&buffer, &address));
 }
 
 static int
-get_dst_entry(buffer, ret_entry)
-    char *buffer;
-    dst_rec_ptr_t *ret_entry;
+get_dst_entry (buffer, ret_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)
+  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;
+      size = 0;
+      break;
     case dst_typ_comp_unit:
-       size = sizeof(DST_comp_unit(entry));
-       break;
+      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;
+      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;
+      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;
+      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;
+      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;
+      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;
+      size = sizeof (DST_pointer (entry));
+      break;
     case dst_typ_array:
-       size = sizeof(DST_array(entry));
-       break;
+      size = sizeof (DST_array (entry));
+      break;
     case dst_typ_subrange:
-       size = sizeof(DST_subrange(entry));
-       break;
+      size = sizeof (DST_subrange (entry));
+      break;
     case dst_typ_set:
-       size = sizeof(DST_set(entry));
-       break;
+      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;
+      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;
+      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;
+      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;
+      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;
+      size = sizeof (DST_file (entry));
+      break;
     case dst_typ_offset:
-       size = sizeof(DST_offset(entry));
-       break;
+      size = sizeof (DST_offset (entry));
+      break;
     case dst_typ_alias:
-       size = sizeof(DST_alias(entry));
-       break;
+      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;
+      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;
+      size = -1;
+      break;
     case dst_typ_old_label:
-       size = sizeof(DST_old_label(entry));
-       break;
+      size = sizeof (DST_old_label (entry));
+      break;
     case dst_typ_scope:
-       size = sizeof(DST_scope(entry));
-       break;
+      size = sizeof (DST_scope (entry));
+      break;
     case dst_typ_end_scope:
-       size = 0;
-       break;
+      size = 0;
+      break;
     case dst_typ_25:
     case dst_typ_26:
-       size = -1;
-       break;
+      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;
+      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;
+      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;
+      size = sizeof (DST_aux_size (entry));
+      break;
     case dst_typ_aux_align:
-       size = sizeof(DST_aux_align(entry));
-       break;
+      size = sizeof (DST_aux_align (entry));
+      break;
     case dst_typ_aux_field_size:
-       size = sizeof(DST_aux_field_size(entry));
-       break;
+      size = sizeof (DST_aux_field_size (entry));
+      break;
     case dst_typ_aux_field_off:
-       size = sizeof(DST_aux_field_off(entry));
-       break;
+      size = sizeof (DST_aux_field_off (entry));
+      break;
     case dst_typ_aux_field_align:
-       size = sizeof(DST_aux_field_align(entry));
-       break;
+      size = sizeof (DST_aux_field_align (entry));
+      break;
     case dst_typ_aux_qual:
-       size = sizeof(DST_aux_qual(entry));
-       break;
+      size = sizeof (DST_aux_qual (entry));
+      break;
     case dst_typ_aux_var_bound:
-       size = sizeof(DST_aux_var_bound(entry));
-       break;
+      size = sizeof (DST_aux_var_bound (entry));
+      break;
     case dst_typ_extension:
-       size = DST_extension(entry).rec_size;
-       break;
+      size = DST_extension (entry).rec_size;
+      break;
     case dst_typ_string:
-       size = sizeof(DST_string(entry));
-       break;
+      size = sizeof (DST_string (entry));
+      break;
     case dst_typ_old_entry:
-       size = 48; /* Obsolete entry type */
-       break;
+      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;
+      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;
+      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;
+      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;
+      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;
+      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;
+      size = sizeof (DST_variable (entry));
+      break;
     case dst_typ_label:
-       size = sizeof(DST_label(entry));
-       break;
+      size = sizeof (DST_label (entry));
+      break;
     case dst_typ_entry:
-       size = sizeof(DST_entry(entry));
-       break;
+      size = sizeof (DST_entry (entry));
+      break;
     case dst_typ_aux_lifetime:
-       size = sizeof(DST_aux_lifetime(entry));
-       break;
+      size = sizeof (DST_aux_lifetime (entry));
+      break;
     case dst_typ_aux_ptr_base:
-       size = sizeof(DST_aux_ptr_base(entry));
-       break;
+      size = sizeof (DST_aux_ptr_base (entry));
+      break;
     case dst_typ_aux_src_range:
-       size = sizeof(DST_aux_src_range(entry));
-       break;
+      size = sizeof (DST_aux_src_range (entry));
+      break;
     case dst_typ_aux_reg_val:
-       size = sizeof(DST_aux_reg_val(entry));
-       break;
+      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;
+      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;
+      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;
+      size = -1;
+      break;
     }
-    if (size == -1)
+  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;
+      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;
+  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(buffer, entry, table)
-    char **buffer;
-    dst_rec_ptr_t *entry;
-    dst_sec *table;
+static int
+next_dst_entry (buffer, entry, table)
+     char **buffer;
+     dst_rec_ptr_t *entry;
+     dst_sec *table;
 {
-    if (*buffer - table->buffer >= table->size)
+  if (*buffer - table->buffer >= table->size)
     {
-       *entry = NULL;
-       return 0;
+      *entry = NULL;
+      return 0;
     }
-    *buffer += get_dst_entry(*buffer, entry);
-    return 1;
+  *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;
+static dst_rec_ptr_t section_table = NULL;
 
 char *
-get_sec_ref(ref)
-    dst_sect_ref_t *ref;
+get_sec_ref (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);
+  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)
+dst_get_addr (int section, long offset)
 {
-       if (!section_table || !section)
-               return 0;
-       return DST_section_tab(section_table).section_base[section-1] + offset;
+  if (!section_table || !section)
+    return 0;
+  return DST_section_tab (section_table).section_base[section - 1] + offset;
 }
 
 CORE_ADDR
-dst_sym_addr(ref)
-    dst_sect_ref_t *ref;
+dst_sym_addr (ref)
+     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;
+  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 type *
-create_new_type(objfile)
-    struct objfile *objfile;
+create_new_type (objfile)
+     struct objfile *objfile;
 {
-       struct type *type;
+  struct type *type;
 
-       type = (struct type *)
-               obstack_alloc (&objfile->symbol_obstack, sizeof (struct type));
-       memset(type, 0, sizeof(struct type));
-       return type;
+  type = (struct type *)
+    obstack_alloc (&objfile->symbol_obstack, sizeof (struct type));
+  memset (type, 0, sizeof (struct type));
+  return type;
 }
 
 static struct symbol *
-create_new_symbol(objfile, name)
-    struct objfile *objfile;
-    char *name;
+create_new_symbol (objfile, name)
+     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;
+  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 PARAMS ((struct objfile *, dst_rec_ptr_t));
+  decode_dst_type PARAMS ((struct objfile *, dst_rec_ptr_t));
 
 static struct type *
-decode_type_desc(objfile, type_desc, base)
-       struct objfile *objfile;
-       dst_type_t *type_desc;
-       dst_rec_ptr_t base;
+decode_type_desc (objfile, type_desc, base)
+     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)
+  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)
        {
-               entry = (dst_rec_ptr_t) DST_OFFSET(base,
-                                       dst_user_type_offset(*type_desc));
-               type = decode_dst_type(objfile, entry);
+       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;
        }
-       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;
+    }
+  return type;
 }
 
-struct structure_list
-    {
-    struct structure_list *next;
-    struct type *type;
-    };
+struct structure_list
+{
+  struct structure_list *next;
+  struct type *type;
+};
 
 static struct structure_list *struct_list = NULL;
 
 static struct type *
-find_dst_structure(name)
-    char *name;
+find_dst_structure (name)
+     char *name;
 {
-       struct structure_list *element;
+  struct structure_list *element;
 
-       for (element = struct_list; element; element = element->next)
-               if (!strcmp(name, TYPE_NAME(element->type)))
-                       return element->type;
-       return NULL;
+  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(objfile, entry, code, version)
-    struct objfile *objfile;
-    dst_rec_ptr_t entry;
-    int code;
-    int version;
+decode_dst_structure (objfile, entry, code, version)
+     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)
-       {
-               free((PTR) name);
-               return type;
-       }
-       type = create_new_type(objfile);
-       TYPE_NAME(type) = obstack_copy0 (&objfile->symbol_obstack,
-                                               name, strlen(name));
-       free((PTR) 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++)
+  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)
+    {
+      free ((PTR) name);
+      return type;
+    }
+  type = create_new_type (objfile);
+  TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
+                                   name, strlen (name));
+  free ((PTR) 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)
        {
-               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;
+       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;
        }
-       return type;
+      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(objfile, entry)
-    struct objfile *objfile;
-    dst_rec_ptr_t entry;
+decode_dst_type (objfile, entry)
+     struct objfile *objfile;
+     dst_rec_ptr_t entry;
 {
-       struct type *child_type, *type, *range_type, *index_type;
+  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;
-       }
+  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;
+struct symbol_list
+{
+  struct symbol_list *next;
+  struct symbol *symbol;
 };
 
-static struct  symbol_list *dst_global_symbols = NULL;
-static int     total_globals = 0;
+static struct symbol_list *dst_global_symbols = NULL;
+static int total_globals = 0;
 
 static void
-decode_dst_locstring(locstr, sym)
-    char *locstr;
-    struct symbol *sym;
+decode_dst_locstring (locstr, sym)
+     char *locstr;
+     struct symbol *sym;
 {
-       dst_loc_entry_t *entry, *next_entry;
-       CORE_ADDR       temp;
-       int count = 0;
+  dst_loc_entry_t *entry, *next_entry;
+  CORE_ADDR temp;
+  int count = 0;
 
-       while(1)
+  while (1)
+    {
+      if (count++ == 100)
        {
-               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;
-               }
+         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(objfile, entry, name, nsyms_ret)
-    struct objfile *objfile;
-    dst_rec_ptr_t entry;
-    char *name;
-    int *nsyms_ret;
+process_dst_symbols (objfile, entry, name, nsyms_ret)
+     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)
+  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)
        {
-               *nsyms_ret = 0;
-               return NULL;
+         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;
        }
-       location = (char *) entry;
-       while (NEXT_SYM(&location, &entry) &&
-              entry->rec_type != dst_typ_end_scope)
+      else if (entry->rec_type == dst_typ_variable)
        {
-               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
+         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)
                {
-                       element->next = list;
-                       list = element;
-                       nsyms++;
+                 sym->aux_value.basereg = loc_index;
                }
-               element->symbol = sym;
+             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++;
        }
-       *nsyms_ret = nsyms;
-       return list;
+      else
+       {
+         element->next = list;
+         list = element;
+         nsyms++;
+       }
+      element->symbol = sym;
+    }
+  *nsyms_ret = nsyms;
+  return list;
 }
 
 
 static struct symbol *
-process_dst_function(objfile, entry, name, address)
-    struct objfile *objfile;
-    dst_rec_ptr_t entry;
-    char *name;
-    CORE_ADDR address;
+process_dst_function (objfile, entry, name, address)
+     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;
+  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;
+  type = builtin_type_int;
+  sym = create_new_symbol (objfile, name);
+  SYMBOL_CLASS (sym) = LOC_BLOCK;
 
-       if (entry)
+  if (entry)
+    {
+      location = (char *) entry;
+      do
        {
-               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);
-                       }
-               }
+         NEXT_SYM (&location, &sym_entry);
        }
+      while (sym_entry && sym_entry->rec_type != dst_typ_signature);
 
-       if (!type->function_type)
+      if (sym_entry)
        {
-               ftype = create_new_type(objfile);
-               type->function_type = ftype;
-               ftype->target_type = type;
-               ftype->code = TYPE_CODE_FUNC;
+         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);
+           }
        }
-       SYMBOL_TYPE(sym) = type->function_type;
+    }
 
-       /* Now add ourselves to the global symbols list */
-       element = (struct symbol_list *)
-                       xmalloc(sizeof(struct symbol_list));
+  if (!type->function_type)
+    {
+      ftype = create_new_type (objfile);
+      type->function_type = ftype;
+      ftype->target_type = type;
+      ftype->code = 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;
+  element->next = dst_global_symbols;
+  dst_global_symbols = element;
+  total_globals++;
+  element->symbol = sym;
 
-       return sym;
+  return sym;
 }
 
 static struct block *
-process_dst_block(objfile, entry)
-    struct objfile *objfile;
-    dst_rec_ptr_t entry;
+process_dst_block (objfile, entry)
+     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 *));
+  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;
 
-       symnum = 0;
-       while (symlist)
-       {
-               nextsym = symlist->next;
+    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;
+      block->sym[symnum] = symlist->symbol;
 
-               free((PTR) 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;
+      free ((PTR) 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)
+  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_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;
-               }
+         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;
+    }
+  record_pending_block (objfile, block, NULL);
+  return block;
 }
 
 
@@ -1509,91 +1514,91 @@ static void
 read_dst_symtab (objfile)
      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;
-
-                               free((PTR) 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)
+  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)
        {
-               element = struct_list;
-               struct_list = element->next;
-               free((PTR) element);
+         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;
+
+             free ((PTR) 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;
+      free ((PTR) element);
+    }
 }
-
 \f
+
 /* Support for line number handling */
 static char *linetab = NULL;
 static long linetab_offset;
@@ -1603,27 +1608,27 @@ static unsigned long linetab_size;
    external (unswapped) format in memory; we'll swap them as we enter
    them into GDB's data structures.  */
 static int
-init_one_section(chan, secinfo)
-    int chan;
-    dst_sec *secinfo;
+init_one_section (chan, secinfo)
+     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;
+      || lseek (chan, secinfo->position, 0) == -1
+      || (secinfo->buffer = xmalloc (secinfo->size)) == NULL
+      || myread (chan, secinfo->buffer, secinfo->size) == -1)
+    return 0;
   else
-       return 1;
+    return 1;
 }
+
 static int
 init_dst_sections (chan)
-    int chan;
+     int chan;
 {
 
-  if (!init_one_section(chan, &blocks_info) ||
-      !init_one_section(chan, &lines_info) ||
-      !init_one_section(chan, &symbols_info))
+  if (!init_one_section (chan, &blocks_info) ||
+      !init_one_section (chan, &lines_info) ||
+      !init_one_section (chan, &symbols_info))
     return -1;
   else
     return 0;
@@ -1631,7 +1636,8 @@ init_dst_sections (chan)
 
 /* Fake up support for relocating symbol addresses.  FIXME.  */
 
-struct section_offsets dst_symfile_faker = {0};
+struct section_offsets dst_symfile_faker =
+{0};
 
 struct section_offsets *
 dst_symfile_offsets (objfile, addr)
@@ -1648,18 +1654,18 @@ 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 */
+  (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 ()
 {
-  add_symtab_fns(&dst_sym_fns);
+  add_symtab_fns (&dst_sym_fns);
 }
index c76da776d60a306d8f4623fb00aaf10c5c9f28d0..8565040a3fdb801df58020a41d63bf47c920e6a0 100644 (file)
@@ -2,21 +2,22 @@
    GDB, the GNU debugger.
    Copyright 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -30,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Type of function passed to bfd_map_over_sections.  */
 
-typedef void (*section_map_func) PARAMS ((bfd *abfd, asection *sect, PTR obj));
+typedef void (*section_map_func) PARAMS ((bfd * abfd, asection * sect, PTR obj));
 
 /* Packet escape character used by Densan monitor.  */
 
@@ -51,40 +52,40 @@ extern void report_transfer_performance PARAMS ((unsigned long,
    This structure describes a field in a bitmapped register.  */
 
 struct bit_field
-{
-  char *prefix;                /* string appearing before the value */
-  char *suffix;                /* string appearing after the value */
-  char *user_name;     /* name used by human when entering field value */
-  int  length;         /* number of bits in the field */
-  int  start;          /* starting (least significant) bit number of field */
-};
-        
+  {
+    char *prefix;              /* string appearing before the value */
+    char *suffix;              /* string appearing after the value */
+    char *user_name;           /* name used by human when entering field value */
+    int length;                        /* number of bits in the field */
+    int start;                 /* starting (least significant) bit number of field */
+  };
+
 /* Local functions for register manipulation.  */
 
 static void r3900_supply_register PARAMS ((char *regname, int regnamelen,
                                           char *val, int vallen));
 static void fetch_bad_vaddr PARAMS ((void));
-static unsigned long fetch_fields PARAMS ((struct bit_field *bf));
+static unsigned long fetch_fields PARAMS ((struct bit_field * bf));
 static void fetch_bitmapped_register PARAMS ((int regno,
-                                                  struct bit_field *bf));
+                                             struct bit_field * bf));
 static void r3900_fetch_registers PARAMS ((int regno));
 static void store_bitmapped_register PARAMS ((int regno,
-                                                   struct bit_field *bf));
+                                             struct bit_field * bf));
 static void r3900_store_registers PARAMS ((int regno));
 
 /* Local functions for fast binary loading.  */
 
 static void write_long PARAMS ((char *buf, long n));
 static void write_long_le PARAMS ((char *buf, long n));
-static int  debug_readchar PARAMS ((int hex));
+static int debug_readchar PARAMS ((int hex));
 static void debug_write PARAMS ((unsigned char *buf, int buflen));
 static void ignore_packet PARAMS ((void));
 static void send_packet PARAMS ((char type, unsigned char *buf, int buflen,
                                 int seq));
 static void process_read_request PARAMS ((unsigned char *buf, int buflen));
-static void count_section PARAMS ((bfd *abfd, asection *s,
+static void count_section PARAMS ((bfd * abfd, asection * s,
                                   unsigned int *section_count));
-static void load_section PARAMS ((bfd *abfd, asection *s,
+static void load_section PARAMS ((bfd * abfd, asection * s,
                                  unsigned int *data_count));
 static void r3900_load PARAMS ((char *filename, int from_tty));
 
@@ -118,41 +119,176 @@ static int ethernet = 0;
 
 static char *r3900_regnames[NUM_REGS] =
 {
-  "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",
-
-  "S",                 /* PS_REGNUM */
-  "l",         /* LO_REGNUM */
-  "h",         /* HI_REGNUM */
-  "B",         /* BADVADDR_REGNUM */
-  "Pcause",    /* CAUSE_REGNUM */
-  "p"          /* PC_REGNUM */
+  "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",
+
+  "S",                         /* PS_REGNUM */
+  "l",                         /* LO_REGNUM */
+  "h",                         /* HI_REGNUM */
+  "B",                         /* BADVADDR_REGNUM */
+  "Pcause",                    /* CAUSE_REGNUM */
+  "p"                          /* PC_REGNUM */
 };
 
 
 /* Table of register names produced by monitor's register dump command.  */
 
 static struct reg_entry
+  {
+    char *name;
+    int regno;
+  }
+reg_table[] =
 {
-  char *name;
-  int regno;
-} reg_table[] =
-{
-  { "r0_zero", 0 },  { "r1_at",   1 },  { "r2_v0",   2 },  { "r3_v1",   3 },
-  { "r4_a0",   4 },  { "r5_a1",   5 },  { "r6_a2",   6 },  { "r7_a3",   7 },
-  { "r8_t0",   8 },  { "r9_t1",   9 },  { "r10_t2", 10 },  { "r11_t3", 11 },
-  { "r12_t4", 12 },  { "r13_t5", 13 },  { "r14_t6", 14 },  { "r15_t7", 15 },
-  { "r16_s0", 16 },  { "r17_s1", 17 },  { "r18_s2", 18 },  { "r19_s3", 19 },
-  { "r20_s4", 20 },  { "r21_s5", 21 },  { "r22_s6", 22 },  { "r23_s7", 23 },
-  { "r24_t8", 24 },  { "r25_t9", 25 },  { "r26_k0", 26 },  { "r27_k1", 27 },
-  { "r28_gp", 28 },  { "r29_sp", 29 },  { "r30_fp", 30 },  { "r31_ra", 31 },
-  { "HI",     HI_REGNUM },
-  { "LO",     LO_REGNUM },
-  { "PC",     PC_REGNUM },
-  { "BadV",   BADVADDR_REGNUM },
-  { NULL,     0 }
+  {
+    "r0_zero", 0
+  }
+  ,
+  {
+    "r1_at", 1
+  }
+  ,
+  {
+    "r2_v0", 2
+  }
+  ,
+  {
+    "r3_v1", 3
+  }
+  ,
+  {
+    "r4_a0", 4
+  }
+  ,
+  {
+    "r5_a1", 5
+  }
+  ,
+  {
+    "r6_a2", 6
+  }
+  ,
+  {
+    "r7_a3", 7
+  }
+  ,
+  {
+    "r8_t0", 8
+  }
+  ,
+  {
+    "r9_t1", 9
+  }
+  ,
+  {
+    "r10_t2", 10
+  }
+  ,
+  {
+    "r11_t3", 11
+  }
+  ,
+  {
+    "r12_t4", 12
+  }
+  ,
+  {
+    "r13_t5", 13
+  }
+  ,
+  {
+    "r14_t6", 14
+  }
+  ,
+  {
+    "r15_t7", 15
+  }
+  ,
+  {
+    "r16_s0", 16
+  }
+  ,
+  {
+    "r17_s1", 17
+  }
+  ,
+  {
+    "r18_s2", 18
+  }
+  ,
+  {
+    "r19_s3", 19
+  }
+  ,
+  {
+    "r20_s4", 20
+  }
+  ,
+  {
+    "r21_s5", 21
+  }
+  ,
+  {
+    "r22_s6", 22
+  }
+  ,
+  {
+    "r23_s7", 23
+  }
+  ,
+  {
+    "r24_t8", 24
+  }
+  ,
+  {
+    "r25_t9", 25
+  }
+  ,
+  {
+    "r26_k0", 26
+  }
+  ,
+  {
+    "r27_k1", 27
+  }
+  ,
+  {
+    "r28_gp", 28
+  }
+  ,
+  {
+    "r29_sp", 29
+  }
+  ,
+  {
+    "r30_fp", 30
+  }
+  ,
+  {
+    "r31_ra", 31
+  }
+  ,
+  {
+    "HI", HI_REGNUM
+  }
+  ,
+  {
+    "LO", LO_REGNUM
+  }
+  ,
+  {
+    "PC", PC_REGNUM
+  }
+  ,
+  {
+    "BadV", BADVADDR_REGNUM
+  }
+  ,
+  {
+    NULL, 0
+  }
 };
 
 
@@ -162,81 +298,81 @@ static struct reg_entry
    cache register that the monitor displays.  Register fields that should
    be ignored have a length of zero in the tables below.  */
 
-static struct bit_field status_fields [] =
+static struct bit_field status_fields[] =
 {
   /* Status register portion */
-  { "SR[<CU=", " ",    "cu",   4, 28 },
-  { "RE=",     " ",    "re",   1, 25 },
-  { "BEV=",    " ",    "bev",  1, 22 },
-  { "TS=",     " ",    "ts",   1, 21 },
-  { "Nmi=",    " ",    "nmi",  1, 20 },
-  { "INT=",    " ",    "int",  6, 10 },
-  { "SW=",     ">]",   "sw",   2,  8 },
-  { "[<KUO=",  " ",    "kuo",  1,  5 },
-  { "IEO=",    " ",    "ieo",  1,  4 },
-  { "KUP=",    " ",    "kup",  1,  3 },
-  { "IEP=",    " ",    "iep",  1,  2 },
-  { "KUC=",    " ",    "kuc",  1,  1 },
-  { "IEC=",    ">]",   "iec",  1,  0 },
+  {"SR[<CU=", " ", "cu", 4, 28},
+  {"RE=", " ", "re", 1, 25},
+  {"BEV=", " ", "bev", 1, 22},
+  {"TS=", " ", "ts", 1, 21},
+  {"Nmi=", " ", "nmi", 1, 20},
+  {"INT=", " ", "int", 6, 10},
+  {"SW=", ">]", "sw", 2, 8},
+  {"[<KUO=", " ", "kuo", 1, 5},
+  {"IEO=", " ", "ieo", 1, 4},
+  {"KUP=", " ", "kup", 1, 3},
+  {"IEP=", " ", "iep", 1, 2},
+  {"KUC=", " ", "kuc", 1, 1},
+  {"IEC=", ">]", "iec", 1, 0},
 
   /* Cache register portion (dummy for parsing only) */
-  { "CR[<IalO="," ",   "ialo", 0, 13 },
-  { "DalO=",   " ",    "dalo", 0, 12 },
-  { "IalP=",   " ",    "ialp", 0, 11 },
-  { "DalP=",   " ",    "dalp", 0, 10 },
-  { "IalC=",   " ",    "ialc", 0,  9 },
-  { "DalC=",   ">] ",  "dalc", 0,  8 },
-
-  { NULL,      NULL,   0,  0 }         /* end of table marker */
+  {"CR[<IalO=", " ", "ialo", 0, 13},
+  {"DalO=", " ", "dalo", 0, 12},
+  {"IalP=", " ", "ialp", 0, 11},
+  {"DalP=", " ", "dalp", 0, 10},
+  {"IalC=", " ", "ialc", 0, 9},
+  {"DalC=", ">] ", "dalc", 0, 8},
+
+  {NULL, NULL, 0, 0}           /* end of table marker */
 };
 
 
-#if 0  /* FIXME: Enable when we add support for modifying cache register.  */
-static struct bit_field cache_fields [] =
+#if 0                          /* FIXME: Enable when we add support for modifying cache register.  */
+static struct bit_field cache_fields[] =
 {
   /* Status register portion (dummy for parsing only) */
-  { "SR[<CU=", " ",    "cu",   0, 28 },
-  { "RE=",     " ",    "re",   0, 25 },
-  { "BEV=",    " ",    "bev",  0, 22 },
-  { "TS=",     " ",    "ts",   0, 21 },
-  { "Nmi=",    " ",    "nmi",  0, 20 },
-  { "INT=",    " ",    "int",  0, 10 },
-  { "SW=",     ">]",   "sw",   0,  8 },
-  { "[<KUO=",  " ",    "kuo",  0,  5 },
-  { "IEO=",    " ",    "ieo",  0,  4 },
-  { "KUP=",    " ",    "kup",  0,  3 },
-  { "IEP=",    " ",    "iep",  0,  2 },
-  { "KUC=",    " ",    "kuc",  0,  1 },
-  { "IEC=",    ">]",   "iec",  0,  0 },
+  {"SR[<CU=", " ", "cu", 0, 28},
+  {"RE=", " ", "re", 0, 25},
+  {"BEV=", " ", "bev", 0, 22},
+  {"TS=", " ", "ts", 0, 21},
+  {"Nmi=", " ", "nmi", 0, 20},
+  {"INT=", " ", "int", 0, 10},
+  {"SW=", ">]", "sw", 0, 8},
+  {"[<KUO=", " ", "kuo", 0, 5},
+  {"IEO=", " ", "ieo", 0, 4},
+  {"KUP=", " ", "kup", 0, 3},
+  {"IEP=", " ", "iep", 0, 2},
+  {"KUC=", " ", "kuc", 0, 1},
+  {"IEC=", ">]", "iec", 0, 0},
 
   /* Cache register portion  */
-  { "CR[<IalO="," ",   "ialo", 1, 13 },
-  { "DalO=",   " ",    "dalo", 1, 12 },
-  { "IalP=",   " ",    "ialp", 1, 11 },
-  { "DalP=",   " ",    "dalp", 1, 10 },
-  { "IalC=",   " ",    "ialc", 1,  9 },
-  { "DalC=",   ">] ",  "dalc", 1,  8 },
-
-  { NULL,      NULL,   NULL,   0,  0 }         /* end of table marker */
+  {"CR[<IalO=", " ", "ialo", 1, 13},
+  {"DalO=", " ", "dalo", 1, 12},
+  {"IalP=", " ", "ialp", 1, 11},
+  {"DalP=", " ", "dalp", 1, 10},
+  {"IalC=", " ", "ialc", 1, 9},
+  {"DalC=", ">] ", "dalc", 1, 8},
+
+  {NULL, NULL, NULL, 0, 0}     /* end of table marker */
 };
 #endif
 
 
-static struct bit_field cause_fields[] = 
+static struct bit_field cause_fields[] =
 {
-  { "<BD=",    " ",    "bd",   1, 31 },
-  { "CE=",     " ",    "ce",   2, 28 },
-  { "IP=",     " ",    "ip",   6, 10 },
-  { "SW=",     " ",    "sw",   2,  8 },
-  { "EC=",     ">]" ,  "ec",   5,  2 },
+  {"<BD=", " ", "bd", 1, 31},
+  {"CE=", " ", "ce", 2, 28},
+  {"IP=", " ", "ip", 6, 10},
+  {"SW=", " ", "sw", 2, 8},
+  {"EC=", ">]", "ec", 5, 2},
 
-  { NULL,      NULL,   NULL,   0,  0 }         /* end of table marker */
+  {NULL, NULL, NULL, 0, 0}     /* end of table marker */
 };
 
 
 /* The monitor prints register values in the form
 
-       regname = xxxx xxxx
+   regname = xxxx xxxx
 
    We look up the register name in a table, and remove the embedded space in
    the hex value before passing it to monitor_supply_register.  */
@@ -285,17 +421,17 @@ r3900_supply_register (regname, regnamelen, val, vallen)
    you modify it.  */
 
 static void
-fetch_bad_vaddr()
+fetch_bad_vaddr ()
 {
   char buf[20];
 
   monitor_printf ("xB\r");
   monitor_expect ("BadV=", NULL, 0);
-  monitor_expect_prompt (buf, sizeof(buf));
+  monitor_expect_prompt (buf, sizeof (buf));
   monitor_supply_register (BADVADDR_REGNUM, buf);
 }
 
-    
+
 /* Read a series of bit fields from the monitor, and return their
    combined binary value.  */
 
@@ -307,17 +443,17 @@ fetch_fields (bf)
   unsigned long val = 0;
   unsigned long bits;
 
-  for ( ; bf->prefix != NULL; bf++)
+  for (; bf->prefix != NULL; bf++)
     {
-      monitor_expect (bf->prefix, NULL, 0);            /* get prefix */
+      monitor_expect (bf->prefix, NULL, 0);    /* get prefix */
       monitor_expect (bf->suffix, buf, sizeof (buf));  /* hex value, suffix */
       if (bf->length != 0)
-        {
+       {
          bits = strtoul (buf, NULL, 16);       /* get field value */
          bits &= ((1 << bf->length) - 1);      /* mask out useless bits */
-         val |= bits << bf->start;             /* insert into register */
+         val |= bits << bf->start;     /* insert into register */
        }
-         
+
     }
 
   return val;
@@ -386,10 +522,10 @@ store_bitmapped_register (regno, bf)
   newval = read_register (regno);
 
   /* To save time, write just the fields that have changed.  */
-  for ( ; bf->prefix != NULL; bf++)
+  for (; bf->prefix != NULL; bf++)
     {
       if (bf->length != 0)
-        {
+       {
          unsigned long oldbits, newbits, mask;
 
          mask = (1 << bf->length) - 1;
@@ -459,7 +595,7 @@ static int
 debug_readchar (hex)
      int hex;
 {
-  char buf [10];
+  char buf[10];
   int c = monitor_readchar ();
 
   if (remote_debug > 0)
@@ -468,7 +604,7 @@ debug_readchar (hex)
        sprintf (buf, "[%02x]", c & 0xff);
       else if (c == '\0')
        strcpy (buf, "\\0");
-      else 
+      else
        {
          buf[0] = c;
          buf[1] = '\0';
@@ -507,21 +643,21 @@ debug_write (buf, buflen)
    when its console is in "communications interface" mode.   A packet
    is of this form:
 
-      start of packet flag (one byte: 0xdc)
-      packet type (one byte)
-      length (low byte)
-      length (high byte)
-      data (length bytes)
+   start of packet flag (one byte: 0xdc)
+   packet type (one byte)
+   length (low byte)
+   length (high byte)
+   data (length bytes)
 
    The last two bytes of the data field are a checksum, but we don't
    bother to verify it.
-*/
+ */
 
 static void
 ignore_packet ()
 {
   int c;
-  int len;  
+  int len;
 
   /* Ignore lots of trash (messages about section addresses, for example)
      until we see the start of a packet.  */
@@ -535,12 +671,12 @@ ignore_packet ()
     error ("Packet header byte not found; %02x seen instead.", c);
 
   /* Read the packet type and length.  */
-  c = debug_readchar (1);                      /* type */
+  c = debug_readchar (1);      /* type */
 
-  c = debug_readchar (1);                      /* low byte of length */
+  c = debug_readchar (1);      /* low byte of length */
   len = c & 0xff;
 
-  c = debug_readchar (1);                      /* high byte of length */
+  c = debug_readchar (1);      /* high byte of length */
   len += (c & 0xff) << 8;
 
   /* Ignore the rest of the packet.  */
@@ -554,7 +690,7 @@ ignore_packet ()
    The 'p' packet is a special case.  This is a packet we send
    in response to a read ('r') packet from the monitor.  This function
    appends a one-byte sequence number to the data field of such a packet.
-*/
+ */
 
 static void
 send_packet (type, buf, buflen, seq)
@@ -604,7 +740,7 @@ send_packet (type, buf, buflen, seq)
            sum += tmp << 8;
        }
       if (type == 'p')
-        {
+       {
          if (buflen & 1)
            sum += (seq & 0xff);
          else
@@ -612,7 +748,7 @@ send_packet (type, buf, buflen, seq)
        }
       sum = (sum & 0xffff) + ((sum >> 16) & 0xffff);
       sum += (sum >> 16) & 1;
-      sum = ~sum;  
+      sum = ~sum;
 
       hdr[0] = (sum >> 8) & 0xff;
       hdr[1] = sum & 0xff;
@@ -672,7 +808,7 @@ process_read_request (buf, buflen)
 
 static void
 count_section (abfd, s, section_count)
-     bfd      *abfd;
+     bfd *abfd;
      asection *s;
      unsigned int *section_count;
 {
@@ -688,42 +824,42 @@ count_section (abfd, s, section_count)
    packets containing read requests, but rather than respond
    to them in an general way, we expect them to following
    a certain pattern.
-   
+
    For example, we know that the monitor will start loading by
    issuing an 8-byte read request for the binary file header.
    We know this is coming and ignore the actual contents
    of the read request packet.
-*/
+ */
 
 static void
 load_section (abfd, s, data_count)
-     bfd      *abfd;
+     bfd *abfd;
      asection *s;
      unsigned int *data_count;
 {
   if (s->flags & SEC_LOAD)
     {
       bfd_size_type section_size = bfd_section_size (abfd, s);
-      bfd_vma       section_base = bfd_section_lma  (abfd, s);
+      bfd_vma section_base = bfd_section_lma (abfd, s);
       unsigned char *buffer;
       unsigned char header[8];
 
       /* Don't output zero-length sections.  */
       if (section_size == 0)
-        return;
+       return;
       if (data_count)
        *data_count += section_size;
 
       /* Print some fluff about the section being loaded.  */
       printf_filtered ("Loading section %s, size 0x%lx lma ",
-                      bfd_section_name (abfd, s), (long)section_size);
+                      bfd_section_name (abfd, s), (long) section_size);
       print_address_numeric (section_base, 1, gdb_stdout);
       printf_filtered ("\n");
       gdb_flush (gdb_stdout);
 
       /* Write the section header (location and size).  */
-      write_long (&header[0], (long)section_base);
-      write_long (&header[4], (long)section_size);
+      write_long (&header[0], (long) section_base);
+      write_long (&header[4], (long) section_size);
       process_read_request (header, sizeof (header));
 
       /* Read the section contents into a buffer, write it out,
@@ -732,7 +868,7 @@ load_section (abfd, s, data_count)
       bfd_get_section_contents (abfd, s, buffer, 0, section_size);
       process_read_request (buffer, section_size);
       free (buffer);
-  }
+    }
 }
 
 
@@ -740,12 +876,12 @@ load_section (abfd, s, data_count)
    we can use the "Rm" command to do a fast binary load.  The format
    of the download data is:
 
-       number of sections (4 bytes)
-       starting address (4 bytes)
-       repeat for each section:
-           location address (4 bytes)
-           section size (4 bytes)
-           binary data
+   number of sections (4 bytes)
+   starting address (4 bytes)
+   repeat for each section:
+   location address (4 bytes)
+   section size (4 bytes)
+   binary data
 
    The 4-byte fields are all in big-endian order.
 
@@ -755,9 +891,9 @@ load_section (abfd, s, data_count)
  */
 
 static void
-r3900_load (filename, from_tty) 
-    char *filename;
-    int from_tty;
+r3900_load (filename, from_tty)
+     char *filename;
+     int from_tty;
 {
   bfd *abfd;
   unsigned int data_count = 0;
@@ -794,13 +930,13 @@ r3900_load (filename, from_tty)
   monitor_printf ("Rm\r");
   ignore_packet ();
   send_packet ('a', "", 0, 0);
-  
+
   /* Output the fast load header (number of sections and starting address).  */
   bfd_map_over_sections ((bfd *) abfd, (section_map_func) count_section,
                         &section_count);
-  write_long (&buffer[0], (long)section_count);
+  write_long (&buffer[0], (long) section_count);
   if (exec_bfd)
-    write_long (&buffer[4], (long)bfd_get_start_address (exec_bfd));
+    write_long (&buffer[4], (long) bfd_get_start_address (exec_bfd));
   else
     write_long (&buffer[4], 0);
   process_read_request (buffer, sizeof (buffer));
@@ -819,14 +955,14 @@ r3900_load (filename, from_tty)
   monitor_expect_prompt (NULL, 0);
 
   /* Print start address and download performance information.  */
-  printf_filtered ("Start address 0x%lx\n", (long)bfd_get_start_address (abfd));
+  printf_filtered ("Start address 0x%lx\n", (long) bfd_get_start_address (abfd));
   report_transfer_performance (data_count, start_time, end_time);
 
   /* Finally, make the PC point at the start address */
   if (exec_bfd)
     write_pc (bfd_get_start_address (exec_bfd));
 
-  inferior_pid = 0;             /* No process now */
+  inferior_pid = 0;            /* No process now */
 
   /* This is necessary because many things were based on the PC at the
      time that we attached to the monitor, which is no longer valid
@@ -839,19 +975,21 @@ r3900_load (filename, from_tty)
 
 
 /* Commands to send to the monitor when first connecting:
-    * The bare carriage return forces a prompt from the monitor
-      (monitor doesn't prompt immediately after a reset).
-    * The "vconsx" switches the monitor back to interactive mode
-      in case an aborted download had left it in packet mode.
-    * The "Xtr" command causes subsequent "t" (trace) commands to display
-      the general registers only.
-    * The "Xxr" command does the same thing for the "x" (examine
-      registers) command.
-    * The "bx" command clears all breakpoints.
-*/
-
-static char *r3900_inits[] = {"\r", "vconsx\r", "Xtr\r", "Xxr\r", "bx\r", NULL};
-static char *dummy_inits[] = { NULL };
+   * The bare carriage return forces a prompt from the monitor
+   (monitor doesn't prompt immediately after a reset).
+   * The "vconsx" switches the monitor back to interactive mode
+   in case an aborted download had left it in packet mode.
+   * The "Xtr" command causes subsequent "t" (trace) commands to display
+   the general registers only.
+   * The "Xxr" command does the same thing for the "x" (examine
+   registers) command.
+   * The "bx" command clears all breakpoints.
+ */
+
+static char *r3900_inits[] =
+{"\r", "vconsx\r", "Xtr\r", "Xxr\r", "bx\r", NULL};
+static char *dummy_inits[] =
+{NULL};
 
 static struct target_ops r3900_ops;
 static struct monitor_ops r3900_cmds;
@@ -883,9 +1021,9 @@ r3900_open (args, from_tty)
   ethernet = 0;
   monitor_printf ("v\r");
   if (monitor_expect ("console device :", NULL, 0) != -1)
-      if (monitor_expect ("\n", buf, sizeof (buf)) != -1)
-       if (strstr (buf, "ethernet") != NULL)
-         ethernet = 1;
+    if (monitor_expect ("\n", buf, sizeof (buf)) != -1)
+      if (strstr (buf, "ethernet") != NULL)
+       ethernet = 1;
   monitor_expect_prompt (NULL, 0);
 }
 
@@ -893,39 +1031,39 @@ void
 _initialize_r3900_rom ()
 {
   r3900_cmds.flags = MO_NO_ECHO_ON_OPEN |
-                    MO_ADDR_BITS_REMOVE |
-                    MO_CLR_BREAK_USES_ADDR |
-                    MO_GETMEM_READ_SINGLE |
-                    MO_PRINT_PROGRAM_OUTPUT;
+    MO_ADDR_BITS_REMOVE |
+    MO_CLR_BREAK_USES_ADDR |
+    MO_GETMEM_READ_SINGLE |
+    MO_PRINT_PROGRAM_OUTPUT;
 
   r3900_cmds.init = dummy_inits;
   r3900_cmds.cont = "g\r";
   r3900_cmds.step = "t\r";
-  r3900_cmds.set_break = "b %A\r";             /* COREADDR */
-  r3900_cmds.clr_break = "b %A,0\r";           /* COREADDR */
-  r3900_cmds.fill = "fx %A s %x %x\r";         /* COREADDR, len, val */
+  r3900_cmds.set_break = "b %A\r";     /* COREADDR */
+  r3900_cmds.clr_break = "b %A,0\r";   /* COREADDR */
+  r3900_cmds.fill = "fx %A s %x %x\r"; /* COREADDR, len, val */
 
   r3900_cmds.setmem.cmdb = "sx %A %x\r";       /* COREADDR, val */
   r3900_cmds.setmem.cmdw = "sh %A %x\r";       /* COREADDR, val */
   r3900_cmds.setmem.cmdl = "sw %A %x\r";       /* COREADDR, val */
 
-  r3900_cmds.getmem.cmdb = "sx %A\r";          /* COREADDR */
-  r3900_cmds.getmem.cmdw = "sh %A\r";          /* COREADDR */
-  r3900_cmds.getmem.cmdl = "sw %A\r";          /* COREADDR */
+  r3900_cmds.getmem.cmdb = "sx %A\r";  /* COREADDR */
+  r3900_cmds.getmem.cmdw = "sh %A\r";  /* COREADDR */
+  r3900_cmds.getmem.cmdl = "sw %A\r";  /* COREADDR */
   r3900_cmds.getmem.resp_delim = " : ";
   r3900_cmds.getmem.term = " ";
   r3900_cmds.getmem.term_cmd = ".\r";
 
-  r3900_cmds.setreg.cmd = "x%s %x\r";          /* regname, val */
+  r3900_cmds.setreg.cmd = "x%s %x\r";  /* regname, val */
 
-  r3900_cmds.getreg.cmd = "x%s\r";             /* regname */
+  r3900_cmds.getreg.cmd = "x%s\r";     /* regname */
   r3900_cmds.getreg.resp_delim = "=";
   r3900_cmds.getreg.term = " ";
   r3900_cmds.getreg.term_cmd = ".\r";
 
   r3900_cmds.dump_registers = "x\r";
   r3900_cmds.register_pattern =
-       "\\([a-zA-Z0-9_]+\\) *=\\([0-9a-f]+ [0-9a-f]+\\b\\)";
+    "\\([a-zA-Z0-9_]+\\) *=\\([0-9a-f]+ [0-9a-f]+\\b\\)";
   r3900_cmds.supply_register = r3900_supply_register;
   /* S-record download, via "keyboard port".  */
   r3900_cmds.load = "r0\r";
index 35be19d7f8ede6deaa2fe839ec04a2949711645f..8f0274b447a49878e7e73cc1bd4bf11028a1ed76 100644 (file)
@@ -8,21 +8,22 @@
    based on Fred Fish's (Cygnus Support) implementation of DWARF 1
    support in dwarfread.c
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
 
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
@@ -207,15 +208,15 @@ struct attr_abbrev
 /* This data structure holds a complete die structure. */
 struct die_info
   {
-    enum dwarf_tag tag;                 /* Tag indicating type of die */
-    unsigned short has_children; /* Does the die have children */
-    unsigned int abbrev;        /* Abbrev number */
-    unsigned int offset;        /* Offset in .debug_info section */
-    unsigned int num_attrs;     /* Number of attributes */
-    struct attribute *attrs;    /* An array of attributes */
-    struct die_info *next_ref;  /* Next die in ref hash table */
-    struct die_info *next;      /* Next die in linked list */
-    struct type *type;          /* Cached type information */
+    enum dwarf_tag tag;                /* Tag indicating type of die */
+    unsigned short has_children;       /* Does the die have children */
+    unsigned int abbrev;       /* Abbrev number */
+    unsigned int offset;       /* Offset in .debug_info section */
+    unsigned int num_attrs;    /* Number of attributes */
+    struct attribute *attrs;   /* An array of attributes */
+    struct die_info *next_ref; /* Next die in ref hash table */
+    struct die_info *next;     /* Next die in linked list */
+    struct type *type;         /* Cached type information */
   };
 
 /* Attributes have a name and a value */
@@ -315,7 +316,7 @@ static int isreg;           /* Object lives in register.
 static int offreg;             /* Object's address is the sum of the
                                   register specified by basereg, plus
                                   the offset returned.  */
-static int basereg;            /* See `offreg'.  */
+static int basereg;            /* See `offreg'.  */
 static int isderef;            /* Value described by flags above is
                                   the address of a pointer to the object.  */
 static int islocal;            /* Variable is at the returned offset
@@ -348,27 +349,27 @@ static CORE_ADDR baseaddr;        /* Add to each symbol value */
    of symbols read from an object file.  */
 
 struct dwarf2_pinfo
-{
-  /* Pointer to start of dwarf info buffer for the objfile.  */
+  {
+    /* Pointer to start of dwarf info buffer for the objfile.  */
 
-  char *dwarf_info_buffer;
+    char *dwarf_info_buffer;
 
-  /* Offset in dwarf_info_buffer for this compilation unit. */
+    /* Offset in dwarf_info_buffer for this compilation unit. */
 
-  unsigned long dwarf_info_offset;
+    unsigned long dwarf_info_offset;
 
-  /* Pointer to start of dwarf abbreviation buffer for the objfile.  */
+    /* Pointer to start of dwarf abbreviation buffer for the objfile.  */
 
-  char *dwarf_abbrev_buffer;
+    char *dwarf_abbrev_buffer;
 
-  /* Size of dwarf abbreviation section for the objfile.  */
+    /* Size of dwarf abbreviation section for the objfile.  */
 
-  unsigned int dwarf_abbrev_size;
+    unsigned int dwarf_abbrev_size;
 
-  /* Pointer to start of dwarf line buffer for the objfile.  */
+    /* Pointer to start of dwarf line buffer for the objfile.  */
 
-  char *dwarf_line_buffer;
-};
+    char *dwarf_line_buffer;
+  };
 
 #define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private)
 #define DWARF_INFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_info_buffer)
@@ -397,46 +398,49 @@ static int bits_per_byte = 8;
    pass lists of data member fields and lists of member function fields
    in an instance of a field_info structure, as defined below.  */
 struct field_info
-{
-  /* List of data member and baseclasses fields. */
-  struct nextfield
-    {
-      struct nextfield *next;
-      int accessibility;
-      int virtuality;
-      struct field field;
-    } *fields;
+  {
+    /* List of data member and baseclasses fields. */
+    struct nextfield
+      {
+       struct nextfield *next;
+       int accessibility;
+       int virtuality;
+       struct field field;
+      }
+     *fields;
 
-  /* Number of fields.  */
-  int nfields;
+    /* Number of fields.  */
+    int nfields;
 
-  /* Number of baseclasses.  */
-  int nbaseclasses;
+    /* Number of baseclasses.  */
+    int nbaseclasses;
 
-  /* Set if the accesibility of one of the fields is not public.  */
-  int non_public_fields;
+    /* Set if the accesibility of one of the fields is not public.  */
+    int non_public_fields;
 
-  /* Member function fields array, entries are allocated in the order they
-     are encountered in the object file.  */
-  struct nextfnfield
-    {
-      struct nextfnfield *next;
-      struct fn_field fnfield;
-    } *fnfields;
+    /* Member function fields array, entries are allocated in the order they
+       are encountered in the object file.  */
+    struct nextfnfield
+      {
+       struct nextfnfield *next;
+       struct fn_field fnfield;
+      }
+     *fnfields;
 
-  /* Member function fieldlist array, contains name of possibly overloaded
-     member function, number of overloaded member functions and a pointer
-     to the head of the member function field chain.  */
-  struct fnfieldlist
-    {
-      char *name;
-      int length;
-      struct nextfnfield *head;
-    } *fnfieldlists;
+    /* Member function fieldlist array, contains name of possibly overloaded
+       member function, number of overloaded member functions and a pointer
+       to the head of the member function field chain.  */
+    struct fnfieldlist
+      {
+       char *name;
+       int length;
+       struct nextfnfield *head;
+      }
+     *fnfieldlists;
 
-  /* Number of entries in the fnfieldlists array.  */
-  int nfnfields;
-};
+    /* Number of entries in the fnfieldlists array.  */
+    int nfnfields;
+  };
 
 /* FIXME: Kludge to mark a varargs function type for C++ member function
    argument processing.  */
@@ -664,14 +668,14 @@ static void dwarf2_add_field PARAMS ((struct field_info *, struct die_info *,
                                      struct objfile *));
 
 static void dwarf2_attach_fields_to_type PARAMS ((struct field_info *,
-                                                 struct type *, 
+                                                 struct type *,
                                                  struct objfile *));
 
 static char *skip_member_fn_name PARAMS ((char *));
 
 static void dwarf2_add_member_fn PARAMS ((struct field_info *,
                                          struct die_info *, struct type *,
-                                         struct objfile *objfile));
+                                         struct objfile * objfile));
 
 static void dwarf2_attach_fn_fields_to_type PARAMS ((struct field_info *,
                                                     struct type *,
@@ -837,9 +841,9 @@ dwarf2_locate_sections (ignore_abfd, sectp, ignore_ptr)
 
 void
 dwarf2_build_psymtabs (objfile, section_offsets, mainline)
-    struct objfile *objfile;
-    struct section_offsets *section_offsets;
-    int mainline;
+     struct objfile *objfile;
+     struct section_offsets *section_offsets;
+     int mainline;
 {
 
   /* We definitely need the .debug_info and .debug_abbrev sections */
@@ -871,7 +875,7 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
   else
 #endif
     /* only test this case for now */
-    {          
+    {
       /* In this case we have to work a bit harder */
       dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline);
     }
@@ -946,7 +950,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
   back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
 
   while ((unsigned int) (info_ptr - dwarf_info_buffer)
-         + ((info_ptr - dwarf_info_buffer) % 4) < dwarf_info_size)
+        + ((info_ptr - dwarf_info_buffer) % 4) < dwarf_info_size)
     {
       beg_of_comp_unit = info_ptr;
       cu_header.length = read_4_bytes (abfd, info_ptr);
@@ -999,7 +1003,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
 
       /* Allocate a new partial symbol table structure */
       pst = start_psymtab_common (objfile, section_offsets,
-                                 comp_unit_die.name ? comp_unit_die.name : "",
+                              comp_unit_die.name ? comp_unit_die.name : "",
                                  comp_unit_die.lowpc,
                                  objfile->global_psymbols.next,
                                  objfile->static_psymbols.next);
@@ -1007,11 +1011,11 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
       pst->read_symtab_private = (char *)
        obstack_alloc (&objfile->psymbol_obstack, sizeof (struct dwarf2_pinfo));
       cu_header_offset = beg_of_comp_unit - dwarf_info_buffer;
-      DWARF_INFO_BUFFER(pst) = dwarf_info_buffer;
-      DWARF_INFO_OFFSET(pst) = beg_of_comp_unit - dwarf_info_buffer;
-      DWARF_ABBREV_BUFFER(pst) = dwarf_abbrev_buffer;
-      DWARF_ABBREV_SIZE(pst) = dwarf_abbrev_size;
-      DWARF_LINE_BUFFER(pst) = dwarf_line_buffer;
+      DWARF_INFO_BUFFER (pst) = dwarf_info_buffer;
+      DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf_info_buffer;
+      DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
+      DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
+      DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
       baseaddr = ANOFFSET (section_offsets, 0);
 
       /* Store the function that reads in the rest of the symbol table */
@@ -1028,11 +1032,11 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
             then use the information extracted from its child dies.  */
          if (!comp_unit_has_pc_info)
            {
-             comp_unit_die.lowpc  = lowpc;
+             comp_unit_die.lowpc = lowpc;
              comp_unit_die.highpc = highpc;
            }
        }
-      pst->textlow  = comp_unit_die.lowpc + baseaddr;
+      pst->textlow = comp_unit_die.lowpc + baseaddr;
       pst->texthigh = comp_unit_die.highpc + baseaddr;
 
       pst->n_global_syms = objfile->global_psymbols.next -
@@ -1071,8 +1075,8 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
 
   int nesting_level = 1;
   int has_pc_info;
-  
-  *lowpc  = ((CORE_ADDR) -1);
+
+  *lowpc = ((CORE_ADDR) - 1);
   *highpc = ((CORE_ADDR) 0);
 
   while (nesting_level)
@@ -1115,13 +1119,13 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
              break;
            case DW_TAG_enumerator:
              /* File scope enumerators are added to the partial symbol
-                table.  */
+                table.  */
              if (nesting_level == 2)
                add_partial_symbol (&pdi, objfile);
              break;
            case DW_TAG_base_type:
              /* File scope base type definitions are added to the partial
-                symbol table.  */
+                symbol table.  */
              if (nesting_level == 1)
                add_partial_symbol (&pdi, objfile);
              break;
@@ -1131,8 +1135,8 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
        }
 
       /* If the die has a sibling, skip to the sibling.
-        Do not skip enumeration types, we want to record their
-        enumerators.  */
+         Do not skip enumeration types, we want to record their
+         enumerators.  */
       if (pdi.sibling && pdi.tag != DW_TAG_enumeration_type)
        {
          info_ptr = pdi.sibling;
@@ -1152,7 +1156,7 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc)
 
   /* If we didn't find a lowpc, set it to highpc to avoid complaints
      from `maint check'.  */
-  if (*lowpc == ((CORE_ADDR) -1))
+  if (*lowpc == ((CORE_ADDR) - 1))
     *lowpc = *highpc;
   return info_ptr;
 }
@@ -1170,20 +1174,20 @@ add_partial_symbol (pdi, objfile)
       if (pdi->is_external)
        {
          /*prim_record_minimal_symbol (pdi->name, pdi->lowpc + baseaddr,
-                                     mst_text, objfile);*/
+            mst_text, objfile); */
          add_psymbol_to_list (pdi->name, strlen (pdi->name),
                               VAR_NAMESPACE, LOC_BLOCK,
                               &objfile->global_psymbols,
-                              0, pdi->lowpc + baseaddr, cu_language, objfile);
+                           0, pdi->lowpc + baseaddr, cu_language, objfile);
        }
       else
        {
          /*prim_record_minimal_symbol (pdi->name, pdi->lowpc + baseaddr,
-                                     mst_file_text, objfile);*/
+            mst_file_text, objfile); */
          add_psymbol_to_list (pdi->name, strlen (pdi->name),
                               VAR_NAMESPACE, LOC_BLOCK,
                               &objfile->static_psymbols,
-                              0, pdi->lowpc + baseaddr, cu_language, objfile);
+                           0, pdi->lowpc + baseaddr, cu_language, objfile);
        }
       break;
     case DW_TAG_variable:
@@ -1217,7 +1221,7 @@ add_partial_symbol (pdi, objfile)
            return;
          addr = decode_locdesc (pdi->locdesc, objfile);
          /*prim_record_minimal_symbol (pdi->name, addr + baseaddr,
-                                     mst_file_data, objfile);*/
+            mst_file_data, objfile); */
          add_psymbol_to_list (pdi->name, strlen (pdi->name),
                               VAR_NAMESPACE, LOC_STATIC,
                               &objfile->static_psymbols,
@@ -1236,7 +1240,7 @@ add_partial_symbol (pdi, objfile)
     case DW_TAG_union_type:
     case DW_TAG_enumeration_type:
       /* Skip aggregate types without children, these are external
-        references.  */
+         references.  */
       if (pdi->has_children == 0)
        return;
       add_psymbol_to_list (pdi->name, strlen (pdi->name),
@@ -1310,11 +1314,11 @@ psymtab_to_symtab_1 (pst)
   struct cleanup *back_to;
 
   /* Set local variables from the partial symbol table info.  */
-  offset = DWARF_INFO_OFFSET(pst);
-  dwarf_info_buffer = DWARF_INFO_BUFFER(pst);
-  dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER(pst);
-  dwarf_abbrev_size = DWARF_ABBREV_SIZE(pst);
-  dwarf_line_buffer = DWARF_LINE_BUFFER(pst);
+  offset = DWARF_INFO_OFFSET (pst);
+  dwarf_info_buffer = DWARF_INFO_BUFFER (pst);
+  dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst);
+  dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst);
+  dwarf_line_buffer = DWARF_LINE_BUFFER (pst);
   baseaddr = ANOFFSET (pst->section_offsets, 0);
   cu_header_offset = offset;
   info_ptr = dwarf_info_buffer + offset;
@@ -1349,8 +1353,8 @@ psymtab_to_symtab_1 (pst)
   if (!dwarf2_get_pc_bounds (dies, &lowpc, &highpc, objfile))
     {
       /* Some compilers don't define a DW_AT_high_pc attribute for
-        the compilation unit.   If the DW_AT_high_pc is missing,
-        synthesize it, by scanning the DIE's below the compilation unit.  */
+         the compilation unit.   If the DW_AT_high_pc is missing,
+         synthesize it, by scanning the DIE's below the compilation unit.  */
       highpc = 0;
       if (dies->has_children)
        {
@@ -1407,8 +1411,8 @@ process_die (die, objfile)
       break;
     case DW_TAG_inlined_subroutine:
       /* FIXME:  These are ignored for now.
-        They could be used to set breakpoints on all inlined instances
-        of a function and make GDB `next' properly over inlined functions.  */
+         They could be used to set breakpoints on all inlined instances
+         of a function and make GDB `next' properly over inlined functions.  */
       break;
     case DW_TAG_lexical_block:
       read_lexical_block_scope (die, objfile);
@@ -1464,7 +1468,7 @@ read_file_scope (die, objfile)
      struct objfile *objfile;
 {
   unsigned int line_offset = 0;
-  CORE_ADDR lowpc  = ((CORE_ADDR) -1);
+  CORE_ADDR lowpc = ((CORE_ADDR) - 1);
   CORE_ADDR highpc = ((CORE_ADDR) 0);
   struct attribute *attr;
   char *name = "<unknown>";
@@ -1496,7 +1500,7 @@ read_file_scope (die, objfile)
 
   /* If we didn't find a lowpc, set it to highpc to avoid complaints
      from finish_block.  */
-  if (lowpc == ((CORE_ADDR) -1))
+  if (lowpc == ((CORE_ADDR) - 1))
     lowpc = highpc;
   lowpc += baseaddr;
   highpc += baseaddr;
@@ -1537,8 +1541,8 @@ read_file_scope (die, objfile)
   /* We assume that we're processing GCC output. */
   processing_gcc_compilation = 2;
 #if 0
-    /* FIXME:Do something here.  */
-    if (dip->at_producer != NULL)
+  /* FIXME:Do something here.  */
+  if (dip->at_producer != NULL)
     {
       handle_producer (dip->at_producer);
     }
@@ -1801,20 +1805,20 @@ dwarf2_add_field (fip, die, objfile)
          if (BITS_BIG_ENDIAN)
            {
              /* For big endian bits, the DW_AT_bit_offset gives the
-                additional bit offset from the MSB of the containing
-                anonymous object to the MSB of the field.  We don't
-                have to do anything special since we don't need to
-                know the size of the anonymous object.  */
+                additional bit offset from the MSB of the containing
+                anonymous object to the MSB of the field.  We don't
+                have to do anything special since we don't need to
+                know the size of the anonymous object.  */
              FIELD_BITPOS (*fp) += DW_UNSND (attr);
            }
          else
            {
              /* For little endian bits, compute the bit offset to the
-                MSB of the anonymous object, subtract off the number of
-                bits from the MSB of the field to the MSB of the
-                object, and then subtract off the number of bits of
-                the field itself.  The result is the bit offset of
-                the LSB of the field.  */
+                MSB of the anonymous object, subtract off the number of
+                bits from the MSB of the field to the MSB of the
+                object, and then subtract off the number of bits of
+                the field itself.  The result is the bit offset of
+                the LSB of the field.  */
              int anonymous_size;
              int bit_offset = DW_UNSND (attr);
 
@@ -1847,7 +1851,7 @@ dwarf2_add_field (fip, die, objfile)
                               &objfile->type_obstack);
 
       /* Change accessibility for artificial fields (e.g. virtual table
-        pointer or virtual base class pointer) to private.  */
+         pointer or virtual base class pointer) to private.  */
       if (dwarf_attr (die, DW_AT_artificial))
        {
          new_field->accessibility = DW_ACCESS_private;
@@ -1860,7 +1864,7 @@ dwarf2_add_field (fip, die, objfile)
       char *cp;
 
       /* C++ static member.
-        Get physical name, extract field name from physical name.  */
+         Get physical name, extract field name from physical name.  */
       physname = dwarf2_linkage_name (die);
       if (physname == NULL)
        return;
@@ -1876,10 +1880,10 @@ dwarf2_add_field (fip, die, objfile)
        }
 
       SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname),
-                                           &objfile->type_obstack));
+                                            &objfile->type_obstack));
       FIELD_TYPE (*fp) = die_type (die, objfile);
       FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname),
-                              &objfile->type_obstack);
+                                      &objfile->type_obstack);
     }
   else if (die->tag == DW_TAG_inheritance)
     {
@@ -1950,33 +1954,33 @@ dwarf2_attach_fields_to_type (fip, type, objfile)
       TYPE_FIELD (type, nfields) = fip->fields->field;
       switch (fip->fields->accessibility)
        {
-         case DW_ACCESS_private:
-           SET_TYPE_FIELD_PRIVATE (type, nfields);
-           break;
+       case DW_ACCESS_private:
+         SET_TYPE_FIELD_PRIVATE (type, nfields);
+         break;
 
-         case DW_ACCESS_protected:
-           SET_TYPE_FIELD_PROTECTED (type, nfields);
-           break;
+       case DW_ACCESS_protected:
+         SET_TYPE_FIELD_PROTECTED (type, nfields);
+         break;
 
-         case DW_ACCESS_public:
-           break;
+       case DW_ACCESS_public:
+         break;
 
-         default:
-           /* Unknown accessibility.  Complain and treat it as public.  */
-           {
-             complain (&dwarf2_unsupported_accessibility,
-                       fip->fields->accessibility);
-           }
-           break;
+       default:
+         /* Unknown accessibility.  Complain and treat it as public.  */
+         {
+           complain (&dwarf2_unsupported_accessibility,
+                     fip->fields->accessibility);
+         }
+         break;
        }
       if (nfields < fip->nbaseclasses)
        {
          switch (fip->fields->virtuality)
            {
-             case DW_VIRTUALITY_virtual:
-             case DW_VIRTUALITY_pure_virtual:
-               SET_TYPE_FIELD_VIRTUAL (type, nfields);
-               break;
+           case DW_VIRTUALITY_virtual:
+           case DW_VIRTUALITY_pure_virtual:
+             SET_TYPE_FIELD_VIRTUAL (type, nfields);
+             break;
            }
        }
       fip->fields = fip->fields->next;
@@ -2009,7 +2013,7 @@ skip_member_fn_name (physname)
     {
       /* Take care of trailing underscores.  */
       if (endname[1] != '_')
-        endname--;
+       endname--;
     }
   return endname;
 }
@@ -2036,12 +2040,12 @@ dwarf2_add_member_fn (fip, die, type, objfile)
   if (physname == NULL)
     return;
   if ((physname[0] == '_' && physname[1] == '_'
-        && strchr ("0123456789Qt", physname[2]))
+       && strchr ("0123456789Qt", physname[2]))
       || DESTRUCTOR_PREFIX_P (physname))
     {
       /* Constructor and destructor field names are set to the name
-        of the class, but without template parameter lists.
-        The name might be missing for anonymous aggregates.  */
+         of the class, but without template parameter lists.
+         The name might be missing for anonymous aggregates.  */
       if (TYPE_TAG_NAME (type))
        {
          char *p = strchr (TYPE_TAG_NAME (type), '<');
@@ -2065,7 +2069,7 @@ dwarf2_add_member_fn (fip, die, type, objfile)
       char *endname = skip_member_fn_name (physname);
 
       /* Ignore member function if we were unable not extract the member
-        function name.  */
+         function name.  */
       if (endname == physname)
        return;
       fieldname = obsavestring (physname, endname - physname,
@@ -2089,10 +2093,10 @@ dwarf2_add_member_fn (fip, die, type, objfile)
          fip->fnfieldlists = (struct fnfieldlist *)
            xrealloc (fip->fnfieldlists,
                      (fip->nfnfields + DW_FIELD_ALLOC_CHUNK)
-                       * sizeof (struct fnfieldlist));
+                     * sizeof (struct fnfieldlist));
          if (fip->nfnfields == 0)
-           make_cleanup ((make_cleanup_func) free_current_contents, 
-                          &fip->fnfieldlists);
+           make_cleanup ((make_cleanup_func) free_current_contents,
+                         &fip->fnfieldlists);
        }
       flp = &fip->fnfieldlists[fip->nfnfields];
       flp->name = fieldname;
@@ -2137,11 +2141,11 @@ dwarf2_add_member_fn (fip, die, type, objfile)
       smash_to_method_type (fnp->type, type, return_type, arg_types);
 
       /* Handle static member functions.
-        Dwarf2 has no clean way to discern C++ static and non-static
-        member functions. G++ helps GDB by marking the first
-        parameter for non-static member functions (which is the
-        this pointer) as artificial. We obtain this information
-        from read_subroutine_type via TYPE_FIELD_ARTIFICIAL.  */
+         Dwarf2 has no clean way to discern C++ static and non-static
+         member functions. G++ helps GDB by marking the first
+         parameter for non-static member functions (which is the
+         this pointer) as artificial. We obtain this information
+         from read_subroutine_type via TYPE_FIELD_ARTIFICIAL.  */
       if (nparams == 0 || TYPE_FIELD_ARTIFICIAL (die->type, 0) == 0)
        fnp->voffset = VOFFSET_STATIC;
     }
@@ -2161,12 +2165,12 @@ dwarf2_add_member_fn (fip, die, type, objfile)
     {
       switch (DW_UNSND (attr))
        {
-         case DW_ACCESS_private:
-           fnp->is_private = 1;
-           break;
-         case DW_ACCESS_protected:
-           fnp->is_protected = 1;
-           break;
+       case DW_ACCESS_private:
+         fnp->is_private = 1;
+         break;
+       case DW_ACCESS_protected:
+         fnp->is_protected = 1;
+         break;
        }
     }
 
@@ -2203,7 +2207,7 @@ dwarf2_attach_fn_fields_to_type (fip, type, objfile)
       fn_flp->fn_fields = (struct fn_field *)
        TYPE_ALLOC (type, sizeof (struct fn_field) * flp->length);
       for (k = flp->length; (k--, nfp); nfp = nfp->next)
-        fn_flp->fn_fields[k] = nfp->fnfield;
+       fn_flp->fn_fields[k] = nfp->fnfield;
 
       total_length += flp->length;
     }
@@ -2258,7 +2262,7 @@ read_structure_scope (die, objfile)
   else
     {
       /* FIXME: TYPE_CODE_CLASS is currently defined to TYPE_CODE_STRUCT
-        in gdbtypes.h.  */
+         in gdbtypes.h.  */
       TYPE_CODE (type) = TYPE_CODE_CLASS;
     }
 
@@ -2323,7 +2327,7 @@ read_structure_scope (die, objfile)
        {
          dwarf2_attach_fn_fields_to_type (&fi, type, objfile);
 
-          /* Get the type which refers to the base class (possibly this
+         /* Get the type which refers to the base class (possibly this
             class itself) which contains the vtable pointer for the current
             class from the DW_AT_containing_type attribute.  */
 
@@ -2334,7 +2338,8 @@ read_structure_scope (die, objfile)
              TYPE_VPTR_BASETYPE (type) = t;
              if (type == t)
                {
-                 static const char vptr_name[] = { '_','v','p','t','r','\0' };
+                 static const char vptr_name[] =
+                 {'_', 'v', 'p', 't', 'r', '\0'};
                  int i;
 
                  /* Our own class provides vtbl ptr.  */
@@ -2355,7 +2360,7 @@ read_structure_scope (die, objfile)
                  /* Complain if virtual function table field not found.  */
                  if (i < TYPE_N_BASECLASSES (t))
                    complain (&dwarf2_vtbl_not_found_complaint,
-                             TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : "");
+                         TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : "");
                }
              else
                {
@@ -2445,7 +2450,7 @@ read_enumeration (die, objfile)
                      fields = (struct field *)
                        xrealloc (fields,
                                  (num_fields + DW_FIELD_ALLOC_CHUNK)
-                                   * sizeof (struct field));
+                                 * sizeof (struct field));
                    }
 
                  FIELD_NAME (fields[num_fields]) = SYMBOL_NAME (sym);
@@ -2537,9 +2542,9 @@ read_array_type (die, objfile)
                  low = DW_SND (attr);
                }
              else if (attr->form == DW_FORM_udata
-                      || attr->form == DW_FORM_data1
-                      || attr->form == DW_FORM_data2
-                      || attr->form == DW_FORM_data4)
+                      || attr->form == DW_FORM_data1
+                      || attr->form == DW_FORM_data2
+                      || attr->form == DW_FORM_data4)
                {
                  low = DW_UNSND (attr);
                }
@@ -2563,9 +2568,9 @@ read_array_type (die, objfile)
                  high = DW_SND (attr);
                }
              else if (attr->form == DW_FORM_udata
-                      || attr->form == DW_FORM_data1
-                      || attr->form == DW_FORM_data2
-                      || attr->form == DW_FORM_data4)
+                      || attr->form == DW_FORM_data1
+                      || attr->form == DW_FORM_data2
+                      || attr->form == DW_FORM_data4)
                {
                  high = DW_UNSND (attr);
                }
@@ -2596,10 +2601,10 @@ read_array_type (die, objfile)
            {
              range_types = (struct type **)
                xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
-                                        * sizeof (struct type *));
+                         * sizeof (struct type *));
              if (ndim == 0)
-               make_cleanup ((make_cleanup_func) free_current_contents, 
-                              &range_types);
+               make_cleanup ((make_cleanup_func) free_current_contents,
+                             &range_types);
            }
          range_types[ndim++] = create_range_type (NULL, index_type, low, high);
        }
@@ -2802,13 +2807,13 @@ read_tag_string_type (die, objfile)
 /* Handle DIES due to C code like:
 
    struct foo
-     {
-       int (*funcp)(int a, long l);
-       int b;
-     };
+   {
+   int (*funcp)(int a, long l);
+   int b;
+   };
 
    ('funcp' generates a DW_TAG_subroutine_type DIE)
-*/
+ */
 
 static void
 read_subroutine_type (die, objfile)
@@ -2863,10 +2868,10 @@ read_subroutine_type (die, objfile)
          if (child_die->tag == DW_TAG_formal_parameter)
            {
              /* Dwarf2 has no clean way to discern C++ static and non-static
-                member functions. G++ helps GDB by marking the first
-                parameter for non-static member functions (which is the
-                this pointer) as artificial. We pass this information
-                to dwarf2_add_member_fn via TYPE_FIELD_ARTIFICIAL.  */
+                member functions. G++ helps GDB by marking the first
+                parameter for non-static member functions (which is the
+                this pointer) as artificial. We pass this information
+                to dwarf2_add_member_fn via TYPE_FIELD_ARTIFICIAL.  */
              attr = dwarf_attr (child_die, DW_AT_artificial);
              if (attr)
                TYPE_FIELD_ARTIFICIAL (ftype, iparams) = DW_UNSND (attr);
@@ -2988,8 +2993,8 @@ read_base_type (die, objfile)
 
 struct die_info *
 read_comp_unit (info_ptr, abfd)
-    char *info_ptr;
-    bfd *abfd;
+     char *info_ptr;
+     bfd *abfd;
 {
   struct die_info *first_die, *last_die, *die;
   char *cur_ptr;
@@ -3071,7 +3076,7 @@ dwarf2_read_section (objfile, offset, size)
     {
       buf = NULL;
       error ("Dwarf Error: Can't read DWARF data from '%s'",
-        bfd_get_filename (abfd));
+            bfd_get_filename (abfd));
     }
   return buf;
 }
@@ -3083,7 +3088,7 @@ dwarf2_read_section (objfile, offset, size)
 
 static void
 dwarf2_read_abbrevs (abfd, offset)
-     bfd * abfd;
+     bfd *abfd;
      unsigned int offset;
 {
   char *abbrev_ptr;
@@ -3122,7 +3127,7 @@ dwarf2_read_abbrevs (abfd, offset)
              cur_abbrev->attrs = (struct attr_abbrev *)
                xrealloc (cur_abbrev->attrs,
                          (cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK)
-                           * sizeof (struct attr_abbrev));
+                         * sizeof (struct attr_abbrev));
            }
          cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name;
          cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form;
@@ -3138,13 +3143,13 @@ dwarf2_read_abbrevs (abfd, offset)
 
       /* Get next abbreviation.
          Under Irix6 the abbreviations for a compilation unit are not
-        always properly terminated with an abbrev number of 0.
-        Exit loop if we encounter an abbreviation which we have
-        already read (which means we are about to read the abbreviations
-        for the next compile unit) or if the end of the abbreviation
-        table is reached.  */
+         always properly terminated with an abbrev number of 0.
+         Exit loop if we encounter an abbreviation which we have
+         already read (which means we are about to read the abbreviations
+         for the next compile unit) or if the end of the abbreviation
+         table is reached.  */
       if ((unsigned int) (abbrev_ptr - dwarf_abbrev_buffer)
-           >= dwarf_abbrev_size)
+         >= dwarf_abbrev_size)
        break;
       abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
       abbrev_ptr += bytes_read;
@@ -3205,7 +3210,7 @@ dwarf2_lookup_abbrev (number)
 static char *
 read_partial_die (part_die, abfd, info_ptr, has_pc_info)
      struct partial_die_info *part_die;
-     bfd * abfd;
+     bfd *abfd;
      char *info_ptr;
      int *has_pc_info;
 {
@@ -3214,7 +3219,7 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
   struct attribute attr;
   struct attribute spec_attr;
   int found_spec_attr = 0;
-  int has_low_pc_attr  = 0;
+  int has_low_pc_attr = 0;
   int has_high_pc_attr = 0;
 
   *part_die = zeroed_partial_die;
@@ -3239,7 +3244,7 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
       info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
 
       /* Store the data if it is of an attribute we want to keep in a
-        partial symbol table.  */
+         partial symbol table.  */
       switch (attr.name)
        {
        case DW_AT_name:
@@ -3283,7 +3288,7 @@ read_partial_die (part_die, abfd, info_ptr, has_pc_info)
          /* Ignore absolute siblings, they might point outside of
             the current compile unit.  */
          if (attr.form == DW_FORM_ref_addr)
-           complain(&dwarf2_absolute_sibling_complaint);
+           complain (&dwarf2_absolute_sibling_complaint);
          else
            part_die->sibling =
              dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr);
@@ -3584,7 +3589,7 @@ read_address (abfd, buf)
 
 static char *
 read_n_bytes (abfd, buf, size)
-     bfd * abfd;
+     bfd *abfd;
      char *buf;
      unsigned int size;
 {
@@ -3765,12 +3770,12 @@ dwarf_attr (die, name)
   if (spec)
     {
       struct die_info *ref_die =
-       follow_die_ref (dwarf2_get_ref_die_offset (spec));
+      follow_die_ref (dwarf2_get_ref_die_offset (spec));
 
       if (ref_die)
        return dwarf_attr (ref_die, name);
     }
-    
+
   return NULL;
 }
 
@@ -3782,20 +3787,20 @@ struct filenames
 {
   unsigned int num_files;
   struct fileinfo
-  {
-    char *name;
-    unsigned int dir;
-    unsigned int time;
-    unsigned int size;
-  }
-  *files;
+    {
+      char *name;
+      unsigned int dir;
+      unsigned int time;
+      unsigned int size;
+    }
+   *files;
 };
 
 struct directories
-{
-  unsigned int num_dirs;
-  char **dirs;
-};
+  {
+    unsigned int num_dirs;
+    char **dirs;
+  };
 
 static void
 dwarf_decode_lines (offset, comp_dir, abfd)
@@ -3851,8 +3856,8 @@ dwarf_decode_lines (offset, comp_dir, abfd)
   line_ptr += 1;
   lh.standard_opcode_lengths = (unsigned char *)
     xmalloc (lh.opcode_base * sizeof (unsigned char));
-  back_to = make_cleanup ((make_cleanup_func) free_current_contents, 
-                          &lh.standard_opcode_lengths);
+  back_to = make_cleanup ((make_cleanup_func) free_current_contents,
+                         &lh.standard_opcode_lengths);
 
   lh.standard_opcode_lengths[0] = 1;
   for (i = 1; i < lh.opcode_base; ++i)
@@ -3886,10 +3891,10 @@ dwarf_decode_lines (offset, comp_dir, abfd)
          files.files = (struct fileinfo *)
            xrealloc (files.files,
                      (files.num_files + FILE_ALLOC_CHUNK)
-                       * sizeof (struct fileinfo));
+                     * sizeof (struct fileinfo));
          if (files.num_files == 0)
-           make_cleanup ((make_cleanup_func) free_current_contents, 
-                          &files.files);
+           make_cleanup ((make_cleanup_func) free_current_contents,
+                         &files.files);
        }
       files.files[files.num_files].name = cur_file;
       files.files[files.num_files].dir =
@@ -3929,7 +3934,7 @@ dwarf_decode_lines (offset, comp_dir, abfd)
        }
 
       /* Decode the table. */
-      while (! end_sequence)
+      while (!end_sequence)
        {
          op_code = read_1_byte (abfd, line_ptr);
          line_ptr += 1;
@@ -3962,10 +3967,10 @@ dwarf_decode_lines (offset, comp_dir, abfd)
                      files.files = (struct fileinfo *)
                        xrealloc (files.files,
                                  (files.num_files + FILE_ALLOC_CHUNK)
-                                   * sizeof (struct fileinfo));
+                                 * sizeof (struct fileinfo));
                      if (files.num_files == 0)
-                       make_cleanup ((make_cleanup_func) free_current_contents, 
-                                      &files.files);
+                       make_cleanup ((make_cleanup_func) free_current_contents,
+                                     &files.files);
                    }
                  files.files[files.num_files].name = cur_file;
                  files.files[files.num_files].dir =
@@ -3999,7 +4004,7 @@ dwarf_decode_lines (offset, comp_dir, abfd)
              break;
            case DW_LNS_set_file:
              /* The file and directory tables are 0 based, the references
-                are 1 based.  */
+                are 1 based.  */
              file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
              line_ptr += bytes_read;
              dwarf2_start_subfile
@@ -4050,12 +4055,12 @@ done:
    /srcdir and compiling it with Irix6.2 cc in /compdir using a filename
    of /srcdir/list0.c yields the following debugging information for list0.c:
 
-       DW_AT_name:             /srcdir/list0.c
-       DW_AT_comp_dir:         /compdir
-       files.files[0].name:    list0.h         
-       files.files[0].dir:     /srcdir
-       files.files[1].name:    list0.c         
-       files.files[1].dir:     /srcdir
+   DW_AT_name:          /srcdir/list0.c
+   DW_AT_comp_dir:              /compdir
+   files.files[0].name: list0.h         
+   files.files[0].dir:  /srcdir
+   files.files[1].name: list0.c         
+   files.files[1].dir:  /srcdir
 
    The line number information for list0.c has to end up in a single
    subfile, so that `break /srcdir/list0.c:1' works as expected.  */
@@ -4092,7 +4097,7 @@ dwarf2_start_subfile (filename, dirname)
    and return a pointer to it.
    If TYPE is NULL, determine symbol type from the die, otherwise
    used the passed type.
 */
+ */
 
 static struct symbol *
 new_symbol (die, type, objfile)
@@ -4117,7 +4122,7 @@ new_symbol (die, type, objfile)
                                        &objfile->symbol_obstack);
 
       /* Default assumptions.
-        Use the passed type or decode it from the die.  */
+         Use the passed type or decode it from the die.  */
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       SYMBOL_CLASS (sym) = LOC_STATIC;
       if (type != NULL)
@@ -4192,7 +4197,7 @@ new_symbol (die, type, objfile)
                    decode_locdesc (DW_BLOCK (attr), objfile);
                  add_symbol_to_list (sym, &global_symbols);
 
-                 /* In shared libraries the address of the variable
+                 /* In shared libraries the address of the variable
                     in the location descriptor might still be relocatable,
                     so its value could be zero.
                     Enter the symbol as a LOC_UNRESOLVED symbol, if its
@@ -4239,11 +4244,11 @@ new_symbol (die, type, objfile)
          else
            {
              /* We do not know the address of this symbol.
-                If it is an external symbol and we have type information
-                for it, enter the symbol as a LOC_UNRESOLVED symbol.
-                The address of the variable will then be determined from
-                the minimal symbol table whenever the variable is
-                referenced.  */
+                If it is an external symbol and we have type information
+                for it, enter the symbol as a LOC_UNRESOLVED symbol.
+                The address of the variable will then be determined from
+                the minimal symbol table whenever the variable is
+                referenced.  */
              attr2 = dwarf_attr (die, DW_AT_external);
              if (attr2 && (DW_UNSND (attr2) != 0)
                  && dwarf_attr (die, DW_AT_type) != NULL)
@@ -4307,8 +4312,8 @@ new_symbol (die, type, objfile)
          if (cu_language == language_cplus)
            {
              struct symbol *typedef_sym = (struct symbol *)
-               obstack_alloc (&objfile->symbol_obstack,
-                              sizeof (struct symbol));
+             obstack_alloc (&objfile->symbol_obstack,
+                            sizeof (struct symbol));
              *typedef_sym = *sym;
              SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
              if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
@@ -5514,7 +5519,7 @@ dump_die (die)
        case DW_FORM_string:
          fprintf (stderr, "string: \"%s\"",
                   DW_STRING (&die->attrs[i])
-                    ? DW_STRING (&die->attrs[i]) : "");
+                  ? DW_STRING (&die->attrs[i]) : "");
          break;
        case DW_FORM_flag:
          if (DW_UNSND (&die->attrs[i]))
@@ -5528,7 +5533,7 @@ dump_die (die)
        case DW_FORM_data8:     /* we do not have 64 bit quantities */
        default:
          fprintf (stderr, "unsupported attribute form: %d.",
-                          die->attrs[i].form);
+                  die->attrs[i].form);
        }
       fprintf (stderr, "\n");
     }
@@ -5656,7 +5661,7 @@ dwarf2_fundamental_type (objfile, typeid)
    DW_AT_frame_base attribute, the global islocal flag is set.
    Hopefully the machine dependent code knows how to set up a virtual
    frame pointer for the local references.
+
    Note that stack[0] is unused except as a default error return.
    Note that stack overflow is not yet handled.  */
 
@@ -5828,7 +5833,7 @@ decode_locdesc (blk, objfile)
 
        case DW_OP_constu:
          stack[++stacki] = read_unsigned_leb128 (NULL, (data + i),
-                                                        &bytes_read);
+                                                 &bytes_read);
          i += bytes_read;
          break;
 
@@ -5855,13 +5860,13 @@ decode_locdesc (blk, objfile)
        case DW_OP_deref:
          isderef = 1;
          /* If we're not the last op, then we definitely can't encode
-             this using GDB's address_class enum.  */
+            this using GDB's address_class enum.  */
          if (i < size)
            complain (&dwarf2_complex_location_expr);
          break;
 
        default:
-         complain (&dwarf2_unsupported_stack_op, dwarf_stack_op_name(op));
+         complain (&dwarf2_unsupported_stack_op, dwarf_stack_op_name (op));
          return (stack[stacki]);
        }
     }
index 45a0e238550ecf67374664a1e4ec8d78b0a3b808..e9893caa26a908be5e7bc20bc9d6746903a169d4 100644 (file)
@@ -4,40 +4,40 @@
    Written by Fred Fish at Cygnus Support.  Portions based on dbxread.c,
    mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /*
 
-FIXME: Do we need to generate dependencies in partial symtabs?
-(Perhaps we don't need to).
+   FIXME: Do we need to generate dependencies in partial symtabs?
+   (Perhaps we don't need to).
 
-FIXME: Resolve minor differences between what information we put in the
-partial symbol table and what dbxread puts in.  For example, we don't yet
-put enum constants there.  And dbxread seems to invent a lot of typedefs
-we never see.  Use the new printpsym command to see the partial symbol table
-contents.
+   FIXME: Resolve minor differences between what information we put in the
+   partial symbol table and what dbxread puts in.  For example, we don't yet
+   put enum constants there.  And dbxread seems to invent a lot of typedefs
+   we never see.  Use the new printpsym command to see the partial symbol table
+   contents.
 
-FIXME: Figure out a better way to tell gdb about the name of the function
-contain the user's entry point (I.E. main())
+   FIXME: Figure out a better way to tell gdb about the name of the function
+   contain the user's entry point (I.E. main())
 
-FIXME: See other FIXME's and "ifdef 0" scattered throughout the code for
-other things to work on, if you get bored. :-)
+   FIXME: See other FIXME's and "ifdef 0" scattered throughout the code for
+   other things to work on, if you get bored. :-)
 
-*/
+ */
 
 #include "defs.h"
 #include "symtab.h"
@@ -47,7 +47,7 @@ other things to work on, if you get bored. :-)
 #include "elf/dwarf.h"
 #include "buildsym.h"
 #include "demangle.h"
-#include "expression.h"        /* Needed for enum exp_opcode in language.h, sigh... */
+#include "expression.h"                /* Needed for enum exp_opcode in language.h, sigh... */
 #include "language.h"
 #include "complaints.h"
 
@@ -245,8 +245,8 @@ typedef unsigned int DIE_REF;       /* Reference to a DIE */
 
 /* External variables referenced. */
 
-extern int info_verbose;               /* From main.c; nonzero => verbose */
-extern char *warning_pre_print;                /* From utils.c */
+extern int info_verbose;       /* From main.c; nonzero => verbose */
+extern char *warning_pre_print;        /* From utils.c */
 
 /* The DWARF debugging information consists of two major pieces,
    one is a block of DWARF Information Entries (DIE's) and the other
@@ -272,74 +272,75 @@ extern char *warning_pre_print;           /* From utils.c */
    we may want to test for the presence of some attributes in the DIE,
    such as AT_low_pc, without restricting the values of the field,
    we need someway to note that we found such an attribute.
-   
+
  */
-   
+
 typedef char BLOCK;
 
-struct dieinfo {
-  char *               die;            /* Pointer to the raw DIE data */
-  unsigned long        die_length;     /* Length of the raw DIE data */
-  DIE_REF              die_ref;        /* Offset of this DIE */
-  unsigned short       die_tag;        /* Tag for this DIE */
-  unsigned long                at_padding;
-  unsigned long                at_sibling;
-  BLOCK *              at_location;
-  char *               at_name;
-  unsigned short       at_fund_type;
-  BLOCK *              at_mod_fund_type;
-  unsigned long                at_user_def_type;
-  BLOCK *              at_mod_u_d_type;
-  unsigned short       at_ordering;
-  BLOCK *              at_subscr_data;
-  unsigned long                at_byte_size;
-  unsigned short       at_bit_offset;
-  unsigned long                at_bit_size;
-  BLOCK *              at_element_list;
-  unsigned long                at_stmt_list;
-  CORE_ADDR            at_low_pc;
-  CORE_ADDR            at_high_pc;
-  unsigned long                at_language;
-  unsigned long                at_member;
-  unsigned long                at_discr;
-  BLOCK *              at_discr_value;
-  BLOCK *              at_string_length;
-  char *               at_comp_dir;
-  char *               at_producer;
-  unsigned long                at_start_scope;
-  unsigned long                at_stride_size;
-  unsigned long                at_src_info;
-  char *               at_prototyped;
-  unsigned int         has_at_low_pc:1;
-  unsigned int         has_at_stmt_list:1;
-  unsigned int         has_at_byte_size:1;
-  unsigned int         short_element_list:1;
-
-  /* Kludge to identify register variables */
-
-  unsigned int         isreg;
-
-  /* Kludge to identify optimized out variables */
-
-  unsigned int         optimized_out;
-
-  /* Kludge to identify basereg references.
-     Nonzero if we have an offset relative to a basereg.  */
-
-  unsigned int         offreg;
-
-  /* Kludge to identify which base register is it relative to.  */
-
-  unsigned int         basereg;
-};
+struct dieinfo
+  {
+    char *die;                 /* Pointer to the raw DIE data */
+    unsigned long die_length;  /* Length of the raw DIE data */
+    DIE_REF die_ref;           /* Offset of this DIE */
+    unsigned short die_tag;    /* Tag for this DIE */
+    unsigned long at_padding;
+    unsigned long at_sibling;
+    BLOCK *at_location;
+    char *at_name;
+    unsigned short at_fund_type;
+    BLOCK *at_mod_fund_type;
+    unsigned long at_user_def_type;
+    BLOCK *at_mod_u_d_type;
+    unsigned short at_ordering;
+    BLOCK *at_subscr_data;
+    unsigned long at_byte_size;
+    unsigned short at_bit_offset;
+    unsigned long at_bit_size;
+    BLOCK *at_element_list;
+    unsigned long at_stmt_list;
+    CORE_ADDR at_low_pc;
+    CORE_ADDR at_high_pc;
+    unsigned long at_language;
+    unsigned long at_member;
+    unsigned long at_discr;
+    BLOCK *at_discr_value;
+    BLOCK *at_string_length;
+    char *at_comp_dir;
+    char *at_producer;
+    unsigned long at_start_scope;
+    unsigned long at_stride_size;
+    unsigned long at_src_info;
+    char *at_prototyped;
+    unsigned int has_at_low_pc:1;
+    unsigned int has_at_stmt_list:1;
+    unsigned int has_at_byte_size:1;
+    unsigned int short_element_list:1;
+
+    /* Kludge to identify register variables */
+
+    unsigned int isreg;
+
+    /* Kludge to identify optimized out variables */
+
+    unsigned int optimized_out;
+
+    /* Kludge to identify basereg references.
+       Nonzero if we have an offset relative to a basereg.  */
+
+    unsigned int offreg;
+
+    /* Kludge to identify which base register is it relative to.  */
+
+    unsigned int basereg;
+  };
 
-static int diecount;   /* Approximate count of dies for compilation unit */
+static int diecount;           /* Approximate count of dies for compilation unit */
 static struct dieinfo *curdie; /* For warnings and such */
 
-static char *dbbase;   /* Base pointer to dwarf info */
-static int dbsize;     /* Size of dwarf info in bytes */
-static int dbroff;     /* Relative offset from start of .debug section */
-static char *lnbase;   /* Base pointer to line section */
+static char *dbbase;           /* Base pointer to dwarf info */
+static int dbsize;             /* Size of dwarf info in bytes */
+static int dbroff;             /* Relative offset from start of .debug section */
+static char *lnbase;           /* Base pointer to line section */
 
 /* This value is added to each symbol value.  FIXME:  Generalize to 
    the section_offsets structure used by dbxread (once this is done,
@@ -353,27 +354,28 @@ static struct section_offsets *base_section_offsets;
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.  */
 
-struct dwfinfo {
-  /* Always the absolute file offset to the start of the ".debug"
-     section for the file containing the DIE's being accessed.  */
-  file_ptr dbfoff;
-  /* Relative offset from the start of the ".debug" section to the
-     first DIE to be accessed.  When building the partial symbol
-     table, this value will be zero since we are accessing the
-     entire ".debug" section.  When expanding a partial symbol
-     table entry, this value will be the offset to the first
-     DIE for the compilation unit containing the symbol that
-     triggers the expansion.  */
-  int dbroff;
-  /* The size of the chunk of DIE's being examined, in bytes.  */
-  int dblength;
-  /* The absolute file offset to the line table fragment.  Ignored
-     when building partial symbol tables, but used when expanding
-     them, and contains the absolute file offset to the fragment
-     of the ".line" section containing the line numbers for the
-     current compilation unit.  */
-  file_ptr lnfoff;
-};
+struct dwfinfo
+  {
+    /* Always the absolute file offset to the start of the ".debug"
+       section for the file containing the DIE's being accessed.  */
+    file_ptr dbfoff;
+    /* Relative offset from the start of the ".debug" section to the
+       first DIE to be accessed.  When building the partial symbol
+       table, this value will be zero since we are accessing the
+       entire ".debug" section.  When expanding a partial symbol
+       table entry, this value will be the offset to the first
+       DIE for the compilation unit containing the symbol that
+       triggers the expansion.  */
+    int dbroff;
+    /* The size of the chunk of DIE's being examined, in bytes.  */
+    int dblength;
+    /* The absolute file offset to the line table fragment.  Ignored
+       when building partial symbol tables, but used when expanding
+       them, and contains the absolute file offset to the fragment
+       of the ".line" section containing the line numbers for the
+       current compilation unit.  */
+    file_ptr lnfoff;
+  };
 
 #define DBFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbfoff)
 #define DBROFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbroff)
@@ -430,7 +432,7 @@ static int numutypes;               /* Max number of user type pointers */
    FT_NUM_MEMBERS compile time constant, which is the number of predefined
    fundamental types gdb knows how to construct. */
 
-static struct type *ftypes[FT_NUM_MEMBERS];  /* Fundamental types */
+static struct type *ftypes[FT_NUM_MEMBERS];    /* Fundamental types */
 
 /* Record the language for the compilation unit which is currently being
    processed.  We know it once we have seen the TAG_compile_unit DIE,
@@ -455,7 +457,7 @@ static int
 attribute_size PARAMS ((unsigned int));
 
 static CORE_ADDR
-target_to_host PARAMS ((char *, int, int, struct objfile *));
+  target_to_host PARAMS ((char *, int, int, struct objfile *));
 
 static void
 add_enum_psymbol PARAMS ((struct dieinfo *, struct objfile *));
@@ -506,19 +508,19 @@ read_structure_scope PARAMS ((struct dieinfo *, char *, char *,
                              struct objfile *));
 
 static struct type *
-decode_array_element_type PARAMS ((char *));
+  decode_array_element_type PARAMS ((char *));
 
 static struct type *
-decode_subscript_data_item PARAMS ((char *, char *));
+  decode_subscript_data_item PARAMS ((char *, char *));
 
 static void
 dwarf_read_array_type PARAMS ((struct dieinfo *));
 
 static void
-read_tag_pointer_type PARAMS ((struct dieinfo *dip));
+read_tag_pointer_type PARAMS ((struct dieinfo * dip));
 
 static void
-read_tag_string_type PARAMS ((struct dieinfo *dip));
+read_tag_string_type PARAMS ((struct dieinfo * dip));
 
 static void
 read_subroutine_type PARAMS ((struct dieinfo *, char *, char *));
@@ -527,40 +529,40 @@ static void
 read_enumeration PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
 
 static struct type *
-struct_type PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
+  struct_type PARAMS ((struct dieinfo *, char *, char *, struct objfile *));
 
 static struct type *
-enum_type PARAMS ((struct dieinfo *, struct objfile *));
+  enum_type PARAMS ((struct dieinfo *, struct objfile *));
 
 static void
 decode_line_numbers PARAMS ((char *));
 
 static struct type *
-decode_die_type PARAMS ((struct dieinfo *));
+  decode_die_type PARAMS ((struct dieinfo *));
 
 static struct type *
-decode_mod_fund_type PARAMS ((char *));
+  decode_mod_fund_type PARAMS ((char *));
 
 static struct type *
-decode_mod_u_d_type PARAMS ((char *));
+  decode_mod_u_d_type PARAMS ((char *));
 
 static struct type *
-decode_modified_type PARAMS ((char *, unsigned int, int));
+  decode_modified_type PARAMS ((char *, unsigned int, int));
 
 static struct type *
-decode_fund_type PARAMS ((unsigned int));
+  decode_fund_type PARAMS ((unsigned int));
 
 static char *
-create_name PARAMS ((char *, struct obstack *));
+  create_name PARAMS ((char *, struct obstack *));
 
 static struct type *
-lookup_utype PARAMS ((DIE_REF));
+  lookup_utype PARAMS ((DIE_REF));
 
 static struct type *
-alloc_utype PARAMS ((DIE_REF, struct type *));
+  alloc_utype PARAMS ((DIE_REF, struct type *));
 
 static struct symbol *
-new_symbol PARAMS ((struct dieinfo *, struct objfile *));
+  new_symbol PARAMS ((struct dieinfo *, struct objfile *));
 
 static void
 synthesize_typedef PARAMS ((struct dieinfo *, struct objfile *,
@@ -573,42 +575,42 @@ static void
 set_cu_language PARAMS ((struct dieinfo *));
 
 static struct type *
-dwarf_fundamental_type PARAMS ((struct objfile *, int));
+  dwarf_fundamental_type PARAMS ((struct objfile *, int));
 
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       dwarf_fundamental_type -- lookup or create a fundamental type
+   dwarf_fundamental_type -- lookup or create a fundamental type
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct type *
-       dwarf_fundamental_type (struct objfile *objfile, int typeid)
+   struct type *
+   dwarf_fundamental_type (struct objfile *objfile, int typeid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       DWARF version 1 doesn't supply any fundamental type information,
-       so gdb has to construct such types.  It has a fixed number of
-       fundamental types that it knows how to construct, which is the
-       union of all types that it knows how to construct for all languages
-       that it knows about.  These are enumerated in gdbtypes.h.
+   DWARF version 1 doesn't supply any fundamental type information,
+   so gdb has to construct such types.  It has a fixed number of
+   fundamental types that it knows how to construct, which is the
+   union of all types that it knows how to construct for all languages
+   that it knows about.  These are enumerated in gdbtypes.h.
 
-       As an example, assume we find a DIE that references a DWARF
-       fundamental type of FT_integer.  We first look in the ftypes
-       array to see if we already have such a type, indexed by the
-       gdb internal value of FT_INTEGER.  If so, we simply return a
-       pointer to that type.  If not, then we ask an appropriate
-       language dependent routine to create a type FT_INTEGER, using
-       defaults reasonable for the current target machine, and install
-       that type in ftypes for future reference.
+   As an example, assume we find a DIE that references a DWARF
+   fundamental type of FT_integer.  We first look in the ftypes
+   array to see if we already have such a type, indexed by the
+   gdb internal value of FT_INTEGER.  If so, we simply return a
+   pointer to that type.  If not, then we ask an appropriate
+   language dependent routine to create a type FT_INTEGER, using
+   defaults reasonable for the current target machine, and install
+   that type in ftypes for future reference.
 
-RETURNS
+   RETURNS
 
-       Pointer to a fundamental type.
+   Pointer to a fundamental type.
 
-*/
+ */
 
 static struct type *
 dwarf_fundamental_type (objfile, typeid)
@@ -626,7 +628,7 @@ dwarf_fundamental_type (objfile, typeid)
 
   if (ftypes[typeid] == NULL)
     {
-      ftypes[typeid] = cu_language_defn -> la_fund_type(objfile, typeid);
+      ftypes[typeid] = cu_language_defn->la_fund_type (objfile, typeid);
     }
 
   return (ftypes[typeid]);
@@ -634,24 +636,24 @@ dwarf_fundamental_type (objfile, typeid)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       set_cu_language -- set local copy of language for compilation unit
+   set_cu_language -- set local copy of language for compilation unit
 
-SYNOPSIS
+   SYNOPSIS
 
-       void
-       set_cu_language (struct dieinfo *dip)
+   void
+   set_cu_language (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Decode the language attribute for a compilation unit DIE and
-       remember what the language was.  We use this at various times
-       when processing DIE's for a given compilation unit.
+   Decode the language attribute for a compilation unit DIE and
+   remember what the language was.  We use this at various times
+   when processing DIE's for a given compilation unit.
 
-RETURNS
+   RETURNS
 
-       No return value.
+   No return value.
 
  */
 
@@ -659,69 +661,69 @@ static void
 set_cu_language (dip)
      struct dieinfo *dip;
 {
-  switch (dip -> at_language)
+  switch (dip->at_language)
     {
-      case LANG_C89:
-      case LANG_C:
-        cu_language = language_c;
-       break;
-      case LANG_C_PLUS_PLUS:
-       cu_language = language_cplus;
-       break;
-      case LANG_CHILL:
-       cu_language = language_chill;
-       break;
-      case LANG_MODULA2:
-       cu_language = language_m2;
-       break;
-      case LANG_FORTRAN77:
-      case LANG_FORTRAN90:
-       cu_language = language_fortran;
-       break;
-      case LANG_ADA83:
-      case LANG_COBOL74:
-      case LANG_COBOL85:
-      case LANG_PASCAL83:
-       /* We don't know anything special about these yet. */
-       cu_language = language_unknown;
-       break;
-      default:
-       /* If no at_language, try to deduce one from the filename */
-       cu_language = deduce_language_from_filename (dip -> at_name);
-       break;
+    case LANG_C89:
+    case LANG_C:
+      cu_language = language_c;
+      break;
+    case LANG_C_PLUS_PLUS:
+      cu_language = language_cplus;
+      break;
+    case LANG_CHILL:
+      cu_language = language_chill;
+      break;
+    case LANG_MODULA2:
+      cu_language = language_m2;
+      break;
+    case LANG_FORTRAN77:
+    case LANG_FORTRAN90:
+      cu_language = language_fortran;
+      break;
+    case LANG_ADA83:
+    case LANG_COBOL74:
+    case LANG_COBOL85:
+    case LANG_PASCAL83:
+      /* We don't know anything special about these yet. */
+      cu_language = language_unknown;
+      break;
+    default:
+      /* If no at_language, try to deduce one from the filename */
+      cu_language = deduce_language_from_filename (dip->at_name);
+      break;
     }
   cu_language_defn = language_def (cu_language);
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       dwarf_build_psymtabs -- build partial symtabs from DWARF debug info
+   dwarf_build_psymtabs -- build partial symtabs from DWARF debug info
 
-SYNOPSIS
+   SYNOPSIS
 
-       void dwarf_build_psymtabs (struct objfile *objfile,
-            struct section_offsets *section_offsets,
-            int mainline, file_ptr dbfoff, unsigned int dbfsize,
-            file_ptr lnoffset, unsigned int lnsize)
+   void dwarf_build_psymtabs (struct objfile *objfile,
+   struct section_offsets *section_offsets,
+   int mainline, file_ptr dbfoff, unsigned int dbfsize,
+   file_ptr lnoffset, unsigned int lnsize)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function is called upon to build partial symtabs from files
-       containing DIE's (Dwarf Information Entries) and DWARF line numbers.
+   This function is called upon to build partial symtabs from files
+   containing DIE's (Dwarf Information Entries) and DWARF line numbers.
 
-       It is passed a bfd* containing the DIES
-       and line number information, the corresponding filename for that
-       file, a base address for relocating the symbols, a flag indicating
-       whether or not this debugging information is from a "main symbol
-       table" rather than a shared library or dynamically linked file,
-       and file offset/size pairs for the DIE information and line number
-       information.
+   It is passed a bfd* containing the DIES
+   and line number information, the corresponding filename for that
+   file, a base address for relocating the symbols, a flag indicating
+   whether or not this debugging information is from a "main symbol
+   table" rather than a shared library or dynamically linked file,
+   and file offset/size pairs for the DIE information and line number
+   information.
 
-RETURNS
+   RETURNS
 
-       No return value.
+   No return value.
 
  */
 
@@ -738,7 +740,7 @@ dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
 {
   bfd *abfd = objfile->obfd;
   struct cleanup *back_to;
-  
+
   current_objfile = objfile;
   dbsize = dbfsize;
   dbbase = xmalloc (dbsize);
@@ -750,17 +752,17 @@ dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
       error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
     }
   back_to = make_cleanup (free, dbbase);
-  
+
   /* If we are reinitializing, or if we have never loaded syms yet, init.
      Since we have no idea how many DIES we are looking at, we just guess
      some arbitrary value. */
-  
-  if (mainline || objfile -> global_psymbols.size == 0 ||
-      objfile -> static_psymbols.size == 0)
+
+  if (mainline || objfile->global_psymbols.size == 0 ||
+      objfile->static_psymbols.size == 0)
     {
       init_psymbol_list (objfile, 1024);
     }
-  
+
   /* Save the relocation factor where everybody can see it.  */
 
   base_section_offsets = section_offsets;
@@ -769,28 +771,28 @@ dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
   /* Follow the compilation unit sibling chain, building a partial symbol
      table entry for each one.  Save enough information about each compilation
      unit to locate the full DWARF information later. */
-  
+
   scan_compilation_units (dbbase, dbbase + dbsize, dbfoff, lnoffset, objfile);
-  
+
   do_cleanups (back_to);
   current_objfile = NULL;
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_lexical_block_scope -- process all dies in a lexical block
+   read_lexical_block_scope -- process all dies in a lexical block
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_lexical_block_scope (struct dieinfo *dip,
-               char *thisdie, char *enddie)
+   static void read_lexical_block_scope (struct dieinfo *dip,
+   char *thisdie, char *enddie)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Process all the DIES contained within a lexical block scope.
-       Start a new scope, process the dies, and then close the scope.
+   Process all the DIES contained within a lexical block scope.
+   Start a new scope, process the dies, and then close the scope.
 
  */
 
@@ -803,34 +805,34 @@ read_lexical_block_scope (dip, thisdie, enddie, objfile)
 {
   register struct context_stack *new;
 
-  push_context (0, dip -> at_low_pc);
-  process_dies (thisdie + dip -> die_length, enddie, objfile);
+  push_context (0, dip->at_low_pc);
+  process_dies (thisdie + dip->die_length, enddie, objfile);
   new = pop_context ();
   if (local_symbols != NULL)
     {
-      finish_block (0, &local_symbols, new -> old_blocks, new -> start_addr,
-                   dip -> at_high_pc, objfile);
+      finish_block (0, &local_symbols, new->old_blocks, new->start_addr,
+                   dip->at_high_pc, objfile);
     }
-  local_symbols = new -> locals;
+  local_symbols = new->locals;
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       lookup_utype -- look up a user defined type from die reference
+   lookup_utype -- look up a user defined type from die reference
 
-SYNOPSIS
+   SYNOPSIS
 
-       static type *lookup_utype (DIE_REF die_ref)
+   static type *lookup_utype (DIE_REF die_ref)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a DIE reference, lookup the user defined type associated with
-       that DIE, if it has been registered already.  If not registered, then
-       return NULL.  Alloc_utype() can be called to register an empty
-       type for this reference, which will be filled in later when the
-       actual referenced DIE is processed.
+   Given a DIE reference, lookup the user defined type associated with
+   that DIE, if it has been registered already.  If not registered, then
+   return NULL.  Alloc_utype() can be called to register an empty
+   type for this reference, which will be filled in later when the
+   actual referenced DIE is processed.
  */
 
 static struct type *
@@ -839,7 +841,7 @@ lookup_utype (die_ref)
 {
   struct type *type = NULL;
   int utypeidx;
-  
+
   utypeidx = (die_ref - dbroff) / 4;
   if ((utypeidx < 0) || (utypeidx >= numutypes))
     {
@@ -855,23 +857,23 @@ lookup_utype (die_ref)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       alloc_utype  -- add a user defined type for die reference
+   alloc_utype  -- add a user defined type for die reference
 
-SYNOPSIS
+   SYNOPSIS
 
-       static type *alloc_utype (DIE_REF die_ref, struct type *utypep)
+   static type *alloc_utype (DIE_REF die_ref, struct type *utypep)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a die reference DIE_REF, and a possible pointer to a user
-       defined type UTYPEP, register that this reference has a user
-       defined type and either use the specified type in UTYPEP or
-       make a new empty type that will be filled in later.
+   Given a die reference DIE_REF, and a possible pointer to a user
+   defined type UTYPEP, register that this reference has a user
+   defined type and either use the specified type in UTYPEP or
+   make a new empty type that will be filled in later.
 
-       We should only be called after calling lookup_utype() to verify that
-       there is not currently a type registered for DIE_REF.
+   We should only be called after calling lookup_utype() to verify that
+   there is not currently a type registered for DIE_REF.
  */
 
 static struct type *
@@ -881,7 +883,7 @@ alloc_utype (die_ref, utypep)
 {
   struct type **typep;
   int utypeidx;
-  
+
   utypeidx = (die_ref - dbroff) / 4;
   typep = utypes + utypeidx;
   if ((utypeidx < 0) || (utypeidx >= numutypes))
@@ -907,19 +909,19 @@ alloc_utype (die_ref, utypep)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       free_utypes -- free the utypes array and reset pointer & count
+   free_utypes -- free the utypes array and reset pointer & count
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void free_utypes (PTR dummy)
+   static void free_utypes (PTR dummy)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Called via do_cleanups to free the utypes array, reset the pointer to NULL,
-       and set numutypes back to zero.  This ensures that the utypes does not get
-       referenced after being freed.
+   Called via do_cleanups to free the utypes array, reset the pointer to NULL,
+   and set numutypes back to zero.  This ensures that the utypes does not get
+   referenced after being freed.
  */
 
 static void
@@ -934,19 +936,19 @@ free_utypes (dummy)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_die_type -- return a type for a specified die
+   decode_die_type -- return a type for a specified die
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *decode_die_type (struct dieinfo *dip)
+   static struct type *decode_die_type (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a die information structure DIP, decode the
-       type of the die and return a pointer to the decoded type.  All
-       dies without specific types default to type int.
+   Given a pointer to a die information structure DIP, decode the
+   type of the die and return a pointer to the decoded type.  All
+   dies without specific types default to type int.
  */
 
 static struct type *
@@ -954,25 +956,25 @@ decode_die_type (dip)
      struct dieinfo *dip;
 {
   struct type *type = NULL;
-  
-  if (dip -> at_fund_type != 0)
+
+  if (dip->at_fund_type != 0)
     {
-      type = decode_fund_type (dip -> at_fund_type);
+      type = decode_fund_type (dip->at_fund_type);
     }
-  else if (dip -> at_mod_fund_type != NULL)
+  else if (dip->at_mod_fund_type != NULL)
     {
-      type = decode_mod_fund_type (dip -> at_mod_fund_type);
+      type = decode_mod_fund_type (dip->at_mod_fund_type);
     }
-  else if (dip -> at_user_def_type)
+  else if (dip->at_user_def_type)
     {
-      if ((type = lookup_utype (dip -> at_user_def_type)) == NULL)
+      if ((type = lookup_utype (dip->at_user_def_type)) == NULL)
        {
-         type = alloc_utype (dip -> at_user_def_type, NULL);
+         type = alloc_utype (dip->at_user_def_type, NULL);
        }
     }
-  else if (dip -> at_mod_u_d_type)
+  else if (dip->at_mod_u_d_type)
     {
-      type = decode_mod_u_d_type (dip -> at_mod_u_d_type);
+      type = decode_mod_u_d_type (dip->at_mod_u_d_type);
     }
   else
     {
@@ -983,22 +985,22 @@ decode_die_type (dip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       struct_type -- compute and return the type for a struct or union
+   struct_type -- compute and return the type for a struct or union
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *struct_type (struct dieinfo *dip, char *thisdie,
-           char *enddie, struct objfile *objfile)
+   static struct type *struct_type (struct dieinfo *dip, char *thisdie,
+   char *enddie, struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given pointer to a die information structure for a die which
-       defines a union or structure (and MUST define one or the other),
-       and pointers to the raw die data that define the range of dies which
-       define the members, compute and return the user defined type for the
-       structure or union.
+   Given pointer to a die information structure for a die which
+   defines a union or structure (and MUST define one or the other),
+   and pointers to the raw die data that define the range of dies which
+   define the members, compute and return the user defined type for the
+   structure or union.
  */
 
 static struct type *
@@ -1009,10 +1011,11 @@ struct_type (dip, thisdie, enddie, objfile)
      struct objfile *objfile;
 {
   struct type *type;
-  struct nextfield {
-    struct nextfield *next;
-    struct field field;
-  };
+  struct nextfield
+    {
+      struct nextfield *next;
+      struct field field;
+    };
   struct nextfield *list = NULL;
   struct nextfield *new;
   int nfields = 0;
@@ -1020,47 +1023,47 @@ struct_type (dip, thisdie, enddie, objfile)
   struct dieinfo mbr;
   char *nextdie;
   int anonymous_size;
-  
-  if ((type = lookup_utype (dip -> die_ref)) == NULL)
+
+  if ((type = lookup_utype (dip->die_ref)) == NULL)
     {
       /* No forward references created an empty type, so install one now */
-      type = alloc_utype (dip -> die_ref, NULL);
+      type = alloc_utype (dip->die_ref, NULL);
     }
-  INIT_CPLUS_SPECIFIC(type);
-  switch (dip -> die_tag)
+  INIT_CPLUS_SPECIFIC (type);
+  switch (dip->die_tag)
     {
-      case TAG_class_type:
-        TYPE_CODE (type) = TYPE_CODE_CLASS;
-       break;
-      case TAG_structure_type:
-        TYPE_CODE (type) = TYPE_CODE_STRUCT;
-       break;
-      case TAG_union_type:
-       TYPE_CODE (type) = TYPE_CODE_UNION;
-       break;
-      default:
-       /* Should never happen */
-       TYPE_CODE (type) = TYPE_CODE_UNDEF;
-       complain (&missing_tag, DIE_ID, DIE_NAME);
-       break;
+    case TAG_class_type:
+      TYPE_CODE (type) = TYPE_CODE_CLASS;
+      break;
+    case TAG_structure_type:
+      TYPE_CODE (type) = TYPE_CODE_STRUCT;
+      break;
+    case TAG_union_type:
+      TYPE_CODE (type) = TYPE_CODE_UNION;
+      break;
+    default:
+      /* Should never happen */
+      TYPE_CODE (type) = TYPE_CODE_UNDEF;
+      complain (&missing_tag, DIE_ID, DIE_NAME);
+      break;
     }
   /* Some compilers try to be helpful by inventing "fake" names for
      anonymous enums, structures, and unions, like "~0fake" or ".0fake".
      Thanks, but no thanks... */
-  if (dip -> at_name != NULL
-      && *dip -> at_name != '~'
-      && *dip -> at_name != '.')
+  if (dip->at_name != NULL
+      && *dip->at_name != '~'
+      && *dip->at_name != '.')
     {
-      TYPE_TAG_NAME (type) = obconcat (&objfile -> type_obstack,
-                                      "", "", dip -> at_name);
+      TYPE_TAG_NAME (type) = obconcat (&objfile->type_obstack,
+                                      "", "", dip->at_name);
     }
   /* Use whatever size is known.  Zero is a valid size.  We might however
      wish to check has_at_byte_size to make sure that some byte size was
      given explicitly, but DWARF doesn't specify that explicit sizes of
      zero have to present, so complaining about missing sizes should 
      probably not be the default. */
-  TYPE_LENGTH (type) = dip -> at_byte_size;
-  thisdie += dip -> die_length;
+  TYPE_LENGTH (type) = dip->at_byte_size;
+  thisdie += dip->die_length;
   while (thisdie < enddie)
     {
       basicdieinfo (&mbr, thisdie, objfile);
@@ -1082,12 +1085,12 @@ struct_type (dip, thisdie, enddie, objfile)
        case TAG_member:
          /* Get space to record the next field's data.  */
          new = (struct nextfield *) alloca (sizeof (struct nextfield));
-         new -> next = list;
+         new->next = list;
          list = new;
          /* Save the data.  */
-         list -> field.name =
-             obsavestring (mbr.at_name, strlen (mbr.at_name),
-                           &objfile -> type_obstack);
+         list->field.name =
+           obsavestring (mbr.at_name, strlen (mbr.at_name),
+                         &objfile->type_obstack);
          FIELD_TYPE (list->field) = decode_die_type (&mbr);
          FIELD_BITPOS (list->field) = 8 * locval (&mbr);
          /* Handle bit fields. */
@@ -1095,39 +1098,39 @@ struct_type (dip, thisdie, enddie, objfile)
          if (BITS_BIG_ENDIAN)
            {
              /* For big endian bits, the at_bit_offset gives the
-                additional bit offset from the MSB of the containing
-                anonymous object to the MSB of the field.  We don't
-                have to do anything special since we don't need to
-                know the size of the anonymous object. */
+                additional bit offset from the MSB of the containing
+                anonymous object to the MSB of the field.  We don't
+                have to do anything special since we don't need to
+                know the size of the anonymous object. */
              FIELD_BITPOS (list->field) += mbr.at_bit_offset;
            }
          else
            {
              /* For little endian bits, we need to have a non-zero
-                at_bit_size, so that we know we are in fact dealing
-                with a bitfield.  Compute the bit offset to the MSB
-                of the anonymous object, subtract off the number of
-                bits from the MSB of the field to the MSB of the
-                object, and then subtract off the number of bits of
-                the field itself.  The result is the bit offset of
-                the LSB of the field. */
+                at_bit_size, so that we know we are in fact dealing
+                with a bitfield.  Compute the bit offset to the MSB
+                of the anonymous object, subtract off the number of
+                bits from the MSB of the field to the MSB of the
+                object, and then subtract off the number of bits of
+                the field itself.  The result is the bit offset of
+                the LSB of the field. */
              if (mbr.at_bit_size > 0)
                {
                  if (mbr.has_at_byte_size)
                    {
                      /* The size of the anonymous object containing
-                        the bit field is explicit, so use the
-                        indicated size (in bytes). */
+                        the bit field is explicit, so use the
+                        indicated size (in bytes). */
                      anonymous_size = mbr.at_byte_size;
                    }
                  else
                    {
                      /* The size of the anonymous object containing
-                        the bit field matches the size of an object
-                        of the bit field's type.  DWARF allows
-                        at_byte_size to be left out in such cases, as
-                        a debug information size optimization. */
-                     anonymous_size = TYPE_LENGTH (list -> field.type);
+                        the bit field matches the size of an object
+                        of the bit field's type.  DWARF allows
+                        at_byte_size to be left out in such cases, as
+                        a debug information size optimization. */
+                     anonymous_size = TYPE_LENGTH (list->field.type);
                    }
                  FIELD_BITPOS (list->field) +=
                    anonymous_size * 8 - mbr.at_bit_offset - mbr.at_bit_size;
@@ -1156,46 +1159,46 @@ struct_type (dip, thisdie, enddie, objfile)
       TYPE_FIELDS (type) = (struct field *)
        TYPE_ALLOC (type, sizeof (struct field) * nfields);
       /* Copy the saved-up fields into the field vector.  */
-      for (n = nfields; list; list = list -> next)
+      for (n = nfields; list; list = list->next)
        {
-         TYPE_FIELD (type, --n) = list -> field;
-       }       
+         TYPE_FIELD (type, --n) = list->field;
+       }
     }
   return (type);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_structure_scope -- process all dies within struct or union
+   read_structure_scope -- process all dies within struct or union
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_structure_scope (struct dieinfo *dip,
-               char *thisdie, char *enddie, struct objfile *objfile)
+   static void read_structure_scope (struct dieinfo *dip,
+   char *thisdie, char *enddie, struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Called when we find the DIE that starts a structure or union
-       scope (definition) to process all dies that define the members
-       of the structure or union.  DIP is a pointer to the die info
-       struct for the DIE that names the structure or union.
+   Called when we find the DIE that starts a structure or union
+   scope (definition) to process all dies that define the members
+   of the structure or union.  DIP is a pointer to the die info
+   struct for the DIE that names the structure or union.
 
-NOTES
+   NOTES
+
+   Note that we need to call struct_type regardless of whether or not
+   the DIE has an at_name attribute, since it might be an anonymous
+   structure or union.  This gets the type entered into our set of
+   user defined types.
+
+   However, if the structure is incomplete (an opaque struct/union)
+   then suppress creating a symbol table entry for it since gdb only
+   wants to find the one with the complete definition.  Note that if
+   it is complete, we just call new_symbol, which does it's own
+   checking about whether the struct/union is anonymous or not (and
+   suppresses creating a symbol table entry itself).
 
-       Note that we need to call struct_type regardless of whether or not
-       the DIE has an at_name attribute, since it might be an anonymous
-       structure or union.  This gets the type entered into our set of
-       user defined types.
-
-       However, if the structure is incomplete (an opaque struct/union)
-       then suppress creating a symbol table entry for it since gdb only
-       wants to find the one with the complete definition.  Note that if
-       it is complete, we just call new_symbol, which does it's own
-       checking about whether the struct/union is anonymous or not (and
-       suppresses creating a symbol table entry itself).
-       
  */
 
 static void
@@ -1207,7 +1210,7 @@ read_structure_scope (dip, thisdie, enddie, objfile)
 {
   struct type *type;
   struct symbol *sym;
-  
+
   type = struct_type (dip, thisdie, enddie, objfile);
   if (!(TYPE_FLAGS (type) & TYPE_FLAG_STUB))
     {
@@ -1225,21 +1228,21 @@ read_structure_scope (dip, thisdie, enddie, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_array_element_type -- decode type of the array elements
+   decode_array_element_type -- decode type of the array elements
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *decode_array_element_type (char *scan, char *end)
+   static struct type *decode_array_element_type (char *scan, char *end)
 
-DESCRIPTION
+   DESCRIPTION
 
-       As the last step in decoding the array subscript information for an
-       array DIE, we need to decode the type of the array elements.  We are
-       passed a pointer to this last part of the subscript information and
-       must return the appropriate type.  If the type attribute is not
-       recognized, just warn about the problem and return type int.
+   As the last step in decoding the array subscript information for an
+   array DIE, we need to decode the type of the array elements.  We are
+   passed a pointer to this last part of the subscript information and
+   must return the appropriate type.  If the type attribute is not
+   recognized, just warn about the problem and return type int.
  */
 
 static struct type *
@@ -1251,7 +1254,7 @@ decode_array_element_type (scan)
   unsigned short attribute;
   unsigned short fundtype;
   int nbytes;
-  
+
   attribute = target_to_host (scan, SIZEOF_ATTRIBUTE, GET_UNSIGNED,
                              current_objfile);
   scan += SIZEOF_ATTRIBUTE;
@@ -1264,77 +1267,77 @@ decode_array_element_type (scan)
     {
       switch (attribute)
        {
-         case AT_fund_type:
-           fundtype = target_to_host (scan, nbytes, GET_UNSIGNED,
-                                      current_objfile);
-           typep = decode_fund_type (fundtype);
-           break;
-         case AT_mod_fund_type:
-           typep = decode_mod_fund_type (scan);
-           break;
-         case AT_user_def_type:
-           die_ref = target_to_host (scan, nbytes, GET_UNSIGNED,
-                                     current_objfile);
-           if ((typep = lookup_utype (die_ref)) == NULL)
-             {
-               typep = alloc_utype (die_ref, NULL);
-             }
-           break;
-         case AT_mod_u_d_type:
-           typep = decode_mod_u_d_type (scan);
-           break;
-         default:
-           complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute);
-           typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
-           break;
-         }
+       case AT_fund_type:
+         fundtype = target_to_host (scan, nbytes, GET_UNSIGNED,
+                                    current_objfile);
+         typep = decode_fund_type (fundtype);
+         break;
+       case AT_mod_fund_type:
+         typep = decode_mod_fund_type (scan);
+         break;
+       case AT_user_def_type:
+         die_ref = target_to_host (scan, nbytes, GET_UNSIGNED,
+                                   current_objfile);
+         if ((typep = lookup_utype (die_ref)) == NULL)
+           {
+             typep = alloc_utype (die_ref, NULL);
+           }
+         break;
+       case AT_mod_u_d_type:
+         typep = decode_mod_u_d_type (scan);
+         break;
+       default:
+         complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute);
+         typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
+         break;
+       }
     }
   return (typep);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_subscript_data_item -- decode array subscript item
+   decode_subscript_data_item -- decode array subscript item
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *
-       decode_subscript_data_item (char *scan, char *end)
+   static struct type *
+   decode_subscript_data_item (char *scan, char *end)
 
-DESCRIPTION
+   DESCRIPTION
 
-       The array subscripts and the data type of the elements of an
-       array are described by a list of data items, stored as a block
-       of contiguous bytes.  There is a data item describing each array
-       dimension, and a final data item describing the element type.
-       The data items are ordered the same as their appearance in the
-       source (I.E. leftmost dimension first, next to leftmost second,
-       etc).
+   The array subscripts and the data type of the elements of an
+   array are described by a list of data items, stored as a block
+   of contiguous bytes.  There is a data item describing each array
+   dimension, and a final data item describing the element type.
+   The data items are ordered the same as their appearance in the
+   source (I.E. leftmost dimension first, next to leftmost second,
+   etc).
 
-       The data items describing each array dimension consist of four
-       parts: (1) a format specifier, (2) type type of the subscript
-       index, (3) a description of the low bound of the array dimension,
-       and (4) a description of the high bound of the array dimension.
+   The data items describing each array dimension consist of four
+   parts: (1) a format specifier, (2) type type of the subscript
+   index, (3) a description of the low bound of the array dimension,
+   and (4) a description of the high bound of the array dimension.
 
-       The last data item is the description of the type of each of
-       the array elements.
+   The last data item is the description of the type of each of
+   the array elements.
 
-       We are passed a pointer to the start of the block of bytes
-       containing the remaining data items, and a pointer to the first
-       byte past the data.  This function recursively decodes the
-       remaining data items and returns a type.
+   We are passed a pointer to the start of the block of bytes
+   containing the remaining data items, and a pointer to the first
+   byte past the data.  This function recursively decodes the
+   remaining data items and returns a type.
 
-       If we somehow fail to decode some data, we complain about it
-       and return a type "array of int".
+   If we somehow fail to decode some data, we complain about it
+   and return a type "array of int".
 
-BUGS
-       FIXME:  This code only implements the forms currently used
-       by the AT&T and GNU C compilers.
+   BUGS
+   FIXME:  This code only implements the forms currently used
+   by the AT&T and GNU C compilers.
 
-       The end pointer is supplied for error checking, maybe we should
-       use it for that...
+   The end pointer is supplied for error checking, maybe we should
+   use it for that...
  */
 
 static struct type *
@@ -1351,7 +1354,7 @@ decode_subscript_data_item (scan, end)
   unsigned long lowbound;
   unsigned long highbound;
   int nbytes;
-  
+
   format = target_to_host (scan, SIZEOF_FORMAT_SPECIFIER, GET_UNSIGNED,
                           current_objfile);
   scan += SIZEOF_FORMAT_SPECIFIER;
@@ -1378,7 +1381,7 @@ decode_subscript_data_item (scan, end)
          nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
        }
       rangetype = create_range_type ((struct type *) NULL, indextype,
-                                     lowbound, highbound);
+                                    lowbound, highbound);
       typep = create_array_type ((struct type *) NULL, nexttype, rangetype);
       break;
     case FMT_FT_C_X:
@@ -1405,18 +1408,18 @@ decode_subscript_data_item (scan, end)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       dwarf_read_array_type -- read TAG_array_type DIE
+   dwarf_read_array_type -- read TAG_array_type DIE
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void dwarf_read_array_type (struct dieinfo *dip)
+   static void dwarf_read_array_type (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Extract all information from a TAG_array_type DIE and add to
-       the user defined type vector.
+   Extract all information from a TAG_array_type DIE and add to
+   the user defined type vector.
  */
 
 static void
@@ -1429,23 +1432,23 @@ dwarf_read_array_type (dip)
   char *subend;
   unsigned short blocksz;
   int nbytes;
-  
-  if (dip -> at_ordering != ORD_row_major)
+
+  if (dip->at_ordering != ORD_row_major)
     {
       /* FIXME:  Can gdb even handle column major arrays? */
       complain (&not_row_major, DIE_ID, DIE_NAME);
     }
-  if ((sub = dip -> at_subscr_data) != NULL)
+  if ((sub = dip->at_subscr_data) != NULL)
     {
       nbytes = attribute_size (AT_subscr_data);
       blocksz = target_to_host (sub, nbytes, GET_UNSIGNED, current_objfile);
       subend = sub + nbytes + blocksz;
       sub += nbytes;
       type = decode_subscript_data_item (sub, subend);
-      if ((utype = lookup_utype (dip -> die_ref)) == NULL)
+      if ((utype = lookup_utype (dip->die_ref)) == NULL)
        {
          /* Install user defined type that has not been referenced yet. */
-         alloc_utype (dip -> die_ref, type);
+         alloc_utype (dip->die_ref, type);
        }
       else if (TYPE_CODE (utype) == TYPE_CODE_UNDEF)
        {
@@ -1470,18 +1473,18 @@ dwarf_read_array_type (dip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_tag_pointer_type -- read TAG_pointer_type DIE
+   read_tag_pointer_type -- read TAG_pointer_type DIE
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_tag_pointer_type (struct dieinfo *dip)
+   static void read_tag_pointer_type (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Extract all information from a TAG_pointer_type DIE and add to
-       the user defined type vector.
+   Extract all information from a TAG_pointer_type DIE and add to
+   the user defined type vector.
  */
 
 static void
@@ -1490,12 +1493,12 @@ read_tag_pointer_type (dip)
 {
   struct type *type;
   struct type *utype;
-  
+
   type = decode_die_type (dip);
-  if ((utype = lookup_utype (dip -> die_ref)) == NULL)
+  if ((utype = lookup_utype (dip->die_ref)) == NULL)
     {
       utype = lookup_pointer_type (type);
-      alloc_utype (dip -> die_ref, utype);
+      alloc_utype (dip->die_ref, utype);
     }
   else
     {
@@ -1504,27 +1507,27 @@ read_tag_pointer_type (dip)
 
       /* We assume the machine has only one representation for pointers!  */
       /* FIXME:  Possably a poor assumption  */
-      TYPE_LENGTH (utype) = TARGET_PTR_BIT / TARGET_CHAR_BIT ;
+      TYPE_LENGTH (utype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
       TYPE_CODE (utype) = TYPE_CODE_PTR;
     }
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_tag_string_type -- read TAG_string_type DIE
+   read_tag_string_type -- read TAG_string_type DIE
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_tag_string_type (struct dieinfo *dip)
+   static void read_tag_string_type (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Extract all information from a TAG_string_type DIE and add to
-       the user defined type vector.  It isn't really a user defined
-       type, but it behaves like one, with other DIE's using an
-       AT_user_def_type attribute to reference it.
+   Extract all information from a TAG_string_type DIE and add to
+   the user defined type vector.  It isn't really a user defined
+   type, but it behaves like one, with other DIE's using an
+   AT_user_def_type attribute to reference it.
  */
 
 static void
@@ -1537,10 +1540,10 @@ read_tag_string_type (dip)
   unsigned long lowbound = 0;
   unsigned long highbound;
 
-  if (dip -> has_at_byte_size)
+  if (dip->has_at_byte_size)
     {
       /* A fixed bounds string */
-      highbound = dip -> at_byte_size - 1;
+      highbound = dip->at_byte_size - 1;
     }
   else
     {
@@ -1550,17 +1553,17 @@ read_tag_string_type (dip)
   indextype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
   rangetype = create_range_type ((struct type *) NULL, indextype, lowbound,
                                 highbound);
-      
-  utype = lookup_utype (dip -> die_ref);
+
+  utype = lookup_utype (dip->die_ref);
   if (utype == NULL)
     {
       /* No type defined, go ahead and create a blank one to use. */
-      utype = alloc_utype (dip -> die_ref, (struct type *) NULL);
+      utype = alloc_utype (dip->die_ref, (struct type *) NULL);
     }
   else
     {
       /* Already a type in our slot due to a forward reference. Make sure it
-        is a blank one.  If not, complain and leave it alone. */
+         is a blank one.  If not, complain and leave it alone. */
       if (TYPE_CODE (utype) != TYPE_CODE_UNDEF)
        {
          complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
@@ -1574,29 +1577,29 @@ read_tag_string_type (dip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_subroutine_type -- process TAG_subroutine_type dies
+   read_subroutine_type -- process TAG_subroutine_type dies
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_subroutine_type (struct dieinfo *dip, char thisdie,
-               char *enddie)
+   static void read_subroutine_type (struct dieinfo *dip, char thisdie,
+   char *enddie)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Handle DIES due to C code like:
+   Handle DIES due to C code like:
 
-       struct foo {
-           int (*funcp)(int a, long l);  (Generates TAG_subroutine_type DIE)
-           int b;
-       };
+   struct foo {
+   int (*funcp)(int a, long l);  (Generates TAG_subroutine_type DIE)
+   int b;
+   };
 
-NOTES
+   NOTES
 
-       The parameter DIES are currently ignored.  See if gdb has a way to
-       include this info in it's type system, and decode them if so.  Is
-       this what the type structure's "arg_types" field is for?  (FIXME)
+   The parameter DIES are currently ignored.  See if gdb has a way to
+   include this info in it's type system, and decode them if so.  Is
+   this what the type structure's "arg_types" field is for?  (FIXME)
  */
 
 static void
@@ -1607,7 +1610,7 @@ read_subroutine_type (dip, thisdie, enddie)
 {
   struct type *type;           /* Type that this function returns */
   struct type *ftype;          /* Function that returns above type */
-  
+
   /* Decode the type that this subroutine returns */
 
   type = decode_die_type (dip);
@@ -1615,17 +1618,17 @@ read_subroutine_type (dip, thisdie, enddie)
   /* Check to see if we already have a partially constructed user
      defined type for this DIE, from a forward reference. */
 
-  if ((ftype = lookup_utype (dip -> die_ref)) == NULL)
+  if ((ftype = lookup_utype (dip->die_ref)) == NULL)
     {
       /* This is the first reference to one of these types.  Make
-        a new one and place it in the user defined types. */
+         a new one and place it in the user defined types. */
       ftype = lookup_function_type (type);
-      alloc_utype (dip -> die_ref, ftype);
+      alloc_utype (dip->die_ref, ftype);
     }
   else if (TYPE_CODE (ftype) == TYPE_CODE_UNDEF)
     {
       /* We have an existing partially constructed type, so bash it
-        into the correct type. */
+         into the correct type. */
       TYPE_TARGET_TYPE (ftype) = type;
       TYPE_LENGTH (ftype) = 1;
       TYPE_CODE (ftype) = TYPE_CODE_FUNC;
@@ -1638,25 +1641,25 @@ read_subroutine_type (dip, thisdie, enddie)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_enumeration -- process dies which define an enumeration
+   read_enumeration -- process dies which define an enumeration
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_enumeration (struct dieinfo *dip, char *thisdie,
-               char *enddie, struct objfile *objfile)
+   static void read_enumeration (struct dieinfo *dip, char *thisdie,
+   char *enddie, struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a die which begins an enumeration, process all
-       the dies that define the members of the enumeration.
+   Given a pointer to a die which begins an enumeration, process all
+   the dies that define the members of the enumeration.
 
-NOTES
+   NOTES
 
-       Note that we need to call enum_type regardless of whether or not we
-       have a symbol, since we might have an enum without a tag name (thus
-       no symbol for the tagname).
+   Note that we need to call enum_type regardless of whether or not we
+   have a symbol, since we might have an enum without a tag name (thus
+   no symbol for the tagname).
  */
 
 static void
@@ -1668,7 +1671,7 @@ read_enumeration (dip, thisdie, enddie, objfile)
 {
   struct type *type;
   struct symbol *sym;
-  
+
   type = enum_type (dip, objfile);
   sym = new_symbol (dip, objfile);
   if (sym != NULL)
@@ -1683,33 +1686,33 @@ read_enumeration (dip, thisdie, enddie, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       enum_type -- decode and return a type for an enumeration
+   enum_type -- decode and return a type for an enumeration
 
-SYNOPSIS
+   SYNOPSIS
 
-       static type *enum_type (struct dieinfo *dip, struct objfile *objfile)
+   static type *enum_type (struct dieinfo *dip, struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a die information structure for the die which
-       starts an enumeration, process all the dies that define the members
-       of the enumeration and return a type pointer for the enumeration.
+   Given a pointer to a die information structure for the die which
+   starts an enumeration, process all the dies that define the members
+   of the enumeration and return a type pointer for the enumeration.
 
-       At the same time, for each member of the enumeration, create a
-       symbol for it with namespace VAR_NAMESPACE and class LOC_CONST,
-       and give it the type of the enumeration itself.
+   At the same time, for each member of the enumeration, create a
+   symbol for it with namespace VAR_NAMESPACE and class LOC_CONST,
+   and give it the type of the enumeration itself.
 
-NOTES
+   NOTES
 
-       Note that the DWARF specification explicitly mandates that enum
-       constants occur in reverse order from the source program order,
-       for "consistency" and because this ordering is easier for many
-       compilers to generate. (Draft 6, sec 3.8.5, Enumeration type
-       Entries).  Because gdb wants to see the enum members in program
-       source order, we have to ensure that the order gets reversed while
-       we are processing them.
+   Note that the DWARF specification explicitly mandates that enum
+   constants occur in reverse order from the source program order,
+   for "consistency" and because this ordering is easier for many
+   compilers to generate. (Draft 6, sec 3.8.5, Enumeration type
+   Entries).  Because gdb wants to see the enum members in program
+   source order, we have to ensure that the order gets reversed while
+   we are processing them.
  */
 
 static struct type *
@@ -1718,10 +1721,11 @@ enum_type (dip, objfile)
      struct objfile *objfile;
 {
   struct type *type;
-  struct nextfield {
-    struct nextfield *next;
-    struct field field;
-  };
+  struct nextfield
+    {
+      struct nextfield *next;
+      struct field field;
+    };
   struct nextfield *list = NULL;
   struct nextfield *new;
   int nfields = 0;
@@ -1732,30 +1736,30 @@ enum_type (dip, objfile)
   struct symbol *sym;
   int nbytes;
   int unsigned_enum = 1;
-  
-  if ((type = lookup_utype (dip -> die_ref)) == NULL)
+
+  if ((type = lookup_utype (dip->die_ref)) == NULL)
     {
       /* No forward references created an empty type, so install one now */
-      type = alloc_utype (dip -> die_ref, NULL);
+      type = alloc_utype (dip->die_ref, NULL);
     }
   TYPE_CODE (type) = TYPE_CODE_ENUM;
   /* Some compilers try to be helpful by inventing "fake" names for
      anonymous enums, structures, and unions, like "~0fake" or ".0fake".
      Thanks, but no thanks... */
-  if (dip -> at_name != NULL
-      && *dip -> at_name != '~'
-      && *dip -> at_name != '.')
+  if (dip->at_name != NULL
+      && *dip->at_name != '~'
+      && *dip->at_name != '.')
     {
-      TYPE_TAG_NAME (type) = obconcat (&objfile -> type_obstack,
-                                      "", "", dip -> at_name);
+      TYPE_TAG_NAME (type) = obconcat (&objfile->type_obstack,
+                                      "", "", dip->at_name);
     }
-  if (dip -> at_byte_size != 0)
+  if (dip->at_byte_size != 0)
     {
-      TYPE_LENGTH (type) = dip -> at_byte_size;
+      TYPE_LENGTH (type) = dip->at_byte_size;
     }
-  if ((scan = dip -> at_element_list) != NULL)
+  if ((scan = dip->at_element_list) != NULL)
     {
-      if (dip -> short_element_list)
+      if (dip->short_element_list)
        {
          nbytes = attribute_size (AT_short_element_list);
        }
@@ -1769,7 +1773,7 @@ enum_type (dip, objfile)
       while (scan < listend)
        {
          new = (struct nextfield *) alloca (sizeof (struct nextfield));
-         new -> next = list;
+         new->next = list;
          list = new;
          FIELD_TYPE (list->field) = NULL;
          FIELD_BITSIZE (list->field) = 0;
@@ -1777,15 +1781,15 @@ enum_type (dip, objfile)
            target_to_host (scan, TARGET_FT_LONG_SIZE (objfile), GET_SIGNED,
                            objfile);
          scan += TARGET_FT_LONG_SIZE (objfile);
-         list -> field.name = obsavestring (scan, strlen (scan),
-                                            &objfile -> type_obstack);
+         list->field.name = obsavestring (scan, strlen (scan),
+                                          &objfile->type_obstack);
          scan += strlen (scan) + 1;
          nfields++;
          /* Handcraft a new symbol for this enum member. */
          sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                                 sizeof (struct symbol));
          memset (sym, 0, sizeof (struct symbol));
-         SYMBOL_NAME (sym) = create_name (list -> field.name,
+         SYMBOL_NAME (sym) = create_name (list->field.name,
                                           &objfile->symbol_obstack);
          SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
          SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -1797,10 +1801,10 @@ enum_type (dip, objfile)
          add_symbol_to_list (sym, list_in_scope);
        }
       /* Now create the vector of fields, and record how big it is. This is
-        where we reverse the order, by pulling the members off the list in
-        reverse order from how they were inserted.  If we have no fields
-        (this is apparently possible in C++) then skip building a field
-        vector. */
+         where we reverse the order, by pulling the members off the list in
+         reverse order from how they were inserted.  If we have no fields
+         (this is apparently possible in C++) then skip building a field
+         vector. */
       if (nfields > 0)
        {
          if (unsigned_enum)
@@ -1809,10 +1813,10 @@ enum_type (dip, objfile)
          TYPE_FIELDS (type) = (struct field *)
            obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * nfields);
          /* Copy the saved-up fields into the field vector.  */
-         for (n = 0; (n < nfields) && (list != NULL); list = list -> next)
+         for (n = 0; (n < nfields) && (list != NULL); list = list->next)
            {
-             TYPE_FIELD (type, n++) = list -> field;
-           }   
+             TYPE_FIELD (type, n++) = list->field;
+           }
        }
     }
   return (type);
@@ -1820,23 +1824,23 @@ enum_type (dip, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_func_scope -- process all dies within a function scope
+   read_func_scope -- process all dies within a function scope
 
-DESCRIPTION
+   DESCRIPTION
 
-       Process all dies within a given function scope.  We are passed
-       a die information structure pointer DIP for the die which
-       starts the function scope, and pointers into the raw die data
-       that define the dies within the function scope.
-
-       For now, we ignore lexical block scopes within the function.
-       The problem is that AT&T cc does not define a DWARF lexical
-       block scope for the function itself, while gcc defines a
-       lexical block scope for the function.  We need to think about
-       how to handle this difference, or if it is even a problem.
-       (FIXME)
+   Process all dies within a given function scope.  We are passed
+   a die information structure pointer DIP for the die which
+   starts the function scope, and pointers into the raw die data
+   that define the dies within the function scope.
+
+   For now, we ignore lexical block scopes within the function.
+   The problem is that AT&T cc does not define a DWARF lexical
+   block scope for the function itself, while gcc defines a
+   lexical block scope for the function.  We need to think about
+   how to handle this difference, or if it is even a problem.
+   (FIXME)
  */
 
 static void
@@ -1847,50 +1851,50 @@ read_func_scope (dip, thisdie, enddie, objfile)
      struct objfile *objfile;
 {
   register struct context_stack *new;
-  
+
   /* AT_name is absent if the function is described with an
      AT_abstract_origin tag.
      Ignore the function description for now to avoid GDB core dumps.
      FIXME: Add code to handle AT_abstract_origin tags properly.  */
-  if (dip -> at_name == NULL)
+  if (dip->at_name == NULL)
     {
       complain (&missing_at_name, DIE_ID);
       return;
     }
 
-  if (objfile -> ei.entry_point >= dip -> at_low_pc &&
-      objfile -> ei.entry_point <  dip -> at_high_pc)
+  if (objfile->ei.entry_point >= dip->at_low_pc &&
+      objfile->ei.entry_point < dip->at_high_pc)
     {
-      objfile -> ei.entry_func_lowpc = dip -> at_low_pc;
-      objfile -> ei.entry_func_highpc = dip -> at_high_pc;
+      objfile->ei.entry_func_lowpc = dip->at_low_pc;
+      objfile->ei.entry_func_highpc = dip->at_high_pc;
     }
-  if (STREQ (dip -> at_name, "main"))  /* FIXME: hardwired name */
+  if (STREQ (dip->at_name, "main"))    /* FIXME: hardwired name */
     {
-      objfile -> ei.main_func_lowpc = dip -> at_low_pc;
-      objfile -> ei.main_func_highpc = dip -> at_high_pc;
+      objfile->ei.main_func_lowpc = dip->at_low_pc;
+      objfile->ei.main_func_highpc = dip->at_high_pc;
     }
-  new = push_context (0, dip -> at_low_pc);
-  new -> name = new_symbol (dip, objfile);
+  new = push_context (0, dip->at_low_pc);
+  new->name = new_symbol (dip, objfile);
   list_in_scope = &local_symbols;
-  process_dies (thisdie + dip -> die_length, enddie, objfile);
+  process_dies (thisdie + dip->die_length, enddie, objfile);
   new = pop_context ();
   /* Make a block for the local symbols within.  */
-  finish_block (new -> name, &local_symbols, new -> old_blocks,
-               new -> start_addr, dip -> at_high_pc, objfile);
+  finish_block (new->name, &local_symbols, new->old_blocks,
+               new->start_addr, dip->at_high_pc, objfile);
   list_in_scope = &file_symbols;
 }
 
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       handle_producer -- process the AT_producer attribute
+   handle_producer -- process the AT_producer attribute
 
-DESCRIPTION
+   DESCRIPTION
 
-       Perform any operations that depend on finding a particular
-       AT_producer attribute.
+   Perform any operations that depend on finding a particular
+   AT_producer attribute.
 
  */
 
@@ -1935,24 +1939,24 @@ handle_producer (producer)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_file_scope -- process all dies within a file scope
+   read_file_scope -- process all dies within a file scope
 
-DESCRIPTION
+   DESCRIPTION
+
+   Process all dies within a given file scope.  We are passed a
+   pointer to the die information structure for the die which
+   starts the file scope, and pointers into the raw die data which
+   mark the range of dies within the file scope.
 
-       Process all dies within a given file scope.  We are passed a
-       pointer to the die information structure for the die which
-       starts the file scope, and pointers into the raw die data which
-       mark the range of dies within the file scope.
-
-       When the partial symbol table is built, the file offset for the line
-       number table for each compilation unit is saved in the partial symbol
-       table entry for that compilation unit.  As the symbols for each
-       compilation unit are read, the line number table is read into memory
-       and the variable lnbase is set to point to it.  Thus all we have to
-       do is use lnbase to access the line number table for the current
-       compilation unit.
+   When the partial symbol table is built, the file offset for the line
+   number table for each compilation unit is saved in the partial symbol
+   table entry for that compilation unit.  As the symbols for each
+   compilation unit are read, the line number table is read into memory
+   and the variable lnbase is set to point to it.  Thus all we have to
+   do is use lnbase to access the line number table for the current
+   compilation unit.
  */
 
 static void
@@ -1964,51 +1968,51 @@ read_file_scope (dip, thisdie, enddie, objfile)
 {
   struct cleanup *back_to;
   struct symtab *symtab;
-  
-  if (objfile -> ei.entry_point >= dip -> at_low_pc &&
-      objfile -> ei.entry_point <  dip -> at_high_pc)
+
+  if (objfile->ei.entry_point >= dip->at_low_pc &&
+      objfile->ei.entry_point < dip->at_high_pc)
     {
-      objfile -> ei.entry_file_lowpc = dip -> at_low_pc;
-      objfile -> ei.entry_file_highpc = dip -> at_high_pc;
+      objfile->ei.entry_file_lowpc = dip->at_low_pc;
+      objfile->ei.entry_file_highpc = dip->at_high_pc;
     }
   set_cu_language (dip);
-  if (dip -> at_producer != NULL)
+  if (dip->at_producer != NULL)
     {
-      handle_producer (dip -> at_producer);
+      handle_producer (dip->at_producer);
     }
   numutypes = (enddie - thisdie) / 4;
   utypes = (struct type **) xmalloc (numutypes * sizeof (struct type *));
   back_to = make_cleanup (free_utypes, NULL);
   memset (utypes, 0, numutypes * sizeof (struct type *));
   memset (ftypes, 0, FT_NUM_MEMBERS * sizeof (struct type *));
-  start_symtab (dip -> at_name, dip -> at_comp_dir, dip -> at_low_pc);
+  start_symtab (dip->at_name, dip->at_comp_dir, dip->at_low_pc);
   record_debugformat ("DWARF 1");
   decode_line_numbers (lnbase);
-  process_dies (thisdie + dip -> die_length, enddie, objfile);
+  process_dies (thisdie + dip->die_length, enddie, objfile);
 
-  symtab = end_symtab (dip -> at_high_pc, objfile, 0);
+  symtab = end_symtab (dip->at_high_pc, objfile, 0);
   if (symtab != NULL)
     {
-      symtab -> language = cu_language;
-    }      
+      symtab->language = cu_language;
+    }
   do_cleanups (back_to);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       process_dies -- process a range of DWARF Information Entries
+   process_dies -- process a range of DWARF Information Entries
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void process_dies (char *thisdie, char *enddie,
-                                 struct objfile *objfile)
+   static void process_dies (char *thisdie, char *enddie,
+   struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Process all DIE's in a specified range.  May be (and almost
-       certainly will be) called recursively.
+   Process all DIE's in a specified range.  May be (and almost
+   certainly will be) called recursively.
  */
 
 static void
@@ -2019,7 +2023,7 @@ process_dies (thisdie, enddie, objfile)
 {
   char *nextdie;
   struct dieinfo di;
-  
+
   while (thisdie < enddie)
     {
       basicdieinfo (&di, thisdie, objfile);
@@ -2051,8 +2055,8 @@ process_dies (thisdie, enddie, objfile)
            {
            case TAG_compile_unit:
              /* Skip Tag_compile_unit if we are already inside a compilation
-                unit, we are unable to handle nested compilation units
-                properly (FIXME).  */
+                unit, we are unable to handle nested compilation units
+                properly (FIXME).  */
              if (current_subfile == NULL)
                read_file_scope (&di, thisdie, nextdie, objfile);
              else
@@ -2099,62 +2103,62 @@ process_dies (thisdie, enddie, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_line_numbers -- decode a line number table fragment
+   decode_line_numbers -- decode a line number table fragment
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void decode_line_numbers (char *tblscan, char *tblend,
-               long length, long base, long line, long pc)
+   static void decode_line_numbers (char *tblscan, char *tblend,
+   long length, long base, long line, long pc)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Translate the DWARF line number information to gdb form.
+   Translate the DWARF line number information to gdb form.
 
-       The ".line" section contains one or more line number tables, one for
-       each ".line" section from the objects that were linked.
+   The ".line" section contains one or more line number tables, one for
+   each ".line" section from the objects that were linked.
 
-       The AT_stmt_list attribute for each TAG_source_file entry in the
-       ".debug" section contains the offset into the ".line" section for the
-       start of the table for that file.
+   The AT_stmt_list attribute for each TAG_source_file entry in the
+   ".debug" section contains the offset into the ".line" section for the
+   start of the table for that file.
 
-       The table itself has the following structure:
+   The table itself has the following structure:
 
-       <table length><base address><source statement entry>
-       4 bytes       4 bytes       10 bytes
+   <table length><base address><source statement entry>
+   4 bytes       4 bytes       10 bytes
 
-       The table length is the total size of the table, including the 4 bytes
-       for the length information.
+   The table length is the total size of the table, including the 4 bytes
+   for the length information.
 
-       The base address is the address of the first instruction generated
-       for the source file.
+   The base address is the address of the first instruction generated
+   for the source file.
 
-       Each source statement entry has the following structure:
+   Each source statement entry has the following structure:
 
-       <line number><statement position><address delta>
-       4 bytes      2 bytes             4 bytes
+   <line number><statement position><address delta>
+   4 bytes      2 bytes             4 bytes
 
-       The line number is relative to the start of the file, starting with
-       line 1.
+   The line number is relative to the start of the file, starting with
+   line 1.
 
-       The statement position either -1 (0xFFFF) or the number of characters
-       from the beginning of the line to the beginning of the statement.
+   The statement position either -1 (0xFFFF) or the number of characters
+   from the beginning of the line to the beginning of the statement.
 
-       The address delta is the difference between the base address and
-       the address of the first instruction for the statement.
+   The address delta is the difference between the base address and
+   the address of the first instruction for the statement.
 
-       Note that we must copy the bytes from the packed table to our local
-       variables before attempting to use them, to avoid alignment problems
-       on some machines, particularly RISC processors.
+   Note that we must copy the bytes from the packed table to our local
+   variables before attempting to use them, to avoid alignment problems
+   on some machines, particularly RISC processors.
 
-BUGS
+   BUGS
 
-       Does gdb expect the line numbers to be sorted?  They are now by
-       chance/luck, but are not required to be.  (FIXME)
+   Does gdb expect the line numbers to be sorted?  They are now by
+   chance/luck, but are not required to be.  (FIXME)
 
-       The line with number 0 is unused, gdb apparently can discover the
-       span of the last line some other way. How?  (FIXME)
+   The line with number 0 is unused, gdb apparently can discover the
+   span of the last line some other way. How?  (FIXME)
  */
 
 static void
@@ -2167,7 +2171,7 @@ decode_line_numbers (linetable)
   unsigned long base;
   unsigned long line;
   unsigned long pc;
-  
+
   if (linetable != NULL)
     {
       tblscan = tblend = linetable;
@@ -2198,37 +2202,37 @@ decode_line_numbers (linetable)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       locval -- compute the value of a location attribute
+   locval -- compute the value of a location attribute
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int locval (struct dieinfo *dip)
+   static int locval (struct dieinfo *dip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given pointer to a string of bytes that define a location, compute
-       the location and return the value.
-       A location description containing no atoms indicates that the
-       object is optimized out. The optimized_out flag is set for those,
-       the return value is meaningless.
-
-       When computing values involving the current value of the frame pointer,
-       the value zero is used, which results in a value relative to the frame
-       pointer, rather than the absolute value.  This is what GDB wants
-       anyway.
-    
-       When the result is a register number, the isreg flag is set, otherwise
-       it is cleared.  This is a kludge until we figure out a better
-       way to handle the problem.  Gdb's design does not mesh well with the
-       DWARF notion of a location computing interpreter, which is a shame
-       because the flexibility goes unused.
+   Given pointer to a string of bytes that define a location, compute
+   the location and return the value.
+   A location description containing no atoms indicates that the
+   object is optimized out. The optimized_out flag is set for those,
+   the return value is meaningless.
 
-NOTES
+   When computing values involving the current value of the frame pointer,
+   the value zero is used, which results in a value relative to the frame
+   pointer, rather than the absolute value.  This is what GDB wants
+   anyway.
 
-       Note that stack[0] is unused except as a default error return.
-       Note that stack overflow is not yet handled.
+   When the result is a register number, the isreg flag is set, otherwise
+   it is cleared.  This is a kludge until we figure out a better
+   way to handle the problem.  Gdb's design does not mesh well with the
+   DWARF notion of a location computing interpreter, which is a shame
+   because the flexibility goes unused.
+
+   NOTES
+
+   Note that stack[0] is unused except as a default error return.
+   Note that stack overflow is not yet handled.
  */
 
 static int
@@ -2243,72 +2247,72 @@ locval (dip)
   char *end;
   int loc_atom_code;
   int loc_value_size;
-  
-  loc = dip -> at_location;
+
+  loc = dip->at_location;
   nbytes = attribute_size (AT_location);
   locsize = target_to_host (loc, nbytes, GET_UNSIGNED, current_objfile);
   loc += nbytes;
   end = loc + locsize;
   stacki = 0;
   stack[stacki] = 0;
-  dip -> isreg = 0;
-  dip -> offreg = 0;
-  dip -> optimized_out = 1;
+  dip->isreg = 0;
+  dip->offreg = 0;
+  dip->optimized_out = 1;
   loc_value_size = TARGET_FT_LONG_SIZE (current_objfile);
   while (loc < end)
     {
-      dip -> optimized_out = 0;
+      dip->optimized_out = 0;
       loc_atom_code = target_to_host (loc, SIZEOF_LOC_ATOM_CODE, GET_UNSIGNED,
                                      current_objfile);
       loc += SIZEOF_LOC_ATOM_CODE;
       switch (loc_atom_code)
        {
-         case 0:
-           /* error */
-           loc = end;
-           break;
-         case OP_REG:
-           /* push register (number) */
-           stack[++stacki]
-             = DWARF_REG_TO_REGNUM (target_to_host (loc, loc_value_size,
-                                                    GET_UNSIGNED,
-                                                    current_objfile));
-           loc += loc_value_size;
-           dip -> isreg = 1;
-           break;
-         case OP_BASEREG:
-           /* push value of register (number) */
-           /* Actually, we compute the value as if register has 0, so the
-              value ends up being the offset from that register.  */
-           dip -> offreg = 1;
-           dip -> basereg = target_to_host (loc, loc_value_size, GET_UNSIGNED,
-                                            current_objfile);
-           loc += loc_value_size;
-           stack[++stacki] = 0;
-           break;
-         case OP_ADDR:
-           /* push address (relocated address) */
-           stack[++stacki] = target_to_host (loc, loc_value_size,
-                                             GET_UNSIGNED, current_objfile);
-           loc += loc_value_size;
-           break;
-         case OP_CONST:
-           /* push constant (number)   FIXME: signed or unsigned! */
-           stack[++stacki] = target_to_host (loc, loc_value_size,
-                                             GET_SIGNED, current_objfile);
-           loc += loc_value_size;
-           break;
-         case OP_DEREF2:
-           /* pop, deref and push 2 bytes (as a long) */
-           complain (&op_deref2, DIE_ID, DIE_NAME, stack[stacki]);
-           break;
-         case OP_DEREF4:       /* pop, deref and push 4 bytes (as a long) */
-           complain (&op_deref4, DIE_ID, DIE_NAME, stack[stacki]);
-           break;
-         case OP_ADD:  /* pop top 2 items, add, push result */
-           stack[stacki - 1] += stack[stacki];
-           stacki--;
-           break;
+       case 0:
+         /* error */
+         loc = end;
+         break;
+       case OP_REG:
+         /* push register (number) */
+         stack[++stacki]
+           = DWARF_REG_TO_REGNUM (target_to_host (loc, loc_value_size,
+                                                  GET_UNSIGNED,
+                                                  current_objfile));
+         loc += loc_value_size;
+         dip->isreg = 1;
+         break;
+       case OP_BASEREG:
+         /* push value of register (number) */
+         /* Actually, we compute the value as if register has 0, so the
+            value ends up being the offset from that register.  */
+         dip->offreg = 1;
+         dip->basereg = target_to_host (loc, loc_value_size, GET_UNSIGNED,
+                                        current_objfile);
+         loc += loc_value_size;
+         stack[++stacki] = 0;
+         break;
+       case OP_ADDR:
+         /* push address (relocated address) */
+         stack[++stacki] = target_to_host (loc, loc_value_size,
+                                           GET_UNSIGNED, current_objfile);
+         loc += loc_value_size;
+         break;
+       case OP_CONST:
+         /* push constant (number)   FIXME: signed or unsigned! */
+         stack[++stacki] = target_to_host (loc, loc_value_size,
+                                           GET_SIGNED, current_objfile);
+         loc += loc_value_size;
+         break;
+       case OP_DEREF2:
+         /* pop, deref and push 2 bytes (as a long) */
+         complain (&op_deref2, DIE_ID, DIE_NAME, stack[stacki]);
+         break;
+       case OP_DEREF4: /* pop, deref and push 4 bytes (as a long) */
+         complain (&op_deref4, DIE_ID, DIE_NAME, stack[stacki]);
+         break;
+       case OP_ADD:            /* pop top 2 items, add, push result */
+         stack[stacki - 1] += stack[stacki];
+         stacki--;
+         break;
        }
     }
   return (stack[stacki]);
@@ -2316,21 +2320,21 @@ locval (dip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       read_ofile_symtab -- build a full symtab entry from chunk of DIE's
+   read_ofile_symtab -- build a full symtab entry from chunk of DIE's
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void read_ofile_symtab (struct partial_symtab *pst)
+   static void read_ofile_symtab (struct partial_symtab *pst)
 
-DESCRIPTION
+   DESCRIPTION
 
-       When expanding a partial symbol table entry to a full symbol table
-       entry, this is the function that gets called to read in the symbols
-       for the compilation unit.  A pointer to the newly constructed symtab,
-       which is now the new first one on the objfile's symtab list, is
-       stashed in the partial symbol table entry.
+   When expanding a partial symbol table entry to a full symbol table
+   entry, this is the function that gets called to read in the symbols
+   for the compilation unit.  A pointer to the newly constructed symtab,
+   which is now the new first one on the objfile's symtab list, is
+   stashed in the partial symbol table entry.
  */
 
 static void
@@ -2343,8 +2347,8 @@ read_ofile_symtab (pst)
   bfd *abfd;
   char lnsizedata[SIZEOF_LINETBL_LENGTH];
 
-  abfd = pst -> objfile -> obfd;
-  current_objfile = pst -> objfile;
+  abfd = pst->objfile->obfd;
+  current_objfile = pst->objfile;
 
   /* Allocate a buffer for the entire chunk of DIE's for this compilation
      unit, seek to the location in the file, and read in all the DIE's. */
@@ -2352,8 +2356,8 @@ read_ofile_symtab (pst)
   diecount = 0;
   dbsize = DBLENGTH (pst);
   dbbase = xmalloc (dbsize);
-  dbroff = DBROFF(pst);
-  foffset = DBFOFF(pst) + dbroff;
+  dbroff = DBROFF (pst);
+  foffset = DBFOFF (pst) + dbroff;
   base_section_offsets = pst->section_offsets;
   baseaddr = ANOFFSET (pst->section_offsets, 0);
   if (bfd_seek (abfd, foffset, SEEK_SET) ||
@@ -2379,7 +2383,7 @@ read_ofile_symtab (pst)
          error ("can't read DWARF line number table size");
        }
       lnsize = target_to_host (lnsizedata, SIZEOF_LINETBL_LENGTH,
-                              GET_UNSIGNED, pst -> objfile);
+                              GET_UNSIGNED, pst->objfile);
       lnbase = xmalloc (lnsize);
       if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
          (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
@@ -2390,28 +2394,28 @@ read_ofile_symtab (pst)
       make_cleanup (free, lnbase);
     }
 
-  process_dies (dbbase, dbbase + dbsize, pst -> objfile);
+  process_dies (dbbase, dbbase + dbsize, pst->objfile);
   do_cleanups (back_to);
   current_objfile = NULL;
-  pst -> symtab = pst -> objfile -> symtabs;
+  pst->symtab = pst->objfile->symtabs;
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       psymtab_to_symtab_1 -- do grunt work for building a full symtab entry
+   psymtab_to_symtab_1 -- do grunt work for building a full symtab entry
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void psymtab_to_symtab_1 (struct partial_symtab *pst)
+   static void psymtab_to_symtab_1 (struct partial_symtab *pst)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Called once for each partial symbol table entry that needs to be
-       expanded into a full symbol table entry.
+   Called once for each partial symbol table entry that needs to be
+   expanded into a full symbol table entry.
 
-*/
+ */
 
 static void
 psymtab_to_symtab_1 (pst)
@@ -2419,20 +2423,20 @@ psymtab_to_symtab_1 (pst)
 {
   int i;
   struct cleanup *old_chain;
-  
+
   if (pst != NULL)
     {
       if (pst->readin)
        {
          warning ("psymtab for %s already read in.  Shouldn't happen.",
-                  pst -> filename);
+                  pst->filename);
        }
       else
        {
          /* Read in all partial symtabs on which this one is dependent */
-         for (i = 0; i < pst -> number_of_dependencies; i++)
+         for (i = 0; i < pst->number_of_dependencies; i++)
            {
-             if (!pst -> dependencies[i] -> readin)
+             if (!pst->dependencies[i]->readin)
                {
                  /* Inform about additional files that need to be read in. */
                  if (info_verbose)
@@ -2442,18 +2446,18 @@ psymtab_to_symtab_1 (pst)
                      fputs_filtered ("and ", gdb_stdout);
                      wrap_here ("");
                      printf_filtered ("%s...",
-                                      pst -> dependencies[i] -> filename);
+                                      pst->dependencies[i]->filename);
                      wrap_here ("");
-                     gdb_flush (gdb_stdout);           /* Flush output */
+                     gdb_flush (gdb_stdout);   /* Flush output */
                    }
-                 psymtab_to_symtab_1 (pst -> dependencies[i]);
+                 psymtab_to_symtab_1 (pst->dependencies[i]);
                }
-           }     
-         if (DBLENGTH (pst))           /* Otherwise it's a dummy */
+           }
+         if (DBLENGTH (pst))   /* Otherwise it's a dummy */
            {
              buildsym_init ();
-             old_chain = make_cleanup ((make_cleanup_func) 
-                                        really_free_pendings, 0);
+             old_chain = make_cleanup ((make_cleanup_func)
+                                       really_free_pendings, 0);
              read_ofile_symtab (pst);
              if (info_verbose)
                {
@@ -2461,31 +2465,31 @@ psymtab_to_symtab_1 (pst)
                  wrap_here ("");
                  gdb_flush (gdb_stdout);
                }
-             sort_symtab_syms (pst -> symtab);
+             sort_symtab_syms (pst->symtab);
              do_cleanups (old_chain);
            }
-         pst -> readin = 1;
+         pst->readin = 1;
        }
     }
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       dwarf_psymtab_to_symtab -- build a full symtab entry from partial one
+   dwarf_psymtab_to_symtab -- build a full symtab entry from partial one
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void dwarf_psymtab_to_symtab (struct partial_symtab *pst)
+   static void dwarf_psymtab_to_symtab (struct partial_symtab *pst)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This is the DWARF support entry point for building a full symbol
-       table entry from a partial symbol table entry.  We are passed a
-       pointer to the partial symbol table entry that needs to be expanded.
+   This is the DWARF support entry point for building a full symbol
+   table entry from a partial symbol table entry.  We are passed a
+   pointer to the partial symbol table entry that needs to be expanded.
 
-*/
+ */
 
 static void
 dwarf_psymtab_to_symtab (pst)
@@ -2494,35 +2498,35 @@ dwarf_psymtab_to_symtab (pst)
 
   if (pst != NULL)
     {
-      if (pst -> readin)
+      if (pst->readin)
        {
          warning ("psymtab for %s already read in.  Shouldn't happen.",
-                  pst -> filename);
+                  pst->filename);
        }
       else
        {
-         if (DBLENGTH (pst) || pst -> number_of_dependencies)
+         if (DBLENGTH (pst) || pst->number_of_dependencies)
            {
              /* Print the message now, before starting serious work, to avoid
-                disconcerting pauses.  */
+                disconcerting pauses.  */
              if (info_verbose)
                {
                  printf_filtered ("Reading in symbols for %s...",
-                                  pst -> filename);
+                                  pst->filename);
                  gdb_flush (gdb_stdout);
                }
-             
+
              psymtab_to_symtab_1 (pst);
-             
-#if 0        /* FIXME:  Check to see what dbxread is doing here and see if
-                we need to do an equivalent or is this something peculiar to
-                stabs/a.out format.
-                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);
+
+#if 0                          /* FIXME:  Check to see what dbxread is doing here and see if
+                                  we need to do an equivalent or is this something peculiar to
+                                  stabs/a.out format.
+                                  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);
 #endif
-             
+
              /* Finish up the verbose info message.  */
              if (info_verbose)
                {
@@ -2536,16 +2540,16 @@ dwarf_psymtab_to_symtab (pst)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       add_enum_psymbol -- add enumeration members to partial symbol table
+   add_enum_psymbol -- add enumeration members to partial symbol table
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given pointer to a DIE that is known to be for an enumeration,
-       extract the symbolic names of the enumeration members and add
-       partial symbols for them.
-*/
+   Given pointer to a DIE that is known to be for an enumeration,
+   extract the symbolic names of the enumeration members and add
+   partial symbols for them.
+ */
 
 static void
 add_enum_psymbol (dip, objfile)
@@ -2556,10 +2560,10 @@ add_enum_psymbol (dip, objfile)
   char *listend;
   unsigned short blocksz;
   int nbytes;
-  
-  if ((scan = dip -> at_element_list) != NULL)
+
+  if ((scan = dip->at_element_list) != NULL)
     {
-      if (dip -> short_element_list)
+      if (dip->short_element_list)
        {
          nbytes = attribute_size (AT_short_element_list);
        }
@@ -2574,7 +2578,7 @@ add_enum_psymbol (dip, objfile)
        {
          scan += TARGET_FT_LONG_SIZE (objfile);
          add_psymbol_to_list (scan, strlen (scan), VAR_NAMESPACE, LOC_CONST,
-                              &objfile -> static_psymbols, 0, 0, cu_language,
+                              &objfile->static_psymbols, 0, 0, cu_language,
                               objfile);
          scan += strlen (scan) + 1;
        }
@@ -2583,56 +2587,56 @@ add_enum_psymbol (dip, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       add_partial_symbol -- add symbol to partial symbol table
+   add_partial_symbol -- add symbol to partial symbol table
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a DIE, if it is one of the types that we want to
-       add to a partial symbol table, finish filling in the die info
-       and then add a partial symbol table entry for it.
+   Given a DIE, if it is one of the types that we want to
+   add to a partial symbol table, finish filling in the die info
+   and then add a partial symbol table entry for it.
 
-NOTES
+   NOTES
 
-       The caller must ensure that the DIE has a valid name attribute.
-*/
+   The caller must ensure that the DIE has a valid name attribute.
+ */
 
 static void
 add_partial_symbol (dip, objfile)
      struct dieinfo *dip;
      struct objfile *objfile;
 {
-  switch (dip -> die_tag)
+  switch (dip->die_tag)
     {
     case TAG_global_subroutine:
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
-                               VAR_NAMESPACE, LOC_BLOCK,
-                               &objfile -> global_psymbols,
-                               0, dip -> at_low_pc, cu_language, objfile);
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
+                          VAR_NAMESPACE, LOC_BLOCK,
+                          &objfile->global_psymbols,
+                          0, dip->at_low_pc, cu_language, objfile);
       break;
     case TAG_global_variable:
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
                           VAR_NAMESPACE, LOC_STATIC,
-                          &objfile -> global_psymbols,
+                          &objfile->global_psymbols,
                           0, 0, cu_language, objfile);
       break;
     case TAG_subroutine:
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
-                               VAR_NAMESPACE, LOC_BLOCK,
-                               &objfile -> static_psymbols,
-                               0, dip -> at_low_pc, cu_language, objfile);
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
+                          VAR_NAMESPACE, LOC_BLOCK,
+                          &objfile->static_psymbols,
+                          0, dip->at_low_pc, cu_language, objfile);
       break;
     case TAG_local_variable:
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
                           VAR_NAMESPACE, LOC_STATIC,
-                          &objfile -> static_psymbols,
+                          &objfile->static_psymbols,
                           0, 0, cu_language, objfile);
       break;
     case TAG_typedef:
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
                           VAR_NAMESPACE, LOC_TYPEDEF,
-                          &objfile -> static_psymbols,
+                          &objfile->static_psymbols,
                           0, 0, cu_language, objfile);
       break;
     case TAG_class_type:
@@ -2640,24 +2644,23 @@ add_partial_symbol (dip, objfile)
     case TAG_union_type:
     case TAG_enumeration_type:
       /* Do not add opaque aggregate definitions to the psymtab.  */
-      if (!dip -> has_at_byte_size)
+      if (!dip->has_at_byte_size)
        break;
-      add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
+      add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
                           STRUCT_NAMESPACE, LOC_TYPEDEF,
-                          &objfile -> static_psymbols,
+                          &objfile->static_psymbols,
                           0, 0, cu_language, objfile);
       if (cu_language == language_cplus)
        {
          /* For C++, these implicitly act as typedefs as well. */
-         add_psymbol_to_list (dip -> at_name, strlen (dip -> at_name),
+         add_psymbol_to_list (dip->at_name, strlen (dip->at_name),
                               VAR_NAMESPACE, LOC_TYPEDEF,
-                              &objfile -> static_psymbols,
+                              &objfile->static_psymbols,
                               0, 0, cu_language, objfile);
        }
       break;
     }
 }
-
 /* *INDENT-OFF* */
 /*
 
@@ -2724,6 +2727,8 @@ NOTES
  */
 /* *INDENT-ON* */
 
+
+
 static void
 scan_partial_symbols (thisdie, enddie, objfile)
      char *thisdie;
@@ -2733,7 +2738,7 @@ scan_partial_symbols (thisdie, enddie, objfile)
   char *nextdie;
   char *temp;
   struct dieinfo di;
-  
+
   while (thisdie < enddie)
     {
       basicdieinfo (&di, thisdie, objfile);
@@ -2807,44 +2812,44 @@ scan_partial_symbols (thisdie, enddie, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       scan_compilation_units -- build a psymtab entry for each compilation
+   scan_compilation_units -- build a psymtab entry for each compilation
 
-DESCRIPTION
+   DESCRIPTION
 
-       This is the top level dwarf parsing routine for building partial
-       symbol tables.
-
-       It scans from the beginning of the DWARF table looking for the first
-       TAG_compile_unit DIE, and then follows the sibling chain to locate
-       each additional TAG_compile_unit DIE.
-   
-       For each TAG_compile_unit DIE it creates a partial symtab structure,
-       calls a subordinate routine to collect all the compilation unit's
-       global DIE's, file scope DIEs, typedef DIEs, etc, and then links the
-       new partial symtab structure into the partial symbol table.  It also
-       records the appropriate information in the partial symbol table entry
-       to allow the chunk of DIE's and line number table for this compilation
-       unit to be located and re-read later, to generate a complete symbol
-       table entry for the compilation unit.
-
-       Thus it effectively partitions up a chunk of DIE's for multiple
-       compilation units into smaller DIE chunks and line number tables,
-       and associates them with a partial symbol table entry.
+   This is the top level dwarf parsing routine for building partial
+   symbol tables.
 
-NOTES
+   It scans from the beginning of the DWARF table looking for the first
+   TAG_compile_unit DIE, and then follows the sibling chain to locate
+   each additional TAG_compile_unit DIE.
+
+   For each TAG_compile_unit DIE it creates a partial symtab structure,
+   calls a subordinate routine to collect all the compilation unit's
+   global DIE's, file scope DIEs, typedef DIEs, etc, and then links the
+   new partial symtab structure into the partial symbol table.  It also
+   records the appropriate information in the partial symbol table entry
+   to allow the chunk of DIE's and line number table for this compilation
+   unit to be located and re-read later, to generate a complete symbol
+   table entry for the compilation unit.
+
+   Thus it effectively partitions up a chunk of DIE's for multiple
+   compilation units into smaller DIE chunks and line number tables,
+   and associates them with a partial symbol table entry.
+
+   NOTES
 
-       If any compilation unit has no line number table associated with
-       it for some reason (a missing at_stmt_list attribute, rather than
-       just one with a value of zero, which is valid) then we ensure that
-       the recorded file offset is zero so that the routine which later
-       reads line number table fragments knows that there is no fragment
-       to read.
+   If any compilation unit has no line number table associated with
+   it for some reason (a missing at_stmt_list attribute, rather than
+   just one with a value of zero, which is valid) then we ensure that
+   the recorded file offset is zero so that the routine which later
+   reads line number table fragments knows that there is no fragment
+   to read.
 
-RETURNS
+   RETURNS
 
-       Returns no value.
+   Returns no value.
 
  */
 
@@ -2894,53 +2899,53 @@ scan_compilation_units (thisdie, enddie, dbfoff, lnoffset, objfile)
 
          pst = start_psymtab_common (objfile, base_section_offsets,
                                      di.at_name, di.at_low_pc,
-                                     objfile -> global_psymbols.next,
-                                     objfile -> static_psymbols.next);
+                                     objfile->global_psymbols.next,
+                                     objfile->static_psymbols.next);
 
-         pst -> texthigh = di.at_high_pc;
-         pst -> read_symtab_private = (char *)
-             obstack_alloc (&objfile -> psymbol_obstack,
-                            sizeof (struct dwfinfo));
+         pst->texthigh = di.at_high_pc;
+         pst->read_symtab_private = (char *)
+           obstack_alloc (&objfile->psymbol_obstack,
+                          sizeof (struct dwfinfo));
          DBFOFF (pst) = dbfoff;
          DBROFF (pst) = curoff;
          DBLENGTH (pst) = culength;
-         LNFOFF (pst)  = curlnoffset;
-         pst -> read_symtab = dwarf_psymtab_to_symtab;
+         LNFOFF (pst) = curlnoffset;
+         pst->read_symtab = dwarf_psymtab_to_symtab;
 
          /* Now look for partial symbols */
 
          scan_partial_symbols (thisdie + di.die_length, nextdie, objfile);
 
-         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->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);
          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);
+         free_named_symtabs (pst->filename);
        }
-      thisdie = nextdie;      
+      thisdie = nextdie;
     }
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       new_symbol -- make a symbol table entry for a new symbol
+   new_symbol -- make a symbol table entry for a new symbol
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct symbol *new_symbol (struct dieinfo *dip,
-                                         struct objfile *objfile)
+   static struct symbol *new_symbol (struct dieinfo *dip,
+   struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a DWARF information entry, figure out if we need
-       to make a symbol table entry for it, and if so, create a new entry
-       and return a pointer to it.
+   Given a pointer to a DWARF information entry, figure out if we need
+   to make a symbol table entry for it, and if so, create a new entry
+   and return a pointer to it.
  */
 
 static struct symbol *
@@ -2949,14 +2954,14 @@ new_symbol (dip, objfile)
      struct objfile *objfile;
 {
   struct symbol *sym = NULL;
-  
-  if (dip -> at_name != NULL)
+
+  if (dip->at_name != NULL)
     {
-      sym = (struct symbol *) obstack_alloc (&objfile -> symbol_obstack,
+      sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       OBJSTAT (objfile, n_syms++);
       memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = create_name (dip -> at_name,
+      SYMBOL_NAME (sym) = create_name (dip->at_name,
                                       &objfile->symbol_obstack);
       /* default assumptions */
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -2964,26 +2969,26 @@ new_symbol (dip, objfile)
       SYMBOL_TYPE (sym) = decode_die_type (dip);
 
       /* If this symbol is from a C++ compilation, then attempt to cache the
-        demangled form for future reference.  This is a typical time versus
-        space tradeoff, that was decided in favor of time because it sped up
-        C++ symbol lookups by a factor of about 20. */
+         demangled form for future reference.  This is a typical time versus
+         space tradeoff, that was decided in favor of time because it sped up
+         C++ symbol lookups by a factor of about 20. */
 
       SYMBOL_LANGUAGE (sym) = cu_language;
-      SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile -> symbol_obstack);
-      switch (dip -> die_tag)
+      SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
+      switch (dip->die_tag)
        {
        case TAG_label:
-         SYMBOL_VALUE_ADDRESS (sym) = dip -> at_low_pc;
+         SYMBOL_VALUE_ADDRESS (sym) = dip->at_low_pc;
          SYMBOL_CLASS (sym) = LOC_LABEL;
          break;
        case TAG_global_subroutine:
        case TAG_subroutine:
-         SYMBOL_VALUE_ADDRESS (sym) = dip -> at_low_pc;
+         SYMBOL_VALUE_ADDRESS (sym) = dip->at_low_pc;
          SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
-         if (dip -> at_prototyped)
+         if (dip->at_prototyped)
            TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
          SYMBOL_CLASS (sym) = LOC_BLOCK;
-         if (dip -> die_tag == TAG_global_subroutine)
+         if (dip->die_tag == TAG_global_subroutine)
            {
              add_symbol_to_list (sym, &global_symbols);
            }
@@ -2993,7 +2998,7 @@ new_symbol (dip, objfile)
            }
          break;
        case TAG_global_variable:
-         if (dip -> at_location != NULL)
+         if (dip->at_location != NULL)
            {
              SYMBOL_VALUE_ADDRESS (sym) = locval (dip);
              add_symbol_to_list (sym, &global_symbols);
@@ -3002,21 +3007,21 @@ new_symbol (dip, objfile)
            }
          break;
        case TAG_local_variable:
-         if (dip -> at_location != NULL)
+         if (dip->at_location != NULL)
            {
              int loc = locval (dip);
-             if (dip -> optimized_out)
+             if (dip->optimized_out)
                {
                  SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
                }
-             else if (dip -> isreg)
+             else if (dip->isreg)
                {
                  SYMBOL_CLASS (sym) = LOC_REGISTER;
                }
-             else if (dip -> offreg)
+             else if (dip->offreg)
                {
                  SYMBOL_CLASS (sym) = LOC_BASEREG;
-                 SYMBOL_BASEREG (sym) = dip -> basereg;
+                 SYMBOL_BASEREG (sym) = dip->basereg;
                }
              else
                {
@@ -3037,19 +3042,19 @@ new_symbol (dip, objfile)
            }
          break;
        case TAG_formal_parameter:
-         if (dip -> at_location != NULL)
+         if (dip->at_location != NULL)
            {
              SYMBOL_VALUE (sym) = locval (dip);
            }
          add_symbol_to_list (sym, list_in_scope);
-         if (dip -> isreg)
+         if (dip->isreg)
            {
              SYMBOL_CLASS (sym) = LOC_REGPARM;
            }
-         else if (dip -> offreg)
+         else if (dip->offreg)
            {
              SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
-             SYMBOL_BASEREG (sym) = dip -> basereg;
+             SYMBOL_BASEREG (sym) = dip->basereg;
            }
          else
            {
@@ -3085,23 +3090,23 @@ new_symbol (dip, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       synthesize_typedef -- make a symbol table entry for a "fake" typedef
+   synthesize_typedef -- make a symbol table entry for a "fake" typedef
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void synthesize_typedef (struct dieinfo *dip,
-                                       struct objfile *objfile,
-                                       struct type *type);
+   static void synthesize_typedef (struct dieinfo *dip,
+   struct objfile *objfile,
+   struct type *type);
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a DWARF information entry, synthesize a typedef
-       for the name in the DIE, using the specified type.
+   Given a pointer to a DWARF information entry, synthesize a typedef
+   for the name in the DIE, using the specified type.
 
-       This is used for C++ class, structs, unions, and enumerations to
-       set up the tag name as a type.
+   This is used for C++ class, structs, unions, and enumerations to
+   set up the tag name as a type.
 
  */
 
@@ -3112,14 +3117,14 @@ synthesize_typedef (dip, objfile, type)
      struct type *type;
 {
   struct symbol *sym = NULL;
-  
-  if (dip -> at_name != NULL)
+
+  if (dip->at_name != NULL)
     {
       sym = (struct symbol *)
-       obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
+       obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
       OBJSTAT (objfile, n_syms++);
       memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = create_name (dip -> at_name,
+      SYMBOL_NAME (sym) = create_name (dip->at_name,
                                       &objfile->symbol_obstack);
       SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language);
       SYMBOL_TYPE (sym) = type;
@@ -3131,26 +3136,26 @@ synthesize_typedef (dip, objfile, type)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_mod_fund_type -- decode a modified fundamental type
+   decode_mod_fund_type -- decode a modified fundamental type
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *decode_mod_fund_type (char *typedata)
+   static struct type *decode_mod_fund_type (char *typedata)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Decode a block of data containing a modified fundamental
-       type specification.  TYPEDATA is a pointer to the block,
-       which starts with a length containing the size of the rest
-       of the block.  At the end of the block is a fundmental type
-       code value that gives the fundamental type.  Everything
-       in between are type modifiers.
+   Decode a block of data containing a modified fundamental
+   type specification.  TYPEDATA is a pointer to the block,
+   which starts with a length containing the size of the rest
+   of the block.  At the end of the block is a fundmental type
+   code value that gives the fundamental type.  Everything
+   in between are type modifiers.
 
-       We simply compute the number of modifiers and call the general
-       function decode_modified_type to do the actual work.
-*/
+   We simply compute the number of modifiers and call the general
+   function decode_modified_type to do the actual work.
+ */
 
 static struct type *
 decode_mod_fund_type (typedata)
@@ -3159,7 +3164,7 @@ decode_mod_fund_type (typedata)
   struct type *typep = NULL;
   unsigned short modcount;
   int nbytes;
-  
+
   /* Get the total size of the block, exclusive of the size itself */
 
   nbytes = attribute_size (AT_mod_fund_type);
@@ -3178,26 +3183,26 @@ decode_mod_fund_type (typedata)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_mod_u_d_type -- decode a modified user defined type
+   decode_mod_u_d_type -- decode a modified user defined type
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *decode_mod_u_d_type (char *typedata)
+   static struct type *decode_mod_u_d_type (char *typedata)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Decode a block of data containing a modified user defined
-       type specification.  TYPEDATA is a pointer to the block,
-       which consists of a two byte length, containing the size
-       of the rest of the block.  At the end of the block is a
-       four byte value that gives a reference to a user defined type.
-       Everything in between are type modifiers.
+   Decode a block of data containing a modified user defined
+   type specification.  TYPEDATA is a pointer to the block,
+   which consists of a two byte length, containing the size
+   of the rest of the block.  At the end of the block is a
+   four byte value that gives a reference to a user defined type.
+   Everything in between are type modifiers.
 
-       We simply compute the number of modifiers and call the general
-       function decode_modified_type to do the actual work.
-*/
+   We simply compute the number of modifiers and call the general
+   function decode_modified_type to do the actual work.
+ */
 
 static struct type *
 decode_mod_u_d_type (typedata)
@@ -3206,7 +3211,7 @@ decode_mod_u_d_type (typedata)
   struct type *typep = NULL;
   unsigned short modcount;
   int nbytes;
-  
+
   /* Get the total size of the block, exclusive of the size itself */
 
   nbytes = attribute_size (AT_mod_u_d_type);
@@ -3225,41 +3230,41 @@ decode_mod_u_d_type (typedata)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_modified_type -- decode modified user or fundamental type
+   decode_modified_type -- decode modified user or fundamental type
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct type *decode_modified_type (char *modifiers,
-           unsigned short modcount, int mtype)
+   static struct type *decode_modified_type (char *modifiers,
+   unsigned short modcount, int mtype)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Decode a modified type, either a modified fundamental type or
-       a modified user defined type.  MODIFIERS is a pointer to the
-       block of bytes that define MODCOUNT modifiers.  Immediately
-       following the last modifier is a short containing the fundamental
-       type or a long containing the reference to the user defined
-       type.  Which one is determined by MTYPE, which is either
-       AT_mod_fund_type or AT_mod_u_d_type to indicate what modified
-       type we are generating.
-
-       We call ourself recursively to generate each modified type,`
-       until MODCOUNT reaches zero, at which point we have consumed
-       all the modifiers and generate either the fundamental type or
-       user defined type.  When the recursion unwinds, each modifier
-       is applied in turn to generate the full modified type.
+   Decode a modified type, either a modified fundamental type or
+   a modified user defined type.  MODIFIERS is a pointer to the
+   block of bytes that define MODCOUNT modifiers.  Immediately
+   following the last modifier is a short containing the fundamental
+   type or a long containing the reference to the user defined
+   type.  Which one is determined by MTYPE, which is either
+   AT_mod_fund_type or AT_mod_u_d_type to indicate what modified
+   type we are generating.
 
-NOTES
+   We call ourself recursively to generate each modified type,`
+   until MODCOUNT reaches zero, at which point we have consumed
+   all the modifiers and generate either the fundamental type or
+   user defined type.  When the recursion unwinds, each modifier
+   is applied in turn to generate the full modified type.
+
+   NOTES
 
-       If we find a modifier that we don't recognize, and it is not one
-       of those reserved for application specific use, then we issue a
-       warning and simply ignore the modifier.
+   If we find a modifier that we don't recognize, and it is not one
+   of those reserved for application specific use, then we issue a
+   warning and simply ignore the modifier.
 
-BUGS
+   BUGS
 
-       We currently ignore MOD_const and MOD_volatile.  (FIXME)
+   We currently ignore MOD_const and MOD_volatile.  (FIXME)
 
  */
 
@@ -3274,7 +3279,7 @@ decode_modified_type (modifiers, modcount, mtype)
   DIE_REF die_ref;
   char modifier;
   int nbytes;
-  
+
   if (modcount == 0)
     {
       switch (mtype)
@@ -3306,25 +3311,25 @@ decode_modified_type (modifiers, modcount, mtype)
       typep = decode_modified_type (modifiers, --modcount, mtype);
       switch (modifier)
        {
-         case MOD_pointer_to:
-           typep = lookup_pointer_type (typep);
-           break;
-         case MOD_reference_to:
-           typep = lookup_reference_type (typep);
-           break;
-         case MOD_const:
-           complain (&const_ignored, DIE_ID, DIE_NAME);  /* FIXME */
-           break;
-         case MOD_volatile:
-           complain (&volatile_ignored, DIE_ID, DIE_NAME); /* FIXME */
-           break;
-         default:
-           if (!(MOD_lo_user <= (unsigned char) modifier
-                 && (unsigned char) modifier <= MOD_hi_user))
-             {
-               complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier);
-             }
-           break;
+       case MOD_pointer_to:
+         typep = lookup_pointer_type (typep);
+         break;
+       case MOD_reference_to:
+         typep = lookup_reference_type (typep);
+         break;
+       case MOD_const:
+         complain (&const_ignored, DIE_ID, DIE_NAME);  /* FIXME */
+         break;
+       case MOD_volatile:
+         complain (&volatile_ignored, DIE_ID, DIE_NAME);       /* FIXME */
+         break;
+       default:
+         if (!(MOD_lo_user <= (unsigned char) modifier
+               && (unsigned char) modifier <= MOD_hi_user))
+           {
+             complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier);
+           }
+         break;
        }
     }
   return (typep);
@@ -3332,39 +3337,39 @@ decode_modified_type (modifiers, modcount, mtype)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       decode_fund_type -- translate basic DWARF type to gdb base type
+   decode_fund_type -- translate basic DWARF type to gdb base type
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an integer that is one of the fundamental DWARF types,
-       translate it to one of the basic internal gdb types and return
-       a pointer to the appropriate gdb type (a "struct type *").
+   Given an integer that is one of the fundamental DWARF types,
+   translate it to one of the basic internal gdb types and return
+   a pointer to the appropriate gdb type (a "struct type *").
 
-NOTES
+   NOTES
 
-       For robustness, if we are asked to translate a fundamental
-       type that we are unprepared to deal with, we return int so
-       callers can always depend upon a valid type being returned,
-       and so gdb may at least do something reasonable by default.
-       If the type is not in the range of those types defined as
-       application specific types, we also issue a warning.
-*/
+   For robustness, if we are asked to translate a fundamental
+   type that we are unprepared to deal with, we return int so
+   callers can always depend upon a valid type being returned,
+   and so gdb may at least do something reasonable by default.
+   If the type is not in the range of those types defined as
+   application specific types, we also issue a warning.
+ */
 
 static struct type *
 decode_fund_type (fundtype)
      unsigned int fundtype;
 {
   struct type *typep = NULL;
-  
+
   switch (fundtype)
     {
 
     case FT_void:
       typep = dwarf_fundamental_type (current_objfile, FT_VOID);
       break;
-    
+
     case FT_boolean:           /* Was FT_set in AT&T version */
       typep = dwarf_fundamental_type (current_objfile, FT_BOOLEAN);
       break;
@@ -3373,11 +3378,11 @@ decode_fund_type (fundtype)
       typep = dwarf_fundamental_type (current_objfile, FT_VOID);
       typep = lookup_pointer_type (typep);
       break;
-    
+
     case FT_char:
       typep = dwarf_fundamental_type (current_objfile, FT_CHAR);
       break;
-    
+
     case FT_signed_char:
       typep = dwarf_fundamental_type (current_objfile, FT_SIGNED_CHAR);
       break;
@@ -3385,7 +3390,7 @@ decode_fund_type (fundtype)
     case FT_unsigned_char:
       typep = dwarf_fundamental_type (current_objfile, FT_UNSIGNED_CHAR);
       break;
-    
+
     case FT_short:
       typep = dwarf_fundamental_type (current_objfile, FT_SHORT);
       break;
@@ -3393,11 +3398,11 @@ decode_fund_type (fundtype)
     case FT_signed_short:
       typep = dwarf_fundamental_type (current_objfile, FT_SIGNED_SHORT);
       break;
-    
+
     case FT_unsigned_short:
       typep = dwarf_fundamental_type (current_objfile, FT_UNSIGNED_SHORT);
       break;
-    
+
     case FT_integer:
       typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
       break;
@@ -3405,11 +3410,11 @@ decode_fund_type (fundtype)
     case FT_signed_integer:
       typep = dwarf_fundamental_type (current_objfile, FT_SIGNED_INTEGER);
       break;
-    
+
     case FT_unsigned_integer:
       typep = dwarf_fundamental_type (current_objfile, FT_UNSIGNED_INTEGER);
       break;
-    
+
     case FT_long:
       typep = dwarf_fundamental_type (current_objfile, FT_LONG);
       break;
@@ -3417,11 +3422,11 @@ decode_fund_type (fundtype)
     case FT_signed_long:
       typep = dwarf_fundamental_type (current_objfile, FT_SIGNED_LONG);
       break;
-    
+
     case FT_unsigned_long:
       typep = dwarf_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
       break;
-    
+
     case FT_long_long:
       typep = dwarf_fundamental_type (current_objfile, FT_LONG_LONG);
       break;
@@ -3437,27 +3442,27 @@ decode_fund_type (fundtype)
     case FT_float:
       typep = dwarf_fundamental_type (current_objfile, FT_FLOAT);
       break;
-    
+
     case FT_dbl_prec_float:
       typep = dwarf_fundamental_type (current_objfile, FT_DBL_PREC_FLOAT);
       break;
-    
+
     case FT_ext_prec_float:
       typep = dwarf_fundamental_type (current_objfile, FT_EXT_PREC_FLOAT);
       break;
-    
+
     case FT_complex:
       typep = dwarf_fundamental_type (current_objfile, FT_COMPLEX);
       break;
-    
+
     case FT_dbl_prec_complex:
       typep = dwarf_fundamental_type (current_objfile, FT_DBL_PREC_COMPLEX);
       break;
-    
+
     case FT_ext_prec_complex:
       typep = dwarf_fundamental_type (current_objfile, FT_EXT_PREC_COMPLEX);
       break;
-    
+
     }
 
   if (typep == NULL)
@@ -3468,22 +3473,22 @@ decode_fund_type (fundtype)
          complain (&unexpected_fund_type, DIE_ID, DIE_NAME, fundtype);
        }
     }
-    
+
   return (typep);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       create_name -- allocate a fresh copy of a string on an obstack
+   create_name -- allocate a fresh copy of a string on an obstack
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a string and a pointer to an obstack, allocates
-       a fresh copy of the string on the specified obstack.
+   Given a pointer to a string and a pointer to an obstack, allocates
+   a fresh copy of the string on the specified obstack.
 
-*/
+ */
 
 static char *
 create_name (name, obstackp)
@@ -3501,56 +3506,56 @@ create_name (name, obstackp)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       basicdieinfo -- extract the minimal die info from raw die data
+   basicdieinfo -- extract the minimal die info from raw die data
 
-SYNOPSIS
+   SYNOPSIS
 
-       void basicdieinfo (char *diep, struct dieinfo *dip,
-                          struct objfile *objfile)
+   void basicdieinfo (char *diep, struct dieinfo *dip,
+   struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to raw DIE data, and a pointer to an instance of a
-       die info structure, this function extracts the basic information
-       from the DIE data required to continue processing this DIE, along
-       with some bookkeeping information about the DIE.
+   Given a pointer to raw DIE data, and a pointer to an instance of a
+   die info structure, this function extracts the basic information
+   from the DIE data required to continue processing this DIE, along
+   with some bookkeeping information about the DIE.
 
-       The information we absolutely must have includes the DIE tag,
-       and the DIE length.  If we need the sibling reference, then we
-       will have to call completedieinfo() to process all the remaining
-       DIE information.
+   The information we absolutely must have includes the DIE tag,
+   and the DIE length.  If we need the sibling reference, then we
+   will have to call completedieinfo() to process all the remaining
+   DIE information.
 
-       Note that since there is no guarantee that the data is properly
-       aligned in memory for the type of access required (indirection
-       through anything other than a char pointer), and there is no
-       guarantee that it is in the same byte order as the gdb host,
-       we call a function which deals with both alignment and byte
-       swapping issues.  Possibly inefficient, but quite portable.
+   Note that since there is no guarantee that the data is properly
+   aligned in memory for the type of access required (indirection
+   through anything other than a char pointer), and there is no
+   guarantee that it is in the same byte order as the gdb host,
+   we call a function which deals with both alignment and byte
+   swapping issues.  Possibly inefficient, but quite portable.
 
-       We also take care of some other basic things at this point, such
-       as ensuring that the instance of the die info structure starts
-       out completely zero'd and that curdie is initialized for use
-       in error reporting if we have a problem with the current die.
+   We also take care of some other basic things at this point, such
+   as ensuring that the instance of the die info structure starts
+   out completely zero'd and that curdie is initialized for use
+   in error reporting if we have a problem with the current die.
 
-NOTES
+   NOTES
+
+   All DIE's must have at least a valid length, thus the minimum
+   DIE size is SIZEOF_DIE_LENGTH.  In order to have a valid tag, the
+   DIE size must be at least SIZEOF_DIE_TAG larger, otherwise they
+   are forced to be TAG_padding DIES.
 
-       All DIE's must have at least a valid length, thus the minimum
-       DIE size is SIZEOF_DIE_LENGTH.  In order to have a valid tag, the
-       DIE size must be at least SIZEOF_DIE_TAG larger, otherwise they
-       are forced to be TAG_padding DIES.
-
-       Padding DIES must be at least SIZEOF_DIE_LENGTH in length, implying
-       that if a padding DIE is used for alignment and the amount needed is
-       less than SIZEOF_DIE_LENGTH, then the padding DIE has to be big
-       enough to align to the next alignment boundry.
-
-       We do some basic sanity checking here, such as verifying that the
-       length of the die would not cause it to overrun the recorded end of
-       the buffer holding the DIE info.  If we find a DIE that is either
-       too small or too large, we force it's length to zero which should
-       cause the caller to take appropriate action.
+   Padding DIES must be at least SIZEOF_DIE_LENGTH in length, implying
+   that if a padding DIE is used for alignment and the amount needed is
+   less than SIZEOF_DIE_LENGTH, then the padding DIE has to be big
+   enough to align to the next alignment boundry.
+
+   We do some basic sanity checking here, such as verifying that the
+   length of the die would not cause it to overrun the recorded end of
+   the buffer holding the DIE info.  If we find a DIE that is either
+   too small or too large, we force it's length to zero which should
+   cause the caller to take appropriate action.
  */
 
 static void
@@ -3561,57 +3566,57 @@ basicdieinfo (dip, diep, objfile)
 {
   curdie = dip;
   memset (dip, 0, sizeof (struct dieinfo));
-  dip -> die = diep;
-  dip -> die_ref = dbroff + (diep - dbbase);
-  dip -> die_length = target_to_host (diep, SIZEOF_DIE_LENGTH, GET_UNSIGNED,
-                                     objfile);
-  if ((dip -> die_length < SIZEOF_DIE_LENGTH) ||
-      ((diep + dip -> die_length) > (dbbase + dbsize)))
+  dip->die = diep;
+  dip->die_ref = dbroff + (diep - dbbase);
+  dip->die_length = target_to_host (diep, SIZEOF_DIE_LENGTH, GET_UNSIGNED,
+                                   objfile);
+  if ((dip->die_length < SIZEOF_DIE_LENGTH) ||
+      ((diep + dip->die_length) > (dbbase + dbsize)))
     {
-      complain (&malformed_die, DIE_ID, DIE_NAME, dip -> die_length);
-      dip -> die_length = 0;
+      complain (&malformed_die, DIE_ID, DIE_NAME, dip->die_length);
+      dip->die_length = 0;
     }
-  else if (dip -> die_length < (SIZEOF_DIE_LENGTH + SIZEOF_DIE_TAG))
+  else if (dip->die_length < (SIZEOF_DIE_LENGTH + SIZEOF_DIE_TAG))
     {
-      dip -> die_tag = TAG_padding;
+      dip->die_tag = TAG_padding;
     }
   else
     {
       diep += SIZEOF_DIE_LENGTH;
-      dip -> die_tag = target_to_host (diep, SIZEOF_DIE_TAG, GET_UNSIGNED,
-                                      objfile);
+      dip->die_tag = target_to_host (diep, SIZEOF_DIE_TAG, GET_UNSIGNED,
+                                    objfile);
     }
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       completedieinfo -- finish reading the information for a given DIE
+   completedieinfo -- finish reading the information for a given DIE
 
-SYNOPSIS
+   SYNOPSIS
 
-       void completedieinfo (struct dieinfo *dip, struct objfile *objfile)
+   void completedieinfo (struct dieinfo *dip, struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to an already partially initialized die info structure,
-       scan the raw DIE data and finish filling in the die info structure
-       from the various attributes found.
-   
-       Note that since there is no guarantee that the data is properly
-       aligned in memory for the type of access required (indirection
-       through anything other than a char pointer), and there is no
-       guarantee that it is in the same byte order as the gdb host,
-       we call a function which deals with both alignment and byte
-       swapping issues.  Possibly inefficient, but quite portable.
+   Given a pointer to an already partially initialized die info structure,
+   scan the raw DIE data and finish filling in the die info structure
+   from the various attributes found.
 
-NOTES
+   Note that since there is no guarantee that the data is properly
+   aligned in memory for the type of access required (indirection
+   through anything other than a char pointer), and there is no
+   guarantee that it is in the same byte order as the gdb host,
+   we call a function which deals with both alignment and byte
+   swapping issues.  Possibly inefficient, but quite portable.
 
-       Each time we are called, we increment the diecount variable, which
-       keeps an approximate count of the number of dies processed for
-       each compilation unit.  This information is presented to the user
-       if the info_verbose flag is set.
+   NOTES
+
+   Each time we are called, we increment the diecount variable, which
+   keeps an approximate count of the number of dies processed for
+   each compilation unit.  This information is presented to the user
+   if the info_verbose flag is set.
 
  */
 
@@ -3625,10 +3630,10 @@ completedieinfo (dip, objfile)
   unsigned short attr;         /* Current attribute being scanned */
   unsigned short form;         /* Form of the attribute */
   int nbytes;                  /* Size of next field to read */
-  
+
   diecount++;
-  diep = dip -> die;
-  end = diep + dip -> die_length;
+  diep = dip->die;
+  end = diep + dip->die_length;
   diep += SIZEOF_DIE_LENGTH + SIZEOF_DIE_TAG;
   while (diep < end)
     {
@@ -3643,121 +3648,121 @@ completedieinfo (dip, objfile)
       switch (attr)
        {
        case AT_fund_type:
-         dip -> at_fund_type = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                               objfile);
+         dip->at_fund_type = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                             objfile);
          break;
        case AT_ordering:
-         dip -> at_ordering = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                              objfile);
+         dip->at_ordering = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                            objfile);
          break;
        case AT_bit_offset:
-         dip -> at_bit_offset = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                                objfile);
+         dip->at_bit_offset = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                              objfile);
          break;
        case AT_sibling:
-         dip -> at_sibling = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                             objfile);
+         dip->at_sibling = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                           objfile);
          break;
        case AT_stmt_list:
-         dip -> at_stmt_list = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                               objfile);
-         dip -> has_at_stmt_list = 1;
+         dip->at_stmt_list = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                             objfile);
+         dip->has_at_stmt_list = 1;
          break;
        case AT_low_pc:
-         dip -> at_low_pc = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                            objfile);
-         dip -> at_low_pc += baseaddr;
-         dip -> has_at_low_pc = 1;
+         dip->at_low_pc = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                          objfile);
+         dip->at_low_pc += baseaddr;
+         dip->has_at_low_pc = 1;
          break;
        case AT_high_pc:
-         dip -> at_high_pc = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                             objfile);
-         dip -> at_high_pc += baseaddr;
+         dip->at_high_pc = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                           objfile);
+         dip->at_high_pc += baseaddr;
          break;
        case AT_language:
-         dip -> at_language = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                              objfile);
+         dip->at_language = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                            objfile);
          break;
        case AT_user_def_type:
-         dip -> at_user_def_type = target_to_host (diep, nbytes,
-                                                   GET_UNSIGNED, objfile);
+         dip->at_user_def_type = target_to_host (diep, nbytes,
+                                                 GET_UNSIGNED, objfile);
          break;
        case AT_byte_size:
-         dip -> at_byte_size = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                               objfile);
-         dip -> has_at_byte_size = 1;
+         dip->at_byte_size = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                             objfile);
+         dip->has_at_byte_size = 1;
          break;
        case AT_bit_size:
-         dip -> at_bit_size = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                              objfile);
+         dip->at_bit_size = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                            objfile);
          break;
        case AT_member:
-         dip -> at_member = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                            objfile);
+         dip->at_member = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                          objfile);
          break;
        case AT_discr:
-         dip -> at_discr = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                           objfile);
+         dip->at_discr = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                         objfile);
          break;
        case AT_location:
-         dip -> at_location = diep;
+         dip->at_location = diep;
          break;
        case AT_mod_fund_type:
-         dip -> at_mod_fund_type = diep;
+         dip->at_mod_fund_type = diep;
          break;
        case AT_subscr_data:
-         dip -> at_subscr_data = diep;
+         dip->at_subscr_data = diep;
          break;
        case AT_mod_u_d_type:
-         dip -> at_mod_u_d_type = diep;
+         dip->at_mod_u_d_type = diep;
          break;
        case AT_element_list:
-         dip -> at_element_list = diep;
-         dip -> short_element_list = 0;
+         dip->at_element_list = diep;
+         dip->short_element_list = 0;
          break;
        case AT_short_element_list:
-         dip -> at_element_list = diep;
-         dip -> short_element_list = 1;
+         dip->at_element_list = diep;
+         dip->short_element_list = 1;
          break;
        case AT_discr_value:
-         dip -> at_discr_value = diep;
+         dip->at_discr_value = diep;
          break;
        case AT_string_length:
-         dip -> at_string_length = diep;
+         dip->at_string_length = diep;
          break;
        case AT_name:
-         dip -> at_name = diep;
+         dip->at_name = diep;
          break;
        case AT_comp_dir:
          /* For now, ignore any "hostname:" portion, since gdb doesn't
             know how to deal with it.  (FIXME). */
-         dip -> at_comp_dir = strrchr (diep, ':');
-         if (dip -> at_comp_dir != NULL)
+         dip->at_comp_dir = strrchr (diep, ':');
+         if (dip->at_comp_dir != NULL)
            {
-             dip -> at_comp_dir++;
+             dip->at_comp_dir++;
            }
          else
            {
-             dip -> at_comp_dir = diep;
+             dip->at_comp_dir = diep;
            }
          break;
        case AT_producer:
-         dip -> at_producer = diep;
+         dip->at_producer = diep;
          break;
        case AT_start_scope:
-         dip -> at_start_scope = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                                 objfile);
+         dip->at_start_scope = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                               objfile);
          break;
        case AT_stride_size:
-         dip -> at_stride_size = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                                 objfile);
+         dip->at_stride_size = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                               objfile);
          break;
        case AT_src_info:
-         dip -> at_src_info = target_to_host (diep, nbytes, GET_UNSIGNED,
-                                              objfile);
+         dip->at_src_info = target_to_host (diep, nbytes, GET_UNSIGNED,
+                                            objfile);
          break;
        case AT_prototyped:
-         dip -> at_prototyped = diep;
+         dip->at_prototyped = diep;
          break;
        default:
          /* Found an attribute that we are unprepared to handle.  However
@@ -3802,30 +3807,30 @@ completedieinfo (dip, objfile)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       target_to_host -- swap in target data to host
+   target_to_host -- swap in target data to host
 
-SYNOPSIS
+   SYNOPSIS
 
-       target_to_host (char *from, int nbytes, int signextend,
-                       struct objfile *objfile)
+   target_to_host (char *from, int nbytes, int signextend,
+   struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given pointer to data in target format in FROM, a byte count for
-       the size of the data in NBYTES, a flag indicating whether or not
-       the data is signed in SIGNEXTEND, and a pointer to the current
-       objfile in OBJFILE, convert the data to host format and return
-       the converted value.
+   Given pointer to data in target format in FROM, a byte count for
+   the size of the data in NBYTES, a flag indicating whether or not
+   the data is signed in SIGNEXTEND, and a pointer to the current
+   objfile in OBJFILE, convert the data to host format and return
+   the converted value.
 
-NOTES
+   NOTES
 
-       FIXME:  If we read data that is known to be signed, and expect to
-       use it as signed data, then we need to explicitly sign extend the
-       result until the bfd library is able to do this for us.
+   FIXME:  If we read data that is known to be signed, and expect to
+   use it as signed data, then we need to explicitly sign extend the
+   result until the bfd library is able to do this for us.
 
-       FIXME: Would a 32 bit target ever need an 8 byte result?
+   FIXME: Would a 32 bit target ever need an 8 byte result?
 
  */
 
@@ -3840,43 +3845,43 @@ target_to_host (from, nbytes, signextend, objfile)
 
   switch (nbytes)
     {
-      case 8:
-        rtnval = bfd_get_64 (objfile -> obfd, (bfd_byte *) from);
-       break;
-      case 4:
-       rtnval = bfd_get_32 (objfile -> obfd, (bfd_byte *) from);
-       break;
-      case 2:
-       rtnval = bfd_get_16 (objfile -> obfd, (bfd_byte *) from);
-       break;
-      case 1:
-       rtnval = bfd_get_8 (objfile -> obfd, (bfd_byte *) from);
-       break;
-      default:
-       complain (&no_bfd_get_N, DIE_ID, DIE_NAME, nbytes);
-       rtnval = 0;
-       break;
+    case 8:
+      rtnval = bfd_get_64 (objfile->obfd, (bfd_byte *) from);
+      break;
+    case 4:
+      rtnval = bfd_get_32 (objfile->obfd, (bfd_byte *) from);
+      break;
+    case 2:
+      rtnval = bfd_get_16 (objfile->obfd, (bfd_byte *) from);
+      break;
+    case 1:
+      rtnval = bfd_get_8 (objfile->obfd, (bfd_byte *) from);
+      break;
+    default:
+      complain (&no_bfd_get_N, DIE_ID, DIE_NAME, nbytes);
+      rtnval = 0;
+      break;
     }
   return (rtnval);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       attribute_size -- compute size of data for a DWARF attribute
+   attribute_size -- compute size of data for a DWARF attribute
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int attribute_size (unsigned int attr)
+   static int attribute_size (unsigned int attr)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a DWARF attribute in ATTR, compute the size of the first
-       piece of data associated with this attribute and return that
-       size.
+   Given a DWARF attribute in ATTR, compute the size of the first
+   piece of data associated with this attribute and return that
+   size.
 
-       Returns -1 for unrecognized attributes.
+   Returns -1 for unrecognized attributes.
 
  */
 
@@ -3890,28 +3895,28 @@ attribute_size (attr)
   form = FORM_FROM_ATTR (attr);
   switch (form)
     {
-      case FORM_STRING:                /* A variable length field is next */
-        nbytes = 0;
-       break;
-      case FORM_DATA2:         /* Next 2 byte field is the data itself */
-      case FORM_BLOCK2:                /* Next 2 byte field is a block length */
-       nbytes = 2;
-       break;
-      case FORM_DATA4:         /* Next 4 byte field is the data itself */
-      case FORM_BLOCK4:                /* Next 4 byte field is a block length */
-      case FORM_REF:           /* Next 4 byte field is a DIE offset */
-       nbytes = 4;
-       break;
-      case FORM_DATA8:         /* Next 8 byte field is the data itself */
-       nbytes = 8;
-       break;
-      case FORM_ADDR:          /* Next field size is target sizeof(void *) */
-       nbytes = TARGET_FT_POINTER_SIZE (objfile);
-       break;
-      default:
-       complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form);
-       nbytes = -1;
-       break;
-      }
+    case FORM_STRING:          /* A variable length field is next */
+      nbytes = 0;
+      break;
+    case FORM_DATA2:           /* Next 2 byte field is the data itself */
+    case FORM_BLOCK2:          /* Next 2 byte field is a block length */
+      nbytes = 2;
+      break;
+    case FORM_DATA4:           /* Next 4 byte field is the data itself */
+    case FORM_BLOCK4:          /* Next 4 byte field is a block length */
+    case FORM_REF:             /* Next 4 byte field is a DIE offset */
+      nbytes = 4;
+      break;
+    case FORM_DATA8:           /* Next 8 byte field is the data itself */
+      nbytes = 8;
+      break;
+    case FORM_ADDR:            /* Next field size is target sizeof(void *) */
+      nbytes = TARGET_FT_POINTER_SIZE (objfile);
+      break;
+    default:
+      complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form);
+      nbytes = -1;
+      break;
+    }
   return (nbytes);
 }
index 9c13b00bf4859cfbee99b6f2b3beb29a8563c37f..f0ad2bed8b2e92e9f5375336563bfa13f36b4ebe 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
@@ -38,29 +39,30 @@ extern void _initialize_elfread PARAMS ((void));
    psymtab reading.  It is destroyed at the complation of psymtab-reading.
    It's local to elf_symfile_read.  */
 
-struct elfinfo {
-  file_ptr dboffset;           /* Offset to dwarf debug section */
-  unsigned int dbsize;         /* Size of dwarf debug section */
-  file_ptr lnoffset;           /* Offset to dwarf line number section */
-  unsigned int lnsize;         /* Size of dwarf line number section */
-  asection *stabsect;          /* Section pointer for .stab section */
-  asection *stabindexsect;     /* Section pointer for .stab.index section */
-  asection *mdebugsect;                /* Section pointer for .mdebug section */
-};
+struct elfinfo
+  {
+    file_ptr dboffset;         /* Offset to dwarf debug section */
+    unsigned int dbsize;       /* Size of dwarf debug section */
+    file_ptr lnoffset;         /* Offset to dwarf line number section */
+    unsigned int lnsize;       /* Size of dwarf line number section */
+    asection *stabsect;                /* Section pointer for .stab section */
+    asection *stabindexsect;   /* Section pointer for .stab.index section */
+    asection *mdebugsect;      /* Section pointer for .mdebug section */
+  };
 
 /* Various things we might complain about... */
 
-struct complaint section_info_complaint = 
-  {"elf/stab section information %s without a preceding file symbol", 0, 0};
+struct complaint section_info_complaint =
+{"elf/stab section information %s without a preceding file symbol", 0, 0};
 
-struct complaint section_info_dup_complaint = 
-  {"duplicated elf/stab section information for %s", 0, 0};
+struct complaint section_info_dup_complaint =
+{"duplicated elf/stab section information for %s", 0, 0};
 
-struct complaint stab_info_mismatch_complaint = 
-  {"elf/stab section information missing for %s", 0, 0};
+struct complaint stab_info_mismatch_complaint =
+{"elf/stab section information missing for %s", 0, 0};
 
-struct complaint stab_info_questionable_complaint = 
-  {"elf/stab section information questionable for %s", 0, 0};
+struct complaint stab_info_questionable_complaint =
+{"elf/stab section information questionable for %s", 0, 0};
 
 static void
 elf_symfile_init PARAMS ((struct objfile *));
@@ -75,16 +77,16 @@ static void
 elf_symfile_finish PARAMS ((struct objfile *));
 
 static void
-elf_symtab_read PARAMS ((bfd *,  CORE_ADDR, struct objfile *, int));
+elf_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *, int));
 
 static void
 free_elfinfo PARAMS ((void *));
 
 static struct minimal_symbol *
-record_minimal_symbol_and_info PARAMS ((char *, CORE_ADDR,
-                                       enum minimal_symbol_type, char *,
-                                       asection *bfd_section,
-                                       struct objfile *));
+  record_minimal_symbol_and_info PARAMS ((char *, CORE_ADDR,
+                                         enum minimal_symbol_type, char *,
+                                         asection * bfd_section,
+                                         struct objfile *));
 
 static void
 elf_locate_sections PARAMS ((bfd *, asection *, void *));
@@ -117,31 +119,31 @@ elf_locate_sections (ignore_abfd, sectp, eip)
   register struct elfinfo *ei;
 
   ei = (struct elfinfo *) eip;
-  if (STREQ (sectp -> name, ".debug"))
+  if (STREQ (sectp->name, ".debug"))
     {
-      ei -> dboffset = sectp -> filepos;
-      ei -> dbsize = bfd_get_section_size_before_reloc (sectp);
+      ei->dboffset = sectp->filepos;
+      ei->dbsize = bfd_get_section_size_before_reloc (sectp);
     }
-  else if (STREQ (sectp -> name, ".line"))
+  else if (STREQ (sectp->name, ".line"))
     {
-      ei -> lnoffset = sectp -> filepos;
-      ei -> lnsize = bfd_get_section_size_before_reloc (sectp);
+      ei->lnoffset = sectp->filepos;
+      ei->lnsize = bfd_get_section_size_before_reloc (sectp);
     }
-  else if (STREQ (sectp -> name, ".stab"))
+  else if (STREQ (sectp->name, ".stab"))
     {
-      ei -> stabsect = sectp;
+      ei->stabsect = sectp;
     }
-  else if (STREQ (sectp -> name, ".stab.index"))
+  else if (STREQ (sectp->name, ".stab.index"))
     {
-      ei -> stabindexsect = sectp;
+      ei->stabindexsect = sectp;
     }
-  else if (STREQ (sectp -> name, ".mdebug"))
+  else if (STREQ (sectp->name, ".mdebug"))
     {
-      ei -> mdebugsect = sectp;
+      ei->mdebugsect = sectp;
     }
 }
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 char *
 elf_interpreter (abfd)
@@ -156,7 +158,7 @@ elf_interpreter (abfd)
     {
       size = bfd_section_size (abfd, interp_sec);
       interp = alloca (size);
-      if (bfd_get_section_contents (abfd, interp_sec, interp, (file_ptr)0,
+      if (bfd_get_section_contents (abfd, interp_sec, interp, (file_ptr) 0,
                                    size))
        {
          interp = savestring (interp, size - 1);
@@ -213,29 +215,29 @@ record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section,
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       elf_symtab_read -- read the symbol table of an ELF file
+   elf_symtab_read -- read the symbol table of an ELF file
 
-SYNOPSIS
+   SYNOPSIS
 
-       void elf_symtab_read (bfd *abfd, CORE_ADDR addr,
-                             struct objfile *objfile, int dynamic)
+   void elf_symtab_read (bfd *abfd, CORE_ADDR addr,
+   struct objfile *objfile, int dynamic)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an open bfd, a base address to relocate symbols to, and a
-       flag that specifies whether or not this bfd is for an executable
-       or not (may be shared library for example), add all the global
-       function and data symbols to the minimal symbol table.
+   Given an open bfd, a base address to relocate symbols to, and a
+   flag that specifies whether or not this bfd is for an executable
+   or not (may be shared library for example), add all the global
+   function and data symbols to the minimal symbol table.
 
-       In stabs-in-ELF, as implemented by Sun, there are some local symbols
-       defined in the ELF symbol table, which can be used to locate
-       the beginnings of sections from each ".o" file that was linked to
-       form the executable objfile.  We gather any such info and record it
-       in data structures hung off the objfile's private data.
+   In stabs-in-ELF, as implemented by Sun, there are some local symbols
+   defined in the ELF symbol table, which can be used to locate
+   the beginnings of sections from each ".o" file that was linked to
+   form the executable objfile.  We gather any such info and record it
+   in data structures hung off the objfile's private data.
 
-*/
+ */
 
 static void
 elf_symtab_read (abfd, addr, objfile, dynamic)
@@ -266,7 +268,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
   struct dbx_symfile_info *dbx = objfile->sym_stab_info;
   unsigned long size;
   int stripped = (bfd_get_symcount (abfd) == 0);
+
   if (dynamic)
     {
       storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
@@ -287,44 +289,44 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
       symbol_table = (asymbol **) xmalloc (storage_needed);
       back_to = make_cleanup (free, symbol_table);
       if (dynamic)
-        number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd,
+       number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd,
                                                             symbol_table);
       else
-        number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+       number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
       if (number_of_symbols < 0)
        error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
               bfd_errmsg (bfd_get_error ()));
       for (i = 0; i < number_of_symbols; i++)
        {
          sym = symbol_table[i];
-         if (sym -> name == NULL || *sym -> name == '\0')
+         if (sym->name == NULL || *sym->name == '\0')
            {
              /* Skip names that don't exist (shouldn't happen), or names
-                that are null strings (may happen). */
+                that are null strings (may happen). */
              continue;
            }
 
          if (dynamic
-             && sym -> section == &bfd_und_section
-             && (sym -> flags & BSF_FUNCTION))
+             && sym->section == &bfd_und_section
+             && (sym->flags & BSF_FUNCTION))
            {
              struct minimal_symbol *msym;
 
              /* Symbol is a reference to a function defined in
-                a shared library.
-                If its value is non zero then it is usually the address
-                of the corresponding entry in the procedure linkage table,
-                relative to the base address.
-                If its value is zero then the dynamic linker has to resolve
-                the symbol. We are unable to find any meaningful address
-                for this symbol in the executable file, so we skip it.  */
-             symaddr = sym -> value;
+                a shared library.
+                If its value is non zero then it is usually the address
+                of the corresponding entry in the procedure linkage table,
+                relative to the base address.
+                If its value is zero then the dynamic linker has to resolve
+                the symbol. We are unable to find any meaningful address
+                for this symbol in the executable file, so we skip it.  */
+             symaddr = sym->value;
              if (symaddr == 0)
                continue;
              symaddr += addr;
              msym = record_minimal_symbol_and_info
-               ((char *) sym -> name, symaddr,
-               mst_solib_trampoline, NULL, sym -> section, objfile);
+               ((char *) sym->name, symaddr,
+                mst_solib_trampoline, NULL, sym->section, objfile);
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
              if (msym != NULL)
                msym->filename = filesymname;
@@ -337,47 +339,47 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
             of the main symbol table.  */
          if (dynamic && !stripped)
            continue;
-         if (sym -> flags & BSF_FILE)
+         if (sym->flags & BSF_FILE)
            {
              /* STT_FILE debugging symbol that helps stabs-in-elf debugging.
-                Chain any old one onto the objfile; remember new sym.  */
+                Chain any old one onto the objfile; remember new sym.  */
              if (sectinfo != NULL)
                {
-                 sectinfo -> next = dbx -> stab_section_info;
-                 dbx -> stab_section_info = sectinfo;
+                 sectinfo->next = dbx->stab_section_info;
+                 dbx->stab_section_info = sectinfo;
                  sectinfo = NULL;
                }
              filesym = sym;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
              filesymname =
-               obsavestring ((char *)filesym->name, strlen (filesym->name),
+               obsavestring ((char *) filesym->name, strlen (filesym->name),
                              &objfile->symbol_obstack);
 #endif
            }
-         else if (sym -> flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
+         else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
            {
              struct minimal_symbol *msym;
 
              /* Select global/local/weak symbols.  Note that bfd puts abs
-                symbols in their own section, so all symbols we are
-                interested in will have a section. */
+                symbols in their own section, so all symbols we are
+                interested in will have a section. */
              /* Bfd symbols are section relative. */
-             symaddr = sym -> value + sym -> section -> vma;
+             symaddr = sym->value + sym->section->vma;
              /* Relocate all non-absolute symbols by base address.  */
-             if (sym -> section != &bfd_abs_section)
+             if (sym->section != &bfd_abs_section)
                {
                  symaddr += addr;
                }
              /* For non-absolute symbols, use the type of the section
-                they are relative to, to intuit text/data.  Bfd provides
-                no way of figuring this out for absolute symbols. */
-             if (sym -> section == &bfd_abs_section)
+                they are relative to, to intuit text/data.  Bfd provides
+                no way of figuring this out for absolute symbols. */
+             if (sym->section == &bfd_abs_section)
                {
                  /* This is a hack to get the minimal symbol type
                     right for Irix 5, which has absolute adresses
                     with special section indices for dynamic symbols. */
                  unsigned short shndx =
-                   ((elf_symbol_type *) sym)->internal_elf_sym.st_shndx;
+                 ((elf_symbol_type *) sym)->internal_elf_sym.st_shndx;
 
                  switch (shndx)
                    {
@@ -403,14 +405,14 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
                      symaddr += addr;
                    }
                }
-             else if (sym -> section -> flags & SEC_CODE)
+             else if (sym->section->flags & SEC_CODE)
                {
-                 if (sym -> flags & BSF_GLOBAL)
+                 if (sym->flags & BSF_GLOBAL)
                    {
                      ms_type = mst_text;
                    }
                  else if ((sym->name[0] == '.' && sym->name[1] == 'L')
-                          || ((sym -> flags & BSF_LOCAL)
+                          || ((sym->flags & BSF_LOCAL)
                               && sym->name[0] == '$'
                               && sym->name[1] == 'L'))
                    /* Looks like a compiler-generated label.  Skip it.
@@ -424,23 +426,23 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
                  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. */
+                        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   
+#endif
                  else
                    {
                      ms_type = mst_file_text;
                    }
                }
-             else if (sym -> section -> flags & SEC_ALLOC)
+             else if (sym->section->flags & SEC_ALLOC)
                {
-                 if (sym -> flags & BSF_GLOBAL)
+                 if (sym->flags & BSF_GLOBAL)
                    {
-                     if (sym -> section -> flags & SEC_LOAD)
+                     if (sym->section->flags & SEC_LOAD)
                        {
                          ms_type = mst_data;
                        }
@@ -449,23 +451,23 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
                          ms_type = mst_bss;
                        }
                    }
-                 else if (sym -> flags & BSF_LOCAL)
+                 else if (sym->flags & BSF_LOCAL)
                    {
                      /* Named Local variable in a Data section.  Check its
-                        name for stabs-in-elf.  The STREQ macro checks the
-                        first character inline, so we only actually do a
-                        strcmp function call on names that start with 'B'
-                        or 'D' */
+                        name for stabs-in-elf.  The STREQ macro checks the
+                        first character inline, so we only actually do a
+                        strcmp function call on names that start with 'B'
+                        or 'D' */
                      index = SECT_OFF_MAX;
-                     if (STREQ ("Bbss.bss", sym -> name))
+                     if (STREQ ("Bbss.bss", sym->name))
                        {
                          index = SECT_OFF_BSS;
                        }
-                     else if (STREQ ("Ddata.data", sym -> name))
+                     else if (STREQ ("Ddata.data", sym->name))
                        {
                          index = SECT_OFF_DATA;
                        }
-                     else if (STREQ ("Drodata.rodata", sym -> name))
+                     else if (STREQ ("Drodata.rodata", sym->name))
                        {
                          index = SECT_OFF_RODATA;
                        }
@@ -476,39 +478,39 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
                          if (sectinfo == NULL)
                            {
                              sectinfo = (struct stab_section_info *)
-                               xmmalloc (objfile -> md, sizeof (*sectinfo));
+                               xmmalloc (objfile->md, sizeof (*sectinfo));
                              memset ((PTR) sectinfo, 0, sizeof (*sectinfo));
                              if (filesym == NULL)
                                {
                                  complain (&section_info_complaint,
-                                           sym -> name);
+                                           sym->name);
                                }
                              else
                                {
-                                 sectinfo -> filename =
-                                   (char *) filesym -> name;
+                                 sectinfo->filename =
+                                   (char *) filesym->name;
                                }
                            }
-                         if (sectinfo -> sections[index] != 0)
+                         if (sectinfo->sections[index] != 0)
                            {
                              complain (&section_info_dup_complaint,
-                                       sectinfo -> filename);
+                                       sectinfo->filename);
                            }
                          /* Bfd symbols are section relative. */
-                         symaddr = sym -> value + sym -> section -> vma;
+                         symaddr = sym->value + sym->section->vma;
                          /* Relocate non-absolute symbols by base address.  */
-                         if (sym -> section != &bfd_abs_section)
+                         if (sym->section != &bfd_abs_section)
                            {
                              symaddr += addr;
                            }
-                         sectinfo -> sections[index] = symaddr;
+                         sectinfo->sections[index] = symaddr;
                          /* The special local symbols don't go in the
                             minimal symbol table, so ignore this one. */
                          continue;
                        }
                      /* Not a special stabs-in-elf symbol, do regular
-                        symbol processing. */
-                     if (sym -> section -> flags & SEC_LOAD)
+                        symbol processing. */
+                     if (sym->section->flags & SEC_LOAD)
                        {
                          ms_type = mst_file_data;
                        }
@@ -529,19 +531,19 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
                     hob with actions like finding what function the PC
                     is in.  Ignore them if they aren't text, data, or bss.  */
                  /* ms_type = mst_unknown; */
-                 continue;             /* Skip this symbol. */
+                 continue;     /* Skip this symbol. */
                }
              /* Pass symbol size field in via BFD.  FIXME!!!  */
-             size = ((elf_symbol_type *) sym) -> internal_elf_sym.st_size;
+             size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
              msym = record_minimal_symbol_and_info
-               ((char *) sym -> name, symaddr,
-                ms_type, (PTR) size, sym -> section, objfile);
+               ((char *) sym->name, symaddr,
+                ms_type, (PTR) size, sym->section, objfile);
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
              if (msym != NULL)
                msym->filename = filesymname;
 #endif
 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
-             ELF_MAKE_MSYMBOL_SPECIAL(sym,msym);
+             ELF_MAKE_MSYMBOL_SPECIAL (sym, msym);
 #endif
            }
        }
@@ -599,7 +601,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
 
   /* Allocate struct to keep track of the symfile */
   objfile->sym_stab_info = (struct dbx_symfile_info *)
-    xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
+    xmmalloc (objfile->md, sizeof (struct dbx_symfile_info));
   memset ((char *) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
   make_cleanup (free_elfinfo, (PTR) objfile);
 
@@ -628,7 +630,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
     }
 
   /* We first have to find them... */
-  bfd_map_over_sections (abfd, elf_locate_sections, (PTR) &ei);
+  bfd_map_over_sections (abfd, elf_locate_sections, (PTR) & ei);
 
   /* ELF debugging information is inserted into the psymtab in the
      order of least informative first - most informative last.  Since
@@ -647,7 +649,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
       const struct ecoff_debug_swap *swap;
 
       /* .mdebug section, presumably holding ECOFF debugging
-        information.  */
+         information.  */
       swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
       if (swap)
        elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect,
@@ -658,7 +660,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
       asection *str_sect;
 
       /* Stab sections have an associated string table that looks like
-        a separate section.  */
+         a separate section.  */
       str_sect = bfd_get_section_by_name (abfd, ".stabstr");
 
       /* FIXME should probably warn about a stab section without a stabstr.  */
@@ -700,7 +702,7 @@ static void
 free_elfinfo (objp)
      PTR objp;
 {
-  struct objfile *objfile = (struct objfile *)objp;
+  struct objfile *objfile = (struct objfile *) objp;
   struct dbx_symfile_info *dbxinfo = objfile->sym_stab_info;
   struct stab_section_info *ssi, *nssi;
 
@@ -739,9 +741,9 @@ static void
 elf_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (objfile -> sym_stab_info != NULL)
+  if (objfile->sym_stab_info != NULL)
     {
-      mfree (objfile -> md, objfile -> sym_stab_info);
+      mfree (objfile->md, objfile->sym_stab_info);
     }
 }
 
@@ -787,7 +789,7 @@ elfstab_offset_sections (objfile, pst)
   /* The ELF symbol info doesn't include path names, so strip the path
      (if any) from the psymtab filename.  */
   while (0 != (p = strchr (filename, '/')))
-    filename = p+1;
+    filename = p + 1;
 
   /* FIXME:  This linear search could speed up significantly
      if it was chained in the right order to match how we search it,
@@ -801,7 +803,7 @@ elfstab_offset_sections (objfile, pst)
             (from different directories) with the same name.  */
          if (0 == maybe->found)
            break;
-         questionable = maybe;         /* Might use it later.  */
+         questionable = maybe; /* Might use it later.  */
        }
     }
 
@@ -816,9 +818,9 @@ elfstab_offset_sections (objfile, pst)
       /* Found it!  Allocate a new psymtab struct, and fill it in.  */
       maybe->found++;
       pst->section_offsets = (struct section_offsets *)
-       obstack_alloc (&objfile -> psymbol_obstack,
+       obstack_alloc (&objfile->psymbol_obstack,
                       sizeof (struct section_offsets) +
-              sizeof (pst->section_offsets->offsets) * (SECT_OFF_MAX-1));
+              sizeof (pst->section_offsets->offsets) * (SECT_OFF_MAX - 1));
 
       for (i = 0; i < SECT_OFF_MAX; i++)
        ANOFFSET (pst->section_offsets, i) = maybe->sections[i];
@@ -826,7 +828,7 @@ elfstab_offset_sections (objfile, pst)
     }
 
   /* We were unable to find any offsets for this file.  Complain.  */
-  if (dbx->stab_section_info)          /* If there *is* any info, */
+  if (dbx->stab_section_info)  /* If there *is* any info, */
     complain (&stab_info_mismatch_complaint, filename);
 }
 \f
@@ -835,13 +837,13 @@ elfstab_offset_sections (objfile, pst)
 static struct sym_fns elf_sym_fns =
 {
   bfd_target_elf_flavour,
-  elf_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  elf_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  elf_symfile_read,    /* sym_read: read a symbol file into symtab */
-  elf_symfile_finish,  /* sym_finish: finished with file, cleanup */
+  elf_new_init,                        /* sym_new_init: init anything gbl to entire symtab */
+  elf_symfile_init,            /* sym_init: read initial info, setup for sym_read() */
+  elf_symfile_read,            /* sym_read: read a symbol file into symtab */
+  elf_symfile_finish,          /* sym_finish: finished with file, cleanup */
   default_symfile_offsets,
                        /* sym_offsets:  Translate ext. to int. relocation */
-  NULL                 /* next: pointer to next struct sym_fns */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
index 77296bef2a41d0a949106df58b78dc69a440f99b..c4a5adc375489dcc8a6030c7fed8bd95050c32ec 100644 (file)
@@ -1,19 +1,20 @@
 /* environ.c -- library for manipulating environments for GNU.
    Copyright (C) 1986, 1989 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #define max(a, b) ((a) > (b) ? (a) : (b))
@@ -22,8 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "environ.h"
 #include "gdb_string.h"
 #include "gdbcore.h"
-
 \f
+
 /* Return a new environment object.  */
 
 struct environ *
@@ -67,12 +68,12 @@ init_environ (e)
   if (environ == NULL)
     return;
 
-  for (i = 0; environ[i]; i++) /*EMPTY*/;
+  for (i = 0; environ[i]; i++) /*EMPTY */ ;
 
   if (e->allocated < i)
     {
       e->allocated = max (i, e->allocated + 10);
-      e->vector = (char **) xrealloc ((char *)e->vector,
+      e->vector = (char **) xrealloc ((char *) e->vector,
                                      (e->allocated + 1) * sizeof (char *));
     }
 
@@ -137,7 +138,7 @@ set_in_environ (e, var, value)
       if (i == e->allocated)
        {
          e->allocated += 10;
-         vector = (char **) xrealloc ((char *)vector,
+         vector = (char **) xrealloc ((char *) vector,
                                       (e->allocated + 1) * sizeof (char *));
          e->vector = vector;
        }
index 87a538a1b47b07ff7b6f5e96fb6c3624c2edf62c..0a6e848082a11e8d71d53838126dca2cafc6ab78 100644 (file)
@@ -1,19 +1,20 @@
 /* Header for environment manipulation library.
    Copyright 1989, 1992 Free Software Foundation.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (ENVIRON_H)
 #define ENVIRON_H 1
@@ -21,20 +22,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* We manipulate environments represented as these structures.  */
 
 struct environ
-{
-  /* Number of usable slots allocated in VECTOR.
-     VECTOR always has one slot not counted here,
-     to hold the terminating zero.  */
-  int allocated;
-  /* A vector of slots, ALLOCATED + 1 of them.
-     The first few slots contain strings "VAR=VALUE"
-     and the next one contains zero.
-     Then come some unused slots.  */
-  char **vector;
-};
+  {
+    /* Number of usable slots allocated in VECTOR.
+       VECTOR always has one slot not counted here,
+       to hold the terminating zero.  */
+    int allocated;
+    /* A vector of slots, ALLOCATED + 1 of them.
+       The first few slots contain strings "VAR=VALUE"
+       and the next one contains zero.
+       Then come some unused slots.  */
+    char **vector;
+  };
 
 extern struct environ *
-make_environ PARAMS ((void));
+  make_environ PARAMS ((void));
 
 extern void
 free_environ PARAMS ((struct environ *));
@@ -43,7 +44,7 @@ extern void
 init_environ PARAMS ((struct environ *));
 
 extern char *
-get_in_environ PARAMS ((const struct environ *, const char *));
+  get_in_environ PARAMS ((const struct environ *, const char *));
 
 extern void
 set_in_environ PARAMS ((struct environ *, const char *,
@@ -53,6 +54,6 @@ extern void
 unset_in_environ PARAMS ((struct environ *, char *));
 
 extern char **
-environ_vector PARAMS ((struct environ *));
+  environ_vector PARAMS ((struct environ *));
 
-#endif /* defined (ENVIRON_H) */
+#endif /* defined (ENVIRON_H) */
index a6b655fedebab09acd8e5dab00da82a9bacad311..3d8796228d2e76b2e5d7e4309792848238a8c37f 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -27,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "frame.h"
 #include "demangle.h"
-#include "language.h"  /* For CAST_IS_CONVERSION */
-#include "f-lang.h"    /* for array bound stuff */
+#include "language.h"          /* For CAST_IS_CONVERSION */
+#include "f-lang.h"            /* for array bound stuff */
 
-/* Defined in symtab.c */ 
+/* Defined in symtab.c */
 extern int hp_som_som_object_present;
 
-/* This is defined in valops.c */ 
+/* This is defined in valops.c */
 extern int overload_resolution;
 
 
@@ -51,12 +52,12 @@ static value_ptr evaluate_subexp PARAMS ((struct type *, struct expression *,
 static char *get_label PARAMS ((struct expression *, int *));
 
 static value_ptr
-evaluate_struct_tuple PARAMS ((value_ptr, struct expression *, int *,
-                              enum noside, int));
+  evaluate_struct_tuple PARAMS ((value_ptr, struct expression *, int *,
+                                enum noside, int));
 
 static LONGEST
-init_array_element PARAMS ((value_ptr, value_ptr, struct expression *,
-                           int *, enum noside, LONGEST, LONGEST));
+  init_array_element PARAMS ((value_ptr, value_ptr, struct expression *,
+                             int *, enum noside, LONGEST, LONGEST));
 
 #ifdef __GNUC__
 inline
@@ -80,8 +81,8 @@ parse_and_eval_address (exp)
 {
   struct expression *expr = parse_expression (exp);
   register CORE_ADDR addr;
-  register struct cleanup *old_chain = 
-      make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+  register struct cleanup *old_chain =
+  make_cleanup ((make_cleanup_func) free_current_contents, &expr);
 
   addr = value_as_pointer (evaluate_expression (expr));
   do_cleanups (old_chain);
@@ -95,10 +96,10 @@ CORE_ADDR
 parse_and_eval_address_1 (expptr)
      char **expptr;
 {
-  struct expression *expr = parse_exp_1 (expptr, (struct block *)0, 0);
+  struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0);
   register CORE_ADDR addr;
   register struct cleanup *old_chain =
-      make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+  make_cleanup ((make_cleanup_func) free_current_contents, &expr);
 
   addr = value_as_pointer (evaluate_expression (expr));
   do_cleanups (old_chain);
@@ -112,7 +113,7 @@ parse_and_eval (exp)
   struct expression *expr = parse_expression (exp);
   register value_ptr val;
   register struct cleanup *old_chain
-    = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+  = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
 
   val = evaluate_expression (expr);
   do_cleanups (old_chain);
@@ -130,7 +131,7 @@ parse_to_comma_and_eval (expp)
   struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
   register value_ptr val;
   register struct cleanup *old_chain
-    = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+  = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
 
   val = evaluate_expression (expr);
   do_cleanups (old_chain);
@@ -164,7 +165,7 @@ evaluate_type (exp)
 /* If the next expression is an OP_LABELED, skips past it,
    returning the label.  Otherwise, does nothing and returns NULL. */
 
-static char*
+static char *
 get_label (exp, pos)
      register struct expression *exp;
      int *pos;
@@ -198,14 +199,14 @@ evaluate_struct_tuple (struct_val, exp, pos, noside, nargs)
   int fieldno = -1;
   int variantno = -1;
   int subfieldno = -1;
-   while (--nargs >= 0)
+  while (--nargs >= 0)
     {
       int pc = *pos;
       value_ptr val = NULL;
       int nlabels = 0;
       int bitpos, bitsize;
       char *addr;
-      
+
       /* Skip past the labels, and count them. */
       while (get_label (exp, pos) != NULL)
        nlabels++;
@@ -242,9 +243,9 @@ evaluate_struct_tuple (struct_val, exp, pos, noside, nargs)
                          substruct_type
                            = TYPE_FIELD_TYPE (field_type, variantno);
                          if (TYPE_CODE (substruct_type) == TYPE_CODE_STRUCT)
-                           { 
+                           {
                              for (subfieldno = 0;
-                                  subfieldno < TYPE_NFIELDS (substruct_type);
+                                subfieldno < TYPE_NFIELDS (substruct_type);
                                   subfieldno++)
                                {
                                  if (STREQ (TYPE_FIELD_NAME (substruct_type,
@@ -317,7 +318,8 @@ evaluate_struct_tuple (struct_val, exp, pos, noside, nargs)
          else
            memcpy (addr, VALUE_CONTENTS (val),
                    TYPE_LENGTH (VALUE_TYPE (val)));
-       } while (--nlabels > 0);
+       }
+      while (--nlabels > 0);
     }
   return struct_val;
 }
@@ -356,7 +358,7 @@ init_array_element (array, element, exp, pos, noside, low_bound, high_bound)
       high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
       if (low < low_bound || high > high_bound)
        error ("tuple range index out of range");
-      for (index = low ; index <= high; index++)
+      for (index = low; index <= high; index++)
        {
          memcpy (VALUE_CONTENTS_RAW (array)
                  + (index - low_bound) * element_size,
@@ -388,12 +390,12 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
   struct type *type;
   int nargs;
   value_ptr *argvec;
-  int upper, lower, retcode; 
+  int upper, lower, retcode;
   int code;
   int ix;
   long mem_offset;
-  struct symbol * sym;
-  struct type ** arg_types;
+  struct symbol *sym;
+  struct type **arg_types;
   int save_pos1;
 
   pc = (*pos)++;
@@ -429,7 +431,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
        goto nosideret;
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
        {
-         struct symbol * sym = exp->elts[pc + 2].symbol;
+         struct symbol *sym = exp->elts[pc + 2].symbol;
          enum lval_type lv;
 
          switch (SYMBOL_CLASS (sym))
@@ -463,7 +465,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
 
     case OP_REGISTER:
       {
-       int regno     = longest_to_int (exp->elts[pc + 1].longconst);
+       int regno = longest_to_int (exp->elts[pc + 1].longconst);
        value_ptr val = value_of_register (regno);
 
        (*pos) += 2;
@@ -475,7 +477,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
     case OP_BOOL:
       (*pos) += 2;
       return value_from_longest (LA_BOOL_TYPE,
-                                  exp->elts[pc + 1].longconst);
+                                exp->elts[pc + 1].longconst);
 
     case OP_INTERNALVAR:
       (*pos) += 2;
@@ -527,7 +529,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
            }
          index = low_bound;
          memset (VALUE_CONTENTS_RAW (array), 0, TYPE_LENGTH (expect_type));
-         for (tem = nargs;  --nargs >= 0;  )
+         for (tem = nargs; --nargs >= 0;)
            {
              value_ptr element;
              int index_pc = 0;
@@ -601,8 +603,8 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
                  range_low = range_high = value_as_long (elem_val);
                }
              /* check types of elements to avoid mixture of elements from
-                different types. Also check if type of element is "compatible"
-                with element type of powerset */
+                different types. Also check if type of element is "compatible"
+                with element type of powerset */
              if (TYPE_CODE (range_low_type) == TYPE_CODE_RANGE)
                range_low_type = TYPE_TARGET_TYPE (range_low_type);
              if (TYPE_CODE (range_high_type) == TYPE_CODE_RANGE)
@@ -625,12 +627,12 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
                error ("POWERSET tuple element out of range");
              range_low -= low_bound;
              range_high -= low_bound;
-             for ( ; range_low <= range_high; range_low++)
+             for (; range_low <= range_high; range_low++)
                {
                  int bit_index = (unsigned) range_low % TARGET_CHAR_BIT;
                  if (BITS_BIG_ENDIAN)
                    bit_index = TARGET_CHAR_BIT - 1 - bit_index;
-                 valaddr [(unsigned) range_low / TARGET_CHAR_BIT]
+                 valaddr[(unsigned) range_low / TARGET_CHAR_BIT]
                    |= 1 << bit_index;
                }
            }
@@ -651,9 +653,9 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       {
        value_ptr array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
        int lowbound
-         = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+       = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
        int upper
-         = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+       = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
        if (noside == EVAL_SKIP)
          goto nosideret;
        return value_slice (array, lowbound, upper - lowbound + 1);
@@ -663,9 +665,9 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       {
        value_ptr array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
        int lowbound
-         = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+       = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
        int length
-         = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+       = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
        return value_slice (array, lowbound, length);
       }
 
@@ -689,19 +691,19 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       op = exp->elts[*pos].opcode;
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
       /* 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 */
       argvec = (value_ptr *) alloca (sizeof (value_ptr) * (nargs + 3));
       if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
        {
          LONGEST fnptr;
 
-          /* 1997-08-01 Currently we do not support function invocation
-             via pointers-to-methods with HP aCC. Pointer does not point
-             to the function, but possibly to some thunk. */
-          if (hp_som_som_object_present)
-            {
-              error ("Not implemented: function invocation through pointer to method with HP aCC");
-            }
+         /* 1997-08-01 Currently we do not support function invocation
+            via pointers-to-methods with HP aCC. Pointer does not point
+            to the function, but possibly to some thunk. */
+         if (hp_som_som_object_present)
+           {
+             error ("Not implemented: function invocation through pointer to method with HP aCC");
+           }
 
          nargs++;
          /* First, evaluate the structure into arg2 */
@@ -729,16 +731,16 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
 
          fnptr = value_as_long (arg1);
 
-         if (METHOD_PTR_IS_VIRTUAL(fnptr))
+         if (METHOD_PTR_IS_VIRTUAL (fnptr))
            {
-             int fnoffset = METHOD_PTR_TO_VOFFSET(fnptr);
+             int fnoffset = METHOD_PTR_TO_VOFFSET (fnptr);
              struct type *basetype;
              struct type *domain_type =
-                 TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)));
+             TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)));
              int i, j;
              basetype = TYPE_TARGET_TYPE (VALUE_TYPE (arg2));
              if (domain_type != basetype)
-                 arg2 = value_cast(lookup_pointer_type (domain_type), arg2);
+               arg2 = value_cast (lookup_pointer_type (domain_type), arg2);
              basetype = TYPE_VPTR_BASETYPE (domain_type);
              for (i = TYPE_NFN_FIELDS (basetype) - 1; i >= 0; i--)
                {
@@ -782,19 +784,19 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
          if (op == STRUCTOP_STRUCT)
            {
              /* If v is a variable in a register, and the user types
-                v.method (), this will produce an error, because v has
-                no address.
-
-                A possible way around this would be to allocate a
-                copy of the variable on the stack, copy in the
-                contents, call the function, and copy out the
-                contents.  I.e. convert this from call by reference
-                to call by copy-return (or whatever it's called).
-                However, this does not work because it is not the
-                same: the method being called could stash a copy of
-                the address, and then future uses through that address
-                (after the method returns) would be expected to
-                use the variable itself, not some copy of it.  */
+                v.method (), this will produce an error, because v has
+                no address.
+
+                A possible way around this would be to allocate a
+                copy of the variable on the stack, copy in the
+                contents, call the function, and copy out the
+                contents.  I.e. convert this from call by reference
+                to call by copy-return (or whatever it's called).
+                However, this does not work because it is not the
+                same: the method being called could stash a copy of
+                the address, and then future uses through that address
+                (after the method returns) would be expected to
+                use the variable itself, not some copy of it.  */
              arg2 = evaluate_subexp_for_address (exp, pos, noside);
            }
          else
@@ -817,9 +819,9 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
            {
              for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
                {
-                  /* pai: FIXME This seems to be coercing arguments before
-                   * overload resolution has been done! */
-                 argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem-1),
+                 /* pai: FIXME This seems to be coercing arguments before
+                  * overload resolution has been done! */
+                 argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1),
                                                 exp, pos, noside);
                }
            }
@@ -840,47 +842,48 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
          int static_memfuncp;
          value_ptr temp = arg2;
          char tstr[256];
-          struct fn_field * fns_ptr;
-          int num_fns;
-          struct type * basetype;
-          int boffset;
-
-          /* Method invocation : stuff "this" as first parameter */
-          /* pai: this used to have lookup_pointer_type for some reason,
-           * but temp is already a pointer to the object */
+         struct fn_field *fns_ptr;
+         int num_fns;
+         struct type *basetype;
+         int boffset;
+
+         /* Method invocation : stuff "this" as first parameter */
+         /* pai: this used to have lookup_pointer_type for some reason,
+          * but temp is already a pointer to the object */
          argvec[1] = value_from_longest (VALUE_TYPE (temp),
-                                          VALUE_ADDRESS (temp)+VALUE_OFFSET (temp));
-          /* Name of method from expression */ 
-          strcpy(tstr, &exp->elts[pc2+2].string);
-          
-          if (overload_resolution && (exp->language_defn->la_language == language_cplus))
-            {
-              /* Language is C++, do some overload resolution before evaluation */
-              value_ptr valp = NULL;
-              
-              /* Prepare list of argument types for overload resolution */ 
-              arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
-              for (ix=1; ix <= nargs; ix++)
-                arg_types[ix-1] = VALUE_TYPE (argvec[ix]);
-
-              (void) find_overload_match (arg_types, nargs, tstr,
-                                          1 /* method */, 0 /* strict match */,
-                                          arg2 /* the object */, NULL,
-                                          &valp, NULL, &static_memfuncp);
-
-
-              argvec[1] = arg2;  /* the ``this'' pointer */
-              argvec[0] = valp;  /* use the method found after overload resolution */ 
-            }
-          else /* Non-C++ case -- or no overload resolution */ 
-            {
-              temp = arg2;
-              argvec[0] = value_struct_elt (&temp, argvec+1, tstr,
-                                            &static_memfuncp,
-                                            op == STRUCTOP_STRUCT
-                                            ? "structure" : "structure pointer");
-              argvec[1] = arg2; /* the ``this'' pointer */
-            }
+                               VALUE_ADDRESS (temp) + VALUE_OFFSET (temp));
+         /* Name of method from expression */
+         strcpy (tstr, &exp->elts[pc2 + 2].string);
+
+         if (overload_resolution && (exp->language_defn->la_language == language_cplus))
+           {
+             /* Language is C++, do some overload resolution before evaluation */
+             value_ptr valp = NULL;
+
+             /* Prepare list of argument types for overload resolution */
+             arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
+             for (ix = 1; ix <= nargs; ix++)
+               arg_types[ix - 1] = VALUE_TYPE (argvec[ix]);
+
+             (void) find_overload_match (arg_types, nargs, tstr,
+                                    1 /* method */ , 0 /* strict match */ ,
+                                         arg2 /* the object */ , NULL,
+                                         &valp, NULL, &static_memfuncp);
+
+
+             argvec[1] = arg2; /* the ``this'' pointer */
+             argvec[0] = valp; /* use the method found after overload resolution */
+           }
+         else
+           /* Non-C++ case -- or no overload resolution */
+           {
+             temp = arg2;
+             argvec[0] = value_struct_elt (&temp, argvec + 1, tstr,
+                                           &static_memfuncp,
+                                           op == STRUCTOP_STRUCT
+                                      ? "structure" : "structure pointer");
+             argvec[1] = arg2; /* the ``this'' pointer */
+           }
 
          if (static_memfuncp)
            {
@@ -895,34 +898,34 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
          argvec[0] = arg1;
        }
       else
-        { 
+       {
          /* Non-member function being called */
 
-          if (overload_resolution && (exp->language_defn->la_language == language_cplus))
-            {
-              /* Language is C++, do some overload resolution before evaluation */
-             struct symbol * symp;
-
-              /* Prepare list of argument types for overload resolution */ 
-              arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
-              for (ix=1; ix <= nargs; ix++)
-                arg_types[ix-1] = VALUE_TYPE (argvec[ix]);
-
-              (void) find_overload_match (arg_types, nargs, NULL /* no need for name */,
-                                          0 /* not method */, 0 /* strict match */,
-                                          NULL, exp->elts[5].symbol /* the function */,
-                                          NULL, &symp, NULL);
-              
-              /* Now fix the expression being evaluated */ 
-              exp->elts[5].symbol = symp;
-              argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1, noside);
-            } 
-          else
-            {
-              /* Not C++, or no overload resolution allowed */ 
-              /* nothing to be done; argvec already correctly set up */ 
-            }
-        }
+         if (overload_resolution && (exp->language_defn->la_language == language_cplus))
+           {
+             /* Language is C++, do some overload resolution before evaluation */
+             struct symbol *symp;
+
+             /* Prepare list of argument types for overload resolution */
+             arg_types = (struct type **) xmalloc (nargs * (sizeof (struct type *)));
+             for (ix = 1; ix <= nargs; ix++)
+               arg_types[ix - 1] = VALUE_TYPE (argvec[ix]);
+
+             (void) find_overload_match (arg_types, nargs, NULL /* no need for name */ ,
+                                0 /* not method */ , 0 /* strict match */ ,
+                             NULL, exp->elts[5].symbol /* the function */ ,
+                                         NULL, &symp, NULL);
+
+             /* Now fix the expression being evaluated */
+             exp->elts[5].symbol = symp;
+             argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1, noside);
+           }
+         else
+           {
+             /* Not C++, or no overload resolution allowed */
+             /* nothing to be done; argvec already correctly set up */
+           }
+       }
 
     do_call_it:
 
@@ -938,7 +941,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
             it won't offer it. */
 
          struct type *ftype =
-           TYPE_TARGET_TYPE (VALUE_TYPE (argvec[0]));
+         TYPE_TARGET_TYPE (VALUE_TYPE (argvec[0]));
 
          if (ftype)
            return allocate_value (TYPE_TARGET_TYPE (VALUE_TYPE (argvec[0])));
@@ -946,28 +949,28 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
            error ("Expression of type other than \"Function returning ...\" used as function");
        }
       if (argvec[0] == NULL)
-        error ("Cannot evaluate function -- may be inlined");
+       error ("Cannot evaluate function -- may be inlined");
       return call_function_by_hand (argvec[0], nargs, argvec + 1);
       /* pai: FIXME save value from call_function_by_hand, then adjust pc by adjust_fn_pc if +ve  */
 
-    case OP_F77_UNDETERMINED_ARGLIST: 
+    case OP_F77_UNDETERMINED_ARGLIST:
 
       /* Remember that in F77, functions, substring ops and 
          array subscript operations cannot be disambiguated 
          at parse time.  We have made all array subscript operations, 
          substring operations as well as function calls  come here 
          and we now have to discover what the heck this thing actually was.  
-        If it is a function, we process just as if we got an OP_FUNCALL. */
+         If it is a function, we process just as if we got an OP_FUNCALL. */
 
-      nargs = longest_to_int (exp->elts[pc+1].longconst);
+      nargs = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 2;
 
-      /* First determine the type code we are dealing with.  */ 
+      /* First determine the type code we are dealing with.  */
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       type = check_typedef (VALUE_TYPE (arg1));
       code = TYPE_CODE (type);
 
-      switch (code) 
+      switch (code)
        {
        case TYPE_CODE_ARRAY:
          goto multi_f77_subscript;
@@ -985,11 +988,11 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
          tem = 1;
          for (; tem <= nargs; tem++)
            argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
-         argvec[tem] = 0; /* signal end of arglist */
+         argvec[tem] = 0;      /* signal end of arglist */
          goto do_call_it;
 
        default:
-              error ("Cannot perform substring on this type"); 
+         error ("Cannot perform substring on this type");
        }
 
     op_f77_substr:
@@ -1006,18 +1009,18 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       arg3 = evaluate_subexp_with_coercion (exp, pos, noside);
 
       if (noside == EVAL_SKIP)
-        goto nosideret;
-      
+       goto nosideret;
+
       tem2 = value_as_long (arg2);
       tem3 = value_as_long (arg3);
-      
+
       return value_slice (arg1, tem2, tem3 - tem2 + 1);
 
     case OP_COMPLEX:
       /* We have a complex number, There should be 2 floating 
-        point numbers that compose it */ 
+         point numbers that compose it */
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); 
+      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
       return value_literal_complex (arg1, arg2, builtin_type_f_complex_s16);
 
@@ -1061,12 +1064,12 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       arg1 = evaluate_subexp_for_address (exp, pos, noside);
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
-      /* With HP aCC, pointers to methods do not point to the function code */ 
+      /* With HP aCC, pointers to methods do not point to the function code */
       if (hp_som_som_object_present &&
-          (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
-          (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
-        error ("Pointers to methods not supported with HP aCC"); /* 1997-08-19 */
-        
+         (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
+      (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
+       error ("Pointers to methods not supported with HP aCC");        /* 1997-08-19 */
+
       mem_offset = value_as_long (arg2);
       goto handle_pointer_to_member;
 
@@ -1074,23 +1077,23 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
-      /* With HP aCC, pointers to methods do not point to the function code */ 
+      /* With HP aCC, pointers to methods do not point to the function code */
       if (hp_som_som_object_present &&
-          (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
-          (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
-        error ("Pointers to methods not supported with HP aCC"); /* 1997-08-19 */
+         (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
+      (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
+       error ("Pointers to methods not supported with HP aCC");        /* 1997-08-19 */
 
       mem_offset = value_as_long (arg2);
 
-handle_pointer_to_member:
+    handle_pointer_to_member:
       /* HP aCC generates offsets that have bit #29 set; turn it off to get
          a real offset to the member. */
       if (hp_som_som_object_present)
-        {
-          if (!mem_offset) /* no bias -> really null */ 
-            error ("Attempted dereference of null pointer-to-member");
-          mem_offset &= ~0x20000000;
-        }
+       {
+         if (!mem_offset)      /* no bias -> really null */
+           error ("Attempted dereference of null pointer-to-member");
+         mem_offset &= ~0x20000000;
+       }
       if (noside == EVAL_SKIP)
        goto nosideret;
       type = check_typedef (VALUE_TYPE (arg2));
@@ -1107,8 +1110,8 @@ handle_pointer_to_member:
       arg3 = value_from_longest (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
                                 value_as_long (arg1) + mem_offset);
       return value_ind (arg3);
-bad_pointer_to_member:
-      error("non-pointer-to-member value used in pointer-to-member construct");
+    bad_pointer_to_member:
+      error ("non-pointer-to-member value used in pointer-to-member construct");
 
     case BINOP_CONCAT:
       arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
@@ -1124,26 +1127,26 @@ bad_pointer_to_member:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
 
-      /* Do special stuff for HP aCC pointers to members */ 
+      /* Do special stuff for HP aCC pointers to members */
       if (hp_som_som_object_present)
-        {
-          /* 1997-08-19 Can't assign HP aCC pointers to methods. No details of
-             the implementation yet; but the pointer appears to point to a code
-             sequence (thunk) in memory -- in any case it is *not* the address
-             of the function as it would be in a naive implementation. */ 
-          if ((TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR) &&
-              (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_METHOD))
-            error ("Assignment to pointers to methods not implemented with HP aCC");
-
-          /* HP aCC pointers to data members require a constant bias */ 
-          if ((TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR) &&
-              (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_MEMBER))
-              {
-                unsigned int * ptr = (unsigned int *) VALUE_CONTENTS (arg2); /* forces evaluation */ 
-                *ptr |= 0x20000000; /* set 29th bit */
-              }
-        }
-                                                    
+       {
+         /* 1997-08-19 Can't assign HP aCC pointers to methods. No details of
+            the implementation yet; but the pointer appears to point to a code
+            sequence (thunk) in memory -- in any case it is *not* the address
+            of the function as it would be in a naive implementation. */
+         if ((TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR) &&
+             (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_METHOD))
+           error ("Assignment to pointers to methods not implemented with HP aCC");
+
+         /* HP aCC pointers to data members require a constant bias */
+         if ((TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR) &&
+             (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_MEMBER))
+           {
+             unsigned int *ptr = (unsigned int *) VALUE_CONTENTS (arg2);       /* forces evaluation */
+             *ptr |= 0x20000000;       /* set 29th bit */
+           }
+       }
+
       if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
        return arg1;
       if (binop_user_defined_p (op, arg1, arg2))
@@ -1203,10 +1206,9 @@ bad_pointer_to_member:
        goto nosideret;
       if (binop_user_defined_p (op, arg1, arg2))
        return value_x_binop (arg1, arg2, op, OP_NULL, 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);
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS
+              && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
+       return value_zero (VALUE_TYPE (arg1), not_lval);
       else
        return value_binop (arg1, arg2, op);
 
@@ -1225,7 +1227,7 @@ bad_pointer_to_member:
       if (binop_user_defined_p (op, arg1, arg2))
        return value_x_binop (arg1, arg2, op, OP_NULL, noside);
       else
-        {
+       {
          /* If the user attempts to subscript something that is not an
             array or pointer type (like a plain int variable for example),
             then report this as an error. */
@@ -1246,7 +1248,7 @@ bad_pointer_to_member:
            return value_zero (TYPE_TARGET_TYPE (type), VALUE_LVAL (arg1));
          else
            return value_subscript (arg1, arg2);
-        }
+       }
 
     case BINOP_IN:
       arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
@@ -1254,7 +1256,7 @@ bad_pointer_to_member:
       if (noside == EVAL_SKIP)
        goto nosideret;
       return value_in (arg1, arg2);
-      
+
     case MULTI_SUBSCRIPT:
       (*pos) += 2;
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
@@ -1278,9 +1280,9 @@ bad_pointer_to_member:
          if (noside == EVAL_AVOID_SIDE_EFFECTS)
            {
              /* If the user attempts to subscript something that has no target
-                type (like a plain int variable for example), then report this
-                as an error. */
-             
+                type (like a plain int variable for example), then report this
+                as an error. */
+
              type = TYPE_TARGET_TYPE (check_typedef (VALUE_TYPE (arg1)));
              if (type != NULL)
                {
@@ -1294,7 +1296,7 @@ bad_pointer_to_member:
                         TYPE_NAME (VALUE_TYPE (arg1)));
                }
            }
-         
+
          if (binop_user_defined_p (op, arg1, arg2))
            {
              arg1 = value_x_binop (arg1, arg2, op, OP_NULL, noside);
@@ -1307,13 +1309,13 @@ bad_pointer_to_member:
       return (arg1);
 
     multi_f77_subscript:
-      { 
-       int subscript_array[MAX_FORTRAN_DIMS+1]; /* 1-based array of 
-                                                   subscripts, max == 7 */
-       int array_size_array[MAX_FORTRAN_DIMS+1];
-       int ndimensions=1,i;
-       struct type *tmp_type; 
-       int offset_item;   /* The array offset where the item lives */ 
+      {
+       int subscript_array[MAX_FORTRAN_DIMS + 1];      /* 1-based array of 
+                                                          subscripts, max == 7 */
+       int array_size_array[MAX_FORTRAN_DIMS + 1];
+       int ndimensions = 1, i;
+       struct type *tmp_type;
+       int offset_item;        /* The array offset where the item lives */
 
        if (nargs > MAX_FORTRAN_DIMS)
          error ("Too many subscripts for F77 (%d Max)", MAX_FORTRAN_DIMS);
@@ -1325,30 +1327,30 @@ bad_pointer_to_member:
          error ("Wrong number of subscripts");
 
        /* Now that we know we have a legal array subscript expression 
-          let us actually find out where this element exists in the array. */ 
+          let us actually find out where this element exists in the array. */
 
-       offset_item = 0; 
+       offset_item = 0;
        for (i = 1; i <= nargs; i++)
          {
-           /* Evaluate each subscript, It must be a legal integer in F77 */ 
+           /* Evaluate each subscript, It must be a legal integer in F77 */
            arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
 
-           /* Fill in the subscript and array size arrays */ 
+           /* Fill in the subscript and array size arrays */
 
            subscript_array[i] = value_as_long (arg2);
-               
+
            retcode = f77_get_dynamic_upperbound (tmp_type, &upper);
            if (retcode == BOUND_FETCH_ERROR)
-             error ("Cannot obtain dynamic upper bound"); 
+             error ("Cannot obtain dynamic upper bound");
 
-           retcode = f77_get_dynamic_lowerbound (tmp_type, &lower); 
+           retcode = f77_get_dynamic_lowerbound (tmp_type, &lower);
            if (retcode == BOUND_FETCH_ERROR)
-             error("Cannot obtain dynamic lower bound"); 
+             error ("Cannot obtain dynamic lower bound");
 
            array_size_array[i] = upper - lower + 1;
-               
-           /* Zero-normalize subscripts so that offsetting will work. */ 
-               
+
+           /* Zero-normalize subscripts so that offsetting will work. */
+
            subscript_array[i] -= lower;
 
            /* If we are at the bottom of a multidimensional 
@@ -1357,23 +1359,23 @@ bad_pointer_to_member:
               below. This is done because we pretend to value_subscript
               that we actually have a one-dimensional array 
               of base element type that we apply a simple 
-              offset to. */ 
+              offset to. */
 
-           if (i < nargs) 
-             tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); 
+           if (i < nargs)
+             tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type));
          }
 
        /* Now let us calculate the offset for this item */
 
-       offset_item = subscript_array[ndimensions]; 
-         
+       offset_item = subscript_array[ndimensions];
+
        for (i = ndimensions - 1; i >= 1; i--)
-         offset_item = 
+         offset_item =
            array_size_array[i] * offset_item + subscript_array[i];
 
        /* Construct a value node with the value of the offset */
 
-       arg2 = value_from_longest (builtin_type_f_integer, offset_item); 
+       arg2 = value_from_longest (builtin_type_f_integer, offset_item);
 
        /* Let us now play a dirty trick: we will take arg1 
           which is a value node pointing to the topmost level
@@ -1382,7 +1384,7 @@ bad_pointer_to_member:
           type, this will ensure that value_subscript()
           returns the correct type value */
 
-       VALUE_TYPE (arg1) = tmp_type; 
+       VALUE_TYPE (arg1) = tmp_type;
        return value_ind (value_add (value_coerce_array (arg1), arg2));
       }
 
@@ -1393,12 +1395,12 @@ bad_pointer_to_member:
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
          goto nosideret;
        }
-      
+
       oldpos = *pos;
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
       *pos = oldpos;
-      
-      if (binop_user_defined_p (op, arg1, arg2)) 
+
+      if (binop_user_defined_p (op, arg1, arg2))
        {
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
          return value_x_binop (arg1, arg2, op, OP_NULL, noside);
@@ -1409,7 +1411,7 @@ bad_pointer_to_member:
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos,
                                  (tem ? EVAL_SKIP : noside));
          return value_from_longest (LA_BOOL_TYPE,
-                                 (LONGEST) (!tem && !value_logical_not (arg2)));
+                            (LONGEST) (!tem && !value_logical_not (arg2)));
        }
 
     case BINOP_LOGICAL_OR:
@@ -1419,12 +1421,12 @@ bad_pointer_to_member:
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
          goto nosideret;
        }
-      
+
       oldpos = *pos;
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
       *pos = oldpos;
-      
-      if (binop_user_defined_p (op, arg1, arg2)) 
+
+      if (binop_user_defined_p (op, arg1, arg2))
        {
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
          return value_x_binop (arg1, arg2, op, OP_NULL, noside);
@@ -1435,7 +1437,7 @@ bad_pointer_to_member:
          arg2 = evaluate_subexp (NULL_TYPE, exp, pos,
                                  (!tem ? EVAL_SKIP : noside));
          return value_from_longest (LA_BOOL_TYPE,
-                                 (LONGEST) (!tem || !value_logical_not (arg2)));
+                            (LONGEST) (!tem || !value_logical_not (arg2)));
        }
 
     case BINOP_EQUAL:
@@ -1522,7 +1524,7 @@ bad_pointer_to_member:
        {
          return value_x_binop (arg1, arg2, op, OP_NULL, noside);
        }
-      else 
+      else
        {
          tem = value_less (arg1, arg2) || value_equal (arg1, arg2);
          return value_from_longest (LA_BOOL_TYPE, (LONGEST) tem);
@@ -1539,7 +1541,7 @@ bad_pointer_to_member:
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
        {
          return allocate_repeat_value (VALUE_TYPE (arg1),
-                                       longest_to_int (value_as_long (arg2)));
+                                    longest_to_int (value_as_long (arg2)));
        }
       else
        return value_repeat (arg1, longest_to_int (value_as_long (arg2)));
@@ -1581,12 +1583,12 @@ bad_pointer_to_member:
 
     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 ((TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) &&
          ((TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_METHOD) ||
           (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_MEMBER)))
-        error ("Attempt to dereference pointer to member without an object");
+       error ("Attempt to dereference pointer to member without an object");
       if (noside == EVAL_SKIP)
        goto nosideret;
       if (unop_user_defined_p (op, arg1))
@@ -1596,9 +1598,9 @@ bad_pointer_to_member:
          type = check_typedef (VALUE_TYPE (arg1));
          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.  */
+         /* In C you can dereference an array to get the 1st elt.  */
              || TYPE_CODE (type) == TYPE_CODE_ARRAY
-             )
+           )
            return value_zero (TYPE_TARGET_TYPE (type),
                               lval_memory);
          else if (TYPE_CODE (type) == TYPE_CODE_INT)
@@ -1611,34 +1613,34 @@ bad_pointer_to_member:
 
     case UNOP_ADDR:
       /* C++: check for and handle pointer to members.  */
-      
+
       op = exp->elts[*pos].opcode;
 
       if (noside == EVAL_SKIP)
        {
          if (op == OP_SCOPE)
            {
-             int temm = longest_to_int (exp->elts[pc+3].longconst);
+             int temm = longest_to_int (exp->elts[pc + 3].longconst);
              (*pos) += 3 + BYTES_TO_EXP_ELEM (temm + 1);
            }
          else
            evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
          goto nosideret;
        }
-      else 
-        {
-          value_ptr retvalp = evaluate_subexp_for_address (exp, pos, noside);
-          /* If HP aCC object, use bias for pointers to members */ 
-          if (hp_som_som_object_present &&
-              (TYPE_CODE (VALUE_TYPE (retvalp)) == TYPE_CODE_PTR) &&
-              (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (retvalp))) == TYPE_CODE_MEMBER))
-            {
-              unsigned int * ptr = (unsigned int *) VALUE_CONTENTS (retvalp); /* forces evaluation */
-              *ptr |= 0x20000000; /* set 29th bit */
-            }
-          return retvalp;
-        }
-      
+      else
+       {
+         value_ptr retvalp = evaluate_subexp_for_address (exp, pos, noside);
+         /* If HP aCC object, use bias for pointers to members */
+         if (hp_som_som_object_present &&
+             (TYPE_CODE (VALUE_TYPE (retvalp)) == TYPE_CODE_PTR) &&
+             (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (retvalp))) == TYPE_CODE_MEMBER))
+           {
+             unsigned int *ptr = (unsigned int *) VALUE_CONTENTS (retvalp);    /* forces evaluation */
+             *ptr |= 0x20000000;       /* set 29th bit */
+           }
+         return retvalp;
+       }
+
     case UNOP_SIZEOF:
       if (noside == EVAL_SKIP)
        {
@@ -1679,8 +1681,8 @@ bad_pointer_to_member:
        }
       else
        {
-         arg2 = value_add (arg1, value_from_longest (builtin_type_char, 
-                                                  (LONGEST) 1));
+         arg2 = value_add (arg1, value_from_longest (builtin_type_char,
+                                                     (LONGEST) 1));
          return value_assign (arg1, arg2);
        }
 
@@ -1694,8 +1696,8 @@ bad_pointer_to_member:
        }
       else
        {
-         arg2 = value_sub (arg1, value_from_longest (builtin_type_char, 
-                                                  (LONGEST) 1));
+         arg2 = value_sub (arg1, value_from_longest (builtin_type_char,
+                                                     (LONGEST) 1));
          return value_assign (arg1, arg2);
        }
 
@@ -1709,8 +1711,8 @@ bad_pointer_to_member:
        }
       else
        {
-         arg2 = value_add (arg1, value_from_longest (builtin_type_char, 
-                                                  (LONGEST) 1));
+         arg2 = value_add (arg1, value_from_longest (builtin_type_char,
+                                                     (LONGEST) 1));
          value_assign (arg1, arg2);
          return arg1;
        }
@@ -1725,12 +1727,12 @@ bad_pointer_to_member:
        }
       else
        {
-         arg2 = value_sub (arg1, value_from_longest (builtin_type_char, 
-                                                  (LONGEST) 1));
+         arg2 = value_sub (arg1, value_from_longest (builtin_type_char,
+                                                     (LONGEST) 1));
          value_assign (arg1, arg2);
          return arg1;
        }
-       
+
     case OP_THIS:
       (*pos) += 1;
       return value_of_this (1);
@@ -1740,20 +1742,20 @@ bad_pointer_to_member:
 
     default:
       /* Removing this case and compiling with gcc -Wall reveals that
-        a lot of cases are hitting this case.  Some of these should
-        probably be removed from expression.h (e.g. do we need a BINOP_SCOPE
-        and an OP_SCOPE?); others are legitimate expressions which are
-        (apparently) not fully implemented.
+         a lot of cases are hitting this case.  Some of these should
+         probably be removed from expression.h (e.g. do we need a BINOP_SCOPE
+         and an OP_SCOPE?); others are legitimate expressions which are
+         (apparently) not fully implemented.
 
-        If there are any cases landing here which mean a user error,
-        then they should be separate cases, with more descriptive
-        error messages.  */
+         If there are any cases landing here which mean a user error,
+         then they should be separate cases, with more descriptive
+         error messages.  */
 
       error ("\
 GDB does not (yet) know how to evaluate that kind of expression");
     }
 
- nosideret:
+nosideret:
   return value_from_longest (builtin_type_long, (LONGEST) 1);
 }
 \f
@@ -1794,13 +1796,13 @@ evaluate_subexp_for_address (exp, pos, noside)
       /* C++: The "address" of a reference should yield the address
        * of the object pointed to. Let value_addr() deal with it. */
       if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_REF)
-        goto default_case;
+       goto default_case;
 
       (*pos) += 4;
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
        {
          struct type *type =
-           lookup_pointer_type (SYMBOL_TYPE (var));
+         lookup_pointer_type (SYMBOL_TYPE (var));
          enum address_class sym_class = SYMBOL_CLASS (var);
 
          if (sym_class == LOC_CONST
@@ -1809,14 +1811,14 @@ evaluate_subexp_for_address (exp, pos, noside)
              || sym_class == LOC_REGPARM)
            error ("Attempt to take address of register or constant.");
 
-       return
-         value_zero (type, not_lval);
+         return
+           value_zero (type, not_lval);
        }
       else
        return
          locate_var_value
-           (var,
-            block_innermost_frame (exp->elts[pc + 1].block));
+         (var,
+          block_innermost_frame (exp->elts[pc + 1].block));
 
     default:
     default_case:
@@ -1844,7 +1846,7 @@ evaluate_subexp_for_address (exp, pos, noside)
    with nonzero based arrays, coercion loses.  Use CAST_IS_CONVERSION
    to decide if coercion is appropriate.
 
  */
+ */
 
 value_ptr
 evaluate_subexp_with_coercion (exp, pos, noside)
@@ -1870,7 +1872,7 @@ evaluate_subexp_with_coercion (exp, pos, noside)
          (*pos) += 4;
          val =
            locate_var_value
-             (var, block_innermost_frame (exp->elts[pc + 1].block));
+           (var, block_innermost_frame (exp->elts[pc + 1].block));
          return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (SYMBOL_TYPE (var))),
                             val);
        }
@@ -1901,9 +1903,9 @@ evaluate_subexp_for_sizeof (exp, pos)
   switch (op)
     {
       /* This case is handled specially
-        so that we avoid creating a value for the result type.
-        If the result type is very big, it's desirable not to
-        create a value unnecessarily.  */
+         so that we avoid creating a value for the result type.
+         If the result type is very big, it's desirable not to
+         create a value unnecessarily.  */
     case UNOP_IND:
       (*pos)++;
       val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
@@ -1914,7 +1916,7 @@ evaluate_subexp_for_sizeof (exp, pos)
        error ("Attempt to take contents of a non-pointer value.");
       type = check_typedef (TYPE_TARGET_TYPE (type));
       return value_from_longest (builtin_type_int, (LONGEST)
-                     TYPE_LENGTH (type));
+                                TYPE_LENGTH (type));
 
     case UNOP_MEMVAL:
       (*pos) += 3;
@@ -1931,7 +1933,7 @@ evaluate_subexp_for_sizeof (exp, pos)
     default:
       val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
       return value_from_longest (builtin_type_int,
-                             (LONGEST) TYPE_LENGTH (VALUE_TYPE (val)));
+                                (LONGEST) TYPE_LENGTH (VALUE_TYPE (val)));
     }
 }
 
@@ -1942,17 +1944,17 @@ parse_and_eval_type (p, length)
      char *p;
      int length;
 {
-    char *tmp = (char *)alloca (length + 4);
-    struct expression *expr;
-    tmp[0] = '(';
-    memcpy (tmp+1, p, length);
-    tmp[length+1] = ')';
-    tmp[length+2] = '0';
-    tmp[length+3] = '\0';
-    expr = parse_expression (tmp);
-    if (expr->elts[0].opcode != UNOP_CAST)
-       error ("Internal error in eval_type.");
-    return expr->elts[1].type;
+  char *tmp = (char *) alloca (length + 4);
+  struct expression *expr;
+  tmp[0] = '(';
+  memcpy (tmp + 1, p, length);
+  tmp[length + 1] = ')';
+  tmp[length + 2] = '0';
+  tmp[length + 3] = '\0';
+  expr = parse_expression (tmp);
+  if (expr->elts[0].opcode != UNOP_CAST)
+    error ("Internal error in eval_type.");
+  return expr->elts[1].type;
 }
 
 int
@@ -1962,15 +1964,15 @@ calc_f77_array_dims (array_type)
   int ndimen = 1;
   struct type *tmp_type;
 
-  if ((TYPE_CODE(array_type) != TYPE_CODE_ARRAY))
+  if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
     error ("Can't get dimensions for a non-array type");
-   
-  tmp_type = array_type; 
+
+  tmp_type = array_type;
 
   while ((tmp_type = TYPE_TARGET_TYPE (tmp_type)))
     {
       if (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)
        ++ndimen;
     }
-  return ndimen; 
+  return ndimen;
 }
index 3f15da57594331cf73b10ce6b44c1ff6b76b7d08..f47257edc706f243e554cebeb60ae03f399de360 100644 (file)
@@ -16,7 +16,8 @@
 
    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. */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA. */
 
 #include "defs.h"
 #include "top.h"
@@ -106,10 +107,10 @@ gdb_notifier;
 static struct
   {
     /* Pointer to first in handler list. */
-    async_signal_handler *first_handler;     
-    
+    async_signal_handler *first_handler;
+
     /* Pointer to last in handler list. */
-    async_signal_handler *last_handler;             
+    async_signal_handler *last_handler;
   }
 sighandler_list;
 
@@ -294,7 +295,7 @@ gdb_do_one_event ()
 
 /* Start up the event loop. This is the entry point to the event loop
    from the command loop. */
-void 
+void
 start_event_loop ()
 {
   /* Loop until there is something to do. This is the entry point to
@@ -308,13 +309,13 @@ start_event_loop ()
      to listen to.  So we exit GDB. */
   return;
 }
-
 \f
 
+
 /* Wrapper function for create_file_handler, so that the caller
    doesn't have to know implementation details about the use of poll
    vs. select. */
-void 
+void
 add_file_handler (fd, proc, client_data)
      int fd;
      file_handler_func *proc;
@@ -378,10 +379,10 @@ create_file_handler (fd, mask, proc, client_data)
   if (gdb_notifier.poll_fds)
     gdb_notifier.poll_fds =
       (struct pollfd *) realloc (gdb_notifier.poll_fds,
-                                (gdb_notifier.num_fds) * sizeof (struct pollfd));
+                          (gdb_notifier.num_fds) * sizeof (struct pollfd));
   else
-     gdb_notifier.poll_fds = 
-       (struct pollfd *) xmalloc (sizeof (struct pollfd));
+    gdb_notifier.poll_fds =
+      (struct pollfd *) xmalloc (sizeof (struct pollfd));
   (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
   (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
   (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
@@ -733,7 +734,7 @@ invoke_async_signal_handler ()
 
   while (1)
     {
-      for (async_handler_ptr = sighandler_list.first_handler; 
+      for (async_handler_ptr = sighandler_list.first_handler;
           async_handler_ptr != NULL;
           async_handler_ptr = async_handler_ptr->next_handler)
        {
index 86abb22f2b734603ce8dd175682fd76b841077ca..393b3e00ba38e7d0827a8bbe7a77c91f1b6b3819 100644 (file)
@@ -16,7 +16,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* An event loop listens for events from multiple event sources. When
    an event arrives, it is queued and processed by calling the
@@ -107,7 +108,7 @@ file_handler;
 
 typedef struct async_signal_handler
   {
-    int ready; /* If ready, call this handler from the main event loop, 
+    int ready;                 /* If ready, call this handler from the main event loop, 
                                   using invoke_async_handler. */
     struct async_signal_handler *next_handler; /* Ptr to next handler */
     async_handler_func *proc;  /* Function to call to do the work */
@@ -123,7 +124,7 @@ typedef enum
     TAIL,
     /* Add at head of queue. It will be processed in last in first out
        order. */
-    HEAD       
+    HEAD
   }
 queue_position;
 
@@ -230,12 +231,12 @@ extern void add_file_handler PARAMS ((int, file_handler_func, gdb_client_data));
 extern void mark_async_signal_handler PARAMS ((async_signal_handler *));
 extern async_signal_handler *
   create_async_signal_handler PARAMS ((async_handler_func *, gdb_client_data));
-extern void delete_async_signal_handler PARAMS ((async_signal_handler **async_handler_ptr));
+extern void delete_async_signal_handler PARAMS ((async_signal_handler ** async_handler_ptr));
 
 /* Exported functions from event-top.c. 
    FIXME: these should really go into top.h. */
 
-extern void display_gdb_prompt PARAMS ((char*));
+extern void display_gdb_prompt PARAMS ((char *));
 extern void async_init_signals PARAMS ((void));
 extern void set_async_editing_command PARAMS ((char *, int, struct cmd_list_element *));
 extern void set_async_annotation_level PARAMS ((char *, int, struct cmd_list_element *));
index 91b6389f363beca7ece45fd9cfddce90f9d1ca13..2bb95a48290a23f4b712345a18848634f69677cc 100644 (file)
 
    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. */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA. */
 
 #include "defs.h"
 #include "top.h"
 #include "inferior.h"
-#include "terminal.h" /* for job_control*/
+#include "terminal.h"          /* for job_control */
 #include <signal.h>
 #include "event-loop.h"
 
@@ -171,8 +172,8 @@ cli_command_loop ()
   if (async_command_editing_p)
     {
       /* Tell readline what the prompt to display is and what function it
-        will need to call after a whole line is read. This also displays
-        the first prompt.*/
+         will need to call after a whole line is read. This also displays
+         the first prompt. */
       length = strlen (PREFIX (0)) + strlen (gdb_prompt) + strlen (SUFFIX (0)) + 1;
       a_prompt = (char *) xmalloc (length);
       strcpy (a_prompt, PREFIX (0));
@@ -209,7 +210,7 @@ change_line_handler ()
       call_readline = gdb_readline2;
 
       /* Set up the command handler as well, in case we are called as
-        first thing from .gdbinit. */
+         first thing from .gdbinit. */
       input_handler = command_line_handler;
     }
 
@@ -242,7 +243,7 @@ display_gdb_prompt (new_prompt)
      char *new_prompt;
 {
   int prompt_length = 0;
-  char *gdb_prompt  = get_prompt ();
+  char *gdb_prompt = get_prompt ();
 
   if (!new_prompt)
     {
@@ -429,15 +430,15 @@ command_handler (command)
     }
 
   execute_command (command, instream == stdin);
+
   /* Set things up for this function to be compete later, once the
      executin has completed, if we are doing an execution command,
      otherwise, just go ahead and finish. */
   if (target_has_async && target_executing)
     {
-      arg1 = 
+      arg1 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg2 = 
+      arg2 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
       arg1->next = arg2;
       arg2->next = NULL;
@@ -453,7 +454,7 @@ command_handler (command)
     {
       bpstat_do_actions (&stop_bpstat);
       do_cleanups (old_chain);
-    
+
       if (display_time)
        {
          long cmd_time = get_run_time () - time_at_cmd_start;
@@ -485,7 +486,7 @@ command_handler (command)
 void
 command_line_handler_continuation (arg)
      struct continuation_arg *arg;
-{ 
+{
   extern int display_time;
   extern int display_space;
 
@@ -493,8 +494,8 @@ command_line_handler_continuation (arg)
   long space_at_cmd_start = (long) arg->next->data;
 
   bpstat_do_actions (&stop_bpstat);
-  /*do_cleanups (old_chain);*/  /*?????FIXME?????*/
-    
+  /*do_cleanups (old_chain); *//*?????FIXME????? */
+
   if (display_time)
     {
       long cmd_time = get_run_time () - time_at_cmd_start;
@@ -815,7 +816,7 @@ gdb_readline2 ()
    as the default for gdb. */
 void
 async_init_signals ()
-{  
+{
   signal (SIGINT, handle_sigint);
   sigint_token =
     create_async_signal_handler (async_request_quit, NULL);
@@ -861,7 +862,7 @@ async_init_signals ()
 
 }
 
-void 
+void
 mark_async_signal_handler_wrapper (token)
      void *token;
 {
@@ -870,7 +871,7 @@ mark_async_signal_handler_wrapper (token)
 
 /* Tell the event loop what to do if SIGINT is received. 
    See event-signal.c. */
-void 
+void
 handle_sigint (sig)
      int sig;
 {
@@ -892,7 +893,7 @@ handle_sigint (sig)
 }
 
 /* Do the quit. All the checks have been done by the caller. */
-void 
+void
 async_request_quit (arg)
      gdb_client_data arg;
 {
@@ -906,7 +907,7 @@ async_request_quit (arg)
 
 /* Tell the event loop what to do if SIGQUIT is received. 
    See event-signal.c. */
-static void 
+static void
 handle_sigquit (sig)
      int sig;
 {
@@ -915,7 +916,7 @@ handle_sigquit (sig)
 }
 
 /* Called by the event loop in response to a SIGQUIT. */
-static void 
+static void
 async_do_nothing (arg)
      gdb_client_data arg;
 {
@@ -925,7 +926,7 @@ async_do_nothing (arg)
 #ifdef SIGHUP
 /* Tell the event loop what to do if SIGHUP is received. 
    See event-signal.c. */
-static void 
+static void
 handle_sighup (sig)
      int sig;
 {
@@ -934,7 +935,7 @@ handle_sighup (sig)
 }
 
 /* Called by the event loop to process a SIGHUP */
-static void 
+static void
 async_disconnect (arg)
      gdb_client_data arg;
 {
@@ -947,18 +948,19 @@ async_disconnect (arg)
 #endif
 
 #ifdef STOP_SIGNAL
-void handle_stop_sig (sig)
+void
+handle_stop_sig (sig)
      int sig;
 {
- mark_async_signal_handler_wrapper (sigtstp_token);
- signal (sig, handle_stop_sig);
 mark_async_signal_handler_wrapper (sigtstp_token);
 signal (sig, handle_stop_sig);
 }
 
 static void
 async_stop_sig (arg)
      gdb_client_data arg;
 {
- char *prompt = get_prompt ();
 char *prompt = get_prompt ();
 #if STOP_SIGNAL == SIGTSTP
   signal (SIGTSTP, SIG_DFL);
   sigsetmask (0);
@@ -977,7 +979,7 @@ async_stop_sig (arg)
 
 /* Tell the event loop what to do if SIGFPE is received. 
    See event-signal.c. */
-static void 
+static void
 handle_sigfpe (sig)
      int sig;
 {
@@ -986,7 +988,7 @@ handle_sigfpe (sig)
 }
 
 /* Event loop will call this functin to process a SIGFPE. */
-static void 
+static void
 async_float_handler (arg)
      gdb_client_data arg;
 {
@@ -998,7 +1000,7 @@ async_float_handler (arg)
 /* Tell the event loop what to do if SIGWINCH is received. 
    See event-signal.c. */
 #if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
-static void 
+static void
 handle_sigwinch (sig)
      int sig;
 {
@@ -1043,19 +1045,19 @@ set_async_prompt (args, from_tty, c)
 
 /* 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.*/
+   and hook up instream to the event loop. */
 void
 _initialize_event_loop ()
 {
   if (async_p)
     {
       /* When a character is detected on instream by select or poll,
-        readline will be invoked via this callback function. */
+         readline will be invoked via this callback function. */
       call_readline = rl_callback_read_char;
 
       /* When readline has read an end-of-line character, it passes
-        the complete line to gdb for processing. command_line_handler
-        is the function that does this. */
+         the complete line to gdb for processing. command_line_handler
+         is the function that does this. */
       input_handler = command_line_handler;
 
       /* Tell readline to use the same input stream that gdb uses. */
@@ -1071,16 +1073,15 @@ _initialize_event_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
-        register with the even loop. Another source is going to be
-        the target program (inferior), but that must be registered
-        only when it actually exists (I.e. after we say 'run' or
-        after we connect to a remote target. */
+         register with the even loop. Another source is going to be
+         the target program (inferior), but that must be registered
+         only when it actually exists (I.e. after we say 'run' or
+         after we connect to a remote target. */
       add_file_handler (input_fd, (file_handler_func *) call_readline, 0);
-      
+
       /* Tell gdb that we will be using the readline library. This
-        could be overwritten by a command in .gdbinit like 'set
-        editing on' or 'off'. */
+         could be overwritten by a command in .gdbinit like 'set
+         editing on' or 'off'. */
       async_command_editing_p = 1;
     }
 }
-
index 2e5e8bd12eecdd7401b38d126d1f62589f7b0ba2..2f9e46e509e5577139e9dec2509235791c1fb9fa 100644 (file)
@@ -1,22 +1,23 @@
 /* Work with executable files, for GDB. 
    Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1997, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -88,7 +89,7 @@ int write_files = 0;
 #define NEED_TEXT_START_END (0)
 #endif
 CORE_ADDR text_start = 0;
-CORE_ADDR text_end   = 0;
+CORE_ADDR text_end = 0;
 
 struct vmap *vmap;
 
@@ -99,15 +100,15 @@ exec_close (quitting)
 {
   int need_symtab_cleanup = 0;
   struct vmap *vp, *nxt;
-  
-  for (nxt = vmap; nxt != NULL; )
+
+  for (nxt = vmap; nxt != NULL;)
     {
       vp = nxt;
       nxt = vp->nxt;
 
       /* if there is an objfile associated with this bfd,
-        free_objfile() will do proper cleanup of objfile *and* bfd. */
-                  
+         free_objfile() will do proper cleanup of objfile *and* bfd. */
+
       if (vp->objfile)
        {
          free_objfile (vp->objfile);
@@ -120,10 +121,10 @@ exec_close (quitting)
                   vp->name, bfd_errmsg (bfd_get_error ()));
 
       /* FIXME: This routine is #if 0'd in symfile.c.  What should we
-        be doing here?  Should we just free everything in
-        vp->objfile->symtabs?  Should free_objfile do that?
-        FIXME-as-well: free_objfile already free'd vp->name, so it isn't
-        valid here.  */
+         be doing here?  Should we just free everything in
+         vp->objfile->symtabs?  Should free_objfile do that?
+         FIXME-as-well: free_objfile already free'd vp->name, so it isn't
+         valid here.  */
       free_named_symtabs (vp->name);
       free (vp);
     }
@@ -143,7 +144,7 @@ exec_close (quitting)
 
   if (exec_ops.to_sections)
     {
-      free ((PTR)exec_ops.to_sections);
+      free ((PTR) exec_ops.to_sections);
       exec_ops.to_sections = NULL;
       exec_ops.to_sections_end = NULL;
     }
@@ -151,20 +152,20 @@ exec_close (quitting)
 
 /*  Process the first arg in ARGS as the new exec file.
 
-    This function is intended to be behave essentially the same
-    as exec_file_command, except that the latter will detect when
-    a target is being debugged, and will ask the user whether it
-    should be shut down first.  (If the answer is "no", then the
-    new file is ignored.)
+   This function is intended to be behave essentially the same
+   as exec_file_command, except that the latter will detect when
+   a target is being debugged, and will ask the user whether it
+   should be shut down first.  (If the answer is "no", then the
+   new file is ignored.)
 
-    This file is used by exec_file_command, to do the work of opening
-    and processing the exec file after any prompting has happened.
+   This file is used by exec_file_command, to do the work of opening
+   and processing the exec file after any prompting has happened.
 
-    And, it is used by child_attach, when the attach command was
-    given a pid but not a exec pathname, and the attach command could
-    figure out the pathname from the pid.  (In this case, we shouldn't
-    ask the user whether the current target should be shut down --
-    we're supplying the exec pathname late for good reason.) */
+   And, it is used by child_attach, when the attach command was
+   given a pid but not a exec pathname, and the attach command could
+   figure out the pathname from the pid.  (In this case, we shouldn't
+   ask the user whether the current target should be shut down --
+   we're supplying the exec pathname late for good reason.) */
 
 void
 exec_file_attach (args, from_tty)
@@ -183,9 +184,9 @@ exec_file_attach (args, from_tty)
     {
       char *scratch_pathname;
       int scratch_chan;
-      
+
       /* Scan through the args and pick up the first non option arg
-        as the filename.  */
+         as the filename.  */
 
       argv = buildargv (args);
       if (argv == NULL)
@@ -193,24 +194,26 @@ exec_file_attach (args, from_tty)
 
       make_cleanup_freeargv (argv);
 
-      for (; (*argv != NULL) && (**argv == '-'); argv++) {;}
+      for (; (*argv != NULL) && (**argv == '-'); argv++)
+       {;
+       }
       if (*argv == NULL)
        error ("no exec file name was specified");
 
       filename = tilde_expand (*argv);
       make_cleanup (free, filename);
-      
-      scratch_chan = openp (getenv ("PATH"), 1, filename, 
-                           write_files? O_RDWR|O_BINARY: O_RDONLY|O_BINARY, 0,
+
+      scratch_chan = openp (getenv ("PATH"), 1, filename,
+                  write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
                            &scratch_pathname);
 #if defined(__GO32__) || defined(_WIN32)
       if (scratch_chan < 0)
-      {
-       char *exename = alloca (strlen (filename) + 5);
-       strcat (strcpy (exename, filename), ".exe");
-       scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ?
-               O_RDWR|O_BINARY : O_RDONLY|O_BINARY, 0, &scratch_pathname);
-      }
+       {
+         char *exename = alloca (strlen (filename) + 5);
+         strcat (strcpy (exename, filename), ".exe");
+         scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ?
+            O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname);
+       }
 #endif
       if (scratch_chan < 0)
        perror_with_name (filename);
@@ -221,12 +224,12 @@ exec_file_attach (args, from_tty)
               scratch_pathname, bfd_errmsg (bfd_get_error ()));
 
       /* At this point, scratch_pathname and exec_bfd->name both point to the
-        same malloc'd string.  However exec_close() will attempt to free it
-        via the exec_bfd->name pointer, so we need to make another copy and
-        leave exec_bfd as the new owner of the original copy. */
+         same malloc'd string.  However exec_close() will attempt to free it
+         via the exec_bfd->name pointer, so we need to make another copy and
+         leave exec_bfd as the new owner of the original copy. */
       scratch_pathname = strdup (scratch_pathname);
       make_cleanup (free, scratch_pathname);
-      
+
       if (!bfd_check_format (exec_bfd, bfd_object))
        {
          /* Make sure to close exec_bfd, or else "run" might try to use
@@ -237,7 +240,7 @@ exec_file_attach (args, from_tty)
        }
 
       /* FIXME - This should only be run for RS6000, but the ifdef is a poor
-        way to accomplish.  */
+         way to accomplish.  */
 #ifdef IBM6000_TARGET
       /* Setup initial vmap. */
 
@@ -253,34 +256,34 @@ exec_file_attach (args, from_tty)
 #endif /* IBM6000_TARGET */
 
       if (build_section_table (exec_bfd, &exec_ops.to_sections,
-                               &exec_ops.to_sections_end))
+                              &exec_ops.to_sections_end))
        {
          /* Make sure to close exec_bfd, or else "run" might try to use
             it.  */
          exec_close (0);
-         error ("\"%s\": can't find the file sections: %s", 
+         error ("\"%s\": can't find the file sections: %s",
                 scratch_pathname, bfd_errmsg (bfd_get_error ()));
        }
 
       /* text_end is sometimes used for where to put call dummies.  A
-        few ports use these for other purposes too.  */
+         few ports use these for other purposes too.  */
       if (NEED_TEXT_START_END)
        {
          struct section_table *p;
-         
+
          /* Set text_start to the lowest address of the start of any
             readonly code section and set text_end to the highest
             address of the end of any readonly code section.  */
          /* FIXME: The comment above does not match the code.  The
             code checks for sections with are either code *or*
             readonly.  */
-         text_start = ~(CORE_ADDR)0;
-         text_end = (CORE_ADDR)0;
+         text_start = ~(CORE_ADDR) 0;
+         text_end = (CORE_ADDR) 0;
          for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
            if (bfd_get_section_flags (p->bfd, p->the_bfd_section)
                & (SEC_CODE | SEC_READONLY))
              {
-               if (text_start > p->addr) 
+               if (text_start > p->addr)
                  text_start = p->addr;
                if (text_end < p->endaddr)
                  text_end = p->endaddr;
@@ -303,9 +306,9 @@ exec_file_attach (args, from_tty)
 
 /*  Process the first arg in ARGS as the new exec file.
 
-    Note that we have to explicitly ignore additional args, since we can
-    be called from file_command(), which also calls symbol_file_command()
-    which can take multiple args. */
+   Note that we have to explicitly ignore additional args, since we can
+   be called from file_command(), which also calls symbol_file_command()
+   which can take multiple args. */
 
 void
 exec_file_command (args, from_tty)
@@ -336,8 +339,8 @@ file_command (arg, from_tty)
   if (file_changed_hook)
     file_changed_hook (arg);
 }
-
 \f
+
 /* Locate all mappable sections of a BFD file. 
    table_pp_char is a char * to get it through bfd_map_over_sections;
    we cast it back to its proper type.  */
@@ -348,7 +351,7 @@ add_to_section_table (abfd, asect, table_pp_char)
      sec_ptr asect;
      PTR table_pp_char;
 {
-  struct section_table **table_pp = (struct section_table **)table_pp_char;
+  struct section_table **table_pp = (struct section_table **) table_pp_char;
   flagword aflag;
 
   aflag = bfd_get_section_flags (abfd, asect);
@@ -375,18 +378,18 @@ build_section_table (some_bfd, start, end)
 
   count = bfd_count_sections (some_bfd);
   if (*start)
-    free ((PTR)*start);
+    free ((PTR) * start);
   *start = (struct section_table *) xmalloc (count * sizeof (**start));
   *end = *start;
-  bfd_map_over_sections (some_bfd, add_to_section_table, (char *)end);
+  bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
   if (*end > *start + count)
-    abort();
+    abort ();
   /* We could realloc the table, but it probably loses for most files.  */
   return 0;
 }
 \f
 static void
-bfdsec_to_vmap(abfd, sect, arg3) 
+bfdsec_to_vmap (abfd, sect, arg3)
      bfd *abfd;
      sec_ptr sect;
      PTR arg3;
@@ -432,7 +435,7 @@ map_vmap (abfd, arch)
   vp->bfd = abfd;
   vp->name = bfd_get_filename (arch ? arch : abfd);
   vp->member = arch ? bfd_get_filename (abfd) : "";
-  
+
   vmap_bfd.pbfd = arch;
   vmap_bfd.pvmap = vp;
   bfd_map_over_sections (abfd, bfdsec_to_vmap, &vmap_bfd);
@@ -452,16 +455,16 @@ map_vmap (abfd, arch)
 
    Result is a length:
 
-       0:    We cannot handle this address and length.
-       > 0:  We have handled N bytes starting at this address.
-             (If N == length, we did it all.)  We might be able
-             to handle more bytes beyond this length, but no
-             promises.
-       < 0:  We cannot handle this address, but if somebody
-             else handles (-N) bytes, we can start from there.
+   0:    We cannot handle this address and length.
+   > 0:  We have handled N bytes starting at this address.
+   (If N == length, we did it all.)  We might be able
+   to handle more bytes beyond this length, but no
+   promises.
+   < 0:  We cannot handle this address, but if somebody
+   else handles (-N) bytes, we can start from there.
 
-    The same routine is used to handle both core and exec files;
-    we just tail-call it with more arguments to select between them.  */
+   The same routine is used to handle both core and exec files;
+   we just tail-call it with more arguments to select between them.  */
 
 int
 xfer_memory (memaddr, myaddr, len, write, target)
@@ -478,7 +481,7 @@ xfer_memory (memaddr, myaddr, len, write, target)
   asection *section;
 
   if (len <= 0)
-    abort();
+    abort ();
 
   if (overlay_debugging)
     {
@@ -491,7 +494,7 @@ xfer_memory (memaddr, myaddr, len, write, target)
   xfer_fn = write ? bfd_set_section_contents : bfd_get_section_contents;
   nextsectaddr = memend;
 
-#if 0 /* Stu's implementation */
+#if 0                          /* Stu's implementation */
 /* If a section has been specified, try to use it.  Note that we cannot use the
    specified section directly.  This is because it usually comes from the
    symbol file, which may be different from the exec or core file.  Instead, we
@@ -538,9 +541,9 @@ xfer_memory (memaddr, myaddr, len, write, target)
     {
       if (overlay_debugging && section && p->the_bfd_section &&
          strcmp (section->name, p->the_bfd_section->name) != 0)
-       continue;       /* not the section we need */
+       continue;               /* not the section we need */
       if (memaddr >= p->addr)
-       if (memend <= p->endaddr)
+       if (memend <= p->endaddr)
          {
            /* Entire transfer is within this section.  */
            res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
@@ -552,7 +555,7 @@ xfer_memory (memaddr, myaddr, len, write, target)
            /* This section ends before the transfer starts.  */
            continue;
          }
-       else 
+       else
          {
            /* This section overlaps the transfer.  Just do half.  */
            len = p->endaddr - memaddr;
@@ -565,22 +568,22 @@ xfer_memory (memaddr, myaddr, len, write, target)
     }
 
   if (nextsectaddr >= memend)
-    return 0;                          /* We can't help */
+    return 0;                  /* We can't help */
   else
-    return - (nextsectaddr - memaddr); /* Next boundary where we can help */
+    return -(nextsectaddr - memaddr);  /* Next boundary where we can help */
 }
-
 \f
+
 void
 print_section_info (t, abfd)
-  struct target_ops *t;
-  bfd *abfd;
+     struct target_ops *t;
+     bfd *abfd;
 {
   struct section_table *p;
 
-  printf_filtered ("\t`%s', ", bfd_get_filename(abfd));
+  printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
   wrap_here ("        ");
-  printf_filtered ("file type %s.\n", bfd_get_target(abfd));
+  printf_filtered ("file type %s.\n", bfd_get_target (abfd));
   if (abfd == exec_bfd)
     {
       printf_filtered ("\tEntry point: ");
@@ -616,14 +619,14 @@ exec_files_info (t)
 
       printf_unfiltered ("\tMapping info for file `%s'.\n", vmap->name);
       printf_unfiltered ("\t  %8.8s   %8.8s   %8.8s   %8.8s %8.8s %s\n",
-                      "tstart", "tend", "dstart", "dend", "section",
-                      "file(member)");
-
-    for (vp = vmap; vp; vp = vp->nxt)
-      printf_unfiltered ("\t0x%8.8x 0x%8.8x 0x%8.8x 0x%8.8x %s%s%s%s\n",
-                        vp->tstart, vp->tend, vp->dstart, vp->dend, vp->name,
-                        *vp->member ? "(" : "", vp->member,
-                        *vp->member ? ")" : "");
+                        "tstart", "tend", "dstart", "dend", "section",
+                        "file(member)");
+
+      for (vp = vmap; vp; vp = vp->nxt)
+       printf_unfiltered ("\t0x%8.8x 0x%8.8x 0x%8.8x 0x%8.8x %s%s%s%s\n",
+                      vp->tstart, vp->tend, vp->dstart, vp->dend, vp->name,
+                          *vp->member ? "(" : "", vp->member,
+                          *vp->member ? ")" : "");
     }
 }
 
@@ -638,9 +641,9 @@ exec_set_section_offsets (text_off, data_off, bss_off)
      bfd_signed_vma bss_off;
 {
   struct section_table *sect;
-  for (sect = exec_ops.to_sections; 
-       sect < exec_ops.to_sections_end; 
+
+  for (sect = exec_ops.to_sections;
+       sect < exec_ops.to_sections_end;
        sect++)
     {
       flagword flags;
@@ -649,17 +652,17 @@ exec_set_section_offsets (text_off, data_off, bss_off)
 
       if (flags & SEC_CODE)
        {
-         sect->addr    += text_off;
+         sect->addr += text_off;
          sect->endaddr += text_off;
        }
       else if (flags & (SEC_DATA | SEC_LOAD))
        {
-         sect->addr    += data_off;
+         sect->addr += data_off;
          sect->endaddr += data_off;
        }
       else if (flags & SEC_ALLOC)
        {
-         sect->addr    += bss_off;
+         sect->addr += bss_off;
          sect->endaddr += bss_off;
        }
     }
@@ -681,23 +684,25 @@ set_section_command (args, from_tty)
     error ("Must specify section name and its virtual address");
 
   /* Parse out section name */
-  for (secname = args; !isspace(*args); args++) ;
+  for (secname = args; !isspace (*args); args++);
   seclen = args - secname;
 
   /* Parse out new virtual address */
   secaddr = parse_and_eval_address (args);
 
-  for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++) {
-    if (!strncmp (secname, bfd_section_name (exec_bfd, p->the_bfd_section), seclen)
-       && bfd_section_name (exec_bfd, p->the_bfd_section)[seclen] == '\0') {
-      offset = secaddr - p->addr;
-      p->addr += offset;
-      p->endaddr += offset;
-      if (from_tty)
-       exec_files_info(&exec_ops);
-      return;
+  for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
+    {
+      if (!strncmp (secname, bfd_section_name (exec_bfd, p->the_bfd_section), seclen)
+         && bfd_section_name (exec_bfd, p->the_bfd_section)[seclen] == '\0')
+       {
+         offset = secaddr - p->addr;
+         p->addr += offset;
+         p->endaddr += offset;
+         if (from_tty)
+           exec_files_info (&exec_ops);
+         return;
+       }
     }
-  } 
   if (seclen >= sizeof (secprint))
     seclen = sizeof (secprint) - 1;
   strncpy (secprint, secname, seclen);
@@ -740,7 +745,7 @@ Specify the filename of the executable file.";
   exec_ops.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior;
   exec_ops.to_stratum = file_stratum;
   exec_ops.to_has_memory = 1;
-  exec_ops.to_magic = OPS_MAGIC;       
+  exec_ops.to_magic = OPS_MAGIC;
 }
 
 void
@@ -763,24 +768,24 @@ No arg means to have no executable file and no symbols.", &cmdlist);
     }
 
   c = add_cmd ("exec-file", class_files, exec_file_command,
-          "Use FILE as program for getting contents of pure memory.\n\
+              "Use FILE as program for getting contents of pure memory.\n\
 If FILE cannot be found as specified, your execution directory path\n\
 is searched for a command of that name.\n\
 No arg means have no executable file.", &cmdlist);
   c->completer = filename_completer;
 
   add_com ("section", class_files, set_section_command,
-   "Change the base address of section SECTION of the exec file to ADDR.\n\
+          "Change the base address of section SECTION of the exec file to ADDR.\n\
 This can be used if the exec file does not contain section addresses,\n\
 (such as in the a.out format), or when the addresses specified in the\n\
 file itself are wrong.  Each section must be changed separately.  The\n\
 ``info files'' command lists all the sections and their addresses.");
 
   add_show_from_set
-    (add_set_cmd ("write", class_support, var_boolean, (char *)&write_files,
+    (add_set_cmd ("write", class_support, var_boolean, (char *) &write_files,
                  "Set writing into executable and core files.",
                  &setlist),
      &showlist);
-  
+
   add_target (&exec_ops);
 }
index 7cd35ece7066a02a796d56b4a61f363eac5e8530..fadb0b76d1862d8a234aa058166c27f6a5d7275b 100644 (file)
@@ -1,21 +1,22 @@
 /* Print in infix form a struct expression.
    Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -73,7 +74,7 @@ print_subexp (exp, pos, stream, prec)
   opcode = exp->elts[pc].opcode;
   switch (opcode)
     {
-    /* Common ops */
+      /* Common ops */
 
     case OP_SCOPE:
       myprec = PREC_PREFIX;
@@ -124,7 +125,7 @@ print_subexp (exp, pos, stream, prec)
     case OP_REGISTER:
       (*pos) += 2;
       fprintf_filtered (stream, "$%s",
-              REGISTER_NAME (longest_to_int (exp->elts[pc + 1].longconst)));
+             REGISTER_NAME (longest_to_int (exp->elts[pc + 1].longconst)));
       return;
 
     case OP_BOOL:
@@ -137,7 +138,7 @@ print_subexp (exp, pos, stream, prec)
     case OP_INTERNALVAR:
       (*pos) += 2;
       fprintf_filtered (stream, "$%s",
-              internalvar_name (exp->elts[pc + 1].internalvar));
+                       internalvar_name (exp->elts[pc + 1].internalvar));
       return;
 
     case OP_FUNCALL:
@@ -156,22 +157,22 @@ print_subexp (exp, pos, stream, prec)
 
     case OP_NAME:
     case OP_EXPRSTRING:
-      nargs = longest_to_int (exp -> elts[pc + 1].longconst);
+      nargs = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
       fputs_filtered (&exp->elts[pc + 2].string, stream);
       return;
 
     case OP_STRING:
-      nargs = longest_to_int (exp -> elts[pc + 1].longconst);
+      nargs = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
       /* LA_PRINT_STRING will print using the current repeat count threshold.
-        If necessary, we can temporarily set it to zero, or pass it as an
-        additional parameter to LA_PRINT_STRING.  -fnf */
+         If necessary, we can temporarily set it to zero, or pass it as an
+         additional parameter to LA_PRINT_STRING.  -fnf */
       LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0);
       return;
 
     case OP_BITSTRING:
-      nargs = longest_to_int (exp -> elts[pc + 1].longconst);
+      nargs = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos)
        += 3 + BYTES_TO_EXP_ELEM ((nargs + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT);
       fprintf_unfiltered (stream, "B'<unimplemented>'");
@@ -265,9 +266,9 @@ print_subexp (exp, pos, stream, prec)
       if ((int) prec > (int) PREC_COMMA)
        fputs_filtered ("(", stream);
       /* Print the subexpressions, forcing parentheses
-        around any binary operations within them.
-        This is more parentheses than are strictly necessary,
-        but it looks clearer.  */
+         around any binary operations within them.
+         This is more parentheses than are strictly necessary,
+         but it looks clearer.  */
       print_subexp (exp, pos, stream, PREC_HYPER);
       fputs_filtered (" ? ", stream);
       print_subexp (exp, pos, stream, PREC_HYPER);
@@ -295,7 +296,7 @@ print_subexp (exp, pos, stream, prec)
       fputs_filtered (&exp->elts[pc + 2].string, stream);
       return;
 
-    /* Will not occur for Modula-2 */
+      /* Will not occur for Modula-2 */
     case STRUCTOP_PTR:
       tem = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
@@ -324,38 +325,41 @@ print_subexp (exp, pos, stream, prec)
     case UNOP_CAST:
       (*pos) += 2;
       if ((int) prec > (int) PREC_PREFIX)
-        fputs_filtered ("(", stream);
+       fputs_filtered ("(", stream);
       fputs_filtered ("(", stream);
       type_print (exp->elts[pc + 1].type, "", stream, 0);
       fputs_filtered (") ", stream);
       print_subexp (exp, pos, stream, PREC_PREFIX);
       if ((int) prec > (int) PREC_PREFIX)
-        fputs_filtered (")", stream);
+       fputs_filtered (")", stream);
       return;
 
     case UNOP_MEMVAL:
       (*pos) += 2;
       if ((int) prec > (int) PREC_PREFIX)
-        fputs_filtered ("(", stream);
+       fputs_filtered ("(", stream);
       if (exp->elts[pc + 1].type->code == TYPE_CODE_FUNC &&
-         exp->elts[pc + 3].opcode == OP_LONG) {
-       /* We have a minimal symbol fn, probably.  It's encoded
-          as a UNOP_MEMVAL (function-type) of an OP_LONG (int, address).
-          Swallow the OP_LONG (including both its opcodes); ignore
-          its type; print the value in the type of the MEMVAL.  */
-       (*pos) += 4;
-       val = value_at_lazy (exp->elts[pc + 1].type,
-                            (CORE_ADDR) exp->elts[pc + 5].longconst,
-                            NULL);
-       value_print (val, stream, 0, Val_no_prettyprint);
-      } else {
-       fputs_filtered ("{", stream);
-       type_print (exp->elts[pc + 1].type, "", stream, 0);
-       fputs_filtered ("} ", stream);
-        print_subexp (exp, pos, stream, PREC_PREFIX);
-      }
+         exp->elts[pc + 3].opcode == OP_LONG)
+       {
+         /* We have a minimal symbol fn, probably.  It's encoded
+            as a UNOP_MEMVAL (function-type) of an OP_LONG (int, address).
+            Swallow the OP_LONG (including both its opcodes); ignore
+            its type; print the value in the type of the MEMVAL.  */
+         (*pos) += 4;
+         val = value_at_lazy (exp->elts[pc + 1].type,
+                              (CORE_ADDR) exp->elts[pc + 5].longconst,
+                              NULL);
+         value_print (val, stream, 0, Val_no_prettyprint);
+       }
+      else
+       {
+         fputs_filtered ("{", stream);
+         type_print (exp->elts[pc + 1].type, "", stream, 0);
+         fputs_filtered ("} ", stream);
+         print_subexp (exp, pos, stream, PREC_PREFIX);
+       }
       if ((int) prec > (int) PREC_PREFIX)
-        fputs_filtered (")", stream);
+       fputs_filtered (")", stream);
       return;
 
     case BINOP_ASSIGN_MODIFY:
@@ -377,14 +381,14 @@ print_subexp (exp, pos, stream, prec)
        error ("Invalid expression");
       break;
 
-    /* C++ ops */
+      /* C++ ops */
 
     case OP_THIS:
       ++(*pos);
       fputs_filtered ("this", stream);
       return;
 
-    /* Modula-2 ops */
+      /* Modula-2 ops */
 
     case MULTI_SUBSCRIPT:
       (*pos) += 2;
@@ -401,19 +405,19 @@ print_subexp (exp, pos, stream, prec)
       return;
 
     case BINOP_VAL:
-      (*pos)+=2;
-      fprintf_unfiltered(stream,"VAL(");
-      type_print(exp->elts[pc+1].type,"",stream,0);
-      fprintf_unfiltered(stream,",");
-      print_subexp(exp,pos,stream,PREC_PREFIX);
-      fprintf_unfiltered(stream,")");
+      (*pos) += 2;
+      fprintf_unfiltered (stream, "VAL(");
+      type_print (exp->elts[pc + 1].type, "", stream, 0);
+      fprintf_unfiltered (stream, ",");
+      print_subexp (exp, pos, stream, PREC_PREFIX);
+      fprintf_unfiltered (stream, ")");
       return;
-      
+
     case BINOP_INCL:
     case BINOP_EXCL:
-      error("print_subexp:  Not implemented.");
+      error ("print_subexp:  Not implemented.");
 
-    /* Default ops */
+      /* Default ops */
 
     default:
       op_str = "???";
@@ -430,7 +434,7 @@ print_subexp (exp, pos, stream, prec)
           to interpret further elements.  For example, this happens
           if opcode is OP_TYPE.  */
        error ("Invalid expression");
-   }
+    }
 
   /* Note that PREC_BUILTIN will always emit parentheses. */
   if ((int) myprec < (int) prec)
@@ -458,8 +462,8 @@ print_subexp (exp, pos, stream, prec)
     {
       /* Binary operator.  */
       /* Print left operand.
-        If operator is right-associative,
-        increment precedence for this operand.  */
+         If operator is right-associative,
+         increment precedence for this operand.  */
       print_subexp (exp, pos, stream,
                    (enum precedence) ((int) myprec + assoc));
       /* Print the operator itself.  */
@@ -470,8 +474,8 @@ print_subexp (exp, pos, stream, prec)
       else
        fprintf_filtered (stream, " %s ", op_str);
       /* Print right operand.
-        If operator is left-associative,
-        increment precedence for this operand.  */
+         If operator is left-associative,
+         increment precedence for this operand.  */
       print_subexp (exp, pos, stream,
                    (enum precedence) ((int) myprec + !assoc));
     }
@@ -484,8 +488,8 @@ print_subexp (exp, pos, stream, prec)
    a string.   NULL indicates that the opcode was not found in the
    current language table.  */
 char *
-op_string(op)
-   enum exp_opcode op;
+op_string (op)
+     enum exp_opcode op;
 {
   int tem;
   register const struct op_print *op_print_tab;
@@ -500,11 +504,11 @@ op_string(op)
 /* Support for dumping the raw data from expressions in a human readable
    form.  */
 
-static char * op_name PARAMS ((int opcode));
+static char *op_name PARAMS ((int opcode));
 
 static char *
 op_name (opcode)
-       int opcode;
+     int opcode;
 {
   switch (opcode)
     {
@@ -515,92 +519,178 @@ op_name (opcode)
        sprintf (buf, "<unknown %d>", opcode);
        return buf;
       }
-    case OP_NULL: return "OP_NULL";
-    case BINOP_ADD: return "BINOP_ADD";
-    case BINOP_SUB: return "BINOP_SUB";
-    case BINOP_MUL: return "BINOP_MUL";
-    case BINOP_DIV: return "BINOP_DIV";
-    case BINOP_REM: return "BINOP_REM";
-    case BINOP_MOD: return "BINOP_MOD";
-    case BINOP_LSH: return "BINOP_LSH";
-    case BINOP_RSH: return "BINOP_RSH";
-    case BINOP_LOGICAL_AND: return "BINOP_LOGICAL_AND";
-    case BINOP_LOGICAL_OR: return "BINOP_LOGICAL_OR";
-    case BINOP_BITWISE_AND: return "BINOP_BITWISE_AND";
-    case BINOP_BITWISE_IOR: return "BINOP_BITWISE_IOR";
-    case BINOP_BITWISE_XOR: return "BINOP_BITWISE_XOR";
-    case BINOP_EQUAL: return "BINOP_EQUAL";
-    case BINOP_NOTEQUAL: return "BINOP_NOTEQUAL";
-    case BINOP_LESS: return "BINOP_LESS";
-    case BINOP_GTR: return "BINOP_GTR";
-    case BINOP_LEQ: return "BINOP_LEQ";
-    case BINOP_GEQ: return "BINOP_GEQ";
-    case BINOP_REPEAT: return "BINOP_REPEAT";
-    case BINOP_ASSIGN: return "BINOP_ASSIGN";
-    case BINOP_COMMA: return "BINOP_COMMA";
-    case BINOP_SUBSCRIPT: return "BINOP_SUBSCRIPT";
-    case MULTI_SUBSCRIPT: return "MULTI_SUBSCRIPT";
-    case BINOP_EXP: return "BINOP_EXP";
-    case BINOP_MIN: return "BINOP_MIN";
-    case BINOP_MAX: return "BINOP_MAX";
-    case BINOP_SCOPE: return "BINOP_SCOPE";
-    case STRUCTOP_MEMBER: return "STRUCTOP_MEMBER";
-    case STRUCTOP_MPTR: return "STRUCTOP_MPTR";
-    case BINOP_INTDIV: return "BINOP_INTDIV";
-    case BINOP_ASSIGN_MODIFY: return "BINOP_ASSIGN_MODIFY";
-    case BINOP_VAL: return "BINOP_VAL";
-    case BINOP_INCL: return "BINOP_INCL";
-    case BINOP_EXCL: return "BINOP_EXCL";
-    case BINOP_CONCAT: return "BINOP_CONCAT";
-    case BINOP_RANGE: return "BINOP_RANGE";
-    case BINOP_END: return "BINOP_END";
-    case TERNOP_COND: return "TERNOP_COND";
-    case TERNOP_SLICE: return "TERNOP_SLICE";
-    case TERNOP_SLICE_COUNT: return "TERNOP_SLICE_COUNT";
-    case OP_LONG: return "OP_LONG";
-    case OP_DOUBLE: return "OP_DOUBLE";
-    case OP_VAR_VALUE: return "OP_VAR_VALUE";
-    case OP_LAST: return "OP_LAST";
-    case OP_REGISTER: return "OP_REGISTER";
-    case OP_INTERNALVAR: return "OP_INTERNALVAR";
-    case OP_FUNCALL: return "OP_FUNCALL";
-    case OP_STRING: return "OP_STRING";
-    case OP_BITSTRING: return "OP_BITSTRING";
-    case OP_ARRAY: return "OP_ARRAY";
-    case UNOP_CAST: return "UNOP_CAST";
-    case UNOP_MEMVAL: return "UNOP_MEMVAL";
-    case UNOP_NEG: return "UNOP_NEG";
-    case UNOP_LOGICAL_NOT: return "UNOP_LOGICAL_NOT";
-    case UNOP_COMPLEMENT: return "UNOP_COMPLEMENT";
-    case UNOP_IND: return "UNOP_IND";
-    case UNOP_ADDR: return "UNOP_ADDR";
-    case UNOP_PREINCREMENT: return "UNOP_PREINCREMENT";
-    case UNOP_POSTINCREMENT: return "UNOP_POSTINCREMENT";
-    case UNOP_PREDECREMENT: return "UNOP_PREDECREMENT";
-    case UNOP_POSTDECREMENT: return "UNOP_POSTDECREMENT";
-    case UNOP_SIZEOF: return "UNOP_SIZEOF";
-    case UNOP_LOWER: return "UNOP_LOWER";
-    case UNOP_UPPER: return "UNOP_UPPER";
-    case UNOP_LENGTH: return "UNOP_LENGTH";
-    case UNOP_PLUS: return "UNOP_PLUS";
-    case UNOP_CAP: return "UNOP_CAP";
-    case UNOP_CHR: return "UNOP_CHR";
-    case UNOP_ORD: return "UNOP_ORD";
-    case UNOP_ABS: return "UNOP_ABS";
-    case UNOP_FLOAT: return "UNOP_FLOAT";
-    case UNOP_HIGH: return "UNOP_HIGH";
-    case UNOP_MAX: return "UNOP_MAX";
-    case UNOP_MIN: return "UNOP_MIN";
-    case UNOP_ODD: return "UNOP_ODD";
-    case UNOP_TRUNC: return "UNOP_TRUNC";
-    case OP_BOOL: return "OP_BOOL";
-    case OP_M2_STRING: return "OP_M2_STRING";
-    case STRUCTOP_STRUCT: return "STRUCTOP_STRUCT";
-    case STRUCTOP_PTR: return "STRUCTOP_PTR";
-    case OP_THIS: return "OP_THIS";
-    case OP_SCOPE: return "OP_SCOPE";
-    case OP_TYPE: return "OP_TYPE";
-    case OP_LABELED: return "OP_LABELED";
+    case OP_NULL:
+      return "OP_NULL";
+    case BINOP_ADD:
+      return "BINOP_ADD";
+    case BINOP_SUB:
+      return "BINOP_SUB";
+    case BINOP_MUL:
+      return "BINOP_MUL";
+    case BINOP_DIV:
+      return "BINOP_DIV";
+    case BINOP_REM:
+      return "BINOP_REM";
+    case BINOP_MOD:
+      return "BINOP_MOD";
+    case BINOP_LSH:
+      return "BINOP_LSH";
+    case BINOP_RSH:
+      return "BINOP_RSH";
+    case BINOP_LOGICAL_AND:
+      return "BINOP_LOGICAL_AND";
+    case BINOP_LOGICAL_OR:
+      return "BINOP_LOGICAL_OR";
+    case BINOP_BITWISE_AND:
+      return "BINOP_BITWISE_AND";
+    case BINOP_BITWISE_IOR:
+      return "BINOP_BITWISE_IOR";
+    case BINOP_BITWISE_XOR:
+      return "BINOP_BITWISE_XOR";
+    case BINOP_EQUAL:
+      return "BINOP_EQUAL";
+    case BINOP_NOTEQUAL:
+      return "BINOP_NOTEQUAL";
+    case BINOP_LESS:
+      return "BINOP_LESS";
+    case BINOP_GTR:
+      return "BINOP_GTR";
+    case BINOP_LEQ:
+      return "BINOP_LEQ";
+    case BINOP_GEQ:
+      return "BINOP_GEQ";
+    case BINOP_REPEAT:
+      return "BINOP_REPEAT";
+    case BINOP_ASSIGN:
+      return "BINOP_ASSIGN";
+    case BINOP_COMMA:
+      return "BINOP_COMMA";
+    case BINOP_SUBSCRIPT:
+      return "BINOP_SUBSCRIPT";
+    case MULTI_SUBSCRIPT:
+      return "MULTI_SUBSCRIPT";
+    case BINOP_EXP:
+      return "BINOP_EXP";
+    case BINOP_MIN:
+      return "BINOP_MIN";
+    case BINOP_MAX:
+      return "BINOP_MAX";
+    case BINOP_SCOPE:
+      return "BINOP_SCOPE";
+    case STRUCTOP_MEMBER:
+      return "STRUCTOP_MEMBER";
+    case STRUCTOP_MPTR:
+      return "STRUCTOP_MPTR";
+    case BINOP_INTDIV:
+      return "BINOP_INTDIV";
+    case BINOP_ASSIGN_MODIFY:
+      return "BINOP_ASSIGN_MODIFY";
+    case BINOP_VAL:
+      return "BINOP_VAL";
+    case BINOP_INCL:
+      return "BINOP_INCL";
+    case BINOP_EXCL:
+      return "BINOP_EXCL";
+    case BINOP_CONCAT:
+      return "BINOP_CONCAT";
+    case BINOP_RANGE:
+      return "BINOP_RANGE";
+    case BINOP_END:
+      return "BINOP_END";
+    case TERNOP_COND:
+      return "TERNOP_COND";
+    case TERNOP_SLICE:
+      return "TERNOP_SLICE";
+    case TERNOP_SLICE_COUNT:
+      return "TERNOP_SLICE_COUNT";
+    case OP_LONG:
+      return "OP_LONG";
+    case OP_DOUBLE:
+      return "OP_DOUBLE";
+    case OP_VAR_VALUE:
+      return "OP_VAR_VALUE";
+    case OP_LAST:
+      return "OP_LAST";
+    case OP_REGISTER:
+      return "OP_REGISTER";
+    case OP_INTERNALVAR:
+      return "OP_INTERNALVAR";
+    case OP_FUNCALL:
+      return "OP_FUNCALL";
+    case OP_STRING:
+      return "OP_STRING";
+    case OP_BITSTRING:
+      return "OP_BITSTRING";
+    case OP_ARRAY:
+      return "OP_ARRAY";
+    case UNOP_CAST:
+      return "UNOP_CAST";
+    case UNOP_MEMVAL:
+      return "UNOP_MEMVAL";
+    case UNOP_NEG:
+      return "UNOP_NEG";
+    case UNOP_LOGICAL_NOT:
+      return "UNOP_LOGICAL_NOT";
+    case UNOP_COMPLEMENT:
+      return "UNOP_COMPLEMENT";
+    case UNOP_IND:
+      return "UNOP_IND";
+    case UNOP_ADDR:
+      return "UNOP_ADDR";
+    case UNOP_PREINCREMENT:
+      return "UNOP_PREINCREMENT";
+    case UNOP_POSTINCREMENT:
+      return "UNOP_POSTINCREMENT";
+    case UNOP_PREDECREMENT:
+      return "UNOP_PREDECREMENT";
+    case UNOP_POSTDECREMENT:
+      return "UNOP_POSTDECREMENT";
+    case UNOP_SIZEOF:
+      return "UNOP_SIZEOF";
+    case UNOP_LOWER:
+      return "UNOP_LOWER";
+    case UNOP_UPPER:
+      return "UNOP_UPPER";
+    case UNOP_LENGTH:
+      return "UNOP_LENGTH";
+    case UNOP_PLUS:
+      return "UNOP_PLUS";
+    case UNOP_CAP:
+      return "UNOP_CAP";
+    case UNOP_CHR:
+      return "UNOP_CHR";
+    case UNOP_ORD:
+      return "UNOP_ORD";
+    case UNOP_ABS:
+      return "UNOP_ABS";
+    case UNOP_FLOAT:
+      return "UNOP_FLOAT";
+    case UNOP_HIGH:
+      return "UNOP_HIGH";
+    case UNOP_MAX:
+      return "UNOP_MAX";
+    case UNOP_MIN:
+      return "UNOP_MIN";
+    case UNOP_ODD:
+      return "UNOP_ODD";
+    case UNOP_TRUNC:
+      return "UNOP_TRUNC";
+    case OP_BOOL:
+      return "OP_BOOL";
+    case OP_M2_STRING:
+      return "OP_M2_STRING";
+    case STRUCTOP_STRUCT:
+      return "STRUCTOP_STRUCT";
+    case STRUCTOP_PTR:
+      return "STRUCTOP_PTR";
+    case OP_THIS:
+      return "OP_THIS";
+    case OP_SCOPE:
+      return "OP_SCOPE";
+    case OP_TYPE:
+      return "OP_TYPE";
+    case OP_LABELED:
+      return "OP_LABELED";
     }
 }
 
@@ -623,21 +713,21 @@ dump_prefix_expression (exp, stream, note)
   else
     fprintf_filtered (stream, "Type printing not yet supported....");
   fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %d bytes each.\n",
-                   exp->language_defn->la_name, exp -> nelts,
+                   exp->language_defn->la_name, exp->nelts,
                    sizeof (union exp_element));
   fprintf_filtered (stream, "\t%5s  %20s  %16s  %s\n", "Index", "Opcode",
                    "Hex Value", "String Value");
-  for (elt = 0; elt < exp -> nelts; elt++)
+  for (elt = 0; elt < exp->nelts; elt++)
     {
       fprintf_filtered (stream, "\t%5d  ", elt);
-      opcode_name = op_name (exp -> elts[elt].opcode);
+      opcode_name = op_name (exp->elts[elt].opcode);
 
       fprintf_filtered (stream, "%20s  ", opcode_name);
-      print_longest (stream, 'd', 0, exp -> elts[elt].longconst);
+      print_longest (stream, 'd', 0, exp->elts[elt].longconst);
       fprintf_filtered (stream, "  ");
 
       for (eltscan = (char *) &exp->elts[elt],
-            eltsize = sizeof (union exp_element) ;
+          eltsize = sizeof (union exp_element);
           eltsize-- > 0;
           eltscan++)
        {
@@ -648,7 +738,7 @@ dump_prefix_expression (exp, stream, note)
     }
 }
 
-static int dump_subexp PARAMS ((struct expression *exp, GDB_FILE *stream, int elt));
+static int dump_subexp PARAMS ((struct expression * exp, GDB_FILE * stream, int elt));
 
 static int
 dump_subexp (exp, stream, elt)
@@ -668,7 +758,7 @@ dump_subexp (exp, stream, elt)
 
   fprintf_filtered (stream, "%-20s  ", op_name (exp->elts[elt].opcode));
 
-  switch (exp -> elts[elt++].opcode)
+  switch (exp->elts[elt++].opcode)
     {
     case TERNOP_COND:
     case TERNOP_SLICE:
@@ -744,32 +834,32 @@ dump_subexp (exp, stream, elt)
       fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
       type_print (exp->elts[elt].type, NULL, stream, 0);
       fprintf_filtered (stream, "), value %ld (0x%lx)",
-                       (long)exp->elts[elt+1].longconst,
-                       (long)exp->elts[elt+1].longconst);
+                       (long) exp->elts[elt + 1].longconst,
+                       (long) exp->elts[elt + 1].longconst);
       elt += 3;
       break;
     case OP_DOUBLE:
       fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
       type_print (exp->elts[elt].type, NULL, stream, 0);
       fprintf_filtered (stream, "), value %g",
-                       (double)exp->elts[elt+1].doubleconst);
+                       (double) exp->elts[elt + 1].doubleconst);
       elt += 3;
       break;
     case OP_VAR_VALUE:
       fprintf_filtered (stream, "Block @0x%x, symbol @0x%x (%s)",
                        exp->elts[elt].block,
-                       exp->elts[elt+1].symbol,
-                       SYMBOL_NAME (exp->elts[elt+1].symbol));
+                       exp->elts[elt + 1].symbol,
+                       SYMBOL_NAME (exp->elts[elt + 1].symbol));
       elt += 3;
       break;
     case OP_LAST:
       fprintf_filtered (stream, "History element %ld",
-                       (long)exp->elts[elt].longconst);
+                       (long) exp->elts[elt].longconst);
       elt += 2;
       break;
     case OP_REGISTER:
       fprintf_filtered (stream, "Register %ld",
-                       (long)exp->elts[elt].longconst);
+                       (long) exp->elts[elt].longconst);
       elt += 2;
       break;
     case OP_INTERNALVAR:
@@ -809,14 +899,14 @@ dump_subexp (exp, stream, elt)
     case UNOP_MEMVAL:
     case UNOP_CAST:
       fprintf_filtered (stream, "Type @0x%x (",
-                         exp->elts[elt].type);
+                       exp->elts[elt].type);
       type_print (exp->elts[elt].type, NULL, stream, 0);
       fprintf_filtered (stream, ")");
       elt = dump_subexp (exp, stream, elt + 2);
       break;
     case OP_TYPE:
       fprintf_filtered (stream, "Type @0x%x (",
-                         exp->elts[elt].type);
+                       exp->elts[elt].type);
       type_print (exp->elts[elt].type, NULL, stream, 0);
       fprintf_filtered (stream, ")");
       elt += 2;
@@ -889,11 +979,11 @@ dump_postfix_expression (exp, stream, note)
   else
     fputs_filtered ("Type printing not yet supported....", stream);
   fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %d bytes each.\n",
-                   exp->language_defn->la_name, exp -> nelts,
+                   exp->language_defn->la_name, exp->nelts,
                    sizeof (union exp_element));
   fputs_filtered ("\n", stream);
 
-  for (elt = 0; elt < exp -> nelts;)
+  for (elt = 0; elt < exp->nelts;)
     elt = dump_subexp (exp, stream, elt);
   fputs_filtered ("\n", stream);
 }
index 52471c5a9f631d928ca5e3f85f50766f35c473ef..4408e8d304f93a8dec1338190ecc29b5da163128 100644 (file)
@@ -1,27 +1,28 @@
 /* Definitions for expressions stored in reversed prefix form, for GDB.
    Copyright 1986, 1989, 1992, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (EXPRESSION_H)
 #define EXPRESSION_H 1
 
 
-#include "symtab.h"  /* Needed for "struct block" type. */
+#include "symtab.h"            /* Needed for "struct block" type. */
 
 
 /* Definitions for saved C expressions.  */
@@ -40,288 +41,288 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    by the preceding opcode.  */
 
 enum exp_opcode
-{
-  /* Used when it's necessary to pass an opcode which will be ignored,
-     or to catch uninitialized values.  */
-  OP_NULL,
+  {
+    /* Used when it's necessary to pass an opcode which will be ignored,
+       or to catch uninitialized values.  */
+    OP_NULL,
 
 /* BINOP_... operate on two values computed by following subexpressions,
    replacing them by one result value.  They take no immediate arguments.  */
 
-  BINOP_ADD,           /* + */
-  BINOP_SUB,           /* - */
-  BINOP_MUL,           /* * */
-  BINOP_DIV,           /* / */
-  BINOP_REM,           /* % */
-  BINOP_MOD,           /* mod (Knuth 1.2.4) */
-  BINOP_LSH,           /* << */
-  BINOP_RSH,           /* >> */
-  BINOP_LOGICAL_AND,   /* && */
-  BINOP_LOGICAL_OR,    /* || */
-  BINOP_BITWISE_AND,   /* & */
-  BINOP_BITWISE_IOR,   /* | */
-  BINOP_BITWISE_XOR,   /* ^ */
-  BINOP_EQUAL,         /* == */
-  BINOP_NOTEQUAL,      /* != */
-  BINOP_LESS,          /* < */
-  BINOP_GTR,           /* > */
-  BINOP_LEQ,           /* <= */
-  BINOP_GEQ,           /* >= */
-  BINOP_REPEAT,                /* @ */
-  BINOP_ASSIGN,                /* = */
-  BINOP_COMMA,         /* , */
-  BINOP_SUBSCRIPT,     /* x[y] */
-  BINOP_EXP,           /* Exponentiation */
-
-  /* C++.  */
-
-  BINOP_MIN,           /* <? */
-  BINOP_MAX,           /* >? */
-  BINOP_SCOPE,         /* :: */
-
-  /* STRUCTOP_MEMBER is used for pointer-to-member constructs.
-     X . * Y translates into X STRUCTOP_MEMBER Y.  */
-  STRUCTOP_MEMBER,
-
-  /* STRUCTOP_MPTR is used for pointer-to-member constructs
-     when X is a pointer instead of an aggregate.  */
-  STRUCTOP_MPTR,
-
-  /* end of C++.  */
-
-  /* For Modula-2 integer division DIV */
-  BINOP_INTDIV,
-
-  BINOP_ASSIGN_MODIFY, /* +=, -=, *=, and so on.
-                          The following exp_element is another opcode,
-                          a BINOP_, saying how to modify.
-                          Then comes another BINOP_ASSIGN_MODIFY,
-                          making three exp_elements in total.  */
-
-  /* Modula-2 standard (binary) procedures */
-  BINOP_VAL,
-  BINOP_INCL,
-  BINOP_EXCL,
-
-  /* Concatenate two operands, such as character strings or bitstrings.
-     If the first operand is a integer expression, then it means concatenate
-     the second operand with itself that many times. */
-  BINOP_CONCAT,
-
-  /* For Chill and Pascal. */
-  BINOP_IN, /* Returns 1 iff ARG1 IN ARG2. */
-
-  /* This is the "colon operator" used various places in Chill. */
-  BINOP_RANGE,
-
-  /* This must be the highest BINOP_ value, for expprint.c.  */
-  BINOP_END,
-
-  /* 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.  */
-  TERNOP_SLICE,
-
-  /* A sub-string/sub-array.  Chill 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,...].
-     The dimensionality is encoded in the operator, like the number of
-     function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
-     The value of the first following subexpression is subscripted
-     by each of the next following subexpressions, one per dimension. */
-   MULTI_SUBSCRIPT,
-
-  /* The OP_... series take immediate following arguments.
-     After the arguments come another OP_... (the same one)
-     so that the grouping can be recognized from the end.  */
-
-  /* OP_LONG is followed by a type pointer in the next exp_element
-     and the long constant value in the following exp_element.
-     Then comes another OP_LONG.
-     Thus, the operation occupies four exp_elements.  */
-  OP_LONG,
-
-  /* OP_DOUBLE is similar but takes a DOUBLEST constant instead of a long.  */
-  OP_DOUBLE,
-
-  /* OP_VAR_VALUE takes one struct block * in the following element,
-     and one struct symbol * in the following exp_element, followed by
-     another OP_VAR_VALUE, making four exp_elements.  If the block is
-     non-NULL, evaluate the symbol relative to the innermost frame
-     executing in that block; if the block is NULL use the selected frame.  */
-  OP_VAR_VALUE,
-
-  /* OP_LAST is followed by an integer in the next exp_element.
-     The integer is zero for the last value printed,
-     or it is the absolute number of a history element.
-     With another OP_LAST at the end, this makes three exp_elements.  */
-  OP_LAST,
-
-  /* OP_REGISTER is followed by an integer in the next exp_element.
-     This is the number of a register to fetch (as an int).
-     With another OP_REGISTER at the end, this makes three exp_elements.  */
-  OP_REGISTER,
-
-  /* OP_INTERNALVAR is followed by an internalvar ptr in the next exp_element.
-     With another OP_INTERNALVAR at the end, this makes three exp_elements.  */
-  OP_INTERNALVAR,
-
-  /* OP_FUNCALL is followed by an integer in the next exp_element.
-     The integer is the number of args to the function call.
-     That many plus one values from following subexpressions
-     are used, the first one being the function.
-     The integer is followed by a repeat of OP_FUNCALL,
-     making three exp_elements.  */
-  OP_FUNCALL,
-
-  /* This is EXACTLY like OP_FUNCALL but is semantically different.  
-     In F77, array subscript expressions, substring expressions
-     and function calls are  all exactly the same syntactically. They may 
-     only be dismabiguated at runtime.  Thus this operator, which 
-     indicates that we have found something of the form <name> ( <stuff> ) */ 
-  OP_F77_UNDETERMINED_ARGLIST,
-  
-  /* The following OP is a special one, it introduces a F77 complex
-     literal. It is followed by exactly two args that are doubles.  */ 
-  OP_COMPLEX,
-
-  /* OP_STRING represents a string constant.
-     Its format is the same as that of a STRUCTOP, but the string
-     data is just made into a string constant when the operation
-     is executed.  */
-  OP_STRING,
-
-  /* OP_BITSTRING represents a packed bitstring constant.
-     Its format is the same as that of a STRUCTOP, but the bitstring
-     data is just made into a bitstring constant when the operation
-     is executed.  */
-  OP_BITSTRING,
-
-  /* OP_ARRAY creates an array constant out of the following subexpressions.
-     It is followed by two exp_elements, the first containing an integer
-     that is the lower bound of the array and the second containing another
-     integer that is the upper bound of the array.  The second integer is
-     followed by a repeat of OP_ARRAY, making four exp_elements total.
-     The bounds are used to compute the number of following subexpressions
-     to consume, as well as setting the bounds in the created array constant.
-     The type of the elements is taken from the type of the first subexp,
-     and they must all match. */
-  OP_ARRAY,
-
-  /* UNOP_CAST is followed by a type pointer in the next exp_element.
-     With another UNOP_CAST at the end, this makes three exp_elements.
-     It casts the value of the following subexpression.  */
-  UNOP_CAST,
-
-  /* UNOP_MEMVAL is followed by a type pointer in the next exp_element
-     With another UNOP_MEMVAL at the end, this makes three exp_elements.
-     It casts the contents of the word addressed by the value of the
-     following subexpression.  */
-  UNOP_MEMVAL,
-
-  /* UNOP_... operate on one value from a following subexpression
-     and replace it with a result.  They take no immediate arguments.  */
-
-  UNOP_NEG,            /* Unary - */
-  UNOP_LOGICAL_NOT,    /* Unary ! */
-  UNOP_COMPLEMENT,     /* Unary ~ */
-  UNOP_IND,            /* Unary * */
-  UNOP_ADDR,           /* Unary & */
-  UNOP_PREINCREMENT,   /* ++ before an expression */
-  UNOP_POSTINCREMENT,  /* ++ after an expression */
-  UNOP_PREDECREMENT,   /* -- before an expression */
-  UNOP_POSTDECREMENT,  /* -- after an expression */
-  UNOP_SIZEOF,         /* Unary sizeof (followed by expression) */
-
-  UNOP_PLUS,           /* Unary plus */
-
-  UNOP_CAP,            /* Modula-2 standard (unary) procedures */
-  UNOP_CHR,
-  UNOP_ORD,
-  UNOP_ABS,
-  UNOP_FLOAT,
-  UNOP_HIGH,
-  UNOP_MAX,
-  UNOP_MIN,
-  UNOP_ODD,
-  UNOP_TRUNC,
-
-  /* Chill builtin functions. */
-  UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH, UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN,
-
-  OP_BOOL,             /* Modula-2 builtin BOOLEAN type */
-  OP_M2_STRING,                /* Modula-2 string constants */
-
-  /* STRUCTOP_... operate on a value from a following subexpression
-     by extracting a structure component specified by a string
-     that appears in the following exp_elements (as many as needed).
-     STRUCTOP_STRUCT is used for "." and STRUCTOP_PTR for "->".
-     They differ only in the error message given in case the value is
-     not suitable or the structure component specified is not found.
-
-     The length of the string follows the opcode, followed by
-     BYTES_TO_EXP_ELEM(length) elements containing the data of the
-     string, followed by the length again and the opcode again.  */
-
-  STRUCTOP_STRUCT,
-  STRUCTOP_PTR,
-
-  /* C++ */
-  /* OP_THIS is just a placeholder for the class instance variable.
-     It just comes in a tight (OP_THIS, OP_THIS) pair.  */
-  OP_THIS,
-
-  /* OP_SCOPE surrounds a type name and a field name.  The type
-     name is encoded as one element, but the field name stays as
-     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).
-
-     The NAME is represented as for STRUCTOP_STRUCT;  VALUE follows. */
-  OP_LABELED,
-
-  /* OP_TYPE is for parsing types, and used with the "ptype" command
-     so we can look up types that are qualified by scope, either with
-     the GDB "::" operator, or the Modula-2 '.' operator. */
-  OP_TYPE,
-
-  /* An un-looked-up identifier. */
-  OP_NAME,
-
-  /* An unparsed expression.  Used for Scheme (for now at least) */
-  OP_EXPRSTRING
-};
+    BINOP_ADD,                 /* + */
+    BINOP_SUB,                 /* - */
+    BINOP_MUL,                 /* * */
+    BINOP_DIV,                 /* / */
+    BINOP_REM,                 /* % */
+    BINOP_MOD,                 /* mod (Knuth 1.2.4) */
+    BINOP_LSH,                 /* << */
+    BINOP_RSH,                 /* >> */
+    BINOP_LOGICAL_AND,         /* && */
+    BINOP_LOGICAL_OR,          /* || */
+    BINOP_BITWISE_AND,         /* & */
+    BINOP_BITWISE_IOR,         /* | */
+    BINOP_BITWISE_XOR,         /* ^ */
+    BINOP_EQUAL,               /* == */
+    BINOP_NOTEQUAL,            /* != */
+    BINOP_LESS,                        /* < */
+    BINOP_GTR,                 /* > */
+    BINOP_LEQ,                 /* <= */
+    BINOP_GEQ,                 /* >= */
+    BINOP_REPEAT,              /* @ */
+    BINOP_ASSIGN,              /* = */
+    BINOP_COMMA,               /* , */
+    BINOP_SUBSCRIPT,           /* x[y] */
+    BINOP_EXP,                 /* Exponentiation */
+
+    /* C++.  */
+
+    BINOP_MIN,                 /* <? */
+    BINOP_MAX,                 /* >? */
+    BINOP_SCOPE,               /* :: */
+
+    /* STRUCTOP_MEMBER is used for pointer-to-member constructs.
+       X . * Y translates into X STRUCTOP_MEMBER Y.  */
+    STRUCTOP_MEMBER,
+
+    /* STRUCTOP_MPTR is used for pointer-to-member constructs
+       when X is a pointer instead of an aggregate.  */
+    STRUCTOP_MPTR,
+
+    /* end of C++.  */
+
+    /* For Modula-2 integer division DIV */
+    BINOP_INTDIV,
+
+    BINOP_ASSIGN_MODIFY,       /* +=, -=, *=, and so on.
+                                  The following exp_element is another opcode,
+                                  a BINOP_, saying how to modify.
+                                  Then comes another BINOP_ASSIGN_MODIFY,
+                                  making three exp_elements in total.  */
+
+    /* Modula-2 standard (binary) procedures */
+    BINOP_VAL,
+    BINOP_INCL,
+    BINOP_EXCL,
+
+    /* Concatenate two operands, such as character strings or bitstrings.
+       If the first operand is a integer expression, then it means concatenate
+       the second operand with itself that many times. */
+    BINOP_CONCAT,
+
+    /* For Chill and Pascal. */
+    BINOP_IN,                  /* Returns 1 iff ARG1 IN ARG2. */
+
+    /* This is the "colon operator" used various places in Chill. */
+    BINOP_RANGE,
+
+    /* This must be the highest BINOP_ value, for expprint.c.  */
+    BINOP_END,
+
+    /* 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.  */
+    TERNOP_SLICE,
+
+    /* A sub-string/sub-array.  Chill 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,...].
+       The dimensionality is encoded in the operator, like the number of
+       function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
+       The value of the first following subexpression is subscripted
+       by each of the next following subexpressions, one per dimension. */
+    MULTI_SUBSCRIPT,
+
+    /* The OP_... series take immediate following arguments.
+       After the arguments come another OP_... (the same one)
+       so that the grouping can be recognized from the end.  */
+
+    /* OP_LONG is followed by a type pointer in the next exp_element
+       and the long constant value in the following exp_element.
+       Then comes another OP_LONG.
+       Thus, the operation occupies four exp_elements.  */
+    OP_LONG,
+
+    /* OP_DOUBLE is similar but takes a DOUBLEST constant instead of a long.  */
+    OP_DOUBLE,
+
+    /* OP_VAR_VALUE takes one struct block * in the following element,
+       and one struct symbol * in the following exp_element, followed by
+       another OP_VAR_VALUE, making four exp_elements.  If the block is
+       non-NULL, evaluate the symbol relative to the innermost frame
+       executing in that block; if the block is NULL use the selected frame.  */
+    OP_VAR_VALUE,
+
+    /* OP_LAST is followed by an integer in the next exp_element.
+       The integer is zero for the last value printed,
+       or it is the absolute number of a history element.
+       With another OP_LAST at the end, this makes three exp_elements.  */
+    OP_LAST,
+
+    /* OP_REGISTER is followed by an integer in the next exp_element.
+       This is the number of a register to fetch (as an int).
+       With another OP_REGISTER at the end, this makes three exp_elements.  */
+    OP_REGISTER,
+
+    /* OP_INTERNALVAR is followed by an internalvar ptr in the next exp_element.
+       With another OP_INTERNALVAR at the end, this makes three exp_elements.  */
+    OP_INTERNALVAR,
+
+    /* OP_FUNCALL is followed by an integer in the next exp_element.
+       The integer is the number of args to the function call.
+       That many plus one values from following subexpressions
+       are used, the first one being the function.
+       The integer is followed by a repeat of OP_FUNCALL,
+       making three exp_elements.  */
+    OP_FUNCALL,
+
+    /* This is EXACTLY like OP_FUNCALL but is semantically different.  
+       In F77, array subscript expressions, substring expressions
+       and function calls are  all exactly the same syntactically. They may 
+       only be dismabiguated at runtime.  Thus this operator, which 
+       indicates that we have found something of the form <name> ( <stuff> ) */
+    OP_F77_UNDETERMINED_ARGLIST,
+
+    /* The following OP is a special one, it introduces a F77 complex
+       literal. It is followed by exactly two args that are doubles.  */
+    OP_COMPLEX,
+
+    /* OP_STRING represents a string constant.
+       Its format is the same as that of a STRUCTOP, but the string
+       data is just made into a string constant when the operation
+       is executed.  */
+    OP_STRING,
+
+    /* OP_BITSTRING represents a packed bitstring constant.
+       Its format is the same as that of a STRUCTOP, but the bitstring
+       data is just made into a bitstring constant when the operation
+       is executed.  */
+    OP_BITSTRING,
+
+    /* OP_ARRAY creates an array constant out of the following subexpressions.
+       It is followed by two exp_elements, the first containing an integer
+       that is the lower bound of the array and the second containing another
+       integer that is the upper bound of the array.  The second integer is
+       followed by a repeat of OP_ARRAY, making four exp_elements total.
+       The bounds are used to compute the number of following subexpressions
+       to consume, as well as setting the bounds in the created array constant.
+       The type of the elements is taken from the type of the first subexp,
+       and they must all match. */
+    OP_ARRAY,
+
+    /* UNOP_CAST is followed by a type pointer in the next exp_element.
+       With another UNOP_CAST at the end, this makes three exp_elements.
+       It casts the value of the following subexpression.  */
+    UNOP_CAST,
+
+    /* UNOP_MEMVAL is followed by a type pointer in the next exp_element
+       With another UNOP_MEMVAL at the end, this makes three exp_elements.
+       It casts the contents of the word addressed by the value of the
+       following subexpression.  */
+    UNOP_MEMVAL,
+
+    /* UNOP_... operate on one value from a following subexpression
+       and replace it with a result.  They take no immediate arguments.  */
+
+    UNOP_NEG,                  /* Unary - */
+    UNOP_LOGICAL_NOT,          /* Unary ! */
+    UNOP_COMPLEMENT,           /* Unary ~ */
+    UNOP_IND,                  /* Unary * */
+    UNOP_ADDR,                 /* Unary & */
+    UNOP_PREINCREMENT,         /* ++ before an expression */
+    UNOP_POSTINCREMENT,                /* ++ after an expression */
+    UNOP_PREDECREMENT,         /* -- before an expression */
+    UNOP_POSTDECREMENT,                /* -- after an expression */
+    UNOP_SIZEOF,               /* Unary sizeof (followed by expression) */
+
+    UNOP_PLUS,                 /* Unary plus */
+
+    UNOP_CAP,                  /* Modula-2 standard (unary) procedures */
+    UNOP_CHR,
+    UNOP_ORD,
+    UNOP_ABS,
+    UNOP_FLOAT,
+    UNOP_HIGH,
+    UNOP_MAX,
+    UNOP_MIN,
+    UNOP_ODD,
+    UNOP_TRUNC,
+
+    /* Chill builtin functions. */
+    UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH, UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN,
+
+    OP_BOOL,                   /* Modula-2 builtin BOOLEAN type */
+    OP_M2_STRING,              /* Modula-2 string constants */
+
+    /* STRUCTOP_... operate on a value from a following subexpression
+       by extracting a structure component specified by a string
+       that appears in the following exp_elements (as many as needed).
+       STRUCTOP_STRUCT is used for "." and STRUCTOP_PTR for "->".
+       They differ only in the error message given in case the value is
+       not suitable or the structure component specified is not found.
+
+       The length of the string follows the opcode, followed by
+       BYTES_TO_EXP_ELEM(length) elements containing the data of the
+       string, followed by the length again and the opcode again.  */
+
+    STRUCTOP_STRUCT,
+    STRUCTOP_PTR,
+
+    /* C++ */
+    /* OP_THIS is just a placeholder for the class instance variable.
+       It just comes in a tight (OP_THIS, OP_THIS) pair.  */
+    OP_THIS,
+
+    /* OP_SCOPE surrounds a type name and a field name.  The type
+       name is encoded as one element, but the field name stays as
+       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).
+
+       The NAME is represented as for STRUCTOP_STRUCT;  VALUE follows. */
+    OP_LABELED,
+
+    /* OP_TYPE is for parsing types, and used with the "ptype" command
+       so we can look up types that are qualified by scope, either with
+       the GDB "::" operator, or the Modula-2 '.' operator. */
+    OP_TYPE,
+
+    /* An un-looked-up identifier. */
+    OP_NAME,
+
+    /* An unparsed expression.  Used for Scheme (for now at least) */
+    OP_EXPRSTRING
+  };
 
 union exp_element
-{
-  enum exp_opcode opcode;
-  struct symbol *symbol;
-  LONGEST longconst;
-  DOUBLEST doubleconst;
-  /* Really sizeof (union exp_element) characters (or less for the last
-     element of a string).  */
-  char string;
-  struct type *type;
-  struct internalvar *internalvar;
-  struct block *block;
-};
+  {
+    enum exp_opcode opcode;
+    struct symbol *symbol;
+    LONGEST longconst;
+    DOUBLEST doubleconst;
+    /* Really sizeof (union exp_element) characters (or less for the last
+       element of a string).  */
+    char string;
+    struct type *type;
+    struct internalvar *internalvar;
+    struct block *block;
+  };
 
 struct expression
-{
-  const struct language_defn *language_defn;  /* language it was entered in */
-  int nelts;
-  union exp_element elts[1];
-};
+  {
+    const struct language_defn *language_defn; /* language it was entered in */
+    int nelts;
+    union exp_element elts[1];
+  };
 
 /* Macros for converting between number of expression elements and bytes
    to store that many expression elements. */
@@ -347,10 +348,10 @@ extern struct block *innermost_block;
 /* Values of NOSIDE argument to eval_subexp.  */
 
 enum noside
-{
-  EVAL_NORMAL,
-  EVAL_SKIP,                   /* Only effect is to increment pos.  */
-  EVAL_AVOID_SIDE_EFFECTS      /* Don't modify any variables or
+  {
+    EVAL_NORMAL,
+    EVAL_SKIP,                 /* Only effect is to increment pos.  */
+    EVAL_AVOID_SIDE_EFFECTS    /* Don't modify any variables or
                                   call any functions.  The value
                                   returned will have the correct
                                   type, and will have an
@@ -359,10 +360,10 @@ enum noside
                                   listed as being in a register in
                                   the function in which it was
                                   declared will be lval_register).  */
-};
+  };
 
-extern struct valueevaluate_subexp_standard
-PARAMS ((struct type *, struct expression *, int*, enum noside));
+extern struct value *evaluate_subexp_standard
+  PARAMS ((struct type *, struct expression *, int *, enum noside));
 
 /* From expprint.c */
 
@@ -377,4 +378,4 @@ extern void dump_postfix_expression PARAMS ((struct expression *,
                                             GDB_FILE *,
                                             char *));
 
-#endif /* !defined (EXPRESSION_H) */
+#endif /* !defined (EXPRESSION_H) */
index 53dce631981d5b2b494c563b3415a1de98798b27..6e67fbce9d93fb018765d6baeed220f807886c74 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Motorola.  Adapted from the C parser by Farooq Butt
    (fmbutt@engage.sps.mot.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -35,7 +36,7 @@ struct type *builtin_type_f_character;
 struct type *builtin_type_f_logical;
 struct type *builtin_type_f_logical_s1;
 struct type *builtin_type_f_logical_s2;
-struct type *builtin_type_f_integer; 
+struct type *builtin_type_f_integer;
 struct type *builtin_type_f_integer_s2;
 struct type *builtin_type_f_real;
 struct type *builtin_type_f_real_s8;
@@ -48,21 +49,21 @@ struct type *builtin_type_f_void;
 /* Following is dubious stuff that had been in the xcoff reader. */
 
 struct saved_fcn
-{
-  long                         line_offset;  /* Line offset for function */ 
-  struct saved_fcn             *next;      
-}; 
+  {
+    long line_offset;          /* Line offset for function */
+    struct saved_fcn *next;
+  };
 
 
-struct saved_bf_symnum 
-{
-  long       symnum_fcn;  /* Symnum of function (i.e. .function directive) */
-  long       symnum_bf;   /* Symnum of .bf for this function */ 
-  struct saved_bf_symnum *next;  
-}; 
+struct saved_bf_symnum
+  {
+    long symnum_fcn;           /* Symnum of function (i.e. .function directive) */
+    long symnum_bf;            /* Symnum of .bf for this function */
+    struct saved_bf_symnum *next;
+  };
 
-typedef struct saved_fcn           SAVED_FUNCTION, *SAVED_FUNCTION_PTR; 
-typedef struct saved_bf_symnum     SAVED_BF, *SAVED_BF_PTR; 
+typedef struct saved_fcn SAVED_FUNCTION, *SAVED_FUNCTION_PTR;
+typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR;
 
 /* Local functions */
 
@@ -83,9 +84,9 @@ static void patch_common_entries PARAMS ((SAVED_F77_COMMON_PTR, CORE_ADDR, int))
 #endif
 
 static struct type *f_create_fundamental_type PARAMS ((struct objfile *, int));
-static void f_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
-static void f_printchar PARAMS ((int c, GDB_FILE *stream));
-static void f_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+static void f_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
+static void f_printchar PARAMS ((int c, GDB_FILE * stream));
+static void f_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
 
 /* Print the character C on STREAM as part of the contents of a literal
    string whose delimiter is QUOTER.  Note that that format for printing
@@ -100,7 +101,7 @@ f_emit_char (c, stream, quoter)
      int quoter;
 {
   c &= 0xFF;                   /* Avoid sign bit follies */
-  
+
   if (PRINT_LITERAL_FORM (c))
     {
       if (c == '\\' || c == quoter)
@@ -174,29 +175,29 @@ f_printstr (stream, string, length, width, force_ellipses)
   extern int inspect_it;
   extern int repeat_count_threshold;
   extern int print_max;
-  
+
   if (length == 0)
     {
       fputs_filtered ("''", gdb_stdout);
       return;
     }
-  
+
   for (i = 0; i < length && things_printed < print_max; ++i)
     {
       /* 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;
-      
+
       QUIT;
-      
+
       if (need_comma)
        {
          fputs_filtered (", ", stream);
          need_comma = 0;
        }
-      
+
       rep1 = i + 1;
       reps = 1;
       while (rep1 < length && string[rep1] == string[i])
@@ -204,7 +205,7 @@ f_printstr (stream, string, length, width, force_ellipses)
          ++rep1;
          ++reps;
        }
-      
+
       if (reps > repeat_count_threshold)
        {
          if (in_quotes)
@@ -235,7 +236,7 @@ f_printstr (stream, string, length, width, force_ellipses)
          ++things_printed;
        }
     }
-  
+
   /* Terminate the quotes if necessary.  */
   if (in_quotes)
     {
@@ -244,7 +245,7 @@ f_printstr (stream, string, length, width, force_ellipses)
       else
        fputs_filtered ("'", stream);
     }
-  
+
   if (force_ellipses || i < length)
     fputs_filtered ("...", stream);
 }
@@ -259,7 +260,7 @@ f_create_fundamental_type (objfile, typeid)
      int typeid;
 {
   register struct type *type = NULL;
-  
+
   switch (typeid)
     {
     case FT_VOID:
@@ -315,10 +316,10 @@ f_create_fundamental_type (objfile, typeid)
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
                        TARGET_INT_BIT / TARGET_CHAR_BIT,
-                       0, "integer", objfile); /* FIXME -fnf */
+                       0, "integer", objfile);         /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
-      type = init_type (TYPE_CODE_BOOL, 
+      type = init_type (TYPE_CODE_BOOL,
                        TARGET_INT_BIT / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, "logical*4", objfile);
       break;
@@ -335,7 +336,7 @@ f_create_fundamental_type (objfile, typeid)
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
-                       0, "long", objfile); /* FIXME -fnf */
+                       0, "long", objfile);    /* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
@@ -397,9 +398,9 @@ f_create_fundamental_type (objfile, typeid)
       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. */
+         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);
@@ -408,52 +409,53 @@ f_create_fundamental_type (objfile, typeid)
     }
   return (type);
 }
-
 \f
+
 /* Table of operators and their precedences for printing expressions.  */
 
-static const struct op_print f_op_print_tab[] = {
-  { "+",     BINOP_ADD, PREC_ADD, 0 },
-  { "+",     UNOP_PLUS, PREC_PREFIX, 0 },
-  { "-",     BINOP_SUB, PREC_ADD, 0 },
-  { "-",     UNOP_NEG, PREC_PREFIX, 0 },
-  { "*",     BINOP_MUL, PREC_MUL, 0 },
-  { "/",     BINOP_DIV, PREC_MUL, 0 },
-  { "DIV",   BINOP_INTDIV, PREC_MUL, 0 },
-  { "MOD",   BINOP_REM, PREC_MUL, 0 },
-  { "=",     BINOP_ASSIGN, PREC_ASSIGN, 1 },
-  { ".OR.",  BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0 },
-  { ".AND.", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0 },
-  { ".NOT.", UNOP_LOGICAL_NOT, PREC_PREFIX, 0 },
-  { ".EQ.",  BINOP_EQUAL, PREC_EQUAL, 0 },
-  { ".NE.",  BINOP_NOTEQUAL, PREC_EQUAL, 0 },
-  { ".LE.",  BINOP_LEQ, PREC_ORDER, 0 },
-  { ".GE.",  BINOP_GEQ, PREC_ORDER, 0 },
-  { ".GT.",  BINOP_GTR, PREC_ORDER, 0 },
-  { ".LT.",  BINOP_LESS, PREC_ORDER, 0 },
-  { "**",    UNOP_IND, PREC_PREFIX, 0 },
-  { "@",     BINOP_REPEAT, PREC_REPEAT, 0 },
-  { NULL,    0, 0, 0 }
+static const struct op_print f_op_print_tab[] =
+{
+  {"+", BINOP_ADD, PREC_ADD, 0},
+  {"+", UNOP_PLUS, PREC_PREFIX, 0},
+  {"-", BINOP_SUB, PREC_ADD, 0},
+  {"-", UNOP_NEG, PREC_PREFIX, 0},
+  {"*", BINOP_MUL, PREC_MUL, 0},
+  {"/", BINOP_DIV, PREC_MUL, 0},
+  {"DIV", BINOP_INTDIV, PREC_MUL, 0},
+  {"MOD", BINOP_REM, PREC_MUL, 0},
+  {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+  {".OR.", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+  {".AND.", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+  {".NOT.", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+  {".EQ.", BINOP_EQUAL, PREC_EQUAL, 0},
+  {".NE.", BINOP_NOTEQUAL, PREC_EQUAL, 0},
+  {".LE.", BINOP_LEQ, PREC_ORDER, 0},
+  {".GE.", BINOP_GEQ, PREC_ORDER, 0},
+  {".GT.", BINOP_GTR, PREC_ORDER, 0},
+  {".LT.", BINOP_LESS, PREC_ORDER, 0},
+  {"**", UNOP_IND, PREC_PREFIX, 0},
+  {"@", BINOP_REPEAT, PREC_REPEAT, 0},
+  {NULL, 0, 0, 0}
 };
 \f
-struct type ** CONST_PTR (f_builtin_types[]) = 
+struct type **CONST_PTR (f_builtin_types[]) =
 {
   &builtin_type_f_character,
-  &builtin_type_f_logical,
-  &builtin_type_f_logical_s1,
-  &builtin_type_f_logical_s2,
-  &builtin_type_f_integer,
-  &builtin_type_f_integer_s2,
-  &builtin_type_f_real,
-  &builtin_type_f_real_s8,
-  &builtin_type_f_real_s16,
-  &builtin_type_f_complex_s8,
-  &builtin_type_f_complex_s16,
+    &builtin_type_f_logical,
+    &builtin_type_f_logical_s1,
+    &builtin_type_f_logical_s2,
+    &builtin_type_f_integer,
+    &builtin_type_f_integer_s2,
+    &builtin_type_f_real,
+    &builtin_type_f_real_s8,
+    &builtin_type_f_real_s16,
+    &builtin_type_f_complex_s8,
+    &builtin_type_f_complex_s16,
 #if 0
-  &builtin_type_f_complex_s32,
+    &builtin_type_f_complex_s32,
 #endif
-  &builtin_type_f_void,
-  0
+    &builtin_type_f_void,
+    0
 };
 
 /* This is declared in c-lang.h but it is silly to import that file for what
@@ -461,7 +463,8 @@ struct type ** CONST_PTR (f_builtin_types[]) =
 extern int
 c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
 
-const struct language_defn f_language_defn = {
+const struct language_defn f_language_defn =
+{
   "fortran",
   language_fortran,
   f_builtin_types,
@@ -474,19 +477,19 @@ const struct language_defn f_language_defn = {
   f_printstr,                  /* function to print string constant */
   f_emit_char,                 /* Function to print a single character */
   f_create_fundamental_type,   /* Create fundamental type in this language */
-  f_print_type,                        /* Print a type using appropriate syntax */
+  f_print_type,                        /* Print a type using appropriate syntax */
   f_val_print,                 /* Print a value using appropriate syntax */
-  c_value_print,  /* FIXME */
-  {"",      "",   "",   ""},   /* Binary format info */
-  {"0%o",  "0",   "o", ""},    /* Octal format info */
-  {"%d",   "",    "d", ""},    /* Decimal format info */
-  {"0x%x", "0x",  "x", ""},    /* Hex format info */
+  c_value_print,               /* FIXME */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%o", "0", "o", ""},       /* Octal format info */
+  {"%d", "", "d", ""},         /* Decimal format info */
+  {"0x%x", "0x", "x", ""},     /* Hex format info */
   f_op_print_tab,              /* expression operators for printing */
   0,                           /* arrays are first-class (not c-style) */
   1,                           /* String lower bound */
-  &builtin_type_f_character,   /* Type of string elements */ 
+  &builtin_type_f_character,   /* Type of string elements */
   LANG_MAGIC
-  };
+};
 
 void
 _initialize_f_language ()
@@ -495,68 +498,68 @@ _initialize_f_language ()
     init_type (TYPE_CODE_VOID, 1,
               0,
               "VOID", (struct objfile *) NULL);
-  
+
   builtin_type_f_character =
     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
               0,
               "character", (struct objfile *) NULL);
-  
+
   builtin_type_f_logical_s1 =
     init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "logical*1", (struct objfile *) NULL);
-  
+
   builtin_type_f_integer_s2 =
     init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
               0,
               "integer*2", (struct objfile *) NULL);
-  
+
   builtin_type_f_logical_s2 =
     init_type (TYPE_CODE_BOOL, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "logical*2", (struct objfile *) NULL);
-  
+
   builtin_type_f_integer =
     init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
               0,
               "integer", (struct objfile *) NULL);
-  
+
   builtin_type_f_logical =
     init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "logical*4", (struct objfile *) NULL);
-  
+
   builtin_type_f_real =
     init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
               0,
               "real", (struct objfile *) NULL);
-  
+
   builtin_type_f_real_s8 =
     init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "real*8", (struct objfile *) NULL);
-  
+
   builtin_type_f_real_s16 =
     init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "real*16", (struct objfile *) NULL);
-  
+
   builtin_type_f_complex_s8 =
     init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
               0,
               "complex*8", (struct objfile *) NULL);
   TYPE_TARGET_TYPE (builtin_type_f_complex_s8) = builtin_type_f_real;
-  
+
   builtin_type_f_complex_s16 =
     init_type (TYPE_CODE_COMPLEX, 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "complex*16", (struct objfile *) NULL);
   TYPE_TARGET_TYPE (builtin_type_f_complex_s16) = builtin_type_f_real_s8;
-  
+
   /* We have a new size == 4 double floats for the
      complex*32 data type */
-  
-  builtin_type_f_complex_s32 = 
+
+  builtin_type_f_complex_s32 =
     init_type (TYPE_CODE_COMPLEX, 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "complex*32", (struct objfile *) NULL);
@@ -565,215 +568,218 @@ _initialize_f_language ()
   builtin_type_string =
     init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
               0,
-              "character string", (struct objfile *) NULL); 
-  
+              "character string", (struct objfile *) NULL);
+
   add_language (&f_language_defn);
 }
 
 #if 0
 static SAVED_BF_PTR
-allocate_saved_bf_node()
+allocate_saved_bf_node ()
 {
   SAVED_BF_PTR new;
-  
+
   new = (SAVED_BF_PTR) xmalloc (sizeof (SAVED_BF));
-  return(new);
+  return (new);
 }
 
 static SAVED_FUNCTION *
-allocate_saved_function_node()
+allocate_saved_function_node ()
 {
   SAVED_FUNCTION *new;
-  
+
   new = (SAVED_FUNCTION *) xmalloc (sizeof (SAVED_FUNCTION));
-  return(new);
+  return (new);
 }
 
-static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node()
+static SAVED_F77_COMMON_PTR
+allocate_saved_f77_common_node ()
 {
   SAVED_F77_COMMON_PTR new;
-  
+
   new = (SAVED_F77_COMMON_PTR) xmalloc (sizeof (SAVED_F77_COMMON));
-  return(new);
+  return (new);
 }
 
-static COMMON_ENTRY_PTR allocate_common_entry_node()
+static COMMON_ENTRY_PTR
+allocate_common_entry_node ()
 {
   COMMON_ENTRY_PTR new;
-  
+
   new = (COMMON_ENTRY_PTR) xmalloc (sizeof (COMMON_ENTRY));
-  return(new);
+  return (new);
 }
 #endif
 
-SAVED_F77_COMMON_PTR head_common_list=NULL;     /* Ptr to 1st saved COMMON  */
-SAVED_F77_COMMON_PTR tail_common_list=NULL;     /* Ptr to last saved COMMON  */
-SAVED_F77_COMMON_PTR current_common=NULL;       /* Ptr to current COMMON */
+SAVED_F77_COMMON_PTR head_common_list = NULL;  /* Ptr to 1st saved COMMON  */
+SAVED_F77_COMMON_PTR tail_common_list = NULL;  /* Ptr to last saved COMMON  */
+SAVED_F77_COMMON_PTR current_common = NULL;    /* Ptr to current COMMON */
 
 #if 0
-static SAVED_BF_PTR saved_bf_list=NULL;          /* Ptr to (.bf,function) 
-                                                    list*/
-static SAVED_BF_PTR saved_bf_list_end=NULL;      /* Ptr to above list's end */
-static SAVED_BF_PTR current_head_bf_list=NULL;   /* Current head of above list
-                                                 */
+static SAVED_BF_PTR saved_bf_list = NULL;      /* Ptr to (.bf,function) 
+                                                  list */
+static SAVED_BF_PTR saved_bf_list_end = NULL;  /* Ptr to above list's end */
+static SAVED_BF_PTR current_head_bf_list = NULL;       /* Current head of above list
+                                                        */
 
-static SAVED_BF_PTR tmp_bf_ptr;                  /* Generic temporary for use 
-                                                    in macros */ 
+static SAVED_BF_PTR tmp_bf_ptr;        /* Generic temporary for use 
+                                  in macros */
 
 /* The following function simply enters a given common block onto 
    the global common block chain */
 
 static void
-add_common_block(name,offset,secnum,func_stab)
+add_common_block (name, offset, secnum, func_stab)
      char *name;
      CORE_ADDR offset;
      int secnum;
      char *func_stab;
 {
   SAVED_F77_COMMON_PTR tmp;
-  char *c,*local_copy_func_stab; 
-  
+  char *c, *local_copy_func_stab;
+
   /* If the COMMON block we are trying to add has a blank 
      name (i.e. "#BLNK_COM") then we set it to __BLANK
      because the darn "#" character makes GDB's input 
-     parser have fits. */ 
-  
-  
-  if (STREQ(name,BLANK_COMMON_NAME_ORIGINAL) ||
-      STREQ(name,BLANK_COMMON_NAME_MF77))
+     parser have fits. */
+
+
+  if (STREQ (name, BLANK_COMMON_NAME_ORIGINAL) ||
+      STREQ (name, BLANK_COMMON_NAME_MF77))
     {
-      
-      free(name);
-      name = alloca(strlen(BLANK_COMMON_NAME_LOCAL) + 1); 
-      strcpy(name,BLANK_COMMON_NAME_LOCAL); 
+
+      free (name);
+      name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
+      strcpy (name, BLANK_COMMON_NAME_LOCAL);
     }
-  
-  tmp = allocate_saved_f77_common_node();
-  
-  local_copy_func_stab = xmalloc (strlen(func_stab) + 1);
-  strcpy(local_copy_func_stab,func_stab); 
-  
-  tmp->name = xmalloc(strlen(name) + 1);
-  
+
+  tmp = allocate_saved_f77_common_node ();
+
+  local_copy_func_stab = xmalloc (strlen (func_stab) + 1);
+  strcpy (local_copy_func_stab, func_stab);
+
+  tmp->name = xmalloc (strlen (name) + 1);
+
   /* local_copy_func_stab is a stabstring, let us first extract the 
-     function name from the stab by NULLing out the ':' character. */ 
-  
-  
-  c = NULL; 
-  c = strchr(local_copy_func_stab,':');
-  
+     function name from the stab by NULLing out the ':' character. */
+
+
+  c = NULL;
+  c = strchr (local_copy_func_stab, ':');
+
   if (c)
     *c = '\0';
   else
-    error("Malformed function STAB found in add_common_block()");
-  
-  
-  tmp->owning_function = xmalloc (strlen(local_copy_func_stab) + 1); 
-  
-  strcpy(tmp->owning_function,local_copy_func_stab); 
-  
-  strcpy(tmp->name,name);
-  tmp->offset = offset; 
+    error ("Malformed function STAB found in add_common_block()");
+
+
+  tmp->owning_function = xmalloc (strlen (local_copy_func_stab) + 1);
+
+  strcpy (tmp->owning_function, local_copy_func_stab);
+
+  strcpy (tmp->name, name);
+  tmp->offset = offset;
   tmp->next = NULL;
   tmp->entries = NULL;
-  tmp->secnum = secnum; 
-  
+  tmp->secnum = secnum;
+
   current_common = tmp;
-  
+
   if (head_common_list == NULL)
     {
       head_common_list = tail_common_list = tmp;
     }
   else
     {
-      tail_common_list->next = tmp; 
+      tail_common_list->next = tmp;
       tail_common_list = tmp;
     }
 }
 #endif
 
 /* The following function simply enters a given common entry onto 
-   the "current_common" block that has been saved away. */ 
+   the "current_common" block that has been saved away. */
 
 #if 0
 static void
-add_common_entry(entry_sym_ptr)
-     struct symbol *entry_sym_ptr; 
+add_common_entry (entry_sym_ptr)
+     struct symbol *entry_sym_ptr;
 {
   COMMON_ENTRY_PTR tmp;
-  
-  
-  
+
+
+
   /* The order of this list is important, since 
      we expect the entries to appear in decl.
-     order when we later issue "info common" calls */ 
-  
-  tmp = allocate_common_entry_node();
-  
+     order when we later issue "info common" calls */
+
+  tmp = allocate_common_entry_node ();
+
   tmp->next = NULL;
   tmp->symbol = entry_sym_ptr;
-  
+
   if (current_common == NULL)
-    error("Attempt to add COMMON entry with no block open!");
-  else         
+    error ("Attempt to add COMMON entry with no block open!");
+  else
     {
       if (current_common->entries == NULL)
        {
          current_common->entries = tmp;
-         current_common->end_of_entries = tmp; 
+         current_common->end_of_entries = tmp;
        }
       else
        {
-         current_common->end_of_entries->next = tmp; 
-         current_common->end_of_entries = tmp; 
+         current_common->end_of_entries->next = tmp;
+         current_common->end_of_entries = tmp;
        }
     }
 }
 #endif
 
-/* This routine finds the first encountred COMMON block named "name" */ 
+/* This routine finds the first encountred COMMON block named "name" */
 
 #if 0
 static SAVED_F77_COMMON_PTR
-find_first_common_named(name)
-     char *name; 
+find_first_common_named (name)
+     char *name;
 {
-  
+
   SAVED_F77_COMMON_PTR tmp;
-  
+
   tmp = head_common_list;
-  
+
   while (tmp != NULL)
     {
-      if (STREQ(tmp->name,name))
-       return(tmp);
+      if (STREQ (tmp->name, name))
+       return (tmp);
       else
        tmp = tmp->next;
     }
-  return(NULL); 
+  return (NULL);
 }
 #endif
 
 /* This routine finds the first encountred COMMON block named "name" 
-   that belongs to function funcname */ 
+   that belongs to function funcname */
 
-SAVED_F77_COMMON_PTR find_common_for_function(name, funcname)
+SAVED_F77_COMMON_PTR
+find_common_for_function (name, funcname)
      char *name;
-     char *funcname; 
+     char *funcname;
 {
-  
+
   SAVED_F77_COMMON_PTR tmp;
-  
+
   tmp = head_common_list;
-  
+
   while (tmp != NULL)
     {
-      if (STREQ(tmp->name,name) && STREQ(tmp->owning_function,funcname))
-       return(tmp);
+      if (STREQ (tmp->name, name) && STREQ (tmp->owning_function, funcname))
+       return (tmp);
       else
        tmp = tmp->next;
     }
-  return(NULL); 
+  return (NULL);
 }
 
 
@@ -781,7 +787,7 @@ SAVED_F77_COMMON_PTR find_common_for_function(name, funcname)
 
 /* The following function is called to patch up the offsets 
    for the statics contained in the COMMON block named
-   "name."  */ 
+   "name."  */
 
 static void
 patch_common_entries (blk, offset, secnum)
@@ -790,19 +796,19 @@ patch_common_entries (blk, offset, secnum)
      int secnum;
 {
   COMMON_ENTRY_PTR entry;
-  
-  blk->offset = offset;  /* Keep this around for future use. */ 
-  
+
+  blk->offset = offset;                /* Keep this around for future use. */
+
   entry = blk->entries;
-  
+
   while (entry != NULL)
     {
-      SYMBOL_VALUE (entry->symbol) += offset; 
+      SYMBOL_VALUE (entry->symbol) += offset;
       SYMBOL_SECTION (entry->symbol) = secnum;
-      
+
       entry = entry->next;
     }
-  blk->secnum = secnum; 
+  blk->secnum = secnum;
 }
 
 /* Patch all commons named "name" that need patching.Since COMMON
@@ -817,30 +823,30 @@ patch_all_commons_by_name (name, offset, secnum)
      CORE_ADDR offset;
      int secnum;
 {
-  
+
   SAVED_F77_COMMON_PTR tmp;
-  
+
   /* For blank common blocks, change the canonical reprsentation 
      of a blank name */
-  
-  if ((STREQ(name,BLANK_COMMON_NAME_ORIGINAL)) ||
-      (STREQ(name,BLANK_COMMON_NAME_MF77)))
+
+  if ((STREQ (name, BLANK_COMMON_NAME_ORIGINAL)) ||
+      (STREQ (name, BLANK_COMMON_NAME_MF77)))
     {
-      free(name);
-      name = alloca(strlen(BLANK_COMMON_NAME_LOCAL) + 1); 
-      strcpy(name,BLANK_COMMON_NAME_LOCAL); 
+      free (name);
+      name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
+      strcpy (name, BLANK_COMMON_NAME_LOCAL);
     }
-  
+
   tmp = head_common_list;
-  
+
   while (tmp != NULL)
     {
-      if (COMMON_NEEDS_PATCHING(tmp))
-       if (STREQ(tmp->name,name))
-         patch_common_entries(tmp,offset,secnum); 
-      
+      if (COMMON_NEEDS_PATCHING (tmp))
+       if (STREQ (tmp->name, name))
+         patch_common_entries (tmp, offset, secnum);
+
       tmp = tmp->next;
-    }   
+    }
 }
 #endif
 
@@ -850,7 +856,7 @@ patch_all_commons_by_name (name, offset, secnum)
    #line pragmas sometimes cause line ranges to get messed up 
    we simply create a linear list.  This list can then be searched 
    first by a queueing algorithm and upon failure fall back to 
-   a linear scan. */ 
+   a linear scan. */
 
 #if 0
 #define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
@@ -876,24 +882,24 @@ else \
               \
                 saved_bf_list_end->next = tmp_bf_ptr;  \
                   saved_bf_list_end = tmp_bf_ptr; \
-                  } 
+                  }
 #endif
 
-/* This function frees the entire (.bf,function) list */ 
+/* This function frees the entire (.bf,function) list */
 
 #if 0
-static void 
-  clear_bf_list()
+static void
+clear_bf_list ()
 {
-  
+
   SAVED_BF_PTR tmp = saved_bf_list;
-  SAVED_BF_PTR next = NULL; 
-  
+  SAVED_BF_PTR next = NULL;
+
   while (tmp != NULL)
     {
       next = tmp->next;
-      free(tmp);
-      tmp=next;
+      free (tmp);
+      tmp = next;
     }
   saved_bf_list = NULL;
 }
@@ -909,66 +915,65 @@ get_bf_for_fcn (the_function)
 {
   SAVED_BF_PTR tmp;
   int nprobes = 0;
-  
+
   /* First use a simple queuing algorithm (i.e. look and see if the 
      item at the head of the queue is the one you want)  */
-  
+
   if (saved_bf_list == NULL)
-    fatal ("cannot get .bf node off empty list"); 
-  
-  if (current_head_bf_list != NULL) 
+    fatal ("cannot get .bf node off empty list");
+
+  if (current_head_bf_list != NULL)
     if (current_head_bf_list->symnum_fcn == the_function)
       {
-       if (global_remote_debug) 
-         fprintf(stderr,"*"); 
+       if (global_remote_debug)
+         fprintf (stderr, "*");
 
-       tmp = current_head_bf_list; 
+       tmp = current_head_bf_list;
        current_head_bf_list = current_head_bf_list->next;
-       return(tmp->symnum_bf); 
+       return (tmp->symnum_bf);
       }
-  
+
   /* If the above did not work (probably because #line directives were 
      used in the sourcefile and they messed up our internal tables) we now do
      the ugly linear scan */
-  
-  if (global_remote_debug) 
-    fprintf(stderr,"\ndefaulting to linear scan\n"); 
-  
-  nprobes = 0; 
+
+  if (global_remote_debug)
+    fprintf (stderr, "\ndefaulting to linear scan\n");
+
+  nprobes = 0;
   tmp = saved_bf_list;
   while (tmp != NULL)
     {
-      nprobes++; 
+      nprobes++;
       if (tmp->symnum_fcn == the_function)
-       { 
+       {
          if (global_remote_debug)
-           fprintf(stderr,"Found in %d probes\n",nprobes);
+           fprintf (stderr, "Found in %d probes\n", nprobes);
          current_head_bf_list = tmp->next;
-         return(tmp->symnum_bf);
-       } 
-      tmp= tmp->next; 
+         return (tmp->symnum_bf);
+       }
+      tmp = tmp->next;
     }
-  
-  return(-1); 
+
+  return (-1);
 }
 
-static SAVED_FUNCTION_PTR saved_function_list=NULL; 
-static SAVED_FUNCTION_PTR saved_function_list_end=NULL; 
+static SAVED_FUNCTION_PTR saved_function_list = NULL;
+static SAVED_FUNCTION_PTR saved_function_list_end = NULL;
 
 static void
-clear_function_list()
+clear_function_list ()
 {
   SAVED_FUNCTION_PTR tmp = saved_function_list;
-  SAVED_FUNCTION_PTR next = NULL; 
-  
+  SAVED_FUNCTION_PTR next = NULL;
+
   while (tmp != NULL)
     {
       next = tmp->next;
-      free(tmp);
+      free (tmp);
       tmp = next;
     }
-  
+
   saved_function_list = NULL;
 }
 #endif
-
index c6b8f028a23a5ebaf53bef4bd70b40fd170b7cfa..77f36752f8118e0bfdab15a5406b371163bd27e0 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 extern int f_parse PARAMS ((void));
 
@@ -26,67 +27,67 @@ extern void f_error PARAMS ((char *));      /* Defined in f-exp.y */
 extern void f_print_type PARAMS ((struct type *, char *,
                                  GDB_FILE *, int, int));
 
-extern int f_val_print PARAMS ((struct type *, char *, int, 
+extern int f_val_print PARAMS ((struct type *, char *, int,
                                CORE_ADDR, GDB_FILE *,
                                int, int, int, enum val_prettyprint));
 
-/* Language-specific data structures */ 
+/* Language-specific data structures */
 
 struct common_entry
-{
-  struct symbol *symbol;                    /* The symbol node corresponding
-                                              to this component */ 
-  struct common_entry *next;                /* The next component */ 
-};
+  {
+    struct symbol *symbol;     /* The symbol node corresponding
+                                  to this component */
+    struct common_entry *next; /* The next component */
+  };
 
 struct saved_f77_common
-{
-  char *name;                                /* Name of COMMON */
-  char *owning_function;                     /* Name of parent function */ 
-  int secnum;                                /* Section # of .bss */ 
-  CORE_ADDR offset;                          /* Offset from .bss for 
-                                               this block */
-  struct common_entry *entries;              /* List of block's components */
-  struct common_entry *end_of_entries;       /* ptr. to end of components */ 
-  struct saved_f77_common *next;              /* Next saved COMMON block */ 
-};
+  {
+    char *name;                        /* Name of COMMON */
+    char *owning_function;     /* Name of parent function */
+    int secnum;                        /* Section # of .bss */
+    CORE_ADDR offset;          /* Offset from .bss for 
+                                  this block */
+    struct common_entry *entries;      /* List of block's components */
+    struct common_entry *end_of_entries;       /* ptr. to end of components */
+    struct saved_f77_common *next;     /* Next saved COMMON block */
+  };
 
-typedef struct saved_f77_common    SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
+typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
 
-typedef struct common_entry        COMMON_ENTRY, *COMMON_ENTRY_PTR;
+typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
 
-extern SAVED_F77_COMMON_PTR head_common_list;   /* Ptr to 1st saved COMMON  */
-extern SAVED_F77_COMMON_PTR tail_common_list;   /* Ptr to last saved COMMON  */
-extern SAVED_F77_COMMON_PTR current_common;     /* Ptr to current COMMON */
+extern SAVED_F77_COMMON_PTR head_common_list;  /* Ptr to 1st saved COMMON  */
+extern SAVED_F77_COMMON_PTR tail_common_list;  /* Ptr to last saved COMMON  */
+extern SAVED_F77_COMMON_PTR current_common;    /* Ptr to current COMMON */
 
 extern SAVED_F77_COMMON_PTR find_common_for_function PARAMS ((char *, char *));
 
-#define UNINITIALIZED_SECNUM -1 
+#define UNINITIALIZED_SECNUM -1
 #define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)
 
-#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM"  /* XLF assigned  */
-#define BLANK_COMMON_NAME_MF77     "__BLNK__"   /* MF77 assigned  */
-#define BLANK_COMMON_NAME_LOCAL    "__BLANK"    /* Local GDB */
+#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned  */
+#define BLANK_COMMON_NAME_MF77     "__BLNK__"  /* MF77 assigned  */
+#define BLANK_COMMON_NAME_LOCAL    "__BLANK"   /* Local GDB */
 
 #define BOUND_FETCH_OK 1
 #define BOUND_FETCH_ERROR -999
 
 /* When reasonable array bounds cannot be fetched, such as when 
-you ask to 'mt print symbols' and there is no stack frame and 
-therefore no way of knowing the bounds of stack-based arrays, 
-we have to assign default bounds, these are as good as any... */ 
+   you ask to 'mt print symbols' and there is no stack frame and 
+   therefore no way of knowing the bounds of stack-based arrays, 
+   we have to assign default bounds, these are as good as any... */
 
 #define DEFAULT_UPPER_BOUND 999999
 #define DEFAULT_LOWER_BOUND -999999
 
-extern char *real_main_name;   /* Name of main function */ 
-extern int  real_main_c_value;   /* C_value field of main function */ 
+extern char *real_main_name;   /* Name of main function */
+extern int real_main_c_value;  /* C_value field of main function */
 
 extern int f77_get_dynamic_upperbound PARAMS ((struct type *, int *));
 
 extern int f77_get_dynamic_lowerbound PARAMS ((struct type *, int *));
 
-extern void f77_get_dynamic_array_length PARAMS ((struct type *)); 
+extern void f77_get_dynamic_array_length PARAMS ((struct type *));
 
 extern int calc_f77_array_dims PARAMS ((struct type *));
 
index 09bb3ebd09592cff58da26690aa9a541704cb260..12b2865ee70355ca09b902640b255bc45cd3e29d 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Motorola.  Adapted from the C version by Farooq Butt
    (fmbutt@engage.sps.mot.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -34,12 +35,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "demangle.h"
 #include "f-lang.h"
 #include "typeprint.h"
-#include "frame.h"  /* ??? */
+#include "frame.h"             /* ??? */
 
 #include "gdb_string.h"
 #include <errno.h>
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 static void f_type_print_args PARAMS ((struct type *, GDB_FILE *));
 #endif
 
@@ -53,8 +54,8 @@ void f_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *,
                                          int, int));
 
 void f_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
-
 \f
+
 /* LEVEL is the depth to indent lines by.  */
 
 void
@@ -72,8 +73,8 @@ f_print_type (type, varstring, stream, show, level)
   code = TYPE_CODE (type);
   if ((varstring != NULL && *varstring != '\0')
       ||
-      /* Need a space if going to print stars or brackets;
-        but not if we will print just a type name.  */
+  /* Need a space if going to print stars or brackets;
+     but not if we will print just a type name.  */
       ((show > 0 || TYPE_NAME (type) == 0)
        &&
        (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
@@ -89,7 +90,7 @@ f_print_type (type, varstring, stream, show, level)
   /* For demangled function names, we have the arglist as part of the name,
      so don't print an additional pair of ()'s */
 
-  demangled_args = varstring[strlen(varstring) - 1] == ')';
+  demangled_args = varstring[strlen (varstring) - 1] == ')';
   f_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
 }
 
@@ -152,12 +153,12 @@ f_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
     case TYPE_CODE_COMPLEX:
     case TYPE_CODE_TYPEDEF:
       /* These types need no prefix.  They are listed here so that
-        gcc -Wall will reveal any types that haven't been handled.  */
+         gcc -Wall will reveal any types that haven't been handled.  */
       break;
     }
 }
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 static void
 f_type_print_args (type, stream)
@@ -180,9 +181,9 @@ f_type_print_args (type, stream)
          for (i = 1; args[i] != NULL && args[i]->code != TYPE_CODE_VOID; i++)
            {
              f_print_type (args[i], "", stream, -1, 0);
-             if (args[i+1] == NULL)
+             if (args[i + 1] == NULL)
                fprintf_filtered (stream, "...");
-             else if (args[i+1]->code != TYPE_CODE_VOID)
+             else if (args[i + 1]->code != TYPE_CODE_VOID)
                {
                  fprintf_filtered (stream, ",");
                  wrap_here ("    ");
@@ -193,7 +194,7 @@ f_type_print_args (type, stream)
   fprintf_filtered (stream, ")");
 }
 
-#endif /* 0 */
+#endif /* 0 */
 
 /* Print any array sizes, function arguments or close parentheses
    needed after the variable name (to describe its type).
@@ -226,61 +227,60 @@ f_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
       arrayprint_recurse_level++;
 
       if (arrayprint_recurse_level == 1)
-       fprintf_filtered(stream,"(");
+       fprintf_filtered (stream, "(");
 
       if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
        f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
 
-      retcode = f77_get_dynamic_lowerbound (type,&lower_bound);
+      retcode = f77_get_dynamic_lowerbound (type, &lower_bound);
 
       lower_bound_was_default = 0;
 
       if (retcode == BOUND_FETCH_ERROR)
-       fprintf_filtered (stream,"???");
+       fprintf_filtered (stream, "???");
+      else if (lower_bound == 1)       /* The default */
+       lower_bound_was_default = 1;
       else
-       if (lower_bound == 1) /* The default */
-         lower_bound_was_default = 1;
-       else
-         fprintf_filtered (stream,"%d",lower_bound);
+       fprintf_filtered (stream, "%d", lower_bound);
 
       if (lower_bound_was_default)
        lower_bound_was_default = 0;
       else
-       fprintf_filtered(stream,":");
+       fprintf_filtered (stream, ":");
 
       /* Make sure that, if we have an assumed size array, we
-        print out a warning and print the upperbound as '*' */
+         print out a warning and print the upperbound as '*' */
 
-      if (TYPE_ARRAY_UPPER_BOUND_TYPE(type) == BOUND_CANNOT_BE_DETERMINED)
+      if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
        fprintf_filtered (stream, "*");
-       else
-        {
-          retcode = f77_get_dynamic_upperbound(type,&upper_bound);
+      else
+       {
+         retcode = f77_get_dynamic_upperbound (type, &upper_bound);
 
-          if (retcode == BOUND_FETCH_ERROR)
-            fprintf_filtered(stream,"???");
-          else
-            fprintf_filtered(stream,"%d",upper_bound);
-        }
+         if (retcode == BOUND_FETCH_ERROR)
+           fprintf_filtered (stream, "???");
+         else
+           fprintf_filtered (stream, "%d", upper_bound);
+       }
 
       if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
        f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
       if (arrayprint_recurse_level == 1)
        fprintf_filtered (stream, ")");
       else
-       fprintf_filtered(stream,",");
+       fprintf_filtered (stream, ",");
       arrayprint_recurse_level--;
       break;
 
     case TYPE_CODE_PTR:
     case TYPE_CODE_REF:
       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
-      fprintf_filtered(stream,")");
+      fprintf_filtered (stream, ")");
       break;
 
     case TYPE_CODE_FUNC:
       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-                                passed_a_ptr, 0);
+                                  passed_a_ptr, 0);
       if (passed_a_ptr)
        fprintf_filtered (stream, ")");
 
@@ -306,7 +306,7 @@ f_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
     case TYPE_CODE_COMPLEX:
     case TYPE_CODE_TYPEDEF:
       /* These types do not need a suffix.  They are listed so that
-        gcc -Wall will report types that may not have been considered.  */
+         gcc -Wall will report types that may not have been considered.  */
       break;
     }
 }
@@ -381,7 +381,7 @@ f_type_print_base (type, stream, show, level)
       f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
       break;
 
-   case TYPE_CODE_PTR:
+    case TYPE_CODE_PTR:
       fprintf_filtered (stream, "PTR TO -> ( ");
       f_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
       break;
@@ -446,9 +446,9 @@ f_type_print_base (type, stream, show, level)
     default_case:
     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. */
+         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
index c1a9e1757d3da87606fecd8d3073ff62413e8edb..f3b3114b3ac43d6ff0f3382563c21d032eae54e9 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "demangle.h"
 #include "valprint.h"
 #include "language.h"
-#include "f-lang.h" 
+#include "f-lang.h"
 #include "frame.h"
 #include "gdbcore.h"
 #include "command.h"
@@ -50,187 +51,187 @@ static void f77_create_arrayprint_offset_tbl PARAMS ((struct type *,
                                                      GDB_FILE *));
 static void f77_get_dynamic_length_of_aggregate PARAMS ((struct type *));
 
-int f77_array_offset_tbl[MAX_FORTRAN_DIMS+1][2];
+int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
 
 /* Array which holds offsets to be applied to get a row's elements
    for a given array. Array also holds the size of each subarray.  */
 
 /* The following macro gives us the size of the nth dimension, Where 
-   n is 1 based. */ 
+   n is 1 based. */
 
 #define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1])
 
-/* The following gives us the offset for row n where n is 1-based. */ 
+/* The following gives us the offset for row n where n is 1-based. */
 
 #define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0])
 
-int 
+int
 f77_get_dynamic_lowerbound (type, lower_bound)
      struct type *type;
-     int *lower_bound; 
+     int *lower_bound;
 {
-  CORE_ADDR current_frame_addr;   
-  CORE_ADDR ptr_to_lower_bound; 
-  
+  CORE_ADDR current_frame_addr;
+  CORE_ADDR ptr_to_lower_bound;
+
   switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
     {
     case BOUND_BY_VALUE_ON_STACK:
       current_frame_addr = selected_frame->frame;
-      if (current_frame_addr > 0) 
+      if (current_frame_addr > 0)
        {
-         *lower_bound = 
-           read_memory_integer (current_frame_addr + 
+         *lower_bound =
+           read_memory_integer (current_frame_addr +
                                 TYPE_ARRAY_LOWER_BOUND_VALUE (type),
                                 4);
        }
       else
        {
-         *lower_bound = DEFAULT_LOWER_BOUND; 
-         return BOUND_FETCH_ERROR; 
+         *lower_bound = DEFAULT_LOWER_BOUND;
+         return BOUND_FETCH_ERROR;
        }
-      break; 
-      
+      break;
+
     case BOUND_SIMPLE:
       *lower_bound = TYPE_ARRAY_LOWER_BOUND_VALUE (type);
-      break; 
-      
-    case BOUND_CANNOT_BE_DETERMINED: 
-      error ("Lower bound may not be '*' in F77"); 
-      break; 
-      
+      break;
+
+    case BOUND_CANNOT_BE_DETERMINED:
+      error ("Lower bound may not be '*' in F77");
+      break;
+
     case BOUND_BY_REF_ON_STACK:
       current_frame_addr = selected_frame->frame;
-      if (current_frame_addr > 0) 
+      if (current_frame_addr > 0)
        {
-         ptr_to_lower_bound = 
-           read_memory_integer (current_frame_addr + 
+         ptr_to_lower_bound =
+           read_memory_integer (current_frame_addr +
                                 TYPE_ARRAY_LOWER_BOUND_VALUE (type),
                                 4);
-         *lower_bound = read_memory_integer (ptr_to_lower_bound, 4); 
+         *lower_bound = read_memory_integer (ptr_to_lower_bound, 4);
        }
       else
        {
-         *lower_bound = DEFAULT_LOWER_BOUND; 
-         return BOUND_FETCH_ERROR; 
+         *lower_bound = DEFAULT_LOWER_BOUND;
+         return BOUND_FETCH_ERROR;
        }
-      break; 
-      
-    case BOUND_BY_REF_IN_REG: 
-    case BOUND_BY_VALUE_IN_REG: 
-    default: 
+      break;
+
+    case BOUND_BY_REF_IN_REG:
+    case BOUND_BY_VALUE_IN_REG:
+    default:
       error ("??? unhandled dynamic array bound type ???");
-      break; 
+      break;
     }
   return BOUND_FETCH_OK;
 }
 
-int 
+int
 f77_get_dynamic_upperbound (type, upper_bound)
      struct type *type;
      int *upper_bound;
 {
   CORE_ADDR current_frame_addr = 0;
-  CORE_ADDR ptr_to_upper_bound; 
-  
+  CORE_ADDR ptr_to_upper_bound;
+
   switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
     {
     case BOUND_BY_VALUE_ON_STACK:
       current_frame_addr = selected_frame->frame;
-      if (current_frame_addr > 0) 
+      if (current_frame_addr > 0)
        {
-         *upper_bound = 
-           read_memory_integer (current_frame_addr + 
+         *upper_bound =
+           read_memory_integer (current_frame_addr +
                                 TYPE_ARRAY_UPPER_BOUND_VALUE (type),
                                 4);
        }
       else
        {
-         *upper_bound = DEFAULT_UPPER_BOUND; 
-         return BOUND_FETCH_ERROR; 
+         *upper_bound = DEFAULT_UPPER_BOUND;
+         return BOUND_FETCH_ERROR;
        }
-      break; 
-      
+      break;
+
     case BOUND_SIMPLE:
       *upper_bound = TYPE_ARRAY_UPPER_BOUND_VALUE (type);
-      break; 
-      
-    case BOUND_CANNOT_BE_DETERMINED: 
+      break;
+
+    case BOUND_CANNOT_BE_DETERMINED:
       /* we have an assumed size array on our hands. Assume that 
-        upper_bound == lower_bound so that we show at least 
-        1 element.If the user wants to see more elements, let 
-        him manually ask for 'em and we'll subscript the 
-        array and show him */
+         upper_bound == lower_bound so that we show at least 
+         1 element.If the user wants to see more elements, let 
+         him manually ask for 'em and we'll subscript the 
+         array and show him */
       f77_get_dynamic_lowerbound (type, upper_bound);
-      break; 
-      
+      break;
+
     case BOUND_BY_REF_ON_STACK:
       current_frame_addr = selected_frame->frame;
-      if (current_frame_addr > 0) 
+      if (current_frame_addr > 0)
        {
-         ptr_to_upper_bound = 
-           read_memory_integer (current_frame_addr + 
+         ptr_to_upper_bound =
+           read_memory_integer (current_frame_addr +
                                 TYPE_ARRAY_UPPER_BOUND_VALUE (type),
                                 4);
-         *upper_bound = read_memory_integer(ptr_to_upper_bound, 4); 
+         *upper_bound = read_memory_integer (ptr_to_upper_bound, 4);
        }
       else
        {
-         *upper_bound = DEFAULT_UPPER_BOUND; 
+         *upper_bound = DEFAULT_UPPER_BOUND;
          return BOUND_FETCH_ERROR;
        }
-      break; 
-      
-    case BOUND_BY_REF_IN_REG: 
-    case BOUND_BY_VALUE_IN_REG: 
-    default: 
+      break;
+
+    case BOUND_BY_REF_IN_REG:
+    case BOUND_BY_VALUE_IN_REG:
+    default:
       error ("??? unhandled dynamic array bound type ???");
-      break; 
+      break;
     }
   return BOUND_FETCH_OK;
 }
 
-/* Obtain F77 adjustable array dimensions */ 
+/* Obtain F77 adjustable array dimensions */
 
 static void
 f77_get_dynamic_length_of_aggregate (type)
      struct type *type;
 {
   int upper_bound = -1;
-  int lower_bound = 1; 
-  int retcode; 
-  
+  int lower_bound = 1;
+  int retcode;
+
   /* Recursively go all the way down into a possibly multi-dimensional
      F77 array and get the bounds.  For simple arrays, this is pretty
      easy but when the bounds are dynamic, we must be very careful 
      to add up all the lengths correctly.  Not doing this right 
      will lead to horrendous-looking arrays in parameter lists.
-     
+
      This function also works for strings which behave very 
-     similarly to arrays.  */ 
-  
-  if (TYPE_CODE(TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY
-      || TYPE_CODE(TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING)
+     similarly to arrays.  */
+
+  if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY
+      || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING)
     f77_get_dynamic_length_of_aggregate (TYPE_TARGET_TYPE (type));
-  
-  /* Recursion ends here, start setting up lengths.  */ 
-  retcode = f77_get_dynamic_lowerbound (type, &lower_bound); 
+
+  /* Recursion ends here, start setting up lengths.  */
+  retcode = f77_get_dynamic_lowerbound (type, &lower_bound);
   if (retcode == BOUND_FETCH_ERROR)
-    error ("Cannot obtain valid array lower bound"); 
-  
-  retcode = f77_get_dynamic_upperbound (type, &upper_bound); 
+    error ("Cannot obtain valid array lower bound");
+
+  retcode = f77_get_dynamic_upperbound (type, &upper_bound);
   if (retcode == BOUND_FETCH_ERROR)
-    error ("Cannot obtain valid array upper bound"); 
-  
-  /* Patch in a valid length value. */ 
-  
+    error ("Cannot obtain valid array upper bound");
+
+  /* Patch in a valid length value. */
+
   TYPE_LENGTH (type) =
     (upper_bound - lower_bound + 1) * TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type)));
-}       
+}
 
 /* Function that sets up the array offset,size table for the array 
-   type "type".  */ 
+   type "type".  */
 
-static void 
+static void
 f77_create_arrayprint_offset_tbl (type, stream)
      struct type *type;
      GDB_FILE *stream;
@@ -238,36 +239,36 @@ f77_create_arrayprint_offset_tbl (type, stream)
   struct type *tmp_type;
   int eltlen;
   int ndimen = 1;
-  int upper, lower, retcode; 
-  
-  tmp_type = type; 
-  
-  while ((TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)) 
+  int upper, lower, retcode;
+
+  tmp_type = type;
+
+  while ((TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY))
     {
       if (TYPE_ARRAY_UPPER_BOUND_TYPE (tmp_type) == BOUND_CANNOT_BE_DETERMINED)
-       fprintf_filtered (stream, "<assumed size array> "); 
-      
+       fprintf_filtered (stream, "<assumed size array> ");
+
       retcode = f77_get_dynamic_upperbound (tmp_type, &upper);
       if (retcode == BOUND_FETCH_ERROR)
-       error ("Cannot obtain dynamic upper bound"); 
-      
-      retcode = f77_get_dynamic_lowerbound(tmp_type,&lower); 
+       error ("Cannot obtain dynamic upper bound");
+
+      retcode = f77_get_dynamic_lowerbound (tmp_type, &lower);
       if (retcode == BOUND_FETCH_ERROR)
-       error("Cannot obtain dynamic lower bound"); 
-      
+       error ("Cannot obtain dynamic lower bound");
+
       F77_DIM_SIZE (ndimen) = upper - lower + 1;
-      
+
       tmp_type = TYPE_TARGET_TYPE (tmp_type);
-      ndimen++; 
+      ndimen++;
     }
-  
+
   /* Now we multiply eltlen by all the offsets, so that later we 
      can print out array elements correctly.  Up till now we 
      know an offset to apply to get the item but we also 
      have to know how much to add to get to the next item */
-  
+
   ndimen--;
-  eltlen = TYPE_LENGTH (tmp_type); 
+  eltlen = TYPE_LENGTH (tmp_type);
   F77_DIM_OFFSET (ndimen) = eltlen;
   while (--ndimen > 0)
     {
@@ -279,11 +280,11 @@ f77_create_arrayprint_offset_tbl (type, stream)
 /* Actual function which prints out F77 arrays, Valaddr == address in 
    the superior.  Address == the address in the inferior.  */
 
-static void 
-f77_print_array_1 (nss, ndimensions, type, valaddr, address, 
+static void
+f77_print_array_1 (nss, ndimensions, type, valaddr, address,
                   stream, format, deref_ref, recurse, pretty)
      int nss;
-     int ndimensions; 
+     int ndimensions;
      struct type *type;
      char *valaddr;
      CORE_ADDR address;
@@ -294,16 +295,16 @@ f77_print_array_1 (nss, ndimensions, type, valaddr, address,
      enum val_prettyprint pretty;
 {
   int i;
-  
+
   if (nss != ndimensions)
     {
-      for (i = 0; i< F77_DIM_SIZE(nss); i++)
+      for (i = 0; i < F77_DIM_SIZE (nss); i++)
        {
          fprintf_filtered (stream, "( ");
          f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type),
-                           valaddr + i * F77_DIM_OFFSET (nss),
-                           address + i * F77_DIM_OFFSET (nss), 
-                           stream, format, deref_ref, recurse, pretty);
+                            valaddr + i * F77_DIM_OFFSET (nss),
+                            address + i * F77_DIM_OFFSET (nss),
+                            stream, format, deref_ref, recurse, pretty);
          fprintf_filtered (stream, ") ");
        }
     }
@@ -313,13 +314,13 @@ f77_print_array_1 (nss, ndimensions, type, valaddr, address,
        {
          val_print (TYPE_TARGET_TYPE (type),
                     valaddr + i * F77_DIM_OFFSET (ndimensions),
-                     0,
+                    0,
                     address + i * F77_DIM_OFFSET (ndimensions),
-                    stream, format, deref_ref, recurse, pretty); 
+                    stream, format, deref_ref, recurse, pretty);
 
          if (i != (F77_DIM_SIZE (nss) - 1))
-           fprintf_filtered (stream, ", "); 
-         
+           fprintf_filtered (stream, ", ");
+
          if (i == print_max - 1)
            fprintf_filtered (stream, "...");
        }
@@ -329,8 +330,8 @@ f77_print_array_1 (nss, ndimensions, type, valaddr, address,
 /* This function gets called to print an F77 array, we set up some 
    stuff and then immediately call f77_print_array_1() */
 
-static void 
-f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse, 
+static void
+f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse,
                 pretty)
      struct type *type;
      char *valaddr;
@@ -341,36 +342,36 @@ f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse,
      int recurse;
      enum val_prettyprint pretty;
 {
-  int ndimensions; 
-  
-  ndimensions = calc_f77_array_dims (type); 
-  
+  int ndimensions;
+
+  ndimensions = calc_f77_array_dims (type);
+
   if (ndimensions > MAX_FORTRAN_DIMS || ndimensions < 0)
     error ("Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)",
           ndimensions, MAX_FORTRAN_DIMS);
-  
+
   /* Since F77 arrays are stored column-major, we set up an 
      offset table to get at the various row's elements. The 
-     offset table contains entries for both offset and subarray size. */ 
-  
-  f77_create_arrayprint_offset_tbl (type, stream); 
-  
-  f77_print_array_1 (1, ndimensions, type, valaddr, address, stream, format, 
-                     deref_ref, recurse, pretty);
-}
+     offset table contains entries for both offset and subarray size. */
 
+  f77_create_arrayprint_offset_tbl (type, stream);
+
+  f77_print_array_1 (1, ndimensions, type, valaddr, address, stream, format,
+                    deref_ref, recurse, pretty);
+}
 \f
+
 /* 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
@@ -386,30 +387,30 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
      int recurse;
      enum val_prettyprint pretty;
 {
-  register unsigned int i = 0;         /* Number of characters printed */
+  register unsigned int i = 0; /* Number of characters printed */
   struct type *elttype;
   LONGEST val;
   CORE_ADDR addr;
-  
+
   CHECK_TYPEDEF (type);
   switch (TYPE_CODE (type))
     {
-    case TYPE_CODE_STRING: 
+    case TYPE_CODE_STRING:
       f77_get_dynamic_length_of_aggregate (type);
       LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0);
       break;
-      
+
     case TYPE_CODE_ARRAY:
-      fprintf_filtered (stream, "("); 
-      f77_print_array (type, valaddr, address, stream, format, 
-                      deref_ref, recurse, pretty); 
+      fprintf_filtered (stream, "(");
+      f77_print_array (type, valaddr, address, stream, format,
+                      deref_ref, recurse, pretty);
       fprintf_filtered (stream, ")");
       break;
 #if 0
       /* Array of unspecified length: treat like pointer to first elt.  */
       valaddr = (char *) &address;
       /* FALL THROUGH */
-#endif 
+#endif
     case TYPE_CODE_PTR:
       if (format && format != 's')
        {
@@ -420,7 +421,7 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
        {
          addr = unpack_pointer (type, valaddr);
          elttype = check_typedef (TYPE_TARGET_TYPE (type));
-         
+
          if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
            {
              /* Try to print what function it points to.  */
@@ -428,10 +429,10 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
              /* Return value is irrelevant except for string pointers.  */
              return 0;
            }
-         
+
          if (addressprint && format != 's')
            fprintf_filtered (stream, "0x%x", addr);
-         
+
          /* For a pointer to char or unsigned char, also print the string
             pointed to, unless pointer is null.  */
          if (TYPE_LENGTH (elttype) == 1
@@ -439,13 +440,13 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
              && (format == 0 || format == 's')
              && addr != 0)
            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_FUNC:
       if (format)
        {
@@ -453,14 +454,14 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
          break;
        }
       /* FIXME, we should consider, at least for ANSI C language, eliminating
-        the distinction made between FUNCs and POINTERs to FUNCs.  */
+         the distinction made between FUNCs and POINTERs to FUNCs.  */
       fprintf_filtered (stream, "{");
       type_print (type, "", stream, -1);
       fprintf_filtered (stream, "} ");
       /* Try to print what function it points to, and its address.  */
       print_address_demangle (address, stream, demangle);
       break;
-      
+
     case TYPE_CODE_INT:
       format = format ? format : output_format;
       if (format)
@@ -480,80 +481,85 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
            }
        }
       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_VOID:
       fprintf_filtered (stream, "VOID");
       break;
-      
+
     case TYPE_CODE_ERROR:
       fprintf_filtered (stream, "<error type>");
       break;
-      
+
     case TYPE_CODE_RANGE:
       /* FIXME, we should not ever have to print one of these yet.  */
       fprintf_filtered (stream, "<range type>");
       break;
-      
+
     case TYPE_CODE_BOOL:
       format = format ? format : output_format;
       if (format)
        print_scalar_formatted (valaddr, type, format, 0, stream);
       else
        {
-          val = 0; 
-          switch (TYPE_LENGTH(type))
+         val = 0;
+         switch (TYPE_LENGTH (type))
            {
            case 1:
              val = unpack_long (builtin_type_f_logical_s1, valaddr);
-             break ; 
-             
-           case 2: 
+             break;
+
+           case 2:
              val = unpack_long (builtin_type_f_logical_s2, valaddr);
-             break ; 
-             
-           case 4: 
+             break;
+
+           case 4:
              val = unpack_long (builtin_type_f_logical, valaddr);
-             break ; 
-             
+             break;
+
            default:
              error ("Logicals of length %d bytes not supported",
                     TYPE_LENGTH (type));
-             
+
            }
-         
-          if (val == 0) 
+
+         if (val == 0)
            fprintf_filtered (stream, ".FALSE.");
-          else 
-           if (val == 1) 
-             fprintf_filtered (stream, ".TRUE.");
-           else
-             /* Not a legitimate logical type, print as an integer.  */
-             {
-               /* Bash the type code temporarily.  */
-               TYPE_CODE (type) = TYPE_CODE_INT;
-               f_val_print (type, valaddr, 0, address, stream, format, 
-                            deref_ref, recurse, pretty); 
-               /* Restore the type code so later uses work as intended. */
-               TYPE_CODE (type) = TYPE_CODE_BOOL; 
-             }
+         else if (val == 1)
+           fprintf_filtered (stream, ".TRUE.");
+         else
+           /* Not a legitimate logical type, print as an integer.  */
+           {
+             /* Bash the type code temporarily.  */
+             TYPE_CODE (type) = TYPE_CODE_INT;
+             f_val_print (type, valaddr, 0, address, stream, format,
+                          deref_ref, recurse, pretty);
+             /* Restore the type code so later uses work as intended. */
+             TYPE_CODE (type) = TYPE_CODE_BOOL;
+           }
        }
       break;
-      
+
     case TYPE_CODE_COMPLEX:
       switch (TYPE_LENGTH (type))
        {
-       case 8:  type = builtin_type_f_real;  break;
-       case 16:  type = builtin_type_f_real_s8;  break;
-       case 32:  type = builtin_type_f_real_s16;  break;
+       case 8:
+         type = builtin_type_f_real;
+         break;
+       case 16:
+         type = builtin_type_f_real_s8;
+         break;
+       case 32:
+         type = builtin_type_f_real_s16;
+         break;
        default:
-         error ("Cannot print out complex*%d variables", TYPE_LENGTH(type)); 
+         error ("Cannot print out complex*%d variables", TYPE_LENGTH (type));
        }
       fputs_filtered ("(", stream);
       print_floating (valaddr, type, stream);
@@ -561,14 +567,14 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
       print_floating (valaddr, type, stream);
       fputs_filtered (")", stream);
       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.  */
+         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;
-      
+
     default:
       error ("Invalid F77 type code %d in symbol table.", TYPE_CODE (type));
     }
@@ -580,70 +586,70 @@ static void
 list_all_visible_commons (funname)
      char *funname;
 {
-  SAVED_F77_COMMON_PTR  tmp;
-  
+  SAVED_F77_COMMON_PTR tmp;
+
   tmp = head_common_list;
-  
+
   printf_filtered ("All COMMON blocks visible at this level:\n\n");
-  
+
   while (tmp != NULL)
     {
-      if (STREQ(tmp->owning_function,funname))
-       printf_filtered ("%s\n", tmp->name); 
-      
+      if (STREQ (tmp->owning_function, funname))
+       printf_filtered ("%s\n", tmp->name);
+
       tmp = tmp->next;
     }
 }
 
 /* This function is used to print out the values in a given COMMON 
    block. It will always use the most local common block of the 
-   given name */ 
+   given name */
 
-static void 
+static void
 info_common_command (comname, from_tty)
      char *comname;
      int from_tty;
 {
-  SAVED_F77_COMMON_PTR  the_common; 
-  COMMON_ENTRY_PTR entry; 
+  SAVED_F77_COMMON_PTR the_common;
+  COMMON_ENTRY_PTR entry;
   struct frame_info *fi;
   register char *funname = 0;
   struct symbol *func;
-  
+
   /* We have been told to display the contents of F77 COMMON 
      block supposedly visible in this function.  Let us 
      first make sure that it is visible and if so, let 
-     us display its contents */ 
-  
-  fi = selected_frame; 
-  
+     us display its contents */
+
+  fi = selected_frame;
+
   if (fi == NULL)
-    error ("No frame selected"); 
-  
+    error ("No frame selected");
+
   /* The following is generally ripped off from stack.c's routine 
-     print_frame_info() */ 
-  
+     print_frame_info() */
+
   func = find_pc_function (fi->pc);
   if (func)
     {
       /* In certain pathological cases, the symtabs give the wrong
-        function (when we are in the first function in a file which
-        is compiled without debugging symbols, the previous function
-        is compiled with debugging symbols, and the "foo.o" symbol
-        that is supposed to tell us where the file with debugging symbols
-        ends has been truncated by ar because it is longer than 15
-        characters).
-        
-        So look in the minimal symbol tables as well, and if it comes
-        up with a larger address for the function use that instead.
-        I don't think this can ever cause any problems; there shouldn't
-        be any minimal symbols in the middle of a function.
-        FIXME:  (Not necessarily true.  What about text labels) */
-      
+         function (when we are in the first function in a file which
+         is compiled without debugging symbols, the previous function
+         is compiled with debugging symbols, and the "foo.o" symbol
+         that is supposed to tell us where the file with debugging symbols
+         ends has been truncated by ar because it is longer than 15
+         characters).
+
+         So look in the minimal symbol tables as well, and if it comes
+         up with a larger address for the function use that instead.
+         I don't think this can ever cause any problems; there shouldn't
+         be any minimal symbols in the middle of a function.
+         FIXME:  (Not necessarily true.  What about text labels) */
+
       struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
-      
+
       if (msymbol != NULL
-         && (SYMBOL_VALUE_ADDRESS (msymbol) 
+         && (SYMBOL_VALUE_ADDRESS (msymbol)
              > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
        funname = SYMBOL_NAME (msymbol);
       else
@@ -652,91 +658,91 @@ info_common_command (comname, from_tty)
   else
     {
       register struct minimal_symbol *msymbol =
-       lookup_minimal_symbol_by_pc (fi->pc);
-      
+      lookup_minimal_symbol_by_pc (fi->pc);
+
       if (msymbol != NULL)
        funname = SYMBOL_NAME (msymbol);
     }
-  
+
   /* If comname is NULL, we assume the user wishes to see the 
-     which COMMON blocks are visible here and then return */ 
-  
+     which COMMON blocks are visible here and then return */
+
   if (comname == 0)
     {
       list_all_visible_commons (funname);
-      return; 
+      return;
     }
-  
-  the_common = find_common_for_function (comname,funname); 
-  
+
+  the_common = find_common_for_function (comname, funname);
+
   if (the_common)
     {
-      if (STREQ(comname,BLANK_COMMON_NAME_LOCAL))
+      if (STREQ (comname, BLANK_COMMON_NAME_LOCAL))
        printf_filtered ("Contents of blank COMMON block:\n");
-      else 
-       printf_filtered ("Contents of F77 COMMON block '%s':\n",comname); 
-      
-      printf_filtered ("\n"); 
-      entry = the_common->entries; 
-      
+      else
+       printf_filtered ("Contents of F77 COMMON block '%s':\n", comname);
+
+      printf_filtered ("\n");
+      entry = the_common->entries;
+
       while (entry != NULL)
        {
-         printf_filtered ("%s = ",SYMBOL_NAME(entry->symbol)); 
-         print_variable_value (entry->symbol, fi, gdb_stdout); 
-         printf_filtered ("\n"); 
-         entry = entry->next; 
+         printf_filtered ("%s = ", SYMBOL_NAME (entry->symbol));
+         print_variable_value (entry->symbol, fi, gdb_stdout);
+         printf_filtered ("\n");
+         entry = entry->next;
        }
     }
-  else 
+  else
     printf_filtered ("Cannot locate the common block %s in function '%s'\n",
-                   comname, funname);
+                    comname, funname);
 }
 
 /* This function is used to determine whether there is a
-   F77 common block visible at the current scope called 'comname'. */ 
+   F77 common block visible at the current scope called 'comname'. */
 
 #if 0
 static int
 there_is_a_visible_common_named (comname)
      char *comname;
 {
-  SAVED_F77_COMMON_PTR  the_common; 
+  SAVED_F77_COMMON_PTR the_common;
   struct frame_info *fi;
   register char *funname = 0;
   struct symbol *func;
-  
+
   if (comname == NULL)
-    error ("Cannot deal with NULL common name!"); 
-  
-  fi = selected_frame; 
-  
+    error ("Cannot deal with NULL common name!");
+
+  fi = selected_frame;
+
   if (fi == NULL)
-    error ("No frame selected"); 
-  
+    error ("No frame selected");
+
   /* The following is generally ripped off from stack.c's routine 
-     print_frame_info() */ 
-  
+     print_frame_info() */
+
   func = find_pc_function (fi->pc);
   if (func)
     {
       /* In certain pathological cases, the symtabs give the wrong
-        function (when we are in the first function in a file which
-        is compiled without debugging symbols, the previous function
-        is compiled with debugging symbols, and the "foo.o" symbol
-        that is supposed to tell us where the file with debugging symbols
-        ends has been truncated by ar because it is longer than 15
-        characters).
-        
-        So look in the minimal symbol tables as well, and if it comes
-        up with a larger address for the function use that instead.
-        I don't think this can ever cause any problems; there shouldn't
-        be any minimal symbols in the middle of a function.
-        FIXME:  (Not necessarily true.  What about text labels) */
-      
+         function (when we are in the first function in a file which
+         is compiled without debugging symbols, the previous function
+         is compiled with debugging symbols, and the "foo.o" symbol
+         that is supposed to tell us where the file with debugging symbols
+         ends has been truncated by ar because it is longer than 15
+         characters).
+
+         So look in the minimal symbol tables as well, and if it comes
+         up with a larger address for the function use that instead.
+         I don't think this can ever cause any problems; there shouldn't
+         be any minimal symbols in the middle of a function.
+         FIXME:  (Not necessarily true.  What about text labels) */
+
       struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
-      
+
       if (msymbol != NULL
-         && (SYMBOL_VALUE_ADDRESS (msymbol) 
+         && (SYMBOL_VALUE_ADDRESS (msymbol)
              > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
        funname = SYMBOL_NAME (msymbol);
       else
@@ -744,15 +750,15 @@ there_is_a_visible_common_named (comname)
     }
   else
     {
-      register struct minimal_symbol *msymbol = 
-       lookup_minimal_symbol_by_pc (fi->pc);
-      
+      register struct minimal_symbol *msymbol =
+      lookup_minimal_symbol_by_pc (fi->pc);
+
       if (msymbol != NULL)
        funname = SYMBOL_NAME (msymbol);
     }
-  
-  the_common = find_common_for_function (comname, funname); 
-  
+
+  the_common = find_common_for_function (comname, funname);
+
   return (the_common ? 1 : 0);
 }
 #endif
@@ -763,6 +769,6 @@ _initialize_f_valprint ()
   add_info ("common", info_common_command,
            "Print out the values contained in a Fortran COMMON block.");
   if (xdb_commands)
-    add_com("lc", class_info, info_common_command,
-           "Print out the values contained in a Fortran COMMON block.");
+    add_com ("lc", class_info, info_common_command,
+            "Print out the values contained in a Fortran COMMON block.");
 }
index f721c71e2bc9e9e01898ee70124691086ee09206..489761fa282830a77962f7d3f4164c7b68fd93c2 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 94, 95, 96, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "gdb_string.h"
 #include "floatformat.h"
-#include "symfile.h"   /* for overlay functions */
+#include "symfile.h"           /* for overlay functions */
 
 /* This is used to indicate that we don't know the format of the floating point
    number.  Typically, this is useful for native ports, where the actual format
@@ -43,7 +44,7 @@ const struct floatformat floatformat_unknown;
 
 static void write_register_gen PARAMS ((int, char *));
 
-static int read_relative_register_raw_bytes_for_frame PARAMS ((int regnum, char *myaddr, struct frame_info *frame));
+static int read_relative_register_raw_bytes_for_frame PARAMS ((int regnum, char *myaddr, struct frame_info * frame));
 
 /* Basic byte-swapping routines.  GDB has needed these for a long time...
    All extract a target-format integer at ADDR which is LEN bytes long.  */
@@ -53,17 +54,17 @@ static int read_relative_register_raw_bytes_for_frame PARAMS ((int regnum, char
      assume it throughout all these swapping routines.  If we had to deal with
      9 bit characters, we would need to make len be in bits and would have
      to re-write these routines...  */
-  you lose
+you lose
 #endif
 
-LONGEST
+  LONGEST
 extract_signed_integer (addr, len)
      PTR addr;
      int len;
 {
   LONGEST retval;
   unsigned char *p;
-  unsigned char *startaddr = (unsigned char *)addr;
+  unsigned char *startaddr = (unsigned char *) addr;
   unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (LONGEST))
@@ -77,7 +78,7 @@ That operation is not available on integers of more than %d bytes.",
     {
       p = startaddr;
       /* Do the sign extension once at the start.  */
-      retval = ((LONGEST)*p ^ 0x80) - 0x80;
+      retval = ((LONGEST) * p ^ 0x80) - 0x80;
       for (++p; p < endaddr; ++p)
        retval = (retval << 8) | *p;
     }
@@ -85,7 +86,7 @@ That operation is not available on integers of more than %d bytes.",
     {
       p = endaddr - 1;
       /* Do the sign extension once at the start.  */
-      retval = ((LONGEST)*p ^ 0x80) - 0x80;
+      retval = ((LONGEST) * p ^ 0x80) - 0x80;
       for (--p; p >= startaddr; --p)
        retval = (retval << 8) | *p;
     }
@@ -99,7 +100,7 @@ extract_unsigned_integer (addr, len)
 {
   ULONGEST retval;
   unsigned char *p;
-  unsigned char *startaddr = (unsigned char *)addr;
+  unsigned char *startaddr = (unsigned char *) addr;
   unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (ULONGEST))
@@ -182,7 +183,7 @@ extract_address (addr, len)
 {
   /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
      whether we want this to be true eventually.  */
-  return (CORE_ADDR)extract_unsigned_integer (addr, len);
+  return (CORE_ADDR) extract_unsigned_integer (addr, len);
 }
 
 void
@@ -192,7 +193,7 @@ store_signed_integer (addr, len, val)
      LONGEST val;
 {
   unsigned char *p;
-  unsigned char *startaddr = (unsigned char *)addr;
+  unsigned char *startaddr = (unsigned char *) addr;
   unsigned char *endaddr = startaddr + len;
 
   /* Start at the least significant end of the integer, and work towards
@@ -222,7 +223,7 @@ store_unsigned_integer (addr, len, val)
      ULONGEST val;
 {
   unsigned char *p;
-  unsigned char *startaddr = (unsigned char *)addr;
+  unsigned char *startaddr = (unsigned char *) addr;
   unsigned char *endaddr = startaddr + len;
 
   /* Start at the least significant end of the integer, and work towards
@@ -409,17 +410,18 @@ find_saved_register (frame, regnum)
      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))
+
+  if (REGISTER_IN_WINDOW_P (regnum))
     {
       frame1 = get_next_frame (frame);
-      if (!frame1) return 0;   /* Registers of this frame are active.  */
-      
+      if (!frame1)
+       return 0;               /* Registers of this frame are active.  */
+
       /* Get the SP from the next frame in; it will be this
-        current frame.  */
+         current frame.  */
       if (regnum != SP_REGNUM)
-       frame1 = frame; 
-         
+       frame1 = frame;
+
       FRAME_INIT_SAVED_REGS (frame1);
       return frame1->saved_regs[regnum];       /* ... which might be zero */
     }
@@ -485,7 +487,7 @@ default_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
          if (raw_buffer != NULL)
            {
              /* Put it back in target format.  */
-             store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), (LONGEST)addr);
+             store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), (LONGEST) addr);
            }
          if (addrp != NULL)
            *addrp = 0;
@@ -538,17 +540,17 @@ read_relative_register_raw_bytes_for_frame (regnum, myaddr, frame)
   if (regnum == FP_REGNUM && frame)
     {
       /* Put it back in target format. */
-      store_address (myaddr, REGISTER_RAW_SIZE(FP_REGNUM),
-                    (LONGEST)FRAME_FP(frame));
+      store_address (myaddr, REGISTER_RAW_SIZE (FP_REGNUM),
+                    (LONGEST) FRAME_FP (frame));
 
       return 0;
     }
 
   get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
-                      regnum, (enum lval_type *)NULL);
+                     regnum, (enum lval_type *) NULL);
 
-  if (register_valid [regnum] < 0)
-    return 1;  /* register value not available */
+  if (register_valid[regnum] < 0)
+    return 1;                  /* register value not available */
 
   return optim;
 }
@@ -564,7 +566,7 @@ read_relative_register_raw_bytes (regnum, myaddr)
      int regnum;
      char *myaddr;
 {
-  return read_relative_register_raw_bytes_for_frame (regnum, myaddr, 
+  return read_relative_register_raw_bytes_for_frame (regnum, myaddr,
                                                     selected_frame);
 }
 
@@ -589,7 +591,7 @@ value_of_register (regnum)
                      selected_frame, regnum, &lval);
 
   if (register_valid[regnum] < 0)
-    return NULL;       /* register value not available */
+    return NULL;               /* register value not available */
 
   reg_val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum));
 
@@ -672,8 +674,8 @@ registers_fetched ()
    They are inefficient because they need to check for partial updates, which
    can only be done by scanning through all of the registers and seeing if the
    bytes that are being read/written fall inside of an invalid register.  [The
-    main reason this is necessary is that register sizes can vary, so a simple
-    index won't suffice.]  It is far better to call read_register_gen if you
+   main reason this is necessary is that register sizes can vary, so a simple
+   index won't suffice.]  It is far better to call read_register_gen if you
    want to get at the raw register contents, as it only takes a regno as an
    argument, and therefore can't do a partial register update.  It would also
    be good to have a write_register_gen for similar reasons.
@@ -726,7 +728,7 @@ read_register_bytes (inregbyte, myaddr, inlen)
        continue;
 
       /* We've found an invalid register where at least one byte will be read.
-        Update it from the target.  */
+         Update it from the target.  */
 
       target_fetch_registers (regno);
 
@@ -780,20 +782,20 @@ write_register_gen (regno, myaddr)
       registers_pid = inferior_pid;
     }
 
-  size = REGISTER_RAW_SIZE(regno);
+  size = REGISTER_RAW_SIZE (regno);
 
   /* If we have a valid copy of the register, and new value == old value,
      then don't bother doing the actual store. */
 
-  if (register_valid [regno]
+  if (register_valid[regno]
       && memcmp (&registers[REGISTER_BYTE (regno)], myaddr, size) == 0)
     return;
-  
+
   target_prepare_to_store ();
 
   memcpy (&registers[REGISTER_BYTE (regno)], myaddr, size);
 
-  register_valid [regno] = 1;
+  register_valid[regno] = 1;
 
   target_store_registers (regno);
 }
@@ -839,7 +841,7 @@ write_register_bytes (myregstart, myaddr, inlen)
        }
 
       /* We may be doing a partial update of an invalid register.  Update it
-        from the target before scribbling on it.  */
+         from the target before scribbling on it.  */
       read_register_gen (regno, regbuf);
 
       if (startin)
@@ -870,8 +872,8 @@ read_register (regno)
   if (!register_valid[regno])
     target_fetch_registers (regno);
 
-  return (CORE_ADDR)extract_address (&registers[REGISTER_BYTE (regno)],
-                                    REGISTER_RAW_SIZE(regno));
+  return (CORE_ADDR) extract_address (&registers[REGISTER_BYTE (regno)],
+                                     REGISTER_RAW_SIZE (regno));
 }
 
 CORE_ADDR
@@ -917,22 +919,22 @@ write_register (regno, val)
       registers_pid = inferior_pid;
     }
 
-  size = REGISTER_RAW_SIZE(regno);
+  size = REGISTER_RAW_SIZE (regno);
   buf = alloca (size);
-  store_signed_integer (buf, size, (LONGEST)val);
+  store_signed_integer (buf, size, (LONGEST) val);
 
   /* If we have a valid copy of the register, and new value == old value,
      then don't bother doing the actual store. */
 
-  if (register_valid [regno]
+  if (register_valid[regno]
       && memcmp (&registers[REGISTER_BYTE (regno)], buf, size) == 0)
     return;
-  
+
   target_prepare_to_store ();
 
   memcpy (&registers[REGISTER_BYTE (regno)], buf, size);
 
-  register_valid [regno] = 1;
+  register_valid[regno] = 1;
 
   target_store_registers (regno);
 }
@@ -967,7 +969,7 @@ write_register_pid (regno, val, pid)
    If VAL is a NULL pointer, then it's probably an unsupported register.  We
    just set it's value to all zeros.  We might want to record this fact, and
    report it to the users of read_register and friends.
-*/
+ */
 
 void
 supply_register (regno, val)
@@ -991,7 +993,7 @@ supply_register (regno, val)
   /* On some architectures, e.g. HPPA, there are a few stray bits in some
      registers, that the rest of the code would like to ignore.  */
 #ifdef CLEAN_UP_REGISTER_VALUE
-  CLEAN_UP_REGISTER_VALUE(regno, &registers[REGISTER_BYTE(regno)]);
+  CLEAN_UP_REGISTER_VALUE (regno, &registers[REGISTER_BYTE (regno)]);
 #endif
 }
 
@@ -1031,13 +1033,13 @@ CORE_ADDR
 read_pc_pid (pid)
      int pid;
 {
-  int  saved_inferior_pid;
-  CORE_ADDR  pc_val;
+  int saved_inferior_pid;
+  CORE_ADDR pc_val;
 
   /* In case pid != inferior_pid. */
   saved_inferior_pid = inferior_pid;
   inferior_pid = pid;
-  
+
   pc_val = TARGET_READ_PC (pid);
 
   inferior_pid = saved_inferior_pid;
@@ -1080,12 +1082,12 @@ write_pc_pid (pc, pid)
      CORE_ADDR pc;
      int pid;
 {
-  int  saved_inferior_pid;
+  int saved_inferior_pid;
 
   /* In case pid != inferior_pid. */
   saved_inferior_pid = inferior_pid;
   inferior_pid = pid;
-  
+
   TARGET_WRITE_PC (pc, pid);
 
   inferior_pid = saved_inferior_pid;
@@ -1200,7 +1202,7 @@ symbol_read_needs_frame (sym)
   switch (SYMBOL_CLASS (sym))
     {
       /* All cases listed explicitly so that gcc -Wall will detect it if
-        we failed to consider one.  */
+         we failed to consider one.  */
     case LOC_REGISTER:
     case LOC_ARG:
     case LOC_REF_ARG:
@@ -1221,8 +1223,8 @@ symbol_read_needs_frame (sym)
 
     case LOC_LABEL:
       /* Getting the address of a label can be done independently of the block,
-        even if some *uses* of that address wouldn't work so well without
-        the right frame.  */
+         even if some *uses* of that address wouldn't work so well without
+         the right frame.  */
 
     case LOC_BLOCK:
     case LOC_CONST_BYTES:
@@ -1255,7 +1257,8 @@ read_var_value (var, frame)
 
   len = TYPE_LENGTH (type);
 
-  if (frame == NULL) frame = selected_frame;
+  if (frame == NULL)
+    frame = selected_frame;
 
   switch (SYMBOL_CLASS (var))
     {
@@ -1269,12 +1272,12 @@ read_var_value (var, frame)
     case LOC_LABEL:
       /* Put the constant back in target format.  */
       if (overlay_debugging)
-       store_address (VALUE_CONTENTS_RAW (v), len, 
-                      (LONGEST)symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
-                                                          SYMBOL_BFD_SECTION (var)));
+       store_address (VALUE_CONTENTS_RAW (v), len,
+            (LONGEST) symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+                                                SYMBOL_BFD_SECTION (var)));
       else
        store_address (VALUE_CONTENTS_RAW (v), len,
-                      (LONGEST)SYMBOL_VALUE_ADDRESS (var));
+                      (LONGEST) SYMBOL_VALUE_ADDRESS (var));
       VALUE_LVAL (v) = not_lval;
       return v;
 
@@ -1298,12 +1301,12 @@ read_var_value (var, frame)
     case LOC_INDIRECT:
       /* The import slot does not have a real address in it from the
          dynamic loader (dld.sl on HP-UX), if the target hasn't begun
-         execution yet, so check for that. */ 
+         execution yet, so check for that. */
       if (!target_has_execution)
-        error ("\
+       error ("\
 Attempt to access variable defined in different shared object or load module when\n\
 addresses have not been bound by the dynamic loader. Try again when executable is running.");
-      
+
       addr = SYMBOL_VALUE_ADDRESS (var);
       addr = read_memory_unsigned_integer
        (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
@@ -1347,25 +1350,25 @@ addresses have not been bound by the dynamic loader. Try again when executable i
        addr += SYMBOL_VALUE (var);
        break;
       }
-                           
+
     case LOC_THREAD_LOCAL_STATIC:
       {
-        char buf[MAX_REGISTER_RAW_SIZE];
-        
-        get_saved_register(buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
+       char buf[MAX_REGISTER_RAW_SIZE];
+
+       get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
-        addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
-        addr += SYMBOL_VALUE (var );
-        break;
+       addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
+       addr += SYMBOL_VALUE (var);
+       break;
       }
-      
+
     case LOC_TYPEDEF:
       error ("Cannot look up value of a typedef");
       break;
 
     case LOC_BLOCK:
       if (overlay_debugging)
-       VALUE_ADDRESS (v) = symbol_overlayed_address 
+       VALUE_ADDRESS (v) = symbol_overlayed_address
          (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_BFD_SECTION (var));
       else
        VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (var));
@@ -1386,13 +1389,13 @@ addresses have not been bound by the dynamic loader. Try again when executable i
        if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR)
          {
            regval = value_from_register (lookup_pointer_type (type),
-                                         regno, 
+                                         regno,
                                          frame);
 
            if (regval == NULL)
              error ("Value of register variable not available.");
 
-           addr   = value_as_pointer (regval);
+           addr = value_as_pointer (regval);
            VALUE_LVAL (v) = lval_memory;
          }
        else
@@ -1448,7 +1451,7 @@ value_from_register (type, regnum, frame)
      int regnum;
      struct frame_info *frame;
 {
-  char raw_buffer [MAX_REGISTER_RAW_SIZE];
+  char raw_buffer[MAX_REGISTER_RAW_SIZE];
   CORE_ADDR addr;
   int optim;
   value_ptr v = allocate_value (type);
@@ -1471,10 +1474,10 @@ value_from_register (type, regnum, frame)
 #ifdef GDB_TARGET_IS_H8500
       || TYPE_CODE (type) == TYPE_CODE_PTR
 #endif
-      )
+    )
     {
       /* Value spread across multiple storage locations.  */
-      
+
       int local_regnum;
       int mem_stor = 0, reg_stor = 0;
       int mem_tracking = 1;
@@ -1500,13 +1503,18 @@ value_from_register (type, regnum, frame)
 
          switch (regnum)
            {
-           case R0_REGNUM: case R1_REGNUM: case R2_REGNUM: case R3_REGNUM:
+           case R0_REGNUM:
+           case R1_REGNUM:
+           case R2_REGNUM:
+           case R3_REGNUM:
              page_regnum = SEG_D_REGNUM;
              break;
-           case R4_REGNUM: case R5_REGNUM:
+           case R4_REGNUM:
+           case R5_REGNUM:
              page_regnum = SEG_E_REGNUM;
              break;
-           case R6_REGNUM: case R7_REGNUM:
+           case R6_REGNUM:
+           case R7_REGNUM:
              page_regnum = SEG_T_REGNUM;
              break;
            }
@@ -1549,7 +1557,7 @@ value_from_register (type, regnum, frame)
          last_addr = addr;
        }
       else
-#endif                         /* GDB_TARGET_IS_H8500 */
+#endif /* GDB_TARGET_IS_H8500 */
        for (local_regnum = regnum;
             value_bytes_copied < len;
             (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum),
@@ -1562,8 +1570,8 @@ value_from_register (type, regnum, frame)
                                local_regnum,
                                &lval);
 
-         if (register_valid[local_regnum] == -1)
-           return NULL;        /* register value not available */
+           if (register_valid[local_regnum] == -1)
+             return NULL;      /* register value not available */
 
            if (regnum == local_regnum)
              first_addr = addr;
@@ -1572,7 +1580,7 @@ value_from_register (type, regnum, frame)
            else
              {
                mem_stor++;
-             
+
                mem_tracking =
                  (mem_tracking
                   && (regnum == local_regnum
@@ -1606,9 +1614,9 @@ value_from_register (type, regnum, frame)
       VALUE_OPTIMIZED_OUT (v) = optim;
 
       /* Any structure stored in more than one register will always be
-        an integral number of registers.  Otherwise, you'd need to do
-        some fiddling with the last register copied here for little
-        endian machines.  */
+         an integral number of registers.  Otherwise, you'd need to do
+         some fiddling with the last register copied here for little
+         endian machines.  */
 
       /* Copy into the contents section of the value.  */
       memcpy (VALUE_CONTENTS_RAW (v), value_bytes, len);
@@ -1616,7 +1624,7 @@ value_from_register (type, regnum, frame)
       /* Finally do any conversion necessary when extracting this
          type from more than one register.  */
 #ifdef REGISTER_CONVERT_TO_TYPE
-      REGISTER_CONVERT_TO_TYPE(regnum, type, VALUE_CONTENTS_RAW(v));
+      REGISTER_CONVERT_TO_TYPE (regnum, type, VALUE_CONTENTS_RAW (v));
 #endif
       return v;
     }
@@ -1628,14 +1636,14 @@ value_from_register (type, regnum, frame)
   get_saved_register (raw_buffer, &optim, &addr, frame, regnum, &lval);
 
   if (register_valid[regnum] == -1)
-    return NULL;       /* register value not available */
+    return NULL;               /* register value not available */
 
   VALUE_OPTIMIZED_OUT (v) = optim;
   VALUE_LVAL (v) = lval;
   VALUE_ADDRESS (v) = addr;
 
   /* Convert raw data to virtual format if necessary.  */
-  
+
   if (REGISTER_CONVERTIBLE (regnum))
     {
       REGISTER_CONVERT_TO_VIRTUAL (regnum, type,
@@ -1647,13 +1655,13 @@ value_from_register (type, regnum, frame)
 
       if (TARGET_BYTE_ORDER == BIG_ENDIAN && len < REGISTER_RAW_SIZE (regnum))
        {
-         /* Big-endian, and we want less than full size.  */
+         /* Big-endian, and we want less than full size.  */
          VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len;
        }
 
       memcpy (VALUE_CONTENTS_RAW (v), raw_buffer + VALUE_OFFSET (v), len);
     }
-  
+
   return v;
 }
 \f
@@ -1684,13 +1692,13 @@ locate_var_value (var, frame)
       value_ptr val;
 
       addr = VALUE_ADDRESS (lazy_value);
-      val =  value_from_longest (lookup_pointer_type (type), (LONGEST) addr);
+      val = value_from_longest (lookup_pointer_type (type), (LONGEST) addr);
       VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (lazy_value);
       return val;
     }
 
   /* Not a memory address; check what the problem was.  */
-  switch (VALUE_LVAL (lazy_value)) 
+  switch (VALUE_LVAL (lazy_value))
     {
     case lval_register:
     case lval_reg_frame_relative:
@@ -1703,10 +1711,10 @@ locate_var_value (var, frame)
             SYMBOL_SOURCE_NAME (var));
       break;
     }
-  return 0;  /* For lint -- never reached */
+  return 0;                    /* For lint -- never reached */
 }
-
 \f
+
 static void build_findvar PARAMS ((void));
 static void
 build_findvar ()
index 7fa4a0bed7856541e7b6354854908c339045243a..754367b705efd3bf1f6f19be812cde68d9e93ee5 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 91, 92, 93, 94, 1996, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -144,7 +145,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
   /* Multiplying the length of exec_file by 4 is to account for the fact
      that it may expand when quoted; it is a worst-case number based on
      every character being '.  */
-  len = 5 + 4 * strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop*/ 12;
+  len = 5 + 4 * strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop */ 12;
   /* If desired, concat something onto the front of ALLARGS.
      SHELL_COMMAND is the result.  */
 #ifdef SHELL_COMMAND_CONCAT
@@ -177,8 +178,8 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
       strcat (shell_command, "exec ");
 
       /* Quoting in this style is said to work with all shells.  But csh
-       on IRIX 4.0.1 can't deal with it.  So we only quote it if we need
-       to.  */
+         on IRIX 4.0.1 can't deal with it.  So we only quote it if we need
+         to.  */
       p = exec_file;
       while (1)
        {
@@ -250,7 +251,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
   gdb_flush (gdb_stderr);
 
   /* If there's any initialization of the target layers that must happen
-   to prepare to handle the child we're about fork, do it now...
+     to prepare to handle the child we're about fork, do it now...
    */
   if (pre_trace_fun != NULL)
     (*pre_trace_fun) ();
@@ -278,15 +279,15 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
        perror ("setpgrp failed in child");
 
       /* Ask the tty subsystem to switch to the one we specified earlier
-        (or to share the current terminal, if none was specified).  */
+         (or to share the current terminal, if none was specified).  */
 
       new_tty ();
 
       /* Changing the signal handlers for the inferior after
-        a vfork can also change them for the superior, so we don't mess
-        with signals here.  See comments in
-        initialize_signals for how we get the right signal handlers
-        for the inferior.  */
+         a vfork can also change them for the superior, so we don't mess
+         with signals here.  See comments in
+         initialize_signals for how we get the right signal handlers
+         for the inferior.  */
 
       /* "Trace me, Dr. Memory!" */
       (*traceme_fun) ();
@@ -300,10 +301,10 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
        */
 
       /* There is no execlpe call, so we have to set the environment
-        for our child in the global variable.  If we've vforked, this
-        clobbers the parent, but environ is restored a few lines down
-        in the parent.  By the way, yes we do need to look down the
-        path to find $SHELL.  Rich Pixley says so, and I agree.  */
+         for our child in the global variable.  If we've vforked, this
+         clobbers the parent, but environ is restored a few lines down
+         in the parent.  By the way, yes we do need to look down the
+         path to find $SHELL.  Rich Pixley says so, and I agree.  */
       environ = env;
 
       /* If we decided above to start up with a shell,
@@ -346,8 +347,8 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
            }
          fprintf_unfiltered (gdb_stderr, ".\n");
          /* This extra info seems to be useless
-        fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring);
-         */
+            fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring);
+          */
          gdb_flush (gdb_stderr);
          _exit (0177);
        }
@@ -387,7 +388,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
 
    Also, the original debugger will set FOLLOWED_CHILD FALSE, while the
    clone will set it TRUE.
  */
+ */
 void
 clone_and_follow_inferior (child_pid, followed_child)
      int child_pid;
@@ -405,7 +406,7 @@ clone_and_follow_inferior (child_pid, followed_child)
      this way because on some targets, only one process at a time can
      trace another.  Thus, the original debugger must relinquish its
      tracing rights before the clone can pick them up.)
-     */
+   */
 #define SEM_TALK (1)
 #define SEM_LISTEN (0)
   int handoff_semaphore[2];    /* Original "talks" to [1], clone "listens" to [0] */
@@ -423,7 +424,7 @@ clone_and_follow_inferior (child_pid, followed_child)
   gdb_flush (gdb_stderr);
 
   /* Open the semaphore pipes.
-     */
+   */
   status = pipe (handoff_semaphore);
   if (status < 0)
     error ("error getting pipe for handoff semaphore");
@@ -442,14 +443,14 @@ clone_and_follow_inferior (child_pid, followed_child)
     perror_with_name ("fork");
 
   /* Are we the original debugger?  If so, we must relinquish all claims
-   to CHILD_PID. */
+     to CHILD_PID. */
   if (debugger_pid != 0)
     {
-      char signal_spelling[100];/* Arbitrary but sufficient length */
+      char signal_spelling[100];       /* Arbitrary but sufficient length */
 
       /* Detach from CHILD_PID.  Deliver a "stop" signal when we do, though,
-       so that it remains stopped until the clone debugger can attach
-       to it.
+         so that it remains stopped until the clone debugger can attach
+         to it.
        */
       detach_breakpoints (child_pid);
 
@@ -475,7 +476,7 @@ clone_and_follow_inferior (child_pid, followed_child)
 
          Wait until the original debugger relinquishes control of CHILD_PID,
          though.
-         */
+       */
       read (handoff_semaphore[SEM_LISTEN], &listen_value, sizeof (listen_value));
 
       /* Note that we DON'T want to actually detach from inferior_pid,
@@ -483,7 +484,7 @@ clone_and_follow_inferior (child_pid, followed_child)
          debugger wants to retain control of the process.  So, we
          just reset inferior_pid to CHILD_PID, and then ensure that all
          breakpoints are really set in CHILD_PID.
-         */
+       */
       target_mourn_inferior ();
 
       /* Ask the tty subsystem to switch to the one we specified earlier
@@ -499,7 +500,7 @@ clone_and_follow_inferior (child_pid, followed_child)
          of attaching can behave differently on some targets than the
          standard method, where a process formerly not under debugger
          control was suddenly attached to..)
-         */
+       */
       target_post_follow_inferior_by_clone ();
 
       *followed_child = 1;
@@ -555,11 +556,11 @@ startup_inferior (ntraps)
          if (!terminal_initted)
            {
              /* Now that the child has exec'd we know it has already set its
-                process group.  On POSIX systems, tcsetpgrp will fail with
-                EPERM if we try it before the child's setpgid.  */
+                process group.  On POSIX systems, tcsetpgrp will fail with
+                EPERM if we try it before the child's setpgid.  */
 
              /* Set up the "saved terminal modes" of the inferior
-                based on what modes we are starting it with.  */
+                based on what modes we are starting it with.  */
              target_terminal_init ();
 
              /* Install inferior's terminal modes.  */
index 13d9426451450c618332451fad25f933c2c6b3fd..55b713a13593156abcc442965a168cd5b98d178d 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the Fujitsu FR30.
    Copyright 1999, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -51,22 +52,23 @@ fr30_frameless_function_invocation (fi)
 void
 fr30_pop_frame ()
 {
-  struct frame_info *frame = get_current_frame();
+  struct frame_info *frame = get_current_frame ();
   int regnum;
-  CORE_ADDR sp = read_register(SP_REGNUM);
+  CORE_ADDR sp = read_register (SP_REGNUM);
 
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  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)));
-       }
+       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 ();
@@ -118,7 +120,7 @@ fr30_store_return_value (struct type *type,
    Return the address of the first code past the prologue of the function.  */
 
 CORE_ADDR
-fr30_skip_prologue(CORE_ADDR pc)
+fr30_skip_prologue (CORE_ADDR pc)
 {
   CORE_ADDR func_addr, func_end;
 
@@ -130,8 +132,9 @@ fr30_skip_prologue(CORE_ADDR pc)
 
       sal = find_pc_line (func_addr, 0);
 
-      if (sal.line != 0 && sal.end < func_end) {
-       return sal.end;
+      if (sal.line != 0 && sal.end < func_end)
+       {
+         return sal.end;
        }
     }
 
@@ -153,86 +156,87 @@ fr30_skip_prologue(CORE_ADDR pc)
    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(nargs, args, sp, struct_return, struct_addr)
-     int         nargs;
-     value_ptr * args;
-     CORE_ADDR   sp;
-     int         struct_return;
-     CORE_ADDR   struct_addr;
+fr30_push_arguments (nargs, args, sp, struct_return, struct_addr)
+     int nargs;
+     value_ptr *args;
+     CORE_ADDR sp;
+     int struct_return;
+     CORE_ADDR struct_addr;
 {
   int argreg;
   int argnum;
   int stack_offset;
-  struct stack_arg {
+  struct stack_arg
+    {
       char *val;
       int len;
       int offset;
     };
   struct stack_arg *stack_args =
-      (struct stack_arg*)alloca (nargs * sizeof (struct stack_arg));
+  (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);
+    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++)
+     registers, save the rest to be pushed on the stack */
+  for (argnum = 0; argnum < nargs; argnum++)
     {
-      char *         val;
-      value_ptr      arg = args[argnum];
-      struct type *  arg_type = check_typedef (VALUE_TYPE (arg));
-      struct type *  target_type = TYPE_TARGET_TYPE (arg_type);
-      int            len = TYPE_LENGTH (arg_type);
+      char *val;
+      value_ptr arg = args[argnum];
+      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+      struct type *target_type = TYPE_TARGET_TYPE (arg_type);
+      int len = TYPE_LENGTH (arg_type);
       enum type_code typecode = TYPE_CODE (arg_type);
-      CORE_ADDR      regval;
+      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);
+       /* 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;
@@ -243,7 +247,7 @@ void _initialize_fr30_tdep PARAMS ((void));
 void
 _initialize_fr30_tdep ()
 {
-  extern int print_insn_fr30(bfd_vma, disassemble_info *);
+  extern int print_insn_fr30 (bfd_vma, disassemble_info *);
   tm_print_insn = print_insn_fr30;
 }
 
@@ -253,23 +257,23 @@ _initialize_fr30_tdep ()
    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 frame register number;
+   * the size of the stack frame;
+   * the offsets of saved regs (relative to the old SP); and
+   * the offset from the stack pointer to the frame pointer
 
    The cache contains only one entry, since this is adequate
    for the typical sequence of prologue scan requests we get.
    When performing a backtrace, GDB will usually ask to scan
    the same function twice in a row (once to get the frame chain,
    and once to fill in the extra frame information).
-*/
+ */
 
 static struct frame_info prologue_cache;
 
 static int
 check_prologue_cache (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int i;
 
@@ -289,22 +293,23 @@ check_prologue_cache (fi)
 
 /* Function: save_prologue_cache
    Copy the prologue information from fi to the prologue cache.
-*/
+ */
 
 static void
 save_prologue_cache (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int i;
 
-  prologue_cache.pc          = fi->pc;
-  prologue_cache.framereg    = fi->framereg;
-  prologue_cache.framesize   = fi->framesize;
+  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];
-  }
+
+  for (i = 0; i <= NUM_REGS; i++)
+    {
+      prologue_cache.fsr.regs[i] = fi->fsr.regs[i];
+    }
 }
 
 
@@ -319,7 +324,7 @@ save_prologue_cache (fi)
 
 static void
 fr30_scan_prologue (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int sp_offset, fp_offset;
   CORE_ADDR prologue_start, prologue_end, current_pc;
@@ -329,8 +334,8 @@ fr30_scan_prologue (fi)
     return;
 
   /* Assume there is no frame until proven otherwise.  */
-  fi->framereg    = SP_REGNUM;
-  fi->framesize   = 0;
+  fi->framereg = SP_REGNUM;
+  fi->framesize = 0;
   fi->frameoffset = 0;
 
   /* Find the function prologue.  If we can't find the function in
@@ -341,10 +346,10 @@ fr30_scan_prologue (fi)
          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 */
+      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)  */
+       prologue_end = sal.end; /* (probably means no prologue)  */
     }
   else
     {
@@ -363,14 +368,14 @@ fr30_scan_prologue (fi)
 
       insn = read_memory_unsigned_integer (current_pc, 2);
 
-      if ((insn & 0xfe00) == 0x8e00)                   /* stm0 or stm1 */
+      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)
+         if ((insn & 0x0100) == 0)
            {
-             mask <<= 8;  /* stm0 - move to upper byte in virtual mask */
+             mask <<= 8;       /* stm0 - move to upper byte in virtual mask */
            }
 
          /* Calculate offsets of saved registers (to be turned later into addresses). */
@@ -381,53 +386,53 @@ fr30_scan_prologue (fi)
                fi->fsr.regs[reg] = sp_offset;
              }
        }
-      else if((insn & 0xfff0) == 0x1700)               /* st rx,@-r15 */
-        {
+      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 */
-        {
+      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 */
+      else if (insn == 0x1781) /* st rp,@-sp */
        {
-               sp_offset -= 4;
-               fi->fsr.regs[RP_REGNUM] = sp_offset;
+         sp_offset -= 4;
+         fi->fsr.regs[RP_REGNUM] = sp_offset;
        }
-      else if(insn == 0x170e)                          /* st fp,@-sp */
+      else if (insn == 0x170e) /* st fp,@-sp */
        {
-               sp_offset -= 4;
-               fi->fsr.regs[FP_REGNUM] = sp_offset;
+         sp_offset -= 4;
+         fi->fsr.regs[FP_REGNUM] = sp_offset;
        }
-      else if(insn == 0x8bfe)                          /* mov sp,fp */
+      else if (insn == 0x8bfe) /* mov sp,fp */
        {
          fi->framereg = FP_REGNUM;
        }
-      else if((insn & 0xff00) == 0xa300)               /* addsp xx */
+      else if ((insn & 0xff00) == 0xa300)      /* addsp xx */
        {
-         sp_offset += 4 * (signed char)(insn & 0xff);
+         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 */
+      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));
+         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 */
+      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));
+           (read_memory_unsigned_integer (current_pc + 2, 2) << 16 |
+            read_memory_unsigned_integer (current_pc + 4, 2));
          current_pc += 6;
        }
     }
@@ -437,7 +442,7 @@ fr30_scan_prologue (fi)
      [new FP] - [new SP].  */
   fi->framesize = -sp_offset;
   fi->frameoffset = fp_offset - sp_offset;
-  
+
   save_prologue_cache (fi);
 }
 
@@ -456,7 +461,7 @@ fr30_scan_prologue (fi)
 
 void
 fr30_init_extra_frame_info (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   int reg;
 
@@ -468,28 +473,29 @@ fr30_init_extra_frame_info (fi)
   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;
+         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;
-       }
+  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
@@ -509,8 +515,8 @@ fr30_find_callers_reg (fi, regnum)
     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_memory_unsigned_integer (fi->fsr.regs[regnum],
+                                          REGISTER_RAW_SIZE (regnum));
 
   return read_register (regnum);
 }
@@ -526,7 +532,7 @@ fr30_find_callers_reg (fi, regnum)
 
 CORE_ADDR
 fr30_frame_chain (fi)
-     struct frame_info * fi;
+     struct frame_info *fi;
 {
   CORE_ADDR fn_start, callers_pc, fp;
   struct frame_info caller_fi;
@@ -534,17 +540,17 @@ fr30_frame_chain (fi)
 
   /* 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 */
+    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: */
+  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 (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 */
+      return 0;                        /* in _start fn, don't chain further */
 
   framereg = fi->framereg;
 
@@ -553,9 +559,9 @@ fr30_frame_chain (fi)
     if (fn_start == entry_point_address ())
       return 0;
 
-  memset (& caller_fi, 0, sizeof (caller_fi));
+  memset (&caller_fi, 0, sizeof (caller_fi));
   caller_fi.pc = callers_pc;
-  fr30_scan_prologue (& caller_fi);
+  fr30_scan_prologue (&caller_fi);
   framereg = caller_fi.framereg;
 
   /* If the caller used a frame register, return its value.
@@ -577,8 +583,8 @@ CORE_ADDR
 fr30_frame_saved_pc (fi)
      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);
+  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);
 }
@@ -586,9 +592,9 @@ fr30_frame_saved_pc (fi)
 /* 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
  */
+   jarl <offset24>, r31
+   trap
+ */
 
 int
 fr30_fix_call_dummy (dummy, sp, fun, nargs, args, type, gcc_p)
@@ -606,7 +612,7 @@ fr30_fix_call_dummy (dummy, sp, fun, nargs, args, type, gcc_p)
   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);
+  store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff);
+  store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16);
   return 0;
 }
index 77cc4915740d3edcb2bdf85472410a6648a80d5f..39e41ef3272ec7bdf308d83f62c365f2e2f8b5b3 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for dealing with stack frames, for GDB, the GNU debugger.
    Copyright 1986, 1989, 1991, 1992, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (FRAME_H)
 #define FRAME_H 1
@@ -66,7 +67,7 @@ struct frame_info
        Set by machine-dependent code.  On some machines, if
        the machine-dependent code fails to check for this, the backtrace
        will look relatively normal.  For example, on the i386
-         #3  0x158728 in sighold ()
+       #3  0x158728 in sighold ()
        On other machines (e.g. rs6000), the machine-dependent code better
        set this to prevent us from trying to print it like a normal frame.  */
     int signal_handler_caller;
@@ -79,13 +80,13 @@ struct frame_info
        address where the sp was saved.  */
     /* Allocated by frame_saved_regs_zalloc () which is called /
        initialized by FRAME_INIT_SAVED_REGS(). */
-    CORE_ADDR *saved_regs; /*NUM_REGS*/
+    CORE_ADDR *saved_regs;     /*NUM_REGS */
 
 #ifdef EXTRA_FRAME_INFO
     /* XXXX - deprecated */
     /* Anything extra for this structure that may have been defined
        in the machine dependent files. */
-    EXTRA_FRAME_INFO
+      EXTRA_FRAME_INFO
 #endif
 
     /* Anything extra for this structure that may have been defined
@@ -95,7 +96,7 @@ struct frame_info
     struct frame_extra_info *extra_info;
 
     /* Pointers to the next and previous frame_info's in the frame cache.  */
-   struct frame_info *next, *prev;
+    struct frame_info *next, *prev;
   };
 
 /* Allocate additional space for appendices to a struct frame_info. */
@@ -144,8 +145,8 @@ extern void generic_save_dummy_frame_tos PARAMS ((CORE_ADDR sp));
    chain or following frames back into the startup code.  See the comments
    in objfiles.h. */
 #define FRAME_CHAIN_VALID(chain, thisframe) alternate_frame_chain_valid (chain,thisframe)
-#endif /* FRAME_CHAIN_VALID_ALTERNATE */
-#endif /* FRAME_CHAIN_VALID */
+#endif /* FRAME_CHAIN_VALID_ALTERNATE */
+#endif /* FRAME_CHAIN_VALID */
 
 /* The stack frame that the user has specified for commands to act on.
    Note that one cannot assume this is the address of valid data.  */
@@ -171,7 +172,7 @@ extern void reinit_frame_cache PARAMS ((void));
 extern void get_frame_saved_regs PARAMS ((struct frame_info *,
                                          struct frame_saved_regs *));
 #endif
-  
+
 extern void set_current_frame PARAMS ((struct frame_info *));
 
 extern struct frame_info *get_prev_frame PARAMS ((struct frame_info *));
@@ -192,18 +193,18 @@ extern CORE_ADDR get_frame_pc PARAMS ((struct frame_info *));
 
 extern CORE_ADDR get_pc_function_start PARAMS ((CORE_ADDR));
 
-extern struct block * block_for_pc PARAMS ((CORE_ADDR));
+extern struct block *block_for_pc PARAMS ((CORE_ADDR));
 
-extern struct block * block_for_pc_sect PARAMS ((CORE_ADDR, asection *));
+extern struct block *block_for_pc_sect PARAMS ((CORE_ADDR, asection *));
 
 extern int frameless_look_for_prologue PARAMS ((struct frame_info *));
 
 extern void print_frame_args PARAMS ((struct symbol *, struct frame_info *,
                                      int, GDB_FILE *));
 
-extern struct frame_info *find_relative_frame PARAMS ((struct frame_info *, int*));
+extern struct frame_info *find_relative_frame PARAMS ((struct frame_info *, int *));
 
-extern void show_and_print_stack_frame PARAMS ((struct frame_info *fi, int level, int source));
+extern void show_and_print_stack_frame PARAMS ((struct frame_info * fi, int level, int source));
 
 extern void print_stack_frame PARAMS ((struct frame_info *, int, int));
 
@@ -229,28 +230,28 @@ extern struct frame_info *find_frame_addr_in_frame_chain PARAMS ((CORE_ADDR));
 
 extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
 
-extern CORE_ADDR generic_read_register_dummy PARAMS ((CORE_ADDR pc, 
-                                                     CORE_ADDR fp, 
+extern CORE_ADDR generic_read_register_dummy PARAMS ((CORE_ADDR pc,
+                                                     CORE_ADDR fp,
                                                      int));
-extern void      generic_push_dummy_frame    PARAMS ((void));
-extern void      generic_pop_current_frame   PARAMS ((void (*) (struct frame_info *)));
-extern void      generic_pop_dummy_frame     PARAMS ((void));
+extern void generic_push_dummy_frame PARAMS ((void));
+extern void generic_pop_current_frame PARAMS ((void (*)(struct frame_info *)));
+extern void generic_pop_dummy_frame PARAMS ((void));
 
-extern int       generic_pc_in_call_dummy    PARAMS ((CORE_ADDR pc, 
-                                                     CORE_ADDR sp, 
-                                                     CORE_ADDR fp));
-extern char *    generic_find_dummy_frame    PARAMS ((CORE_ADDR pc, 
-                                                     CORE_ADDR fp));
+extern int generic_pc_in_call_dummy PARAMS ((CORE_ADDR pc,
+                                            CORE_ADDR sp,
+                                            CORE_ADDR fp));
+extern char *generic_find_dummy_frame PARAMS ((CORE_ADDR pc,
+                                              CORE_ADDR fp));
 
 extern void generic_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun,
-                                           int nargs, struct value **args,
-                                           struct type *type, int gcc_p));
+                                           int nargs, struct value ** args,
+                                           struct type * type, int gcc_p));
 
 #ifdef __STDC__
 /* Some native compilers, even ones that are supposed to be ANSI and for which __STDC__
    is true, complain about forward decls of enums. */
 enum lval_type;
-extern void     generic_get_saved_register  PARAMS ((char *, int *, CORE_ADDR *, struct frame_info *, int, enum lval_type *));
+extern void generic_get_saved_register PARAMS ((char *, int *, CORE_ADDR *, struct frame_info *, int, enum lval_type *));
 #endif
 
 #endif /* !defined (FRAME_H)  */
index 1ad782abdcae30aa055f0c1b9c5c2335dfc3a39b..09b372167459e27abb7058b8a4e61ba537593927 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1992 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by John Gilmore.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This file exists to hold the common definitions required of most of
    the symbol-readers that end up using stabs.  The common use of
@@ -36,46 +37,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        SECT_OFF_DATA   1
 #define        SECT_OFF_BSS    2
 #define        SECT_OFF_RODATA 3
-#define        SECT_OFF_MAX    4               /* Count of possible values */
+#define        SECT_OFF_MAX    4       /* Count of possible values */
 
 /* The stab_section_info chain remembers info from the ELF symbol table,
    while psymtabs are being built for the other symbol tables in the 
    objfile.  It is destroyed at the complation of psymtab-reading.
    Any info that was used from it has been copied into psymtabs.  */
 
-struct stab_section_info {
-  char *filename;
-  CORE_ADDR sections[SECT_OFF_MAX];
-  struct stab_section_info *next;
-  int found;           /* Count of times it's found in searching */
-};
+struct stab_section_info
+  {
+    char *filename;
+    CORE_ADDR sections[SECT_OFF_MAX];
+    struct stab_section_info *next;
+    int found;                 /* Count of times it's found in searching */
+  };
 
 /* Information is passed among various dbxread routines for accessing
    symbol files.  A pointer to this structure is kept in the sym_stab_info
    field of the objfile struct.  */
-struct dbx_symfile_info {
-  CORE_ADDR text_addr;         /* Start of text section */
-  int text_size;               /* Size of text section */
-  int symcount;                        /* How many symbols are there in the file */
-  char *stringtab;             /* The actual string table */
-  int stringtab_size;          /* Its size */
-  file_ptr symtab_offset;      /* Offset in file to symbol table */
-  int symbol_size;             /* Bytes in a single symbol */
-  struct stab_section_info *stab_section_info;         /* section starting points
-                                  of the original .o files before linking. */
-
-  /* See stabsread.h for the use of the following. */
-  struct header_file *header_files;
-  int n_header_files;
-  int n_allocated_header_files;
-
-  /* Pointers to BFD sections.  These are used to speed up the building of
-     minimal symbols.  */
-  asection *text_section;
-  asection *data_section;
-  asection *bss_section;
-};
+
+struct dbx_symfile_info
+  {
+    CORE_ADDR text_addr;       /* Start of text section */
+    int text_size;             /* Size of text section */
+    int symcount;              /* How many symbols are there in the file */
+    char *stringtab;           /* The actual string table */
+    int stringtab_size;                /* Its size */
+    file_ptr symtab_offset;    /* Offset in file to symbol table */
+    int symbol_size;           /* Bytes in a single symbol */
+    struct stab_section_info *stab_section_info;       /* section starting points
+                                                          of the original .o files before linking. */
+
+    /* See stabsread.h for the use of the following. */
+    struct header_file *header_files;
+    int n_header_files;
+    int n_allocated_header_files;
+
+    /* Pointers to BFD sections.  These are used to speed up the building of
+       minimal symbols.  */
+    asection *text_section;
+    asection *data_section;
+    asection *bss_section;
+  };
 
 #define DBX_SYMFILE_INFO(o)    ((o)->sym_stab_info)
 #define DBX_TEXT_ADDR(o)       (DBX_SYMFILE_INFO(o)->text_addr)
index b871b292a53c4a73996cc64a4d0dbe21461a35f3..e0c8f88a6fd78dc041564664d28a2811b8456701 100644 (file)
@@ -1,21 +1,22 @@
 /* Portable <sys/stat.h>
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined(GDB_STAT_H)
 #define GDB_STAT_H
@@ -57,12 +58,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
 #endif
-#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
+#if !defined(S_ISMPB) && defined(S_IFMPB)      /* V7 */
 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
 #endif
-#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
+#if !defined(S_ISNWK) && defined(S_IFNWK)      /* HP/UX */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
-#endif /* !defined(GDB_STAT_H) */
+#endif /* !defined(GDB_STAT_H) */
index d578c8d951f90f4146733f19915a9119c6d83ad2..9824f1f8c92c679a09d3f9d29647eb4ecac2c1d1 100644 (file)
@@ -1,21 +1,22 @@
 /* Portable <string.h>
    Copyright 1995, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined(GDB_STRING_H)
 #define GDB_STRING_H
@@ -23,11 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifdef STDC_HEADERS
 #include <string.h>
 #else
-# ifdef HAVE_STRING_H
-#   include <string.h>
-# else
-#   include <strings.h>
-# endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
 
 #ifndef strchr
 extern char *strchr PARAMS ((const char *, int));      /* X3.159-1989  4.11.5.2 */
@@ -41,14 +42,14 @@ extern char *strrchr PARAMS ((const char *, int));  /* X3.159-1989  4.11.5.5 */
 extern char *strtok PARAMS ((char *, const char *));   /* X3.159-1989  4.11.5.8 */
 #endif
 
-# ifdef HAVE_MEMORY_H
-#   include <memory.h>
-# else
-extern void *memset();
-extern void *memcpy();
-extern void *memmove();
-extern int   memcmp();
-# endif
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#else
+extern void *memset ();
+extern void *memcpy ();
+extern void *memmove ();
+extern int memcmp ();
+#endif
 #endif /* STDC_HEADERS */
 
 #ifdef NEED_DECLARATION_STRERROR
@@ -58,7 +59,7 @@ extern char *strerror PARAMS ((int)); /* X3.159-1989  4.11.6.2 */
 #endif
 
 #ifdef NEED_DECLARATION_STRDUP
-extern char *strdup (); /* full prototype collides w/ some OSes (AIX 3.2.5) */
+extern char *strdup ();                /* full prototype collides w/ some OSes (AIX 3.2.5) */
 #endif
 
 #ifdef NEED_DECLARATION_STRSTR
@@ -67,4 +68,4 @@ extern char *strstr PARAMS ((const char *, const char *));    /* X3.159-1989  4.11.
 #endif
 #endif
 
-#endif /* !defined(GDB_STRING_H) */
+#endif /* !defined(GDB_STRING_H) */
index d0cf66d12e6e1e67123f3930aab91cc7bae64093..6e736fabebf69d4a0b769c15bf6581009917b808 100644 (file)
@@ -1,27 +1,28 @@
 /* Semi-dynamic architecture support for GDB, the GNU debugger.
    Copyright 1998-1999, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
 #if GDB_MULTI_ARCH
 #include "gdbcmd.h"
-#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
+#include "inferior.h"          /* enum CALL_DUMMY_LOCATION et.al. */
 #else
 /* Just include everything in sight so that the every old definition
    of macro is visible. */
@@ -60,127 +61,127 @@ int gdbarch_debug = GDBARCH_DEBUG;
 /* Maintain the struct gdbarch object */
 
 struct gdbarch
-{
-  /* basic architectural information */
-  const struct bfd_arch_info * bfd_arch_info;
-  int byte_order;
+  {
+    /* basic architectural information */
+    const struct bfd_arch_info *bfd_arch_info;
+    int byte_order;
 
-  /* target specific vector. */
-  struct gdbarch_tdep *tdep;
+    /* target specific vector. */
+    struct gdbarch_tdep *tdep;
 
-  /* per-architecture data-pointers */
-  int nr_data;
-  void **data;
+    /* per-architecture data-pointers */
+    int nr_data;
+    void **data;
 
-  /* per-architecture swap-regions */
-  struct gdbarch_swap *swap;
+    /* per-architecture swap-regions */
+    struct gdbarch_swap *swap;
 
-  /* Multi-arch values.
+    /* Multi-arch values.
 
-     When extending this structure you must:
+       When extending this structure you must:
 
-     Add the field below.
+       Add the field below.
 
-     Declare set/get functions and define the corresponding
-     macro in gdbarch.h.
+       Declare set/get functions and define the corresponding
+       macro in gdbarch.h.
 
-     gdbarch_alloc(): If zero/NULL is not a suitable default,
-     initialize the new field.
+       gdbarch_alloc(): If zero/NULL is not a suitable default,
+       initialize the new field.
 
-     verify_gdbarch(): Confirm that the target updated the field
-     correctly.
+       verify_gdbarch(): Confirm that the target updated the field
+       correctly.
 
-     gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
-     field is dumped out
+       gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
+       field is dumped out
 
-     ``default_gdbarch()'': Append an initial value to the static
-     variable (base values on the host's c-type system).
+       ``default_gdbarch()'': Append an initial value to the static
+       variable (base values on the host's c-type system).
 
-     get_gdbarch(): Implement the set/get functions (probably using
-     the macro's as shortcuts).
+       get_gdbarch(): Implement the set/get functions (probably using
+       the macro's as shortcuts).
 
      */
 
-  int ptr_bit;
-  int short_bit;
-  int int_bit;
-  int long_bit;
-  int long_long_bit;
-  int float_bit;
-  int double_bit;
-  int long_double_bit;
-  gdbarch_read_pc_ftype *read_pc;
-  gdbarch_write_pc_ftype *write_pc;
-  gdbarch_read_fp_ftype *read_fp;
-  gdbarch_write_fp_ftype *write_fp;
-  gdbarch_read_sp_ftype *read_sp;
-  gdbarch_write_sp_ftype *write_sp;
-  int num_regs;
-  int sp_regnum;
-  int fp_regnum;
-  int pc_regnum;
-  gdbarch_register_name_ftype *register_name;
-  int register_size;
-  int register_bytes;
-  gdbarch_register_byte_ftype *register_byte;
-  gdbarch_register_raw_size_ftype *register_raw_size;
-  int max_register_raw_size;
-  gdbarch_register_virtual_size_ftype *register_virtual_size;
-  int max_register_virtual_size;
-  gdbarch_register_virtual_type_ftype *register_virtual_type;
-  int use_generic_dummy_frames;
-  int call_dummy_location;
-  gdbarch_call_dummy_address_ftype *call_dummy_address;
-  CORE_ADDR call_dummy_start_offset;
-  CORE_ADDR call_dummy_breakpoint_offset;
-  int call_dummy_breakpoint_offset_p;
-  int call_dummy_length;
-  gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
-  int call_dummy_p;
-  LONGEST * call_dummy_words;
-  int sizeof_call_dummy_words;
-  int call_dummy_stack_adjust_p;
-  int call_dummy_stack_adjust;
-  gdbarch_fix_call_dummy_ftype *fix_call_dummy;
-  int believe_pcc_promotion;
-  int believe_pcc_promotion_type;
-  gdbarch_get_saved_register_ftype *get_saved_register;
-  gdbarch_register_convertible_ftype *register_convertible;
-  gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
-  gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
-  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_d10v_make_daddr_ftype *d10v_make_daddr;
-  gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
-  gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
-  gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
-  gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
-  gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
-  gdbarch_store_struct_return_ftype *store_struct_return;
-  gdbarch_store_return_value_ftype *store_return_value;
-  gdbarch_extract_struct_value_address_ftype *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;
-  gdbarch_skip_prologue_ftype *skip_prologue;
-  gdbarch_inner_than_ftype *inner_than;
-  gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
-  CORE_ADDR decr_pc_after_break;
-  CORE_ADDR function_start_offset;
-  gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
-  CORE_ADDR frame_args_skip;
-  gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
-  gdbarch_frame_chain_ftype *frame_chain;
-  gdbarch_frame_chain_valid_ftype *frame_chain_valid;
-  gdbarch_frame_saved_pc_ftype *frame_saved_pc;
-  gdbarch_frame_args_address_ftype *frame_args_address;
-  gdbarch_frame_locals_address_ftype *frame_locals_address;
-  gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
-  gdbarch_frame_num_args_ftype *frame_num_args;
-};
+    int ptr_bit;
+    int short_bit;
+    int int_bit;
+    int long_bit;
+    int long_long_bit;
+    int float_bit;
+    int double_bit;
+    int long_double_bit;
+    gdbarch_read_pc_ftype *read_pc;
+    gdbarch_write_pc_ftype *write_pc;
+    gdbarch_read_fp_ftype *read_fp;
+    gdbarch_write_fp_ftype *write_fp;
+    gdbarch_read_sp_ftype *read_sp;
+    gdbarch_write_sp_ftype *write_sp;
+    int num_regs;
+    int sp_regnum;
+    int fp_regnum;
+    int pc_regnum;
+    gdbarch_register_name_ftype *register_name;
+    int register_size;
+    int register_bytes;
+    gdbarch_register_byte_ftype *register_byte;
+    gdbarch_register_raw_size_ftype *register_raw_size;
+    int max_register_raw_size;
+    gdbarch_register_virtual_size_ftype *register_virtual_size;
+    int max_register_virtual_size;
+    gdbarch_register_virtual_type_ftype *register_virtual_type;
+    int use_generic_dummy_frames;
+    int call_dummy_location;
+    gdbarch_call_dummy_address_ftype *call_dummy_address;
+    CORE_ADDR call_dummy_start_offset;
+    CORE_ADDR call_dummy_breakpoint_offset;
+    int call_dummy_breakpoint_offset_p;
+    int call_dummy_length;
+    gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy;
+    int call_dummy_p;
+    LONGEST *call_dummy_words;
+    int sizeof_call_dummy_words;
+    int call_dummy_stack_adjust_p;
+    int call_dummy_stack_adjust;
+    gdbarch_fix_call_dummy_ftype *fix_call_dummy;
+    int believe_pcc_promotion;
+    int believe_pcc_promotion_type;
+    gdbarch_get_saved_register_ftype *get_saved_register;
+    gdbarch_register_convertible_ftype *register_convertible;
+    gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
+    gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
+    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_d10v_make_daddr_ftype *d10v_make_daddr;
+    gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr;
+    gdbarch_d10v_daddr_p_ftype *d10v_daddr_p;
+    gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p;
+    gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw;
+    gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw;
+    gdbarch_store_struct_return_ftype *store_struct_return;
+    gdbarch_store_return_value_ftype *store_return_value;
+    gdbarch_extract_struct_value_address_ftype *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;
+    gdbarch_skip_prologue_ftype *skip_prologue;
+    gdbarch_inner_than_ftype *inner_than;
+    gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
+    CORE_ADDR decr_pc_after_break;
+    CORE_ADDR function_start_offset;
+    gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
+    CORE_ADDR frame_args_skip;
+    gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
+    gdbarch_frame_chain_ftype *frame_chain;
+    gdbarch_frame_chain_valid_ftype *frame_chain_valid;
+    gdbarch_frame_saved_pc_ftype *frame_saved_pc;
+    gdbarch_frame_args_address_ftype *frame_args_address;
+    gdbarch_frame_locals_address_ftype *frame_locals_address;
+    gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
+    gdbarch_frame_num_args_ftype *frame_num_args;
+  };
 
 
 /* The default architecture uses host values (for want of a better
@@ -188,7 +189,8 @@ struct gdbarch
 
 extern const struct bfd_arch_info bfd_default_arch_struct;
 
-struct gdbarch default_gdbarch = {
+struct gdbarch default_gdbarch =
+{
   /* basic architecture information */
   &bfd_default_arch_struct,
   BIG_ENDIAN,
@@ -197,7 +199,7 @@ struct gdbarch default_gdbarch = {
   /*per-architecture data-pointers and swap regions */
   0, NULL, NULL,
   /* Multi-arch values */
-  8 * sizeof (void*),
+  8 * sizeof (void *),
   8 * sizeof (short),
   8 * sizeof (int),
   8 * sizeof (long),
@@ -324,7 +326,7 @@ gdbarch_alloc (info, tdep)
 
 /* Ensure that all values in a GDBARCH are reasonable. */
 
-static void verify_gdbarch PARAMS ((struct gdbarch *gdbarch));
+static void verify_gdbarch PARAMS ((struct gdbarch * gdbarch));
 static void
 verify_gdbarch (gdbarch)
      struct gdbarch *gdbarch;
@@ -573,306 +575,306 @@ gdbarch_dump ()
 {
   if (TARGET_ARCHITECTURE != NULL)
     fprintf_unfiltered (gdb_stdlog,
-                        "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
-                        TARGET_ARCHITECTURE->printable_name);
+                       "gdbarch_update: TARGET_ARCHITECTURE = %s\n",
+                       TARGET_ARCHITECTURE->printable_name);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
-                      (long) TARGET_BYTE_ORDER);
+                     "gdbarch_update: TARGET_BYTE_ORDER = %ld\n",
+                     (long) TARGET_BYTE_ORDER);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_PTR_BIT = %ld\n",
-                      (long) TARGET_PTR_BIT);
+                     "gdbarch_update: TARGET_PTR_BIT = %ld\n",
+                     (long) TARGET_PTR_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
-                      (long) TARGET_SHORT_BIT);
+                     "gdbarch_update: TARGET_SHORT_BIT = %ld\n",
+                     (long) TARGET_SHORT_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_INT_BIT = %ld\n",
-                      (long) TARGET_INT_BIT);
+                     "gdbarch_update: TARGET_INT_BIT = %ld\n",
+                     (long) TARGET_INT_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_LONG_BIT = %ld\n",
-                      (long) TARGET_LONG_BIT);
+                     "gdbarch_update: TARGET_LONG_BIT = %ld\n",
+                     (long) TARGET_LONG_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
-                      (long) TARGET_LONG_LONG_BIT);
+                     "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n",
+                     (long) TARGET_LONG_LONG_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
-                      (long) TARGET_FLOAT_BIT);
+                     "gdbarch_update: TARGET_FLOAT_BIT = %ld\n",
+                     (long) TARGET_FLOAT_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
-                      (long) TARGET_DOUBLE_BIT);
+                     "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n",
+                     (long) TARGET_DOUBLE_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
-                      (long) TARGET_LONG_DOUBLE_BIT);
+                     "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n",
+                     (long) TARGET_LONG_DOUBLE_BIT);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
-                      (long) current_gdbarch->read_pc
-                      /*TARGET_READ_PC ()*/);
+                     "gdbarch_update: TARGET_READ_PC = 0x%08lx\n",
+                     (long) current_gdbarch->read_pc
+  /*TARGET_READ_PC () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
-                      (long) current_gdbarch->write_pc
-                      /*TARGET_WRITE_PC ()*/);
+                     "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n",
+                     (long) current_gdbarch->write_pc
+  /*TARGET_WRITE_PC () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
-                      (long) current_gdbarch->read_fp
-                      /*TARGET_READ_FP ()*/);
+                     "gdbarch_update: TARGET_READ_FP = 0x%08lx\n",
+                     (long) current_gdbarch->read_fp
+  /*TARGET_READ_FP () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
-                      (long) current_gdbarch->write_fp
-                      /*TARGET_WRITE_FP ()*/);
+                     "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n",
+                     (long) current_gdbarch->write_fp
+  /*TARGET_WRITE_FP () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
-                      (long) current_gdbarch->read_sp
-                      /*TARGET_READ_SP ()*/);
+                     "gdbarch_update: TARGET_READ_SP = 0x%08lx\n",
+                     (long) current_gdbarch->read_sp
+  /*TARGET_READ_SP () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
-                      (long) current_gdbarch->write_sp
-                      /*TARGET_WRITE_SP ()*/);
+                     "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n",
+                     (long) current_gdbarch->write_sp
+  /*TARGET_WRITE_SP () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: NUM_REGS = %ld\n",
-                      (long) NUM_REGS);
+                     "gdbarch_update: NUM_REGS = %ld\n",
+                     (long) NUM_REGS);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: SP_REGNUM = %ld\n",
-                      (long) SP_REGNUM);
+                     "gdbarch_update: SP_REGNUM = %ld\n",
+                     (long) SP_REGNUM);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FP_REGNUM = %ld\n",
-                      (long) FP_REGNUM);
+                     "gdbarch_update: FP_REGNUM = %ld\n",
+                     (long) FP_REGNUM);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: PC_REGNUM = %ld\n",
-                      (long) PC_REGNUM);
+                     "gdbarch_update: PC_REGNUM = %ld\n",
+                     (long) PC_REGNUM);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
-                      (long) current_gdbarch->register_name
-                      /*REGISTER_NAME ()*/);
+                     "gdbarch_update: REGISTER_NAME = 0x%08lx\n",
+                     (long) current_gdbarch->register_name
+  /*REGISTER_NAME () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_SIZE = %ld\n",
-                      (long) REGISTER_SIZE);
+                     "gdbarch_update: REGISTER_SIZE = %ld\n",
+                     (long) REGISTER_SIZE);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_BYTES = %ld\n",
-                      (long) REGISTER_BYTES);
+                     "gdbarch_update: REGISTER_BYTES = %ld\n",
+                     (long) REGISTER_BYTES);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
-                      (long) current_gdbarch->register_byte
-                      /*REGISTER_BYTE ()*/);
+                     "gdbarch_update: REGISTER_BYTE = 0x%08lx\n",
+                     (long) current_gdbarch->register_byte
+  /*REGISTER_BYTE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
-                      (long) current_gdbarch->register_raw_size
-                      /*REGISTER_RAW_SIZE ()*/);
+                     "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n",
+                     (long) current_gdbarch->register_raw_size
+  /*REGISTER_RAW_SIZE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
-                      (long) MAX_REGISTER_RAW_SIZE);
+                     "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n",
+                     (long) MAX_REGISTER_RAW_SIZE);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
-                      (long) current_gdbarch->register_virtual_size
-                      /*REGISTER_VIRTUAL_SIZE ()*/);
+                     "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n",
+                     (long) current_gdbarch->register_virtual_size
+  /*REGISTER_VIRTUAL_SIZE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
-                      (long) MAX_REGISTER_VIRTUAL_SIZE);
+                     "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n",
+                     (long) MAX_REGISTER_VIRTUAL_SIZE);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
-                      (long) current_gdbarch->register_virtual_type
-                      /*REGISTER_VIRTUAL_TYPE ()*/);
+                     "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n",
+                     (long) current_gdbarch->register_virtual_type
+  /*REGISTER_VIRTUAL_TYPE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
-                      (long) USE_GENERIC_DUMMY_FRAMES);
+                     "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n",
+                     (long) USE_GENERIC_DUMMY_FRAMES);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
-                      (long) CALL_DUMMY_LOCATION);
+                     "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n",
+                     (long) CALL_DUMMY_LOCATION);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->call_dummy_address
-                      /*CALL_DUMMY_ADDRESS ()*/);
+                     "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->call_dummy_address
+  /*CALL_DUMMY_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
-                      (long) CALL_DUMMY_START_OFFSET);
+                     "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n",
+                     (long) CALL_DUMMY_START_OFFSET);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
-                      (long) CALL_DUMMY_BREAKPOINT_OFFSET);
+                "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
+                     (long) CALL_DUMMY_BREAKPOINT_OFFSET);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
-                      (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
+                  "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n",
+                     (long) CALL_DUMMY_BREAKPOINT_OFFSET_P);
   if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
     fprintf_unfiltered (gdb_stdlog,
-                        "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
-                        (long) CALL_DUMMY_LENGTH);
+                       "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n",
+                       (long) CALL_DUMMY_LENGTH);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
-                      (long) current_gdbarch->pc_in_call_dummy
-                      /*PC_IN_CALL_DUMMY ()*/);
+                     "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n",
+                     (long) current_gdbarch->pc_in_call_dummy
+  /*PC_IN_CALL_DUMMY () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_P = %ld\n",
-                      (long) CALL_DUMMY_P);
+                     "gdbarch_update: CALL_DUMMY_P = %ld\n",
+                     (long) CALL_DUMMY_P);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
-                      (long) CALL_DUMMY_WORDS);
+                     "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n",
+                     (long) CALL_DUMMY_WORDS);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
-                      (long) SIZEOF_CALL_DUMMY_WORDS);
+                     "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n",
+                     (long) SIZEOF_CALL_DUMMY_WORDS);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
-                      (long) CALL_DUMMY_STACK_ADJUST_P);
+                   "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n",
+                     (long) CALL_DUMMY_STACK_ADJUST_P);
   if (CALL_DUMMY_STACK_ADJUST_P)
     fprintf_unfiltered (gdb_stdlog,
-                        "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
-                        (long) CALL_DUMMY_STACK_ADJUST);
+                     "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n",
+                       (long) CALL_DUMMY_STACK_ADJUST);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
-                      (long) current_gdbarch->fix_call_dummy
-                      /*FIX_CALL_DUMMY ()*/);
+                     "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n",
+                     (long) current_gdbarch->fix_call_dummy
+  /*FIX_CALL_DUMMY () */ );
 #ifdef BELIEVE_PCC_PROMOTION
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
-                      (long) BELIEVE_PCC_PROMOTION);
+                     "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n",
+                     (long) BELIEVE_PCC_PROMOTION);
 #endif
 #ifdef BELIEVE_PCC_PROMOTION_TYPE
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
-                      (long) BELIEVE_PCC_PROMOTION_TYPE);
+                     "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n",
+                     (long) BELIEVE_PCC_PROMOTION_TYPE);
 #endif
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
-                      (long) current_gdbarch->get_saved_register
-                      /*GET_SAVED_REGISTER ()*/);
+                     "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n",
+                     (long) current_gdbarch->get_saved_register
+  /*GET_SAVED_REGISTER () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
-                      (long) current_gdbarch->register_convertible
-                      /*REGISTER_CONVERTIBLE ()*/);
+                     "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n",
+                     (long) current_gdbarch->register_convertible
+  /*REGISTER_CONVERTIBLE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
-                      (long) current_gdbarch->register_convert_to_virtual
-                      /*REGISTER_CONVERT_TO_VIRTUAL ()*/);
+                 "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n",
+                     (long) current_gdbarch->register_convert_to_virtual
+  /*REGISTER_CONVERT_TO_VIRTUAL () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
-                      (long) current_gdbarch->register_convert_to_raw
-                      /*REGISTER_CONVERT_TO_RAW ()*/);
+                     "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n",
+                     (long) current_gdbarch->register_convert_to_raw
+  /*REGISTER_CONVERT_TO_RAW () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
-                      (long) current_gdbarch->extract_return_value
-                      /*EXTRACT_RETURN_VALUE ()*/);
+                     "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n",
+                     (long) current_gdbarch->extract_return_value
+  /*EXTRACT_RETURN_VALUE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
-                      (long) current_gdbarch->push_arguments
-                      /*PUSH_ARGUMENTS ()*/);
+                     "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n",
+                     (long) current_gdbarch->push_arguments
+  /*PUSH_ARGUMENTS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
-                      (long) current_gdbarch->push_dummy_frame
-                      /*PUSH_DUMMY_FRAME ()*/);
+                     "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n",
+                     (long) current_gdbarch->push_dummy_frame
+  /*PUSH_DUMMY_FRAME () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->push_return_address
-                      /*PUSH_RETURN_ADDRESS ()*/);
+                     "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->push_return_address
+  /*PUSH_RETURN_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: POP_FRAME = 0x%08lx\n",
-                      (long) current_gdbarch->pop_frame
-                      /*POP_FRAME ()*/);
+                     "gdbarch_update: POP_FRAME = 0x%08lx\n",
+                     (long) current_gdbarch->pop_frame
+  /*POP_FRAME () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_make_daddr
-                      /*D10V_MAKE_DADDR ()*/);
+                     "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_make_daddr
+  /*D10V_MAKE_DADDR () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_make_iaddr
-                      /*D10V_MAKE_IADDR ()*/);
+                     "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_make_iaddr
+  /*D10V_MAKE_IADDR () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_daddr_p
-                      /*D10V_DADDR_P ()*/);
+                     "gdbarch_update: D10V_DADDR_P = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_daddr_p
+  /*D10V_DADDR_P () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_iaddr_p
-                      /*D10V_IADDR_P ()*/);
+                     "gdbarch_update: D10V_IADDR_P = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_iaddr_p
+  /*D10V_IADDR_P () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_convert_daddr_to_raw
-                      /*D10V_CONVERT_DADDR_TO_RAW ()*/);
+                   "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_convert_daddr_to_raw
+  /*D10V_CONVERT_DADDR_TO_RAW () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
-                      (long) current_gdbarch->d10v_convert_iaddr_to_raw
-                      /*D10V_CONVERT_IADDR_TO_RAW ()*/);
+                   "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n",
+                     (long) current_gdbarch->d10v_convert_iaddr_to_raw
+  /*D10V_CONVERT_IADDR_TO_RAW () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
-                      (long) current_gdbarch->store_struct_return
-                      /*STORE_STRUCT_RETURN ()*/);
+                     "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n",
+                     (long) current_gdbarch->store_struct_return
+  /*STORE_STRUCT_RETURN () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
-                      (long) current_gdbarch->store_return_value
-                      /*STORE_RETURN_VALUE ()*/);
+                     "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n",
+                     (long) current_gdbarch->store_return_value
+  /*STORE_RETURN_VALUE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->extract_struct_value_address
-                      /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
+                "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->extract_struct_value_address
+  /*EXTRACT_STRUCT_VALUE_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
-                      (long) current_gdbarch->use_struct_convention
-                      /*USE_STRUCT_CONVENTION ()*/);
+                     "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n",
+                     (long) current_gdbarch->use_struct_convention
+  /*USE_STRUCT_CONVENTION () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
-                      (long) current_gdbarch->frame_init_saved_regs
-                      /*FRAME_INIT_SAVED_REGS ()*/);
+                     "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n",
+                     (long) current_gdbarch->frame_init_saved_regs
+  /*FRAME_INIT_SAVED_REGS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
-                      (long) current_gdbarch->init_extra_frame_info
-                      /*INIT_EXTRA_FRAME_INFO ()*/);
+                     "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n",
+                     (long) current_gdbarch->init_extra_frame_info
+  /*INIT_EXTRA_FRAME_INFO () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
-                      (long) current_gdbarch->skip_prologue
-                      /*SKIP_PROLOGUE ()*/);
+                     "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n",
+                     (long) current_gdbarch->skip_prologue
+  /*SKIP_PROLOGUE () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: INNER_THAN = 0x%08lx\n",
-                      (long) current_gdbarch->inner_than
-                      /*INNER_THAN ()*/);
+                     "gdbarch_update: INNER_THAN = 0x%08lx\n",
+                     (long) current_gdbarch->inner_than
+  /*INNER_THAN () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
-                      (long) current_gdbarch->breakpoint_from_pc
-                      /*BREAKPOINT_FROM_PC ()*/);
+                     "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n",
+                     (long) current_gdbarch->breakpoint_from_pc
+  /*BREAKPOINT_FROM_PC () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
-                      (long) DECR_PC_AFTER_BREAK);
+                     "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n",
+                     (long) DECR_PC_AFTER_BREAK);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
-                      (long) FUNCTION_START_OFFSET);
+                     "gdbarch_update: FUNCTION_START_OFFSET = %ld\n",
+                     (long) FUNCTION_START_OFFSET);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->remote_translate_xfer_address
-                      /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
+               "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->remote_translate_xfer_address
+  /*REMOTE_TRANSLATE_XFER_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
-                      (long) FRAME_ARGS_SKIP);
+                     "gdbarch_update: FRAME_ARGS_SKIP = %ld\n",
+                     (long) FRAME_ARGS_SKIP);
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
-                      (long) current_gdbarch->frameless_function_invocation
-                      /*FRAMELESS_FUNCTION_INVOCATION ()*/);
+               "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
+                     (long) current_gdbarch->frameless_function_invocation
+  /*FRAMELESS_FUNCTION_INVOCATION () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
-                      (long) current_gdbarch->frame_chain
-                      /*FRAME_CHAIN ()*/);
+                     "gdbarch_update: FRAME_CHAIN = 0x%08lx\n",
+                     (long) current_gdbarch->frame_chain
+  /*FRAME_CHAIN () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
-                      (long) current_gdbarch->frame_chain_valid
-                      /*FRAME_CHAIN_VALID ()*/);
+                     "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n",
+                     (long) current_gdbarch->frame_chain_valid
+  /*FRAME_CHAIN_VALID () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
-                      (long) current_gdbarch->frame_saved_pc
-                      /*FRAME_SAVED_PC ()*/);
+                     "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n",
+                     (long) current_gdbarch->frame_saved_pc
+  /*FRAME_SAVED_PC () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->frame_args_address
-                      /*FRAME_ARGS_ADDRESS ()*/);
+                     "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->frame_args_address
+  /*FRAME_ARGS_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
-                      (long) current_gdbarch->frame_locals_address
-                      /*FRAME_LOCALS_ADDRESS ()*/);
+                     "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n",
+                     (long) current_gdbarch->frame_locals_address
+  /*FRAME_LOCALS_ADDRESS () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
-                      (long) current_gdbarch->saved_pc_after_call
-                      /*SAVED_PC_AFTER_CALL ()*/);
+                     "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n",
+                     (long) current_gdbarch->saved_pc_after_call
+  /*SAVED_PC_AFTER_CALL () */ );
   fprintf_unfiltered (gdb_stdlog,
-                      "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
-                      (long) current_gdbarch->frame_num_args
-                      /*FRAME_NUM_ARGS ()*/);
+                     "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n",
+                     (long) current_gdbarch->frame_num_args
+  /*FRAME_NUM_ARGS () */ );
 }
 
 struct gdbarch_tdep *
 gdbarch_tdep (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -883,7 +885,7 @@ gdbarch_tdep (gdbarch)
 
 const struct bfd_arch_info *
 gdbarch_bfd_arch_info (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -893,7 +895,7 @@ gdbarch_bfd_arch_info (gdbarch)
 
 int
 gdbarch_byte_order (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -903,7 +905,7 @@ gdbarch_byte_order (gdbarch)
 
 int
 gdbarch_ptr_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->ptr_bit == 0)
     fatal ("gdbarch: gdbarch_ptr_bit invalid");
@@ -915,15 +917,15 @@ gdbarch_ptr_bit (gdbarch)
 
 void
 set_gdbarch_ptr_bit (gdbarch, ptr_bit)
-    struct gdbarch *gdbarch;
-    int ptr_bit;
+     struct gdbarch *gdbarch;
+     int ptr_bit;
 {
   gdbarch->ptr_bit = ptr_bit;
 }
 
 int
 gdbarch_short_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->short_bit == 0)
     fatal ("gdbarch: gdbarch_short_bit invalid");
@@ -935,15 +937,15 @@ gdbarch_short_bit (gdbarch)
 
 void
 set_gdbarch_short_bit (gdbarch, short_bit)
-    struct gdbarch *gdbarch;
-    int short_bit;
+     struct gdbarch *gdbarch;
+     int short_bit;
 {
   gdbarch->short_bit = short_bit;
 }
 
 int
 gdbarch_int_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->int_bit == 0)
     fatal ("gdbarch: gdbarch_int_bit invalid");
@@ -955,15 +957,15 @@ gdbarch_int_bit (gdbarch)
 
 void
 set_gdbarch_int_bit (gdbarch, int_bit)
-    struct gdbarch *gdbarch;
-    int int_bit;
+     struct gdbarch *gdbarch;
+     int int_bit;
 {
   gdbarch->int_bit = int_bit;
 }
 
 int
 gdbarch_long_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->long_bit == 0)
     fatal ("gdbarch: gdbarch_long_bit invalid");
@@ -975,15 +977,15 @@ gdbarch_long_bit (gdbarch)
 
 void
 set_gdbarch_long_bit (gdbarch, long_bit)
-    struct gdbarch *gdbarch;
-    int long_bit;
+     struct gdbarch *gdbarch;
+     int long_bit;
 {
   gdbarch->long_bit = long_bit;
 }
 
 int
 gdbarch_long_long_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->long_long_bit == 0)
     fatal ("gdbarch: gdbarch_long_long_bit invalid");
@@ -995,15 +997,15 @@ gdbarch_long_long_bit (gdbarch)
 
 void
 set_gdbarch_long_long_bit (gdbarch, long_long_bit)
-    struct gdbarch *gdbarch;
-    int long_long_bit;
+     struct gdbarch *gdbarch;
+     int long_long_bit;
 {
   gdbarch->long_long_bit = long_long_bit;
 }
 
 int
 gdbarch_float_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->float_bit == 0)
     fatal ("gdbarch: gdbarch_float_bit invalid");
@@ -1015,15 +1017,15 @@ gdbarch_float_bit (gdbarch)
 
 void
 set_gdbarch_float_bit (gdbarch, float_bit)
-    struct gdbarch *gdbarch;
-    int float_bit;
+     struct gdbarch *gdbarch;
+     int float_bit;
 {
   gdbarch->float_bit = float_bit;
 }
 
 int
 gdbarch_double_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->double_bit == 0)
     fatal ("gdbarch: gdbarch_double_bit invalid");
@@ -1035,15 +1037,15 @@ gdbarch_double_bit (gdbarch)
 
 void
 set_gdbarch_double_bit (gdbarch, double_bit)
-    struct gdbarch *gdbarch;
-    int double_bit;
+     struct gdbarch *gdbarch;
+     int double_bit;
 {
   gdbarch->double_bit = double_bit;
 }
 
 int
 gdbarch_long_double_bit (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->long_double_bit == 0)
     fatal ("gdbarch: gdbarch_long_double_bit invalid");
@@ -1055,8 +1057,8 @@ gdbarch_long_double_bit (gdbarch)
 
 void
 set_gdbarch_long_double_bit (gdbarch, long_double_bit)
-    struct gdbarch *gdbarch;
-    int long_double_bit;
+     struct gdbarch *gdbarch;
+     int long_double_bit;
 {
   gdbarch->long_double_bit = long_double_bit;
 }
@@ -1074,8 +1076,8 @@ gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
 
 void
 set_gdbarch_read_pc (gdbarch, read_pc)
-    struct gdbarch *gdbarch;
-    gdbarch_read_pc_ftype read_pc;
+     struct gdbarch *gdbarch;
+     gdbarch_read_pc_ftype read_pc;
 {
   gdbarch->read_pc = read_pc;
 }
@@ -1093,8 +1095,8 @@ gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
 
 void
 set_gdbarch_write_pc (gdbarch, write_pc)
-    struct gdbarch *gdbarch;
-    gdbarch_write_pc_ftype write_pc;
+     struct gdbarch *gdbarch;
+     gdbarch_write_pc_ftype write_pc;
 {
   gdbarch->write_pc = write_pc;
 }
@@ -1112,8 +1114,8 @@ gdbarch_read_fp (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_read_fp (gdbarch, read_fp)
-    struct gdbarch *gdbarch;
-    gdbarch_read_fp_ftype read_fp;
+     struct gdbarch *gdbarch;
+     gdbarch_read_fp_ftype read_fp;
 {
   gdbarch->read_fp = read_fp;
 }
@@ -1131,8 +1133,8 @@ gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
 
 void
 set_gdbarch_write_fp (gdbarch, write_fp)
-    struct gdbarch *gdbarch;
-    gdbarch_write_fp_ftype write_fp;
+     struct gdbarch *gdbarch;
+     gdbarch_write_fp_ftype write_fp;
 {
   gdbarch->write_fp = write_fp;
 }
@@ -1150,8 +1152,8 @@ gdbarch_read_sp (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_read_sp (gdbarch, read_sp)
-    struct gdbarch *gdbarch;
-    gdbarch_read_sp_ftype read_sp;
+     struct gdbarch *gdbarch;
+     gdbarch_read_sp_ftype read_sp;
 {
   gdbarch->read_sp = read_sp;
 }
@@ -1169,15 +1171,15 @@ gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
 
 void
 set_gdbarch_write_sp (gdbarch, write_sp)
-    struct gdbarch *gdbarch;
-    gdbarch_write_sp_ftype write_sp;
+     struct gdbarch *gdbarch;
+     gdbarch_write_sp_ftype write_sp;
 {
   gdbarch->write_sp = write_sp;
 }
 
 int
 gdbarch_num_regs (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->num_regs == -1)
     fatal ("gdbarch: gdbarch_num_regs invalid");
@@ -1189,15 +1191,15 @@ gdbarch_num_regs (gdbarch)
 
 void
 set_gdbarch_num_regs (gdbarch, num_regs)
-    struct gdbarch *gdbarch;
-    int num_regs;
+     struct gdbarch *gdbarch;
+     int num_regs;
 {
   gdbarch->num_regs = num_regs;
 }
 
 int
 gdbarch_sp_regnum (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->sp_regnum == -1)
     fatal ("gdbarch: gdbarch_sp_regnum invalid");
@@ -1209,15 +1211,15 @@ gdbarch_sp_regnum (gdbarch)
 
 void
 set_gdbarch_sp_regnum (gdbarch, sp_regnum)
-    struct gdbarch *gdbarch;
-    int sp_regnum;
+     struct gdbarch *gdbarch;
+     int sp_regnum;
 {
   gdbarch->sp_regnum = sp_regnum;
 }
 
 int
 gdbarch_fp_regnum (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->fp_regnum == -1)
     fatal ("gdbarch: gdbarch_fp_regnum invalid");
@@ -1229,15 +1231,15 @@ gdbarch_fp_regnum (gdbarch)
 
 void
 set_gdbarch_fp_regnum (gdbarch, fp_regnum)
-    struct gdbarch *gdbarch;
-    int fp_regnum;
+     struct gdbarch *gdbarch;
+     int fp_regnum;
 {
   gdbarch->fp_regnum = fp_regnum;
 }
 
 int
 gdbarch_pc_regnum (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->pc_regnum == -1)
     fatal ("gdbarch: gdbarch_pc_regnum invalid");
@@ -1249,8 +1251,8 @@ gdbarch_pc_regnum (gdbarch)
 
 void
 set_gdbarch_pc_regnum (gdbarch, pc_regnum)
-    struct gdbarch *gdbarch;
-    int pc_regnum;
+     struct gdbarch *gdbarch;
+     int pc_regnum;
 {
   gdbarch->pc_regnum = pc_regnum;
 }
@@ -1268,15 +1270,15 @@ gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
 
 void
 set_gdbarch_register_name (gdbarch, register_name)
-    struct gdbarch *gdbarch;
-    gdbarch_register_name_ftype register_name;
+     struct gdbarch *gdbarch;
+     gdbarch_register_name_ftype register_name;
 {
   gdbarch->register_name = register_name;
 }
 
 int
 gdbarch_register_size (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->register_size == -1)
     fatal ("gdbarch: gdbarch_register_size invalid");
@@ -1288,15 +1290,15 @@ gdbarch_register_size (gdbarch)
 
 void
 set_gdbarch_register_size (gdbarch, register_size)
-    struct gdbarch *gdbarch;
-    int register_size;
+     struct gdbarch *gdbarch;
+     int register_size;
 {
   gdbarch->register_size = register_size;
 }
 
 int
 gdbarch_register_bytes (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->register_bytes == -1)
     fatal ("gdbarch: gdbarch_register_bytes invalid");
@@ -1308,8 +1310,8 @@ gdbarch_register_bytes (gdbarch)
 
 void
 set_gdbarch_register_bytes (gdbarch, register_bytes)
-    struct gdbarch *gdbarch;
-    int register_bytes;
+     struct gdbarch *gdbarch;
+     int register_bytes;
 {
   gdbarch->register_bytes = register_bytes;
 }
@@ -1327,8 +1329,8 @@ gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
 
 void
 set_gdbarch_register_byte (gdbarch, register_byte)
-    struct gdbarch *gdbarch;
-    gdbarch_register_byte_ftype register_byte;
+     struct gdbarch *gdbarch;
+     gdbarch_register_byte_ftype register_byte;
 {
   gdbarch->register_byte = register_byte;
 }
@@ -1346,15 +1348,15 @@ gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
 
 void
 set_gdbarch_register_raw_size (gdbarch, register_raw_size)
-    struct gdbarch *gdbarch;
-    gdbarch_register_raw_size_ftype register_raw_size;
+     struct gdbarch *gdbarch;
+     gdbarch_register_raw_size_ftype register_raw_size;
 {
   gdbarch->register_raw_size = register_raw_size;
 }
 
 int
 gdbarch_max_register_raw_size (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->max_register_raw_size == -1)
     fatal ("gdbarch: gdbarch_max_register_raw_size invalid");
@@ -1366,8 +1368,8 @@ gdbarch_max_register_raw_size (gdbarch)
 
 void
 set_gdbarch_max_register_raw_size (gdbarch, max_register_raw_size)
-    struct gdbarch *gdbarch;
-    int max_register_raw_size;
+     struct gdbarch *gdbarch;
+     int max_register_raw_size;
 {
   gdbarch->max_register_raw_size = max_register_raw_size;
 }
@@ -1385,15 +1387,15 @@ gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
 
 void
 set_gdbarch_register_virtual_size (gdbarch, register_virtual_size)
-    struct gdbarch *gdbarch;
-    gdbarch_register_virtual_size_ftype register_virtual_size;
+     struct gdbarch *gdbarch;
+     gdbarch_register_virtual_size_ftype register_virtual_size;
 {
   gdbarch->register_virtual_size = register_virtual_size;
 }
 
 int
 gdbarch_max_register_virtual_size (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->max_register_virtual_size == -1)
     fatal ("gdbarch: gdbarch_max_register_virtual_size invalid");
@@ -1405,8 +1407,8 @@ gdbarch_max_register_virtual_size (gdbarch)
 
 void
 set_gdbarch_max_register_virtual_size (gdbarch, max_register_virtual_size)
-    struct gdbarch *gdbarch;
-    int max_register_virtual_size;
+     struct gdbarch *gdbarch;
+     int max_register_virtual_size;
 {
   gdbarch->max_register_virtual_size = max_register_virtual_size;
 }
@@ -1424,15 +1426,15 @@ gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
 
 void
 set_gdbarch_register_virtual_type (gdbarch, register_virtual_type)
-    struct gdbarch *gdbarch;
-    gdbarch_register_virtual_type_ftype register_virtual_type;
+     struct gdbarch *gdbarch;
+     gdbarch_register_virtual_type_ftype register_virtual_type;
 {
   gdbarch->register_virtual_type = register_virtual_type;
 }
 
 int
 gdbarch_use_generic_dummy_frames (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->use_generic_dummy_frames == -1)
     fatal ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
@@ -1444,15 +1446,15 @@ gdbarch_use_generic_dummy_frames (gdbarch)
 
 void
 set_gdbarch_use_generic_dummy_frames (gdbarch, use_generic_dummy_frames)
-    struct gdbarch *gdbarch;
-    int use_generic_dummy_frames;
+     struct gdbarch *gdbarch;
+     int use_generic_dummy_frames;
 {
   gdbarch->use_generic_dummy_frames = use_generic_dummy_frames;
 }
 
 int
 gdbarch_call_dummy_location (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_location == 0)
     fatal ("gdbarch: gdbarch_call_dummy_location invalid");
@@ -1464,8 +1466,8 @@ gdbarch_call_dummy_location (gdbarch)
 
 void
 set_gdbarch_call_dummy_location (gdbarch, call_dummy_location)
-    struct gdbarch *gdbarch;
-    int call_dummy_location;
+     struct gdbarch *gdbarch;
+     int call_dummy_location;
 {
   gdbarch->call_dummy_location = call_dummy_location;
 }
@@ -1483,15 +1485,15 @@ gdbarch_call_dummy_address (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_call_dummy_address (gdbarch, call_dummy_address)
-    struct gdbarch *gdbarch;
-    gdbarch_call_dummy_address_ftype call_dummy_address;
+     struct gdbarch *gdbarch;
+     gdbarch_call_dummy_address_ftype call_dummy_address;
 {
   gdbarch->call_dummy_address = call_dummy_address;
 }
 
 CORE_ADDR
 gdbarch_call_dummy_start_offset (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_start_offset == -1)
     fatal ("gdbarch: gdbarch_call_dummy_start_offset invalid");
@@ -1503,15 +1505,15 @@ gdbarch_call_dummy_start_offset (gdbarch)
 
 void
 set_gdbarch_call_dummy_start_offset (gdbarch, call_dummy_start_offset)
-    struct gdbarch *gdbarch;
-    CORE_ADDR call_dummy_start_offset;
+     struct gdbarch *gdbarch;
+     CORE_ADDR call_dummy_start_offset;
 {
   gdbarch->call_dummy_start_offset = call_dummy_start_offset;
 }
 
 CORE_ADDR
 gdbarch_call_dummy_breakpoint_offset (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_breakpoint_offset == -1)
     fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
@@ -1523,15 +1525,15 @@ gdbarch_call_dummy_breakpoint_offset (gdbarch)
 
 void
 set_gdbarch_call_dummy_breakpoint_offset (gdbarch, call_dummy_breakpoint_offset)
-    struct gdbarch *gdbarch;
-    CORE_ADDR call_dummy_breakpoint_offset;
+     struct gdbarch *gdbarch;
+     CORE_ADDR call_dummy_breakpoint_offset;
 {
   gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
 }
 
 int
 gdbarch_call_dummy_breakpoint_offset_p (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_breakpoint_offset_p == -1)
     fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
@@ -1543,15 +1545,15 @@ gdbarch_call_dummy_breakpoint_offset_p (gdbarch)
 
 void
 set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, call_dummy_breakpoint_offset_p)
-    struct gdbarch *gdbarch;
-    int call_dummy_breakpoint_offset_p;
+     struct gdbarch *gdbarch;
+     int call_dummy_breakpoint_offset_p;
 {
   gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p;
 }
 
 int
 gdbarch_call_dummy_length (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_length == -1)
     fatal ("gdbarch: gdbarch_call_dummy_length invalid");
@@ -1563,8 +1565,8 @@ gdbarch_call_dummy_length (gdbarch)
 
 void
 set_gdbarch_call_dummy_length (gdbarch, call_dummy_length)
-    struct gdbarch *gdbarch;
-    int call_dummy_length;
+     struct gdbarch *gdbarch;
+     int call_dummy_length;
 {
   gdbarch->call_dummy_length = call_dummy_length;
 }
@@ -1582,15 +1584,15 @@ gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, C
 
 void
 set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy)
-    struct gdbarch *gdbarch;
-    gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy;
+     struct gdbarch *gdbarch;
+     gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy;
 {
   gdbarch->pc_in_call_dummy = pc_in_call_dummy;
 }
 
 int
 gdbarch_call_dummy_p (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_p == -1)
     fatal ("gdbarch: gdbarch_call_dummy_p invalid");
@@ -1602,15 +1604,15 @@ gdbarch_call_dummy_p (gdbarch)
 
 void
 set_gdbarch_call_dummy_p (gdbarch, call_dummy_p)
-    struct gdbarch *gdbarch;
-    int call_dummy_p;
+     struct gdbarch *gdbarch;
+     int call_dummy_p;
 {
   gdbarch->call_dummy_p = call_dummy_p;
 }
 
 LONGEST *
 gdbarch_call_dummy_words (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -1620,15 +1622,15 @@ gdbarch_call_dummy_words (gdbarch)
 
 void
 set_gdbarch_call_dummy_words (gdbarch, call_dummy_words)
-    struct gdbarch *gdbarch;
-    LONGEST * call_dummy_words;
+     struct gdbarch *gdbarch;
+     LONGEST *call_dummy_words;
 {
   gdbarch->call_dummy_words = call_dummy_words;
 }
 
 int
 gdbarch_sizeof_call_dummy_words (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -1638,15 +1640,15 @@ gdbarch_sizeof_call_dummy_words (gdbarch)
 
 void
 set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_call_dummy_words)
-    struct gdbarch *gdbarch;
-    int sizeof_call_dummy_words;
+     struct gdbarch *gdbarch;
+     int sizeof_call_dummy_words;
 {
   gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
 }
 
 int
 gdbarch_call_dummy_stack_adjust_p (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_stack_adjust_p == -1)
     fatal ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
@@ -1658,15 +1660,15 @@ gdbarch_call_dummy_stack_adjust_p (gdbarch)
 
 void
 set_gdbarch_call_dummy_stack_adjust_p (gdbarch, call_dummy_stack_adjust_p)
-    struct gdbarch *gdbarch;
-    int call_dummy_stack_adjust_p;
+     struct gdbarch *gdbarch;
+     int call_dummy_stack_adjust_p;
 {
   gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p;
 }
 
 int
 gdbarch_call_dummy_stack_adjust (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
     fatal ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
@@ -1678,8 +1680,8 @@ gdbarch_call_dummy_stack_adjust (gdbarch)
 
 void
 set_gdbarch_call_dummy_stack_adjust (gdbarch, call_dummy_stack_adjust)
-    struct gdbarch *gdbarch;
-    int call_dummy_stack_adjust;
+     struct gdbarch *gdbarch;
+     int call_dummy_stack_adjust;
 {
   gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust;
 }
@@ -1697,15 +1699,15 @@ gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE
 
 void
 set_gdbarch_fix_call_dummy (gdbarch, fix_call_dummy)
-    struct gdbarch *gdbarch;
-    gdbarch_fix_call_dummy_ftype fix_call_dummy;
+     struct gdbarch *gdbarch;
+     gdbarch_fix_call_dummy_ftype fix_call_dummy;
 {
   gdbarch->fix_call_dummy = fix_call_dummy;
 }
 
 int
 gdbarch_believe_pcc_promotion (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -1715,15 +1717,15 @@ gdbarch_believe_pcc_promotion (gdbarch)
 
 void
 set_gdbarch_believe_pcc_promotion (gdbarch, believe_pcc_promotion)
-    struct gdbarch *gdbarch;
-    int believe_pcc_promotion;
+     struct gdbarch *gdbarch;
+     int believe_pcc_promotion;
 {
   gdbarch->believe_pcc_promotion = believe_pcc_promotion;
 }
 
 int
 gdbarch_believe_pcc_promotion_type (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch_debug >= 2)
     /* FIXME: gdb_std??? */
@@ -1733,14 +1735,14 @@ gdbarch_believe_pcc_promotion_type (gdbarch)
 
 void
 set_gdbarch_believe_pcc_promotion_type (gdbarch, believe_pcc_promotion_type)
-    struct gdbarch *gdbarch;
-    int believe_pcc_promotion_type;
+     struct gdbarch *gdbarch;
+     int believe_pcc_promotion_type;
 {
   gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
 }
 
 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)
+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)
 {
   if (gdbarch->get_saved_register == 0)
     fatal ("gdbarch: gdbarch_get_saved_register invalid");
@@ -1752,8 +1754,8 @@ gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *opti
 
 void
 set_gdbarch_get_saved_register (gdbarch, get_saved_register)
-    struct gdbarch *gdbarch;
-    gdbarch_get_saved_register_ftype get_saved_register;
+     struct gdbarch *gdbarch;
+     gdbarch_get_saved_register_ftype get_saved_register;
 {
   gdbarch->get_saved_register = get_saved_register;
 }
@@ -1771,8 +1773,8 @@ gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
 
 void
 set_gdbarch_register_convertible (gdbarch, register_convertible)
-    struct gdbarch *gdbarch;
-    gdbarch_register_convertible_ftype register_convertible;
+     struct gdbarch *gdbarch;
+     gdbarch_register_convertible_ftype register_convertible;
 {
   gdbarch->register_convertible = register_convertible;
 }
@@ -1790,8 +1792,8 @@ gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct
 
 void
 set_gdbarch_register_convert_to_virtual (gdbarch, register_convert_to_virtual)
-    struct gdbarch *gdbarch;
-    gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual;
+     struct gdbarch *gdbarch;
+     gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual;
 {
   gdbarch->register_convert_to_virtual = register_convert_to_virtual;
 }
@@ -1809,8 +1811,8 @@ gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int
 
 void
 set_gdbarch_register_convert_to_raw (gdbarch, register_convert_to_raw)
-    struct gdbarch *gdbarch;
-    gdbarch_register_convert_to_raw_ftype register_convert_to_raw;
+     struct gdbarch *gdbarch;
+     gdbarch_register_convert_to_raw_ftype register_convert_to_raw;
 {
   gdbarch->register_convert_to_raw = register_convert_to_raw;
 }
@@ -1828,8 +1830,8 @@ gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *
 
 void
 set_gdbarch_extract_return_value (gdbarch, extract_return_value)
-    struct gdbarch *gdbarch;
-    gdbarch_extract_return_value_ftype extract_return_value;
+     struct gdbarch *gdbarch;
+     gdbarch_extract_return_value_ftype extract_return_value;
 {
   gdbarch->extract_return_value = extract_return_value;
 }
@@ -1847,8 +1849,8 @@ gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args,
 
 void
 set_gdbarch_push_arguments (gdbarch, push_arguments)
-    struct gdbarch *gdbarch;
-    gdbarch_push_arguments_ftype push_arguments;
+     struct gdbarch *gdbarch;
+     gdbarch_push_arguments_ftype push_arguments;
 {
   gdbarch->push_arguments = push_arguments;
 }
@@ -1866,8 +1868,8 @@ gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_push_dummy_frame (gdbarch, push_dummy_frame)
-    struct gdbarch *gdbarch;
-    gdbarch_push_dummy_frame_ftype push_dummy_frame;
+     struct gdbarch *gdbarch;
+     gdbarch_push_dummy_frame_ftype push_dummy_frame;
 {
   gdbarch->push_dummy_frame = push_dummy_frame;
 }
@@ -1885,8 +1887,8 @@ gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp
 
 void
 set_gdbarch_push_return_address (gdbarch, push_return_address)
-    struct gdbarch *gdbarch;
-    gdbarch_push_return_address_ftype push_return_address;
+     struct gdbarch *gdbarch;
+     gdbarch_push_return_address_ftype push_return_address;
 {
   gdbarch->push_return_address = push_return_address;
 }
@@ -1904,8 +1906,8 @@ gdbarch_pop_frame (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_pop_frame (gdbarch, pop_frame)
-    struct gdbarch *gdbarch;
-    gdbarch_pop_frame_ftype pop_frame;
+     struct gdbarch *gdbarch;
+     gdbarch_pop_frame_ftype pop_frame;
 {
   gdbarch->pop_frame = pop_frame;
 }
@@ -1923,8 +1925,8 @@ gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_make_daddr (gdbarch, d10v_make_daddr)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_make_daddr_ftype d10v_make_daddr;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_make_daddr_ftype d10v_make_daddr;
 {
   gdbarch->d10v_make_daddr = d10v_make_daddr;
 }
@@ -1942,8 +1944,8 @@ gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_make_iaddr (gdbarch, d10v_make_iaddr)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr;
 {
   gdbarch->d10v_make_iaddr = d10v_make_iaddr;
 }
@@ -1961,8 +1963,8 @@ gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_daddr_p (gdbarch, d10v_daddr_p)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_daddr_p_ftype d10v_daddr_p;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_daddr_p_ftype d10v_daddr_p;
 {
   gdbarch->d10v_daddr_p = d10v_daddr_p;
 }
@@ -1980,8 +1982,8 @@ gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_iaddr_p (gdbarch, d10v_iaddr_p)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p;
 {
   gdbarch->d10v_iaddr_p = d10v_iaddr_p;
 }
@@ -1999,8 +2001,8 @@ gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_convert_daddr_to_raw (gdbarch, d10v_convert_daddr_to_raw)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw;
 {
   gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw;
 }
@@ -2018,8 +2020,8 @@ gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
 
 void
 set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch, d10v_convert_iaddr_to_raw)
-    struct gdbarch *gdbarch;
-    gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw;
+     struct gdbarch *gdbarch;
+     gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw;
 {
   gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw;
 }
@@ -2037,8 +2039,8 @@ gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR
 
 void
 set_gdbarch_store_struct_return (gdbarch, store_struct_return)
-    struct gdbarch *gdbarch;
-    gdbarch_store_struct_return_ftype store_struct_return;
+     struct gdbarch *gdbarch;
+     gdbarch_store_struct_return_ftype store_struct_return;
 {
   gdbarch->store_struct_return = store_struct_return;
 }
@@ -2056,8 +2058,8 @@ gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *va
 
 void
 set_gdbarch_store_return_value (gdbarch, store_return_value)
-    struct gdbarch *gdbarch;
-    gdbarch_store_return_value_ftype store_return_value;
+     struct gdbarch *gdbarch;
+     gdbarch_store_return_value_ftype store_return_value;
 {
   gdbarch->store_return_value = store_return_value;
 }
@@ -2075,8 +2077,8 @@ gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
 
 void
 set_gdbarch_extract_struct_value_address (gdbarch, extract_struct_value_address)
-    struct gdbarch *gdbarch;
-    gdbarch_extract_struct_value_address_ftype extract_struct_value_address;
+     struct gdbarch *gdbarch;
+     gdbarch_extract_struct_value_address_ftype extract_struct_value_address;
 {
   gdbarch->extract_struct_value_address = extract_struct_value_address;
 }
@@ -2094,8 +2096,8 @@ gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *
 
 void
 set_gdbarch_use_struct_convention (gdbarch, use_struct_convention)
-    struct gdbarch *gdbarch;
-    gdbarch_use_struct_convention_ftype use_struct_convention;
+     struct gdbarch *gdbarch;
+     gdbarch_use_struct_convention_ftype use_struct_convention;
 {
   gdbarch->use_struct_convention = use_struct_convention;
 }
@@ -2113,8 +2115,8 @@ gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame
 
 void
 set_gdbarch_frame_init_saved_regs (gdbarch, frame_init_saved_regs)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs;
 {
   gdbarch->frame_init_saved_regs = frame_init_saved_regs;
 }
@@ -2132,8 +2134,8 @@ gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct fra
 
 void
 set_gdbarch_init_extra_frame_info (gdbarch, init_extra_frame_info)
-    struct gdbarch *gdbarch;
-    gdbarch_init_extra_frame_info_ftype init_extra_frame_info;
+     struct gdbarch *gdbarch;
+     gdbarch_init_extra_frame_info_ftype init_extra_frame_info;
 {
   gdbarch->init_extra_frame_info = init_extra_frame_info;
 }
@@ -2151,8 +2153,8 @@ gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
 
 void
 set_gdbarch_skip_prologue (gdbarch, skip_prologue)
-    struct gdbarch *gdbarch;
-    gdbarch_skip_prologue_ftype skip_prologue;
+     struct gdbarch *gdbarch;
+     gdbarch_skip_prologue_ftype skip_prologue;
 {
   gdbarch->skip_prologue = skip_prologue;
 }
@@ -2170,14 +2172,14 @@ gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
 
 void
 set_gdbarch_inner_than (gdbarch, inner_than)
-    struct gdbarch *gdbarch;
-    gdbarch_inner_than_ftype inner_than;
+     struct gdbarch *gdbarch;
+     gdbarch_inner_than_ftype inner_than;
 {
   gdbarch->inner_than = inner_than;
 }
 
 unsigned char *
-gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
 {
   if (gdbarch->breakpoint_from_pc == 0)
     fatal ("gdbarch: gdbarch_breakpoint_from_pc invalid");
@@ -2189,15 +2191,15 @@ gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenp
 
 void
 set_gdbarch_breakpoint_from_pc (gdbarch, breakpoint_from_pc)
-    struct gdbarch *gdbarch;
-    gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc;
+     struct gdbarch *gdbarch;
+     gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc;
 {
   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
 }
 
 CORE_ADDR
 gdbarch_decr_pc_after_break (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->decr_pc_after_break == -1)
     fatal ("gdbarch: gdbarch_decr_pc_after_break invalid");
@@ -2209,15 +2211,15 @@ gdbarch_decr_pc_after_break (gdbarch)
 
 void
 set_gdbarch_decr_pc_after_break (gdbarch, decr_pc_after_break)
-    struct gdbarch *gdbarch;
-    CORE_ADDR decr_pc_after_break;
+     struct gdbarch *gdbarch;
+     CORE_ADDR decr_pc_after_break;
 {
   gdbarch->decr_pc_after_break = decr_pc_after_break;
 }
 
 CORE_ADDR
 gdbarch_function_start_offset (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->function_start_offset == -1)
     fatal ("gdbarch: gdbarch_function_start_offset invalid");
@@ -2229,14 +2231,14 @@ gdbarch_function_start_offset (gdbarch)
 
 void
 set_gdbarch_function_start_offset (gdbarch, function_start_offset)
-    struct gdbarch *gdbarch;
-    CORE_ADDR function_start_offset;
+     struct gdbarch *gdbarch;
+     CORE_ADDR function_start_offset;
 {
   gdbarch->function_start_offset = function_start_offset;
 }
 
 void
-gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
+gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len)
 {
   if (gdbarch->remote_translate_xfer_address == 0)
     fatal ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
@@ -2248,15 +2250,15 @@ gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_ad
 
 void
 set_gdbarch_remote_translate_xfer_address (gdbarch, remote_translate_xfer_address)
-    struct gdbarch *gdbarch;
-    gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address;
+     struct gdbarch *gdbarch;
+     gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address;
 {
   gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
 }
 
 CORE_ADDR
 gdbarch_frame_args_skip (gdbarch)
-    struct gdbarch *gdbarch;
+     struct gdbarch *gdbarch;
 {
   if (gdbarch->frame_args_skip == -1)
     fatal ("gdbarch: gdbarch_frame_args_skip invalid");
@@ -2268,8 +2270,8 @@ gdbarch_frame_args_skip (gdbarch)
 
 void
 set_gdbarch_frame_args_skip (gdbarch, frame_args_skip)
-    struct gdbarch *gdbarch;
-    CORE_ADDR frame_args_skip;
+     struct gdbarch *gdbarch;
+     CORE_ADDR frame_args_skip;
 {
   gdbarch->frame_args_skip = frame_args_skip;
 }
@@ -2287,8 +2289,8 @@ gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_inf
 
 void
 set_gdbarch_frameless_function_invocation (gdbarch, frameless_function_invocation)
-    struct gdbarch *gdbarch;
-    gdbarch_frameless_function_invocation_ftype frameless_function_invocation;
+     struct gdbarch *gdbarch;
+     gdbarch_frameless_function_invocation_ftype frameless_function_invocation;
 {
   gdbarch->frameless_function_invocation = frameless_function_invocation;
 }
@@ -2306,8 +2308,8 @@ gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
 
 void
 set_gdbarch_frame_chain (gdbarch, frame_chain)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_chain_ftype frame_chain;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_chain_ftype frame_chain;
 {
   gdbarch->frame_chain = frame_chain;
 }
@@ -2325,8 +2327,8 @@ gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct fram
 
 void
 set_gdbarch_frame_chain_valid (gdbarch, frame_chain_valid)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_chain_valid_ftype frame_chain_valid;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_chain_valid_ftype frame_chain_valid;
 {
   gdbarch->frame_chain_valid = frame_chain_valid;
 }
@@ -2344,8 +2346,8 @@ gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
 
 void
 set_gdbarch_frame_saved_pc (gdbarch, frame_saved_pc)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_saved_pc_ftype frame_saved_pc;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_saved_pc_ftype frame_saved_pc;
 {
   gdbarch->frame_saved_pc = frame_saved_pc;
 }
@@ -2363,8 +2365,8 @@ gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
 
 void
 set_gdbarch_frame_args_address (gdbarch, frame_args_address)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_args_address_ftype frame_args_address;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_args_address_ftype frame_args_address;
 {
   gdbarch->frame_args_address = frame_args_address;
 }
@@ -2382,8 +2384,8 @@ gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
 
 void
 set_gdbarch_frame_locals_address (gdbarch, frame_locals_address)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_locals_address_ftype frame_locals_address;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_locals_address_ftype frame_locals_address;
 {
   gdbarch->frame_locals_address = frame_locals_address;
 }
@@ -2401,8 +2403,8 @@ gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
 
 void
 set_gdbarch_saved_pc_after_call (gdbarch, saved_pc_after_call)
-    struct gdbarch *gdbarch;
-    gdbarch_saved_pc_after_call_ftype saved_pc_after_call;
+     struct gdbarch *gdbarch;
+     gdbarch_saved_pc_after_call_ftype saved_pc_after_call;
 {
   gdbarch->saved_pc_after_call = saved_pc_after_call;
 }
@@ -2420,8 +2422,8 @@ gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
 
 void
 set_gdbarch_frame_num_args (gdbarch, frame_num_args)
-    struct gdbarch *gdbarch;
-    gdbarch_frame_num_args_ftype frame_num_args;
+     struct gdbarch *gdbarch;
+     gdbarch_frame_num_args_ftype frame_num_args;
 {
   gdbarch->frame_num_args = frame_num_args;
 }
@@ -2436,17 +2438,17 @@ struct gdbarch_data
 };
 
 struct gdbarch_data_registration
-{
-  gdbarch_data_ftype *init;
-  struct gdbarch_data *data;
-  struct gdbarch_data_registration *next;
-};
+  {
+    gdbarch_data_ftype *init;
+    struct gdbarch_data *data;
+    struct gdbarch_data_registration *next;
+  };
 
 struct gdbarch_data_registrary
-{
-  int nr;
-  struct gdbarch_data_registration *registrations;
-};
+  {
+    int nr;
+    struct gdbarch_data_registration *registrations;
+  };
 
 struct gdbarch_data_registrary gdbarch_data_registrary =
 {
@@ -2479,7 +2481,7 @@ init_gdbarch_data (gdbarch)
 {
   struct gdbarch_data_registration *rego;
   gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
-  gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
+  gdbarch->data = xmalloc (sizeof (void *) * gdbarch->nr_data);
   for (rego = gdbarch_data_registrary.registrations;
        rego != NULL;
        rego = rego->next)
@@ -2514,20 +2516,20 @@ struct gdbarch_swap
 };
 
 struct gdbarch_swap_registration
-{
-  void *data;
-  unsigned long sizeof_data;
-  gdbarch_swap_ftype *init;
-  struct gdbarch_swap_registration *next;
-};
+  {
+    void *data;
+    unsigned long sizeof_data;
+    gdbarch_swap_ftype *init;
+    struct gdbarch_swap_registration *next;
+  };
 
 struct gdbarch_swap_registrary
-{
-  int nr;
-  struct gdbarch_swap_registration *registrations;
-};
+  {
+    int nr;
+    struct gdbarch_swap_registration *registrations;
+  };
 
-struct gdbarch_swap_registrary gdbarch_swap_registrary = 
+struct gdbarch_swap_registrary gdbarch_swap_registrary =
 {
   0, NULL,
 };
@@ -2646,7 +2648,7 @@ register_gdbarch_init (bfd_architecture, init)
   (*curr)->arches = NULL;
   (*curr)->next = NULL;
 }
-  
+
 
 
 /* Look for an architecture using gdbarch_info.  Base search on only
@@ -2727,7 +2729,7 @@ gdbarch_update (info)
       fprintf_unfiltered (gdb_stdlog,
                          "gdbarch_update: info.bfd_architecture %d (%s)\n",
                          info.bfd_architecture,
-                         bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
+               bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
       fprintf_unfiltered (gdb_stdlog,
                          "gdbarch_update: info.bfd_arch_info %s\n",
                          (info.bfd_arch_info != NULL
@@ -2787,7 +2789,7 @@ gdbarch_update (info)
          return 1;
        }
     }
-    
+
   /* Append this new architecture to this targets list. */
   (*list) = XMALLOC (struct gdbarch_list);
   (*list)->next = NULL;
@@ -2798,12 +2800,12 @@ gdbarch_update (info)
   if (gdbarch_debug)
     {
       fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
+                "gdbarch_update: New architecture 0x%08lx (%s) selected\n",
                          (long) new_gdbarch,
                          new_gdbarch->bfd_arch_info->printable_name);
       gdbarch_dump ();
     }
-  
+
   /* Check that the newly installed architecture is valid.  */
   verify_gdbarch (new_gdbarch);
 
@@ -2811,12 +2813,12 @@ gdbarch_update (info)
      CURRENT_GDBARCH must be update before these modules are
      called. */
   init_gdbarch_swap (new_gdbarch);
-  
+
   /* Initialize the per-architecture data-pointer of all parties that
      registered an interest in this architecture.  CURRENT_GDBARCH
      must be updated before these modules are called. */
   init_gdbarch_data (new_gdbarch);
-  
+
   return 1;
 }
 
@@ -2842,7 +2844,7 @@ gdbarch_update (info)
 #endif
 #endif
 #ifndef TARGET_BYTE_ORDER_DEFAULT
-#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
+#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN   /* arbitrary */
 #endif
 int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
 int target_byte_order_auto = 1;
@@ -2858,9 +2860,9 @@ show_endian (args, from_tty)
      int from_tty;
 {
   char *msg =
-    (TARGET_BYTE_ORDER_AUTO
-     ? "The target endianness is set automatically (currently %s endian)\n"
-     : "The target is assumed to be %s endian\n");
+  (TARGET_BYTE_ORDER_AUTO
+   ? "The target endianness is set automatically (currently %s endian)\n"
+   : "The target is assumed to be %s endian\n");
   printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
 }
 
@@ -2954,7 +2956,7 @@ set_endian_from_file (abfd)
   if (TARGET_BYTE_ORDER_SELECTABLE_P)
     {
       int want;
-      
+
       if (bfd_big_endian (abfd))
        want = BIG_ENDIAN;
       else
@@ -2984,11 +2986,11 @@ set_endian_from_file (abfd)
 int target_architecture_auto = 1;
 extern const struct bfd_arch_info bfd_default_arch_struct;
 const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
-int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap));
+int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info * ap));
 
 /* Do the real work of changing the current architecture */
 
-static int arch_ok PARAMS ((const struct bfd_arch_info *arch));
+static int arch_ok PARAMS ((const struct bfd_arch_info * arch));
 static int
 arch_ok (arch)
      const struct bfd_arch_info *arch;
@@ -3000,9 +3002,12 @@ arch_ok (arch)
          || target_architecture_hook (arch));
 }
 
-enum set_arch { set_arch_auto, set_arch_manual };
+enum set_arch
+{
+  set_arch_auto, set_arch_manual
+};
 
-static void set_arch PARAMS ((const struct bfd_arch_info *arch, enum set_arch type));
+static void set_arch PARAMS ((const struct bfd_arch_info * arch, enum set_arch type));
 static void
 set_arch (arch, type)
      const struct bfd_arch_info *arch;
@@ -3194,7 +3199,7 @@ generic_register_convertible_not (num)
 {
   return 0;
 }
-  
+
 /* Disassembler */
 
 /* Pointer to the target-dependent disassembly function.  */
@@ -3254,7 +3259,7 @@ _initialize_gdbarch ()
   add_cmd ("architecture", class_support, info_architecture,
           "List supported target architectures", &infolist);
 
-  INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
+  INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype) fprintf_filtered);
   tm_print_insn_info.flavour = bfd_target_unknown_flavour;
   tm_print_insn_info.read_memory_func = dis_asm_read_memory;
   tm_print_insn_info.memory_error_func = dis_asm_memory_error;
@@ -3263,7 +3268,7 @@ _initialize_gdbarch ()
   add_show_from_set (add_set_cmd ("archdebug",
                                  class_maintenance,
                                  var_zinteger,
-                                 (char *)&gdbarch_debug,
+                                 (char *) &gdbarch_debug,
                                  "Set architecture debugging.\n\
 When non-zero, architecture debugging is enabled.", &setlist),
                     &showlist);
index 15be3ae9acd2c2c4255c1cf0abbafcfbf42b9d75..65ff69de3b84f889a8b7b8e5dcd16dfcc6e8e387 100644 (file)
@@ -1,21 +1,22 @@
 /* Architecture commands for GDB, the GNU debugger.
    Copyright 1998-1999, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef GDBARCH_H
 #define GDBARCH_H
@@ -68,7 +69,7 @@ extern struct gdbarch *current_gdbarch;
 
 /* The following are pre-initialized by GDBARCH. */
 
-extern const struct bfd_arch_info * gdbarch_bfd_arch_info PARAMS ((struct gdbarch *gdbarch));
+extern const struct bfd_arch_info *gdbarch_bfd_arch_info PARAMS ((struct gdbarch * gdbarch));
 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_ARCHITECTURE)
@@ -76,7 +77,7 @@ extern const struct bfd_arch_info * gdbarch_bfd_arch_info PARAMS ((struct gdbarc
 #endif
 #endif
 
-extern int gdbarch_byte_order PARAMS ((struct gdbarch *gdbarch));
+extern int gdbarch_byte_order PARAMS ((struct gdbarch * gdbarch));
 /* set_gdbarch_byte_order() - not applicable - pre-initialized. */
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_BYTE_ORDER)
@@ -87,686 +88,687 @@ extern int gdbarch_byte_order PARAMS ((struct gdbarch *gdbarch));
 
 /* The following are initialized by the target dependant code. */
 
-extern int gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch, int ptr_bit));
+extern int gdbarch_ptr_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_ptr_bit PARAMS ((struct gdbarch * gdbarch, int ptr_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_PTR_BIT)
 #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch, int short_bit));
+extern int gdbarch_short_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_short_bit PARAMS ((struct gdbarch * gdbarch, int short_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_SHORT_BIT)
 #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch, int int_bit));
+extern int gdbarch_int_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_int_bit PARAMS ((struct gdbarch * gdbarch, int int_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_INT_BIT)
 #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch, int long_bit));
+extern int gdbarch_long_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_long_bit PARAMS ((struct gdbarch * gdbarch, int long_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_BIT)
 #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch, int long_long_bit));
+extern int gdbarch_long_long_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_long_long_bit PARAMS ((struct gdbarch * gdbarch, int long_long_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_LONG_BIT)
 #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch, int float_bit));
+extern int gdbarch_float_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_float_bit PARAMS ((struct gdbarch * gdbarch, int float_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_FLOAT_BIT)
 #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch, int double_bit));
+extern int gdbarch_double_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_double_bit PARAMS ((struct gdbarch * gdbarch, int double_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_DOUBLE_BIT)
 #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch, int long_double_bit));
+extern int gdbarch_long_double_bit PARAMS ((struct gdbarch * gdbarch));
+extern void set_gdbarch_long_double_bit PARAMS ((struct gdbarch * gdbarch, int long_double_bit));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_DOUBLE_BIT)
 #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_read_pc_ftype) PARAMS ((int pid));
-extern CORE_ADDR gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, int pid));
-extern void set_gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc));
+typedef
+CORE_ADDR (gdbarch_read_pc_ftype) PARAMS ((int pid));
+     extern CORE_ADDR gdbarch_read_pc PARAMS ((struct gdbarch * gdbarch, int pid));
+     extern void set_gdbarch_read_pc PARAMS ((struct gdbarch * gdbarch, gdbarch_read_pc_ftype * read_pc));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_PC)
 #define TARGET_READ_PC(pid) (gdbarch_read_pc (current_gdbarch, pid))
 #endif
 #endif
 
-typedef void (gdbarch_write_pc_ftype) PARAMS ((CORE_ADDR val, int pid));
-extern void gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val, int pid));
-extern void set_gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc));
+     typedef void (gdbarch_write_pc_ftype) PARAMS ((CORE_ADDR val, int pid));
+     extern void gdbarch_write_pc PARAMS ((struct gdbarch * gdbarch, CORE_ADDR val, int pid));
+     extern void set_gdbarch_write_pc PARAMS ((struct gdbarch * gdbarch, gdbarch_write_pc_ftype * write_pc));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_PC)
 #define TARGET_WRITE_PC(val, pid) (gdbarch_write_pc (current_gdbarch, val, pid))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_read_fp_ftype) PARAMS ((void));
-extern CORE_ADDR gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp));
+     typedef CORE_ADDR (gdbarch_read_fp_ftype) PARAMS ((void));
+     extern CORE_ADDR gdbarch_read_fp PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_read_fp PARAMS ((struct gdbarch * gdbarch, gdbarch_read_fp_ftype * read_fp));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_FP)
 #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
 #endif
 #endif
 
-typedef void (gdbarch_write_fp_ftype) PARAMS ((CORE_ADDR val));
-extern void gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val));
-extern void set_gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp));
+     typedef void (gdbarch_write_fp_ftype) PARAMS ((CORE_ADDR val));
+     extern void gdbarch_write_fp PARAMS ((struct gdbarch * gdbarch, CORE_ADDR val));
+     extern void set_gdbarch_write_fp PARAMS ((struct gdbarch * gdbarch, gdbarch_write_fp_ftype * write_fp));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_FP)
 #define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_read_sp_ftype) PARAMS ((void));
-extern CORE_ADDR gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp));
+     typedef CORE_ADDR (gdbarch_read_sp_ftype) PARAMS ((void));
+     extern CORE_ADDR gdbarch_read_sp PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_read_sp PARAMS ((struct gdbarch * gdbarch, gdbarch_read_sp_ftype * read_sp));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_SP)
 #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
 #endif
 #endif
 
-typedef void (gdbarch_write_sp_ftype) PARAMS ((CORE_ADDR val));
-extern void gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val));
-extern void set_gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp));
+     typedef void (gdbarch_write_sp_ftype) PARAMS ((CORE_ADDR val));
+     extern void gdbarch_write_sp PARAMS ((struct gdbarch * gdbarch, CORE_ADDR val));
+     extern void set_gdbarch_write_sp PARAMS ((struct gdbarch * gdbarch, gdbarch_write_sp_ftype * write_sp));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_SP)
 #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
 #endif
 #endif
 
-extern int gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch, int num_regs));
+     extern int gdbarch_num_regs PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_num_regs PARAMS ((struct gdbarch * gdbarch, int num_regs));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (NUM_REGS)
 #define NUM_REGS (gdbarch_num_regs (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch, int sp_regnum));
+     extern int gdbarch_sp_regnum PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_sp_regnum PARAMS ((struct gdbarch * gdbarch, int sp_regnum));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (SP_REGNUM)
 #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch, int fp_regnum));
+     extern int gdbarch_fp_regnum PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_fp_regnum PARAMS ((struct gdbarch * gdbarch, int fp_regnum));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FP_REGNUM)
 #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch, int pc_regnum));
+     extern int gdbarch_pc_regnum PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_pc_regnum PARAMS ((struct gdbarch * gdbarch, int pc_regnum));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (PC_REGNUM)
 #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
 #endif
 #endif
 
-typedef char * (gdbarch_register_name_ftype) PARAMS ((int regnr));
-extern char * gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, int regnr));
-extern void set_gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name));
+     typedef char *(gdbarch_register_name_ftype) PARAMS ((int regnr));
+     extern char *gdbarch_register_name PARAMS ((struct gdbarch * gdbarch, int regnr));
+     extern void set_gdbarch_register_name PARAMS ((struct gdbarch * gdbarch, gdbarch_register_name_ftype * register_name));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_NAME)
 #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
 #endif
 #endif
 
-extern int gdbarch_register_size PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_register_size PARAMS ((struct gdbarch *gdbarch, int register_size));
+     extern int gdbarch_register_size PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_register_size PARAMS ((struct gdbarch * gdbarch, int register_size));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_SIZE)
 #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch, int register_bytes));
+     extern int gdbarch_register_bytes PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_register_bytes PARAMS ((struct gdbarch * gdbarch, int register_bytes));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTES)
 #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
 #endif
 #endif
 
-typedef int (gdbarch_register_byte_ftype) PARAMS ((int reg_nr));
-extern int gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, int reg_nr));
-extern void set_gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte));
+     typedef int (gdbarch_register_byte_ftype) PARAMS ((int reg_nr));
+     extern int gdbarch_register_byte PARAMS ((struct gdbarch * gdbarch, int reg_nr));
+     extern void set_gdbarch_register_byte PARAMS ((struct gdbarch * gdbarch, gdbarch_register_byte_ftype * register_byte));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTE)
 #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
 #endif
 #endif
 
-typedef int (gdbarch_register_raw_size_ftype) PARAMS ((int reg_nr));
-extern int gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, int reg_nr));
-extern void set_gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size));
+     typedef int (gdbarch_register_raw_size_ftype) PARAMS ((int reg_nr));
+     extern int gdbarch_register_raw_size PARAMS ((struct gdbarch * gdbarch, int reg_nr));
+     extern void set_gdbarch_register_raw_size PARAMS ((struct gdbarch * gdbarch, gdbarch_register_raw_size_ftype * register_raw_size));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_RAW_SIZE)
 #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
 #endif
 #endif
 
-extern int gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch, int max_register_raw_size));
+     extern int gdbarch_max_register_raw_size PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_max_register_raw_size PARAMS ((struct gdbarch * gdbarch, int max_register_raw_size));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_RAW_SIZE)
 #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
 #endif
 #endif
 
-typedef int (gdbarch_register_virtual_size_ftype) PARAMS ((int reg_nr));
-extern int gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int reg_nr));
-extern void set_gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size));
+     typedef int (gdbarch_register_virtual_size_ftype) PARAMS ((int reg_nr));
+     extern int gdbarch_register_virtual_size PARAMS ((struct gdbarch * gdbarch, int reg_nr));
+     extern void set_gdbarch_register_virtual_size PARAMS ((struct gdbarch * gdbarch, gdbarch_register_virtual_size_ftype * register_virtual_size));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_SIZE)
 #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
 #endif
 #endif
 
-extern int gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int max_register_virtual_size));
+     extern int gdbarch_max_register_virtual_size PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_max_register_virtual_size PARAMS ((struct gdbarch * gdbarch, int max_register_virtual_size));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
 #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
 #endif
 #endif
 
-typedef struct type * (gdbarch_register_virtual_type_ftype) PARAMS ((int reg_nr));
-extern struct type * gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, int reg_nr));
-extern void set_gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type));
+     typedef struct type *(gdbarch_register_virtual_type_ftype) PARAMS ((int reg_nr));
+     extern struct type *gdbarch_register_virtual_type PARAMS ((struct gdbarch * gdbarch, int reg_nr));
+     extern void set_gdbarch_register_virtual_type PARAMS ((struct gdbarch * gdbarch, gdbarch_register_virtual_type_ftype * register_virtual_type));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_TYPE)
 #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
 #endif
 #endif
 
-extern int gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch, int use_generic_dummy_frames));
+     extern int gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch * gdbarch, int use_generic_dummy_frames));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (USE_GENERIC_DUMMY_FRAMES)
 #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch, int call_dummy_location));
+     extern int gdbarch_call_dummy_location PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_location PARAMS ((struct gdbarch * gdbarch, int call_dummy_location));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LOCATION)
 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) PARAMS ((void));
-extern CORE_ADDR gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address));
+     typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) PARAMS ((void));
+     extern CORE_ADDR gdbarch_call_dummy_address PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_address PARAMS ((struct gdbarch * gdbarch, gdbarch_call_dummy_address_ftype * call_dummy_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_ADDRESS)
 #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
 #endif
 #endif
 
-extern CORE_ADDR gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset));
+     extern CORE_ADDR gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch * gdbarch, CORE_ADDR call_dummy_start_offset));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_START_OFFSET)
 #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
 #endif
 #endif
 
-extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset));
+     extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch * gdbarch, CORE_ADDR call_dummy_breakpoint_offset));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
 #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p));
+     extern int gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch * gdbarch, int call_dummy_breakpoint_offset_p));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
 #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch, int call_dummy_length));
+     extern int gdbarch_call_dummy_length PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_length PARAMS ((struct gdbarch * gdbarch, int call_dummy_length));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LENGTH)
 #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
 #endif
 #endif
 
-typedef int (gdbarch_pc_in_call_dummy_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
-extern int gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
-extern void set_gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy));
+     typedef int (gdbarch_pc_in_call_dummy_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
+     extern int gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch * gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
+     extern void set_gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch * gdbarch, gdbarch_pc_in_call_dummy_ftype * pc_in_call_dummy));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (PC_IN_CALL_DUMMY)
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_p));
+     extern int gdbarch_call_dummy_p PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_p PARAMS ((struct gdbarch * gdbarch, int call_dummy_p));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_P)
 #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
 #endif
 #endif
 
-extern LONGEST * gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch, LONGEST * call_dummy_words));
+     extern LONGEST *gdbarch_call_dummy_words PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_words PARAMS ((struct gdbarch * gdbarch, LONGEST * call_dummy_words));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_WORDS)
 #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch, int sizeof_call_dummy_words));
+     extern int gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch * gdbarch, int sizeof_call_dummy_words));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (SIZEOF_CALL_DUMMY_WORDS)
 #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust_p));
+     extern int gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch * gdbarch, int call_dummy_stack_adjust_p));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST_P)
 #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust));
+     extern int gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch * gdbarch, int call_dummy_stack_adjust));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST)
 #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch))
 #endif
 #endif
 
-typedef void (gdbarch_fix_call_dummy_ftype) PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p));
-extern void gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p));
-extern void set_gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy));
+     typedef void (gdbarch_fix_call_dummy_ftype) PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value ** args, struct type * type, int gcc_p));
+     extern void gdbarch_fix_call_dummy PARAMS ((struct gdbarch * gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value ** args, struct type * type, int gcc_p));
+     extern void set_gdbarch_fix_call_dummy PARAMS ((struct gdbarch * gdbarch, gdbarch_fix_call_dummy_ftype * fix_call_dummy));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FIX_CALL_DUMMY)
 #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
 #endif
 #endif
 
-extern int gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion));
+     extern int gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch * gdbarch, int believe_pcc_promotion));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION)
 #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
 #endif
 #endif
 
-extern int gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion_type));
+     extern int gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch * gdbarch, int believe_pcc_promotion_type));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
 #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
 #endif
 #endif
 
-typedef void (gdbarch_get_saved_register_ftype) PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval));
-extern void gdbarch_get_saved_register PARAMS ((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 PARAMS ((struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register));
+     typedef void (gdbarch_get_saved_register_ftype) PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lval));
+     extern void gdbarch_get_saved_register PARAMS ((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 PARAMS ((struct gdbarch * gdbarch, gdbarch_get_saved_register_ftype * get_saved_register));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !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
 
-typedef int (gdbarch_register_convertible_ftype) PARAMS ((int nr));
-extern int gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, int nr));
-extern void set_gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible));
+     typedef int (gdbarch_register_convertible_ftype) PARAMS ((int nr));
+     extern int gdbarch_register_convertible PARAMS ((struct gdbarch * gdbarch, int nr));
+     extern void set_gdbarch_register_convertible PARAMS ((struct gdbarch * gdbarch, gdbarch_register_convertible_ftype * register_convertible));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERTIBLE)
 #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
 #endif
 #endif
 
-typedef void (gdbarch_register_convert_to_virtual_ftype) PARAMS ((int regnum, struct type *type, char *from, char *to));
-extern void gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to));
-extern void set_gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual));
+     typedef void (gdbarch_register_convert_to_virtual_ftype) PARAMS ((int regnum, struct type * type, char *from, char *to));
+     extern void gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch * gdbarch, int regnum, struct type * type, char *from, char *to));
+     extern void set_gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch * gdbarch, gdbarch_register_convert_to_virtual_ftype * register_convert_to_virtual));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
 #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
 #endif
 #endif
 
-typedef void (gdbarch_register_convert_to_raw_ftype) PARAMS ((struct type *type, int regnum, char *from, char *to));
-extern void gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to));
-extern void set_gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw));
+     typedef void (gdbarch_register_convert_to_raw_ftype) PARAMS ((struct type * type, int regnum, char *from, char *to));
+     extern void gdbarch_register_convert_to_raw PARAMS ((struct gdbarch * gdbarch, struct type * type, int regnum, char *from, char *to));
+     extern void set_gdbarch_register_convert_to_raw PARAMS ((struct gdbarch * gdbarch, gdbarch_register_convert_to_raw_ftype * register_convert_to_raw));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_RAW)
 #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
 #endif
 #endif
 
-typedef void (gdbarch_extract_return_value_ftype) PARAMS ((struct type *type, char *regbuf, char *valbuf));
-extern void gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf));
-extern void set_gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value));
+     typedef void (gdbarch_extract_return_value_ftype) PARAMS ((struct type * type, char *regbuf, char *valbuf));
+     extern void gdbarch_extract_return_value PARAMS ((struct gdbarch * gdbarch, struct type * type, char *regbuf, char *valbuf));
+     extern void set_gdbarch_extract_return_value PARAMS ((struct gdbarch * gdbarch, gdbarch_extract_return_value_ftype * extract_return_value));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_RETURN_VALUE)
 #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_push_arguments_ftype) PARAMS ((int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
-extern CORE_ADDR gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
-extern void set_gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments));
+     typedef CORE_ADDR (gdbarch_push_arguments_ftype) PARAMS ((int nargs, struct value ** args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
+     extern CORE_ADDR gdbarch_push_arguments PARAMS ((struct gdbarch * gdbarch, int nargs, struct value ** args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
+     extern void set_gdbarch_push_arguments PARAMS ((struct gdbarch * gdbarch, gdbarch_push_arguments_ftype * push_arguments));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_ARGUMENTS)
 #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
 #endif
 #endif
 
-typedef void (gdbarch_push_dummy_frame_ftype) PARAMS ((void));
-extern void gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame));
+     typedef void (gdbarch_push_dummy_frame_ftype) PARAMS ((void));
+     extern void gdbarch_push_dummy_frame PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_push_dummy_frame PARAMS ((struct gdbarch * gdbarch, gdbarch_push_dummy_frame_ftype * push_dummy_frame));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_DUMMY_FRAME)
 #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_push_return_address_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
-extern CORE_ADDR gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp));
-extern void set_gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address));
+     typedef CORE_ADDR (gdbarch_push_return_address_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
+     extern CORE_ADDR gdbarch_push_return_address PARAMS ((struct gdbarch * gdbarch, CORE_ADDR pc, CORE_ADDR sp));
+     extern void set_gdbarch_push_return_address PARAMS ((struct gdbarch * gdbarch, gdbarch_push_return_address_ftype * push_return_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_RETURN_ADDRESS)
 #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp))
 #endif
 #endif
 
-typedef void (gdbarch_pop_frame_ftype) PARAMS ((void));
-extern void gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame));
+     typedef void (gdbarch_pop_frame_ftype) PARAMS ((void));
+     extern void gdbarch_pop_frame PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_pop_frame PARAMS ((struct gdbarch * gdbarch, gdbarch_pop_frame_ftype * pop_frame));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (POP_FRAME)
 #define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) PARAMS ((CORE_ADDR x));
-extern CORE_ADDR gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr));
+     typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) PARAMS ((CORE_ADDR x));
+     extern CORE_ADDR gdbarch_d10v_make_daddr PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_make_daddr PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_make_daddr_ftype * d10v_make_daddr));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_DADDR)
 #define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) PARAMS ((CORE_ADDR x));
-extern CORE_ADDR gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr));
+     typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) PARAMS ((CORE_ADDR x));
+     extern CORE_ADDR gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_make_iaddr_ftype * d10v_make_iaddr));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_IADDR)
 #define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x))
 #endif
 #endif
 
-typedef int (gdbarch_d10v_daddr_p_ftype) PARAMS ((CORE_ADDR x));
-extern int gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p));
+     typedef int (gdbarch_d10v_daddr_p_ftype) PARAMS ((CORE_ADDR x));
+     extern int gdbarch_d10v_daddr_p PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_daddr_p PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_daddr_p_ftype * d10v_daddr_p));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_DADDR_P)
 #define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x))
 #endif
 #endif
 
-typedef int (gdbarch_d10v_iaddr_p_ftype) PARAMS ((CORE_ADDR x));
-extern int gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p));
+     typedef int (gdbarch_d10v_iaddr_p_ftype) PARAMS ((CORE_ADDR x));
+     extern int gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_iaddr_p_ftype * d10v_iaddr_p));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_IADDR_P)
 #define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
-extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw));
+     typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
+     extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype * d10v_convert_daddr_to_raw));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_DADDR_TO_RAW)
 #define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
-extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
-extern void set_gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw));
+     typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
+     extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch * gdbarch, CORE_ADDR x));
+     extern void set_gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch * gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype * d10v_convert_iaddr_to_raw));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_IADDR_TO_RAW)
 #define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x))
 #endif
 #endif
 
-typedef void (gdbarch_store_struct_return_ftype) PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
-extern void gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp));
-extern void set_gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return));
+     typedef void (gdbarch_store_struct_return_ftype) PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
+     extern void gdbarch_store_struct_return PARAMS ((struct gdbarch * gdbarch, CORE_ADDR addr, CORE_ADDR sp));
+     extern void set_gdbarch_store_struct_return PARAMS ((struct gdbarch * gdbarch, gdbarch_store_struct_return_ftype * store_struct_return));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (STORE_STRUCT_RETURN)
 #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp))
 #endif
 #endif
 
-typedef void (gdbarch_store_return_value_ftype) PARAMS ((struct type *type, char *valbuf));
-extern void gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *valbuf));
-extern void set_gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value));
+     typedef void (gdbarch_store_return_value_ftype) PARAMS ((struct type * type, char *valbuf));
+     extern void gdbarch_store_return_value PARAMS ((struct gdbarch * gdbarch, struct type * type, char *valbuf));
+     extern void set_gdbarch_store_return_value PARAMS ((struct gdbarch * gdbarch, gdbarch_store_return_value_ftype * store_return_value));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (STORE_RETURN_VALUE)
 #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) PARAMS ((char *regbuf));
-extern CORE_ADDR gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, char *regbuf));
-extern void set_gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address));
+     typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) PARAMS ((char *regbuf));
+     extern CORE_ADDR gdbarch_extract_struct_value_address PARAMS ((struct gdbarch * gdbarch, char *regbuf));
+     extern void set_gdbarch_extract_struct_value_address PARAMS ((struct gdbarch * gdbarch, gdbarch_extract_struct_value_address_ftype * extract_struct_value_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
 #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
 #endif
 #endif
 
-typedef int (gdbarch_use_struct_convention_ftype) PARAMS ((int gcc_p, struct type *value_type));
-extern int gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, int gcc_p, struct type *value_type));
-extern void set_gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention));
+     typedef int (gdbarch_use_struct_convention_ftype) PARAMS ((int gcc_p, struct type * value_type));
+     extern int gdbarch_use_struct_convention PARAMS ((struct gdbarch * gdbarch, int gcc_p, struct type * value_type));
+     extern void set_gdbarch_use_struct_convention PARAMS ((struct gdbarch * gdbarch, gdbarch_use_struct_convention_ftype * use_struct_convention));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (USE_STRUCT_CONVENTION)
 #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
 #endif
 #endif
 
-typedef void (gdbarch_frame_init_saved_regs_ftype) PARAMS ((struct frame_info *frame));
-extern void gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
-extern void set_gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs));
+     typedef void (gdbarch_frame_init_saved_regs_ftype) PARAMS ((struct frame_info * frame));
+     extern void gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch * gdbarch, struct frame_info * frame));
+     extern void set_gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_init_saved_regs_ftype * frame_init_saved_regs));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_INIT_SAVED_REGS)
 #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
 #endif
 #endif
 
-typedef void (gdbarch_init_extra_frame_info_ftype) PARAMS ((int fromleaf, struct frame_info *frame));
-extern void gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame));
-extern void set_gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info));
+     typedef void (gdbarch_init_extra_frame_info_ftype) PARAMS ((int fromleaf, struct frame_info * frame));
+     extern void gdbarch_init_extra_frame_info PARAMS ((struct gdbarch * gdbarch, int fromleaf, struct frame_info * frame));
+     extern void set_gdbarch_init_extra_frame_info PARAMS ((struct gdbarch * gdbarch, gdbarch_init_extra_frame_info_ftype * init_extra_frame_info));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (INIT_EXTRA_FRAME_INFO)
 #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_skip_prologue_ftype) PARAMS ((CORE_ADDR ip));
-extern CORE_ADDR gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, CORE_ADDR ip));
-extern void set_gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue));
+     typedef CORE_ADDR (gdbarch_skip_prologue_ftype) PARAMS ((CORE_ADDR ip));
+     extern CORE_ADDR gdbarch_skip_prologue PARAMS ((struct gdbarch * gdbarch, CORE_ADDR ip));
+     extern void set_gdbarch_skip_prologue PARAMS ((struct gdbarch * gdbarch, gdbarch_skip_prologue_ftype * skip_prologue));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (SKIP_PROLOGUE)
 #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
 #endif
 #endif
 
-typedef int (gdbarch_inner_than_ftype) PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
-extern int gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs));
-extern void set_gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than));
+     typedef int (gdbarch_inner_than_ftype) PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
+     extern int gdbarch_inner_than PARAMS ((struct gdbarch * gdbarch, CORE_ADDR lhs, CORE_ADDR rhs));
+     extern void set_gdbarch_inner_than PARAMS ((struct gdbarch * gdbarch, gdbarch_inner_than_ftype * inner_than));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (INNER_THAN)
 #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
 #endif
 #endif
 
-typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) PARAMS ((CORE_ADDR *pcptr, int *lenptr));
-extern unsigned char * gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr));
-extern void set_gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc));
+     typedef unsigned char *(gdbarch_breakpoint_from_pc_ftype) PARAMS ((CORE_ADDR * pcptr, int *lenptr));
+     extern unsigned char *gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch * gdbarch, CORE_ADDR * pcptr, int *lenptr));
+     extern void set_gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch * gdbarch, gdbarch_breakpoint_from_pc_ftype * breakpoint_from_pc));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (BREAKPOINT_FROM_PC)
 #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
 #endif
 #endif
 
-extern CORE_ADDR gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break));
+     extern CORE_ADDR gdbarch_decr_pc_after_break PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_decr_pc_after_break PARAMS ((struct gdbarch * gdbarch, CORE_ADDR decr_pc_after_break));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (DECR_PC_AFTER_BREAK)
 #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
 #endif
 #endif
 
-extern CORE_ADDR gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR function_start_offset));
+     extern CORE_ADDR gdbarch_function_start_offset PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_function_start_offset PARAMS ((struct gdbarch * gdbarch, CORE_ADDR function_start_offset));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FUNCTION_START_OFFSET)
 #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
 #endif
 #endif
 
-typedef void (gdbarch_remote_translate_xfer_address_ftype) PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
-extern void gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
-extern void set_gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address));
+     typedef void (gdbarch_remote_translate_xfer_address_ftype) PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len));
+     extern void gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch * gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len));
+     extern void set_gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch * gdbarch, gdbarch_remote_translate_xfer_address_ftype * remote_translate_xfer_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
 #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
 #endif
 #endif
 
-extern CORE_ADDR gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch));
-extern void set_gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch, CORE_ADDR frame_args_skip));
+     extern CORE_ADDR gdbarch_frame_args_skip PARAMS ((struct gdbarch * gdbarch));
+     extern void set_gdbarch_frame_args_skip PARAMS ((struct gdbarch * gdbarch, CORE_ADDR frame_args_skip));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_SKIP)
 #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
 #endif
 #endif
 
-typedef int (gdbarch_frameless_function_invocation_ftype) PARAMS ((struct frame_info *fi));
-extern int gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
-extern void set_gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation));
+     typedef int (gdbarch_frameless_function_invocation_ftype) PARAMS ((struct frame_info * fi));
+     extern int gdbarch_frameless_function_invocation PARAMS ((struct gdbarch * gdbarch, struct frame_info * fi));
+     extern void set_gdbarch_frameless_function_invocation PARAMS ((struct gdbarch * gdbarch, gdbarch_frameless_function_invocation_ftype * frameless_function_invocation));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAMELESS_FUNCTION_INVOCATION)
 #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_frame_chain_ftype) PARAMS ((struct frame_info *frame));
-extern CORE_ADDR gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
-extern void set_gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain));
+     typedef CORE_ADDR (gdbarch_frame_chain_ftype) PARAMS ((struct frame_info * frame));
+     extern CORE_ADDR gdbarch_frame_chain PARAMS ((struct gdbarch * gdbarch, struct frame_info * frame));
+     extern void set_gdbarch_frame_chain PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_chain_ftype * frame_chain));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN)
 #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
 #endif
 #endif
 
-typedef int (gdbarch_frame_chain_valid_ftype) PARAMS ((CORE_ADDR chain, struct frame_info *thisframe));
-extern int gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe));
-extern void set_gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid));
+     typedef int (gdbarch_frame_chain_valid_ftype) PARAMS ((CORE_ADDR chain, struct frame_info * thisframe));
+     extern int gdbarch_frame_chain_valid PARAMS ((struct gdbarch * gdbarch, CORE_ADDR chain, struct frame_info * thisframe));
+     extern void set_gdbarch_frame_chain_valid PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_chain_valid_ftype * frame_chain_valid));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN_VALID)
 #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) PARAMS ((struct frame_info *fi));
-extern CORE_ADDR gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
-extern void set_gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc));
+     typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) PARAMS ((struct frame_info * fi));
+     extern CORE_ADDR gdbarch_frame_saved_pc PARAMS ((struct gdbarch * gdbarch, struct frame_info * fi));
+     extern void set_gdbarch_frame_saved_pc PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_saved_pc_ftype * frame_saved_pc));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_SAVED_PC)
 #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_frame_args_address_ftype) PARAMS ((struct frame_info *fi));
-extern CORE_ADDR gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
-extern void set_gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address));
+     typedef CORE_ADDR (gdbarch_frame_args_address_ftype) PARAMS ((struct frame_info * fi));
+     extern CORE_ADDR gdbarch_frame_args_address PARAMS ((struct gdbarch * gdbarch, struct frame_info * fi));
+     extern void set_gdbarch_frame_args_address PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_args_address_ftype * frame_args_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_ADDRESS)
 #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) PARAMS ((struct frame_info *fi));
-extern CORE_ADDR gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
-extern void set_gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address));
+     typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) PARAMS ((struct frame_info * fi));
+     extern CORE_ADDR gdbarch_frame_locals_address PARAMS ((struct gdbarch * gdbarch, struct frame_info * fi));
+     extern void set_gdbarch_frame_locals_address PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_locals_address_ftype * frame_locals_address));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_LOCALS_ADDRESS)
 #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
 #endif
 #endif
 
-typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) PARAMS ((struct frame_info *frame));
-extern CORE_ADDR gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
-extern void set_gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call));
+     typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) PARAMS ((struct frame_info * frame));
+     extern CORE_ADDR gdbarch_saved_pc_after_call PARAMS ((struct gdbarch * gdbarch, struct frame_info * frame));
+     extern void set_gdbarch_saved_pc_after_call PARAMS ((struct gdbarch * gdbarch, gdbarch_saved_pc_after_call_ftype * saved_pc_after_call));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (SAVED_PC_AFTER_CALL)
 #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame))
 #endif
 #endif
 
-typedef int (gdbarch_frame_num_args_ftype) PARAMS ((struct frame_info *frame));
-extern int gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
-extern void set_gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args));
+     typedef int (gdbarch_frame_num_args_ftype) PARAMS ((struct frame_info * frame));
+     extern int gdbarch_frame_num_args PARAMS ((struct gdbarch * gdbarch, struct frame_info * frame));
+     extern void set_gdbarch_frame_num_args PARAMS ((struct gdbarch * gdbarch, gdbarch_frame_num_args_ftype * frame_num_args));
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_NUM_ARGS)
 #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
 #endif
 #endif
 
-extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch *gdbarch));
+     extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch * gdbarch));
 
 
 /* Mechanism for co-ordinating the selection of a specific
@@ -819,39 +821,39 @@ extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch *gdbarch));
    - that describes the selected architecture (see
    gdbarch_alloc()). */
 
-struct gdbarch_list
-{
-  struct gdbarch *gdbarch;
-  struct gdbarch_list *next;
-};
+     struct gdbarch_list
+       {
+        struct gdbarch *gdbarch;
+        struct gdbarch_list *next;
+       };
 
-struct gdbarch_info
-{
-  /* Use default: bfd_arch_unknown (ZERO). */
-  enum bfd_architecture bfd_architecture;
+     struct gdbarch_info
+       {
+        /* Use default: bfd_arch_unknown (ZERO). */
+        enum bfd_architecture bfd_architecture;
 
-  /* Use default: NULL (ZERO). */
-  const struct bfd_arch_info *bfd_arch_info;
+        /* Use default: NULL (ZERO). */
+        const struct bfd_arch_info *bfd_arch_info;
 
-  /* Use default: 0 (ZERO). */
-  int byte_order;
+        /* Use default: 0 (ZERO). */
+        int byte_order;
 
-  /* Use default: NULL (ZERO). */
-  bfd *abfd;
+        /* Use default: NULL (ZERO). */
+        bfd *abfd;
 
-  /* Use default: NULL (ZERO). */
-  struct gdbarch_tdep_info *tdep_info;
-};
+        /* Use default: NULL (ZERO). */
+        struct gdbarch_tdep_info *tdep_info;
+       };
 
-typedef struct gdbarch *(gdbarch_init_ftype) PARAMS ((struct gdbarch_info info, struct gdbarch_list *arches));
+     typedef struct gdbarch *(gdbarch_init_ftype) PARAMS ((struct gdbarch_info info, struct gdbarch_list * arches));
 
-extern void register_gdbarch_init PARAMS ((enum bfd_architecture architecture, gdbarch_init_ftype *));
+     extern void register_gdbarch_init PARAMS ((enum bfd_architecture architecture, gdbarch_init_ftype *));
 
 
 /* Helper function.  Search the list of ARCHES for a GDBARCH that
    matches the information provided by INFO. */
 
-extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_list *arches,  const struct gdbarch_info *info));
+     extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_list * arches, const struct gdbarch_info * info));
 
 
 /* Helper function.  Create a preliminary ``struct gdbarch''.  Perform
@@ -859,7 +861,7 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_
    parameters.  set_gdbarch_*() functions are called to complete the
    initialization of the object. */
 
-extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *info, struct gdbarch_tdep *tdep));
+     extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info * info, struct gdbarch_tdep * tdep));
 
 
 /* Helper function. Force an update of the current architecture.  Used
@@ -873,7 +875,7 @@ extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *info, s
    INFO.ABFD (if specified) before calling the corresponding
    architectures INIT function. */
 
-extern int gdbarch_update PARAMS ((struct gdbarch_info info));
+     extern int gdbarch_update PARAMS ((struct gdbarch_info info));
 
 
 
@@ -894,13 +896,13 @@ extern int gdbarch_update PARAMS ((struct gdbarch_info info));
    Multiple registrarants for any architecture are allowed (and
    strongly encouraged).  */
 
-typedef void *(gdbarch_data_ftype) PARAMS ((void));
-extern struct gdbarch_data *register_gdbarch_data PARAMS ((gdbarch_data_ftype *init));
+     typedef void *(gdbarch_data_ftype) PARAMS ((void));
+     extern struct gdbarch_data *register_gdbarch_data PARAMS ((gdbarch_data_ftype * init));
 
 /* Return the value of the per-architecture data-pointer for the
    current architecture. */
 
-extern void *gdbarch_data PARAMS ((struct gdbarch_data*));
+     extern void *gdbarch_data PARAMS ((struct gdbarch_data *));
 
 
 
@@ -916,8 +918,8 @@ extern void *gdbarch_data PARAMS ((struct gdbarch_data*));
 
    New code should use register_gdbarch_data(). */
 
-typedef void (gdbarch_swap_ftype) PARAMS ((void));
-extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbarch_swap_ftype *init));
+     typedef void (gdbarch_swap_ftype) PARAMS ((void));
+     extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbarch_swap_ftype * init));
 
 
 
@@ -944,7 +946,7 @@ extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbar
 #endif
 #endif
 
-extern int target_byte_order;
+     extern int target_byte_order;
 #ifdef TARGET_BYTE_ORDER_SELECTABLE
 /* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE
    and expect defs.h to re-define TARGET_BYTE_ORDER. */
@@ -954,7 +956,7 @@ extern int target_byte_order;
 #define TARGET_BYTE_ORDER (target_byte_order + 0)
 #endif
 
-extern int target_byte_order_auto;
+     extern int target_byte_order_auto;
 #ifndef TARGET_BYTE_ORDER_AUTO
 #define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0)
 #endif
@@ -963,12 +965,12 @@ extern int target_byte_order_auto;
 
 /* The target-system-dependant BFD architecture is dynamic */
 
-extern int target_architecture_auto;
+     extern int target_architecture_auto;
 #ifndef TARGET_ARCHITECTURE_AUTO
 #define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0)
 #endif
 
-extern const struct bfd_arch_info *target_architecture;
+     extern const struct bfd_arch_info *target_architecture;
 #ifndef TARGET_ARCHITECTURE
 #define TARGET_ARCHITECTURE (target_architecture + 0)
 #endif
@@ -977,7 +979,7 @@ extern const struct bfd_arch_info *target_architecture;
    architecture. A zero return status indicates that the target did
    not like the change. */
 
-extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *)); 
+     extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *));
 
 
 
@@ -985,17 +987,17 @@ extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *));
 
 #include "dis-asm.h"           /* Get defs for disassemble_info */
 
-extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr,
-                                       int len, disassemble_info *info));
+     extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte * myaddr,
+                                        int len, disassemble_info * info));
 
-extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr,
-                                         disassemble_info *info));
+     extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr,
+                                              disassemble_info * info));
 
-extern void dis_asm_print_address PARAMS ((bfd_vma addr,
-                                          disassemble_info *info));
+     extern void dis_asm_print_address PARAMS ((bfd_vma addr,
+                                               disassemble_info * info));
 
-extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
-extern disassemble_info tm_print_insn_info;
+     extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
+     extern disassemble_info tm_print_insn_info;
 #ifndef TARGET_PRINT_INSN
 #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
 #endif
@@ -1024,7 +1026,7 @@ extern disassemble_info tm_print_insn_info;
 
 
 /* Fallback definition of REGISTER_CONVERTIBLE etc */
-extern int generic_register_convertible_not PARAMS ((int reg_nr));
+     extern int generic_register_convertible_not PARAMS ((int reg_nr));
 #ifndef REGISTER_CONVERTIBLE
 #define REGISTER_CONVERTIBLE(x) (0)
 #endif
@@ -1050,7 +1052,7 @@ extern int generic_register_convertible_not PARAMS ((int reg_nr));
 /* Fallback definition for REGISTER_NAME for systems still defining
    REGISTER_NAMES. */
 #ifndef REGISTER_NAME
-extern char *gdb_register_names[];
+     extern char *gdb_register_names[];
 #define REGISTER_NAME(i) gdb_register_names[i]
 #endif
 
@@ -1058,24 +1060,24 @@ extern char *gdb_register_names[];
 /* Set the dynamic target-system-dependant parameters (architecture,
    byte-order, ...) using information found in the BFD */
 
-extern void set_gdbarch_from_file PARAMS ((bfd *));
+     extern void set_gdbarch_from_file PARAMS ((bfd *));
 
 
 /* Explicitly set the dynamic target-system-dependant parameters based
    on bfd_architecture and machine. */
 
-extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
+     extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
 
 
 /* Helper function for targets that don't know how my arguments are
    being passed */
 
-extern int frame_num_args_unknown PARAMS ((struct frame_info *fi));
+     extern int frame_num_args_unknown PARAMS ((struct frame_info * fi));
 
 
 /* gdbarch trace variable */
-extern int gdbarch_debug;
+     extern int gdbarch_debug;
 
-extern void gdbarch_dump PARAMS ((void));
+     extern void gdbarch_dump PARAMS ((void));
 
 #endif
index 65b47ee2ad2142a9b80f6d00863fc97637063f17..af4fcf6199f9abad3251f6f3dd29c960966f47c2 100644 (file)
@@ -1,19 +1,20 @@
 /* Header file for GDB-specific command-line stuff.
    Copyright 1986, 1989, 1990, 1992 Free Software Foundation, Inc.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (GDBCMD_H)
 #define GDBCMD_H 1
@@ -112,4 +113,4 @@ extern char **noop_completer PARAMS ((char *, char *));
 
 extern char **filename_completer PARAMS ((char *, char *));
 
-#endif /* !defined (GDBCMD_H) */
+#endif /* !defined (GDBCMD_H) */
index 6501e3098b969fa37cbb1bb63546c1473f7382da..b083d56e8dcd1de583a3bef449b3acff714ca1f3 100644 (file)
@@ -1,21 +1,22 @@
 /* Machine independent variables that describe the core file under GDB.
    Copyright 1986, 1987, 1989, 1990, 1992, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Interface routines for core, executable, etc.  */
 
@@ -51,7 +52,7 @@ extern void memory_error PARAMS ((int status, CORE_ADDR memaddr));
 extern void read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
 
 extern void read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr,
-                                        int len, asection *bfd_section));
+                                        int len, asection * bfd_section));
 
 /* Read an integer from debugged memory, given address and number of
    bytes.  */
@@ -64,7 +65,7 @@ extern LONGEST read_memory_integer PARAMS ((CORE_ADDR memaddr, int len));
 extern ULONGEST read_memory_unsigned_integer PARAMS ((CORE_ADDR memaddr, int len));
 
 /* Read a null-terminated string from the debuggee's memory, given address,
- * a buffer into which to place the string, and the maximum available space */ 
+ * a buffer into which to place the string, and the maximum available space */
 extern void read_memory_string PARAMS ((CORE_ADDR, char *, int));
 
 /* This takes a char *, not void *.  This is probably right, because
@@ -77,7 +78,7 @@ extern void write_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
 extern void generic_search PARAMS ((int len, char *data, char *mask,
                                    CORE_ADDR startaddr, int increment,
                                    CORE_ADDR lorange, CORE_ADDR hirange,
-                                   CORE_ADDR *addr_found, char *data_found));
+                                CORE_ADDR * addr_found, char *data_found));
 \f
 /* Hook for `exec_file_command' command to call.  */
 
@@ -129,41 +130,42 @@ extern void set_gnutarget PARAMS ((char *));
 /* Structure to keep track of core register reading functions for
    various core file types.  */
 
-struct core_fns {
+struct core_fns
+  {
 
-  /* BFD flavour that we handle.  Note that bfd_target_unknown_flavour matches
-     anything, and if there is no better match, this function will be called
-     as the default. */
+    /* BFD flavour that we handle.  Note that bfd_target_unknown_flavour matches
+       anything, and if there is no better match, this function will be called
+       as the default. */
 
-  enum bfd_flavour core_flavour;
+    enum bfd_flavour core_flavour;
 
-  /* Extract the register values out of the core file and store them where
-     `read_register' will find them.
+    /* Extract the register values out of the core file and store them where
+       `read_register' will find them.
 
-     CORE_REG_SECT points to the register values themselves, read into
-     memory.
+       CORE_REG_SECT points to the register values themselves, read into
+       memory.
 
-     CORE_REG_SIZE is the size of that area.
+       CORE_REG_SIZE is the size of that area.
 
-     WHICH says which set of registers we are handling (0 = int, 2 = float on
-     machines where they are discontiguous).
+       WHICH says which set of registers we are handling (0 = int, 2 = float on
+       machines where they are discontiguous).
 
-     REG_ADDR is the offset from u.u_ar0 to the register values relative to
-     core_reg_sect.  This is used with old-fashioned core files to locate the
-     registers in a large upage-plus-stack ".reg" section.  Original upage
-     address X is at location core_reg_sect+x+reg_addr. */
+       REG_ADDR is the offset from u.u_ar0 to the register values relative to
+       core_reg_sect.  This is used with old-fashioned core files to locate the
+       registers in a large upage-plus-stack ".reg" section.  Original upage
+       address X is at location core_reg_sect+x+reg_addr. */
 
-  void (*core_read_registers) PARAMS ((char *core_reg_sect, unsigned core_reg_size,
-                                 int which, CORE_ADDR reg_addr));
+    void (*core_read_registers) PARAMS ((char *core_reg_sect, unsigned core_reg_size,
+                                        int which, CORE_ADDR reg_addr));
 
-  /* Finds the next struct core_fns.  They are allocated and initialized
-     in whatever module implements the functions pointed to; an 
-     initializer calls add_core_fns to add them to the global chain.  */
+    /* Finds the next struct core_fns.  They are allocated and initialized
+       in whatever module implements the functions pointed to; an 
+       initializer calls add_core_fns to add them to the global chain.  */
 
-  struct core_fns *next;
+    struct core_fns *next;
 
-};
+  };
 
-extern void add_core_fns PARAMS ((struct core_fns *cf));
+extern void add_core_fns PARAMS ((struct core_fns * cf));
 
-#endif /* !defined (GDBCORE_H) */
+#endif /* !defined (GDBCORE_H) */
index ebe06bad8f2413d1e8bd15d88c45236d31e74d4d..577396222f7690c9e7b8cbe57d4aa85c7e6d3fee 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1996 Free Software Foundation, Inc.
    Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <sys/file.h>
@@ -72,7 +73,7 @@ sync_error (fp, desc, expect, got)
 }
 
 void
-remote_close()
+remote_close ()
 {
   close (remote_desc);
 }
@@ -111,19 +112,19 @@ remote_open (name)
 
       /* Allow rapid reuse of this port. */
       tmp = 1;
-      setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *)&tmp,
-                 sizeof(tmp));
+      setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp,
+                 sizeof (tmp));
 
       sockaddr.sin_family = PF_INET;
-      sockaddr.sin_port = htons(port);
+      sockaddr.sin_port = htons (port);
       sockaddr.sin_addr.s_addr = INADDR_ANY;
 
-      if (bind (tmp_desc, (struct sockaddr *)&sockaddr, sizeof (sockaddr))
+      if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr))
          || listen (tmp_desc, 1))
        perror_with_name ("Can't bind address");
 
       tmp = sizeof (sockaddr);
-      remote_desc = accept (tmp_desc, (struct sockaddr *)&sockaddr, &tmp);
+      remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp);
       if (remote_desc == -1)
        perror_with_name ("Accept failed");
 
@@ -133,18 +134,18 @@ remote_open (name)
 
       /* Enable TCP keep alive process. */
       tmp = 1;
-      setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *)&tmp, sizeof(tmp));
+      setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
 
       /* Tell TCP not to delay small packets.  This greatly speeds up
-        interactive response. */
+         interactive response. */
       tmp = 1;
       setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
-                 (char *)&tmp, sizeof(tmp));
+                 (char *) &tmp, sizeof (tmp));
 
       close (tmp_desc);                /* No longer need this */
 
-      signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbreplay simply
-                                   exits when the remote side dies.  */
+      signal (SIGPIPE, SIG_IGN);       /* If we don't do this, then gdbreplay simply
+                                          exits when the remote side dies.  */
     }
 
   fcntl (remote_desc, F_SETFL, FASYNC);
@@ -153,7 +154,8 @@ remote_open (name)
   fflush (stderr);
 }
 
-static int tohex (ch)
+static int
+tohex (ch)
      int ch;
 {
   if (ch >= '0' && ch <= '9')
@@ -194,13 +196,26 @@ logchar (fp)
       fflush (stdout);
       switch (ch)
        {
-       case '\\': break;
-       case 'b': ch = '\b'; break;
-       case 'f': ch = '\f'; break;
-       case 'n': ch = '\n'; break;
-       case 'r': ch = '\r'; break;
-       case 't': ch = '\t'; break;
-       case 'v': ch = '\v'; break;
+       case '\\':
+         break;
+       case 'b':
+         ch = '\b';
+         break;
+       case 'f':
+         ch = '\f';
+         break;
+       case 'n':
+         ch = '\n';
+         break;
+       case 'r':
+         ch = '\r';
+         break;
+       case 't':
+         ch = '\t';
+         break;
+       case 'v':
+         ch = '\v';
+         break;
        case 'x':
          ch2 = fgetc (fp);
          fputc (ch2, stdout);
@@ -244,7 +259,8 @@ expect (fp)
          break;
        }
       read (remote_desc, &fromgdb, 1);
-    } while (fromlog == fromgdb);
+    }
+  while (fromlog == fromgdb);
   if (fromlog != EOL)
     {
       sync_error (fp, "Sync error during read of gdb packet", fromlog,
@@ -292,7 +308,7 @@ main (argc, argv)
   if (fp == NULL)
     {
       perror_with_name (argv[1]);
-    }      
+    }
   remote_open (argv[2]);
   while ((ch = logchar (fp)) != EOF)
     {
@@ -315,4 +331,3 @@ main (argc, argv)
   remote_close ();
   exit (0);
 }
-
index c784d0c61accb6e714e4602cb648ac8dae144653..3c28a3895d37e86d38ad065cb6069b3f37ea9142 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for the remote server for GDB.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <sys/wait.h>
@@ -90,7 +91,7 @@ kill_inferior ()
     return;
   ptrace (8, inferior_pid, 0, 0, 0);
   wait (0);
-  /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
 }
 
 /* Return nonzero if the given thread is still alive.  */
@@ -195,8 +196,8 @@ fetch_register (regno)
   for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
     {
       errno = 0;
-      *(int *) &registers[ regno * 4 + i] = ptrace (PT_RUREGS, inferior_pid,
-                                (PTRACE_ARG3_TYPE) regaddr, 0, 0);
+      *(int *) &registers[regno * 4 + i] = ptrace (PT_RUREGS, inferior_pid,
+                                         (PTRACE_ARG3_TYPE) regaddr, 0, 0);
       regaddr += sizeof (int);
       if (errno != 0)
        {
@@ -209,7 +210,7 @@ fetch_register (regno)
          goto error_exit;
        }
     }
- error_exit:;
+error_exit:;
 }
 
 /* Fetch all registers, or just one, from the child process.  */
@@ -247,20 +248,20 @@ store_inferior_registers (regno)
       regaddr = register_addr (regno, offset);
       errno = 0;
       if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
-        {
-          scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
-          ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
-                  scratch, 0);
-          if (errno != 0)
-            {
+       {
+         scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
+         ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+                 scratch, 0);
+         if (errno != 0)
+           {
              /* Error, even if attached.  Failing to write these two
-                registers is pretty serious.  */
-              sprintf (buf, "writing register number %d", regno);
-              perror_with_name (buf);
-            }
-        }
+                registers is pretty serious.  */
+             sprintf (buf, "writing register number %d", regno);
+             perror_with_name (buf);
+           }
+       }
       else
-       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
+       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
          {
            errno = 0;
            ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
@@ -276,7 +277,7 @@ store_inferior_registers (regno)
                error (msg);
                return;
              }
-           regaddr += sizeof(int);
+           regaddr += sizeof (int);
          }
     }
   else
index 106021057a3c792470ab9fff81ab5294c608006a..32f10a13f13114a81510e334d9ec5ac6739b2419 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for the remote server for GDB.
    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <sys/wait.h>
@@ -95,7 +96,7 @@ kill_inferior ()
     return;
   ptrace (PTRACE_KILL, inferior_pid, 0, 0);
   wait (0);
-  /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
 }
 
 /* Return nonzero if the given thread is still alive.  */
@@ -169,7 +170,7 @@ myresume (step, signal)
 #ifndef TARGET_M68K
 /* this table must line up with REGISTER_NAMES in tm-i386v.h */
 /* symbols like 'EAX' come from <sys/reg.h> */
-static int regmap[] = 
+static int regmap[] =
 {
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
@@ -187,22 +188,22 @@ i386_register_u_addr (blockend, regnum)
   /* 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) 
+  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);
+      fpstate = ubase + ((char *) &u.u_fpstate - (char *) &u);
       return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM));
-    } 
+    }
   else
 #endif
     return (blockend + 4 * regmap[regnum]);
-  
+
 }
 #else /* TARGET_M68K */
 /* This table must line up with REGISTER_NAMES in tm-m68k.h */
-static int regmap[] = 
+static int regmap[] =
 {
 #ifdef PT_D0
   PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
@@ -228,7 +229,7 @@ m68k_linux_register_u_addr (blockend, regnum)
      int blockend;
      int regnum;
 {
-    return (blockend + 4 * regmap[regnum]);
+  return (blockend + 4 * regmap[regnum]);
 }
 #endif
 
@@ -265,8 +266,8 @@ fetch_register (regno)
   for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
     {
       errno = 0;
-      *(int *) &registers[ regno * 4 + i] = ptrace (PTRACE_PEEKUSR, inferior_pid,
-                                (PTRACE_ARG3_TYPE) regaddr, 0);
+      *(int *) &registers[regno * 4 + i] = ptrace (PTRACE_PEEKUSR, inferior_pid,
+                                            (PTRACE_ARG3_TYPE) regaddr, 0);
       regaddr += sizeof (int);
       if (errno != 0)
        {
@@ -279,7 +280,7 @@ fetch_register (regno)
          goto error_exit;
        }
     }
- error_exit:;
+error_exit:;
 }
 
 /* Fetch all registers, or just one, from the child process.  */
@@ -289,7 +290,7 @@ fetch_inferior_registers (regno)
      int regno;
 {
   if (regno == -1 || regno == 0)
-    for (regno = 0; regno < NUM_REGS-NUM_FREGS; regno++)
+    for (regno = 0; regno < NUM_REGS - NUM_FREGS; regno++)
       fetch_register (regno);
   else
     fetch_register (regno);
@@ -317,21 +318,21 @@ store_inferior_registers (regno)
       errno = 0;
 #if 0
       if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
-        {
-          scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
-          ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
-                  scratch, 0);
-          if (errno != 0)
-            {
+       {
+         scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
+         ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+                 scratch, 0);
+         if (errno != 0)
+           {
              /* Error, even if attached.  Failing to write these two
-                registers is pretty serious.  */
-              sprintf (buf, "writing register number %d", regno);
-              perror_with_name (buf);
-            }
-        }
+                registers is pretty serious.  */
+             sprintf (buf, "writing register number %d", regno);
+             perror_with_name (buf);
+           }
+       }
       else
 #endif
-       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
+       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
          {
            errno = 0;
            ptrace (PTRACE_POKEUSR, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
@@ -347,11 +348,11 @@ store_inferior_registers (regno)
                error (msg);
                return;
              }
-           regaddr += sizeof(int);
+           regaddr += sizeof (int);
          }
     }
   else
-    for (regno = 0; regno < NUM_REGS-NUM_FREGS; regno++)
+    for (regno = 0; regno < NUM_REGS - NUM_FREGS; regno++)
       store_inferior_registers (regno);
 }
 
index 3444f7a116e502ef71baa1a970313191a2971a60..ecc331811c94aada8c89de74f4a6a9bbb1b5ff59 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for the remote server for GDB.
    Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "server.h"
 #include "frame.h"
@@ -66,18 +67,18 @@ create_inferior (program, allargs)
       int pgrp;
 
       /* Switch child to it's own process group so that signals won't
-        directly affect gdbserver. */
+         directly affect gdbserver. */
 
-      pgrp = getpid();
-      setpgrp(0, pgrp);
+      pgrp = getpid ();
+      setpgrp (0, pgrp);
       ioctl (0, TIOCSPGRP, &pgrp);
 
-      ptrace (PTRACE_TRACEME, 0, (PTRACE_ARG3_TYPE)0, 0);
+      ptrace (PTRACE_TRACEME, 0, (PTRACE_ARG3_TYPE) 0, 0);
 
       execv (program, allargs);
 
       fprintf (stderr, "GDBserver (process %d):  Cannot exec %s: %s.\n",
-              getpid(), program,
+              getpid (), program,
               errno < sys_nerr ? sys_errlist[errno] : "unknown error");
       fflush (stderr);
       _exit (0177);
@@ -128,34 +129,34 @@ mywait (status)
 
   while (1)
     {
-      enable_async_io();
+      enable_async_io ();
 
       pid = wait (&w);
 
-      disable_async_io();
+      disable_async_io ();
 
-      if (pid != PIDGET(inferior_pid))
+      if (pid != PIDGET (inferior_pid))
        perror_with_name ("wait");
 
       thread_from_wait = w.w_tid;
       inferior_pid = BUILDPID (inferior_pid, w.w_tid);
 
-      if (WIFSTOPPED(w)
-         && WSTOPSIG(w) == SIGTRAP)
+      if (WIFSTOPPED (w)
+         && WSTOPSIG (w) == SIGTRAP)
        {
          int realsig;
 
          realsig = ptrace (PTRACE_GETTRACESIG, inferior_pid,
-                           (PTRACE_ARG3_TYPE)0, 0);
+                           (PTRACE_ARG3_TYPE) 0, 0);
 
          if (realsig == SIGNEWTHREAD)
            {
              /* It's a new thread notification.  Nothing to do here since
-                the machine independent code in wait_for_inferior will
-                add the thread to the thread list and restart the thread
-                when pid != inferior_pid and pid is not in the thread list.
-                We don't even want to muck with realsig -- the code in
-                wait_for_inferior expects SIGTRAP.  */
+                the machine independent code in wait_for_inferior will
+                add the thread to the thread list and restart the thread
+                when pid != inferior_pid and pid is not in the thread list.
+                We don't even want to muck with realsig -- the code in
+                wait_for_inferior expects SIGTRAP.  */
              ;
            }
        }
@@ -209,22 +210,22 @@ myresume (step, signal)
 
 static int regmap[] =
 {
-  X(eax),
-  X(ecx),
-  X(edx),
-  X(ebx),
-  X(esp),                      /* sp */
-  X(ebp),                      /* fp */
-  X(esi),
-  X(edi),
-  X(eip),                      /* pc */
-  X(flags),                    /* ps */
-  X(cs),
-  X(ss),
-  X(ds),
-  X(es),
-  X(ecode),                    /* Lynx doesn't give us either fs or gs, so */
-  X(fault),                    /* we just substitute these two in the hopes
+  X (eax),
+  X (ecx),
+  X (edx),
+  X (ebx),
+  X (esp),                     /* sp */
+  X (ebp),                     /* fp */
+  X (esi),
+  X (edi),
+  X (eip),                     /* pc */
+  X (flags),                   /* ps */
+  X (cs),
+  X (ss),
+  X (ds),
+  X (es),
+  X (ecode),                   /* Lynx doesn't give us either fs or gs, so */
+  X (fault),                   /* we just substitute these two in the hopes
                                   that they are useful. */
 };
 #endif
@@ -234,39 +235,39 @@ static int regmap[] =
 
 static int regmap[] =
 {
-  X(regs[0]),                  /* d0 */
-  X(regs[1]),                  /* d1 */
-  X(regs[2]),                  /* d2 */
-  X(regs[3]),                  /* d3 */
-  X(regs[4]),                  /* d4 */
-  X(regs[5]),                  /* d5 */
-  X(regs[6]),                  /* d6 */
-  X(regs[7]),                  /* d7 */
-  X(regs[8]),                  /* a0 */
-  X(regs[9]),                  /* a1 */
-  X(regs[10]),                 /* a2 */
-  X(regs[11]),                 /* a3 */
-  X(regs[12]),                 /* a4 */
-  X(regs[13]),                 /* a5 */
-  X(regs[14]),                 /* fp */
+  X (regs[0]),                 /* d0 */
+  X (regs[1]),                 /* d1 */
+  X (regs[2]),                 /* d2 */
+  X (regs[3]),                 /* d3 */
+  X (regs[4]),                 /* d4 */
+  X (regs[5]),                 /* d5 */
+  X (regs[6]),                 /* d6 */
+  X (regs[7]),                 /* d7 */
+  X (regs[8]),                 /* a0 */
+  X (regs[9]),                 /* a1 */
+  X (regs[10]),                        /* a2 */
+  X (regs[11]),                        /* a3 */
+  X (regs[12]),                        /* a4 */
+  X (regs[13]),                        /* a5 */
+  X (regs[14]),                        /* fp */
   0,                           /* sp */
-  X(status),                   /* ps */
-  X(pc),
-
-  X(fregs[0*3]),               /* fp0 */
-  X(fregs[1*3]),               /* fp1 */
-  X(fregs[2*3]),               /* fp2 */
-  X(fregs[3*3]),               /* fp3 */
-  X(fregs[4*3]),               /* fp4 */
-  X(fregs[5*3]),               /* fp5 */
-  X(fregs[6*3]),               /* fp6 */
-  X(fregs[7*3]),               /* fp7 */
-
-  X(fcregs[0]),                        /* fpcontrol */
-  X(fcregs[1]),                        /* fpstatus */
-  X(fcregs[2]),                        /* fpiaddr */
-  X(ssw),                      /* fpcode */
-  X(fault),                    /* fpflags */
+  X (status),                  /* ps */
+  X (pc),
+
+  X (fregs[0 * 3]),            /* fp0 */
+  X (fregs[1 * 3]),            /* fp1 */
+  X (fregs[2 * 3]),            /* fp2 */
+  X (fregs[3 * 3]),            /* fp3 */
+  X (fregs[4 * 3]),            /* fp4 */
+  X (fregs[5 * 3]),            /* fp5 */
+  X (fregs[6 * 3]),            /* fp6 */
+  X (fregs[7 * 3]),            /* fp7 */
+
+  X (fcregs[0]),               /* fpcontrol */
+  X (fcregs[1]),               /* fpstatus */
+  X (fcregs[2]),               /* fpiaddr */
+  X (ssw),                     /* fpcode */
+  X (fault),                   /* fpflags */
 };
 #endif
 
@@ -278,67 +279,67 @@ static int regmap[] =
 static int regmap[] =
 {
   -1,                          /* g0 */
-  X(g1),
-  X(g2),
-  X(g3),
-  X(g4),
+  X (g1),
+  X (g2),
+  X (g3),
+  X (g4),
   -1,                          /* g5->g7 aren't saved by Lynx */
   -1,
   -1,
 
-  X(o[0]),
-  X(o[1]),
-  X(o[2]),
-  X(o[3]),
-  X(o[4]),
-  X(o[5]),
-  X(o[6]),                     /* sp */
-  X(o[7]),                     /* ra */
-
-  -1,-1,-1,-1,-1,-1,-1,-1,     /* l0 -> l7 */
-
-  -1,-1,-1,-1,-1,-1,-1,-1,     /* i0 -> i7 */
-
-  FX(f.fregs[0]),              /* f0 */
-  FX(f.fregs[1]),
-  FX(f.fregs[2]),
-  FX(f.fregs[3]),
-  FX(f.fregs[4]),
-  FX(f.fregs[5]),
-  FX(f.fregs[6]),
-  FX(f.fregs[7]),
-  FX(f.fregs[8]),
-  FX(f.fregs[9]),
-  FX(f.fregs[10]),
-  FX(f.fregs[11]),
-  FX(f.fregs[12]),
-  FX(f.fregs[13]),
-  FX(f.fregs[14]),
-  FX(f.fregs[15]),
-  FX(f.fregs[16]),
-  FX(f.fregs[17]),
-  FX(f.fregs[18]),
-  FX(f.fregs[19]),
-  FX(f.fregs[20]),
-  FX(f.fregs[21]),
-  FX(f.fregs[22]),
-  FX(f.fregs[23]),
-  FX(f.fregs[24]),
-  FX(f.fregs[25]),
-  FX(f.fregs[26]),
-  FX(f.fregs[27]),
-  FX(f.fregs[28]),
-  FX(f.fregs[29]),
-  FX(f.fregs[30]),
-  FX(f.fregs[31]),
-
-  X(y),
-  X(psr),
-  X(wim),
-  X(tbr),
-  X(pc),
-  X(npc),
-  FX(fsr),                     /* fpsr */
+  X (o[0]),
+  X (o[1]),
+  X (o[2]),
+  X (o[3]),
+  X (o[4]),
+  X (o[5]),
+  X (o[6]),                    /* sp */
+  X (o[7]),                    /* ra */
+
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* l0 -> l7 */
+
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* i0 -> i7 */
+
+  FX (f.fregs[0]),             /* f0 */
+  FX (f.fregs[1]),
+  FX (f.fregs[2]),
+  FX (f.fregs[3]),
+  FX (f.fregs[4]),
+  FX (f.fregs[5]),
+  FX (f.fregs[6]),
+  FX (f.fregs[7]),
+  FX (f.fregs[8]),
+  FX (f.fregs[9]),
+  FX (f.fregs[10]),
+  FX (f.fregs[11]),
+  FX (f.fregs[12]),
+  FX (f.fregs[13]),
+  FX (f.fregs[14]),
+  FX (f.fregs[15]),
+  FX (f.fregs[16]),
+  FX (f.fregs[17]),
+  FX (f.fregs[18]),
+  FX (f.fregs[19]),
+  FX (f.fregs[20]),
+  FX (f.fregs[21]),
+  FX (f.fregs[22]),
+  FX (f.fregs[23]),
+  FX (f.fregs[24]),
+  FX (f.fregs[25]),
+  FX (f.fregs[26]),
+  FX (f.fregs[27]),
+  FX (f.fregs[28]),
+  FX (f.fregs[29]),
+  FX (f.fregs[30]),
+  FX (f.fregs[31]),
+
+  X (y),
+  X (psr),
+  X (wim),
+  X (tbr),
+  X (pc),
+  X (npc),
+  FX (fsr),                    /* fpsr */
   -1,                          /* cpsr */
 };
 #endif
@@ -371,7 +372,7 @@ fetch_inferior_registers (regno)
 
   if (whatregs & WHATREGS_GEN)
     {
-      struct econtext ec;              /* general regs */
+      struct econtext ec;      /* general regs */
       char buf[MAX_REGISTER_RAW_SIZE];
       int retval;
       int i;
@@ -379,25 +380,25 @@ fetch_inferior_registers (regno)
       errno = 0;
       retval = ptrace (PTRACE_GETREGS,
                       BUILDPID (inferior_pid, general_thread),
-                      (PTRACE_ARG3_TYPE) &ec,
+                      (PTRACE_ARG3_TYPE) & ec,
                       0);
       if (errno)
        perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
-  
+
       memset (buf, 0, REGISTER_RAW_SIZE (G0_REGNUM));
       supply_register (G0_REGNUM, buf);
-      supply_register (TBR_REGNUM, (char *)&ec.tbr);
+      supply_register (TBR_REGNUM, (char *) &ec.tbr);
 
       memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
              4 * REGISTER_RAW_SIZE (G1_REGNUM));
       for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
        register_valid[i] = 1;
 
-      supply_register (PS_REGNUM, (char *)&ec.psr);
-      supply_register (Y_REGNUM, (char *)&ec.y);
-      supply_register (PC_REGNUM, (char *)&ec.pc);
-      supply_register (NPC_REGNUM, (char *)&ec.npc);
-      supply_register (WIM_REGNUM, (char *)&ec.wim);
+      supply_register (PS_REGNUM, (char *) &ec.psr);
+      supply_register (Y_REGNUM, (char *) &ec.y);
+      supply_register (PC_REGNUM, (char *) &ec.pc);
+      supply_register (NPC_REGNUM, (char *) &ec.npc);
+      supply_register (WIM_REGNUM, (char *) &ec.wim);
 
       memcpy (&registers[REGISTER_BYTE (O0_REGNUM)], ec.o,
              8 * REGISTER_RAW_SIZE (O0_REGNUM));
@@ -413,13 +414,13 @@ fetch_inferior_registers (regno)
       sp = read_register (SP_REGNUM);
 
       target_xfer_memory (sp + FRAME_SAVED_I0,
-                         &registers[REGISTER_BYTE(I0_REGNUM)],
+                         &registers[REGISTER_BYTE (I0_REGNUM)],
                          8 * REGISTER_RAW_SIZE (I0_REGNUM), 0);
       for (i = I0_REGNUM; i <= I7_REGNUM; i++)
        register_valid[i] = 1;
 
       target_xfer_memory (sp + FRAME_SAVED_L0,
-                         &registers[REGISTER_BYTE(L0_REGNUM)],
+                         &registers[REGISTER_BYTE (L0_REGNUM)],
                          8 * REGISTER_RAW_SIZE (L0_REGNUM), 0);
       for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
        register_valid[i] = 1;
@@ -427,22 +428,22 @@ fetch_inferior_registers (regno)
 
   if (whatregs & WHATREGS_FLOAT)
     {
-      struct fcontext fc;              /* fp regs */
+      struct fcontext fc;      /* fp regs */
       int retval;
       int i;
 
       errno = 0;
-      retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
-  
+
       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
              32 * REGISTER_RAW_SIZE (FP0_REGNUM));
       for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
        register_valid[i] = 1;
 
-      supply_register (FPS_REGNUM, (char *)&fc.fsr);
+      supply_register (FPS_REGNUM, (char *) &fc.fsr);
     }
 #endif
 }
@@ -474,7 +475,7 @@ store_inferior_registers (regno)
 
   if (whatregs & WHATREGS_GEN)
     {
-      struct econtext ec;              /* general regs */
+      struct econtext ec;      /* general regs */
       int retval;
 
       ec.tbr = read_register (TBR_REGNUM);
@@ -491,7 +492,7 @@ store_inferior_registers (regno)
              8 * REGISTER_RAW_SIZE (O0_REGNUM));
 
       errno = 0;
-      retval = ptrace (PTRACE_SETREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) &ec,
+      retval = ptrace (PTRACE_SETREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & ec,
                       0);
       if (errno)
        perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
@@ -506,8 +507,8 @@ store_inferior_registers (regno)
 
       if (regno == -1 || regno == SP_REGNUM)
        {
-         if (!register_valid[L0_REGNUM+5])
-           abort();
+         if (!register_valid[L0_REGNUM + 5])
+           abort ();
          target_xfer_memory (sp + FRAME_SAVED_I0,
                              &registers[REGISTER_BYTE (I0_REGNUM)],
                              8 * REGISTER_RAW_SIZE (I0_REGNUM), 1);
@@ -519,7 +520,7 @@ store_inferior_registers (regno)
       else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
        {
          if (!register_valid[regno])
-           abort();
+           abort ();
          if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
            regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
              + FRAME_SAVED_L0;
@@ -533,27 +534,27 @@ store_inferior_registers (regno)
 
   if (whatregs & WHATREGS_FLOAT)
     {
-      struct fcontext fc;              /* fp regs */
+      struct fcontext fc;      /* fp regs */
       int retval;
 
 /* We read fcontext first so that we can get good values for fq_t... */
       errno = 0;
-      retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_GETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
-  
+
       memcpy (fc.f.fregs, &registers[REGISTER_BYTE (FP0_REGNUM)],
              32 * REGISTER_RAW_SIZE (FP0_REGNUM));
 
       fc.fsr = read_register (FPS_REGNUM);
 
       errno = 0;
-      retval = ptrace (PTRACE_SETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_SETFPREGS, BUILDPID (inferior_pid, general_thread), (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
-      }
+    }
 #endif
 }
 #endif /* SPARC */
@@ -564,20 +565,20 @@ store_inferior_registers (regno)
    saved context block.  */
 
 static unsigned long
-lynx_registers_addr()
+lynx_registers_addr ()
 {
   CORE_ADDR stblock;
-  int ecpoff = offsetof(st_t, ecp);
+  int ecpoff = offsetof (st_t, ecp);
   CORE_ADDR ecp;
 
   errno = 0;
   stblock = (CORE_ADDR) ptrace (PTRACE_THREADUSER, BUILDPID (inferior_pid, general_thread),
-                               (PTRACE_ARG3_TYPE)0, 0);
+                               (PTRACE_ARG3_TYPE) 0, 0);
   if (errno)
     perror_with_name ("PTRACE_THREADUSER");
 
   ecp = (CORE_ADDR) ptrace (PTRACE_PEEKTHREAD, BUILDPID (inferior_pid, general_thread),
-                           (PTRACE_ARG3_TYPE)ecpoff, 0);
+                           (PTRACE_ARG3_TYPE) ecpoff, 0);
   if (errno)
     perror_with_name ("lynx_registers_addr(PTRACE_PEEKTHREAD)");
 
@@ -596,7 +597,7 @@ fetch_inferior_registers (ignored)
   unsigned long reg;
   unsigned long ecp;
 
-  ecp = lynx_registers_addr();
+  ecp = lynx_registers_addr ();
 
   for (regno = 0; regno < NUM_REGS; regno++)
     {
@@ -611,8 +612,8 @@ fetch_inferior_registers (ignored)
                    (PTRACE_ARG3_TYPE) (ecp + regmap[regno]), 0);
       if (errno)
        perror_with_name ("fetch_inferior_registers(PTRACE_PEEKTHREAD)");
-  
-      *(unsigned long *)&registers[REGISTER_BYTE (regno)] = reg;
+
+      *(unsigned long *) &registers[REGISTER_BYTE (regno)] = reg;
     }
 }
 
@@ -628,7 +629,7 @@ store_inferior_registers (ignored)
   unsigned long reg;
   unsigned long ecp;
 
-  ecp = lynx_registers_addr();
+  ecp = lynx_registers_addr ();
 
   for (regno = 0; regno < NUM_REGS; regno++)
     {
@@ -638,7 +639,7 @@ store_inferior_registers (ignored)
       ptrace_fun = regno == SP_REGNUM ? PTRACE_POKEUSP : PTRACE_POKEUSER;
 #endif
 
-      reg = *(unsigned long *)&registers[REGISTER_BYTE (regno)];
+      reg = *(unsigned long *) &registers[REGISTER_BYTE (regno)];
 
       errno = 0;
       ptrace (ptrace_fun, BUILDPID (inferior_pid, general_thread),
@@ -730,12 +731,12 @@ write_inferior_memory (memaddr, myaddr, len)
          ptrace (PTRACE_POKETEXT, BUILDPID (inferior_pid, general_thread), addr, buffer[i]);
          if (errno)
            {
-             fprintf(stderr, "\
+             fprintf (stderr, "\
 ptrace (PTRACE_POKETEXT): errno=%d, pid=0x%x, addr=0x%x, buffer[i] = 0x%x\n",
-                     errno, BUILDPID (inferior_pid, general_thread),
-                     addr, buffer[i]);
-             fprintf(stderr, "Sleeping for 1 second\n");
-             sleep(1);
+                      errno, BUILDPID (inferior_pid, general_thread),
+                      addr, buffer[i]);
+             fprintf (stderr, "Sleeping for 1 second\n");
+             sleep (1);
            }
          else
            break;
index 8ad6e91d461a9e1750a55dbe88ddb2cfb7315c96..ebd5f7d21e7ee4e523c0d91875f8e1b33d7b03e9 100644 (file)
@@ -1,27 +1,28 @@
 /* Low level interface to simulators, for the remote server for GDB.
    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
 #include "server.h"
-#include "callback.h"   /* GDB simulator callback interface */
-#include "remote-sim.h" /* GDB simulator interface */
+#include "callback.h"          /* GDB simulator callback interface */
+#include "remote-sim.h"                /* GDB simulator interface */
 
 extern int remote_debug;
 
@@ -29,7 +30,7 @@ extern host_callback default_callback;        /* in sim/common/callback.c */
 
 char registers[REGISTER_BYTES] __attribute__ ((aligned));
 
-int target_byte_order; /* used by simulator */
+int target_byte_order;         /* used by simulator */
 
 /* We record the result of sim_open so we can pass it
    back to the other sim_foo routines.  */
@@ -40,13 +41,13 @@ static SIM_DESC gdbsim_desc = 0;
 
 static void
 generic_load (loadfile_bfd)
-    bfd *loadfile_bfd;
+     bfd *loadfile_bfd;
 {
   asection *s;
 
-  for (s = loadfile_bfd->sections; s; s = s->next) 
+  for (s = loadfile_bfd->sections; s; s = s->next)
     {
-      if (s->flags & SEC_LOAD) 
+      if (s->flags & SEC_LOAD)
        {
          bfd_size_type size;
 
@@ -60,11 +61,11 @@ generic_load (loadfile_bfd)
              lma = s->lma;
 
              /* Is this really necessary?  I guess it gives the user something
-                to look at during a long download.  */
+                to look at during a long download.  */
              printf ("Loading section %s, size 0x%lx lma 0x%lx\n",
                      bfd_get_section_name (loadfile_bfd, s),
                      (unsigned long) size,
-                     (unsigned long) lma); /* chops high 32 bits.  FIXME!! */
+                     (unsigned long) lma);     /* chops high 32 bits.  FIXME!! */
 
              bfd_get_section_contents (loadfile_bfd, s, buffer, 0, size);
 
@@ -75,11 +76,11 @@ generic_load (loadfile_bfd)
     }
 
   printf ("Start address 0x%lx\n",
-         (unsigned long)loadfile_bfd->start_address);
+         (unsigned long) loadfile_bfd->start_address);
 
   /* We were doing this in remote-mips.c, I suspect it is right
      for other targets too.  */
-  /* write_pc (loadfile_bfd->start_address); */        /* FIXME!! */
+  /* write_pc (loadfile_bfd->start_address); *//* FIXME!! */
 }
 
 int
@@ -95,9 +96,9 @@ create_inferior (program, argv)
 #endif
 
   abfd = bfd_openr (program, 0);
-  if (!abfd) 
+  if (!abfd)
     {
-      fprintf (stderr, "gdbserver: can't open %s: %s\n", 
+      fprintf (stderr, "gdbserver: can't open %s: %s\n",
               program, bfd_errmsg (bfd_get_error ()));
       exit (1);
     }
@@ -166,7 +167,7 @@ fetch_inferior_registers (regno)
      int regno;
 {
   if (regno == -1 || regno == 0)
-    for (regno = 0; regno < NUM_REGS/*-NUM_FREGS*/; regno++)
+    for (regno = 0; regno < NUM_REGS /*-NUM_FREGS*/ ; regno++)
       fetch_register (regno);
   else
     fetch_register (regno);
@@ -180,7 +181,7 @@ void
 store_inferior_registers (regno)
      int regno;
 {
-  if (regno  == -1) 
+  if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
        store_inferior_registers (regno);
@@ -224,7 +225,7 @@ mywait (status)
       return sigrc;
 #endif
 
-    default:   /* should this be sim_signalled or sim_stopped?  FIXME!! */
+    default:                   /* should this be sim_signalled or sim_stopped?  FIXME!! */
       if (remote_debug)
        printf ("\nChild received signal = %x \n", sigrc);
       fetch_inferior_registers (0);
@@ -270,7 +271,7 @@ write_inferior_memory (memaddr, myaddr, len)
      char *myaddr;
      int len;
 {
-  sim_write (gdbsim_desc, memaddr, myaddr, len);  /* should check for error.  FIXME!! */
+  sim_write (gdbsim_desc, memaddr, myaddr, len);       /* should check for error.  FIXME!! */
   return 0;
 }
 
index ddffaec59276be254c4275a1e861452c0bd56140..9dd70a25079ee4891a775e979e8537780e710688 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for the remote server for GDB.
    Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <sys/wait.h>
@@ -95,7 +96,7 @@ kill_inferior ()
     return;
   ptrace (8, inferior_pid, 0, 0);
   wait (0);
-  /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
 }
 
 /* Return nonzero if the given thread is still alive.  */
@@ -172,32 +173,32 @@ fetch_inferior_registers (ignored)
      to the stack pointer.  */
 
   if (ptrace (PTRACE_GETREGS, inferior_pid,
-             (PTRACE_ARG3_TYPE) &inferior_registers, 0))
-    perror("ptrace_getregs");
-      
+             (PTRACE_ARG3_TYPE) & inferior_registers, 0))
+    perror ("ptrace_getregs");
+
   registers[REGISTER_BYTE (0)] = 0;
   memcpy (&registers[REGISTER_BYTE (1)], &inferior_registers.r_g1,
          15 * REGISTER_RAW_SIZE (G0_REGNUM));
-  *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; 
-  *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-  *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
-  *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
+  *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+  *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+  *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
+  *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
 
   /* Floating point registers */
 
   if (ptrace (PTRACE_GETFPREGS, inferior_pid,
-             (PTRACE_ARG3_TYPE) &inferior_fp_registers,
+             (PTRACE_ARG3_TYPE) & inferior_fp_registers,
              0))
-    perror("ptrace_getfpregs");
+    perror ("ptrace_getfpregs");
   memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
          sizeof inferior_fp_registers.fpu_fr);
 
   /* These regs are saved on the stack by the kernel.  Only read them
      all (16 ptrace calls!) if we really need them.  */
 
-  read_inferior_memory (*(CORE_ADDR*)&registers[REGISTER_BYTE (SP_REGNUM)],
+  read_inferior_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)],
                        &registers[REGISTER_BYTE (L0_REGNUM)],
-                       16*REGISTER_RAW_SIZE (L0_REGNUM));
+                       16 * REGISTER_RAW_SIZE (L0_REGNUM));
 }
 
 /* Store our register values back into the inferior.
@@ -210,33 +211,33 @@ store_inferior_registers (ignored)
 {
   struct regs inferior_registers;
   struct fp_status inferior_fp_registers;
-  CORE_ADDR sp = *(CORE_ADDR *)&registers[REGISTER_BYTE (SP_REGNUM)];
+  CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
 
   write_inferior_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
-                        16*REGISTER_RAW_SIZE (L0_REGNUM));
+                        16 * REGISTER_RAW_SIZE (L0_REGNUM));
 
   memcpy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (G1_REGNUM)],
          15 * REGISTER_RAW_SIZE (G1_REGNUM));
 
   inferior_registers.r_ps =
-    *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
+    *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
   inferior_registers.r_pc =
-    *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+    *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
   inferior_registers.r_npc =
-    *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)];
+    *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
   inferior_registers.r_y =
-    *(int *)&registers[REGISTER_BYTE (Y_REGNUM)];
+    *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
 
   if (ptrace (PTRACE_SETREGS, inferior_pid,
-             (PTRACE_ARG3_TYPE) &inferior_registers, 0))
-    perror("ptrace_setregs");
+             (PTRACE_ARG3_TYPE) & inferior_registers, 0))
+    perror ("ptrace_setregs");
 
   memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
          sizeof inferior_fp_registers.fpu_fr);
 
   if (ptrace (PTRACE_SETFPREGS, inferior_pid,
-             (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0))
-    perror("ptrace_setfpregs");
+             (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
+    perror ("ptrace_setfpregs");
 }
 
 /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
index c84b79f2f684b3edcdf49e6d5956f1fa787df633..11f1d8ac2383376491c8aad002f2a6ecc989eb67 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for the remote server for GDB.
    Copyright (C) 1986, 1987, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "<sys/wait.h>"
@@ -92,7 +93,7 @@ kill_inferior ()
     return;
   ptrace (8, inferior_pid, 0, 0);
   wait (0);
-  /*************inferior_died ();****VK**************/
+/*************inferior_died ();****VK**************/
 }
 
 /* Return nonzero if the given thread is still alive.  */
@@ -162,25 +163,25 @@ fetch_inferior_registers (ignored)
   struct fp_status inferior_fp_registers;
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
 #ifdef FP0_REGNUM
   ptrace (PTRACE_GETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
-#endif 
-  
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
+#endif
+
   memcpy (registers, &inferior_registers, 16 * 4);
 #ifdef FP0_REGNUM
   memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
          sizeof inferior_fp_registers.fps_regs);
-#endif 
-  *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
-  *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+#endif
+  *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+  *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
 #ifdef FP0_REGNUM
   memcpy
     (&registers[REGISTER_BYTE (FPC_REGNUM)],
      &inferior_fp_registers.fps_control,
      sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif 
+#endif
 }
 
 /* Store our register values back into the inferior.
@@ -200,8 +201,8 @@ store_inferior_registers (ignored)
          &registers[REGISTER_BYTE (FP0_REGNUM)],
          sizeof inferior_fp_registers.fps_regs);
 #endif
-  inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
-  inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+  inferior_registers.r_ps = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
+  inferior_registers.r_pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
 
 #ifdef FP0_REGNUM
   memcpy (&inferior_fp_registers.fps_control,
@@ -211,10 +212,10 @@ store_inferior_registers (ignored)
 #endif
 
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
 #if FP0_REGNUM
   ptrace (PTRACE_SETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 #endif
 }
 
index 0a7e0fbc7978886d7e6ed1a12f3b3545731988f5..4dab2abb8d570e5775bbb4a860faafcdf4577557 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote utility routines for the remote server for GDB.
    Copyright (C) 1986, 1989, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "server.h"
 #include "terminal.h"
@@ -53,17 +54,17 @@ remote_open (name)
 #ifdef HAVE_TERMIOS
       {
        struct termios termios;
-       tcgetattr(remote_desc, &termios);
+       tcgetattr (remote_desc, &termios);
 
        termios.c_iflag = 0;
        termios.c_oflag = 0;
        termios.c_lflag = 0;
-       termios.c_cflag &= ~(CSIZE|PARENB);
+       termios.c_cflag &= ~(CSIZE | PARENB);
        termios.c_cflag |= CLOCAL | CS8;
        termios.c_cc[VMIN] = 0;
        termios.c_cc[VTIME] = 0;
 
-       tcsetattr(remote_desc, TCSANOW, &termios);
+       tcsetattr (remote_desc, TCSANOW, &termios);
       }
 #endif
 
@@ -75,7 +76,7 @@ remote_open (name)
        termio.c_iflag = 0;
        termio.c_oflag = 0;
        termio.c_lflag = 0;
-       termio.c_cflag &= ~(CSIZE|PARENB);
+       termio.c_cflag &= ~(CSIZE | PARENB);
        termio.c_cflag |= CLOCAL | CS8;
        termio.c_cc[VMIN] = 0;
        termio.c_cc[VTIME] = 0;
@@ -115,19 +116,19 @@ remote_open (name)
 
       /* Allow rapid reuse of this port. */
       tmp = 1;
-      setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *)&tmp,
-                 sizeof(tmp));
+      setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp,
+                 sizeof (tmp));
 
       sockaddr.sin_family = PF_INET;
-      sockaddr.sin_port = htons(port);
+      sockaddr.sin_port = htons (port);
       sockaddr.sin_addr.s_addr = INADDR_ANY;
 
-      if (bind (tmp_desc, (struct sockaddr *)&sockaddr, sizeof (sockaddr))
+      if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr))
          || listen (tmp_desc, 1))
        perror_with_name ("Can't bind address");
 
       tmp = sizeof (sockaddr);
-      remote_desc = accept (tmp_desc, (struct sockaddr *)&sockaddr, &tmp);
+      remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp);
       if (remote_desc == -1)
        perror_with_name ("Accept failed");
 
@@ -137,18 +138,18 @@ remote_open (name)
 
       /* Enable TCP keep alive process. */
       tmp = 1;
-      setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *)&tmp, sizeof(tmp));
+      setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
 
       /* Tell TCP not to delay small packets.  This greatly speeds up
-        interactive response. */
+         interactive response. */
       tmp = 1;
       setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
-                 (char *)&tmp, sizeof(tmp));
+                 (char *) &tmp, sizeof (tmp));
 
       close (tmp_desc);                /* No longer need this */
 
-      signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbserver simply
-                                   exits when the remote side dies.  */
+      signal (SIGPIPE, SIG_IGN);       /* If we don't do this, then gdbserver simply
+                                          exits when the remote side dies.  */
     }
 
 #if defined(F_SETFL) && defined (FASYNC)
@@ -160,7 +161,7 @@ remote_open (name)
 }
 
 void
-remote_close()
+remote_close ()
 {
   close (remote_desc);
 }
@@ -260,7 +261,7 @@ putpkt (buf)
    will cause us to send a SIGINT to the child.  */
 
 static void
-input_interrupt()
+input_interrupt ()
 {
   int cc;
   char c;
@@ -269,7 +270,7 @@ input_interrupt()
 
   if (cc != 1 || c != '\003')
     {
-      fprintf(stderr, "input_interrupt, cc = %d c = %d\n", cc, c);
+      fprintf (stderr, "input_interrupt, cc = %d c = %d\n", cc, c);
       return;
     }
 
@@ -277,13 +278,13 @@ input_interrupt()
 }
 
 void
-enable_async_io()
+enable_async_io ()
 {
   signal (SIGIO, input_interrupt);
 }
 
 void
-disable_async_io()
+disable_async_io ()
 {
   signal (SIGIO, SIG_IGN);
 }
@@ -358,7 +359,7 @@ getpkt (buf)
 
       c1 = fromhex (readchar ());
       c2 = fromhex (readchar ());
-      
+
       if (csum == (c1 << 4) + c2)
        break;
 
@@ -430,7 +431,7 @@ convert_ascii_to_int (from, to, n)
 }
 
 static char *
-outreg(regno, buf)
+outreg (regno, buf)
      int regno;
      char *buf;
 {
@@ -479,7 +480,7 @@ prepare_resume_reply (buf, status, signo)
 #endif
 
       /* 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.  */
+         threads.  If we didn't check this, GDB 4.13 and older would choke.  */
       if (cont_thread != 0)
        {
          if (old_thread_from_wait != thread_from_wait)
index cdec0f8a93135cd10e0af34e3d6c552db2784998..66afb888efdf81e8349d724d009e49d6aa6fbbf6 100644 (file)
@@ -1,21 +1,22 @@
 /* Main code for remote server for GDB.
    Copyright (C) 1989, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "server.h"
 
@@ -52,14 +53,14 @@ main (argc, argv)
   unsigned int len;
   CORE_ADDR mem_addr;
 
-  if (setjmp(toplevel))
+  if (setjmp (toplevel))
     {
-      fprintf(stderr, "Exiting\n");
-      exit(1);
+      fprintf (stderr, "Exiting\n");
+      exit (1);
     }
 
   if (argc < 3)
-    error("Usage: gdbserver tty prog [args ...]");
+    error ("Usage: gdbserver tty prog [args ...]");
 
   /* Wait till we are at first instruction in program.  */
   signal = start_inferior (&argv[2], &status);
@@ -70,8 +71,8 @@ main (argc, argv)
     {
       remote_open (argv[1]);
 
-restart:
-      setjmp(toplevel);
+    restart:
+      setjmp (toplevel);
       while (getpkt (own_buf) > 0)
        {
          unsigned char sig;
@@ -154,7 +155,7 @@ restart:
              fprintf (stderr, "Killing inferior\n");
              kill_inferior ();
              /* When using the extended protocol, we start up a new
-                debugging session.   The traditional protocol will
+                debugging session.   The traditional protocol will
                 exit instead.  */
              if (extended_protocol)
                {
@@ -179,7 +180,7 @@ restart:
              break;
            case 'R':
              /* Restarting the inferior is only supported in the
-                extended protocol.  */
+                extended protocol.  */
              if (extended_protocol)
                {
                  kill_inferior ();
@@ -201,8 +202,8 @@ restart:
                }
            default:
              /* It is a request we don't understand.  Respond with an
-                empty packet so that gdb knows that we don't support this
-                request.  */
+                empty packet so that gdb knows that we don't support this
+                request.  */
              own_buf[0] = '\0';
              break;
            }
@@ -238,11 +239,11 @@ restart:
 
       /* We come here when getpkt fails.
 
-        For the extended remote protocol we exit (and this is the only
-        way we gracefully exit!).
+         For the extended remote protocol we exit (and this is the only
+         way we gracefully exit!).
 
-        For the traditional remote protocol close the connection,
-        and re-open it at the top of the loop.  */
+         For the traditional remote protocol close the connection,
+         and re-open it at the top of the loop.  */
       if (extended_protocol)
        {
          remote_close ();
index e23c773a60b81b450c09daaa4c2a0475272d9918..bfc89c7bbb7087f35a0098a1a69a3f594d6c1d0a 100644 (file)
@@ -1,21 +1,22 @@
 /* Common definitions for remote server for GDB.
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <setjmp.h>
@@ -61,10 +62,10 @@ void convert_ascii_to_int PARAMS ((char *from, char *to, int n));
 void convert_int_to_ascii PARAMS ((char *from, char *to, int n));
 void prepare_resume_reply PARAMS ((char *buf, char status, unsigned char sig));
 
-void decode_m_packet PARAMS ((char *from, CORE_ADDR *mem_addr_ptr,
-                            unsigned int *len_ptr));
-void decode_M_packet PARAMS ((char *from, CORE_ADDR *mem_addr_ptr,
-                            unsigned int *len_ptr, char *to));
+void decode_m_packet PARAMS ((char *from, CORE_ADDR * mem_addr_ptr,
+                             unsigned int *len_ptr));
+void decode_M_packet PARAMS ((char *from, CORE_ADDR * mem_addr_ptr,
+                             unsigned int *len_ptr, char *to));
 
 
 /* Functions from utils.c */
index 63d522c95a9a76a6b3a823948a98bde858f31cca..ecff057ac48daa3a329b5fa280105193d05e9c70 100644 (file)
@@ -1,21 +1,22 @@
 /* General utility routines for the remote server for GDB.
    Copyright (C) 1986, 1989, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "server.h"
 #include <stdio.h>
@@ -56,7 +57,7 @@ perror_with_name (string)
 
 #ifdef ANSI_PROTOTYPES
 NORETURN void
-error (const char *string, ...)
+error (const char *string,...)
 #else
 void
 error (va_alist)
@@ -82,7 +83,7 @@ error (va_alist)
   }
 #endif
   fprintf (stderr, "\n");
-  longjmp(toplevel, 1);
+  longjmp (toplevel, 1);
 }
 
 /* Print an error message and exit reporting failure.
@@ -92,7 +93,7 @@ error (va_alist)
 /* VARARGS */
 NORETURN void
 #ifdef ANSI_PROTOTYPES
-fatal (char *string, ...)
+fatal (char *string,...)
 #else
 fatal (va_alist)
      va_dcl
index c3829e3d129e73e2df36c73e4b84e95d1db8564e..9010d39b48196d7bb72240499778285f5dd39305 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Lynx Real-Time Systems, Inc.  Los Gatos, CA.
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef GDBTHREAD_H
 #define GDBTHREAD_H
@@ -31,7 +32,7 @@ extern void init_thread_list PARAMS ((void));
 extern void add_thread PARAMS ((int pid));
 
 extern void delete_thread PARAMS ((int));
-  
+
 extern int thread_id_to_pid PARAMS ((int));
 
 extern int in_thread_list PARAMS ((int pid));
@@ -43,16 +44,16 @@ extern int valid_thread_id PARAMS ((int thread));
 extern void load_infrun_state PARAMS ((int, CORE_ADDR *, CORE_ADDR *, char **,
                                       int *, struct breakpoint **,
                                       struct breakpoint **, CORE_ADDR *,
-                                      CORE_ADDR *, CORE_ADDR *, int *, int *,
-                                       int *, bpstat *, int *));
+                                    CORE_ADDR *, CORE_ADDR *, int *, int *,
+                                      int *, bpstat *, int *));
 
 extern void save_infrun_state PARAMS ((int, CORE_ADDR, CORE_ADDR, char *,
                                       int, struct breakpoint *,
                                       struct breakpoint *, CORE_ADDR,
                                       CORE_ADDR, CORE_ADDR, int, int,
-                                       int, bpstat, int));
+                                      int, bpstat, int));
 
 /* Commands with a prefix of `thread'.  */
 extern struct cmd_list_element *thread_cmd_list;
 
-#endif /* GDBTHREAD_H */
+#endif /* GDBTHREAD_H */
index dc026a4159d16c93862f0e805ce23970a29970da..6e013af43e703d4347a6d736a06a9a626e9fcbff 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -68,7 +69,11 @@ struct type *builtin_type_bool;
 int opaque_type_resolution = 1;
 
 
-struct extra { char str[128]; int len; }; /* maximum extention is 128! FIXME */
+struct extra
+  {
+    char str[128];
+    int len;
+  };                           /* maximum extention is 128! FIXME */
 
 static void add_name PARAMS ((struct extra *, char *));
 static void add_mangled_type PARAMS ((struct extra *, struct type *));
@@ -79,7 +84,7 @@ static void print_bit_vector PARAMS ((B_TYPE *, int));
 static void print_arg_types PARAMS ((struct type **, int));
 static void dump_fn_fieldlists PARAMS ((struct type *, int));
 static void print_cplus_stuff PARAMS ((struct type *, int));
-static void virtual_base_list_aux PARAMS ((struct type *dclass));
+static void virtual_base_list_aux PARAMS ((struct type * dclass));
 
 
 /* Alloc a new type structure and fill it with some defaults.  If
@@ -96,12 +101,12 @@ alloc_type (objfile)
 
   if (objfile == NULL)
     {
-      type  = (struct type *) xmalloc (sizeof (struct type));
+      type = (struct type *) xmalloc (sizeof (struct type));
     }
   else
     {
-      type  = (struct type *) obstack_alloc (&objfile -> type_obstack,
-                                            sizeof (struct type));
+      type = (struct type *) obstack_alloc (&objfile->type_obstack,
+                                           sizeof (struct type));
       OBJSTAT (objfile, n_types++);
     }
   memset ((char *) type, 0, sizeof (struct type));
@@ -111,7 +116,7 @@ alloc_type (objfile)
   TYPE_CODE (type) = TYPE_CODE_UNDEF;
   TYPE_OBJFILE (type) = objfile;
   TYPE_VPTR_FIELDNO (type) = -1;
-  TYPE_CV_TYPE (type) = type;  /* chain back to itself */ 
+  TYPE_CV_TYPE (type) = type;  /* chain back to itself */
 
   return (type);
 }
@@ -126,20 +131,20 @@ make_pointer_type (type, typeptr)
      struct type *type;
      struct type **typeptr;
 {
-  register struct type *ntype;         /* New type */
+  register struct type *ntype; /* New type */
   struct objfile *objfile;
 
   ntype = TYPE_POINTER_TYPE (type);
 
-  if (ntype) 
+  if (ntype)
     {
-      if (typeptr == 0)                
-        return ntype;  /* Don't care about alloc, and have new type.  */
+      if (typeptr == 0)
+       return ntype;           /* Don't care about alloc, and have new type.  */
       else if (*typeptr == 0)
-        {
+       {
          *typeptr = ntype;     /* Tracking alloc, and we have new type.  */
          return ntype;
-        }
+       }
     }
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
@@ -148,7 +153,8 @@ make_pointer_type (type, typeptr)
       if (typeptr)
        *typeptr = ntype;
     }
-  else                         /* We have storage, but need to reset it.  */
+  else
+    /* We have storage, but need to reset it.  */
     {
       ntype = *typeptr;
       objfile = TYPE_OBJFILE (ntype);
@@ -166,7 +172,7 @@ make_pointer_type (type, typeptr)
 
   /* pointers are unsigned */
   TYPE_FLAGS (ntype) |= TYPE_FLAG_UNSIGNED;
-  
+
   if (!TYPE_POINTER_TYPE (type))       /* Remember it, if don't have one.  */
     TYPE_POINTER_TYPE (type) = ntype;
 
@@ -180,7 +186,7 @@ struct type *
 lookup_pointer_type (type)
      struct type *type;
 {
-  return make_pointer_type (type, (struct type **)0);
+  return make_pointer_type (type, (struct type **) 0);
 }
 
 /* Lookup a C++ `reference' to a type TYPE.  TYPEPTR, if nonzero, points
@@ -193,20 +199,20 @@ make_reference_type (type, typeptr)
      struct type *type;
      struct type **typeptr;
 {
-  register struct type *ntype;         /* New type */
+  register struct type *ntype; /* New type */
   struct objfile *objfile;
 
   ntype = TYPE_REFERENCE_TYPE (type);
 
-  if (ntype) 
+  if (ntype)
     {
-      if (typeptr == 0)                
-        return ntype;  /* Don't care about alloc, and have new type.  */
+      if (typeptr == 0)
+       return ntype;           /* Don't care about alloc, and have new type.  */
       else if (*typeptr == 0)
-        {
+       {
          *typeptr = ntype;     /* Tracking alloc, and we have new type.  */
          return ntype;
-        }
+       }
     }
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
@@ -215,7 +221,8 @@ make_reference_type (type, typeptr)
       if (typeptr)
        *typeptr = ntype;
     }
-  else                         /* We have storage, but need to reset it.  */
+  else
+    /* We have storage, but need to reset it.  */
     {
       ntype = *typeptr;
       objfile = TYPE_OBJFILE (ntype);
@@ -231,7 +238,7 @@ make_reference_type (type, typeptr)
 
   TYPE_LENGTH (ntype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
   TYPE_CODE (ntype) = TYPE_CODE_REF;
-  
+
   if (!TYPE_REFERENCE_TYPE (type))     /* Remember it, if don't have one.  */
     TYPE_REFERENCE_TYPE (type) = ntype;
 
@@ -244,7 +251,7 @@ struct type *
 lookup_reference_type (type)
      struct type *type;
 {
-  return make_reference_type (type, (struct type **)0);
+  return make_reference_type (type, (struct type **) 0);
 }
 
 /* Lookup a function type that returns type TYPE.  TYPEPTR, if nonzero, points
@@ -257,7 +264,7 @@ make_function_type (type, typeptr)
      struct type *type;
      struct type **typeptr;
 {
-  register struct type *ntype;         /* New type */
+  register struct type *ntype; /* New type */
   struct objfile *objfile;
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
@@ -266,7 +273,8 @@ make_function_type (type, typeptr)
       if (typeptr)
        *typeptr = ntype;
     }
-  else                         /* We have storage, but need to reset it.  */
+  else
+    /* We have storage, but need to reset it.  */
     {
       ntype = *typeptr;
       objfile = TYPE_OBJFILE (ntype);
@@ -278,7 +286,7 @@ make_function_type (type, typeptr)
 
   TYPE_LENGTH (ntype) = 1;
   TYPE_CODE (ntype) = TYPE_CODE_FUNC;
-  
+
   return ntype;
 }
 
@@ -290,7 +298,7 @@ struct type *
 lookup_function_type (type)
      struct type *type;
 {
-  return make_function_type (type, (struct type **)0);
+  return make_function_type (type, (struct type **) 0);
 }
 
 
@@ -311,8 +319,8 @@ make_cv_type (cnst, voltl, type, typeptr)
      struct type *type;
      struct type **typeptr;
 {
-  register struct type *ntype;          /* New type */
-  register struct type *tmp_type = type; /* tmp type */
+  register struct type *ntype; /* New type */
+  register struct type *tmp_type = type;       /* tmp type */
   struct objfile *objfile;
 
   ntype = TYPE_CV_TYPE (type);
@@ -320,16 +328,16 @@ make_cv_type (cnst, voltl, type, typeptr)
   while (ntype != type)
     {
       if ((TYPE_CONST (ntype) == cnst) &&
-          (TYPE_VOLATILE (ntype) == voltl))
-          {
-            if (typeptr == 0)
-              return ntype;
-            else if (*typeptr == 0)
-              {
-                *typeptr = ntype;      /* Tracking alloc, and we have new type.  */
-                return ntype;
-              }
-          }
+         (TYPE_VOLATILE (ntype) == voltl))
+       {
+         if (typeptr == 0)
+           return ntype;
+         else if (*typeptr == 0)
+           {
+             *typeptr = ntype; /* Tracking alloc, and we have new type.  */
+             return ntype;
+           }
+       }
       tmp_type = ntype;
       ntype = TYPE_CV_TYPE (ntype);
     }
@@ -340,7 +348,8 @@ make_cv_type (cnst, voltl, type, typeptr)
       if (typeptr)
        *typeptr = ntype;
     }
-  else                         /* We have storage, but need to reset it.  */
+  else
+    /* We have storage, but need to reset it.  */
     {
       ntype = *typeptr;
       objfile = TYPE_OBJFILE (ntype);
@@ -348,23 +357,23 @@ make_cv_type (cnst, voltl, type, typeptr)
       TYPE_OBJFILE (ntype) = objfile;
     }
 
-  /* Copy original type */ 
+  /* Copy original type */
   memcpy ((char *) ntype, (char *) type, sizeof (struct type));
   /* But zero out fields that shouldn't be copied */
-  TYPE_POINTER_TYPE (ntype) = (struct type *) 0;    /* Need new pointer kind */
-  TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0;  /* Need new referene kind */
+  TYPE_POINTER_TYPE (ntype) = (struct type *) 0;       /* Need new pointer kind */
+  TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0;     /* Need new referene kind */
   /* Note: TYPE_TARGET_TYPE can be left as is */
 
   /* Set flags appropriately */
   if (cnst)
-    TYPE_FLAGS (ntype) |=  TYPE_FLAG_CONST;
+    TYPE_FLAGS (ntype) |= TYPE_FLAG_CONST;
   else
-    TYPE_FLAGS (ntype) &=  ~TYPE_FLAG_CONST;
+    TYPE_FLAGS (ntype) &= ~TYPE_FLAG_CONST;
 
   if (voltl)
-    TYPE_FLAGS (ntype) |=  TYPE_FLAG_VOLATILE;
+    TYPE_FLAGS (ntype) |= TYPE_FLAG_VOLATILE;
   else
-    TYPE_FLAGS (ntype) &=  ~TYPE_FLAG_VOLATILE;
+    TYPE_FLAGS (ntype) &= ~TYPE_FLAG_VOLATILE;
 
   /* Fix the chain of cv variants */
   TYPE_CV_TYPE (ntype) = type;
@@ -447,10 +456,10 @@ create_range_type (result_type, index_type, low_bound, high_bound)
   memset (TYPE_FIELDS (result_type), 0, 2 * sizeof (struct field));
   TYPE_FIELD_BITPOS (result_type, 0) = low_bound;
   TYPE_FIELD_BITPOS (result_type, 1) = high_bound;
-  TYPE_FIELD_TYPE (result_type, 0) = builtin_type_int;         /* FIXME */
-  TYPE_FIELD_TYPE (result_type, 1) = builtin_type_int;         /* FIXME */
+  TYPE_FIELD_TYPE (result_type, 0) = builtin_type_int; /* FIXME */
+  TYPE_FIELD_TYPE (result_type, 1) = builtin_type_int; /* FIXME */
 
-  if(low_bound >= 0)
+  if (low_bound >= 0)
     TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
 
   return (result_type);
@@ -489,7 +498,7 @@ get_discrete_bounds (type, lowp, highp)
            }
 
          /* Set unsigned indicator if warranted. */
-         if(*lowp >= 0)
+         if (*lowp >= 0)
            {
              TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
            }
@@ -505,11 +514,11 @@ get_discrete_bounds (type, lowp, highp)
       *highp = 1;
       return 0;
     case TYPE_CODE_INT:
-      if (TYPE_LENGTH (type) > sizeof (LONGEST))  /* Too big */
+      if (TYPE_LENGTH (type) > sizeof (LONGEST))       /* Too big */
        return -1;
       if (!TYPE_UNSIGNED (type))
        {
-         *lowp = - (1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
+         *lowp = -(1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
          *highp = -*lowp - 1;
          return 0;
        }
@@ -517,8 +526,8 @@ get_discrete_bounds (type, lowp, highp)
     case TYPE_CODE_CHAR:
       *lowp = 0;
       /* This round-about calculation is to avoid shifting by
-        TYPE_LENGTH (type) * TARGET_CHAR_BIT, which will not work
-        if TYPE_LENGTH (type) == sizeof (LONGEST). */
+         TYPE_LENGTH (type) * TARGET_CHAR_BIT, which will not work
+         if TYPE_LENGTH (type) == sizeof (LONGEST). */
       *highp = 1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1);
       *highp = (*highp - 1) | *highp;
       return 0;
@@ -608,7 +617,7 @@ create_set_type (result_type, domain_type)
     TYPE_ALLOC (result_type, 1 * sizeof (struct field));
   memset (TYPE_FIELDS (result_type), 0, sizeof (struct field));
 
-  if (! (TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB))
+  if (!(TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB))
     {
       if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0)
        low_bound = high_bound = 0;
@@ -618,7 +627,7 @@ create_set_type (result_type, domain_type)
     }
   TYPE_FIELD_TYPE (result_type, 0) = domain_type;
 
-  if(low_bound >= 0)
+  if (low_bound >= 0)
     TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
 
   return (result_type);
@@ -696,22 +705,22 @@ type_name_no_tag (type)
 }
 
 /* Lookup a primitive type named NAME. 
-   Return zero if NAME is not a primitive type.*/
+   Return zero if NAME is not a primitive type. */
 
 struct type *
 lookup_primitive_typename (name)
      char *name;
 {
-   struct type ** const *p;
-
-   for (p = current_language -> la_builtin_type_vector; *p != NULL; p++)
-     {
-       if (STREQ ((**p) -> name, name))
-        {
-          return (**p);
-        }
-     }
-   return (NULL); 
+  struct type **const *p;
+
+  for (p = current_language->la_builtin_type_vector; *p != NULL; p++)
+    {
+      if (STREQ ((**p)->name, name))
+       {
+         return (**p);
+       }
+    }
+  return (NULL);
 }
 
 /* Lookup a typedef or primitive type named NAME,
@@ -807,7 +816,7 @@ lookup_union (name, block)
      struct block *block;
 {
   register struct symbol *sym;
-  struct type * t;
+  struct type *t;
 
   sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
                       (struct symtab **) NULL);
@@ -815,7 +824,7 @@ lookup_union (name, block)
   if (sym == NULL)
     error ("No union type named %s.", name);
 
-  t = SYMBOL_TYPE(sym);
+  t = SYMBOL_TYPE (sym);
 
   if (TYPE_CODE (t) == TYPE_CODE_UNION)
     return (t);
@@ -823,8 +832,8 @@ lookup_union (name, block)
   /* C++ unions may come out with TYPE_CODE_CLASS, but we look at
    * a further "declared_type" field to discover it is really a union.
    */
-  if (HAVE_CPLUS_STRUCT (t)) 
-    if (TYPE_DECLARED_TYPE(t) == DECLARED_TYPE_UNION) 
+  if (HAVE_CPLUS_STRUCT (t))
+    if (TYPE_DECLARED_TYPE (t) == DECLARED_TYPE_UNION)
       return (t);
 
   /* If we get here, it's not a union */
@@ -842,7 +851,7 @@ lookup_enum (name, block)
 {
   register struct symbol *sym;
 
-  sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, 
+  sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
                       (struct symtab **) NULL);
   if (sym == NULL)
     {
@@ -865,13 +874,13 @@ lookup_template_type (name, type, block)
      struct block *block;
 {
   struct symbol *sym;
-  char *nam = (char*) alloca(strlen(name) + strlen(type->name) + 4);
+  char *nam = (char *) alloca (strlen (name) + strlen (type->name) + 4);
   strcpy (nam, name);
   strcat (nam, "<");
   strcat (nam, type->name);
-  strcat (nam, " >");  /* FIXME, extra space still introduced in gcc? */
+  strcat (nam, " >");          /* FIXME, extra space still introduced in gcc? */
 
-  sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **)NULL);
+  sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **) NULL);
 
   if (sym == NULL)
     {
@@ -898,7 +907,7 @@ struct type *
 lookup_struct_elt_type (type, name, noerr)
      struct type *type;
      char *name;
-    int noerr;
+     int noerr;
 {
   int i;
 
@@ -961,7 +970,7 @@ lookup_struct_elt_type (type, name, noerr)
     {
       return NULL;
     }
-  
+
   target_terminal_ours ();
   gdb_flush (gdb_stdout);
   fprintf_unfiltered (gdb_stderr, "Type ");
@@ -969,7 +978,7 @@ lookup_struct_elt_type (type, name, noerr)
   fprintf_unfiltered (gdb_stderr, " has no component named ");
   fputs_filtered (name, gdb_stderr);
   error (".");
-  return (struct type *)-1;    /* For lint */
+  return (struct type *) -1;   /* For lint */
 }
 
 /* If possible, make the vptr_fieldno and vptr_basetype fields of TYPE
@@ -990,7 +999,7 @@ fill_in_vptr_fieldno (type)
       int i;
 
       /* We must start at zero in case the first (and only) baseclass is
-        virtual (and hence we cannot share the table pointer).  */
+         virtual (and hence we cannot share the table pointer).  */
       for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
        {
          fill_in_vptr_fieldno (TYPE_BASECLASS (type, i));
@@ -1049,7 +1058,7 @@ get_destructor_fn_field (t, method_indexp, field_indexp)
    often enough to merit such treatment.  */
 
 struct complaint stub_noname_complaint =
-  {"stub type has NULL name", 0, 0};
+{"stub type has NULL name", 0, 0};
 
 struct type *
 check_typedef (type)
@@ -1060,7 +1069,7 @@ check_typedef (type)
     {
       if (!TYPE_TARGET_TYPE (type))
        {
-         charname;
+         char *name;
          struct symbol *sym;
 
          /* It is dangerous to call lookup_symbol if we are currently
@@ -1078,12 +1087,12 @@ check_typedef (type)
              complain (&stub_noname_complaint);
              return type;
            }
-         sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, 
+         sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
                               (struct symtab **) NULL);
          if (sym)
            TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
          else
-           TYPE_TARGET_TYPE (type) = alloc_type (NULL);  /* TYPE_CODE_UNDEF */
+           TYPE_TARGET_TYPE (type) = alloc_type (NULL);        /* TYPE_CODE_UNDEF */
        }
       type = TYPE_TARGET_TYPE (type);
     }
@@ -1091,12 +1100,12 @@ check_typedef (type)
   /* If this is a struct/class/union with no fields, then check whether a
      full definition exists somewhere else.  This is for systems where a
      type definition with no fields is issued for such types, instead of
-     identifying them as stub types in the first place */ 
-     
+     identifying them as stub types in the first place */
+
   if (TYPE_IS_OPAQUE (type) && opaque_type_resolution && !currently_reading_symtab)
     {
-      char * name = type_name_no_tag (type);
-      struct type * newtype;
+      char *name = type_name_no_tag (type);
+      struct type *newtype;
       if (name == NULL)
        {
          complain (&stub_noname_complaint);
@@ -1109,13 +1118,13 @@ check_typedef (type)
        }
     }
   /* Otherwise, rely on the stub flag being set for opaque/stubbed types */
-  else if ((TYPE_FLAGS(type) & TYPE_FLAG_STUB) && ! currently_reading_symtab)
+  else if ((TYPE_FLAGS (type) & TYPE_FLAG_STUB) && !currently_reading_symtab)
     {
-      charname = type_name_no_tag (type);
+      char *name = type_name_no_tag (type);
       /* FIXME: shouldn't we separately check the TYPE_NAME and the
-        TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
-        as appropriate?  (this code was written before TYPE_NAME and
-        TYPE_TAG_NAME were separate).  */
+         TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
+         as appropriate?  (this code was written before TYPE_NAME and
+         TYPE_TAG_NAME were separate).  */
       struct symbol *sym;
       if (name == NULL)
        {
@@ -1125,7 +1134,7 @@ check_typedef (type)
       sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL);
       if (sym)
        {
-         memcpy ((char *)type, (char *)SYMBOL_TYPE(sym), sizeof (struct type));
+         memcpy ((char *) type, (char *) SYMBOL_TYPE (sym), sizeof (struct type));
        }
     }
 
@@ -1135,7 +1144,8 @@ check_typedef (type)
       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
 
       if (TYPE_FLAGS (target_type) & (TYPE_FLAG_STUB | TYPE_FLAG_TARGET_STUB))
-       { }
+       {
+       }
       else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
               && TYPE_NFIELDS (type) == 1
               && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
@@ -1166,51 +1176,51 @@ check_typedef (type)
 #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
 #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
 
-static void 
-add_name(pextras,n) 
-  struct extra * pextras;
-  char * n; 
+static void
+add_name (pextras, n)
+     struct extra *pextras;
+     char *n;
 {
   int nlen;
 
-  if ((nlen = (n ? strlen(n) : 0))==0) 
+  if ((nlen = (n ? strlen (n) : 0)) == 0)
     return;
-  sprintf(pextras->str+pextras->len,"%d%s",nlen,n);
-  pextras->len=strlen(pextras->str);
+  sprintf (pextras->str + pextras->len, "%d%s", nlen, n);
+  pextras->len = strlen (pextras->str);
 }
 
-static void 
-add_mangled_type(pextras,t) 
-  struct extra * pextras;
-  struct type * t;
+static void
+add_mangled_type (pextras, t)
+     struct extra *pextras;
+     struct type *t;
 {
   enum type_code tcode;
   int tlen, tflags;
-  char * tname;
+  char *tname;
 
-  tcode = TYPE_CODE(t);
-  tlen = TYPE_LENGTH(t);
-  tflags = TYPE_FLAGS(t);
-  tname = TYPE_NAME(t);
+  tcode = TYPE_CODE (t);
+  tlen = TYPE_LENGTH (t);
+  tflags = TYPE_FLAGS (t);
+  tname = TYPE_NAME (t);
   /* args of "..." seem to get mangled as "e" */
 
-  switch (tcode) 
-    {
-      case TYPE_CODE_INT: 
-        if (tflags==1)
-          ADD_EXTRA('U');
-        switch (tlen) 
-          {
-            case 1:
-              ADD_EXTRA('c');
-              break;
-            case 2:
-              ADD_EXTRA('s');
-              break;
-            case 4: 
-              {
-              char* pname;
-              if ((pname=strrchr(tname,'l'),pname) && !strcmp(pname,"long"))
+  switch (tcode)
+    {
+    case TYPE_CODE_INT:
+      if (tflags == 1)
+       ADD_EXTRA ('U');
+      switch (tlen)
+       {
+       case 1:
+         ADD_EXTRA ('c');
+         break;
+       case 2:
+         ADD_EXTRA ('s');
+         break;
+       case 4:
+         {
+           char *pname;
+           if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long"))
              {
                ADD_EXTRA ('l');
              }
@@ -1218,145 +1228,150 @@ add_mangled_type(pextras,t)
              {
                ADD_EXTRA ('i');
              }
-             }
-              break;
-            default: 
-              {
-          
-                static struct complaint msg = {"Bad int type code length x%x\n",0,0};
-          
-                complain (&msg, tlen);
-          
-              }
-          }
-        break;
-      case TYPE_CODE_FLT: 
-          switch (tlen) 
-            {
-              case 4:
-                ADD_EXTRA('f');
-                break;
-              case 8:
-                ADD_EXTRA('d');
-                break;
-              case 16:
-                ADD_EXTRA('r');
-                break;
-              default: 
-               {
-                  static struct complaint msg = {"Bad float type code length x%x\n",0,0};
-                 complain (&msg, tlen);
-               }
-             }
-            break;
-      case TYPE_CODE_REF:
-        ADD_EXTRA('R');
-        /* followed by what it's a ref to */
-        break;
-      case TYPE_CODE_PTR:
-        ADD_EXTRA('P');
-        /* followed by what it's a ptr to */
-        break;
-      case TYPE_CODE_TYPEDEF: 
-        {
-          static struct complaint msg = {"Typedefs in overloaded functions not yet supported\n",0,0};
-          complain (&msg);
-        }
+         }
+         break;
+       default:
+         {
+
+           static struct complaint msg =
+           {"Bad int type code length x%x\n", 0, 0};
+
+           complain (&msg, tlen);
+
+         }
+       }
+      break;
+    case TYPE_CODE_FLT:
+      switch (tlen)
+       {
+       case 4:
+         ADD_EXTRA ('f');
+         break;
+       case 8:
+         ADD_EXTRA ('d');
+         break;
+       case 16:
+         ADD_EXTRA ('r');
+         break;
+       default:
+         {
+           static struct complaint msg =
+           {"Bad float type code length x%x\n", 0, 0};
+           complain (&msg, tlen);
+         }
+       }
+      break;
+    case TYPE_CODE_REF:
+      ADD_EXTRA ('R');
+      /* followed by what it's a ref to */
+      break;
+    case TYPE_CODE_PTR:
+      ADD_EXTRA ('P');
+      /* followed by what it's a ptr to */
+      break;
+    case TYPE_CODE_TYPEDEF:
+      {
+       static struct complaint msg =
+       {"Typedefs in overloaded functions not yet supported\n", 0, 0};
+       complain (&msg);
+      }
       /* followed by type bytes & name */
       break;
     case TYPE_CODE_FUNC:
-      ADD_EXTRA('F');
+      ADD_EXTRA ('F');
       /* followed by func's arg '_' & ret types */
       break;
     case TYPE_CODE_VOID:
-      ADD_EXTRA('v');
+      ADD_EXTRA ('v');
       break;
     case TYPE_CODE_METHOD:
-      ADD_EXTRA('M');
+      ADD_EXTRA ('M');
       /* followed by name of class and func's arg '_' & ret types */
-      add_name(pextras,tname);
-      ADD_EXTRA('F');  /* then mangle function */
+      add_name (pextras, tname);
+      ADD_EXTRA ('F');         /* then mangle function */
       break;
-    case TYPE_CODE_STRUCT: /* C struct */
-    case TYPE_CODE_UNION:  /* C union */
-    case TYPE_CODE_ENUM:   /* Enumeration type */
+    case TYPE_CODE_STRUCT:     /* C struct */
+    case TYPE_CODE_UNION:      /* C union */
+    case TYPE_CODE_ENUM:       /* Enumeration type */
       /* followed by name of type */
-      add_name(pextras,tname);
+      add_name (pextras, tname);
       break;
 
-    /* errors possible types/not supported */
-    case TYPE_CODE_CHAR:              
-    case TYPE_CODE_ARRAY:  /* Array type */
-    case TYPE_CODE_MEMBER: /* Member type */
+      /* errors possible types/not supported */
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_ARRAY:      /* Array type */
+    case TYPE_CODE_MEMBER:     /* Member type */
     case TYPE_CODE_BOOL:
-    case TYPE_CODE_COMPLEX:            /* Complex float */
+    case TYPE_CODE_COMPLEX:    /* Complex float */
     case TYPE_CODE_UNDEF:
-    case TYPE_CODE_SET:                /* Pascal sets */
-    case TYPE_CODE_RANGE:  
+    case TYPE_CODE_SET:        /* Pascal sets */
+    case TYPE_CODE_RANGE:
     case TYPE_CODE_STRING:
     case TYPE_CODE_BITSTRING:
     case TYPE_CODE_ERROR:
-    default: 
+    default:
       {
-        static struct complaint msg = {"Unknown type code x%x\n",0,0};
-        complain (&msg, tcode);
+       static struct complaint msg =
+       {"Unknown type code x%x\n", 0, 0};
+       complain (&msg, tcode);
       }
     }
   if (t->target_type)
-    add_mangled_type(pextras,t->target_type);
+    add_mangled_type (pextras, t->target_type);
 }
 
 #if 0
 void
-cfront_mangle_name(type, i, j)
+cfront_mangle_name (type, i, j)
      struct type *type;
      int i;
      int j;
 {
-   struct fn_field *f;
-   char *mangled_name = gdb_mangle_name (type, i, j);
-
-   f = TYPE_FN_FIELDLIST1 (type, i);   /* moved from below */
-
-   /* kludge to support cfront methods - gdb expects to find "F" for 
-      ARM_mangled names, so when we mangle, we have to add it here */
-   if (ARM_DEMANGLING) 
-     {
-       int k;
-       char * arm_mangled_name;
-       struct fn_field *method = &f[j];
-       char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
-        char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
-        char *newname = type_name_no_tag (type);
-
-        struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
-       int nargs = TYPE_NFIELDS(ftype);        /* number of args */
-       struct extra extras, * pextras = &extras;       
-       INIT_EXTRA
+  struct fn_field *f;
+  char *mangled_name = gdb_mangle_name (type, i, j);
+
+  f = TYPE_FN_FIELDLIST1 (type, i);    /* moved from below */
+
+  /* kludge to support cfront methods - gdb expects to find "F" for 
+     ARM_mangled names, so when we mangle, we have to add it here */
+  if (ARM_DEMANGLING)
+    {
+      int k;
+      char *arm_mangled_name;
+      struct fn_field *method = &f[j];
+      char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+      char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+      char *newname = type_name_no_tag (type);
+
+      struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
+      int nargs = TYPE_NFIELDS (ftype);                /* number of args */
+      struct extra extras, *pextras = &extras;
+      INIT_EXTRA
 
        if (TYPE_FN_FIELD_STATIC_P (f, j))      /* j for sublist within this list */
-         ADD_EXTRA('S')
-       ADD_EXTRA('F')
+       ADD_EXTRA ('S')
+         ADD_EXTRA ('F')
        /* add args here! */
-       if (nargs <= 1)                         /* no args besides this */
-               ADD_EXTRA('v')
-       else {
-         for (k=1; k<nargs; k++) 
-           {
-             struct type * t;
-             t = TYPE_FIELD_TYPE(ftype,k);
-             add_mangled_type(pextras,t);
-           }
-       }
-       ADD_EXTRA('\0')
-       printf("add_mangled_type: %s\n",extras.str); /* FIXME */
-       arm_mangled_name = malloc(strlen(mangled_name)+extras.len);
-        sprintf(arm_mangled_name,"%s%s",mangled_name,extras.str);
-       free(mangled_name);
-       mangled_name = arm_mangled_name;
-     }
+         if (nargs <= 1)       /* no args besides this */
+         ADD_EXTRA ('v')
+           else
+         {
+           for (k = 1; k < nargs; k++)
+             {
+               struct type *t;
+               t = TYPE_FIELD_TYPE (ftype, k);
+               add_mangled_type (pextras, t);
+             }
+         }
+      ADD_EXTRA ('\0')
+       printf ("add_mangled_type: %s\n", extras.str);  /* FIXME */
+      arm_mangled_name = malloc (strlen (mangled_name) + extras.len);
+      sprintf (arm_mangled_name, "%s%s", mangled_name, extras.str);
+      free (mangled_name);
+      mangled_name = arm_mangled_name;
+    }
 }
-#endif /* 0 */
+#endif /* 0 */
 
 #undef ADD_EXTRA
 /* End of new code added to support parsing of Cfront stabs strings */
@@ -1424,7 +1439,7 @@ check_stub_method (type, method_id, signature_id)
   argtypes[0] = lookup_pointer_type (type);
   argcount = 1;
 
-  if (*p != ')')                       /* () means no args, skip while */
+  if (*p != ')')               /* () means no args, skip while */
     {
       depth = 0;
       while (*p)
@@ -1435,7 +1450,7 @@ check_stub_method (type, method_id, signature_id)
              if (strncmp (argtypetext, "...", p - argtypetext) != 0)
                {
                  argtypes[argcount] =
-                     parse_and_eval_type (argtypetext, p - argtypetext);
+                   parse_and_eval_type (argtypetext, p - argtypetext);
                  argcount += 1;
                }
              argtypetext = p + 1;
@@ -1454,18 +1469,18 @@ check_stub_method (type, method_id, signature_id)
        }
     }
 
-  if (p[-2] != '.')                    /* Not '...' */
+  if (p[-2] != '.')            /* Not '...' */
     {
       argtypes[argcount] = builtin_type_void;  /* List terminator */
     }
   else
     {
-      argtypes[argcount] = NULL;               /* Ellist terminator */
+      argtypes[argcount] = NULL;       /* Ellist terminator */
     }
 
   free (demangled_name);
 
-  f = TYPE_FN_FIELDLIST1 (type, method_id);    
+  f = TYPE_FN_FIELDLIST1 (type, method_id);
 
   TYPE_FN_FIELD_PHYSNAME (f, signature_id) = mangled_name;
 
@@ -1487,7 +1502,7 @@ allocate_cplus_struct_type (type)
     {
       TYPE_CPLUS_SPECIFIC (type) = (struct cplus_struct_type *)
        TYPE_ALLOC (type, sizeof (struct cplus_struct_type));
-      *(TYPE_CPLUS_SPECIFIC(type)) = cplus_struct_default;
+      *(TYPE_CPLUS_SPECIFIC (type)) = cplus_struct_default;
     }
 }
 
@@ -1515,7 +1530,7 @@ init_type (code, length, flags, name, objfile)
   if ((name != NULL) && (objfile != NULL))
     {
       TYPE_NAME (type) =
-       obsavestring (name, strlen (name), &objfile -> type_obstack);
+       obsavestring (name, strlen (name), &objfile->type_obstack);
     }
   else
     {
@@ -1567,20 +1582,20 @@ lookup_fundamental_type (objfile, typeid)
 
   /* If this is the first time we need a fundamental type for this objfile
      then we need to initialize the vector of type pointers. */
-  
-  if (objfile -> fundamental_types == NULL)
+
+  if (objfile->fundamental_types == NULL)
     {
       nbytes = FT_NUM_MEMBERS * sizeof (struct type *);
-      objfile -> fundamental_types = (struct type **)
-       obstack_alloc (&objfile -> type_obstack, nbytes);
-      memset ((char *) objfile -> fundamental_types, 0, nbytes);
+      objfile->fundamental_types = (struct type **)
+       obstack_alloc (&objfile->type_obstack, nbytes);
+      memset ((char *) objfile->fundamental_types, 0, nbytes);
       OBJSTAT (objfile, n_types += FT_NUM_MEMBERS);
     }
 
   /* Look for this particular type in the fundamental type vector.  If one is
      not found, create and install one appropriate for the current language. */
 
-  typep = objfile -> fundamental_types + typeid;
+  typep = objfile->fundamental_types + typeid;
   if (*typep == NULL)
     {
       *typep = create_fundamental_type (objfile, typeid);
@@ -1626,11 +1641,11 @@ chill_varying_type (type)
 
 int
 is_ancestor (base, dclass)
-  struct type * base;
-  struct type * dclass;
+     struct type *base;
+     struct type *dclass;
 {
   int i;
-  
+
   CHECK_TYPEDEF (base);
   CHECK_TYPEDEF (dclass);
 
@@ -1652,50 +1667,50 @@ is_ancestor (base, dclass)
 
 int
 has_vtable (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
   /* In the HP ANSI C++ runtime model, a class has a vtable only if it
      has virtual functions or virtual bases.  */
 
   register int i;
 
-  if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
     return 0;
-  
+
   /* First check for the presence of virtual bases */
-  if (TYPE_FIELD_VIRTUAL_BITS(dclass))
-    for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
-      if (B_TST(TYPE_FIELD_VIRTUAL_BITS(dclass), i))
-        return 1;
-  
+  if (TYPE_FIELD_VIRTUAL_BITS (dclass))
+    for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+      if (B_TST (TYPE_FIELD_VIRTUAL_BITS (dclass), i))
+       return 1;
+
   /* Next check for virtual functions */
-  if (TYPE_FN_FIELDLISTS(dclass))
-    for (i=0; i < TYPE_NFN_FIELDS(dclass); i++)
-      if (TYPE_FN_FIELD_VIRTUAL_P(TYPE_FN_FIELDLIST1(dclass, i), 0))
-        return 1;
-
-  /* Recurse on non-virtual bases to see if any of them needs a vtable */ 
-  if (TYPE_FIELD_VIRTUAL_BITS(dclass))
-    for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
-      if ((!B_TST (TYPE_FIELD_VIRTUAL_BITS(dclass), i)) &&
-         (has_vtable (TYPE_FIELD_TYPE(dclass, i))))
+  if (TYPE_FN_FIELDLISTS (dclass))
+    for (i = 0; i < TYPE_NFN_FIELDS (dclass); i++)
+      if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (dclass, i), 0))
        return 1;
-  
-  /* Well, maybe we don't need a virtual table */ 
+
+  /* Recurse on non-virtual bases to see if any of them needs a vtable */
+  if (TYPE_FIELD_VIRTUAL_BITS (dclass))
+    for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+      if ((!B_TST (TYPE_FIELD_VIRTUAL_BITS (dclass), i)) &&
+         (has_vtable (TYPE_FIELD_TYPE (dclass, i))))
+       return 1;
+
+  /* Well, maybe we don't need a virtual table */
   return 0;
 }
 
 /* Return a pointer to the "primary base class" of DCLASS.
+
    A NULL return indicates that DCLASS has no primary base, or that it
    couldn't be found (insufficient information).
-  
+
    This routine is aimed at the HP/Taligent ANSI C++ runtime model,
    and may not work with other runtime models.  */
 
 struct type *
 primary_base_class (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
   /* In HP ANSI C++'s runtime model, a "primary base class" of a class
      is the first directly inherited, non-virtual base class that
@@ -1703,70 +1718,70 @@ primary_base_class (dclass)
 
   register int i;
 
-  if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
     return NULL;
 
-  for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
-    if (!TYPE_FIELD_VIRTUAL(dclass, i) &&
-        has_vtable(TYPE_FIELD_TYPE(dclass, i)))
-      return TYPE_FIELD_TYPE(dclass, i);
+  for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+    if (!TYPE_FIELD_VIRTUAL (dclass, i) &&
+       has_vtable (TYPE_FIELD_TYPE (dclass, i)))
+      return TYPE_FIELD_TYPE (dclass, i);
 
   return NULL;
 }
 
 /* Global manipulated by virtual_base_list[_aux]() */
 
-static struct vbase * current_vbase_list = NULL;
+static struct vbase *current_vbase_list = NULL;
 
 /* Return a pointer to a null-terminated list of struct vbase
    items. The vbasetype pointer of each item in the list points to the
    type information for a virtual base of the argument DCLASS.
-  
+
    Helper function for virtual_base_list(). 
    Note: the list goes backward, right-to-left. virtual_base_list()
    copies the items out in reverse order.  */
 
 static void
 virtual_base_list_aux (dclass)
-     struct type * dclass;
+     struct type *dclass;
 {
-  struct vbase * tmp_vbase;
+  struct vbase *tmp_vbase;
   register int i;
 
-  if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
     return;
 
   for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
     {
       /* Recurse on this ancestor, first */
-      virtual_base_list_aux(TYPE_FIELD_TYPE(dclass, i));
+      virtual_base_list_aux (TYPE_FIELD_TYPE (dclass, i));
 
       /* If this current base is itself virtual, add it to the list */
-      if (BASETYPE_VIA_VIRTUAL(dclass, i))
-        {
-          struct type * basetype = TYPE_FIELD_TYPE (dclass, i);
-          
-          /* Check if base already recorded */
-          tmp_vbase = current_vbase_list;
-          while (tmp_vbase)
-            {
-              if (tmp_vbase->vbasetype == basetype)
-                break; /* found it */
-              tmp_vbase = tmp_vbase->next;
-            }
-
-          if (!tmp_vbase) /* normal exit from loop */
-            {
-              /* Allocate new item for this virtual base */
-              tmp_vbase = (struct vbase *) xmalloc (sizeof (struct vbase));
-
-              /* Stick it on at the end of the list */
-              tmp_vbase->vbasetype = basetype;
-              tmp_vbase->next = current_vbase_list;
-              current_vbase_list = tmp_vbase;
-            }
-        } /* if virtual */
-    } /* for loop over bases */
+      if (BASETYPE_VIA_VIRTUAL (dclass, i))
+       {
+         struct type *basetype = TYPE_FIELD_TYPE (dclass, i);
+
+         /* Check if base already recorded */
+         tmp_vbase = current_vbase_list;
+         while (tmp_vbase)
+           {
+             if (tmp_vbase->vbasetype == basetype)
+               break;          /* found it */
+             tmp_vbase = tmp_vbase->next;
+           }
+
+         if (!tmp_vbase)       /* normal exit from loop */
+           {
+             /* Allocate new item for this virtual base */
+             tmp_vbase = (struct vbase *) xmalloc (sizeof (struct vbase));
+
+             /* Stick it on at the end of the list */
+             tmp_vbase->vbasetype = basetype;
+             tmp_vbase->next = current_vbase_list;
+             current_vbase_list = tmp_vbase;
+           }
+       }                       /* if virtual */
+    }                          /* for loop over bases */
 }
 
 
@@ -1774,38 +1789,38 @@ virtual_base_list_aux (dclass)
    bases are laid out in the object's memory area in order of their
    occurrence in a depth-first, left-to-right search through the
    ancestors.
-  
+
    Argument DCLASS is the type whose virtual bases are required.
    Return value is the address of a null-terminated array of pointers
    to struct type items.
-   
+
    This routine is aimed at the HP/Taligent ANSI C++ runtime model,
    and may not work with other runtime models.
-  
+
    This routine merely hands off the argument to virtual_base_list_aux()
    and then copies the result into an array to save space.  */
 
 struct type **
 virtual_base_list (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
-  register struct vbase * tmp_vbase;
-  register struct vbase * tmp_vbase_2;
+  register struct vbase *tmp_vbase;
+  register struct vbase *tmp_vbase_2;
   register int i;
   int count;
-  struct type ** vbase_array;
+  struct type **vbase_array;
 
   current_vbase_list = NULL;
-  virtual_base_list_aux(dclass);
+  virtual_base_list_aux (dclass);
 
-  for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
+  for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
     /* no body */ ;
 
   count = i;
 
-  vbase_array = (struct type **) xmalloc((count + 1) * sizeof (struct type *));
+  vbase_array = (struct type **) xmalloc ((count + 1) * sizeof (struct type *));
 
-  for (i=count -1, tmp_vbase = current_vbase_list; i >= 0; i--, tmp_vbase = tmp_vbase->next)
+  for (i = count - 1, tmp_vbase = current_vbase_list; i >= 0; i--, tmp_vbase = tmp_vbase->next)
     vbase_array[i] = tmp_vbase->vbasetype;
 
   /* Get rid of constructed chain */
@@ -1813,10 +1828,10 @@ virtual_base_list (dclass)
   while (tmp_vbase)
     {
       tmp_vbase = tmp_vbase->next;
-      free(tmp_vbase_2);
+      free (tmp_vbase_2);
       tmp_vbase_2 = tmp_vbase;
     }
-  
+
   vbase_array[count] = NULL;
   return vbase_array;
 }
@@ -1825,15 +1840,15 @@ virtual_base_list (dclass)
 
 int
 virtual_base_list_length (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
   register int i;
-  register struct vbase * tmp_vbase;
-  
+  register struct vbase *tmp_vbase;
+
   current_vbase_list = NULL;
-  virtual_base_list_aux(dclass);
+  virtual_base_list_aux (dclass);
 
-  for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
+  for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
     /* no body */ ;
   return i;
 }
@@ -1844,11 +1859,11 @@ virtual_base_list_length (dclass)
 
 int
 virtual_base_list_length_skip_primaries (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
   register int i;
-  register struct vbase * tmp_vbase;
-  struct type * primary;
+  register struct vbase *tmp_vbase;
+  struct type *primary;
 
   primary = TYPE_RUNTIME_PTR (dclass) ? TYPE_PRIMARY_BASE (dclass) : NULL;
 
@@ -1856,12 +1871,12 @@ virtual_base_list_length_skip_primaries (dclass)
     return virtual_base_list_length (dclass);
 
   current_vbase_list = NULL;
-  virtual_base_list_aux(dclass);
+  virtual_base_list_aux (dclass);
 
-  for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; tmp_vbase = tmp_vbase->next)
+  for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; tmp_vbase = tmp_vbase->next)
     {
       if (virtual_base_index (tmp_vbase->vbasetype, primary) >= 0)
-        continue;
+       continue;
       i++;
     }
   return i;
@@ -1873,24 +1888,24 @@ virtual_base_list_length_skip_primaries (dclass)
    indicates "not found" or a problem.  */
 
 int
-virtual_base_index(base, dclass)
-  struct type * base;
-  struct type * dclass;
+virtual_base_index (base, dclass)
+     struct type *base;
+     struct type *dclass;
 {
-  register struct type * vbase;
+  register struct type *vbase;
   register int i;
 
-  if ((TYPE_CODE(dclass) != TYPE_CODE_CLASS) ||
-      (TYPE_CODE(base) != TYPE_CODE_CLASS))
+  if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
+      (TYPE_CODE (base) != TYPE_CODE_CLASS))
     return -1;
 
   i = 0;
-  vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[0];
+  vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[0];
   while (vbase)
     {
       if (vbase == base)
-        break;
-      vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[++i];
+       break;
+      vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[++i];
     }
 
   return vbase ? i : -1;
@@ -1905,30 +1920,30 @@ virtual_base_index(base, dclass)
    found" or a problem.  */
 
 int
-virtual_base_index_skip_primaries(base, dclass)
-  struct type * base;
-  struct type * dclass;
+virtual_base_index_skip_primaries (base, dclass)
+     struct type *base;
+     struct type *dclass;
 {
-  register struct type * vbase;
+  register struct type *vbase;
   register int i, j;
-  struct type * primary;
+  struct type *primary;
 
-  if ((TYPE_CODE(dclass) != TYPE_CODE_CLASS) ||
-      (TYPE_CODE(base) != TYPE_CODE_CLASS))
+  if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
+      (TYPE_CODE (base) != TYPE_CODE_CLASS))
     return -1;
 
-  primary = TYPE_RUNTIME_PTR(dclass) ? TYPE_PRIMARY_BASE(dclass) : NULL;
+  primary = TYPE_RUNTIME_PTR (dclass) ? TYPE_PRIMARY_BASE (dclass) : NULL;
 
   j = -1;
   i = 0;
-  vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[0];
+  vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[0];
   while (vbase)
     {
-      if (!primary || (virtual_base_index_skip_primaries(vbase, primary) < 0))
-        j++;
+      if (!primary || (virtual_base_index_skip_primaries (vbase, primary) < 0))
+       j++;
       if (vbase == base)
-        break;
-      vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[++i];
+       break;
+      vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[++i];
     }
 
   return vbase ? j : -1;
@@ -1940,11 +1955,11 @@ virtual_base_index_skip_primaries(base, dclass)
 
 int
 class_index_in_primary_list (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
-  struct type * pbc; /* primary base class */
+  struct type *pbc;            /* primary base class */
 
-  /* Simply recurse on primary base */ 
+  /* Simply recurse on primary base */
   pbc = TYPE_PRIMARY_BASE (dclass);
   if (pbc)
     return 1 + class_index_in_primary_list (pbc);
@@ -1963,28 +1978,28 @@ class_index_in_primary_list (dclass)
 
 int
 count_virtual_fns (dclass)
-  struct type * dclass;
+     struct type *dclass;
 {
-  int base;     /* index for base classes */
-  int fn, oi;   /* function and overloaded instance indices */
-  
-  int vfuncs;   /* count to return */ 
+  int base;                    /* index for base classes */
+  int fn, oi;                  /* function and overloaded instance indices */
 
-  /* recurse on bases that can share virtual table */ 
-  struct type * pbc = primary_base_class (dclass);
+  int vfuncs;                  /* count to return */
+
+  /* recurse on bases that can share virtual table */
+  struct type *pbc = primary_base_class (dclass);
   if (pbc)
     vfuncs = count_virtual_fns (pbc);
-  
+
   for (fn = 0; fn < TYPE_NFN_FIELDS (dclass); fn++)
     for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (dclass, fn); oi++)
       if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (dclass, fn), oi))
-        vfuncs++;
+       vfuncs++;
 
   return vfuncs;
 }
-
 \f
 
+
 /* Functions for overload resolution begin here */
 
 /* Compare two badness vectors A and B and return the result.
@@ -1995,41 +2010,42 @@ count_virtual_fns (dclass)
 
 int
 compare_badness (a, b)
-  struct badness_vector * a;
-  struct badness_vector * b;
+     struct badness_vector *a;
+     struct badness_vector *b;
 {
   int i;
   int tmp;
-  short found_pos = 0;      /* any positives in c? */
-  short found_neg = 0;      /* any negatives in c? */
-  
-  /* differing lengths => incomparable */ 
+  short found_pos = 0;         /* any positives in c? */
+  short found_neg = 0;         /* any negatives in c? */
+
+  /* differing lengths => incomparable */
   if (a->length != b->length)
     return 1;
 
-  /* Subtract b from a */ 
-  for (i=0; i < a->length; i++)
+  /* Subtract b from a */
+  for (i = 0; i < a->length; i++)
     {
       tmp = a->rank[i] - b->rank[i];
       if (tmp > 0)
-        found_pos = 1;
+       found_pos = 1;
       else if (tmp < 0)
-        found_neg = 1;
+       found_neg = 1;
     }
 
   if (found_pos)
     {
       if (found_neg)
-        return 1; /* incomparable */ 
+       return 1;               /* incomparable */
       else
-        return 3; /* A > B */ 
+       return 3;               /* A > B */
     }
-  else /* no positives */ 
+  else
+    /* no positives */
     {
       if (found_neg)
-        return 2; /* A < B */
+       return 2;               /* A < B */
       else
-        return 0; /* A == B */
+       return 0;               /* A == B */
     }
 }
 
@@ -2039,22 +2055,22 @@ compare_badness (a, b)
 
 struct badness_vector *
 rank_function (parms, nparms, args, nargs)
-  struct type ** parms;
-  int nparms;
-  struct type ** args;
-  int nargs;
+     struct type **parms;
+     int nparms;
+     struct type **args;
+     int nargs;
 {
   int i;
-  struct badness_vector * bv;
+  struct badness_vector *bv;
   int min_len = nparms < nargs ? nparms : nargs;
 
   bv = xmalloc (sizeof (struct badness_vector));
-  bv->length = nargs + 1; /* add 1 for the length-match rank */ 
+  bv->length = nargs + 1;      /* add 1 for the length-match rank */
   bv->rank = xmalloc ((nargs + 1) * sizeof (int));
 
   /* First compare the lengths of the supplied lists.
    * If there is a mismatch, set it to a high value. */
-   
+
   /* pai/1997-06-03 FIXME: when we have debug info about default
    * arguments and ellipsis parameter lists, we should consider those
    * and rank the length-match more finely. */
@@ -2062,11 +2078,11 @@ rank_function (parms, nparms, args, nargs)
   LENGTH_MATCH (bv) = (nargs != nparms) ? LENGTH_MISMATCH_BADNESS : 0;
 
   /* Now rank all the parameters of the candidate function */
-  for (i=1; i <= min_len; i++)
-    bv->rank[i] = rank_one_type (parms[i-1], args[i-1]);
+  for (i = 1; i <= min_len; i++)
+    bv->rank[i] = rank_one_type (parms[i - 1], args[i - 1]);
 
-  /* If more arguments than parameters, add dummy entries */ 
-  for (i = min_len +1; i <= nargs; i++)
+  /* If more arguments than parameters, add dummy entries */
+  for (i = min_len + 1; i <= nargs; i++)
     bv->rank[i] = TOO_FEW_PARAMS_BADNESS;
 
   return bv;
@@ -2084,8 +2100,8 @@ rank_function (parms, nparms, args, nargs)
 
 int
 rank_one_type (parm, arg)
-  struct type * parm;
-  struct type * arg;
+     struct type *parm;
+     struct type *arg;
 {
   /* Identical type pointers */
   /* However, this still doesn't catch all cases of same type for arg
@@ -2105,297 +2121,297 @@ rank_one_type (parm, arg)
     return 0;
 
 #if 0
-  /* Debugging only */ 
-  printf("------ Arg is %s [%d], parm is %s [%d]\n",
-         TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
+  /* Debugging only */
+  printf ("------ Arg is %s [%d], parm is %s [%d]\n",
+      TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
 #endif
 
   /* x -> y means arg of type x being supplied for parameter of type y */
 
   switch (TYPE_CODE (parm))
     {
-      case TYPE_CODE_PTR:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_PTR: 
-              if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
-                return VOID_PTR_CONVERSION_BADNESS;
-              else
-                return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
-            case TYPE_CODE_ARRAY:
-              return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
-            case TYPE_CODE_FUNC:
-              return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
-            case TYPE_CODE_INT:
-            case TYPE_CODE_ENUM:
-            case TYPE_CODE_CHAR:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_BOOL:
-              return POINTER_CONVERSION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-      case TYPE_CODE_ARRAY:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_PTR:
-            case TYPE_CODE_ARRAY:
-              return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-      case TYPE_CODE_FUNC:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_PTR: /* funcptr -> func */
-              return rank_one_type (parm, TYPE_TARGET_TYPE (arg));
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-      case TYPE_CODE_INT:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_INT:
-              if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
-                {
-                  /* Deal with signed, unsigned, and plain chars and
-                     signed and unsigned ints */
-                  if (TYPE_NOSIGN (parm))
-                    {
-                      /* This case only for character types */
-                      if (TYPE_NOSIGN (arg))  /* plain char -> plain char */
-                        return 0;
-                      else
-                        return INTEGER_COERCION_BADNESS; /* signed/unsigned char -> plain char */
-                    }
-                  else if (TYPE_UNSIGNED (parm))
-                    {
-                      if (TYPE_UNSIGNED (arg))
-                        {
-                          if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg))) 
-                            return 0;  /* unsigned int -> unsigned int, or unsigned long -> unsigned long */
-                          else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
-                            return INTEGER_PROMOTION_BADNESS; /* unsigned int -> unsigned long */
-                          else
-                            return INTEGER_COERCION_BADNESS; /* unsigned long -> unsigned int */ 
-                        }
-                      else
-                        {
-                          if (!strcmp (TYPE_NAME (arg), "long") && !strcmp (TYPE_NAME (parm), "int"))
-                            return INTEGER_COERCION_BADNESS; /* signed long -> unsigned int */
-                          else 
-                            return INTEGER_CONVERSION_BADNESS; /* signed int/long -> unsigned int/long */ 
-                        }
-                    }
-                  else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
-                    {
-                      if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
-                        return 0;
-                      else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
-                        return INTEGER_PROMOTION_BADNESS;
-                      else
-                        return INTEGER_COERCION_BADNESS;
-                    }
-                  else
-                    return INTEGER_COERCION_BADNESS;
-                }
-              else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
-                return INTEGER_PROMOTION_BADNESS;
-              else
-                return INTEGER_COERCION_BADNESS;
-            case TYPE_CODE_ENUM:
-            case TYPE_CODE_CHAR:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_BOOL:
-              return INTEGER_PROMOTION_BADNESS;
-            case TYPE_CODE_FLT:
-              return INT_FLOAT_CONVERSION_BADNESS;
-            case TYPE_CODE_PTR:
-              return NS_POINTER_CONVERSION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_ENUM:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_INT:
-            case TYPE_CODE_CHAR:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_BOOL:
-            case TYPE_CODE_ENUM:
-              return INTEGER_COERCION_BADNESS;
-            case TYPE_CODE_FLT:
-              return INT_FLOAT_CONVERSION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_CHAR:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_BOOL:
-            case TYPE_CODE_ENUM:
-              return INTEGER_COERCION_BADNESS;
-            case TYPE_CODE_FLT:
-              return INT_FLOAT_CONVERSION_BADNESS;
-            case TYPE_CODE_INT: 
-              if (TYPE_LENGTH (arg) > TYPE_LENGTH (parm))
-                return INTEGER_COERCION_BADNESS;
-              else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
-                return INTEGER_PROMOTION_BADNESS;
-              /* >>> !! else fall through !! <<< */ 
-            case TYPE_CODE_CHAR:
-              /* Deal with signed, unsigned, and plain chars for C++
-                 and with int cases falling through from previous case */
-              if (TYPE_NOSIGN (parm))
-                {
-                  if (TYPE_NOSIGN (arg))
-                    return 0;
-                  else
-                    return INTEGER_COERCION_BADNESS;
-                }
-              else if (TYPE_UNSIGNED (parm))
-                {
-                  if (TYPE_UNSIGNED (arg))
-                    return 0;
-                  else
-                    return INTEGER_PROMOTION_BADNESS;
-                }
-              else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
-                return 0;
-              else
-                return INTEGER_COERCION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_RANGE:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_INT:
-            case TYPE_CODE_CHAR:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_BOOL:
-            case TYPE_CODE_ENUM:
-              return INTEGER_COERCION_BADNESS;
-            case TYPE_CODE_FLT:
-              return INT_FLOAT_CONVERSION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_BOOL:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_INT:
-            case TYPE_CODE_CHAR:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_ENUM:
-            case TYPE_CODE_FLT:
-            case TYPE_CODE_PTR:
-              return BOOLEAN_CONVERSION_BADNESS;
-            case TYPE_CODE_BOOL:
-              return 0;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_FLT:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_FLT:
-              if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
-                return FLOAT_PROMOTION_BADNESS;
-              else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
-                return 0;
-              else
-                return FLOAT_CONVERSION_BADNESS;
-            case TYPE_CODE_INT:
-            case TYPE_CODE_BOOL:
-            case TYPE_CODE_ENUM:
-            case TYPE_CODE_RANGE:
-            case TYPE_CODE_CHAR:
-              return INT_FLOAT_CONVERSION_BADNESS;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_COMPLEX:
-        switch (TYPE_CODE (arg))
-          { /* Strictly not needed for C++, but... */
-            case TYPE_CODE_FLT:
-              return FLOAT_PROMOTION_BADNESS;
-            case TYPE_CODE_COMPLEX:
-              return 0;
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_STRUCT:
+    case TYPE_CODE_PTR:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_PTR:
+         if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
+           return VOID_PTR_CONVERSION_BADNESS;
+         else
+           return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+       case TYPE_CODE_ARRAY:
+         return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+       case TYPE_CODE_FUNC:
+         return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
+       case TYPE_CODE_INT:
+       case TYPE_CODE_ENUM:
+       case TYPE_CODE_CHAR:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_BOOL:
+         return POINTER_CONVERSION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+    case TYPE_CODE_ARRAY:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_PTR:
+       case TYPE_CODE_ARRAY:
+         return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+    case TYPE_CODE_FUNC:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_PTR:     /* funcptr -> func */
+         return rank_one_type (parm, TYPE_TARGET_TYPE (arg));
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+    case TYPE_CODE_INT:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_INT:
+         if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
+           {
+             /* Deal with signed, unsigned, and plain chars and
+                signed and unsigned ints */
+             if (TYPE_NOSIGN (parm))
+               {
+                 /* This case only for character types */
+                 if (TYPE_NOSIGN (arg))        /* plain char -> plain char */
+                   return 0;
+                 else
+                   return INTEGER_COERCION_BADNESS;    /* signed/unsigned char -> plain char */
+               }
+             else if (TYPE_UNSIGNED (parm))
+               {
+                 if (TYPE_UNSIGNED (arg))
+                   {
+                     if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
+                       return 0;       /* unsigned int -> unsigned int, or unsigned long -> unsigned long */
+                     else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
+                       return INTEGER_PROMOTION_BADNESS;       /* unsigned int -> unsigned long */
+                     else
+                       return INTEGER_COERCION_BADNESS;        /* unsigned long -> unsigned int */
+                   }
+                 else
+                   {
+                     if (!strcmp (TYPE_NAME (arg), "long") && !strcmp (TYPE_NAME (parm), "int"))
+                       return INTEGER_COERCION_BADNESS;        /* signed long -> unsigned int */
+                     else
+                       return INTEGER_CONVERSION_BADNESS;      /* signed int/long -> unsigned int/long */
+                   }
+               }
+             else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
+               {
+                 if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
+                   return 0;
+                 else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
+                   return INTEGER_PROMOTION_BADNESS;
+                 else
+                   return INTEGER_COERCION_BADNESS;
+               }
+             else
+               return INTEGER_COERCION_BADNESS;
+           }
+         else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+           return INTEGER_PROMOTION_BADNESS;
+         else
+           return INTEGER_COERCION_BADNESS;
+       case TYPE_CODE_ENUM:
+       case TYPE_CODE_CHAR:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_BOOL:
+         return INTEGER_PROMOTION_BADNESS;
+       case TYPE_CODE_FLT:
+         return INT_FLOAT_CONVERSION_BADNESS;
+       case TYPE_CODE_PTR:
+         return NS_POINTER_CONVERSION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_ENUM:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_INT:
+       case TYPE_CODE_CHAR:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_BOOL:
+       case TYPE_CODE_ENUM:
+         return INTEGER_COERCION_BADNESS;
+       case TYPE_CODE_FLT:
+         return INT_FLOAT_CONVERSION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_CHAR:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_BOOL:
+       case TYPE_CODE_ENUM:
+         return INTEGER_COERCION_BADNESS;
+       case TYPE_CODE_FLT:
+         return INT_FLOAT_CONVERSION_BADNESS;
+       case TYPE_CODE_INT:
+         if (TYPE_LENGTH (arg) > TYPE_LENGTH (parm))
+           return INTEGER_COERCION_BADNESS;
+         else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+           return INTEGER_PROMOTION_BADNESS;
+         /* >>> !! else fall through !! <<< */
+       case TYPE_CODE_CHAR:
+         /* Deal with signed, unsigned, and plain chars for C++
+            and with int cases falling through from previous case */
+         if (TYPE_NOSIGN (parm))
+           {
+             if (TYPE_NOSIGN (arg))
+               return 0;
+             else
+               return INTEGER_COERCION_BADNESS;
+           }
+         else if (TYPE_UNSIGNED (parm))
+           {
+             if (TYPE_UNSIGNED (arg))
+               return 0;
+             else
+               return INTEGER_PROMOTION_BADNESS;
+           }
+         else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
+           return 0;
+         else
+           return INTEGER_COERCION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_RANGE:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_INT:
+       case TYPE_CODE_CHAR:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_BOOL:
+       case TYPE_CODE_ENUM:
+         return INTEGER_COERCION_BADNESS;
+       case TYPE_CODE_FLT:
+         return INT_FLOAT_CONVERSION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_BOOL:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_INT:
+       case TYPE_CODE_CHAR:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_ENUM:
+       case TYPE_CODE_FLT:
+       case TYPE_CODE_PTR:
+         return BOOLEAN_CONVERSION_BADNESS;
+       case TYPE_CODE_BOOL:
+         return 0;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_FLT:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_FLT:
+         if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+           return FLOAT_PROMOTION_BADNESS;
+         else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
+           return 0;
+         else
+           return FLOAT_CONVERSION_BADNESS;
+       case TYPE_CODE_INT:
+       case TYPE_CODE_BOOL:
+       case TYPE_CODE_ENUM:
+       case TYPE_CODE_RANGE:
+       case TYPE_CODE_CHAR:
+         return INT_FLOAT_CONVERSION_BADNESS;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_COMPLEX:
+      switch (TYPE_CODE (arg))
+       {                       /* Strictly not needed for C++, but... */
+       case TYPE_CODE_FLT:
+         return FLOAT_PROMOTION_BADNESS;
+       case TYPE_CODE_COMPLEX:
+         return 0;
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_STRUCT:
       /* currently same as TYPE_CODE_CLASS */
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_STRUCT:
-              /* Check for derivation */
-              if (is_ancestor (parm, arg))
-                return BASE_CONVERSION_BADNESS;
-              /* else fall through */
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_UNION:
-        switch (TYPE_CODE (arg))
-          {
-            case TYPE_CODE_UNION:
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_MEMBER:
-        switch (TYPE_CODE (arg))
-          {
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_METHOD:
-        switch (TYPE_CODE (arg))
-          {
-            
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_REF:
-        switch (TYPE_CODE (arg))
-          {
-            
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-
-        break;
-      case TYPE_CODE_SET:
-        switch (TYPE_CODE (arg))
-          {
-            /* Not in C++ */
-            case TYPE_CODE_SET:
-              return rank_one_type (TYPE_FIELD_TYPE (parm, 0), TYPE_FIELD_TYPE (arg, 0));
-            default:
-              return INCOMPATIBLE_TYPE_BADNESS;
-          }
-        break;
-      case TYPE_CODE_VOID:
-      default:  
-        return INCOMPATIBLE_TYPE_BADNESS;
-    } /* switch (TYPE_CODE (arg)) */
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_STRUCT:
+         /* Check for derivation */
+         if (is_ancestor (parm, arg))
+           return BASE_CONVERSION_BADNESS;
+         /* else fall through */
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_UNION:
+      switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_UNION:
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_MEMBER:
+      switch (TYPE_CODE (arg))
+       {
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_METHOD:
+      switch (TYPE_CODE (arg))
+       {
+
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_REF:
+      switch (TYPE_CODE (arg))
+       {
+
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+
+      break;
+    case TYPE_CODE_SET:
+      switch (TYPE_CODE (arg))
+       {
+         /* Not in C++ */
+       case TYPE_CODE_SET:
+         return rank_one_type (TYPE_FIELD_TYPE (parm, 0), TYPE_FIELD_TYPE (arg, 0));
+       default:
+         return INCOMPATIBLE_TYPE_BADNESS;
+       }
+      break;
+    case TYPE_CODE_VOID:
+    default:
+      return INCOMPATIBLE_TYPE_BADNESS;
+    }                          /* switch (TYPE_CODE (arg)) */
 }
 
-/* End of functions for overload resolution */ 
+
+/* End of functions for overload resolution */
 
 static void
 print_bit_vector (bits, nbits)
@@ -2437,7 +2453,7 @@ print_arg_types (args, spaces)
       while (*args != NULL)
        {
          recursive_dump_type (*args, spaces + 2);
-         if ((*args++) -> code == TYPE_CODE_VOID)
+         if ((*args++)->code == TYPE_CODE_VOID)
            {
              break;
            }
@@ -2577,10 +2593,10 @@ recursive_dump_type (type, spaces)
       || (TYPE_CPLUS_SPECIFIC (type) && TYPE_NFN_FIELDS (type) > 0))
     {
       struct type **first_dont_print
-       = (struct type **)obstack_base (&dont_print_type_obstack);
+      = (struct type **) obstack_base (&dont_print_type_obstack);
 
-      int i = (struct type **)obstack_next_free (&dont_print_type_obstack)
-       - first_dont_print;
+      int i = (struct type **) obstack_next_free (&dont_print_type_obstack)
+      - first_dont_print;
 
       while (--i >= 0)
        {
@@ -2613,69 +2629,69 @@ recursive_dump_type (type, spaces)
   printfi_filtered (spaces, "code 0x%x ", TYPE_CODE (type));
   switch (TYPE_CODE (type))
     {
-      case TYPE_CODE_UNDEF:
-        printf_filtered ("(TYPE_CODE_UNDEF)");
-       break;
-      case TYPE_CODE_PTR:
-       printf_filtered ("(TYPE_CODE_PTR)");
-       break;
-      case TYPE_CODE_ARRAY:
-       printf_filtered ("(TYPE_CODE_ARRAY)");
-       break;
-      case TYPE_CODE_STRUCT:
-       printf_filtered ("(TYPE_CODE_STRUCT)");
-       break;
-      case TYPE_CODE_UNION:
-       printf_filtered ("(TYPE_CODE_UNION)");
-       break;
-      case TYPE_CODE_ENUM:
-       printf_filtered ("(TYPE_CODE_ENUM)");
-       break;
-      case TYPE_CODE_FUNC:
-       printf_filtered ("(TYPE_CODE_FUNC)");
-       break;
-      case TYPE_CODE_INT:
-       printf_filtered ("(TYPE_CODE_INT)");
-       break;
-      case TYPE_CODE_FLT:
-       printf_filtered ("(TYPE_CODE_FLT)");
-       break;
-      case TYPE_CODE_VOID:
-       printf_filtered ("(TYPE_CODE_VOID)");
-       break;
-      case TYPE_CODE_SET:
-       printf_filtered ("(TYPE_CODE_SET)");
-       break;
-      case TYPE_CODE_RANGE:
-       printf_filtered ("(TYPE_CODE_RANGE)");
-       break;
-      case TYPE_CODE_STRING:
-       printf_filtered ("(TYPE_CODE_STRING)");
-       break;
-      case TYPE_CODE_ERROR:
-       printf_filtered ("(TYPE_CODE_ERROR)");
-       break;
-      case TYPE_CODE_MEMBER:
-       printf_filtered ("(TYPE_CODE_MEMBER)");
-       break;
-      case TYPE_CODE_METHOD:
-       printf_filtered ("(TYPE_CODE_METHOD)");
-       break;
-      case TYPE_CODE_REF:
-       printf_filtered ("(TYPE_CODE_REF)");
-       break;
-      case TYPE_CODE_CHAR:
-       printf_filtered ("(TYPE_CODE_CHAR)");
-       break;
-      case TYPE_CODE_BOOL:
-       printf_filtered ("(TYPE_CODE_BOOL)");
-       break;
-      case TYPE_CODE_TYPEDEF:
-       printf_filtered ("(TYPE_CODE_TYPEDEF)");
-       break;
-      default:
-       printf_filtered ("(UNKNOWN TYPE CODE)");
-       break;
+    case TYPE_CODE_UNDEF:
+      printf_filtered ("(TYPE_CODE_UNDEF)");
+      break;
+    case TYPE_CODE_PTR:
+      printf_filtered ("(TYPE_CODE_PTR)");
+      break;
+    case TYPE_CODE_ARRAY:
+      printf_filtered ("(TYPE_CODE_ARRAY)");
+      break;
+    case TYPE_CODE_STRUCT:
+      printf_filtered ("(TYPE_CODE_STRUCT)");
+      break;
+    case TYPE_CODE_UNION:
+      printf_filtered ("(TYPE_CODE_UNION)");
+      break;
+    case TYPE_CODE_ENUM:
+      printf_filtered ("(TYPE_CODE_ENUM)");
+      break;
+    case TYPE_CODE_FUNC:
+      printf_filtered ("(TYPE_CODE_FUNC)");
+      break;
+    case TYPE_CODE_INT:
+      printf_filtered ("(TYPE_CODE_INT)");
+      break;
+    case TYPE_CODE_FLT:
+      printf_filtered ("(TYPE_CODE_FLT)");
+      break;
+    case TYPE_CODE_VOID:
+      printf_filtered ("(TYPE_CODE_VOID)");
+      break;
+    case TYPE_CODE_SET:
+      printf_filtered ("(TYPE_CODE_SET)");
+      break;
+    case TYPE_CODE_RANGE:
+      printf_filtered ("(TYPE_CODE_RANGE)");
+      break;
+    case TYPE_CODE_STRING:
+      printf_filtered ("(TYPE_CODE_STRING)");
+      break;
+    case TYPE_CODE_ERROR:
+      printf_filtered ("(TYPE_CODE_ERROR)");
+      break;
+    case TYPE_CODE_MEMBER:
+      printf_filtered ("(TYPE_CODE_MEMBER)");
+      break;
+    case TYPE_CODE_METHOD:
+      printf_filtered ("(TYPE_CODE_METHOD)");
+      break;
+    case TYPE_CODE_REF:
+      printf_filtered ("(TYPE_CODE_REF)");
+      break;
+    case TYPE_CODE_CHAR:
+      printf_filtered ("(TYPE_CODE_CHAR)");
+      break;
+    case TYPE_CODE_BOOL:
+      printf_filtered ("(TYPE_CODE_BOOL)");
+      break;
+    case TYPE_CODE_TYPEDEF:
+      printf_filtered ("(TYPE_CODE_TYPEDEF)");
+      break;
+    default:
+      printf_filtered ("(UNKNOWN TYPE CODE)");
+      break;
     }
   puts_filtered ("\n");
   printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
@@ -2736,33 +2752,33 @@ recursive_dump_type (type, 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_address (TYPE_ARG_TYPES (type), gdb_stdout);
-       puts_filtered ("\n");
-       print_arg_types (TYPE_ARG_TYPES (type), spaces);
-       break;
+    case TYPE_CODE_METHOD:
+    case TYPE_CODE_FUNC:
+      printfi_filtered (spaces, "arg_types ");
+      gdb_print_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_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
-       puts_filtered ("\n");
-       print_cplus_stuff (type, spaces);
-       break;
+    case TYPE_CODE_STRUCT:
+      printfi_filtered (spaces, "cplus_stuff ");
+      gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
+      puts_filtered ("\n");
+      print_cplus_stuff (type, spaces);
+      break;
 
-      default:
-       /* We have to pick one of the union types to be able print and test
-          the value.  Pick cplus_struct_type, even though we know it isn't
-          any particular one. */
-       printfi_filtered (spaces, "type_specific ");
-       gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
-       if (TYPE_CPLUS_SPECIFIC (type) != NULL)
-         {
-           printf_filtered (" (unknown data form)");
-         }
-       printf_filtered ("\n");
-       break;
+    default:
+      /* We have to pick one of the union types to be able print and test
+         the value.  Pick cplus_struct_type, even though we know it isn't
+         any particular one. */
+      printfi_filtered (spaces, "type_specific ");
+      gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
+      if (TYPE_CPLUS_SPECIFIC (type) != NULL)
+       {
+         printf_filtered (" (unknown data form)");
+       }
+      printf_filtered ("\n");
+      break;
 
     }
   if (spaces == 0)
@@ -2782,7 +2798,7 @@ build_gdbtypes ()
               0,
               "char", (struct objfile *) NULL);
   TYPE_FLAGS (builtin_type_char) |= TYPE_FLAG_NOSIGN;
-  builtin_type_true_char = 
+  builtin_type_true_char =
     init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
               0,
               "true character", (struct objfile *) NULL);
@@ -2822,7 +2838,7 @@ build_gdbtypes ()
     init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
               0,
               "long long", (struct objfile *) NULL);
-  builtin_type_unsigned_long_long = 
+  builtin_type_unsigned_long_long =
     init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
               TYPE_FLAG_UNSIGNED,
               "unsigned long long", (struct objfile *) NULL);
@@ -2889,9 +2905,9 @@ build_gdbtypes ()
               0,
               "bool", (struct objfile *) NULL);
 
-  /* Add user knob for controlling resolution of opaque types */ 
+  /* Add user knob for controlling resolution of opaque types */
   add_show_from_set
-    (add_set_cmd ("opaque-type-resolution", class_support, var_boolean, (char *)&opaque_type_resolution,
+    (add_set_cmd ("opaque-type-resolution", class_support, var_boolean, (char *) &opaque_type_resolution,
                  "Set resolution of opaque struct/class/union types (if set before loading symbols).",
                  &setlist),
      &showlist);
@@ -2909,31 +2925,31 @@ _initialize_gdbtypes ()
   /* FIXME - For the moment, handle types by swapping them in and out.
      Should be using the per-architecture data-pointer and a large
      struct. */
-  register_gdbarch_swap (&builtin_type_void, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_char, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_short, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_int, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_long, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_long_long, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_signed_char, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_unsigned_char, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_unsigned_short, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_unsigned_int, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_unsigned_long, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_unsigned_long_long, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_float, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_double, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_long_double, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_complex, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_double_complex, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_string, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_int8, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_uint8, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_int16, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_uint16, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_int32, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_uint32, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_int64, sizeof (struct type*), NULL);
-  register_gdbarch_swap (&builtin_type_uint64, sizeof (struct type*), NULL);
+  register_gdbarch_swap (&builtin_type_void, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_char, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_short, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_int, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_long, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_long_long, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_signed_char, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_unsigned_char, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_unsigned_short, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_unsigned_int, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_unsigned_long, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_unsigned_long_long, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_float, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_double, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_long_double, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_complex, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_double_complex, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_string, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_int8, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_uint8, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_int16, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_uint16, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_int32, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_uint32, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_int64, sizeof (struct type *), NULL);
+  register_gdbarch_swap (&builtin_type_uint64, sizeof (struct type *), NULL);
   register_gdbarch_swap (NULL, 0, build_gdbtypes);
 }
index 92ecd9ab738ddc299c738f3ed9001ce75492fb1f..21fb905449e8fd2cac2f8f452cfc7b7b7a173a08 100644 (file)
@@ -3,21 +3,22 @@
    Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (GDBTYPES_H)
 #define GDBTYPES_H 1
@@ -30,9 +31,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define FT_VOID                        0
 #define FT_BOOLEAN             1
-#define FT_CHAR                        2 /* we use this for not-unsigned C/C++ chars */
-#define FT_SIGNED_CHAR         3 /* we use this for C++ signed chars */
-#define FT_UNSIGNED_CHAR       4 /* we use this for C/C++ unsigned chars */
+#define FT_CHAR                        2       /* we use this for not-unsigned C/C++ chars */
+#define FT_SIGNED_CHAR         3       /* we use this for C++ signed chars */
+#define FT_UNSIGNED_CHAR       4       /* we use this for C/C++ unsigned chars */
 #define FT_SHORT               5
 #define FT_SIGNED_SHORT                6
 #define FT_UNSIGNED_SHORT      7
@@ -72,63 +73,63 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Different kinds of data types are distinguished by the `code' field.  */
 
 enum type_code
-{
-  TYPE_CODE_UNDEF,             /* Not used; catches errors */
-  TYPE_CODE_PTR,               /* Pointer type */
-  TYPE_CODE_ARRAY,             /* Array type with lower & upper bounds. */
-  TYPE_CODE_STRUCT,            /* C struct or Pascal record */
-  TYPE_CODE_UNION,             /* C union or Pascal variant part */
-  TYPE_CODE_ENUM,              /* Enumeration type */
-  TYPE_CODE_FUNC,              /* Function type */
-  TYPE_CODE_INT,               /* Integer type */
-
-  /* Floating type.  This is *NOT* a complex type.  Beware, there are parts
-     of GDB which bogusly assume that TYPE_CODE_FLT can mean complex.  */
-  TYPE_CODE_FLT,
-
-  /* Void type.  The length field specifies the length (probably always
-     one) which is used in pointer arithmetic involving pointers to
-     this type, but actually dereferencing such a pointer is invalid;
-     a void type has no length and no actual representation in memory
-     or registers.  A pointer to a void type is a generic pointer.  */
-  TYPE_CODE_VOID,
-
-  TYPE_CODE_SET,               /* Pascal sets */
-  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.  */
-  TYPE_CODE_STRING,
-
-  /* String of bits; like TYPE_CODE_SET but prints differently (at least
-     for CHILL).  */
-  TYPE_CODE_BITSTRING,
-
-  /* Unknown type.  The length field is valid if we were able to
-     deduce that much about the type, or 0 if we don't even know that.  */
-  TYPE_CODE_ERROR,
-
-  /* C++ */
-  TYPE_CODE_MEMBER,            /* Member type */
-  TYPE_CODE_METHOD,            /* Method type */
-  TYPE_CODE_REF,               /* C++ Reference types */
-
-  TYPE_CODE_CHAR,              /* *real* character type */
-
-  /* Boolean type.  0 is false, 1 is true, and other values are non-boolean
-     (e.g. FORTRAN "logical" used as unsigned int).  */
-  TYPE_CODE_BOOL,
-
-  /* Fortran */
-  TYPE_CODE_COMPLEX,           /* Complex float */
-
-  TYPE_CODE_TYPEDEF,
-  TYPE_CODE_TEMPLATE,          /* C++ template */
-  TYPE_CODE_TEMPLATE_ARG       /* C++ template arg */
-
-};
+  {
+    TYPE_CODE_UNDEF,           /* Not used; catches errors */
+    TYPE_CODE_PTR,             /* Pointer type */
+    TYPE_CODE_ARRAY,           /* Array type with lower & upper bounds. */
+    TYPE_CODE_STRUCT,          /* C struct or Pascal record */
+    TYPE_CODE_UNION,           /* C union or Pascal variant part */
+    TYPE_CODE_ENUM,            /* Enumeration type */
+    TYPE_CODE_FUNC,            /* Function type */
+    TYPE_CODE_INT,             /* Integer type */
+
+    /* Floating type.  This is *NOT* a complex type.  Beware, there are parts
+       of GDB which bogusly assume that TYPE_CODE_FLT can mean complex.  */
+    TYPE_CODE_FLT,
+
+    /* Void type.  The length field specifies the length (probably always
+       one) which is used in pointer arithmetic involving pointers to
+       this type, but actually dereferencing such a pointer is invalid;
+       a void type has no length and no actual representation in memory
+       or registers.  A pointer to a void type is a generic pointer.  */
+    TYPE_CODE_VOID,
+
+    TYPE_CODE_SET,             /* Pascal sets */
+    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.  */
+    TYPE_CODE_STRING,
+
+    /* String of bits; like TYPE_CODE_SET but prints differently (at least
+       for CHILL).  */
+    TYPE_CODE_BITSTRING,
+
+    /* Unknown type.  The length field is valid if we were able to
+       deduce that much about the type, or 0 if we don't even know that.  */
+    TYPE_CODE_ERROR,
+
+    /* C++ */
+    TYPE_CODE_MEMBER,          /* Member type */
+    TYPE_CODE_METHOD,          /* Method type */
+    TYPE_CODE_REF,             /* C++ Reference types */
+
+    TYPE_CODE_CHAR,            /* *real* character type */
+
+    /* Boolean type.  0 is false, 1 is true, and other values are non-boolean
+       (e.g. FORTRAN "logical" used as unsigned int).  */
+    TYPE_CODE_BOOL,
+
+    /* Fortran */
+    TYPE_CODE_COMPLEX,         /* Complex float */
+
+    TYPE_CODE_TYPEDEF,
+    TYPE_CODE_TEMPLATE,                /* C++ template */
+    TYPE_CODE_TEMPLATE_ARG     /* C++ template arg */
+
+  };
 
 /* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
    alias for TYPE_CODE_STRUCT.  This is for DWARF, which has a distinct
@@ -194,7 +195,7 @@ enum type_code
 
 /* This flag is used to indicate that processing for this type
    is incomplete.
+
    (Mostly intended for HP platforms, where class methods, for
    instance, can be encountered before their classes in the debug
    info; the incomplete type has to be marked so that the class and
@@ -204,210 +205,213 @@ enum type_code
 
 
 struct type
-{
+  {
 
-  /* Code for kind of type */
+    /* Code for kind of type */
 
-  enum type_code code;
+    enum type_code code;
 
-  /* Name of this type, or NULL if none.
+    /* Name of this type, or NULL if none.
 
-     This is used for printing only, except by poorly designed C++ code.
-     For looking up a name, look for a symbol in the VAR_NAMESPACE.  */
+       This is used for printing only, except by poorly designed C++ code.
+       For looking up a name, look for a symbol in the VAR_NAMESPACE.  */
 
-  char *name;
+    char *name;
 
-  /* Tag name for this type, or NULL if none.  This means that the
-     name of the type consists of a keyword followed by the tag name.
-     Which keyword is determined by the type code ("struct" for
-     TYPE_CODE_STRUCT, etc.).  As far as I know C/C++ are the only languages
-     with this feature.
+    /* Tag name for this type, or NULL if none.  This means that the
+       name of the type consists of a keyword followed by the tag name.
+       Which keyword is determined by the type code ("struct" for
+       TYPE_CODE_STRUCT, etc.).  As far as I know C/C++ are the only languages
+       with this feature.
 
-     This is used for printing only, except by poorly designed C++ code.
-     For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
-     One more legitimate use is that if TYPE_FLAG_STUB is set, this is
-     the name to use to look for definitions in other files.  */
+       This is used for printing only, except by poorly designed C++ code.
+       For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
+       One more legitimate use is that if TYPE_FLAG_STUB is set, this is
+       the name to use to look for definitions in other files.  */
 
-  char *tag_name;
+    char *tag_name;
 
-  /* Length of storage for a value of this type.  Various places pass
-     this to memcpy and such, meaning it must be in units of
-     HOST_CHAR_BIT.  Various other places expect they can calculate
-     addresses by adding it and such, meaning it must be in units of
-     TARGET_CHAR_BIT.  For some DSP targets, in which HOST_CHAR_BIT
-     will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
-     is a problem.  One fix would be to make this field in bits
-     (requiring that it always be a multiple of HOST_CHAR_BIT and
-     TARGET_CHAR_BIT)--the other choice would be to make it
-     consistently in units of HOST_CHAR_BIT.  */
+    /* Length of storage for a value of this type.  Various places pass
+       this to memcpy and such, meaning it must be in units of
+       HOST_CHAR_BIT.  Various other places expect they can calculate
+       addresses by adding it and such, meaning it must be in units of
+       TARGET_CHAR_BIT.  For some DSP targets, in which HOST_CHAR_BIT
+       will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
+       is a problem.  One fix would be to make this field in bits
+       (requiring that it always be a multiple of HOST_CHAR_BIT and
+       TARGET_CHAR_BIT)--the other choice would be to make it
+       consistently in units of HOST_CHAR_BIT.  */
 
-  unsigned length;
+    unsigned length;
 
-  /* FIXME, these should probably be restricted to a Fortran-specific
-     field in some fashion.  */
+    /* FIXME, these should probably be restricted to a Fortran-specific
+       field in some fashion.  */
 #define BOUND_CANNOT_BE_DETERMINED   5
 #define BOUND_BY_REF_ON_STACK        4
 #define BOUND_BY_VALUE_ON_STACK      3
 #define BOUND_BY_REF_IN_REG          2
 #define BOUND_BY_VALUE_IN_REG        1
 #define BOUND_SIMPLE                 0
-  int upper_bound_type;
-  int lower_bound_type;
+    int upper_bound_type;
+    int lower_bound_type;
 
-  /* Every type is now associated with a particular objfile, and the
-     type is allocated on the type_obstack for that objfile.  One problem
-     however, is that there are times when gdb allocates new types while
-     it is not in the process of reading symbols from a particular objfile.
-     Fortunately, these happen when the type being created is a derived
-     type of an existing type, such as in lookup_pointer_type().  So
-     we can just allocate the new type using the same objfile as the
-     existing type, but to do this we need a backpointer to the objfile
-     from the existing type.  Yes this is somewhat ugly, but without
-     major overhaul of the internal type system, it can't be avoided
-     for now. */
+    /* Every type is now associated with a particular objfile, and the
+       type is allocated on the type_obstack for that objfile.  One problem
+       however, is that there are times when gdb allocates new types while
+       it is not in the process of reading symbols from a particular objfile.
+       Fortunately, these happen when the type being created is a derived
+       type of an existing type, such as in lookup_pointer_type().  So
+       we can just allocate the new type using the same objfile as the
+       existing type, but to do this we need a backpointer to the objfile
+       from the existing type.  Yes this is somewhat ugly, but without
+       major overhaul of the internal type system, it can't be avoided
+       for now. */
 
-  struct objfile *objfile;
+    struct objfile *objfile;
 
-  /* For a pointer type, describes the type of object pointed to.
-     For an array type, describes the type of the elements.
-     For a function or method type, describes the type of the return value.
-     For a range type, describes the type of the full range.
-     For a complex type, describes the type of each coordinate.
-     Unused otherwise.  */
+    /* For a pointer type, describes the type of object pointed to.
+       For an array type, describes the type of the elements.
+       For a function or method type, describes the type of the return value.
+       For a range type, describes the type of the full range.
+       For a complex type, describes the type of each coordinate.
+       Unused otherwise.  */
 
-  struct type *target_type;
+    struct type *target_type;
 
-  /* Type that is a pointer to this type.
-     NULL if no such pointer-to type is known yet.
-     The debugger may add the address of such a type
-     if it has to construct one later.  */ 
+    /* Type that is a pointer to this type.
+       NULL if no such pointer-to type is known yet.
+       The debugger may add the address of such a type
+       if it has to construct one later.  */
 
-  struct type *pointer_type;
+    struct type *pointer_type;
 
-  /* C++: also need a reference type.  */
+    /* C++: also need a reference type.  */
 
-  struct type *reference_type;
+    struct type *reference_type;
 
-  /* C-v variant chain. This points to a type that
-     differs from this one only in a const or volatile
-     attribute (or both). The various c-v variants
-     are chained together in a ring. */
-  struct type *cv_type;
+    /* C-v variant chain. This points to a type that
+       differs from this one only in a const or volatile
+       attribute (or both). The various c-v variants
+       are chained together in a ring. */
+    struct type *cv_type;
 
-  /* Flags about this type.  */
+    /* Flags about this type.  */
 
-  int flags;
+    int flags;
 
-  /* Number of fields described for this type */
+    /* Number of fields described for this type */
 
-  short nfields;
+    short nfields;
 
-  /* For structure and union types, a description of each field.
-     For set and pascal array types, there is one "field",
-     whose type is the domain type of the set or array.
-     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 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.
+    /* For structure and union types, a description of each field.
+       For set and pascal array types, there is one "field",
+       whose type is the domain type of the set or array.
+       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 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.
 
-     Using a pointer to a separate array of fields
-     allows all types to have the same size, which is useful
-     because we can allocate the space for a type before
-     we know what to put in it.  */
+       Using a pointer to a separate array of fields
+       allows all types to have the same size, which is useful
+       because we can allocate the space for a type before
+       we know what to put in it.  */
 
-  struct field
-    {
+    struct field
+      {
 
 
 
-      union field_location
-        {
-         /* Position of this field, counting in bits from start of
-            containing structure.
-            For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
-            For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
-            For a function type, this is the position in the argument list
-            of this argument.
-            For a range bound or enum value, this is the value itself. */
+       union field_location
+         {
+           /* Position of this field, counting in bits from start of
+              containing structure.
+              For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
+              For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
+              For a function type, this is the position in the argument list
+              of this argument.
+              For a range bound or enum value, this is the value itself. */
 
-         int bitpos;
+           int bitpos;
 
-         /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
-            is the location (in the target) of the static field.
-            Otherwise, physname is the mangled label of the static field. */
+           /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
+              is the location (in the target) of the static field.
+              Otherwise, physname is the mangled label of the static field. */
 
-         CORE_ADDR physaddr;
-         char* physname;
-      } loc;
+           CORE_ADDR physaddr;
+           char *physname;
+         }
+       loc;
 
-      /* Size of this field, in bits, or zero if not packed.
-        For an unpacked field, the field's type's length
-        says how many bytes the field occupies.
-        A value of -1 or -2 indicates a static field;  -1 means the location
-        is specified by the label loc.physname;  -2 means that loc.physaddr
-        specifies the actual address. */
+       /* Size of this field, in bits, or zero if not packed.
+          For an unpacked field, the field's type's length
+          says how many bytes the field occupies.
+          A value of -1 or -2 indicates a static field;  -1 means the location
+          is specified by the label loc.physname;  -2 means that loc.physaddr
+          specifies the actual address. */
 
-      int bitsize;
+       int bitsize;
 
-      /* In a struct or union type, type of this field.
-        In a function type, type of this argument.
-        In an array type, the domain-type of the array.  */
+       /* In a struct or union type, type of this field.
+          In a function type, type of this argument.
+          In an array type, the domain-type of the array.  */
 
-      struct type *type;
+       struct type *type;
 
-      /* Name of field, value or argument.
-        NULL for range bounds and array domains.  */
+       /* Name of field, value or argument.
+          NULL for range bounds and array domains.  */
 
-      char *name;
+       char *name;
 
-    } *fields;
+      }
+     *fields;
 
-  /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
-     is the base class which defined the virtual function table pointer.  
+    /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
+       is the base class which defined the virtual function table pointer.  
 
-     For types that are pointer to member types (TYPE_CODE_MEMBER),
-     VPTR_BASETYPE is the type that this pointer is a member of.
+       For types that are pointer to member types (TYPE_CODE_MEMBER),
+       VPTR_BASETYPE is the type that this pointer is a member of.
 
-     For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
-     type that contains the method.
+       For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
+       type that contains the method.
 
-     Unused otherwise.  */
+       Unused otherwise.  */
 
-  struct type *vptr_basetype;
+    struct type *vptr_basetype;
 
-  /* Field number of the virtual function table pointer in
-     VPTR_BASETYPE.  If -1, we were unable to find the virtual
-     function table pointer in initial symbol reading, and
-     fill_in_vptr_fieldno should be called to find it if possible.
+    /* Field number of the virtual function table pointer in
+       VPTR_BASETYPE.  If -1, we were unable to find the virtual
+       function table pointer in initial symbol reading, and
+       fill_in_vptr_fieldno should be called to find it if possible.
 
-     Unused if this type does not have virtual functions.  */
+       Unused if this type does not have virtual functions.  */
 
-  int vptr_fieldno;
+    int vptr_fieldno;
 
-  /* Slot to point to additional language-specific fields of this type.  */
+    /* Slot to point to additional language-specific fields of this type.  */
 
-  union type_specific
-    {
+    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.  */
+       /* 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;
+       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. */
+       /* 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. */
 
-      struct cplus_struct_type *cplus_stuff;
+       struct cplus_struct_type *cplus_stuff;
 
-    } type_specific;
-};
+      }
+    type_specific;
+  };
 
 #define        NULL_TYPE ((struct type *) 0)
 
@@ -415,160 +419,162 @@ struct type
    nodes.  */
 
 struct cplus_struct_type
-{
-  /* Number of base classes this type derives from.  The baseclasses are
-     stored in the first N_BASECLASSES fields (i.e. the `fields' field of
-     the struct type).  I think only the `type' field of such a field has
-     any meaning.  */
+  {
+    /* Number of base classes this type derives from.  The baseclasses are
+       stored in the first N_BASECLASSES fields (i.e. the `fields' field of
+       the struct type).  I think only the `type' field of such a field has
+       any meaning.  */
 
-  short n_baseclasses;
+    short n_baseclasses;
 
-  /* Number of methods with unique names.  All overloaded methods with
-     the same name count only once. */
+    /* Number of methods with unique names.  All overloaded methods with
+       the same name count only once. */
 
-  short nfn_fields;
+    short nfn_fields;
 
-  /* Number of methods described for this type, not including the
-     methods that it derives from.  */
+    /* Number of methods described for this type, not including the
+       methods that it derives from.  */
 
-  short nfn_fields_total;
+    short nfn_fields_total;
 
-  /* The "declared_type" field contains a code saying how the
-     user really declared this type, e.g., "class s", "union s",
-     "struct s".
-     The 3 above things come out from the C++ compiler looking like classes, 
-     but we keep track of the real declaration so we can give
-     the correct information on "ptype". (Note: TEMPLATE may not
-     belong in this list...)  */
+    /* The "declared_type" field contains a code saying how the
+       user really declared this type, e.g., "class s", "union s",
+       "struct s".
+       The 3 above things come out from the C++ compiler looking like classes, 
+       but we keep track of the real declaration so we can give
+       the correct information on "ptype". (Note: TEMPLATE may not
+       belong in this list...)  */
 
 #define DECLARED_TYPE_CLASS 0
 #define DECLARED_TYPE_UNION 1
 #define DECLARED_TYPE_STRUCT 2
 #define DECLARED_TYPE_TEMPLATE 3
-  short declared_type; /* One of the above codes */
-  /* For derived classes, the number of base classes is given by n_baseclasses
-     and virtual_field_bits is a bit vector containing one bit per base class.
-     If the base class is virtual, the corresponding bit will be set.
-     I.E, given:
+    short declared_type;       /* One of the above codes */
+
+    /* For derived classes, the number of base classes is given by n_baseclasses
+       and virtual_field_bits is a bit vector containing one bit per base class.
+       If the base class is virtual, the corresponding bit will be set.
+       I.E, given:
 
-       class A{};
-       class B{};
-       class C : public B, public virtual A {};
+       class A{};
+       class B{};
+       class C : public B, public virtual A {};
 
-     B is a baseclass of C; A is a virtual baseclass for C.
-     This is a C++ 2.0 language feature. */
+       B is a baseclass of C; A is a virtual baseclass for C.
+       This is a C++ 2.0 language feature. */
 
-  B_TYPE *virtual_field_bits;
+    B_TYPE *virtual_field_bits;
 
-  /* For classes with private fields, the number of fields is given by
-     nfields and private_field_bits is a bit vector containing one bit
-     per field.
-     If the field is private, the corresponding bit will be set. */
+    /* For classes with private fields, the number of fields is given by
+       nfields and private_field_bits is a bit vector containing one bit
+       per field.
+       If the field is private, the corresponding bit will be set. */
 
-  B_TYPE *private_field_bits;
+    B_TYPE *private_field_bits;
 
-  /* For classes with protected fields, the number of fields is given by
-     nfields and protected_field_bits is a bit vector containing one bit
-     per field.
-     If the field is private, the corresponding bit will be set. */
+    /* For classes with protected fields, the number of fields is given by
+       nfields and protected_field_bits is a bit vector containing one bit
+       per field.
+       If the field is private, the corresponding bit will be set. */
 
-  B_TYPE *protected_field_bits;
+    B_TYPE *protected_field_bits;
 
-  /* for classes with fields to be ignored, either this is optimized out
-     or this field has length 0 */
+    /* for classes with fields to be ignored, either this is optimized out
+       or this field has length 0 */
 
-  B_TYPE *ignore_field_bits;
+    B_TYPE *ignore_field_bits;
 
-  /* For classes, structures, and unions, a description of each field,
-     which consists of an overloaded name, followed by the types of
-     arguments that the method expects, and then the name after it
-     has been renamed to make it distinct.
+    /* For classes, structures, and unions, a description of each field,
+       which consists of an overloaded name, followed by the types of
+       arguments that the method expects, and then the name after it
+       has been renamed to make it distinct.
 
-     fn_fieldlists points to an array of nfn_fields of these. */
+       fn_fieldlists points to an array of nfn_fields of these. */
 
-  struct fn_fieldlist
-    {
+    struct fn_fieldlist
+      {
 
-      /* The overloaded name.  */
+       /* The overloaded name.  */
 
-      char *name;
+       char *name;
 
-      /* The number of methods with this name.  */
+       /* The number of methods with this name.  */
 
-      int length;
+       int length;
 
-      /* The list of methods.  */
+       /* The list of methods.  */
 
-      struct fn_field
-       {
+       struct fn_field
+         {
 
-         /* If is_stub is clear, this is the mangled name which we can
-            look up to find the address of the method (FIXME: it would
-            be cleaner to have a pointer to the struct symbol here
-            instead).  */
+           /* If is_stub is clear, this is the mangled name which we can
+              look up to find the address of the method (FIXME: it would
+              be cleaner to have a pointer to the struct symbol here
+              instead).  */
 
-         /* If is_stub is set, this is the portion of the mangled
-            name which specifies the arguments.  For example, "ii",
-            if there are two int arguments, or "" if there are no
-            arguments.  See gdb_mangle_name for the conversion from this
-            format to the one used if is_stub is clear.  */
+           /* If is_stub is set, this is the portion of the mangled
+              name which specifies the arguments.  For example, "ii",
+              if there are two int arguments, or "" if there are no
+              arguments.  See gdb_mangle_name for the conversion from this
+              format to the one used if is_stub is clear.  */
 
-         char *physname;
+           char *physname;
 
-          /* The function type for the method.
-             (This comment used to say "The return value of the method",
-             but that's wrong. The function type 
-             is expected here, i.e. something with TYPE_CODE_FUNC,
-             and *not* the return-value type). */
+           /* The function type for the method.
+              (This comment used to say "The return value of the method",
+              but that's wrong. The function type 
+              is expected here, i.e. something with TYPE_CODE_FUNC,
+              and *not* the return-value type). */
 
-         struct type *type;
+           struct type *type;
 
-         /* The argument list.  Only valid if is_stub is clear.  Contains
-            the type of each argument, including `this', and ending with
-            a NULL pointer after the last argument.  Should not contain
-            a `this' pointer for static member functions.  */
+           /* The argument list.  Only valid if is_stub is clear.  Contains
+              the type of each argument, including `this', and ending with
+              a NULL pointer after the last argument.  Should not contain
+              a `this' pointer for static member functions.  */
 
-         struct type **args;
+           struct type **args;
 
-         /* For virtual functions.
-            First baseclass that defines this virtual function.   */
+           /* For virtual functions.
+              First baseclass that defines this virtual function.   */
 
-         struct type *fcontext;
+           struct type *fcontext;
 
-         /* Attributes. */
+           /* Attributes. */
 
-         unsigned int is_const : 1;
-         unsigned int is_volatile : 1;
-         unsigned int is_private : 1;
-         unsigned int is_protected : 1;
-         unsigned int is_public : 1;
-         unsigned int is_abstract : 1;
-         unsigned int is_static : 1;
-         unsigned int is_final : 1;
-         unsigned int is_synchronized : 1;
-         unsigned int is_native : 1;
+           unsigned int is_const:1;
+           unsigned int is_volatile:1;
+           unsigned int is_private:1;
+           unsigned int is_protected:1;
+           unsigned int is_public:1;
+           unsigned int is_abstract:1;
+           unsigned int is_static:1;
+           unsigned int is_final:1;
+           unsigned int is_synchronized:1;
+           unsigned int is_native:1;
 
-         /* A stub method only has some fields valid (but they are enough
-            to reconstruct the rest of the fields).  */
-         unsigned int is_stub : 1;
+           /* A stub method only has some fields valid (but they are enough
+              to reconstruct the rest of the fields).  */
+           unsigned int is_stub:1;
 
-          /* C++ method that is inlined */ 
-          unsigned int is_inlined : 1;
+           /* C++ method that is inlined */
+           unsigned int is_inlined:1;
 
-         /* Unused.  */
-         unsigned int dummy : 4;
+           /* Unused.  */
+           unsigned int dummy:4;
 
-         /* Index into that baseclass's virtual function table,
-            minus 2; else if static: VOFFSET_STATIC; else: 0.  */
+           /* Index into that baseclass's virtual function table,
+              minus 2; else if static: VOFFSET_STATIC; else: 0.  */
 
-         unsigned int voffset : 16;
+           unsigned int voffset:16;
 
-#        define VOFFSET_STATIC 1
+#define VOFFSET_STATIC 1
 
-       } *fn_fields;
+         }
+        *fn_fields;
 
-    } *fn_fieldlists;
+      }
+     *fn_fieldlists;
 
     /* If this "struct type" describes a template, then it 
      * has arguments. "template_args" points to an array of
@@ -579,10 +585,11 @@ struct cplus_struct_type
      */
     short ntemplate_args;
     struct template_arg
-    {
-      char *name;
-      struct type *type;
-    } *template_args;
+      {
+       char *name;
+       struct type *type;
+      }
+     *template_args;
 
     /* If this "struct type" describes a template, it has a list
      * of instantiations. "instantiations" is a pointer to an array
@@ -610,33 +617,38 @@ struct cplus_struct_type
      * point to the type information for all virtual bases among this type's
      * ancestors.
      */
-    struct runtime_info {
-      short has_vtable;
-      struct type * primary_base;
-      struct type ** virtual_base_list;
-    } * runtime_ptr;
+    struct runtime_info
+      {
+       short has_vtable;
+       struct type *primary_base;
+       struct type **virtual_base_list;
+      }
+     *runtime_ptr;
 
     /* Pointer to information about enclosing scope, if this is a
      * local type.  If it is not a local type, this is NULL
      */
-    struct local_type_info {
-      char * file;
-      int line;
-    } * localtype_ptr;  
-};
+    struct local_type_info
+      {
+       char *file;
+       int line;
+      }
+     *localtype_ptr;
+  };
 
 /* Struct used in computing virtual base list */
 struct vbase
-{
-    struct type * vbasetype;  /* pointer to virtual base */
-    struct vbase * next;      /* next in chain */
-};
+  {
+    struct type *vbasetype;    /* pointer to virtual base */
+    struct vbase *next;                /* next in chain */
+  };
 
 /* Struct used for ranking a function for overload resolution */
-struct badness_vector {
-  int length;
-  int * rank;
-};
+struct badness_vector
+  {
+    int length;
+    int *rank;
+  };
 
 /* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
    this shared static structure. */
@@ -803,18 +815,18 @@ allocate_cplus_struct_type PARAMS ((struct type *));
 #define TYPE_HAS_VTABLE(thistype) (TYPE_RUNTIME_PTR(thistype) && TYPE_VTABLE(thistype))
 #define TYPE_PRIMARY_BASE(thistype) (TYPE_RUNTIME_PTR(thistype)->primary_base)
 #define TYPE_VIRTUAL_BASE_LIST(thistype) (TYPE_RUNTIME_PTR(thistype)->virtual_base_list)
-  
+
 #define TYPE_LOCALTYPE_PTR(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr)
 #define TYPE_LOCALTYPE_FILE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->file)
 #define TYPE_LOCALTYPE_LINE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->line)
-              
+
 #define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) ||        \
                                    (TYPE_CODE (thistype) == TYPE_CODE_UNION))        && \
                                   (TYPE_NFIELDS (thistype) == 0)                     && \
                                   (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
-       
-         
-                        
+
+
+
 /* Implicit sizes */
 extern struct type *builtin_type_void;
 extern struct type *builtin_type_char;
@@ -880,7 +892,7 @@ extern struct type *builtin_type_f_integer;
 extern struct type *builtin_type_f_logical;
 extern struct type *builtin_type_f_logical_s1;
 extern struct type *builtin_type_f_logical_s2;
-extern struct type *builtin_type_f_integer; 
+extern struct type *builtin_type_f_integer;
 extern struct type *builtin_type_f_integer_s2;
 extern struct type *builtin_type_f_real;
 extern struct type *builtin_type_f_real_s8;
@@ -891,7 +903,7 @@ extern struct type *builtin_type_f_complex_s32;
 extern struct type *builtin_type_f_void;
 
 /* RTTI for C++ */
-/* extern struct type *builtin_type_cxx_typeinfo; */ 
+/* extern struct type *builtin_type_cxx_typeinfo; */
 
 /* Maximum and minimum values of built-in types */
 
@@ -918,22 +930,22 @@ extern struct type *builtin_type_f_void;
     : xmalloc (size))
 
 extern struct type *
-alloc_type PARAMS ((struct objfile *));
+  alloc_type PARAMS ((struct objfile *));
 
 extern struct type *
-init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
+  init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
 
 extern struct type *
-lookup_reference_type PARAMS ((struct type *));
+  lookup_reference_type PARAMS ((struct type *));
 
 extern struct type *
-make_reference_type PARAMS ((struct type *, struct type **));
+  make_reference_type PARAMS ((struct type *, struct type **));
 
 extern struct type *
-make_cv_type PARAMS ((int, int, struct type *, struct type **));
+  make_cv_type PARAMS ((int, int, struct type *, struct type **));
 
 extern struct type *
-lookup_member_type PARAMS ((struct type *, struct type *));
+  lookup_member_type PARAMS ((struct type *, struct type *));
 
 extern void
 smash_to_method_type PARAMS ((struct type *, struct type *, struct type *,
@@ -943,47 +955,47 @@ extern void
 smash_to_member_type PARAMS ((struct type *, struct type *, struct type *));
 
 extern struct type *
-allocate_stub_method PARAMS ((struct type *));
+  allocate_stub_method PARAMS ((struct type *));
 
 extern char *
-type_name_no_tag PARAMS ((const struct type *));
+  type_name_no_tag PARAMS ((const struct type *));
 
 extern struct type *
-lookup_struct_elt_type PARAMS ((struct type *, char *, int));
+  lookup_struct_elt_type PARAMS ((struct type *, char *, int));
 
 extern struct type *
-make_pointer_type PARAMS ((struct type *, struct type **));
+  make_pointer_type PARAMS ((struct type *, struct type **));
 
 extern struct type *
-lookup_pointer_type PARAMS ((struct type *));
+  lookup_pointer_type PARAMS ((struct type *));
 
 extern struct type *
-make_function_type PARAMS ((struct type *, struct type **));
+  make_function_type PARAMS ((struct type *, struct type **));
 
 extern struct type *
-lookup_function_type PARAMS ((struct type *));
+  lookup_function_type PARAMS ((struct type *));
 
 extern struct type *
-create_range_type PARAMS ((struct type *, struct type *, int, int));
+  create_range_type PARAMS ((struct type *, struct type *, int, int));
 
 extern struct type *
-create_array_type PARAMS ((struct type *, struct type *, struct type *));
+  create_array_type PARAMS ((struct type *, struct type *, struct type *));
 
 extern struct type *
-create_string_type PARAMS ((struct type *, struct type *));
+  create_string_type PARAMS ((struct type *, struct type *));
 
 extern struct type *create_set_type PARAMS ((struct type *, struct type *));
 
-extern int chill_varying_type PARAMS ((struct type*));
+extern int chill_varying_type PARAMS ((struct type *));
 
 extern struct type *
-lookup_unsigned_typename PARAMS ((char *));
+  lookup_unsigned_typename PARAMS ((char *));
 
 extern struct type *
-lookup_signed_typename PARAMS ((char *));
+  lookup_signed_typename PARAMS ((char *));
 
 extern struct type *
-check_typedef PARAMS ((struct type *));
+  check_typedef PARAMS ((struct type *));
 
 #define CHECK_TYPEDEF(TYPE) (TYPE) = check_typedef (TYPE)
 
@@ -991,29 +1003,29 @@ extern void
 check_stub_method PARAMS ((struct type *, int, int));
 
 extern struct type *
-lookup_primitive_typename PARAMS ((char *));
+  lookup_primitive_typename PARAMS ((char *));
 
 extern char *
-gdb_mangle_name PARAMS ((struct type *, int, int));
+  gdb_mangle_name PARAMS ((struct type *, int, int));
 
 extern struct type *
-builtin_type PARAMS ((char **));
+  builtin_type PARAMS ((char **));
 
 extern struct type *
-lookup_typename PARAMS ((char *, struct block *, int));
+  lookup_typename PARAMS ((char *, struct block *, int));
 
 extern struct type *
-lookup_template_type PARAMS ((char *, struct type *, struct block *));
+  lookup_template_type PARAMS ((char *, struct type *, struct block *));
 
 extern struct type *
-lookup_fundamental_type PARAMS ((struct objfile *, int));
+  lookup_fundamental_type PARAMS ((struct objfile *, int));
 
 extern void
 fill_in_vptr_fieldno PARAMS ((struct type *));
 
 extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *));
 
-extern int get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
+extern int get_discrete_bounds PARAMS ((struct type *, LONGEST *, LONGEST *));
 
 extern int
 is_ancestor PARAMS ((struct type *, struct type *));
@@ -1022,10 +1034,10 @@ extern int
 has_vtable PARAMS ((struct type *));
 
 extern struct type *
-primary_base_class PARAMS ((struct type *));
+  primary_base_class PARAMS ((struct type *));
 
 extern struct type **
-virtual_base_list PARAMS ((struct type *));
+  virtual_base_list PARAMS ((struct type *));
 
 extern int
 virtual_base_list_length PARAMS ((struct type *));
@@ -1042,7 +1054,7 @@ extern int
 class_index_in_primary_list PARAMS ((struct type *));
 
 extern int
-count_virtual_fns PARAMS ((struct type*));
+count_virtual_fns PARAMS ((struct type *));
 
 /* Constants for HP/Taligent ANSI C++ runtime model */
 
@@ -1073,9 +1085,9 @@ count_virtual_fns PARAMS ((struct type*));
 
 #define LENGTH_MATCH(bv) ((bv)->rank[0])
 
-/* Badness if parameter list length doesn't match arg list length */ 
+/* Badness if parameter list length doesn't match arg list length */
 #define LENGTH_MISMATCH_BADNESS      100
-/* Dummy badness value for nonexistent parameter positions */ 
+/* Dummy badness value for nonexistent parameter positions */
 #define TOO_FEW_PARAMS_BADNESS       100
 /* Badness if no conversion among types */
 #define INCOMPATIBLE_TYPE_BADNESS    100
@@ -1112,7 +1124,7 @@ extern int
 compare_badness PARAMS ((struct badness_vector *, struct badness_vector *));
 
 extern struct badness_vector *
-rank_function PARAMS ((struct type **, int, struct type **, int));
+  rank_function PARAMS ((struct type **, int, struct type **, int));
 
 extern int
 rank_one_type PARAMS ((struct type *, struct type *));
@@ -1132,4 +1144,4 @@ extern void maintenance_print_type PARAMS ((char *, int));
 
 extern void print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
 
-#endif /* GDBTYPES_H */
+#endif /* GDBTYPES_H */
index f50b64f326d516c239ebfaf0d9b5efdf05a4abf5..9a5b927c806ffc8a3a454727693f4a68f1c2e0ec 100644 (file)
@@ -19,8 +19,9 @@
 
    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.
-*/
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+ */
 
 #include <stdio.h>
 #include <string.h>
@@ -98,8 +99,8 @@ void inf_validate_procs (struct inf *inf);
 void inf_steal_exc_ports (struct inf *inf);
 void inf_restore_exc_ports (struct inf *inf);
 struct proc *inf_tid_to_proc (struct inf *inf, int tid);
-inline void inf_set_threads_resume_sc (struct inf *inf, 
-                                      struct proc *run_thread, 
+inline void inf_set_threads_resume_sc (struct inf *inf,
+                                      struct proc *run_thread,
                                       int run_others);
 inline int inf_set_threads_resume_sc_for_signal_thread (struct inf *inf);
 inline void inf_suspend (struct inf *inf);
@@ -119,7 +120,7 @@ thread_state_t proc_get_state (struct proc *proc, int force);
 struct proc *make_proc (struct inf *inf, mach_port_t port, int tid);
 struct proc *_proc_free (struct proc *proc);
 int proc_update_sc (struct proc *proc);
-error_t proc_get_exception_port (struct proc *proc, mach_port_t *port);
+error_t proc_get_exception_port (struct proc *proc, mach_port_t * port);
 error_t proc_set_exception_port (struct proc *proc, mach_port_t port);
 static mach_port_t _proc_get_exc_port (struct proc *proc);
 void proc_steal_exc_port (struct proc *proc, mach_port_t exc_port);
@@ -147,105 +148,106 @@ char *proc_string (struct proc *proc);
        __e; }) \
    : EIEIO)
 
-#define MIG_SERVER_DIED EMIG_SERVER_DIED /* XXX */
+#define MIG_SERVER_DIED EMIG_SERVER_DIED       /* XXX */
 \f
 /* The state passed by an exception message.  */
 struct exc_state
-{
-  int exception;               /* The exception code */
-  int code, subcode;
-  mach_port_t handler;         /* The real exception port to handle this. */
-  mach_port_t reply;           /* The reply port from the exception call. */
-};
+  {
+    int exception;             /* The exception code */
+    int code, subcode;
+    mach_port_t handler;       /* The real exception port to handle this. */
+    mach_port_t reply;         /* The reply port from the exception call. */
+  };
 
 /* The results of the last wait an inf did. */
 struct inf_wait
-{
-  struct target_waitstatus status; /* The status returned to gdb.  */
-  struct exc_state exc;                /* The exception that caused us to return. */
-  struct proc *thread;         /* The thread in question.  */
-  int suppress;                        /* Something trivial happened.  */
-};
+  {
+    struct target_waitstatus status;   /* The status returned to gdb.  */
+    struct exc_state exc;      /* The exception that caused us to return. */
+    struct proc *thread;       /* The thread in question.  */
+    int suppress;              /* Something trivial happened.  */
+  };
 
 /* The state of an inferior.  */
 struct inf
-{
-  /* Fields describing the current inferior.  */
+  {
+    /* Fields describing the current inferior.  */
 
-  struct proc *task;           /* The mach task.   */
-  struct proc *threads;                /* A linked list of all threads in TASK.  */
+    struct proc *task;         /* The mach task.   */
+    struct proc *threads;      /* A linked list of all threads in TASK.  */
 
-  /* True if THREADS needn't be validated by querying the task.  We assume that
-     we and the task in question are the only ones frobbing the thread list,
-     so as long as we don't let any code run, we don't have to worry about
-     THREADS changing.  */
-  int threads_up_to_date;
+    /* True if THREADS needn't be validated by querying the task.  We assume that
+       we and the task in question are the only ones frobbing the thread list,
+       so as long as we don't let any code run, we don't have to worry about
+       THREADS changing.  */
+    int threads_up_to_date;
 
-  pid_t pid;                   /* The real system PID. */
+    pid_t pid;                 /* The real system PID. */
 
-  struct inf_wait wait;                /* What to return from target_wait.  */
+    struct inf_wait wait;      /* What to return from target_wait.  */
 
-  /* One thread proc in INF may be in `single-stepping mode'.  This is it.  */
-  struct proc *step_thread;
+    /* One thread proc in INF may be in `single-stepping mode'.  This is it.  */
+    struct proc *step_thread;
 
-  /* The thread we think is the signal thread.  */
-  struct proc *signal_thread;
+    /* The thread we think is the signal thread.  */
+    struct proc *signal_thread;
 
-  mach_port_t event_port;      /* Where we receive various msgs.  */
+    mach_port_t event_port;    /* Where we receive various msgs.  */
 
-  /* True if we think at least one thread in the inferior could currently be
-     running.  */
-  unsigned int running : 1;
+    /* True if we think at least one thread in the inferior could currently be
+       running.  */
+    unsigned int running:1;
 
-  /* True if the process has stopped (in the proc server sense).  Note that
-     since a proc server `stop' leaves the signal thread running, the inf can
-     be RUNNING && STOPPED...  */
-  unsigned int stopped : 1;
+    /* True if the process has stopped (in the proc server sense).  Note that
+       since a proc server `stop' leaves the signal thread running, the inf can
+       be RUNNING && STOPPED...  */
+    unsigned int stopped:1;
 
-  /* True if the inferior has no message port.  */
-  unsigned int nomsg : 1;
+    /* True if the inferior has no message port.  */
+    unsigned int nomsg:1;
 
-  /* True if the inferior is traced.  */
-  unsigned int traced : 1;
+    /* True if the inferior is traced.  */
+    unsigned int traced:1;
 
-  /* True if we shouldn't try waiting for the inferior, usually because we
-     can't for some reason.  */
-  unsigned int no_wait : 1;
+    /* True if we shouldn't try waiting for the inferior, usually because we
+       can't for some reason.  */
+    unsigned int no_wait:1;
 
-  /* When starting a new inferior, we don't try to validate threads until all
-     the proper execs have been done.  This is a count of how many execs we
-     expect to happen.  */
-  unsigned pending_execs;
+    /* When starting a new inferior, we don't try to validate threads until all
+       the proper execs have been done.  This is a count of how many execs we
+       expect to happen.  */
+    unsigned pending_execs;
 
-  /* Fields describing global state */
+    /* Fields describing global state */
 
-  /* The task suspend count used when gdb has control.  This is normally 1 to
-     make things easier for us, but sometimes (like when attaching to vital
-     system servers) it may be desirable to let the task continue to run
-     (pausing individual threads as necessary).  */
-  int pause_sc;
+    /* The task suspend count used when gdb has control.  This is normally 1 to
+       make things easier for us, but sometimes (like when attaching to vital
+       system servers) it may be desirable to let the task continue to run
+       (pausing individual threads as necessary).  */
+    int pause_sc;
 
-  /* The task suspend count left when detaching from a task.  */
-  int detach_sc;
+    /* The task suspend count left when detaching from a task.  */
+    int detach_sc;
 
-  /* The initial values used for the run_sc and pause_sc of newly discovered
-     threads -- see the definition of those fields in struct proc.  */
-  int default_thread_run_sc;
-  int default_thread_pause_sc;
-  int default_thread_detach_sc;
+    /* The initial values used for the run_sc and pause_sc of newly discovered
+       threads -- see the definition of those fields in struct proc.  */
+    int default_thread_run_sc;
+    int default_thread_pause_sc;
+    int default_thread_detach_sc;
 
-  /* True if the process should be traced when started/attached.  Newly
-     started processes *must* be traced at first to exec them properly, but
-     if this is false, tracing is turned off as soon it has done so.  */
-  int want_signals;
+    /* True if the process should be traced when started/attached.  Newly
+       started processes *must* be traced at first to exec them properly, but
+       if this is false, tracing is turned off as soon it has done so.  */
+    int want_signals;
 
-  /* True if exceptions from the inferior process should be trapped.  This
-     must be on to use breakpoints.  */
-  int want_exceptions;
-};
+    /* True if exceptions from the inferior process should be trapped.  This
+       must be on to use breakpoints.  */
+    int want_exceptions;
+  };
 
 
-int __proc_pid (struct proc *proc)
+int
+__proc_pid (struct proc *proc)
 {
   return proc->inf->pid;
 }
@@ -256,7 +258,7 @@ int
 proc_update_sc (struct proc *proc)
 {
   int running;
-  int err =  0;
+  int err = 0;
   int delta = proc->sc - proc->cur_sc;
 
   if (delta)
@@ -268,8 +270,8 @@ proc_update_sc (struct proc *proc)
       assert (proc_is_thread (proc));
       proc_debug (proc, "storing back changed thread state");
       err = thread_set_state (proc->port, THREAD_STATE_FLAVOR,
-                             (thread_state_t)&proc->state, THREAD_STATE_SIZE);
-      if (! err)
+                        (thread_state_t) & proc->state, THREAD_STATE_SIZE);
+      if (!err)
        proc->state_changed = 0;
     }
 
@@ -286,7 +288,7 @@ proc_update_sc (struct proc *proc)
       else
        err = thread_resume (proc->port);
 
-  if (! err)
+  if (!err)
     proc->cur_sc = proc->sc;
 
   /* If we got an error, then the task/thread has disappeared.  */
@@ -315,7 +317,7 @@ proc_abort (struct proc *proc, int force)
 {
   assert (proc_is_thread (proc));
 
-  if (! proc->aborted)
+  if (!proc->aborted)
     {
       struct inf *inf = proc->inf;
       int running = (proc->cur_sc == 0 && inf->task->cur_sc == 0);
@@ -331,7 +333,7 @@ proc_abort (struct proc *proc, int force)
        /* An exception is pending on PROC, which don't mess with.  */
        running = 1;
 
-      if (! running)
+      if (!running)
        /* We only abort the thread if it's not actually running.  */
        {
          thread_abort (proc->port);
@@ -357,16 +359,16 @@ proc_get_state (struct proc *proc, int will_modify)
 
   proc_abort (proc, will_modify);
 
-  if (! was_aborted && proc->aborted)
+  if (!was_aborted && proc->aborted)
     /* PROC's state may have changed since we last fetched it.  */
     proc->state_valid = 0;
 
-  if (! proc->state_valid)
+  if (!proc->state_valid)
     {
       mach_msg_type_number_t state_size = THREAD_STATE_SIZE;
       error_t err =
-       thread_get_state (proc->port, THREAD_STATE_FLAVOR,
-                         (thread_state_t)&proc->state, &state_size);
+      thread_get_state (proc->port, THREAD_STATE_FLAVOR,
+                       (thread_state_t) & proc->state, &state_size);
       proc_debug (proc, "getting thread state");
       proc->state_valid = !err;
     }
@@ -375,7 +377,7 @@ proc_get_state (struct proc *proc, int will_modify)
     {
       if (will_modify)
        proc->state_changed = 1;
-      return (thread_state_t)&proc->state;
+      return (thread_state_t) & proc->state;
     }
   else
     return 0;
@@ -383,7 +385,7 @@ proc_get_state (struct proc *proc, int will_modify)
 \f
 /* Set PORT to PROC's exception port.  */
 error_t
-proc_get_exception_port (struct proc *proc, mach_port_t *port)
+proc_get_exception_port (struct proc * proc, mach_port_t * port)
 {
   if (proc_is_task (proc))
     return task_get_exception_port (proc->port, port);
@@ -393,7 +395,7 @@ proc_get_exception_port (struct proc *proc, mach_port_t *port)
 
 /* Set PROC's exception port to PORT.  */
 error_t
-proc_set_exception_port (struct proc *proc, mach_port_t port)
+proc_set_exception_port (struct proc * proc, mach_port_t port)
 {
   proc_debug (proc, "setting exception port: %d", port);
   if (proc_is_task (proc))
@@ -502,15 +504,15 @@ proc_trace (struct proc *proc, int set)
 {
   thread_state_t state = proc_get_state (proc, 1);
 
-  if (! state)
+  if (!state)
     return 0;                  /* the thread must be dead.  */
 
   proc_debug (proc, "tracing %s", set ? "on" : "off");
-  
+
   if (set)
     {
       /* XXX We don't get the exception unless the thread has its own
-        exception port???? */
+         exception port???? */
       if (proc->exc_port == MACH_PORT_NULL)
        proc_steal_exc_port (proc, proc->inf->event_port);
       THREAD_STATE_SET_TRACED (state);
@@ -559,7 +561,7 @@ make_proc (struct inf *inf, mach_port_t port, int tid)
 
   /* Get notified when things die.  */
   err =
-    mach_port_request_notification (mach_task_self(), port,
+    mach_port_request_notification (mach_task_self (), port,
                                    MACH_NOTIFY_DEAD_NAME, 1,
                                    inf->event_port,
                                    MACH_MSG_TYPE_MAKE_SEND_ONCE,
@@ -621,7 +623,8 @@ _proc_free (struct proc *proc)
   return next;
 }
 \f
-struct inf *make_inf ()
+struct inf *
+make_inf ()
 {
   struct inf *inf = malloc (sizeof (struct inf));
 
@@ -721,7 +724,7 @@ inf_startup (struct inf *inf, int pid)
 }
 \f
 /* close current process, if any, and attach INF to process PORT */
-void 
+void
 inf_set_pid (struct inf *inf, pid_t pid)
 {
   task_t task_port;
@@ -760,7 +763,7 @@ inf_set_pid (struct inf *inf, pid_t pid)
     {
       inf->pid = pid;
       if (inf->pause_sc)
-       inf->task->sc = inf->task->cur_sc = 1; /* Reflect task_suspend above */
+       inf->task->sc = inf->task->cur_sc = 1;  /* Reflect task_suspend above */
     }
   else
     inf->pid = -1;
@@ -779,18 +782,18 @@ inf_validate_procinfo (struct inf *inf)
   mach_msg_type_number_t pi_len = 0;
   int info_flags = 0;
   error_t err =
-    proc_getprocinfo (proc_server, inf->pid, &info_flags,
-                     (procinfo_t *)&pi, &pi_len, &noise, &noise_len);
+  proc_getprocinfo (proc_server, inf->pid, &info_flags,
+                   (procinfo_t *) & pi, &pi_len, &noise, &noise_len);
 
-  if (! err)
+  if (!err)
     {
       inf->stopped = !!(pi->state & PI_STOPPED);
       inf->nomsg = !!(pi->state & PI_NOMSG);
       if (inf->nomsg)
        inf->traced = !!(pi->state & PI_TRACED);
-      vm_deallocate (mach_task_self (), (vm_address_t)pi, pi_len);
+      vm_deallocate (mach_task_self (), (vm_address_t) pi, pi_len);
       if (noise_len > 0)
-       vm_deallocate (mach_task_self (), (vm_address_t)noise, noise_len);
+       vm_deallocate (mach_task_self (), (vm_address_t) noise, noise_len);
     }
 }
 
@@ -802,7 +805,7 @@ inf_validate_task_sc (struct inf *inf)
   struct task_basic_info info;
   mach_msg_type_number_t info_len = TASK_BASIC_INFO_COUNT;
   error_t err =
-    task_info (inf->task->port, TASK_BASIC_INFO, (task_info_t)&info, &info_len);
+  task_info (inf->task->port, TASK_BASIC_INFO, (task_info_t) & info, &info_len);
 
   if (err)
     inf->task->dead = 1;       /* oh well */
@@ -814,7 +817,7 @@ inf_validate_task_sc (struct inf *inf)
       abort =
        !query ("Pid %d has an additional task suspend count of %d; clear it? ",
                inf->pid, info.suspend_count - inf->task->cur_sc);
-      target_terminal_inferior (); /* Give it back to the child.  */
+      target_terminal_inferior ();     /* Give it back to the child.  */
 
       if (abort)
        error ("Additional task suspend count left untouched.");
@@ -833,10 +836,10 @@ inf_set_traced (struct inf *inf, int on)
     if (inf->task && !inf->task->dead)
       /* Make it take effect immediately.  */
       {
-       sigset_t mask = on ? ~(sigset_t)0 : 0;
+       sigset_t mask = on ? ~(sigset_t) 0 : 0;
        error_t err =
-         INF_RESUME_MSGPORT_RPC (inf, msg_set_init_int (msgport, refport,
-                                                        INIT_TRACEMASK, mask));
+       INF_RESUME_MSGPORT_RPC (inf, msg_set_init_int (msgport, refport,
+                                                    INIT_TRACEMASK, mask));
        if (err == EIEIO)
          {
            if (on)
@@ -856,7 +859,7 @@ inf_set_traced (struct inf *inf, int on)
 \f
 /* Makes all the real suspend count deltas of all the procs in INF match the
    desired values.  Careful to always do thread/task suspend counts in the
-   safe order.  Returns true if at least one thread is thought to be running.*/
+   safe order.  Returns true if at least one thread is thought to be running. */
 int
 inf_update_suspends (struct inf *inf)
 {
@@ -896,7 +899,7 @@ inf_update_suspends (struct inf *inf)
       inf->running = thread_running && task_running;
 
       /* Once any thread has executed some code, we can't depend on the
-        threads list any more.  */
+         threads list any more.  */
       if (inf->running)
        inf->threads_up_to_date = 0;
 
@@ -984,7 +987,7 @@ inf_validate_procs (struct inf *inf)
        for (i = search_start, left = num_threads; left; i++, left--)
          {
            if (i >= num_threads)
-             i -= num_threads; /* I wrapped around.  */
+             i -= num_threads; /* I wrapped around.  */
            if (thread->port == threads[i])
              /* We already know about this thread.  */
              {
@@ -996,11 +999,11 @@ inf_validate_procs (struct inf *inf)
              }
          }
 
-       if (! left)
+       if (!left)
          {
            proc_debug (thread, "died!");
            thread->port = MACH_PORT_NULL;
-           thread = _proc_free (thread); /* THREAD is dead.  */
+           thread = _proc_free (thread);       /* THREAD is dead.  */
            (last ? last->next : inf->threads) = thread;
          }
       }
@@ -1016,11 +1019,11 @@ inf_validate_procs (struct inf *inf)
          (last ? last->next : inf->threads) = thread;
          last = thread;
          proc_debug (thread, "new thread: %d", threads[i]);
-         add_thread (thread->tid); /* Tell GDB's generic thread code.  */
+         add_thread (thread->tid);     /* Tell GDB's generic thread code.  */
        }
 
-    vm_deallocate(mach_task_self(),
-                 (vm_address_t)threads, (num_threads * sizeof(thread_t)));
+    vm_deallocate (mach_task_self (),
+                (vm_address_t) threads, (num_threads * sizeof (thread_t)));
   }
 }
 \f
@@ -1028,9 +1031,9 @@ inf_validate_procs (struct inf *inf)
 inline int
 inf_update_procs (struct inf *inf)
 {
-  if (! inf->task)
+  if (!inf->task)
     return 0;
-  if (! inf->threads_up_to_date)
+  if (!inf->threads_up_to_date)
     inf_validate_procs (inf);
   return !!inf->task;
 }
@@ -1038,7 +1041,7 @@ inf_update_procs (struct inf *inf)
 /* Sets the resume_sc of each thread in inf.  That of RUN_THREAD is set to 0,
    and others are set to their run_sc if RUN_OTHERS is true, and otherwise
    their pause_sc.  */
-inline void 
+inline void
 inf_set_threads_resume_sc (struct inf *inf,
                           struct proc *run_thread, int run_others)
 {
@@ -1067,7 +1070,7 @@ inf_resume (struct inf *inf)
 
   if (inf->task)
     {
-      if (! inf->pending_execs)
+      if (!inf->pending_execs)
        /* Try to make sure our task count is correct -- in the case where
           we're waiting for an exec though, things are too volatile, so just
           assume things will be reasonable (which they usually will be).  */
@@ -1112,7 +1115,7 @@ inf_set_step_thread (struct inf *inf, struct proc *thread)
   if (inf->step_thread != thread)
     {
       if (inf->step_thread && inf->step_thread->port != MACH_PORT_NULL)
-       if (! proc_trace (inf->step_thread, 0))
+       if (!proc_trace (inf->step_thread, 0))
          return;
       if (thread && proc_trace (thread, 1))
        inf->step_thread = thread;
@@ -1199,7 +1202,8 @@ inf_attach (struct inf *inf, int pid)
 }
 \f
 /* Makes sure that we've got our exception ports entrenched in the process. */
-void inf_steal_exc_ports (struct inf *inf)
+void
+inf_steal_exc_ports (struct inf *inf)
 {
   struct proc *thread;
 
@@ -1213,7 +1217,8 @@ void inf_steal_exc_ports (struct inf *inf)
 }
 
 /* Makes sure the process has its own exception ports.  */
-void inf_restore_exc_ports (struct inf *inf)
+void
+inf_restore_exc_ports (struct inf *inf)
 {
   struct proc *thread;
 
@@ -1269,37 +1274,37 @@ inf_signal (struct inf *inf, enum target_signal sig)
     }
   else
     /* A Unix signal.  */
-    if (inf->stopped)
-      /* The process is stopped and expecting a signal.  Just send off a
-        request and let it get handled when we resume everything.  */
-      {
-       inf_debug (inf, "sending %s to stopped process", NAME);
-       err =
-         INF_MSGPORT_RPC (inf,
-                          msg_sig_post_untraced_request (msgport,
-                                                         inf->event_port,
-                                                         MACH_MSG_TYPE_MAKE_SEND_ONCE,
-                                                         host_sig, 0,
-                                                         refport));
-       if (! err)
-         /* Posting an untraced signal automatically continues it.
-            We clear this here rather than when we get the reply
-            because we'd rather assume it's not stopped when it
-            actually is, than the reverse.  */
-         inf->stopped = 0;
-      }
-    else
-      /* It's not expecting it.  We have to let just the signal thread
-        run, and wait for it to get into a reasonable state before we
-        can continue the rest of the process.  When we finally resume the
-        process the signal we request will be the very first thing that
-        happens. */
-      {
-       inf_debug (inf, "sending %s to unstopped process (so resuming signal thread)", NAME);
-       err = 
-         INF_RESUME_MSGPORT_RPC (inf, msg_sig_post_untraced (msgport,
-                                                             host_sig, 0, refport));
-      }
+  if (inf->stopped)
+    /* The process is stopped and expecting a signal.  Just send off a
+       request and let it get handled when we resume everything.  */
+    {
+      inf_debug (inf, "sending %s to stopped process", NAME);
+      err =
+       INF_MSGPORT_RPC (inf,
+                        msg_sig_post_untraced_request (msgport,
+                                                       inf->event_port,
+                                              MACH_MSG_TYPE_MAKE_SEND_ONCE,
+                                                       host_sig, 0,
+                                                       refport));
+      if (!err)
+       /* Posting an untraced signal automatically continues it.
+          We clear this here rather than when we get the reply
+          because we'd rather assume it's not stopped when it
+          actually is, than the reverse.  */
+       inf->stopped = 0;
+    }
+  else
+    /* It's not expecting it.  We have to let just the signal thread
+       run, and wait for it to get into a reasonable state before we
+       can continue the rest of the process.  When we finally resume the
+       process the signal we request will be the very first thing that
+       happens. */
+    {
+      inf_debug (inf, "sending %s to unstopped process (so resuming signal thread)", NAME);
+      err =
+       INF_RESUME_MSGPORT_RPC (inf, msg_sig_post_untraced (msgport,
+                                                    host_sig, 0, refport));
+    }
 
   if (err == EIEIO)
     /* Can't do too much... */
@@ -1318,18 +1323,18 @@ inf_continue (struct inf *inf)
   process_t proc;
   error_t err = proc_pid2proc (proc_server, inf->pid, &proc);
 
-  if (! err)
+  if (!err)
     {
       inf_debug (inf, "continuing process");
 
       err = proc_mark_cont (proc);
-      if (! err)
+      if (!err)
        {
          struct proc *thread;
 
          for (thread = inf->threads; thread; thread = thread->next)
            thread_resume (thread->port);
-         
+
          inf->stopped = 0;
        }
     }
@@ -1349,11 +1354,13 @@ struct inf *waiting_inf;
 static int
 gnu_wait (int tid, struct target_waitstatus *status)
 {
-  struct msg {
-    mach_msg_header_t hdr;
-    mach_msg_type_t type;
-    int data[8000];
-  } msg;
+  struct msg
+    {
+      mach_msg_header_t hdr;
+      mach_msg_type_t type;
+      int data[8000];
+    }
+  msg;
   error_t err;
   struct proc *thread;
   struct inf *inf = current_inferior;
@@ -1374,7 +1381,7 @@ gnu_wait (int tid, struct target_waitstatus *status)
 
   inf_debug (inf, "waiting for: %d", tid);
 
- rewait:
+rewait:
   if (proc_wait_pid != inf->pid && !inf->no_wait)
     /* Always get information on events from the proc server.  */
     {
@@ -1399,7 +1406,7 @@ gnu_wait (int tid, struct target_waitstatus *status)
          /* Even if proc_waits_pending was > 0 before, we still won't get
             any other replies, because it was either from a different INF,
             or a different process attached to INF -- and the event port,
-            which is the wait reply port, changes when you switch processes.*/
+            which is the wait reply port, changes when you switch processes. */
          proc_waits_pending = 1;
        }
     }
@@ -1429,20 +1436,22 @@ gnu_wait (int tid, struct target_waitstatus *status)
     error ("Couldn't wait for an event: %s", strerror (err));
   else
     {
-      struct {
-       mach_msg_header_t hdr;
-       mach_msg_type_t err_type;
-       kern_return_t err;
-       char noise[200];
-      } reply;
+      struct
+       {
+         mach_msg_header_t hdr;
+         mach_msg_type_t err_type;
+         kern_return_t err;
+         char noise[200];
+       }
+      reply;
 
       inf_debug (inf, "event: msgid = %d", msg.hdr.msgh_id);
 
       /* Handle what we got.  */
-      if (! notify_server (&msg.hdr, &reply.hdr)
-         && ! exc_server (&msg.hdr, &reply.hdr)
-         && ! process_reply_server (&msg.hdr, &reply.hdr)
-         && ! msg_reply_server (&msg.hdr, &reply.hdr))
+      if (!notify_server (&msg.hdr, &reply.hdr)
+         && !exc_server (&msg.hdr, &reply.hdr)
+         && !process_reply_server (&msg.hdr, &reply.hdr)
+         && !msg_reply_server (&msg.hdr, &reply.hdr))
        /* Whatever it is, it's something strange.  */
        error ("Got a strange event, msg id = %d.", msg.hdr.msgh_id);
 
@@ -1474,9 +1483,9 @@ gnu_wait (int tid, struct target_waitstatus *status)
          if (--inf->pending_execs == 0)
            /* We're done!  */
            {
-#if 0  /* do we need this? */
+#if 0                          /* do we need this? */
              prune_threads (1);        /* Get rid of the old shell threads */
-             renumber_threads (0); /* Give our threads reasonable names. */
+             renumber_threads (0);     /* Give our threads reasonable names. */
 #endif
            }
          inf_debug (inf, "pending exec completed, pending_execs => %d",
@@ -1514,7 +1523,7 @@ gnu_wait (int tid, struct target_waitstatus *status)
     if (inf_update_procs (inf) && inf->threads)
       tid = inf->threads->tid; /* The first available thread.  */
     else
-      tid = inferior_pid; /* let wait_for_inferior handle exit case */
+      tid = inferior_pid;      /* let wait_for_inferior handle exit case */
 
   if (thread && tid >= 0 && status->kind != TARGET_WAITKIND_SPURIOUS
       && inf->pause_sc == 0 && thread->pause_sc == 0)
@@ -1522,7 +1531,7 @@ gnu_wait (int tid, struct target_waitstatus *status)
     {
       thread->sc = 1;
       inf_update_suspends (inf);
-    }      
+    }
 
   inf_debug (inf, "returning tid = %d, status = %s (%d)", tid,
             status->kind == TARGET_WAITKIND_EXITED ? "EXITED"
@@ -1562,7 +1571,7 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
   mach_port_deallocate (mach_task_self (), thread_port);
   mach_port_deallocate (mach_task_self (), task_port);
 
-  if (! thread->aborted)
+  if (!thread->aborted)
     /* THREAD hasn't been aborted since this exception happened (abortion
        clears any exception state), so it must be real.  */
     {
@@ -1662,7 +1671,7 @@ do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_port)
     }
 
   mach_port_deallocate (mach_task_self (), dead_port);
-  inf->threads_up_to_date = 0; /* Just in case */
+  inf->threads_up_to_date = 0; /* Just in case */
 
   return 0;
 }
@@ -1815,7 +1824,7 @@ port_msgs_queued (mach_port_t port)
 {
   struct mach_port_status status;
   error_t err =
-    mach_port_get_receive_status (mach_task_self (), port, &status);
+  mach_port_get_receive_status (mach_task_self (), port, &status);
 
   if (err)
     return 0;
@@ -1838,7 +1847,7 @@ port_msgs_queued (mach_port_t port)
    Note that a resume may not `take' if there are pending exceptions/&c
    still unprocessed from the last resume we did (any given resume may result
    in multiple events returned by wait).
-*/
+ */
 static void
 gnu_resume (int tid, int step, enum target_signal sig)
 {
@@ -1848,7 +1857,7 @@ gnu_resume (int tid, int step, enum target_signal sig)
   inf_debug (inf, "tid = %d, step = %d, sig = %d", tid, step, sig);
 
   inf_validate_procinfo (inf);
-  
+
   if (sig != TARGET_SIGNAL_0 || inf->stopped)
     {
       if (sig == TARGET_SIGNAL_0 && inf->nomsg)
@@ -1884,7 +1893,7 @@ gnu_resume (int tid, int step, enum target_signal sig)
     /* Just allow a single thread to run.  */
     {
       struct proc *thread = inf_tid_to_thread (inf, tid);
-      if (! thread)
+      if (!thread)
        error ("Can't run single thread id %d: no such thread!");
       inf_debug (inf, "running one thread: %d/%d", inf->pid, thread->tid);
       inf_set_threads_resume_sc (inf, thread, 0);
@@ -1893,7 +1902,7 @@ gnu_resume (int tid, int step, enum target_signal sig)
   if (step)
     {
       step_thread = inf_tid_to_thread (inf, tid);
-      if (! step_thread)
+      if (!step_thread)
        warning ("Can't step thread id %d: no such thread.", tid);
       else
        inf_debug (inf, "stepping thread: %d/%d", inf->pid, step_thread->tid);
@@ -1946,7 +1955,7 @@ inf_pick_first_thread ()
 static struct inf *
 cur_inf ()
 {
-  if (! current_inferior)
+  if (!current_inferior)
     current_inferior = make_inf ();
   return current_inferior;
 }
@@ -1960,33 +1969,33 @@ gnu_create_inferior (exec_file, allargs, env)
   struct inf *inf = cur_inf ();
 
   void trace_me ()
-    {
-      /* We're in the child; make this process stop as soon as it execs.  */
-      inf_debug (inf, "tracing self");
-      if (ptrace (PTRACE_TRACEME) != 0)
-       error ("ptrace (PTRACE_TRACEME) failed!");
-    }
+  {
+    /* We're in the child; make this process stop as soon as it execs.  */
+    inf_debug (inf, "tracing self");
+    if (ptrace (PTRACE_TRACEME) != 0)
+      error ("ptrace (PTRACE_TRACEME) failed!");
+  }
   void attach_to_child (int pid)
-    {
-      /* Attach to the now stopped child, which is actually a shell...  */
-      inf_debug (inf, "attaching to child: %d", pid);
+  {
+    /* Attach to the now stopped child, which is actually a shell...  */
+    inf_debug (inf, "attaching to child: %d", pid);
 
-      inf_attach (inf, pid);
+    inf_attach (inf, pid);
 
-      attach_flag = 0;
-      push_target (&gnu_ops);
+    attach_flag = 0;
+    push_target (&gnu_ops);
 
-      inf->pending_execs = 2;
-      inf->nomsg = 1;
-      inf->traced = 1;
+    inf->pending_execs = 2;
+    inf->nomsg = 1;
+    inf->traced = 1;
 
-      /* Now let the child run again, knowing that it will stop immediately
-        because of the ptrace. */
-      inf_resume (inf);
-      inferior_pid = inf_pick_first_thread ();
+    /* Now let the child run again, knowing that it will stop immediately
+       because of the ptrace. */
+    inf_resume (inf);
+    inferior_pid = inf_pick_first_thread ();
 
-      startup_inferior (inf->pending_execs);
-    }
+    startup_inferior (inf->pending_execs);
+  }
 
   inf_debug (inf, "creating inferior");
 
@@ -2005,7 +2014,7 @@ gnu_create_inferior (exec_file, allargs, env)
     inf_restore_exc_ports (inf);
 
   /* Here we go!  */
-  proceed ((CORE_ADDR) -1, 0, 0);
+  proceed ((CORE_ADDR) - 1, 0, 0);
 }
 
 /* Mark our target-struct as eligible for stray "run" and "attach"
@@ -2034,7 +2043,7 @@ gnu_attach (args, from_tty)
 
   pid = atoi (args);
 
-  if (pid == getpid())         /* Trying to masturbate? */
+  if (pid == getpid ())                /* Trying to masturbate? */
     error ("I refuse to debug myself!");
 
   if (from_tty)
@@ -2063,7 +2072,7 @@ gnu_attach (args, from_tty)
   /* We have to initialize the terminal settings now, since the code
      below might try to restore them.  */
   target_terminal_init ();
-  
+
   /* If the process was stopped before we attached, make it continue the next
      time the user does a continue.  */
   inf_validate_procinfo (inf);
@@ -2071,7 +2080,7 @@ gnu_attach (args, from_tty)
   inf_update_signal_thread (inf);
   inf_set_traced (inf, inf->want_signals);
 
-#if 0 /* Do we need this? */
+#if 0                          /* Do we need this? */
   renumber_threads (0);                /* Give our threads reasonable names. */
 #endif
 }
@@ -2098,12 +2107,12 @@ gnu_detach (args, from_tty)
        printf_unfiltered ("Detaching from pid %d\n", current_inferior->pid);
       gdb_flush (gdb_stdout);
     }
-  
+
   inf_detach (current_inferior);
 
   inferior_pid = 0;
 
-  unpush_target (&gnu_ops);            /* Pop out of handling an inferior */
+  unpush_target (&gnu_ops);    /* Pop out of handling an inferior */
 }
 #endif /* ATTACH_DETACH */
 
@@ -2148,7 +2157,7 @@ gnu_pid_to_exec_file ()
   error ("to_pid_to_exec_file target function not implemented");
   return NULL;
 }
+
 
 static int
 gnu_thread_alive (int tid)
@@ -2173,16 +2182,16 @@ gnu_read_inferior (task, addr, myaddr, length)
   error_t err;
   vm_address_t low_address = (vm_address_t) trunc_page (addr);
   vm_size_t aligned_length =
-    (vm_size_t) round_page (addr+length) - low_address;
-  pointer_t    copied;
-  int         copy_count;
+  (vm_size_t) round_page (addr + length) - low_address;
+  pointer_t copied;
+  int copy_count;
 
   /* Get memory from inferior with page aligned addresses */
   err = vm_read (task, low_address, aligned_length, &copied, &copy_count);
   if (err)
     return 0;
 
-  err = hurd_safe_copyin (myaddr, (void*)addr - low_address + copied, length);
+  err = hurd_safe_copyin (myaddr, (void *) addr - low_address + copied, length);
   if (err)
     {
       warning ("Read from inferior faulted: %s", strerror (err));
@@ -2199,14 +2208,15 @@ gnu_read_inferior (task, addr, myaddr, length)
 #define CHK_GOTO_OUT(str,ret) \
   do if (ret != KERN_SUCCESS) { errstr = #str; goto out; } while(0)
 
-struct vm_region_list {
+struct vm_region_list
+{
   struct vm_region_list *next;
-  vm_prot_t    protection;
-  vm_address_t  start;
-  vm_size_t    length;
+  vm_prot_t protection;
+  vm_address_t start;
+  vm_size_t length;
 };
 
-struct obstack  region_obstack;
+struct obstack region_obstack;
 
 /*
  * Write gdb's LEN bytes from MYADDR and copy it to ADDR
@@ -2220,17 +2230,17 @@ gnu_write_inferior (task, addr, myaddr, length)
      int length;
 {
   error_t err = 0;
-  vm_address_t low_address       = (vm_address_t) trunc_page (addr);
-  vm_size_t    aligned_length = 
-                       (vm_size_t) round_page (addr+length) - low_address;
-  pointer_t    copied;
-  int         copy_count;
-  int         deallocate = 0;
+  vm_address_t low_address = (vm_address_t) trunc_page (addr);
+  vm_size_t aligned_length =
+  (vm_size_t) round_page (addr + length) - low_address;
+  pointer_t copied;
+  int copy_count;
+  int deallocate = 0;
 
-  char         *errstr = "Bug in gnu_write_inferior";
+  char *errstr = "Bug in gnu_write_inferior";
 
   struct vm_region_list *region_element;
-  struct vm_region_list *region_head = (struct vm_region_list *)NULL;
+  struct vm_region_list *region_head = (struct vm_region_list *) NULL;
 
   /* Get memory from inferior with page aligned addresses */
   err = vm_read (task,
@@ -2242,7 +2252,7 @@ gnu_write_inferior (task, addr, myaddr, length)
 
   deallocate++;
 
-  err = hurd_safe_copyout ((void*)addr - low_address + copied, myaddr, length);
+  err = hurd_safe_copyout ((void *) addr - low_address + copied, myaddr, length);
   CHK_GOTO_OUT ("Write to inferior faulted", err);
 
   obstack_init (&region_obstack);
@@ -2251,12 +2261,12 @@ gnu_write_inferior (task, addr, myaddr, length)
    * First check for holes and unwritable memory.
    */
   {
-    vm_size_t    remaining_length  = aligned_length;
-    vm_address_t region_address    = low_address;
+    vm_size_t remaining_length = aligned_length;
+    vm_address_t region_address = low_address;
 
     struct vm_region_list *scan;
 
-    while(region_address < low_address + aligned_length)
+    while (region_address < low_address + aligned_length)
       {
        vm_prot_t protection;
        vm_prot_t max_protection;
@@ -2264,9 +2274,9 @@ gnu_write_inferior (task, addr, myaddr, length)
        boolean_t shared;
        mach_port_t object_name;
        vm_offset_t offset;
-       vm_size_t   region_length = remaining_length;
-       vm_address_t old_address  = region_address;
-    
+       vm_size_t region_length = remaining_length;
+       vm_address_t old_address = region_address;
+
        err = vm_region (task,
                         &region_address,
                         &region_length,
@@ -2298,18 +2308,18 @@ gnu_write_inferior (task, addr, myaddr, length)
          }
 
        /* Chain the regions for later use */
-       region_element = 
+       region_element =
          (struct vm_region_list *)
-           obstack_alloc (&region_obstack, sizeof (struct vm_region_list));
-    
+         obstack_alloc (&region_obstack, sizeof (struct vm_region_list));
+
        region_element->protection = protection;
-       region_element->start      = region_address;
-       region_element->length     = region_length;
+       region_element->start = region_address;
+       region_element->length = region_length;
 
        /* Chain the regions along with protections */
        region_element->next = region_head;
-       region_head          = region_element;
-       
+       region_head = region_element;
+
        region_address += region_length;
        remaining_length = remaining_length - region_length;
       }
@@ -2317,12 +2327,12 @@ gnu_write_inferior (task, addr, myaddr, length)
     /* If things fail after this, we give up.
      * Somebody is messing up inferior_task's mappings.
      */
-    
+
     /* Enable writes to the chained vm regions */
     for (scan = region_head; scan; scan = scan->next)
       {
        boolean_t protection_changed = FALSE;
-       
+
        if (!(scan->protection & VM_PROT_WRITE))
          {
            err = vm_protect (task,
@@ -2339,12 +2349,12 @@ gnu_write_inferior (task, addr, myaddr, length)
                    copied,
                    aligned_length);
     CHK_GOTO_OUT ("vm_write failed", err);
-       
+
     /* Set up the original region protections, if they were changed */
     for (scan = region_head; scan; scan = scan->next)
       {
        boolean_t protection_changed = FALSE;
-       
+
        if (!(scan->protection & VM_PROT_WRITE))
          {
            err = vm_protect (task,
@@ -2357,11 +2367,11 @@ gnu_write_inferior (task, addr, myaddr, length)
       }
   }
 
- out:
+out:
   if (deallocate)
     {
       obstack_free (&region_obstack, 0);
-      
+
       (void) vm_deallocate (mach_task_self (),
                            copied,
                            copy_count);
@@ -2387,9 +2397,9 @@ gnu_xfer_memory (memaddr, myaddr, len, write, target)
 {
   int result;
   task_t task =
-    current_inferior
-      ? (current_inferior->task ? current_inferior->task->port : 0)
-      : 0;
+  current_inferior
+  ? (current_inferior->task ? current_inferior->task->port : 0)
+  : 0;
 
   if (task == MACH_PORT_NULL)
     return 0;
@@ -2401,85 +2411,86 @@ gnu_xfer_memory (memaddr, myaddr, len, write, target)
       if (write)
        return gnu_write_inferior (task, memaddr, myaddr, len);
       else
-       return gnu_read_inferior  (task, memaddr, myaddr, len);
+       return gnu_read_inferior (task, memaddr, myaddr, len);
     }
 }
 \f
 extern void gnu_store_registers (int regno);
 extern void gnu_fetch_registers (int regno);
 
-struct target_ops gnu_ops ;
+struct target_ops gnu_ops;
 
 static void
-init_gnu_ops(void)
-{
-  gnu_ops.to_shortname =   "GNU";              /* to_shortname */
-  gnu_ops.to_longname =   "GNU Hurd process";  /* to_longname */
-  gnu_ops.to_doc =   "GNU Hurd process";       /* to_doc */
-  gnu_ops.to_open =   gnu_open;                        /* to_open */
-  gnu_ops.to_close =   0;                      /* to_close */
-  gnu_ops.to_attach =   gnu_attach;            /* to_attach */
+init_gnu_ops (void)
+{
+  gnu_ops.to_shortname = "GNU";        /* to_shortname */
+  gnu_ops.to_longname = "GNU Hurd process";    /* to_longname */
+  gnu_ops.to_doc = "GNU Hurd process"; /* to_doc */
+  gnu_ops.to_open = gnu_open;  /* to_open */
+  gnu_ops.to_close = 0;                /* to_close */
+  gnu_ops.to_attach = gnu_attach;      /* to_attach */
   gnu_ops.to_post_attach = NULL;
-  gnu_ops.to_require_attach = NULL;             /* to_require_attach */
-  gnu_ops.to_detach =   gnu_detach;            /* to_detach */
-  gnu_ops.to_require_detach = NULL;             /* to_require_detach */
-  gnu_ops.to_resume =   gnu_resume;            /* to_resume */
-  gnu_ops.to_wait  =   gnu_wait;               /* to_wait */
-  gnu_ops.to_post_wait = NULL;                         /* to_post_wait */
-  gnu_ops.to_fetch_registers  =   gnu_fetch_registers; /* to_fetch_registers */
-  gnu_ops.to_store_registers  =   gnu_store_registers; /* to_store_registers */
-  gnu_ops.to_prepare_to_store =   gnu_prepare_to_store;        /* to_prepare_to_store */
-  gnu_ops.to_xfer_memory  =   gnu_xfer_memory; /* to_xfer_memory */
-  gnu_ops.to_files_info  =   0;                        /* to_files_info */
-  gnu_ops.to_insert_breakpoint =   memory_insert_breakpoint;
-  gnu_ops.to_remove_breakpoint =   memory_remove_breakpoint;
-  gnu_ops.to_terminal_init  =   gnu_terminal_init_inferior;
-  gnu_ops.to_terminal_inferior =   terminal_inferior;
-  gnu_ops.to_terminal_ours_for_output =   terminal_ours_for_output;
-  gnu_ops.to_terminal_ours  =   terminal_ours;
-  gnu_ops.to_terminal_info  =   child_terminal_info;   
-  gnu_ops.to_kill  =   gnu_kill_inferior;      /* to_kill */
-  gnu_ops.to_load  =   0;                      /* to_load */
-  gnu_ops.to_lookup_symbol =   0;              /* to_lookup_symbol */
-  gnu_ops.to_create_inferior =   gnu_create_inferior;  /* to_create_inferior */
-  gnu_ops.to_post_startup_inferior = NULL;      /* to_post_startup_inferior */
-  gnu_ops.to_acknowledge_created_inferior = NULL; /* to_acknowledge_created_inferior */
-  gnu_ops.to_clone_and_follow_inferior = NULL;    /* to_clone_and_follow_inferior */
-  gnu_ops.to_post_follow_inferior_by_clone = NULL; /* to_post_follow_inferior_by_clone */
+  gnu_ops.to_require_attach = NULL;    /* to_require_attach */
+  gnu_ops.to_detach = gnu_detach;      /* to_detach */
+  gnu_ops.to_require_detach = NULL;    /* to_require_detach */
+  gnu_ops.to_resume = gnu_resume;      /* to_resume */
+  gnu_ops.to_wait = gnu_wait;  /* to_wait */
+  gnu_ops.to_post_wait = NULL; /* to_post_wait */
+  gnu_ops.to_fetch_registers = gnu_fetch_registers;    /* to_fetch_registers */
+  gnu_ops.to_store_registers = gnu_store_registers;    /* to_store_registers */
+  gnu_ops.to_prepare_to_store = gnu_prepare_to_store;  /* to_prepare_to_store */
+  gnu_ops.to_xfer_memory = gnu_xfer_memory;    /* to_xfer_memory */
+  gnu_ops.to_files_info = 0;   /* to_files_info */
+  gnu_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  gnu_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  gnu_ops.to_terminal_init = gnu_terminal_init_inferior;
+  gnu_ops.to_terminal_inferior = terminal_inferior;
+  gnu_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  gnu_ops.to_terminal_ours = terminal_ours;
+  gnu_ops.to_terminal_info = child_terminal_info;
+  gnu_ops.to_kill = gnu_kill_inferior; /* to_kill */
+  gnu_ops.to_load = 0;         /* to_load */
+  gnu_ops.to_lookup_symbol = 0;        /* to_lookup_symbol */
+  gnu_ops.to_create_inferior = gnu_create_inferior;    /* to_create_inferior */
+  gnu_ops.to_post_startup_inferior = NULL;     /* to_post_startup_inferior */
+  gnu_ops.to_acknowledge_created_inferior = NULL;      /* to_acknowledge_created_inferior */
+  gnu_ops.to_clone_and_follow_inferior = NULL; /* to_clone_and_follow_inferior */
+  gnu_ops.to_post_follow_inferior_by_clone = NULL;     /* to_post_follow_inferior_by_clone */
   gnu_ops.to_insert_fork_catchpoint = NULL;
   gnu_ops.to_remove_fork_catchpoint = NULL;
   gnu_ops.to_insert_vfork_catchpoint = NULL;
   gnu_ops.to_remove_vfork_catchpoint = NULL;
-  gnu_ops.to_has_forked = NULL;                    /* to_has_forked */
-  gnu_ops.to_has_vforked = NULL;                   /* to_has_vforked */
+  gnu_ops.to_has_forked = NULL;        /* to_has_forked */
+  gnu_ops.to_has_vforked = NULL;       /* to_has_vforked */
   gnu_ops.to_can_follow_vfork_prior_to_exec = NULL;
-  gnu_ops.to_post_follow_vfork = NULL;             /* to_post_follow_vfork */
+  gnu_ops.to_post_follow_vfork = NULL; /* to_post_follow_vfork */
   gnu_ops.to_insert_exec_catchpoint = NULL;
   gnu_ops.to_remove_exec_catchpoint = NULL;
   gnu_ops.to_has_execd = NULL;
   gnu_ops.to_reported_exec_events_per_exec_call = NULL;
   gnu_ops.to_has_exited = NULL;
-  gnu_ops.to_mourn_inferior =   gnu_mourn_inferior; /* to_mourn_inferior */
-  gnu_ops.to_can_run  =   gnu_can_run;         /* to_can_run */
-  gnu_ops.to_notice_signals =   0;             /* to_notice_signals */
-  gnu_ops.to_thread_alive  =   gnu_thread_alive;/* to_thread_alive */
-  gnu_ops.to_stop  =   gnu_stop;               /* to_stop */
-  gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file;         /* to_pid_to_exec_file */
+  gnu_ops.to_mourn_inferior = gnu_mourn_inferior;      /* to_mourn_inferior */
+  gnu_ops.to_can_run = gnu_can_run;    /* to_can_run */
+  gnu_ops.to_notice_signals = 0;       /* to_notice_signals */
+  gnu_ops.to_thread_alive = gnu_thread_alive;  /* to_thread_alive */
+  gnu_ops.to_stop = gnu_stop;  /* to_stop */
+  gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file;  /* to_pid_to_exec_file */
   gnu_ops.to_core_file_to_sym_file = NULL;
-  gnu_ops.to_stratum =   process_stratum;      /* to_stratum */
-  gnu_ops.DONT_USE =   0;                      /* to_next */
-  gnu_ops.to_has_all_memory =   1;             /* to_has_all_memory */
-  gnu_ops.to_has_memory =   1;                 /* to_has_memory */
-  gnu_ops.to_has_stack =   1;                  /* to_has_stack */
-  gnu_ops.to_has_registers =   1;              /* to_has_registers */
-  gnu_ops.to_has_execution =   1;              /* to_has_execution */
-  gnu_ops.to_sections =   0;                   /* sections */
-  gnu_ops.to_sections_end =   0;               /* sections_end */
-  gnu_ops.to_magic =   OPS_MAGIC ;             /* to_magic */
-} /* init_gnu_ops */
+  gnu_ops.to_stratum = process_stratum;                /* to_stratum */
+  gnu_ops.DONT_USE = 0;                /* to_next */
+  gnu_ops.to_has_all_memory = 1;       /* to_has_all_memory */
+  gnu_ops.to_has_memory = 1;   /* to_has_memory */
+  gnu_ops.to_has_stack = 1;    /* to_has_stack */
+  gnu_ops.to_has_registers = 1;        /* to_has_registers */
+  gnu_ops.to_has_execution = 1;        /* to_has_execution */
+  gnu_ops.to_sections = 0;     /* sections */
+  gnu_ops.to_sections_end = 0; /* sections_end */
+  gnu_ops.to_magic = OPS_MAGIC;        /* to_magic */
+}                              /* init_gnu_ops */
 \f
 /* Return printable description of proc.  */
-char *proc_string (struct proc *proc)
+char *
+proc_string (struct proc *proc)
 {
   static char tid_str[80];
   if (proc_is_task (proc))
@@ -2596,7 +2607,7 @@ static struct inf *
 active_inf ()
 {
   struct inf *inf = cur_inf ();
-  if (! inf->task)
+  if (!inf->task)
     error ("No current process.");
   return inf;
 }
@@ -2716,14 +2727,14 @@ steal_exc_port (struct proc *proc, mach_port_t name)
 
   proc->saved_exc_port = port;
 
-  if (! proc->exc_port)
+  if (!proc->exc_port)
     /* If PROC is a thread, we may not have set its exception port before.
        We can't use proc_steal_exc_port because it also sets saved_exc_port. */
     {
-       proc->exc_port = proc->inf->event_port;
-       err = proc_set_exception_port (proc, proc->exc_port);
-       error ("Can't set exception port for %s: %s",
-             proc_string (proc), strerror (err));
+      proc->exc_port = proc->inf->event_port;
+      err = proc_set_exception_port (proc, proc->exc_port);
+      error ("Can't set exception port for %s: %s",
+            proc_string (proc), strerror (err));
     }
 }
 \f
@@ -2736,7 +2747,7 @@ set_task_exc_port_cmd (char *args, int from_tty)
   steal_exc_port (inf->task, parse_and_eval_address (args));
 }
 
-static void 
+static void
 set_stopped_cmd (char *args, int from_tty)
 {
   cur_inf ()->stopped = _parse_bool_arg (args, "yes", "no", "set stopped");
@@ -2751,13 +2762,13 @@ show_stopped_cmd (char *args, int from_tty)
                     inf->stopped ? "is" : "isn't");
 }
 
-static void 
+static void
 set_sig_thread_cmd (char *args, int from_tty)
 {
   int tid;
   struct inf *inf = cur_inf ();
 
-  if (!args || (! isdigit (*args) && strcmp (args, "none") != 0))
+  if (!args || (!isdigit (*args) && strcmp (args, "none") != 0))
     error ("Illegal argument to \"set signal-thread\" command.\n"
           "Should be an integer thread ID, or `none'.");
 
@@ -2785,7 +2796,7 @@ show_sig_thread_cmd (char *args, int from_tty)
     printf_unfiltered ("There is no signal thread.\n");
 }
 \f
-static void 
+static void
 set_signals_cmd (char *args, int from_tty)
 {
   int trace;
@@ -2809,7 +2820,7 @@ show_signals_cmd (char *args, int from_tty)
                     : (inf->want_signals ? "will be" : "won't be"));
 }
 
-static void 
+static void
 set_exceptions_cmd (char *args, int from_tty)
 {
   struct inf *inf = cur_inf ();
@@ -2817,7 +2828,7 @@ set_exceptions_cmd (char *args, int from_tty)
 
   if (inf->task && inf->want_exceptions != val)
     /* Make this take effect immediately in a running process.  */
-    /* XXX */;
+    /* XXX */ ;
 
   inf->want_exceptions = val;
 }
@@ -2891,8 +2902,8 @@ info_port_rights (char *args, mach_port_type_t only)
          value_ptr val = parse_to_comma_and_eval (&args);
          long right = value_as_long (val);
          error_t err =
-           print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,
-                            stdout);
+         print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,
+                          stdout);
          if (err)
            error ("%ld: %s.", right, strerror (err));
        }
@@ -2901,8 +2912,8 @@ info_port_rights (char *args, mach_port_type_t only)
     /* Print all of them.  */
     {
       error_t err =
-       print_task_ports_info (inf->task->port, only, PORTINFO_DETAILS,
-                              stdout);
+      print_task_ports_info (inf->task->port, only, PORTINFO_DETAILS,
+                            stdout);
       if (err)
        error ("%s.", strerror (err));
     }
@@ -2936,22 +2947,23 @@ info_port_rights_cmd (char *args, int from_tty)
   info_port_rights (args, ~0);
 }
 \f
-static void add_task_commands ()
+static void
+add_task_commands ()
 {
   add_cmd ("pause", class_run, set_thread_default_pause_cmd,
-          "Set whether the new threads are suspended while gdb has control.\n"
+       "Set whether the new threads are suspended while gdb has control.\n"
           "This property normally has no effect because the whole task is\n"
-          "suspended, however, that may be disabled with \"set task pause off\".\n"
+   "suspended, however, that may be disabled with \"set task pause off\".\n"
           "The default value is \"off\".",
           &set_thread_default_cmd_list);
   add_cmd ("pause", no_class, show_thread_default_pause_cmd,
           "Show whether new threads are suspended while gdb has control.",
           &show_thread_default_cmd_list);
   add_cmd ("run", class_run, set_thread_default_run_cmd,
-          "Set whether new threads are allowed to run (once gdb has noticed them).",
+  "Set whether new threads are allowed to run (once gdb has noticed them).",
           &set_thread_default_cmd_list);
   add_cmd ("run", no_class, show_thread_default_run_cmd,
-          "Show whether new threads are allowed to run (once gdb has noticed them).",
+  "Show whether new threads are allowed to run (once gdb has noticed them).",
           &show_thread_default_cmd_list);
   add_cmd ("detach-suspend-count", class_run, set_thread_default_detach_sc_cmd,
           "Set the default detach-suspend-count value for new threads.",
@@ -2961,18 +2973,18 @@ static void add_task_commands ()
           &show_thread_default_cmd_list);
 
   add_cmd ("signals", class_run, set_signals_cmd,
-          "Set whether the inferior process's signals will be intercepted.\n"
+        "Set whether the inferior process's signals will be intercepted.\n"
           "Mach exceptions (such as breakpoint traps) are not affected.",
           &setlist);
   add_alias_cmd ("sigs", "signals", class_run, 1, &setlist);
   add_cmd ("signals", no_class, show_signals_cmd,
-          "Show whether the inferior process's signals will be intercepted.",
+        "Show whether the inferior process's signals will be intercepted.",
           &showlist);
   add_alias_cmd ("sigs", "signals", no_class, 1, &showlist);
 
   add_cmd ("signal-thread", class_run, set_sig_thread_cmd,
           "Set the thread that gdb thinks is the libc signal thread.\n"
-          "This thread is run when delivering a signal to a non-stopped process.",
+    "This thread is run when delivering a signal to a non-stopped process.",
           &setlist);
   add_alias_cmd ("sigthread", "signal-thread", class_run, 1, &setlist);
   add_cmd ("signal-thread", no_class, show_sig_thread_cmd,
@@ -2981,22 +2993,22 @@ static void add_task_commands ()
   add_alias_cmd ("sigthread", "signal-thread", no_class, 1, &showlist);
 
   add_cmd ("stopped", class_run, set_stopped_cmd,
-          "Set whether gdb thinks the inferior process is stopped as with SIGSTOP.\n"
+  "Set whether gdb thinks the inferior process is stopped as with SIGSTOP.\n"
           "Stopped process will be continued by sending them a signal.",
           &setlist);
   add_cmd ("stopped", no_class, show_signals_cmd,
-          "Show whether gdb thinks the inferior process is stopped as with SIGSTOP.",
+  "Show whether gdb thinks the inferior process is stopped as with SIGSTOP.",
           &showlist);
 
   add_cmd ("exceptions", class_run, set_exceptions_cmd,
-          "Set whether exceptions in the inferior process will be trapped.\n"
-          "When exceptions are turned off, neither breakpoints nor single-stepping\n"
+        "Set whether exceptions in the inferior process will be trapped.\n"
+  "When exceptions are turned off, neither breakpoints nor single-stepping\n"
           "will work.",
           &setlist);
   /* Allow `set exc' despite conflict with `set exception-port'.  */
   add_alias_cmd ("exc", "exceptions", class_run, 1, &setlist);
   add_cmd ("exceptions", no_class, show_exceptions_cmd,
-          "Show whether exceptions in the inferior process will be trapped.",
+        "Show whether exceptions in the inferior process will be trapped.",
           &showlist);
 
   add_prefix_cmd ("task", no_class, set_task_cmd,
@@ -3081,7 +3093,7 @@ show_thread_pause_cmd (char *args, int from_tty)
   printf_unfiltered ("Thread %s %s suspended while gdb has control%s.\n",
                     proc_string (thread),
                     sc ? "is" : "isn't",
-                    !sc && thread->inf->pause_sc ? " (but the task is)" : "");
+                 !sc && thread->inf->pause_sc ? " (but the task is)" : "");
 }
 
 static void
@@ -3147,14 +3159,14 @@ thread_takeover_sc_cmd (char *args, int from_tty)
   thread_basic_info_t info = &_info;
   mach_msg_type_number_t info_len = THREAD_BASIC_INFO_COUNT;
   error_t err =
-    thread_info (thread->port, THREAD_BASIC_INFO, (int *)&info, &info_len);
+  thread_info (thread->port, THREAD_BASIC_INFO, (int *) &info, &info_len);
   if (err)
     error ("%s.", strerror (err));
   thread->sc = info->suspend_count;
   if (from_tty)
     printf_unfiltered ("Suspend count was %d.\n", thread->sc);
   if (info != &_info)
-    vm_deallocate (mach_task_self (), (vm_address_t)info, info_len * sizeof (int));
+    vm_deallocate (mach_task_self (), (vm_address_t) info, info_len * sizeof (int));
 }
 
 add_thread_commands ()
@@ -3175,15 +3187,15 @@ add_thread_commands ()
                  &show_thread_cmd_list);
 
   add_cmd ("pause", class_run, set_thread_pause_cmd,
-          "Set whether the current thread is suspended while gdb has control.\n"
+      "Set whether the current thread is suspended while gdb has control.\n"
           "A value of \"on\" takes effect immediately, otherwise nothing\n"
           "happens until the next time the program is continued.  This\n"
-          "property normally has no effect because the whole task is suspended,\n"
+    "property normally has no effect because the whole task is suspended,\n"
           "however, that may be disabled with \"set task pause off\".\n"
           "The default value is \"off\".",
           &set_thread_cmd_list);
   add_cmd ("pause", no_class, show_thread_pause_cmd,
-          "Show whether the current thread is suspended while gdb has control.",
+      "Show whether the current thread is suspended while gdb has control.",
           &show_thread_cmd_list);
 
   add_cmd ("run", class_run, set_thread_run_cmd,
@@ -3215,7 +3227,7 @@ add_thread_commands ()
   add_cmd ("takeover-suspend-count", no_class, thread_takeover_sc_cmd,
           "Force the threads absolute suspend-count to be gdb's.\n"
           "Prior to giving this command, gdb's thread suspend-counts are relative to\n"
-          "the thread's initial suspend-count when gdb notices the threads.",
+        "the thread's initial suspend-count when gdb notices the threads.",
           &thread_cmd_list);
 }
 \f
@@ -3223,14 +3235,14 @@ void
 _initialize_gnu_nat ()
 {
   proc_server = getproc ();
-  init_gnu_ops() ;
+  init_gnu_ops ();
   add_target (&gnu_ops);
   add_task_commands ();
   add_thread_commands ();
 
   add_set_cmd ("gnu-debug", class_maintenance,
-              var_boolean, (char *)&gnu_debug_flag,
-              "Set debugging output for the gnu backend.", &maintenancelist);
+              var_boolean, (char *) &gnu_debug_flag,
+            "Set debugging output for the gnu backend.", &maintenancelist);
 }
 \f
 #ifdef FLUSH_INFERIOR_CACHE
@@ -3241,12 +3253,12 @@ _initialize_gnu_nat ()
    end up looping in mysterious Bpt traps */
 
 void
-flush_inferior_icache(pc, amount)
+flush_inferior_icache (pc, amount)
      CORE_ADDR pc;
 {
   vm_machine_attribute_val_t flush = MATTR_VAL_ICACHE_FLUSH;
-  error_t   ret;
-  
+  error_t ret;
+
   ret = vm_machine_attribute (current_inferior->task->port,
                              pc,
                              amount,
@@ -3255,4 +3267,4 @@ flush_inferior_icache(pc, amount)
   if (ret != KERN_SUCCESS)
     warning ("Error flushing inferior's cache : %s", strerror (ret));
 }
-#endif FLUSH_INFERIOR_CACHE
+#endif /* FLUSH_INFERIOR_CACHE */
index 3a32ab66991f506e0264483cb94a01b0725d31ce..8cc6c122e21b641fb2103fa4a05475da5e65cc1f 100644 (file)
@@ -1,21 +1,22 @@
 /* Common things used by the various *gnu-nat.c files
    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 
-Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.ai.mit.edu>
 
-The GNU Hurd is free software; you can 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.
+   The GNU Hurd is free software; you can 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.
 
-The GNU Hurd is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+   The GNU Hurd is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef __GNU_NAT_H__
 #define __GNU_NAT_H__
@@ -33,38 +34,38 @@ struct proc *inf_tid_to_thread (struct inf *inf, int tid);
 /* A proc is either a thread, or the task (there can only be one task proc
    because it always has the same TID, PROC_TID_TASK).  */
 struct proc
-{
-  thread_t port;               /* The task or thread port.  */
-  int tid;                     /* The GDB pid (actually a thread id).  */
-  int num;                     /* An id number for threads, to print.  */
-
-  mach_port_t saved_exc_port;  /* The task/thread's real exception port.  */
-  mach_port_t exc_port;                /* Our replacement, which for.  */
-
-  int sc;                      /* Desired suspend count.   */
-  int cur_sc;                  /* Implemented suspend count.  */
-  int run_sc;                  /* Default sc when the program is running. */
-  int pause_sc;                        /* Default sc when gdb has control. */
-  int resume_sc;               /* Sc resulting from the last resume. */
-  int detach_sc;               /* SC to leave around when detaching
+  {
+    thread_t port;             /* The task or thread port.  */
+    int tid;                   /* The GDB pid (actually a thread id).  */
+    int num;                   /* An id number for threads, to print.  */
+
+    mach_port_t saved_exc_port;        /* The task/thread's real exception port.  */
+    mach_port_t exc_port;      /* Our replacement, which for.  */
+
+    int sc;                    /* Desired suspend count.   */
+    int cur_sc;                        /* Implemented suspend count.  */
+    int run_sc;                        /* Default sc when the program is running. */
+    int pause_sc;              /* Default sc when gdb has control. */
+    int resume_sc;             /* Sc resulting from the last resume. */
+    int detach_sc;             /* SC to leave around when detaching
                                   from program. */
 
-  thread_state_data_t state;   /* Registers, &c. */
-  int state_valid : 1;         /* True if STATE is up to date. */
-  int state_changed : 1;
+    thread_state_data_t state; /* Registers, &c. */
+    int state_valid:1;         /* True if STATE is up to date. */
+    int state_changed:1;
 
-  int aborted : 1;             /* True if thread_abort has been called.  */
-  int dead : 1;                        /* We happen to know it's actually dead. */
+    int aborted:1;             /* True if thread_abort has been called.  */
+    int dead:1;                        /* We happen to know it's actually dead. */
 
-  /* Bit mask of registers fetched by gdb.  This is used when we re-fetch
-     STATE after aborting the thread, to detect that gdb may have out-of-date
-     information.  */
-  unsigned long fetched_regs;
+    /* Bit mask of registers fetched by gdb.  This is used when we re-fetch
+       STATE after aborting the thread, to detect that gdb may have out-of-date
+       information.  */
+    unsigned long fetched_regs;
 
-  struct inf *inf;             /* Where we come from.  */
+    struct inf *inf;           /* Where we come from.  */
 
-  struct proc *next;
-};
+    struct proc *next;
+  };
 
 /* The task has a thread entry with this TID.  */
 #define PROC_TID_TASK  (-1)
index 3b8332752fb36d86bd6f5543cd9b015830203999..ef798075f83ed6a805e37248f1213ac7f4da438d 100644 (file)
@@ -20,7 +20,8 @@
 
    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.  */
+   Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* AIX requires this to be the first thing in the file. */
 #if defined _AIX && !defined REGEX_MALLOC
index 4d62b03a8c6a95c4c5808802f0ae83b91599b20c..3bdfe7c40eab3521c4d589f219f23592f2ee5b19 100644 (file)
@@ -18,7 +18,8 @@
 
    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.  */
+   Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef _REGEX_H
 #define _REGEX_H 1
index d872219fb554570f23ac78cfbf5e269fb7f45745..b77f3f076d729c41dd8a2a4a2666abf6cc76ba36 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1997, 1999 Free Software Foundation, Inc.
    Written by Robert Hoehne.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <fcntl.h>
 
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "command.h"
 #include "floatformat.h"
 
-#include <stdio.h>     /* required for __DJGPP_MINOR__ */
+#include <stdio.h>             /* required for __DJGPP_MINOR__ */
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -39,139 +40,128 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #if __DJGPP_MINOR__ < 3
 /* This code will be provided from DJGPP 2.03 on. Until then I code it
    here */
-typedef struct {
-  unsigned short sig0;
-  unsigned short sig1;
-  unsigned short sig2;
-  unsigned short sig3;
-  unsigned short exponent:15;
-  unsigned short sign:1;
-} NPXREG;
-
-typedef struct {
-  unsigned int control;
-  unsigned int status;
-  unsigned int tag;
-  unsigned int eip;
-  unsigned int cs;
-  unsigned int dataptr;
-  unsigned int datasel;
-  NPXREG reg[8];
-} NPX;
+typedef struct
+  {
+    unsigned short sig0;
+    unsigned short sig1;
+    unsigned short sig2;
+    unsigned short sig3;
+    unsigned short exponent:15;
+    unsigned short sign:1;
+  }
+NPXREG;
+
+typedef struct
+  {
+    unsigned int control;
+    unsigned int status;
+    unsigned int tag;
+    unsigned int eip;
+    unsigned int cs;
+    unsigned int dataptr;
+    unsigned int datasel;
+    NPXREG reg[8];
+  }
+NPX;
 
 static NPX npx;
 
-static void save_npx (void); /* Save the FPU of the debugged program */
-static void load_npx (void); /* Restore the FPU of the debugged program */
+static void save_npx (void);   /* Save the FPU of the debugged program */
+static void load_npx (void);   /* Restore the FPU of the debugged program */
 
 /* ------------------------------------------------------------------------- */
 /* Store the contents of the NPX in the global variable `npx'.  */
+/* *INDENT-OFF* */
 
 static void
 save_npx (void)
 {
   asm ("inb    $0xa0, %%al
-       testb   $0x20, %%al
-       jz      1f
-       xorb    %%al, %%al
-       outb    %%al, $0xf0
-       movb    $0x20, %%al
-       outb    %%al, $0xa0
-       outb    %%al, $0x20
+       testb $0x20, %%al
+       jz 1f
+       xorb %% al, %%al
+       outb %% al, $0xf0
+       movb $0x20, %%al
+       outb %% al, $0xa0
+       outb %% al, $0x20
 1:
-       fnsave  %0
-       fwait"
-       : "=m" (npx)
-       : /* No input */
-       : "%eax");
+       fnsave 0
+       fwait "
+:     "=m" (npx)
+:                              /* No input */
+:     "%eax");
 }
+
+/* *INDENT-ON* */
+
+
+
+
+
 /* ------------------------------------------------------------------------- */
 /* Reload the contents of the NPX from the global variable `npx'.  */
 
 static void
 load_npx (void)
 {
-  asm ("frstor %0" : "=m" (npx));
+asm ("frstor %0":"=m" (npx));
 }
 #endif /* __DJGPP_MINOR < 3 */
 
 extern void _initialize_go32_nat (void);
 
 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];
-};
+  {
+    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];
+  };
 
 extern char **environ;
 
 #define SOME_PID 42
 
 static int prog_has_started = 0;
-static void
-print_387_status (unsigned short status, struct env387 *ep);
-static void
-go32_open (char *name, int from_tty);
-static void
-go32_close (int quitting);
-static void
-go32_attach (char *args, int from_tty);
-static void
-go32_detach (char *args, int from_tty);
-static void
-go32_resume (int pid, int step, enum target_signal siggnal);
-static int
-go32_wait (int pid, struct target_waitstatus *status);
-static void
-go32_fetch_registers (int regno);
-static void
-store_register (int regno);
-static void
-go32_store_registers (int regno);
-static void
-go32_prepare_to_store (void);
-static int
-go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-                 struct target_ops *target);
-static void
-go32_files_info (struct target_ops *target);
-static void
-go32_stop (void);
-static void
-go32_kill_inferior (void);
-static void
-go32_create_inferior (char *exec_file, char *args, char **env);
-static void
-go32_mourn_inferior (void);
-static int
-go32_can_run (void);
-static void
-ignore (void);
-static void
-ignore2 (char *a, int b);
+static void print_387_status (unsigned short status, struct env387 *ep);
+static void go32_open (char *name, int from_tty);
+static void go32_close (int quitting);
+static void go32_attach (char *args, int from_tty);
+static void go32_detach (char *args, int from_tty);
+static void go32_resume (int pid, int step, enum target_signal siggnal);
+static int go32_wait (int pid, struct target_waitstatus *status);
+static void go32_fetch_registers (int regno);
+static void store_register (int regno);
+static void go32_store_registers (int regno);
+static void go32_prepare_to_store (void);
+static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+                            int write, struct target_ops *target);
+static void go32_files_info (struct target_ops *target);
+static void go32_stop (void);
+static void go32_kill_inferior (void);
+static void go32_create_inferior (char *exec_file, char *args, char **env);
+static void go32_mourn_inferior (void);
+static int go32_can_run (void);
+static void ignore (void);
+static void ignore2 (char *a, int b);
 static int go32_insert_aligned_watchpoint (int pid, CORE_ADDR waddr,
-                                          CORE_ADDR addr, int len, int rw);
+                                          CORE_ADDR addr, int len, int rw);
 static int go32_insert_nonaligned_watchpoint (int pid, CORE_ADDR waddr,
-                                             CORE_ADDR addr, int len, int rw);
+                                          CORE_ADDR addr, int len, int rw);
 
 static struct target_ops go32_ops;
-static void
-go32_terminal_init (void);
-static void
-go32_terminal_inferior (void);
-static void
-go32_terminal_ours (void);
+static void go32_terminal_init (void);
+static void go32_terminal_inferior (void);
+static void go32_terminal_ours (void);
 
 static void
 print_387_status (unsigned short status, struct env387 *ep)
@@ -254,36 +244,36 @@ static struct
 regno_mapping[] =
 {
   r_ofs (tss_eax), 4,
-  r_ofs (tss_ecx), 4,
-  r_ofs (tss_edx), 4,
-  r_ofs (tss_ebx), 4,
-  r_ofs (tss_esp), 4,
-  r_ofs (tss_ebp), 4,
-  r_ofs (tss_esi), 4,
-  r_ofs (tss_edi), 4,
-  r_ofs (tss_eip), 4,
-  r_ofs (tss_eflags), 4,
-  r_ofs (tss_cs), 2,
-  r_ofs (tss_ss), 2,
-  r_ofs (tss_ds), 2,
-  r_ofs (tss_es), 2,
-  r_ofs (tss_fs), 2,
-  r_ofs (tss_gs), 2,
-  0, 10,
-  1, 10,
-  2, 10,
-  3, 10,
-  4, 10,
-  5, 10,
-  6, 10,
-  7, 10,
-  0, 2,
-  4, 2,
-  8, 2,
-  12, 4,
-  16, 2,
-  20, 4,
-  24, 2
+    r_ofs (tss_ecx), 4,
+    r_ofs (tss_edx), 4,
+    r_ofs (tss_ebx), 4,
+    r_ofs (tss_esp), 4,
+    r_ofs (tss_ebp), 4,
+    r_ofs (tss_esi), 4,
+    r_ofs (tss_edi), 4,
+    r_ofs (tss_eip), 4,
+    r_ofs (tss_eflags), 4,
+    r_ofs (tss_cs), 2,
+    r_ofs (tss_ss), 2,
+    r_ofs (tss_ds), 2,
+    r_ofs (tss_es), 2,
+    r_ofs (tss_fs), 2,
+    r_ofs (tss_gs), 2,
+    0, 10,
+    1, 10,
+    2, 10,
+    3, 10,
+    4, 10,
+    5, 10,
+    6, 10,
+    7, 10,
+    0, 2,
+    4, 2,
+    8, 2,
+    12, 4,
+    16, 2,
+    20, 4,
+    24, 2
 };
 
 static struct
@@ -294,26 +284,26 @@ static struct
 sig_map[] =
 {
   0, TARGET_SIGNAL_FPE,
-  1, TARGET_SIGNAL_TRAP,
-  2, TARGET_SIGNAL_UNKNOWN,
-  3, TARGET_SIGNAL_TRAP,
-  4, TARGET_SIGNAL_FPE,
-  5, TARGET_SIGNAL_SEGV,
-  6, TARGET_SIGNAL_ILL,
-  7, TARGET_SIGNAL_FPE,
-  8, TARGET_SIGNAL_SEGV,
-  9, TARGET_SIGNAL_SEGV,
-  10, TARGET_SIGNAL_BUS,
-  11, TARGET_SIGNAL_SEGV,
-  12, TARGET_SIGNAL_SEGV,
-  13, TARGET_SIGNAL_ABRT,
-  14, TARGET_SIGNAL_SEGV,
-  16, TARGET_SIGNAL_FPE,
-  31, TARGET_SIGNAL_ILL,
-  0x75, TARGET_SIGNAL_FPE,
-  0x79, TARGET_SIGNAL_INT,
-  0x1b, TARGET_SIGNAL_INT,
-  -1, -1
+    1, TARGET_SIGNAL_TRAP,
+    2, TARGET_SIGNAL_UNKNOWN,
+    3, TARGET_SIGNAL_TRAP,
+    4, TARGET_SIGNAL_FPE,
+    5, TARGET_SIGNAL_SEGV,
+    6, TARGET_SIGNAL_ILL,
+    7, TARGET_SIGNAL_FPE,
+    8, TARGET_SIGNAL_SEGV,
+    9, TARGET_SIGNAL_SEGV,
+    10, TARGET_SIGNAL_BUS,
+    11, TARGET_SIGNAL_SEGV,
+    12, TARGET_SIGNAL_SEGV,
+    13, TARGET_SIGNAL_ABRT,
+    14, TARGET_SIGNAL_SEGV,
+    16, TARGET_SIGNAL_FPE,
+    31, TARGET_SIGNAL_ILL,
+    0x75, TARGET_SIGNAL_FPE,
+    0x79, TARGET_SIGNAL_INT,
+    0x1b, TARGET_SIGNAL_INT,
+    -1, -1
 };
 
 static void
@@ -342,9 +332,9 @@ static int resume_is_step;
 
 static void
 go32_resume (int pid, int step, enum target_signal siggnal)
-  {
-    resume_is_step = step;
-  }
+{
+  resume_is_step = step;
+}
 
 static int
 go32_wait (int pid, struct target_waitstatus *status)
@@ -390,7 +380,7 @@ go32_wait (int pid, struct target_waitstatus *status)
 static void
 go32_fetch_registers (int regno)
 {
-  /*JHW*/
+  /*JHW */
   int end_reg = regno + 1;     /* just one reg initially */
 
   if (regno < 0)               /* do the all registers */
@@ -628,7 +618,7 @@ ignore2 (char *a, int b)
    (CONTROL & (DR_CONTROL_MASK << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * index)))\
   )
 
-#if 0 /* use debugging macro */
+#if 0                          /* use debugging macro */
 #define SHOW_DR(text) \
 do { \
   fprintf(stderr,"%08x %08x ",edi.dr[7],edi.dr[6]); \
@@ -826,10 +816,10 @@ static void
 go32_terminal_init (void)
 {
   /* Save the filemodes for stdin/stout */
-  inf_in_flag = setmode(0, 0);
-  setmode(0, inf_in_flag);
-  inf_out_flag = setmode(1, 0);
-  setmode(1, inf_out_flag);
+  inf_in_flag = setmode (0, 0);
+  setmode (0, inf_in_flag);
+  inf_out_flag = setmode (1, 0);
+  setmode (1, inf_out_flag);
   inf_flags_valid = 1;
 }
 
@@ -838,10 +828,10 @@ go32_terminal_inferior (void)
 {
   /* set the filemodes for stdin/stdout of the inferior */
   if (inf_flags_valid)
-  {
-    setmode(0, inf_in_flag);
-    setmode(1, inf_out_flag);
-  }
+    {
+      setmode (0, inf_in_flag);
+      setmode (1, inf_out_flag);
+    }
 }
 
 static void
@@ -849,8 +839,8 @@ go32_terminal_ours (void)
 {
   /* Switch to text mode on stdin/stdout always on the gdb terminal and
      save the inferior modes to be restored later */
-  inf_in_flag = setmode(0, O_TEXT);
-  inf_out_flag = setmode(1, O_TEXT);
+  inf_in_flag = setmode (0, O_TEXT);
+  inf_out_flag = setmode (1, O_TEXT);
 }
 
 static void
index 1916cc2ac69fd14517217781df62816264167b17..3c70165a5c0b311d9a71c32977775cb4efaf43e0 100644 (file)
 /* OBSOLETE      CORE_ADDR memaddr; */
 /* OBSOLETE      FILE *stream; */
 /* OBSOLETE { */
-/* OBSOLETE    unsigned char buffer[MAXLEN]; */
-/* OBSOLETE    register int i; */
-/* OBSOLETE    register char *d; */
-/* OBSOLETE    register int bestmask; */
-/* OBSOLETE    unsigned best; */
-/* OBSOLETE    int temp, index, bestlen; */
-/* OBSOLETE  */
-/* OBSOLETE    read_memory (memaddr, buffer, MAXLEN); */
-/* OBSOLETE  */
-/* OBSOLETE    bestmask = 0; */
-/* OBSOLETE    index = -1; */
-/* OBSOLETE    best = 0xffffffff; */
-/* OBSOLETE    for (i = 0; i < NOPCODES; i++) */
-/* OBSOLETE    { */
-/* OBSOLETE            register unsigned int opcode = gld_opcodes[i].opcode; */
-/* OBSOLETE            register unsigned int mask = gld_opcodes[i].mask; */
-/* OBSOLETE            register unsigned int len = gld_opcodes[i].length; */
-/* OBSOLETE            register unsigned int test; */
-/* OBSOLETE  */
-/* OBSOLETE            /* Get possible opcode bytes into integer *x/ */
-/* OBSOLETE            test = buffer[0] << 24; */
-/* OBSOLETE            test |= buffer[1] << 16; */
-/* OBSOLETE            test |= buffer[2] << 8; */
-/* OBSOLETE            test |= buffer[3]; */
-/* OBSOLETE  */
-/* OBSOLETE            /* Mask with opcode and see if match *x/ */
-/* OBSOLETE            if ((opcode & mask) == (test & mask)) */
-/* OBSOLETE            { */
-/* OBSOLETE                    /* See if second or third match *x/ */
-/* OBSOLETE                    if (index >= 0) */
-/* OBSOLETE                    { */
-/* OBSOLETE                            /* Take new one if it looks good *x/ */
-/* OBSOLETE                            if (bestlen == MAXLEN && len == MAXLEN) */
-/* OBSOLETE                            { */
-/* OBSOLETE                                    /* See if lower bits matched *x/ */
-/* OBSOLETE                                    if (((bestmask & 3) == 0) && */
-/* OBSOLETE                                        ((mask & 3) != 0)) */
-/* OBSOLETE                                    { */
-/* OBSOLETE                                            bestmask = mask; */
-/* OBSOLETE                                            bestlen = len; */
-/* OBSOLETE                                            best = test; */
-/* OBSOLETE                                            index = i; */
-/* OBSOLETE                                    } */
-/* OBSOLETE                            } */
-/* OBSOLETE                    } */
-/* OBSOLETE                    else */
-/* OBSOLETE                    { */
-/* OBSOLETE                            /* First match, save it *x/ */
-/* OBSOLETE                            bestmask = mask; */
-/* OBSOLETE                            bestlen = len; */
-/* OBSOLETE                            best = test; */
-/* OBSOLETE                            index = i; */
-/* OBSOLETE                    } */
-/* OBSOLETE            } */
-/* OBSOLETE    } */
-/* OBSOLETE  */
-/* OBSOLETE    /* Handle undefined instructions.  *x/ */
-/* OBSOLETE    if (index < 0) */
-/* OBSOLETE    { */
-/* OBSOLETE            fprintf (stream, "undefined   0%o",(buffer[0]<<8)+buffer[1]); */
-/* OBSOLETE            return 2; */
-/* OBSOLETE    } */
-/* OBSOLETE  */
-/* OBSOLETE    /* Print instruction name *x/ */
-/* OBSOLETE    fprintf (stream, "%-12s", gld_opcodes[index].name); */
-/* OBSOLETE  */
-/* OBSOLETE    /* Adjust if short instruction *x/ */
-/* OBSOLETE    if (gld_opcodes[index].length < 4) */
-/* OBSOLETE    { */
-/* OBSOLETE            best >>= 16; */
-/* OBSOLETE            i = 0; */
-/* OBSOLETE    } */
-/* OBSOLETE    else */
-/* OBSOLETE    { */
-/* OBSOLETE            i = 16; */
-/* OBSOLETE    } */
-/* OBSOLETE  */
-/* OBSOLETE    /* Dump out instruction arguments *x/ */
-/* OBSOLETE    for (d = gld_opcodes[index].args; *d; ++d) */
-/* OBSOLETE    { */
-/* OBSOLETE        switch (*d) */
-/* OBSOLETE        { */
-/* OBSOLETE            case 'f': */
-/* OBSOLETE                fprintf (stream, "%d",  (best >> (7 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'r': */
-/* OBSOLETE                fprintf (stream, "r%d", (best >> (7 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'R': */
-/* OBSOLETE                fprintf (stream, "r%d", (best >> (4 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'b': */
-/* OBSOLETE                fprintf (stream, "b%d", (best >> (7 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'B': */
-/* OBSOLETE                fprintf (stream, "b%d", (best >> (4 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'v': */
-/* OBSOLETE                fprintf (stream, "b%d", (best >> (7 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'V': */
-/* OBSOLETE                fprintf (stream, "b%d", (best >> (4 + i)) & 7); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'X': */
-/* OBSOLETE                temp = (best >> 20) & 7; */
-/* OBSOLETE                if (temp) */
-/* OBSOLETE                    fprintf (stream, "r%d", temp); */
-/* OBSOLETE                else */
-/* OBSOLETE                    putc ('0', stream); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'A': */
-/* OBSOLETE                temp = (best >> 16) & 7; */
-/* OBSOLETE                if (temp) */
-/* OBSOLETE                    fprintf (stream, "(b%d)", temp); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'S': */
-/* OBSOLETE                fprintf (stream, "#%d", best & 0x1f); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'I': */
-/* OBSOLETE                fprintf (stream, "#%x", best & 0xffff); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'O': */
-/* OBSOLETE                fprintf (stream, "%x", best & 0xffff); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'h': */
-/* OBSOLETE                fprintf (stream, "%d", best & 0xfffe); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'd': */
-/* OBSOLETE                fprintf (stream, "%d", best & 0xfffc); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'T': */
-/* OBSOLETE                fprintf (stream, "%d", (best >> 8) & 0xff); */
-/* OBSOLETE                break; */
-/* OBSOLETE            case 'N': */
-/* OBSOLETE                fprintf (stream, "%d", best & 0xff); */
-/* OBSOLETE                break; */
-/* OBSOLETE            default: */
-/* OBSOLETE                putc (*d, stream); */
-/* OBSOLETE                break; */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
-/* OBSOLETE  */
-/* OBSOLETE    /* Return length of instruction *x/ */
-/* OBSOLETE    return (gld_opcodes[index].length); */
+/* OBSOLETE     unsigned char buffer[MAXLEN]; */
+/* OBSOLETE     register int i; */
+/* OBSOLETE     register char *d; */
+/* OBSOLETE     register int bestmask; */
+/* OBSOLETE     unsigned best; */
+/* OBSOLETE     int temp, index, bestlen; */
+/* OBSOLETE  */
+/* OBSOLETE     read_memory (memaddr, buffer, MAXLEN); */
+/* OBSOLETE  */
+/* OBSOLETE     bestmask = 0; */
+/* OBSOLETE     index = -1; */
+/* OBSOLETE     best = 0xffffffff; */
+/* OBSOLETE     for (i = 0; i < NOPCODES; i++) */
+/* OBSOLETE     { */
+/* OBSOLETE             register unsigned int opcode = gld_opcodes[i].opcode; */
+/* OBSOLETE             register unsigned int mask = gld_opcodes[i].mask; */
+/* OBSOLETE             register unsigned int len = gld_opcodes[i].length; */
+/* OBSOLETE             register unsigned int test; */
+/* OBSOLETE  */
+/* OBSOLETE             /* Get possible opcode bytes into integer *x/ */
+/* OBSOLETE             test = buffer[0] << 24; */
+/* OBSOLETE             test |= buffer[1] << 16; */
+/* OBSOLETE             test |= buffer[2] << 8; */
+/* OBSOLETE             test |= buffer[3]; */
+/* OBSOLETE  */
+/* OBSOLETE             /* Mask with opcode and see if match *x/ */
+/* OBSOLETE             if ((opcode & mask) == (test & mask)) */
+/* OBSOLETE             { */
+/* OBSOLETE                     /* See if second or third match *x/ */
+/* OBSOLETE                     if (index >= 0) */
+/* OBSOLETE                     { */
+/* OBSOLETE                             /* Take new one if it looks good *x/ */
+/* OBSOLETE                             if (bestlen == MAXLEN && len == MAXLEN) */
+/* OBSOLETE                             { */
+/* OBSOLETE                                     /* See if lower bits matched *x/ */
+/* OBSOLETE                                     if (((bestmask & 3) == 0) && */
+/* OBSOLETE                                         ((mask & 3) != 0)) */
+/* OBSOLETE                                     { */
+/* OBSOLETE                                             bestmask = mask; */
+/* OBSOLETE                                             bestlen = len; */
+/* OBSOLETE                                             best = test; */
+/* OBSOLETE                                             index = i; */
+/* OBSOLETE                                     } */
+/* OBSOLETE                             } */
+/* OBSOLETE                     } */
+/* OBSOLETE                     else */
+/* OBSOLETE                     { */
+/* OBSOLETE                             /* First match, save it *x/ */
+/* OBSOLETE                             bestmask = mask; */
+/* OBSOLETE                             bestlen = len; */
+/* OBSOLETE                             best = test; */
+/* OBSOLETE                             index = i; */
+/* OBSOLETE                     } */
+/* OBSOLETE             } */
+/* OBSOLETE     } */
+/* OBSOLETE  */
+/* OBSOLETE     /* Handle undefined instructions.  *x/ */
+/* OBSOLETE     if (index < 0) */
+/* OBSOLETE     { */
+/* OBSOLETE             fprintf (stream, "undefined   0%o",(buffer[0]<<8)+buffer[1]); */
+/* OBSOLETE             return 2; */
+/* OBSOLETE     } */
+/* OBSOLETE  */
+/* OBSOLETE     /* Print instruction name *x/ */
+/* OBSOLETE     fprintf (stream, "%-12s", gld_opcodes[index].name); */
+/* OBSOLETE  */
+/* OBSOLETE     /* Adjust if short instruction *x/ */
+/* OBSOLETE     if (gld_opcodes[index].length < 4) */
+/* OBSOLETE     { */
+/* OBSOLETE             best >>= 16; */
+/* OBSOLETE             i = 0; */
+/* OBSOLETE     } */
+/* OBSOLETE     else */
+/* OBSOLETE     { */
+/* OBSOLETE             i = 16; */
+/* OBSOLETE     } */
+/* OBSOLETE  */
+/* OBSOLETE     /* Dump out instruction arguments *x/ */
+/* OBSOLETE     for (d = gld_opcodes[index].args; *d; ++d) */
+/* OBSOLETE     { */
+/* OBSOLETE         switch (*d) */
+/* OBSOLETE         { */
+/* OBSOLETE             case 'f': */
+/* OBSOLETE                 fprintf (stream, "%d",  (best >> (7 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'r': */
+/* OBSOLETE                 fprintf (stream, "r%d", (best >> (7 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'R': */
+/* OBSOLETE                 fprintf (stream, "r%d", (best >> (4 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'b': */
+/* OBSOLETE                 fprintf (stream, "b%d", (best >> (7 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'B': */
+/* OBSOLETE                 fprintf (stream, "b%d", (best >> (4 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'v': */
+/* OBSOLETE                 fprintf (stream, "b%d", (best >> (7 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'V': */
+/* OBSOLETE                 fprintf (stream, "b%d", (best >> (4 + i)) & 7); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'X': */
+/* OBSOLETE                 temp = (best >> 20) & 7; */
+/* OBSOLETE                 if (temp) */
+/* OBSOLETE                     fprintf (stream, "r%d", temp); */
+/* OBSOLETE                 else */
+/* OBSOLETE                     putc ('0', stream); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'A': */
+/* OBSOLETE                 temp = (best >> 16) & 7; */
+/* OBSOLETE                 if (temp) */
+/* OBSOLETE                     fprintf (stream, "(b%d)", temp); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'S': */
+/* OBSOLETE                 fprintf (stream, "#%d", best & 0x1f); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'I': */
+/* OBSOLETE                 fprintf (stream, "#%x", best & 0xffff); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'O': */
+/* OBSOLETE                 fprintf (stream, "%x", best & 0xffff); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'h': */
+/* OBSOLETE                 fprintf (stream, "%d", best & 0xfffe); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'd': */
+/* OBSOLETE                 fprintf (stream, "%d", best & 0xfffc); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'T': */
+/* OBSOLETE                 fprintf (stream, "%d", (best >> 8) & 0xff); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             case 'N': */
+/* OBSOLETE                 fprintf (stream, "%d", best & 0xff); */
+/* OBSOLETE                 break; */
+/* OBSOLETE             default: */
+/* OBSOLETE                 putc (*d, stream); */
+/* OBSOLETE                 break; */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
+/* OBSOLETE  */
+/* OBSOLETE     /* Return length of instruction *x/ */
+/* OBSOLETE     return (gld_opcodes[index].length); */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* */
 /* OBSOLETE  * Find the number of arguments to a function. */
 /* OBSOLETE  *x/ */
 /* OBSOLETE findarg(frame) */
-/* OBSOLETE    struct frame_info *frame; */
+/* OBSOLETE     struct frame_info *frame; */
 /* OBSOLETE { */
-/* OBSOLETE    register struct symbol *func; */
-/* OBSOLETE    register unsigned pc; */
+/* OBSOLETE     register struct symbol *func; */
+/* OBSOLETE     register unsigned pc; */
 /* OBSOLETE  */
 /* OBSOLETE #ifdef notdef */
-/* OBSOLETE    /* find starting address of frame function *x/ */
-/* OBSOLETE    pc = get_pc_function_start (frame->pc); */
+/* OBSOLETE     /* find starting address of frame function *x/ */
+/* OBSOLETE     pc = get_pc_function_start (frame->pc); */
 /* OBSOLETE  */
-/* OBSOLETE    /* find function symbol info *x/ */
-/* OBSOLETE    func = find_pc_function (pc); */
+/* OBSOLETE     /* find function symbol info *x/ */
+/* OBSOLETE     func = find_pc_function (pc); */
 /* OBSOLETE  */
-/* OBSOLETE    /* call blockframe code to look for match *x/ */
-/* OBSOLETE    if (func != NULL) */
+/* OBSOLETE     /* call blockframe code to look for match *x/ */
+/* OBSOLETE     if (func != NULL) */
 /* OBSOLETE                 return (func->value.block->nsyms / sizeof(int)); */
 /* OBSOLETE #endif */
 /* OBSOLETE  */
 /* OBSOLETE     /* Setup toplevel frame structure *x/ */
 /* OBSOLETE     frame->pc = read_pc(); */
 /* OBSOLETE     frame->next_frame = 0; */
-/* OBSOLETE     frame->frame = read_register (SP_REGNUM);      /* Br2 *x/ */
+/* OBSOLETE     frame->frame = read_register (SP_REGNUM);       /* Br2 *x/ */
 /* OBSOLETE  */
 /* OBSOLETE     /* Search for this frame (start at current Br2) *x/ */
 /* OBSOLETE     do */
 /* OBSOLETE     { */
-/* OBSOLETE    pointer = framechain(frame); */
-/* OBSOLETE    frame->next_frame = frame->frame; */
-/* OBSOLETE    frame->frame = pointer; */
-/* OBSOLETE    frame->pc = FRAME_SAVED_PC(frame); */
+/* OBSOLETE     pointer = framechain(frame); */
+/* OBSOLETE     frame->next_frame = frame->frame; */
+/* OBSOLETE     frame->frame = pointer; */
+/* OBSOLETE     frame->pc = FRAME_SAVED_PC(frame); */
 /* OBSOLETE     } */
 /* OBSOLETE     while (frame->next_frame != thisframe); */
 /* OBSOLETE #endif */
 /* OBSOLETE  */
 /* OBSOLETE     /* stop gap for now, end at __base3 *x/ */
 /* OBSOLETE     if (thisframe->pc == 0) */
-/* OBSOLETE    return 0; */
+/* OBSOLETE     return 0; */
 /* OBSOLETE  */
 /* OBSOLETE     return pointer; */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE     /* If no stack given, read register Br1 "(sp)" *x/ */
 /* OBSOLETE     if (!frame->frame) */
-/* OBSOLETE    prevsp = read_register (SP_REGNUM); */
+/* OBSOLETE     prevsp = read_register (SP_REGNUM); */
 /* OBSOLETE     else */
-/* OBSOLETE    prevsp = frame->frame; */
+/* OBSOLETE     prevsp = frame->frame; */
 /* OBSOLETE  */
 /* OBSOLETE     /* Check function header, case #2 *x/ */
 /* OBSOLETE     value = read_memory_integer (func, 4); */
 /* OBSOLETE     if (value) */
 /* OBSOLETE     { */
-/* OBSOLETE    /* 32bit call push value stored in function header *x/ */
-/* OBSOLETE    prevsp += value; */
+/* OBSOLETE     /* 32bit call push value stored in function header *x/ */
+/* OBSOLETE     prevsp += value; */
 /* OBSOLETE     } */
 /* OBSOLETE     else */
 /* OBSOLETE     { */
-/* OBSOLETE    /* read half-word from suabr at start of function *x/ */
-/* OBSOLETE    prevsp += read_memory_integer (func + 10, 2); */
+/* OBSOLETE     /* read half-word from suabr at start of function *x/ */
+/* OBSOLETE     prevsp += read_memory_integer (func + 10, 2); */
 /* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE     return (prevsp); */
index 904758fa8b4f6226662170d7a95253770e057cae..72e17d48cc98a5f5bd462c9040dce02b72a1b4b7 100644 (file)
 /* OBSOLETE       make_cleanup (free, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
-/* OBSOLETE    error ("To look at a core file, you must kill the program with \"kill\"."); */
+/* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
 /* OBSOLETE       corechan = open (filename, O_RDONLY, 0); */
 /* OBSOLETE       if (corechan < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       /* 4.2-style (and perhaps also sysV-style) core dump file.  *x/ */
 /* OBSOLETE       { */
-/* OBSOLETE    struct user u; */
-/* OBSOLETE    int reg_offset; */
-/* OBSOLETE  */
-/* OBSOLETE    val = myread (corechan, &u, sizeof u); */
-/* OBSOLETE    if (val < 0) */
-/* OBSOLETE      perror_with_name (filename); */
-/* OBSOLETE    data_start = exec_data_start; */
-/* OBSOLETE  */
-/* OBSOLETE    data_end = data_start + NBPG * u.u_dsize; */
-/* OBSOLETE    stack_start = stack_end - NBPG * u.u_ssize; */
-/* OBSOLETE    data_offset = NBPG * UPAGES; */
-/* OBSOLETE    stack_offset = NBPG * (UPAGES + u.u_dsize); */
-/* OBSOLETE    reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; */
-/* OBSOLETE  */
-/* OBSOLETE    /* I don't know where to find this info. */
-/* OBSOLETE       So, for now, mark it as not available.  *x/ */
-/* OBSOLETE    core_aouthdr.a_magic = 0; */
-/* OBSOLETE  */
-/* OBSOLETE    /* Read the register values out of the core file and store */
-/* OBSOLETE       them where `read_register' will find them.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE    { */
-/* OBSOLETE      register int regno; */
-/* OBSOLETE  */
-/* OBSOLETE      for (regno = 0; regno < NUM_REGS; regno++) */
-/* OBSOLETE        { */
-/* OBSOLETE          char buf[MAX_REGISTER_RAW_SIZE]; */
-/* OBSOLETE  */
-/* OBSOLETE          val = lseek (corechan, register_addr (regno, reg_offset), 0); */
-/* OBSOLETE          if (val < 0) */
-/* OBSOLETE            perror_with_name (filename); */
-/* OBSOLETE  */
-/* OBSOLETE          val = myread (corechan, buf, sizeof buf); */
-/* OBSOLETE          if (val < 0) */
-/* OBSOLETE            perror_with_name (filename); */
-/* OBSOLETE          supply_register (regno, buf); */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE     struct user u; */
+/* OBSOLETE     int reg_offset; */
+/* OBSOLETE  */
+/* OBSOLETE     val = myread (corechan, &u, sizeof u); */
+/* OBSOLETE     if (val < 0) */
+/* OBSOLETE       perror_with_name (filename); */
+/* OBSOLETE     data_start = exec_data_start; */
+/* OBSOLETE  */
+/* OBSOLETE     data_end = data_start + NBPG * u.u_dsize; */
+/* OBSOLETE     stack_start = stack_end - NBPG * u.u_ssize; */
+/* OBSOLETE     data_offset = NBPG * UPAGES; */
+/* OBSOLETE     stack_offset = NBPG * (UPAGES + u.u_dsize); */
+/* OBSOLETE     reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; */
+/* OBSOLETE  */
+/* OBSOLETE     /* I don't know where to find this info. */
+/* OBSOLETE        So, for now, mark it as not available.  *x/ */
+/* OBSOLETE     core_aouthdr.a_magic = 0; */
+/* OBSOLETE  */
+/* OBSOLETE     /* Read the register values out of the core file and store */
+/* OBSOLETE        them where `read_register' will find them.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE     { */
+/* OBSOLETE       register int regno; */
+/* OBSOLETE  */
+/* OBSOLETE       for (regno = 0; regno < NUM_REGS; regno++) */
+/* OBSOLETE         { */
+/* OBSOLETE           char buf[MAX_REGISTER_RAW_SIZE]; */
+/* OBSOLETE  */
+/* OBSOLETE           val = lseek (corechan, register_addr (regno, reg_offset), 0); */
+/* OBSOLETE           if (val < 0) */
+/* OBSOLETE             perror_with_name (filename); */
+/* OBSOLETE  */
+/* OBSOLETE           val = myread (corechan, buf, sizeof buf); */
+/* OBSOLETE           if (val < 0) */
+/* OBSOLETE             perror_with_name (filename); */
+/* OBSOLETE           supply_register (regno, buf); */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE       } */
 /* OBSOLETE       if (filename[0] == '/') */
-/* OBSOLETE    corefile = savestring (filename, strlen (filename)); */
+/* OBSOLETE     corefile = savestring (filename, strlen (filename)); */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      corefile = concat (current_directory, "/", filename, NULL); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       corefile = concat (current_directory, "/", filename, NULL); */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       flush_cached_frames (); */
 /* OBSOLETE       select_frame (get_current_frame (), 0); */
index 4fc502e4fa978461569aff9331add7c00f67ad56..a0bea530d93117a450a67080416f59406ba1d94e 100644 (file)
@@ -1,25 +1,26 @@
 /* Target-machine dependent code for Hitachi H8/300, for GDB.
    Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
- Contributed by Steve Chamberlain
-                sac@cygnus.com
  Contributed by Steve Chamberlain
+   sac@cygnus.com
  */
 
 #include "defs.h"
@@ -57,8 +58,8 @@ extern int h8300hmode, h8300smode;
 static char *original_register_names[] = REGISTER_NAMES;
 
 static char *h8300h_register_names[] =
-  {"er0", "er1", "er2", "er3", "er4", "er5", "er6",
   "sp", "ccr","pc","cycles","tick","inst" };
+{"er0", "er1", "er2", "er3", "er4", "er5", "er6",
"sp", "ccr", "pc", "cycles", "tick", "inst"};
 
 char **h8300_register_names = original_register_names;
 
@@ -70,7 +71,7 @@ static void set_machine_hook PARAMS ((char *filename));
 
 void h8300_frame_find_saved_regs ();
 
-CORE_ADDR 
+CORE_ADDR
 h8300_skip_prologue (start_pc)
      CORE_ADDR start_pc;
 {
@@ -165,10 +166,10 @@ CORE_ADDR
 h8300_frame_chain (thisframe)
      struct frame_info *thisframe;
 {
-  if (PC_IN_CALL_DUMMY(thisframe->pc, thisframe->frame, thisframe->frame))
-    { /* initialize the from_pc now */
+  if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
+    {                          /* initialize the from_pc now */
       thisframe->from_pc = generic_read_register_dummy (thisframe->pc,
-                                                       thisframe->frame, 
+                                                       thisframe->frame,
                                                        PC_REGNUM);
       return thisframe->frame;
     }
@@ -203,15 +204,15 @@ h8300_frame_find_saved_regs (fi, fsr)
 
       fi->fsr = cache_fsr;
 
-      if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
-       {       /* no more to do. */
+      if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+       {                       /* no more to do. */
          if (fsr)
            *fsr = *fi->fsr;
          return;
        }
       /* 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.  */
+         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);
@@ -228,7 +229,7 @@ h8300_frame_find_saved_regs (fi, fsr)
 /* 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.*/
+   of the instruction. */
 
 CORE_ADDR
 NEXT_PROLOGUE_INSN (addr, lim, pword1)
@@ -404,7 +405,7 @@ examine_prologue (ip, limit, after_prolog_fp, fsr, fi)
 
   /* 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);
@@ -423,8 +424,8 @@ h8300_init_extra_frame_info (fromleaf, fi)
   fi->args_pointer = 0;                /* Unknown */
   fi->locals_pointer = 0;      /* Unknown */
   fi->from_pc = 0;
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
-    { /* anything special to do? */
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+    {                          /* anything special to do? */
       return;
     }
 }
@@ -438,7 +439,7 @@ CORE_ADDR
 h8300_frame_saved_pc (frame)
      struct frame_info *frame;
 {
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     return generic_read_register_dummy (frame->pc, frame->frame, PC_REGNUM);
   else
     return frame->from_pc;
@@ -448,7 +449,7 @@ CORE_ADDR
 frame_locals_address (fi)
      struct frame_info *fi;
 {
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     return (CORE_ADDR) 0;      /* Not sure what else to do... */
   if (!fi->locals_pointer)
     {
@@ -467,7 +468,7 @@ CORE_ADDR
 frame_args_address (fi)
      struct frame_info *fi;
 {
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     return (CORE_ADDR) 0;      /* Not sure what else to do... */
   if (!fi->args_pointer)
     {
@@ -510,7 +511,7 @@ frame_args_address (fi)
    optimization.  I suspect this is a compiler bug.  Arguments of
    these odd sizes are left-justified within the word (as opposed to
    arguments smaller than WORDSIZE bytes, which are right-justified).
+
    If the function is to return an aggregate type such as a struct,
    the caller must allocate space into which the callee will copy the
    return value.  In this case, a pointer to the return value location
@@ -518,7 +519,7 @@ frame_args_address (fi)
    the other arguments passed in via registers R0 to R2.  */
 
 CORE_ADDR
-h8300_push_arguments(nargs, args, sp, struct_return, struct_addr)
+h8300_push_arguments (nargs, args, sp, struct_return, struct_addr)
      int nargs;
      struct value **args;
      CORE_ADDR sp;
@@ -538,27 +539,27 @@ h8300_push_arguments(nargs, args, sp, struct_return, struct_addr)
   if (h8300hmode || h8300smode)
     {
       stack_align = 3;
-      wordsize    = 4;
+      wordsize = 4;
     }
   else
     {
       stack_align = 1;
-      wordsize    = 2;
+      wordsize = 2;
     }
 
   /* first force sp to a n-byte alignment */
   sp = sp & ~stack_align;
 
   /* Now make sure there's space on the stack */
-  for (argnum = 0, stack_alloc = 0; 
+  for (argnum = 0, stack_alloc = 0;
        argnum < nargs; argnum++)
-    stack_alloc += ((TYPE_LENGTH(VALUE_TYPE(args[argnum])) + stack_align) 
+    stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + stack_align)
                    & ~stack_align);
-  sp -= stack_alloc;   /* make room on stack for args */
+  sp -= stack_alloc;           /* make room on stack for args */
   /* we may over-allocate a little here, but that won't hurt anything */
 
-  argreg = ARG0_REGNUM; 
-  if (struct_return)   /* "struct return" pointer takes up one argreg */
+  argreg = ARG0_REGNUM;
+  if (struct_return)           /* "struct return" pointer takes up one argreg */
     {
       write_register (argreg++, struct_addr);
     }
@@ -571,30 +572,30 @@ h8300_push_arguments(nargs, args, sp, struct_return, struct_addr)
     {
       type = VALUE_TYPE (args[argnum]);
       len = TYPE_LENGTH (type);
-      memset(valbuf, 0, sizeof(valbuf));
+      memset (valbuf, 0, sizeof (valbuf));
       if (len < wordsize)
        {
          /* the purpose of this is to right-justify the value within the word */
-         memcpy(valbuf + (wordsize - len), 
-                (char *) VALUE_CONTENTS (args[argnum]), len);
+         memcpy (valbuf + (wordsize - len),
+                 (char *) VALUE_CONTENTS (args[argnum]), len);
          val = valbuf;
        }
       else
        val = (char *) VALUE_CONTENTS (args[argnum]);
 
-      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, 
+      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);
          stack_offset += (len + stack_align) & ~stack_align;
        }
       /* 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))
+         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))
        while (len > 0)
-         { /* there's room in registers */
+         {                     /* there's room in registers */
            regval = extract_address (val, wordsize);
            write_register (argreg, regval);
            len -= wordsize;
@@ -635,16 +636,16 @@ h8300_push_return_address (pc, sp)
    was created.  Usually used either by the "RETURN" command, or by
    call_function_by_hand after the dummy_frame is finished. */
 
-void 
+void
 h8300_pop_frame ()
 {
   unsigned regnum;
   struct frame_saved_regs fsr;
   struct frame_info *frame = get_current_frame ();
 
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     {
-      generic_pop_dummy_frame();
+      generic_pop_dummy_frame ();
     }
   else
     {
@@ -655,8 +656,8 @@ h8300_pop_frame ()
          /* Don't forget SP_REGNUM is a frame_saved_regs struct is the
             actual value we want, not the address of the value we want.  */
          if (fsr.regs[regnum] && regnum != SP_REGNUM)
-           write_register (regnum, 
-                           read_memory_integer(fsr.regs[regnum], BINWORD));
+           write_register (regnum,
+                           read_memory_integer (fsr.regs[regnum], BINWORD));
          else if (fsr.regs[regnum] && regnum == SP_REGNUM)
            write_register (regnum, frame->frame + 2 * BINWORD);
        }
@@ -684,70 +685,72 @@ h8300_extract_return_value (type, regbuf, valbuf)
   else
     wordsize = 2;
 
-  len = TYPE_LENGTH(type);
-
-  switch (len) {
-  case 1:      /* (char) */
-  case 2:      /* (short), (int) */
-    memcpy (valbuf,   regbuf + REGISTER_BYTE(0) + (wordsize - len), len);
-    break;
-  case 4:      /* (long), (float) */
-    if (h8300smode || h8300hmode)
-      {
-       memcpy (valbuf,   regbuf + REGISTER_BYTE(0), 4);
-      }
-    else
-      {
-       memcpy (valbuf,   regbuf + REGISTER_BYTE(0), 2);
-       memcpy (valbuf+2, regbuf + REGISTER_BYTE(1), 2);
-      }
-    break;
-  case 8:      /* (double) (doesn't seem to happen, which is good,
-                  because this almost certainly isn't right.  */
-    error ("I don't know how a double is returned.");
-    break;
-  }
+  len = TYPE_LENGTH (type);
+
+  switch (len)
+    {
+    case 1:                    /* (char) */
+    case 2:                    /* (short), (int) */
+      memcpy (valbuf, regbuf + REGISTER_BYTE (0) + (wordsize - len), len);
+      break;
+    case 4:                    /* (long), (float) */
+      if (h8300smode || h8300hmode)
+       {
+         memcpy (valbuf, regbuf + REGISTER_BYTE (0), 4);
+       }
+      else
+       {
+         memcpy (valbuf, regbuf + REGISTER_BYTE (0), 2);
+         memcpy (valbuf + 2, regbuf + REGISTER_BYTE (1), 2);
+       }
+      break;
+    case 8:                    /* (double) (doesn't seem to happen, which is good,
+                                  because this almost certainly isn't right.  */
+      error ("I don't know how a double is returned.");
+      break;
+    }
 }
 
 /* Function: store_return_value
    Place the appropriate value in the appropriate registers.
    Primarily used by the RETURN command.  */
 
-void 
+void
 h8300_store_return_value (type, valbuf)
      struct type *type;
      char *valbuf;
 {
   int wordsize, len, regval;
-  
+
   if (h8300hmode || h8300smode)
     wordsize = 4;
   else
     wordsize = 2;
 
-  len = TYPE_LENGTH(type);
-  switch (len) {
-  case 1:      /* char */
-  case 2:      /* short, int */
-    regval = extract_address(valbuf, len);
-    write_register (0, regval);
-    break;
-  case 4:      /* long, float */
-    regval = extract_address(valbuf, len);
-    if (h8300smode || h8300hmode)
-      {
-       write_register (0, regval);
-      }
-    else
-      {
-       write_register (0, regval >> 16);
-       write_register (1, regval & 0xffff);
-      }
-    break;
-  case 8:      /* presumeably double, but doesn't seem to happen */
-    error ("I don't know how to return a double.");
-    break;
-  }
+  len = TYPE_LENGTH (type);
+  switch (len)
+    {
+    case 1:                    /* char */
+    case 2:                    /* short, int */
+      regval = extract_address (valbuf, len);
+      write_register (0, regval);
+      break;
+    case 4:                    /* long, float */
+      regval = extract_address (valbuf, len);
+      if (h8300smode || h8300hmode)
+       {
+         write_register (0, regval);
+       }
+      else
+       {
+         write_register (0, regval >> 16);
+         write_register (1, regval & 0xffff);
+       }
+      break;
+    case 8:                    /* presumeably double, but doesn't seem to happen */
+      error ("I don't know how to return a double.");
+      break;
+    }
 }
 
 struct cmd_list_element *setmemorylist;
@@ -762,7 +765,7 @@ set_register_names ()
 }
 
 static void
-h8300_command(args, from_tty)
+h8300_command (args, from_tty)
 {
   extern int h8300hmode;
   h8300hmode = 0;
@@ -771,7 +774,7 @@ h8300_command(args, from_tty)
 }
 
 static void
-h8300h_command(args, from_tty)
+h8300h_command (args, from_tty)
 {
   extern int h8300hmode;
   h8300hmode = 1;
@@ -780,7 +783,7 @@ h8300h_command(args, from_tty)
 }
 
 static void
-h8300s_command(args, from_tty)
+h8300s_command (args, from_tty)
 {
   extern int h8300smode;
   extern int h8300hmode;
@@ -790,7 +793,7 @@ h8300s_command(args, from_tty)
 }
 
 
-static void 
+static void
 set_machine (args, from_tty)
      char *args;
      int from_tty;
@@ -815,8 +818,7 @@ set_machine_hook (filename)
       h8300smode = 1;
       h8300hmode = 1;
     }
-  else 
-    if (bfd_get_mach (exec_bfd) == bfd_mach_h8300h)
+  else if (bfd_get_mach (exec_bfd) == bfd_mach_h8300h)
     {
       h8300smode = 0;
       h8300hmode = 1;
@@ -833,7 +835,7 @@ void
 _initialize_h8300m ()
 {
   add_prefix_cmd ("machine", no_class, set_machine,
-                 "set the machine type", 
+                 "set the machine type",
                  &setmemorylist, "set machine ", 0,
                  &setlist);
 
@@ -848,7 +850,7 @@ _initialize_h8300m ()
 
   /* Add a hook to set the machine type when we're loading a file. */
 
-  specify_exec_file_hook(set_machine_hook);
+  specify_exec_file_hook (set_machine_hook);
 }
 
 
@@ -863,7 +865,7 @@ print_register_hook (regno)
       unsigned char b[4];
       unsigned char l;
       read_relative_register_raw_bytes (regno, b);
-      l = b[REGISTER_VIRTUAL_SIZE(8) -1];
+      l = b[REGISTER_VIRTUAL_SIZE (8) - 1];
       printf_unfiltered ("\t");
       printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
       printf_unfiltered ("H-%d - ", (l & 0x20) != 0);
index 49fab2d54e560ef07dc0ed33a485448c7a49f564..b6ac28c0868177fef95ab5918544b44a340776a7 100644 (file)
@@ -1,25 +1,26 @@
 /* Target-dependent code for Hitachi H8/500, for GDB.
    Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
- Contributed by Steve Chamberlain
-                sac@cygnus.com
  Contributed by Steve Chamberlain
+   sac@cygnus.com
  */
 
 #include "defs.h"
@@ -45,20 +46,20 @@ static int data_size = 2;
    arg-2
    arg-1
    return address <2 or 4 bytes>
-   old fp        <2 bytes>
+   old fp         <2 bytes>
    auto-n
    ..
    auto-1
    saved registers
 
-*/
+ */
 
 /* an easy to debug H8 stack frame looks like:
-0x6df6         push    r6
-0x0d76         mov.w   r7,r6
-0x6dfn          push    reg
-0x7905 nnnn    mov.w  #n,r5    or   0x1b87  subs #2,sp
-0x1957         sub.w  r5,sp
+   0x6df6               push    r6
+   0x0d76       mov.w   r7,r6
+   0x6dfn          push    reg
+   0x7905 nnnn          mov.w  #n,r5    or   0x1b87  subs #2,sp
+   0x1957               sub.w  r5,sp
 
  */
 
@@ -125,7 +126,7 @@ h8500_frame_chain (thisframe)
 /* 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.*/
+   of the instruction. */
 
 CORE_ADDR
 NEXT_PROLOGUE_INSN (addr, lim, pword1)
@@ -161,7 +162,7 @@ frame_saved_pc (frame)
   return read_memory_integer (FRAME_FP (frame) + 2, PTR_SIZE);
 }
 
-void 
+void
 h8500_pop_frame ()
 {
   unsigned regnum;
@@ -328,9 +329,9 @@ frame_find_saved_regs (frame_info, frame_saved_regs)
     {
       pc = get_pc_function_start ((frame_info)->pc);
       /* Verify we have a link a6 instruction next;
-        if not we lose.  If we win, find the address above the saved
-        regs using the amount of storage from the link instruction.
-        */
+         if not we lose.  If we win, find the address above the saved
+         regs using the amount of storage from the link instruction.
+       */
 
       thebyte = read_memory_integer (pc, 1);
       if (0x1f == thebyte)
@@ -523,7 +524,7 @@ h8500_value_of_trapped_internalvar (var)
   regval = regbuf[0] << 16;
 
   get_saved_register (regbuf, NULL, NULL, selected_frame, regnum, NULL);
-  regval |= regbuf[0] << 8 | regbuf[1];        /* XXX host/target byte order */
+  regval |= regbuf[0] << 8 | regbuf[1];                /* XXX host/target byte order */
 
   free (var->value);           /* Free up old value */
 
@@ -639,15 +640,15 @@ _initialize_h8500_tdep ()
                  &setlist);
 
   add_cmd ("small", class_support, small_command,
-          "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist);
+      "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist);
 
   add_cmd ("big", class_support, big_command,
-          "Set big memory model. (32 bit code, 32 bit data)", &setmemorylist);
+       "Set big memory model. (32 bit code, 32 bit data)", &setmemorylist);
 
   add_cmd ("medium", class_support, medium_command,
-          "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist);
+     "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist);
 
   add_cmd ("compact", class_support, compact_command,
-          "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist);
+    "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist);
 
 }
index 5926ada3f3e7b5320345e0591a5deebf108aab8b..e1208dca5137b200608460f845abdefc180ad00f 100644 (file)
@@ -15,7 +15,8 @@
 
    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.
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
    Written by the Center for Software Science at the University of Utah
    and by Cygnus Support.  */
@@ -282,7 +283,7 @@ hpread_pxdb_needed (sym_bfd)
 /* Check whether the file needs to be preprocessed by pxdb. 
    If so, call pxdb. */
 
-void 
+void
 do_pxdb (sym_bfd)
      bfd *sym_bfd;
 {
@@ -292,22 +293,22 @@ do_pxdb (sym_bfd)
 
   /* This code will not be executed if the file is not in SOM
      format (i.e. if compiled with gcc) */
-    if (hpread_pxdb_needed (sym_bfd)) 
-      {
-       /*This file has not been pre-processed. Preprocess now */
-         
-       if (hpread_call_pxdb (sym_bfd->filename))
-         {
-           /* The call above has changed the on-disk file, 
-               we can close the file anyway, because the
-              symbols will be reread in when the target is run */
-           bfd_close (sym_bfd); 
-         }
-      }
-}
+  if (hpread_pxdb_needed (sym_bfd))
+    {
+      /*This file has not been pre-processed. Preprocess now */
 
+      if (hpread_call_pxdb (sym_bfd->filename))
+       {
+         /* The call above has changed the on-disk file, 
+            we can close the file anyway, because the
+            symbols will be reread in when the target is run */
+         bfd_close (sym_bfd);
+       }
+    }
+}
 \f
 
+
 #ifdef QUICK_LOOK_UP
 
 /* Code to handle quick lookup-tables follows. */
@@ -363,10 +364,10 @@ do_pxdb (sym_bfd)
    psymtabs created so far */
 
 typedef struct
-  {
-    int start;
-    int end;
-  }
+{
+  int start;
+  int end;
+}
 pst_syms_struct;
 
 static pst_syms_struct *pst_syms_array = 0;
@@ -601,10 +602,10 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
                                           VAR_NAMESPACE,
                                           LOC_BLOCK,   /* "I am a routine"        */
                                           &objfile->global_psymbols,
-                                          (qPD[curr_pd].adrStart + /* Starting address of rtn */
-                                           ANOFFSET (section_offsets, SECT_OFF_TEXT)),
+                                          (qPD[curr_pd].adrStart +     /* Starting address of rtn */
+                                ANOFFSET (section_offsets, SECT_OFF_TEXT)),
                                           0,   /* core addr?? */
-                                          trans_lang ((enum hp_language) qPD[curr_pd].language),
+                     trans_lang ((enum hp_language) qPD[curr_pd].language),
                                           objfile);
       else
        add_psymbol_with_dem_name_to_list (rtn_name,
@@ -614,10 +615,10 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
                                           VAR_NAMESPACE,
                                           LOC_BLOCK,   /* "I am a routine"        */
                                           &objfile->static_psymbols,
-                                          (qPD[curr_pd].adrStart +  /* Starting address of rtn */
-                                           ANOFFSET (section_offsets, SECT_OFF_TEXT)),
+                                          (qPD[curr_pd].adrStart +     /* Starting address of rtn */
+                                ANOFFSET (section_offsets, SECT_OFF_TEXT)),
                                           0,   /* core addr?? */
-                                          trans_lang ((enum hp_language) qPD[curr_pd].language),
+                     trans_lang ((enum hp_language) qPD[curr_pd].language),
                                           objfile);
 
       symbol_count++;
@@ -647,12 +648,12 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
    entry for it, so in such cases we create a psymtab for the file.  */
 
 int
-hpread_quick_traverse (objfile,        section_offsets, gntt_bits, vt_bits, pxdb_header_p)     
-     struct objfile *objfile;        /* The object file descriptor */
-     struct section_offsets *section_offsets; /* ?? Null for HP */
-     char *gntt_bits;                /* GNTT entries, loaded in from the file */
-     char *vt_bits;                  /* VT (string) entries ditto. */
-     PXDB_header_ptr pxdb_header_p;  /* Pointer to pxdb header ditto */
+hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header_p)
+     struct objfile *objfile;  /* The object file descriptor */
+     struct section_offsets *section_offsets;  /* ?? Null for HP */
+     char *gntt_bits;          /* GNTT entries, loaded in from the file */
+     char *vt_bits;            /* VT (string) entries ditto. */
+     PXDB_header_ptr pxdb_header_p;    /* Pointer to pxdb header ditto */
 {
   struct partial_symtab *pst;
 
@@ -679,8 +680,8 @@ hpread_quick_traverse (objfile,     section_offsets, gntt_bits, vt_bits, pxdb_header
 
   struct partial_symbol **global_syms; /* We'll be filling in the "global"   */
   struct partial_symbol **static_syms; /* and "static" tables in the objfile
-                                           as we go, so we need a pair of     
-                                           current pointers. */
+                                          as we go, so we need a pair of     
+                                          current pointers. */
 
 #ifdef DUMPING
   /* Turn this on for lots of debugging information in this routine.
@@ -862,24 +863,24 @@ hpread_quick_traverse (objfile,   section_offsets, gntt_bits, vt_bits, pxdb_header
             might help.  */
 
          pst = hpread_start_psymtab (objfile,
-                                     section_offsets,          /* ?? */
+                                     section_offsets,  /* ?? */
                                      mod_name_string,
                                      CURR_MODULE_START,        /* Low text address: bogus! */
-                                     (CURR_MODULE_ISYM * sizeof (struct dntt_type_block)),
-                                                               /* ldsymoff */
+                      (CURR_MODULE_ISYM * sizeof (struct dntt_type_block)),
+         /* ldsymoff */
                                      global_syms,
                                      static_syms);
 
          pst = hpread_end_psymtab (pst,
                                    NULL,       /* psymtab_include_list */
-                                   0,          /* includes_used        */
-                                   end_sym * sizeof (struct dntt_type_block),
-                                               /* byte index in LNTT of end 
-                                                  = capping symbol offset  
-                                                  = LDSYMOFF of nextfile */
-                                   0,          /* text high            */
+                                   0,  /* includes_used        */
+                                 end_sym * sizeof (struct dntt_type_block),
+         /* byte index in LNTT of end 
+            = capping symbol offset  
+            = LDSYMOFF of nextfile */
+                                   0,  /* text high            */
                                    NULL,       /* dependency_list      */
-                                   0);         /* dependencies_used    */
+                                   0);         /* dependencies_used    */
 
          global_syms = objfile->global_psymbols.next;
          static_syms = objfile->static_psymbols.next;
@@ -966,9 +967,9 @@ hpread_quick_traverse (objfile,     section_offsets, gntt_bits, vt_bits, pxdb_header
              pst = hpread_start_psymtab (objfile,
                                          section_offsets,      /* ?? */
                                          full_name_string,
-                                         start_adr,            /* Low text address */
-                                         (start_sym * sizeof (struct dntt_type_block)),
-                                                               /* ldsymoff */
+                                         start_adr,    /* Low text address */
+                             (start_sym * sizeof (struct dntt_type_block)),
+             /* ldsymoff */
                                          global_syms,
                                          static_syms);
 
@@ -981,7 +982,7 @@ hpread_quick_traverse (objfile,     section_offsets, gntt_bits, vt_bits, pxdb_header
 
              syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
                                        start_adr, end_adr,
-                                       pst, vt_bits, objfile, section_offsets);
+                                   pst, vt_bits, objfile, section_offsets);
 
              /* Get ending symbol offset */
 
@@ -1030,10 +1031,10 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
              pst = hpread_end_psymtab (pst,
                                        NULL,   /* psymtab_include_list */
                                        0,      /* includes_used        */
-                                       end_sym * sizeof (struct dntt_type_block),
-                                               /* byte index in LNTT of end 
-                                                  = capping symbol offset   
-                                                  = LDSYMOFF of nextfile */
+                                 end_sym * sizeof (struct dntt_type_block),
+             /* byte index in LNTT of end 
+                = capping symbol offset   
+                = LDSYMOFF of nextfile */
                                        end_adr,        /* text high */
                                        NULL,   /* dependency_list */
                                        0);     /* dependencies_used */
@@ -1197,8 +1198,8 @@ hpread_quick_traverse (objfile,   section_offsets, gntt_bits, vt_bits, pxdb_header
                                          section_offsets,      /* ?? */
                                          full_name_string,
                                          start_adr,    /* Low text address */
-                                         (start_sym * sizeof (struct dntt_type_block)),
-                                                       /* ldsymoff */
+                             (start_sym * sizeof (struct dntt_type_block)),
+             /* ldsymoff */
                                          global_syms,
                                          static_syms);
 
@@ -1211,7 +1212,7 @@ hpread_quick_traverse (objfile,   section_offsets, gntt_bits, vt_bits, pxdb_header
 
              syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
                                        start_adr, end_adr,
-                                       pst, vt_bits, objfile, section_offsets);
+                                   pst, vt_bits, objfile, section_offsets);
 
              /* Get ending symbol offset */
 
@@ -1260,10 +1261,10 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
              pst = hpread_end_psymtab (pst,
                                        NULL,   /* psymtab_include_list */
                                        0,      /* includes_used        */
-                                       end_sym * sizeof (struct dntt_type_block),
-                                               /* byte index in LNTT of end 
-                                                  = capping symbol offset   
-                                                  = LDSYMOFF of nextfile */
+                                 end_sym * sizeof (struct dntt_type_block),
+             /* byte index in LNTT of end 
+                = capping symbol offset   
+                = LDSYMOFF of nextfile */
                                        end_adr,        /* text high */
                                        NULL,   /* dependency_list      */
                                        0);     /* dependencies_used    */
@@ -1311,8 +1312,8 @@ hpread_quick_traverse (objfile,   section_offsets, gntt_bits, vt_bits, pxdb_header
                                  section_offsets,      /* ?? */
                                  "orphans",
                                  start_adr,    /* Low text address */
-                                 (CURR_PROC_ISYM * sizeof (struct dntt_type_block)),
-                                               /* ldsymoff */
+                        (CURR_PROC_ISYM * sizeof (struct dntt_type_block)),
+      /* ldsymoff */
                                  global_syms,
                                  static_syms);
 
@@ -1323,10 +1324,10 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
       pst = hpread_end_psymtab (pst,
                                NULL,   /* psymtab_include_list */
                                0,      /* includes_used */
-                               pxdb_header_p->globals * sizeof (struct dntt_type_block),
-                                       /* byte index in LNTT of end 
-                                          = capping symbol offset   
-                                          = LDSYMOFF of nextfile */
+                  pxdb_header_p->globals * sizeof (struct dntt_type_block),
+      /* byte index in LNTT of end 
+         = capping symbol offset   
+         = LDSYMOFF of nextfile */
                                end_adr,        /* text high  */
                                NULL,   /* dependency_list */
                                0);     /* dependencies_used */
@@ -1507,7 +1508,7 @@ hpread_symfile_init (objfile)
                     bfd_section_size (objfile->obfd, gntt_section));
 
   bfd_get_section_contents (objfile->obfd, gntt_section, GNTT (objfile),
-                           0, bfd_section_size (objfile->obfd, gntt_section));
+                        0, bfd_section_size (objfile->obfd, gntt_section));
 
   GNTT_SYMCOUNT (objfile)
     = bfd_section_size (objfile->obfd, gntt_section)
@@ -1529,7 +1530,7 @@ hpread_symfile_init (objfile)
                     bfd_section_size (objfile->obfd, lntt_section));
 
   bfd_get_section_contents (objfile->obfd, lntt_section, LNTT (objfile),
-                           0, bfd_section_size (objfile->obfd, lntt_section));
+                        0, bfd_section_size (objfile->obfd, lntt_section));
 
   LNTT_SYMCOUNT (objfile)
     = bfd_section_size (objfile->obfd, lntt_section)
@@ -1546,7 +1547,7 @@ hpread_symfile_init (objfile)
                   bfd_section_size (objfile->obfd, slt_section));
 
   bfd_get_section_contents (objfile->obfd, slt_section, SLT (objfile),
-                           0, bfd_section_size (objfile->obfd, slt_section));
+                         0, bfd_section_size (objfile->obfd, slt_section));
 
   /* Read in data from the $VT$ subspace.  $VT$ contains things like
      names and constants.  Keep track of the number of symbols in the VT.  */
@@ -1686,16 +1687,16 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
 
        discard_cleanups (old_chain);
 
-               /* Set up to scan the global section of the LNTT.
+       /* Set up to scan the global section of the LNTT.
 
-                  This field is not always correct: if there are
-                  no globals, it will point to the last record in
-                  the regular LNTT, which is usually an END MODULE.
+          This field is not always correct: if there are
+          no globals, it will point to the last record in
+          the regular LNTT, which is usually an END MODULE.
 
-                  Since it might happen that there could be a file
-                  with just one global record, there's no way to
-                  tell other than by looking at the record, so that's
-                  done below. */
+          Since it might happen that there could be a file
+          with just one global record, there's no way to
+          tell other than by looking at the record, so that's
+          done below. */
        if (found_modules_in_program)
          scan_start = pxdb_header.globals;
       }
@@ -1709,8 +1710,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
   }
 #endif /* QUICK_LOOK_UP */
 
-    /* Make two passes, one over the GNTT symbols, the other for the
-       LNTT symbols.
+  /* Make two passes, one over the GNTT symbols, the other for the
+     LNTT symbols.
 
      JB comment: above isn't true--they only make one pass, over
      the LNTT.  */
@@ -1833,7 +1834,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                pst = hpread_start_psymtab (objfile, section_offsets,
                                            namestring, valu,
                                            (hp_symnum
-                                            * sizeof (struct dntt_type_block)),
+                                        * sizeof (struct dntt_type_block)),
                                            objfile->global_psymbols.next,
                                            objfile->static_psymbols.next);
                texthigh = valu;
@@ -1869,7 +1870,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                  pst = hpread_start_psymtab (objfile, section_offsets,
                                              namestring, valu,
                                              (hp_symnum
-                                              * sizeof (struct dntt_type_block)),
+                                        * sizeof (struct dntt_type_block)),
                                              objfile->global_psymbols.next,
                                              objfile->static_psymbols.next);
                  texthigh = valu;
@@ -1988,9 +1989,9 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                    pst = hpread_start_psymtab (objfile, section_offsets,
                                                "globals", 0,
                                                (hp_symnum
-                                                * sizeof (struct dntt_type_block)),
-                                               objfile->global_psymbols.next,
-                                               objfile->static_psymbols.next);
+                                        * sizeof (struct dntt_type_block)),
+                                             objfile->global_psymbols.next,
+                                            objfile->static_psymbols.next);
                  }
 
                /* Compute address of the data symbol */
@@ -2048,7 +2049,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                                                 VAR_NAMESPACE, storage,
                                                 &objfile->global_psymbols,
                                                 dn_bufp->dsvar.location,
-                                                0, language_unknown, objfile);
+                                             0, language_unknown, objfile);
                          }
                        else
                          {
@@ -2056,7 +2057,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                                                 VAR_NAMESPACE, storage,
                                                 &objfile->static_psymbols,
                                                 dn_bufp->dsvar.location,
-                                                0, language_unknown, objfile);
+                                             0, language_unknown, objfile);
                          }
                      }
                  }
@@ -2072,7 +2073,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                  pst = hpread_start_psymtab (objfile, section_offsets,
                                              "globals", 0,
                                              (hp_symnum
-                                              * sizeof (struct dntt_type_block)),
+                                        * sizeof (struct dntt_type_block)),
                                              objfile->global_psymbols.next,
                                              objfile->static_psymbols.next);
                }
@@ -2296,7 +2297,7 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
     {
       pst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+                   number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
              number_dependencies * sizeof (struct partial_symtab *));
     }
@@ -2377,5 +2378,3 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
 ***c - basic - offset:4
 *** End:
 #endif
-
-
index 90d4a10c6bc95b009ee4d26e899a6413ef312b4b..a432473412687e991058f20ea7cdde4c484be55e 100644 (file)
@@ -15,7 +15,8 @@
 
    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.
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
    Written by the Center for Software Science at the University of Utah
    and by Cygnus Support.  */
 #include "hpread.h"
 #include "demangle.h"
 #include "complaints.h"
-
 \f
 
 
-static struct complaint  hpread_unhandled_end_common_complaint =
+
+static struct complaint hpread_unhandled_end_common_complaint =
 {
   "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n", 0, 0
 };
 
-static struct complaint  hpread_unhandled_type_complaint =
+static struct complaint hpread_unhandled_type_complaint =
 {
   "hpread_type_translate: unhandled type code.", 0, 0
 };
 
-static struct complaint  hpread_struct_complaint =
+static struct complaint hpread_struct_complaint =
 {
   "hpread_read_struct_type: expected SVAR type...", 0, 0
 };
@@ -53,28 +54,28 @@ static struct complaint hpread_array_complaint =
   "error in hpread_array_type.", 0, 0
 };
 
-static struct complaint  hpread_type_lookup_complaint =
+static struct complaint hpread_type_lookup_complaint =
 {
   "error in hpread_type_lookup().", 0, 0
 };
 
 
-static struct complaint  hpread_unexpected_end_complaint =
+static struct complaint hpread_unexpected_end_complaint =
 {
   "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.", 0, 0
 };
 
-static struct complaint hpread_tagdef_complaint  =
+static struct complaint hpread_tagdef_complaint =
 {
   "error processing class tagdef", 0, 0
 };
 
-static struct complaint  hpread_unhandled_common_complaint =
+static struct complaint hpread_unhandled_common_complaint =
 {
   "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON.", 0, 0
 };
 
-static struct complaint  hpread_unhandled_blockdata_complaint =
+static struct complaint hpread_unhandled_blockdata_complaint =
 {
   "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA.", 0, 0
 };
@@ -91,17 +92,17 @@ static unsigned long hpread_get_line
 static CORE_ADDR hpread_get_location
   PARAMS ((sltpointer, struct objfile *));
 
-static void hpread_psymtab_to_symtab_1 
+static void hpread_psymtab_to_symtab_1
   PARAMS ((struct partial_symtab *));
 
-void hpread_psymtab_to_symtab 
+void hpread_psymtab_to_symtab
   PARAMS ((struct partial_symtab *));
 
 static struct symtab *hpread_expand_symtab
   PARAMS ((struct objfile *, int, int, CORE_ADDR, int,
           struct section_offsets *, char *));
 
-static int hpread_type_translate 
+static int hpread_type_translate
   PARAMS ((dnttpointer));
 
 static struct type **hpread_lookup_type
@@ -125,19 +126,19 @@ static struct type *hpread_read_struct_type
 static struct type *hpread_get_nth_template_arg
   PARAMS ((struct objfile *, int));
 
-static struct type * hpread_read_templ_arg_type 
+static struct type *hpread_read_templ_arg_type
   PARAMS ((dnttpointer, union dnttentry *, struct objfile *, char *));
 
 static struct type *hpread_read_set_type
   PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
 
-static struct type * hpread_read_array_type 
-  PARAMS ((dnttpointer, union dnttentry *dn_bufp, struct objfile *objfile));
+static struct type *hpread_read_array_type
+  PARAMS ((dnttpointer, union dnttentry * dn_bufp, struct objfile * objfile));
 
 static struct type *hpread_read_subrange_type
   PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
 
-static struct type * hpread_type_lookup
+static struct type *hpread_type_lookup
   PARAMS ((dnttpointer, struct objfile *));
 
 static sltpointer hpread_record_lines
@@ -146,12 +147,12 @@ static sltpointer hpread_record_lines
 
 static void hpread_process_one_debug_symbol
   PARAMS ((union dnttentry *, char *, struct section_offsets *,
-          struct objfile *, CORE_ADDR, int, char *, int, int * ));
+          struct objfile *, CORE_ADDR, int, char *, int, int *));
 
 static int hpread_get_scope_depth
   PARAMS ((union dnttentry *, struct objfile *, int));
 
-static void fix_static_member_physnames 
+static void fix_static_member_physnames
   PARAMS ((struct type *, char *, struct objfile *));
 
 static void fixup_class_method_type
@@ -164,19 +165,19 @@ static dnttpointer hpread_get_next_skip_over_anon_unions
 
 /* Global to indicate presence of HP-compiled objects,
    in particular, SOM executable file with SOM debug info 
-   Defined in symtab.c, used in hppa-tdep.c. */ 
+   Defined in symtab.c, used in hppa-tdep.c. */
 extern int hp_som_som_object_present;
 
 /* Static used to indicate a class type that requires a
    fix-up of one of its method types */
-static struct type * fixup_class = NULL;
+static struct type *fixup_class = NULL;
 
 /* Static used to indicate the method type that is to be
    used to fix-up the type for fixup_class */
-static struct type * fixup_method = NULL;
-
+static struct type *fixup_method = NULL;
 \f
 
+
 /* Get the nesting depth for the source line identified by INDEX.  */
 
 static unsigned long
@@ -220,24 +221,24 @@ hpread_get_location (index, objfile)
     {
       /* find previous normal sltentry and get address */
       for (i = 0; ((sl_bufp->snorm.sltdesc != SLT_NORMAL) &&
-                   (sl_bufp->snorm.sltdesc != SLT_NORMAL_OFFSET) &&
+                  (sl_bufp->snorm.sltdesc != SLT_NORMAL_OFFSET) &&
                   (sl_bufp->snorm.sltdesc != SLT_EXIT)); i++)
        sl_bufp = hpread_get_slt (index - i, objfile);
       if (sl_bufp->snorm.sltdesc == SLT_NORMAL_OFFSET)
-        return sl_bufp->snormoff.address;
+       return sl_bufp->snormoff.address;
       else
-        return sl_bufp->snorm.address;
+       return sl_bufp->snorm.address;
     }
 
   /* find next normal sltentry and get address */
   for (i = 0; ((sl_bufp->snorm.sltdesc != SLT_NORMAL) &&
               (sl_bufp->snorm.sltdesc != SLT_NORMAL_OFFSET) &&
-               (sl_bufp->snorm.sltdesc != SLT_EXIT)); i++)
+              (sl_bufp->snorm.sltdesc != SLT_EXIT)); i++)
     sl_bufp = hpread_get_slt (index + i, objfile);
-      if (sl_bufp->snorm.sltdesc == SLT_NORMAL_OFFSET)
-        return sl_bufp->snormoff.address;
-      else
-        return sl_bufp->snorm.address;
+  if (sl_bufp->snorm.sltdesc == SLT_NORMAL_OFFSET)
+    return sl_bufp->snormoff.address;
+  else
+    return sl_bufp->snorm.address;
 }
 \f
 
@@ -301,18 +302,18 @@ hpread_has_name (kind)
     case DNTT_TYPE_INHERITANCE:
     case DNTT_TYPE_FRIEND_CLASS:
     case DNTT_TYPE_FRIEND_FUNC:
-    case DNTT_TYPE_MODIFIER: 
+    case DNTT_TYPE_MODIFIER:
     case DNTT_TYPE_OBJECT_ID:
     case DNTT_TYPE_TEMPLATE:
     case DNTT_TYPE_TEMPLATE_ARG:
     case DNTT_TYPE_FUNC_TEMPLATE:
     case DNTT_TYPE_LINK:
-    /* DNTT_TYPE_DYN_ARRAY_DESC ? */
-    /* DNTT_TYPE_DESC_SUBRANGE ? */
-    /* DNTT_TYPE_BEGIN_EXT ? */
-    /* DNTT_TYPE_INLN ? */
-    /* DNTT_TYPE_INLN_LIST ? */
-    /* DNTT_TYPE_ALIAS ? */
+      /* DNTT_TYPE_DYN_ARRAY_DESC ? */
+      /* DNTT_TYPE_DESC_SUBRANGE ? */
+      /* DNTT_TYPE_BEGIN_EXT ? */
+      /* DNTT_TYPE_INLN ? */
+      /* DNTT_TYPE_INLN_LIST ? */
+      /* DNTT_TYPE_ALIAS ? */
     default:
       return 0;
     }
@@ -400,7 +401,7 @@ hpread_psymtab_to_symtab (pst)
      was compiled using an HP compiler (aCC, cc) 
      the processing_acc_compilation variable is declared in the 
      file buildsym.h, the HP_COMPILED_TARGET is defined to be equal
-     to 3 in the file tm_hppa.h*/
+     to 3 in the file tm_hppa.h */
 
   processing_gcc_compilation = 0;
 
@@ -448,11 +449,11 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
      struct section_offsets *section_offsets;
      char *filename;
 {
-  char            *namestring;
+  char *namestring;
   union dnttentry *dn_bufp;
-  unsigned         max_symnum;
-  int              at_module_boundary = 0;
-                   /* 1 => at end, -1 => at beginning */ 
+  unsigned max_symnum;
+  int at_module_boundary = 0;
+  /* 1 => at end, -1 => at beginning */
 
   int sym_index = sym_offset / sizeof (struct dntt_type_block);
 
@@ -462,11 +463,12 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
   last_source_file = 0;
 
   /* Demangling style -- if EDG style already set, don't change it,
-     as HP style causes some problems with the KAI EDG compiler */ 
-  if (current_demangling_style != edg_demangling) {
-    /* Otherwise, ensure that we are using HP style demangling */ 
-    set_demangling_style (HP_DEMANGLING_STYLE_STRING);
-  }
+     as HP style causes some problems with the KAI EDG compiler */
+  if (current_demangling_style != edg_demangling)
+    {
+      /* Otherwise, ensure that we are using HP style demangling */
+      set_demangling_style (HP_DEMANGLING_STYLE_STRING);
+    }
 
   dn_bufp = hpread_get_lntt (sym_index, objfile);
   if (!((dn_bufp->dblock.kind == (unsigned char) DNTT_TYPE_SRCFILE) ||
@@ -492,12 +494,12 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
    * in to prepare for backing this out again. -JB
    */
   max_symnum = sym_size / sizeof (struct dntt_type_block);
-           /* No reason to multiply on pst side and divide on sym side... FIXME */
+  /* No reason to multiply on pst side and divide on sym side... FIXME */
 
   /* Read in and process each debug symbol within the specified range.
    */
   for (symnum = 0;
-       symnum < max_symnum;       
+       symnum < max_symnum;
        symnum++)
     {
       QUIT;                    /* Allow this to be interruptable */
@@ -512,9 +514,9 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
       hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
                                       objfile, text_offset, text_size,
                                       filename, symnum + sym_index,
-                                      &at_module_boundary
-                                       );
-                                       
+                                      &at_module_boundary
+       );
+
       /* OLD COMMENTS: This routine is only called for psts.  All psts
        * correspond to MODULES.  If we ever do lazy-reading of globals
        * from the LNTT, then there will be a pst which ends when the
@@ -522,7 +524,7 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
        * to re-visit this break.  
 
        if( at_end_of_module )
-           break;
+       break;
 
        */
 
@@ -535,12 +537,12 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
          the psymtab, so we break out if we enter a new module. */
 
       if (at_module_boundary == -1)
-        break;
+       break;
     }
 
   current_objfile = NULL;
-  hp_som_som_object_present = 1; /* Indicate we've processed an HP SOM SOM file */
-  
+  hp_som_som_object_present = 1;       /* Indicate we've processed an HP SOM SOM file */
+
   return end_symtab (text_offset + text_size, objfile, 0);
 }
 \f
@@ -553,10 +555,11 @@ static int
 hpread_type_translate (typep)
      dnttpointer typep;
 {
-  if (!typep.dntti.immediate) {
-    error ("error in hpread_type_translate\n.");
-    return;
-  }
+  if (!typep.dntti.immediate)
+    {
+      error ("error in hpread_type_translate\n.");
+      return;
+    }
 
   switch (typep.dntti.type)
     {
@@ -564,13 +567,13 @@ hpread_type_translate (typep)
     case HP_TYPE_BOOLEAN_S300_COMPAT:
     case HP_TYPE_BOOLEAN_VAX_COMPAT:
       return FT_BOOLEAN;
-    case HP_TYPE_CHAR:                /* C signed char, C++ plain char */
+    case HP_TYPE_CHAR:         /* C signed char, C++ plain char */
+
     case HP_TYPE_WIDE_CHAR:
       return FT_CHAR;
     case HP_TYPE_INT:
       if (typep.dntti.bitlength <= 8)
-       return FT_SIGNED_CHAR;         /* C++ signed char */
+       return FT_SIGNED_CHAR;  /* C++ signed char */
       if (typep.dntti.bitlength <= 16)
        return FT_SHORT;
       if (typep.dntti.bitlength <= 32)
@@ -578,11 +581,11 @@ hpread_type_translate (typep)
       return FT_LONG_LONG;
     case HP_TYPE_LONG:
       if (typep.dntti.bitlength <= 8)
-       return FT_SIGNED_CHAR;           /* C++ signed char. */ 
+       return FT_SIGNED_CHAR;  /* C++ signed char. */
       return FT_LONG;
     case HP_TYPE_UNSIGNED_LONG:
       if (typep.dntti.bitlength <= 8)
-       return FT_UNSIGNED_CHAR;        /* C/C++ unsigned char */
+       return FT_UNSIGNED_CHAR;        /* C/C++ unsigned char */
       if (typep.dntti.bitlength <= 16)
        return FT_UNSIGNED_SHORT;
       if (typep.dntti.bitlength <= 32)
@@ -626,9 +629,9 @@ hpread_type_translate (typep)
     case HP_TYPE_TEXT:
     case HP_TYPE_FLABEL:
     case HP_TYPE_PACKED_DECIMAL:
-    case HP_TYPE_ANYPOINTER:  
+    case HP_TYPE_ANYPOINTER:
     case HP_TYPE_GLOBAL_ANYPOINTER:
-    case HP_TYPE_LOCAL_ANYPOINTER: 
+    case HP_TYPE_LOCAL_ANYPOINTER:
     default:
       warning ("hpread_type_translate: unhandled type code.\n");
       return FT_VOID;
@@ -685,35 +688,37 @@ hpread_lookup_type (hp_type, objfile)
        {
          old_len = TYPE_VECTOR_LENGTH (objfile);
 
-          /* See if we need to allocate a type-vector. */
+         /* See if we need to allocate a type-vector. */
          if (old_len == 0)
            {
-              TYPE_VECTOR_LENGTH(objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile);
+             TYPE_VECTOR_LENGTH (objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile);
              TYPE_VECTOR (objfile) = (struct type **)
                xmmalloc (objfile->md, TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
              memset (&TYPE_VECTOR (objfile)[old_len], 0,
-                       (TYPE_VECTOR_LENGTH (objfile) - old_len) *
-                       sizeof (struct type *));
+                     (TYPE_VECTOR_LENGTH (objfile) - old_len) *
+                     sizeof (struct type *));
            }
 
-          /* See if we need to resize type-vector. With my change to
-           * initially allocate a correct-size type-vector, this code
-           * should no longer trigger.
-           */
-         while (index >= TYPE_VECTOR_LENGTH (objfile)) {
-           TYPE_VECTOR_LENGTH (objfile) *= 2;
-            size_changed = 1;
-          }
-          if (size_changed) {
-           TYPE_VECTOR (objfile) = (struct type **)
-             xmrealloc (objfile -> md,
-                         (char *) TYPE_VECTOR (objfile),
-                         (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
+         /* See if we need to resize type-vector. With my change to
+          * initially allocate a correct-size type-vector, this code
+          * should no longer trigger.
+          */
+         while (index >= TYPE_VECTOR_LENGTH (objfile))
+           {
+             TYPE_VECTOR_LENGTH (objfile) *= 2;
+             size_changed = 1;
+           }
+         if (size_changed)
+           {
+             TYPE_VECTOR (objfile) = (struct type **)
+               xmrealloc (objfile->md,
+                          (char *) TYPE_VECTOR (objfile),
+                  (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
 
              memset (&TYPE_VECTOR (objfile)[old_len], 0,
-                       (TYPE_VECTOR_LENGTH (objfile) - old_len) *
-                       sizeof (struct type *));
-          } 
+                     (TYPE_VECTOR_LENGTH (objfile) - old_len) *
+                     sizeof (struct type *));
+           }
 
        }
       return &TYPE_VECTOR (objfile)[index];
@@ -734,15 +739,16 @@ hpread_alloc_type (hp_type, objfile)
   struct type **type_addr;
 
   type_addr = hpread_lookup_type (hp_type, objfile);
-  if (*type_addr == 0) {
-    *type_addr = alloc_type (objfile);
+  if (*type_addr == 0)
+    {
+      *type_addr = alloc_type (objfile);
 
-    /* A hack - if we really are a C++ class symbol, then this default
-     * will get overriden later on.
-     */
-    TYPE_CPLUS_SPECIFIC (*type_addr)
-      = (struct cplus_struct_type *) &cplus_struct_default;
-  }
+      /* A hack - if we really are a C++ class symbol, then this default
+       * will get overriden later on.
+       */
+      TYPE_CPLUS_SPECIFIC (*type_addr)
+       = (struct cplus_struct_type *) &cplus_struct_default;
+    }
 
   return *type_addr;
 }
@@ -797,7 +803,7 @@ hpread_read_enum_type (hp_type, dn_bufp, objfile)
       sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = obsavestring (name, strlen (name), 
+      SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
                                        &objfile->symbol_obstack);
       SYMBOL_CLASS (sym) = LOC_CONST;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -866,24 +872,24 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
   type = hpread_alloc_type (hp_type, objfile);
   if (TYPE_CODE (type) == TYPE_CODE_FUNC)
     {
-      record_args = 0; /* already read in, don't modify type */ 
+      record_args = 0;         /* already read in, don't modify type */
     }
   else
     {
       /* Nope, so read it in and store it away.  */
       if (dn_bufp->dblock.kind == DNTT_TYPE_FUNCTION ||
-          dn_bufp->dblock.kind == DNTT_TYPE_MEMFUNC)
-        type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunc.retval,
-                                                          objfile));
+         dn_bufp->dblock.kind == DNTT_TYPE_MEMFUNC)
+       type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunc.retval,
+                                                         objfile));
       else if (dn_bufp->dblock.kind == DNTT_TYPE_FUNCTYPE)
-        type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunctype.retval,
-                                                          objfile));
-      else /* expect DNTT_TYPE_FUNC_TEMPLATE */
-        type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunc_template.retval,
-                                                          objfile));
+       type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunctype.retval,
+                                                         objfile));
+      else                     /* expect DNTT_TYPE_FUNC_TEMPLATE */
+       type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunc_template.retval,
+                                                         objfile));
       memcpy ((char *) type, (char *) type1, sizeof (struct type));
-      
-      /* Mark it -- in the middle of processing */ 
+
+      /* Mark it -- in the middle of processing */
       TYPE_FLAGS (type) |= TYPE_FLAG_INCOMPLETE;
     }
 
@@ -894,7 +900,7 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
     param = dn_bufp->dfunc.firstparam;
   else if (dn_bufp->dblock.kind == DNTT_TYPE_FUNCTYPE)
     param = dn_bufp->dfunctype.firstparam;
-  else /* expect DNTT_TYPE_FUNC_TEMPLATE */
+  else                         /* expect DNTT_TYPE_FUNC_TEMPLATE */
     param = dn_bufp->dfunc_template.firstparam;
   while (param.word && param.word != DNTTNIL)
     {
@@ -920,18 +926,18 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (paramp->dfparam.copyparam)
        {
-         SYMBOL_VALUE (sym) = paramp->dfparam.location ;
+         SYMBOL_VALUE (sym) = paramp->dfparam.location;
 #ifdef HPREAD_ADJUST_STACK_ADDRESS
          SYMBOL_VALUE (sym)
            += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
 #endif
          /* This is likely a pass-by-invisible reference parameter,
             Hack on the symbol class to make GDB happy.  */
-          /* ??rehrauer: This appears to be broken w/r/t to passing
-             C values of type float and struct.  Perhaps this ought
-             to be highighted as a special case, but for now, just
-             allowing these to be LOC_ARGs seems to work fine.
-             */
+         /* ??rehrauer: This appears to be broken w/r/t to passing
+            C values of type float and struct.  Perhaps this ought
+            to be highighted as a special case, but for now, just
+            allowing these to be LOC_ARGs seems to work fine.
+          */
 #if 0
          SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
 #endif
@@ -953,7 +959,7 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
       /* Note 3 (pai/1997-08-11) I removed the add_symbol_to_list() which put
          each fparam on the local_symbols list from here.  Now we use the
          local_list to which fparams are added below, and set the param_symbols
-         global to point to that at the end of this routine. */ 
+         global to point to that at the end of this routine. */
       /* elz: I added this new list of symbols which is local to the function.
          this list is the one which is actually used to build the type for the
          function rather than the gloabal list pointed to by symlist.
@@ -962,16 +968,16 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
          a function itself with more parameters in it. Adding parameters to the
          same global symbol list would not work!      
          Actually it did work in case of cc compiled programs where you do 
-         not check the parameter lists of the arguments. */ 
+         not check the parameter lists of the arguments. */
       add_symbol_to_list (sym, &local_list);
 
     }
 
   /* If type was read in earlier, don't bother with modifying
-     the type struct */ 
+     the type struct */
   if (!record_args)
     goto finish;
-  
+
   /* Note how many parameters we found.  */
   TYPE_NFIELDS (type) = nsyms;
   TYPE_FIELDS (type) = (struct field *)
@@ -984,14 +990,14 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
   /* Note that we preserve the order of the parameters, so
      that in something like "enum {FOO, LAST_THING=FOO}" we print
      FOO, not LAST_THING.  */
-  
+
   /* get the parameters types from the local list not the global list
      so that the type can be correctly constructed for functions which
      have function as parameters */
   for (syms = local_list, n = 0; syms; syms = syms->next)
     {
       int j = 0;
-      for (j=0; j < syms->nsyms; j++, n++)
+      for (j = 0; j < syms->nsyms; j++, n++)
        {
          struct symbol *xsym = syms->symbol[j];
          TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
@@ -1000,7 +1006,7 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
          TYPE_FIELD_BITSIZE (type, n) = 0;
        }
     }
-  /* Mark it as having been processed */ 
+  /* Mark it as having been processed */
   TYPE_FLAGS (type) &= ~(TYPE_FLAG_INCOMPLETE);
 
   /* Check whether we need to fix-up a class type with this function's type */
@@ -1016,11 +1022,11 @@ hpread_read_function_type (hp_type, dn_bufp, objfile, newblock)
      called for creating a new block, and not if it was called
      simply to get the function type. This prevents recursive
      invocations from trashing param_symbols. */
-finish:  
+finish:
   if (newblock)
     param_symbols = local_list;
-  
-   return type;
+
+  return type;
 }
 
 
@@ -1052,18 +1058,18 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
   type = hpread_alloc_type (hp_type, objfile);
   if (TYPE_CODE (type) == TYPE_CODE_FUNC)
     {
-      record_args = 0; /* already read in, don't modify type */ 
+      record_args = 0;         /* already read in, don't modify type */
     }
   else
     {
       /* Nope, so read it in and store it away.  */
       if (dn_bufp->dblock.kind == DNTT_TYPE_DOC_FUNCTION ||
-          dn_bufp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC)
-        type1 = lookup_function_type (hpread_type_lookup (dn_bufp->ddocfunc.retval,
-                                                          objfile));
+         dn_bufp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC)
+       type1 = lookup_function_type (hpread_type_lookup (dn_bufp->ddocfunc.retval,
+                                                         objfile));
       memcpy ((char *) type, (char *) type1, sizeof (struct type));
-      
-      /* Mark it -- in the middle of processing */ 
+
+      /* Mark it -- in the middle of processing */
       TYPE_FLAGS (type) |= TYPE_FLAG_INCOMPLETE;
     }
 
@@ -1095,18 +1101,18 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (paramp->dfparam.copyparam)
        {
-         SYMBOL_VALUE (sym) = paramp->dfparam.location ;
+         SYMBOL_VALUE (sym) = paramp->dfparam.location;
 #ifdef HPREAD_ADJUST_STACK_ADDRESS
          SYMBOL_VALUE (sym)
            += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
 #endif
          /* This is likely a pass-by-invisible reference parameter,
             Hack on the symbol class to make GDB happy.  */
-          /* ??rehrauer: This appears to be broken w/r/t to passing
-             C values of type float and struct.  Perhaps this ought
-             to be highighted as a special case, but for now, just
-             allowing these to be LOC_ARGs seems to work fine.
-             */
+         /* ??rehrauer: This appears to be broken w/r/t to passing
+            C values of type float and struct.  Perhaps this ought
+            to be highighted as a special case, but for now, just
+            allowing these to be LOC_ARGs seems to work fine.
+          */
 #if 0
          SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
 #endif
@@ -1128,8 +1134,8 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
       /* Note 3 (pai/1997-08-11) I removed the add_symbol_to_list() which put
          each fparam on the local_symbols list from here.  Now we use the
          local_list to which fparams are added below, and set the param_symbols
-         global to point to that at the end of this routine. */ 
-         
+         global to point to that at the end of this routine. */
+
       /* elz: I added this new list of symbols which is local to the function.
          this list is the one which is actually used to build the type for the
          function rather than the gloabal list pointed to by symlist.
@@ -1143,15 +1149,15 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
     }
 
   /* If type was read in earlier, don't bother with modifying
-     the type struct */ 
+     the type struct */
   if (!record_args)
     goto finish;
-  
+
   /* Note how many parameters we found.  */
   TYPE_NFIELDS (type) = nsyms;
   TYPE_FIELDS (type) = (struct field *)
     obstack_alloc (&objfile->type_obstack,
-                   sizeof (struct field) * nsyms);
+                  sizeof (struct field) * nsyms);
 
   /* Find the symbols for the parameters and 
      use them to fill parameter-type information into the function-type.
@@ -1159,25 +1165,25 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
   /* Note that we preserve the order of the parameters, so
      that in something like "enum {FOO, LAST_THING=FOO}" we print
      FOO, not LAST_THING.  */
-  
+
   /* get the parameters types from the local list not the global list
      so that the type can be correctly constructed for functions which
      have function as parameters
-  */
+   */
   for (syms = local_list, n = 0; syms; syms = syms->next)
     {
       int j = 0;
       for (j = 0; j < syms->nsyms; j++, n++)
-        {
-          struct symbol *xsym = syms->symbol[j];
-          TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
-          TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
-          TYPE_FIELD_BITPOS (type, n) = n;
-          TYPE_FIELD_BITSIZE (type, n) = 0;
-        }
+       {
+         struct symbol *xsym = syms->symbol[j];
+         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
+         TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
+         TYPE_FIELD_BITPOS (type, n) = n;
+         TYPE_FIELD_BITSIZE (type, n) = 0;
+       }
     }
-  
-  /* Mark it as having been processed */ 
+
+  /* Mark it as having been processed */
   TYPE_FLAGS (type) &= ~(TYPE_FLAG_INCOMPLETE);
 
   /* Check whether we need to fix-up a class type with this function's type */
@@ -1193,10 +1199,10 @@ hpread_read_doc_function_type (hp_type, dn_bufp, objfile, newblock)
      called for creating a new block, and not if it was called
      simply to get the function type. This prevents recursive
      invocations from trashing param_symbols. */
-finish:  
+finish:
   if (newblock)
     param_symbols = local_list;
-  
+
   return type;
 }
 
@@ -1215,7 +1221,7 @@ finish:
  * 
  * There may be problems handling nested templates... tough.
  */
-static struct type * current_template = NULL;
+static struct type *current_template = NULL;
 
 /* Read in and internalize a structure definition.  
  * This same routine is called for struct, union, and class types.
@@ -1234,10 +1240,10 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
     {
       struct nextfield *next;
       struct field field;
-      unsigned char attributes; /* store visibility and virtuality info */
-#     define ATTR_VIRTUAL 1      
-#     define ATTR_PRIVATE 2      
-#     define ATTR_PROTECT 3      
+      unsigned char attributes;        /* store visibility and virtuality info */
+#define ATTR_VIRTUAL 1
+#define ATTR_PRIVATE 2
+#define ATTR_PROTECT 3
     };
 
 
@@ -1248,7 +1254,7 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
       struct fn_fieldlist field;
       struct fn_field fn_field;
       int num_fn_fields;
-     };
+    };
 
   /* The template args get linked together into a list of struct next_template's */
   struct next_template
@@ -1258,10 +1264,10 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
     };
 
   /* The template instantiations get linked together into a list of these... */
-  struct next_instantiation 
+  struct next_instantiation
     {
-      struct next_instantiation * next;
-      struct type * t;
+      struct next_instantiation *next;
+      struct type *t;
     };
 
   struct type *type;
@@ -1285,9 +1291,9 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
   int volatile_member = 0;
   unsigned long vtbl_offset;
   int need_bitvectors = 0;
-  char * method_name = NULL;
-  char * method_alias = NULL;
-  
+  char *method_name = NULL;
+  char *method_alias = NULL;
+
 
   /* Is it something we've already dealt with?  */
   type = hpread_alloc_type (hp_type, objfile);
@@ -1295,7 +1301,7 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
       (TYPE_CODE (type) == TYPE_CODE_UNION) ||
       (TYPE_CODE (type) == TYPE_CODE_CLASS) ||
       (TYPE_CODE (type) == TYPE_CODE_TEMPLATE))
-      return type;
+    return type;
 
   /* Get the basic type correct.  */
   if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT)
@@ -1310,13 +1316,13 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
     }
   else if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS)
     {
-      TYPE_CODE (type) = TYPE_CODE_CLASS; 
+      TYPE_CODE (type) = TYPE_CODE_CLASS;
       TYPE_LENGTH (type) = dn_bufp->dclass.bitlength / 8;
 
       /* Overrides the TYPE_CPLUS_SPECIFIC(type) with allocated memory
        * rather than &cplus_struct_default.
        */
-      allocate_cplus_struct_type(type);
+      allocate_cplus_struct_type (type);
 
       /* Fill in declared-type.
        * (The C++ compiler will emit TYPE_CODE_CLASS 
@@ -1325,14 +1331,14 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
        * want to know how it was really declared)
        */
       /* (0==class, 1==union, 2==struct) */
-      TYPE_DECLARED_TYPE(type) = dn_bufp->dclass.class_decl;
+      TYPE_DECLARED_TYPE (type) = dn_bufp->dclass.class_decl;
     }
   else if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
     {
       /* Get the basic type correct.  */
-      TYPE_CODE (type) = TYPE_CODE_TEMPLATE; 
-      allocate_cplus_struct_type(type);
-      TYPE_DECLARED_TYPE(type) = DECLARED_TYPE_TEMPLATE;
+      TYPE_CODE (type) = TYPE_CODE_TEMPLATE;
+      allocate_cplus_struct_type (type);
+      TYPE_DECLARED_TYPE (type) = DECLARED_TYPE_TEMPLATE;
     }
   else
     return type;
@@ -1343,60 +1349,62 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
   /* For classes, read the parent list.
    * Question (RT): Do we need to do this for templates also?
    */
-  if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS) {
+  if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS)
+    {
 
-    /* First read the parent-list (classes from which we derive fields) */
-    parent = dn_bufp->dclass.parentlist;
-    while (parent.word && parent.word != DNTTNIL) {
-      parentp = hpread_get_lntt (parent.dnttp.index, objfile);
+      /* First read the parent-list (classes from which we derive fields) */
+      parent = dn_bufp->dclass.parentlist;
+      while (parent.word && parent.word != DNTTNIL)
+       {
+         parentp = hpread_get_lntt (parent.dnttp.index, objfile);
 
-      /* "parentp" should point to a DNTT_TYPE_INHERITANCE record */
+         /* "parentp" should point to a DNTT_TYPE_INHERITANCE record */
 
-      /* Get space to record the next field/data-member. */
-      new = (struct nextfield *) alloca (sizeof (struct nextfield));
-      new->next = list;
-      list = new;
+         /* Get space to record the next field/data-member. */
+         new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         new->next = list;
+         list = new;
 
-      FIELD_BITSIZE (list->field) = 0;
+         FIELD_BITSIZE (list->field) = 0;
 
-      /* The "classname" field is actually a DNTT pointer to the base class */
-      baseclass = hpread_type_lookup (parentp->dinheritance.classname, 
-                                            objfile);
-      FIELD_TYPE (list->field) = baseclass;
+         /* The "classname" field is actually a DNTT pointer to the base class */
+         baseclass = hpread_type_lookup (parentp->dinheritance.classname,
+                                         objfile);
+         FIELD_TYPE (list->field) = baseclass;
 
-      list->field.name = type_name_no_tag(FIELD_TYPE (list->field));
+         list->field.name = type_name_no_tag (FIELD_TYPE (list->field));
 
-      list->attributes = 0;
+         list->attributes = 0;
 
-      /* Check for virtuality of base, and set the
-       * offset of the base subobject within the object.
-       * (Offset set to -1 for virtual bases (for now).)
-       */
-      if (parentp->dinheritance.Virtual)
-        {
-         B_SET(&(list->attributes), ATTR_VIRTUAL);
-          parentp->dinheritance.offset = -1;
-        }
-      else
-        FIELD_BITPOS (list->field) = parentp->dinheritance.offset;
-
-      /* Check visibility */
-      switch (parentp->dinheritance.visibility)
-        {
-          case 1:
-            B_SET(&(list->attributes), ATTR_PROTECT);
-            break;
-          case 2:
-            B_SET(&(list->attributes), ATTR_PRIVATE);
-            break;
-        }
-      
-      n_base_classes++;
-      nfields++;
-
-      parent = parentp->dinheritance.next;
+         /* Check for virtuality of base, and set the
+          * offset of the base subobject within the object.
+          * (Offset set to -1 for virtual bases (for now).)
+          */
+         if (parentp->dinheritance.Virtual)
+           {
+             B_SET (&(list->attributes), ATTR_VIRTUAL);
+             parentp->dinheritance.offset = -1;
+           }
+         else
+           FIELD_BITPOS (list->field) = parentp->dinheritance.offset;
+
+         /* Check visibility */
+         switch (parentp->dinheritance.visibility)
+           {
+           case 1:
+             B_SET (&(list->attributes), ATTR_PROTECT);
+             break;
+           case 2:
+             B_SET (&(list->attributes), ATTR_PRIVATE);
+             break;
+           }
+
+         n_base_classes++;
+         nfields++;
+
+         parent = parentp->dinheritance.next;
+       }
     }
-  }
 
   /* For templates, read the template argument list.
    * This must be done before processing the member list, because
@@ -1408,46 +1416,48 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
    *   };
    * We need to read the argument list "T1", "T2" first.
    */
-  if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE) {
-    /* Kludge alert: This stuffs a global "current_template" which
-     * is referred to by hpread_get_nth_templ_arg(). The global
-     * is cleared at the end of this routine.
-     */
-    current_template = type;
+  if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
+    {
+      /* Kludge alert: This stuffs a global "current_template" which
+       * is referred to by hpread_get_nth_templ_arg(). The global
+       * is cleared at the end of this routine.
+       */
+      current_template = type;
 
-    /* Read in the argument list */
-    field = dn_bufp->dtemplate.arglist;
-    while (field.word && field.word != DNTTNIL) {
-      /* Get this template argument*/
-      fieldp = hpread_get_lntt (field.dnttp.index, objfile);
-      if (fieldp->dblock.kind != DNTT_TYPE_TEMPLATE_ARG)
-        {
-          warning ("Invalid debug info: Template argument entry is of wrong kind");
-          break;
-        }
-      /* Bump the count */ 
-      n_templ_args++;
-      /* Allocate and fill in a struct next_template */
-      t_new = (struct next_template *) alloca (sizeof (struct next_template));
-      t_new->next = t_list;
-      t_list = t_new;
-      t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name;
-      t_list->arg.type = hpread_read_templ_arg_type(field, fieldp, 
-                                                    objfile, t_list->arg.name);
-      /* Walk to the next template argument */
-      field = fieldp->dtempl_arg.nextarg;
+      /* Read in the argument list */
+      field = dn_bufp->dtemplate.arglist;
+      while (field.word && field.word != DNTTNIL)
+       {
+         /* Get this template argument */
+         fieldp = hpread_get_lntt (field.dnttp.index, objfile);
+         if (fieldp->dblock.kind != DNTT_TYPE_TEMPLATE_ARG)
+           {
+             warning ("Invalid debug info: Template argument entry is of wrong kind");
+             break;
+           }
+         /* Bump the count */
+         n_templ_args++;
+         /* Allocate and fill in a struct next_template */
+         t_new = (struct next_template *) alloca (sizeof (struct next_template));
+         t_new->next = t_list;
+         t_list = t_new;
+         t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name;
+         t_list->arg.type = hpread_read_templ_arg_type (field, fieldp,
+                                                objfile, t_list->arg.name);
+         /* Walk to the next template argument */
+         field = fieldp->dtempl_arg.nextarg;
+       }
     }
-  }
 
-  TYPE_NTEMPLATE_ARGS(type) = n_templ_args;
+  TYPE_NTEMPLATE_ARGS (type) = n_templ_args;
 
   if (n_templ_args > 0)
-    TYPE_TEMPLATE_ARGS(type) = (struct template_arg *)
+    TYPE_TEMPLATE_ARGS (type) = (struct template_arg *)
       obstack_alloc (&objfile->type_obstack, sizeof (struct template_arg) * n_templ_args);
   for (n = n_templ_args; t_list; t_list = t_list->next)
     {
       n -= 1;
-      TYPE_TEMPLATE_ARG(type, n) = t_list->arg;
+      TYPE_TEMPLATE_ARG (type, n) = t_list->arg;
     }
 
   /* Next read in and internalize all the fields/members.  */
@@ -1473,453 +1483,471 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
       static_member = 0;
       const_member = 0;
       volatile_member = 0;
-       
-      if (fieldp->dblock.kind == DNTT_TYPE_GENFIELD) {
-
-        /* The type will be GENFIELD if the field is a method or
-         * a static member (or some other cases -- see below)
-         */
-
-        /* Follow a link to get to the record for the field. */
-        fn_field = fieldp->dgenfield.field;
-        fn_fieldp = hpread_get_lntt(fn_field.dnttp.index, objfile);
-
-        /* Virtual funcs are indicated by a VFUNC which points to the
-         * real entry
-         */
-        if (fn_fieldp->dblock.kind == DNTT_TYPE_VFUNC) {
-          vtbl_offset = fn_fieldp->dvfunc.vtbl_offset;
-          fn_field = fn_fieldp->dvfunc.funcptr;
-          fn_fieldp = hpread_get_lntt(fn_field.dnttp.index, objfile);
-        }
-
-        /* A function's entry may be preceded by a modifier which
-         * labels it static/constant/volatile.
-         */
-        if (fn_fieldp->dblock.kind == DNTT_TYPE_MODIFIER) {
-          static_member = fn_fieldp->dmodifier.m_static;
-          const_member = fn_fieldp->dmodifier.m_const;
-          volatile_member = fn_fieldp->dmodifier.m_volatile;
-          fn_field = fn_fieldp->dmodifier.type;
-          fn_fieldp = hpread_get_lntt(fn_field.dnttp.index, objfile);
-        }
-
-        /* Check whether we have a method */
-        if ((fn_fieldp->dblock.kind == DNTT_TYPE_MEMFUNC) ||
-            (fn_fieldp->dblock.kind == DNTT_TYPE_FUNCTION) ||
-            (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC) ||
-            (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_FUNCTION)) {
-          /* Method found */
-
-          short ix = 0;
-
-          /* Look up function type of method */
-         memtype = hpread_type_lookup (fn_field, objfile);
-
-          /* Methods can be seen before classes in the SOM records.
-             If we are processing this class because it's a parameter of a
-             method, at this point the method's type is actually incomplete;
-             we'll have to fix it up later; mark the class for this. */ 
-             
-          if (TYPE_INCOMPLETE (memtype))
-            {
-              TYPE_FLAGS (type) |= TYPE_FLAG_INCOMPLETE;
-              if (fixup_class)
-                warning ("Two classes to fix up for method??  Type information may be incorrect for some classes.");
-              if (fixup_method)
-                warning ("Two methods to be fixed up at once?? Type information may be incorrect for some classes.");
-              fixup_class = type;     /* remember this class has to be fixed up */
-              fixup_method = memtype; /* remember the method type to be used in fixup */ 
-            }
-
-          /* HP aCC generates operator names without the "operator" keyword, and
-             generates null strings as names for operators that are 
-             user-defined type conversions to basic types (e.g. operator int ()).
-             So try to reconstruct name as best as possible. */
-
-          method_name = (char *) (VT (objfile) + fn_fieldp->dfunc.name);
-          method_alias = (char *) (VT (objfile) + fn_fieldp->dfunc.alias);
-
-          if (!method_name ||                               /* no name */ 
-              !*method_name ||                              /* or null name */ 
-              cplus_mangle_opname (method_name, DMGL_ANSI)) /* or name is an operator like "<" */ 
-            {
-              char * tmp_name = cplus_demangle (method_alias, DMGL_ANSI);
-              char * op_string = strstr (tmp_name, "operator");
-              method_name = xmalloc (strlen (op_string) + 1); /* don't overwrite VT! */ 
-              strcpy (method_name, op_string);
-            }
-                        
-          /* First check if a method of the same name has already been seen. */
-          fn_p = fn_list;
-          while (fn_p)
-            {
-              if (STREQ (fn_p->field.name, method_name))
-                break;
-              fn_p = fn_p->next;
-            }
-
-          /* If no such method was found, allocate a new entry in the list */ 
-          if (!fn_p)
-            {
-              /* Get space to record this member function */
-              /* Note: alloca used; this will disappear on routine exit */
-              fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field));
-              fn_new->next = fn_list;
-              fn_list = fn_new;
-
-              /* Fill in the fields of the struct nextfield */
-          
-              /* Record the (unmangled) method name */
-              fn_list->field.name = method_name;
-              /* Initial space for overloaded methods */
-              /* Note: xmalloc is used; this will persist after this routine exits */ 
-              fn_list->field.fn_fields = (struct fn_field *) xmalloc (5 * (sizeof (struct fn_field)));
-              fn_list->field.length = 1; /* Init # of overloaded instances */ 
-              fn_list->num_fn_fields = 5; /* # of entries for which space allocated */
-              fn_p = fn_list;
-              ix = 0; /* array index for fn_field */ 
-              /* Bump the total count of the distinctly named methods */
-              n_fn_fields++;
-            }
-          else /* Another overloaded instance of an already seen method name */
-            {
-              if (++(fn_p->field.length) > fn_p->num_fn_fields)
-                {
-                  /* Increase space allocated for overloaded instances */ 
-                  fn_p->field.fn_fields
-                    = (struct fn_field *) xrealloc (fn_p->field.fn_fields,
-                                                     (fn_p->num_fn_fields + 5) * sizeof (struct fn_field));
-                  fn_p->num_fn_fields += 5;
-                }
-              ix = fn_p->field.length -1;  /* array index for fn_field */
-            }
-          
-          /* "physname" is intended to be the name of this overloaded instance. */
-          if ((fn_fieldp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) && 
-             method_alias && 
-              *method_alias) /* not a null string */
-            fn_p->field.fn_fields[ix].physname = method_alias;
+
+      if (fieldp->dblock.kind == DNTT_TYPE_GENFIELD)
+       {
+
+         /* The type will be GENFIELD if the field is a method or
+          * a static member (or some other cases -- see below)
+          */
+
+         /* Follow a link to get to the record for the field. */
+         fn_field = fieldp->dgenfield.field;
+         fn_fieldp = hpread_get_lntt (fn_field.dnttp.index, objfile);
+
+         /* Virtual funcs are indicated by a VFUNC which points to the
+          * real entry
+          */
+         if (fn_fieldp->dblock.kind == DNTT_TYPE_VFUNC)
+           {
+             vtbl_offset = fn_fieldp->dvfunc.vtbl_offset;
+             fn_field = fn_fieldp->dvfunc.funcptr;
+             fn_fieldp = hpread_get_lntt (fn_field.dnttp.index, objfile);
+           }
+
+         /* A function's entry may be preceded by a modifier which
+          * labels it static/constant/volatile.
+          */
+         if (fn_fieldp->dblock.kind == DNTT_TYPE_MODIFIER)
+           {
+             static_member = fn_fieldp->dmodifier.m_static;
+             const_member = fn_fieldp->dmodifier.m_const;
+             volatile_member = fn_fieldp->dmodifier.m_volatile;
+             fn_field = fn_fieldp->dmodifier.type;
+             fn_fieldp = hpread_get_lntt (fn_field.dnttp.index, objfile);
+           }
+
+         /* Check whether we have a method */
+         if ((fn_fieldp->dblock.kind == DNTT_TYPE_MEMFUNC) ||
+             (fn_fieldp->dblock.kind == DNTT_TYPE_FUNCTION) ||
+             (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC) ||
+             (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_FUNCTION))
+           {
+             /* Method found */
+
+             short ix = 0;
+
+             /* Look up function type of method */
+             memtype = hpread_type_lookup (fn_field, objfile);
+
+             /* Methods can be seen before classes in the SOM records.
+                If we are processing this class because it's a parameter of a
+                method, at this point the method's type is actually incomplete;
+                we'll have to fix it up later; mark the class for this. */
+
+             if (TYPE_INCOMPLETE (memtype))
+               {
+                 TYPE_FLAGS (type) |= TYPE_FLAG_INCOMPLETE;
+                 if (fixup_class)
+                   warning ("Two classes to fix up for method??  Type information may be incorrect for some classes.");
+                 if (fixup_method)
+                   warning ("Two methods to be fixed up at once?? Type information may be incorrect for some classes.");
+                 fixup_class = type;   /* remember this class has to be fixed up */
+                 fixup_method = memtype;       /* remember the method type to be used in fixup */
+               }
+
+             /* HP aCC generates operator names without the "operator" keyword, and
+                generates null strings as names for operators that are 
+                user-defined type conversions to basic types (e.g. operator int ()).
+                So try to reconstruct name as best as possible. */
+
+             method_name = (char *) (VT (objfile) + fn_fieldp->dfunc.name);
+             method_alias = (char *) (VT (objfile) + fn_fieldp->dfunc.alias);
+
+             if (!method_name ||       /* no name */
+                 !*method_name ||      /* or null name */
+                 cplus_mangle_opname (method_name, DMGL_ANSI))         /* or name is an operator like "<" */
+               {
+                 char *tmp_name = cplus_demangle (method_alias, DMGL_ANSI);
+                 char *op_string = strstr (tmp_name, "operator");
+                 method_name = xmalloc (strlen (op_string) + 1);       /* don't overwrite VT! */
+                 strcpy (method_name, op_string);
+               }
+
+             /* First check if a method of the same name has already been seen. */
+             fn_p = fn_list;
+             while (fn_p)
+               {
+                 if (STREQ (fn_p->field.name, method_name))
+                   break;
+                 fn_p = fn_p->next;
+               }
+
+             /* If no such method was found, allocate a new entry in the list */
+             if (!fn_p)
+               {
+                 /* Get space to record this member function */
+                 /* Note: alloca used; this will disappear on routine exit */
+                 fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field));
+                 fn_new->next = fn_list;
+                 fn_list = fn_new;
+
+                 /* Fill in the fields of the struct nextfield */
+
+                 /* Record the (unmangled) method name */
+                 fn_list->field.name = method_name;
+                 /* Initial space for overloaded methods */
+                 /* Note: xmalloc is used; this will persist after this routine exits */
+                 fn_list->field.fn_fields = (struct fn_field *) xmalloc (5 * (sizeof (struct fn_field)));
+                 fn_list->field.length = 1;    /* Init # of overloaded instances */
+                 fn_list->num_fn_fields = 5;   /* # of entries for which space allocated */
+                 fn_p = fn_list;
+                 ix = 0;       /* array index for fn_field */
+                 /* Bump the total count of the distinctly named methods */
+                 n_fn_fields++;
+               }
+             else
+               /* Another overloaded instance of an already seen method name */
+               {
+                 if (++(fn_p->field.length) > fn_p->num_fn_fields)
+                   {
+                     /* Increase space allocated for overloaded instances */
+                     fn_p->field.fn_fields
+                       = (struct fn_field *) xrealloc (fn_p->field.fn_fields,
+                     (fn_p->num_fn_fields + 5) * sizeof (struct fn_field));
+                     fn_p->num_fn_fields += 5;
+                   }
+                 ix = fn_p->field.length - 1;  /* array index for fn_field */
+               }
+
+             /* "physname" is intended to be the name of this overloaded instance. */
+             if ((fn_fieldp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
+                 method_alias &&
+                 *method_alias)        /* not a null string */
+               fn_p->field.fn_fields[ix].physname = method_alias;
+             else
+               fn_p->field.fn_fields[ix].physname = method_name;
+             /* What's expected here is the function type */
+             /* 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].args = NULL;
+               }
+             else
+               {
+                 fn_p->field.fn_fields[ix].type = memtype;
+
+                 /* The argument list */
+                 fn_p->field.fn_fields[ix].type->type_specific.arg_types =
+                   (struct type **) obstack_alloc (&objfile->type_obstack,
+                          sizeof (struct type *) * (memtype->nfields + 1));
+                 for (i = 0; i < memtype->nfields; i++)
+                   fn_p->field.fn_fields[ix].type->type_specific.arg_types[i] = memtype->fields[i].type;
+                 /* void termination */
+                 fn_p->field.fn_fields[ix].type->type_specific.arg_types[memtype->nfields] = builtin_type_void;
+
+                 /* pai: It's not clear why this args field has to be set.  Perhaps
+                  * it should be eliminated entirely. */
+                 fn_p->field.fn_fields[ix].args =
+                   (struct type **) obstack_alloc (&objfile->type_obstack,
+                          sizeof (struct type *) * (memtype->nfields + 1));
+                 for (i = 0; i < memtype->nfields; i++)
+                   fn_p->field.fn_fields[ix].args[i] = memtype->fields[i].type;
+                 /* null-terminated, unlike arg_types above e */
+                 fn_p->field.fn_fields[ix].args[memtype->nfields] = NULL;
+               }
+             /* For virtual functions, fill in the voffset field with the
+              * virtual table offset. (This is just copied over from the
+              * SOM record; not sure if it is what GDB expects here...).
+              * But if the function is a static method, set it to 1.
+              * 
+              * Note that we have to add 1 because 1 indicates a static
+              * method, and 0 indicates a non-static, non-virtual method */
+
+             if (static_member)
+               fn_p->field.fn_fields[ix].voffset = VOFFSET_STATIC;
+             else
+               fn_p->field.fn_fields[ix].voffset = vtbl_offset ? vtbl_offset + 1 : 0;
+
+             /* Also fill in the fcontext field with the current
+              * class. (The latter isn't quite right: should be the baseclass
+              * that defines the virtual function... Note we do have
+              * a variable "baseclass" that we could stuff into the fcontext
+              * field, but "baseclass" isn't necessarily right either,
+              * since the virtual function could have been defined more
+              * than one level up).
+              */
+
+             if (vtbl_offset != 0)
+               fn_p->field.fn_fields[ix].fcontext = type;
+             else
+               fn_p->field.fn_fields[ix].fcontext = NULL;
+
+             /* Other random fields pertaining to this method */
+             fn_p->field.fn_fields[ix].is_const = const_member;
+             fn_p->field.fn_fields[ix].is_volatile = volatile_member;  /* ?? */
+             switch (fieldp->dgenfield.visibility)
+               {
+               case 1:
+                 fn_p->field.fn_fields[ix].is_protected = 1;
+                 fn_p->field.fn_fields[ix].is_private = 0;
+                 break;
+               case 2:
+                 fn_p->field.fn_fields[ix].is_protected = 0;
+                 fn_p->field.fn_fields[ix].is_private = 1;
+                 break;
+               default:        /* public */
+                 fn_p->field.fn_fields[ix].is_protected = 0;
+                 fn_p->field.fn_fields[ix].is_private = 0;
+               }
+             fn_p->field.fn_fields[ix].is_stub = 0;
+
+             /* HP aCC emits both MEMFUNC and FUNCTION entries for a method;
+                if the class points to the FUNCTION, there is usually separate
+                code for the method; but if we have a MEMFUNC, the method has
+                been inlined (and there is usually no FUNCTION entry)
+                FIXME Not sure if this test is accurate. pai/1997-08-22 */
+             if ((fn_fieldp->dblock.kind == DNTT_TYPE_MEMFUNC) ||
+                 (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC))
+               fn_p->field.fn_fields[ix].is_inlined = 1;
+             else
+               fn_p->field.fn_fields[ix].is_inlined = 0;
+
+             fn_p->field.fn_fields[ix].dummy = 0;
+
+             /* Bump the total count of the member functions */
+             n_fn_fields_total++;
+
+           }
+         else if (fn_fieldp->dblock.kind == DNTT_TYPE_SVAR)
+           {
+             /* This case is for static data members of classes */
+
+             /* pai:: FIXME -- check that "staticmem" bit is set */
+
+             /* Get space to record this static member */
+             new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             new->next = list;
+             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);
+
+             FIELD_TYPE (list->field) = memtype;
+             list->attributes = 0;
+             switch (fieldp->dgenfield.visibility)
+               {
+               case 1:
+                 B_SET (&(list->attributes), ATTR_PROTECT);
+                 break;
+               case 2:
+                 B_SET (&(list->attributes), ATTR_PRIVATE);
+                 break;
+               }
+             nfields++;
+           }
+
+         else if (fn_fieldp->dblock.kind == DNTT_TYPE_FIELD)
+           {
+             /* FIELDs follow GENFIELDs for fields of anonymous unions.
+                Code below is replicated from the case for FIELDs further
+                below, except that fieldp is replaced by fn_fieldp */
+             if (!fn_fieldp->dfield.a_union)
+               warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set");
+             /* Get space to record the next field/data-member. */
+             new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             new->next = list;
+             list = new;
+
+             list->field.name = VT (objfile) + fn_fieldp->dfield.name;
+             FIELD_BITPOS (list->field) = fn_fieldp->dfield.bitoffset;
+             if (fn_fieldp->dfield.bitlength % 8)
+               list->field.bitsize = fn_fieldp->dfield.bitlength;
+             else
+               list->field.bitsize = 0;
+
+             memtype = hpread_type_lookup (fn_fieldp->dfield.type, objfile);
+             list->field.type = memtype;
+             list->attributes = 0;
+             switch (fn_fieldp->dfield.visibility)
+               {
+               case 1:
+                 B_SET (&(list->attributes), ATTR_PROTECT);
+                 break;
+               case 2:
+                 B_SET (&(list->attributes), ATTR_PRIVATE);
+                 break;
+               }
+             nfields++;
+           }
+         else if (fn_fieldp->dblock.kind == DNTT_TYPE_SVAR)
+           {
+             /* Field of anonymous union; union is not inside a class */
+             if (!fn_fieldp->dsvar.a_union)
+               warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set");
+             /* Get space to record the next field/data-member. */
+             new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             new->next = list;
+             list = new;
+
+             list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
+             FIELD_BITPOS (list->field) = 0;   /* FIXME is this always true? */
+             FIELD_BITSIZE (list->field) = 0;  /* use length from type */
+             memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
+             list->field.type = memtype;
+             list->attributes = 0;
+             /* No info to set visibility -- always public */
+             nfields++;
+           }
+         else if (fn_fieldp->dblock.kind == DNTT_TYPE_DVAR)
+           {
+             /* Field of anonymous union; union is not inside a class */
+             if (!fn_fieldp->ddvar.a_union)
+               warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set");
+             /* Get space to record the next field/data-member. */
+             new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             new->next = list;
+             list = new;
+
+             list->field.name = VT (objfile) + fn_fieldp->ddvar.name;
+             FIELD_BITPOS (list->field) = 0;   /* FIXME is this always true? */
+             FIELD_BITSIZE (list->field) = 0;  /* use length from type */
+             memtype = hpread_type_lookup (fn_fieldp->ddvar.type, objfile);
+             list->field.type = memtype;
+             list->attributes = 0;
+             /* No info to set visibility -- always public */
+             nfields++;
+           }
          else
-            fn_p->field.fn_fields[ix].physname = method_name;
-          /* What's expected here is the function type */
-   /* 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].args = NULL;
-            }
-          else
-            {
-              fn_p->field.fn_fields[ix].type = memtype;
-
-              /* The argument list */
-              fn_p->field.fn_fields[ix].type->type_specific.arg_types =
-                (struct type **) obstack_alloc(&objfile->type_obstack,
-                                               sizeof(struct type *) * (memtype->nfields + 1));
-              for (i = 0; i < memtype->nfields; i++) 
-                fn_p->field.fn_fields[ix].type->type_specific.arg_types[i] = memtype->fields[i].type;
-              /* void termination */ 
-              fn_p->field.fn_fields[ix].type->type_specific.arg_types[memtype->nfields] = builtin_type_void;
-
-              /* pai: It's not clear why this args field has to be set.  Perhaps
-               * it should be eliminated entirely. */
-              fn_p->field.fn_fields[ix].args =
-                (struct type **) obstack_alloc(&objfile->type_obstack,
-                                               sizeof(struct type *) * (memtype->nfields + 1));
-              for (i = 0; i < memtype->nfields; i++)
-                fn_p->field.fn_fields[ix].args[i] = memtype->fields[i].type;
-              /* null-terminated, unlike arg_types above e*/ 
-              fn_p->field.fn_fields[ix].args[memtype->nfields] = NULL;
-            }
-          /* For virtual functions, fill in the voffset field with the
-           * virtual table offset. (This is just copied over from the
-           * SOM record; not sure if it is what GDB expects here...).
-           * But if the function is a static method, set it to 1.
-           * 
-           * Note that we have to add 1 because 1 indicates a static
-           * method, and 0 indicates a non-static, non-virtual method */
-
-          if (static_member)
-            fn_p->field.fn_fields[ix].voffset = VOFFSET_STATIC;
-          else
-            fn_p->field.fn_fields[ix].voffset = vtbl_offset ? vtbl_offset + 1 : 0;
-
-          /* Also fill in the fcontext field with the current
-           * class. (The latter isn't quite right: should be the baseclass
-           * that defines the virtual function... Note we do have
-           * a variable "baseclass" that we could stuff into the fcontext
-           * field, but "baseclass" isn't necessarily right either,
-           * since the virtual function could have been defined more
-           * than one level up).
-           */
-
-          if (vtbl_offset != 0)
-            fn_p->field.fn_fields[ix].fcontext = type;
-          else
-            fn_p->field.fn_fields[ix].fcontext = NULL;
-
-          /* Other random fields pertaining to this method */
-          fn_p->field.fn_fields[ix].is_const = const_member;
-          fn_p->field.fn_fields[ix].is_volatile = volatile_member; /* ?? */ 
-          switch (fieldp->dgenfield.visibility) {
-            case 1:
-              fn_p->field.fn_fields[ix].is_protected = 1;
-              fn_p->field.fn_fields[ix].is_private = 0;
-              break;
-            case 2:
-              fn_p->field.fn_fields[ix].is_protected = 0;
-              fn_p->field.fn_fields[ix].is_private = 1;
-              break;
-            default: /* public */
-              fn_p->field.fn_fields[ix].is_protected = 0;
-              fn_p->field.fn_fields[ix].is_private = 0;
-          }
-          fn_p->field.fn_fields[ix].is_stub = 0;
-
-          /* HP aCC emits both MEMFUNC and FUNCTION entries for a method;
-             if the class points to the FUNCTION, there is usually separate
-             code for the method; but if we have a MEMFUNC, the method has
-             been inlined (and there is usually no FUNCTION entry)
-             FIXME Not sure if this test is accurate. pai/1997-08-22 */ 
-          if ((fn_fieldp->dblock.kind == DNTT_TYPE_MEMFUNC) ||
-              (fn_fieldp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC))
-            fn_p->field.fn_fields[ix].is_inlined = 1;
-          else
-            fn_p->field.fn_fields[ix].is_inlined = 0;
-          
-          fn_p->field.fn_fields[ix].dummy = 0;
-          
-          /* Bump the total count of the member functions */
-          n_fn_fields_total++;
-
-        } else if (fn_fieldp->dblock.kind == DNTT_TYPE_SVAR) {
-          /* This case is for static data members of classes */ 
-          
-          /* pai:: FIXME -- check that "staticmem" bit is set */
-
-          /* Get space to record this static member */
-          new = (struct nextfield *) alloca (sizeof (struct nextfield));
-          new->next = list;
-          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);
-          
-          FIELD_TYPE (list->field) = memtype;
-          list->attributes = 0;
-          switch (fieldp->dgenfield.visibility) {
-            case 1:
-              B_SET(&(list->attributes), ATTR_PROTECT);
-              break;
-            case 2:
-              B_SET(&(list->attributes), ATTR_PRIVATE);
-              break;
-          }
-          nfields++;
-        }
-
-        else if (fn_fieldp->dblock.kind == DNTT_TYPE_FIELD)
-          {
-            /* FIELDs follow GENFIELDs for fields of anonymous unions.
-               Code below is replicated from the case for FIELDs further
-               below, except that fieldp is replaced by fn_fieldp */ 
-            if (!fn_fieldp->dfield.a_union)
-              warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set");
-            /* Get space to record the next field/data-member. */
-            new = (struct nextfield *) alloca (sizeof (struct nextfield));
-            new->next = list;
-            list = new;
-
-            list->field.name = VT (objfile) + fn_fieldp->dfield.name;
-            FIELD_BITPOS (list->field) = fn_fieldp->dfield.bitoffset;
-            if (fn_fieldp->dfield.bitlength % 8)
-              list->field.bitsize = fn_fieldp->dfield.bitlength;
-            else
-              list->field.bitsize = 0;
-
-            memtype = hpread_type_lookup (fn_fieldp->dfield.type, objfile);
-            list->field.type = memtype;
-            list->attributes = 0;
-            switch (fn_fieldp->dfield.visibility) {
-              case 1:
-                B_SET(&(list->attributes), ATTR_PROTECT);
-                break;
-              case 2:
-                B_SET(&(list->attributes), ATTR_PRIVATE);
-                break;
-            }
-            nfields++;
-          }
-        else if (fn_fieldp->dblock.kind == DNTT_TYPE_SVAR)
-          {
-            /* Field of anonymous union; union is not inside a class */
-            if (!fn_fieldp->dsvar.a_union)
-              warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set");
-            /* Get space to record the next field/data-member. */
-            new = (struct nextfield *) alloca (sizeof (struct nextfield));
-            new->next = list;
-            list = new;
-
-            list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
-            FIELD_BITPOS (list->field) = 0;  /* FIXME is this always true? */
-            FIELD_BITSIZE (list->field) = 0; /* use length from type */
-            memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
-            list->field.type = memtype;
-            list->attributes = 0;
-            /* No info to set visibility -- always public */ 
-            nfields++;
-          }
-        else if (fn_fieldp->dblock.kind == DNTT_TYPE_DVAR)
-          {
-            /* Field of anonymous union; union is not inside a class */
-            if (!fn_fieldp->ddvar.a_union)
-              warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set");
-            /* Get space to record the next field/data-member. */
-            new = (struct nextfield *) alloca (sizeof (struct nextfield));
-            new->next = list;
-            list = new;
-
-            list->field.name = VT (objfile) + fn_fieldp->ddvar.name;
-            FIELD_BITPOS (list->field) = 0;  /* FIXME is this always true? */
-            FIELD_BITSIZE (list->field) = 0; /* use length from type */ 
-            memtype = hpread_type_lookup (fn_fieldp->ddvar.type, objfile);
-            list->field.type = memtype;
-            list->attributes = 0;
-            /* No info to set visibility -- always public */ 
-            nfields++;
-          }
-        else { /* Not a method, nor a static data member, nor an anon union field */
-
-          /* This case is for miscellaneous type entries (local enums,
-             local function templates, etc.) that can be present
-             inside a class. */
-
-          /* Enums -- will be handled by other code that takes care
-             of DNTT_TYPE_ENUM; here we see only DNTT_TYPE_MEMENUM so
-             it's not clear we could have handled them here at all. */
-          /* FUNC_TEMPLATE: is handled by other code (??). */
-          /* MEMACCESS: modified access for inherited member. Not
-             sure what to do with this, ignoriing it at present. */ 
-
-          /* What other entries can appear following a GENFIELD which
-             we do not handle above?  (MODIFIER, VFUNC handled above.) */
-
-          if ((fn_fieldp->dblock.kind != DNTT_TYPE_MEMACCESS) &&
-              (fn_fieldp->dblock.kind != DNTT_TYPE_MEMENUM) &&
-              (fn_fieldp->dblock.kind != DNTT_TYPE_FUNC_TEMPLATE))
-            warning ("Internal error: Unexpected debug record kind %d found following DNTT_GENFIELD",
-                     fn_fieldp->dblock.kind);
-        }
-        /* walk to the next FIELD or GENFIELD */
-        field = fieldp->dgenfield.nextfield;
-
-      } 
-      else if (fieldp->dblock.kind == DNTT_TYPE_FIELD) {
-        
-        /* Ordinary structure/union/class field */
-        struct type * anon_union_type;
-
-        /* Get space to record the next field/data-member. */
-       new = (struct nextfield *) alloca (sizeof (struct nextfield));
-        new->next = list;
-        list = new;
-        
-        list->field.name = VT (objfile) + fieldp->dfield.name;
-
-
-        /* A FIELD by itself (without a GENFIELD) can also be a static member */
-        if (fieldp->dfield.staticmem)
-          {
-           FIELD_BITPOS (list->field) = -1;
-           FIELD_BITSIZE (list->field) = 0;
-          }
-        else /* Non-static data member */ 
-          {
-           FIELD_BITPOS (list->field) = fieldp->dfield.bitoffset;
-           if (fieldp->dfield.bitlength % 8)
-             FIELD_BITSIZE (list->field) = fieldp->dfield.bitlength;
-           else
+           {                   /* Not a method, nor a static data member, nor an anon union field */
+
+             /* This case is for miscellaneous type entries (local enums,
+                local function templates, etc.) that can be present
+                inside a class. */
+
+             /* Enums -- will be handled by other code that takes care
+                of DNTT_TYPE_ENUM; here we see only DNTT_TYPE_MEMENUM so
+                it's not clear we could have handled them here at all. */
+             /* FUNC_TEMPLATE: is handled by other code (??). */
+             /* MEMACCESS: modified access for inherited member. Not
+                sure what to do with this, ignoriing it at present. */
+
+             /* What other entries can appear following a GENFIELD which
+                we do not handle above?  (MODIFIER, VFUNC handled above.) */
+
+             if ((fn_fieldp->dblock.kind != DNTT_TYPE_MEMACCESS) &&
+                 (fn_fieldp->dblock.kind != DNTT_TYPE_MEMENUM) &&
+                 (fn_fieldp->dblock.kind != DNTT_TYPE_FUNC_TEMPLATE))
+               warning ("Internal error: Unexpected debug record kind %d found following DNTT_GENFIELD",
+                        fn_fieldp->dblock.kind);
+           }
+         /* walk to the next FIELD or GENFIELD */
+         field = fieldp->dgenfield.nextfield;
+
+       }
+      else if (fieldp->dblock.kind == DNTT_TYPE_FIELD)
+       {
+
+         /* Ordinary structure/union/class field */
+         struct type *anon_union_type;
+
+         /* Get space to record the next field/data-member. */
+         new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         new->next = list;
+         list = new;
+
+         list->field.name = VT (objfile) + fieldp->dfield.name;
+
+
+         /* A FIELD by itself (without a GENFIELD) can also be a static member */
+         if (fieldp->dfield.staticmem)
+           {
+             FIELD_BITPOS (list->field) = -1;
              FIELD_BITSIZE (list->field) = 0;
-          }
-
-        memtype = hpread_type_lookup (fieldp->dfield.type, objfile);
-        FIELD_TYPE (list->field) = memtype;
-        list->attributes = 0;
-        switch (fieldp->dfield.visibility) {
-          case 1:
-            B_SET(&(list->attributes), ATTR_PROTECT);
-            break;
-          case 2:
-            B_SET(&(list->attributes), ATTR_PRIVATE);
-            break;
-        }
-        nfields++;
-
-
-        /* Note 1: First, we have to check if the current field is an anonymous
-           union. If it is, then *its* fields are threaded along in the
-           nextfield chain. :-( This was supposed to help debuggers, but is
-           really just a nuisance since we deal with anonymous unions anyway by
-           checking that the name is null.  So anyway, we skip over the fields
-           of the anonymous union. pai/1997-08-22 */
-        /* Note 2: In addition, the bitoffsets for the fields of the anon union
-           are relative to the enclosing struct, *NOT* relative to the anon
-           union!  This is an even bigger nuisance -- we have to go in and munge
-           the anon union's type information appropriately. pai/1997-08-22 */
-
-        /* Both tasks noted above are done by a separate function.  This takes us
-           to the next FIELD or GENFIELD, skipping anon unions, and recursively
-           processing intermediate types. */ 
-        field = hpread_get_next_skip_over_anon_unions (1, field, &fieldp, objfile);
-
-      } else {
-        /* neither field nor genfield ?? is this possible?? */
-        /* pai:: FIXME walk to the next -- how? */
-        warning ("Internal error: unexpected DNTT kind %d encountered as field of struct");
-        warning ("Skipping remaining fields of struct");
-        break; /* get out of loop of fields */ 
-      }
+           }
+         else
+           /* Non-static data member */
+           {
+             FIELD_BITPOS (list->field) = fieldp->dfield.bitoffset;
+             if (fieldp->dfield.bitlength % 8)
+               FIELD_BITSIZE (list->field) = fieldp->dfield.bitlength;
+             else
+               FIELD_BITSIZE (list->field) = 0;
+           }
+
+         memtype = hpread_type_lookup (fieldp->dfield.type, objfile);
+         FIELD_TYPE (list->field) = memtype;
+         list->attributes = 0;
+         switch (fieldp->dfield.visibility)
+           {
+           case 1:
+             B_SET (&(list->attributes), ATTR_PROTECT);
+             break;
+           case 2:
+             B_SET (&(list->attributes), ATTR_PRIVATE);
+             break;
+           }
+         nfields++;
+
+
+         /* Note 1: First, we have to check if the current field is an anonymous
+            union. If it is, then *its* fields are threaded along in the
+            nextfield chain. :-( This was supposed to help debuggers, but is
+            really just a nuisance since we deal with anonymous unions anyway by
+            checking that the name is null.  So anyway, we skip over the fields
+            of the anonymous union. pai/1997-08-22 */
+         /* Note 2: In addition, the bitoffsets for the fields of the anon union
+            are relative to the enclosing struct, *NOT* relative to the anon
+            union!  This is an even bigger nuisance -- we have to go in and munge
+            the anon union's type information appropriately. pai/1997-08-22 */
+
+         /* Both tasks noted above are done by a separate function.  This takes us
+            to the next FIELD or GENFIELD, skipping anon unions, and recursively
+            processing intermediate types. */
+         field = hpread_get_next_skip_over_anon_unions (1, field, &fieldp, objfile);
+
+       }
+      else
+       {
+         /* neither field nor genfield ?? is this possible?? */
+         /* pai:: FIXME walk to the next -- how? */
+         warning ("Internal error: unexpected DNTT kind %d encountered as field of struct");
+         warning ("Skipping remaining fields of struct");
+         break;                /* get out of loop of fields */
+       }
     }
 
   /* If it's a template, read in the instantiation list */
-  if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE) {
-    ninstantiations = 0;
-    field = dn_bufp->dtemplate.expansions;
-    while (field.word && field.word != DNTTNIL) {
-      fieldp = hpread_get_lntt (field.dnttp.index, objfile);
-      /* The expansions or nextexp should point to a tagdef */
-      if (fieldp->dblock.kind != DNTT_TYPE_TAGDEF) 
-        break;
-
-      i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation)); 
-      i_new->next = i_list;
-      i_list = i_new;
-      i_list->t = hpread_type_lookup (field, objfile);
-      ninstantiations++;
-
-      /* And the "type" field of that should point to a class */
-      field = fieldp->dtag.type;
-      fieldp = hpread_get_lntt (field.dnttp.index, objfile);
-      if (fieldp->dblock.kind != DNTT_TYPE_CLASS) 
-        break;
-
-      /* Get the next expansion */
-      field = fieldp->dclass.nextexp;
+  if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
+    {
+      ninstantiations = 0;
+      field = dn_bufp->dtemplate.expansions;
+      while (field.word && field.word != DNTTNIL)
+       {
+         fieldp = hpread_get_lntt (field.dnttp.index, objfile);
+
+         /* The expansions or nextexp should point to a tagdef */
+         if (fieldp->dblock.kind != DNTT_TYPE_TAGDEF)
+           break;
+
+         i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation));
+         i_new->next = i_list;
+         i_list = i_new;
+         i_list->t = hpread_type_lookup (field, objfile);
+         ninstantiations++;
+
+         /* And the "type" field of that should point to a class */
+         field = fieldp->dtag.type;
+         fieldp = hpread_get_lntt (field.dnttp.index, objfile);
+         if (fieldp->dblock.kind != DNTT_TYPE_CLASS)
+           break;
+
+         /* Get the next expansion */
+         field = fieldp->dclass.nextexp;
+       }
     }
-  }
-  TYPE_NINSTANTIATIONS(type) = ninstantiations;
-  if (ninstantiations > 0) 
-    TYPE_INSTANTIATIONS(type) = (struct type **)
+  TYPE_NINSTANTIATIONS (type) = ninstantiations;
+  if (ninstantiations > 0)
+    TYPE_INSTANTIATIONS (type) = (struct type **)
       obstack_alloc (&objfile->type_obstack, sizeof (struct type *) * ninstantiations);
   for (n = ninstantiations; i_list; i_list = i_list->next)
     {
       n -= 1;
-      TYPE_INSTANTIATION(type, n) = i_list->t;
+      TYPE_INSTANTIATION (type, n) = i_list->t;
     }
 
 
@@ -1940,12 +1968,12 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
    */
   TYPE_NFN_FIELDS (type) = n_fn_fields;
   TYPE_NFN_FIELDS_TOTAL (type) = n_fn_fields_total;
-  TYPE_FN_FIELDLISTS(type) = (struct fn_fieldlist *)
+  TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
     obstack_alloc (&objfile->type_obstack, sizeof (struct fn_fieldlist) * n_fn_fields);
   for (n = n_fn_fields; fn_list; fn_list = fn_list->next)
     {
       n -= 1;
-      TYPE_FN_FIELDLIST(type, n) = fn_list->field;
+      TYPE_FN_FIELDLIST (type, n) = fn_list->field;
     }
 
   /* pai:: FIXME -- perhaps each bitvector should be created individually */
@@ -1953,15 +1981,15 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
     {
       n -= 1;
       if (tmp_list->attributes)
-        {
-          need_bitvectors = 1;
-          break;
-        }
+       {
+         need_bitvectors = 1;
+         break;
+       }
     }
 
   if (need_bitvectors)
     {
-      /* pai:: this step probably redundant */ 
+      /* pai:: this step probably redundant */
       ALLOCATE_CPLUS_STRUCT_TYPE (type);
 
       TYPE_FIELD_VIRTUAL_BITS (type) =
@@ -1971,7 +1999,7 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
       TYPE_FIELD_PRIVATE_BITS (type) =
        (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
       B_CLRALL (TYPE_FIELD_PRIVATE_BITS (type), nfields);
-      
+
       TYPE_FIELD_PROTECTED_BITS (type) =
        (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
       B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields);
@@ -1982,48 +2010,48 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
       B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
 
       while (nfields-- > 0)
-        {
-          if (B_TST(&(list->attributes),ATTR_VIRTUAL))
-            SET_TYPE_FIELD_VIRTUAL (type, nfields);
-          if (B_TST(&(list->attributes),ATTR_PRIVATE))
-            SET_TYPE_FIELD_PRIVATE (type, nfields);
-          if (B_TST(&(list->attributes),ATTR_PROTECT))
-            SET_TYPE_FIELD_PROTECTED (type, nfields);
-
-          list = list->next;
-        }
+       {
+         if (B_TST (&(list->attributes), ATTR_VIRTUAL))
+           SET_TYPE_FIELD_VIRTUAL (type, nfields);
+         if (B_TST (&(list->attributes), ATTR_PRIVATE))
+           SET_TYPE_FIELD_PRIVATE (type, nfields);
+         if (B_TST (&(list->attributes), ATTR_PROTECT))
+           SET_TYPE_FIELD_PROTECTED (type, nfields);
+
+         list = list->next;
+       }
     }
   else
     {
-      TYPE_FIELD_VIRTUAL_BITS(type) = NULL;
-      TYPE_FIELD_PROTECTED_BITS(type) = NULL;
-      TYPE_FIELD_PRIVATE_BITS(type) = NULL;
+      TYPE_FIELD_VIRTUAL_BITS (type) = NULL;
+      TYPE_FIELD_PROTECTED_BITS (type) = NULL;
+      TYPE_FIELD_PRIVATE_BITS (type) = NULL;
     }
-  
-  if (has_vtable(type))
+
+  if (has_vtable (type))
     {
       /* Allocate space for class runtime information */
-      TYPE_RUNTIME_PTR(type) = (struct runtime_info *) xmalloc (sizeof(struct runtime_info));
+      TYPE_RUNTIME_PTR (type) = (struct runtime_info *) xmalloc (sizeof (struct runtime_info));
       /* Set flag for vtable */
-      TYPE_VTABLE(type) = 1;
+      TYPE_VTABLE (type) = 1;
       /* The first non-virtual base class with a vtable. */
-      TYPE_PRIMARY_BASE(type) = primary_base_class(type);
+      TYPE_PRIMARY_BASE (type) = primary_base_class (type);
       /* The virtual base list. */
-      TYPE_VIRTUAL_BASE_LIST(type) = virtual_base_list(type);
+      TYPE_VIRTUAL_BASE_LIST (type) = virtual_base_list (type);
     }
   else
-    TYPE_RUNTIME_PTR(type) = NULL;
+    TYPE_RUNTIME_PTR (type) = NULL;
 
   /* If this is a local type (C++ - declared inside a function), record file name & line # */
-  if (hpread_get_scope_depth (dn_bufp, objfile, 1 /* no need for real depth */))
+  if (hpread_get_scope_depth (dn_bufp, objfile, 1 /* no need for real depth */ ))
     {
       TYPE_LOCALTYPE_PTR (type) = (struct local_type_info *) xmalloc (sizeof (struct local_type_info));
       TYPE_LOCALTYPE_FILE (type) = (char *) xmalloc (strlen (current_subfile->name) + 1);
       strcpy (TYPE_LOCALTYPE_FILE (type), current_subfile->name);
       if (current_subfile->line_vector && (current_subfile->line_vector->nitems > 0))
-        TYPE_LOCALTYPE_LINE (type) = current_subfile->line_vector->item[current_subfile->line_vector->nitems - 1].line;
+       TYPE_LOCALTYPE_LINE (type) = current_subfile->line_vector->item[current_subfile->line_vector->nitems - 1].line;
       else
-        TYPE_LOCALTYPE_LINE (type) = 0;
+       TYPE_LOCALTYPE_LINE (type) = 0;
     }
   else
     TYPE_LOCALTYPE_PTR (type) = NULL;
@@ -2040,32 +2068,32 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
    work correctly.
    TYPE is a pointer to the struct/class type
    NAME is a char * (string) which is the class/struct name
-   Void return */ 
+   Void return */
 
 static void
 fix_static_member_physnames (type, class_name, objfile)
-  struct type * type;
-  char * class_name;
-  struct objfile * objfile;
+     struct type *type;
+     char *class_name;
+     struct objfile *objfile;
 {
   int i;
 
-  /* We fix the member names only for classes or structs */ 
+  /* We fix the member names only for classes or structs */
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT)
     return;
 
-  for (i=0; i < TYPE_NFIELDS (type); i++)
+  for (i = 0; i < TYPE_NFIELDS (type); i++)
     if (TYPE_FIELD_STATIC (type, i))
       {
-        if (TYPE_FIELD_STATIC_PHYSNAME (type, i))
-          return;  /* physnames are already set */
-
-        SET_FIELD_PHYSNAME (type->fields[i], 
-                 obstack_alloc (&objfile->type_obstack,
-                                  strlen (class_name) + strlen (TYPE_FIELD_NAME (type, i)) + 3));
-        strcpy (TYPE_FIELD_STATIC_PHYSNAME (type, i), class_name);
-        strcat (TYPE_FIELD_STATIC_PHYSNAME (type, i), "::");
-        strcat (TYPE_FIELD_STATIC_PHYSNAME (type, i), TYPE_FIELD_NAME (type, i));
+       if (TYPE_FIELD_STATIC_PHYSNAME (type, i))
+         return;               /* physnames are already set */
+
+       SET_FIELD_PHYSNAME (type->fields[i],
+                           obstack_alloc (&objfile->type_obstack,
+            strlen (class_name) + strlen (TYPE_FIELD_NAME (type, i)) + 3));
+       strcpy (TYPE_FIELD_STATIC_PHYSNAME (type, i), class_name);
+       strcat (TYPE_FIELD_STATIC_PHYSNAME (type, i), "::");
+       strcat (TYPE_FIELD_STATIC_PHYSNAME (type, i), TYPE_FIELD_NAME (type, i));
       }
 }
 
@@ -2073,13 +2101,13 @@ fix_static_member_physnames (type, class_name, objfile)
  * for a method (previously marked with a null type in hpread_read_struct_type()
  * is set correctly to METHOD.
  * OBJFILE is as for other such functions. 
- * Void return. */ 
+ * Void return. */
+
 static void
 fixup_class_method_type (class, method, objfile)
-  struct type * class;
-  struct type * method;
-  struct objfile * objfile;
+     struct type *class;
+     struct type *method;
+     struct objfile *objfile;
 {
   int i, j, k;
 
@@ -2091,38 +2119,38 @@ fixup_class_method_type (class, method, objfile)
       (TYPE_CODE (class) != TYPE_CODE_UNION))
     return;
 
-  /* Loop over all methods and find the one marked with a NULL type */ 
+  /* Loop over all methods and find the one marked with a NULL type */
   for (i = 0; i < TYPE_NFN_FIELDS (class); i++)
     for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (class, i); j++)
       if (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j) == NULL)
-        {
-          /* Set the method type */ 
-          TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j) = method;
-          /* The argument list */
-          (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types
-            = (struct type **) obstack_alloc(&objfile->type_obstack,
-                                             sizeof(struct type *) * (method->nfields + 1));
-          for (k = 0; k < method->nfields; k++) 
-          (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types[k] = method->fields[k].type;
-          /* void termination */ 
-          (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types[method->nfields] = builtin_type_void;
-          
-          /* pai: It's not clear why this args field has to be set.  Perhaps
-           * it should be eliminated entirely. */
-          (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args
-            = (struct type **) obstack_alloc(&objfile->type_obstack,
-                                             sizeof(struct type *) * (method->nfields + 1));
-          for (k = 0; k < method->nfields; k++)
-            (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[k] = method->fields[k].type;
-          /* null-terminated, unlike arg_types above */ 
-          (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[method->nfields] = NULL;
-
-          /* Break out of both loops -- only one method to fix up in a class */ 
-          goto finish;
-        }
+       {
+         /* Set the method type */
+         TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j) = method;
+         /* The argument list */
+         (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types
+           = (struct type **) obstack_alloc (&objfile->type_obstack,
+                           sizeof (struct type *) * (method->nfields + 1));
+         for (k = 0; k < method->nfields; k++)
+           (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types[k] = method->fields[k].type;
+         /* void termination */
+         (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j))->type_specific.arg_types[method->nfields] = builtin_type_void;
+
+         /* pai: It's not clear why this args field has to be set.  Perhaps
+          * it should be eliminated entirely. */
+         (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args
+           = (struct type **) obstack_alloc (&objfile->type_obstack,
+                           sizeof (struct type *) * (method->nfields + 1));
+         for (k = 0; k < method->nfields; k++)
+           (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[k] = method->fields[k].type;
+         /* null-terminated, unlike arg_types above */
+         (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[method->nfields] = NULL;
+
+         /* Break out of both loops -- only one method to fix up in a class */
+         goto finish;
+       }
 
 finish:
-  TYPE_FLAGS (class) &= ~TYPE_FLAG_INCOMPLETE;  
+  TYPE_FLAGS (class) &= ~TYPE_FLAG_INCOMPLETE;
 }
 
 
@@ -2139,15 +2167,15 @@ finish:
  * We need to look these up in order to fill in "a" and "b"'s type.
  * This is called from hpread_type_lookup().
  */
-static struct type * 
-hpread_get_nth_template_arg(objfile, n)
+static struct type *
+hpread_get_nth_template_arg (objfile, n)
      struct objfile *objfile;
      int n;
 {
-   if (current_template != NULL)
-     return TYPE_TEMPLATE_ARG(current_template, n).type;
-   else
-     return lookup_fundamental_type (objfile, FT_TEMPLATE_ARG);
+  if (current_template != NULL)
+    return TYPE_TEMPLATE_ARG (current_template, n).type;
+  else
+    return lookup_fundamental_type (objfile, FT_TEMPLATE_ARG);
 }
 
 /* Read in and internalize a TEMPL_ARG (template arg) symbol.  */
@@ -2157,7 +2185,7 @@ hpread_read_templ_arg_type (hp_type, dn_bufp, objfile, name)
      dnttpointer hp_type;
      union dnttentry *dn_bufp;
      struct objfile *objfile;
-     char * name;
+     char *name;
 {
   struct type *type;
 
@@ -2207,7 +2235,7 @@ hpread_read_array_type (hp_type, dn_bufp, objfile)
      struct objfile *objfile;
 {
   struct type *type;
-  
+
   /* Allocate an array type symbol.
    * Why no check for already-read here, like in the other
    * hpread_read_xxx_type routines?  Because it kept us 
@@ -2223,18 +2251,22 @@ hpread_read_array_type (hp_type, dn_bufp, objfile)
    * or express both array-length and element-length in bytes.
    */
   if (!((dn_bufp->darray.arrayisbytes && dn_bufp->darray.elemisbytes) ||
-       (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes))) {
-    warning ("error in hpread_array_type.\n");
-    return;
-  } else if (dn_bufp->darray.arraylength == 0x7fffffff) {
-    /* The HP debug format represents char foo[]; as an array with
-     * length 0x7fffffff.  Internally GDB wants to represent this
-     * as an array of length zero.  
-     */
-    TYPE_LENGTH (type) = 0;
-  } else if (dn_bufp->darray.arrayisbytes)
+       (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes)))
+    {
+      warning ("error in hpread_array_type.\n");
+      return;
+    }
+  else if (dn_bufp->darray.arraylength == 0x7fffffff)
+    {
+      /* The HP debug format represents char foo[]; as an array with
+       * length 0x7fffffff.  Internally GDB wants to represent this
+       *  as an array of length zero.  
+       */
+      TYPE_LENGTH (type) = 0;
+    }
+  else if (dn_bufp->darray.arrayisbytes)
     TYPE_LENGTH (type) = dn_bufp->darray.arraylength;
-  else /* arraylength is in bits */
+  else                         /* arraylength is in bits */
     TYPE_LENGTH (type) = dn_bufp->darray.arraylength / 8;
 
   TYPE_TARGET_TYPE (type) = hpread_type_lookup (dn_bufp->darray.elemtype,
@@ -2325,7 +2357,7 @@ hpread_type_lookup (hp_type, objfile)
      struct objfile *objfile;
 {
   union dnttentry *dn_bufp;
-  struct type * tmp_type;
+  struct type *tmp_type;
 
   /* First see if it's a simple builtin type.  */
   if (hp_type.dntti.immediate)
@@ -2334,7 +2366,7 @@ hpread_type_lookup (hp_type, objfile)
      * GDB's representation of this fundamental type.
      */
     if (hp_type.dntti.type == HP_TYPE_TEMPLATE_ARG)
-      return hpread_get_nth_template_arg(objfile, hp_type.dntti.bitlength);
+      return hpread_get_nth_template_arg (objfile, hp_type.dntti.bitlength);
     else
       return lookup_fundamental_type (objfile, hpread_type_translate (hp_type));
 
@@ -2390,54 +2422,54 @@ hpread_type_lookup (hp_type, objfile)
 
     case DNTT_TYPE_TYPEDEF:
       {
-        /* A typedef - chase it down by making a recursive call */
+       /* A typedef - chase it down by making a recursive call */
        struct type *structtype = hpread_type_lookup (dn_bufp->dtype.type,
                                                      objfile);
 
-        /* The following came from the base hpread.c that we inherited.
-         * It is WRONG so I have commented it out. - RT
-         *...
-
-       char *suffix;
-       suffix = VT (objfile) + dn_bufp->dtype.name;
-       TYPE_NAME (structtype) = suffix;
-
-         * ... further explanation ....
-         *
-         * What we have here is a typedef pointing to a typedef.
-         * E.g.,
-         * typedef int foo;
-         * typedef foo fum;
-         *
-         * What we desire to build is (these are pictures
-         * of "struct type"'s): 
-         *
-         *  +---------+     +----------+     +------------+
-         *  | typedef |     | typedef  |     | fund. type |
-         *  |     type| ->  |      type| ->  |            |
-         *  | "fum"   |     | "foo"    |     | "int"      |
-         *  +---------+     +----------+     +------------+
-         *
-         * What this commented-out code is doing is smashing the
-         * name of pointed-to-type to be the same as the pointed-from
-         * type. So we wind up with something like:
-         *
-         *  +---------+     +----------+     +------------+
-         *  | typedef |     | typedef  |     | fund. type |
-         *  |     type| ->  |      type| ->  |            |
-         *  | "fum"   |     | "fum"    |     | "fum"      |
-         *  +---------+     +----------+     +------------+
-         
-         */
+       /* The following came from the base hpread.c that we inherited.
+        * It is WRONG so I have commented it out. - RT
+        *...
+
+        char *suffix;
+        suffix = VT (objfile) + dn_bufp->dtype.name;
+        TYPE_NAME (structtype) = suffix;
+
+        * ... further explanation ....
+        *
+        * What we have here is a typedef pointing to a typedef.
+        * E.g.,
+        * typedef int foo;
+        * typedef foo fum;
+        *
+        * What we desire to build is (these are pictures
+        * of "struct type"'s): 
+        *
+        *  +---------+     +----------+     +------------+
+        *  | typedef |     | typedef  |     | fund. type |
+        *  |     type| ->  |      type| ->  |            |
+        *  | "fum"   |     | "foo"    |     | "int"      |
+        *  +---------+     +----------+     +------------+
+        *
+        * What this commented-out code is doing is smashing the
+        * name of pointed-to-type to be the same as the pointed-from
+        * type. So we wind up with something like:
+        *
+        *  +---------+     +----------+     +------------+
+        *  | typedef |     | typedef  |     | fund. type |
+        *  |     type| ->  |      type| ->  |            |
+        *  | "fum"   |     | "fum"    |     | "fum"      |
+        *  +---------+     +----------+     +------------+
+        * 
+        */
 
        return structtype;
       }
 
     case DNTT_TYPE_TAGDEF:
-       {
+      {
        /* Just a little different from above.  We have to tack on
         * an identifier of some kind (struct, union, enum, class, etc).  
-         */
+        */
        struct type *structtype = hpread_type_lookup (dn_bufp->dtype.type,
                                                      objfile);
        char *prefix, *suffix;
@@ -2445,37 +2477,49 @@ hpread_type_lookup (hp_type, objfile)
 
        /* Lookup the next type in the list.  It should be a structure,
         * union, class, enum, or template type.  
-         * We will need to attach that to our name.  
-         */
+        * We will need to attach that to our name.  
+        */
        if (dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile))
          dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile);
-       else {
-          complain (&hpread_type_lookup_complaint);
-          return;
-        }
-
-       if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT) {
-         prefix = "struct ";
-       } else if (dn_bufp->dblock.kind == DNTT_TYPE_UNION) {
-         prefix = "union ";
-       } else if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS) { 
-          /* Further field for CLASS saying how it was really declared */
-          /* 0==class, 1==union, 2==struct */
-          if (dn_bufp->dclass.class_decl == 0) 
-           prefix = "class ";
-          else if (dn_bufp->dclass.class_decl == 1) 
-           prefix = "union ";
-          else if (dn_bufp->dclass.class_decl == 2) 
+       else
+         {
+           complain (&hpread_type_lookup_complaint);
+           return;
+         }
+
+       if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT)
+         {
            prefix = "struct ";
-          else
-            prefix = "";
-       } else if (dn_bufp->dblock.kind == DNTT_TYPE_ENUM) {
-         prefix = "enum ";
-       } else if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE) {
-         prefix = "template ";
-        } else {
-          prefix = "";
-        }
+         }
+       else if (dn_bufp->dblock.kind == DNTT_TYPE_UNION)
+         {
+           prefix = "union ";
+         }
+       else if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS)
+         {
+           /* Further field for CLASS saying how it was really declared */
+           /* 0==class, 1==union, 2==struct */
+           if (dn_bufp->dclass.class_decl == 0)
+             prefix = "class ";
+           else if (dn_bufp->dclass.class_decl == 1)
+             prefix = "union ";
+           else if (dn_bufp->dclass.class_decl == 2)
+             prefix = "struct ";
+           else
+             prefix = "";
+         }
+       else if (dn_bufp->dblock.kind == DNTT_TYPE_ENUM)
+         {
+           prefix = "enum ";
+         }
+       else if (dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
+         {
+           prefix = "template ";
+         }
+       else
+         {
+           prefix = "";
+         }
 
        /* Build the correct name.  */
        structtype->name
@@ -2485,10 +2529,10 @@ hpread_type_lookup (hp_type, objfile)
        TYPE_NAME (structtype) = strcat (TYPE_NAME (structtype), suffix);
        TYPE_TAG_NAME (structtype) = suffix;
 
-        /* For classes/structs, we have to set the static member "physnames"
-           to point to strings like "Class::Member" */ 
-        if (TYPE_CODE (structtype) == TYPE_CODE_STRUCT)
-          fix_static_member_physnames (structtype, suffix, objfile);
+       /* For classes/structs, we have to set the static member "physnames"
+          to point to strings like "Class::Member" */
+       if (TYPE_CODE (structtype) == TYPE_CODE_STRUCT)
+         fix_static_member_physnames (structtype, suffix, objfile);
 
        return structtype;
       }
@@ -2498,19 +2542,19 @@ hpread_type_lookup (hp_type, objfile)
        * the appropriate GDB type.
        */
       return make_pointer_type (
-          hpread_type_lookup (dn_bufp->dptr.pointsto, 
-                              objfile), 
-          NULL);
+                                hpread_type_lookup (dn_bufp->dptr.pointsto,
+                                                    objfile),
+                                NULL);
 
     case DNTT_TYPE_REFERENCE:
       /* C++ reference type - call a routine in gdbtypes.c that constructs
        * the appropriate GDB type.
        */
       return make_reference_type (
-                 hpread_type_lookup (dn_bufp->dreference.pointsto, 
-                                     objfile), 
-                 NULL);
-   
+                          hpread_type_lookup (dn_bufp->dreference.pointsto,
+                                              objfile),
+                                  NULL);
+
     case DNTT_TYPE_ENUM:
       return hpread_read_enum_type (hp_type, dn_bufp, objfile);
     case DNTT_TYPE_SET:
@@ -2538,16 +2582,16 @@ hpread_type_lookup (hp_type, objfile)
        * while the "memtype" field defines the pointed-to-type.
        */
       {
-      struct type * ptrmemtype;
-      struct type * class_type;
-      struct type * memtype;
-      memtype = hpread_type_lookup (dn_bufp->dptrmem.memtype, 
-                                    objfile), 
-      class_type = hpread_type_lookup (dn_bufp->dptrmem.pointsto, 
-                                       objfile), 
-      ptrmemtype = alloc_type(objfile);
-      smash_to_member_type(ptrmemtype, class_type, memtype); 
-      return make_pointer_type(ptrmemtype, NULL);
+       struct type *ptrmemtype;
+       struct type *class_type;
+       struct type *memtype;
+       memtype = hpread_type_lookup (dn_bufp->dptrmem.memtype,
+                                     objfile),
+         class_type = hpread_type_lookup (dn_bufp->dptrmem.pointsto,
+                                          objfile),
+         ptrmemtype = alloc_type (objfile);
+       smash_to_member_type (ptrmemtype, class_type, memtype);
+       return make_pointer_type (ptrmemtype, NULL);
       }
       break;
 
@@ -2557,31 +2601,32 @@ hpread_type_lookup (hp_type, objfile)
        * while the "memtype" field defines the pointed-to-type.
        */
       {
-      struct type * ptrmemtype;
-      struct type * class_type;
-      struct type * functype;
-      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); 
-      return make_pointer_type(ptrmemtype, NULL);
+       struct type *ptrmemtype;
+       struct type *class_type;
+       struct type *functype;
+       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);
+       return make_pointer_type (ptrmemtype, NULL);
       }
       break;
 
-    case DNTT_TYPE_CLASS: 
+    case DNTT_TYPE_CLASS:
       return hpread_read_struct_type (hp_type, dn_bufp, objfile);
 
     case DNTT_TYPE_GENFIELD:
@@ -2606,12 +2651,12 @@ hpread_type_lookup (hp_type, objfile)
        * "m_void" modifiers?  Is static_flag really needed here?
        * (m_static used for methods of classes, elsewhere).
        */
-      tmp_type = make_cv_type (dn_bufp->dmodifier.m_const, 
-                               dn_bufp->dmodifier.m_volatile,
-                               hpread_type_lookup (dn_bufp->dmodifier.type, objfile),
-                               0);
+      tmp_type = make_cv_type (dn_bufp->dmodifier.m_const,
+                              dn_bufp->dmodifier.m_volatile,
+                     hpread_type_lookup (dn_bufp->dmodifier.type, objfile),
+                              0);
       return tmp_type;
-      
+
 
     case DNTT_TYPE_MEMFUNC:
       /* Member function. Treat like a function.
@@ -2632,13 +2677,13 @@ hpread_type_lookup (hp_type, objfile)
 
     case DNTT_TYPE_TEMPLATE_ARG:
       {
-      char * name;
-      /* The TEMPLATE record points to an argument list of
-       * TEMPLATE_ARG records, each of which describes one
-       * of the type-arguments. 
-       */
-      name =  VT (objfile) + dn_bufp->dtempl_arg.name;
-      return hpread_read_templ_arg_type (hp_type, dn_bufp, objfile, name);
+       char *name;
+       /* The TEMPLATE record points to an argument list of
+        * TEMPLATE_ARG records, each of which describes one
+        * of the type-arguments. 
+        */
+       name = VT (objfile) + dn_bufp->dtempl_arg.name;
+       return hpread_read_templ_arg_type (hp_type, dn_bufp, objfile, name);
       }
 
     case DNTT_TYPE_FUNC_TEMPLATE:
@@ -2654,13 +2699,13 @@ hpread_type_lookup (hp_type, objfile)
        */
       return lookup_fundamental_type (objfile, FT_VOID);
 
-    /* Also not yet handled... */
-    /* case DNTT_TYPE_DYN_ARRAY_DESC: */
-    /* case DNTT_TYPE_DESC_SUBRANGE: */
-    /* case DNTT_TYPE_BEGIN_EXT: */
-    /* case DNTT_TYPE_INLN: */
-    /* case DNTT_TYPE_INLN_LIST: */
-    /* case DNTT_TYPE_ALIAS: */
+      /* Also not yet handled... */
+      /* case DNTT_TYPE_DYN_ARRAY_DESC: */
+      /* case DNTT_TYPE_DESC_SUBRANGE: */
+      /* case DNTT_TYPE_BEGIN_EXT: */
+      /* case DNTT_TYPE_INLN: */
+      /* case DNTT_TYPE_INLN_LIST: */
+      /* case DNTT_TYPE_ALIAS: */
     default:
       /* A fancy way of returning NULL */
       return lookup_fundamental_type (objfile, FT_VOID);
@@ -2699,47 +2744,48 @@ hpread_record_lines (subfile, s_idx, e_idx, objfile, offset)
  * Called from hpread_process_one_debug_symbol()
  * If "f" is not a member function, return NULL.
  */
-char * class_of (functype)
-struct type * functype;
+char *
+class_of (functype)
+     struct type *functype;
 {
-  struct type * first_param_type;
-  char * first_param_name;
-  struct type * pointed_to_type;
-  char * class_name;
+  struct type *first_param_type;
+  char *first_param_name;
+  struct type *pointed_to_type;
+  char *class_name;
 
   /* Check that the function has a first argument "this",
    * and that "this" is a pointer to a class. If not,
    * functype is not a member function, so return NULL.
    */
-  if (TYPE_NFIELDS(functype) == 0)
+  if (TYPE_NFIELDS (functype) == 0)
     return NULL;
   first_param_name = TYPE_FIELD_NAME (functype, 0);
   if (first_param_name == NULL)
-    return NULL; /* paranoia */
-  if (strcmp(first_param_name, "this"))
+    return NULL;               /* paranoia */
+  if (strcmp (first_param_name, "this"))
     return NULL;
   first_param_type = TYPE_FIELD_TYPE (functype, 0);
   if (first_param_type == NULL)
-    return NULL; /* paranoia */
-  if (TYPE_CODE(first_param_type) != TYPE_CODE_PTR)
+    return NULL;               /* paranoia */
+  if (TYPE_CODE (first_param_type) != TYPE_CODE_PTR)
     return NULL;
 
   /* Get the thing that "this" points to, check that
    * it's a class, and get its class name.
    */
-  pointed_to_type = TYPE_TARGET_TYPE(first_param_type);
-  if (pointed_to_type == NULL) 
-    return NULL; /* paranoia */
-  if (TYPE_CODE(pointed_to_type) != TYPE_CODE_CLASS)
+  pointed_to_type = TYPE_TARGET_TYPE (first_param_type);
+  if (pointed_to_type == NULL)
+    return NULL;               /* paranoia */
+  if (TYPE_CODE (pointed_to_type) != TYPE_CODE_CLASS)
     return NULL;
-  class_name = TYPE_NAME(pointed_to_type);
+  class_name = TYPE_NAME (pointed_to_type);
   if (class_name == NULL)
-    return NULL; /* paranoia */
+    return NULL;               /* paranoia */
 
   /* The class name may be of the form "class c", in which case
    * we want to strip off the leading "class ".
    */
-  if (strncmp(class_name, "class ", 6) == 0)
+  if (strncmp (class_name, "class ", 6) == 0)
     class_name += 6;
 
   return class_name;
@@ -2755,24 +2801,24 @@ struct type * functype;
  *   text_offset: 
  *   text_size: 
  *   filename: 
- *   index:            Index of this symbol
+ *   index:             Index of this symbol
  *   at_module_boundary_p Pointer to boolean flag to control caller's loop.
  */
 
 static void
 hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
                                 text_offset, text_size, filename,
-                                 index, at_module_boundary_p
-                                 )
+                                index, at_module_boundary_p
+)
      union dnttentry *dn_bufp;
      char *name;
      struct section_offsets *section_offsets;
      struct objfile *objfile;
      CORE_ADDR text_offset;
-     int       text_size;
-     char     *filename;
-     int       index;
-     int      *at_module_boundary_p;
+     int text_size;
+     char *filename;
+     int index;
+     int *at_module_boundary_p;
 {
   unsigned long desc;
   int type;
@@ -2783,9 +2829,9 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
   dnttpointer hp_type;
   struct symbol *sym;
   struct context_stack *new;
-  char * class_scope_name;
-  extern int is_in_import_list (); /* in somread.c */ 
-  
+  char *class_scope_name;
+  extern int is_in_import_list ();     /* in somread.c */
+
   /* Allocate one GDB debug symbol and fill in some default values. */
   sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                         sizeof (struct symbol));
@@ -2833,35 +2879,37 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        */
 
       valu = text_offset;
-      if (!last_source_file ) {
-          /*
-           * A note on "last_source_file": this is a char* pointing
-           * to the actual file name.  "start_symtab" sets it,
-           * "end_symtab" clears it.
-           *
-           * So if "last_source_file" is NULL, then either this is
-           * the first record we are looking at, or a previous call
-           * to "end_symtab()" was made to close out the previous
-           * module.  Since we're now quitting the scan loop when we
-           * see a MODULE END record, we should never get here, except
-           * in the case that we're not using the quick look-up tables
-           * and have to use the old system as a fall-back.
-           */
+      if (!last_source_file)
+       {
+         /*
+          * A note on "last_source_file": this is a char* pointing
+          * to the actual file name.  "start_symtab" sets it,
+          * "end_symtab" clears it.
+          *
+          * So if "last_source_file" is NULL, then either this is
+          * the first record we are looking at, or a previous call
+          * to "end_symtab()" was made to close out the previous
+          * module.  Since we're now quitting the scan loop when we
+          * see a MODULE END record, we should never get here, except
+          * in the case that we're not using the quick look-up tables
+          * and have to use the old system as a fall-back.
+          */
          start_symtab (name, NULL, valu);
          record_debugformat ("HP");
          SL_INDEX (objfile) = dn_bufp->dsfile.address;
-      }
+       }
 
-      else {
-          /* Either a new include file, or a SRCFILE record
-           * saying we are back in the main source (or out of
-           * a nested include file) again.
-           */
+      else
+       {
+         /* Either a new include file, or a SRCFILE record
+          * saying we are back in the main source (or out of
+          * a nested include file) again.
+          */
          SL_INDEX (objfile) = hpread_record_lines (current_subfile,
                                                    SL_INDEX (objfile),
                                                    dn_bufp->dsfile.address,
                                                    objfile, offset);
-      }
+       }
 
       /* A note on "start_subfile".  This routine will check
        * the name we pass it and look for an existing subfile
@@ -2872,7 +2920,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        */
       start_subfile (name, NULL);
       break;
-      
+
     case DNTT_TYPE_MODULE:
       /*
        * We no longer ignore DNTT_TYPE_MODULE symbols.  The module 
@@ -2902,27 +2950,27 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        */
 
       valu = text_offset;
-      if (!last_source_file )
+      if (!last_source_file)
        {
-          /* Start of a new module. We know this because "last_source_file"
-           * is NULL, which can only happen the first time or if we just 
-           * made a call to end_symtab() to close out the previous module.
-           */
+         /* Start of a new module. We know this because "last_source_file"
+          * is NULL, which can only happen the first time or if we just 
+          * made a call to end_symtab() to close out the previous module.
+          */
          start_symtab (name, NULL, valu);
          SL_INDEX (objfile) = dn_bufp->dmodule.address;
        }
       else
        {
-          /* This really shouldn't happen if we're using the quick
-           * look-up tables, as it would mean we'd scanned past an
-           * END MODULE entry.  But if we're not using the tables,
-           * we started the module on the SRCFILE entry, so it's ok.
-           * For now, accept this.
-           */
-     /* warning( "Error expanding psymtab, missed module end, found entry for %s",
-      *           name );
-      */
-          *at_module_boundary_p = -1;
+         /* This really shouldn't happen if we're using the quick
+          * look-up tables, as it would mean we'd scanned past an
+          * END MODULE entry.  But if we're not using the tables,
+          * we started the module on the SRCFILE entry, so it's ok.
+          * For now, accept this.
+          */
+         /* warning( "Error expanding psymtab, missed module end, found entry for %s",
+          *           name );
+          */
+         *at_module_boundary_p = -1;
        }
 
       start_subfile (name, NULL);
@@ -2938,7 +2986,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
                                                SL_INDEX (objfile),
                                                dn_bufp->dfunc.address,
                                                objfile, offset);
-      
+
       WITHIN_FUNCTION (objfile) = 1;
       CURRENT_FUNCTION_VALUE (objfile) = valu;
 
@@ -2957,64 +3005,66 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * (if any), which we get from the "alias" field of the SOM record
        * if that exists.
        */
-      if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) && 
-          dn_bufp->dfunc.alias && /* has an alias */ 
-          *(char *)(VT (objfile) + dn_bufp->dfunc.alias)) /* not a null string */ 
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
+      if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
+         dn_bufp->dfunc.alias &&       /* has an alias */
+         *(char *) (VT (objfile) + dn_bufp->dfunc.alias))      /* not a null string */
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
       else
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
 
       /* Special hack to get around HP compilers' insistence on
        * reporting "main" as "_MAIN_" for C/C++ */
       if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) &&
-          (strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0))
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
-      
+         (strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0))
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+
       /* The SYMBOL_CPLUS_DEMANGLED_NAME field is expected to
        * be the demangled name.
        */
       if (dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS)
        {
-        /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
-         * calling the demangler in libiberty (cplus_demangle()) to
-         * do the job. This generally does the job, even though
-         * it's intended for the GNU compiler and not the aCC compiler
-         * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
-         * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
-         * Generally, we don't want params when we display
-         * a demangled name, but when I took out the DMGL_PARAMS,
-         * some things broke, so I'm leaving it in here, and
-         * working around the issue in stack.c. - RT
-         */
-        SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
-        if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
-           (!SYMBOL_CPLUS_DEMANGLED_NAME(sym))) {
-
-          /* Well, the symbol name is mangled, but the
-           * demangler in libiberty failed so the demangled
-           * field is still NULL. Try to
-           * do the job ourselves based on the "name" field
-           * in the SOM record. A complication here is that
-           * the name field contains only the function name
-           * (like "f"), whereas we want the class qualification
-           * (as in "c::f"). Try to reconstruct that.
-           */          
-          char * basename;
-          char * classname;
-          char * dem_name;
-          basename = VT (objfile) + dn_bufp->dfunc.name;
-          classname = class_of(SYMBOL_TYPE(sym));
-          if (classname) {
-            dem_name = xmalloc(strlen(basename)+strlen(classname)+3);
-            strcpy(dem_name, classname);
-            strcat(dem_name, "::");
-            strcat(dem_name, basename);
-            SYMBOL_CPLUS_DEMANGLED_NAME(sym) = dem_name;
-            SYMBOL_LANGUAGE (sym) = language_cplus;
-          }
-        }
-      }
+         /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
+          * calling the demangler in libiberty (cplus_demangle()) to
+          * do the job. This generally does the job, even though
+          * it's intended for the GNU compiler and not the aCC compiler
+          * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
+          * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
+          * Generally, we don't want params when we display
+          * a demangled name, but when I took out the DMGL_PARAMS,
+          * some things broke, so I'm leaving it in here, and
+          * working around the issue in stack.c. - RT
+          */
+         SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
+         if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
+             (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+           {
+
+             /* Well, the symbol name is mangled, but the
+              * demangler in libiberty failed so the demangled
+              * field is still NULL. Try to
+              * do the job ourselves based on the "name" field
+              * in the SOM record. A complication here is that
+              * the name field contains only the function name
+              * (like "f"), whereas we want the class qualification
+              * (as in "c::f"). Try to reconstruct that.
+              */
+             char *basename;
+             char *classname;
+             char *dem_name;
+             basename = VT (objfile) + dn_bufp->dfunc.name;
+             classname = class_of (SYMBOL_TYPE (sym));
+             if (classname)
+               {
+                 dem_name = xmalloc (strlen (basename) + strlen (classname) + 3);
+                 strcpy (dem_name, classname);
+                 strcat (dem_name, "::");
+                 strcat (dem_name, basename);
+                 SYMBOL_CPLUS_DEMANGLED_NAME (sym) = dem_name;
+                 SYMBOL_LANGUAGE (sym) = language_cplus;
+               }
+           }
+       }
+
       /* Add the function symbol to the list of symbols in this blockvector */
       if (dn_bufp->dfunc.global)
        add_symbol_to_list (sym, &global_symbols);
@@ -3030,19 +3080,20 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * So I made it C/C++ specific. - RT
        */
       if (dn_bufp->dfunc.language == HP_LANGUAGE_C ||
-          dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) {
-        while (dn_bufp->dblock.kind != DNTT_TYPE_BEGIN)
-         {
-         dn_bufp = hpread_get_lntt (++index, objfile);
-         if (dn_bufp->dblock.extension)
-           continue;
-         }
-        SL_INDEX (objfile) = hpread_record_lines (current_subfile,
-                                                 SL_INDEX (objfile),
-                                                 dn_bufp->dbegin.address,
-                                                 objfile, offset);
-        SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile);
-      }
+         dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS)
+       {
+         while (dn_bufp->dblock.kind != DNTT_TYPE_BEGIN)
+           {
+             dn_bufp = hpread_get_lntt (++index, objfile);
+             if (dn_bufp->dblock.extension)
+               continue;
+           }
+         SL_INDEX (objfile) = hpread_record_lines (current_subfile,
+                                                   SL_INDEX (objfile),
+                                                   dn_bufp->dbegin.address,
+                                                   objfile, offset);
+         SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile);
+       }
       record_line (current_subfile, SYMBOL_LINE (sym), valu);
       break;
 
@@ -3054,7 +3105,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
                                                SL_INDEX (objfile),
                                                dn_bufp->ddocfunc.address,
                                                objfile, offset);
-      
+
       WITHIN_FUNCTION (objfile) = 1;
       CURRENT_FUNCTION_VALUE (objfile) = valu;
       /* Stack must be empty now.  */
@@ -3072,61 +3123,64 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * (if any), which we get from the "alias" field of the SOM record
        * if that exists.
        */
-      if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) && 
-          dn_bufp->ddocfunc.alias && /* has an alias */ 
-          *(char *)(VT (objfile) + dn_bufp->ddocfunc.alias)) /* not a null string */ 
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
+      if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
+         dn_bufp->ddocfunc.alias &&    /* has an alias */
+         *(char *) (VT (objfile) + dn_bufp->ddocfunc.alias))   /* not a null string */
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
       else
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
 
       /* Special hack to get around HP compilers' insistence on
        * reporting "main" as "_MAIN_" for C/C++ */
       if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) &&
-          (strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0))
-        SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
-      
-      if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) {
-
-        /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
-         * calling the demangler in libiberty (cplus_demangle()) to
-         * do the job. This generally does the job, even though
-         * it's intended for the GNU compiler and not the aCC compiler
-         * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
-         * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
-         * Generally, we don't want params when we display
-         * a demangled name, but when I took out the DMGL_PARAMS,
-         * some things broke, so I'm leaving it in here, and
-         * working around the issue in stack.c. - RT 
-         */
-        SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
-
-        if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
-           (!SYMBOL_CPLUS_DEMANGLED_NAME(sym))) {
-
-          /* Well, the symbol name is mangled, but the
-           * demangler in libiberty failed so the demangled
-           * field is still NULL. Try to
-           * do the job ourselves based on the "name" field
-           * in the SOM record. A complication here is that
-           * the name field contains only the function name
-           * (like "f"), whereas we want the class qualification
-           * (as in "c::f"). Try to reconstruct that.
-           */          
-          char * basename;
-          char * classname;
-          char * dem_name;
-          basename = VT (objfile) + dn_bufp->ddocfunc.name;
-          classname = class_of(SYMBOL_TYPE(sym));
-          if (classname) {
-            dem_name = xmalloc(strlen(basename)+strlen(classname)+3);
-            strcpy(dem_name, classname);
-            strcat(dem_name, "::");
-            strcat(dem_name, basename);
-            SYMBOL_CPLUS_DEMANGLED_NAME(sym) = dem_name;
-            SYMBOL_LANGUAGE (sym) = language_cplus;
-          }
-        }
-      }
+         (strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0))
+       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+
+      if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS)
+       {
+
+         /* SYMBOL_INIT_DEMANGLED_NAME is a macro which winds up
+          * calling the demangler in libiberty (cplus_demangle()) to
+          * do the job. This generally does the job, even though
+          * it's intended for the GNU compiler and not the aCC compiler
+          * Note that SYMBOL_INIT_DEMANGLED_NAME calls the
+          * demangler with arguments DMGL_PARAMS | DMGL_ANSI.
+          * Generally, we don't want params when we display
+          * a demangled name, but when I took out the DMGL_PARAMS,
+          * some things broke, so I'm leaving it in here, and
+          * working around the issue in stack.c. - RT 
+          */
+         SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
+
+         if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
+             (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
+           {
+
+             /* Well, the symbol name is mangled, but the
+              * demangler in libiberty failed so the demangled
+              * field is still NULL. Try to
+              * do the job ourselves based on the "name" field
+              * in the SOM record. A complication here is that
+              * the name field contains only the function name
+              * (like "f"), whereas we want the class qualification
+              * (as in "c::f"). Try to reconstruct that.
+              */
+             char *basename;
+             char *classname;
+             char *dem_name;
+             basename = VT (objfile) + dn_bufp->ddocfunc.name;
+             classname = class_of (SYMBOL_TYPE (sym));
+             if (classname)
+               {
+                 dem_name = xmalloc (strlen (basename) + strlen (classname) + 3);
+                 strcpy (dem_name, classname);
+                 strcat (dem_name, "::");
+                 strcat (dem_name, basename);
+                 SYMBOL_CPLUS_DEMANGLED_NAME (sym) = dem_name;
+                 SYMBOL_LANGUAGE (sym) = language_cplus;
+               }
+           }
+       }
 
       /* Add the function symbol to the list of symbols in this blockvector */
       if (dn_bufp->ddocfunc.global)
@@ -3143,69 +3197,72 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * So I made it C/C++ specific. - RT
        */
       if (dn_bufp->ddocfunc.language == HP_LANGUAGE_C ||
-          dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) {
-        while (dn_bufp->dblock.kind != DNTT_TYPE_BEGIN)
-         {
-         dn_bufp = hpread_get_lntt (++index, objfile);
-         if (dn_bufp->dblock.extension)
-           continue;
-         }
-        SL_INDEX (objfile) = hpread_record_lines (current_subfile,
-                                                 SL_INDEX (objfile),
-                                                 dn_bufp->dbegin.address,
-                                                 objfile, offset);
-        SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile);
-      }
+         dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS)
+       {
+         while (dn_bufp->dblock.kind != DNTT_TYPE_BEGIN)
+           {
+             dn_bufp = hpread_get_lntt (++index, objfile);
+             if (dn_bufp->dblock.extension)
+               continue;
+           }
+         SL_INDEX (objfile) = hpread_record_lines (current_subfile,
+                                                   SL_INDEX (objfile),
+                                                   dn_bufp->dbegin.address,
+                                                   objfile, offset);
+         SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile);
+       }
       record_line (current_subfile, SYMBOL_LINE (sym), valu);
       break;
 
     case DNTT_TYPE_BEGIN:
       /* Begin a new scope. */
-      if (context_stack_depth == 1 /* this means we're at function level */ &&
-          context_stack[0].name != NULL /* this means it's a function */ &&
-          context_stack[0].depth == 0 /* this means it's the first BEGIN 
-                                         we've seen after the FUNCTION */ 
-         )
-      {
-        /* This is the first BEGIN after a FUNCTION.
-         * We ignore this one, since HP compilers always insert
-         * at least one BEGIN, i.e. it's:
-         * 
-         *     FUNCTION
-         *     argument symbols
-         *     BEGIN
-         *     local symbols
-         *        (possibly nested BEGIN ... END's if there are inner { } blocks)
-         *     END
-         *     END
-         *
-         * By ignoring this first BEGIN, the local symbols get treated
-         * as belonging to the function scope, and "print func::local_sym"
-         * works (which is what we want).
-         */
-
-        /* All we do here is increase the depth count associated with
-         * the FUNCTION entry in the context stack. This ensures that
-         * the next BEGIN we see (if any), representing a real nested { }
-         * block, will get processed.
-         */ 
-
-         context_stack[0].depth++;
-
-      } else { 
-
-        /* Record lines up to this SLT pointer. */
-        SL_INDEX (objfile) = hpread_record_lines (current_subfile,
-                                                 SL_INDEX (objfile),
-                                                 dn_bufp->dbegin.address,
-                                                 objfile, offset);
-        /* Calculate start address of new scope */
-        valu = hpread_get_location (dn_bufp->dbegin.address, objfile);
-        valu += offset;                /* Relocate for dynamic loading */
-        /* We use the scope start DNTT index as nesting depth identifier! */
-        desc = hpread_get_scope_start (dn_bufp->dbegin.address, objfile);
-        new = push_context (desc, valu);
-      }
+      if (context_stack_depth == 1 /* this means we're at function level */  &&
+         context_stack[0].name != NULL /* this means it's a function */  &&
+         context_stack[0].depth == 0   /* this means it's the first BEGIN 
+                                          we've seen after the FUNCTION */
+       )
+       {
+         /* This is the first BEGIN after a FUNCTION.
+          * We ignore this one, since HP compilers always insert
+          * at least one BEGIN, i.e. it's:
+          * 
+          *     FUNCTION
+          *     argument symbols
+          *     BEGIN
+          *     local symbols
+          *        (possibly nested BEGIN ... END's if there are inner { } blocks)
+          *     END
+          *     END
+          *
+          * By ignoring this first BEGIN, the local symbols get treated
+          * as belonging to the function scope, and "print func::local_sym"
+          * works (which is what we want).
+          */
+
+         /* All we do here is increase the depth count associated with
+          * the FUNCTION entry in the context stack. This ensures that
+          * the next BEGIN we see (if any), representing a real nested { }
+          * block, will get processed.
+          */
+
+         context_stack[0].depth++;
+
+       }
+      else
+       {
+
+         /* Record lines up to this SLT pointer. */
+         SL_INDEX (objfile) = hpread_record_lines (current_subfile,
+                                                   SL_INDEX (objfile),
+                                                   dn_bufp->dbegin.address,
+                                                   objfile, offset);
+         /* Calculate start address of new scope */
+         valu = hpread_get_location (dn_bufp->dbegin.address, objfile);
+         valu += offset;       /* Relocate for dynamic loading */
+         /* We use the scope start DNTT index as nesting depth identifier! */
+         desc = hpread_get_scope_start (dn_bufp->dbegin.address, objfile);
+         new = push_context (desc, valu);
+       }
       break;
 
     case DNTT_TYPE_END:
@@ -3228,22 +3285,22 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        {
        case DNTT_TYPE_MODULE:
          /* Ending a module ends the symbol table for that module.  
-           * Calling end_symtab() has the side effect of clearing the
-           * last_source_file pointer, which in turn signals 
-           * process_one_debug_symbol() to treat the next DNTT_TYPE_SRCFILE
-           * record as a module-begin.
-           */
+          * Calling end_symtab() has the side effect of clearing the
+          * last_source_file pointer, which in turn signals 
+          * process_one_debug_symbol() to treat the next DNTT_TYPE_SRCFILE
+          * record as a module-begin.
+          */
          valu = text_offset + text_size + offset;
 
-          /* Tell our caller that we're done with expanding the
-           * debug information for a module.
-           */
-          *at_module_boundary_p = 1;
+         /* Tell our caller that we're done with expanding the
+          * debug information for a module.
+          */
+         *at_module_boundary_p = 1;
+
+         /* Don't do this, as our caller will do it!
 
-          /* Don't do this, as our caller will do it!
-           *
-           *     (void) end_symtab (valu, objfile, 0);
-           */
+          *      (void) end_symtab (valu, objfile, 0);
+          */
          break;
 
        case DNTT_TYPE_FUNCTION:
@@ -3251,63 +3308,65 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
          dn_temp = hpread_get_lntt (dn_bufp->dend.beginscope.dnttp.index,
                                     objfile);
          valu = dn_temp->dfunc.hiaddr + offset;
-          /* Insert func params into local list */ 
-          merge_symbol_lists (&param_symbols, &local_symbols);
+         /* Insert func params into local list */
+         merge_symbol_lists (&param_symbols, &local_symbols);
          new = pop_context ();
          /* Make a block for the local symbols within.  */
          finish_block (new->name, &local_symbols, new->old_blocks,
                        new->start_addr, valu, objfile);
-         WITHIN_FUNCTION (objfile) = 0; /* This may have to change for Pascal */ 
-          local_symbols = new->locals;
-          param_symbols = new->params;
+         WITHIN_FUNCTION (objfile) = 0;        /* This may have to change for Pascal */
+         local_symbols = new->locals;
+         param_symbols = new->params;
          break;
 
        case DNTT_TYPE_BEGIN:
-          if (context_stack_depth == 1 &&
-              context_stack[0].name != NULL &&
-              context_stack[0].depth == 1)         
-          {
-            /* This is the END corresponding to the
-             * BEGIN which we ignored - see DNTT_TYPE_BEGIN case above.
-             */
-            context_stack[0].depth--;
-          } else {
-           /* Ending a local scope.  */
-           valu = hpread_get_location (dn_bufp->dend.address, objfile);
-           /* Why in the hell is this needed?  */
-           valu += offset + 9; /* Relocate for dynamic loading */
-           new = pop_context ();
-           desc = dn_bufp->dend.beginscope.dnttp.index;
-           if (desc != new->depth)
-             complain (&lbrac_mismatch_complaint, (char *) symnum);
-
-           /* Make a block for the local symbols within.  */
-           finish_block (new->name, &local_symbols, new->old_blocks,
-                         new->start_addr, valu, objfile);
-           local_symbols = new->locals;
-           param_symbols = new->params;
-          }
+         if (context_stack_depth == 1 &&
+             context_stack[0].name != NULL &&
+             context_stack[0].depth == 1)
+           {
+             /* This is the END corresponding to the
+              * BEGIN which we ignored - see DNTT_TYPE_BEGIN case above.
+              */
+             context_stack[0].depth--;
+           }
+         else
+           {
+             /* Ending a local scope.  */
+             valu = hpread_get_location (dn_bufp->dend.address, objfile);
+             /* Why in the hell is this needed?  */
+             valu += offset + 9;       /* Relocate for dynamic loading */
+             new = pop_context ();
+             desc = dn_bufp->dend.beginscope.dnttp.index;
+             if (desc != new->depth)
+               complain (&lbrac_mismatch_complaint, (char *) symnum);
+
+             /* Make a block for the local symbols within.  */
+             finish_block (new->name, &local_symbols, new->old_blocks,
+                           new->start_addr, valu, objfile);
+             local_symbols = new->locals;
+             param_symbols = new->params;
+           }
          break;
 
-        case DNTT_TYPE_WITH:
-          /* Since we ignore the DNTT_TYPE_WITH that starts the scope,
-           * we can ignore the DNTT_TYPE_END that ends it.
-           */
+       case DNTT_TYPE_WITH:
+         /* Since we ignore the DNTT_TYPE_WITH that starts the scope,
+          * we can ignore the DNTT_TYPE_END that ends it.
+          */
          break;
 
-        case DNTT_TYPE_COMMON:
-          /* End a FORTRAN common block. We don't currently handle these */
-          complain (&hpread_unhandled_end_common_complaint);
+       case DNTT_TYPE_COMMON:
+         /* End a FORTRAN common block. We don't currently handle these */
+         complain (&hpread_unhandled_end_common_complaint);
          break;
 
-        case DNTT_TYPE_CLASS_SCOPE: 
+       case DNTT_TYPE_CLASS_SCOPE:
 
-         /* pai: FIXME Not handling nested classes for now -- must
-           * maintain a stack */
-          class_scope_name = NULL;
+         /* pai: FIXME Not handling nested classes for now -- must
+            * maintain a stack */
+         class_scope_name = NULL;
 
 #if 0
-          /* End a class scope */
+         /* End a class scope */
          valu = hpread_get_location (dn_bufp->dend.address, objfile);
          /* Why in the hell is this needed?  */
          valu += offset + 9;   /* Relocate for dynamic loading */
@@ -3323,13 +3382,13 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
 #endif
          break;
 
-        default:
-          complain (&hpread_unexpected_end_complaint);
-          break;
+       default:
+         complain (&hpread_unexpected_end_complaint);
+         break;
        }
       break;
 
-    /* DNTT_TYPE_IMPORT is not handled */
+      /* DNTT_TYPE_IMPORT is not handled */
 
     case DNTT_TYPE_LABEL:
       SYMBOL_NAMESPACE (sym) = LABEL_NAMESPACE;
@@ -3356,28 +3415,28 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
          So I've added code in hpread_read_function_type() to add fparams
          to a param_symbols list for the current context level.  These are
          then merged into local_symbols when a function end is reached.
-         pai/1997-08-11 */ 
-         
-      break; /* do nothing; handled in hpread_read_function_type() */ 
-      
-#if 0 /* Old code */ 
+         pai/1997-08-11 */
+
+      break;                   /* do nothing; handled in hpread_read_function_type() */
+
+#if 0                          /* Old code */
       if (dn_bufp->dfparam.regparam)
-        SYMBOL_CLASS (sym) = LOC_REGISTER;
+       SYMBOL_CLASS (sym) = LOC_REGISTER;
       else if (dn_bufp->dfparam.indirect)
        SYMBOL_CLASS (sym) = LOC_REF_ARG;
       else
        SYMBOL_CLASS (sym) = LOC_ARG;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (dn_bufp->dfparam.copyparam)
-        {
-          SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
+       {
+         SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
 #ifdef HPREAD_ADJUST_STACK_ADDRESS
-          SYMBOL_VALUE (sym)
-            += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
+         SYMBOL_VALUE (sym)
+           += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
 #endif
-        }
+       }
       else
-        SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
+       SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
       SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dfparam.type, objfile);
       add_symbol_to_list (sym, &fparam_symbols);
       break;
@@ -3385,7 +3444,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
 
     case DNTT_TYPE_SVAR:
       /* Static variables.  */
-      SYMBOL_CLASS (sym) = LOC_STATIC; 
+      SYMBOL_CLASS (sym) = LOC_STATIC;
 
       /* Note: There is a case that arises with globals in shared
        * libraries where we need to set the address to LOC_INDIRECT.
@@ -3396,54 +3455,55 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * in the symbol table contains a pointer to the real "g".
        * We use the storage class LOC_INDIRECT to indicate this. RT
        */
-      if (is_in_import_list (SYMBOL_NAME(sym), objfile))
-        SYMBOL_CLASS (sym) = LOC_INDIRECT;
+      if (is_in_import_list (SYMBOL_NAME (sym), objfile))
+       SYMBOL_CLASS (sym) = LOC_INDIRECT;
 
       SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location + data_offset;
       SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dsvar.type, objfile);
 
       if (dn_bufp->dsvar.global)
        add_symbol_to_list (sym, &global_symbols);
-        
+
       else if (WITHIN_FUNCTION (objfile))
        add_symbol_to_list (sym, &local_symbols);
-        
+
       else
        add_symbol_to_list (sym, &file_symbols);
 
       if (dn_bufp->dsvar.thread_specific)
-        {
-          /* Thread-local variable.
-           */
-          SYMBOL_CLASS (sym)   = LOC_THREAD_LOCAL_STATIC;
-          SYMBOL_BASEREG (sym) = CR27_REGNUM;
-
-          if( objfile->flags & OBJF_SHARED ) {
-              /*
-               * This variable is not only thread local but
-               * in a shared library.
-               *
-               * Alas, the shared lib structures are private
-               * to "somsolib.c".  But C lets us point to one.
-               */
-              struct so_list *so;
-
-              if( objfile->obj_private == NULL )
-                  error( "Internal error in reading shared library information." );
-
-              so = ((obj_private_data_t *)(objfile->obj_private))->so_info;
-              if( so == NULL )
-                  error( "Internal error in reading shared library information." );
-
-              /* Thread-locals in shared libraries do NOT have the
-               * standard offset ("data_offset"), so we re-calculate
-               * where to look for this variable, using a call-back
-               * to interpret the private shared-library data.
-               */
-              SYMBOL_VALUE_ADDRESS(sym) = dn_bufp->dsvar.location +
-                                             so_lib_thread_start_addr( so );
-          }
-        }
+       {
+         /* Thread-local variable.
+          */
+         SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC;
+         SYMBOL_BASEREG (sym) = CR27_REGNUM;
+
+         if (objfile->flags & OBJF_SHARED)
+           {
+             /*
+              * This variable is not only thread local but
+              * in a shared library.
+              *
+              * Alas, the shared lib structures are private
+              * to "somsolib.c".  But C lets us point to one.
+              */
+             struct so_list *so;
+
+             if (objfile->obj_private == NULL)
+               error ("Internal error in reading shared library information.");
+
+             so = ((obj_private_data_t *) (objfile->obj_private))->so_info;
+             if (so == NULL)
+               error ("Internal error in reading shared library information.");
+
+             /* Thread-locals in shared libraries do NOT have the
+              * standard offset ("data_offset"), so we re-calculate
+              * where to look for this variable, using a call-back
+              * to interpret the private shared-library data.
+              */
+             SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
+               so_lib_thread_start_addr (so);
+           }
+       }
       break;
 
     case DNTT_TYPE_DVAR:
@@ -3452,7 +3512,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        SYMBOL_CLASS (sym) = LOC_REGISTER;
       else
        SYMBOL_CLASS (sym) = LOC_LOCAL;
-        
+
       SYMBOL_VALUE (sym) = dn_bufp->ddvar.location;
 #ifdef HPREAD_ADJUST_STACK_ADDRESS
       SYMBOL_VALUE (sym)
@@ -3496,79 +3556,81 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
 
     case DNTT_TYPE_TAGDEF:
       {
-      int global = dn_bufp->dtag.global;
-      /* Structure, union, enum, template, or class tag definition */
-      /* We do want to process these, since a name is
-       * added to the namespace for the tag name (and if C++ class,
-       * for the typename also).
-       */
-      SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
-
-      /* The tag contains in its "type" field a pointer to the
-       * DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, DNTT_TYPE_ENUM, 
-       * DNTT_TYPE_CLASS or DNTT_TYPE_TEMPLATE
-       * record that actually defines the type.
-       */
-      SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile);
-      TYPE_NAME (sym->type) = SYMBOL_NAME (sym);
-      TYPE_TAG_NAME (sym->type) = SYMBOL_NAME (sym);
-      if (dn_bufp->dtag.global)
-       add_symbol_to_list (sym, &global_symbols);
-      else if (WITHIN_FUNCTION (objfile))
-       add_symbol_to_list (sym, &local_symbols);
-      else
-       add_symbol_to_list (sym, &file_symbols);
-
-      /* If this is a C++ class, then we additionally 
-       * need to define a typedef for the
-       * class type. E.g., so that the name "c" becomes visible as
-       * a type name when the user says "class c { ... }".
-       * In order to figure this out, we need to chase down the "type"
-       * field to get to the DNTT_TYPE_CLASS record. 
-       *
-       * We also add the typename for ENUM. Though this isn't
-       * strictly correct, it is necessary because of the debug info
-       * generated by the aCC compiler, in which we cannot
-       * distinguish between:
-       *   enum e { ... };
-       * and
-       *   typedef enum { ... } e;
-       * I.e., the compiler emits the same debug info for the above
-       * two cases, in both cases "e" appearing as a tagdef.
-       * Therefore go ahead and generate the typename so that
-       * "ptype e" will work in the above cases.
-       *
-       * We also add the typename for TEMPLATE, so as to allow "ptype t"
-       * when "t" is a template name. 
-       */
-      if (dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile))
-        dn_bufp = hpread_get_lntt (dn_bufp->dtag.type.dnttp.index, objfile);
-      else {
-        complain (&hpread_tagdef_complaint);
-        return;
-      }
-      if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS ||
-          dn_bufp->dblock.kind == DNTT_TYPE_ENUM ||
-          dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE) {
-        struct symbol *newsym;
-        
-        newsym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
-                                                 sizeof (struct symbol));
-        memset (newsym, 0, sizeof (struct symbol));
-        SYMBOL_NAME (newsym) = name;
-        SYMBOL_LANGUAGE (newsym) = language_auto;
-        SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE;
-        SYMBOL_LINE (newsym) = 0;
-        SYMBOL_VALUE (newsym) = 0;
-        SYMBOL_CLASS (newsym) = LOC_TYPEDEF;
-        SYMBOL_TYPE (newsym) = sym->type;
-        if (global)
-         add_symbol_to_list (newsym, &global_symbols);
-        else if (WITHIN_FUNCTION (objfile))
-         add_symbol_to_list (newsym, &local_symbols);
-        else
-         add_symbol_to_list (newsym, &file_symbols);
-      }
+       int global = dn_bufp->dtag.global;
+       /* Structure, union, enum, template, or class tag definition */
+       /* We do want to process these, since a name is
+        * added to the namespace for the tag name (and if C++ class,
+        * for the typename also).
+        */
+       SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+
+       /* The tag contains in its "type" field a pointer to the
+        * DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, DNTT_TYPE_ENUM, 
+        * DNTT_TYPE_CLASS or DNTT_TYPE_TEMPLATE
+        * record that actually defines the type.
+        */
+       SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile);
+       TYPE_NAME (sym->type) = SYMBOL_NAME (sym);
+       TYPE_TAG_NAME (sym->type) = SYMBOL_NAME (sym);
+       if (dn_bufp->dtag.global)
+         add_symbol_to_list (sym, &global_symbols);
+       else if (WITHIN_FUNCTION (objfile))
+         add_symbol_to_list (sym, &local_symbols);
+       else
+         add_symbol_to_list (sym, &file_symbols);
+
+       /* If this is a C++ class, then we additionally 
+        * need to define a typedef for the
+        * class type. E.g., so that the name "c" becomes visible as
+        * a type name when the user says "class c { ... }".
+        * In order to figure this out, we need to chase down the "type"
+        * field to get to the DNTT_TYPE_CLASS record. 
+        *
+        * We also add the typename for ENUM. Though this isn't
+        * strictly correct, it is necessary because of the debug info
+        * generated by the aCC compiler, in which we cannot
+        * distinguish between:
+        *   enum e { ... };
+        * and
+        *   typedef enum { ... } e;
+        * I.e., the compiler emits the same debug info for the above
+        * two cases, in both cases "e" appearing as a tagdef.
+        * Therefore go ahead and generate the typename so that
+        * "ptype e" will work in the above cases.
+        *
+        * We also add the typename for TEMPLATE, so as to allow "ptype t"
+        * when "t" is a template name. 
+        */
+       if (dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile))
+         dn_bufp = hpread_get_lntt (dn_bufp->dtag.type.dnttp.index, objfile);
+       else
+         {
+           complain (&hpread_tagdef_complaint);
+           return;
+         }
+       if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS ||
+           dn_bufp->dblock.kind == DNTT_TYPE_ENUM ||
+           dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
+         {
+           struct symbol *newsym;
+
+           newsym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+                                                   sizeof (struct symbol));
+           memset (newsym, 0, sizeof (struct symbol));
+           SYMBOL_NAME (newsym) = name;
+           SYMBOL_LANGUAGE (newsym) = language_auto;
+           SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE;
+           SYMBOL_LINE (newsym) = 0;
+           SYMBOL_VALUE (newsym) = 0;
+           SYMBOL_CLASS (newsym) = LOC_TYPEDEF;
+           SYMBOL_TYPE (newsym) = sym->type;
+           if (global)
+             add_symbol_to_list (newsym, &global_symbols);
+           else if (WITHIN_FUNCTION (objfile))
+             add_symbol_to_list (newsym, &local_symbols);
+           else
+             add_symbol_to_list (newsym, &file_symbols);
+         }
       }
       break;
 
@@ -3630,9 +3692,9 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        */
       break;
 
-    /* DNTT_TYPE_VARIANT is not handled by GDB */
+      /* DNTT_TYPE_VARIANT is not handled by GDB */
 
-    /* DNTT_TYPE_FILE is not handled by GDB */
+      /* DNTT_TYPE_FILE is not handled by GDB */
 
     case DNTT_TYPE_FUNCTYPE:
       /* Function type */
@@ -3654,10 +3716,10 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
       complain (&hpread_unhandled_common_complaint);
       break;
 
-    /* DNTT_TYPE_COBSTRUCT is not handled by GDB.  */
-    /* DNTT_TYPE_XREF is not handled by GDB.  */
-    /* DNTT_TYPE_SA is not handled by GDB.  */
-    /* DNTT_TYPE_MACRO is not handled by GDB */
+      /* DNTT_TYPE_COBSTRUCT is not handled by GDB.  */
+      /* DNTT_TYPE_XREF is not handled by GDB.  */
+      /* DNTT_TYPE_SA is not handled by GDB.  */
+      /* DNTT_TYPE_MACRO is not handled by GDB */
 
     case DNTT_TYPE_BLOCKDATA:
       /* Not sure what this is - part of FORTRAN support maybe? 
@@ -3693,16 +3755,16 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
 
       dn_temp = hpread_get_lntt (dn_bufp->dclass_scope.type.dnttp.index, objfile);
       if (dn_temp->dblock.kind == DNTT_TYPE_TAGDEF)
-        class_scope_name = VT (objfile) + dn_temp->dtag.name;
+       class_scope_name = VT (objfile) + dn_temp->dtag.name;
       else
-        class_scope_name = NULL;
+       class_scope_name = NULL;
 
 #if 0
 
       /* Begin a new scope.  */
       SL_INDEX (objfile) = hpread_record_lines (current_subfile,
                                                SL_INDEX (objfile),
-                                               dn_bufp->dclass_scope.address,
+                                             dn_bufp->dclass_scope.address,
                                                objfile, offset);
       valu = hpread_get_location (dn_bufp->dclass_scope.address, objfile);
       valu += offset;          /* Relocate for dynamic loading */
@@ -3775,7 +3837,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        * info. DDE only uses it in "describe". We may later want
        * to extend GDB's "ptype" to give this info, but for now
        * it seems safe enough to ignore it.
-       */  
+       */
       break;
 
     case DNTT_TYPE_MODIFIER:
@@ -3835,12 +3897,12 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        */
       break;
 
-    /* DNTT_TYPE_DYN_ARRAY_DESC is not handled by GDB */
-    /* DNTT_TYPE_DESC_SUBRANGE is not handled by GDB */
-    /* DNTT_TYPE_BEGIN_EXT is not handled by GDB */
-    /* DNTT_TYPE_INLN is not handled by GDB */
-    /* DNTT_TYPE_INLN_LIST is not handled by GDB */
-    /* DNTT_TYPE_ALIAS is not handled by GDB */
+      /* DNTT_TYPE_DYN_ARRAY_DESC is not handled by GDB */
+      /* DNTT_TYPE_DESC_SUBRANGE is not handled by GDB */
+      /* DNTT_TYPE_BEGIN_EXT is not handled by GDB */
+      /* DNTT_TYPE_INLN is not handled by GDB */
+      /* DNTT_TYPE_INLN_LIST is not handled by GDB */
+      /* DNTT_TYPE_ALIAS is not handled by GDB */
 
     default:
       break;
@@ -3857,54 +3919,54 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
  * Return value is an integer.  0 => not a local type / name
  * positive return => type or name is local to some 
  * block or function.
- */ 
+ */
 
 
 /* elz: ATTENTION: FIXME: NOTE: WARNING!!!!
    this function now returns 0 right away. It was taking too much time
    at start up. Now, though, the local types are not handled correctly.
-*/
+ */
 
 
 static int
 hpread_get_scope_depth (dn_bufp, objfile, report_nested)
-  union dnttentry * dn_bufp;
-  struct objfile * objfile;
-  int  report_nested;
+     union dnttentry *dn_bufp;
+     struct objfile *objfile;
+     int report_nested;
 {
   register int index;
-  register union dnttentry * dn_tmp;
+  register union dnttentry *dn_tmp;
   register short depth = 0;
 /****************************/
   return 0;
 /****************************/
 
   index = (((char *) dn_bufp) - LNTT (objfile)) / (sizeof (struct dntt_type_block));
-  
+
   while (--index >= 0)
     {
       dn_tmp = hpread_get_lntt (index, objfile);
       switch (dn_tmp->dblock.kind)
-        {
-          case DNTT_TYPE_MODULE:
-            return depth;
-          case DNTT_TYPE_END:
-            /* index is signed int; dnttp.index is 29-bit unsigned int! */
-            index = (int) dn_tmp->dend.beginscope.dnttp.index;
-            break;
-          case DNTT_TYPE_BEGIN:
-          case DNTT_TYPE_FUNCTION:
-          case DNTT_TYPE_DOC_FUNCTION:
-          case DNTT_TYPE_WITH:   
-          case DNTT_TYPE_COMMON: 
-          case DNTT_TYPE_CLASS_SCOPE:
-            depth++;
-            if (report_nested)
-              return 1;
-            break;
-          default:
-            break;
-        }
+       {
+       case DNTT_TYPE_MODULE:
+         return depth;
+       case DNTT_TYPE_END:
+         /* index is signed int; dnttp.index is 29-bit unsigned int! */
+         index = (int) dn_tmp->dend.beginscope.dnttp.index;
+         break;
+       case DNTT_TYPE_BEGIN:
+       case DNTT_TYPE_FUNCTION:
+       case DNTT_TYPE_DOC_FUNCTION:
+       case DNTT_TYPE_WITH:
+       case DNTT_TYPE_COMMON:
+       case DNTT_TYPE_CLASS_SCOPE:
+         depth++;
+         if (report_nested)
+           return 1;
+         break;
+       default:
+         break;
+       }
     }
   return depth;
 }
@@ -3912,17 +3974,17 @@ hpread_get_scope_depth (dn_bufp, objfile, report_nested)
 /* Adjust the bitoffsets for all fields of an anonymous union of
    type TYPE by negative BITS.  This handles HP aCC's hideous habit
    of giving members of anonymous unions bit offsets relative to the
-   enclosing structure instead of relative to the union itself. */  
+   enclosing structure instead of relative to the union itself. */
 
 static void
 hpread_adjust_bitoffsets (type, bits)
-  struct type * type;
-  int bits;
+     struct type *type;
+     int bits;
 {
   register int i;
 
   /* This is done only for unions; caller had better check that
-     it is an anonymous one. */ 
+     it is an anonymous one. */
   if (TYPE_CODE (type) != TYPE_CODE_UNION)
     return;
 
@@ -3944,7 +4006,7 @@ hpread_adjust_bitoffsets (type, bits)
 
    This function does a "next" in the chain of FIELD entries, but transparently
    skips over anonymous unions' fields (recursively).
-   
+
    Inputs are the number of times to do "next" at the top level, the dnttpointer
    (FIELD) and entry pointer (FIELDP) for the dntt record corresponding to it,
    and the ubiquitous objfile parameter. (Note: FIELDP is a **.)  Return value
@@ -3952,17 +4014,17 @@ hpread_adjust_bitoffsets (type, bits)
 
 static dnttpointer
 hpread_get_next_skip_over_anon_unions (skip_fields, field, fieldp, objfile)
-  int skip_fields;
-  dnttpointer field;
-  union dnttentry ** fieldp;
-  struct objfile * objfile;
+     int skip_fields;
+     dnttpointer field;
+     union dnttentry **fieldp;
+     struct objfile *objfile;
 {
-  struct type * anon_type;
+  struct type *anon_type;
   register int i;
   int bitoffset;
-  char * name;
+  char *name;
 
-  for (i=0; i < skip_fields; i++)
+  for (i = 0; i < skip_fields; i++)
     {
       /* Get type of item we're looking at now; recursively processes the types
          of these intermediate items we skip over, so they aren't lost. */
@@ -3970,19 +4032,17 @@ hpread_get_next_skip_over_anon_unions (skip_fields, field, fieldp, objfile)
       anon_type = CHECK_TYPEDEF (anon_type);
       bitoffset = (*fieldp)->dfield.bitoffset;
       name = VT (objfile) + (*fieldp)->dfield.name;
-      /* First skip over one item to avoid stack death on recursion */ 
+      /* First skip over one item to avoid stack death on recursion */
       field = (*fieldp)->dfield.nextfield;
       *fieldp = hpread_get_lntt (field.dnttp.index, objfile);
       /* Do we have another anonymous union? If so, adjust the bitoffsets
          of its members and skip over its members. */
       if ((TYPE_CODE (anon_type) == TYPE_CODE_UNION) &&
-          (!name || STREQ (name, "")))
-        {
-          hpread_adjust_bitoffsets (anon_type, bitoffset);
-          field = hpread_get_next_skip_over_anon_unions (TYPE_NFIELDS (anon_type), field, fieldp, objfile);
-        }
+         (!name || STREQ (name, "")))
+       {
+         hpread_adjust_bitoffsets (anon_type, bitoffset);
+         field = hpread_get_next_skip_over_anon_unions (TYPE_NFIELDS (anon_type), field, fieldp, objfile);
+       }
     }
   return field;
 }
-
-
index e3ee41b95434a75df24494ec1ad8722b22997fda..b6a6624e700dc8ec47556690966862b3f3d3bf48 100644 (file)
@@ -1,21 +1,22 @@
 /* HP/UX native interface for HP 300's, for GDB when running under Unix.
    Copyright 1986, 1987, 1989, 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 file is part of GDB.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is free software; you can 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.
 
-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 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"
@@ -46,25 +47,29 @@ store_inferior_register PARAMS ((int, unsigned int));
 /* Get kernel_u_addr using HPUX-style nlist().  */
 CORE_ADDR kernel_u_addr;
 
-struct hpnlist {
-        char *          n_name;
-        long            n_value;
-        unsigned char   n_type;
-        unsigned char   n_length;
-        short           n_almod;
-        short           n_unused;
-};
-static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }};
+struct hpnlist
+  {
+    char *n_name;
+    long n_value;
+    unsigned char n_type;
+    unsigned char n_length;
+    short n_almod;
+    short n_unused;
+  };
+static struct hpnlist nl[] =
+{
+  {"_u", -1,},
+  {(char *) 0,}};
 
 /* read the value of the u area from the hp-ux kernel */
 void
 _initialize_hp300ux_nat ()
 {
 #ifndef HPUX_VERSION_5
-    nlist ("/hp-ux", nl);
-    kernel_u_addr = nl[0].n_value;
+  nlist ("/hp-ux", nl);
+  kernel_u_addr = nl[0].n_value;
 #else /* HPUX version 5.  */
-    kernel_u_addr = (CORE_ADDR) 0x0097900;
+  kernel_u_addr = (CORE_ADDR) 0x0097900;
 #endif
 }
 
@@ -82,20 +87,25 @@ fetch_inferior_register (regno, regaddr)
 #ifndef HPUX_VERSION_5
   if (regno == PS_REGNUM)
     {
-      union { int i; short s[2]; } ps_val;
+      union
+       {
+         int i;
+         short s[2];
+       }
+      ps_val;
       int regval;
-      
+
       ps_val.i = (ptrace (PT_RUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
                          0, 0));
       regval = ps_val.s[0];
-      supply_register (regno, (char *)&regval);
+      supply_register (regno, (char *) &regval);
     }
   else
 #endif /* not HPUX_VERSION_5 */
     {
       char buf[MAX_REGISTER_RAW_SIZE];
       register int i;
-      
+
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
        {
          *(int *) &buf[i] = ptrace (PT_RUAREA, inferior_pid,
@@ -121,7 +131,7 @@ store_inferior_register_1 (regno, regaddr, val)
   if (errno != 0)
     {
       char string_buf[64];
-      
+
       sprintf (string_buf, "writing register number %d", regno);
       perror_with_name (string_buf);
     }
@@ -137,8 +147,13 @@ store_inferior_register (regno, regaddr)
 #ifndef HPUX_VERSION_5
   if (regno == PS_REGNUM)
     {
-      union { int i; short s[2]; } ps_val;
-      
+      union
+       {
+         int i;
+         short s[2];
+       }
+      ps_val;
+
       ps_val.i = (ptrace (PT_RUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
                          0, 0));
       ps_val.s[0] = (read_register (regno));
@@ -148,7 +163,7 @@ store_inferior_register (regno, regaddr)
 #endif /* not HPUX_VERSION_5 */
     {
       register int i;
-      
+
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
        {
          store_inferior_register_1
@@ -166,7 +181,7 @@ fetch_inferior_registers (regno)
 {
   struct user u;
   register unsigned int ar0_offset;
-  
+
   ar0_offset = (INFERIOR_AR0 (u));
   if (regno == -1)
     {
@@ -198,7 +213,7 @@ store_inferior_registers (regno)
       store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
       return;
     }
-  
+
   ar0_offset = (INFERIOR_AR0 (u));
   if (regno >= 0)
     {
index 288f0853f4cc3b4961f60bef41b5316bb47bdabd..82ac67b4c22f8b21e0df1c909ba5aa1f65cc501a 100644 (file)
@@ -5,21 +5,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -46,7 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #else
 #endif
 
-/*#include <sys/user.h>                After a.out.h  */
+/*#include <sys/user.h>         After a.out.h  */
 #include <sys/file.h>
 #include "gdb_stat.h"
 #include "wait.h"
@@ -64,7 +65,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    that threads have. */
 #define THREAD_INITIAL_FRAME_SYMBOL  "__pthread_exit"
 #define THREAD_INITIAL_FRAME_SYM_LEN  sizeof(THREAD_INITIAL_FRAME_SYMBOL)
+
 static int extract_5_load PARAMS ((unsigned int));
 
 static unsigned extract_5R_store PARAMS ((unsigned int));
@@ -129,16 +130,18 @@ static void pa_register_look_aside PARAMS ((char *, int, long *));
 static void pa_print_fp_reg PARAMS ((int));
 static void pa_strcat_fp_reg PARAMS ((int, GDB_FILE *, enum precision_type));
 
-typedef struct {
-  struct minimal_symbol * msym;
-  CORE_ADDR solib_handle;
-} args_for_find_stub;
+typedef struct
+  {
+    struct minimal_symbol *msym;
+    CORE_ADDR solib_handle;
+  }
+args_for_find_stub;
 
 static CORE_ADDR cover_find_stub_with_shl_get PARAMS ((args_for_find_stub *));
 
-static int is_pa_2 = 0;  /* False */
+static int is_pa_2 = 0;                /* False */
 
-/* This is declared in symtab.c; set to 1 in hp-symtab-read.c */ 
+/* This is declared in symtab.c; set to 1 in hp-symtab-read.c */
 extern int hp_som_som_object_present;
 
 /* In breakpoint.c */
@@ -146,7 +149,7 @@ extern int exception_catchpoints_are_fragile;
 
 /* This is defined in valops.c. */
 extern value_ptr
-find_function_in_inferior PARAMS((char *));
+  find_function_in_inferior PARAMS ((char *));
 
 /* Should call_function allocate stack space for a struct return?  */
 int
@@ -156,8 +159,8 @@ hppa_use_struct_convention (gcc_p, type)
 {
   return (TYPE_LENGTH (type) > 8);
 }
-
 \f
+
 /* Routines to extract various sized constants out of hppa 
    instructions. */
 
@@ -168,7 +171,7 @@ static int
 sign_extend (val, bits)
      unsigned val, bits;
 {
-  return (int)(val >> (bits - 1) ? (-1 << bits) | val : val);
+  return (int) (val >> (bits - 1) ? (-1 << bits) | val : val);
 }
 
 /* For many immediate values the sign bit is the low bit! */
@@ -177,7 +180,7 @@ static int
 low_sign_extend (val, bits)
      unsigned val, bits;
 {
-  return (int)((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1);
+  return (int) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1);
 }
 
 /* extract the immediate field from a ld{bhw}s instruction */
@@ -229,8 +232,8 @@ extract_5_store (word)
   return low_sign_extend (word & MASK_5, 5);
 }
 
-#endif /* 0 */
-       
+#endif /* 0 */
+
 /* extract the immediate field from a break instruction */
 
 static unsigned
@@ -280,7 +283,7 @@ deposit_14 (opnd, word)
 {
   unsigned sign = (opnd < 0 ? 1 : 0);
 
-  return word | ((unsigned)opnd << 1 & MASK_14)  | sign;
+  return word | ((unsigned) opnd << 1 & MASK_14) | sign;
 }
 
 /* extract a 21 bit constant */
@@ -346,10 +349,10 @@ unsigned int
 deposit_17 (opnd, word)
      unsigned opnd, word;
 {
-  word |= GET_FIELD (opnd, 15 + 0, 15 + 0); /* w */
-  word |= GET_FIELD (opnd, 15 + 1, 15 + 5) << 16; /* w1 */
-  word |= GET_FIELD (opnd, 15 + 6, 15 + 6) << 2; /* w2[10] */
-  word |= GET_FIELD (opnd, 15 + 7, 15 + 16) << 3; /* w2[0..9] */
+  word |= GET_FIELD (opnd, 15 + 0, 15 + 0);    /* w */
+  word |= GET_FIELD (opnd, 15 + 1, 15 + 5) << 16;      /* w1 */
+  word |= GET_FIELD (opnd, 15 + 6, 15 + 6) << 2;       /* w2[10] */
+  word |= GET_FIELD (opnd, 15 + 7, 15 + 16) << 3;      /* w2[0..9] */
 
   return word;
 }
@@ -409,17 +412,17 @@ internalize_unwinds (objfile, table, section, entries, size, text_offset)
       bfd_get_section_contents (objfile->obfd, section, buf, 0, size);
 
       /* Now internalize the information being careful to handle host/target
-        endian issues.  */
+         endian issues.  */
       for (i = 0; i < entries; i++)
        {
          table[i].region_start = bfd_get_32 (objfile->obfd,
-                                             (bfd_byte *)buf);
+                                             (bfd_byte *) buf);
          table[i].region_start += text_offset;
          buf += 4;
-         table[i].region_end = bfd_get_32 (objfile->obfd, (bfd_byte *)buf);
+         table[i].region_end = bfd_get_32 (objfile->obfd, (bfd_byte *) buf);
          table[i].region_end += text_offset;
          buf += 4;
-         tmp = bfd_get_32 (objfile->obfd, (bfd_byte *)buf);
+         tmp = bfd_get_32 (objfile->obfd, (bfd_byte *) buf);
          buf += 4;
          table[i].Cannot_unwind = (tmp >> 31) & 0x1;
          table[i].Millicode = (tmp >> 30) & 0x1;
@@ -445,7 +448,7 @@ internalize_unwinds (objfile, table, section, entries, size, text_offset)
          table[i].Save_MRP_in_frame = (tmp >> 2) & 0x1;
          table[i].extn_ptr_defined = (tmp >> 1) & 0x1;
          table[i].Cleanup_defined = tmp & 0x1;
-         tmp = bfd_get_32 (objfile->obfd, (bfd_byte *)buf);
+         tmp = bfd_get_32 (objfile->obfd, (bfd_byte *) buf);
          buf += 4;
          table[i].MPE_XL_interrupt_marker = (tmp >> 31) & 0x1;
          table[i].HP_UX_interrupt_marker = (tmp >> 30) & 0x1;
@@ -454,7 +457,7 @@ internalize_unwinds (objfile, table, section, entries, size, text_offset)
          table[i].reserved4 = (tmp >> 27) & 0x1;
          table[i].Total_frame_size = tmp & 0x7ffffff;
 
-          /* Stub unwinds are handled elsewhere. */
+         /* Stub unwinds are handled elsewhere. */
          table[i].stub_unwind.stub_type = 0;
          table[i].stub_unwind.padding = 0;
        }
@@ -480,8 +483,8 @@ read_unwind_info (objfile)
   obj_private_data_t *obj_private;
 
   text_offset = ANOFFSET (objfile->section_offsets, 0);
-  ui = (struct obj_unwind_info *)obstack_alloc (&objfile->psymbol_obstack,
-                                               sizeof (struct obj_unwind_info));
+  ui = (struct obj_unwind_info *) obstack_alloc (&objfile->psymbol_obstack,
+                                          sizeof (struct obj_unwind_info));
 
   ui->table = NULL;
   ui->cache = NULL;
@@ -507,8 +510,8 @@ read_unwind_info (objfile)
 
   if (elf_unwind_sec)
     {
-      elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec); /* purecov: deadcode */
-      elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE; /* purecov: deadcode */
+      elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec);      /* purecov: deadcode */
+      elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE;                /* purecov: deadcode */
     }
   else
     {
@@ -534,7 +537,7 @@ read_unwind_info (objfile)
   /* Allocate memory for the unwind table.  */
   ui->table = (struct unwind_table_entry *)
     obstack_alloc (&objfile->psymbol_obstack, total_size);
-   ui->last = total_entries - 1;
+  ui->last = total_entries - 1;
 
   /* Internalize the standard unwind entries.  */
   index = 0;
@@ -568,11 +571,11 @@ read_unwind_info (objfile)
          ui->table[index].region_start += text_offset;
          buf += 4;
          ui->table[index].stub_unwind.stub_type = bfd_get_8 (objfile->obfd,
-                                                              (bfd_byte *) buf);
+                                                         (bfd_byte *) buf);
          buf += 2;
          ui->table[index].region_end
-           = ui->table[index].region_start + 4 * 
-             (bfd_get_16 (objfile->obfd, (bfd_byte *) buf) - 1);
+           = ui->table[index].region_start + 4 *
+           (bfd_get_16 (objfile->obfd, (bfd_byte *) buf) - 1);
          buf += 2;
        }
 
@@ -583,17 +586,17 @@ read_unwind_info (objfile)
         compare_unwind_entries);
 
   /* Keep a pointer to the unwind information.  */
-  if(objfile->obj_private == NULL)
+  if (objfile->obj_private == NULL)
     {
       obj_private = (obj_private_data_t *)
-       obstack_alloc(&objfile->psymbol_obstack,
-                     sizeof(obj_private_data_t));
+       obstack_alloc (&objfile->psymbol_obstack,
+                      sizeof (obj_private_data_t));
       obj_private->unwind_info = NULL;
-      obj_private->so_info     = NULL;
-      
+      obj_private->so_info = NULL;
+
       objfile->obj_private = (PTR) obj_private;
     }
-  obj_private = (obj_private_data_t *)objfile->obj_private; 
+  obj_private = (obj_private_data_t *) objfile->obj_private;
   obj_private->unwind_info = ui;
 }
 
@@ -603,7 +606,7 @@ read_unwind_info (objfile)
    search of the unwind tables, we depend upon them to be sorted.  */
 
 struct unwind_table_entry *
-find_unwind_entry(pc)
+find_unwind_entry (pc)
      CORE_ADDR pc;
 {
   int first, middle, last;
@@ -614,48 +617,48 @@ find_unwind_entry(pc)
     return NULL;
 
   ALL_OBJFILES (objfile)
-    {
-      struct obj_unwind_info *ui;
-      ui = NULL;
-      if (objfile->obj_private)
-       ui = ((obj_private_data_t *)(objfile->obj_private))->unwind_info;
+  {
+    struct obj_unwind_info *ui;
+    ui = NULL;
+    if (objfile->obj_private)
+      ui = ((obj_private_data_t *) (objfile->obj_private))->unwind_info;
 
-      if (!ui)
-       {
-         read_unwind_info (objfile);
-         if (objfile->obj_private == NULL)
-           error ("Internal error reading unwind information."); /* purecov: deadcode */
-         ui = ((obj_private_data_t *)(objfile->obj_private))->unwind_info;
-       }
+    if (!ui)
+      {
+       read_unwind_info (objfile);
+       if (objfile->obj_private == NULL)
+         error ("Internal error reading unwind information.");         /* purecov: deadcode */
+       ui = ((obj_private_data_t *) (objfile->obj_private))->unwind_info;
+      }
 
-      /* First, check the cache */
+    /* First, check the cache */
 
-      if (ui->cache
-         && pc >= ui->cache->region_start
-         && pc <= ui->cache->region_end)
-       return ui->cache;
+    if (ui->cache
+       && pc >= ui->cache->region_start
+       && pc <= ui->cache->region_end)
+      return ui->cache;
 
-      /* Not in the cache, do a binary search */
+    /* Not in the cache, do a binary search */
 
-      first = 0;
-      last = ui->last;
+    first = 0;
+    last = ui->last;
 
-      while (first <= last)
-       {
-         middle = (first + last) / 2;
-         if (pc >= ui->table[middle].region_start
-             && pc <= ui->table[middle].region_end)
-           {
-             ui->cache = &ui->table[middle];
-             return &ui->table[middle];
-           }
+    while (first <= last)
+      {
+       middle = (first + last) / 2;
+       if (pc >= ui->table[middle].region_start
+           && pc <= ui->table[middle].region_end)
+         {
+           ui->cache = &ui->table[middle];
+           return &ui->table[middle];
+         }
 
-         if (pc < ui->table[middle].region_start)
-           last = middle - 1;
-         else
-           first = middle + 1;
-       }
-    }                          /* ALL_OBJFILES() */
+       if (pc < ui->table[middle].region_start)
+         last = middle - 1;
+       else
+         first = middle + 1;
+      }
+  }                            /* ALL_OBJFILES() */
   return NULL;
 }
 
@@ -734,14 +737,14 @@ pc_in_linker_stub (pc)
        break;
 
       /* Check for ldsid (rp),r1 which is the magic instruction for a 
-        return from a cross-space function call.  */
+         return from a cross-space function call.  */
       if (read_memory_integer (pc + i * 4, 4) == 0x004010a1)
        {
          found_magic_instruction = 1;
          break;
        }
       /* Add code to handle long call/branch and argument relocation stubs
-        here.  */
+         here.  */
     }
 
   if (found_magic_instruction != 0)
@@ -756,20 +759,20 @@ pc_in_linker_stub (pc)
        break;
 
       /* Check for ldsid (rp),r1 which is the magic instruction for a 
-        return from a cross-space function call.  */
+         return from a cross-space function call.  */
       if (read_memory_integer (pc - i * 4, 4) == 0x004010a1)
        {
          found_magic_instruction = 1;
          break;
        }
       /* Add code to handle long call/branch and argument relocation stubs
-        here.  */
+         here.  */
     }
   return found_magic_instruction;
 }
 
 static int
-find_return_regnum(pc)
+find_return_regnum (pc)
      CORE_ADDR pc;
 {
   struct unwind_table_entry *u;
@@ -794,9 +797,9 @@ find_proc_framesize (pc)
   struct minimal_symbol *msym_us;
 
   /* This may indicate a bug in our callers... */
-  if (pc == (CORE_ADDR)0)
+  if (pc == (CORE_ADDR) 0)
     return -1;
-  
+
   u = find_unwind_entry (pc);
 
   if (!u)
@@ -886,7 +889,7 @@ saved_pc_after_call (frame)
 
   ret_regnum = find_return_regnum (get_frame_pc (frame));
   pc = read_register (ret_regnum) & ~0x3;
-  
+
   /* If PC is in a linker stub, then we need to dig the address
      the stub will return to out of the stack.  */
   u = find_unwind_entry (pc);
@@ -903,8 +906,8 @@ hppa_frame_saved_pc (frame)
   CORE_ADDR pc = get_frame_pc (frame);
   struct unwind_table_entry *u;
   CORE_ADDR old_pc;
-  int  spun_around_loop = 0;
-  int  rp_offset = 0;
+  int spun_around_loop = 0;
+  int rp_offset = 0;
 
   /* BSD, HPUX & OSF1 all lay out the hardware state in the same manner
      at the base of the frame in an interrupt handler.  Registers within
@@ -930,10 +933,10 @@ hppa_frame_saved_pc (frame)
       ret_regnum = find_return_regnum (pc);
 
       /* If the next frame is an interrupt frame or a signal
-        handler caller, then we need to look in the saved
-        register area to get the return pointer (the values
-        in the registers may not correspond to anything useful).  */
-      if (frame->next 
+         handler caller, then we need to look in the saved
+         register area to get the return pointer (the values
+         in the registers may not correspond to anything useful).  */
+      if (frame->next
          && (frame->next->signal_handler_caller
              || pc_in_interrupt_handler (frame->next->pc)))
        {
@@ -945,9 +948,9 @@ hppa_frame_saved_pc (frame)
              pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3;
 
              /* Syscalls are really two frames.  The syscall stub itself
-                with a return pointer in %rp and the kernel call with
-                a return pointer in %r31.  We return the %rp variant
-                if %r31 is the same as frame->pc.  */
+                with a return pointer in %rp and the kernel call with
+                a return pointer in %r31.  We return the %rp variant
+                if %r31 is the same as frame->pc.  */
              if (pc == frame->pc)
                pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3;
            }
@@ -960,14 +963,14 @@ hppa_frame_saved_pc (frame)
   else
     {
       spun_around_loop = 0;
-      old_pc           = pc;
+      old_pc = pc;
 
-restart:
+    restart:
       rp_offset = rp_saved (pc);
 
       /* Similar to code in frameless function case.  If the next
-        frame is a signal or interrupt handler, then dig the right
-        information out of the saved register info.  */
+         frame is a signal or interrupt handler, then dig the right
+         information out of the saved register info.  */
       if (rp_offset == 0
          && frame->next
          && (frame->next->signal_handler_caller
@@ -981,9 +984,9 @@ restart:
              pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3;
 
              /* Syscalls are really two frames.  The syscall stub itself
-                with a return pointer in %rp and the kernel call with
-                a return pointer in %r31.  We return the %rp variant
-                if %r31 is the same as frame->pc.  */
+                with a return pointer in %rp and the kernel call with
+                a return pointer in %r31.  We return the %rp variant
+                if %r31 is the same as frame->pc.  */
              if (pc == frame->pc)
                pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3;
            }
@@ -991,15 +994,15 @@ restart:
            pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3;
        }
       else if (rp_offset == 0)
-        {
-          old_pc = pc;
-          pc = read_register (RP_REGNUM) & ~0x3;
-        }
+       {
+         old_pc = pc;
+         pc = read_register (RP_REGNUM) & ~0x3;
+       }
       else
-        {
-          old_pc = pc;
-          pc = read_memory_integer (frame->frame + rp_offset, 4) & ~0x3;
-        }
+       {
+         old_pc = pc;
+         pc = read_memory_integer (frame->frame + rp_offset, 4) & ~0x3;
+       }
     }
 
   /* If PC is inside a linker stub, then dig out the address the stub
@@ -1014,28 +1017,28 @@ restart:
       unsigned int insn;
 
       /* If this is a dynamic executable, and we're in a signal handler,
-        then the call chain will eventually point us into the stub for
-        _sigreturn.  Unlike most cases, we'll be pointed to the branch
-        to the real sigreturn rather than the code after the real branch!. 
+         then the call chain will eventually point us into the stub for
+         _sigreturn.  Unlike most cases, we'll be pointed to the branch
+         to the real sigreturn rather than the code after the real branch!. 
 
-        Else, try to dig the address the stub will return to in the normal
-        fashion.  */
+         Else, try to dig the address the stub will return to in the normal
+         fashion.  */
       insn = read_memory_integer (pc, 4);
       if ((insn & 0xfc00e000) == 0xe8000000)
        return (pc + extract_17 (insn) + 8) & ~0x3;
       else
        {
-        if (old_pc == pc)
-            spun_around_loop++;
-        
-        if (spun_around_loop > 1) 
-         {
-           /* We're just about to go around the loop again with
-              no more hope of success.  Die. */
-           error("Unable to find return pc for this frame");
-         }
-        else
-         goto restart;
+         if (old_pc == pc)
+           spun_around_loop++;
+
+         if (spun_around_loop > 1)
+           {
+             /* We're just about to go around the loop again with
+                no more hope of success.  Die. */
+             error ("Unable to find return pc for this frame");
+           }
+         else
+           goto restart;
        }
     }
 
@@ -1062,13 +1065,13 @@ init_extra_frame_info (fromleaf, frame)
   if (fromleaf)
     {
       /* Find the framesize of *this* frame without peeking at the PC
-        in the current frame structure (it isn't set yet).  */
+         in the current frame structure (it isn't set yet).  */
       framesize = find_proc_framesize (FRAME_SAVED_PC (get_next_frame (frame)));
 
       /* Now adjust our base frame accordingly.  If we have a frame pointer
-        use it, else subtract the size of this frame from the current
-        frame.  (we always want frame->frame to point at the lowest address
-        in the frame).  */
+         use it, else subtract the size of this frame from the current
+         frame.  (we always want frame->frame to point at the lowest address
+         in the frame).  */
       if (framesize == -1)
        frame->frame = TARGET_READ_FP ();
       else
@@ -1077,7 +1080,7 @@ init_extra_frame_info (fromleaf, frame)
     }
 
   flags = read_register (FLAGS_REGNUM);
-  if (flags & 2)       /* In system call? */
+  if (flags & 2)               /* In system call? */
     frame->pc = read_register (31) & ~0x3;
 
   /* The outermost frame is always derived from PC-framesize
@@ -1089,7 +1092,7 @@ init_extra_frame_info (fromleaf, frame)
      explain, but the parent *always* creates some stack space for
      the child.  So the child actually does have a frame of some
      sorts, and its base is the high address in its parent's frame.  */
-  framesize = find_proc_framesize(frame->pc);
+  framesize = find_proc_framesize (frame->pc);
   if (framesize == -1)
     frame->frame = TARGET_READ_FP ();
   else
@@ -1113,39 +1116,41 @@ frame_chain (frame)
   CORE_ADDR frame_base;
   struct frame_info *tmp_frame;
 
-  CORE_ADDR  caller_pc;
+  CORE_ADDR caller_pc;
 
   struct minimal_symbol *min_frame_symbol;
-  struct symbol         *frame_symbol;
-  char                  *frame_symbol_name;
+  struct symbol *frame_symbol;
+  char *frame_symbol_name;
 
   /* If this is a threaded application, and we see the
      routine "__pthread_exit", treat it as the stack root
      for this thread. */
-  min_frame_symbol  = lookup_minimal_symbol_by_pc (frame->pc);
-  frame_symbol      = find_pc_function(frame->pc);
+  min_frame_symbol = lookup_minimal_symbol_by_pc (frame->pc);
+  frame_symbol = find_pc_function (frame->pc);
 
-  if ((min_frame_symbol != 0) /* && (frame_symbol == 0) */)
+  if ((min_frame_symbol != 0) /* && (frame_symbol == 0) */ )
     {
-    /* The test above for "no user function name" would defend
-       against the slim likelihood that a user might define a
-       routine named "__pthread_exit" and then try to debug it.
-
-       If it weren't commented out, and you tried to debug the
-       pthread library itself, you'd get errors.
-      
-       So for today, we don't make that check. */
-    frame_symbol_name = SYMBOL_NAME(min_frame_symbol);
-    if (frame_symbol_name != 0) {
-      if (0 == strncmp(frame_symbol_name,
-                      THREAD_INITIAL_FRAME_SYMBOL,
-                      THREAD_INITIAL_FRAME_SYM_LEN)) {
-         /* Pretend we've reached the bottom of the stack. */
-         return (CORE_ADDR) 0;
-         }
-       }  
-    }  /* End of hacky code for threads. */
-    
+      /* The test above for "no user function name" would defend
+         against the slim likelihood that a user might define a
+         routine named "__pthread_exit" and then try to debug it.
+
+         If it weren't commented out, and you tried to debug the
+         pthread library itself, you'd get errors.
+
+         So for today, we don't make that check. */
+      frame_symbol_name = SYMBOL_NAME (min_frame_symbol);
+      if (frame_symbol_name != 0)
+       {
+         if (0 == strncmp (frame_symbol_name,
+                           THREAD_INITIAL_FRAME_SYMBOL,
+                           THREAD_INITIAL_FRAME_SYM_LEN))
+           {
+             /* Pretend we've reached the bottom of the stack. */
+             return (CORE_ADDR) 0;
+           }
+       }
+    }                          /* End of hacky code for threads. */
+
   /* Handle HPUX, BSD, and OSF1 style interrupt frames first.  These
      are easy; at *sp we have a full save state strucutre which we can
      pull the old stack pointer from.  Also see frame_saved_pc for
@@ -1164,7 +1169,7 @@ frame_chain (frame)
   /* Get frame sizes for the current frame and the frame of the 
      caller.  */
   my_framesize = find_proc_framesize (frame->pc);
-  caller_pc = FRAME_SAVED_PC(frame);
+  caller_pc = FRAME_SAVED_PC (frame);
 
   /* If we can't determine the caller's PC, then it's not likely we can
      really determine anything meaningful about its frame.  We'll consider
@@ -1172,7 +1177,7 @@ frame_chain (frame)
   if (caller_pc == (CORE_ADDR) 0)
     return (CORE_ADDR) 0;
 
-  caller_framesize = find_proc_framesize (FRAME_SAVED_PC(frame));
+  caller_framesize = find_proc_framesize (FRAME_SAVED_PC (frame));
 
   /* If caller does not have a frame pointer, then its frame
      can be found at current_frame - caller_framesize.  */
@@ -1214,10 +1219,10 @@ frame_chain (frame)
             think anyone has actually written any tools (not even "strip")
             which leave them out of an executable, so maybe this is a moot
             point.  */
-          /* ??rehrauer: Actually, it's quite possible to stepi your way into
-             code that doesn't have unwind entries.  For example, stepping into
-             the dynamic linker will give you a PC that has none.  Thus, I've
-             disabled this warning. */
+         /* ??rehrauer: Actually, it's quite possible to stepi your way into
+            code that doesn't have unwind entries.  For example, stepping into
+            the dynamic linker will give you a PC that has none.  Thus, I've
+            disabled this warning. */
 #if 0
          warning ("Unable to find unwind for PC 0x%x -- Help!", tmp_frame->pc);
 #endif
@@ -1225,7 +1230,7 @@ frame_chain (frame)
        }
 
       /* Entry_GR specifies the number of callee-saved general registers
-        saved in the stack.  It starts at %r3, so %r3 would be 1.  */
+         saved in the stack.  It starts at %r3, so %r3 would be 1.  */
       if (u->Entry_GR >= 1 || u->Save_SP
          || tmp_frame->signal_handler_caller
          || pc_in_interrupt_handler (tmp_frame->pc))
@@ -1237,7 +1242,7 @@ frame_chain (frame)
   if (tmp_frame)
     {
       /* We may have walked down the chain into a function with a frame
-        pointer.  */
+         pointer.  */
       if (u->Save_SP
          && !tmp_frame->signal_handler_caller
          && !pc_in_interrupt_handler (tmp_frame->pc))
@@ -1245,7 +1250,7 @@ frame_chain (frame)
          return read_memory_integer (tmp_frame->frame, 4);
        }
       /* %r3 was saved somewhere in the stack.  Dig it out.  */
-      else 
+      else
        {
          struct frame_saved_regs saved_regs;
 
@@ -1257,17 +1262,17 @@ frame_chain (frame)
             is usually turned off if the process is being traced so
             that the debugger can get full register state for the
             process.
-             
+
             This scheme works well except for two cases:
 
-              * Attaching to a process when the process is in the
-              kernel performing a system call (debugger can't get
-              full register state for the inferior process since
-              the process wasn't being traced when it entered the
-              system call).
+            * Attaching to a process when the process is in the
+            kernel performing a system call (debugger can't get
+            full register state for the inferior process since
+            the process wasn't being traced when it entered the
+            system call).
 
-              * Register state is not complete if the system call
-              causes the process to core dump.
+            * Register state is not complete if the system call
+            causes the process to core dump.
 
 
             The following heinous code is an attempt to deal with
@@ -1280,7 +1285,7 @@ frame_chain (frame)
          /* Abominable hack.  */
          if (current_target.to_has_execution == 0
              && ((saved_regs.regs[FLAGS_REGNUM]
-                  && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4)
+                  && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4)
                       & 0x2))
                  || (saved_regs.regs[FLAGS_REGNUM] == 0
                      && read_register (FLAGS_REGNUM) & 0x2)))
@@ -1295,7 +1300,7 @@ frame_chain (frame)
                  return frame_base - (u->Total_frame_size << 3);
                }
            }
-       
+
          return read_memory_integer (saved_regs.regs[FP_REGNUM], 4);
        }
     }
@@ -1315,26 +1320,26 @@ frame_chain (frame)
               && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4)
                   & 0x2))
              || (saved_regs.regs[FLAGS_REGNUM] == 0
-                 && read_register (FLAGS_REGNUM)  & 0x2)))
+                 && read_register (FLAGS_REGNUM) & 0x2)))
        {
          u = find_unwind_entry (FRAME_SAVED_PC (frame));
          if (!u)
            {
              return read_memory_integer (saved_regs.regs[FP_REGNUM], 4);
            }
-          else
-            {
-              return frame_base - (u->Total_frame_size << 3);
-            }
+         else
+           {
+             return frame_base - (u->Total_frame_size << 3);
+           }
        }
-       
+
       /* The value in %r3 was never saved into the stack (thus %r3 still
-        holds the value of the previous frame pointer).  */
+         holds the value of the previous frame pointer).  */
       return TARGET_READ_FP ();
     }
 }
-
 \f
+
 /* To see if a frame chain is valid, see if the caller looks like it
    was compiled with gcc. */
 
@@ -1442,10 +1447,10 @@ push_dummy_frame (inf_status)
   /* Space for "arguments"; the RP goes in here. */
   sp = read_register (SP_REGNUM) + 48;
   int_buffer = read_register (RP_REGNUM) | 0x3;
-  write_memory (sp - 20, (char *)&int_buffer, 4);
+  write_memory (sp - 20, (char *) &int_buffer, 4);
 
   int_buffer = TARGET_READ_FP ();
-  write_memory (sp, (char *)&int_buffer, 4);
+  write_memory (sp, (char *) &int_buffer, 4);
 
   write_register (FP_REGNUM, sp);
 
@@ -1459,8 +1464,8 @@ push_dummy_frame (inf_status)
 
   for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
     {
-      read_register_bytes (REGISTER_BYTE (regnum), (char *)&freg_buffer, 8);
-      sp = push_bytes (sp, (char *)&freg_buffer, 8);
+      read_register_bytes (REGISTER_BYTE (regnum), (char *) &freg_buffer, 8);
+      sp = push_bytes (sp, (char *) &freg_buffer, 8);
     }
   sp = push_word (sp, read_register (IPSW_REGNUM));
   sp = push_word (sp, read_register (SAR_REGNUM));
@@ -1517,7 +1522,7 @@ hppa_pop_frame ()
   get_frame_saved_regs (frame, &fsr);
 
 #ifndef NO_PC_SPACE_QUEUE_RESTORE
-  if (fsr.regs[IPSW_REGNUM])    /* Restoring a call dummy frame */
+  if (fsr.regs[IPSW_REGNUM])   /* Restoring a call dummy frame */
     restore_pc_queue (&fsr);
 #endif
 
@@ -1525,20 +1530,20 @@ hppa_pop_frame ()
     if (fsr.regs[regnum])
       write_register (regnum, read_memory_integer (fsr.regs[regnum], 4));
 
-  for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM ; regnum--)
+  for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
     if (fsr.regs[regnum])
       {
-       read_memory (fsr.regs[regnum], (char *)&freg_buffer, 8);
-        write_register_bytes (REGISTER_BYTE (regnum), (char *)&freg_buffer, 8);
+       read_memory (fsr.regs[regnum], (char *) &freg_buffer, 8);
+       write_register_bytes (REGISTER_BYTE (regnum), (char *) &freg_buffer, 8);
       }
 
   if (fsr.regs[IPSW_REGNUM])
     write_register (IPSW_REGNUM,
-                    read_memory_integer (fsr.regs[IPSW_REGNUM], 4));
+                   read_memory_integer (fsr.regs[IPSW_REGNUM], 4));
 
   if (fsr.regs[SAR_REGNUM])
     write_register (SAR_REGNUM,
-                    read_memory_integer (fsr.regs[SAR_REGNUM], 4));
+                   read_memory_integer (fsr.regs[SAR_REGNUM], 4));
 
   /* If the PC was explicitly saved, then just restore it.  */
   if (fsr.regs[PCOQ_TAIL_REGNUM])
@@ -1547,7 +1552,7 @@ hppa_pop_frame ()
       write_register (PCOQ_TAIL_REGNUM, npc);
     }
   /* Else use the value in %rp to set the new PC.  */
-  else 
+  else
     {
       npc = read_register (RP_REGNUM);
       write_pc (npc);
@@ -1555,7 +1560,7 @@ hppa_pop_frame ()
 
   write_register (FP_REGNUM, read_memory_integer (fp, 4));
 
-  if (fsr.regs[IPSW_REGNUM])    /* call dummy */
+  if (fsr.regs[IPSW_REGNUM])   /* call dummy */
     write_register (SP_REGNUM, fp - 48);
   else
     write_register (SP_REGNUM, fp);
@@ -1575,7 +1580,7 @@ hppa_pop_frame ()
       struct cleanup *old_chain;
 
       /* Set up our breakpoint.   Set it to be silent as the MI code
-        for "return_command" will print the frame we returned to.  */
+         for "return_command" will print the frame we returned to.  */
       sal = find_pc_line (target_pc, 0);
       sal.pc = target_pc;
       breakpoint = set_momentary_breakpoint (sal, NULL, bp_finish);
@@ -1587,7 +1592,7 @@ hppa_pop_frame ()
       /* Start up the inferior.  */
       clear_proceed_status ();
       proceed_to_finish = 1;
-      proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+      proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 0);
 
       /* Perform our cleanups.  */
       do_cleanups (old_chain);
@@ -1615,9 +1620,9 @@ restore_pc_queue (fsr)
      registers of the PC queue through ptrace. Boo, hiss.
      Conveniently, the call dummy has this sequence of instructions
      after the break:
-        mtsp r21, sr0
-        ble,n 0(sr0, r22)
-    
+     mtsp r21, sr0
+     ble,n 0(sr0, r22)
+
      So, load up the registers and single step until we are in the
      right place. */
 
@@ -1627,23 +1632,23 @@ restore_pc_queue (fsr)
   for (insn_count = 0; insn_count < 3; insn_count++)
     {
       /* FIXME: What if the inferior gets a signal right now?  Want to
-        merge this into wait_for_inferior (as a special kind of
-        watchpoint?  By setting a breakpoint at the end?  Is there
-        any other choice?  Is there *any* way to do this stuff with
-        ptrace() or some equivalent?).  */
+         merge this into wait_for_inferior (as a special kind of
+         watchpoint?  By setting a breakpoint at the end?  Is there
+         any other choice?  Is there *any* way to do this stuff with
+         ptrace() or some equivalent?).  */
       resume (1, 0);
       target_wait (inferior_pid, &w);
 
       if (w.kind == TARGET_WAITKIND_SIGNALLED)
-        {
-          stop_signal = w.value.sig;
-          terminal_ours_for_output ();
-          printf_unfiltered ("\nProgram terminated with signal %s, %s.\n",
+       {
+         stop_signal = w.value.sig;
+         terminal_ours_for_output ();
+         printf_unfiltered ("\nProgram terminated with signal %s, %s.\n",
                             target_signal_to_name (stop_signal),
                             target_signal_to_string (stop_signal));
-          gdb_flush (gdb_stdout);
-          return 0;
-        }
+         gdb_flush (gdb_stdout);
+         return 0;
+       }
     }
   target_terminal_ours ();
   target_fetch_registers (-1);
@@ -1660,19 +1665,19 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
      CORE_ADDR struct_addr;
 {
   /* array of arguments' offsets */
-  int *offset = (int *)alloca(nargs * sizeof (int));
+  int *offset = (int *) alloca (nargs * sizeof (int));
   int cum = 0;
   int i, alignment;
-  
+
   for (i = 0; i < nargs; i++)
     {
       int x = 0;
       /* cum is the sum of the lengths in bytes of
-        the arguments seen so far */
+         the arguments seen so far */
       cum += TYPE_LENGTH (VALUE_TYPE (args[i]));
 
-    /* value must go at proper alignment. Assume alignment is a
-        power of two. */
+      /* value must go at proper alignment. Assume alignment is a
+         power of two. */
       alignment = hppa_alignof (VALUE_TYPE (args[i]));
 
       if (cum % alignment)
@@ -1718,22 +1723,22 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
      CORE_ADDR struct_addr;
 {
   /* array of arguments' offsets */
-  int *offset = (int *)alloca(nargs * sizeof (int));
+  int *offset = (int *) alloca (nargs * sizeof (int));
   /* array of arguments' lengths: real lengths in bytes, not aligned to word size */
-  int *lengths = (int *)alloca(nargs * sizeof (int));
+  int *lengths = (int *) alloca (nargs * sizeof (int));
 
-  int bytes_reserved; /* this is the number of bytes on the stack occupied by an
-                         argument. This will be always a multiple of 4 */
+  int bytes_reserved;          /* this is the number of bytes on the stack occupied by an
+                                  argument. This will be always a multiple of 4 */
 
-  int cum_bytes_reserved = 0; /* this is the total number of bytes reserved by the args
-                                 seen so far. It is a multiple of 4 always */
-  int cum_bytes_aligned = 0; /* same as above, but aligned on 8 bytes */
-  int i; 
+  int cum_bytes_reserved = 0;  /* this is the total number of bytes reserved by the args
+                                  seen so far. It is a multiple of 4 always */
+  int cum_bytes_aligned = 0;   /* same as above, but aligned on 8 bytes */
+  int i;
 
   /* When an arg does not occupy a whole word, for instance in bitfields:
      if the arg is x bits (0<x<32), it must be written
      starting from the (x-1)-th position  down until the 0-th position. 
-     It is enough to align it to the word. */ 
+     It is enough to align it to the word. */
   /* if an arg occupies 8 bytes, it must be aligned on the 64-bits 
      high order word in odd arg word. */
   /* if an arg is larger than 64 bits, we need to pass a pointer to it, and
@@ -1742,36 +1747,36 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
      The argument that is received in this function here has already be converted
      to a pointer to whatever is needed, so that it just can be pushed
      as a word argument */
-  
+
   for (i = 0; i < nargs; i++)
     {
 
       lengths[i] = TYPE_LENGTH (VALUE_TYPE (args[i]));
 
       if (lengths[i] % 4)
-        bytes_reserved = (lengths[i] / 4) * 4 + 4;
-      else 
-        bytes_reserved = lengths[i];
+       bytes_reserved = (lengths[i] / 4) * 4 + 4;
+      else
+       bytes_reserved = lengths[i];
 
       offset[i] = cum_bytes_reserved + lengths[i];
 
-      if ((bytes_reserved == 8) && (offset[i] % 8)) /* if 64-bit arg is not 64 bit aligned */
-      {
-        int new_offset=0;
-        /* bytes_reserved is already aligned to the word, so we put it at one word
-           more down the stack. This will leave one empty word on the
-           stack, and one unused register. This is OK, see the calling
-           convention doc */
-        /* the offset may have to be moved to the corresponding position
-           one word down the stack, to maintain 
-           alignment. */
-        new_offset = (offset[i] / 8) * 8 + 8;
-        if ((new_offset - offset[i]) >=4) 
-        {
-         bytes_reserved += 4;
-         offset[i] += 4;
-        }
-      }
+      if ((bytes_reserved == 8) && (offset[i] % 8))    /* if 64-bit arg is not 64 bit aligned */
+       {
+         int new_offset = 0;
+         /* bytes_reserved is already aligned to the word, so we put it at one word
+            more down the stack. This will leave one empty word on the
+            stack, and one unused register. This is OK, see the calling
+            convention doc */
+         /* the offset may have to be moved to the corresponding position
+            one word down the stack, to maintain 
+            alignment. */
+         new_offset = (offset[i] / 8) * 8 + 8;
+         if ((new_offset - offset[i]) >= 4)
+           {
+             bytes_reserved += 4;
+             offset[i] += 4;
+           }
+       }
 
       cum_bytes_reserved += bytes_reserved;
 
@@ -1786,13 +1791,13 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
   /* now write each of the args at the proper offset down the stack */
   for (i = 0; i < nargs; i++)
     write_memory (sp - offset[i], VALUE_CONTENTS (args[i]), lengths[i]);
-                 
 
- /* if a structure has to be returned, set up register 28 to hold its address */
+
+  /* if a structure has to be returned, set up register 28 to hold its address */
   if (struct_return)
     write_register (28, struct_addr);
 
- /* the stack will have other 8 words on top of the args */
 /* the stack will have other 8 words on top of the args */
   return sp + 32;
 }
 
@@ -1805,7 +1810,7 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
    gets the value from the stack rather than from the buffer where all the
    registers were saved when the function called completed. */
 value_ptr
-hppa_value_returned_from_stack (valtype , addr)
+hppa_value_returned_from_stack (valtype, addr)
      register struct type *valtype;
      CORE_ADDR addr;
 {
@@ -1813,7 +1818,7 @@ hppa_value_returned_from_stack (valtype , addr)
 
   val = allocate_value (valtype);
   CHECK_TYPEDEF (valtype);
-  target_read_memory(addr, VALUE_CONTENTS_RAW (val), TYPE_LENGTH (valtype));
+  target_read_memory (addr, VALUE_CONTENTS_RAW (val), TYPE_LENGTH (valtype));
 
   return val;
 }
@@ -1821,97 +1826,97 @@ hppa_value_returned_from_stack (valtype , addr)
 
 
 /* elz: Used to lookup a symbol in the shared libraries.
- This function calls shl_findsym, indirectly through a
- call to __d_shl_get. __d_shl_get is in end.c, which is always
- linked in by the hp compilers/linkers. 
- The call to shl_findsym cannot be made directly because it needs
- to be active in target address space. 
- inputs: - minimal symbol pointer for the function we want to look up
-         - address in target space of the descriptor for the library
-           where we want to look the symbol up.
-           This address is retrieved using the 
-           som_solib_get_solib_by_pc function (somsolib.c). 
- output: - real address in the library of the function.          
- note: the handle can be null, in which case shl_findsym will look for
-       the symbol in all the loaded shared libraries.
- files to look at if you need reference on this stuff:
- dld.c, dld_shl_findsym.c
- end.c
- man entry for shl_findsym */        
  This function calls shl_findsym, indirectly through a
  call to __d_shl_get. __d_shl_get is in end.c, which is always
  linked in by the hp compilers/linkers. 
  The call to shl_findsym cannot be made directly because it needs
  to be active in target address space. 
  inputs: - minimal symbol pointer for the function we want to look up
+   - address in target space of the descriptor for the library
+   where we want to look the symbol up.
+   This address is retrieved using the 
+   som_solib_get_solib_by_pc function (somsolib.c). 
  output: - real address in the library of the function.          
  note: the handle can be null, in which case shl_findsym will look for
+   the symbol in all the loaded shared libraries.
  files to look at if you need reference on this stuff:
  dld.c, dld_shl_findsym.c
  end.c
+   man entry for shl_findsym */
 
 CORE_ADDR
-find_stub_with_shl_get(function, handle) 
-  struct minimal_symbol *function;
-  CORE_ADDR handle;
+find_stub_with_shl_get (function, handle)
+     struct minimal_symbol *function;
+     CORE_ADDR handle;
 {
- struct symbol *get_sym, *symbol2;
- struct minimal_symbol *buff_minsym, *msymbol;
- struct type *ftype;
- value_ptr *args;
- value_ptr funcval, val;
-
- int x, namelen, err_value, tmp = -1;
- CORE_ADDR endo_buff_addr, value_return_addr, errno_return_addr;
- CORE_ADDR stub_addr;
-
-
-    args           = (value_ptr *) alloca (sizeof (value_ptr) * 8);  /* 6 for the arguments and one null one??? */
-    funcval        = find_function_in_inferior("__d_shl_get");
-    get_sym        = lookup_symbol("__d_shl_get", NULL, VAR_NAMESPACE, NULL, NULL);
-    buff_minsym    = lookup_minimal_symbol("__buffer", NULL, NULL);
-    msymbol        = lookup_minimal_symbol ("__shldp", NULL, NULL);
-    symbol2 = lookup_symbol("__shldp", NULL, VAR_NAMESPACE, NULL, NULL);
-    endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
-    namelen        = strlen(SYMBOL_NAME(function));
-    value_return_addr = endo_buff_addr + namelen;
-    ftype          = check_typedef(SYMBOL_TYPE(get_sym));
-
-    /* do alignment */
-    if ((x=value_return_addr % 64) !=0)
-       value_return_addr = value_return_addr + 64 - x;
-
-    errno_return_addr = value_return_addr + 64;
-
-    
-    /* set up stuff needed by __d_shl_get in buffer in end.o */
-
-    target_write_memory(endo_buff_addr, SYMBOL_NAME(function), namelen);
-    
-    target_write_memory(value_return_addr, (char *) &tmp, 4);
-    
-    target_write_memory(errno_return_addr, (char *) &tmp, 4);
-
-    target_write_memory(SYMBOL_VALUE_ADDRESS(msymbol), 
-                        (char *)&handle, 4);
-    
-    /* now prepare the arguments for the call */
-
-    args[0] = value_from_longest (TYPE_FIELD_TYPE(ftype, 0), 12);
-    args[1] = value_from_longest (TYPE_FIELD_TYPE(ftype, 1), SYMBOL_VALUE_ADDRESS(msymbol));
-    args[2] = value_from_longest (TYPE_FIELD_TYPE(ftype, 2), endo_buff_addr);
-    args[3] = value_from_longest (TYPE_FIELD_TYPE(ftype, 3), TYPE_PROCEDURE);
-    args[4] = value_from_longest (TYPE_FIELD_TYPE(ftype, 4), value_return_addr);
-    args[5] = value_from_longest (TYPE_FIELD_TYPE(ftype, 5), errno_return_addr);
-
-    /* now call the function */
-
-    val = call_function_by_hand(funcval, 6, args);
-
-    /* now get the results */
-
-    target_read_memory(errno_return_addr, (char *) &err_value, sizeof(err_value));
-
-    target_read_memory(value_return_addr, (char *) &stub_addr, sizeof(stub_addr));
-    if (stub_addr <= 0)
-        error("call to __d_shl_get failed, error code is %d", err_value); /* purecov: deadcode */
-    
-    return(stub_addr);
 struct symbol *get_sym, *symbol2;
 struct minimal_symbol *buff_minsym, *msymbol;
 struct type *ftype;
 value_ptr *args;
 value_ptr funcval, val;
+
 int x, namelen, err_value, tmp = -1;
 CORE_ADDR endo_buff_addr, value_return_addr, errno_return_addr;
 CORE_ADDR stub_addr;
+
+
+  args = (value_ptr *) alloca (sizeof (value_ptr) * 8);                /* 6 for the arguments and one null one??? */
+  funcval = find_function_in_inferior ("__d_shl_get");
+  get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_NAMESPACE, NULL, NULL);
+  buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
+  msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
+  symbol2 = lookup_symbol ("__shldp", NULL, VAR_NAMESPACE, NULL, NULL);
+  endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
+  namelen = strlen (SYMBOL_NAME (function));
+  value_return_addr = endo_buff_addr + namelen;
+  ftype = check_typedef (SYMBOL_TYPE (get_sym));
+
+  /* do alignment */
+  if ((x = value_return_addr % 64) != 0)
+    value_return_addr = value_return_addr + 64 - x;
+
+  errno_return_addr = value_return_addr + 64;
+
+
+  /* set up stuff needed by __d_shl_get in buffer in end.o */
+
+  target_write_memory (endo_buff_addr, SYMBOL_NAME (function), namelen);
+
+  target_write_memory (value_return_addr, (char *) &tmp, 4);
+
+  target_write_memory (errno_return_addr, (char *) &tmp, 4);
+
+  target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol),
+                      (char *) &handle, 4);
+
+  /* now prepare the arguments for the call */
+
+  args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12);
+  args[1] = value_from_longest (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol));
+  args[2] = value_from_longest (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr);
+  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE);
+  args[4] = value_from_longest (TYPE_FIELD_TYPE (ftype, 4), value_return_addr);
+  args[5] = value_from_longest (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr);
+
+  /* now call the function */
+
+  val = call_function_by_hand (funcval, 6, args);
+
+  /* now get the results */
+
+  target_read_memory (errno_return_addr, (char *) &err_value, sizeof (err_value));
+
+  target_read_memory (value_return_addr, (char *) &stub_addr, sizeof (stub_addr));
+  if (stub_addr <= 0)
+    error ("call to __d_shl_get failed, error code is %d", err_value); /* purecov: deadcode */
+
+  return (stub_addr);
 }
 
-/* Cover routine for find_stub_with_shl_get to pass to catch_errors */ 
+/* Cover routine for find_stub_with_shl_get to pass to catch_errors */
 static CORE_ADDR
 cover_find_stub_with_shl_get (args)
-  args_for_find_stub * args;
+     args_for_find_stub *args;
 {
   return find_stub_with_shl_get (args->msym, args->solib_handle);
 }
@@ -1959,7 +1964,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
   CORE_ADDR solib_handle = 0;
 
   /* Nonzero if we will use GCC's PLT call routine.  This routine must be
-     passed an import stub, not a PLABEL.  It is also necessary to set %r19    
+     passed an import stub, not a PLABEL.  It is also necessary to set %r19     
      (the PIC register) before performing the call. 
 
      If zero, then we are using __d_plt_call (HP's PLT call routine) or we
@@ -1968,7 +1973,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
   int using_gcc_plt_call = 1;
 
   /* Prefer __gcc_plt_call over the HP supplied routine because
-      __gcc_plt_call works for any number of arguments.  */
+     __gcc_plt_call works for any number of arguments.  */
   trampoline = NULL;
   if (lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL) == NULL)
     using_gcc_plt_call = 0;
@@ -1985,12 +1990,12 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
   if ((fun & 0x2) && using_gcc_plt_call)
     {
       /* Get the GOT/DP value for the target function.  It's
-        at *(fun+4).  Note the call dummy is *NOT* allowed to
-        trash %r19 before calling the target function.  */
+         at *(fun+4).  Note the call dummy is *NOT* allowed to
+         trash %r19 before calling the target function.  */
       write_register (19, read_memory_integer ((fun & ~0x3) + 4, 4));
 
       /* Now get the real address for the function we are calling, it's
-        at *fun.  */
+         at *fun.  */
       fun = (CORE_ADDR) read_memory_integer (fun & ~0x3, 4);
     }
   else
@@ -1998,12 +2003,12 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
 
 #ifndef GDB_TARGET_IS_PA_ELF
       /* FUN could be an export stub, the real address of a function, or
-        a PLABEL.  When using gcc's PLT call routine we must call an import
-        stub rather than the export stub or real function for lazy binding
-        to work correctly
+         a PLABEL.  When using gcc's PLT call routine we must call an import
+         stub rather than the export stub or real function for lazy binding
+         to work correctly
 
-      /* If we are using the gcc PLT call routine, then we need to
-        get the import stub for the target function.  */
+         /* If we are using the gcc PLT call routine, then we need to
+         get the import stub for the target function.  */
       if (using_gcc_plt_call && som_solib_get_got_by_pc (fun))
        {
          struct objfile *objfile;
@@ -2017,35 +2022,35 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
          /* Search all the object files for an import symbol with the
             right name. */
          ALL_OBJFILES (objfile)
-           {
-             stub_symbol
-               = lookup_minimal_symbol_solib_trampoline
-                   (SYMBOL_NAME (funsymbol), NULL, objfile);
-
-             if (! stub_symbol)
-               stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol),
-                                                    NULL, objfile);
-
-             /* Found a symbol with the right name.  */
-             if (stub_symbol)
-               {
-                 struct unwind_table_entry *u;
-                 /* It must be a shared library trampoline.  */
-                 if (MSYMBOL_TYPE (stub_symbol) != mst_solib_trampoline)
-                   continue;
-
-                 /* It must also be an import stub.  */
-                 u = find_unwind_entry (SYMBOL_VALUE (stub_symbol));
-                 if (!u
-                     || (u->stub_unwind.stub_type != IMPORT)
-                         && u->stub_unwind.stub_type != IMPORT_SHLIB)
-                   continue;
-
-                 /* OK.  Looks like the correct import stub.  */
-                 newfun = SYMBOL_VALUE (stub_symbol);
-                 fun = newfun;
-               }
-           }
+         {
+           stub_symbol
+             = lookup_minimal_symbol_solib_trampoline
+             (SYMBOL_NAME (funsymbol), NULL, objfile);
+
+           if (!stub_symbol)
+             stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol),
+                                                  NULL, objfile);
+
+           /* Found a symbol with the right name.  */
+           if (stub_symbol)
+             {
+               struct unwind_table_entry *u;
+               /* It must be a shared library trampoline.  */
+               if (MSYMBOL_TYPE (stub_symbol) != mst_solib_trampoline)
+                 continue;
+
+               /* It must also be an import stub.  */
+               u = find_unwind_entry (SYMBOL_VALUE (stub_symbol));
+               if (!u
+                   || (u->stub_unwind.stub_type != IMPORT)
+                   && u->stub_unwind.stub_type != IMPORT_SHLIB)
+                 continue;
+
+               /* OK.  Looks like the correct import stub.  */
+               newfun = SYMBOL_VALUE (stub_symbol);
+               fun = newfun;
+             }
+         }
 
          /* Ouch.  We did not find an import stub.  Make an attempt to
             do the right thing instead of just croaking.  Most of the
@@ -2054,7 +2059,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
            write_register (19, som_solib_get_got_by_pc (fun));
 
          u = find_unwind_entry (fun);
-         if (u 
+         if (u
              && (u->stub_unwind.stub_type == IMPORT
                  || u->stub_unwind.stub_type == IMPORT_SHLIB))
            trampoline = lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL);
@@ -2077,12 +2082,12 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
 
      Also, query the dynamic linker in the inferior to provide a suitable
      PLABEL for the target function.  */
-  if (! using_gcc_plt_call)
+  if (!using_gcc_plt_call)
     {
       CORE_ADDR new_fun;
 
       /* Get a handle for the shared library containing FUN.  Given the
-        handle we can query the shared library for a PLABEL.  */
+         handle we can query the shared library for a PLABEL.  */
       solib_handle = som_solib_get_solib_by_pc (fun);
 
       if (solib_handle)
@@ -2103,17 +2108,17 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
             get a PLABEL for the target function.  */
          new_stub = find_stub_with_shl_get (fmsymbol, solib_handle);
 
-         if (new_stub == 0) 
+         if (new_stub == 0)
            error ("Can't find an import stub for %s", SYMBOL_NAME (fmsymbol));
 
          /* We have to store the address of the stub in __shlib_funcptr.  */
          msymbol = lookup_minimal_symbol ("__shlib_funcptr", NULL,
-                                          (struct objfile *)NULL);
+                                          (struct objfile *) NULL);
 
          if (msymbol == NULL)
            error ("Can't find an address for __shlib_funcptr");
          target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol),
-                              (char *)&new_stub, 4);
+                              (char *) &new_stub, 4);
 
          /* We want sr4export to call __d_plt_call, so we claim it is
             the final target.  Clear trampoline.  */
@@ -2205,13 +2210,14 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
    and cause a warning. */
 CORE_ADDR
 target_read_fp (pid)
-  int  pid;
+     int pid;
 {
   int flags = read_register (FLAGS_REGNUM);
 
-  if (flags & 2) {
-    return (CORE_ADDR) 0;
-  }
+  if (flags & 2)
+    {
+      return (CORE_ADDR) 0;
+    }
 
   /* This is the only site that may directly read_register () the FP
      register.  All others must use TARGET_READ_FP (). */
@@ -2283,7 +2289,7 @@ hppa_alignof (type)
        {
          /* Bit fields have no real alignment. */
          /* if (!TYPE_FIELD_BITPOS (type, i)) */
-         if (!TYPE_FIELD_BITSIZE (type, i)) /* elz: this should be bitsize */
+         if (!TYPE_FIELD_BITSIZE (type, i))    /* elz: this should be bitsize */
            {
              align = hppa_alignof (TYPE_FIELD_TYPE (type, i));
              max_align = max (max_align, align);
@@ -2302,7 +2308,7 @@ pa_do_registers_info (regnum, fpregs)
      int regnum;
      int fpregs;
 {
-  char raw_regs [REGISTER_BYTES];
+  char raw_regs[REGISTER_BYTES];
   int i;
 
   /* Make a copy of gdb's save area (may cause actual
@@ -2312,29 +2318,32 @@ pa_do_registers_info (regnum, fpregs)
 
   if (regnum == -1)
     pa_print_registers (raw_regs, regnum, fpregs);
-  else if (regnum < FP4_REGNUM) {
-    long reg_val[2];
-      
-    /* Why is the value not passed through "extract_signed_integer"
-       as in "pa_print_registers" below? */
-    pa_register_look_aside(raw_regs, regnum, &reg_val[0]);
-
-    if(!is_pa_2) {
-      printf_unfiltered ("%s %x\n", REGISTER_NAME (regnum), reg_val[1]);
-    }
-    else {
-      /* Fancy % formats to prevent leading zeros. */
-      if(reg_val[0] == 0)
-       printf_unfiltered("%s %x\n", REGISTER_NAME (regnum), reg_val[1]);
+  else if (regnum < FP4_REGNUM)
+    {
+      long reg_val[2];
+
+      /* Why is the value not passed through "extract_signed_integer"
+         as in "pa_print_registers" below? */
+      pa_register_look_aside (raw_regs, regnum, &reg_val[0]);
+
+      if (!is_pa_2)
+       {
+         printf_unfiltered ("%s %x\n", REGISTER_NAME (regnum), reg_val[1]);
+       }
       else
-       printf_unfiltered("%s %x%8.8x\n", REGISTER_NAME (regnum),
-                          reg_val[0], reg_val[1]);        
+       {
+         /* Fancy % formats to prevent leading zeros. */
+         if (reg_val[0] == 0)
+           printf_unfiltered ("%s %x\n", REGISTER_NAME (regnum), reg_val[1]);
+         else
+           printf_unfiltered ("%s %x%8.8x\n", REGISTER_NAME (regnum),
+                              reg_val[0], reg_val[1]);
+       }
     }
-  }
   else
-      /* Note that real floating point values only start at
-         FP4_REGNUM.  FP0 and up are just status and error
-         registers, which have integral (bit) values. */
+    /* Note that real floating point values only start at
+       FP4_REGNUM.  FP0 and up are just status and error
+       registers, which have integral (bit) values. */
     pa_print_fp_reg (regnum);
 }
 
@@ -2346,41 +2355,44 @@ pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
      GDB_FILE *stream;
      enum precision_type precision;
 {
-  char raw_regs [REGISTER_BYTES];
+  char raw_regs[REGISTER_BYTES];
   int i;
 
   /* Make a copy of gdb's save area (may cause actual
-     reads from the target). */  
+     reads from the target). */
   for (i = 0; i < NUM_REGS; i++)
     read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i));
 
   if (regnum == -1)
     pa_strcat_registers (raw_regs, regnum, fpregs, stream);
 
-  else if (regnum < FP4_REGNUM) {
-    long reg_val[2];
-      
-    /* Why is the value not passed through "extract_signed_integer"
-       as in "pa_print_registers" below? */
-    pa_register_look_aside(raw_regs, regnum, &reg_val[0]);
+  else if (regnum < FP4_REGNUM)
+    {
+      long reg_val[2];
+
+      /* Why is the value not passed through "extract_signed_integer"
+         as in "pa_print_registers" below? */
+      pa_register_look_aside (raw_regs, regnum, &reg_val[0]);
 
-    if(!is_pa_2) {
-      fprintf_unfiltered (stream, "%s %x", REGISTER_NAME (regnum), reg_val[1]);
-    }
-    else {
-      /* Fancy % formats to prevent leading zeros. */
-      if(reg_val[0] == 0)
-       fprintf_unfiltered(stream, "%s %x", REGISTER_NAME (regnum),
-                          reg_val[1]);
+      if (!is_pa_2)
+       {
+         fprintf_unfiltered (stream, "%s %x", REGISTER_NAME (regnum), reg_val[1]);
+       }
       else
-       fprintf_unfiltered(stream, "%s %x%8.8x", REGISTER_NAME (regnum),
-                          reg_val[0], reg_val[1]);        
+       {
+         /* Fancy % formats to prevent leading zeros. */
+         if (reg_val[0] == 0)
+           fprintf_unfiltered (stream, "%s %x", REGISTER_NAME (regnum),
+                               reg_val[1]);
+         else
+           fprintf_unfiltered (stream, "%s %x%8.8x", REGISTER_NAME (regnum),
+                               reg_val[0], reg_val[1]);
+       }
     }
-  }
   else
-      /* Note that real floating point values only start at
-         FP4_REGNUM.  FP0 and up are just status and error
-         registers, which have integral (bit) values. */
+    /* Note that real floating point values only start at
+       FP4_REGNUM.  FP0 and up are just status and error
+       registers, which have integral (bit) values. */
     pa_strcat_fp_reg (regnum, stream, precision);
 }
 
@@ -2390,61 +2402,66 @@ pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
    Note that reg_val is really expected to be an array of longs,
    with two elements. */
 static void
-pa_register_look_aside(raw_regs, regnum, raw_val)
+pa_register_look_aside (raw_regs, regnum, raw_val)
      char *raw_regs;
-     int   regnum;
+     int regnum;
      long *raw_val;
 {
-  static int know_which = 0;  /* False */
+  static int know_which = 0;   /* False */
 
-  int          regaddr;
+  int regaddr;
   unsigned int offset;
   register int i;
-  int          start;
-  
-  
+  int start;
+
+
   char buf[MAX_REGISTER_RAW_SIZE];
   long long reg_val;
 
-  if(!know_which) {
-     if(CPU_PA_RISC2_0 == sysconf(_SC_CPU_VERSION)) {
-        is_pa_2 = (1==1);
-     }
-     
-     know_which = 1;  /* True */
-  }
+  if (!know_which)
+    {
+      if (CPU_PA_RISC2_0 == sysconf (_SC_CPU_VERSION))
+       {
+         is_pa_2 = (1 == 1);
+       }
+
+      know_which = 1;          /* True */
+    }
 
   raw_val[0] = 0;
   raw_val[1] = 0;
 
-  if(!is_pa_2) {
-      raw_val[1] = *(long *)(raw_regs + REGISTER_BYTE(regnum));
+  if (!is_pa_2)
+    {
+      raw_val[1] = *(long *) (raw_regs + REGISTER_BYTE (regnum));
       return;
-  }
+    }
 
   /* Code below copied from hppah-nat.c, with fixes for wide
      registers, using different area of save_state, etc. */
   if (regnum == FLAGS_REGNUM || regnum >= FP0_REGNUM ||
-      !HAVE_STRUCT_SAVE_STATE_T || !HAVE_STRUCT_MEMBER_SS_WIDE) {
+      !HAVE_STRUCT_SAVE_STATE_T || !HAVE_STRUCT_MEMBER_SS_WIDE)
+    {
       /* Use narrow regs area of save_state and default macro. */
-      offset  = U_REGS_OFFSET;
-      regaddr = register_addr(regnum, offset);
-      start   = 1;
-  }
-  else {
+      offset = U_REGS_OFFSET;
+      regaddr = register_addr (regnum, offset);
+      start = 1;
+    }
+  else
+    {
       /* Use wide regs area, and calculate registers as 8 bytes wide.
 
          We'd like to do this, but current version of "C" doesn't
          permit "offsetof":
 
-            offset  = offsetof(save_state_t, ss_wide);
+         offset  = offsetof(save_state_t, ss_wide);
 
          Note that to avoid "C" doing typed pointer arithmetic, we
          have to cast away the type in our offset calculation:
          otherwise we get an offset of 1! */
 
       /* NB: save_state_t is not available before HPUX 9.
-        The ss_wide field is not available previous to HPUX 10.20,
+         The ss_wide field is not available previous to HPUX 10.20,
          so to avoid compile-time warnings, we only compile this for
          PA 2.0 processors.  This control path should only be followed
          if we're debugging a PA 2.0 processor, so this should not cause
@@ -2458,15 +2475,15 @@ pa_register_look_aside(raw_regs, regnum, raw_val)
 
       offset = ((int) &temp.ss_wide) - ((int) &temp);
       regaddr = offset + regnum * 8;
-      start   = 0;
+      start = 0;
 #endif
-  }
-   
-  for(i = start; i < 2; i++)
+    }
+
+  for (i = start; i < 2; i++)
     {
       errno = 0;
       raw_val[i] = call_ptrace (PT_RUREGS, inferior_pid,
-                               (PTRACE_ARG3_TYPE) regaddr, 0);
+                               (PTRACE_ARG3_TYPE) regaddr, 0);
       if (errno != 0)
        {
          /* Warning, not error, in case we are attached; sometimes the
@@ -2480,63 +2497,65 @@ pa_register_look_aside(raw_regs, regnum, raw_val)
 
       regaddr += sizeof (long);
     }
-    
+
   if (regnum == PCOQ_HEAD_REGNUM || regnum == PCOQ_TAIL_REGNUM)
-    raw_val[1] &= ~0x3; /* I think we're masking out space bits */
+    raw_val[1] &= ~0x3;                /* I think we're masking out space bits */
 
 error_exit:
   ;
 }
 
 /* "Info all-reg" command */
-                                                    
+
 static void
 pa_print_registers (raw_regs, regnum, fpregs)
      char *raw_regs;
      int regnum;
      int fpregs;
 {
-  int i,j;
-  long raw_val[2];   /* Alas, we are compiled so that "long long" is 32 bits */
+  int i, j;
+  long raw_val[2];             /* Alas, we are compiled so that "long long" is 32 bits */
   long long_val;
 
   for (i = 0; i < 18; i++)
     {
       for (j = 0; j < 4; j++)
        {
-          /* Q: Why is the value passed through "extract_signed_integer",
-               while above, in "pa_do_registers_info" it isn't?
-             A: ? */
-         pa_register_look_aside(raw_regs, i+(j*18), &raw_val[0]);
-
-          /* Even fancier % formats to prevent leading zeros
-             and still maintain the output in columns. */
-          if(!is_pa_2) {
-              /* Being big-endian, on this machine the low bits
-                 (the ones we want to look at) are in the second longword. */
-             long_val = extract_signed_integer (&raw_val[1], 4);
-             printf_filtered ("%8.8s: %8x  ",
-                              REGISTER_NAME (i+(j*18)), long_val);
-         }
-          else {
-             /* raw_val = extract_signed_integer(&raw_val, 8); */
-              if(raw_val[0] == 0)
-                 printf_filtered("%8.8s:         %8x  ",
-                                 REGISTER_NAME (i+(j*18)), raw_val[1]);
-              else
-                 printf_filtered("%8.8s: %8x%8.8x  ", REGISTER_NAME (i+(j*18)),
-                                 raw_val[0], raw_val[1]);
-          }
+         /* Q: Why is the value passed through "extract_signed_integer",
+            while above, in "pa_do_registers_info" it isn't?
+            A: ? */
+         pa_register_look_aside (raw_regs, i + (j * 18), &raw_val[0]);
+
+         /* Even fancier % formats to prevent leading zeros
+            and still maintain the output in columns. */
+         if (!is_pa_2)
+           {
+             /* Being big-endian, on this machine the low bits
+                (the ones we want to look at) are in the second longword. */
+             long_val = extract_signed_integer (&raw_val[1], 4);
+             printf_filtered ("%8.8s: %8x  ",
+                              REGISTER_NAME (i + (j * 18)), long_val);
+           }
+         else
+           {
+             /* raw_val = extract_signed_integer(&raw_val, 8); */
+             if (raw_val[0] == 0)
+               printf_filtered ("%8.8s:         %8x  ",
+                                REGISTER_NAME (i + (j * 18)), raw_val[1]);
+             else
+               printf_filtered ("%8.8s: %8x%8.8x  ", REGISTER_NAME (i + (j * 18)),
+                                raw_val[0], raw_val[1]);
+           }
        }
       printf_unfiltered ("\n");
     }
-  
+
   if (fpregs)
-  for (i = FP4_REGNUM; i < NUM_REGS; i++)  /* FP4_REGNUM == 72 */
+    for (i = FP4_REGNUM; i < NUM_REGS; i++)    /* FP4_REGNUM == 72 */
       pa_print_fp_reg (i);
 }
 
-/************* new function ******************/                                                    
+/************* new function ******************/
 static void
 pa_strcat_registers (raw_regs, regnum, fpregs, stream)
      char *raw_regs;
@@ -2544,8 +2563,8 @@ pa_strcat_registers (raw_regs, regnum, fpregs, stream)
      int fpregs;
      GDB_FILE *stream;
 {
-  int i,j;
-  long raw_val[2];   /* Alas, we are compiled so that "long long" is 32 bits */
+  int i, j;
+  long raw_val[2];             /* Alas, we are compiled so that "long long" is 32 bits */
   long long_val;
   enum precision_type precision;
 
@@ -2555,34 +2574,36 @@ pa_strcat_registers (raw_regs, regnum, fpregs, stream)
     {
       for (j = 0; j < 4; j++)
        {
-          /* Q: Why is the value passed through "extract_signed_integer",
-                while above, in "pa_do_registers_info" it isn't?
-             A: ? */
-         pa_register_look_aside(raw_regs, i+(j*18), &raw_val[0]);
-
-          /* Even fancier % formats to prevent leading zeros
-             and still maintain the output in columns. */
-          if(!is_pa_2) {
-              /* Being big-endian, on this machine the low bits
-                 (the ones we want to look at) are in the second longword. */
-             long_val = extract_signed_integer(&raw_val[1], 4);
-             fprintf_filtered (stream, "%8.8s: %8x  ", REGISTER_NAME (i+(j*18)), long_val);
-         }
-          else {
-             /* raw_val = extract_signed_integer(&raw_val, 8); */
-              if(raw_val[0] == 0)
-                 fprintf_filtered(stream, "%8.8s:         %8x  ", REGISTER_NAME (i+(j*18)),
-                                   raw_val[1]);
-              else
-                 fprintf_filtered(stream, "%8.8s: %8x%8.8x  ", REGISTER_NAME (i+(j*18)),
-                                    raw_val[0], raw_val[1]);
-          }
+         /* Q: Why is the value passed through "extract_signed_integer",
+            while above, in "pa_do_registers_info" it isn't?
+            A: ? */
+         pa_register_look_aside (raw_regs, i + (j * 18), &raw_val[0]);
+
+         /* Even fancier % formats to prevent leading zeros
+            and still maintain the output in columns. */
+         if (!is_pa_2)
+           {
+             /* Being big-endian, on this machine the low bits
+                (the ones we want to look at) are in the second longword. */
+             long_val = extract_signed_integer (&raw_val[1], 4);
+             fprintf_filtered (stream, "%8.8s: %8x  ", REGISTER_NAME (i + (j * 18)), long_val);
+           }
+         else
+           {
+             /* raw_val = extract_signed_integer(&raw_val, 8); */
+             if (raw_val[0] == 0)
+               fprintf_filtered (stream, "%8.8s:         %8x  ", REGISTER_NAME (i + (j * 18)),
+                                 raw_val[1]);
+             else
+               fprintf_filtered (stream, "%8.8s: %8x%8.8x  ", REGISTER_NAME (i + (j * 18)),
+                                 raw_val[0], raw_val[1]);
+           }
        }
       fprintf_unfiltered (stream, "\n");
     }
-  
+
   if (fpregs)
-  for (i = FP4_REGNUM; i < NUM_REGS; i++)  /* FP4_REGNUM == 72 */
+    for (i = FP4_REGNUM; i < NUM_REGS; i++)    /* FP4_REGNUM == 72 */
       pa_strcat_fp_reg (i, stream, precision);
 }
 
@@ -2651,22 +2672,23 @@ pa_strcat_fp_reg (i, stream, precision)
   if (precision == double_precision && (i % 2) == 0)
     {
 
-    char raw_buf[MAX_REGISTER_RAW_SIZE];
-    /* Get the data in raw format for the 2nd half.  */
-    read_relative_register_raw_bytes (i + 1, raw_buf);
-    /* Copy it into the appropriate part of the virtual buffer.  */
-    memcpy (virtual_buffer + REGISTER_RAW_SIZE(i), raw_buf, REGISTER_RAW_SIZE (i));
+      char raw_buf[MAX_REGISTER_RAW_SIZE];
+
+      /* Get the data in raw format for the 2nd half.  */
+      read_relative_register_raw_bytes (i + 1, raw_buf);
+
+      /* Copy it into the appropriate part of the virtual buffer.  */
+      memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buf, REGISTER_RAW_SIZE (i));
 
-    val_print (builtin_type_double, virtual_buffer, 0, 0 , stream, 0, 
-               1, 0, Val_pretty_default);
+      val_print (builtin_type_double, virtual_buffer, 0, 0, stream, 0,
+                1, 0, Val_pretty_default);
 
     }
-  else { 
-    val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, stream, 0,
-              1, 0, Val_pretty_default);
-  }
+  else
+    {
+      val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, stream, 0,
+                1, 0, Val_pretty_default);
+    }
 
 }
 
@@ -2738,7 +2760,7 @@ in_solib_call_trampoline (pc, name)
       CORE_ADDR addr;
 
       /* Search forward from the current PC until we hit a branch
-        or the end of the stub.  */
+         or the end of the stub.  */
       for (addr = pc; addr <= u->region_end; addr += 4)
        {
          unsigned long insn;
@@ -2755,12 +2777,12 @@ in_solib_call_trampoline (pc, name)
        }
 
       /* Should never happen.  */
-      warning ("Unable to find branch in parameter relocation stub.\n"); /* purecov: deadcode */
-      return 0; /* purecov: deadcode */
+      warning ("Unable to find branch in parameter relocation stub.\n");       /* purecov: deadcode */
+      return 0;                        /* purecov: deadcode */
     }
 
   /* Unknown stub type.  For now, just return zero.  */
-  return 0; /* purecov: deadcode */
+  return 0;                    /* purecov: deadcode */
 }
 
 /* Return one if PC is in the return path of a trampoline, else return zero.
@@ -2800,7 +2822,7 @@ in_solib_return_trampoline (pc, name)
       CORE_ADDR addr;
 
       /* Search forward from the current PC until we hit a branch
-        or the end of the stub.  */
+         or the end of the stub.  */
       for (addr = pc; addr <= u->region_end; addr += 4)
        {
          unsigned long insn;
@@ -2817,12 +2839,12 @@ in_solib_return_trampoline (pc, name)
        }
 
       /* Should never happen.  */
-      warning ("Unable to find branch in parameter relocation stub.\n"); /* purecov: deadcode */
-      return 0; /* purecov: deadcode */
+      warning ("Unable to find branch in parameter relocation stub.\n");       /* purecov: deadcode */
+      return 0;                        /* purecov: deadcode */
     }
 
   /* Unknown stub type.  For now, just return zero.  */
-  return 0; /* purecov: deadcode */
+  return 0;                    /* purecov: deadcode */
 
 }
 
@@ -2843,13 +2865,13 @@ in_solib_return_trampoline (pc, name)
    calling an argument relocation stub.  It even handles some stubs
    used in dynamic executables.  */
 
-# if 0
+#if 0
 CORE_ADDR
 skip_trampoline_code (pc, name)
      CORE_ADDR pc;
      char *name;
 {
-  return find_solib_trampoline_target(pc);
+  return find_solib_trampoline_target (pc);
 }
 
 #endif
@@ -2905,8 +2927,8 @@ skip_trampoline_code (pc, name)
       pc = (CORE_ADDR) read_register (22);
 
       /* If bit 30 (counting from the left) is on, then pc is the address of
-        the PLT entry for this function, not the address of the function
-        itself.  Bit 31 has meaning too, but only for MPE.  */
+         the PLT entry for this function, not the address of the function
+         itself.  Bit 31 has meaning too, but only for MPE.  */
       if (pc & 0x2)
        pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, 4);
     }
@@ -2940,56 +2962,56 @@ skip_trampoline_code (pc, name)
      its minimal symbol can be assigned type mst_solib_trampoline.
      Also, if we find that the symbol is a real stub, then we fix the unwind
      descriptor, and define the stub type to be EXPORT.
-     Hopefully this is correct most of the times. */ 
+     Hopefully this is correct most of the times. */
   if (u->stub_unwind.stub_type == 0)
-  {
+    {
 
 /* elz: NOTE (FIXME!) once the problem with the unwind information is fixed
    we can delete all the code which appears between the lines */
 /*--------------------------------------------------------------------------*/
-    msym = lookup_minimal_symbol_by_pc (pc);
+      msym = lookup_minimal_symbol_by_pc (pc);
 
-    if (msym == NULL || MSYMBOL_TYPE (msym) != mst_solib_trampoline)
-      return orig_pc == pc ? 0 : pc & ~0x3;
+      if (msym == NULL || MSYMBOL_TYPE (msym) != mst_solib_trampoline)
+       return orig_pc == pc ? 0 : pc & ~0x3;
+
+      else if (msym != NULL && MSYMBOL_TYPE (msym) == mst_solib_trampoline)
+       {
+         struct objfile *objfile;
+         struct minimal_symbol *msymbol;
+         int function_found = 0;
+
+         /* go look if there is another minimal symbol with the same name as 
+            this one, but with type mst_text. This would happen if the msym
+            is an actual trampoline, in which case there would be another
+            symbol with the same name corresponding to the real function */
+
+         ALL_MSYMBOLS (objfile, msymbol)
+         {
+           if (MSYMBOL_TYPE (msymbol) == mst_text
+               && STREQ (SYMBOL_NAME (msymbol), SYMBOL_NAME (msym)))
+             {
+               function_found = 1;
+               break;
+             }
+         }
+
+         if (function_found)
+           /* the type of msym is correct (mst_solib_trampoline), but
+              the unwind info is wrong, so set it to the correct value */
+           u->stub_unwind.stub_type = EXPORT;
+         else
+           /* the stub type info in the unwind is correct (this is not a
+              trampoline), but the msym type information is wrong, it
+              should be mst_text. So we need to fix the msym, and also
+              get out of this function */
+           {
+             MSYMBOL_TYPE (msym) = mst_text;
+             return orig_pc == pc ? 0 : pc & ~0x3;
+           }
+       }
 
-    else if (msym != NULL && MSYMBOL_TYPE (msym) == mst_solib_trampoline)
-         {
-          struct objfile *objfile;
-          struct minimal_symbol *msymbol;
-          int function_found = 0;
-
-             /* go look if there is another minimal symbol with the same name as 
-                this one, but with type mst_text. This would happen if the msym
-                is an actual trampoline, in which case there would be another
-                symbol with the same name corresponding to the real function */
-
-             ALL_MSYMBOLS (objfile, msymbol)
-             {
-               if (MSYMBOL_TYPE (msymbol) == mst_text
-                    && STREQ (SYMBOL_NAME (msymbol) , SYMBOL_NAME (msym)))
-                 {
-                  function_found = 1;
-                  break;
-                 }
-             }
-
-            if (function_found)  
-                   /* the type of msym is correct (mst_solib_trampoline), but
-                      the unwind info is wrong, so set it to the correct value */
-                u->stub_unwind.stub_type = EXPORT;
-            else
-                   /* the stub type info in the unwind is correct (this is not a
-                      trampoline), but the msym type information is wrong, it
-                      should be mst_text. So we need to fix the msym, and also
-                      get out of this function */
-              {
-                  MSYMBOL_TYPE (msym) = mst_text;
-                  return orig_pc == pc ? 0 : pc & ~0x3;
-              }
-         }
-               
 /*--------------------------------------------------------------------------*/
-  }
+    }
 
   /* It's a stub.  Search for a branch and figure out where it goes.
      Note we have to handle multi insn branch sequences like ldil;ble.
@@ -3012,7 +3034,7 @@ skip_trampoline_code (pc, name)
       curr_inst = read_memory_integer (loc, 4);
 
       /* Does it look like a branch external using %r1?  Then it's the
-        branch from the stub to the actual function.  */
+         branch from the stub to the actual function.  */
       if ((curr_inst & 0xffe0e000) == 0xe0202000)
        {
          /* Yup.  See if the previous instruction loaded
@@ -3031,26 +3053,26 @@ skip_trampoline_code (pc, name)
          Does it look like a bve (r21)? (this is on PA2.0)
          Does it look like a bve, n(r21)? (this is also on PA2.0)
          That's the branch from an
-        import stub to an export stub.
+         import stub to an export stub.
 
-        It is impossible to determine the target of the branch via
-        simple examination of instructions and/or data (consider
-        that the address in the plabel may be the address of the
-        bind-on-reference routine in the dynamic loader).
+         It is impossible to determine the target of the branch via
+         simple examination of instructions and/or data (consider
+         that the address in the plabel may be the address of the
+         bind-on-reference routine in the dynamic loader).
 
-        So we have try an alternative approach.
+         So we have try an alternative approach.
 
-        Get the name of the symbol at our current location; it should
-        be a stub symbol with the same name as the symbol in the
-        shared library.
+         Get the name of the symbol at our current location; it should
+         be a stub symbol with the same name as the symbol in the
+         shared library.
 
-        Then lookup a minimal symbol with the same name; we should
-        get the minimal symbol for the target routine in the shared
-        library as those take precedence of import/export stubs.  */
+         Then lookup a minimal symbol with the same name; we should
+         get the minimal symbol for the target routine in the shared
+         library as those take precedence of import/export stubs.  */
       if ((curr_inst == 0xe2a00000) ||
-          (curr_inst == 0xe2a00002) ||
-          (curr_inst == 0xeaa0d000) ||
-          (curr_inst == 0xeaa0d002))
+         (curr_inst == 0xe2a00002) ||
+         (curr_inst == 0xeaa0d000) ||
+         (curr_inst == 0xeaa0d002))
        {
          struct minimal_symbol *stubsym, *libsym;
 
@@ -3073,18 +3095,18 @@ skip_trampoline_code (pc, name)
        }
 
       /* Does it look like bl X,%rp or bl X,%r0?  Another way to do a
-        branch from the stub to the actual function.  */
-      /*elz*/
+         branch from the stub to the actual function.  */
+      /*elz */
       else if ((curr_inst & 0xffe0e000) == 0xe8400000
               || (curr_inst & 0xffe0e000) == 0xe8000000
-               || (curr_inst & 0xffe0e000) == 0xe800A000)
+              || (curr_inst & 0xffe0e000) == 0xe800A000)
        return (loc + extract_17 (curr_inst) + 8) & ~0x3;
 
       /* Does it look like bv (rp)?   Note this depends on the
-        current stack pointer being the same as the stack
-        pointer in the stub itself!  This is a branch on from the
-        stub back to the original caller.  */
-      /*else if ((curr_inst & 0xffe0e000) == 0xe840c000)*/
+         current stack pointer being the same as the stack
+         pointer in the stub itself!  This is a branch on from the
+         stub back to the original caller.  */
+      /*else if ((curr_inst & 0xffe0e000) == 0xe840c000) */
       else if ((curr_inst & 0xffe0f000) == 0xe840c000)
        {
          /* Yup.  See if the previous instruction loaded
@@ -3104,24 +3126,24 @@ skip_trampoline_code (pc, name)
          the PA2.0: BVE, n (rp) */
       else if ((curr_inst & 0xffe0f000) == 0xe840d000)
        {
-         return (read_memory_integer 
+         return (read_memory_integer
                  (read_register (SP_REGNUM) - 24, 4)) & ~0x3;
        }
 
       /* What about be,n 0(sr0,%rp)?  It's just another way we return to
-        the original caller from the stub.  Used in dynamic executables.  */
+         the original caller from the stub.  Used in dynamic executables.  */
       else if (curr_inst == 0xe0400002)
        {
          /* The value we jump to is sitting in sp - 24.  But that's
             loaded several instructions before the be instruction.
             I guess we could check for the previous instruction being
             mtsp %r1,%sr0 if we want to do sanity checking.  */
-         return (read_memory_integer 
+         return (read_memory_integer
                  (read_register (SP_REGNUM) - 24, 4)) & ~0x3;
        }
 
       /* Haven't found the branch yet, but we're still in the stub.
-        Keep looking.  */
+         Keep looking.  */
       loc += 4;
     }
 }
@@ -3215,7 +3237,7 @@ inst_saves_gr (inst)
      too.  */
   if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18)
     return extract_5R_store (inst);
-      
+
   return 0;
 }
 
@@ -3231,10 +3253,10 @@ static int
 inst_saves_fr (inst)
      unsigned long inst;
 {
-  /* is this an FSTDS ?*/
+  /* is this an FSTDS ? */
   if ((inst & 0xfc00dfc0) == 0x2c001200)
     return extract_5r_store (inst);
-  /* is this an FSTWS ?*/
+  /* is this an FSTWS ? */
   if ((inst & 0xfc00df80) == 0x24001200)
     return extract_5r_store (inst);
   return 0;
@@ -3265,7 +3287,7 @@ restart:
   if (!u)
     return pc;
 
-  /* If we are not at the beginning of a function, then return now. */ 
+  /* If we are not at the beginning of a function, then return now. */
   if ((pc & ~0x3) != u->region_start)
     return pc;
 
@@ -3321,7 +3343,7 @@ restart:
       unsigned long old_save_rp, old_save_sp, next_inst;
 
       /* Save copies of all the triggers so we can compare them later
-        (only for HPC).  */
+         (only for HPC).  */
       old_save_gr = save_gr;
       old_save_fr = save_fr;
       old_save_rp = save_rp;
@@ -3330,7 +3352,7 @@ restart:
 
       status = target_read_memory (pc, buf, 4);
       inst = extract_unsigned_integer (buf, 4);
-       
+
       /* Yow! */
       if (status != 0)
        return pc;
@@ -3343,7 +3365,7 @@ restart:
        save_rp = 0;
 
       /* This is the only way we save SP into the stack.  At this time
-        the HP compilers never bother to save SP into the stack.  */
+         the HP compilers never bother to save SP into the stack.  */
       if ((inst & 0xffffc000) == 0x6fc10000)
        save_sp = 0;
 
@@ -3352,15 +3374,15 @@ restart:
       save_gr &= ~(1 << reg_num);
 
       /* Ugh.  Also account for argument stores into the stack.
-        Unfortunately args_stored only tells us that some arguments
-        where stored into the stack.  Not how many or what kind!
+         Unfortunately args_stored only tells us that some arguments
+         where stored into the stack.  Not how many or what kind!
 
-        This is a kludge as on the HP compiler sets this bit and it
-        never does prologue scheduling.  So once we see one, skip past
-        all of them.   We have similar code for the fp arg stores below.
+         This is a kludge as on the HP compiler sets this bit and it
+         never does prologue scheduling.  So once we see one, skip past
+         all of them.   We have similar code for the fp arg stores below.
 
-        FIXME.  Can still die if we have a mix of GR and FR argument
-        stores!  */
+         FIXME.  Can still die if we have a mix of GR and FR argument
+         stores!  */
       if (reg_num >= 23 && reg_num <= 26)
        {
          while (reg_num >= 23 && reg_num <= 26)
@@ -3381,13 +3403,13 @@ restart:
 
       status = target_read_memory (pc + 4, buf, 4);
       next_inst = extract_unsigned_integer (buf, 4);
-       
+
       /* Yow! */
       if (status != 0)
        return pc;
 
       /* We've got to be read to handle the ldo before the fp register
-        save.  */
+         save.  */
       if ((inst & 0xfc000000) == 0x34000000
          && inst_saves_fr (next_inst) >= 4
          && inst_saves_fr (next_inst) <= 7)
@@ -3398,9 +3420,9 @@ restart:
        }
 
       /* Ugh.  Also account for argument stores into the stack.
-        This is a kludge as on the HP compiler sets this bit and it
-        never does prologue scheduling.  So once we see one, skip past
-        all of them.  */
+         This is a kludge as on the HP compiler sets this bit and it
+         never does prologue scheduling.  So once we see one, skip past
+         all of them.  */
       if (reg_num >= 4 && reg_num <= 7)
        {
          while (reg_num >= 4 && reg_num <= 7)
@@ -3423,26 +3445,26 @@ restart:
        }
 
       /* Quit if we hit any kind of branch.  This can happen if a prologue
-        instruction is in the delay slot of the first call/branch.  */
+         instruction is in the delay slot of the first call/branch.  */
       if (is_branch (inst))
        break;
 
       /* What a crock.  The HP compilers set args_stored even if no
-        arguments were stored into the stack (boo hiss).  This could
-        cause this code to then skip a bunch of user insns (up to the
-        first branch).
-
-        To combat this we try to identify when args_stored was bogusly
-        set and clear it.   We only do this when args_stored is nonzero,
-        all other resources are accounted for, and nothing changed on
-        this pass.  */
+         arguments were stored into the stack (boo hiss).  This could
+         cause this code to then skip a bunch of user insns (up to the
+         first branch).
+
+         To combat this we try to identify when args_stored was bogusly
+         set and clear it.   We only do this when args_stored is nonzero,
+         all other resources are accounted for, and nothing changed on
+         this pass.  */
       if (args_stored
-         && ! (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0)
+       && !(save_gr || save_fr || save_rp || save_sp || stack_remaining > 0)
          && old_save_gr == save_gr && old_save_fr == save_fr
          && old_save_rp == save_rp && old_save_sp == save_sp
          && old_stack_remaining == stack_remaining)
        break;
-      
+
       /* Bump the PC.  */
       pc += 4;
     }
@@ -3454,7 +3476,7 @@ restart:
      but never were, mask them out and restart.
 
      This should only happen in optimized code, and should be very rare.  */
-  if (save_gr || (save_fr && ! (restart_fr || restart_gr)))
+  if (save_gr || (save_fr && !(restart_fr || restart_gr)))
     {
       pc = orig_pc;
       restart_gr = save_gr;
@@ -3481,7 +3503,7 @@ after_prologue (pc)
   struct symbol *f;
 
   if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
-    return 0;                   /* Unknown */
+    return 0;                  /* Unknown */
 
   f = find_pc_function (pc);
   if (!f)
@@ -3490,35 +3512,36 @@ after_prologue (pc)
   sal = find_pc_line (func_addr, 0);
 
   if (sal.end < func_end)
-  {
-  /* this happens when the function has no prologue, because the way 
-     find_pc_line works: elz. Note: this may not be a very good
-     way to decide whether a function has a prologue or not, but
-     it is the best I can do with the info available
-     Also, this will work for functions like: int f()
-                                              {
-                                               return 2;
-                                              }
-    I.e. the bp will be inserted at the first open brace.
-    For functions where the body is only one line written like this:
-                                             int f()
-                                             { return 2; }
-   this will make the breakpoint to be at the last brace, after the body
-   has been executed already. What's the point of stepping through a function
-   without any variables anyway??  */
-
-    if ((SYMBOL_LINE(f) > 0) && (SYMBOL_LINE(f) < sal.line))
-     return pc; /*no adjusment will be made*/
-    else
-     return sal.end; /* this is the end of the prologue */
-  }
+    {
+      /* this happens when the function has no prologue, because the way 
+         find_pc_line works: elz. Note: this may not be a very good
+         way to decide whether a function has a prologue or not, but
+         it is the best I can do with the info available
+         Also, this will work for functions like: int f()
+         {
+         return 2;
+         }
+         I.e. the bp will be inserted at the first open brace.
+         For functions where the body is only one line written like this:
+         int f()
+         { return 2; }
+         this will make the breakpoint to be at the last brace, after the body
+         has been executed already. What's the point of stepping through a function
+         without any variables anyway??  */
+
+      if ((SYMBOL_LINE (f) > 0) && (SYMBOL_LINE (f) < sal.line))
+       return pc;              /*no adjusment will be made */
+      else
+       return sal.end;         /* this is the end of the prologue */
+    }
   /* The line after the prologue is after the end of the function.  In this
      case, put the end of the prologue is the beginning of the function.  */
   /* This should happen only when the function is prologueless and has no
      code in it. For instance void dumb(){} Note: this kind of function
      is  used quite a lot in the test system */
 
-  else return pc; /* no adjustment will be made */
+  else
+    return pc;                 /* no adjustment will be made */
 }
 
 /* To skip prologues, I use this predicate.  Returns either PC itself
@@ -3534,35 +3557,35 @@ CORE_ADDR
 hppa_skip_prologue (pc)
      CORE_ADDR pc;
 {
-    unsigned long inst;
-    int offset;
-    CORE_ADDR post_prologue_pc;
-    char buf[4];
+  unsigned long inst;
+  int offset;
+  CORE_ADDR post_prologue_pc;
+  char buf[4];
 
 #ifdef GDB_TARGET_HAS_SHARED_LIBS
-    /* Silently return the unaltered pc upon memory errors.
-       This could happen on OSF/1 if decode_line_1 tries to skip the
-       prologue for quickstarted shared library functions when the
-       shared library is not yet mapped in.
-       Reading target memory is slow over serial lines, so we perform
-       this check only if the target has shared libraries.  */
-    if (target_read_memory (pc, buf, 4))
-      return pc;
+  /* Silently return the unaltered pc upon memory errors.
+     This could happen on OSF/1 if decode_line_1 tries to skip the
+     prologue for quickstarted shared library functions when the
+     shared library is not yet mapped in.
+     Reading target memory is slow over serial lines, so we perform
+     this check only if the target has shared libraries.  */
+  if (target_read_memory (pc, buf, 4))
+    return pc;
 #endif
 
-    /* See if we can determine the end of the prologue via the symbol table.
-       If so, then return either PC, or the PC after the prologue, whichever
-       is greater.  */
+  /* See if we can determine the end of the prologue via the symbol table.
+     If so, then return either PC, or the PC after the prologue, whichever
+     is greater.  */
 
-    post_prologue_pc = after_prologue (pc);
+  post_prologue_pc = after_prologue (pc);
 
-    if (post_prologue_pc != 0)
-      return max (pc, post_prologue_pc);
+  if (post_prologue_pc != 0)
+    return max (pc, post_prologue_pc);
 
 
-   /* Can't determine prologue from the symbol table, (this can happen if there
-      is no debug information)  so we need to fall back on the old code, which
-      looks at the instructions */
+  /* Can't determine prologue from the symbol table, (this can happen if there
+     is no debug information)  so we need to fall back on the old code, which
+     looks at the instructions */
   /* FIXME (elz) !!!!: this may create a problem if, once the bp is hit, the user says
      where: the backtrace info is not right: this is because the point at which we
      break is at the very first instruction of the function. At this time the stuff that
@@ -3570,54 +3593,53 @@ hppa_skip_prologue (pc)
      cannot know all it needs to know. This will need to be fixed in the
      actual backtrace code. (Note: this is what DDE does) */
 
-    else 
-
-      return (skip_prologue_hard_way(pc));
+  else
+    return (skip_prologue_hard_way (pc));
 
 #if 0
 /* elz: I am keeping this code around just in case, but remember, all the
    instructions are for alpha: you should change all to the hppa instructions */
 
-    /* Can't determine prologue from the symbol table, need to examine
-       instructions.  */
+  /* Can't determine prologue from the symbol table, need to examine
+     instructions.  */
 
-    /* Skip the typical prologue instructions. These are the stack adjustment
-       instruction and the instructions that save registers on the stack
-       or in the gcc frame.  */
-    for (offset = 0; offset < 100; offset += 4)
-      {
-        int status;
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (offset = 0; offset < 100; offset += 4)
+    {
+      int status;
 
-        status = read_memory_nobpt (pc + offset, buf, 4);
-        if (status)
-          memory_error (status, pc + offset);
-        inst = extract_unsigned_integer (buf, 4);
+      status = read_memory_nobpt (pc + offset, buf, 4);
+      if (status)
+       memory_error (status, pc + offset);
+      inst = extract_unsigned_integer (buf, 4);
 
-        /* The alpha has no delay slots. But let's keep the lenient stuff,
-           we might need it for something else in the future.  */
-        if (lenient && 0)
-          continue;
+      /* The alpha has no delay slots. But let's keep the lenient stuff,
+         we might need it for something else in the future.  */
+      if (lenient && 0)
+       continue;
 
-        if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */
-         continue;
-        if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */
-            continue;
-        if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */
-            continue;
-        else if ((inst & 0xfc1f0000) == 0xb41e0000
-                 && (inst & 0xffff0000) != 0xb7fe0000)
-            continue;                          /* stq reg,n($sp) */
-                                               /* reg != $zero */
-        else if ((inst & 0xfc1f0000) == 0x9c1e0000
-                 && (inst & 0xffff0000) != 0x9ffe0000)
-            continue;                          /* stt reg,n($sp) */
-                                               /* reg != $zero */
-        else if (inst == 0x47de040f)            /* bis sp,sp,fp */
-            continue;
-        else
-            break;
-           }
-    return pc + offset;
+      if ((inst & 0xffff0000) == 0x27bb0000)   /* ldah $gp,n($t12) */
+       continue;
+      if ((inst & 0xffff0000) == 0x23bd0000)   /* lda $gp,n($gp) */
+       continue;
+      if ((inst & 0xffff0000) == 0x23de0000)   /* lda $sp,n($sp) */
+       continue;
+      else if ((inst & 0xfc1f0000) == 0xb41e0000
+              && (inst & 0xffff0000) != 0xb7fe0000)
+       continue;               /* stq reg,n($sp) */
+      /* reg != $zero */
+      else if ((inst & 0xfc1f0000) == 0x9c1e0000
+              && (inst & 0xffff0000) != 0x9ffe0000)
+       continue;               /* stt reg,n($sp) */
+      /* reg != $zero */
+      else if (inst == 0x47de040f)     /* bis sp,sp,fp */
+       continue;
+      else
+       break;
+    }
+  return pc + offset;
 #endif /* 0 */
 }
 
@@ -3648,8 +3670,8 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
      for the saved registers.  */
   if ((frame_info->pc >= frame_info->frame
        && frame_info->pc <= (frame_info->frame + CALL_DUMMY_LENGTH
-                            + 32 * 4 +  (NUM_REGS - FP0_REGNUM) * 8
-                            + 6 * 4))) 
+                            + 32 * 4 + (NUM_REGS - FP0_REGNUM) * 8
+                            + 6 * 4)))
     find_dummy_frame_regs (frame_info, frame_saved_regs);
 
   /* Interrupt handlers are special too.  They lay out the register
@@ -3748,7 +3770,7 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
        }
 
       /* Just note that we found the save of SP into the stack.  The
-        value for frame_saved_regs was computed above.  */
+         value for frame_saved_regs was computed above.  */
       if ((inst & 0xffffc000) == 0x6fc10000)
        save_sp = 0;
 
@@ -3772,25 +3794,25 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
              else
                frame_saved_regs->regs[reg]
                  = frame_info->frame + (u->Total_frame_size << 3)
-                   + extract_14 (inst);
+                 + extract_14 (inst);
            }
        }
 
 
       /* GCC handles callee saved FP regs a little differently.  
 
-        It emits an instruction to put the value of the start of
-        the FP store area into %r1.  It then uses fstds,ma with
-        a basereg of %r1 for the stores.
+         It emits an instruction to put the value of the start of
+         the FP store area into %r1.  It then uses fstds,ma with
+         a basereg of %r1 for the stores.
 
-        HP CC emits them at the current stack pointer modifying
-        the stack pointer as it stores each register.  */
+         HP CC emits them at the current stack pointer modifying
+         the stack pointer as it stores each register.  */
 
       /* ldo X(%r3),%r1 or ldo X(%r30),%r1.  */
       if ((inst & 0xffffc000) == 0x34610000
          || (inst & 0xffffc000) == 0x37c10000)
        fp_loc = extract_14 (inst);
-       
+
       reg = inst_saves_fr (inst);
       if (reg >= 12 && reg <= 21)
        {
@@ -3801,8 +3823,8 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
          if (fp_loc == -1)
            {
              /* 1st HP CC FP register store.  After this instruction
-                we've set enough state that the GCC and HPCC code are
-                both handled in the same manner.  */
+                we've set enough state that the GCC and HPCC code are
+                both handled in the same manner.  */
              frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame_info->frame;
              fp_loc = 8;
            }
@@ -3815,7 +3837,7 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
        }
 
       /* Quit if we hit any kind of branch.  This can happen if a prologue
-        instruction is in the delay slot of the first call/branch.  */
+         instruction is in the delay slot of the first call/branch.  */
       if (is_branch (inst))
        break;
 
@@ -3831,22 +3853,24 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
    exception event has occurred. */
 
 /* The name of the hook to be set to point to the callback function */
-static char HP_ACC_EH_notify_hook[]     = "__eh_notify_hook";
-/* The name of the function to be used to set the hook value */ 
-static char HP_ACC_EH_set_hook_value[]  = "__eh_set_hook_value";
-/* The name of the callback function in end.o */ 
+static char HP_ACC_EH_notify_hook[] = "__eh_notify_hook";
+/* The name of the function to be used to set the hook value */
+static char HP_ACC_EH_set_hook_value[] = "__eh_set_hook_value";
+/* The name of the callback function in end.o */
 static char HP_ACC_EH_notify_callback[] = "__d_eh_notify_callback";
-/* Name of function in end.o on which a break is set (called by above) */ 
-static char HP_ACC_EH_break[]           = "__d_eh_break";
-/* Name of flag (in end.o) that enables catching throws */ 
-static char HP_ACC_EH_catch_throw[]     = "__d_eh_catch_throw";
-/* Name of flag (in end.o) that enables catching catching */ 
-static char HP_ACC_EH_catch_catch[]     = "__d_eh_catch_catch";
-/* The enum used by aCC */ 
-typedef enum {
-  __EH_NOTIFY_THROW,
-  __EH_NOTIFY_CATCH
-} __eh_notification;
+/* Name of function in end.o on which a break is set (called by above) */
+static char HP_ACC_EH_break[] = "__d_eh_break";
+/* Name of flag (in end.o) that enables catching throws */
+static char HP_ACC_EH_catch_throw[] = "__d_eh_catch_throw";
+/* Name of flag (in end.o) that enables catching catching */
+static char HP_ACC_EH_catch_catch[] = "__d_eh_catch_catch";
+/* The enum used by aCC */
+typedef enum
+  {
+    __EH_NOTIFY_THROW,
+    __EH_NOTIFY_CATCH
+  }
+__eh_notification;
 
 /* Is exception-handling support available with this executable? */
 static int hp_cxx_exception_support = 0;
@@ -3865,21 +3889,21 @@ static CORE_ADDR eh_catch_catch_addr = NULL;
 /* Address of __d_eh_catch_throw */
 static CORE_ADDR eh_catch_throw_addr = NULL;
 /* Sal for __d_eh_break */
-static struct symtab_and_line * break_callback_sal = NULL;
+static struct symtab_and_line *break_callback_sal = NULL;
 
 /* Code in end.c expects __d_pid to be set in the inferior,
    otherwise __d_eh_notify_callback doesn't bother to call
    __d_eh_break!  So we poke the pid into this symbol
    ourselves.
    0 => success
-   1 => failure  */ 
+   1 => failure  */
 int
 setup_d_pid_in_inferior ()
 {
   CORE_ADDR anaddr;
-  struct minimal_symbol * msymbol;
-  char buf[4]; /* FIXME 32x64? */
-  
+  struct minimal_symbol *msymbol;
+  char buf[4];                 /* FIXME 32x64? */
+
   /* Slam the pid of the process into __d_pid; failing is only a warning!  */
   msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile);
   if (msymbol == NULL)
@@ -3890,8 +3914,8 @@ setup_d_pid_in_inferior ()
     }
 
   anaddr = SYMBOL_VALUE_ADDRESS (msymbol);
-  store_unsigned_integer (buf, 4, inferior_pid); /* FIXME 32x64? */
-  if (target_write_memory (anaddr, buf, 4)) /* FIXME 32x64? */
+  store_unsigned_integer (buf, 4, inferior_pid);       /* FIXME 32x64? */
+  if (target_write_memory (anaddr, buf, 4))    /* FIXME 32x64? */
     {
       warning ("Unable to write __d_pid");
       warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
@@ -3905,22 +3929,22 @@ setup_d_pid_in_inferior ()
    point to the required debug function
 
    Return 0 => failure
-          1 => success          */
+   1 => success          */
 
 static int
 initialize_hp_cxx_exception_support ()
 {
   struct symtabs_and_lines sals;
-  struct cleanup * old_chain;
-  struct cleanup * canonical_strings_chain = NULL;
+  struct cleanup *old_chain;
+  struct cleanup *canonical_strings_chain = NULL;
   int i;
-  char * addr_start;
-  char * addr_end = NULL;
-  char ** canonical = (char **) NULL;
+  char *addr_start;
+  char *addr_end = NULL;
+  char **canonical = (char **) NULL;
   int thread = -1;
-  struct symbol * sym = NULL;
-  struct minimal_symbol * msym = NULL;
-  struct objfile * objfile;
+  struct symbol *sym = NULL;
+  struct minimal_symbol *msym = NULL;
+  struct objfile *objfile;
   asection *shlib_info;
 
   /* Detect and disallow recursion.  On HP-UX with aCC, infinite
@@ -3928,8 +3952,8 @@ initialize_hp_cxx_exception_support ()
      callbacks involves making a call in the inferior, which means
      re-inserting breakpoints which can re-invoke this code */
 
-  static int recurse = 0;  
-  if (recurse > 0) 
+  static int recurse = 0;
+  if (recurse > 0)
     {
       hp_cxx_exception_support_initialized = 0;
       exception_support_initialized = 0;
@@ -3945,7 +3969,7 @@ initialize_hp_cxx_exception_support ()
      will decide to try the g++ exception-handling support instead. */
   if (!hp_som_som_object_present)
     return 0;
-  
+
   /* We have a SOM executable with SOM debug info; find the hooks */
 
   /* First look for the notify hook provided by aCC runtime libs */
@@ -3958,17 +3982,17 @@ initialize_hp_cxx_exception_support ()
      If this symbol is found but the other symbols we require are
      not found, there is something weird going on, and g++ support
      should *not* be tried as an alternative.
-     
+
      ASSUMPTION: Only HP aCC code will have __eh_notify_hook defined.  
      ASSUMPTION: HP aCC and g++ modules cannot be linked together. */
-  
+
   /* libCsup has this hook; it'll usually be non-debuggable */
   msym = lookup_minimal_symbol (HP_ACC_EH_notify_hook, NULL, NULL);
   if (msym)
     {
       eh_notify_hook_addr = SYMBOL_VALUE_ADDRESS (msym);
       hp_cxx_exception_support = 1;
-    }  
+    }
   else
     {
       warning ("Unable to find exception callback hook (%s).", HP_ACC_EH_notify_hook);
@@ -3980,14 +4004,14 @@ initialize_hp_cxx_exception_support ()
     }
 
   /* Next look for the notify callback routine in end.o */
-  /* This is always available in the SOM symbol dictionary if end.o is linked in */ 
+  /* This is always available in the SOM symbol dictionary if end.o is linked in */
   msym = lookup_minimal_symbol (HP_ACC_EH_notify_callback, NULL, NULL);
   if (msym)
     {
       eh_notify_callback_addr = SYMBOL_VALUE_ADDRESS (msym);
       hp_cxx_exception_support = 1;
-    }  
-  else 
+    }
+  else
     {
       warning ("Unable to find exception callback routine (%s).", HP_ACC_EH_notify_callback);
       warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
@@ -4003,7 +4027,7 @@ initialize_hp_cxx_exception_support ()
      can be the target of a call through $$dyncall from the aCC runtime support
      library (libCsup) which is linked shared by default by aCC. */
   /* This test below was copied from somsolib.c/somread.c.  It may not be a very
-     reliable one to test that an executable is linked shared. pai/1997-07-18 */ 
+     reliable one to test that an executable is linked shared. pai/1997-07-18 */
   shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$");
   if (shlib_info && (bfd_section_size (symfile_objfile->obfd, shlib_info) != 0))
     {
@@ -4011,42 +4035,42 @@ initialize_hp_cxx_exception_support ()
          plabel that can be used by an inter-load-module call. */
       /* Find solib handle for main image (which has end.o), and use that
          and the min sym as arguments to __d_shl_get() (which does the equivalent
-         of shl_findsym()) to find the plabel. */ 
+         of shl_findsym()) to find the plabel. */
 
       args_for_find_stub args;
       static char message[] = "Error while finding exception callback hook:\n";
-      
+
       args.solib_handle = som_solib_get_solib_by_pc (eh_notify_callback_addr);
       args.msym = msym;
-      
+
       recurse++;
-      eh_notify_callback_addr = catch_errors ((int (*) PARAMS ((char *))) cover_find_stub_with_shl_get,
-                                              (char *) &args,
-                                              message, RETURN_MASK_ALL);
+      eh_notify_callback_addr = catch_errors ((int (*)PARAMS ((char *))) cover_find_stub_with_shl_get,
+                                             (char *) &args,
+                                             message, RETURN_MASK_ALL);
       recurse--;
-      
+
       exception_catchpoints_are_fragile = 1;
-      
+
       if (!eh_notify_callback_addr)
-        {
-          /* We can get here either if there is no plabel in the export list
-             for the main image, or if something strange happened (??) */ 
-          warning ("Couldn't find a plabel (indirect function label) for the exception callback.");
-          warning ("GDB will not be able to intercept exception events.");
-          return 0;
-        }
+       {
+         /* We can get here either if there is no plabel in the export list
+            for the main image, or if something strange happened (??) */
+         warning ("Couldn't find a plabel (indirect function label) for the exception callback.");
+         warning ("GDB will not be able to intercept exception events.");
+         return 0;
+       }
     }
   else
     exception_catchpoints_are_fragile = 0;
 
   /* Now, look for the breakpointable routine in end.o */
-  /* This should also be available in the SOM symbol dict. if end.o linked in */ 
+  /* This should also be available in the SOM symbol dict. if end.o linked in */
   msym = lookup_minimal_symbol (HP_ACC_EH_break, NULL, NULL);
   if (msym)
     {
       eh_break_addr = SYMBOL_VALUE_ADDRESS (msym);
       hp_cxx_exception_support = 1;
-    }  
+    }
   else
     {
       warning ("Unable to find exception callback routine to set breakpoint (%s).", HP_ACC_EH_break);
@@ -4058,56 +4082,58 @@ initialize_hp_cxx_exception_support ()
 
   /* Next look for the catch enable flag provided in end.o */
   sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-                       VAR_NAMESPACE, 0, (struct symtab **) NULL);
-  if (sym) /* sometimes present in debug info */ 
+                      VAR_NAMESPACE, 0, (struct symtab **) NULL);
+  if (sym)                     /* sometimes present in debug info */
     {
       eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
       hp_cxx_exception_support = 1;
     }
-  else  /* otherwise look in SOM symbol dict. */ 
+  else
+    /* otherwise look in SOM symbol dict. */
     {
       msym = lookup_minimal_symbol (HP_ACC_EH_catch_catch, NULL, NULL);
       if (msym)
-        {
-          eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (msym);
-          hp_cxx_exception_support = 1;
-        }  
+       {
+         eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (msym);
+         hp_cxx_exception_support = 1;
+       }
       else
-        {
-          warning ("Unable to enable interception of exception catches.");
-          warning ("Executable may not have been compiled debuggable with HP aCC.");
-          warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
-          return 0;
-        }
+       {
+         warning ("Unable to enable interception of exception catches.");
+         warning ("Executable may not have been compiled debuggable with HP aCC.");
+         warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
+         return 0;
+       }
     }
 
   /* Next look for the catch enable flag provided end.o */
   sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-                       VAR_NAMESPACE, 0, (struct symtab **) NULL);
-  if (sym) /* sometimes present in debug info */ 
+                      VAR_NAMESPACE, 0, (struct symtab **) NULL);
+  if (sym)                     /* sometimes present in debug info */
     {
       eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
       hp_cxx_exception_support = 1;
     }
-  else /* otherwise look in SOM symbol dict. */ 
+  else
+    /* otherwise look in SOM symbol dict. */
     {
       msym = lookup_minimal_symbol (HP_ACC_EH_catch_throw, NULL, NULL);
       if (msym)
-        {
-          eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (msym);
-          hp_cxx_exception_support = 1;
-        }  
+       {
+         eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (msym);
+         hp_cxx_exception_support = 1;
+       }
       else
-        {
-          warning ("Unable to enable interception of exception throws.");
-          warning ("Executable may not have been compiled debuggable with HP aCC.");
-          warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
-          return 0;
-        }
+       {
+         warning ("Unable to enable interception of exception throws.");
+         warning ("Executable may not have been compiled debuggable with HP aCC.");
+         warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
+         return 0;
+       }
     }
 
-  /* Set the flags */ 
-  hp_cxx_exception_support = 2; /* everything worked so far */ 
+  /* Set the flags */
+  hp_cxx_exception_support = 2;        /* everything worked so far */
   hp_cxx_exception_support_initialized = 1;
   exception_support_initialized = 1;
 
@@ -4121,12 +4147,12 @@ initialize_hp_cxx_exception_support ()
    Return value is NULL if no support found;
    -1 if something went wrong,
    or a pointer to a symtab/line struct if the breakpointable
-   address was found. */ 
+   address was found. */
 
-struct symtab_and_line * 
+struct symtab_and_line *
 child_enable_exception_callback (kind, enable)
-  enum exception_event_kind kind;
-  int enable;
+     enum exception_event_kind kind;
+     int enable;
 {
   char buf[4];
 
@@ -4136,94 +4162,95 @@ child_enable_exception_callback (kind, enable)
 
   switch (hp_cxx_exception_support)
     {
-      case 0:
-        /* Assuming no HP support at all */ 
-        return NULL;
-      case 1:
-        /* HP support should be present, but something went wrong */ 
-        return (struct symtab_and_line *) -1; /* yuck! */ 
-      /* there may be other cases in the future */ 
+    case 0:
+      /* Assuming no HP support at all */
+      return NULL;
+    case 1:
+      /* HP support should be present, but something went wrong */
+      return (struct symtab_and_line *) -1;    /* yuck! */
+      /* there may be other cases in the future */
     }
-        
+
   /* Set the EH hook to point to the callback routine */
-  store_unsigned_integer (buf, 4, enable ? eh_notify_callback_addr : 0); /* FIXME 32x64 problem */
+  store_unsigned_integer (buf, 4, enable ? eh_notify_callback_addr : 0);       /* FIXME 32x64 problem */
   /* pai: (temp) FIXME should there be a pack operation first? */
-  if (target_write_memory (eh_notify_hook_addr, buf, 4))    /* FIXME 32x64 problem */
+  if (target_write_memory (eh_notify_hook_addr, buf, 4))       /* FIXME 32x64 problem */
     {
       warning ("Could not write to target memory for exception event callback.");
       warning ("Interception of exception events may not work.");
-      return (struct symtab_and_line *) -1; 
+      return (struct symtab_and_line *) -1;
     }
   if (enable)
     {
-      /* Ensure that __d_pid is set up correctly -- end.c code checks this. :-(*/
+      /* Ensure that __d_pid is set up correctly -- end.c code checks this. :-( */
       if (inferior_pid > 0)
-        {
-          if (setup_d_pid_in_inferior ())
-            return (struct symtab_and_line *) -1; 
-        }
+       {
+         if (setup_d_pid_in_inferior ())
+           return (struct symtab_and_line *) -1;
+       }
       else
-        {
-          warning ("Internal error: Invalid inferior pid?  Cannot intercept exception events."); /* purecov: deadcode */
-          return (struct symtab_and_line *) -1; /* purecov: deadcode */
-        }
+       {
+         warning ("Internal error: Invalid inferior pid?  Cannot intercept exception events.");        /* purecov: deadcode */
+         return (struct symtab_and_line *) -1;         /* purecov: deadcode */
+       }
     }
-  
+
   switch (kind)
     {
-      case EX_EVENT_THROW:
-        store_unsigned_integer (buf, 4, enable ? 1 : 0);
-        if (target_write_memory (eh_catch_throw_addr, buf, 4)) /* FIXME 32x64? */
-          {
-            warning ("Couldn't enable exception throw interception.");
-            return (struct symtab_and_line *) -1;
-          }
-        break;
-      case EX_EVENT_CATCH:
-        store_unsigned_integer (buf, 4, enable ? 1 : 0);
-        if (target_write_memory (eh_catch_catch_addr, buf, 4)) /* FIXME 32x64? */
-          {
-            warning ("Couldn't enable exception catch interception.");
-            return (struct symtab_and_line *) -1;
-          }
-        break;
-      default: /* purecov: deadcode */
-        error ("Request to enable unknown or unsupported exception event."); /* purecov: deadcode */
+    case EX_EVENT_THROW:
+      store_unsigned_integer (buf, 4, enable ? 1 : 0);
+      if (target_write_memory (eh_catch_throw_addr, buf, 4))   /* FIXME 32x64? */
+       {
+         warning ("Couldn't enable exception throw interception.");
+         return (struct symtab_and_line *) -1;
+       }
+      break;
+    case EX_EVENT_CATCH:
+      store_unsigned_integer (buf, 4, enable ? 1 : 0);
+      if (target_write_memory (eh_catch_catch_addr, buf, 4))   /* FIXME 32x64? */
+       {
+         warning ("Couldn't enable exception catch interception.");
+         return (struct symtab_and_line *) -1;
+       }
+      break;
+    default:                   /* purecov: deadcode */
+      error ("Request to enable unknown or unsupported exception event.");     /* purecov: deadcode */
     }
-  
+
   /* Copy break address into new sal struct, malloc'ing if needed. */
   if (!break_callback_sal)
     {
       break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
     }
-  INIT_SAL(break_callback_sal);
+  INIT_SAL (break_callback_sal);
   break_callback_sal->symtab = NULL;
   break_callback_sal->pc = eh_break_addr;
   break_callback_sal->line = 0;
   break_callback_sal->end = eh_break_addr;
-  
+
   return break_callback_sal;
 }
 
-/* Record some information about the current exception event */ 
+/* Record some information about the current exception event */
 static struct exception_event_record current_ex_event;
-/* Convenience struct */ 
-static struct symtab_and_line null_symtab_and_line = { NULL, 0, 0, 0 };
+/* Convenience struct */
+static struct symtab_and_line null_symtab_and_line =
+{NULL, 0, 0, 0};
 
 /* Report current exception event.  Returns a pointer to a record
    that describes the kind of the event, where it was thrown from,
    and where it will be caught.  More information may be reported
-   in the future */ 
+   in the future */
 struct exception_event_record *
 child_get_current_exception_event ()
 {
-  CORE_ADDR  event_kind;
-  CORE_ADDR  throw_addr;
-  CORE_ADDR  catch_addr;
+  CORE_ADDR event_kind;
+  CORE_ADDR throw_addr;
+  CORE_ADDR catch_addr;
   struct frame_info *fi, *curr_frame;
   int level = 1;
 
-  curr_frame = get_current_frame();
+  curr_frame = get_current_frame ();
   if (!curr_frame)
     return (struct exception_event_record *) NULL;
 
@@ -4238,23 +4265,23 @@ child_get_current_exception_event ()
 
   /* Read in the arguments */
   /* __d_eh_notify_callback() is called with 3 arguments:
-          1. event kind catch or throw
-          2. the target address if known
-          3. a flag -- not sure what this is. pai/1997-07-17 */
-  event_kind = read_register (ARG0_REGNUM);  
+     1. event kind catch or throw
+     2. the target address if known
+     3. a flag -- not sure what this is. pai/1997-07-17 */
+  event_kind = read_register (ARG0_REGNUM);
   catch_addr = read_register (ARG1_REGNUM);
 
   /* Now go down to a user frame */
   /* For a throw, __d_eh_break is called by
-                  __d_eh_notify_callback which is called by
-                  __notify_throw which is called
-                  from user code.
+     __d_eh_notify_callback which is called by
+     __notify_throw which is called
+     from user code.
      For a catch, __d_eh_break is called by
-                  __d_eh_notify_callback which is called by
-                  <stackwalking stuff> which is called by
-                  __throw__<stuff> or __rethrow_<stuff> which is called
-                  from user code. */
-  /* FIXME: Don't use such magic numbers; search for the frames */ 
+     __d_eh_notify_callback which is called by
+     <stackwalking stuff> which is called by
+     __throw__<stuff> or __rethrow_<stuff> which is called
+     from user code. */
+  /* FIXME: Don't use such magic numbers; search for the frames */
   level = (event_kind == EX_EVENT_THROW) ? 3 : 4;
   fi = find_relative_frame (curr_frame, &level);
   if (level != 0)
@@ -4368,57 +4395,57 @@ unwind_command (exp, from_tty)
    o  User hits bp, deletes bp, switches threads -- NO
 
    o  User hits bp, deletes one of two or more bps
-      at that PC, user switches threads -- YES
+   at that PC, user switches threads -- YES
 
    o  Plus, since we're buffering events, the user may have hit a
-      breakpoint, deleted the breakpoint and then gotten another
-      hit on that same breakpoint on another thread which
-      actually hit before the delete. (FIXME in breakpoint.c
-      so that "dead" breakpoints are ignored?) -- NO
+   breakpoint, deleted the breakpoint and then gotten another
+   hit on that same breakpoint on another thread which
+   actually hit before the delete. (FIXME in breakpoint.c
+   so that "dead" breakpoints are ignored?) -- NO
 
    For these reasons, we have to violate information hiding and
    call "breakpoint_here_p".  If core gdb thinks there is a bpt
    here, that's what counts, as core gdb is the one which is
    putting the BPT instruction in and taking it out. */
 int
-hppa_prepare_to_proceed()
+hppa_prepare_to_proceed ()
 {
   pid_t old_thread;
   pid_t current_thread;
 
-  old_thread = hppa_switched_threads(inferior_pid);
+  old_thread = hppa_switched_threads (inferior_pid);
   if (old_thread != 0)
     {
       /* Switched over from "old_thread".  Try to do
          as little work as possible, 'cause mostly
          we're going to switch back. */
       CORE_ADDR new_pc;
-      CORE_ADDR old_pc = read_pc();
+      CORE_ADDR old_pc = read_pc ();
 
       /* Yuk, shouldn't use global to specify current
          thread.  But that's how gdb does it. */
       current_thread = inferior_pid;
-      inferior_pid   = old_thread;
+      inferior_pid = old_thread;
 
-      new_pc = read_pc();
-      if (new_pc != old_pc          /* If at same pc, no need */
+      new_pc = read_pc ();
+      if (new_pc != old_pc     /* If at same pc, no need */
          && breakpoint_here_p (new_pc))
-        {
+       {
          /* User hasn't deleted the BP.
-             Return TRUE, finishing switch to "old_thread". */
+            Return TRUE, finishing switch to "old_thread". */
          flush_cached_frames ();
          registers_changed ();
 #if 0
-         printf("---> PREPARE_TO_PROCEED (was %d, now %d)!\n",
+         printf ("---> PREPARE_TO_PROCEED (was %d, now %d)!\n",
                  current_thread, inferior_pid);
 #endif
-               
+
          return 1;
-        }
+       }
 
       /* Otherwise switch back to the user-chosen thread. */
       inferior_pid = current_thread;
-      new_pc       = read_pc();       /* Re-prime register cache */
+      new_pc = read_pc ();     /* Re-prime register cache */
     }
 
   return 0;
index a795e0250cb3e3e735ff1dbca795c81eaa1a1ae1..29d22ebad4696afa3759bedd9672392f6e9a556c 100644 (file)
@@ -6,21 +6,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -80,7 +81,7 @@ fetch_register (regno)
        }
     }
   supply_register (regno, buf);
- error_exit:;
+error_exit:;
 }
 
 /* Fetch all registers, or just one, from the child process.  */
@@ -117,20 +118,20 @@ store_inferior_registers (regno)
       regaddr = register_addr (regno, offset);
       errno = 0;
       if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
-        {
-          scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
-          ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
-                  scratch);
-          if (errno != 0)
-            {
+       {
+         scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
+         ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+                 scratch);
+         if (errno != 0)
+           {
              /* Error, even if attached.  Failing to write these two
-                registers is pretty serious.  */
-              sprintf (buf, "writing register number %d", regno);
-              perror_with_name (buf);
-            }
-        }
+                registers is pretty serious.  */
+             sprintf (buf, "writing register number %d", regno);
+             perror_with_name (buf);
+           }
+       }
       else
-       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
+       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
          {
            errno = 0;
            ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
@@ -146,7 +147,7 @@ store_inferior_registers (regno)
                warning (msg);
                return;
              }
-           regaddr += sizeof(int);
+           regaddr += sizeof (int);
          }
     }
   else
@@ -164,28 +165,28 @@ store_inferior_registers (regno)
 
    The arguments are as follows:
 
-      PT_PROT -- The ptrace action to perform.
+   PT_PROT -- The ptrace action to perform.
+
+   INFERIOR_PID -- The pid of the process who's page table entries
+   will be modified.
 
-      INFERIOR_PID -- The pid of the process who's page table entries
-      will be modified.
+   PT_ARGS -- The *address* of a 3 word block of memory which has
+   additional information:
 
-      PT_ARGS -- The *address* of a 3 word block of memory which has
-      additional information:
+   word 0 -- The start address to watch.  This should be a page-aligned
+   address.
 
-        word 0 -- The start address to watch.  This should be a page-aligned
-       address.
+   word 1 -- The ending address to watch.  Again, this should be a 
+   page aligned address.
 
-       word 1 -- The ending address to watch.  Again, this should be a 
-       page aligned address.
+   word 2 -- Nonzero to enable the data memory break bit on the
+   given address range or zero to disable the data memory break
+   bit on the given address range.
 
-       word 2 -- Nonzero to enable the data memory break bit on the
-       given address range or zero to disable the data memory break
-       bit on the given address range.
+   This call may fail if the given addresses are not valid in the inferior
+   process.  This most often happens when restarting a program which
+   as watchpoints inserted on heap or stack memory.  */
 
-  This call may fail if the given addresses are not valid in the inferior
-  process.  This most often happens when restarting a program which
-  as watchpoints inserted on heap or stack memory.  */
-       
 #define PT_PROT 21
 
 int
@@ -198,16 +199,16 @@ hppa_set_watchpoint (addr, len, flag)
   pt_args[2] = flag;
 
   /* Mask off the lower 12 bits since we want to work on a page basis.  */
-  pt_args[0] >>= 12; 
-  pt_args[1] >>= 12; 
+  pt_args[0] >>= 12;
+  pt_args[1] >>= 12;
 
   /* Rounding adjustments.  */
-  pt_args[1] -= pt_args[0]; 
-  pt_args[1]++; 
+  pt_args[1] -= pt_args[0];
+  pt_args[1]++;
 
   /* Put the lower 12 bits back as zero.  */
-  pt_args[0] <<= 12; 
-  pt_args[1] <<= 12; 
+  pt_args[0] <<= 12;
+  pt_args[1] <<= 12;
 
   /* Do it.  */
   return ptrace (PT_PROT, inferior_pid, (PTRACE_ARG3_TYPE) pt_args, 0);
index d1e632c1eabf716875262f3bb259f593ce000405..4ade6f2d56fa9235d41090ec5fdafe781d7e0094 100644 (file)
@@ -5,21 +5,22 @@
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
@@ -73,13 +74,13 @@ store_inferior_registers (regno)
          if (errno != 0)
            {
              /* Error, even if attached.  Failing to write these two
-                registers is pretty serious.  */
+                registers is pretty serious.  */
              sprintf (buf, "writing register number %d", regno);
              perror_with_name (buf);
            }
        }
       else
-       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
+       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
          {
            errno = 0;
            call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
@@ -95,7 +96,7 @@ store_inferior_registers (regno)
                warning (msg);
                return;
              }
-           regaddr += sizeof(int);
+           regaddr += sizeof (int);
          }
     }
   else
@@ -139,13 +140,13 @@ fetch_register (regno)
   if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
     buf[3] &= ~0x3;
   supply_register (regno, buf);
- error_exit:;
+error_exit:;
 }
 
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.
-  
+
    Returns the length copied, which is either the LEN argument or zero.
    This xfer function does not do partial moves, since child_ops
    doesn't allow memory operations to cross below us in the target stack
@@ -157,14 +158,14 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & - sizeof (int);
+  register CORE_ADDR addr = memaddr & -sizeof (int);
   /* Round ending address up; get number of longwords that makes.  */
   register int count
-    = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+  = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
 
   /* Allocate buffer of that many longwords.
      Note -- do not use alloca to allocate this buffer since there is no
@@ -179,10 +180,10 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
   if (write)
     {
       /* Fill start and end extra bytes of buffer with existing memory data.  */
-      if (addr != memaddr || len < (int)sizeof (int))
+      if (addr != memaddr || len < (int) sizeof (int))
        {
          /* Need part of initial word -- fetch it.  */
-         buffer[0] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, 
+         buffer[0] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
                                   inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
        }
 
@@ -212,7 +213,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
          errno = 0;
          pt_request = (addr < text_end) ? PT_WIUSER : PT_WDUSER;
          pt_status = call_ptrace (pt_request,
-                                  inferior_pid, 
+                                  inferior_pid,
                                   (PTRACE_ARG3_TYPE) addr,
                                   buffer[i]);
 
@@ -224,14 +225,14 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
              errno = 0;
              pt_request = (pt_request == PT_WIUSER) ? PT_WDUSER : PT_WIUSER;
              pt_status = call_ptrace (pt_request,
-                                      inferior_pid, 
+                                      inferior_pid,
                                       (PTRACE_ARG3_TYPE) addr,
                                       buffer[i]);
 
              /* No, we still fail.  Okay, time to punt. */
              if ((pt_status == -1) && errno)
                {
-                 free(buffer);
+                 free (buffer);
                  return 0;
                }
            }
@@ -243,11 +244,11 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
       for (i = 0; i < count; i++, addr += sizeof (int))
        {
          errno = 0;
-         buffer[i] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, 
+         buffer[i] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
                                   inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
          if (errno)
            {
-             free(buffer);
+             free (buffer);
              return 0;
            }
          QUIT;
@@ -256,7 +257,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
       /* Copy appropriate bytes out of the buffer.  */
       memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
     }
-  free(buffer);
+  free (buffer);
   return len;
 }
 
@@ -313,9 +314,9 @@ child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
   if (followed_child)
     {
       /* If the child has exited, then there's nothing for us to do.
-        In the case of an exec event, we'll let that be handled by
-        the normal mechanism that notices and handles exec events, in
-        resume(). */
+         In the case of an exec event, we'll let that be handled by
+         the normal mechanism that notices and handles exec events, in
+         resume(). */
     }
 }
 
@@ -323,33 +324,33 @@ child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
    this with a null--it's going to be printed via a "%s".  */
 char *
 hppa_pid_to_str (pid)
-    pid_t pid;
+     pid_t pid;
 {
-    /* Static because address returned */
-    static char buf[30];
+  /* Static because address returned */
+  static char buf[30];
 
-    /* Extra NULLs for paranoia's sake */
-    sprintf (buf, "process %d\0\0\0\0", pid);
-            
-    return buf;
+  /* Extra NULLs for paranoia's sake */
+  sprintf (buf, "process %d\0\0\0\0", pid);
+
+  return buf;
 }
 
 /* Format a thread id, given TID.  Be sure to terminate
    this with a null--it's going to be printed via a "%s".
 
    Note: This is a core-gdb tid, not the actual system tid.
-         See infttrace.c for details.  */
+   See infttrace.c for details.  */
 char *
 hppa_tid_to_str (tid)
-    pid_t tid;
+     pid_t tid;
 {
-    /* Static because address returned */
-    static char buf[30];
+  /* Static because address returned */
+  static char buf[30];
+
+  /* Extra NULLs for paranoia's sake */
+  sprintf (buf, "system thread %d\0\0\0\0", tid);
 
-    /* Extra NULLs for paranoia's sake */
-    sprintf (buf, "system thread %d\0\0\0\0", tid);
-            
-    return buf;
+  return buf;
 }
 
 #if !defined (GDB_NATIVE_HPUX_11)
@@ -364,15 +365,17 @@ hppa_tid_to_str (tid)
    after a fork(), and before an exec() by the child.  See
    parent_attach_all for details.  */
 
-typedef struct {
-    int parent_channel[2];  /* Parent "talks" to [1], child "listens" to [0] */
-    int child_channel[2];   /* Child "talks" to [1], parent "listens" to [0] */
-} startup_semaphore_t;
+typedef struct
+{
+  int parent_channel[2];       /* Parent "talks" to [1], child "listens" to [0] */
+  int child_channel[2];                /* Child "talks" to [1], parent "listens" to [0] */
+}
+startup_semaphore_t;
 
 #define SEM_TALK (1)
 #define SEM_LISTEN (0)
 
-static startup_semaphore_t  startup_semaphore;
+static startup_semaphore_t startup_semaphore;
 
 extern int parent_attach_all PARAMS ((int, PTRACE_ARG3_TYPE, int));
 
@@ -423,7 +426,7 @@ parent_attach_all (pid, addr, data)
        &tc_magic_parent,
        sizeof (tc_magic_parent));
   if (tc_magic_child != tc_magic_parent)
-      warning ("mismatched semaphore magic");
+    warning ("mismatched semaphore magic");
 
   /* Discard our copy of the semaphore. */
   (void) close (startup_semaphore.parent_channel[SEM_LISTEN]);
@@ -431,7 +434,7 @@ parent_attach_all (pid, addr, data)
   (void) close (startup_semaphore.child_channel[SEM_LISTEN]);
   (void) close (startup_semaphore.child_channel[SEM_TALK]);
 #endif
-  
+
   return 0;
 }
 #endif
@@ -472,12 +475,12 @@ hppa_require_attach (pid)
 
 int
 hppa_require_detach (pid, signal)
-  int pid;
-  int signal;
+     int pid;
+     int signal;
 {
   errno = 0;
   call_ptrace (PT_DETACH, pid, (PTRACE_ARG3_TYPE) 1, signal);
-  errno = 0;  /* Ignore any errors. */
+  errno = 0;                   /* Ignore any errors. */
   return pid;
 }
 
@@ -570,7 +573,7 @@ hppa_ensure_vforking_parent_remains_stopped (pid)
 int
 hppa_resume_execd_vforking_child_to_get_parent_vfork ()
 {
-  return 1;  /* Yes, the child must be resumed. */
+  return 1;                    /* Yes, the child must be resumed. */
 }
 
 void
@@ -600,14 +603,14 @@ require_notification_of_events (pid)
   ptrace_events.pe_set_event |= PTRACE_FORK;
   ptrace_events.pe_set_event |= PTRACE_VFORK;
   /* ??rehrauer: Add this one when we're prepared to catch it...
-  ptrace_events.pe_set_event |= PTRACE_EXIT;
-  */
+     ptrace_events.pe_set_event |= PTRACE_EXIT;
+   */
 
   errno = 0;
   pt_status = call_ptrace (PT_SET_EVENT_MASK,
-                     pid,
-                     (PTRACE_ARG3_TYPE) &ptrace_events,
-                     sizeof (ptrace_events));
+                          pid,
+                          (PTRACE_ARG3_TYPE) & ptrace_events,
+                          sizeof (ptrace_events));
   if (errno)
     perror_with_name ("ptrace");
   if (pt_status < 0)
@@ -639,14 +642,14 @@ require_notification_of_exec_events (pid)
 
   ptrace_events.pe_set_event |= PTRACE_EXEC;
   /* ??rehrauer: Add this one when we're prepared to catch it...
-  ptrace_events.pe_set_event |= PTRACE_EXIT;
-  */
+     ptrace_events.pe_set_event |= PTRACE_EXIT;
+   */
 
   errno = 0;
   pt_status = call_ptrace (PT_SET_EVENT_MASK,
-                     pid,
-                     (PTRACE_ARG3_TYPE) &ptrace_events,
-                     sizeof (ptrace_events));
+                          pid,
+                          (PTRACE_ARG3_TYPE) & ptrace_events,
+                          sizeof (ptrace_events));
   if (errno)
     perror_with_name ("ptrace");
   if (pt_status < 0)
@@ -672,7 +675,7 @@ child_acknowledge_created_inferior (pid)
   /* Wait for the child to tell us that it has forked. */
   read (startup_semaphore.child_channel[SEM_LISTEN],
        &tc_magic_child,
-       sizeof(tc_magic_child));
+       sizeof (tc_magic_child));
 
   /* Notify the child that it can exec.
 
@@ -790,12 +793,12 @@ child_has_forked (pid, childpid)
   return 0;
 #else
   int pt_status;
-  ptrace_state_t  ptrace_state;
+  ptrace_state_t ptrace_state;
 
   errno = 0;
   pt_status = call_ptrace (PT_GET_PROCESS_STATE,
                           pid,
-                          (PTRACE_ARG3_TYPE) &ptrace_state,
+                          (PTRACE_ARG3_TYPE) & ptrace_state,
                           sizeof (ptrace_state));
   if (errno)
     perror_with_name ("ptrace");
@@ -824,12 +827,12 @@ child_has_vforked (pid, childpid)
 
 #else
   int pt_status;
-  ptrace_state_t  ptrace_state;
+  ptrace_state_t ptrace_state;
 
   errno = 0;
   pt_status = call_ptrace (PT_GET_PROCESS_STATE,
                           pid,
-                          (PTRACE_ARG3_TYPE) &ptrace_state,
+                          (PTRACE_ARG3_TYPE) & ptrace_state,
                           sizeof (ptrace_state));
   if (errno)
     perror_with_name ("ptrace");
@@ -897,12 +900,12 @@ child_has_execd (pid, execd_pathname)
 
 #else
   int pt_status;
-  ptrace_state_t  ptrace_state;
+  ptrace_state_t ptrace_state;
 
   errno = 0;
   pt_status = call_ptrace (PT_GET_PROCESS_STATE,
                           pid,
-                          (PTRACE_ARG3_TYPE) &ptrace_state,
+                          (PTRACE_ARG3_TYPE) & ptrace_state,
                           sizeof (ptrace_state));
   if (errno)
     perror_with_name ("ptrace");
@@ -911,7 +914,7 @@ child_has_execd (pid, execd_pathname)
 
   if (ptrace_state.pe_report_event & PTRACE_EXEC)
     {
-      char *  exec_file = target_pid_to_exec_file (pid);
+      char *exec_file = target_pid_to_exec_file (pid);
       *execd_pathname = savestring (exec_file, strlen (exec_file));
       return 1;
     }
@@ -923,7 +926,7 @@ child_has_execd (pid, execd_pathname)
 int
 child_reported_exec_events_per_exec_call ()
 {
-  return 2;  /* ptrace reports the event twice per call. */
+  return 2;                    /* ptrace reports the event twice per call. */
 }
 
 int
@@ -952,7 +955,7 @@ child_pid_to_exec_file (pid)
   int i;
   int saved_inferior_pid;
   boolean done;
-  
+
 #ifdef PT_GET_PROCESS_PATHNAME
   /* As of 10.x HP-UX, there's an explicit request to get the pathname. */
   pt_status = call_ptrace (PT_GET_PROCESS_PATHNAME,
@@ -980,7 +983,7 @@ child_pid_to_exec_file (pid)
   inferior_pid = pid;
 
   /* Try to grab a null-terminated string. */
-  while (! done)
+  while (!done)
     {
       if (target_read_memory (top_of_stack, four_chars, 4) != 0)
        {
@@ -1026,8 +1029,8 @@ pre_fork_inferior ()
       return;
     }
 }
-
 \f
+
 /* Check to see if the given thread is alive.
 
    This is a no-op, as ptrace doesn't support threads, so we just
@@ -1037,7 +1040,7 @@ int
 child_thread_alive (pid)
      int pid;
 {
-   return 1;
+  return 1;
 }
 
 #endif /* ! GDB_NATIVE_HPUX_11 */
index 95a66b05fefd30bb235a3424a52c5a5e880c710c..aa89379d4ee94c9a92ea738b794335a7bc1355bb 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to HP800 running mach 4.0.
    Copyright (C) 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -43,8 +44,8 @@ fetch_inferior_registers (regno)
   thread_state_data_t state;
   unsigned int stateCnt = TRACE_FLAVOR_SIZE;
   int index;
-  
-  if (! MACH_PORT_VALID (current_thread))
+
+  if (!MACH_PORT_VALID (current_thread))
     error ("fetch inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -60,8 +61,8 @@ fetch_inferior_registers (regno)
             mach_error_string (ret));
   else
     {
-      for (index = 0; index < NUM_REGS; index++) 
-       supply_register (index,(void*)&state[index]);
+      for (index = 0; index < NUM_REGS; index++)
+       supply_register (index, (void *) &state[index]);
     }
 
   if (must_suspend_thread)
@@ -83,7 +84,7 @@ store_inferior_registers (regno)
   unsigned int stateCnt = TRACE_FLAVOR_SIZE;
   register int index;
 
-  if (! MACH_PORT_VALID (current_thread))
+  if (!MACH_PORT_VALID (current_thread))
     error ("store inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -95,7 +96,7 @@ store_inferior_registers (regno)
                          state,
                          &stateCnt);
 
-   if (ret != KERN_SUCCESS) 
+  if (ret != KERN_SUCCESS)
     {
       warning ("store_inferior_registers (get): %s",
               mach_error_string (ret));
@@ -106,32 +107,32 @@ store_inferior_registers (regno)
 
 
   /* 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 (regno > 0 && regno < NUM_REGS ) 
+  if (regno > 0 && regno < NUM_REGS)
     {
-      memcpy(&state[regno], &registers[REGISTER_BYTE (regno)], 
-            REGISTER_RAW_SIZE(regno));
+      memcpy (&state[regno], &registers[REGISTER_BYTE (regno)],
+             REGISTER_RAW_SIZE (regno));
     }
   else
     {
-      for (index = 0; index < NUM_REGS; index++) 
-       memcpy(&state[index], &registers[REGISTER_BYTE (index)], 
-              REGISTER_RAW_SIZE(index));
-/*     state[index] = registers[REGISTER_BYTE (index)];*/
+      for (index = 0; index < NUM_REGS; index++)
+       memcpy (&state[index], &registers[REGISTER_BYTE (index)],
+               REGISTER_RAW_SIZE (index));
+/*      state[index] = registers[REGISTER_BYTE (index)]; */
 
     }
-  
+
   /* Write gdb's current view of register to the thread
    */
   ret = thread_set_state (current_thread,
                          TRACE_FLAVOR,
                          state,
                          TRACE_FLAVOR_SIZE);
-  
+
   if (ret != KERN_SUCCESS)
     warning ("store_inferior_registers (set): %s",
             mach_error_string (ret));
index 0b464ec3a3cc91940d259667111dce9a29aa839d..d14474e5fa55d95ed49253d7bf5ef063147b5387 100644 (file)
@@ -15,7 +15,8 @@
 
    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.
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
    Written by the Center for Software Science at the University of Utah
    and by Cygnus Support.  */
    and internalize the HP C debug symbols within that objfile.  */
 
 struct hpread_symfile_info
-{
-  /* The contents of each of the debug sections (there are 4 of them).  */
-  char *gntt;
-  char *lntt;
-  char *slt;
-  char *vt;
+  {
+    /* The contents of each of the debug sections (there are 4 of them).  */
+    char *gntt;
+    char *lntt;
+    char *slt;
+    char *vt;
 
-  /* We keep the size of the $VT$ section for range checking.  */
-  unsigned int vt_size;
+    /* We keep the size of the $VT$ section for range checking.  */
+    unsigned int vt_size;
 
-  /* Some routines still need to know the number of symbols in the
-     main debug sections ($LNTT$ and $GNTT$). */
-  unsigned int lntt_symcount;
-  unsigned int gntt_symcount;
+    /* Some routines still need to know the number of symbols in the
+       main debug sections ($LNTT$ and $GNTT$). */
+    unsigned int lntt_symcount;
+    unsigned int gntt_symcount;
 
-  /* To keep track of all the types we've processed.  */
-  struct type **type_vector;
-  int type_vector_length;
+    /* To keep track of all the types we've processed.  */
+    struct type **type_vector;
+    int type_vector_length;
 
-  /* Keeps track of the beginning of a range of source lines.  */
-  sltpointer sl_index;
+    /* Keeps track of the beginning of a range of source lines.  */
+    sltpointer sl_index;
 
-  /* Some state variables we'll need.  */
-  int within_function;
+    /* Some state variables we'll need.  */
+    int within_function;
 
-  /* Keep track of the current function's address.  We may need to look
-     up something based on this address.  */
-  unsigned int current_function_value;
-};
+    /* Keep track of the current function's address.  We may need to look
+       up something based on this address.  */
+    unsigned int current_function_value;
+  };
 
 /* Accessor macros to get at the fields.  */
 #define HPUX_SYMFILE_INFO(o) \
@@ -105,20 +106,20 @@ struct hpread_symfile_info
    of the psymtab.  */
 
 struct symloc
-{
-  /* The offset within the file symbol table of first local symbol for
-     this file.  */
+  {
+    /* The offset within the file symbol table of first local symbol for
+       this file.  */
 
-  int ldsymoff;
+    int ldsymoff;
 
-  /* Length (in bytes) 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).  If ldsymlen is 0, the only
-     reason for this thing's existence is the dependency list.
-     Nothing else will happen when it is read in.  */
+    /* Length (in bytes) 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).  If ldsymlen is 0, the only
+       reason for this thing's existence is the dependency list.
+       Nothing else will happen when it is read in.  */
 
-  int ldsymlen;
-};
+    int ldsymlen;
+  };
 
 #define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
 #define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
@@ -132,12 +133,12 @@ extern int info_verbose;
 extern struct complaint string_table_offset_complaint;
 extern struct complaint lbrac_unmatched_complaint;
 extern struct complaint lbrac_mismatch_complaint;
-
 \f
-void hpread_symfile_init  PARAMS ((struct objfile *));
+
+void hpread_symfile_init PARAMS ((struct objfile *));
 
 static struct type *
-hpread_read_array_type PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  hpread_read_array_type PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
 
 static struct type *hpread_alloc_type
   PARAMS ((dnttpointer, struct objfile *));
@@ -185,7 +186,7 @@ static sltpointer hpread_record_lines
 static struct type *hpread_read_function_type
   PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
 
-static struct type * hpread_type_lookup
+static struct type *hpread_type_lookup
   PARAMS ((dnttpointer, struct objfile *));
 
 static unsigned long hpread_get_depth
@@ -205,8 +206,8 @@ static union sltentry *hpread_get_slt PARAMS ((int, struct objfile *));
 static void hpread_psymtab_to_symtab PARAMS ((struct partial_symtab *));
 static void hpread_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
 static int hpread_has_name PARAMS ((enum dntt_entry_type));
-
 \f
+
 /* Initialization for reading native HP C debug symbols from OBJFILE.
 
    It's only purpose in life is to set up the symbol reader's private
@@ -243,11 +244,11 @@ hpread_symfile_init (objfile)
                     bfd_section_size (objfile->obfd, gntt_section));
 
   bfd_get_section_contents (objfile->obfd, gntt_section, GNTT (objfile),
-                           0, bfd_section_size (objfile->obfd, gntt_section));
+                        0, bfd_section_size (objfile->obfd, gntt_section));
 
   GNTT_SYMCOUNT (objfile)
     = bfd_section_size (objfile->obfd, gntt_section)
-                       / sizeof (struct dntt_type_block);
+    / sizeof (struct dntt_type_block);
 
   /* Read in data from the $LNTT$ subspace.   Also keep track of the number
      of LNTT symbols.  */
@@ -260,11 +261,11 @@ hpread_symfile_init (objfile)
                     bfd_section_size (objfile->obfd, lntt_section));
 
   bfd_get_section_contents (objfile->obfd, lntt_section, LNTT (objfile),
-                           0, bfd_section_size (objfile->obfd, lntt_section));
+                        0, bfd_section_size (objfile->obfd, lntt_section));
 
   LNTT_SYMCOUNT (objfile)
     = bfd_section_size (objfile->obfd, lntt_section)
-                       / sizeof (struct dntt_type_block);
+    / sizeof (struct dntt_type_block);
 
   /* Read in data from the $SLT$ subspace.  $SLT$ contains information
      on source line numbers.  */
@@ -277,7 +278,7 @@ hpread_symfile_init (objfile)
                   bfd_section_size (objfile->obfd, slt_section));
 
   bfd_get_section_contents (objfile->obfd, slt_section, SLT (objfile),
-                           0, bfd_section_size (objfile->obfd, slt_section));
+                         0, bfd_section_size (objfile->obfd, slt_section));
 
   /* Read in data from the $VT$ subspace.  $VT$ contains things like
      names and constants.  Keep track of the number of symbols in the VT.  */
@@ -472,7 +473,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                pst = hpread_start_psymtab (objfile, section_offsets,
                                            namestring, valu,
                                            (hp_symnum
-                                            * sizeof (struct dntt_type_block)),
+                                        * sizeof (struct dntt_type_block)),
                                            objfile->global_psymbols.next,
                                            objfile->static_psymbols.next);
                texthigh = valu;
@@ -482,8 +483,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
 
            case DNTT_TYPE_MODULE:
              /* A source file.  It's still unclear to me what the
-                real difference between a DNTT_TYPE_SRCFILE and DNTT_TYPE_MODULE
-                is supposed to be.  */
+                real difference between a DNTT_TYPE_SRCFILE and DNTT_TYPE_MODULE
+                is supposed to be.  */
              SET_NAMESTRING (dn_bufp, &namestring, objfile);
              valu = hpread_get_textlow (i, hp_symnum, objfile);
              valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
@@ -492,7 +493,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                  pst = hpread_start_psymtab (objfile, section_offsets,
                                              namestring, valu,
                                              (hp_symnum
-                                              * sizeof (struct dntt_type_block)),
+                                        * sizeof (struct dntt_type_block)),
                                              objfile->global_psymbols.next,
                                              objfile->static_psymbols.next);
                  texthigh = valu;
@@ -502,7 +503,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
            case DNTT_TYPE_FUNCTION:
            case DNTT_TYPE_ENTRY:
              /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
-                a secondary entry point.  */
+                a secondary entry point.  */
              valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
                                                       SECT_OFF_TEXT);
              if (valu > texthigh)
@@ -519,7 +520,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
            case DNTT_TYPE_BEGIN:
            case DNTT_TYPE_END:
              /* Scope block begin/end.  We only care about function
-                and file blocks right now.  */
+                and file blocks right now.  */
              if (dn_bufp->dend.endkind == DNTT_TYPE_MODULE)
                {
                  hpread_end_psymtab (pst, psymtab_include_list, includes_used,
@@ -573,9 +574,9 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                    pst = hpread_start_psymtab (objfile, section_offsets,
                                                "globals", 0,
                                                (hp_symnum
-                                                * sizeof (struct dntt_type_block)),
-                                               objfile->global_psymbols.next,
-                                               objfile->static_psymbols.next);
+                                        * sizeof (struct dntt_type_block)),
+                                             objfile->global_psymbols.next,
+                                            objfile->static_psymbols.next);
                  }
                if (dn_bufp->dsvar.global)
                  {
@@ -603,8 +604,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
                {
                  pst = hpread_start_psymtab (objfile, section_offsets,
                                              "globals", 0,
-                                             (hp_symnum 
-                                              * sizeof (struct dntt_type_block)),
+                                             (hp_symnum
+                                        * sizeof (struct dntt_type_block)),
                                              objfile->global_psymbols.next,
                                              objfile->static_psymbols.next);
                }
@@ -673,7 +674,7 @@ hpread_get_slt (index, objfile)
      int index;
      struct objfile *objfile;
 {
-  return (union sltentry *)&(SLT (objfile)[index * sizeof (union sltentry)]);
+  return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]);
 }
 
 /* Get the low address associated with some symbol (typically the start
@@ -697,8 +698,9 @@ hpread_get_textlow (global, index, objfile)
        dn_bufp = hpread_get_gntt (index++, objfile);
       else
        dn_bufp = hpread_get_lntt (index++, objfile);
-    } while (dn_bufp->dblock.kind != DNTT_TYPE_FUNCTION
-            && dn_bufp->dblock.kind != DNTT_TYPE_END);
+    }
+  while (dn_bufp->dblock.kind != DNTT_TYPE_FUNCTION
+        && dn_bufp->dblock.kind != DNTT_TYPE_END);
 
   /* Avoid going past a DNTT_TYPE_END when looking for a DNTT_TYPE_FUNCTION.  This
      might happen when a sourcefile has no functions.  */
@@ -825,7 +827,7 @@ hpread_has_name (kind)
 
 static struct partial_symtab *
 hpread_start_psymtab (objfile, section_offsets,
-                 filename, textlow, ldsymoff, global_syms, static_syms)
+                     filename, textlow, ldsymoff, global_syms, static_syms)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
      char *filename;
@@ -854,7 +856,7 @@ hpread_start_psymtab (objfile, section_offsets,
 
 static struct partial_symtab *
 hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
-            capping_text, dependency_list, number_dependencies)
+                   capping_text, dependency_list, number_dependencies)
      struct partial_symtab *pst;
      char **include_list;
      int num_includes;
@@ -864,10 +866,10 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
      int number_dependencies;
 {
   int i;
-  struct objfile *objfile = pst -> objfile;
+  struct objfile *objfile = pst->objfile;
 
   if (capping_symbol_offset != -1)
-      LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
+    LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
   pst->texthigh = capping_text;
 
   pst->n_global_syms =
@@ -880,9 +882,9 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
     {
       pst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+                   number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
-            number_dependencies * sizeof (struct partial_symtab *));
+             number_dependencies * sizeof (struct partial_symtab *));
     }
   else
     pst->dependencies = 0;
@@ -890,19 +892,19 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
   for (i = 0; i < num_includes; i++)
     {
       struct partial_symtab *subpst =
-       allocate_psymtab (include_list[i], objfile);
+      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) =
-       LDSYMLEN(subpst) =
-         subpst->textlow =
-           subpst->texthigh = 0;
+       (char *) obstack_alloc (&objfile->psymbol_obstack,
+                               sizeof (struct symloc));
+      LDSYMOFF (subpst) =
+       LDSYMLEN (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.  */
+         shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
                       sizeof (struct partial_symtab *));
@@ -911,8 +913,8 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
 
       subpst->globals_offset =
        subpst->n_global_syms =
-         subpst->statics_offset =
-           subpst->n_static_syms = 0;
+       subpst->statics_offset =
+       subpst->n_static_syms = 0;
 
       subpst->readin = 0;
       subpst->symtab = 0;
@@ -932,17 +934,17 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
       && 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.  */
+         it is on the obstack, but we can forget to chain it on the list.  */
       /* Empty psymtabs happen as a result of header files which don't have
-        any symbols in them.  There can be a lot of them.  But this check
-        is wrong, in that a psymtab with N_SLINE entries but nothing else
-        is not empty, but we don't realize that.  Fixing that without slowing
-        things down might be tricky.  */
+         any symbols in them.  There can be a lot of them.  But this check
+         is wrong, in that a psymtab with N_SLINE entries but nothing else
+         is not empty, but we don't realize that.  Fixing that without slowing
+         things down might be tricky.  */
 
       discard_psymtab (pst);
 
       /* Indicate that psymtab was thrown away.  */
-      pst = (struct partial_symtab *)NULL;
+      pst = (struct partial_symtab *) NULL;
     }
   return pst;
 }
@@ -1209,15 +1211,15 @@ hpread_lookup_type (hp_type, objfile)
            {
              TYPE_VECTOR_LENGTH (objfile) = 100;
              TYPE_VECTOR (objfile) = (struct type **)
-               xmmalloc (objfile -> md,
-                         TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
+               xmmalloc (objfile->md,
+                    TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
            }
          while (index >= TYPE_VECTOR_LENGTH (objfile))
            TYPE_VECTOR_LENGTH (objfile) *= 2;
          TYPE_VECTOR (objfile) = (struct type **)
-           xmrealloc (objfile -> md,
+           xmrealloc (objfile->md,
                       (char *) TYPE_VECTOR (objfile),
-                     (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
+                  (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
          memset (&TYPE_VECTOR (objfile)[old_len], 0,
                  (TYPE_VECTOR_LENGTH (objfile) - old_len) *
                  sizeof (struct type *));
@@ -1282,7 +1284,7 @@ hpread_read_enum_type (hp_type, dn_bufp, objfile)
       sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = obsavestring (name, strlen (name), 
+      SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
                                        &objfile->symbol_obstack);
       SYMBOL_CLASS (sym) = LOC_CONST;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -1386,7 +1388,7 @@ hpread_read_function_type (hp_type, dn_bufp, objfile)
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (paramp->dfparam.copyparam)
        {
-         SYMBOL_VALUE (sym) = paramp->dfparam.location ;
+         SYMBOL_VALUE (sym) = paramp->dfparam.location;
 #ifdef HPREAD_ADJUST_STACK_ADDRESS
          SYMBOL_VALUE (sym)
            += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
@@ -1462,7 +1464,7 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
   type = hpread_alloc_type (hp_type, objfile);
   if ((TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
       (TYPE_CODE (type) == TYPE_CODE_UNION))
-      return type;
+    return type;
 
   /* Get the basic type correct.  */
   if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT)
@@ -1566,9 +1568,9 @@ hpread_read_array_type (hp_type, dn_bufp, objfile)
   else if (dn_bufp->darray.arraylength == 0x7fffffff)
     {
       /* The HP debug format represents char foo[]; as an array with
-        length 0x7fffffff.  Internally GDB wants to represent this
-        as an array of length zero.  */
-     TYPE_LENGTH (type) = 0;
+         length 0x7fffffff.  Internally GDB wants to represent this
+         as an array of length zero.  */
+      TYPE_LENGTH (type) = 0;
     }
   else
     TYPE_LENGTH (type) = dn_bufp->darray.arraylength / 8;
@@ -1665,7 +1667,7 @@ hpread_type_lookup (hp_type, objfile)
 
        TYPE_CPLUS_SPECIFIC (structtype)
          = (struct cplus_struct_type *) &cplus_struct_default;
-       TYPE_NAME (structtype) = suffix;
+       TYPE_NAME (structtype) = suffix;
        return structtype;
       }
 
@@ -1827,7 +1829,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        }
       start_subfile (name, NULL);
       break;
-      
+
     case DNTT_TYPE_MODULE:
       /* No need to do anything with these DNTT_TYPE_MODULE symbols anymore.  */
       break;
@@ -1840,7 +1842,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
                                                SL_INDEX (objfile),
                                                dn_bufp->dfunc.address,
                                                objfile, offset);
-      
+
       WITHIN_FUNCTION (objfile) = 1;
       CURRENT_FUNCTION_VALUE (objfile) = valu;
 
index 7864dd651502de3d3d73574ba2b1f6e0ad329ff8..2768294829a9a4ba77b77eece60df68befd5d9a0 100644 (file)
@@ -20,7 +20,8 @@
 
    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.
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
    Written by the Center for Software Science at the University of Utah
    and by Cygnus Support.  */
    and internalize the HP C debug symbols within that objfile.  */
 
 struct hpread_symfile_info
-{
-  /* The contents of each of the debug sections (there are 4 of them).  */
-  char *gntt;
-  char *lntt;
-  char *slt;
-  char *vt;
+  {
+    /* The contents of each of the debug sections (there are 4 of them).  */
+    char *gntt;
+    char *lntt;
+    char *slt;
+    char *vt;
 
-  /* We keep the size of the $VT$ section for range checking.  */
-  unsigned int vt_size;
+    /* We keep the size of the $VT$ section for range checking.  */
+    unsigned int vt_size;
 
-  /* Some routines still need to know the number of symbols in the
-     main debug sections ($LNTT$ and $GNTT$). */
-  unsigned int lntt_symcount;
-  unsigned int gntt_symcount;
+    /* Some routines still need to know the number of symbols in the
+       main debug sections ($LNTT$ and $GNTT$). */
+    unsigned int lntt_symcount;
+    unsigned int gntt_symcount;
 
-  /* To keep track of all the types we've processed.  */
-  struct type **type_vector;
-  int type_vector_length;
+    /* To keep track of all the types we've processed.  */
+    struct type **type_vector;
+    int type_vector_length;
 
-  /* Keeps track of the beginning of a range of source lines.  */
-  sltpointer sl_index;
+    /* Keeps track of the beginning of a range of source lines.  */
+    sltpointer sl_index;
 
-  /* Some state variables we'll need.  */
-  int within_function;
+    /* Some state variables we'll need.  */
+    int within_function;
 
-  /* Keep track of the current function's address.  We may need to look
-     up something based on this address.  */
-  unsigned int current_function_value;
-};
+    /* Keep track of the current function's address.  We may need to look
+       up something based on this address.  */
+    unsigned int current_function_value;
+  };
 
 /* Accessor macros to get at the fields.  */
 #define HPUX_SYMFILE_INFO(o) \
@@ -110,20 +111,20 @@ struct hpread_symfile_info
    of the psymtab.  */
 
 struct symloc
-{
-  /* The offset within the file symbol table of first local symbol for
-     this file.  */
+  {
+    /* The offset within the file symbol table of first local symbol for
+       this file.  */
 
-  int ldsymoff;
+    int ldsymoff;
 
-  /* Length (in bytes) 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).  If ldsymlen is 0, the only
-     reason for this thing's existence is the dependency list.
-     Nothing else will happen when it is read in.  */
+    /* Length (in bytes) 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).  If ldsymlen is 0, the only
+       reason for this thing's existence is the dependency list.
+       Nothing else will happen when it is read in.  */
 
-  int ldsymlen;
-};
+    int ldsymlen;
+  };
 
 #define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
 #define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
index 64b932ee7af0f5e2a97ef47f41cfda3790a35577..5064d6869a1cb4194bb052d8747bb2ac3d239daa 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface for debugging HPUX/DCE threads for GDB, the GNU debugger.
    Copyright 1996, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module implements a sort of half target that sits between the
    machine-independent parts of GDB and the ptrace interface (infptrace.c) to
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    structures that live in the user's heap.  For the most part, the kernel has
    no knowlege of these threads.
 
  */
+ */
 
 #include "defs.h"
 
@@ -44,15 +45,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcore.h"
 
 extern int child_suppress_run;
-extern struct target_ops child_ops; /* target vector for inftarg.c */
+extern struct target_ops child_ops;    /* target vector for inftarg.c */
 
 extern void _initialize_hpux_thread PARAMS ((void));
 
 struct string_map
-{
-  int num;
-  char *str;
-};
+  {
+    int num;
+    char *str;
+  };
 
 static int hpux_thread_active = 0;
 
@@ -61,7 +62,7 @@ static int main_pid;          /* Real process ID */
 static CORE_ADDR P_cma__g_known_threads;
 static CORE_ADDR P_cma__g_current_thread;
 
-static struct cleanup * save_inferior_pid PARAMS ((void));
+static struct cleanup *save_inferior_pid PARAMS ((void));
 
 static void restore_inferior_pid PARAMS ((int pid));
 
@@ -74,28 +75,28 @@ static struct target_ops hpux_thread_ops;
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       save_inferior_pid - Save inferior_pid on the cleanup list
-       restore_inferior_pid - Restore inferior_pid from the cleanup list
+   save_inferior_pid - Save inferior_pid on the cleanup list
+   restore_inferior_pid - Restore inferior_pid from the cleanup list
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct cleanup *save_inferior_pid ()
-       void restore_inferior_pid (int pid)
+   struct cleanup *save_inferior_pid ()
+   void restore_inferior_pid (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       These two functions act in unison to restore inferior_pid in
-       case of an error.
+   These two functions act in unison to restore inferior_pid in
+   case of an error.
 
-NOTES
+   NOTES
 
-       inferior_pid is a global variable that needs to be changed by many of
-       these routines before calling functions in procfs.c.  In order to
-       guarantee that inferior_pid gets restored (in case of errors), you
-       need to call save_inferior_pid before changing it.  At the end of the
-       function, you should invoke do_cleanups to restore it.
+   inferior_pid is a global variable that needs to be changed by many of
+   these routines before calling functions in procfs.c.  In order to
+   guarantee that inferior_pid gets restored (in case of errors), you
+   need to call save_inferior_pid before changing it.  At the end of the
+   function, you should invoke do_cleanups to restore it.
 
  */
 
@@ -128,16 +129,16 @@ find_active_thread ()
   if (cached_active_thread != 0)
     return cached_active_thread;
 
-  read_memory ((CORE_ADDR)P_cma__g_current_thread,
-              (char *)&tcb_ptr,
+  read_memory ((CORE_ADDR) P_cma__g_current_thread,
+              (char *) &tcb_ptr,
               sizeof tcb_ptr);
 
-  read_memory (tcb_ptr, (char *)&tcb, sizeof tcb);
+  read_memory (tcb_ptr, (char *) &tcb, sizeof tcb);
 
   return (cma_thread_get_unique (&tcb.prolog.client_thread) << 16) | main_pid;
 }
 
-static cma__t_int_tcb * find_tcb PARAMS ((int thread));
+static cma__t_int_tcb *find_tcb PARAMS ((int thread));
 
 static cma__t_int_tcb *
 find_tcb (thread)
@@ -149,19 +150,19 @@ find_tcb (thread)
   if (thread == cached_thread)
     return &cached_tcb;
 
-  read_memory ((CORE_ADDR)P_cma__g_known_threads,
-              (char *)&queue_header,
+  read_memory ((CORE_ADDR) P_cma__g_known_threads,
+              (char *) &queue_header,
               sizeof queue_header);
 
   for (queue_ptr = queue_header.queue.flink;
-       queue_ptr != (cma__t_queue *)P_cma__g_known_threads;
+       queue_ptr != (cma__t_queue *) P_cma__g_known_threads;
        queue_ptr = cached_tcb.threads.flink)
     {
       cma__t_int_tcb *tcb_ptr;
 
       tcb_ptr = cma__base (queue_ptr, threads, cma__t_int_tcb);
 
-      read_memory ((CORE_ADDR)tcb_ptr, (char *)&cached_tcb, sizeof cached_tcb);
+      read_memory ((CORE_ADDR) tcb_ptr, (char *) &cached_tcb, sizeof cached_tcb);
 
       if (cached_tcb.header.type == cma__c_obj_tcb)
        if (cma_thread_get_unique (&cached_tcb.prolog.client_thread) == thread >> 16)
@@ -279,9 +280,9 @@ hpux_thread_wait (pid, ourstatus)
 
 static char regmap[NUM_REGS] =
 {
-  -2, -1, -1, 0, 4, 8, 12, 16, 20, 24, /* flags, r1 -> r9 */
-  28, 32, 36, 40, 44, 48, 52, 56, 60, -1, /* r10 -> r19 */
-  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* r20 -> r29 */
+  -2, -1, -1, 0, 4, 8, 12, 16, 20, 24, /* flags, r1 -> r9 */
+  28, 32, 36, 40, 44, 48, 52, 56, 60, -1,      /* r10 -> r19 */
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,      /* r20 -> r29 */
 
   /* r30, r31, sar, pcoqh, pcsqh, pcoqt, pcsqt, eiem, iir, isr */
   -2, -1, -1, -2, -1, -1, -1, -1, -1, -1,
@@ -293,14 +294,14 @@ static char regmap[NUM_REGS] =
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 
   -1, -1, -1, -1,              /* mpsfu_high, mpsfu_low, mpsfu_ovflo, pad */
-  144, -1, -1, -1, -1, -1, -1, -1, /* fpsr, fpe1 -> fpe7 */
-  -1, -1, -1, -1, -1, -1, -1, -1, /* fr4 -> fr7 */
-  -1, -1, -1, -1, -1, -1, -1, -1, /* fr8 -> fr11 */
-  136, -1, 128, -1, 120, -1, 112, -1, /* fr12 -> fr15 */
-  104, -1, 96, -1, 88, -1, 80, -1, /* fr16 -> fr19 */
-  72, -1, 64, -1, -1, -1, -1, -1, /* fr20 -> fr23 */
-  -1, -1, -1, -1, -1, -1, -1, -1, /* fr24 -> fr27 */
-  -1, -1, -1, -1, -1, -1, -1, -1, /* fr28 -> fr31 */
+  144, -1, -1, -1, -1, -1, -1, -1,     /* fpsr, fpe1 -> fpe7 */
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* fr4 -> fr7 */
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* fr8 -> fr11 */
+  136, -1, 128, -1, 120, -1, 112, -1,  /* fr12 -> fr15 */
+  104, -1, 96, -1, 88, -1, 80, -1,     /* fr16 -> fr19 */
+  72, -1, 64, -1, -1, -1, -1, -1,      /* fr20 -> fr23 */
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* fr24 -> fr27 */
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* fr28 -> fr31 */
 };
 
 static void
@@ -347,7 +348,7 @@ hpux_thread_fetch_registers (regno)
          unsigned char buf[MAX_REGISTER_RAW_SIZE];
          CORE_ADDR sp;
 
-         sp = (CORE_ADDR)tcb_ptr->static_ctx.sp - 160;
+         sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
 
          if (regno == FLAGS_REGNUM)
            /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */
@@ -410,13 +411,13 @@ hpux_thread_store_registers (regno)
          unsigned char buf[MAX_REGISTER_RAW_SIZE];
          CORE_ADDR sp;
 
-         sp = (CORE_ADDR)tcb_ptr->static_ctx.sp - 160;
+         sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
 
          if (regno == FLAGS_REGNUM)
-           child_ops.to_store_registers (regno); /* Let lower layer handle this... */
+           child_ops.to_store_registers (regno);       /* Let lower layer handle this... */
          else if (regno == SP_REGNUM)
            {
-             write_memory ((CORE_ADDR)&tcb_ptr->static_ctx.sp,
+             write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
                            registers + REGISTER_BYTE (regno),
                            REGISTER_RAW_SIZE (regno));
              tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
@@ -454,7 +455,7 @@ hpux_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
      char *myaddr;
      int len;
      int dowrite;
-     struct target_ops *target; /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   int retval;
   struct cleanup *old_chain;
index 436fd5ee9ab4b57cf85ba97bfb920ad563733337..3e50ca89edc73f51133896344843cf3fe5a3b15a 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1988, 1989, 1991, 1994, 1995, 1996, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -46,10 +47,11 @@ static int gdb_print_insn_i386 (bfd_vma, disassemble_info *);
 void _initialize_i386_tdep PARAMS ((void));
 
 /* This is the variable the is set with "set disassembly-flavor",
- and its legitimate values. */
  and its legitimate values. */
 static char att_flavor[] = "att";
 static char intel_flavor[] = "intel";
-static char *valid_flavors[] = {
+static char *valid_flavors[] =
+{
   att_flavor,
   intel_flavor,
   NULL
@@ -60,7 +62,7 @@ static char *disassembly_flavor = att_flavor;
 static void set_disassembly_flavor_sfunc PARAMS ((char *, int, struct cmd_list_element *));
 static void set_disassembly_flavor ();
 
-void (*disassembly_flavor_hook) PARAMS((char *args, int from_tty));
+void (*disassembly_flavor_hook) PARAMS ((char *args, int from_tty));
 
 /* Stdio style buffering was used to minimize calls to ptrace, but this
    buffering did not take into account that the code section being accessed
@@ -92,31 +94,31 @@ static int codestream_cnt;
 #define codestream_get() (codestream_cnt-- == 0 ? \
                         codestream_fill(0) : codestream_buf[codestream_off++])
 
-static unsigned char 
+static unsigned char
 codestream_fill (peek_flag)
-    int peek_flag;
+     int peek_flag;
 {
   codestream_addr = codestream_next_addr;
   codestream_next_addr += CODESTREAM_BUFSIZ;
   codestream_off = 0;
   codestream_cnt = CODESTREAM_BUFSIZ;
   read_memory (codestream_addr, (char *) codestream_buf, CODESTREAM_BUFSIZ);
-  
+
   if (peek_flag)
-    return (codestream_peek());
+    return (codestream_peek ());
   else
-    return (codestream_get());
+    return (codestream_get ());
 }
 
 static void
 codestream_seek (place)
-    CORE_ADDR place;
+     CORE_ADDR place;
 {
   codestream_next_addr = place / CODESTREAM_BUFSIZ;
   codestream_next_addr *= CODESTREAM_BUFSIZ;
   codestream_cnt = 0;
   codestream_fill (1);
-  while (codestream_tell() != place)
+  while (codestream_tell () != place)
     codestream_get ();
 }
 
@@ -162,7 +164,7 @@ i386_follow_jump ()
          delta = extract_signed_integer (buf, 2);
 
          /* include size of jmp inst (including the 0x66 prefix).  */
-         pos += delta + 4; 
+         pos += delta + 4;
        }
       else
        {
@@ -209,7 +211,7 @@ i386_get_frame_setup (pc)
       /*
        * this function must start with
        * 
-       *    popl %eax            0x58
+       *    popl %eax             0x58
        *    xchgl %eax, (%esp)  0x87 0x04 0x24
        * or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00
        *
@@ -222,8 +224,10 @@ i386_get_frame_setup (pc)
        */
       int pos;
       unsigned char buf[4];
-      static unsigned char proto1[3] = { 0x87,0x04,0x24 };
-      static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 };
+      static unsigned char proto1[3] =
+      {0x87, 0x04, 0x24};
+      static unsigned char proto2[4] =
+      {0x87, 0x44, 0x24, 0x00};
       pos = codestream_tell ();
       codestream_read (buf, 4);
       if (memcmp (buf, proto1, 3) == 0)
@@ -232,7 +236,7 @@ i386_get_frame_setup (pc)
        pos += 4;
 
       codestream_seek (pos);
-      op = codestream_get (); /* update next opcode */
+      op = codestream_get ();  /* update next opcode */
     }
 
   if (op == 0x68 || op == 0x6a)
@@ -265,11 +269,11 @@ i386_get_frame_setup (pc)
       if (buf[0] == 0xe8 && buf[6] == 0xc4 && buf[7] == 0x4)
        pos += sizeof (buf);
       codestream_seek (pos);
-      op = codestream_get (); /* update next opcode */
+      op = codestream_get ();  /* update next opcode */
     }
 
   if (op == 0x55)              /* pushl %ebp */
-    {                  
+    {
       /* check for movl %esp, %ebp - can be written two ways */
       switch (codestream_get ())
        {
@@ -285,7 +289,7 @@ i386_get_frame_setup (pc)
          return (-1);
        }
       /* check for stack adjustment 
-       *
+
        *  subl $XXX, %esp
        *
        * note: you can't subtract a 16 bit immediate
@@ -306,13 +310,13 @@ i386_get_frame_setup (pc)
          /* subl with signed byte immediate 
           * (though it wouldn't make sense to be negative)
           */
-         return (codestream_get());
+         return (codestream_get ());
        }
       else if (op == 0x81)
        {
          char buf[4];
          /* Maybe it is subl with 32 bit immedediate.  */
-         codestream_get();
+         codestream_get ();
          if (codestream_get () != 0xec)
            /* Some instruction starting with 0x81 other than subl.  */
            {
@@ -320,7 +324,7 @@ i386_get_frame_setup (pc)
              return 0;
            }
          /* It is subl with 32 bit immediate.  */
-         codestream_read ((unsigned char *)buf, 4);
+         codestream_read ((unsigned char *) buf, 4);
          return extract_signed_integer (buf, 4);
        }
       else
@@ -332,8 +336,8 @@ i386_get_frame_setup (pc)
     {
       char buf[2];
       /* enter instruction: arg is 16 bit unsigned immed */
-      codestream_read ((unsigned char *)buf, 2);
-      codestream_get (); /* flush final byte of enter instruction */
+      codestream_read ((unsigned char *) buf, 2);
+      codestream_get ();       /* flush final byte of enter instruction */
       return extract_unsigned_integer (buf, 2);
     }
   return (-1);
@@ -354,8 +358,8 @@ i386_frame_num_args (fi)
      this call and a previous one, and we would say there are more args
      than there really are.  */
 
-  int retpc;                                           
-  unsigned char op;                                    
+  int retpc;
+  unsigned char op;
   struct frame_info *pfi;
 
   /* on the 386, the instruction following the call could be:
@@ -372,38 +376,38 @@ i386_frame_num_args (fi)
        nameless arguments.  */
     return -1;
 
-  pfi = get_prev_frame (fi);                   
+  pfi = get_prev_frame (fi);
   if (pfi == 0)
     {
       /* Note:  this can happen if we are looking at the frame for
-        main, because FRAME_CHAIN_VALID won't let us go into
-        start.  If we have debugging symbols, that's not really
-        a big deal; it just means it will only show as many arguments
-        to main as are declared.  */
+         main, because FRAME_CHAIN_VALID won't let us go into
+         start.  If we have debugging symbols, that's not really
+         a big deal; it just means it will only show as many arguments
+         to main as are declared.  */
       return -1;
     }
   else
     {
-      retpc = pfi->pc;                                 
-      op = read_memory_integer (retpc, 1);                     
-      if (op == 0x59)                                  
-       /* pop %ecx */                         
-       return 1;                               
+      retpc = pfi->pc;
+      op = read_memory_integer (retpc, 1);
+      if (op == 0x59)
+       /* pop %ecx */
+       return 1;
       else if (op == 0x83)
        {
-         op = read_memory_integer (retpc+1, 1);        
-         if (op == 0xc4)                               
-           /* addl $<signed imm 8 bits>, %esp */       
-           return (read_memory_integer (retpc+2,1)&0xff)/4;
+         op = read_memory_integer (retpc + 1, 1);
+         if (op == 0xc4)
+           /* addl $<signed imm 8 bits>, %esp */
+           return (read_memory_integer (retpc + 2, 1) & 0xff) / 4;
          else
            return 0;
        }
       else if (op == 0x81)
-       { /* add with 32 bit immediate */
-         op = read_memory_integer (retpc+1, 1);        
-         if (op == 0xc4)                               
-           /* addl $<imm 32>, %esp */          
-           return read_memory_integer (retpc+2, 4) / 4;
+       {                       /* add with 32 bit immediate */
+         op = read_memory_integer (retpc + 1, 1);
+         if (op == 0xc4)
+           /* addl $<imm 32>, %esp */
+           return read_memory_integer (retpc + 2, 4) / 4;
          else
            return 0;
        }
@@ -455,49 +459,49 @@ i386_frame_find_saved_regs (fip, fsrp)
   CORE_ADDR adr;
   CORE_ADDR pc;
   int i;
-  
+
   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) 
+  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++) 
+      for (i = 0; i < NUM_REGS; i++)
        {
          adr -= REGISTER_RAW_SIZE (i);
          fsrp->regs[i] = adr;
        }
       return;
     }
-  
+
   pc = get_pc_function_start (fip->pc);
   if (pc != 0)
     locals = i386_get_frame_setup (pc);
-  
-  if (locals >= 0) 
+
+  if (locals >= 0)
     {
       adr = fip->frame - 4 - locals;
-      for (i = 0; i < 8; i++) 
+      for (i = 0; i < 8; i++)
        {
          op = codestream_get ();
          if (op < 0x50 || op > 0x57)
            break;
 #ifdef I386_REGNO_TO_SYMMETRY
          /* Dynix uses different internal numbering.  Ick.  */
-         fsrp->regs[I386_REGNO_TO_SYMMETRY(op - 0x50)] = adr;
+         fsrp->regs[I386_REGNO_TO_SYMMETRY (op - 0x50)] = adr;
 #else
          fsrp->regs[op - 0x50] = adr;
 #endif
          adr -= 4;
        }
     }
-  
+
   fsrp->regs[PC_REGNUM] = fip->frame + 4;
   fsrp->regs[FP_REGNUM] = fip->frame;
 }
@@ -510,43 +514,44 @@ i386_skip_prologue (pc)
 {
   unsigned char op;
   int i;
-  static unsigned char pic_pat[6] = { 0xe8, 0, 0, 0, 0, /* call   0x0 */
-                                     0x5b,             /* popl   %ebx */
-                                   };
+  static unsigned char pic_pat[6] =
+  {0xe8, 0, 0, 0, 0,           /* call   0x0 */
+   0x5b,                       /* popl   %ebx */
+  };
   CORE_ADDR pos;
-  
+
   if (i386_get_frame_setup (pc) < 0)
     return (pc);
-  
+
   /* found valid frame setup - codestream now points to 
    * start of push instructions for saving registers
    */
-  
+
   /* skip over register saves */
   for (i = 0; i < 8; i++)
     {
       op = codestream_peek ();
       /* break if not pushl inst */
-      if (op < 0x50 || op > 0x57) 
+      if (op < 0x50 || op > 0x57)
        break;
       codestream_get ();
     }
 
   /* The native cc on SVR4 in -K PIC mode inserts the following code to get
      the address of the global offset table (GOT) into register %ebx.
-      call     0x0
-      popl     %ebx
-      movl     %ebx,x(%ebp)    (optional)
-      addl     y,%ebx
+     call       0x0
+     popl       %ebx
+     movl       %ebx,x(%ebp)    (optional)
+     addl       y,%ebx
      This code is with the rest of the prologue (at the end of the
      function), so we have to skip it to get to the first real
      instruction at the start of the function.  */
-     
+
   pos = codestream_tell ();
   for (i = 0; i < 6; i++)
     {
       op = codestream_get ();
-      if (pic_pat [i] != op)
+      if (pic_pat[i] != op)
        break;
     }
   if (i == 6)
@@ -555,33 +560,33 @@ i386_skip_prologue (pc)
       long delta = 6;
 
       op = codestream_get ();
-      if (op == 0x89)                  /* movl %ebx, x(%ebp) */
+      if (op == 0x89)          /* movl %ebx, x(%ebp) */
        {
          op = codestream_get ();
-         if (op == 0x5d)               /* one byte offset from %ebp */
+         if (op == 0x5d)       /* one byte offset from %ebp */
            {
              delta += 3;
              codestream_read (buf, 1);
            }
-         else if (op == 0x9d)          /* four byte offset from %ebp */
+         else if (op == 0x9d)  /* four byte offset from %ebp */
            {
              delta += 6;
              codestream_read (buf, 4);
            }
-         else                          /* unexpected instruction */
-             delta = -1;
-          op = codestream_get ();
+         else                  /* unexpected instruction */
+           delta = -1;
+         op = codestream_get ();
        }
-                                       /* addl y,%ebx */
-      if (delta > 0 && op == 0x81 && codestream_get () == 0xc3) 
+      /* addl y,%ebx */
+      if (delta > 0 && op == 0x81 && codestream_get () == 0xc3)
        {
-           pos += delta + 6;
+         pos += delta + 6;
        }
     }
   codestream_seek (pos);
-  
+
   i386_follow_jump ();
-  
+
   return (codestream_tell ());
 }
 
@@ -591,7 +596,7 @@ i386_push_dummy_frame ()
   CORE_ADDR sp = read_register (SP_REGNUM);
   int regnum;
   char regbuf[MAX_REGISTER_RAW_SIZE];
-  
+
   sp = push_word (sp, read_register (PC_REGNUM));
   sp = push_word (sp, read_register (FP_REGNUM));
   write_register (FP_REGNUM, sp);
@@ -611,10 +616,10 @@ i386_pop_frame ()
   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++) 
+  for (regnum = 0; regnum < NUM_REGS; regnum++)
     {
       CORE_ADDR adr;
       adr = fsr.regs[regnum];
@@ -639,7 +644,7 @@ i386_pop_frame ()
    This routine returns true on success. */
 
 int
-get_longjmp_target(pc)
+get_longjmp_target (pc)
      CORE_ADDR *pc;
 {
   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
@@ -647,7 +652,7 @@ get_longjmp_target(pc)
 
   sp = read_register (SP_REGNUM);
 
-  if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
+  if (target_read_memory (sp + SP_ARG0,                /* Offset of first arg on stack */
                          buf,
                          TARGET_PTR_BIT / TARGET_CHAR_BIT))
     return 0;
@@ -666,26 +671,26 @@ get_longjmp_target(pc)
 #endif /* GET_LONGJMP_TARGET */
 
 void
-i386_extract_return_value(type, regbuf, valbuf)
+i386_extract_return_value (type, regbuf, valbuf)
      struct type *type;
      char regbuf[REGISTER_BYTES];
      char *valbuf;
 {
 /* On AIX, floating point values are returned in floating point registers.  */
 #ifdef I386_AIX_TARGET
-  if (TYPE_CODE_FLT == TYPE_CODE(type))
+  if (TYPE_CODE_FLT == TYPE_CODE (type))
     {
       double d;
       /* 387 %st(0), gcc uses this */
       floatformat_to_double (&floatformat_i387_ext,
-                            &regbuf[REGISTER_BYTE(FP0_REGNUM)],
+                            &regbuf[REGISTER_BYTE (FP0_REGNUM)],
                             &d);
       store_floating (valbuf, TYPE_LENGTH (type), d);
     }
   else
 #endif /* I386_AIX_TARGET */
-    { 
-      memcpy (valbuf, regbuf, TYPE_LENGTH (type)); 
+    {
+      memcpy (valbuf, regbuf, TYPE_LENGTH (type));
     }
 }
 
@@ -729,12 +734,12 @@ sunpro_static_transform_name (name)
   if (IS_STATIC_TRANSFORM_NAME (name))
     {
       /* For file-local statics there will be a period, a bunch
-        of junk (the contents of which match a string given in the
-        N_OPT), a period and the name.  For function-local statics
-        there will be a bunch of junk (which seems to change the
-        second character from 'A' to 'B'), a period, the name of the
-        function, and the name.  So just skip everything before the
-        last period.  */
+         of junk (the contents of which match a string given in the
+         N_OPT), a period and the name.  For function-local statics
+         there will be a bunch of junk (which seems to change the
+         second character from 'A' to 'B'), a period, the name of the
+         function, and the name.  So just skip everything before the
+         last period.  */
       p = strrchr (name, '.');
       if (p != NULL)
        name = p + 1;
@@ -752,17 +757,17 @@ skip_trampoline_code (pc, name)
      CORE_ADDR pc;
      char *name;
 {
-  if (pc && read_memory_unsigned_integer (pc, 2) == 0x25ff) /* jmp *(dest) */
+  if (pc && read_memory_unsigned_integer (pc, 2) == 0x25ff)    /* jmp *(dest) */
     {
-      unsigned long indirect = read_memory_unsigned_integer (pc+2, 4);
+      unsigned long indirect = read_memory_unsigned_integer (pc + 2, 4);
       struct minimal_symbol *indsym =
-       indirect ? lookup_minimal_symbol_by_pc (indirect) : 0;
-      char *symname = indsym ? SYMBOL_NAME(indsym) : 0;
+      indirect ? lookup_minimal_symbol_by_pc (indirect) : 0;
+      char *symname = indsym ? SYMBOL_NAME (indsym) : 0;
 
-      if (symname) 
+      if (symname)
        {
-         if (strncmp (symname,"__imp_", 6) == 0
-             || strncmp (symname,"_imp_", 5) == 0)
+         if (strncmp (symname, "__imp_", 6) == 0
+             || strncmp (symname, "_imp_", 5) == 0)
            return name ? 1 : read_memory_unsigned_integer (indirect, 4);
        }
     }
@@ -772,7 +777,7 @@ skip_trampoline_code (pc, name)
 static int
 gdb_print_insn_i386 (memaddr, info)
      bfd_vma memaddr;
-     disassemble_info * info;
+     disassemble_info *info;
 {
   if (disassembly_flavor == att_flavor)
     return print_insn_i386_att (memaddr, info);
@@ -794,9 +799,9 @@ set_disassembly_flavor_sfunc (args, from_tty, c)
      struct cmd_list_element *c;
 {
   set_disassembly_flavor ();
-  
+
   if (disassembly_flavor_hook != NULL)
-    disassembly_flavor_hook(args, from_tty);
+    disassembly_flavor_hook (args, from_tty);
 }
 
 static void
@@ -812,24 +817,24 @@ void
 _initialize_i386_tdep ()
 {
   struct cmd_list_element *new_cmd;
-  
+
   tm_print_insn = gdb_print_insn_i386;
   tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach;
 
   /* Add the variable that controls the disassembly flavor */
 
   new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
-                                 valid_flavors,
-                                 (char *) &disassembly_flavor,
-                                 "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
+                             valid_flavors,
+                             (char *) &disassembly_flavor,
+                             "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
 and the default value is \"att\".",
-                                 &setlist);
+                             &setlist);
   new_cmd->function.sfunc = set_disassembly_flavor_sfunc;
-  add_show_from_set(new_cmd, &showlist);
-  
+  add_show_from_set (new_cmd, &showlist);
+
   /* Finally, initialize the disassembly flavor to the default given
      in the disassembly_flavor variable */
 
   set_disassembly_flavor ();
-  
+
 }
index 83e9624a00f6453d183afe3dfa98d1c867850621..a874dd00507d39d035864eb853b00db6e979ceed 100644 (file)
@@ -1,21 +1,22 @@
 /* Intel 386 native support.
    Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -52,11 +53,11 @@ extern int errno;
 #include "target.h"
 
 static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
-
 \f
+
 /* this table must line up with REGISTER_NAMES in tm-i386v.h */
 /* symbols like 'EAX' come from <sys/reg.h> */
-static int regmap[] = 
+static int regmap[] =
 {
   EAX, ECX, EDX, EBX,
   USP, EBP, ESI, EDI,
@@ -78,25 +79,25 @@ i386_register_u_addr (blockend, regnum)
   /* 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) 
+  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);
+      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 
+struct env387
 {
   unsigned short control;
   unsigned short r0;
@@ -123,50 +124,58 @@ print_387_status (status, ep)
   int top;
   int fpreg;
   unsigned char *p;
-  
+
   bothstatus = ((status != 0) && (ep->status != 0));
-  if (status != 0) 
+  if (status != 0)
     {
       if (bothstatus)
        printf_unfiltered ("u: ");
       print_387_status_word (status);
     }
-  
-  if (ep->status != 0) 
+
+  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));
+  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--) 
+  for (fpreg = 7; fpreg >= 0; fpreg--)
     {
       double val;
 
       printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
 
-      switch ((ep->tag >> ((7 - fpreg) * 2)) & 3) 
+      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;
+       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);
+
+      i387_to_double ((char *) ep->regs[fpreg], (char *) &val);
       printf_unfiltered ("  %#g\n", val);
     }
 }
@@ -188,17 +197,17 @@ i386_float_info ()
       char buf[10];
       unsigned short status;
 
-      ptrace (PT_READ_FPR, inferior_pid, buf, offsetof(struct env387, status));
+      ptrace (PT_READ_FPR, inferior_pid, 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));
+       memcpy (&fps, &core_env387, sizeof (fps));
     }
-  
-  if (fpsaved == 0) 
+
+  if (fpsaved == 0)
     {
       printf_unfiltered ("no floating point status saved\n");
       return;
@@ -207,14 +216,14 @@ i386_float_info ()
   if (inferior_pid)
     {
       int offset;
-      for (offset = 0; offset < sizeof(fps); offset += 10)
+      for (offset = 0; offset < sizeof (fps); offset += 10)
        {
          char buf[10];
          ptrace (PT_READ_FPR, inferior_pid, buf, offset);
-         memcpy ((char *)&fps.control + offset, buf,
-                 MIN(10, sizeof(fps) - 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);
@@ -228,11 +237,11 @@ fetch_register (regno)
 {
   char buf[MAX_REGISTER_RAW_SIZE];
   if (regno < FP0_REGNUM)
-    *(int *)buf = ptrace (PT_READ_GPR, inferior_pid,
-                         PT_REG(regmap[regno]), 0, 0);
+    *(int *) buf = ptrace (PT_READ_GPR, inferior_pid,
+                          PT_REG (regmap[regno]), 0, 0);
   else
     ptrace (PT_READ_FPR, inferior_pid, buf,
-           (regno - FP0_REGNUM)*10 + offsetof(struct env387, regs));
+           (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
   supply_register (regno, buf);
 }
 
@@ -255,11 +264,11 @@ store_register (regno)
   char buf[80];
   errno = 0;
   if (regno < FP0_REGNUM)
-    ptrace (PT_WRITE_GPR, inferior_pid, PT_REG(regmap[regno]),
+    ptrace (PT_WRITE_GPR, inferior_pid, PT_REG (regmap[regno]),
            *(int *) &registers[REGISTER_BYTE (regno)], 0);
   else
     ptrace (PT_WRITE_FPR, inferior_pid, &registers[REGISTER_BYTE (regno)],
-           (regno - FP0_REGNUM)*10 + offsetof(struct env387, regs));
+           (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
 
   if (errno != 0)
     {
@@ -283,29 +292,29 @@ store_inferior_registers (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
+#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[] = 
+static int core_regmap[] =
 {
   CD_AX, CD_CX, CD_DX, CD_BX,
   CD_SP, CD_BP, CD_SI, CD_DI,
@@ -330,7 +339,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 
       int i;
       for (i = 0; i < FP0_REGNUM; i++)
-       regs(i) = cd_regs(core_regmap[i]);
+       regs (i) = cd_regs (core_regmap[i]);
     }
   else if (which == 2)
     {
@@ -342,8 +351,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
        fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
     }
 }
-
 \f
+
 /* Register that we are able to handle i386aix core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index e784773f0834d439d81894c7ab3afdb8d05a5d0e..642b19b5a922557aded7553ad09e6501ce14abe4 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent code for BSD Unix running on i386's, for GDB.
    Copyright 1988, 1989, 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
@@ -27,27 +28,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "inferior.h"
 
 void
-fetch_inferior_registers(regno)
+fetch_inferior_registers (regno)
      int regno;
 {
   struct reg inferior_registers;
 
-  ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-  memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers, 4*NUM_REGS);
+  ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+  memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers, 4 * NUM_REGS);
   registers_fetched ();
 }
 
 void
-store_inferior_registers(regno)
+store_inferior_registers (regno)
      int regno;
 {
   struct reg inferior_registers;
 
-  memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)], 4*NUM_REGS);
-  ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+  memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)], 4 * NUM_REGS);
+  ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) & inferior_registers, 0);
 }
 
-struct md_core {
+struct md_core
+{
   struct reg intreg;
   struct fpreg freg;
 };
@@ -59,11 +61,11 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
      int which;
      CORE_ADDR ignore;
 {
-  struct md_core *core_reg = (struct md_core *)core_reg_sect;
+  struct md_core *core_reg = (struct md_core *) core_reg_sect;
 
   /* integer registers */
-  memcpy(&registers[REGISTER_BYTE (0)], &core_reg->intreg,
-        sizeof(struct reg));
+  memcpy (&registers[REGISTER_BYTE (0)], &core_reg->intreg,
+         sizeof (struct reg));
   /* floating point registers */
   /* XXX */
 }
@@ -74,7 +76,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
 
 /* this table must line up with REGISTER_NAMES in tm-i386.h */
 /* symbols like 'tEAX' come from <machine/reg.h> */
-static int tregmap[] = 
+static int tregmap[] =
 {
   tEAX, tECX, tEDX, tEBX,
   tESP, tEBP, tESI, tEDI,
@@ -82,7 +84,7 @@ static int tregmap[] =
 };
 
 #ifdef sEAX
-static int sregmap[] = 
+static int sregmap[] =
 {
   sEAX, sECX, sEDX, sEBX,
   sESP, sEBP, sESI, sEDI,
@@ -93,7 +95,7 @@ static int sregmap[] =
 /* FreeBSD has decided to collapse the s* and t* symbols.  So if the s*
    ones aren't around, use the t* ones for sregmap too.  */
 
-static int sregmap[] = 
+static int sregmap[] =
 {
   tEAX, tECX, tEDX, tEBX,
   tESP, tEBP, tESI, tEDI,
@@ -126,7 +128,7 @@ i386_register_u_addr (blockend, regnum)
 
 #ifdef FLOAT_INFO
 #include "expression.h"
-#include "language.h"                  /* for local_hex_string */
+#include "language.h"          /* for local_hex_string */
 #include "floatformat.h"
 
 #include <sys/param.h>
@@ -140,35 +142,35 @@ i386_register_u_addr (blockend, regnum)
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/uio.h>
-#define curpcb Xcurpcb /* XXX avoid leaking declaration from pcb.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_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];
-};
+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 (status, ep)
@@ -179,58 +181,66 @@ print_387_status (status, ep)
   int bothstatus;
   int top;
   int fpreg;
-  
+
   bothstatus = ((status != 0) && (ep->status != 0));
-  if (status != 0) 
+  if (status != 0)
     {
       if (bothstatus)
        printf_unfiltered ("u: ");
-      print_387_status_word ((unsigned int)status);
+      print_387_status_word ((unsigned int) status);
     }
-  
-  if (ep->status != 0) 
+
+  if (ep->status != 0)
     {
       if (bothstatus)
        printf_unfiltered ("e: ");
-      print_387_status_word ((unsigned int)ep->status);
+      print_387_status_word ((unsigned int) ep->status);
     }
-  
-  print_387_control_word ((unsigned int)ep->control);
+
+  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));
+  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--) 
+  for (fpreg = 7; fpreg >= 0; fpreg--)
     {
       double val;
-      
-      printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg); 
 
-      switch ((ep->tag >> (fpreg * 2)) & 3) 
+      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;
+       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);
+
+      floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg],
+                            &val);
       printf_unfiltered ("  %g\n", val);
     }
 }
 
 i386_float_info ()
 {
-  struct user u; /* just for address computations */
+  struct user u;               /* just for address computations */
   int i;
   /* fpstate defined in <sys/user.h> */
   struct fpstate *fpstatep;
@@ -239,41 +249,41 @@ i386_float_info ()
   char fpvalid;
   unsigned int rounded_addr;
   unsigned int rounded_size;
-  /*extern int corechan;*/
+  /*extern int corechan; */
   int skip;
   extern int inferior_pid;
-  
-  uaddr = (char *)&U_FPSTATE(u) - (char *)&u;
-  if (inferior_pid) 
+
+  uaddr = (char *) &U_FPSTATE (u) - (char *) &u;
+  if (inferior_pid)
     {
       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 = (int *) buf;
+      for (i = 0; i < rounded_size; i++)
        {
-         *ip++ = ptrace (PT_READ_U, inferior_pid, (caddr_t)rounded_addr, 0);
+         *ip++ = ptrace (PT_READ_U, inferior_pid, (caddr_t) rounded_addr, 0);
          rounded_addr += sizeof (int);
        }
-    } 
-  else 
+    }
+  else
     {
-      printf("float info: can't do a core file (yet)\n");
+      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");
+      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);
+
+  print_387_status (0, (struct env387 *) buf);
 }
 
 int
index 6ed92c167f5da85e5b28d15053a504364204dfbd..6834ea011b0a1b864b390614dcf34fbde924f6f5 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to I386 running the GNU Hurd
    Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -37,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <target.h>
 
 /* @@@ Should move print_387_status() to i387-tdep.c */
-extern void print_387_control_word ();         /* i387-tdep.h */
+extern void print_387_control_word (); /* i387-tdep.h */
 extern void print_387_status_word ();
 \f
 /* Find offsets to thread states at compile time.
@@ -51,12 +52,12 @@ extern void print_387_status_word ();
  * location where the gdb registers[i] is stored.
  */
 
-static int reg_offset[] = 
+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)
+  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_ADDR(state,regnum) ((char *)(state)+reg_offset[regnum])
@@ -84,29 +85,29 @@ gnu_fetch_registers (int reg)
 {
   struct proc *thread;
   thread_state_t state;
-  
-  inf_update_procs (current_inferior); /* Make sure we know about new threads.  */
+
+  inf_update_procs (current_inferior); /* Make sure we know about new threads.  */
 
   thread = inf_tid_to_thread (current_inferior, inferior_pid);
-  if (! thread)
+  if (!thread)
     error ("fetch inferior registers: %d: Invalid thread", inferior_pid);
 
   state = proc_get_state (thread, 0);
 
-  if (! state)
+  if (!state)
     warning ("Couldn't fetch register %s from %s (invalid thread).",
             REGISTER_NAME (reg), proc_string (thread));
   else if (reg >= 0)
     {
       proc_debug (thread, "fetching register: %s", REGISTER_NAME (reg));
-      supply_register (reg, REG_ADDR(state, reg));
+      supply_register (reg, REG_ADDR (state, reg));
       thread->fetched_regs |= (1 << reg);
     }
   else
     {
       proc_debug (thread, "fetching all registers");
-      for (reg = 0; reg < NUM_REGS; reg++) 
-       supply_register (reg, REG_ADDR(state, reg));
+      for (reg = 0; reg < NUM_REGS; reg++)
+       supply_register (reg, REG_ADDR (state, reg));
       thread->fetched_regs = ~0;
     }
 }
@@ -125,28 +126,28 @@ gnu_store_registers (reg)
   int was_aborted, was_valid;
   thread_state_t state;
   thread_state_data_t old_state;
-  
-  inf_update_procs (current_inferior); /* Make sure we know about new threads.  */
+
+  inf_update_procs (current_inferior); /* Make sure we know about new threads.  */
 
   thread = inf_tid_to_thread (current_inferior, inferior_pid);
-  if (! thread)
+  if (!thread)
     error ("store inferior registers: %d: Invalid thread", inferior_pid);
 
   proc_debug (thread, "storing register %s.", REGISTER_NAME (reg));
 
   was_aborted = thread->aborted;
   was_valid = thread->state_valid;
-  if (! was_aborted && was_valid)
+  if (!was_aborted && was_valid)
     bcopy (&thread->state, &old_state, sizeof (old_state));
 
   state = proc_get_state (thread, 1);
 
-  if (! state)
+  if (!state)
     warning ("Couldn't store register %s from %s (invalid thread).",
             REGISTER_NAME (reg), proc_string (thread));
   else
     {
-      if (! was_aborted && was_valid)
+      if (!was_aborted && was_valid)
        /* See which registers have changed after aborting the thread.  */
        {
          int check_reg;
@@ -175,7 +176,7 @@ gnu_store_registers (reg)
       else
        {
          proc_debug (thread, "storing all registers");
-         for (reg = 0; reg < NUM_REGS; reg++) 
+         for (reg = 0; reg < NUM_REGS; reg++)
            STORE_REGS (state, reg, 1);
        }
     }
@@ -186,7 +187,7 @@ gnu_store_registers (reg)
  *
  * i387 status dumper. See also i387-tdep.c
  */
-struct env387 
+struct env387
 {
   unsigned short control;
   unsigned short r0;
@@ -215,80 +216,90 @@ print_387_status (status, ep)
   int top;
   int fpreg;
   unsigned char *p;
-  
+
   bothstatus = ((status != 0) && (ep->status != 0));
-  if (status != 0) 
+  if (status != 0)
     {
       if (bothstatus)
        printf_unfiltered ("u: ");
       print_387_status_word (status);
     }
-  
-  if (ep->status != 0) 
+
+  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));
-  
+  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--) 
+  for (fpreg = 7; fpreg >= 0; fpreg--)
     {
       double val;
-      
+
       printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
-      
-      switch ((ep->tag >> (fpreg * 2)) & 3) 
+
+      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;
+       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);
+
+      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));
+    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));
+    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));
+    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));
+    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                           */
+#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 {
+typedef struct fpstate
+{
 #if 1
-  unsigned char        state[FP_STATE_BYTES]; /* "hardware" state */
+  unsigned char state[FP_STATE_BYTES]; /* "hardware" state */
 #else
-  struct env387        state;  /* Actually this */
+  struct env387 state;         /* Actually this */
 #endif
-  int status;          /* Duplicate status */
-} *fpstate_t;
+  int status;                  /* Duplicate status */
+}
+ *fpstate_t;
 
 /* Mach 3 specific routines.
  */
@@ -301,7 +312,7 @@ get_i387_state (fstate)
   unsigned int fsCnt = i386_FLOAT_STATE_COUNT;
   struct i386_float_state *fsp;
   struct proc *thread = inf_tid_to_thread (current_inferior, inferior_pid);
-  
+
   if (!thread)
     error ("get_i387_state: Invalid thread");
 
@@ -315,7 +326,7 @@ get_i387_state (fstate)
       return 0;
     }
 
-  fsp = (struct i386_float_state *)state;
+  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 0;
@@ -327,7 +338,7 @@ get_i387_state (fstate)
 
   fstate->status = fsp->exc_status;
 
-  memcpy (fstate->state, (char *)&fsp->hw_state, FP_STATE_BYTES);
+  memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES);
 
   return 1;
 }
@@ -336,22 +347,22 @@ get_i387_state (fstate)
  * This is called by "info float" command
  */
 void
-i386_mach3_float_info()
+i386_mach3_float_info ()
 {
-  char buf [sizeof (struct fpstate) + 2 * sizeof (int)];
+  char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
   int valid = 0;
   fpstate_t fps;
-  
+
   if (target_has_execution)
     valid = get_i387_state (buf);
 
-  if (!valid) 
+  if (!valid)
     {
       warning ("no floating point status saved");
       return;
     }
-  
+
   fps = (fpstate_t) buf;
 
-  print_387_status (fps->status, (struct env387 *)fps->state);
+  print_387_status (fps->status, (struct env387 *) fps->state);
 }
index 101f4edd8c6afba656db27ce1eceba2663621b4d..1b011212824983a7327b5569c4e575b703b5d35b 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for Intel 386 running LynxOS.
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -33,7 +34,8 @@ i386lynx_saved_pc_after_call (frame)
      struct frame_info *frame;
 {
   char opcode[7];
-  static const unsigned char call_inst[] = {0x9a, 0, 0, 0, 0, 8, 0}; /* lcall 0x8,0x0 */
+  static const unsigned char call_inst[] =
+  {0x9a, 0, 0, 0, 0, 8, 0};    /* lcall 0x8,0x0 */
 
   read_memory (frame->pc - 7, opcode, 7);
   if (memcmp (opcode, call_inst, 7) == 0)
index c0257b18584931e8c99a65765a661e763b65a5f5..61fd3846af78d9a1ea465e73aa4c62901f304dcb 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to I386 running mach 3.0.
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -34,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #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.
  *
@@ -49,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #elif UPAGES == 2
 #define UAREA_SIZE (NBPG*UPAGES)
 #else
-FIXME!! UPAGES is neither 2 nor 16
+FIXME ! !UPAGES is neither 2 nor 16
 #endif
 
 /* @@@ Should move print_387_status() to i387-tdep.c */
@@ -57,8 +58,8 @@ extern void print_387_control_word ();                /* i387-tdep.h */
 extern void print_387_status_word ();
 
 #define private static
-
 \f
+
 /* 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 :-)
@@ -70,12 +71,12 @@ extern void print_387_status_word ();
  * location where the gdb registers[i] is stored.
  */
 
-static int reg_offset[] = 
+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)
+  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])
@@ -107,8 +108,8 @@ fetch_inferior_registers (regno)
   thread_state_data_t state;
   unsigned int stateCnt = i386_THREAD_STATE_COUNT;
   int index;
-  
-  if (! MACH_PORT_VALID (current_thread))
+
+  if (!MACH_PORT_VALID (current_thread))
     error ("fetch inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -127,12 +128,12 @@ fetch_inferior_registers (regno)
    * since we fetched them all anyway
    */
   else if (regno != -1)
-    supply_register (regno, (char *)state+reg_offset[regno]);
+    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]);
+      for (index = 0; index < NUM_REGS; index++)
+       supply_register (index, (char *) state + reg_offset[index]);
     }
 
   if (must_suspend_thread)
@@ -154,7 +155,7 @@ store_inferior_registers (regno)
   unsigned int stateCnt = i386_THREAD_STATE_COUNT;
   register int index;
 
-  if (! MACH_PORT_VALID (current_thread))
+  if (!MACH_PORT_VALID (current_thread))
     error ("store inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -166,7 +167,7 @@ store_inferior_registers (regno)
                          state,
                          &stateCnt);
 
-   if (ret != KERN_SUCCESS) 
+  if (ret != KERN_SUCCESS)
     {
       warning ("store_inferior_registers (get): %s",
               mach_error_string (ret));
@@ -176,7 +177,7 @@ store_inferior_registers (regno)
     }
 
   /* 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)
@@ -187,17 +188,17 @@ store_inferior_registers (regno)
   else
 #endif
     {
-      for (index = 0; index < NUM_REGS; index++) 
+      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));
@@ -205,9 +206,9 @@ store_inferior_registers (regno)
   if (must_suspend_thread)
     setup_thread (current_thread, 0);
 }
-
 \f
 
+
 /* 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?
@@ -230,7 +231,7 @@ register_addr (regno, blockend)
     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);
+  addr = (unsigned int) REG_ADDRESS (UAREA_SIZE - sizeof (struct i386_thread_state), regno);
 
   return addr;
 }
@@ -240,7 +241,7 @@ register_addr (regno, blockend)
  *
  * i387 status dumper. See also i387-tdep.c
  */
-struct env387 
+struct env387
 {
   unsigned short control;
   unsigned short r0;
@@ -269,80 +270,90 @@ print_387_status (status, ep)
   int top;
   int fpreg;
   unsigned char *p;
-  
+
   bothstatus = ((status != 0) && (ep->status != 0));
-  if (status != 0) 
+  if (status != 0)
     {
       if (bothstatus)
        printf_unfiltered ("u: ");
       print_387_status_word (status);
     }
-  
-  if (ep->status != 0) 
+
+  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));
-  
+  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--) 
+  for (fpreg = 7; fpreg >= 0; fpreg--)
     {
       double val;
-      
+
       printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
-      
-      switch ((ep->tag >> (fpreg * 2)) & 3) 
+
+      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;
+       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);
+
+      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));
+    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));
+    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));
+    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));
+    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                           */
+#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 {
+typedef struct fpstate
+{
 #if 1
-  unsigned char        state[FP_STATE_BYTES]; /* "hardware" state */
+  unsigned char state[FP_STATE_BYTES]; /* "hardware" state */
 #else
-  struct env387        state;  /* Actually this */
+  struct env387 state;         /* Actually this */
 #endif
-  int status;          /* Duplicate status */
-} *fpstate_t;
+  int status;                  /* Duplicate status */
+}
+ *fpstate_t;
 
 /* Mach 3 specific routines.
  */
@@ -354,7 +365,7 @@ get_i387_state (fstate)
   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,
@@ -367,7 +378,7 @@ get_i387_state (fstate)
       return FALSE;
     }
 
-  fsp = (struct i386_float_state *)state;
+  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;
@@ -379,7 +390,7 @@ get_i387_state (fstate)
 
   fstate->status = fsp->exc_status;
 
-  memcpy (fstate->state, (char *)&fsp->hw_state, FP_STATE_BYTES);
+  memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES);
 
   return TRUE;
 }
@@ -396,26 +407,26 @@ get_i387_core_state (fstate)
  * This is called by "info float" command
  */
 void
-i386_mach3_float_info()
+i386_mach3_float_info ()
 {
-  char buf [sizeof (struct fpstate) + 2 * sizeof (int)];
+  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 */
+#if 0
+  else if (WE HAVE CORE FILE)  /* @@@@ Core files not supported */
     valid = get_i387_core_state (buf);
-#endif    
+#endif
 
-  if (!valid) 
+  if (!valid)
     {
       warning ("no floating point status saved");
       return;
     }
-  
+
   fps = (fpstate_t) buf;
 
-  print_387_status (fps->status, (struct env387 *)fps->state);
+  print_387_status (fps->status, (struct env387 *) fps->state);
 }
index 91090db155221e8fbc0392105d45631d978cc1d5..e0121886ee57da3b2924c3aaa2f47463f3b6d075 100644 (file)
@@ -1,21 +1,22 @@
 /* Native dependent code for Mach 386's for GDB, the GNU debugger.
    Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -40,7 +41,7 @@ static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
 
 void
 fetch_inferior_registers (regno)
-     int regno;                /* Original value discarded */
+     int regno;                        /* Original value discarded */
 {
   struct regs inferior_registers;
   struct fp_state inferior_fp_registers;
@@ -48,18 +49,18 @@ fetch_inferior_registers (regno)
   registers_fetched ();
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
   ptrace (PTRACE_GETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (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);
+         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);
+         &inferior_fp_registers.f_ctrl,
+         sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
 }
 
 /* Store our register values back into the inferior.
@@ -75,12 +76,12 @@ store_inferior_registers (regno)
 
   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_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);
-  
+         &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
@@ -93,7 +94,7 @@ store_inferior_registers (regno)
       inferior_registers.r_reg[EAX] =
        inferior_registers.r_reg[FP_REGNUM];
       ptrace (PTRACE_SETREGS, inferior_pid,
-             (PTRACE_ARG3_TYPE) &inferior_registers);
+             (PTRACE_ARG3_TYPE) & inferior_registers);
       ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0xc589);
       ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0);
       wait (0);
@@ -102,9 +103,9 @@ store_inferior_registers (regno)
     }
 #endif
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
   ptrace (PTRACE_SETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 }
 
 
@@ -120,29 +121,30 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 {
   int val;
 
-  switch (which) {
-  case 0:
-  case 1:
-    memcpy (registers, core_reg_sect, core_reg_size);
-    break;
+  switch (which)
+    {
+    case 0:
+    case 1:
+      memcpy (registers, core_reg_sect, core_reg_size);
+      break;
 
-  case 2:
+    case 2:
 #ifdef FP0_REGNUM
-    memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
-          core_reg_sect,
-          core_reg_size);              /* FIXME, probably bogus */
+      memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+             core_reg_sect,
+             core_reg_size);   /* FIXME, probably bogus */
 #endif
 #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);
+      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;
-  }
+      break;
+    }
 }
-
 \f
+
 /* Register that we are able to handle i386mach core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index 5618687a6895d66dae3c756e1059a2a6450865e3..e160385cccfc9d9cc8314b10aec248ebf9288f94 100644 (file)
@@ -1,30 +1,31 @@
 /* Intel 386 native support for SYSV systems (pre-SVR4).
    Copyright (C) 1988, 89, 91, 92, 94, 96, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
 #ifdef HAVE_PTRACE_H
-# include <ptrace.h>
+#include <ptrace.h>
 #else
-# ifdef HAVE_SYS_PTRACE_H
-#  include <sys/ptrace.h>
-# endif
+#ifdef HAVE_SYS_PTRACE_H
+#include <sys/ptrace.h>
+#endif
 #endif
 
 #include "frame.h"
@@ -52,11 +53,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  */
 
 #ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
-# ifdef HAVE_ASM_DEBUGREG_H
-#  include <asm/debugreg.h>
-# else
-#  include <sys/debugreg.h>
-# endif
+#ifdef HAVE_ASM_DEBUGREG_H
+#include <asm/debugreg.h>
+#else
+#include <sys/debugreg.h>
+#endif
 #endif
 
 #include <sys/file.h>
@@ -69,11 +70,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "floatformat.h"
 
 #include "target.h"
-
 \f
+
 /* this table must line up with REGISTER_NAMES in tm-i386v.h */
 /* symbols like 'EAX' come from <sys/reg.h> */
-static int regmap[] = 
+static int regmap[] =
 {
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
@@ -96,22 +97,22 @@ i386_register_u_addr (blockend, regnum)
 
   ubase = blockend;
   /* FIXME:  Should have better way to test floating point range */
-  if (regnum >= FP0_REGNUM && regnum <= (FP0_REGNUM + 7)) 
+  if (regnum >= FP0_REGNUM && regnum <= (FP0_REGNUM + 7))
     {
-#ifdef KSTKSZ  /* SCO, and others? */
+#ifdef KSTKSZ                  /* SCO, and others? */
       ubase += 4 * (SS + 1) - KSTKSZ;
-      fpstate = ubase + ((char *)&u.u_fps.u_fpstate - (char *)&u);
+      fpstate = ubase + ((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 = ubase + ((char *) &u.i387.st_space - (char *) &u);
       return (fpstate + 10 * (regnum - FP0_REGNUM));
 #endif
-    } 
+    }
   else
     {
       return (ubase + 4 * regmap[regnum]);
     }
-  
+
 }
 \f
 int
@@ -134,7 +135,7 @@ static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1];
 
 static int
 i386_insert_aligned_watchpoint PARAMS ((int, CORE_ADDR, CORE_ADDR, int,
-                                          int));
+                                       int));
 
 static int
 i386_insert_nonaligned_watchpoint PARAMS ((int, CORE_ADDR, CORE_ADDR, int,
@@ -164,7 +165,7 @@ i386_insert_aligned_watchpoint (pid, waddr, addr, len, rw)
   int read_write_bits, len_bits;
   int free_debug_register;
   int register_number;
-  
+
   /* Look for a free debug register.  */
   for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
     {
@@ -195,7 +196,7 @@ i386_insert_aligned_watchpoint (pid, waddr, addr, len, rw)
     }
   else
     return i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw);
-  
+
   free_debug_register = i;
   register_number = free_debug_register - DR_FIRSTADDR;
   debug_control_mirror |=
@@ -205,7 +206,7 @@ i386_insert_aligned_watchpoint (pid, waddr, addr, len, rw)
     (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * register_number));
   debug_control_mirror |= DR_LOCAL_SLOWDOWN;
   debug_control_mirror &= ~DR_CONTROL_RESERVED;
-  
+
   ptrace (6, pid, offsetof (struct user, u_debugreg[DR_CONTROL]),
          debug_control_mirror);
   ptrace (6, pid, offsetof (struct user, u_debugreg[free_debug_register]),
@@ -228,7 +229,8 @@ i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw)
   int size;
   int rv;
 
-  static int size_try_array[16] = {
+  static int size_try_array[16] =
+  {
     1, 1, 1, 1,                        /* trying size one */
     2, 1, 2, 1,                        /* trying size two */
     2, 1, 2, 1,                        /* trying size three */
@@ -287,7 +289,7 @@ i386_remove_watchpoint (pid, addr, len)
 
 CORE_ADDR
 i386_stopped_by_watchpoint (pid)
-    int pid;
+     int pid;
 {
   int i;
   int status;
@@ -316,7 +318,7 @@ i386_stopped_by_watchpoint (pid)
    rich@cygnus.com 15 Sept 92. */
 i386_float_info ()
 {
-  struct user u; /* just for address computations */
+  struct user u;               /* just for address computations */
   int i;
   /* fpstate defined in <sys/user.h> */
   struct fpstate *fpstatep;
@@ -327,66 +329,66 @@ i386_float_info ()
   unsigned int rounded_size;
   extern int corechan;
   int skip;
-  
-  uaddr = (char *)&u.u_fpvalid - (char *)&u;
+
+  uaddr = (char *) &u.u_fpvalid - (char *) &u;
   if (target_has_execution)
     {
       unsigned int data;
       unsigned int mask;
-      
+
       rounded_addr = uaddr & -sizeof (int);
       data = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) rounded_addr, 0);
       mask = 0xff << ((uaddr - rounded_addr) * 8);
-      
+
       fpvalid = ((data & mask) != 0);
-    } 
+    }
 #if 0
-  else 
+  else
     {
       if (lseek (corechan, uaddr, 0) < 0)
        perror ("seek on core file");
-      if (myread (corechan, &fpvalid, 1) < 0) 
+      if (myread (corechan, &fpvalid, 1) < 0)
        perror ("read on core file");
-      
+
     }
-#endif /* no core support yet */
-  
-  if (fpvalid == 0) 
+#endif /* no core support yet */
+
+  if (fpvalid == 0)
     {
       printf_unfiltered ("no floating point status saved\n");
       return;
     }
-  
-  uaddr = (char *)&U_FPSTATE(u) - (char *)&u;
+
+  uaddr = (char *) &U_FPSTATE (u) - (char *) &u;
   if (target_has_execution)
     {
       int *ip;
-      
+
       rounded_addr = uaddr & -sizeof (int);
       rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) +
                      sizeof (int) - 1) / sizeof (int);
       skip = uaddr - rounded_addr;
-      
-      ip = (int *)buf;
-      for (i = 0; i < rounded_size; i++) 
+
+      ip = (int *) buf;
+      for (i = 0; i < rounded_size; i++)
        {
          *ip++ = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) rounded_addr, 0);
          rounded_addr += sizeof (int);
        }
-    } 
+    }
 #if 0
-  else 
+  else
     {
       if (lseek (corechan, uaddr, 0) < 0)
        perror_with_name ("seek on core file");
-      if (myread (corechan, buf, sizeof (struct fpstate)) < 0) 
-       perror_with_name ("read from core file");
+      if (myread (corechan, buf, sizeof (struct fpstate)) < 0)
+         perror_with_name ("read from core file");
       skip = 0;
     }
-#endif /* 0 */ 
+#endif /* 0 */
 
-  fpstatep = (struct fpstate *)(buf + skip);
-  print_387_status (fpstatep->status, (struct env387 *)fpstatep->state);
+  fpstatep = (struct fpstate *) (buf + skip);
+  print_387_status (fpstatep->status, (struct env387 *) fpstatep->state);
 }
 
 #endif /* never */
index 074c1daf4b9f872b3e9ff7678519584111e8c0df..10802cb730b8d88183b33711f799916b5351ab75 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent code for SVR4 Unix running on i386's, for GDB.
    Copyright 1988, 1989, 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "value.h"
@@ -31,46 +32,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/procfs.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 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:
-
-       typedef int gregset_t[19];              (in <sys/regset.h>)
-
-       #define GS      0                       (in <sys/reg.h>)
-       #define FS      1
-       ...
-       #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 //
-       } fpregset_t;
-
-    These routines provide the packing and unpacking of gregset_t and
-    fpregset_t formatted data.
+   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 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:
+
+   typedef int gregset_t[19];           (in <sys/regset.h>)
+
+   #define GS   0                       (in <sys/reg.h>)
+   #define FS   1
+   ...
+   #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 //
+   } fpregset_t;
+
+   These routines provide the packing and unpacking of gregset_t and
+   fpregset_t formatted data.
 
  */
 
@@ -78,7 +79,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* This is a duplicate of the table in i386-xdep.c. */
 
-static int regmap[] = 
+static int regmap[] =
 {
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
@@ -98,14 +99,14 @@ void fill_fpregset PARAMS ((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. */
+   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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 void
 supply_gregset (gregsetp)
@@ -115,7 +116,7 @@ supply_gregset (gregsetp)
   register greg_t *regp = (greg_t *) gregsetp;
   extern int regmap[];
 
-  for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++)
+  for (regi = 0; regi < (NUM_REGS - NUM_FREGS); regi++)
     {
       supply_register (regi, (char *) (regp + regmap[regi]));
     }
@@ -130,7 +131,7 @@ fill_gregset (gregsetp, regno)
   register greg_t *regp = (greg_t *) gregsetp;
   extern int regmap[];
 
-  for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++)
+  for (regi = 0; regi < (NUM_REGS - NUM_FREGS); regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
@@ -139,15 +140,15 @@ fill_gregset (gregsetp, regno)
     }
 }
 
-#endif /* HAVE_GREGSET_T */
+#endif /* HAVE_GREGSET_T */
 
 #if defined (FP0_REGNUM) && 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. */
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
 
-void 
+void
 supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
@@ -155,9 +156,9 @@ supply_fpregset (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. */
+   (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. */
 
 void
 fill_fpregset (fpregsetp, regno)
@@ -167,6 +168,6 @@ fill_fpregset (fpregsetp, regno)
   /* FIXME: see m68k-tdep.c for an example, for the m68k. */
 }
 
-#endif /* defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T) */
+#endif /* defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T) */
 
-#endif /* HAVE_SYS_PROCFS_H */
+#endif /* HAVE_SYS_PROCFS_H */
index 869ab9a33b81c9cf50db7740df2e88e4cfd4c7cc..253bc26ed504188ab3366378c201e78e9301dcc4 100644 (file)
@@ -1,21 +1,22 @@
 /* Intel 387 floating point stuff.
    Copyright (C) 1988, 1989, 1991, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -36,7 +37,7 @@ i387_to_double (from, to)
      char *from;
      char *to;
 {
-  floatformat_to_double (&floatformat_i387_ext, from, (double *)to);
+  floatformat_to_double (&floatformat_i387_ext, from, (double *) to);
 }
 
 void
@@ -44,44 +45,67 @@ double_to_i387 (from, to)
      char *from;
      char *to;
 {
-  floatformat_from_double (&floatformat_i387_ext, (double *)from, to);
+  floatformat_from_double (&floatformat_i387_ext, (double *) from, to);
 }
 
 void
 print_387_control_word (control)
      unsigned int control;
 {
-  printf_unfiltered ("control %s: ", local_hex_string(control));
+  printf_unfiltered ("control %s: ", local_hex_string (control));
   printf_unfiltered ("compute to ");
-  switch ((control >> 8) & 3) 
+  switch ((control >> 8) & 3)
     {
-    case 0: printf_unfiltered ("24 bits; "); break;
-    case 1: printf_unfiltered ("(bad); "); break;
-    case 2: printf_unfiltered ("53 bits; "); break;
-    case 3: printf_unfiltered ("64 bits; "); break;
+    case 0:
+      printf_unfiltered ("24 bits; ");
+      break;
+    case 1:
+      printf_unfiltered ("(bad); ");
+      break;
+    case 2:
+      printf_unfiltered ("53 bits; ");
+      break;
+    case 3:
+      printf_unfiltered ("64 bits; ");
+      break;
     }
   printf_unfiltered ("round ");
-  switch ((control >> 10) & 3) 
+  switch ((control >> 10) & 3)
     {
-    case 0: printf_unfiltered ("NEAREST; "); break;
-    case 1: printf_unfiltered ("DOWN; "); break;
-    case 2: printf_unfiltered ("UP; "); break;
-    case 3: printf_unfiltered ("CHOP; "); break;
+    case 0:
+      printf_unfiltered ("NEAREST; ");
+      break;
+    case 1:
+      printf_unfiltered ("DOWN; ");
+      break;
+    case 2:
+      printf_unfiltered ("UP; ");
+      break;
+    case 3:
+      printf_unfiltered ("CHOP; ");
+      break;
     }
-  if (control & 0x3f) 
+  if (control & 0x3f)
     {
       printf_unfiltered ("mask:");
-      if (control & 0x0001) printf_unfiltered (" INVALID");
-      if (control & 0x0002) printf_unfiltered (" DENORM");
-      if (control & 0x0004) printf_unfiltered (" DIVZ");
-      if (control & 0x0008) printf_unfiltered (" OVERF");
-      if (control & 0x0010) printf_unfiltered (" UNDERF");
-      if (control & 0x0020) printf_unfiltered (" LOS");
+      if (control & 0x0001)
+       printf_unfiltered (" INVALID");
+      if (control & 0x0002)
+       printf_unfiltered (" DENORM");
+      if (control & 0x0004)
+       printf_unfiltered (" DIVZ");
+      if (control & 0x0008)
+       printf_unfiltered (" OVERF");
+      if (control & 0x0010)
+       printf_unfiltered (" UNDERF");
+      if (control & 0x0020)
+       printf_unfiltered (" LOS");
       printf_unfiltered (";");
     }
   printf_unfiltered ("\n");
-  if (control & 0xe080) warning ("reserved bits on: %s\n",
-                               local_hex_string(control & 0xe080));
+  if (control & 0xe080)
+    warning ("reserved bits on: %s\n",
+            local_hex_string (control & 0xe080));
 }
 
 void
@@ -89,23 +113,30 @@ print_387_status_word (status)
      unsigned int status;
 {
   printf_unfiltered ("status %s: ", local_hex_string (status));
-  if (status & 0xff) 
+  if (status & 0xff)
     {
       printf_unfiltered ("exceptions:");
-      if (status & 0x0001) printf_unfiltered (" INVALID");
-      if (status & 0x0002) printf_unfiltered (" DENORM");
-      if (status & 0x0004) printf_unfiltered (" DIVZ");
-      if (status & 0x0008) printf_unfiltered (" OVERF");
-      if (status & 0x0010) printf_unfiltered (" UNDERF");
-      if (status & 0x0020) printf_unfiltered (" LOS");
-      if (status & 0x0040) printf_unfiltered (" FPSTACK");
+      if (status & 0x0001)
+       printf_unfiltered (" INVALID");
+      if (status & 0x0002)
+       printf_unfiltered (" DENORM");
+      if (status & 0x0004)
+       printf_unfiltered (" DIVZ");
+      if (status & 0x0008)
+       printf_unfiltered (" OVERF");
+      if (status & 0x0010)
+       printf_unfiltered (" UNDERF");
+      if (status & 0x0020)
+       printf_unfiltered (" LOS");
+      if (status & 0x0040)
+       printf_unfiltered (" FPSTACK");
       printf_unfiltered ("; ");
     }
   printf_unfiltered ("flags: %d%d%d%d; ",
-         (status & 0x4000) != 0,
-         (status & 0x0400) != 0,
-         (status & 0x0200) != 0,
-         (status & 0x0100) != 0);
+                    (status & 0x4000) != 0,
+                    (status & 0x0400) != 0,
+                    (status & 0x0200) != 0,
+                    (status & 0x0100) != 0);
 
   printf_unfiltered ("top %d\n", (status >> 11) & 7);
 }
index 4e16de1518873b831bcdff853bc9880406c249af..4818b4f1d5d0550a5082254e37568f4559e51ca5 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Intel Corporation.
    examine_prologue and other parts contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -57,33 +58,56 @@ i960_use_struct_convention (gcc_p, type)
    This routine must be called as part of gdb initialization.  */
 
 static void
-check_host()
+check_host ()
 {
-       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))
+  int i;
 
-       /* 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 );
-               }
+  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);
        }
+
+    }
 }
 \f
 /* Examine an i960 function prologue, recording the addresses at which
@@ -107,23 +131,23 @@ check_host()
    the function prologue is given below:
 
    (lda LRn, g14
-    mov g14, g[0-7]
-    (mov 0, g14) | (lda 0, 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))?
+   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.  */
 
@@ -159,15 +183,15 @@ examine_prologue (ip, limit, frame_addr, fsr)
   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)     */
-    };
+  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
@@ -175,8 +199,8 @@ examine_prologue (ip, limit, frame_addr, fsr)
 
   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) */
+      && ((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);
@@ -185,13 +209,13 @@ examine_prologue (ip, limit, frame_addr, fsr)
   /* Now look for the prologue code at a leaf entry point:  */
 
   if (next_ip
-      && (insn1 & 0xff87ffff) == 0x5c80161e         /* mov g14, gx */
+      && (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 */
+         && (insn1 == 0x8cf00000       /* lda 0, g14 */
+             || insn1 == 0x5cf01e00))  /* mov 0, g14 */
        {
          ip = next_ip;
          next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
@@ -205,7 +229,7 @@ examine_prologue (ip, limit, frame_addr, fsr)
 
   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
@@ -248,16 +272,16 @@ examine_prologue (ip, limit, frame_addr, fsr)
      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) */
+        ((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);
+       : ((insn1 & BITMASK (27, 1)) ? 2 : 1);
       while (size--)
        {
          fsr->regs[src++] = save_addr;
@@ -280,11 +304,11 @@ examine_prologue (ip, limit, frame_addr, fsr)
   /* 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) */
+      ((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));
+                                           ? insn2 : MEMA_OFFSET (insn1));
       ip = next_ip;
       next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
     }
@@ -297,9 +321,9 @@ examine_prologue (ip, limit, frame_addr, fsr)
       && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
     {
       save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
-      fsr->regs[G0_REGNUM+13] = save_addr;
+      fsr->regs[G0_REGNUM + 13] = save_addr;
       ip = next_ip;
-#if 0  /* We'll need this once there is a subsequent instruction examined. */
+#if 0                          /* We'll need this once there is a subsequent instruction examined. */
       next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
 #endif
     }
@@ -313,7 +337,7 @@ examine_prologue (ip, limit, frame_addr, fsr)
 
 CORE_ADDR
 i960_skip_prologue (ip)
-     CORE_ADDR (ip);
+CORE_ADDR (ip);
 {
   struct frame_saved_regs saved_regs_dummy;
   struct symtab_and_line sal;
@@ -355,19 +379,19 @@ frame_find_saved_regs (fi, fsr)
       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.  */
-         
+         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;
+      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.  */
+         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;
@@ -391,7 +415,7 @@ frame_find_saved_regs (fi, fsr)
      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 
+     -- 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 */
@@ -415,11 +439,11 @@ frame_args_address (fi, must_be_correct)
 
   get_frame_saved_regs (fi, &fsr);
   if (fsr.regs[G14_REGNUM])
-    ap = read_memory_integer (fsr.regs[G14_REGNUM],4);
+    ap = read_memory_integer (fsr.regs[G14_REGNUM], 4);
   else
     {
       if (must_be_correct)
-       return 0;                       /* Don't cache this result */
+       return 0;               /* Don't cache this result */
       if (get_next_frame (fi))
        ap = 0;
       else
@@ -453,7 +477,7 @@ frame_struct_result_address (fi)
     {
       get_frame_saved_regs (fi, &fsr);
       if (fsr.regs[G13_REGNUM])
-       ap = read_memory_integer (fsr.regs[G13_REGNUM],4);
+       ap = read_memory_integer (fsr.regs[G13_REGNUM], 4);
       else
        ap = 0;
     }
@@ -465,7 +489,7 @@ frame_struct_result_address (fi)
 
 /* Return address to which the currently executing leafproc will return,
    or 0 if ip 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
@@ -475,7 +499,7 @@ frame_struct_result_address (fi)
 
 CORE_ADDR
 leafproc_return (ip)
-     CORE_ADDR ip;     /* ip from currently executing function */
+     CORE_ADDR ip;             /* ip from currently executing function */
 {
   register struct minimal_symbol *msymbol;
   char *p;
@@ -485,37 +509,37 @@ leafproc_return (ip)
 
   if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL)
     {
-      if ((p = strchr(SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf"))
+      if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf"))
        {
          if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2)
-             && (insn1 & 0xff87ffff) == 0x5c80161e       /* mov g14, gx */
+             && (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.  */
+                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);
+               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.  */
+                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)
+                 || (insn1 & 0xff000000) != 0xa000000  /* ret */
+                 || lookup_minimal_symbol_by_pc (return_addr) != msymbol)
                return (return_addr);
            }
        }
     }
-  
+
   return (0);
 }
 
@@ -565,8 +589,8 @@ pop_frame ()
       /* 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));
+      write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
+                           sizeof (local_regs_buf));
 
       /* Restore frame pointer.  */
       write_register (FP_REGNUM, prev_fi->frame);
@@ -597,132 +621,170 @@ pop_frame ()
 
 enum target_signal
 i960_fault_to_signal (fault)
-    int fault;
+     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 */
+    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;
+         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 */
+    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;
+         "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                          */
+/* MEM format                           */
 /****************************************/
 
-struct tabent {
-       char    *name;
-       char    numops;
+struct tabent
+{
+  char *name;
+  char numops;
 };
 
-static int                             /* returns instruction length: 4 or 8 */
-mem( memaddr, word1, word2, noprint )
-    unsigned long memaddr;
-    unsigned long word1, word2;
-    int noprint;               /* If TRUE, return instruction length, but
+static int                     /* returns instruction length: 4 or 8 */
+mem (memaddr, word1, word2, noprint)
+     unsigned long memaddr;
+     unsigned long word1, word2;
+     int noprint;              /* If TRUE, return instruction length, but
                                   don't output any text.  */
 {
-       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;
+  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;
-               }
+  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;
+  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 ((mem_tab[i].name != NULL)        /* Valid instruction */
+      && ((mode == 5) || (mode >= 12)))
+    {                          /* With 32-bit displacement */
+      len = 8;
+    }
+  else
+    {
+      len = 4;
+    }
 
-       if ( noprint ){
-               return len;
-       }
-       abort ();
+  if (noprint)
+    {
+      return len;
+    }
+  abort ();
 }
 
 /* Read the i960 instruction at 'memaddr' and return the address of 
@@ -748,19 +810,19 @@ next_insn (memaddr, pword1, pword2)
   *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*/
+  /* Divide instruction set into classes based on high 4 bits of opcode */
 
   switch ((*pword1 >> 28) & 0xf)
     {
     case 0x0:
-    case 0x1:  /* ctrl */
+    case 0x1:                  /* ctrl */
 
     case 0x2:
-    case 0x3:  /* cobr */
+    case 0x3:                  /* cobr */
 
     case 0x5:
     case 0x6:
-    case 0x7:  /* reg */
+    case 0x7:                  /* reg */
       len = 4;
       break;
 
@@ -772,7 +834,7 @@ next_insn (memaddr, pword1, pword2)
       len = mem (memaddr, *pword1, *pword2, 1);
       break;
 
-    default:   /* invalid instruction */
+    default:                   /* invalid instruction */
       len = 0;
       break;
     }
@@ -791,43 +853,47 @@ next_insn (memaddr, pword1, pword2)
 
 int
 mon960_frame_chain_valid (chain, curframe)
-    CORE_ADDR chain;
-    struct frame_info *curframe;
+     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;
-       }
+  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);
-       }
+  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) );
+  return (chain != read_memory_integer (a, 4));
 }
 
 void
index 17c3d6dbc64c0aab9460715adadfa8e2454c93d5..a3807deaa634dd6b662dc3a6bff7f0de415a45c8 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998 
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <signal.h>
@@ -158,8 +159,8 @@ int stopped_by_random_signal;
    If this is nonzero, respond to a single-step signal
    by continuing to step if the pc is in this range.  */
 
-CORE_ADDR step_range_start; /* Inclusive */
-CORE_ADDR step_range_end; /* Exclusive */
+CORE_ADDR step_range_start;    /* Inclusive */
+CORE_ADDR step_range_end;      /* Exclusive */
 
 /* Stack frame address as of when stepping command was issued.
    This is how we know when we step into a subroutine call,
@@ -187,25 +188,25 @@ int step_multi;
    in format described in environ.h.  */
 
 struct environ *inferior_environ;
-
 \f
+
 /* This function detects whether or not a '&' character (indicating
    background execution) has been added as *the last* of the arguments ARGS
    of a command. If it has, it removes it and returns 1. Otherwise it
    does nothing and returns 0. */
-static int 
+static int
 strip_bg_char (args)
      char **args;
 {
   char *p = NULL;
-  
+
   p = strchr (*args, '&');
-  
+
   if (p)
     {
       if (p == (*args + strlen (*args) - 1))
        {
-         if (strlen (*args) >1)
+         if (strlen (*args) > 1)
            {
              do
                p--;
@@ -244,7 +245,7 @@ run_command (args, from_tty)
   if (inferior_pid != 0 && target_has_execution)
     {
       if (
-         !query ("The program being debugged has been started already.\n\
+          !query ("The program being debugged has been started already.\n\
 Start it from the beginning? "))
        error ("Program not restarted.");
       target_kill ();
@@ -288,7 +289,7 @@ Start it from the beginning? "))
        error ("Asynchronous execution not supported on this target.");
 
       /* If we don't get a request of running in the bg, then we need
-        to simulate synchronous (fg) execution. */
+         to simulate synchronous (fg) execution. */
       if (async_p && !async_exec && target_has_async)
        {
          /* Simulate synchronous execution */
@@ -306,12 +307,12 @@ Start it from the beginning? "))
 
   if (from_tty)
     {
-      puts_filtered("Starting program: ");
+      puts_filtered ("Starting program: ");
       if (exec_file)
-       puts_filtered(exec_file);
-      puts_filtered(" ");
-      puts_filtered(inferior_args);
-      puts_filtered("\n");
+       puts_filtered (exec_file);
+      puts_filtered (" ");
+      puts_filtered (inferior_args);
+      puts_filtered ("\n");
       gdb_flush (gdb_stdout);
     }
 
@@ -325,17 +326,17 @@ run_no_args_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  execute_command("set args", from_tty);
-  run_command((char *)NULL, from_tty);
+  execute_command ("set args", from_tty);
+  run_command ((char *) NULL, from_tty);
 }
-
 \f
+
 void
 continue_command (proc_count_exp, from_tty)
      char *proc_count_exp;
      int from_tty;
 {
-  int async_exec = 0; 
+  int async_exec = 0;
   ERROR_NO_INFERIOR;
 
   /* Find out whether we must run in the background. */
@@ -350,7 +351,7 @@ continue_command (proc_count_exp, from_tty)
   /* If we are not asked to run in the bg, then prepare to run in the
      foreground, synchronously. */
   if (async_p && !async_exec && target_has_async)
-    { 
+    {
       /* Simulate synchronous execution */
       sync_execution = 1;
     }
@@ -384,7 +385,7 @@ continue_command (proc_count_exp, from_tty)
 
   clear_proceed_status ();
 
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 0);
 }
 \f
 /* Step until outside of current statement.  */
@@ -439,12 +440,12 @@ step_1 (skip_subroutines, single_inst, count_string)
   struct frame_info *frame;
   struct cleanup *cleanups = 0;
   int async_exec = 0;
-  
+
   ERROR_NO_INFERIOR;
 
   if (count_string)
     async_exec = strip_bg_char (&count_string);
-      
+
   /* If we get a request for running in the bg but the target
      doesn't support it, error out. */
   if (async_p && async_exec && !target_has_async)
@@ -460,11 +461,11 @@ step_1 (skip_subroutines, single_inst, count_string)
 
   count = count_string ? parse_and_eval_address (count_string) : 1;
 
-  if (!single_inst || skip_subroutines) /* leave si command alone */
+  if (!single_inst || skip_subroutines)                /* leave si command alone */
     {
-      enable_longjmp_breakpoint();
-      cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint, 
-                               0);
+      enable_longjmp_breakpoint ();
+      cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint,
+                              0);
     }
 
   for (; count > 0; count--)
@@ -472,12 +473,12 @@ step_1 (skip_subroutines, single_inst, count_string)
       clear_proceed_status ();
 
       frame = get_current_frame ();
-      if (!frame)                      /* Avoid coredump here.  Why tho? */
+      if (!frame)              /* Avoid coredump here.  Why tho? */
        error ("No current frame");
       step_frame_address = FRAME_FP (frame);
       step_sp = read_sp ();
 
-      if (! single_inst)
+      if (!single_inst)
        {
          find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
          if (step_range_end == 0)
@@ -508,20 +509,20 @@ which has no line number information.\n", name);
        step_over_calls = 1;
 
       step_multi = (count > 1);
-      proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
-      if (! stop_step)
+      proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 1);
+      if (!stop_step)
        break;
 
       /* FIXME: On nexti, this may have already been done (when we hit the
-        step resume break, I think).  Probably this should be moved to
-        wait_for_inferior (near the top).  */
+         step resume break, I think).  Probably this should be moved to
+         wait_for_inferior (near the top).  */
 #if defined (SHIFT_INST_REGS)
-      SHIFT_INST_REGS();
+      SHIFT_INST_REGS ();
 #endif
     }
 
   if (!single_inst || skip_subroutines)
-    do_cleanups(cleanups);
+    do_cleanups (cleanups);
 }
 \f
 /* Continue program at specified address.  */
@@ -537,7 +538,7 @@ jump_command (arg, from_tty)
   struct symbol *fn;
   struct symbol *sfn;
   int async_exec = 0;
+
   ERROR_NO_INFERIOR;
 
   /* Find out whether we must run in the background. */
@@ -552,7 +553,7 @@ jump_command (arg, from_tty)
   /* If we are not asked to run in the bg, then prepare to run in the
      foreground, synchronously. */
   if (async_p && !async_exec && target_has_async)
-    { 
+    {
       /* Simulate synchronous execution */
       sync_execution = 1;
     }
@@ -567,12 +568,12 @@ jump_command (arg, from_tty)
     }
 
   sal = sals.sals[0];
-  free ((PTR)sals.sals);
+  free ((PTR) sals.sals);
 
   if (sal.symtab == 0 && sal.pc == 0)
     error ("No source file has been specified.");
 
-  resolve_sal_pc (&sal);                       /* May error out */
+  resolve_sal_pc (&sal);       /* May error out */
 
   /* See if we are trying to jump to another function. */
   fn = get_frame_function (get_current_frame ());
@@ -587,10 +588,10 @@ jump_command (arg, from_tty)
        }
     }
 
-  if (sfn != NULL) 
+  if (sfn != NULL)
     {
       fixup_symbol_section (sfn, 0);
-      if (section_is_overlay (SYMBOL_BFD_SECTION (sfn)) && 
+      if (section_is_overlay (SYMBOL_BFD_SECTION (sfn)) &&
          !section_is_mapped (SYMBOL_BFD_SECTION (sfn)))
        {
          if (!query ("WARNING!!!  Destination is in unmapped overlay!  Jump anyway? "))
@@ -613,15 +614,15 @@ jump_command (arg, from_tty)
   clear_proceed_status ();
   proceed (addr, TARGET_SIGNAL_0, 0);
 }
-
 \f
+
 /* Go to line or address in current procedure */
 static void
 go_command (line_no, from_tty)
      char *line_no;
      int from_tty;
 {
-  if (line_no == (char *)NULL || !*line_no)
+  if (line_no == (char *) NULL || !*line_no)
     printf_filtered (GO_USAGE);
   else
     {
@@ -629,8 +630,8 @@ go_command (line_no, from_tty)
       jump_command (line_no, from_tty);
     }
 }
-
 \f
+
 /* Continue program giving it specified signal.  */
 
 static void
@@ -676,7 +677,7 @@ signal_command (signum_exp, from_tty)
      FIXME: Neither should "signal foo" but when I tried passing
      (CORE_ADDR)-1 unconditionally I got a testsuite failure which I haven't
      tried to track down yet.  */
-  proceed (oursig == TARGET_SIGNAL_0 ? (CORE_ADDR) -1 : stop_pc, oursig, 0);
+  proceed (oursig == TARGET_SIGNAL_0 ? (CORE_ADDR) - 1 : stop_pc, oursig, 0);
 }
 
 /* Call breakpoint_auto_delete on the current contents of the bpstat
@@ -686,7 +687,7 @@ static void
 breakpoint_auto_delete_contents (arg)
      PTR arg;
 {
-  breakpoint_auto_delete (*(bpstat *)arg);
+  breakpoint_auto_delete (*(bpstat *) arg);
 }
 
 
@@ -722,14 +723,14 @@ run_stack_dummy (addr, buffer)
   if (stack_dummy_testing & 4)
     {
       POP_FRAME;
-      return(0);
+      return (0);
     }
   if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
     {
       struct breakpoint *bpt;
       struct symtab_and_line sal;
-      
-      INIT_SAL (&sal); /* initialize to zeroes */
+
+      INIT_SAL (&sal);         /* initialize to zeroes */
       if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
        {
          sal.pc = CALL_DUMMY_ADDRESS ();
@@ -739,28 +740,28 @@ run_stack_dummy (addr, buffer)
          sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
        }
       sal.section = find_pc_overlay (sal.pc);
-      
+
       /* Set up a FRAME for the dummy frame so we can pass it to
-        set_momentary_breakpoint.  We need to give the breakpoint a
-        frame in case there is only one copy of the dummy (e.g.
-        CALL_DUMMY_LOCATION == AFTER_TEXT_END).  */
+         set_momentary_breakpoint.  We need to give the breakpoint a
+         frame in case there is only one copy of the dummy (e.g.
+         CALL_DUMMY_LOCATION == AFTER_TEXT_END).  */
       flush_cached_frames ();
       set_current_frame (create_new_frame (read_fp (), sal.pc));
-      
+
       /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put
-        a breakpoint instruction.  If not, the call dummy already has the
-        breakpoint instruction in it.
-        
-        addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
-        so we need to subtract the CALL_DUMMY_START_OFFSET.  */
+         a breakpoint instruction.  If not, the call dummy already has the
+         breakpoint instruction in it.
+
+         addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
+         so we need to subtract the CALL_DUMMY_START_OFFSET.  */
       bpt = set_momentary_breakpoint (sal,
                                      get_current_frame (),
                                      bp_call_dummy);
       bpt->disposition = del;
-      
+
       /* If all error()s out of proceed ended up calling normal_stop (and
-        perhaps they should; it already does in the special case of error
-        out of resume()), then we wouldn't need this.  */
+         perhaps they should; it already does in the special case of error
+         out of resume()), then we wouldn't need this.  */
       make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
     }
 
@@ -797,7 +798,7 @@ until_next_command (from_tty)
   CORE_ADDR pc;
   struct symbol *func;
   struct symtab_and_line sal;
+
   clear_proceed_status ();
 
   frame = get_current_frame ();
@@ -808,35 +809,35 @@ until_next_command (from_tty)
 
   pc = read_pc ();
   func = find_pc_function (pc);
-  
+
   if (!func)
     {
       struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc);
-      
+
       if (msymbol == NULL)
        error ("Execution is not within a known function.");
-      
+
       step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
       step_range_end = pc;
     }
   else
     {
       sal = find_pc_line (pc, 0);
-      
+
       step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
       step_range_end = sal.end;
     }
-  
+
   step_over_calls = 1;
   step_frame_address = FRAME_FP (frame);
   step_sp = read_sp ();
 
   step_multi = 0;              /* Only one call to proceed */
-  
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
+
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 1);
 }
 
-static void 
+static void
 until_command (arg, from_tty)
      char *arg;
      int from_tty;
@@ -858,7 +859,7 @@ until_command (arg, from_tty)
   /* If we are not asked to run in the bg, then prepare to run in the
      foreground, synchronously. */
   if (async_p && !async_exec && target_has_async)
-    { 
+    {
       /* Simulate synchronous execution */
       sync_execution = 1;
     }
@@ -884,11 +885,11 @@ finish_command_continuation (arg)
 {
   register struct symbol *function;
   struct breakpoint *breakpoint;
-  
+
   breakpoint = (struct breakpoint *) arg->data;
   function = (struct symbol *) (arg->next)->data;
 
-  if (bpstat_find_breakpoint(stop_bpstat, breakpoint) != NULL
+  if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
       && function != 0)
     {
       struct type *value_type;
@@ -899,7 +900,7 @@ finish_command_continuation (arg)
       value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
       if (!value_type)
        fatal ("internal: finish_command: function has no target type");
-      
+
       if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
        {
          do_exec_cleanups (ALL_CLEANUPS);
@@ -910,37 +911,37 @@ finish_command_continuation (arg)
 
       struct_return = using_struct_return (value_of_variable (function, NULL),
 
-                                  funcaddr,
-                                  check_typedef (value_type),
-               BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
+                                          funcaddr,
+                                          check_typedef (value_type),
+                       BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
 
       if (!struct_return)
-      {
-        val = value_being_returned (value_type, stop_registers, struct_return);
-        printf_filtered ("Value returned is $%d = ", record_latest_value (val));
-        value_print (val, gdb_stdout, 0, Val_no_prettyprint);
-        printf_filtered ("\n");
-      }
+       {
+         val = value_being_returned (value_type, stop_registers, struct_return);
+         printf_filtered ("Value returned is $%d = ", record_latest_value (val));
+         value_print (val, gdb_stdout, 0, Val_no_prettyprint);
+         printf_filtered ("\n");
+       }
       else
-      {
-       /* We cannot determine the contents of the structure because
-         it is on the stack, and we don't know where, since we did not
-         initiate the call, as opposed to the call_function_by_hand case */
+       {
+         /* We cannot determine the contents of the structure because
+            it is on the stack, and we don't know where, since we did not
+            initiate the call, as opposed to the call_function_by_hand case */
 #ifdef VALUE_RETURNED_FROM_STACK
-          val = 0;
-          printf_filtered ("Value returned has type: %s.", 
+         val = 0;
+         printf_filtered ("Value returned has type: %s.",
                           TYPE_NAME (value_type));
-          printf_filtered (" Cannot determine contents\n");
+         printf_filtered (" Cannot determine contents\n");
 #else
-          val = value_being_returned (value_type, stop_registers, 
+         val = value_being_returned (value_type, stop_registers,
                                      struct_return);
-          printf_filtered ("Value returned is $%d = ", 
+         printf_filtered ("Value returned is $%d = ",
                           record_latest_value (val));
-          value_print (val, gdb_stdout, 0, Val_no_prettyprint);
-          printf_filtered ("\n");
+         value_print (val, gdb_stdout, 0, Val_no_prettyprint);
+         printf_filtered ("\n");
 #endif
-       
-      }
+
+       }
     }
   do_exec_cleanups (ALL_CLEANUPS);
 }
@@ -974,7 +975,7 @@ finish_command (arg, from_tty)
   /* If we are not asked to run in the bg, then prepare to run in the
      foreground, synchronously. */
   if (async_p && !async_exec && target_has_async)
-    { 
+    {
       /* Simulate synchronous execution */
       sync_execution = 1;
     }
@@ -1020,9 +1021,9 @@ finish_command (arg, from_tty)
      stopped, in fetch_inferior_event. */
   if (async_p && target_has_async)
     {
-      arg1 = 
+      arg1 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg2 = 
+      arg2 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
       arg1->next = arg2;
       arg2->next = NULL;
@@ -1031,83 +1032,83 @@ finish_command (arg, from_tty)
       add_continuation (finish_command_continuation, arg1);
     }
 
-  proceed_to_finish = 1;               /* We want stop_registers, please... */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+  proceed_to_finish = 1;       /* We want stop_registers, please... */
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 0);
 
   /* Do this only if not running asynchronously or if the target
      cannot do async execution. Otherwise, complete this command when
-     the target actually stops, in fetch_inferior_event.*/
-    if (!async_p || !target_has_async)
-      {
-
-       /* Did we stop at our breakpoint? */
-       if (bpstat_find_breakpoint(stop_bpstat, breakpoint) != NULL
-           && function != 0)
-         {
-           struct type *value_type;
-           register value_ptr val;
-           CORE_ADDR funcaddr;
-           int struct_return;
-
-           value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
-           if (!value_type)
-             fatal ("internal: finish_command: function has no target type");
-
-           /* FIXME: Shouldn't we do the cleanups before returning? */
-           if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
-             return;
-
-           funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
-
-           struct_return = 
-             using_struct_return (value_of_variable (function, NULL),
-                                  funcaddr,
-                                  check_typedef (value_type),
-                                  BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
-
-           if (!struct_return)
-             {
-               val = 
-                 value_being_returned (value_type, stop_registers, struct_return);
-               printf_filtered ("Value returned is $%d = ", 
-                                record_latest_value (val));
-               value_print (val, gdb_stdout, 0, Val_no_prettyprint);
-               printf_filtered ("\n");
-             }
-           else
-             {
-               /* We cannot determine the contents of the structure
-                  because it is on the stack, and we don't know
-                  where, since we did not initiate the call, as
-                  opposed to the call_function_by_hand case */
+     the target actually stops, in fetch_inferior_event. */
+  if (!async_p || !target_has_async)
+    {
+
+      /* Did we stop at our breakpoint? */
+      if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
+         && function != 0)
+       {
+         struct type *value_type;
+         register value_ptr val;
+         CORE_ADDR funcaddr;
+         int struct_return;
+
+         value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
+         if (!value_type)
+           fatal ("internal: finish_command: function has no target type");
+
+         /* FIXME: Shouldn't we do the cleanups before returning? */
+         if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
+           return;
+
+         funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
+
+         struct_return =
+           using_struct_return (value_of_variable (function, NULL),
+                                funcaddr,
+                                check_typedef (value_type),
+                       BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
+
+         if (!struct_return)
+           {
+             val =
+               value_being_returned (value_type, stop_registers, struct_return);
+             printf_filtered ("Value returned is $%d = ",
+                              record_latest_value (val));
+             value_print (val, gdb_stdout, 0, Val_no_prettyprint);
+             printf_filtered ("\n");
+           }
+         else
+           {
+             /* We cannot determine the contents of the structure
+                because it is on the stack, and we don't know
+                where, since we did not initiate the call, as
+                opposed to the call_function_by_hand case */
 #ifdef VALUE_RETURNED_FROM_STACK
-               val = 0;
-               printf_filtered ("Value returned has type: %s.", 
-                                TYPE_NAME (value_type));
-               printf_filtered (" Cannot determine contents\n");
+             val = 0;
+             printf_filtered ("Value returned has type: %s.",
+                              TYPE_NAME (value_type));
+             printf_filtered (" Cannot determine contents\n");
 #else
-               val = value_being_returned (value_type, stop_registers, 
-                                           struct_return);
-               printf_filtered ("Value returned is $%d = ", 
-                                record_latest_value (val));
-               value_print (val, gdb_stdout, 0, Val_no_prettyprint);
-               printf_filtered ("\n");
-#endif       
-             }
-         }
-       do_cleanups(old_chain);
-      }
+             val = value_being_returned (value_type, stop_registers,
+                                         struct_return);
+             printf_filtered ("Value returned is $%d = ",
+                              record_latest_value (val));
+             value_print (val, gdb_stdout, 0, Val_no_prettyprint);
+             printf_filtered ("\n");
+#endif
+           }
+       }
+      do_cleanups (old_chain);
+    }
 }
 \f
 /* ARGSUSED */
 static void
 program_info (args, from_tty)
-    char *args;
-    int from_tty;
+     char *args;
+     int from_tty;
 {
   bpstat bs = stop_bpstat;
   int num = bpstat_num (&bs);
-  
+
   if (!target_has_execution)
     {
       printf_filtered ("The program being debugged is not being run.\n");
@@ -1116,13 +1117,13 @@ program_info (args, from_tty)
 
   target_files_info ();
   printf_filtered ("Program stopped at %s.\n",
-                  local_hex_string((unsigned long) stop_pc));
+                  local_hex_string ((unsigned long) stop_pc));
   if (stop_step)
     printf_filtered ("It stopped after being stepped.\n");
   else if (num != 0)
     {
       /* There may be several breakpoints in the same place, so this
-        isn't as strange as it seems.  */
+         isn't as strange as it seems.  */
       while (num != 0)
        {
          if (num < 0)
@@ -1200,14 +1201,14 @@ set_environment_command (arg, from_tty)
   if (p != 0 && val != 0)
     {
       /* We have both a space and an equals.  If the space is before the
-        equals, walk forward over the spaces til we see a nonspace 
-        (possibly the equals). */
+         equals, walk forward over the spaces til we see a nonspace 
+         (possibly the equals). */
       if (p > val)
        while (*val == ' ')
          val++;
 
       /* Now if the = is after the char following the spaces,
-        take the char following the spaces.  */
+         take the char following the spaces.  */
       if (p > val)
        p = val - 1;
     }
@@ -1231,7 +1232,8 @@ set_environment_command (arg, from_tty)
        val++;
     }
 
-  while (p != arg && (p[-1] == ' ' || p[-1] == '\t')) p--;
+  while (p != arg && (p[-1] == ' ' || p[-1] == '\t'))
+    p--;
 
   var = savestring (arg, p - arg);
   if (nullset)
@@ -1253,7 +1255,7 @@ unset_environment_command (var, from_tty)
   if (var == 0)
     {
       /* If there is no argument, delete all environment variables.
-        Ask for confirmation if reading from the terminal.  */
+         Ask for confirmation if reading from the terminal.  */
       if (!from_tty || query ("Delete all environment variables? "))
        {
          free_environ (inferior_environ);
@@ -1298,10 +1300,10 @@ path_command (dirname, from_tty)
   set_in_environ (inferior_environ, path_var_name, exec_path);
   free (exec_path);
   if (from_tty)
-    path_info ((char *)NULL, from_tty);
+    path_info ((char *) NULL, from_tty);
 }
-
 \f
+
 #ifdef REGISTER_NAMES
 char *gdb_register_names[] = REGISTER_NAMES;
 #endif
@@ -1314,7 +1316,7 @@ char *gdb_register_names[] = REGISTER_NAMES;
    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.  */  
+   to provide that format.  */
 
 #if !defined (DO_REGISTERS_INFO)
 
@@ -1334,16 +1336,19 @@ do_registers_info (regnum, fpregs)
       char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
 
       /* Decide between printing all regs, nonfloat regs, or specific reg.  */
-      if (regnum == -1) {
-       if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs)
-         continue;
-      } else {
-        if (i != regnum)
-         continue;
-      }
+      if (regnum == -1)
+       {
+         if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs)
+           continue;
+       }
+      else
+       {
+         if (i != regnum)
+           continue;
+       }
 
       /* If the register name is empty, it is undefined for this
-        processor, so don't display anything.  */
+         processor, so don't display anything.  */
       if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
        continue;
 
@@ -1386,8 +1391,8 @@ do_registers_info (regnum, fpregs)
          for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
            {
              register int idx = TARGET_BYTE_ORDER == BIG_ENDIAN ? j
-               : REGISTER_RAW_SIZE (i) - 1 - j;
-             printf_filtered ("%02x", (unsigned char)raw_buffer[idx]);
+             : REGISTER_RAW_SIZE (i) - 1 - j;
+             printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
            }
          printf_filtered (")");
        }
@@ -1395,13 +1400,13 @@ do_registers_info (regnum, fpregs)
 /* FIXME!  val_print probably can handle all of these cases now...  */
 
       /* Else if virtual format is too long for printf,
-        print in hex a byte at a time.  */
+         print in hex a byte at a time.  */
       else if (REGISTER_VIRTUAL_SIZE (i) > (int) sizeof (long))
        {
          register int j;
          printf_filtered ("0x");
          for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
-           printf_filtered ("%02x", (unsigned char)virtual_buffer[j]);
+           printf_filtered ("%02x", (unsigned char) virtual_buffer[j]);
        }
       /* Else print as integer in hex and in decimal.  */
       else
@@ -1410,11 +1415,11 @@ do_registers_info (regnum, fpregs)
                     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);
+                    gdb_stdout, 0, 1, 0, Val_pretty_default);
        }
 
       /* The SPARC wants to print even-numbered float regs as doubles
-        in addition to printing them as floats.  */
+         in addition to printing them as floats.  */
 #ifdef PRINT_REGISTER_HOOK
       PRINT_REGISTER_HOOK (i);
 #endif
@@ -1439,12 +1444,12 @@ registers_info (addr_exp, fpregs)
 
   if (!addr_exp)
     {
-      DO_REGISTERS_INFO(-1, fpregs);
+      DO_REGISTERS_INFO (-1, fpregs);
       return;
     }
 
   do
-    {      
+    {
       if (addr_exp[0] == '$')
        addr_exp++;
       end = addr_exp;
@@ -1453,23 +1458,24 @@ registers_info (addr_exp, fpregs)
       numregs = ARCH_NUM_REGS;
 
       regnum = target_map_name_to_register (addr_exp, end - addr_exp);
-      if (regnum >= 0) 
+      if (regnum >= 0)
        goto found;
 
       regnum = numregs;
 
       if (*addr_exp >= '0' && *addr_exp <= '9')
-       regnum = atoi (addr_exp);               /* Take a number */
-      if (regnum >= numregs)           /* Bad name, or bad number */
+       regnum = atoi (addr_exp);       /* Take a number */
+      if (regnum >= numregs)   /* Bad name, or bad number */
        error ("%.*s: invalid register", end - addr_exp, addr_exp);
 
-found:
-      DO_REGISTERS_INFO(regnum, fpregs);
+    found:
+      DO_REGISTERS_INFO (regnum, fpregs);
 
       addr_exp = end;
       while (*addr_exp == ' ' || *addr_exp == '\t')
        ++addr_exp;
-    } while (*addr_exp != '\0');
+    }
+  while (*addr_exp != '\0');
 }
 
 void
@@ -1487,8 +1493,8 @@ nofp_registers_info (addr_exp, from_tty)
 {
   registers_info (addr_exp, 0);
 }
-
 \f
+
 /*
  * TODO:
  * Should save/restore the tty state since it might be that the
@@ -1514,10 +1520,10 @@ attach_command (args, from_tty)
   extern int auto_solib_add;
 #endif
 
-  char *  exec_file;
-  char *  full_exec_path = NULL;
+  char *exec_file;
+  char *full_exec_path = NULL;
 
-  dont_repeat ();                      /* Not for the faint of heart */
+  dont_repeat ();              /* Not for the faint of heart */
 
   if (target_has_execution)
     {
@@ -1553,36 +1559,38 @@ attach_command (args, from_tty)
    * process itself.
    */
   exec_file = (char *) get_exec_file (0);
-  if (! exec_file) {
-    exec_file = target_pid_to_exec_file (inferior_pid);
-    if (exec_file) {
-     /* It's possible we don't have a full path, but rather just a
-         filename.  Some targets, such as HP-UX, don't provide the
-         full path, sigh.
-
-         Attempt to qualify the filename against the source path.
-         (If that fails, we'll just fall back on the original
-         filename.  Not much more we can do...)
-         */
-      if (!source_full_path_of (exec_file, &full_exec_path))
-        full_exec_path = savestring (exec_file, strlen (exec_file));
-
-      exec_file_attach (full_exec_path, from_tty);
-      symbol_file_command (full_exec_path, from_tty);
+  if (!exec_file)
+    {
+      exec_file = target_pid_to_exec_file (inferior_pid);
+      if (exec_file)
+       {
+         /* It's possible we don't have a full path, but rather just a
+            filename.  Some targets, such as HP-UX, don't provide the
+            full path, sigh.
+
+            Attempt to qualify the filename against the source path.
+            (If that fails, we'll just fall back on the original
+            filename.  Not much more we can do...)
+          */
+         if (!source_full_path_of (exec_file, &full_exec_path))
+           full_exec_path = savestring (exec_file, strlen (exec_file));
+
+         exec_file_attach (full_exec_path, from_tty);
+         symbol_file_command (full_exec_path, from_tty);
+       }
     }
-  }
 
 #ifdef SOLIB_ADD
   if (auto_solib_add)
     {
       /* Add shared library symbols from the newly attached process, if any.  */
-      SOLIB_ADD ((char *)0, from_tty, &current_target);
+      SOLIB_ADD ((char *) 0, from_tty, &current_target);
       re_enable_breakpoints_in_shlibs ();
     }
 #endif
 
   /* Take any necessary post-attaching actions for this platform.
-     */
+   */
   target_post_attach (inferior_pid);
 
   normal_stop ();
@@ -1604,7 +1612,7 @@ detach_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  dont_repeat ();                      /* Not for the faint of heart */
+  dont_repeat ();              /* Not for the faint of heart */
   target_detach (args, from_tty);
 #if defined(SOLIB_RESTART)
   SOLIB_RESTART ();
@@ -1620,7 +1628,7 @@ interrupt_target_command (args, from_tty)
 {
   if (async_p && target_has_async)
     {
-      dont_repeat ();                  /* Not for the faint of heart */
+      dont_repeat ();          /* Not for the faint of heart */
       target_stop ();
     }
 }
@@ -1653,14 +1661,14 @@ void
 _initialize_infcmd ()
 {
   struct cmd_list_element *c;
-  
+
   add_com ("tty", class_run, tty_command,
           "Set terminal for future runs of program being debugged.");
 
   add_show_from_set
-    (add_set_cmd ("args", class_run, var_string_noescape, 
-                 (char *)&inferior_args,
-"Set argument list to give program being debugged when it is started.\n\
+    (add_set_cmd ("args", class_run, var_string_noescape,
+                 (char *) &inferior_args,
+                 "Set argument list to give program being debugged when it is started.\n\
 Follow this command with any number of args, to be passed to the program.",
                  &setlist),
      &showlist);
@@ -1676,11 +1684,11 @@ environment to be given to the program.", &showlist);
   add_prefix_cmd ("unset", no_class, unset_command,
                  "Complement to certain \"set\" commands",
                  &unsetlist, "unset ", 0, &cmdlist);
-  
+
   c = add_cmd ("environment", class_run, unset_environment_command,
-             "Cancel environment variable VAR for the program.\n\
+              "Cancel environment variable VAR for the program.\n\
 This does not affect the program until the next \"run\" command.",
-          &unsetlist);
+              &unsetlist);
   c->completer = noop_completer;
 
   c = add_cmd ("environment", class_run, set_environment_command,
@@ -1688,18 +1696,18 @@ This does not affect the program until the next \"run\" command.",
 Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
 VALUES of environment variables are uninterpreted strings.\n\
 This does not affect the program until the next \"run\" command.",
-          &setlist);
+              &setlist);
   c->completer = noop_completer;
+
   add_com ("path", class_files, path_command,
-       "Add directory DIR(s) to beginning of search path for object files.\n\
+          "Add directory DIR(s) to beginning of search path for object files.\n\
 $cwd in the path means the current working directory.\n\
 This path is equivalent to the $PATH shell variable.  It is a list of\n\
 directories, separated by colons.  These directories are searched to find\n\
 fully linked executable files and separately compiled object files as needed.");
 
   c = add_cmd ("paths", no_class, path_info,
-           "Current search path for finding object files.\n\
+              "Current search path for finding object files.\n\
 $cwd in the path means the current working directory.\n\
 This path is equivalent to the $PATH shell variable.  It is a list of\n\
 directories, separated by colons.  These directories are searched to find\n\
@@ -1707,8 +1715,8 @@ fully linked executable files and separately compiled object files as needed.",
               &showlist);
   c->completer = noop_completer;
 
- add_com ("attach", class_run, attach_command,
-          "Attach to a process or file outside of GDB.\n\
 add_com ("attach", class_run, attach_command,
+          "Attach to a process or file outside of GDB.\n\
 This command attaches to another target, of the same type as your last\n\
 \"target\" command (\"info files\" will show your target stack).\n\
 The command may take as argument a process id or a device file.\n\
@@ -1750,7 +1758,7 @@ when they do, the call is treated as one instruction.\n\
 Argument N means do this N times (or till program stops for another reason).");
   add_com_alias ("n", "next", class_run, 1);
   if (xdb_commands)
-    add_com_alias("S", "next", class_run, 1);
+    add_com_alias ("S", "next", class_run, 1);
 
   add_com ("step", class_run, step_command,
           "Step program until it reaches a different source line.\n\
@@ -1758,11 +1766,11 @@ Argument N means do this N times (or till program stops for another reason).");
   add_com_alias ("s", "step", class_run, 1);
 
   add_com ("until", class_run, until_command,
-"Execute until the program reaches a source line greater than the current\n\
+          "Execute until the program reaches a source line greater than the current\n\
 or a specified line or address or function (same args as break command).\n\
 Execution will also stop upon exit from the current stack frame.");
   add_com_alias ("u", "until", class_run, 1);
-  
+
   add_com ("jump", class_run, jump_command,
           "Continue program being debugged at specified line or address.\n\
 Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
@@ -1778,7 +1786,7 @@ expression for an address to start at.\n\
 This command is a combination of tbreak and jump.");
 
   if (xdb_commands)
-    add_com_alias("g", "go", class_run, 1);
+    add_com_alias ("g", "go", class_run, 1);
 
   add_com ("continue", class_run, continue_command,
           "Continue program being debugged, after signal or breakpoint.\n\
@@ -1798,21 +1806,21 @@ use \"set args\" without arguments.");
   add_com_alias ("r", "run", class_run, 1);
   if (xdb_commands)
     add_com ("R", class_run, run_no_args_command,
-         "Start debugged program with no arguments.");
+            "Start debugged program with no arguments.");
 
   add_com ("interrupt", class_run, interrupt_target_command,
           "Interrupt the execution of the debugged program.");
 
   add_info ("registers", nofp_registers_info,
-    "List of integer registers and their contents, for selected stack frame.\n\
+           "List of integer registers and their contents, for selected stack frame.\n\
 Register name as argument means describe only that register.");
 
   if (xdb_commands)
-    add_com("lr", class_info, nofp_registers_info,
-    "List of integer registers and their contents, for selected stack frame.\n\
+    add_com ("lr", class_info, nofp_registers_info,
+            "List of integer registers and their contents, for selected stack frame.\n\
   Register name as argument means describe only that register.");
   add_info ("all-registers", all_registers_info,
-    "List of all registers and their contents, for selected stack frame.\n\
+           "List of all registers and their contents, for selected stack frame.\n\
 Register name as argument means describe only that register.");
 
   add_info ("program", program_info,
index 9ba86c7a62347577de69c0f815275fd4e689f87a..7326f19ce343584a97b0fd06626bbd633136459a 100644 (file)
@@ -2,21 +2,22 @@
    Where it is, why it stopped, and how to step it.
    Copyright 1986, 1989, 1992, 1996, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (INFERIOR_H)
 #define INFERIOR_H 1
@@ -45,7 +46,7 @@ extern void restore_inferior_status PARAMS ((struct inferior_status *));
 
 extern void discard_inferior_status PARAMS ((struct inferior_status *));
 
-extern void write_inferior_status_register PARAMS ((struct inferior_status *inf_status, int regno, LONGEST val));
+extern void write_inferior_status_register PARAMS ((struct inferior_status * inf_status, int regno, LONGEST val));
 
 /* This macro gives the number of registers actually in use by the
    inferior.  This may be less than the total number of registers,
@@ -89,7 +90,7 @@ extern int sync_execution;
 
    If this is > 0, then that many subsequent exec events should be
    ignored (i.e., not be reported to the user).
  */
+ */
 extern int inferior_ignoring_startup_exec_events;
 
 /* This is only valid when inferior_ignoring_startup_exec_events is
@@ -100,7 +101,7 @@ extern int inferior_ignoring_startup_exec_events;
    need actually be noticed and responded to by the debugger (i.e.,
    be reported to the user), then this is the number of "leading"
    exec events which should be ignored.
  */
+ */
 extern int inferior_ignoring_leading_exec_events;
 
 /* Inferior environment. */
@@ -127,7 +128,7 @@ extern void generic_mourn_inferior PARAMS ((void));
 
 extern void terminal_ours PARAMS ((void));
 
-extern int run_stack_dummy PARAMS ((CORE_ADDR, char*));
+extern int run_stack_dummy PARAMS ((CORE_ADDR, char *));
 
 extern CORE_ADDR read_pc PARAMS ((void));
 
@@ -305,7 +306,7 @@ extern int stopped_by_random_signal;
    that address plus one.  But maybe not.).  */
 
 extern CORE_ADDR step_range_start;     /* Inclusive */
-extern CORE_ADDR step_range_end;/* Exclusive */
+extern CORE_ADDR step_range_end;       /* Exclusive */
 
 /* Stack frame address as of when stepping command was issued.
    This is how we know when we step into a subroutine call,
@@ -390,20 +391,20 @@ extern int attach_flag;
 #endif /* No CALL_DUMMY_LOCATION.  */
 
 #if !defined (CALL_DUMMY_ADDRESS)
-#define CALL_DUMMY_ADDRESS() (abort (), 0) /* anything to abort GDB */
+#define CALL_DUMMY_ADDRESS() (abort (), 0)     /* anything to abort GDB */
 #endif
 #if !defined (CALL_DUMMY_START_OFFSET)
-#define CALL_DUMMY_START_OFFSET (abort (), 0) /* anything to abort GDB */
+#define CALL_DUMMY_START_OFFSET (abort (), 0)  /* anything to abort GDB */
 #endif
 #if !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
 #define CALL_DUMMY_BREAKPOINT_OFFSET_P (0)
-#define CALL_DUMMY_BREAKPOINT_OFFSET (abort (), 0) /* anything to abort GDB */
+#define CALL_DUMMY_BREAKPOINT_OFFSET (abort (), 0)     /* anything to abort GDB */
 #endif
 #if !defined CALL_DUMMY_BREAKPOINT_OFFSET_P
 #define CALL_DUMMY_BREAKPOINT_OFFSET_P (1)
 #endif
 #if !defined (CALL_DUMMY_LENGTH)
-#define CALL_DUMMY_LENGTH (abort (), 0) /* anything to abort GDB */
+#define CALL_DUMMY_LENGTH (abort (), 0)                /* anything to abort GDB */
 #endif
 
 #if defined (CALL_DUMMY_STACK_ADJUST)
@@ -431,7 +432,7 @@ extern int attach_flag;
 extern LONGEST call_dummy_words[];
 #define CALL_DUMMY_WORDS (call_dummy_words)
 #else
-#define CALL_DUMMY_WORDS (abort (), (void*) 0) /* anything to abort GDB */
+#define CALL_DUMMY_WORDS (abort (), (void*) 0) /* anything to abort GDB */
 #endif
 #endif
 
@@ -440,7 +441,7 @@ extern LONGEST call_dummy_words[];
 extern int sizeof_call_dummy_words;
 #define SIZEOF_CALL_DUMMY_WORDS (sizeof_call_dummy_words)
 #else
-#define SIZEOF_CALL_DUMMY_WORDS (abort (), 0) /* anything to abort GDB */
+#define SIZEOF_CALL_DUMMY_WORDS (abort (), 0)  /* anything to abort GDB */
 #endif
 #endif
 
@@ -469,7 +470,7 @@ extern int pc_in_call_dummy_before_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp,
 extern int pc_in_call_dummy_after_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
 #if !GDB_MULTI_ARCH
 #if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AFTER_TEXT_END
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address) 
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address)
 #endif
 #endif
 
@@ -503,7 +504,7 @@ extern int pc_in_call_dummy_at_entry_point PARAMS ((CORE_ADDR pc, CORE_ADDR sp,
    default implementation of CALL_DUMMY_HAS_COMPLETED is sufficient.
    Else, a target may wish to supply an implementation that works in
    the presense of multiple breakpoints in its call dummy.
  */
+ */
 #if !defined(CALL_DUMMY_HAS_COMPLETED)
 #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \
   PC_IN_CALL_DUMMY((pc), (sp), (frame_address))
index 6ce7721a93b2779f6abe5804234e0d75678ff661..da25bd46a78ae1d39ab45698b584a74151de042d 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ptrace, for GDB when running under Unix.
    Copyright 1986-87, 1989, 1991-92, 1995, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -114,7 +115,11 @@ static char *inferior_thisrun_terminal;
 
 int terminal_is_ours;
 
-enum {yes, no, have_not_checked} gdb_has_a_terminal_flag = have_not_checked;
+enum
+  {
+    yes, no, have_not_checked
+  }
+gdb_has_a_terminal_flag = have_not_checked;
 
 /* Does GDB have a terminal (on stdin)?  */
 int
@@ -128,8 +133,8 @@ gdb_has_a_terminal ()
       return 0;
     case have_not_checked:
       /* Get all the current tty settings (including whether we have a tty at
-        all!).  Can't do this in _initialize_inflow because SERIAL_FDOPEN
-        won't work until the serial_ops_list is initialized.  */
+         all!).  Can't do this in _initialize_inflow because SERIAL_FDOPEN
+         won't work until the serial_ops_list is initialized.  */
 
 #ifdef F_GETFL
       tflags_ours = fcntl (0, F_GETFL, 0);
@@ -182,7 +187,7 @@ terminal_init_inferior_with_pgrp (pgrp)
   if (gdb_has_a_terminal ())
     {
       /* We could just as well copy our_ttystate (if we felt like adding
-        a new function SERIAL_COPY_TTY_STATE).  */
+         a new function SERIAL_COPY_TTY_STATE).  */
       if (inferior_ttystate)
        free (inferior_ttystate);
       inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
@@ -192,8 +197,8 @@ terminal_init_inferior_with_pgrp (pgrp)
 #endif
 
       /* Make sure that next time we call terminal_inferior (which will be
-        before the program runs, as it needs to be), we install the new
-        process group.  */
+         before the program runs, as it needs to be), we install the new
+         process group.  */
       terminal_is_ours = 1;
     }
 }
@@ -225,38 +230,38 @@ terminal_inferior ()
 
 #ifdef F_GETFL
       /* Is there a reason this is being done twice?  It happens both
-        places we use F_SETFL, so I'm inclined to think perhaps there
-        is some reason, however perverse.  Perhaps not though...  */
+         places we use F_SETFL, so I'm inclined to think perhaps there
+         is some reason, however perverse.  Perhaps not though...  */
       result = fcntl (0, F_SETFL, tflags_inferior);
       result = fcntl (0, F_SETFL, tflags_inferior);
       OOPSY ("fcntl F_SETFL");
 #endif
 
       /* Because we were careful to not change in or out of raw mode in
-        terminal_ours, we will not change in our out of raw mode with
-        this call, so we don't flush any input.  */
+         terminal_ours, we will not change in our out of raw mode with
+         this call, so we don't flush any input.  */
       result = SERIAL_SET_TTY_STATE (stdin_serial, inferior_ttystate);
       OOPSY ("setting tty state");
 
       if (!job_control)
        {
-         sigint_ours = (void (*) ()) signal (SIGINT, SIG_IGN);
+         sigint_ours = (void (*)()) signal (SIGINT, SIG_IGN);
 #ifdef SIGQUIT
-         sigquit_ours = (void (*) ()) signal (SIGQUIT, SIG_IGN);
+         sigquit_ours = (void (*)()) signal (SIGQUIT, SIG_IGN);
 #endif
        }
 
       /* If attach_flag is set, we don't know whether we are sharing a
-        terminal with the inferior or not.  (attaching a process
-        without a terminal is one case where we do not; attaching a
-        process which we ran from the same shell as GDB via `&' is
-        one case where we do, I think (but perhaps this is not
-        `sharing' in the sense that we need to save and restore tty
-        state)).  I don't know if there is any way to tell whether we
-        are sharing a terminal.  So what we do is to go through all
-        the saving and restoring of the tty state, but ignore errors
-        setting the process group, which will happen if we are not
-        sharing a terminal).  */
+         terminal with the inferior or not.  (attaching a process
+         without a terminal is one case where we do not; attaching a
+         process which we ran from the same shell as GDB via `&' is
+         one case where we do, I think (but perhaps this is not
+         `sharing' in the sense that we need to save and restore tty
+         state)).  I don't know if there is any way to tell whether we
+         are sharing a terminal.  So what we do is to go through all
+         the saving and restoring of the tty state, but ignore errors
+         setting the process group, which will happen if we are not
+         sharing a terminal).  */
 
       if (job_control)
        {
@@ -319,7 +324,7 @@ terminal_ours_1 (output_only)
   if (!terminal_is_ours)
     {
       /* Ignore this signal since it will happen when we try to set the
-        pgrp.  */
+         pgrp.  */
       void (*osigttou) ();
       int result;
 
@@ -327,7 +332,7 @@ terminal_ours_1 (output_only)
 
 #ifdef SIGTTOU
       if (job_control)
-       osigttou = (void (*) ()) signal (SIGTTOU, SIG_IGN);
+       osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN);
 #endif
 
       if (inferior_ttystate)
@@ -344,18 +349,18 @@ terminal_ours_1 (output_only)
 #endif
 
       /* Here we used to set ICANON in our ttystate, but I believe this
-        was an artifact from before when we used readline.  Readline sets
-        the tty state when it needs to.
-        FIXME-maybe: However, query() expects non-raw mode and doesn't
-        use readline.  Maybe query should use readline (on the other hand,
-        this only matters for HAVE_SGTTY, not termio or termios, I think).  */
+         was an artifact from before when we used readline.  Readline sets
+         the tty state when it needs to.
+         FIXME-maybe: However, query() expects non-raw mode and doesn't
+         use readline.  Maybe query should use readline (on the other hand,
+         this only matters for HAVE_SGTTY, not termio or termios, I think).  */
 
       /* Set tty state to our_ttystate.  We don't change in our out of raw
-        mode, to avoid flushing input.  We need to do the same thing
-        regardless of output_only, because we don't have separate
-        terminal_is_ours and terminal_is_ours_for_output flags.  It's OK,
-        though, since readline will deal with raw mode when/if it needs to.
-        */
+         mode, to avoid flushing input.  We need to do the same thing
+         regardless of output_only, because we don't have separate
+         terminal_is_ours and terminal_is_ours_for_output flags.  It's OK,
+         though, since readline will deal with raw mode when/if it needs to.
+       */
 
       SERIAL_NOFLUSH_SET_TTY_STATE (stdin_serial, our_ttystate,
                                    inferior_ttystate);
@@ -371,7 +376,7 @@ terminal_ours_1 (output_only)
             such situations as well.  */
          if (result == -1)
            fprintf_unfiltered (gdb_stderr, "[tcsetpgrp failed in terminal_ours: %s]\n",
-                    strerror (errno));
+                               strerror (errno));
 #endif
 #endif /* termios */
 
@@ -397,13 +402,13 @@ terminal_ours_1 (output_only)
       tflags_inferior = fcntl (0, F_GETFL, 0);
 
       /* Is there a reason this is being done twice?  It happens both
-        places we use F_SETFL, so I'm inclined to think perhaps there
-        is some reason, however perverse.  Perhaps not though...  */
+         places we use F_SETFL, so I'm inclined to think perhaps there
+         is some reason, however perverse.  Perhaps not though...  */
       result = fcntl (0, F_SETFL, tflags_ours);
       result = fcntl (0, F_SETFL, tflags_ours);
 #endif
 
-      result = result; /* lint */
+      result = result;         /* lint */
     }
 }
 
@@ -433,7 +438,7 @@ child_terminal_info (args, from_tty)
   /* First the fcntl flags.  */
   {
     int flags;
-    
+
     flags = tflags_inferior;
 
     printf_filtered ("File descriptor flags = ");
@@ -444,18 +449,24 @@ child_terminal_info (args, from_tty)
     /* (O_ACCMODE) parens are to avoid Ultrix header file bug */
     switch (flags & (O_ACCMODE))
       {
-      case O_RDONLY: printf_filtered ("O_RDONLY"); break;
-      case O_WRONLY: printf_filtered ("O_WRONLY"); break;
-      case O_RDWR: printf_filtered ("O_RDWR"); break;
+      case O_RDONLY:
+       printf_filtered ("O_RDONLY");
+       break;
+      case O_WRONLY:
+       printf_filtered ("O_WRONLY");
+       break;
+      case O_RDWR:
+       printf_filtered ("O_RDWR");
+       break;
       }
     flags &= ~(O_ACCMODE);
 
 #ifdef O_NONBLOCK
-    if (flags & O_NONBLOCK) 
+    if (flags & O_NONBLOCK)
       printf_filtered (" | O_NONBLOCK");
     flags &= ~O_NONBLOCK;
 #endif
-    
+
 #if defined (O_NDELAY)
     /* If O_NDELAY and O_NONBLOCK are defined to the same thing, we will
        print it as O_NONBLOCK, which is good cause that is what POSIX
@@ -517,41 +528,50 @@ new_tty ()
   /* Disconnect the child process from our controlling terminal.  On some
      systems (SVR4 for example), this may cause a SIGTTOU, so temporarily
      ignore SIGTTOU. */
-  tty = open("/dev/tty", O_RDWR);
+  tty = open ("/dev/tty", O_RDWR);
   if (tty > 0)
     {
       void (*osigttou) ();
 
-      osigttou = (void (*)()) signal(SIGTTOU, SIG_IGN);
-      ioctl(tty, TIOCNOTTY, 0);
-      close(tty);
-      signal(SIGTTOU, osigttou);
+      osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN);
+      ioctl (tty, TIOCNOTTY, 0);
+      close (tty);
+      signal (SIGTTOU, osigttou);
     }
 #endif
 
   /* Now open the specified new terminal.  */
 
 #ifdef USE_O_NOCTTY
-  tty = open(inferior_thisrun_terminal, O_RDWR | O_NOCTTY);
+  tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY);
 #else
-  tty = open(inferior_thisrun_terminal, O_RDWR);
+  tty = open (inferior_thisrun_terminal, O_RDWR);
 #endif
   if (tty == -1)
     {
       print_sys_errmsg (inferior_thisrun_terminal, errno);
-      _exit(1);
+      _exit (1);
     }
 
   /* Avoid use of dup2; doesn't exist on all systems.  */
   if (tty != 0)
-    { close (0); dup (tty); }
+    {
+      close (0);
+      dup (tty);
+    }
   if (tty != 1)
-    { close (1); dup (tty); }
+    {
+      close (1);
+      dup (tty);
+    }
   if (tty != 2)
-    { close (2); dup (tty); }
+    {
+      close (2);
+      dup (tty);
+    }
   if (tty > 2)
-    close(tty);
-#endif /* !go32 && !win32*/
+    close (tty);
+#endif /* !go32 && !win32 */
 }
 \f
 /* Kill the inferior process.  Make us have no inferior.  */
@@ -572,17 +592,18 @@ kill_command (arg, from_tty)
     error ("Not confirmed.");
   target_kill ();
 
-  init_thread_list();          /* Destroy thread info */
+  init_thread_list ();         /* Destroy thread info */
 
   /* Killing off the inferior can leave us with a core file.  If so,
      print the state we are left in.  */
-  if (target_has_stack) {
-    printf_filtered ("In %s,\n", target_longname);
-    if (selected_frame == NULL)
-      fputs_filtered ("No selected stack frame.\n", gdb_stdout);
-    else
-      print_stack_frame (selected_frame, selected_frame_level, 1);
-  }
+  if (target_has_stack)
+    {
+      printf_filtered ("In %s,\n", target_longname);
+      if (selected_frame == NULL)
+       fputs_filtered ("No selected stack frame.\n", gdb_stdout);
+      else
+       print_stack_frame (selected_frame, selected_frame_level, 1);
+    }
 }
 \f
 /* Call set_sigint_trap when you need to pass a signal on to an attached
@@ -591,26 +612,26 @@ kill_command (arg, from_tty)
 /* ARGSUSED */
 static void
 pass_signal (signo)
-    int signo;
+     int signo;
 {
 #ifndef _WIN32
   kill (PIDGET (inferior_pid), SIGINT);
 #endif
 }
 
-static void (*osig)();
+static void (*osig) ();
 
 void
-set_sigint_trap()
+set_sigint_trap ()
 {
   if (attach_flag || inferior_thisrun_terminal)
     {
-      osig = (void (*) ()) signal (SIGINT, pass_signal);
+      osig = (void (*)()) signal (SIGINT, pass_signal);
     }
 }
 
 void
-clear_sigint_trap()
+clear_sigint_trap ()
 {
   if (attach_flag || inferior_thisrun_terminal)
     {
@@ -649,8 +670,8 @@ set_sigio_trap ()
 {
   if (target_activity_function)
     {
-      old_sigio = (void (*) ()) signal (SIGIO, handle_sigio);
-      fcntl (target_activity_fd, F_SETOWN, getpid()); 
+      old_sigio = (void (*)()) signal (SIGIO, handle_sigio);
+      fcntl (target_activity_fd, F_SETOWN, getpid ());
       old_fcntl_flags = fcntl (target_activity_fd, F_GETFL, 0);
       fcntl (target_activity_fd, F_SETFL, old_fcntl_flags | FASYNC);
     }
@@ -700,8 +721,8 @@ gdb_setpgid ()
     {
 #if defined (NEED_POSIX_SETPGID) || (defined (HAVE_TERMIOS) && defined (HAVE_SETPGID))
       /* setpgid (0, 0) is supposed to work and mean the same thing as
-        this, but on Ultrix 4.2A it fails with EPERM (and
-        setpgid (getpid (), getpid ()) succeeds).  */
+         this, but on Ultrix 4.2A it fails with EPERM (and
+         setpgid (getpid (), getpid ()) succeeds).  */
       retval = setpgid (getpid (), getpid ());
 #else
 #if defined (TIOCGPGRP)
@@ -720,7 +741,7 @@ void
 _initialize_inflow ()
 {
   add_info ("terminal", term_info,
-          "Print inferior's saved terminal status.");
+           "Print inferior's saved terminal status.");
 
   add_com ("kill", class_run, kill_command,
           "Kill execution of program being debugged.");
@@ -741,10 +762,10 @@ _initialize_inflow ()
 #ifdef _SC_JOB_CONTROL
   job_control = sysconf (_SC_JOB_CONTROL);
 #else
-  job_control = 0;     /* have to assume the worst */
-#endif /* _SC_JOB_CONTROL */
-#endif /* _POSIX_JOB_CONTROL */
-#endif /* HAVE_TERMIOS */
+  job_control = 0;             /* have to assume the worst */
+#endif /* _SC_JOB_CONTROL */
+#endif /* _POSIX_JOB_CONTROL */
+#endif /* HAVE_TERMIOS */
 
 #ifdef HAVE_SGTTY
 #ifdef TIOCGPGRP
index 1db7223ea3b5c891eb1e5a3d9e57f92df99c8cc9..eec7c6ae8334a5e0a0b90c8de08dae04e102d3d0 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1988, 89, 90, 91, 92, 93, 94, 95, 96, 1998 
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -36,11 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/ioctl.h>
 
 #ifdef HAVE_PTRACE_H
-# include <ptrace.h>
+#include <ptrace.h>
 #else
-# ifdef HAVE_SYS_PTRACE_H
-#  include <sys/ptrace.h>
-# endif
+#ifdef HAVE_SYS_PTRACE_H
+#include <sys/ptrace.h>
+#endif
 #endif
 
 #if !defined (PT_READ_I)
@@ -107,8 +108,8 @@ static void store_register PARAMS ((int));
 
 void _initialize_kernel_u_addr PARAMS ((void));
 void _initialize_infptrace PARAMS ((void));
-
 \f
+
 /* This function simply calls ptrace with the given arguments.  
    It exists so that all calls to ptrace are isolated in this 
    machine-dependent file. */
@@ -128,25 +129,27 @@ call_ptrace (request, pid, addr, data)
 #endif
 #if defined(PT_SETTRC)
   /* If the parent can be told to attach to us, try to do it.  */
-  if (request == PT_SETTRC) {
-    errno = 0;
-    pt_status = ptrace (PT_SETTRC, pid, addr, data
+  if (request == PT_SETTRC)
+    {
+      errno = 0;
+      pt_status = ptrace (PT_SETTRC, pid, addr, data
 #if defined (FIVE_ARG_PTRACE)
-                       /* Deal with HPUX 8.0 braindamage.  We never use the
-                          calls which require the fifth argument.  */
-                       0
+      /* Deal with HPUX 8.0 braindamage.  We never use the
+         calls which require the fifth argument.  */
+                         ,0
 #endif
-                       );
+       );
 
-     if (errno) perror_with_name ("ptrace");
+      if (errno)
+       perror_with_name ("ptrace");
 #if 0
-     printf (" = %d\n", pt_status);
+      printf (" = %d\n", pt_status);
 #endif
-     if (pt_status < 0)
-         return pt_status;
-     else
-         return parent_attach_all (pid, addr, data);
-  }
+      if (pt_status < 0)
+       return pt_status;
+      else
+       return parent_attach_all (pid, addr, data);
+    }
 #endif
 
 #if defined(PT_CONTIN1)
@@ -169,11 +172,11 @@ call_ptrace (request, pid, addr, data)
 #endif
   pt_status = ptrace (request, pid, addr, data
 #if defined (FIVE_ARG_PTRACE)
-                /* Deal with HPUX 8.0 braindamage.  We never use the
-                   calls which require the fifth argument.  */
-                0
+  /* Deal with HPUX 8.0 braindamage.  We never use the
+     calls which require the fifth argument.  */
+                     ,0
 #endif
-                );
+    );
 #if 0
   if (errno)
     printf (" [errno = %d]", errno);
@@ -196,8 +199,8 @@ call_ptrace (request, pid, addr, data)
 
 int
 ptrace_wait (pid, status)
-    int pid;
-    int *status;
+     int pid;
+     int *status;
 {
   int wstate;
 
@@ -259,9 +262,9 @@ child_resume (pid, step, signal)
   if (step)
     {
       if (SOFTWARE_SINGLE_STEP_P)
-       abort();  /* Make sure this doesn't happen. */
+       abort ();               /* Make sure this doesn't happen. */
       else
-       ptrace (PT_STEP,     pid, (PTRACE_ARG3_TYPE) 1,
+       ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
                target_signal_to_host (signal));
     }
   else
@@ -272,8 +275,8 @@ child_resume (pid, step, signal)
     perror_with_name ("ptrace");
 }
 #endif /* CHILD_RESUME */
-
 \f
+
 #ifdef ATTACH_DETACH
 /* Start debugging the process whose number is PID.  */
 int
@@ -358,9 +361,9 @@ fetch_register (regno)
 {
   /* This isn't really an address.  But ptrace thinks of it as one.  */
   CORE_ADDR regaddr;
-  char mess[128];                              /* For messages */
+  char mess[128];              /* For messages */
   register int i;
-  unsigned int offset;  /* Offset of registers within the u area.  */
+  unsigned int offset;         /* Offset of registers within the u area.  */
   char buf[MAX_REGISTER_RAW_SIZE];
 
   if (CANNOT_FETCH_REGISTER (regno))
@@ -376,8 +379,8 @@ fetch_register (regno)
   for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
     {
       errno = 0;
-      *(PTRACE_XFER_TYPE *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
-                                             (PTRACE_ARG3_TYPE) regaddr, 0);
+      *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, inferior_pid,
+                                            (PTRACE_ARG3_TYPE) regaddr, 0);
       regaddr += sizeof (PTRACE_XFER_TYPE);
       if (errno != 0)
        {
@@ -423,9 +426,9 @@ store_register (regno)
 {
   /* This isn't really an address.  But ptrace thinks of it as one.  */
   CORE_ADDR regaddr;
-  char mess[128];                              /* For messages */
+  char mess[128];              /* For messages */
   register int i;
-  unsigned int offset;  /* Offset of registers within the u area.  */
+  unsigned int offset;         /* Offset of registers within the u area.  */
 
   if (CANNOT_STORE_REGISTER (regno))
     {
@@ -435,11 +438,11 @@ store_register (regno)
   offset = U_REGS_OFFSET;
 
   regaddr = register_addr (regno, offset);
-  for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(PTRACE_XFER_TYPE))
+  for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
     {
       errno = 0;
       ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
-             *(PTRACE_XFER_TYPE *) &registers[REGISTER_BYTE (regno) + i]);
+             *(PTRACE_XFER_TYPE *) & registers[REGISTER_BYTE (regno) + i]);
       regaddr += sizeof (PTRACE_XFER_TYPE);
       if (errno != 0)
        {
@@ -482,7 +485,7 @@ store_inferior_registers (regno)
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.
-  
+
    Returns the length copied, which is either the LEN argument or zero.
    This xfer function does not do partial moves, since child_ops
    doesn't allow memory operations to cross below us in the target stack
@@ -494,28 +497,29 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & - sizeof (PTRACE_XFER_TYPE);
+  register CORE_ADDR addr = memaddr & -sizeof (PTRACE_XFER_TYPE);
   /* Round ending address up; get number of longwords that makes.  */
   register int count
-    = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
-      / sizeof (PTRACE_XFER_TYPE);
+  = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
+  / sizeof (PTRACE_XFER_TYPE);
   /* Allocate buffer of that many longwords.  */
   register PTRACE_XFER_TYPE *buffer
-    = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+  = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
 
   if (write)
     {
       /* Fill start and end extra bytes of buffer with existing memory data.  */
 
-      if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE)) {
-       /* Need part of initial word -- fetch it.  */
-        buffer[0] = ptrace (PT_READ_I, inferior_pid, (PTRACE_ARG3_TYPE) addr,
-                           0);
-      }
+      if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
+       {
+         /* Need part of initial word -- fetch it.  */
+         buffer[0] = ptrace (PT_READ_I, inferior_pid, (PTRACE_ARG3_TYPE) addr,
+                             0);
+       }
 
       if (count > 1)           /* FIXME, avoid if even boundary */
        {
@@ -540,9 +544,9 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
          ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) addr,
                  buffer[i]);
          if (errno)
-            {
+           {
              /* Using the appropriate one (I or D) is necessary for
-                Gould NP1, at least.  */
+                Gould NP1, at least.  */
              errno = 0;
              ptrace (PT_WRITE_I, inferior_pid, (PTRACE_ARG3_TYPE) addr,
                      buffer[i]);
@@ -551,7 +555,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
            return 0;
        }
 #ifdef CLEAR_INSN_CACHE
-      CLEAR_INSN_CACHE();
+      CLEAR_INSN_CACHE ();
 #endif
     }
   else
@@ -574,23 +578,23 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
     }
   return len;
 }
-
 \f
+
 static void
 udot_info (dummy1, dummy2)
      char *dummy1;
      int dummy2;
 {
 #if defined (KERNEL_U_SIZE)
-  int udot_off;                /* Offset into user struct */
-  int udot_val;                /* Value from user struct at udot_off */
-  char mess[128];      /* For messages */
+  int udot_off;                        /* Offset into user struct */
+  int udot_val;                        /* Value from user struct at udot_off */
+  char mess[128];              /* For messages */
 #endif
 
-   if (!target_has_execution)
-     {
-       error ("The program is not being run.");
-     }
+  if (!target_has_execution)
+    {
+      error ("The program is not being run.");
+    }
 
 #if !defined (KERNEL_U_SIZE)
 
@@ -626,8 +630,8 @@ udot_info (dummy1, dummy2)
 #endif
 }
 #endif /* !defined (CHILD_XFER_MEMORY).  */
-
 \f
+
 void
 _initialize_infptrace ()
 {
index 80cc89157adcbf98707779561c7413775d4cc759..8fa98aeaa7c26721d3122a269bb794d52495a4c4 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-struct-independent code to start (run) and stop an inferior process.
    Copyright 1986-1989, 1991-1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -51,7 +52,7 @@ static int hook_stop_stub PARAMS ((PTR));
 
 static void delete_breakpoint_current_contents PARAMS ((PTR));
 
-static void set_follow_fork_mode_command PARAMS ((char *arg, int from_tty, struct cmd_list_element *c));
+static void set_follow_fork_mode_command PARAMS ((char *arg, int from_tty, struct cmd_list_element * c));
 
 static void complete_execution PARAMS ((void));
 
@@ -119,19 +120,19 @@ static void follow_fork PARAMS ((int parent_pid, int child_pid));
 static void follow_vfork PARAMS ((int parent_pid, int child_pid));
 
 static void set_schedlock_func PARAMS ((char *args, int from_tty,
-                                       struct cmd_list_element *c));
+                                       struct cmd_list_element * c));
 
-static int is_internal_shlib_eventpoint PARAMS ((struct breakpoint *ep));
+static int is_internal_shlib_eventpoint PARAMS ((struct breakpoint * ep));
 
 static int stopped_for_internal_shlib_event PARAMS ((bpstat bs));
 
 static int stopped_for_shlib_catchpoint PARAMS ((bpstat bs,
-                                                struct breakpoint **cp_p));
+                                                struct breakpoint ** cp_p));
 
 #if __STDC__
 struct execution_control_state;
 #endif
-static int currently_stepping PARAMS ((struct execution_control_state *ecs));
+static int currently_stepping PARAMS ((struct execution_control_state * ecs));
 
 static void xdb_handle_command PARAMS ((char *args, int from_tty));
 
@@ -384,8 +385,8 @@ static char *follow_fork_mode_kind_names[] =
    kernel problem.  It's also not terribly useful without a GUI to
    help the user drive two debuggers.  So for now, I'm disabling
    the "both" option.
-  "parent", "child", "both", "ask" };
 */
+   "parent", "child", "both", "ask" };
+ */
   "parent", "child", "ask"};
 
 static char *follow_fork_mode_string = NULL;
@@ -511,7 +512,7 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
       char pid_suffix[100];    /* Arbitrary length. */
 
       /* Clone ourselves to follow the child.  This is the end of our
-       involvement with child_pid; our clone will take it from here... */
+         involvement with child_pid; our clone will take it from here... */
       dont_repeat ();
       target_clone_and_follow_inferior (child_pid, &followed_child);
       followed_parent = !followed_child;
@@ -546,12 +547,12 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
 
      Sequence of events, as reported to gdb from HPUX:
 
-           Parent        Child           Action for gdb to take
-         -------------------------------------------------------
-        1                VFORK               Continue child
-        2                EXEC
-        3                EXEC or EXIT
-        4  VFORK */
+     Parent        Child           Action for gdb to take
+     -------------------------------------------------------
+     1                VFORK               Continue child
+     2                EXEC
+     3                EXEC or EXIT
+     4  VFORK */
   if (has_vforked)
     {
       target_post_follow_vfork (parent_pid,
@@ -667,7 +668,7 @@ follow_exec (pid, execd_pathname)
 
   gdb_flush (gdb_stdout);
   target_mourn_inferior ();
-  inferior_pid = saved_pid;   /* Because mourn_inferior resets inferior_pid. */
+  inferior_pid = saved_pid;    /* Because mourn_inferior resets inferior_pid. */
   push_target (tgt);
 
   /* That a.out is now the one to use. */
@@ -764,7 +765,7 @@ resume (step, sig)
   if (SOFTWARE_SINGLE_STEP_P && step)
     {
       /* Do it the hard way, w/temp breakpoints */
-      SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints*/ );
+      SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
       /* ...and don't ask hardware to do it.  */
       step = 0;
       /* and do not pull these breakpoints until after a `wait' in
@@ -794,9 +795,9 @@ resume (step, sig)
        follow_vfork (inferior_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
-             parent vfork events.  We don't actually want to resume the child
-             in this situation; we want to just get its exec event. */
+          If so, then it actually ought to be waiting for us; we respond to
+          parent vfork events.  We don't actually want to resume the child
+          in this situation; we want to just get its exec event. */
        if (!saw_child_exec &&
            (inferior_pid == pending_follow.fork_event.child_pid))
          should_resume = 0;
@@ -805,7 +806,7 @@ resume (step, sig)
 
     case (TARGET_WAITKIND_EXECD):
       /* If we saw a vfork event but couldn't follow it until we saw
-           an exec, then now might be the time! */
+         an exec, then now might be the time! */
       pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
       /* follow_exec is called as soon as the exec event is seen. */
       break;
@@ -829,7 +830,7 @@ resume (step, sig)
          if (!breakpoint_here_p (read_pc ()))
            {
              /* Breakpoint deleted: ok to do regular resume
-                where all the threads either step or continue. */
+                where all the threads either step or continue. */
              target_resume (-1, step, sig);
            }
          else
@@ -886,11 +887,11 @@ clear_proceed_status ()
 
    ADDR is the address to resume at, or -1 for resume where stopped.
    SIGGNAL is the signal to give it, or 0 for none,
-     or -1 for act according to how it stopped.
+   or -1 for act according to how it stopped.
    STEP is nonzero if should trap after one instruction.
-     -1 means return after that and print nothing.
-     You should probably set various step_... variables
-     before calling here, if you are stepping.
+   -1 means return after that and print nothing.
+   You should probably set various step_... variables
+   before calling here, if you are stepping.
 
    You should call clear_proceed_status before calling proceed.  */
 
@@ -910,8 +911,8 @@ proceed (addr, siggnal, step)
   if (addr == (CORE_ADDR) - 1)
     {
       /* If there is a breakpoint at the address we will resume at,
-        step one instruction before inserting breakpoints
-        so that we do not stop right away (and report a second
+         step one instruction before inserting breakpoints
+         so that we do not stop right away (and report a second
          hit at this breakpoint).  */
 
       if (read_pc () == stop_pc && breakpoint_here_p (read_pc ()))
@@ -922,8 +923,8 @@ proceed (addr, siggnal, step)
 #define STEP_SKIPS_DELAY_P (0)
 #endif
       /* Check breakpoint_here_p first, because breakpoint_here_p is fast
-        (it just checks internal GDB data structures) and STEP_SKIPS_DELAY
-        is slow (it needs to read memory from the target).  */
+         (it just checks internal GDB data structures) and STEP_SKIPS_DELAY
+         is slow (it needs to read memory from the target).  */
       if (STEP_SKIPS_DELAY_P
          && breakpoint_here_p (read_pc () + 4)
          && STEP_SKIPS_DELAY (read_pc ()))
@@ -934,13 +935,13 @@ proceed (addr, siggnal, step)
       write_pc (addr);
 
       /* New address; we don't need to single-step a thread
-        over a breakpoint we just hit, 'cause we aren't
-        continuing from there.
+         over a breakpoint we just hit, 'cause we aren't
+         continuing from there.
 
-        It's not worth worrying about the case where a user
-        asks for a "jump" at the current PC--if they get the
-        hiccup of re-hiting a hit breakpoint, what else do
-        they expect? */
+         It's not worth worrying about the case where a user
+         asks for a "jump" at the current PC--if they get the
+         hiccup of re-hiting a hit breakpoint, what else do
+         they expect? */
       thread_step_needed = 0;
     }
 
@@ -968,9 +969,9 @@ proceed (addr, siggnal, step)
   if (trap_expected_after_continue)
     {
       /* If (step == 0), a trap will be automatically generated after
-        the first instruction is executed.  Force step one
-        instruction to clear this condition.  This should not occur
-        if step is nonzero, but it is harmless in that case.  */
+         the first instruction is executed.  Force step one
+         instruction to clear this condition.  This should not occur
+         if step is nonzero, but it is harmless in that case.  */
       oneproc = 1;
       trap_expected_after_continue = 0;
     }
@@ -1048,8 +1049,8 @@ start_remote ()
   else
     {
       /* The 'tar rem' command should always look synchronous,
-        i.e. display the prompt only once it has connected and
-        started the target. */
+         i.e. display the prompt only once it has connected and
+         started the target. */
       sync_execution = 1;
       push_prompt ("", "", "");
       delete_file_handler (input_fd);
@@ -1104,7 +1105,8 @@ delete_breakpoint_current_contents (arg)
    wfi can call target_wait in one place.  (Ultimately the call will be
    moved out of the infinite loop entirely.) */
 
-enum infwait_states {
+enum infwait_states
+{
   infwait_normal_state,
   infwait_thread_hop_state,
   infwait_nullified_state,
@@ -1115,36 +1117,37 @@ enum infwait_states {
    wait_for_inferior.  Probably many of them can return to being
    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 */
-  int pid;
-  int saved_inferior_pid;
-  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;
-  int waiton_pid;
-  int wait_some_more;
-};
-
-void init_execution_control_state PARAMS ((struct execution_control_state *ecs));
-
-void handle_inferior_event PARAMS ((struct execution_control_state *ecs));
+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 */
+    int pid;
+    int saved_inferior_pid;
+    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;
+    int waiton_pid;
+    int wait_some_more;
+  };
+
+void init_execution_control_state PARAMS ((struct execution_control_state * ecs));
+
+void handle_inferior_event PARAMS ((struct execution_control_state * ecs));
 
 /* Wait for control to return from inferior to debugger.
    If inferior gets a signal, we may decide to start it up again
@@ -1220,14 +1223,14 @@ fetch_inferior_event ()
 {
   static struct cleanup *old_cleanups;
 
-  async_ecs = &async_ecss;  
+  async_ecs = &async_ecss;
 
   if (!async_ecs->wait_some_more)
     {
       old_cleanups = make_exec_cleanup (delete_breakpoint_current_contents,
-                                  &step_resume_breakpoint);
+                                       &step_resume_breakpoint);
       make_exec_cleanup (delete_breakpoint_current_contents,
-                   &through_sigtramp_breakpoint);
+                        &through_sigtramp_breakpoint);
 
       /* Fill in with reasonable starting values.  */
       init_execution_control_state (async_ecs);
@@ -1241,10 +1244,10 @@ fetch_inferior_event ()
       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. */
+         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 ();
     }
@@ -1305,362 +1308,362 @@ handle_inferior_event (ecs)
 
   /* Keep this extra brace for now, minimizes diffs.  */
   {
-      switch (ecs->infwait_state)
-       {
-       case infwait_normal_state:
-         /* Since we've done a wait, we have a new event.  Don't
-            carry over any expectations about needing to step over a
-            breakpoint. */
-         thread_step_needed = 0;
-
-         /* 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 (inferior_pid);
-             ecs->enable_hw_watchpoints_after_wait = 0;
-           }
-         stepped_after_stopped_by_watchpoint = 0;
-         break;
+    switch (ecs->infwait_state)
+      {
+      case infwait_normal_state:
+       /* Since we've done a wait, we have a new event.  Don't
+          carry over any expectations about needing to step over a
+          breakpoint. */
+       thread_step_needed = 0;
+
+       /* 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 (inferior_pid);
+           ecs->enable_hw_watchpoints_after_wait = 0;
+         }
+       stepped_after_stopped_by_watchpoint = 0;
+       break;
 
-       case infwait_thread_hop_state:
-         insert_breakpoints ();
+      case infwait_thread_hop_state:
+       insert_breakpoints ();
 
-         /* We need to restart all the threads now,
-          * unles we're running in scheduler-locked mode. 
-          * FIXME: shouldn't we look at currently_stepping ()?
-          */
-         if (scheduler_mode == schedlock_on)
-           target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
-         else
-           target_resume (-1, 0, TARGET_SIGNAL_0);
-         ecs->infwait_state = infwait_normal_state;
-         goto wfi_continue;
+       /* We need to restart all the threads now,
+        * unles we're running in scheduler-locked mode. 
+        * FIXME: shouldn't we look at currently_stepping ()?
+        */
+       if (scheduler_mode == schedlock_on)
+         target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
+       else
+         target_resume (-1, 0, TARGET_SIGNAL_0);
+       ecs->infwait_state = infwait_normal_state;
+       goto wfi_continue;
 
-       case infwait_nullified_state:
-         break;
+      case infwait_nullified_state:
+       break;
 
-       case infwait_nonstep_watch_state:
-         insert_breakpoints ();
+      case infwait_nonstep_watch_state:
+       insert_breakpoints ();
 
-         /* 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;
+       /* 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;
 
-      flush_cached_frames ();
+    flush_cached_frames ();
 
-      /* If it's a new process, add it to the thread database */
+    /* If it's a new process, add it to the thread database */
 
-      ecs->new_thread_event = ((ecs->pid != inferior_pid) && !in_thread_list (ecs->pid));
+    ecs->new_thread_event = ((ecs->pid != inferior_pid) && !in_thread_list (ecs->pid));
 
-      if (ecs->ws.kind != TARGET_WAITKIND_EXITED
-         && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
-         && ecs->new_thread_event)
-       {
-         add_thread (ecs->pid);
+    if (ecs->ws.kind != TARGET_WAITKIND_EXITED
+       && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
+       && ecs->new_thread_event)
+      {
+       add_thread (ecs->pid);
 
-         printf_filtered ("[New %s]\n", target_pid_or_tid_to_str (ecs->pid));
+       printf_filtered ("[New %s]\n", target_pid_or_tid_to_str (ecs->pid));
 
 #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 (-1, 0, TARGET_SIGNAL_0);
-         goto wfi_continue;
+       /* 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 (-1, 0, TARGET_SIGNAL_0);
+       goto wfi_continue;
 #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 ();
+       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.  */
-             if (auto_solib_add)
-               {
-                 /* Switch terminal for any messages produced by
-                    breakpoint_re_set.  */
-                 target_terminal_ours_for_output ();
-                 SOLIB_ADD (NULL, 0, NULL);
-                 target_terminal_inferior ();
-               }
+           /* Check for any newly added shared libraries if we're
+              supposed to be adding them automatically.  */
+           if (auto_solib_add)
+             {
+               /* Switch terminal for any messages produced by
+                  breakpoint_re_set.  */
+               target_terminal_ours_for_output ();
+               SOLIB_ADD (NULL, 0, NULL);
+               target_terminal_inferior ();
+             }
 
-             /* Reinsert breakpoints and continue.  */
-             if (breakpoints_inserted)
-               insert_breakpoints ();
-           }
+           /* Reinsert breakpoints and continue.  */
+           if (breakpoints_inserted)
+             insert_breakpoints ();
+         }
 #endif
-         resume (0, TARGET_SIGNAL_0);
-         goto wfi_continue;
-
-       case TARGET_WAITKIND_SPURIOUS:
-         resume (0, TARGET_SIGNAL_0);
-         goto wfi_continue;
-
-       case TARGET_WAITKIND_EXITED:
-         target_terminal_ours ();      /* Must do this before mourn anyway */
-         annotate_exited (ecs->ws.value.integer);
-         if (ecs->ws.value.integer)
-           printf_filtered ("\nProgram exited with code 0%o.\n",
-                            (unsigned int) ecs->ws.value.integer);
-         else
-           printf_filtered ("\nProgram exited normally.\n");
-
-         /* 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;
-         goto stop_stepping;
-
-       case TARGET_WAITKIND_SIGNALLED:
-         stop_print_frame = 0;
-         stop_signal = ecs->ws.value.sig;
-         target_terminal_ours ();      /* Must do this before mourn anyway */
-         annotate_signalled ();
-
-         /* This looks pretty bogus to me.  Doesn't TARGET_WAITKIND_SIGNALLED
-            mean it is already dead?  This has been here since GDB 2.8, so
-            perhaps it means rms didn't understand unix waitstatuses?
-            For the moment I'm just kludging around this in remote.c
-            rather than trying to change it here --kingdon, 5 Dec 1994.  */
-         target_kill ();       /* kill mourns as well */
-
-         printf_filtered ("\nProgram terminated with signal ");
-         annotate_signal_name ();
-         printf_filtered ("%s", target_signal_to_name (stop_signal));
-         annotate_signal_name_end ();
-         printf_filtered (", ");
-         annotate_signal_string ();
-         printf_filtered ("%s", target_signal_to_string (stop_signal));
-         annotate_signal_string_end ();
-         printf_filtered (".\n");
-
-         printf_filtered ("The program no longer exists.\n");
-         gdb_flush (gdb_stdout);
-         singlestep_breakpoints_inserted_p = 0;        /*SOFTWARE_SINGLE_STEP_P*/
-         goto stop_stepping;
-
-         /* 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 (inferior_pid == ecs->pid)
-           {
-             pending_follow.fork_event.saw_parent_fork = 1;
-             pending_follow.fork_event.parent_pid = ecs->pid;
-             pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
-             goto wfi_continue;
-           }
-         else
-           {
-             pending_follow.fork_event.saw_child_fork = 1;
-             pending_follow.fork_event.child_pid = ecs->pid;
-             pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
-           }
+       resume (0, TARGET_SIGNAL_0);
+       goto wfi_continue;
+
+      case TARGET_WAITKIND_SPURIOUS:
+       resume (0, TARGET_SIGNAL_0);
+       goto wfi_continue;
+
+      case TARGET_WAITKIND_EXITED:
+       target_terminal_ours ();        /* Must do this before mourn anyway */
+       annotate_exited (ecs->ws.value.integer);
+       if (ecs->ws.value.integer)
+         printf_filtered ("\nProgram exited with code 0%o.\n",
+                          (unsigned int) ecs->ws.value.integer);
+       else
+         printf_filtered ("\nProgram exited normally.\n");
+
+       /* 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;
+       goto stop_stepping;
+
+      case TARGET_WAITKIND_SIGNALLED:
+       stop_print_frame = 0;
+       stop_signal = ecs->ws.value.sig;
+       target_terminal_ours ();        /* Must do this before mourn anyway */
+       annotate_signalled ();
+
+       /* This looks pretty bogus to me.  Doesn't TARGET_WAITKIND_SIGNALLED
+          mean it is already dead?  This has been here since GDB 2.8, so
+          perhaps it means rms didn't understand unix waitstatuses?
+          For the moment I'm just kludging around this in remote.c
+          rather than trying to change it here --kingdon, 5 Dec 1994.  */
+       target_kill ();         /* kill mourns as well */
+
+       printf_filtered ("\nProgram terminated with signal ");
+       annotate_signal_name ();
+       printf_filtered ("%s", target_signal_to_name (stop_signal));
+       annotate_signal_name_end ();
+       printf_filtered (", ");
+       annotate_signal_string ();
+       printf_filtered ("%s", target_signal_to_string (stop_signal));
+       annotate_signal_string_end ();
+       printf_filtered (".\n");
+
+       printf_filtered ("The program no longer exists.\n");
+       gdb_flush (gdb_stdout);
+       singlestep_breakpoints_inserted_p = 0;  /*SOFTWARE_SINGLE_STEP_P */
+       goto stop_stepping;
+
+       /* 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 (inferior_pid == ecs->pid)
+         {
+           pending_follow.fork_event.saw_parent_fork = 1;
+           pending_follow.fork_event.parent_pid = ecs->pid;
+           pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
+           goto wfi_continue;
+         }
+       else
+         {
+           pending_follow.fork_event.saw_child_fork = 1;
+           pending_follow.fork_event.child_pid = ecs->pid;
+           pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
+         }
 
-         stop_pc = read_pc_pid (ecs->pid);
-         ecs->saved_inferior_pid = inferior_pid;
-         inferior_pid = ecs->pid;
-         stop_bpstat = bpstat_stop_status
-           (&stop_pc,
-            (DECR_PC_AFTER_BREAK ? 
-             (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
-              && currently_stepping (ecs))
-             : 0)
-           );
-         ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
-         inferior_pid = ecs->saved_inferior_pid;
-         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 (ecs->pid == inferior_pid)
-           {
-             pending_follow.fork_event.saw_parent_fork = 1;
-             pending_follow.fork_event.parent_pid = ecs->pid;
-             pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
-           }
+       stop_pc = read_pc_pid (ecs->pid);
+       ecs->saved_inferior_pid = inferior_pid;
+       inferior_pid = ecs->pid;
+       stop_bpstat = bpstat_stop_status
+         (&stop_pc,
+          (DECR_PC_AFTER_BREAK ?
+           (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+            && currently_stepping (ecs))
+           : 0)
+         );
+       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
+       inferior_pid = ecs->saved_inferior_pid;
+       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 (ecs->pid == inferior_pid)
+         {
+           pending_follow.fork_event.saw_parent_fork = 1;
+           pending_follow.fork_event.parent_pid = ecs->pid;
+           pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
+         }
 
-         /* 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 = ecs->pid;
-             pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
-             target_post_startup_inferior (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->pid, 0, TARGET_SIGNAL_0);
-                 goto wfi_continue;
-               }
-           }
+       /* 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 = ecs->pid;
+           pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
+           target_post_startup_inferior (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->pid, 0, TARGET_SIGNAL_0);
+               goto wfi_continue;
+             }
+         }
 
-         stop_pc = read_pc ();
-         stop_bpstat = bpstat_stop_status
-           (&stop_pc,
-            (DECR_PC_AFTER_BREAK ? 
-             (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
-              && currently_stepping (ecs))
-             : 0)
-            );
-         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->pid, 0, TARGET_SIGNAL_0);
-             goto wfi_continue;
-           }
-         inferior_ignoring_leading_exec_events =
-           target_reported_exec_events_per_exec_call () - 1;
+       stop_pc = read_pc ();
+       stop_bpstat = bpstat_stop_status
+         (&stop_pc,
+          (DECR_PC_AFTER_BREAK ?
+           (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+            && currently_stepping (ecs))
+           : 0)
+         );
+       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->pid, 0, TARGET_SIGNAL_0);
+           goto wfi_continue;
+         }
+       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));
+       pending_follow.execd_pathname = savestring (ecs->ws.value.execd_pathname,
+                                    strlen (ecs->ws.value.execd_pathname));
 
-         /* Did inferior_pid exec, or did a (possibly not-yet-followed)
-             child of a vfork exec?
+       /* Did inferior_pid 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.
+          ??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".
+          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->pid, 1, TARGET_SIGNAL_0);
-             /* We expect the parent vfork event to be available now. */
-             goto wfi_continue;
-           }
+          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->pid, 1, TARGET_SIGNAL_0);
+           /* We expect the parent vfork event to be available now. */
+           goto wfi_continue;
+         }
 
-         /* This causes the eventpoints and symbol table to be reset.  Must
-             do this now, before trying to determine whether to stop. */
-         follow_exec (inferior_pid, pending_follow.execd_pathname);
-         free (pending_follow.execd_pathname);
-
-         stop_pc = read_pc_pid (ecs->pid);
-         ecs->saved_inferior_pid = inferior_pid;
-         inferior_pid = ecs->pid;
-         stop_bpstat = bpstat_stop_status
-           (&stop_pc,
-            (DECR_PC_AFTER_BREAK ? 
-             (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
-              && currently_stepping (ecs))
-             : 0)
-            );
-         ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
-         inferior_pid = ecs->saved_inferior_pid;
-         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 (inferior_pid);
-           }
-         resume (0, TARGET_SIGNAL_0);
-         goto wfi_continue;
+       /* This causes the eventpoints and symbol table to be reset.  Must
+          do this now, before trying to determine whether to stop. */
+       follow_exec (inferior_pid, pending_follow.execd_pathname);
+       free (pending_follow.execd_pathname);
+
+       stop_pc = read_pc_pid (ecs->pid);
+       ecs->saved_inferior_pid = inferior_pid;
+       inferior_pid = ecs->pid;
+       stop_bpstat = bpstat_stop_status
+         (&stop_pc,
+          (DECR_PC_AFTER_BREAK ?
+           (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+            && currently_stepping (ecs))
+           : 0)
+         );
+       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
+       inferior_pid = ecs->saved_inferior_pid;
+       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 (inferior_pid);
+         }
+       resume (0, TARGET_SIGNAL_0);
+       goto wfi_continue;
 
-         /* Before examining the threads further, step this thread to
+       /* 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
@@ -1674,122 +1677,122 @@ handle_inferior_event (ecs)
           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->pid, 1, TARGET_SIGNAL_0);
+      case TARGET_WAITKIND_SYSCALL_RETURN:
+       target_resume (ecs->pid, 1, TARGET_SIGNAL_0);
 
-         if (number_of_threads_in_syscalls > 0)
-           {
-             number_of_threads_in_syscalls--;
-             ecs->enable_hw_watchpoints_after_wait =
-               (number_of_threads_in_syscalls == 0);
-           }
-         goto wfi_continue;
+       if (number_of_threads_in_syscalls > 0)
+         {
+           number_of_threads_in_syscalls--;
+           ecs->enable_hw_watchpoints_after_wait =
+             (number_of_threads_in_syscalls == 0);
+         }
+       goto wfi_continue;
 
-       case TARGET_WAITKIND_STOPPED:
-         stop_signal = ecs->ws.value.sig;
-         break;
-       }
+      case TARGET_WAITKIND_STOPPED:
+       stop_signal = ecs->ws.value.sig;
+       break;
+      }
 
-      /* 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.  */
+    /* 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.  */
-      if (ecs->new_thread_event)
-       {
-         target_resume (-1, 0, TARGET_SIGNAL_0);
-         goto wfi_continue;
-       }
+    /* 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 (-1, 0, TARGET_SIGNAL_0);
+       goto wfi_continue;
+      }
 
-      stop_pc = read_pc_pid (ecs->pid);
+    stop_pc = read_pc_pid (ecs->pid);
 
-      /* 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.  */
+    /* 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)
-       {
-         if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
+    if (stop_signal == TARGET_SIGNAL_TRAP)
+      {
+       if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
+         ecs->random_signal = 0;
+       else 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->pid))
-               {
-                 int remove_status;
-
-                 /* Saw a breakpoint, but it was hit by the wrong thread.
-                      Just continue. */
-                 write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->pid);
-
-                 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)
-                   {
-                     write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, ecs->pid);
-                   }
-                 else
-                   {           /* Single step */
-                     target_resume (ecs->pid, 1, TARGET_SIGNAL_0);
-                     /* FIXME: What if a signal arrives instead of the
-                          single-step happening?  */
-
-                     ecs->waiton_pid = ecs->pid;
-                     ecs->wp = &(ecs->ws);
-                     ecs->infwait_state = infwait_thread_hop_state;
-                     goto wfi_continue;
-                   }
-
-                   /* We need to restart all the threads now,
-                    * unles we're running in scheduler-locked mode. 
-                    * FIXME: shouldn't we look at currently_stepping ()?
-                    */
-                   if (scheduler_mode == schedlock_on)
-                     target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
-                   else
-                     target_resume (-1, 0, TARGET_SIGNAL_0);
+           if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
+                                         ecs->pid))
+             {
+               int remove_status;
+
+               /* Saw a breakpoint, but it was hit by the wrong thread.
+                  Just continue. */
+               write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->pid);
+
+               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)
+                 {
+                   write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, ecs->pid);
+                 }
+               else
+                 {             /* Single step */
+                   target_resume (ecs->pid, 1, TARGET_SIGNAL_0);
+                   /* FIXME: What if a signal arrives instead of the
+                      single-step happening?  */
+
+                   ecs->waiton_pid = ecs->pid;
+                   ecs->wp = &(ecs->ws);
+                   ecs->infwait_state = infwait_thread_hop_state;
                    goto wfi_continue;
-               }
-             else
-               {
-                 /* This breakpoint matches--either it is the right
-                      thread or it's a generic breakpoint for all threads.
-                      Remember that we'll need to step just _this_ thread
-                      on any following user continuation! */
-                 thread_step_needed = 1;
-               }
-           }
-       }
-      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 ((ecs->pid != inferior_pid) &&
-         (pending_follow.kind == TARGET_WAITKIND_SPURIOUS))
-       {
-         int printed = 0;
+               /* We need to restart all the threads now,
+                * unles we're running in scheduler-locked mode. 
+                * FIXME: shouldn't we look at currently_stepping ()?
+                */
+               if (scheduler_mode == schedlock_on)
+                 target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
+               else
+                 target_resume (-1, 0, TARGET_SIGNAL_0);
+               goto wfi_continue;
+             }
+           else
+             {
+               /* This breakpoint matches--either it is the right
+                  thread or it's a generic breakpoint for all threads.
+                  Remember that we'll need to step just _this_ thread
+                  on any following user continuation! */
+               thread_step_needed = 1;
+             }
+         }
+      }
+    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 ((ecs->pid != inferior_pid) &&
+       (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])
-           {
+       /* 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
@@ -1801,1185 +1804,1185 @@ handle_inferior_event (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 (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;
+       /* If it's not SIGTRAP and not a signal we want to stop for, then
+          continue the thread. */
 
-             target_resume (ecs->pid, 0, stop_signal);
-             goto wfi_continue;
-           }
+       if (stop_signal != TARGET_SIGNAL_TRAP
+           && !signal_stop[stop_signal])
+         {
+           if (printed)
+             target_terminal_inferior ();
 
-         /* It's a SIGTRAP or a signal we're interested in.  Switch threads,
-            and fall into the rest of wait_for_inferior().  */
-
-         /* Save infrun state for the old thread.  */
-         save_infrun_state (inferior_pid, 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, ecs->handling_longjmp,
-                            ecs->another_trap,
-                            ecs->stepping_through_solib_after_catch,
-                            ecs->stepping_through_solib_catchpoints,
-                            ecs->stepping_through_sigtramp);
-
-         if (may_switch_from_inferior_pid)
-           switched_from_inferior_pid = inferior_pid;
-
-         inferior_pid = ecs->pid;
-
-         /* Load infrun state for the new thread.  */
-         load_infrun_state (inferior_pid, &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, &ecs->handling_longjmp,
-                            &ecs->another_trap,
-                            &ecs->stepping_through_solib_after_catch,
-                            &ecs->stepping_through_solib_catchpoints,
-                            &ecs->stepping_through_sigtramp);
-
-         if (context_hook)
-           context_hook (pid_to_thread_id (ecs->pid));
-
-         printf_filtered ("[Switching to %s]\n", target_pid_to_str (ecs->pid));
-         flush_cached_frames ();
-       }
+           /* Clear the signal if it should not be passed.  */
+           if (signal_program[stop_signal] == 0)
+             stop_signal = TARGET_SIGNAL_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;
-       }
+           target_resume (ecs->pid, 0, stop_signal);
+           goto wfi_continue;
+         }
 
-      /* 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. */
+       /* It's a SIGTRAP or a signal we're interested in.  Switch threads,
+          and fall into the rest of wait_for_inferior().  */
+
+       /* Save infrun state for the old thread.  */
+       save_infrun_state (inferior_pid, 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, ecs->handling_longjmp,
+                          ecs->another_trap,
+                          ecs->stepping_through_solib_after_catch,
+                          ecs->stepping_through_solib_catchpoints,
+                          ecs->stepping_through_sigtramp);
+
+       if (may_switch_from_inferior_pid)
+         switched_from_inferior_pid = inferior_pid;
+
+       inferior_pid = ecs->pid;
+
+       /* Load infrun state for the new thread.  */
+       load_infrun_state (inferior_pid, &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, &ecs->handling_longjmp,
+                          &ecs->another_trap,
+                          &ecs->stepping_through_solib_after_catch,
+                          &ecs->stepping_through_solib_catchpoints,
+                          &ecs->stepping_through_sigtramp);
+
+       if (context_hook)
+         context_hook (pid_to_thread_id (ecs->pid));
+
+       printf_filtered ("[Switching to %s]\n", target_pid_to_str (ecs->pid));
+       flush_cached_frames ();
+      }
 
-      /*      if (INSTRUCTION_NULLIFIED && currently_stepping (ecs)) */
-      if (INSTRUCTION_NULLIFIED)
-       {
-         registers_changed ();
-         target_resume (ecs->pid, 1, TARGET_SIGNAL_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;
+      }
 
-         /* We may have received a signal that we want to pass to
-            the inferior; therefore, we must not clobber the waitstatus
-            in WS. */
+    /* 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. */
 
-         ecs->infwait_state = infwait_nullified_state;
-         ecs->waiton_pid = ecs->pid;
-         ecs->wp = &(ecs->tmpstatus);
-         goto wfi_continue;
-       }
+    /*      if (INSTRUCTION_NULLIFIED && currently_stepping (ecs)) */
+    if (INSTRUCTION_NULLIFIED)
+      {
+       registers_changed ();
+       target_resume (ecs->pid, 1, TARGET_SIGNAL_0);
 
-      /* 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);
-         goto wfi_continue;
-       }
+       /* We may have received a signal that we want to pass to
+          the inferior; therefore, we must not clobber the waitstatus
+          in WS. */
 
-      /* 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.  */
-
-         write_pc (stop_pc - DECR_PC_AFTER_BREAK);
+       ecs->infwait_state = infwait_nullified_state;
+       ecs->waiton_pid = ecs->pid;
+       ecs->wp = &(ecs->tmpstatus);
+       goto wfi_continue;
+      }
 
-         remove_breakpoints ();
-         registers_changed ();
-         target_resume (ecs->pid, 1, TARGET_SIGNAL_0);  /* Single step */
+    /* 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);
+       goto wfi_continue;
+      }
 
-         ecs->waiton_pid = ecs->pid;
-         ecs->wp = &(ecs->ws);
-         ecs->infwait_state = infwait_nonstep_watch_state;
-         goto wfi_continue;
-       }
+    /* 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.  */
+
+       write_pc (stop_pc - DECR_PC_AFTER_BREAK);
+
+       remove_breakpoints ();
+       registers_changed ();
+       target_resume (ecs->pid, 1, TARGET_SIGNAL_0);   /* Single step */
+
+       ecs->waiton_pid = ecs->pid;
+       ecs->wp = &(ecs->ws);
+       ecs->infwait_state = infwait_nonstep_watch_state;
+       goto wfi_continue;
+      }
 
-      /* 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;
-             goto wfi_break;
-           }
-         if (stop_soon_quietly)
+    /* 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;
            goto wfi_break;
+         }
+       if (stop_soon_quietly)
+         goto wfi_break;
 
-         /* Don't even think about breakpoints
-            if just proceeded over a 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
-           {
-             /* See if there is a breakpoint at the current PC.  */
-             stop_bpstat = bpstat_stop_status
-               (&stop_pc,
-                (DECR_PC_AFTER_BREAK ?
-             /* Notice the case of stepping through a jump
-                   that lands just after a breakpoint.
-                   Don't confuse that with hitting the breakpoint.
-                   What we check for is that 1) stepping is going on
-                   and 2) the pc before the last insn does not match
-                   the address of the breakpoint before the current pc
-                   and 3) 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)))) :
-                 0)
-               );
-             /* Following in case break condition called a
-                function.  */
-             stop_print_frame = 1;
-           }
+          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.  */
+           stop_bpstat = bpstat_stop_status
+             (&stop_pc,
+              (DECR_PC_AFTER_BREAK ?
+           /* Notice the case of stepping through a jump
+              that lands just after a breakpoint.
+              Don't confuse that with hitting the breakpoint.
+              What we check for is that 1) stepping is going on
+              and 2) the pc before the last insn does not match
+              the address of the breakpoint before the current pc
+              and 3) 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)))) :
+               0)
+             );
+           /* Following in case break condition called a
+              function.  */
+           stop_print_frame = 1;
+         }
 
-         if (stop_signal == TARGET_SIGNAL_TRAP)
+       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)
-                 || trap_expected
+           /* 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 ())))
-                 || (step_range_end && step_resume_breakpoint == NULL));
+             );
+           if (!ecs->random_signal)
+             stop_signal = TARGET_SIGNAL_TRAP;
+         }
+      }
 
-         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;
+           goto keep_going;
+         }
+      }
+    else if (ecs->ws.kind == TARGET_WAITKIND_VFORKED)
+      {
+       if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */
+         {
+           stop_signal = TARGET_SIGNAL_0;
+           goto keep_going;
+         }
+      }
+    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;
+           goto keep_going;
+         }
+      }
 
-      /* When we reach this point, we've pretty much decided
-         that the reason for stopping must've been a random
-         (unexpected) signal. */
+    /* For the program's own signals, act according to
+       the signal handling tables.  */
 
-      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)
+      {
+       /* 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 ();
+           annotate_signal ();
+           printf_filtered ("\nProgram received signal ");
+           annotate_signal_name ();
+           printf_filtered ("%s", target_signal_to_name (stop_signal));
+           annotate_signal_name_end ();
+           printf_filtered (", ");
+           annotate_signal_string ();
+           printf_filtered ("%s", target_signal_to_string (stop_signal));
+           annotate_signal_string_end ();
+           printf_filtered (".\n");
+           gdb_flush (gdb_stdout);
+         }
+       if (signal_stop[stop_signal])
+         goto wfi_break;
+       /* 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;
+
+       /* If we're in the middle of a "next" command, let the code for
+          stepping over a function handle this. pai/1997-09-10
+
+          A previous comment here suggested it was possible to change
+          this to jump to keep_going in all cases. */
+
+       if (step_over_calls > 0)
+         goto step_over_function;
+       else
+         goto check_sigtramp2;
+      }
+
+    /* 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)
        {
-         if (ecs->random_signal)       /* I.e., no catchpoint triggered for this. */
-           {
-             trap_expected = 1;
-             stop_signal = TARGET_SIGNAL_0;
-             goto keep_going;
-           }
+         stop_stack_dummy = 1;
+#ifdef HP_OS_BUG
+         trap_expected_after_continue = 1;
+#endif
        }
-      else if (ecs->ws.kind == TARGET_WAITKIND_VFORKED)
+
+      switch (what.main_action)
        {
-         if (ecs->random_signal)       /* I.e., no catchpoint triggered for this. */
+       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 (&jmp_buf_pc))
+           goto keep_going;
+
+         /* Need to blow away step-resume breakpoint, as it
+            interferes with us */
+         if (step_resume_breakpoint != NULL)
            {
-             stop_signal = TARGET_SIGNAL_0;
-             goto keep_going;
+             delete_breakpoint (step_resume_breakpoint);
+             step_resume_breakpoint = NULL;
            }
-       }
-      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. */
+         /* Not sure whether we need to blow this away too, but probably
+            it is like the step-resume breakpoint.  */
+         if (through_sigtramp_breakpoint != NULL)
            {
-             trap_expected = 1;
-             stop_signal = TARGET_SIGNAL_0;
-             goto keep_going;
+             delete_breakpoint (through_sigtramp_breakpoint);
+             through_sigtramp_breakpoint = NULL;
            }
-       }
-
-      /* 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;
+#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 */
+         goto keep_going;
 
-         stopped_by_random_signal = 1;
+       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)))
+           {
+             ecs->another_trap = 1;
+             goto keep_going;
+           }
+#endif /* 0 */
+         disable_longjmp_breakpoint ();
+         ecs->handling_longjmp = 0;    /* FIXME */
+         if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
+           break;
+         /* else fallthrough */
 
-         if (signal_print[stop_signal])
+       case BPSTAT_WHAT_SINGLE:
+         if (breakpoints_inserted)
            {
-             printed = 1;
-             target_terminal_ours_for_output ();
-             annotate_signal ();
-             printf_filtered ("\nProgram received signal ");
-             annotate_signal_name ();
-             printf_filtered ("%s", target_signal_to_name (stop_signal));
-             annotate_signal_name_end ();
-             printf_filtered (", ");
-             annotate_signal_string ();
-             printf_filtered ("%s", target_signal_to_string (stop_signal));
-             annotate_signal_string_end ();
-             printf_filtered (".\n");
-             gdb_flush (gdb_stdout);
+             thread_step_needed = 1;
+             remove_breakpoints ();
            }
-         if (signal_stop[stop_signal])
-           goto wfi_break;
-         /* If not going to stop, give terminal back
-            if we took it away.  */
-         else if (printed)
-           target_terminal_inferior ();
+         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;
 
-         /* Clear the signal if it should not be passed.  */
-         if (signal_program[stop_signal] == 0)
-           stop_signal = TARGET_SIGNAL_0;
+       case BPSTAT_WHAT_STOP_NOISY:
+         stop_print_frame = 1;
 
-         /* If we're in the middle of a "next" command, let the code for
-             stepping over a function handle this. pai/1997-09-10
+         /* 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.  */
 
-             A previous comment here suggested it was possible to change
-             this to jump to keep_going in all cases. */
+         goto stop_stepping;
 
-         if (step_over_calls > 0)
-           goto step_over_function;
-         else
-           goto check_sigtramp2;
-       }
+       case BPSTAT_WHAT_STOP_SILENT:
+         stop_print_frame = 0;
 
-      /* Handle cases caused by hitting a breakpoint.  */
-      {
-       CORE_ADDR jmp_buf_pc;
-       struct bpstat_what what;
+         /* 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.  */
 
-       what = bpstat_what (stop_bpstat);
+         goto stop_stepping;
 
-       if (what.call_dummy)
-         {
-           stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
-           trap_expected_after_continue = 1;
-#endif
-         }
+       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.  */
+         if (step_resume_breakpoint == NULL)
+           {
+             step_resume_breakpoint =
+               bpstat_find_step_resume_breakpoint (stop_bpstat);
+           }
+         delete_breakpoint (step_resume_breakpoint);
+         step_resume_breakpoint = NULL;
+         break;
+
+       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;
 
-       switch (what.main_action)
+       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 (&jmp_buf_pc))
-             goto keep_going;
 
-           /* Need to blow away step-resume breakpoint, as it
-              interferes with us */
-           if (step_resume_breakpoint != NULL)
+           /* Check for any newly added shared libraries if we're
+              supposed to be adding them automatically.  */
+           if (auto_solib_add)
              {
-               delete_breakpoint (step_resume_breakpoint);
-               step_resume_breakpoint = NULL;
+               /* Switch terminal for any messages produced by
+                  breakpoint_re_set.  */
+               target_terminal_ours_for_output ();
+               SOLIB_ADD (NULL, 0, NULL);
+               target_terminal_inferior ();
              }
-           /* Not sure whether we need to blow this away too, but probably
-              it is like the step-resume breakpoint.  */
-           if (through_sigtramp_breakpoint != NULL)
+
+           /* 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)
              {
-               delete_breakpoint (through_sigtramp_breakpoint);
-               through_sigtramp_breakpoint = NULL;
+               stop_print_frame = 0;
+               goto stop_stepping;
              }
 
-#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 */
-           goto keep_going;
-
-         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)))
+           /* 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;
-               goto keep_going;
+               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)
-             {
-               thread_step_needed = 1;
-               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.  */
 
-           goto stop_stepping;
+    /* 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 (ecs->pid, stop_pc))
+         {
+           ecs->another_trap = 1;
+           goto keep_going;
+         }
+#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;
+       goto stop_stepping;
+      }
 
-         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;
+           stop_stack_dummy = 1;
+#ifdef HP_OS_BUG
+           trap_expected_after_continue = 1;
+#endif
+           goto wfi_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.  */
+    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.  */
+      goto check_sigtramp2;
+
+    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.  */
+      goto check_sigtramp2;
+
+    /* 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.  */
+       goto check_sigtramp2;
+      }
 
-           goto stop_stepping;
+    /* We stepped out of the stepping range.  */
 
-         case BPSTAT_WHAT_STEP_RESUME:
-           /* This proably demands a more elegant solution, but, yeah
-               right...
+    /* 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 < 0 && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+      goto keep_going;
 
-               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.
+    /* 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;
 
-               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.  */
-           if (step_resume_breakpoint == NULL)
-             {
-               step_resume_breakpoint =
-                 bpstat_find_step_resume_breakpoint (stop_bpstat);
-             }
-           delete_breakpoint (step_resume_breakpoint);
-           step_resume_breakpoint = NULL;
-           break;
+    /* Did we just take a signal?  */
+    if (IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+       && !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.  */
 
-         case BPSTAT_WHAT_THROUGH_SIGTRAMP:
-           if (through_sigtramp_breakpoint)
-             delete_breakpoint (through_sigtramp_breakpoint);
-           through_sigtramp_breakpoint = NULL;
+       /* 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 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
-           {
-             /* 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;
+       {
+         CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
 
-             /* Check for any newly added shared libraries if we're
-                supposed to be adding them automatically.  */
-             if (auto_solib_add)
-               {
-                 /* Switch terminal for any messages produced by
-                    breakpoint_re_set.  */
-                 target_terminal_ours_for_output ();
-                 SOLIB_ADD (NULL, 0, NULL);
-                 target_terminal_inferior ();
-               }
+         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.  */
 
-             /* Try to reenable shared library breakpoints, additional
-                code segments in shared libraries might be mapped in now. */
-             re_enable_breakpoints_in_shlibs ();
+             /* 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 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_print_frame = 0;
-                 goto stop_stepping;
-               }
+             /* 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;
 
-             /* 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;
-               }
+             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.  */
+             step_resume_breakpoint =
+               set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+             if (breakpoints_inserted)
+               insert_breakpoints ();
            }
-#endif
-           break;
-
-         case BPSTAT_WHAT_LAST:
-           /* Not a real code, but listed here to shut up gcc -Wall.  */
-
-         case BPSTAT_WHAT_KEEP_CHECKING:
-           break;
-         }
-      }
-
-      /* 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.  */
-
-      /* 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 (ecs->pid, stop_pc))
+         else
            {
-             ecs->another_trap = 1;
-             goto keep_going;
+             /* We just stepped out of a signal handler and into
+                its calling trampoline.
+
+                Normally, we'd jump to 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;
            }
-#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;
-         goto stop_stepping;
        }
 
-      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
-             goto wfi_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.  */
-       goto check_sigtramp2;
-      
-      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.  */
-       goto check_sigtramp2;
-      
-      /* 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.  */
-         goto check_sigtramp2;
-       }
 
-      /* We stepped out of the stepping range.  */
+       /* 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;
 
-      /* 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 < 0 && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+       ecs->remove_breakpoints_on_following_step = 1;
        goto keep_going;
+      }
 
-      /* 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 (IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
-         && !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.  */
-
-         /* 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 == 0)
          {
-           CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+           /* I presume that step_over_calls is only 0 when we're
+              supposed to be stepping at the assembly language level
+              ("stepi").  Just stop.  */
+           stop_step = 1;
+           goto wfi_break;
+         }
 
-           if (INNER_THAN (current_frame, step_frame_address))
+       if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc))
+         /* We're doing a "next".  */
+         goto step_over_function;
+
+       /* 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);
                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 jump to 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 ();
+               goto keep_going;
              }
          }
 
+       /* 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;
+          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.  */
+       {
+         struct symtab_and_line tmp_sal;
 
-         ecs->remove_breakpoints_on_following_step = 1;
-         goto keep_going;
+         tmp_sal = find_pc_line (ecs->stop_func_start, 0);
+         if (tmp_sal.line != 0)
+           goto step_into_function;
        }
 
-      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)
+      step_over_function:
+       /* A subroutine call has happened.  */
        {
-         /* It's a subroutine call.  */
+         /* Set a special breakpoint after the return */
+         struct symtab_and_line sr_sal;
 
-         if (step_over_calls == 0)
+         INIT_SAL (&sr_sal);
+         sr_sal.symtab = NULL;
+         sr_sal.line = 0;
+
+         /* If we came here after encountering a signal in the middle of
+            a "next", use the stashed-away previous frame pc */
+         sr_sal.pc
+           = stopped_by_random_signal
+           ? prev_pc
+           : ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+
+         step_resume_breakpoint =
+           set_momentary_breakpoint (sr_sal,
+                                     stopped_by_random_signal ?
+                                     NULL : get_current_frame (),
+                                     bp_step_resume);
+
+         /* We've just entered a callee, and we wish to resume until
+            it returns to the caller.  Setting a step_resume bp on
+            the return PC will catch a return from the callee.
+
+            However, if the callee is recursing, we want to be
+            careful not to catch returns of those recursive calls,
+            but of THIS instance of the call.
+
+            To do this, we set the step_resume bp's frame to our
+            current caller's frame (step_frame_address, which is
+            set by the "next" or "until" command, before execution
+            begins).
+
+            But ... don't do it if we're single-stepping out of a
+            sigtramp, because the reason we're single-stepping is
+            precisely because unwinding is a problem (HP-UX 10.20,
+            e.g.) and the frame address is likely to be incorrect.
+            No danger of sigtramp recursion.  */
+
+         if (ecs->stepping_through_sigtramp)
            {
-             /* I presume that step_over_calls is only 0 when we're
-                supposed to be stepping at the assembly language level
-                ("stepi").  Just stop.  */
-             stop_step = 1;
-             goto wfi_break;
+             step_resume_breakpoint->frame = (CORE_ADDR) NULL;
+             ecs->stepping_through_sigtramp = 0;
            }
+         else if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
+           step_resume_breakpoint->frame = step_frame_address;
 
-         if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc))
-           /* We're doing a "next".  */
-           goto step_over_function;
-
-         /* 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);
-                 step_resume_breakpoint =
-                   set_momentary_breakpoint (xxx, NULL, bp_step_resume);
-                 insert_breakpoints ();
-                 goto keep_going;
-               }
-           }
+         if (breakpoints_inserted)
+           insert_breakpoints ();
+       }
+       goto keep_going;
 
-         /* If we have line number information for the function we
-            are thinking of stepping into, step into it.
+      step_into_function:
+       /* Subroutine call with source code we should not step over.
+          Do step to the first line of code in it.  */
+       {
+         struct symtab *s;
 
-            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.  */
-         {
-           struct symtab_and_line tmp_sal;
+         s = find_pc_symtab (stop_pc);
+         if (s && s->language != language_asm)
+           ecs->stop_func_start = SKIP_PROLOGUE (ecs->stop_func_start);
+       }
+       ecs->sal = find_pc_line (ecs->stop_func_start, 0);
+       /* Use the step_resume_break to step until
+          the end of the prologue, even if that involves jumps
+          (as it seems to on the vax under 4.2).  */
+       /* If the prologue ends in the middle of a source line,
+          continue to the end of that source line (if it is still
+          within the function).  Otherwise, just go to end of prologue.  */
+#ifdef PROLOGUE_FIRSTLINE_OVERLAP
+       /* no, don't either.  It skips any code that's
+          legitimately on the first line.  */
+#else
+       if (ecs->sal.end && ecs->sal.pc != ecs->stop_func_start && ecs->sal.end < ecs->stop_func_end)
+         ecs->stop_func_start = ecs->sal.end;
+#endif
 
-           tmp_sal = find_pc_line (ecs->stop_func_start, 0);
-           if (tmp_sal.line != 0)
-             goto step_into_function;
+       if (ecs->stop_func_start == stop_pc)
+         {
+           /* We are already there: stop now.  */
+           stop_step = 1;
+           goto wfi_break;
          }
-
-       step_over_function:
-         /* A subroutine call has happened.  */
+       else
+         /* Put the step-breakpoint there and go until there. */
          {
-           /* Set a special breakpoint after the return */
            struct symtab_and_line sr_sal;
 
-           INIT_SAL (&sr_sal);
-           sr_sal.symtab = NULL;
-           sr_sal.line = 0;
-
-           /* If we came here after encountering a signal in the middle of
-               a "next", use the stashed-away previous frame pc */
-           sr_sal.pc
-             = stopped_by_random_signal
-             ? prev_pc
-             : ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
-
+           INIT_SAL (&sr_sal); /* initialize to zeroes */
+           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.  */
            step_resume_breakpoint =
-             set_momentary_breakpoint (sr_sal,
-                                       stopped_by_random_signal ?
-                                       NULL : get_current_frame (),
-                                       bp_step_resume);
-
-           /* We've just entered a callee, and we wish to resume until
-               it returns to the caller.  Setting a step_resume bp on
-               the return PC will catch a return from the callee.
-
-               However, if the callee is recursing, we want to be
-               careful not to catch returns of those recursive calls,
-               but of THIS instance of the call.
-
-               To do this, we set the step_resume bp's frame to our
-               current caller's frame (step_frame_address, which is
-               set by the "next" or "until" command, before execution
-               begins).
-
-               But ... don't do it if we're single-stepping out of a
-               sigtramp, because the reason we're single-stepping is
-               precisely because unwinding is a problem (HP-UX 10.20,
-               e.g.) and the frame address is likely to be incorrect.
-               No danger of sigtramp recursion.  */
-
-           if (ecs->stepping_through_sigtramp)
-             {
-               step_resume_breakpoint->frame = (CORE_ADDR) NULL;
-               ecs->stepping_through_sigtramp = 0;
-             }
-           else if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
-             step_resume_breakpoint->frame = step_frame_address;
-
+             set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
            if (breakpoints_inserted)
              insert_breakpoints ();
-         }
-         goto keep_going;
-
-       step_into_function:
-         /* Subroutine call with source code we should not step over.
-            Do step to the first line of code in it.  */
-         {
-           struct symtab *s;
 
-           s = find_pc_symtab (stop_pc);
-           if (s && s->language != language_asm)
-             ecs->stop_func_start = SKIP_PROLOGUE (ecs->stop_func_start);
+           /* And make sure stepping stops right away then.  */
+           step_range_end = step_range_start;
          }
-         ecs->sal = find_pc_line (ecs->stop_func_start, 0);
-         /* Use the step_resume_break to step until
-            the end of the prologue, even if that involves jumps
-            (as it seems to on the vax under 4.2).  */
-         /* If the prologue ends in the middle of a source line,
-            continue to the end of that source line (if it is still
-            within the function).  Otherwise, just go to end of prologue.  */
-#ifdef PROLOGUE_FIRSTLINE_OVERLAP
-         /* no, don't either.  It skips any code that's
-            legitimately on the first line.  */
-#else
-         if (ecs->sal.end && ecs->sal.pc != ecs->stop_func_start && ecs->sal.end < ecs->stop_func_end)
-           ecs->stop_func_start = ecs->sal.end;
-#endif
-
-         if (ecs->stop_func_start == stop_pc)
-           {
-             /* We are already there: stop now.  */
-             stop_step = 1;
-             goto wfi_break;
-           }
-         else
-           /* 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 = 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.  */
-             step_resume_breakpoint =
-               set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
-             if (breakpoints_inserted)
-               insert_breakpoints ();
-
-             /* And make sure stepping stops right away then.  */
-             step_range_end = step_range_start;
-           }
-         goto keep_going;
-       }
-
-      /* We've wandered out of the step range.  */
-
-      ecs->sal = find_pc_line (stop_pc, 0);
-
-      if (step_range_end == 1)
-       {
-         /* It is stepi or nexti.  We always want to stop stepping after
-            one instruction.  */
-         stop_step = 1;
-         goto wfi_break;
-       }
-
-      /* 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;
+       goto keep_going;
+      }
 
-         /* Determine where this trampoline returns.  */
-         tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
+    /* We've wandered out of the step range.  */
 
-         /* 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;
+    ecs->sal = find_pc_line (stop_pc, 0);
 
-             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.  */
-             step_resume_breakpoint =
-               set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
-             if (breakpoints_inserted)
-               insert_breakpoints ();
+    if (step_range_end == 1)
+      {
+       /* It is stepi or nexti.  We always want to stop stepping after
+          one instruction.  */
+       stop_step = 1;
+       goto wfi_break;
+      }
 
-             /* Restart without fiddling with the step ranges or
-                other state.  */
-             goto keep_going;
-           }
-       }
+    /* 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 (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;
-         goto wfi_break;
-       }
+       /* Determine where this trampoline returns.  */
+       tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
 
-      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;
-         goto wfi_break;
-       }
+       /* 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;
 
-      /* We aren't done stepping.
+           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.  */
+           step_resume_breakpoint =
+             set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+           if (breakpoints_inserted)
+             insert_breakpoints ();
 
-        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.)  */
+           /* Restart without fiddling with the step ranges or
+              other state.  */
+           goto keep_going;
+         }
+      }
 
-      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;
-         goto wfi_break;
-       }
-      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->sal.line == 0)
       {
-       CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
-       if (!(INNER_THAN (current_frame, step_frame_address)))
-         step_frame_address = current_frame;
+       /* 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;
+       goto wfi_break;
       }
 
+    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;
+       goto wfi_break;
+      }
 
-      goto keep_going;
+    /* We aren't done stepping.
 
-    check_sigtramp2:
-      if (trap_expected
-         && IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
-         && !IN_SIGTRAMP (prev_pc, prev_func_name)
-         && 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.
-
-            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 testsuite/gdb.t06/signals.exp where
-            it says "exceedingly difficult").  */
-         struct symtab_and_line sr_sal;
+       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.)  */
 
-         INIT_SAL (&sr_sal);   /* initialize to zeroes */
-         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.  */
-         through_sigtramp_breakpoint =
-           set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp);
-         if (breakpoints_inserted)
-           insert_breakpoints ();
+    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;
+       goto wfi_break;
+      }
+    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 */
+    {
+      CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+      if (!(INNER_THAN (current_frame, step_frame_address)))
+       step_frame_address = current_frame;
+    }
 
-         ecs->remove_breakpoints_on_following_step = 1;
-         ecs->another_trap = 1;
-       }
 
-    keep_going:
-      /* Come to this label when you need to resume the inferior.
-        It's really much cleaner to do a goto than a maze of if-else
-        conditions.  */
-
-      /* ??rehrauer: ttrace on HP-UX theoretically allows one to debug
-         a vforked child beetween its creation and subsequent exit or
-         call to exec().  However, I had big problems in this rather
-         creaky exec engine, getting that to work.  The fundamental
-         problem is that I'm trying to debug two processes via an
-         engine that only understands a single process with possibly
-         multiple threads.
-
-         Hence, this spot is known to have problems when
-         target_can_follow_vfork_prior_to_exec returns 1. */
-
-      /* Save the pc before execution, to compare with pc after stop.  */
-      prev_pc = read_pc ();    /* Might have been DECR_AFTER_BREAK */
-      prev_func_start = ecs->stop_func_start;  /* Ok, since if DECR_PC_AFTER
-                                         BREAK is defined, the
-                                         original pc would not have
-                                         been at the start of a
-                                         function. */
-      prev_func_name = ecs->stop_func_name;
+    goto keep_going;
 
-      if (ecs->update_step_sp)
-       step_sp = read_sp ();
-      ecs->update_step_sp = 0;
+  check_sigtramp2:
+    if (trap_expected
+       && IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+       && !IN_SIGTRAMP (prev_pc, prev_func_name)
+       && 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.
+
+          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 testsuite/gdb.t06/signals.exp where
+          it says "exceedingly difficult").  */
+       struct symtab_and_line sr_sal;
+
+       INIT_SAL (&sr_sal);     /* initialize to zeroes */
+       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.  */
+       through_sigtramp_breakpoint =
+         set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp);
+       if (breakpoints_inserted)
+         insert_breakpoints ();
 
-      /* If we did not do break;, it means we should keep
-        running the inferior and not return to debugger.  */
+       ecs->remove_breakpoints_on_following_step = 1;
+       ecs->another_trap = 1;
+      }
 
-      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.  */
-         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.
-
-            We're going to run this baby now!
-
-            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.  */
-         if (step_resume_breakpoint == NULL
-             && through_sigtramp_breakpoint == NULL
-             && ecs->remove_breakpoints_on_following_step)
-           {
-             ecs->remove_breakpoints_on_following_step = 0;
-             remove_breakpoints ();
-             breakpoints_inserted = 0;
-           }
-         else if (!breakpoints_inserted &&
-                  (through_sigtramp_breakpoint != NULL || !ecs->another_trap))
-           {
-             breakpoints_failed = insert_breakpoints ();
-             if (breakpoints_failed)
-               goto wfi_break;
-             breakpoints_inserted = 1;
-           }
+  keep_going:
+    /* Come to this label when you need to resume the inferior.
+       It's really much cleaner to do a goto than a maze of if-else
+       conditions.  */
+
+    /* ??rehrauer: ttrace on HP-UX theoretically allows one to debug
+       a vforked child beetween its creation and subsequent exit or
+       call to exec().  However, I had big problems in this rather
+       creaky exec engine, getting that to work.  The fundamental
+       problem is that I'm trying to debug two processes via an
+       engine that only understands a single process with possibly
+       multiple threads.
+
+       Hence, this spot is known to have problems when
+       target_can_follow_vfork_prior_to_exec returns 1. */
+
+    /* Save the pc before execution, to compare with pc after stop.  */
+    prev_pc = read_pc ();      /* Might have been DECR_AFTER_BREAK */
+    prev_func_start = ecs->stop_func_start;    /* Ok, since if DECR_PC_AFTER
+                                                  BREAK is defined, the
+                                                  original pc would not have
+                                                  been at the start of a
+                                                  function. */
+    prev_func_name = ecs->stop_func_name;
+
+    if (ecs->update_step_sp)
+      step_sp = read_sp ();
+    ecs->update_step_sp = 0;
+
+    /* If we did not do break;, it means we should keep
+       running the inferior and not return to debugger.  */
+
+    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.  */
+       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.
+
+          We're going to run this baby now!
+
+          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.  */
+       if (step_resume_breakpoint == NULL
+           && through_sigtramp_breakpoint == NULL
+           && ecs->remove_breakpoints_on_following_step)
+         {
+           ecs->remove_breakpoints_on_following_step = 0;
+           remove_breakpoints ();
+           breakpoints_inserted = 0;
+         }
+       else if (!breakpoints_inserted &&
+                (through_sigtramp_breakpoint != NULL || !ecs->another_trap))
+         {
+           breakpoints_failed = insert_breakpoints ();
+           if (breakpoints_failed)
+             goto wfi_break;
+           breakpoints_inserted = 1;
+         }
 
-         trap_expected = ecs->another_trap;
+       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).
+       /* 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. */
+          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;
+       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.  */
-         /* FIXME: Shouldn't this be based on the valid bit of the SXIP?
-            (this is only used on the 88k).  */
-
-         if (!bpstat_explains_signal (stop_bpstat)
-             && (stop_signal != TARGET_SIGNAL_CHLD)
-             && !stopped_by_random_signal)
-           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.  */
+       /* FIXME: Shouldn't this be based on the valid bit of the SXIP?
+          (this is only used on the 88k).  */
+
+       if (!bpstat_explains_signal (stop_bpstat)
+           && (stop_signal != TARGET_SIGNAL_CHLD)
+           && !stopped_by_random_signal)
+         SHIFT_INST_REGS ();
 #endif /* SHIFT_INST_REGS */
 
-         resume (currently_stepping (ecs), stop_signal);
-       }
+       resume (currently_stepping (ecs), stop_signal);
+      }
 
-      /* Former continues in the main loop goto here.  */
-    wfi_continue:
-      /* This used to be at the top of the loop.  */
-      if (ecs->infwait_state == infwait_normal_state)
-       {
-         overlay_cache_invalid = 1;
+    /* Former continues in the main loop goto here.  */
+  wfi_continue:
+    /* This used to be at the top of the loop.  */
+    if (ecs->infwait_state == infwait_normal_state)
+      {
+       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. */
+       /* 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. */
 
-         registers_changed ();
-         ecs->waiton_pid = -1;
-         ecs->wp = &(ecs->ws);
-       }
-      /* This is the old end of the while loop.  Let everybody know
-        we want to wait for the inferior some more and get called
-        again soon.  */
-      ecs->wait_some_more = 1;
-      return;
-    }
+       registers_changed ();
+       ecs->waiton_pid = -1;
+       ecs->wp = &(ecs->ws);
+      }
+    /* This is the old end of the while loop.  Let everybody know
+       we want to wait for the inferior some more and get called
+       again soon.  */
+    ecs->wait_some_more = 1;
+    return;
+  }
 
   /* Former breaks in the main loop goto here.  */
 wfi_break:
@@ -3011,8 +3014,8 @@ stop_stepping:
        }
 
       /* Assuming the inferior still exists, set these up for next
-        time, just like we did above if we didn't break out of the
-        loop.  */
+         time, just like we did above if we didn't break out of the
+         loop.  */
       prev_pc = read_pc ();
       prev_func_start = ecs->stop_func_start;
       prev_func_name = ecs->stop_func_name;
@@ -3107,7 +3110,7 @@ stopped_for_shlib_catchpoint (bs, cp_p)
 static void
 complete_execution ()
 {
-extern cleanup_sigint_signal_handler PARAMS ((void));
+  extern cleanup_sigint_signal_handler PARAMS ((void));
 
   if (sync_execution)
     {
@@ -3224,10 +3227,10 @@ The same program may be running in another process.\n");
       select_frame (get_current_frame (), 0);
 
       /* Print current location without a level number, if
-        we have changed functions or hit a breakpoint.
-        Print source line if we have one.
-        bpstat_print() contains the logic deciding in detail
-        what to print, based on the event(s) that just occurred. */
+         we have changed functions or hit a breakpoint.
+         Print source line if we have one.
+         bpstat_print() contains the logic deciding in detail
+         what to print, based on the event(s) that just occurred. */
 
       if (stop_print_frame)
        {
@@ -3236,10 +3239,10 @@ The same program may be running in another process.\n");
 
          bpstat_ret = bpstat_print (stop_bpstat);
          /* bpstat_print() returned one of:
-             -1: Didn't print anything
-              0: Printed preliminary "Breakpoint n, " message, desires
-                 location tacked on
-              1: Printed something, don't tack on location */
+            -1: Didn't print anything
+            0: Printed preliminary "Breakpoint n, " message, desires
+            location tacked on
+            1: Printed something, don't tack on location */
 
          if (bpstat_ret == -1)
            if (stop_step
@@ -3274,11 +3277,11 @@ The same program may be running in another process.\n");
     {
       /* Pop the empty frame that contains the stack dummy.
          POP_FRAME ends with a setting of the current frame, so we
-        can use that next. */
+         can use that next. */
       POP_FRAME;
       /* Set stop_pc to what it was before we called the function.
-        Can't rely on restore_inferior_status because that only gets
-        called if we don't stop in the called function.  */
+         Can't rely on restore_inferior_status because that only gets
+         called if we don't stop in the called function.  */
       stop_pc = read_pc ();
       select_frame (get_current_frame (), 0);
     }
@@ -3298,21 +3301,21 @@ hook_stop_stub (cmd)
   return (0);
 }
 \f
-int 
+int
 signal_stop_state (signo)
      int signo;
 {
   return signal_stop[signo];
 }
 
-int 
+int
 signal_print_state (signo)
      int signo;
 {
   return signal_print[signo];
 }
 
-int 
+int
 signal_pass_state (signo)
      int signo;
 {
@@ -3474,7 +3477,7 @@ handle_command (args, from_tty)
        }
 
       /* If any signal numbers or symbol names were found, set flags for
-        which signals to apply actions to. */
+         which signals to apply actions to. */
 
       for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
        {
@@ -3701,7 +3704,7 @@ write_inferior_status_register (inf_status, regno, val)
      int regno;
      LONGEST val;
 {
-  int size = REGISTER_RAW_SIZE(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);
@@ -3740,7 +3743,7 @@ save_inferior_status (restore_stack_info)
   inf_status->breakpoint_proceeded = breakpoint_proceeded;
   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);
 
   read_register_bytes (0, inf_status->registers, REGISTER_BYTES);
@@ -3774,11 +3777,11 @@ restore_selected_frame (args)
   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.
+     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.  */
+     mvs: this worries me.  */
       level != 0)
     {
       warning ("Unable to restore previously selected frame.\n");
@@ -3832,8 +3835,8 @@ restore_inferior_status (inf_status)
       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.  */
+         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)
@@ -3873,9 +3876,9 @@ set_follow_fork_mode_command (arg, from_tty, c)
     free (follow_fork_mode_string);
   follow_fork_mode_string = savestring (arg, strlen (arg));
 }
+\f
 
 
-\f
 static void build_infrun PARAMS ((void));
 static void
 build_infrun ()
@@ -4013,20 +4016,20 @@ to the user would be loading/unloading of a new library.\n",
    kernel problem.  It's also not terribly useful without a GUI to
    help the user drive two debuggers.  So for now, I'm disabling
    the "both" option.  */
-/*                     "Set debugger response to a program call of fork \
-or vfork.\n\
-A fork or vfork creates a new process.  follow-fork-mode can be:\n\
-  parent  - the original process is debugged after a fork\n\
-  child   - the new process is debugged after a fork\n\
-  both    - both the parent and child are debugged after a fork\n\
-  ask     - the debugger will ask for one of the above choices\n\
-For \"both\", another copy of the debugger will be started to follow\n\
-the new child process.  The original debugger will continue to follow\n\
-the original parent process.  To distinguish their prompts, the\n\
-debugger copy's prompt will be changed.\n\
-For \"parent\" or \"child\", the unfollowed process will run free.\n\
-By default, the debugger will follow the parent process.",
-*/
+/*                      "Set debugger response to a program call of fork \
+   or vfork.\n\
+   A fork or vfork creates a new process.  follow-fork-mode can be:\n\
+   parent  - the original process is debugged after a fork\n\
+   child   - the new process is debugged after a fork\n\
+   both    - both the parent and child are debugged after a fork\n\
+   ask     - the debugger will ask for one of the above choices\n\
+   For \"both\", another copy of the debugger will be started to follow\n\
+   the new child process.  The original debugger will continue to follow\n\
+   the original parent process.  To distinguish their prompts, the\n\
+   debugger copy's prompt will be changed.\n\
+   For \"parent\" or \"child\", the unfollowed process will run free.\n\
+   By default, the debugger will follow the parent process.",
+ */
                        "Set debugger response to a program call of fork \
 or vfork.\n\
 A fork or vfork creates a new process.  follow-fork-mode can be:\n\
@@ -4036,7 +4039,7 @@ A fork or vfork creates a new process.  follow-fork-mode can be:\n\
 For \"parent\" or \"child\", the unfollowed process will run free.\n\
 By default, the debugger will follow the parent process.",
                        &setlist);
-/*  c->function.sfunc = ;*/
+/*  c->function.sfunc = ; */
   add_show_from_set (c, &showlist);
 
   set_follow_fork_mode_command ("parent", 0, NULL);
index d615ff9cffa65826bd4258cb63613742987152d9..96fb3d92da1094c62f9c5a9eb83a8db6ebbe716c 100644 (file)
@@ -2,26 +2,27 @@
    Copyright 1990-1996, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-## Contains temporary hacks..
+   ## Contains temporary hacks..
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "frame.h"  /* required by inferior.h */
+#include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
 #include "gdbcore.h"
@@ -32,11 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <fcntl.h>
 
 #ifdef HAVE_WAIT_H
-# include <wait.h>
+#include <wait.h>
 #else
-# ifdef HAVE_SYS_WAIT_H
-#  include <sys/wait.h>
-# endif
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
 #endif
 
 /* "wait.h" fills in the gaps left by <wait.h> */
@@ -46,10 +47,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif
 
 extern struct symtab_and_line *
-child_enable_exception_callback PARAMS ((enum exception_event_kind, int));
+  child_enable_exception_callback PARAMS ((enum exception_event_kind, int));
 
 extern struct exception_event_record *
-child_get_current_exception_event PARAMS ((void));
+  child_get_current_exception_event PARAMS ((void));
 
 extern void _initialize_inftarg PARAMS ((void));
 
@@ -95,10 +96,10 @@ child_require_detach PARAMS ((int, char *, int));
 static void
 ptrace_me PARAMS ((void));
 
-static void 
+static void
 ptrace_him PARAMS ((int));
 
-static void 
+static void
 child_create_inferior PARAMS ((char *, char *, char **));
 
 static void
@@ -127,14 +128,14 @@ int child_suppress_run = 0;       /* Non-zero if inftarg should pretend not to
 
 #ifndef CHILD_WAIT
 
-/*##*/
+/*## */
 /* Enable HACK for ttrace work.  In
  * infttrace.c/require_notification_of_events,
  * this is set to 0 so that the loop in child_wait
  * won't loop.
  */
 int not_same_real_pid = 1;
-/*##*/
+/*## */
 
 
 /* Wait for child to do something.  Return pid of child, or -1 in case
@@ -148,101 +149,103 @@ child_wait (pid, ourstatus)
   int save_errno;
   int status;
   char *execd_pathname = NULL;
-  int  exit_status;
-  int  related_pid;
-  int  syscall_id;
-  enum target_waitkind  kind;
+  int exit_status;
+  int related_pid;
+  int syscall_id;
+  enum target_waitkind kind;
 
-  do {
-    set_sigint_trap(); /* Causes SIGINT to be passed on to the
-                          attached process. */
-    set_sigio_trap ();
+  do
+    {
+      set_sigint_trap ();      /* Causes SIGINT to be passed on to the
+                                  attached process. */
+      set_sigio_trap ();
 
-    pid = ptrace_wait (inferior_pid, &status);
+      pid = ptrace_wait (inferior_pid, &status);
 
-    save_errno = errno;
+      save_errno = errno;
 
-    clear_sigio_trap ();
+      clear_sigio_trap ();
 
-    clear_sigint_trap();
+      clear_sigint_trap ();
 
-    if (pid == -1)
-      {
-       if (save_errno == EINTR)
-         continue;
+      if (pid == -1)
+       {
+         if (save_errno == EINTR)
+           continue;
 
-       fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
-                safe_strerror (save_errno));
+         fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
+                             safe_strerror (save_errno));
 
-       /* Claim it exited with unknown signal.  */
-       ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
-       ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
-        return -1;
-      }
+         /* Claim it exited with unknown signal.  */
+         ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+         ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+         return -1;
+       }
 
-    /* Did it exit?
-     */
-    if (target_has_exited (pid, status, &exit_status))
-      {
-        /* ??rehrauer: For now, ignore this. */
-        continue;
-      }
-
-    if (!target_thread_alive (pid))
-      {
-        ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
-        return pid;
-      }
-      
-    if (target_has_forked (pid, &related_pid)
-        && ((pid == inferior_pid) || (related_pid == inferior_pid)))
-      {
-        ourstatus->kind = TARGET_WAITKIND_FORKED;
-        ourstatus->value.related_pid = related_pid;
-        return pid;
-      }
-
-    if (target_has_vforked (pid, &related_pid)
-        && ((pid == inferior_pid) || (related_pid == inferior_pid)))
-      {
-        ourstatus->kind = TARGET_WAITKIND_VFORKED;
-        ourstatus->value.related_pid = related_pid;
-        return pid;
-      }
-
-    if (target_has_execd (pid, &execd_pathname))
-      {
-        /* Are we ignoring initial exec events?  (This is likely because
-           we're in the process of starting up the inferior, and another
-           (older) mechanism handles those.)  If so, we'll report this
-           as a regular stop, not an exec.
-           */
-        if (inferior_ignoring_startup_exec_events)
-          {
-            inferior_ignoring_startup_exec_events--;
-          }
-        else
-          {
-            ourstatus->kind = TARGET_WAITKIND_EXECD;
-            ourstatus->value.execd_pathname = execd_pathname;
-            return pid;
-          }
-      }
-
-    /* All we must do with these is communicate their occurrence
-       to wait_for_inferior...
+      /* Did it exit?
        */
-    if (target_has_syscall_event (pid, &kind, &syscall_id))
-      {
-        ourstatus->kind = kind;
-        ourstatus->value.syscall_id = syscall_id;
-        return pid;
-      }
-
-/*##  } while (pid != inferior_pid); ##*/ /* Some other child died or stopped */
+      if (target_has_exited (pid, status, &exit_status))
+       {
+         /* ??rehrauer: For now, ignore this. */
+         continue;
+       }
+
+      if (!target_thread_alive (pid))
+       {
+         ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
+         return pid;
+       }
+
+      if (target_has_forked (pid, &related_pid)
+         && ((pid == inferior_pid) || (related_pid == inferior_pid)))
+       {
+         ourstatus->kind = TARGET_WAITKIND_FORKED;
+         ourstatus->value.related_pid = related_pid;
+         return pid;
+       }
+
+      if (target_has_vforked (pid, &related_pid)
+         && ((pid == inferior_pid) || (related_pid == inferior_pid)))
+       {
+         ourstatus->kind = TARGET_WAITKIND_VFORKED;
+         ourstatus->value.related_pid = related_pid;
+         return pid;
+       }
+
+      if (target_has_execd (pid, &execd_pathname))
+       {
+         /* Are we ignoring initial exec events?  (This is likely because
+            we're in the process of starting up the inferior, and another
+            (older) mechanism handles those.)  If so, we'll report this
+            as a regular stop, not an exec.
+          */
+         if (inferior_ignoring_startup_exec_events)
+           {
+             inferior_ignoring_startup_exec_events--;
+           }
+         else
+           {
+             ourstatus->kind = TARGET_WAITKIND_EXECD;
+             ourstatus->value.execd_pathname = execd_pathname;
+             return pid;
+           }
+       }
+
+      /* All we must do with these is communicate their occurrence
+         to wait_for_inferior...
+       */
+      if (target_has_syscall_event (pid, &kind, &syscall_id))
+       {
+         ourstatus->kind = kind;
+         ourstatus->value.syscall_id = syscall_id;
+         return pid;
+       }
+
+      /*##  } while (pid != inferior_pid); ## *//* Some other child died or stopped */
 /* hack for thread testing */
-      } while( (pid != inferior_pid) && not_same_real_pid );
-/*##*/
+    }
+  while ((pid != inferior_pid) && not_same_real_pid);
+/*## */
 
   store_waitstatus (ourstatus, status);
   return pid;
@@ -252,15 +255,15 @@ child_wait (pid, ourstatus)
 #if !defined(CHILD_POST_WAIT)
 void
 child_post_wait (pid, wait_status)
-  int  pid;
-  int  wait_status;
+     int pid;
+     int wait_status;
 {
   /* This version of Unix doesn't require a meaningful "post wait"
      operation.
-     */
+   */
 }
 #endif
+
 
 #ifndef CHILD_THREAD_ALIVE
 
@@ -280,9 +283,9 @@ child_thread_alive (pid)
 
 static void
 child_attach_to_process (args, from_tty, after_fork)
-  char *  args;
-  int  from_tty;
-  int  after_fork;
+     char *args;
+     int from_tty;
+     int after_fork;
 {
   if (!args)
     error_no_arg ("process-id to attach");
@@ -301,7 +304,7 @@ child_attach_to_process (args, from_tty, after_fork)
     if ((pid == 0) && (args == dummy))
       error ("Illegal process-id: %s\n", args);
 
-    if (pid == getpid())               /* Trying to masturbate? */
+    if (pid == getpid ())      /* Trying to masturbate? */
       error ("I refuse to debug myself!");
 
     if (from_tty)
@@ -309,13 +312,13 @@ child_attach_to_process (args, from_tty, after_fork)
        exec_file = (char *) get_exec_file (0);
 
        if (after_fork)
-         printf_unfiltered ("Attaching after fork to %s\n", 
-                 target_pid_to_str (pid));
+         printf_unfiltered ("Attaching after fork to %s\n",
+                            target_pid_to_str (pid));
        else if (exec_file)
          printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
-                  target_pid_to_str (pid));
-        else
-          printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid));
+                            target_pid_to_str (pid));
+       else
+         printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid));
 
        gdb_flush (gdb_stdout);
       }
@@ -328,7 +331,7 @@ child_attach_to_process (args, from_tty, after_fork)
     inferior_pid = pid;
     push_target (&child_ops);
   }
-#endif  /* ATTACH_DETACH */
+#endif /* ATTACH_DETACH */
 }
 
 
@@ -345,7 +348,7 @@ child_attach (args, from_tty)
 #if !defined(CHILD_POST_ATTACH)
 void
 child_post_attach (pid)
-  int  pid;
+     int pid;
 {
   /* This version of Unix doesn't require a meaningful "post attach"
      operation by a debugger.  */
@@ -358,14 +361,14 @@ child_require_attach (args, from_tty)
      int from_tty;
 {
   child_attach_to_process (args, from_tty, 1);
-} 
+}
 
 static void
 child_detach_from_process (pid, args, from_tty, after_fork)
-  int  pid;
-  char *  args;
-  int  from_tty;
-  int  after_fork;
+     int pid;
+     char *args;
+     int from_tty;
+     int after_fork;
 {
 #ifdef ATTACH_DETACH
   {
@@ -376,12 +379,12 @@ child_detach_from_process (pid, args, from_tty, after_fork)
        char *exec_file = get_exec_file (0);
        if (exec_file == 0)
          exec_file = "";
-        if (after_fork)
-          printf_unfiltered ("Detaching after fork from %s\n",
-                             target_pid_to_str (pid));
-        else
+       if (after_fork)
+         printf_unfiltered ("Detaching after fork from %s\n",
+                            target_pid_to_str (pid));
+       else
          printf_unfiltered ("Detaching from program: %s, %s\n", exec_file,
-                            target_pid_to_str (pid));
+                            target_pid_to_str (pid));
        gdb_flush (gdb_stdout);
       }
     if (args)
@@ -417,9 +420,9 @@ child_detach (args, from_tty)
 
 static void
 child_require_detach (pid, args, from_tty)
-  int  pid;
-  char *  args;
-  int  from_tty;
+     int pid;
+     char *args;
+     int from_tty;
 {
   child_detach_from_process (pid, args, from_tty, 1);
 }
@@ -446,7 +449,7 @@ child_files_info (ignore)
      struct target_ops *ignore;
 {
   printf_unfiltered ("\tUsing the running image of %s %s.\n",
-         attach_flag? "attached": "child", target_pid_to_str (inferior_pid));
+      attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
 }
 
 /* ARGSUSED */
@@ -471,7 +474,7 @@ ptrace_me ()
 /* Stub function which causes the GDB that runs it, to start ptrace-ing
    the child process.  */
 
-static void 
+static void
 ptrace_him (pid)
      int pid;
 {
@@ -481,7 +484,7 @@ ptrace_him (pid)
      between the parent and child processes after the debugger
      forks, and before the child execs the debuggee program.  This
      call basically gives permission for the child to exec.
-     */
+   */
 
   target_acknowledge_created_inferior (pid);
 
@@ -493,7 +496,7 @@ ptrace_him (pid)
 
   /* On some targets, there must be some explicit actions taken after
      the inferior has been started up.
-     */
+   */
   target_post_startup_inferior (pid);
 }
 
@@ -511,46 +514,46 @@ child_create_inferior (exec_file, allargs, env)
 #ifdef HPUXHPPA
   fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, pre_fork_inferior, NULL);
 #else
- fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL);
 fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL);
 #endif
   /* We are at the first instruction we care about.  */
   /* Pedal to the metal... */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
 }
 
 #if !defined(CHILD_POST_STARTUP_INFERIOR)
 void
 child_post_startup_inferior (pid)
-  int  pid;
+     int pid;
 {
   /* This version of Unix doesn't require a meaningful "post startup inferior"
      operation by a debugger.
-     */
+   */
 }
 #endif
 
 #if !defined(CHILD_ACKNOWLEDGE_CREATED_INFERIOR)
 void
 child_acknowledge_created_inferior (pid)
-  int  pid;
+     int pid;
 {
   /* This version of Unix doesn't require a meaningful "acknowledge created inferior"
      operation by a debugger.
-     */
+   */
 }
 #endif
 
 
 void
 child_clone_and_follow_inferior (child_pid, followed_child)
-  int  child_pid;
-  int  *followed_child;
+     int child_pid;
+     int *followed_child;
 {
   clone_and_follow_inferior (child_pid, followed_child);
 
   /* Don't resume CHILD_PID; it's stopped where it ought to be, until
      the decision gets made elsewhere how to continue it.
-     */
+   */
 }
 
 
@@ -560,7 +563,7 @@ child_post_follow_inferior_by_clone ()
 {
   /* This version of Unix doesn't require a meaningful "post follow inferior"
      operation by a clone debugger.
-     */
+   */
 }
 #endif
 
@@ -619,11 +622,11 @@ child_has_forked (pid, child_pid)
 #if !defined(CHILD_HAS_VFORKED)
 int
 child_has_vforked (pid, child_pid)
-  int  pid;
-  int *  child_pid;
+     int pid;
+     int *child_pid;
 {
   /* This version of Unix doesn't support notification of vfork events.
-     */
+   */
   return 0;
 }
 #endif
@@ -636,7 +639,7 @@ child_can_follow_vfork_prior_to_exec ()
   /* This version of Unix doesn't support notification of vfork events.
      However, if it did, it probably wouldn't allow vforks to be followed
      before the following exec.
-     */
+   */
   return 0;
 }
 #endif
@@ -645,14 +648,14 @@ child_can_follow_vfork_prior_to_exec ()
 #if !defined(CHILD_POST_FOLLOW_VFORK)
 void
 child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
-  int  parent_pid;
-  int  followed_parent;
-  int  child_pid;
-  int  followed_child;
+     int parent_pid;
+     int followed_parent;
+     int child_pid;
+     int followed_child;
 {
   /* This version of Unix doesn't require a meaningful "post follow vfork"
      operation by a clone debugger.
-     */
+   */
 }
 #endif
 
@@ -679,11 +682,11 @@ child_remove_exec_catchpoint (pid)
 #if !defined(CHILD_HAS_EXECD)
 int
 child_has_execd (pid, execd_pathname)
-  int  pid;
-  char **  execd_pathname;
+     int pid;
+     char **execd_pathname;
 {
   /* This version of Unix doesn't support notification of exec events.
-     */
+   */
   return 0;
 }
 #endif
@@ -694,7 +697,7 @@ int
 child_reported_exec_events_per_exec_call ()
 {
   /* This version of Unix doesn't support notification of exec events.
-     */
+   */
   return 1;
 }
 #endif
@@ -703,12 +706,12 @@ child_reported_exec_events_per_exec_call ()
 #if !defined(CHILD_HAS_SYSCALL_EVENT)
 int
 child_has_syscall_event (pid, kind, syscall_id)
-  int  pid;
-  enum target_waitkind *  kind;
-  int *  syscall_id;
+     int pid;
+     enum target_waitkind *kind;
+     int *syscall_id;
 {
   /* This version of Unix doesn't support notification of syscall events.
-     */
+   */
   return 0;
 }
 #endif
@@ -717,9 +720,9 @@ child_has_syscall_event (pid, kind, syscall_id)
 #if !defined(CHILD_HAS_EXITED)
 int
 child_has_exited (pid, wait_status, exit_status)
-  int  pid;
-  int  wait_status;
-  int *  exit_status;
+     int pid;
+     int wait_status;
+     int *exit_status;
 {
   if (WIFEXITED (wait_status))
     {
@@ -729,12 +732,12 @@ child_has_exited (pid, wait_status, exit_status)
 
   if (WIFSIGNALED (wait_status))
     {
-      *exit_status = 0;  /* ?? Don't know what else to say here. */
+      *exit_status = 0;                /* ?? Don't know what else to say here. */
       return 1;
     }
 
   /* ?? Do we really need to consult the event state, too?  Assume the
-   wait_state alone suffices.
+     wait_state alone suffices.
    */
   return 0;
 }
@@ -775,8 +778,8 @@ child_stop ()
 #if !defined(CHILD_ENABLE_EXCEPTION_CALLBACK)
 struct symtab_and_line *
 child_enable_exception_callback (kind, enable)
-  enum exception_event_kind kind;
-  int enable;
+     enum exception_event_kind kind;
+     int enable;
 {
   return (struct symtab_and_line *) NULL;
 }
@@ -794,27 +797,27 @@ child_get_current_exception_event ()
 #if !defined(CHILD_PID_TO_EXEC_FILE)
 char *
 child_pid_to_exec_file (pid)
-  int  pid;
+     int pid;
 {
   /* This version of Unix doesn't support translation of a process ID
      to the filename of the executable file.
-     */
+   */
   return NULL;
 }
 #endif
 
 char *
 child_core_file_to_sym_file (core)
-  char *  core;
+     char *core;
 {
   /* The target stratum for a running executable need not support
      this operation.
-     */
+   */
   return NULL;
 }
+\f
 
 
-\f
 static void
 init_child_ops ()
 {
index 61723dff052210c8a84d2051b874640e0c45e5ca..dae4ad44065501002b1647f8ad9e7d223aae540e 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -117,24 +118,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* This semaphore is used to coordinate the child and parent processes
    after a fork(), and before an exec() by the child.  See parent_attach_all
    for details.
-   */
-typedef struct {
-    int  parent_channel[2];  /* Parent "talks" to [1], child "listens" to [0] */
-    int  child_channel[2];   /* Child "talks" to [1], parent "listens" to [0] */
-} startup_semaphore_t;
+ */
+typedef struct
+  {
+    int parent_channel[2];     /* Parent "talks" to [1], child "listens" to [0] */
+    int child_channel[2];      /* Child "talks" to [1], parent "listens" to [0] */
+  }
+startup_semaphore_t;
 
 #define SEM_TALK (1)
 #define SEM_LISTEN (0)
 
-static startup_semaphore_t  startup_semaphore;
+static startup_semaphore_t startup_semaphore;
 
 /* See can_touch_threads_of_process for details. */
-static int  vforking_child_pid = 0;
-static int  vfork_in_flight = 0;
+static int vforking_child_pid = 0;
+static int vfork_in_flight = 0;
 
 /* To support PREPARE_TO_PROCEED (hppa_prepare_to_proceed).
  */
-static pid_t old_gdb_pid  = 0;
+static pid_t old_gdb_pid = 0;
 static pid_t reported_pid = 0;
 static int reported_bpt = 0;
 
@@ -147,13 +150,13 @@ static int reported_bpt = 0;
 
 /* When supplied as the "addr" operand, ttrace interprets this
    to mean, "from the current address".
  */
+ */
 #define TT_USE_CURRENT_PC ((TTRACE_ARG_TYPE) TT_NOPC)
 
 /* When supplied as the "addr", "data" or "addr2" operand for most
    requests, ttrace interprets this to mean, "pay no heed to this
    argument".
  */
+ */
 #define TT_NIL ((TTRACE_ARG_TYPE) TT_NULLARG)
 
 /* This is capable of holding the value of a 32-bit register.  The
@@ -164,8 +167,8 @@ static int reported_bpt = 0;
    ??rehrauer: Yes, this assumes that an int is 32-bits on HP-UX, and
    that registers are 32-bits on HP-UX.  The latter assumption changes
    with PA2.0.
  */
-typedef int  register_value_t;
+ */
+typedef int register_value_t;
 
 /********************************************************************
 
@@ -291,25 +294,29 @@ static unsigned int more_events_left = 0;
 
 /* Process state.
  */
-typedef enum process_state_enum {
+typedef enum process_state_enum
+  {
     STOPPED,
     FAKE_STEPPING,
-    FAKE_CONTINUE,   /* For later use */
+    FAKE_CONTINUE,             /* For later use */
     RUNNING,
     FORKING,
     VFORKING
-} process_state_t;
+  }
+process_state_t;
 
 static process_state_t process_state = STOPPED;
 
 /* User-specified stepping modality.
  */
-typedef enum stepping_mode_enum {
-    DO_DEFAULT,  /* ...which is a continue! */
+typedef enum stepping_mode_enum
+  {
+    DO_DEFAULT,                        /* ...which is a continue! */
     DO_STEP,
     DO_CONTINUE
-} stepping_mode_t;
+  }
+stepping_mode_t;
+
 /* Action to take on an attach, depends on
  * what kind (user command, fork, vfork).
  *
@@ -319,10 +326,12 @@ typedef enum stepping_mode_enum {
  *
  * o  leave stopped.
  */
-typedef enum attach_continue_enum {
-   DO_ATTACH_CONTINUE,
-   DONT_ATTACH_CONTINUE
-} attach_continue_t;
+typedef enum attach_continue_enum
+  {
+    DO_ATTACH_CONTINUE,
+    DONT_ATTACH_CONTINUE
+  }
+attach_continue_t;
 
 /* This flag is true if we are doing a step-over-bpt
  * with buffered events.  We will have to be sure to
@@ -330,87 +339,98 @@ typedef enum attach_continue_enum {
  * code in "infrun.c/wait_for_inferior" will get
  * confused.
  */
-static int doing_fake_step  = 0;
-static lwpid_t  fake_step_tid    = 0;
-
+static int doing_fake_step = 0;
+static lwpid_t fake_step_tid = 0;
 \f
+
 /****************************************************
  * Thread information structure routines and types. *
  ****************************************************
  */
-typedef 
+typedef
 struct thread_info_struct
-{
-    int                        am_pseudo;      /* This is a pseudo-thread for the process. */
-    int                 pid;            /* Process ID */
-    lwpid_t             tid;            /* Thread  ID */
-    int                        handled;        /* 1 if a buffered event was handled. */
-    int                        seen;           /* 1 if this thread was seen on a traverse. */
-    int                        terminated;     /* 1 if thread has terminated. */
-    int                        have_signal;    /* 1 if signal to be sent */
-    enum target_signal  signal_value;   /* Signal to send */
-    int                        have_start;     /* 1 if alternate starting address */
-    stepping_mode_t     stepping_mode;  /* Whether to step or continue */
-    CORE_ADDR           start;          /* Where to start */
-    int                        have_state;     /* 1 if the event state has been set */
-    ttstate_t           last_stop_state;/* The most recently-waited event for this thread. */
+  {
+    int am_pseudo;             /* This is a pseudo-thread for the process. */
+    int pid;                   /* Process ID */
+    lwpid_t tid;               /* Thread  ID */
+    int handled;               /* 1 if a buffered event was handled. */
+    int seen;                  /* 1 if this thread was seen on a traverse. */
+    int terminated;            /* 1 if thread has terminated. */
+    int have_signal;           /* 1 if signal to be sent */
+    enum target_signal signal_value;   /* Signal to send */
+    int have_start;            /* 1 if alternate starting address */
+    stepping_mode_t stepping_mode;     /* Whether to step or continue */
+    CORE_ADDR start;           /* Where to start */
+    int have_state;            /* 1 if the event state has been set */
+    ttstate_t last_stop_state; /* The most recently-waited event for this thread. */
     struct thread_info_struct
-                       *next;           /* All threads are linked via this field. */
+     *next;                    /* All threads are linked via this field. */
     struct thread_info_struct
-                       *next_pseudo;    /* All pseudo-threads are linked via this field. */
-} thread_info;
+     *next_pseudo;             /* All pseudo-threads are linked via this field. */
+  }
+thread_info;
 
 typedef
 struct thread_info_header_struct
-{
-    int          count;
+  {
+    int count;
     thread_info *head;
     thread_info *head_pseudo;
-    
-} thread_info_header;
 
-static thread_info_header thread_head     = { 0, NULL, NULL };
-static thread_info_header deleted_threads = { 0, NULL, NULL };
+  }
+thread_info_header;
 
-static saved_real_pid = 0;
+static thread_info_header thread_head =
+{0, NULL, NULL};
+static thread_info_header deleted_threads =
+{0, NULL, NULL};
 
+static saved_real_pid = 0;
 \f
+
 /*************************************************
  *          Debugging support functions          *
  *************************************************
  */
 CORE_ADDR
-get_raw_pc( ttid )
-    lwpid_t ttid;
+get_raw_pc (ttid)
+     lwpid_t ttid;
 {
-    unsigned long pc_val;
-    int      offset;
-    int      res;
-    offset = register_addr( PC_REGNUM, U_REGS_OFFSET );
-    res    = read_from_register_save_state(
-                       ttid,
-                       (TTRACE_ARG_TYPE) offset,
-                       (char *) &pc_val,
-                       sizeof( pc_val ));
-    if( res <= 0 ) {
-        return (CORE_ADDR) pc_val;
-    }
-    else {
-        return (CORE_ADDR) 0;
-    }
-}                   
+  unsigned long pc_val;
+  int offset;
+  int res;
+
+  offset = register_addr (PC_REGNUM, U_REGS_OFFSET);
+  res = read_from_register_save_state (
+                                       ttid,
+                                       (TTRACE_ARG_TYPE) offset,
+                                       (char *) &pc_val,
+                                       sizeof (pc_val));
+  if (res <= 0)
+    {
+      return (CORE_ADDR) pc_val;
+    }
+  else
+    {
+      return (CORE_ADDR) 0;
+    }
+}
 
 static char *
-get_printable_name_of_stepping_mode( mode )
-    stepping_mode_t mode;
+get_printable_name_of_stepping_mode (mode)
+     stepping_mode_t mode;
 {
-  switch( mode ) {
-    case DO_DEFAULT:  return "DO_DEFAULT";
-    case DO_STEP:     return "DO_STEP";
-    case DO_CONTINUE: return "DO_CONTINUE";
-    default:          return "?unknown mode?";
-  }
+  switch (mode)
+    {
+    case DO_DEFAULT:
+      return "DO_DEFAULT";
+    case DO_STEP:
+      return "DO_STEP";
+    case DO_CONTINUE:
+      return "DO_CONTINUE";
+    default:
+      return "?unknown mode?";
+    }
 }
 
 /* This function returns a pointer to a string describing the
@@ -418,123 +438,126 @@ get_printable_name_of_stepping_mode( mode )
  */
 char *
 get_printable_name_of_ttrace_event (event)
-  ttevents_t event;
+     ttevents_t event;
 {
   /* This enumeration is "gappy", so don't use a table. */
-  switch (event) {
+  switch (event)
+    {
 
     case TTEVT_NONE:
-       return "TTEVT_NONE";
+      return "TTEVT_NONE";
     case TTEVT_SIGNAL:
-       return "TTEVT_SIGNAL";
+      return "TTEVT_SIGNAL";
     case TTEVT_FORK:
-       return "TTEVT_FORK";
+      return "TTEVT_FORK";
     case TTEVT_EXEC:
-       return "TTEVT_EXEC";
+      return "TTEVT_EXEC";
     case TTEVT_EXIT:
-       return "TTEVT_EXIT";
+      return "TTEVT_EXIT";
     case TTEVT_VFORK:
-       return "TTEVT_VFORK";
+      return "TTEVT_VFORK";
     case TTEVT_SYSCALL_RETURN:
-       return "TTEVT_SYSCALL_RETURN";
+      return "TTEVT_SYSCALL_RETURN";
     case TTEVT_LWP_CREATE:
-       return "TTEVT_LWP_CREATE";
+      return "TTEVT_LWP_CREATE";
     case TTEVT_LWP_TERMINATE:
-       return "TTEVT_LWP_TERMINATE";
+      return "TTEVT_LWP_TERMINATE";
     case TTEVT_LWP_EXIT:
-       return "TTEVT_LWP_EXIT";
+      return "TTEVT_LWP_EXIT";
     case TTEVT_LWP_ABORT_SYSCALL:
-       return "TTEVT_LWP_ABORT_SYSCALL";
+      return "TTEVT_LWP_ABORT_SYSCALL";
     case TTEVT_SYSCALL_ENTRY:
-       return "TTEVT_SYSCALL_ENTRY";
-    case TTEVT_SYSCALL_RESTART:        
-       return "TTEVT_SYSCALL_RESTART";
-    default :
+      return "TTEVT_SYSCALL_ENTRY";
+    case TTEVT_SYSCALL_RESTART:
+      return "TTEVT_SYSCALL_RESTART";
+    default:
       return "?new event?";
-  }
+    }
 }
-
 \f
+
 /* This function translates the ttrace request enumeration into
  * a character string that is its printable (aka "human readable")
  * name.
  */
 char *
 get_printable_name_of_ttrace_request (request)
-  ttreq_t  request;
+     ttreq_t request;
 {
   if (!IS_TTRACE_REQ (request))
     return "?bad req?";
 
   /* This enumeration is "gappy", so don't use a table. */
-  switch (request) {
-    case TT_PROC_SETTRC :
+  switch (request)
+    {
+    case TT_PROC_SETTRC:
       return "TT_PROC_SETTRC";
-    case TT_PROC_ATTACH :
+    case TT_PROC_ATTACH:
       return "TT_PROC_ATTACH";
-    case TT_PROC_DETACH :
+    case TT_PROC_DETACH:
       return "TT_PROC_DETACH";
-    case TT_PROC_RDTEXT :
+    case TT_PROC_RDTEXT:
       return "TT_PROC_RDTEXT";
-    case TT_PROC_WRTEXT :
+    case TT_PROC_WRTEXT:
       return "TT_PROC_WRTEXT";
-    case TT_PROC_RDDATA :
+    case TT_PROC_RDDATA:
       return "TT_PROC_RDDATA";
-    case TT_PROC_WRDATA :
+    case TT_PROC_WRDATA:
       return "TT_PROC_WRDATA";
-    case TT_PROC_STOP :
+    case TT_PROC_STOP:
       return "TT_PROC_STOP";
-    case TT_PROC_CONTINUE :
+    case TT_PROC_CONTINUE:
       return "TT_PROC_CONTINUE";
-    case TT_PROC_GET_PATHNAME :
+    case TT_PROC_GET_PATHNAME:
       return "TT_PROC_GET_PATHNAME";
-    case TT_PROC_GET_EVENT_MASK :
+    case TT_PROC_GET_EVENT_MASK:
       return "TT_PROC_GET_EVENT_MASK";
-    case TT_PROC_SET_EVENT_MASK :
+    case TT_PROC_SET_EVENT_MASK:
       return "TT_PROC_SET_EVENT_MASK";
-    case TT_PROC_GET_FIRST_LWP_STATE :
+    case TT_PROC_GET_FIRST_LWP_STATE:
       return "TT_PROC_GET_FIRST_LWP_STATE";
-    case TT_PROC_GET_NEXT_LWP_STATE :
+    case TT_PROC_GET_NEXT_LWP_STATE:
       return "TT_PROC_GET_NEXT_LWP_STATE";
-    case TT_PROC_EXIT :
+    case TT_PROC_EXIT:
       return "TT_PROC_EXIT";
-    case TT_PROC_GET_MPROTECT :
+    case TT_PROC_GET_MPROTECT:
       return "TT_PROC_GET_MPROTECT";
-    case TT_PROC_SET_MPROTECT :
+    case TT_PROC_SET_MPROTECT:
       return "TT_PROC_SET_MPROTECT";
-    case TT_PROC_SET_SCBM :
+    case TT_PROC_SET_SCBM:
       return "TT_PROC_SET_SCBM";
-    case TT_LWP_STOP :
+    case TT_LWP_STOP:
       return "TT_LWP_STOP";
-    case TT_LWP_CONTINUE :
+    case TT_LWP_CONTINUE:
       return "TT_LWP_CONTINUE";
-    case TT_LWP_SINGLE :
+    case TT_LWP_SINGLE:
       return "TT_LWP_SINGLE";
-    case TT_LWP_RUREGS :
+    case TT_LWP_RUREGS:
       return "TT_LWP_RUREGS";
-    case TT_LWP_WUREGS :
+    case TT_LWP_WUREGS:
       return "TT_LWP_WUREGS";
-    case TT_LWP_GET_EVENT_MASK :
+    case TT_LWP_GET_EVENT_MASK:
       return "TT_LWP_GET_EVENT_MASK";
-    case TT_LWP_SET_EVENT_MASK :
+    case TT_LWP_SET_EVENT_MASK:
       return "TT_LWP_SET_EVENT_MASK";
-    case TT_LWP_GET_STATE      :
+    case TT_LWP_GET_STATE:
       return "TT_LWP_GET_STATE";
-    default :
+    default:
       return "?new req?";
-  }
+    }
 }
-
 \f
+
 /* This function translates the process state enumeration into
  * a character string that is its printable (aka "human readable")
  * name.
  */
 static char *
 get_printable_name_of_process_state (process_state)
-  process_state_t  process_state;
+     process_state_t process_state;
 {
-  switch (process_state) {
+  switch (process_state)
+    {
     case STOPPED:
       return "STOPPED";
     case FAKE_STEPPING:
@@ -547,113 +570,115 @@ get_printable_name_of_process_state (process_state)
       return "VFORKING";
     default:
       return "?some unknown state?";
-  }
+    }
 }
 
 /* Set a ttrace thread state to a safe, initial state.
  */
 static void
 clear_ttstate_t (tts)
-    ttstate_t *  tts;
+     ttstate_t *tts;
 {
-    tts->tts_pid = 0;
-    tts->tts_lwpid = 0;
-    tts->tts_user_tid = 0;
-    tts->tts_event = TTEVT_NONE;
+  tts->tts_pid = 0;
+  tts->tts_lwpid = 0;
+  tts->tts_user_tid = 0;
+  tts->tts_event = TTEVT_NONE;
 }
 
 /* Copy ttrace thread state TTS_FROM into TTS_TO.
  */
 static void
 copy_ttstate_t (tts_to, tts_from)
-    ttstate_t *  tts_to;
-    ttstate_t *  tts_from;
+     ttstate_t *tts_to;
+     ttstate_t *tts_from;
 {
-    memcpy ((char *) tts_to, (char *) tts_from, sizeof (*tts_to));
+  memcpy ((char *) tts_to, (char *) tts_from, sizeof (*tts_to));
 }
 
 /* Are there any live threads we know about?
  */
-static int 
-any_thread_records()
+static int
+any_thread_records ()
 {
-    return( thread_head.count > 0 );
+  return (thread_head.count > 0);
 }
 
 /* Create, fill in and link in a thread descriptor.
  */
 static thread_info *
 create_thread_info (pid, tid)
-    int     pid;
-    lwpid_t tid;
+     int pid;
+     lwpid_t tid;
 {
-    thread_info *  new_p;
-    thread_info *  p;
-    int  thread_count_of_pid;
-
-    new_p = malloc( sizeof( thread_info ));
-    new_p->pid = pid;
-    new_p->tid = tid;
-    new_p->have_signal = 0;
-    new_p->have_start  = 0;
-    new_p->have_state  = 0;
-    clear_ttstate_t( &new_p->last_stop_state );
-    new_p->am_pseudo   = 0;
-    new_p->handled     = 0;
-    new_p->seen        = 0;
-    new_p->terminated  = 0;
-    new_p->next        = NULL;
-    new_p->next_pseudo = NULL;
-    new_p->stepping_mode = DO_DEFAULT;
-
-    if( 0 == thread_head.count ) {
+  thread_info *new_p;
+  thread_info *p;
+  int thread_count_of_pid;
+
+  new_p = malloc (sizeof (thread_info));
+  new_p->pid = pid;
+  new_p->tid = tid;
+  new_p->have_signal = 0;
+  new_p->have_start = 0;
+  new_p->have_state = 0;
+  clear_ttstate_t (&new_p->last_stop_state);
+  new_p->am_pseudo = 0;
+  new_p->handled = 0;
+  new_p->seen = 0;
+  new_p->terminated = 0;
+  new_p->next = NULL;
+  new_p->next_pseudo = NULL;
+  new_p->stepping_mode = DO_DEFAULT;
+
+  if (0 == thread_head.count)
+    {
 #ifdef THREAD_DEBUG
-        if( debug_on )
-            printf( "First thread, pid %d tid %d!\n", pid, tid );
+      if (debug_on)
+       printf ("First thread, pid %d tid %d!\n", pid, tid);
 #endif
-        saved_real_pid = inferior_pid;
+      saved_real_pid = inferior_pid;
     }
-    else {
+  else
+    {
 #ifdef THREAD_DEBUG
-        if( debug_on )
-            printf( "Subsequent thread, pid %d tid %d\n", pid, tid );
+      if (debug_on)
+       printf ("Subsequent thread, pid %d tid %d\n", pid, tid);
 #endif
     }
 
-    /* Another day, another thread...
-     */
-    thread_head.count++;
+  /* Another day, another thread...
+   */
+  thread_head.count++;
 
-    /* The new thread always goes at the head of the list.
-     */
-    new_p->next       = thread_head.head;
-    thread_head.head  = new_p;
+  /* The new thread always goes at the head of the list.
+   */
+  new_p->next = thread_head.head;
+  thread_head.head = new_p;
 
-    /* Is this the "pseudo" thread of a process?  It is if there's
-     * no other thread for this process on the list.  (Note that this
-     * accomodates multiple processes, such as we see even for simple
-     * cases like forking "non-threaded" programs.)
-     */
-    p = thread_head.head;
-    thread_count_of_pid = 0;
-    while (p)
-      {
-        if (p->pid == new_p->pid)
-          thread_count_of_pid++;
-        p = p->next;
-      }
-
-    /* Did we see any other threads for this pid?  (Recall that we just
-     * added this thread to the list...)
-     */
-    if (thread_count_of_pid == 1)
-      {
-        new_p->am_pseudo        = 1;
-        new_p->next_pseudo      = thread_head.head_pseudo;
-        thread_head.head_pseudo = new_p;
-      }
-    
-    return new_p;
+  /* Is this the "pseudo" thread of a process?  It is if there's
+   * no other thread for this process on the list.  (Note that this
+   * accomodates multiple processes, such as we see even for simple
+   * cases like forking "non-threaded" programs.)
+   */
+  p = thread_head.head;
+  thread_count_of_pid = 0;
+  while (p)
+    {
+      if (p->pid == new_p->pid)
+       thread_count_of_pid++;
+      p = p->next;
+    }
+
+  /* Did we see any other threads for this pid?  (Recall that we just
+   * added this thread to the list...)
+   */
+  if (thread_count_of_pid == 1)
+    {
+      new_p->am_pseudo = 1;
+      new_p->next_pseudo = thread_head.head_pseudo;
+      thread_head.head_pseudo = new_p;
+    }
+
+  return new_p;
 }
 
 /* Get rid of our thread info.
@@ -661,62 +686,68 @@ create_thread_info (pid, tid)
 static void
 clear_thread_info ()
 {
-    thread_info *p;
-    thread_info *q;
+  thread_info *p;
+  thread_info *q;
 
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        printf( "Clearing all thread info\n" );
+  if (debug_on)
+    printf ("Clearing all thread info\n");
 #endif
 
-    p = thread_head.head;
-    while( p ) {
-        q = p;
-        p = p->next;
-        free( q );
+  p = thread_head.head;
+  while (p)
+    {
+      q = p;
+      p = p->next;
+      free (q);
     }
 
-    thread_head.head        = NULL;
-    thread_head.head_pseudo = NULL;
-    thread_head.count       = 0;
+  thread_head.head = NULL;
+  thread_head.head_pseudo = NULL;
+  thread_head.count = 0;
 
-    p = deleted_threads.head;
-    while( p ) {
-        q = p;
-        p = p->next;
-        free( q );
+  p = deleted_threads.head;
+  while (p)
+    {
+      q = p;
+      p = p->next;
+      free (q);
     }
 
-    deleted_threads.head        = NULL;
-    deleted_threads.head_pseudo = NULL;
-    deleted_threads.count       = 0;
+  deleted_threads.head = NULL;
+  deleted_threads.head_pseudo = NULL;
+  deleted_threads.count = 0;
 
-    /* No threads, so can't have pending events.
-     */
-    more_events_left = 0;   
+  /* No threads, so can't have pending events.
+   */
+  more_events_left = 0;
 }
 
 /* Given a tid, find the thread block for it.
  */
 static thread_info *
 find_thread_info (tid)
-    lwpid_t tid;
+     lwpid_t tid;
 {
-    thread_info *p;
+  thread_info *p;
 
-    for( p = thread_head.head; p; p = p->next )  {
-       if( p->tid == tid ) {
-           return p;
-       }
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->tid == tid)
+       {
+         return p;
+       }
     }
 
-    for( p = deleted_threads.head; p; p = p->next )  {
-       if( p->tid == tid ) {
-           return p;
-       }
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      if (p->tid == tid)
+       {
+         return p;
+       }
     }
-    
-    return NULL;  
+
+  return NULL;
 }
 
 /* For any but the pseudo thread, this maps to the
@@ -727,46 +758,48 @@ find_thread_info (tid)
  * deleted threads.  We do the map, but we don't like it.
  */
 static lwpid_t
-map_from_gdb_tid( gdb_tid )
-    lwpid_t gdb_tid;
+map_from_gdb_tid (gdb_tid)
+     lwpid_t gdb_tid;
 {
-    thread_info *p;
+  thread_info *p;
 
-    /* First assume gdb_tid really is a tid, and try to find a
-     * matching entry on the threads list.
-     */
-    for( p = thread_head.head; p; p = p->next )  {
-        if( p->tid == gdb_tid )
-            return gdb_tid;
+  /* First assume gdb_tid really is a tid, and try to find a
+   * matching entry on the threads list.
+   */
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->tid == gdb_tid)
+       return gdb_tid;
     }
 
-    /* It doesn't appear to be a tid; perhaps it's really a pid?
-     * Try to find a "pseudo" thread entry on the threads list.
-     */
-    for (p = thread_head.head_pseudo; p != NULL; p = p->next_pseudo)
-      {
-        if (p->pid == gdb_tid)
-          return p->tid;
-      }
-
-    /* Perhaps it's the tid of a deleted thread we may still
-     * have some knowledge of?
-     */
-    for( p = deleted_threads.head; p; p = p-> next ) {
-        if( p->tid == gdb_tid )
-            return gdb_tid;
+  /* It doesn't appear to be a tid; perhaps it's really a pid?
+   * Try to find a "pseudo" thread entry on the threads list.
+   */
+  for (p = thread_head.head_pseudo; p != NULL; p = p->next_pseudo)
+    {
+      if (p->pid == gdb_tid)
+       return p->tid;
     }
 
-    /* Or perhaps it's the pid of a deleted process we may still
-     * have knowledge of?
-     */
-    for (p = deleted_threads.head_pseudo; p != NULL; p = p->next_pseudo)
-      {
-        if (p->pid == gdb_tid)
-          return p->tid;
-      }
+  /* Perhaps it's the tid of a deleted thread we may still
+   * have some knowledge of?
+   */
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      if (p->tid == gdb_tid)
+       return gdb_tid;
+    }
 
-    return 0;  /* Error? */
+  /* Or perhaps it's the pid of a deleted process we may still
+   * have knowledge of?
+   */
+  for (p = deleted_threads.head_pseudo; p != NULL; p = p->next_pseudo)
+    {
+      if (p->pid == gdb_tid)
+       return p->tid;
+    }
+
+  return 0;                    /* Error? */
 }
 
 /* Map the other way: from a real tid to the
@@ -775,96 +808,101 @@ map_from_gdb_tid( gdb_tid )
  * also need to consider deleted threads.
  */
 static lwpid_t
-map_to_gdb_tid( real_tid )
-    lwpid_t real_tid;
+map_to_gdb_tid (real_tid)
+     lwpid_t real_tid;
 {
-    thread_info *p;
+  thread_info *p;
 
-    for( p = thread_head.head; p; p = p->next )  {
-        if( p->tid == real_tid ) {
-            if( p->am_pseudo )
-                return p->pid;
-            else 
-                return real_tid;
-       }
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->tid == real_tid)
+       {
+         if (p->am_pseudo)
+           return p->pid;
+         else
+           return real_tid;
+       }
     }
 
-    for( p = deleted_threads.head; p; p = p-> next ) {
-        if( p->tid == real_tid )
-            if( p->am_pseudo )
-                return p->pid;  /* Error? */
-            else 
-                return real_tid;
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      if (p->tid == real_tid)
+       if (p->am_pseudo)
+         return p->pid;        /* Error? */
+       else
+         return real_tid;
     }
 
-    return 0;  /* Error?  Never heard of this thread! */
+  return 0;                    /* Error?  Never heard of this thread! */
 }
 
 /* Do any threads have saved signals?
  */
-static int 
+static int
 saved_signals_exist ()
 {
-    thread_info *p;
-   
-    for( p = thread_head.head; p; p = p->next )  {
-       if( p->have_signal ) {
-           return 1;
-       }
+  thread_info *p;
+
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->have_signal)
+       {
+         return 1;
+       }
     }
 
-    return 0;
+  return 0;
 }
 
 /* Is this the tid for the zero-th thread?
  */
-static int 
+static int
 is_pseudo_thread (tid)
-    lwpid_t tid;
+     lwpid_t tid;
 {
-    thread_info *p = find_thread_info( tid );
-    if( NULL == p || p->terminated )
-        return 0;
-    else
-        return p->am_pseudo;
+  thread_info *p = find_thread_info (tid);
+  if (NULL == p || p->terminated)
+    return 0;
+  else
+    return p->am_pseudo;
 }
 
 /* Is this thread terminated?
  */
-static int 
+static int
 is_terminated (tid)
-    lwpid_t tid;
+     lwpid_t tid;
 {
-    thread_info *p = find_thread_info( tid );
+  thread_info *p = find_thread_info (tid);
 
-    if( NULL != p )
-        return p->terminated;
+  if (NULL != p)
+    return p->terminated;
 
-    return 0;
+  return 0;
 }
 
 /* Is this pid a real PID or a TID?
  */
-static int 
+static int
 is_process_id (pid)
-  int  pid;
+     int pid;
 {
-  lwpid_t  tid;
-  thread_info *  tinfo;
-  pid_t  this_pid;
-  int  this_pid_count;
+  lwpid_t tid;
+  thread_info *tinfo;
+  pid_t this_pid;
+  int this_pid_count;
 
   /* What does PID really represent?
    */
   tid = map_from_gdb_tid (pid);
   if (tid <= 0)
-    return 0; /* Actually, is probably an error... */
+    return 0;                  /* Actually, is probably an error... */
 
   tinfo = find_thread_info (tid);
 
   /* Does it appear to be a true thread?
    */
-  if (! tinfo->am_pseudo)
+  if (!tinfo->am_pseudo)
     return 0;
 
   /* Else, it looks like it may be a process.  See if there's any other
@@ -876,7 +914,7 @@ is_process_id (pid)
   for (tinfo = thread_head.head; tinfo; tinfo = tinfo->next)
     {
       if (tinfo->pid == this_pid)
-        this_pid_count++;
+       this_pid_count++;
     }
 
   return (this_pid_count == 1);
@@ -887,94 +925,101 @@ is_process_id (pid)
  */
 static thread_info *
 add_tthread (pid, tid)
-    int     pid;
-    lwpid_t tid;
+     int pid;
+     lwpid_t tid;
 {
-    thread_info *p;
+  thread_info *p;
 
-    p = find_thread_info( tid );
-    if( NULL == p )
-        p = create_thread_info( pid, tid );
+  p = find_thread_info (tid);
+  if (NULL == p)
+    p = create_thread_info (pid, tid);
 
-    return p;
+  return p;
 }
 
 /* Notice that a thread was deleted.
  */
 static void
 del_tthread (tid)
-    lwpid_t tid;
+     lwpid_t tid;
 {
-    thread_info *p;
-    thread_info *chase;
+  thread_info *p;
+  thread_info *chase;
 
-    if( thread_head.count <= 0 ) {
-        error( "Internal error in thread database." );
-        return;
+  if (thread_head.count <= 0)
+    {
+      error ("Internal error in thread database.");
+      return;
     }
 
-    chase = NULL;
-    for( p = thread_head.head; p; p = p->next )  {
-       if( p->tid == tid ) {
+  chase = NULL;
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->tid == tid)
+       {
 
 #ifdef THREAD_DEBUG
-           if( debug_on )
-               printf( "Delete here: %d \n", tid );
+         if (debug_on)
+           printf ("Delete here: %d \n", tid);
 #endif
 
-           if( p->am_pseudo ) {
-               /*
-                * Deleting a main thread is ok if we're doing
-                * a parent-follow on a child; this is odd but
-                * not wrong.  It apparently _doesn't_ happen
-                * on the child-follow, as we don't just delete
-                * the pseudo while keeping the rest of the
-                * threads around--instead, we clear out the whole
-                * thread list at once.
-                */
-               thread_info *q;
-               thread_info *q_chase;
-               
-               q_chase = NULL;
-               for( q = thread_head.head_pseudo; q; q = q -> next ) {
-                    if( q == p ) {
-                        /* Remove from pseudo list.
-                         */
-                        if( q_chase == NULL )
-                            thread_head.head_pseudo = p->next_pseudo;
-                        else
-                            q_chase-> next = p->next_pseudo;
-                    }
-                    else
-                        q_chase = q;
-               }
-           }
-           
-           /* Remove from live list.
-            */
-           thread_head.count--;
-
-           if( NULL == chase )
-               thread_head.head = p->next;
-           else
-               chase->next      = p->next;
-
-           /* Add to deleted thread list.
-            */
-           p->next = deleted_threads.head;
-           deleted_threads.head = p;
-           deleted_threads.count++;
-           if( p->am_pseudo ) {
-               p->next_pseudo              = deleted_threads.head_pseudo;
-               deleted_threads.head_pseudo = p;
-           }
-           p->terminated = 1;
-           
-           return;
-       }
-
-       else
-           chase = p;
+         if (p->am_pseudo)
+           {
+             /*
+              * Deleting a main thread is ok if we're doing
+              * a parent-follow on a child; this is odd but
+              * not wrong.  It apparently _doesn't_ happen
+              * on the child-follow, as we don't just delete
+              * the pseudo while keeping the rest of the
+              * threads around--instead, we clear out the whole
+              * thread list at once.
+              */
+             thread_info *q;
+             thread_info *q_chase;
+
+             q_chase = NULL;
+             for (q = thread_head.head_pseudo; q; q = q->next)
+               {
+                 if (q == p)
+                   {
+                     /* Remove from pseudo list.
+                      */
+                     if (q_chase == NULL)
+                       thread_head.head_pseudo = p->next_pseudo;
+                     else
+                       q_chase->next = p->next_pseudo;
+                   }
+                 else
+                   q_chase = q;
+               }
+           }
+
+         /* Remove from live list.
+          */
+         thread_head.count--;
+
+         if (NULL == chase)
+           thread_head.head = p->next;
+         else
+           chase->next = p->next;
+
+         /* Add to deleted thread list.
+          */
+         p->next = deleted_threads.head;
+         deleted_threads.head = p;
+         deleted_threads.count++;
+         if (p->am_pseudo)
+           {
+             p->next_pseudo = deleted_threads.head_pseudo;
+             deleted_threads.head_pseudo = p;
+           }
+         p->terminated = 1;
+
+         return;
+       }
+
+      else
+       chase = p;
     }
 }
 
@@ -982,67 +1027,71 @@ del_tthread (tid)
  */
 static int
 get_pid_for (tid)
-    lwpid_t tid;
+     lwpid_t tid;
 {
-    thread_info *p;
+  thread_info *p;
 
-    for( p = thread_head.head; p; p = p->next ) {
-        if( p->tid == tid ) {
-            return p->pid;
-        }
+  for (p = thread_head.head; p; p = p->next)
+    {
+      if (p->tid == tid)
+       {
+         return p->pid;
+       }
     }
 
-    for( p = deleted_threads.head; p; p = p->next ) {
-        if( p->tid == tid ) {
-            return p->pid;
-        }
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      if (p->tid == tid)
+       {
+         return p->pid;
+       }
     }
-    
-    return 0;
+
+  return 0;
 }
 
 /* Note that this thread's current event has been handled.
  */
 static void
-set_handled( pid, tid )
-    int     pid;
-    lwpid_t tid;
+set_handled (pid, tid)
+     int pid;
+     lwpid_t tid;
 {
-    thread_info *p;
-    
-    p = find_thread_info( tid );
-    if( NULL == p )
-        p = add_tthread( pid, tid );
+  thread_info *p;
+
+  p = find_thread_info (tid);
+  if (NULL == p)
+    p = add_tthread (pid, tid);
 
-    p->handled = 1;
+  p->handled = 1;
 }
 
 /* Was this thread's current event handled?
  */
-static int 
-was_handled( tid )
-    lwpid_t tid;
+static int
+was_handled (tid)
+     lwpid_t tid;
 {
-    thread_info *p;
-    
-    p = find_thread_info( tid );
-    if( NULL != p )
-        return p->handled;
+  thread_info *p;
+
+  p = find_thread_info (tid);
+  if (NULL != p)
+    return p->handled;
 
-    return 0;  /* New threads have not been handled */
+  return 0;                    /* New threads have not been handled */
 }
 
 /* Set this thread to unhandled.
  */
 static void
-clear_handled( tid )
-  lwpid_t  tid;
+clear_handled (tid)
+     lwpid_t tid;
 {
-  thread_info *  p;
-    
+  thread_info *p;
+
 #ifdef WAIT_BUFFER_DEBUG
-    if( debug_on )
-        printf( "clear_handled %d\n", (int) tid );
+  if (debug_on)
+    printf ("clear_handled %d\n", (int) tid);
 #endif
 
   p = find_thread_info (tid);
@@ -1057,33 +1106,35 @@ clear_handled( tid )
 static void
 clear_all_handled ()
 {
-    thread_info *p;
+  thread_info *p;
 
 #ifdef WAIT_BUFFER_DEBUG
-    if( debug_on )
-        printf( "clear_all_handled\n" );
+  if (debug_on)
+    printf ("clear_all_handled\n");
 #endif
 
-    for( p = thread_head.head; p; p = p->next ) {
-        p->handled = 0;
+  for (p = thread_head.head; p; p = p->next)
+    {
+      p->handled = 0;
     }
 
-    for( p = deleted_threads.head; p; p = p->next ) {
-        p->handled = 0;
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      p->handled = 0;
     }
 }
 
 /* Set this thread to default stepping mode.
  */
 static void
-clear_stepping_mode( tid )
-  lwpid_t  tid;
+clear_stepping_mode (tid)
+     lwpid_t tid;
 {
-  thread_info *  p;
-    
+  thread_info *p;
+
 #ifdef WAIT_BUFFER_DEBUG
-  if( debug_on )
-       printf( "clear_stepping_mode %d\n", (int) tid );
+  if (debug_on)
+    printf ("clear_stepping_mode %d\n", (int) tid);
 #endif
 
   p = find_thread_info (tid);
@@ -1098,31 +1149,34 @@ clear_stepping_mode( tid )
 static void
 clear_all_stepping_mode ()
 {
-    thread_info *p;
+  thread_info *p;
 
 #ifdef WAIT_BUFFER_DEBUG
-    if( debug_on )
-        printf( "clear_all_stepping_mode\n" );
+  if (debug_on)
+    printf ("clear_all_stepping_mode\n");
 #endif
 
-    for( p = thread_head.head; p; p = p->next ) {
-        p->stepping_mode = DO_DEFAULT;
+  for (p = thread_head.head; p; p = p->next)
+    {
+      p->stepping_mode = DO_DEFAULT;
     }
 
-    for( p = deleted_threads.head; p; p = p->next ) {
-        p->stepping_mode = DO_DEFAULT;
+  for (p = deleted_threads.head; p; p = p->next)
+    {
+      p->stepping_mode = DO_DEFAULT;
     }
 }
 
 /* Set all threads to unseen on this pass.
- */    
+ */
 static void
 set_all_unseen ()
 {
-    thread_info *p;
+  thread_info *p;
 
-    for( p = thread_head.head; p; p = p->next ) {
-        p->seen = 0;
+  for (p = thread_head.head; p; p = p->next)
+    {
+      p->seen = 0;
     }
 }
 
@@ -1131,67 +1185,71 @@ set_all_unseen ()
  */
 static void
 print_tthread (p)
-    thread_info *  p;
+     thread_info *p;
 {
-    printf( " Thread pid %d, tid %d", p->pid, p->tid );
-    if( p->have_state ) 
-        printf( ", event is %s",
-            get_printable_name_of_ttrace_event( p->last_stop_state.tts_event ));
-            
-    if( p->am_pseudo )
-        printf( ", pseudo thread" );
-        
-    if( p->have_signal )
-        printf( ", have signal 0x%x", p->signal_value );
-        
-    if( p->have_start )
-        printf( ", have start at 0x%x", p->start );
-        
-    printf( ", step is %s", get_printable_name_of_stepping_mode( p->stepping_mode ));
-        
-    if( p->handled )
-        printf( ", handled" );
-    else
-        printf( ", not handled" );
-        
-    if( p->seen )
-        printf( ", seen" );
-    else
-        printf( ", not seen" );
-
-    printf( "\n" );
+  printf (" Thread pid %d, tid %d", p->pid, p->tid);
+  if (p->have_state)
+    printf (", event is %s",
+        get_printable_name_of_ttrace_event (p->last_stop_state.tts_event));
+
+  if (p->am_pseudo)
+    printf (", pseudo thread");
+
+  if (p->have_signal)
+    printf (", have signal 0x%x", p->signal_value);
+
+  if (p->have_start)
+    printf (", have start at 0x%x", p->start);
+
+  printf (", step is %s", get_printable_name_of_stepping_mode (p->stepping_mode));
+
+  if (p->handled)
+    printf (", handled");
+  else
+    printf (", not handled");
+
+  if (p->seen)
+    printf (", seen");
+  else
+    printf (", not seen");
+
+  printf ("\n");
 }
 
 static void
 print_tthreads ()
 {
-    thread_info *p;
-
-    if( thread_head.count == 0 )
-        printf( "Thread list is empty\n" );
-    else {
-        printf( "Thread list has " );
-        if( thread_head.count == 1 )
-            printf( "1 entry:\n" );
-        else
-            printf( "%d entries:\n", thread_head.count );
-        for( p = thread_head.head; p; p = p->next ) {
-            print_tthread (p);
-        }
-    }
-
-    if( deleted_threads.count == 0 )
-        printf( "Deleted thread list is empty\n" );
-    else {
-        printf( "Deleted thread list has " );
-        if( deleted_threads.count == 1 )
-            printf( "1 entry:\n" );
-        else
-            printf( "%d entries:\n", deleted_threads.count );
-
-        for( p = deleted_threads.head; p; p = p->next ) {
-            print_tthread (p);
-        }
+  thread_info *p;
+
+  if (thread_head.count == 0)
+    printf ("Thread list is empty\n");
+  else
+    {
+      printf ("Thread list has ");
+      if (thread_head.count == 1)
+       printf ("1 entry:\n");
+      else
+       printf ("%d entries:\n", thread_head.count);
+      for (p = thread_head.head; p; p = p->next)
+       {
+         print_tthread (p);
+       }
+    }
+
+  if (deleted_threads.count == 0)
+    printf ("Deleted thread list is empty\n");
+  else
+    {
+      printf ("Deleted thread list has ");
+      if (deleted_threads.count == 1)
+       printf ("1 entry:\n");
+      else
+       printf ("%d entries:\n", deleted_threads.count);
+
+      for (p = deleted_threads.head; p; p = p->next)
+       {
+         print_tthread (p);
+       }
     }
 }
 #endif
@@ -1201,11 +1259,12 @@ print_tthreads ()
 static void
 update_thread_list ()
 {
-    thread_info *p;
-    thread_info *chase;
+  thread_info *p;
+  thread_info *chase;
 
-    chase = NULL;
-    for( p = thread_head.head; p; p = p->next ) {
+  chase = NULL;
+  for (p = thread_head.head; p; p = p->next)
+    {
       /* Is this an "unseen" thread which really happens to be a process?
          If so, is it inferior_pid and is a vfork in flight?  If yes to
          all, then DON'T REMOVE IT!  We're in the midst of moving a vfork
@@ -1213,26 +1272,27 @@ update_thread_list ()
          can touch the parent again.  We've most likely stopped to examine
          the child at a late stage in the vfork, and if we're not following
          the child, we'd best not treat the parent as a dead "thread"...
-         */
-        if( (!p->seen) && p->am_pseudo && vfork_in_flight
-         && (p->pid != vforking_child_pid))
-            p->seen = 1;
+       */
+      if ((!p->seen) && p->am_pseudo && vfork_in_flight
+         && (p->pid != vforking_child_pid))
+       p->seen = 1;
 
-        if( !p->seen ) {
-            /* Remove this one
-             */
+      if (!p->seen)
+       {
+         /* Remove this one
+          */
 
 #ifdef THREAD_DEBUG
-           if( debug_on )
-               printf( "Delete unseen thread: %d \n", p->tid );
+         if (debug_on)
+           printf ("Delete unseen thread: %d \n", p->tid);
 #endif
-           del_tthread( p->tid );
-       }
+         del_tthread (p->tid);
+       }
     }
 }
-
-    
 \f
+
+
 /************************************************
  *            O/S call wrappers                 *
  ************************************************
@@ -1245,34 +1305,36 @@ update_thread_list ()
  * No other "raw" calls to ttrace should exist in this module.
  */
 static int
-call_real_ttrace( request, pid, tid, addr, data, addr2 )
-  ttreq_t          request;
-  pid_t            pid;
-  lwpid_t          tid;
-  TTRACE_ARG_TYPE  addr, data, addr2;
+call_real_ttrace (request, pid, tid, addr, data, addr2)
+     ttreq_t request;
+     pid_t pid;
+     lwpid_t tid;
+     TTRACE_ARG_TYPE addr, data, addr2;
 {
-  int  tt_status;
+  int tt_status;
 
   errno = 0;
-  tt_status = ttrace( request, pid, tid, addr, data, addr2 );
+  tt_status = ttrace (request, pid, tid, addr, data, addr2);
 
 #ifdef THREAD_DEBUG
-  if (errno) {
-    /* Don't bother for a known benign error: if you ask for the
-     * first thread state, but there is only one thread and it's
-     * not stopped, ttrace complains.
-     *
-     * We have this inside the #ifdef because our caller will do
-     * this check for real.
-     */
-    if( request != TT_PROC_GET_FIRST_LWP_STATE
-    ||  errno   != EPROTO ) {
-        if( debug_on )
-            printf( "TT fail for %s, with pid %d, tid %d, status %d \n",
-                    get_printable_name_of_ttrace_request (request),
-                    pid, tid, tt_status );
+  if (errno)
+    {
+      /* Don't bother for a known benign error: if you ask for the
+       * first thread state, but there is only one thread and it's
+       * not stopped, ttrace complains.
+       *
+       * We have this inside the #ifdef because our caller will do
+       * this check for real.
+       */
+      if (request != TT_PROC_GET_FIRST_LWP_STATE
+         || errno != EPROTO)
+       {
+         if (debug_on)
+           printf ("TT fail for %s, with pid %d, tid %d, status %d \n",
+                   get_printable_name_of_ttrace_request (request),
+                   pid, tid, tt_status);
+       }
     }
-  }
 #endif
 
 #if 0
@@ -1280,51 +1342,53 @@ call_real_ttrace( request, pid, tid, addr, data, addr2 )
    * failed requests here.  However, some clients of this interface
    * seem to expect to catch & deal with them, so we'd best not.
    */
-  if (errno) {
-    strcpy (reason_for_failure, "ttrace (");
-    strcat (reason_for_failure, get_printable_name_of_ttrace_request (request));
-    strcat (reason_for_failure, ")");
-    printf( "ttrace error, errno = %d\n", errno );
-    perror_with_name (reason_for_failure);
-  }
+  if (errno)
+    {
+      strcpy (reason_for_failure, "ttrace (");
+      strcat (reason_for_failure, get_printable_name_of_ttrace_request (request));
+      strcat (reason_for_failure, ")");
+      printf ("ttrace error, errno = %d\n", errno);
+      perror_with_name (reason_for_failure);
+    }
 #endif
 
   return tt_status;
 }
-
 \f
+
 /* This function simply calls ttrace_wait with the given arguments.  
  * It exists so that all calls to ttrace_wait are isolated.
  *
  * No "raw" calls to ttrace_wait should exist elsewhere.
  */
 static int
-call_real_ttrace_wait( pid, tid, option, tsp, tsp_size )
-  int        pid;
-  lwpid_t    tid;
-  ttwopt_t   option;
-  ttstate_t *tsp;
-  size_t     tsp_size;
+call_real_ttrace_wait (pid, tid, option, tsp, tsp_size)
+     int pid;
+     lwpid_t tid;
+     ttwopt_t option;
+     ttstate_t *tsp;
+     size_t tsp_size;
 {
-  int        ttw_status;
-  thread_info *  tinfo = NULL;
+  int ttw_status;
+  thread_info *tinfo = NULL;
 
   errno = 0;
   ttw_status = ttrace_wait (pid, tid, option, tsp, tsp_size);
-  
-  if (errno) {
+
+  if (errno)
+    {
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "TW fail with pid %d, tid %d \n", pid, tid );
+      if (debug_on)
+       printf ("TW fail with pid %d, tid %d \n", pid, tid);
 #endif
 
       perror_with_name ("ttrace wait");
-  }
+    }
 
   return ttw_status;
 }
-
 \f
+
 /* A process may have one or more kernel threads, of which all or
    none may be stopped.  This function returns the ID of the first
    kernel thread in a stopped state, or 0 if none are stopped.
@@ -1334,44 +1398,46 @@ call_real_ttrace_wait( pid, tid, option, tsp, tsp_size )
  */
 static lwpid_t
 get_process_first_stopped_thread_id (pid, thread_state)
-  int  pid;
-  ttstate_t *  thread_state;
+     int pid;
+     ttstate_t *thread_state;
 {
-  int  tt_status;
+  int tt_status;
 
   tt_status = call_real_ttrace (
-                      TT_PROC_GET_FIRST_LWP_STATE,
-                      (pid_t) pid,
-                      (lwpid_t) TT_NIL,
-                      (TTRACE_ARG_TYPE) thread_state,
-                      (TTRACE_ARG_TYPE) sizeof (*thread_state),
-                      TT_NIL);
-                      
-  if (errno) {
-    if( errno == EPROTO) {
-        /* This is an error we can handle: there isn't any stopped
-         * thread.  This happens when we're re-starting the application
-         * and it has only one thread.  GET_NEXT handles the case of
-         * no more stopped threads well; GET_FIRST doesn't.  (A ttrace
-         * "feature".)
-         */
-        tt_status = 1;
-        errno     = 0;
-        return 0;
-    }
-    else
-        perror_with_name ("ttrace");
-  }
-  
-  if( tt_status < 0 )
+                                TT_PROC_GET_FIRST_LWP_STATE,
+                                (pid_t) pid,
+                                (lwpid_t) TT_NIL,
+                                (TTRACE_ARG_TYPE) thread_state,
+                                (TTRACE_ARG_TYPE) sizeof (*thread_state),
+                                TT_NIL);
+
+  if (errno)
+    {
+      if (errno == EPROTO)
+       {
+         /* This is an error we can handle: there isn't any stopped
+          * thread.  This happens when we're re-starting the application
+          * and it has only one thread.  GET_NEXT handles the case of
+          * no more stopped threads well; GET_FIRST doesn't.  (A ttrace
+          * "feature".)
+          */
+         tt_status = 1;
+         errno = 0;
+         return 0;
+       }
+      else
+       perror_with_name ("ttrace");
+    }
+
+  if (tt_status < 0)
     /* Failed somehow.
      */
     return 0;
 
   return thread_state->tts_lwpid;
 }
-
 \f
+
 /* This function returns the ID of the "next" kernel thread in a
    stopped state, or 0 if there are none.  "Next" refers to the
    thread following that of the last successful call to this
@@ -1383,18 +1449,18 @@ get_process_first_stopped_thread_id (pid, thread_state)
  */
 static lwpid_t
 get_process_next_stopped_thread_id (pid, thread_state)
-  int  pid;
-  ttstate_t *  thread_state;
+     int pid;
+     ttstate_t *thread_state;
 {
-  int  tt_status;
+  int tt_status;
 
   tt_status = call_real_ttrace (
-                      TT_PROC_GET_NEXT_LWP_STATE,
-                      (pid_t) pid,
-                      (lwpid_t) TT_NIL,
-                      (TTRACE_ARG_TYPE) thread_state,
-                      (TTRACE_ARG_TYPE) sizeof (*thread_state),
-                      TT_NIL);
+                                TT_PROC_GET_NEXT_LWP_STATE,
+                                (pid_t) pid,
+                                (lwpid_t) TT_NIL,
+                                (TTRACE_ARG_TYPE) thread_state,
+                                (TTRACE_ARG_TYPE) sizeof (*thread_state),
+                                TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 
@@ -1403,15 +1469,16 @@ get_process_next_stopped_thread_id (pid, thread_state)
      */
     return 0;
 
-  else if( tt_status == 0 ) {
-    /* End of list, no next state.  Don't return the
-     * tts_lwpid, as it's a meaningless "240".
-     *
-     * This is an HPUX "feature".
-     */
-    return 0;
-  }
-  
+  else if (tt_status == 0)
+    {
+      /* End of list, no next state.  Don't return the
+       * tts_lwpid, as it's a meaningless "240".
+       *
+       * This is an HPUX "feature".
+       */
+      return 0;
+    }
+
   return thread_state->tts_lwpid;
 }
 
@@ -1426,9 +1493,9 @@ get_process_next_stopped_thread_id (pid, thread_state)
  */
 static lwpid_t
 get_active_tid_of_pid (pid)
-  int  pid;
+     int pid;
 {
-  ttstate_t  thread_state;
+  ttstate_t thread_state;
 
   return get_process_first_stopped_thread_id (pid, &thread_state);
 }
@@ -1438,49 +1505,51 @@ get_active_tid_of_pid (pid)
  */
 int
 is_process_ttrace_request (tt_request)
-  ttreq_t  tt_request;
+     ttreq_t tt_request;
 {
   return IS_TTRACE_PROCREQ (tt_request);
 }
-
 \f
+
 /* This function translates a thread ttrace request into
  * the equivalent process request for a one-thread process.
  */
 static ttreq_t
-make_process_version( request )
-  ttreq_t request;
+make_process_version (request)
+     ttreq_t request;
 {
-  if (!IS_TTRACE_REQ (request)) {
-    error( "Internal error, bad ttrace request made\n" );
-    return -1;
-  }
+  if (!IS_TTRACE_REQ (request))
+    {
+      error ("Internal error, bad ttrace request made\n");
+      return -1;
+    }
 
-  switch (request) {
-    case TT_LWP_STOP :
+  switch (request)
+    {
+    case TT_LWP_STOP:
       return TT_PROC_STOP;
 
-    case TT_LWP_CONTINUE :
+    case TT_LWP_CONTINUE:
       return TT_PROC_CONTINUE;
 
-    case TT_LWP_GET_EVENT_MASK :
+    case TT_LWP_GET_EVENT_MASK:
       return TT_PROC_GET_EVENT_MASK;
 
-    case TT_LWP_SET_EVENT_MASK :
+    case TT_LWP_SET_EVENT_MASK:
       return TT_PROC_SET_EVENT_MASK;
 
-    case TT_LWP_SINGLE :
-    case TT_LWP_RUREGS :
-    case TT_LWP_WUREGS :
-    case TT_LWP_GET_STATE      :
-      return -1;       /* No equivalent */
+    case TT_LWP_SINGLE:
+    case TT_LWP_RUREGS:
+    case TT_LWP_WUREGS:
+    case TT_LWP_GET_STATE:
+      return -1;               /* No equivalent */
 
-    default :
+    default:
       return request;
-  }
+    }
 }
-
 \f
+
 /* This function translates the "pid" used by the rest of
  * gdb to a real pid and a tid.  It then calls "call_real_ttrace"
  * with the given arguments.
@@ -1491,34 +1560,38 @@ make_process_version( request )
  * reasons).
  */
 static int
-call_ttrace( request, gdb_tid, addr, data, addr2 )
-  ttreq_t  request;
-  int      gdb_tid;
-  TTRACE_ARG_TYPE  addr, data, addr2;
+call_ttrace (request, gdb_tid, addr, data, addr2)
+     ttreq_t request;
+     int gdb_tid;
+     TTRACE_ARG_TYPE addr, data, addr2;
 {
-  lwpid_t  real_tid;
-  int      real_pid;
-  ttreq_t  new_request;
-  int      tt_status;
-  char     reason_for_failure [100];  /* Arbitrary size, should be big enough. */
-  
+  lwpid_t real_tid;
+  int real_pid;
+  ttreq_t new_request;
+  int tt_status;
+  char reason_for_failure[100];        /* Arbitrary size, should be big enough. */
+
 #ifdef THREAD_DEBUG
-  int  is_interesting = 0;
+  int is_interesting = 0;
 
-  if( TT_LWP_RUREGS == request ) {
-     is_interesting = 1;          /* Adjust code here as desired */
-  }
-  
-  if( is_interesting && 0 && debug_on ) {
-      if( !is_process_ttrace_request( request )) {
-          printf( "TT: Thread request, tid is %d", gdb_tid );
-          printf( "== SINGLE at %x", addr );
-      }
-      else {
-          printf( "TT: Process request, tid is %d\n", gdb_tid );
-          printf( "==! SINGLE at %x", addr );
-      }
-  }
+  if (TT_LWP_RUREGS == request)
+    {
+      is_interesting = 1;      /* Adjust code here as desired */
+    }
+
+  if (is_interesting && 0 && debug_on)
+    {
+      if (!is_process_ttrace_request (request))
+       {
+         printf ("TT: Thread request, tid is %d", gdb_tid);
+         printf ("== SINGLE at %x", addr);
+       }
+      else
+       {
+         printf ("TT: Process request, tid is %d\n", gdb_tid);
+         printf ("==! SINGLE at %x", addr);
+       }
+    }
 #endif
 
   /* The initial SETTRC and SET_EVENT_MASK calls (and all others
@@ -1529,128 +1602,139 @@ call_ttrace( request, gdb_tid, addr, data, addr2 )
    * rule them out....
    */
 #ifdef THREAD_DEBUG
-  if( request == TT_PROC_SETTRC && debug_on )
-      printf( "Unexpected call for TT_PROC_SETTRC\n" );
+  if (request == TT_PROC_SETTRC && debug_on)
+    printf ("Unexpected call for TT_PROC_SETTRC\n");
 #endif
 
   /* Sometimes we get called with a bogus tid (e.g., if a
    * thread has terminated, we return 0; inftarg later asks
    * whether the thread has exited/forked/vforked).
    */
-  if( gdb_tid == 0 )
+  if (gdb_tid == 0)
     {
-      errno = ESRCH;  /* ttrace's response would probably be "No such process". */
+      errno = ESRCH;           /* ttrace's response would probably be "No such process". */
       return -1;
     }
 
   /* All other cases should be able to expect that there are
    * thread records.
    */
-  if( !any_thread_records()) {
+  if (!any_thread_records ())
+    {
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          warning ("No thread records for ttrace call");
+      if (debug_on)
+       warning ("No thread records for ttrace call");
 #endif
-      errno = ESRCH;  /* ttrace's response would be "No such process". */
+      errno = ESRCH;           /* ttrace's response would be "No such process". */
       return -1;
-  }
+    }
 
   /* OK, now the task is to translate the incoming tid into
    * a pid/tid pair.
    */
-  real_tid = map_from_gdb_tid( gdb_tid );
-  real_pid = get_pid_for( real_tid );
+  real_tid = map_from_gdb_tid (gdb_tid);
+  real_pid = get_pid_for (real_tid);
 
   /* Now check the result.  "Real_pid" is NULL if our list
    * didn't find it.  We have some tricks we can play to fix
    * this, however.
    */
-  if( 0 == real_pid ) {
-    ttstate_t  thread_state;
+  if (0 == real_pid)
+    {
+      ttstate_t thread_state;
 
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        printf( "No saved pid for tid %d\n", gdb_tid );
+      if (debug_on)
+       printf ("No saved pid for tid %d\n", gdb_tid);
 #endif
 
-    if( is_process_ttrace_request( request )) {
-     
-        /* Ok, we couldn't get a tid.  Try to translate to
-         * the equivalent process operation.  We expect this
-         * NOT to happen, so this is a desparation-type
-         * move.  It can happen if there is an internal
-         * error and so no "wait()" call is ever done.
-         */
-        new_request = make_process_version( request );
-        if( new_request == -1 ) {
-        
+      if (is_process_ttrace_request (request))
+       {
+
+         /* Ok, we couldn't get a tid.  Try to translate to
+          * the equivalent process operation.  We expect this
+          * NOT to happen, so this is a desparation-type
+          * move.  It can happen if there is an internal
+          * error and so no "wait()" call is ever done.
+          */
+         new_request = make_process_version (request);
+         if (new_request == -1)
+           {
+
 #ifdef THREAD_DEBUG
-            if( debug_on )
-                printf( "...and couldn't make process version of thread operation\n" );
+             if (debug_on)
+               printf ("...and couldn't make process version of thread operation\n");
 #endif
 
-            /* Use hacky saved pid, which won't always be correct
-             * in the multi-process future.  Use tid as thread,
-             * probably dooming this to failure.  FIX!
-             */
-            if( saved_real_pid != 0 ) {
+             /* Use hacky saved pid, which won't always be correct
+              * in the multi-process future.  Use tid as thread,
+              * probably dooming this to failure.  FIX!
+              */
+             if (saved_real_pid != 0)
+               {
 #ifdef THREAD_DEBUG
-                if( debug_on )
-                    printf( "...using saved pid %d\n", saved_real_pid );
+                 if (debug_on)
+                   printf ("...using saved pid %d\n", saved_real_pid);
 #endif
 
-                real_pid = saved_real_pid;
-                real_tid = gdb_tid;
-            }
+                 real_pid = saved_real_pid;
+                 real_tid = gdb_tid;
+               }
 
-            else
-                error( "Unable to perform thread operation" );
-        } 
+             else
+               error ("Unable to perform thread operation");
+           }
 
-        else {
-            /* Sucessfully translated this to a process request,
-             * which needs no thread value.
-             */
-            real_pid = gdb_tid;
-            real_tid = 0;
-            request  = new_request;
+         else
+           {
+             /* Sucessfully translated this to a process request,
+              * which needs no thread value.
+              */
+             real_pid = gdb_tid;
+             real_tid = 0;
+             request = new_request;
 
 #ifdef THREAD_DEBUG
-            if( debug_on ) {
-                printf( "Translated thread request to process request\n" );
-                if( saved_real_pid == 0 )
-                    printf( "...but there's no saved pid\n" );
-                
-                else {
-                    if( gdb_tid != saved_real_pid )
-                        printf( "...but have the wrong pid (%d rather than %d)\n",
-                                gdb_tid, saved_real_pid );
-                }
-            }
+             if (debug_on)
+               {
+                 printf ("Translated thread request to process request\n");
+                 if (saved_real_pid == 0)
+                   printf ("...but there's no saved pid\n");
+
+                 else
+                   {
+                     if (gdb_tid != saved_real_pid)
+                       printf ("...but have the wrong pid (%d rather than %d)\n",
+                               gdb_tid, saved_real_pid);
+                   }
+               }
 #endif
-        } /* Translated to a process request */
-    }     /* Is a process request */
+           }                   /* Translated to a process request */
+       }                       /* Is a process request */
 
-    else {
-        /* We have to have a thread.  Ooops.
-         */
-       error( "Thread request with no threads (%s)",
-               get_printable_name_of_ttrace_request( request ));
+      else
+       {
+         /* We have to have a thread.  Ooops.
+          */
+         error ("Thread request with no threads (%s)",
+                get_printable_name_of_ttrace_request (request));
+       }
     }
-  }
 
   /* Ttrace doesn't like to see tid values on process requests,
    * even if we have the right one.
    */
-  if (is_process_ttrace_request (request)) {
+  if (is_process_ttrace_request (request))
+    {
       real_tid = 0;
-  }
-  
+    }
+
 #ifdef THREAD_DEBUG
-  if( is_interesting && 0 && debug_on ) {
-    printf( "    now tid %d, pid %d\n", real_tid, real_pid );
-    printf( "    request is %s\n", get_printable_name_of_ttrace_request (request));
-  }
+  if (is_interesting && 0 && debug_on)
+    {
+      printf ("    now tid %d, pid %d\n", real_tid, real_pid);
+      printf ("    request is %s\n", get_printable_name_of_ttrace_request (request));
+    }
 #endif
 
   /* Finally, the (almost) real call.
@@ -1658,11 +1742,12 @@ call_ttrace( request, gdb_tid, addr, data, addr2 )
   tt_status = call_real_ttrace (request, real_pid, real_tid, addr, data, addr2);
 
 #ifdef THREAD_DEBUG
-  if(is_interesting && debug_on ) {
-    if( !TT_OK( tt_status, errno )
-    &&  !(tt_status == 0 & errno == 0))
-      printf( " got error (errno==%d, status==%d)\n", errno, tt_status );
-  }
+  if (is_interesting && debug_on)
+    {
+      if (!TT_OK (tt_status, errno)
+         && !(tt_status == 0 & errno == 0))
+       printf (" got error (errno==%d, status==%d)\n", errno, tt_status);
+    }
 #endif
 
   return tt_status;
@@ -1670,23 +1755,23 @@ call_ttrace( request, gdb_tid, addr, data, addr2 )
 
 
 /* Stop all the threads of a process.
- *
+
  * NOTE: use of TT_PROC_STOP can cause a thread with a real event
  *       to get a TTEVT_NONE event, discarding the old event.  Be
  *       very careful, and only call TT_PROC_STOP when you mean it!
  */
 static void
-stop_all_threads_of_process( real_pid )
-  pid_t  real_pid;
+stop_all_threads_of_process (real_pid)
+     pid_t real_pid;
 {
-  int  ttw_status;
+  int ttw_status;
 
   ttw_status = call_real_ttrace (TT_PROC_STOP,
-                                 (pid_t) real_pid,
-                                 (lwpid_t) TT_NIL,
-                                 (TTRACE_ARG_TYPE) TT_NIL,
-                                 (TTRACE_ARG_TYPE) TT_NIL,
-                                 TT_NIL );
+                                (pid_t) real_pid,
+                                (lwpid_t) TT_NIL,
+                                (TTRACE_ARG_TYPE) TT_NIL,
+                                (TTRACE_ARG_TYPE) TT_NIL,
+                                TT_NIL);
   if (errno)
     perror_with_name ("ttrace stop of other threads");
 }
@@ -1706,7 +1791,7 @@ stop_all_threads_of_process( real_pid )
    This function returns 1 if this stopped process, and the event that
    we're told was responsible for its current stopped state, cannot safely
    have its threads examined.
  */
+ */
 #define CHILD_VFORKED(evt,pid) \
   (((evt) == TTEVT_VFORK) && ((pid) != inferior_pid))
 #define CHILD_URPED(evt,pid) \
@@ -1716,8 +1801,8 @@ stop_all_threads_of_process( real_pid )
 
 static int
 can_touch_threads_of_process (pid, stopping_event)
-  int  pid;
-  ttevents_t  stopping_event;
+     int pid;
+     ttevents_t stopping_event;
 {
   if (CHILD_VFORKED (stopping_event, pid))
     {
@@ -1726,14 +1811,14 @@ can_touch_threads_of_process (pid, stopping_event)
     }
 
   else if (vfork_in_flight &&
-           (PARENT_VFORKED (stopping_event, pid) ||
-            CHILD_URPED (stopping_event, pid)))
+          (PARENT_VFORKED (stopping_event, pid) ||
+           CHILD_URPED (stopping_event, pid)))
     {
       vfork_in_flight = 0;
       vforking_child_pid = 0;
     }
 
-  return ! vfork_in_flight;
+  return !vfork_in_flight;
 }
 
 
@@ -1744,13 +1829,13 @@ can_touch_threads_of_process (pid, stopping_event)
  * If this function is used when the threads of PIS haven't
  * been stopped, undefined behaviour is guaranteed!
  */
-static int 
+static int
 select_stopped_thread_of_process (pid, tsp)
-  int  pid;
-  ttstate_t *  tsp;
+     int pid;
+     ttstate_t *tsp;
 {
-  lwpid_t    candidate_tid,    tid;
-  ttstate_t  candidate_tstate, tstate;
+  lwpid_t candidate_tid, tid;
+  ttstate_t candidate_tstate, tstate;
 
   /* If we're not allowed to touch the process now, then just
    * return the current value of *TSP.
@@ -1758,7 +1843,7 @@ select_stopped_thread_of_process (pid, tsp)
    * This supports "vfork".  It's ok, really, to double the
    * current event (the child EXEC, we hope!).
    */
-  if (! can_touch_threads_of_process (pid, tsp->tts_event))
+  if (!can_touch_threads_of_process (pid, tsp->tts_event))
     return 1;
 
   /* Decide which of (possibly more than one) events to
@@ -1774,9 +1859,10 @@ select_stopped_thread_of_process (pid, tsp)
        * an artifact of our "stop the world" model--the thread is
        * stopped because we stopped it.
        */
-      if (tstate.tts_event == TTEVT_NONE) {
-          set_handled( pid, tstate.tts_lwpid );
-      }
+      if (tstate.tts_event == TTEVT_NONE)
+       {
+         set_handled (pid, tstate.tts_lwpid);
+       }
 
       /* Did we just single-step a single thread, without letting any
        * of the others run?  Is this an event for that thread?
@@ -1787,25 +1873,25 @@ select_stopped_thread_of_process (pid, tsp)
        * checking for what all threads are doing.)
        */
       else if (doing_fake_step && (tstate.tts_lwpid == fake_step_tid))
-        {
+       {
 #ifdef WAIT_BUFFER_DEBUG
-          /* It's possible here to see either a SIGTRAP (due to
-           * successful completion of a step) or a SYSCALL_ENTRY
-           * (due to a step completion with active hardware
-           * watchpoints).
-           */
-           if( debug_on )
-               printf( "Ending fake step with tid %d, state %s\n",
-                       tstate.tts_lwpid,
-                       get_printable_name_of_ttrace_event( tstate.tts_event ));
-#endif 
-
-          /* Remember this one, and throw away any previous
-           * candidate.
-           */
-          candidate_tid    = tstate.tts_lwpid;
-          candidate_tstate = tstate;
-      }
+         /* It's possible here to see either a SIGTRAP (due to
+          * successful completion of a step) or a SYSCALL_ENTRY
+          * (due to a step completion with active hardware
+          * watchpoints).
+          */
+         if (debug_on)
+           printf ("Ending fake step with tid %d, state %s\n",
+                   tstate.tts_lwpid,
+                   get_printable_name_of_ttrace_event (tstate.tts_event));
+#endif
+
+         /* Remember this one, and throw away any previous
+          * candidate.
+          */
+         candidate_tid = tstate.tts_lwpid;
+         candidate_tstate = tstate;
+       }
 
 #ifdef FORGET_DELETED_BPTS
 
@@ -1823,33 +1909,35 @@ select_stopped_thread_of_process (pid, tsp)
        * But it has to go in the buffering code, not in the
        * real go/wait code.
        */
-      else if( (TTEVT_SIGNAL == tstate.tts_event)
-            && (5 == tstate.tts_u.tts_signal.tts_signo)
-            && (0 != get_raw_pc( tstate.tts_lwpid ))
-            && ! breakpoint_here_p( get_raw_pc( tstate.tts_lwpid )) ) {
-          /*
-           * If the user deleted a breakpoint while this
-           * breakpoint-hit event was buffered, we can forget
-           * it now.
-           */
+      else if ((TTEVT_SIGNAL == tstate.tts_event)
+              && (5 == tstate.tts_u.tts_signal.tts_signo)
+              && (0 != get_raw_pc (tstate.tts_lwpid))
+              && !breakpoint_here_p (get_raw_pc (tstate.tts_lwpid)))
+       {
+         /*
+          * If the user deleted a breakpoint while this
+          * breakpoint-hit event was buffered, we can forget
+          * it now.
+          */
 #ifdef WAIT_BUFFER_DEBUG
-           if( debug_on )
-               printf( "Forgetting deleted bp hit for thread %d\n",
-                       tstate.tts_lwpid );
-#endif 
+         if (debug_on)
+           printf ("Forgetting deleted bp hit for thread %d\n",
+                   tstate.tts_lwpid);
+#endif
 
-          set_handled( pid, tstate.tts_lwpid );
-      }
+         set_handled (pid, tstate.tts_lwpid);
+       }
 #endif
 
       /* Else, is this the first "unhandled" event?  If so,
        * we believe our client wants to see it (if we don't
        * see a fake-step later on in the scan).
        */
-      else if( !was_handled( tstate.tts_lwpid ) && candidate_tid == 0 ) {
-          candidate_tid    = tstate.tts_lwpid;
-          candidate_tstate = tstate;
-      }
+      else if (!was_handled (tstate.tts_lwpid) && candidate_tid == 0)
+       {
+         candidate_tid = tstate.tts_lwpid;
+         candidate_tstate = tstate;
+       }
 
       /* This is either an event that has already been "handled",
        * and thus we believe is uninteresting to our client, or we
@@ -1859,90 +1947,102 @@ select_stopped_thread_of_process (pid, tsp)
 
   /* What do we report?
    */
-  if( doing_fake_step ) {
-      if( candidate_tid == fake_step_tid ) {
-          /* Fake step.
-           */
-          tstate = candidate_tstate;
-      }
-      else {
-          warning( "Internal error: fake-step failed to complete." );
-          return 0;
-      }
-  }
-  else if( candidate_tid != 0 ) {
+  if (doing_fake_step)
+    {
+      if (candidate_tid == fake_step_tid)
+       {
+         /* Fake step.
+          */
+         tstate = candidate_tstate;
+       }
+      else
+       {
+         warning ("Internal error: fake-step failed to complete.");
+         return 0;
+       }
+    }
+  else if (candidate_tid != 0)
+    {
       /* Found a candidate unhandled event.
        */
       tstate = candidate_tstate;
-  }
-  else if( tid != 0 ) {
-      warning( "Internal error in call of ttrace_wait." );
+    }
+  else if (tid != 0)
+    {
+      warning ("Internal error in call of ttrace_wait.");
       return 0;
-  }
-  else {
+    }
+  else
+    {
       warning ("Internal error: no unhandled thread event to select");
       return 0;
-  }
+    }
 
   copy_ttstate_t (tsp, &tstate);
   return 1;
-} /* End of select_stopped_thread_of_process */
+}                              /* End of select_stopped_thread_of_process */
 
 #ifdef PARANOIA
 /* Check our internal thread data against the real thing.
  */
 static void
-check_thread_consistency( real_pid )
-    pid_t real_pid;
+check_thread_consistency (real_pid)
+     pid_t real_pid;
 {
-    int          tid;       /* really lwpid_t */
-    ttstate_t    tstate;
-    thread_info *p;
+  int tid;                     /* really lwpid_t */
+  ttstate_t tstate;
+  thread_info *p;
 
-    /* Spin down the O/S list of threads, checking that they
-     * match what we've got.
-     */
-    for (tid = get_process_first_stopped_thread_id( real_pid, &tstate );
-         tid != 0;
-         tid = get_process_next_stopped_thread_id(  real_pid, &tstate )) {
-       
-        p = find_thread_info( tid );
-      
-        if( NULL == p ) {
-            warning( "No internal thread data for thread %d.", tid );
-            continue;
-        }
+  /* Spin down the O/S list of threads, checking that they
+   * match what we've got.
+   */
+  for (tid = get_process_first_stopped_thread_id (real_pid, &tstate);
+       tid != 0;
+       tid = get_process_next_stopped_thread_id (real_pid, &tstate))
+    {
 
-        if( !p->seen ) {
-            warning( "Inconsistent internal thread data for thread %d.", tid );
-        }
+      p = find_thread_info (tid);
 
-        if( p->terminated ) {
-            warning( "Thread %d is not terminated, internal error.", tid );
-            continue;
-        }
+      if (NULL == p)
+       {
+         warning ("No internal thread data for thread %d.", tid);
+         continue;
+       }
+
+      if (!p->seen)
+       {
+         warning ("Inconsistent internal thread data for thread %d.", tid);
+       }
+
+      if (p->terminated)
+       {
+         warning ("Thread %d is not terminated, internal error.", tid);
+         continue;
+       }
 
 
 #define TT_COMPARE( fld ) \
             tstate.fld != p->last_stop_state.fld
-            
-        if( p->have_state ) {
-            if( TT_COMPARE( tts_pid      )
-             || TT_COMPARE( tts_lwpid    )
-             || TT_COMPARE( tts_user_tid )
-             || TT_COMPARE( tts_event    )
-             || TT_COMPARE( tts_flags    )
-             || TT_COMPARE( tts_scno     )
-             || TT_COMPARE( tts_scnargs  )) {
-                warning( "Internal thread data for thread %d is wrong.", tid );
-                continue;
-            }
-        }
+
+      if (p->have_state)
+       {
+         if (TT_COMPARE (tts_pid)
+             || TT_COMPARE (tts_lwpid)
+             || TT_COMPARE (tts_user_tid)
+             || TT_COMPARE (tts_event)
+             || TT_COMPARE (tts_flags)
+             || TT_COMPARE (tts_scno)
+             || TT_COMPARE (tts_scnargs))
+           {
+             warning ("Internal thread data for thread %d is wrong.", tid);
+             continue;
+           }
+       }
     }
 }
-#endif  /* PARANOIA */
-
+#endif /* PARANOIA */
 \f
+
 /* This function wraps calls to "call_real_ttrace_wait" so
  * that a actual wait is only done when all pending events
  * have been reported.
@@ -1953,11 +2053,11 @@ check_thread_consistency( real_pid )
  * Return value is the status of the pseudo wait.
  */
 static int
-call_ttrace_wait( pid, option, tsp, tsp_size )
-  int        pid;
-  ttwopt_t   option;
-  ttstate_t *tsp;
-  size_t     tsp_size;
+call_ttrace_wait (pid, option, tsp, tsp_size)
+     int pid;
+     ttwopt_t option;
+     ttstate_t *tsp;
+     size_t tsp_size;
 {
   /* This holds the actual, for-real, true process ID.
    */
@@ -1967,35 +2067,36 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
    * means "Any process", and zero tid means
    * "Any thread of the specified process".
    */
-  int      wait_pid = 0;
-  lwpid_t  wait_tid = 0;
-  lwpid_t  real_tid;
+  int wait_pid = 0;
+  lwpid_t wait_tid = 0;
+  lwpid_t real_tid;
 
-  int       ttw_status = 0;   /* To be returned */
+  int ttw_status = 0;          /* To be returned */
 
-  thread_info *  tinfo = NULL;
+  thread_info *tinfo = NULL;
 
-  if( pid != 0 ) {
+  if (pid != 0)
+    {
       /* Unexpected case.
        */
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "TW: Pid to wait on is %d\n", pid );
+      if (debug_on)
+       printf ("TW: Pid to wait on is %d\n", pid);
 #endif
 
-      if( !any_thread_records())
-          error( "No thread records for ttrace call w. specific pid" );
+      if (!any_thread_records ())
+       error ("No thread records for ttrace call w. specific pid");
 
       /* OK, now the task is to translate the incoming tid into
        * a pid/tid pair.
        */
-      real_tid = map_from_gdb_tid( pid );
-      real_pid = get_pid_for( real_tid );
+      real_tid = map_from_gdb_tid (pid);
+      real_pid = get_pid_for (real_tid);
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "==TW: real pid %d, real tid %d\n", real_pid, real_tid );
+      if (debug_on)
+       printf ("==TW: real pid %d, real tid %d\n", real_pid, real_tid);
 #endif
-  }
+    }
 
 
   /* Sanity checks and set-up.
@@ -2009,73 +2110,85 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
    *  Buffered events     |  debuffer  error      wait      debuffer (?)
    *
    */
-  if( more_events_left == 0 ) {
-
-      if( process_state == RUNNING ) {
-          /* OK--normal call of ttrace_wait with no buffered events.
-           */
-          ;
-      }
-      else if( process_state == FAKE_STEPPING ) {
-          /* Ok--call of ttrace_wait to support
-           * fake stepping with no buffered events.
-           *
-           * But we better be fake-stepping!
-           */
-          if( !doing_fake_step ) {
-              warning( "Inconsistent thread state." );
-          }
-      }
-      else if( (process_state == FORKING)
-            || (process_state == VFORKING)) {
-          /* Ok--there are two processes, so waiting
-           * for the second while the first is stopped
-           * is ok.  Handled bits stay as they were.
-           */
-           ;
-      }
-      else if( process_state == STOPPED ) {
-          warning( "Process not running at wait call." );
-      }
+  if (more_events_left == 0)
+    {
+
+      if (process_state == RUNNING)
+       {
+         /* OK--normal call of ttrace_wait with no buffered events.
+          */
+         ;
+       }
+      else if (process_state == FAKE_STEPPING)
+       {
+         /* Ok--call of ttrace_wait to support
+          * fake stepping with no buffered events.
+          *
+          * But we better be fake-stepping!
+          */
+         if (!doing_fake_step)
+           {
+             warning ("Inconsistent thread state.");
+           }
+       }
+      else if ((process_state == FORKING)
+              || (process_state == VFORKING))
+       {
+         /* Ok--there are two processes, so waiting
+          * for the second while the first is stopped
+          * is ok.  Handled bits stay as they were.
+          */
+         ;
+       }
+      else if (process_state == STOPPED)
+       {
+         warning ("Process not running at wait call.");
+       }
       else
-          /* No known state.
-           */
-          warning( "Inconsistent process state." );
-  }
-  
-  else {
+       /* No known state.
+        */
+       warning ("Inconsistent process state.");
+    }
+
+  else
+    {
       /* More events left
        */
-      if( process_state == STOPPED ) {
-          /* OK--buffered events being unbuffered.
-           */
-          ;
-      }
-      else if( process_state == RUNNING ) {
-          /* An error--shouldn't have buffered events
-           * when running.
-           */
-          warning( "Trying to continue with buffered events:" );
-      }
-      else if( process_state == FAKE_STEPPING ) {
-          /*
-           * Better be fake-stepping!
-           */
-          if( !doing_fake_step ) {
-              warning( "Losing buffered thread events!\n" );
-          }
-      }
-      else if( (process_state == FORKING)
-            || (process_state == VFORKING)) {
-          /* Ok--there are two processes, so waiting
-           * for the second while the first is stopped
-           * is ok.  Handled bits stay as they were.
-           */
-           ;
-      }
+      if (process_state == STOPPED)
+       {
+         /* OK--buffered events being unbuffered.
+          */
+         ;
+       }
+      else if (process_state == RUNNING)
+       {
+         /* An error--shouldn't have buffered events
+          * when running.
+          */
+         warning ("Trying to continue with buffered events:");
+       }
+      else if (process_state == FAKE_STEPPING)
+       {
+         /*
+          * Better be fake-stepping!
+          */
+         if (!doing_fake_step)
+           {
+             warning ("Losing buffered thread events!\n");
+           }
+       }
+      else if ((process_state == FORKING)
+              || (process_state == VFORKING))
+       {
+         /* Ok--there are two processes, so waiting
+          * for the second while the first is stopped
+          * is ok.  Handled bits stay as they were.
+          */
+         ;
+       }
       else
-          warning( "Process in unknown state with buffered events." );
-  }
+       warning ("Process in unknown state with buffered events.");
+    }
 
   /* Sometimes we have to wait for a particular thread
    * (if we're stepping over a bpt).  In that case, we
@@ -2084,19 +2197,21 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
    * certain very well-understood circumstances), so it
    * can't block.
    */
-  if( doing_fake_step ) {
+  if (doing_fake_step)
+    {
       wait_tid = fake_step_tid;
-      wait_pid = get_pid_for( fake_step_tid );
+      wait_pid = get_pid_for (fake_step_tid);
 
 #ifdef WAIT_BUFFER_DEBUG
-      if( debug_on )
-          printf( "Doing a wait after a fake-step for %d, pid %d\n",
-                  wait_tid, wait_pid );
+      if (debug_on)
+       printf ("Doing a wait after a fake-step for %d, pid %d\n",
+               wait_tid, wait_pid);
 #endif
-  }
+    }
 
-  if( more_events_left == 0         /* No buffered events, need real ones. */
-  ||  process_state != STOPPED ) {
+  if (more_events_left == 0    /* No buffered events, need real ones. */
+      || process_state != STOPPED)
+    {
       /* If there are no buffered events, and so we need
        * real ones, or if we are FORKING, VFORKING, 
        * FAKE_STEPPING or RUNNING, and thus have to do
@@ -2105,13 +2220,13 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
 
 #ifdef WAIT_BUFFER_DEBUG
       /* Normal case... */
-      if( debug_on )
-          printf( "TW: do it for real; pid %d, tid %d\n", wait_pid, wait_tid );
+      if (debug_on)
+       printf ("TW: do it for real; pid %d, tid %d\n", wait_pid, wait_tid);
 #endif
 
       /* The actual wait call.
        */
-      ttw_status = call_real_ttrace_waitwait_pid, wait_tid, option, tsp, tsp_size);
+      ttw_status = call_real_ttrace_wait (wait_pid, wait_tid, option, tsp, tsp_size);
 
       /* Note that the routines we'll call will be using "call_real_ttrace",
        * not "call_ttrace", and thus need the real pid rather than the pseudo-tid
@@ -2120,96 +2235,101 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
       real_pid = tsp->tts_pid;
 
       /* For most events: Stop the world!
-       *
+
        * It's sometimes not safe to stop all threads of a process.
        * Sometimes it's not even safe to ask for the thread state
        * of a process!
        */
       if (can_touch_threads_of_process (real_pid, tsp->tts_event))
-        {
-          /* If we're really only stepping a single thread, then don't
-           * try to stop all the others -- we only do this single-stepping
-           * business when all others were already stopped...and the stop
-           * would mess up other threads' events.
-           *
-           * Similiarly, if there are other threads with events,
-           * don't do the stop.
-           */
-          if( !doing_fake_step ) {
-            if( more_events_left > 0 )
-                warning( "Internal error in stopping process" );
-                
-            stop_all_threads_of_process (real_pid);
-
-            /* At this point, we could scan and update_thread_list(),
-             * and only use the local list for the rest of the
-             * module! We'd get rid of the scans in the various
-             * continue routines (adding one in attach).  It'd
-             * be great--UPGRADE ME!
-             */
-            }
-        }
-        
+       {
+         /* If we're really only stepping a single thread, then don't
+          * try to stop all the others -- we only do this single-stepping
+          * business when all others were already stopped...and the stop
+          * would mess up other threads' events.
+          *
+          * Similiarly, if there are other threads with events,
+          * don't do the stop.
+          */
+         if (!doing_fake_step)
+           {
+             if (more_events_left > 0)
+               warning ("Internal error in stopping process");
+
+             stop_all_threads_of_process (real_pid);
+
+             /* At this point, we could scan and update_thread_list(),
+              * and only use the local list for the rest of the
+              * module! We'd get rid of the scans in the various
+              * continue routines (adding one in attach).  It'd
+              * be great--UPGRADE ME!
+              */
+           }
+       }
+
 #ifdef PARANOIA
-      else if( debug_on ) {
-          if( more_events_left > 0 )
-              printf( "== Can't stop process; more events!\n" );
-          else
-              printf( "== Can't stop process!\n" );
-      }
+      else if (debug_on)
+       {
+         if (more_events_left > 0)
+           printf ("== Can't stop process; more events!\n");
+         else
+           printf ("== Can't stop process!\n");
+       }
 #endif
 
-      process_state   = STOPPED;
+      process_state = STOPPED;
 
 #ifdef WAIT_BUFFER_DEBUG
-      if( debug_on )
-          printf( "Process set to STOPPED\n" );
+      if (debug_on)
+       printf ("Process set to STOPPED\n");
 #endif
-  }
-  
-  else {
+    }
+
+  else
+    {
       /* Fake a call to ttrace_wait.  The process must be
        * STOPPED, as we aren't going to do any wait.
        */
 #ifdef WAIT_BUFFER_DEBUG
-      if( debug_on )
-          printf( "TW: fake it\n" );
+      if (debug_on)
+       printf ("TW: fake it\n");
 #endif
 
-      if( process_state != STOPPED ) {
-          warning( "Process not stopped at wait call, in state '%s'.\n",
-                   get_printable_name_of_process_state( process_state ));
-      }
-    
-      if( doing_fake_step )
-          error( "Internal error in stepping over breakpoint" );
+      if (process_state != STOPPED)
+       {
+         warning ("Process not stopped at wait call, in state '%s'.\n",
+                  get_printable_name_of_process_state (process_state));
+       }
+
+      if (doing_fake_step)
+       error ("Internal error in stepping over breakpoint");
 
-      ttw_status = 0;  /* Faking it is always successful! */
-  }   /* End of fake or not? if */
+      ttw_status = 0;          /* Faking it is always successful! */
+    }                          /* End of fake or not? if */
 
   /* Pick an event to pass to our caller.  Be paranoid.
    */
-  if( !select_stopped_thread_of_process( real_pid, tsp ))
-      warning( "Can't find event, using previous event." );
+  if (!select_stopped_thread_of_process (real_pid, tsp))
+    warning ("Can't find event, using previous event.");
+
+  else if (tsp->tts_event == TTEVT_NONE)
+    warning ("Internal error: no thread has a real event.");
 
-  else if( tsp->tts_event == TTEVT_NONE )
-      warning( "Internal error: no thread has a real event." );
+  else if (doing_fake_step)
+    {
+      if (fake_step_tid != tsp->tts_lwpid)
+       warning ("Internal error in stepping over breakpoint.");
 
-  else if( doing_fake_step ) {
-      if( fake_step_tid != tsp->tts_lwpid )
-          warning( "Internal error in stepping over breakpoint." );
-          
       /* This wait clears the (current) fake-step if there was one.
        */
       doing_fake_step = 0;
-      fake_step_tid   = 0;
-  }
+      fake_step_tid = 0;
+    }
 
   /* We now have a correct tsp and ttw_status for the thread
    * which we want to report.  So it's "handled"!  This call
    * will add it to our list if it's not there already.
    */
-  set_handled( real_pid, tsp->tts_lwpid );
+  set_handled (real_pid, tsp->tts_lwpid);
 
   /* Save a copy of the ttrace state of this thread, in our local
      thread descriptor.
@@ -2223,24 +2343,25 @@ call_ttrace_wait( pid, option, tsp, tsp_size )
      it into our list of threads.)
    */
   tinfo = find_thread_info (tsp->tts_lwpid);
-  if (tinfo != NULL) {
-    copy_ttstate_t (&tinfo->last_stop_state, tsp);
-    tinfo->have_state = 1;
-  }
-  
+  if (tinfo != NULL)
+    {
+      copy_ttstate_t (&tinfo->last_stop_state, tsp);
+      tinfo->have_state = 1;
+    }
+
   return ttw_status;
-} /* call_ttrace_wait */
+}                              /* call_ttrace_wait */
 
 #if defined(CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL)
 int
 child_reported_exec_events_per_exec_call ()
 {
-  return 1;  /* ttrace reports the event once per call. */
+  return 1;                    /* ttrace reports the event once per call. */
 }
 #endif
+\f
 
 
-\f
 /* Our implementation of hardware watchpoints involves making memory
    pages write-protected.  We must remember a page's original permissions,
    and we must also know when it is appropriate to restore a page's
@@ -2258,30 +2379,34 @@ child_reported_exec_events_per_exec_call ()
    page X, its reference count is decremented.  If a page's reference
    count drops to 0, it's permissions are restored and the page's entry
    is thrown out of the dictionary.
-   */
-typedef struct memory_page {
-  CORE_ADDR  page_start;
-  int  reference_count;
-  int  original_permissions;
-  struct memory_page *  next;
-  struct memory_page *  previous;
-} memory_page_t;
+ */
+typedef struct memory_page
+{
+  CORE_ADDR page_start;
+  int reference_count;
+  int original_permissions;
+  struct memory_page *next;
+  struct memory_page *previous;
+}
+memory_page_t;
 
 #define MEMORY_PAGE_DICTIONARY_BUCKET_COUNT  128
 
-static struct {
-  LONGEST  page_count;
-  int  page_size;
-  int  page_protections_allowed;
-  /* These are just the heads of chains of actual page descriptors. */
-  memory_page_t  buckets [MEMORY_PAGE_DICTIONARY_BUCKET_COUNT];
-} memory_page_dictionary;
+static struct
+  {
+    LONGEST page_count;
+    int page_size;
+    int page_protections_allowed;
+    /* These are just the heads of chains of actual page descriptors. */
+    memory_page_t buckets[MEMORY_PAGE_DICTIONARY_BUCKET_COUNT];
+  }
+memory_page_dictionary;
 
 
 static void
 require_memory_page_dictionary ()
 {
-  int  i;
+  int i;
 
   /* Is the memory page dictionary ready for use?  If so, we're done. */
   if (memory_page_dictionary.page_count >= (LONGEST) 0)
@@ -2290,7 +2415,7 @@ require_memory_page_dictionary ()
   /* Else, initialize it. */
   memory_page_dictionary.page_count = (LONGEST) 0;
 
-  for (i=0; i<MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; i++)
+  for (i = 0; i < MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; i++)
     {
       memory_page_dictionary.buckets[i].page_start = (CORE_ADDR) 0;
       memory_page_dictionary.buckets[i].reference_count = 0;
@@ -2303,7 +2428,7 @@ require_memory_page_dictionary ()
 static void
 retire_memory_page_dictionary ()
 {
-  memory_page_dictionary.page_count = (LONGEST) -1;
+  memory_page_dictionary.page_count = (LONGEST) - 1;
 }
 
 
@@ -2313,21 +2438,21 @@ retire_memory_page_dictionary ()
  */
 static int
 write_protect_page (pid, page_start)
-  int       pid;
-  CORE_ADDR page_start;
+     int pid;
+     CORE_ADDR page_start;
 {
-  int  tt_status;
-  int  original_permissions;
-  int  new_permissions;
+  int tt_status;
+  int original_permissions;
+  int new_permissions;
 
   tt_status = call_ttrace (TT_PROC_GET_MPROTECT,
-                           pid,
-                           (TTRACE_ARG_TYPE) page_start,
-                           TT_NIL,
-                           (TTRACE_ARG_TYPE) &original_permissions);
+                          pid,
+                          (TTRACE_ARG_TYPE) page_start,
+                          TT_NIL,
+                          (TTRACE_ARG_TYPE) & original_permissions);
   if (errno || (tt_status < 0))
     {
-      return 0;  /* What else can we do? */
+      return 0;                        /* What else can we do? */
     }
 
   /* We'll also write-protect the page now, if that's allowed. */
@@ -2335,14 +2460,14 @@ write_protect_page (pid, page_start)
     {
       new_permissions = original_permissions & ~PROT_WRITE;
       tt_status = call_ttrace (TT_PROC_SET_MPROTECT,
-                               pid,
-                               (TTRACE_ARG_TYPE) page_start,
-                               (TTRACE_ARG_TYPE) memory_page_dictionary.page_size,
-                               (TTRACE_ARG_TYPE) new_permissions);
+                              pid,
+                              (TTRACE_ARG_TYPE) page_start,
+                        (TTRACE_ARG_TYPE) memory_page_dictionary.page_size,
+                              (TTRACE_ARG_TYPE) new_permissions);
       if (errno || (tt_status < 0))
-        {
-          return 0;  /* What else can we do? */
-        }
+       {
+         return 0;             /* What else can we do? */
+       }
     }
 
   return original_permissions;
@@ -2351,23 +2476,23 @@ write_protect_page (pid, page_start)
 
 /* Unwrite-protect the memory page that starts at this address, restoring
    (what we must assume are) its original permissions.
  */
+ */
 static void
 unwrite_protect_page (pid, page_start, original_permissions)
-  int  pid;
-  CORE_ADDR  page_start;
-  int  original_permissions;
+     int pid;
+     CORE_ADDR page_start;
+     int original_permissions;
 {
-  int  tt_status;
+  int tt_status;
 
   tt_status = call_ttrace (TT_PROC_SET_MPROTECT,
-                           pid,
-                           (TTRACE_ARG_TYPE) page_start,
-                           (TTRACE_ARG_TYPE) memory_page_dictionary.page_size,
-                           (TTRACE_ARG_TYPE) original_permissions);
+                          pid,
+                          (TTRACE_ARG_TYPE) page_start,
+                        (TTRACE_ARG_TYPE) memory_page_dictionary.page_size,
+                          (TTRACE_ARG_TYPE) original_permissions);
   if (errno || (tt_status < 0))
     {
-      return;  /* What else can we do? */
+      return;                  /* What else can we do? */
     }
 }
 
@@ -2377,25 +2502,25 @@ unwrite_protect_page (pid, page_start, original_permissions)
 
    For every memory page that is currently being watched (i.e., that
    presently should be write-protected), write-protect it.
  */
+ */
 void
 hppa_enable_page_protection_events (pid)
-  int  pid;
+     int pid;
 {
-  int  bucket;
+  int bucket;
 
   memory_page_dictionary.page_protections_allowed = 1;
 
-  for (bucket=0; bucket<MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; bucket++)
+  for (bucket = 0; bucket < MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; bucket++)
     {
-      memory_page_t *  page;
+      memory_page_t *page;
 
       page = memory_page_dictionary.buckets[bucket].next;
       while (page != NULL)
-        {
-          page->original_permissions = write_protect_page (pid, page->page_start);
-          page = page->next;
-        }
+       {
+         page->original_permissions = write_protect_page (pid, page->page_start);
+         page = page->next;
+       }
     }
 }
 
@@ -2405,23 +2530,23 @@ hppa_enable_page_protection_events (pid)
 
    For every memory page that is currently being watched (i.e., that
    presently is or should be write-protected), un-write-protect it.
  */
+ */
 void
 hppa_disable_page_protection_events (pid)
-  int  pid;
+     int pid;
 {
-  int  bucket;
+  int bucket;
 
-  for (bucket=0; bucket<MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; bucket++)
+  for (bucket = 0; bucket < MEMORY_PAGE_DICTIONARY_BUCKET_COUNT; bucket++)
     {
-      memory_page_t *  page;
+      memory_page_t *page;
 
       page = memory_page_dictionary.buckets[bucket].next;
       while (page != NULL)
-        {
-          unwrite_protect_page (pid, page->page_start, page->original_permissions);
-          page = page->next;
-        }
+       {
+         unwrite_protect_page (pid, page->page_start, page->original_permissions);
+         page = page->next;
+       }
     }
 
   memory_page_dictionary.page_protections_allowed = 0;
@@ -2435,88 +2560,93 @@ hppa_disable_page_protection_events (pid)
  * Note: we could just scan our own thread list.  FIXME!
  */
 static int
-count_unhandled_events( real_pid, real_tid )
-  int     real_pid;
-  lwpid_t real_tid;
+count_unhandled_events (real_pid, real_tid)
+     int real_pid;
+     lwpid_t real_tid;
 {
-  ttstate_t  tstate;
-  lwpid_t    ttid;
-  int        events_left;
-  
+  ttstate_t tstate;
+  lwpid_t ttid;
+  int events_left;
+
   /* Ok, find out how many threads have real events to report.
    */
   events_left = 0;
-  ttid = get_process_first_stopped_thread_id( real_pid, &tstate );
+  ttid = get_process_first_stopped_thread_id (real_pid, &tstate);
 
 #ifdef THREAD_DEBUG
-  if( debug_on ) {
-      if( ttid == 0 )
-          printf( "Process %d has no threads\n", real_pid );
+  if (debug_on)
+    {
+      if (ttid == 0)
+       printf ("Process %d has no threads\n", real_pid);
       else
-          printf( "Process %d has these threads:\n", real_pid );
-  }
+       printf ("Process %d has these threads:\n", real_pid);
+    }
 #endif
 
-  while (ttid > 0 ) {
-      if( tstate.tts_event != TTEVT_NONE
-      &&  !was_handled( ttid )) {
-          /* TTEVT_NONE implies we just stopped it ourselves
-           * because we're the stop-the-world guys, so it's
-           * not an event from our point of view.
-           *
-           * If "was_handled" is true, this is an event we
-           * already handled, so don't count it.
-           *
-           * Note that we don't count the thread with the
-           * currently-reported event, as it's already marked
-           * as handled.
-           */
-          events_left++;
-      }
-         
+  while (ttid > 0)
+    {
+      if (tstate.tts_event != TTEVT_NONE
+         && !was_handled (ttid))
+       {
+         /* TTEVT_NONE implies we just stopped it ourselves
+          * because we're the stop-the-world guys, so it's
+          * not an event from our point of view.
+          *
+          * If "was_handled" is true, this is an event we
+          * already handled, so don't count it.
+          *
+          * Note that we don't count the thread with the
+          * currently-reported event, as it's already marked
+          * as handled.
+          */
+         events_left++;
+       }
+
 #if defined( THREAD_DEBUG ) || defined( WAIT_BUFFER_DEBUG )
-  if( debug_on ) {
-      if( ttid == real_tid )
-          printf( "*" );         /* Thread we're reporting */
-      else
-          printf( " " );
-         
-      if( tstate.tts_event != TTEVT_NONE )
-          printf( "+" );         /* Thread with a real event */
-      else
-          printf( " " );
+      if (debug_on)
+       {
+         if (ttid == real_tid)
+           printf ("*");       /* Thread we're reporting */
+         else
+           printf (" ");
+
+         if (tstate.tts_event != TTEVT_NONE)
+           printf ("+");       /* Thread with a real event */
+         else
+           printf (" ");
+
+         if (was_handled (ttid))
+           printf ("h");       /* Thread has been handled */
+         else
+           printf (" ");
+
+         printf (" %d, with event %s", ttid,
+                 get_printable_name_of_ttrace_event (tstate.tts_event));
+
+         if (tstate.tts_event == TTEVT_SIGNAL
+             && 5 == tstate.tts_u.tts_signal.tts_signo)
+           {
+             CORE_ADDR pc_val;
 
-      if( was_handled( ttid ))
-          printf( "h" );         /* Thread has been handled */
-      else
-          printf( " " );
-         
-      printf( " %d, with event %s", ttid,
-              get_printable_name_of_ttrace_event( tstate.tts_event ));
-              
-      if( tstate.tts_event == TTEVT_SIGNAL
-       && 5 == tstate.tts_u.tts_signal.tts_signo ) {
-          CORE_ADDR pc_val;
-
-          pc_val = get_raw_pc( ttid );
-
-          if( pc_val > 0 )
-              printf( " breakpoint at 0x%x\n", pc_val );
-          else
-              printf( " bpt, can't fetch pc.\n" );
-      }
-      else
-          printf( "\n" );
-  }
+             pc_val = get_raw_pc (ttid);
+
+             if (pc_val > 0)
+               printf (" breakpoint at 0x%x\n", pc_val);
+             else
+               printf (" bpt, can't fetch pc.\n");
+           }
+         else
+           printf ("\n");
+       }
 #endif
 
       ttid = get_process_next_stopped_thread_id (real_pid, &tstate);
-  }
+    }
 
 #if defined( THREAD_DEBUG ) || defined( WAIT_BUFFER_DEBUG )
-  if( debug_on )
-      if( events_left > 0 )
-          printf( "There are thus %d pending events\n", events_left );
+  if (debug_on)
+    if (events_left > 0)
+      printf ("There are thus %d pending events\n", events_left);
 #endif
 
   return events_left;
@@ -2531,36 +2661,36 @@ count_unhandled_events( real_pid, real_tid )
  */
 int
 ptrace_wait (pid, status)
-    int pid;
-    int *status;
+     int pid;
+     int *status;
 {
-  ttstate_t  tsp;
-  int        ttwait_return;
-  int        real_pid;
-  ttstate_t  state;
-  lwpid_t    real_tid;
-  int  return_pid;
+  ttstate_t tsp;
+  int ttwait_return;
+  int real_pid;
+  ttstate_t state;
+  lwpid_t real_tid;
+  int return_pid;
 
   /* The ptrace implementation of this also ignores pid.
    */
   *status = 0;
 
-  ttwait_return = call_ttrace_wait( 0, TTRACE_WAITOK, &tsp, sizeof (tsp) );
+  ttwait_return = call_ttrace_wait (0, TTRACE_WAITOK, &tsp, sizeof (tsp));
   if (ttwait_return < 0)
     {
       /* ??rehrauer: It appears that if our inferior exits and we
          haven't asked for exit events, that we're not getting any
          indication save a negative return from ttrace_wait and an
          errno set to ESRCH?
-         */
+       */
       if (errno == ESRCH)
-        {
-          *status = 0;  /* WIFEXITED */
-          return inferior_pid;
-        }
+       {
+         *status = 0;          /* WIFEXITED */
+         return inferior_pid;
+       }
 
-      warning"Call of ttrace_wait returned with errno %d.",
-               errno );
+      warning ("Call of ttrace_wait returned with errno %d.",
+              errno);
       *status = ttwait_return;
       return inferior_pid;
     }
@@ -2573,73 +2703,77 @@ ptrace_wait (pid, status)
    * either have to force an order (as we do here), or handle
    * more than one flag at a time.
    */
-  if (tsp.tts_event & TTEVT_LWP_CREATE) {
-
-     /* Unlike what you might expect, this event is reported in
-      * the _creating_ thread, and the _created_ thread (whose tid
-      * we have) is still running.  So we have to stop it.  This
-      * has already been done in "call_ttrace_wait", but should we
-      * ever abandon the "stop-the-world" model, here's the command
-      * to use:
-      *
-      *    call_ttrace( TT_LWP_STOP, real_tid, TT_NIL, TT_NIL, TT_NIL );
-      *
-      * Note that this would depend on being called _after_ "add_tthread"
-      * below for the tid-to-pid translation to be done in "call_ttrace".
-      */
+  if (tsp.tts_event & TTEVT_LWP_CREATE)
+    {
+
+      /* Unlike what you might expect, this event is reported in
+       * the _creating_ thread, and the _created_ thread (whose tid
+       * we have) is still running.  So we have to stop it.  This
+       * has already been done in "call_ttrace_wait", but should we
+       * ever abandon the "stop-the-world" model, here's the command
+       * to use:
+       *
+       *    call_ttrace( TT_LWP_STOP, real_tid, TT_NIL, TT_NIL, TT_NIL );
+       *
+       * Note that this would depend on being called _after_ "add_tthread"
+       * below for the tid-to-pid translation to be done in "call_ttrace".
+       */
 
 #ifdef THREAD_DEBUG
-     if( debug_on )
-         printf( "New thread: pid %d, tid %d, creator tid %d\n",
-                 real_pid, tsp.tts_u.tts_thread.tts_target_lwpid,
-                 real_tid );
+      if (debug_on)
+       printf ("New thread: pid %d, tid %d, creator tid %d\n",
+               real_pid, tsp.tts_u.tts_thread.tts_target_lwpid,
+               real_tid);
 #endif
 
-     /* Now we have to return the tid of the created thread, not
-      * the creating thread, or "wait_for_inferior" won't know we
-      * have a new "process" (thread).  Plus we should record it
-      * right, too.
-      */
+      /* Now we have to return the tid of the created thread, not
+       * the creating thread, or "wait_for_inferior" won't know we
+       * have a new "process" (thread).  Plus we should record it
+       * right, too.
+       */
       real_tid = tsp.tts_u.tts_thread.tts_target_lwpid;
 
-      add_tthread( real_pid, real_tid );
-  }
+      add_tthread (real_pid, real_tid);
+    }
 
-  else if( (tsp.tts_event & TTEVT_LWP_TERMINATE )
-        || (tsp.tts_event & TTEVT_LWP_EXIT) ) {
+  else if ((tsp.tts_event & TTEVT_LWP_TERMINATE)
+          || (tsp.tts_event & TTEVT_LWP_EXIT))
+    {
 
 #ifdef THREAD_DEBUG
-     if( debug_on )
-         printf( "Thread dies: %d\n", real_tid );
+      if (debug_on)
+       printf ("Thread dies: %d\n", real_tid);
 #endif
 
-     del_tthread( real_tid );
-  }
+      del_tthread (real_tid);
+    }
 
-  else if (tsp.tts_event & TTEVT_EXEC) {
+  else if (tsp.tts_event & TTEVT_EXEC)
+    {
 
-#ifdef THREAD_DEBUG 
-      if( debug_on )
-          printf( "Pid %d has zero'th thread %d; inferior pid is %d\n",
-                  real_pid, real_tid, inferior_pid );
+#ifdef THREAD_DEBUG
+      if (debug_on)
+       printf ("Pid %d has zero'th thread %d; inferior pid is %d\n",
+               real_pid, real_tid, inferior_pid);
 #endif
 
-     add_tthread( real_pid, real_tid );
-  }
+      add_tthread (real_pid, real_tid);
+    }
 
 #ifdef THREAD_DEBUG
-  else if( debug_on ) {
-     printf( "Process-level event %s, using tid %d\n",
-             get_printable_name_of_ttrace_event( tsp.tts_event ),
-             real_tid );
-
-     /* OK to do this, as "add_tthread" won't add
-      * duplicate entries.  Also OK not to do it,
-      * as this event isn't one which can change the
-      * thread state.
-      */
-     add_tthread( real_pid, real_tid );
-  }
+  else if (debug_on)
+    {
+      printf ("Process-level event %s, using tid %d\n",
+             get_printable_name_of_ttrace_event (tsp.tts_event),
+             real_tid);
+
+      /* OK to do this, as "add_tthread" won't add
+       * duplicate entries.  Also OK not to do it,
+       * as this event isn't one which can change the
+       * thread state.
+       */
+      add_tthread (real_pid, real_tid);
+    }
 #endif
 
 
@@ -2651,15 +2785,16 @@ ptrace_wait (pid, status)
    * no other resort than to assume that no more events remain...)
    */
   if (can_touch_threads_of_process (real_pid, tsp.tts_event))
-      more_events_left = count_unhandled_events( real_pid, real_tid );
-      
-  else {
-      if( more_events_left > 0 )
-          warning( "Vfork or fork causing loss of %d buffered events.",
-                   more_events_left );
-          
+    more_events_left = count_unhandled_events (real_pid, real_tid);
+
+  else
+    {
+      if (more_events_left > 0)
+       warning ("Vfork or fork causing loss of %d buffered events.",
+                more_events_left);
+
       more_events_left = 0;
-  }
+    }
 
   /* Attempt to translate the ttrace_wait-returned status into the
      ptrace equivalent.
@@ -2667,8 +2802,8 @@ ptrace_wait (pid, status)
      ??rehrauer: This is somewhat fragile.  We really ought to rewrite
      clients that expect to pick apart a ptrace wait status, to use
      something a little more abstract.
-     */
-  if (   (tsp.tts_event & TTEVT_EXEC)
+   */
+  if ((tsp.tts_event & TTEVT_EXEC)
       || (tsp.tts_event & TTEVT_FORK)
       || (tsp.tts_event & TTEVT_VFORK))
     {
@@ -2676,37 +2811,37 @@ ptrace_wait (pid, status)
        * will do two waits.  Be ready to notice this.
        */
       if (tsp.tts_event & TTEVT_FORK)
-        {
-          process_state = FORKING;
-          
+       {
+         process_state = FORKING;
+
 #ifdef WAIT_BUFFER_DEBUG
-          if( debug_on )
-              printf( "Process set to FORKING\n" );
+         if (debug_on)
+           printf ("Process set to FORKING\n");
 #endif
-        }
+       }
       else if (tsp.tts_event & TTEVT_VFORK)
-        {
-          process_state = VFORKING;
-          
+       {
+         process_state = VFORKING;
+
 #ifdef WAIT_BUFFER_DEBUG
-          if( debug_on )
-              printf( "Process set to VFORKING\n" );
+         if (debug_on)
+           printf ("Process set to VFORKING\n");
 #endif
-        }
+       }
 
       /* Make an exec or fork look like a breakpoint.  Definitely a hack,
          but I don't think non HP-UX-specific clients really carefully
          inspect the first events they get after inferior startup, so
          it probably almost doesn't matter what we claim this is.
-         */
+       */
 
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "..a process 'event'\n" );
+      if (debug_on)
+       printf ("..a process 'event'\n");
 #endif
 
       /* Also make fork and exec events look like bpts, so they can be caught.
-      */
+       */
       *status = 0177 | (_SIGTRAP << 8);
     }
 
@@ -2738,67 +2873,67 @@ ptrace_wait (pid, status)
      step out of one syscall only to immediately enter another...
    */
   else if ((tsp.tts_event & TTEVT_SYSCALL_ENTRY)
-        || (tsp.tts_event & TTEVT_SYSCALL_RETURN))
+          || (tsp.tts_event & TTEVT_SYSCALL_RETURN))
     {
       /* Make a syscall event look like a breakpoint.  Same comments
          as for exec & fork events.
-         */
+       */
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "..a syscall 'event'\n" );
+      if (debug_on)
+       printf ("..a syscall 'event'\n");
 #endif
 
       /* Also make syscall events look like bpts, so they can be caught.
-      */
+       */
       *status = 0177 | (_SIGTRAP << 8);
     }
 
   else if ((tsp.tts_event & TTEVT_LWP_CREATE)
-        || (tsp.tts_event & TTEVT_LWP_TERMINATE)
-        || (tsp.tts_event & TTEVT_LWP_EXIT))
+          || (tsp.tts_event & TTEVT_LWP_TERMINATE)
+          || (tsp.tts_event & TTEVT_LWP_EXIT))
     {
       /* Make a thread event look like a breakpoint.  Same comments
        * as for exec & fork events.
        */
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "..a thread 'event'\n" );
+      if (debug_on)
+       printf ("..a thread 'event'\n");
 #endif
 
       /* Also make thread events look like bpts, so they can be caught.
-      */
+       */
       *status = 0177 | (_SIGTRAP << 8);
     }
-    
+
   else if ((tsp.tts_event & TTEVT_EXIT))
-    {  /* WIFEXITED */
-    
+    {                          /* WIFEXITED */
+
 #ifdef THREAD_DEBUG
-       if( debug_on )
-           printf( "..an exit\n" );
+      if (debug_on)
+       printf ("..an exit\n");
 #endif
 
       /* Prevent rest of gdb from thinking this is
        * a new thread if for some reason it's never
        * seen the main thread before.
        */
-      inferior_pid = map_to_gdb_tid( real_tid ); /* HACK, FIX */
-      
+      inferior_pid = map_to_gdb_tid (real_tid);                /* HACK, FIX */
+
       *status = 0 | (tsp.tts_u.tts_exit.tts_exitcode);
     }
-    
+
   else if (tsp.tts_event & TTEVT_SIGNAL)
-    {  /* WIFSTOPPED */
+    {                          /* WIFSTOPPED */
 #ifdef THREAD_DEBUG
-       if( debug_on )
-           printf( "..a signal, %d\n", tsp.tts_u.tts_signal.tts_signo );
+      if (debug_on)
+       printf ("..a signal, %d\n", tsp.tts_u.tts_signal.tts_signo);
 #endif
 
       *status = 0177 | (tsp.tts_u.tts_signal.tts_signo << 8);
     }
 
   else
-    {  /* !WIFSTOPPED */
+    {                          /* !WIFSTOPPED */
 
       /* This means the process or thread terminated.  But we should've
          caught an explicit exit/termination above.  So warn (this is
@@ -2809,10 +2944,10 @@ ptrace_wait (pid, status)
       warning ("process_wait: unknown process state");
 
 #ifdef THREAD_DEBUG
-      if( debug_on )
-          printf( "Process-level event %s, using tid %d\n",
-                  get_printable_name_of_ttrace_event( tsp.tts_event ),
-                  real_tid );
+      if (debug_on)
+       printf ("Process-level event %s, using tid %d\n",
+               get_printable_name_of_ttrace_event (tsp.tts_event),
+               real_tid);
 #endif
 
       *status = _SIGTRAP;
@@ -2822,8 +2957,8 @@ ptrace_wait (pid, status)
 
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf( "Done waiting, pid is %d, tid %d\n", real_pid, real_tid );
+  if (debug_on)
+    printf ("Done waiting, pid is %d, tid %d\n", real_pid, real_tid);
 #endif
 
   /* All code external to this module uses the tid, but calls
@@ -2831,22 +2966,23 @@ ptrace_wait (pid, status)
    * the first thread as having the same number as the starting
    * pid.
    */
-  return_pid = map_to_gdb_tid( real_tid );
+  return_pid = map_to_gdb_tid (real_tid);
 
   /* Remember this for later use in "hppa_prepare_to_proceed".
    */
-  old_gdb_pid  = inferior_pid;
+  old_gdb_pid = inferior_pid;
   reported_pid = return_pid;
   reported_bpt = ((tsp.tts_event & TTEVT_SIGNAL) && (5 == tsp.tts_u.tts_signal.tts_signo));
 
-  if( real_tid == 0 || return_pid == 0 ) {
-      warning( "Internal error: process-wait failed." );
-  }
-        
+  if (real_tid == 0 || return_pid == 0)
+    {
+      warning ("Internal error: process-wait failed.");
+    }
+
   return return_pid;
 }
-
 \f
+
 /* This function causes the caller's process to be traced by its
    parent.  This is intended to be called after GDB forks itself,
    and before the child execs the target.  Despite the name, it
@@ -2870,37 +3006,37 @@ ptrace_wait (pid, status)
 int
 parent_attach_all ()
 {
-  int  tt_status;
+  int tt_status;
 
   /* We need a memory home for a constant, to pass it to ttrace.
      The value of the constant is arbitrary, so long as both
      parent and child use the same value.  Might as well use the
      "magic" constant provided by ttrace...
    */
-  uint64_t  tc_magic_child = TT_VERSION;
-  uint64_t  tc_magic_parent = 0;
+  uint64_t tc_magic_child = TT_VERSION;
+  uint64_t tc_magic_parent = 0;
 
   tt_status = call_real_ttrace (
-                            TT_PROC_SETTRC,
-                            (int)     TT_NIL,
-                            (lwpid_t) TT_NIL,
-                            TT_NIL,
-                            (TTRACE_ARG_TYPE) TT_VERSION,
-                            TT_NIL );
+                                TT_PROC_SETTRC,
+                                (int) TT_NIL,
+                                (lwpid_t) TT_NIL,
+                                TT_NIL,
+                                (TTRACE_ARG_TYPE) TT_VERSION,
+                                TT_NIL);
 
   if (tt_status < 0)
     return tt_status;
 
   /* Notify the parent that we're potentially ready to exec(). */
   write (startup_semaphore.child_channel[SEM_TALK],
-         &tc_magic_child,
-         sizeof (tc_magic_child));
+        &tc_magic_child,
+        sizeof (tc_magic_child));
 
   /* Wait for acknowledgement from the parent. */
   read (startup_semaphore.parent_channel[SEM_LISTEN],
-        &tc_magic_parent,
-        sizeof (tc_magic_parent));
-        
+       &tc_magic_parent,
+       sizeof (tc_magic_parent));
+
   if (tc_magic_child != tc_magic_parent)
     warning ("mismatched semaphore magic");
 
@@ -2909,7 +3045,7 @@ parent_attach_all ()
   (void) close (startup_semaphore.parent_channel[SEM_TALK]);
   (void) close (startup_semaphore.child_channel[SEM_LISTEN]);
   (void) close (startup_semaphore.child_channel[SEM_TALK]);
-  
+
   return tt_status;
 }
 
@@ -2927,18 +3063,18 @@ parent_attach_all ()
  * have to be the common part of both.
  */
 static void
-require_notification_of_events ( real_pid )
-  int  real_pid;
+require_notification_of_events (real_pid)
+     int real_pid;
 {
-  int  tt_status;
-  ttevent_t  notifiable_events;
+  int tt_status;
+  ttevent_t notifiable_events;
 
-  lwpid_t    tid;
-  ttstate_t  thread_state;
+  lwpid_t tid;
+  ttstate_t thread_state;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf( "Require notif, pid is %d\n", real_pid );
+  if (debug_on)
+    printf ("Require notif, pid is %d\n", real_pid);
 #endif
 
   /* Temporary HACK: tell inftarg.c/child_wait to not
@@ -2958,7 +3094,7 @@ require_notification_of_events ( real_pid )
    */
   notifiable_events.tte_opts |= TTEO_PROC_INHERIT;
 
-  notifiable_events.tte_events  = TTEVT_DEFAULT;
+  notifiable_events.tte_events = TTEVT_DEFAULT;
   notifiable_events.tte_events |= TTEVT_SIGNAL;
   notifiable_events.tte_events |= TTEVT_EXEC;
   notifiable_events.tte_events |= TTEVT_EXIT;
@@ -2969,27 +3105,27 @@ require_notification_of_events ( real_pid )
   notifiable_events.tte_events |= TTEVT_LWP_TERMINATE;
 
   tt_status = call_real_ttrace (
-                           TT_PROC_SET_EVENT_MASK,
-                           real_pid,
-                           (lwpid_t) TT_NIL,
-                           (TTRACE_ARG_TYPE) &notifiable_events,
-                           (TTRACE_ARG_TYPE) sizeof (notifiable_events),
-                           TT_NIL);
+                                TT_PROC_SET_EVENT_MASK,
+                                real_pid,
+                                (lwpid_t) TT_NIL,
+                                (TTRACE_ARG_TYPE) & notifiable_events,
+                              (TTRACE_ARG_TYPE) sizeof (notifiable_events),
+                                TT_NIL);
 }
 
 static void
-require_notification_of_exec_events ( real_pid )
-  int  real_pid;
+require_notification_of_exec_events (real_pid)
+     int real_pid;
 {
-  int  tt_status;
-  ttevent_t  notifiable_events;
+  int tt_status;
+  ttevent_t notifiable_events;
 
-  lwpid_t    tid;
-  ttstate_t  thread_state;
+  lwpid_t tid;
+  ttstate_t thread_state;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf( "Require notif, pid is %d\n", real_pid );
+  if (debug_on)
+    printf ("Require notif, pid is %d\n", real_pid);
 #endif
 
   /* Temporary HACK: tell inftarg.c/child_wait to not
@@ -3005,44 +3141,44 @@ require_notification_of_exec_events ( real_pid )
    */
   notifiable_events.tte_opts &= ~TTEO_PROC_INHERIT;
 
-  notifiable_events.tte_events  = TTEVT_DEFAULT;
+  notifiable_events.tte_events = TTEVT_DEFAULT;
   notifiable_events.tte_events |= TTEVT_EXEC;
   notifiable_events.tte_events |= TTEVT_EXIT;
 
   tt_status = call_real_ttrace (
-                           TT_PROC_SET_EVENT_MASK,
-                           real_pid,
-                           (lwpid_t) TT_NIL,
-                           (TTRACE_ARG_TYPE) &notifiable_events,
-                           (TTRACE_ARG_TYPE) sizeof (notifiable_events),
-                           TT_NIL);
+                                TT_PROC_SET_EVENT_MASK,
+                                real_pid,
+                                (lwpid_t) TT_NIL,
+                                (TTRACE_ARG_TYPE) & notifiable_events,
+                              (TTRACE_ARG_TYPE) sizeof (notifiable_events),
+                                TT_NIL);
 }
-
 \f
+
 /* This function is called by the parent process, with pid being the
  * ID of the child process, after the debugger has forked.
  */
 void
 child_acknowledge_created_inferior (pid)
-    int  pid;
+     int pid;
 {
   /* We need a memory home for a constant, to pass it to ttrace.
      The value of the constant is arbitrary, so long as both
      parent and child use the same value.  Might as well use the
      "magic" constant provided by ttrace...
-     */
-  uint64_t  tc_magic_parent = TT_VERSION;
-  uint64_t  tc_magic_child = 0;
+   */
+  uint64_t tc_magic_parent = TT_VERSION;
+  uint64_t tc_magic_child = 0;
 
   /* Wait for the child to tell us that it has forked. */
   read (startup_semaphore.child_channel[SEM_LISTEN],
-        &tc_magic_child,
-        sizeof(tc_magic_child));
+       &tc_magic_child,
+       sizeof (tc_magic_child));
 
   /* Clear thread info now.  We'd like to do this in
    * "require...", but that messes up attach.
    */
-  clear_thread_info();
+  clear_thread_info ();
 
   /* Tell the "rest of gdb" that the initial thread exists.
    * This isn't really a hack.  Other thread-based versions
@@ -3055,7 +3191,7 @@ child_acknowledge_created_inferior (pid)
    *    the process safely to ask what it is.  Anyway, we'll
    *    add it when it gets the EXEC event.
    */
-  add_thread( pid );       /* in thread.c */
+  add_thread (pid);            /* in thread.c */
 
   /* We can now set the child's ttrace event mask.
    */
@@ -3067,8 +3203,8 @@ child_acknowledge_created_inferior (pid)
 
   /* Notify the child that it can exec. */
   write (startup_semaphore.parent_channel[SEM_TALK],
-         &tc_magic_parent,
-         sizeof (tc_magic_parent));
+        &tc_magic_parent,
+        sizeof (tc_magic_parent));
 
   /* Discard our copy of the semaphore. */
   (void) close (startup_semaphore.parent_channel[SEM_LISTEN]);
@@ -3083,8 +3219,8 @@ child_acknowledge_created_inferior (pid)
  * calling require_notification_of_events.
  */
 void
-child_post_startup_inferior ( real_pid)
-  int  real_pid;
+child_post_startup_inferior (real_pid)
+     int real_pid;
 {
   require_notification_of_events (real_pid);
 }
@@ -3093,18 +3229,18 @@ child_post_startup_inferior ( real_pid)
  */
 static void
 hppa_enable_catch_fork (tid)
-  int  tid;
+     int tid;
 {
-  int        tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled.
    */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL );
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 
@@ -3112,15 +3248,15 @@ hppa_enable_catch_fork (tid)
   ttrace_events.tte_events |= TTEVT_FORK;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf( "enable fork, tid is %d\n", tid );
+  if (debug_on)
+    printf ("enable fork, tid is %d\n", tid);
 #endif
 
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 }
@@ -3128,18 +3264,18 @@ hppa_enable_catch_fork (tid)
 
 static void
 hppa_disable_catch_fork (tid)
-  int  tid;
+     int tid;
 {
-  int        tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled.
    */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3148,15 +3284,15 @@ hppa_disable_catch_fork (tid)
   ttrace_events.tte_events &= ~TTEVT_FORK;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf("disable fork, tid is %d\n", tid );
+  if (debug_on)
+    printf ("disable fork, tid is %d\n", tid);
 #endif
 
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3166,12 +3302,12 @@ hppa_disable_catch_fork (tid)
 #if defined(CHILD_INSERT_FORK_CATCHPOINT)
 int
 child_insert_fork_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Enable reporting of fork events from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3180,12 +3316,12 @@ child_insert_fork_catchpoint (tid)
 #if defined(CHILD_REMOVE_FORK_CATCHPOINT)
 int
 child_remove_fork_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Disable reporting of fork events from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3193,18 +3329,18 @@ child_remove_fork_catchpoint (tid)
 
 static void
 hppa_enable_catch_vfork (tid)
-  int  tid;
+     int tid;
 {
-  int  tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled.
    */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3213,15 +3349,15 @@ hppa_enable_catch_vfork (tid)
   ttrace_events.tte_events |= TTEVT_VFORK;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf("enable vfork, tid is %d\n", tid );
+  if (debug_on)
+    printf ("enable vfork, tid is %d\n", tid);
 #endif
 
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3230,17 +3366,17 @@ hppa_enable_catch_vfork (tid)
 
 static void
 hppa_disable_catch_vfork (tid)
-  int  tid;
+     int tid;
 {
-  int  tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled. */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3249,14 +3385,14 @@ hppa_disable_catch_vfork (tid)
   ttrace_events.tte_events &= ~TTEVT_VFORK;
 
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf("disable vfork, tid is %d\n", tid );
+  if (debug_on)
+    printf ("disable vfork, tid is %d\n", tid);
 #endif
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           tid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
 
   if (errno)
     perror_with_name ("ttrace");
@@ -3266,12 +3402,12 @@ hppa_disable_catch_vfork (tid)
 #if defined(CHILD_INSERT_VFORK_CATCHPOINT)
 int
 child_insert_vfork_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Enable reporting of vfork events from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3280,12 +3416,12 @@ child_insert_vfork_catchpoint (tid)
 #if defined(CHILD_REMOVE_VFORK_CATCHPOINT)
 int
 child_remove_vfork_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Disable reporting of vfork events from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3293,40 +3429,41 @@ child_remove_vfork_catchpoint (tid)
 #if defined(CHILD_HAS_FORKED)
 
 /* Q: Do we need to map the returned process ID to a thread ID?
- *
+
  * A: I don't think so--here we want a _real_ pid.  Any later
  *    operations will call "require_notification_of_events" and
  *    start the mapping.
  */
 int
 child_has_forked (tid, childpid)
-  int  tid;
-  int *childpid;
+     int tid;
+     int *childpid;
 {
-  int  tt_status;
-  ttstate_t  ttrace_state;
-  thread_info *  tinfo;
+  int tt_status;
+  ttstate_t ttrace_state;
+  thread_info *tinfo;
 
   /* Do we have cached thread state that we can consult?  If so, use it. */
   tinfo = find_thread_info (map_from_gdb_tid (tid));
-  if (tinfo != NULL) {
-    copy_ttstate_t (&ttrace_state, &tinfo->last_stop_state);
-  }
+  if (tinfo != NULL)
+    {
+      copy_ttstate_t (&ttrace_state, &tinfo->last_stop_state);
+    }
 
   /* Nope, must read the thread's current state */
   else
     {
       tt_status = call_ttrace (TT_LWP_GET_STATE,
-                               tid,
-                               (TTRACE_ARG_TYPE) &ttrace_state,
-                               (TTRACE_ARG_TYPE) sizeof (ttrace_state),
-                               TT_NIL);
+                              tid,
+                              (TTRACE_ARG_TYPE) & ttrace_state,
+                              (TTRACE_ARG_TYPE) sizeof (ttrace_state),
+                              TT_NIL);
 
       if (errno)
-        perror_with_name ("ttrace");
-    
+       perror_with_name ("ttrace");
+
       if (tt_status < 0)
-        return 0;
+       return 0;
     }
 
   if (ttrace_state.tts_event & TTEVT_FORK)
@@ -3346,12 +3483,12 @@ child_has_forked (tid, childpid)
  */
 int
 child_has_vforked (tid, childpid)
-  int  tid;
-  int *  childpid;
+     int tid;
+     int *childpid;
 {
-  int  tt_status;
-  ttstate_t  ttrace_state;
-  thread_info *  tinfo;
+  int tt_status;
+  ttstate_t ttrace_state;
+  thread_info *tinfo;
 
   /* Do we have cached thread state that we can consult?  If so, use it. */
   tinfo = find_thread_info (map_from_gdb_tid (tid));
@@ -3362,16 +3499,16 @@ child_has_vforked (tid, childpid)
   else
     {
       tt_status = call_ttrace (TT_LWP_GET_STATE,
-                               tid,
-                               (TTRACE_ARG_TYPE) &ttrace_state,
-                               (TTRACE_ARG_TYPE) sizeof (ttrace_state),
-                               TT_NIL);
+                              tid,
+                              (TTRACE_ARG_TYPE) & ttrace_state,
+                              (TTRACE_ARG_TYPE) sizeof (ttrace_state),
+                              TT_NIL);
 
       if (errno)
-        perror_with_name ("ttrace");
-    
+       perror_with_name ("ttrace");
+
       if (tt_status < 0)
-        return 0;
+       return 0;
     }
 
   if (ttrace_state.tts_event & TTEVT_VFORK)
@@ -3394,7 +3531,7 @@ child_can_follow_vfork_prior_to_exec ()
      ??rehrauer: However, I had major-league problems trying to
      convince wait_for_inferior to handle that case.  Perhaps when
      it is rewritten to grok multiple processes in an explicit way...
-     */
+   */
   return 0;
 }
 #endif
@@ -3403,12 +3540,12 @@ child_can_follow_vfork_prior_to_exec ()
 #if defined(CHILD_INSERT_EXEC_CATCHPOINT)
 int
 child_insert_exec_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Enable reporting of exec events from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3417,12 +3554,12 @@ child_insert_exec_catchpoint (tid)
 #if defined(CHILD_REMOVE_EXEC_CATCHPOINT)
 int
 child_remove_exec_catchpoint (tid)
-  int  tid;
+     int tid;
 {
   /* Disable reporting of execevents from the kernel. */
   /* ??rehrauer: For the moment, we're always enabling these events,
      and just ignoring them if there's no catchpoint to catch them.
-     */
+   */
   return 0;
 }
 #endif
@@ -3431,12 +3568,12 @@ child_remove_exec_catchpoint (tid)
 #if defined(CHILD_HAS_EXECD)
 int
 child_has_execd (tid, execd_pathname)
-  int  tid;
-  char **  execd_pathname;
+     int tid;
+     char **execd_pathname;
 {
-  int  tt_status;
-  ttstate_t  ttrace_state;
-  thread_info *  tinfo;
+  int tt_status;
+  ttstate_t ttrace_state;
+  thread_info *tinfo;
 
   /* Do we have cached thread state that we can consult?  If so, use it. */
   tinfo = find_thread_info (map_from_gdb_tid (tid));
@@ -3447,24 +3584,24 @@ child_has_execd (tid, execd_pathname)
   else
     {
       tt_status = call_ttrace (TT_LWP_GET_STATE,
-                               tid,
-                               (TTRACE_ARG_TYPE) &ttrace_state,
-                               (TTRACE_ARG_TYPE) sizeof (ttrace_state),
-                               TT_NIL);
+                              tid,
+                              (TTRACE_ARG_TYPE) & ttrace_state,
+                              (TTRACE_ARG_TYPE) sizeof (ttrace_state),
+                              TT_NIL);
 
       if (errno)
-        perror_with_name ("ttrace");
-    
+       perror_with_name ("ttrace");
+
       if (tt_status < 0)
-        return 0;
+       return 0;
     }
 
   if (ttrace_state.tts_event & TTEVT_EXEC)
     {
       /* See child_pid_to_exec_file in this file: this is a macro.
        */
-      char *  exec_file = target_pid_to_exec_file (tid);
-      
+      char *exec_file = target_pid_to_exec_file (tid);
+
       *execd_pathname = savestring (exec_file, strlen (exec_file));
       return 1;
     }
@@ -3477,13 +3614,13 @@ child_has_execd (tid, execd_pathname)
 #if defined(CHILD_HAS_SYSCALL_EVENT)
 int
 child_has_syscall_event (pid, kind, syscall_id)
-  int  pid;
-  enum target_waitkind *  kind;
-  int *  syscall_id;
+     int pid;
+     enum target_waitkind *kind;
+     int *syscall_id;
 {
-  int  tt_status;
-  ttstate_t  ttrace_state;
-  thread_info *  tinfo;
+  int tt_status;
+  ttstate_t ttrace_state;
+  thread_info *tinfo;
 
   /* Do we have cached thread state that we can consult?  If so, use it. */
   tinfo = find_thread_info (map_from_gdb_tid (pid));
@@ -3493,20 +3630,20 @@ child_has_syscall_event (pid, kind, syscall_id)
   /* Nope, must read the thread's current state */
   else
     {
-    tt_status = call_ttrace (TT_LWP_GET_STATE,
-                               pid,
-                               (TTRACE_ARG_TYPE) &ttrace_state,
-                               (TTRACE_ARG_TYPE) sizeof (ttrace_state),
-                               TT_NIL);
+      tt_status = call_ttrace (TT_LWP_GET_STATE,
+                              pid,
+                              (TTRACE_ARG_TYPE) & ttrace_state,
+                              (TTRACE_ARG_TYPE) sizeof (ttrace_state),
+                              TT_NIL);
 
       if (errno)
-        perror_with_name ("ttrace");
-    
+       perror_with_name ("ttrace");
+
       if (tt_status < 0)
-        return 0;
+       return 0;
     }
 
-  *kind = TARGET_WAITKIND_SPURIOUS;  /* Until proven otherwise... */
+  *kind = TARGET_WAITKIND_SPURIOUS;    /* Until proven otherwise... */
   *syscall_id = -1;
 
   if (ttrace_state.tts_event & TTEVT_SYSCALL_ENTRY)
@@ -3520,13 +3657,13 @@ child_has_syscall_event (pid, kind, syscall_id)
   return 1;
 }
 #endif
+\f
 
 
-\f
 #if defined(CHILD_THREAD_ALIVE)
 
 /* Check to see if the given thread is alive.
- *
+
  * We'll trust the thread list, as the more correct
  * approach of stopping the process and spinning down
  * the OS's thread list is _very_ expensive.
@@ -3537,19 +3674,19 @@ int
 child_thread_alive (gdb_tid)
      lwpid_t gdb_tid;
 {
-   lwpid_t  tid;
+  lwpid_t tid;
 
-   /* This spins down the lists twice.
-    * Possible peformance improvement here!
-    */
-   tid = map_from_gdb_tid( gdb_tid );
-   return !is_terminated( tid );
+  /* This spins down the lists twice.
+   * Possible peformance improvement here!
+   */
+  tid = map_from_gdb_tid (gdb_tid);
+  return !is_terminated (tid);
 }
 
 #endif
+\f
 
 
-\f
 /* This function attempts to read the specified number of bytes from the
    save_state_t that is our view into the hardware registers, starting at
    ss_offset, and ending at ss_offset + sizeof_buf - 1
@@ -3559,33 +3696,33 @@ child_thread_alive (gdb_tid)
 
    If it fails, it returns a negative result.  The contents of buf are
    undefined it this function fails.
  */
+ */
 int
 read_from_register_save_state (tid, ss_offset, buf, sizeof_buf)
-    int  tid;
-    TTRACE_ARG_TYPE  ss_offset;
-    char *  buf;
-    int  sizeof_buf;
+     int tid;
+     TTRACE_ARG_TYPE ss_offset;
+     char *buf;
+     int sizeof_buf;
 {
-  int  tt_status;
-  register_value_t  register_value = 0;
+  int tt_status;
+  register_value_t register_value = 0;
 
   tt_status = call_ttrace (TT_LWP_RUREGS,
-                           tid,
-                           ss_offset,
-                           (TTRACE_ARG_TYPE) sizeof_buf,
-                           (TTRACE_ARG_TYPE) buf);
-
-  if( tt_status == 1 )
-      /* Map ttrace's version of success to our version.
-       * Sometime ttrace returns 0, but that's ok here.
-       */
-      return 0;
-      
+                          tid,
+                          ss_offset,
+                          (TTRACE_ARG_TYPE) sizeof_buf,
+                          (TTRACE_ARG_TYPE) buf);
+
+  if (tt_status == 1)
+    /* Map ttrace's version of success to our version.
+     * Sometime ttrace returns 0, but that's ok here.
+     */
+    return 0;
+
   return tt_status;
 }
-
 \f
+
 /* This function attempts to write the specified number of bytes to the
    save_state_t that is our view into the hardware registers, starting at
    ss_offset, and ending at ss_offset + sizeof_buf - 1
@@ -3594,26 +3731,26 @@ read_from_register_save_state (tid, ss_offset, buf, sizeof_buf)
 
    If it fails, it returns a negative result.  The contents of the save_state_t
    are undefined it this function fails.
  */
+ */
 int
 write_to_register_save_state (tid, ss_offset, buf, sizeof_buf)
-    int  tid;
-    TTRACE_ARG_TYPE  ss_offset;
-    char *  buf;
-    int  sizeof_buf;
+     int tid;
+     TTRACE_ARG_TYPE ss_offset;
+     char *buf;
+     int sizeof_buf;
 {
-  int  tt_status;
-  register_value_t  register_value = 0;
+  int tt_status;
+  register_value_t register_value = 0;
 
   tt_status = call_ttrace (TT_LWP_WUREGS,
-                           tid,
-                           ss_offset,
-                           (TTRACE_ARG_TYPE) sizeof_buf,
-                           (TTRACE_ARG_TYPE) buf);
+                          tid,
+                          ss_offset,
+                          (TTRACE_ARG_TYPE) sizeof_buf,
+                          (TTRACE_ARG_TYPE) buf);
   return tt_status;
 }
-
 \f
+
 /* This function is a sop to the largeish number of direct calls
    to call_ptrace that exist in other files.  Rather than create
    functions whose name abstracts away from ptrace, and change all
@@ -3623,147 +3760,148 @@ write_to_register_save_state (tid, ss_offset, buf, sizeof_buf)
    Note HP-UX explicitly disallows a mix of ptrace & ttrace on a traced
    process.  Thus, we must translate all ptrace requests into their
    process-specific, ttrace equivalents.
  */
+ */
 int
 call_ptrace (pt_request, gdb_tid, addr, data)
-     int               pt_request;
-     int               gdb_tid;
-     PTRACE_ARG3_TYPE  addr;
-     int               data;
+     int pt_request;
+     int gdb_tid;
+     PTRACE_ARG3_TYPE addr;
+     int data;
 {
-  ttreq_t           tt_request;
-  TTRACE_ARG_TYPE   tt_addr = (TTRACE_ARG_TYPE) addr;
-  TTRACE_ARG_TYPE   tt_data = (TTRACE_ARG_TYPE) data;
-  TTRACE_ARG_TYPE   tt_addr2 = TT_NIL;
-  int               tt_status;
-  register_value_t  register_value;
-  int               read_buf;
+  ttreq_t tt_request;
+  TTRACE_ARG_TYPE tt_addr = (TTRACE_ARG_TYPE) addr;
+  TTRACE_ARG_TYPE tt_data = (TTRACE_ARG_TYPE) data;
+  TTRACE_ARG_TYPE tt_addr2 = TT_NIL;
+  int tt_status;
+  register_value_t register_value;
+  int read_buf;
 
   /* Perform the necessary argument translation.  Note that some
      cases are funky enough in the ttrace realm that we handle them
      very specially.
    */
-  switch (pt_request) {
+  switch (pt_request)
+    {
       /* The following cases cannot conveniently be handled conveniently
          by merely adjusting the ptrace arguments and feeding into the
          generic call to ttrace at the bottom of this function.
 
          Note that because all branches of this switch end in "return",
          there's no need for any "break" statements.
-         */
-      case PT_SETTRC :
-          return parent_attach_all ();
-          
-      case PT_RUREGS :
-          tt_status = read_from_register_save_state (gdb_tid,
-                                                     tt_addr,
-                                                     &register_value,
-                                                     sizeof (register_value));
-          if (tt_status < 0)
-            return tt_status;
-          return register_value;
-
-      case PT_WUREGS :
-          register_value = (int) tt_data;
-          tt_status = write_to_register_save_state (gdb_tid,
-                                                    tt_addr,
-                                                    &register_value,
-                                                    sizeof (register_value));
-          return tt_status;
-          break;
-
-      case PT_READ_I :
-          tt_status = call_ttrace (TT_PROC_RDTEXT,  /* Implicit 4-byte xfer becomes block-xfer. */
-                                   gdb_tid,
-                                   tt_addr,
-                                   (TTRACE_ARG_TYPE) 4,
-                                   (TTRACE_ARG_TYPE) &read_buf);
-          if (tt_status < 0)
-            return tt_status;
-          return read_buf;
-
-      case PT_READ_D :
-          tt_status = call_ttrace (TT_PROC_RDDATA,  /* Implicit 4-byte xfer becomes block-xfer. */
-                                   gdb_tid,
-                                   tt_addr,
-                                   (TTRACE_ARG_TYPE) 4,
-                                   (TTRACE_ARG_TYPE) &read_buf);
-          if (tt_status < 0)
-            return tt_status;
-          return read_buf;
-
-      case PT_ATTACH :
-          tt_status = call_real_ttrace (TT_PROC_ATTACH,
-                                        map_from_gdb_tid (gdb_tid),
-                                        (lwpid_t) TT_NIL,
-                                        tt_addr,
-                                        (TTRACE_ARG_TYPE) TT_VERSION,
-                                        tt_addr2);
-          if (tt_status < 0)
-            return tt_status;
-          return tt_status;
+       */
+    case PT_SETTRC:
+      return parent_attach_all ();
+
+    case PT_RUREGS:
+      tt_status = read_from_register_save_state (gdb_tid,
+                                                tt_addr,
+                                                &register_value,
+                                                sizeof (register_value));
+      if (tt_status < 0)
+       return tt_status;
+      return register_value;
+
+    case PT_WUREGS:
+      register_value = (int) tt_data;
+      tt_status = write_to_register_save_state (gdb_tid,
+                                               tt_addr,
+                                               &register_value,
+                                               sizeof (register_value));
+      return tt_status;
+      break;
+
+    case PT_READ_I:
+      tt_status = call_ttrace (TT_PROC_RDTEXT, /* Implicit 4-byte xfer becomes block-xfer. */
+                              gdb_tid,
+                              tt_addr,
+                              (TTRACE_ARG_TYPE) 4,
+                              (TTRACE_ARG_TYPE) & read_buf);
+      if (tt_status < 0)
+       return tt_status;
+      return read_buf;
+
+    case PT_READ_D:
+      tt_status = call_ttrace (TT_PROC_RDDATA, /* Implicit 4-byte xfer becomes block-xfer. */
+                              gdb_tid,
+                              tt_addr,
+                              (TTRACE_ARG_TYPE) 4,
+                              (TTRACE_ARG_TYPE) & read_buf);
+      if (tt_status < 0)
+       return tt_status;
+      return read_buf;
+
+    case PT_ATTACH:
+      tt_status = call_real_ttrace (TT_PROC_ATTACH,
+                                   map_from_gdb_tid (gdb_tid),
+                                   (lwpid_t) TT_NIL,
+                                   tt_addr,
+                                   (TTRACE_ARG_TYPE) TT_VERSION,
+                                   tt_addr2);
+      if (tt_status < 0)
+       return tt_status;
+      return tt_status;
 
       /* The following cases are handled by merely adjusting the ptrace
          arguments and feeding into the generic call to ttrace.
-         */
-      case PT_DETACH :
-          tt_request = TT_PROC_DETACH;
-          break;
-
-      case PT_WRITE_I :
-          tt_request = TT_PROC_WRTEXT;  /* Translates 4-byte xfer to block-xfer. */
-          tt_data = 4;                  /* This many bytes. */
-          tt_addr2 = (TTRACE_ARG_TYPE) &data;  /* Address of xfer source. */
-          break;
-
-      case PT_WRITE_D :
-          tt_request = TT_PROC_WRDATA;  /* Translates 4-byte xfer to block-xfer. */
-          tt_data = 4;                  /* This many bytes. */
-          tt_addr2 = (TTRACE_ARG_TYPE) &data;  /* Address of xfer source. */
-          break;
-
-      case PT_RDTEXT :
-          tt_request = TT_PROC_RDTEXT;
-          break;
-
-      case PT_RDDATA :
-          tt_request = TT_PROC_RDDATA;
-          break;
-
-      case PT_WRTEXT :
-          tt_request = TT_PROC_WRTEXT;
-          break;
-
-      case PT_WRDATA :
-          tt_request = TT_PROC_WRDATA;
-          break;
-
-      case PT_CONTINUE :
-          tt_request = TT_PROC_CONTINUE;
-          break;
-
-      case PT_STEP :
-          tt_request = TT_LWP_SINGLE;  /* Should not be making this request? */
-          break;
-
-      case PT_KILL :
-          tt_request = TT_PROC_EXIT;
-          break;
-
-      case PT_GET_PROCESS_PATHNAME :
-          tt_request = TT_PROC_GET_PATHNAME;
-          break;
-
-      default :
-          tt_request = pt_request;  /* Let ttrace be the one to complain. */
-          break;
-  }
+       */
+    case PT_DETACH:
+      tt_request = TT_PROC_DETACH;
+      break;
+
+    case PT_WRITE_I:
+      tt_request = TT_PROC_WRTEXT;     /* Translates 4-byte xfer to block-xfer. */
+      tt_data = 4;             /* This many bytes. */
+      tt_addr2 = (TTRACE_ARG_TYPE) & data;     /* Address of xfer source. */
+      break;
+
+    case PT_WRITE_D:
+      tt_request = TT_PROC_WRDATA;     /* Translates 4-byte xfer to block-xfer. */
+      tt_data = 4;             /* This many bytes. */
+      tt_addr2 = (TTRACE_ARG_TYPE) & data;     /* Address of xfer source. */
+      break;
+
+    case PT_RDTEXT:
+      tt_request = TT_PROC_RDTEXT;
+      break;
+
+    case PT_RDDATA:
+      tt_request = TT_PROC_RDDATA;
+      break;
+
+    case PT_WRTEXT:
+      tt_request = TT_PROC_WRTEXT;
+      break;
+
+    case PT_WRDATA:
+      tt_request = TT_PROC_WRDATA;
+      break;
+
+    case PT_CONTINUE:
+      tt_request = TT_PROC_CONTINUE;
+      break;
+
+    case PT_STEP:
+      tt_request = TT_LWP_SINGLE;      /* Should not be making this request? */
+      break;
+
+    case PT_KILL:
+      tt_request = TT_PROC_EXIT;
+      break;
+
+    case PT_GET_PROCESS_PATHNAME:
+      tt_request = TT_PROC_GET_PATHNAME;
+      break;
+
+    default:
+      tt_request = pt_request; /* Let ttrace be the one to complain. */
+      break;
+    }
 
   return call_ttrace (tt_request,
-                      gdb_tid,
-                      tt_addr,
-                      tt_data,
-                      tt_addr2);
+                     gdb_tid,
+                     tt_addr,
+                     tt_data,
+                     tt_addr2);
 }
 
 /* Kill that pesky process!
@@ -3771,11 +3909,11 @@ call_ptrace (pt_request, gdb_tid, addr, data)
 void
 kill_inferior ()
 {
-  int  tid;
-  int  wait_status;
-  thread_info *  t;
+  int tid;
+  int wait_status;
+  thread_info *t;
   thread_info **paranoia;
-  int           para_count, i;
+  int para_count, i;
 
   if (inferior_pid == 0)
     return;
@@ -3790,53 +3928,56 @@ kill_inferior ()
 
      But we can't just call target_mourn_inferior() for each, since that
      zaps the target vector.
-     */
+   */
 
-  paranoia = (thread_info **) mallocthread_head.count *
-                                      sizeof(thread_info *));
+  paranoia = (thread_info **) malloc (thread_head.count *
+                                     sizeof (thread_info *));
   para_count = 0;
-  
+
   t = thread_head.head;
-  while (t) {
-  
-    paranoia[ para_count ] = t;
-    for( i = 0; i < para_count; i++ ){
-        if( t->next == paranoia[i] ) {
-            warning( "Bad data in gdb's thread data; repairing." );
-            t->next = 0;
-        }
-    }
-    para_count++;
-
-    if (t->am_pseudo && (t->pid != inferior_pid))
-      {
-        /* TT_PROC_STOP doesn't require a subsequent ttrace_wait, as it
-         * generates no event.
-         */
-        call_ttrace (TT_PROC_STOP,
-                     t->pid,
-                     TT_NIL,
-                     TT_NIL,
-                     TT_NIL);
-
-        call_ttrace (TT_PROC_DETACH,
-                     t->pid,
-                     TT_NIL,
-                     (TTRACE_ARG_TYPE) TARGET_SIGNAL_0,
-                     TT_NIL);
-      }
-    t = t->next;
-  }
+  while (t)
+    {
+
+      paranoia[para_count] = t;
+      for (i = 0; i < para_count; i++)
+       {
+         if (t->next == paranoia[i])
+           {
+             warning ("Bad data in gdb's thread data; repairing.");
+             t->next = 0;
+           }
+       }
+      para_count++;
+
+      if (t->am_pseudo && (t->pid != inferior_pid))
+       {
+         /* TT_PROC_STOP doesn't require a subsequent ttrace_wait, as it
+          * generates no event.
+          */
+         call_ttrace (TT_PROC_STOP,
+                      t->pid,
+                      TT_NIL,
+                      TT_NIL,
+                      TT_NIL);
+
+         call_ttrace (TT_PROC_DETACH,
+                      t->pid,
+                      TT_NIL,
+                      (TTRACE_ARG_TYPE) TARGET_SIGNAL_0,
+                      TT_NIL);
+       }
+      t = t->next;
+    }
+
+  free (paranoia);
 
-  free( paranoia );
-  
   call_ttrace (TT_PROC_STOP,
-               inferior_pid,
-               TT_NIL,
-               TT_NIL,
-               TT_NIL);
+              inferior_pid,
+              TT_NIL,
+              TT_NIL,
+              TT_NIL);
   target_mourn_inferior ();
-  clear_thread_info();
+  clear_thread_info ();
 }
 
 
@@ -3845,398 +3986,425 @@ kill_inferior ()
 /* Sanity check a thread about to be continued.
  */
 static void
-thread_dropping_event_check( p )
-    thread_info *p;
+thread_dropping_event_check (p)
+     thread_info *p;
 {
-    if( !p->handled ) {
-        /*
-         * This seems to happen when we "next" over a
-         * "fork()" while following the parent.  If it's
-         * the FORK event, that's ok.  If it's a SIGNAL
-         * in the unfollowed child, that's ok to--but
-         * how can we know that's what's going on?
-         *
-         * FIXME!
-         */
-         if( p->have_state ) {
-             if( p->last_stop_state.tts_event == TTEVT_FORK ) {
-                 /* Ok */
-                 ;
-             }
-             else if( p->last_stop_state.tts_event == TTEVT_SIGNAL ) {
-                 /* Ok, close eyes and let it happen.
-                  */
-                 ;
-             }
-             else {
-                 /* This shouldn't happen--we're dropping a
-                  * real event.
-                  */
-                 warning( "About to continue process %d, thread %d with unhandled event %s.",
-                         p->pid, p->tid,
-                         get_printable_name_of_ttrace_event(
-                                   p->last_stop_state.tts_event ));
+  if (!p->handled)
+    {
+      /*
+       * This seems to happen when we "next" over a
+       * "fork()" while following the parent.  If it's
+       * the FORK event, that's ok.  If it's a SIGNAL
+       * in the unfollowed child, that's ok to--but
+       * how can we know that's what's going on?
+       *
+       * FIXME!
+       */
+      if (p->have_state)
+       {
+         if (p->last_stop_state.tts_event == TTEVT_FORK)
+           {
+             /* Ok */
+             ;
+           }
+         else if (p->last_stop_state.tts_event == TTEVT_SIGNAL)
+           {
+             /* Ok, close eyes and let it happen.
+              */
+             ;
+           }
+         else
+           {
+             /* This shouldn't happen--we're dropping a
+              * real event.
+              */
+             warning ("About to continue process %d, thread %d with unhandled event %s.",
+                      p->pid, p->tid,
+                      get_printable_name_of_ttrace_event (
+                                            p->last_stop_state.tts_event));
 
 #ifdef PARANOIA
-                 if( debug_on )
-                     print_tthread( p );
+             if (debug_on)
+               print_tthread (p);
 #endif
-            }
-        }
-        else {
-            /* No saved state, have to assume it failed.
-             */
-            warning( "About to continue process %d, thread %d with unhandled event.",
-                     p->pid, p->tid );
+           }
+       }
+      else
+       {
+         /* No saved state, have to assume it failed.
+          */
+         warning ("About to continue process %d, thread %d with unhandled event.",
+                  p->pid, p->tid);
 #ifdef PARANOIA
-            if( debug_on )
-                print_tthread( p );
+         if (debug_on)
+           print_tthread (p);
 #endif
-        }
+       }
     }
-    
-}   /* thread_dropping_event_check */
+
+}                              /* thread_dropping_event_check */
 
 /* Use a loop over the threads to continue all the threads but
  * the one specified, which is to be stepped.
  */
 static void
-threads_continue_all_but_one( gdb_tid, signal )
-    lwpid_t gdb_tid;
-    int     signal;
+threads_continue_all_but_one (gdb_tid, signal)
+     lwpid_t gdb_tid;
+     int signal;
 {
-    thread_info  *p;
-    int           thread_signal;
-    lwpid_t       real_tid;
-    lwpid_t       scan_tid;
-    ttstate_t     state;
-    int           real_pid;
-    
+  thread_info *p;
+  int thread_signal;
+  lwpid_t real_tid;
+  lwpid_t scan_tid;
+  ttstate_t state;
+  int real_pid;
+
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        printf( "Using loop over threads to step/resume with signals\n" );
+  if (debug_on)
+    printf ("Using loop over threads to step/resume with signals\n");
 #endif
 
-    /* First update the thread list.
-     */
-    set_all_unseen();
-    real_tid = map_from_gdb_tid( gdb_tid );
-    real_pid = get_pid_for( real_tid );
-    
-    scan_tid = get_process_first_stopped_thread_id( real_pid, &state );
-    while ( 0 != scan_tid ) {
-    
+  /* First update the thread list.
+   */
+  set_all_unseen ();
+  real_tid = map_from_gdb_tid (gdb_tid);
+  real_pid = get_pid_for (real_tid);
+
+  scan_tid = get_process_first_stopped_thread_id (real_pid, &state);
+  while (0 != scan_tid)
+    {
+
 #ifdef THREAD_DEBUG
-        /* FIX: later should check state is stopped;
-         * state.tts_flags & TTS_STATEMASK == TTS_WASSUSPENDED
-         */
-        if( debug_on )
-            if( state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED )
-                printf( "About to continue non-stopped thread %d\n", scan_tid );
+      /* FIX: later should check state is stopped;
+       * state.tts_flags & TTS_STATEMASK == TTS_WASSUSPENDED
+       */
+      if (debug_on)
+       if (state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED)
+         printf ("About to continue non-stopped thread %d\n", scan_tid);
 #endif
 
-        p = find_thread_info( scan_tid );
-        if( NULL == p ) {
-            add_tthread( real_pid, scan_tid );
-            p = find_thread_info( scan_tid );
-
-            /* This is either a newly-created thread or the
-             * result of a fork; in either case there's no
-             * actual event to worry about.
-             */
-            p->handled = 1;
-
-            if( state.tts_event != TTEVT_NONE ) {
-                /* Oops, do need to worry!
-                 */
-                warning( "Unexpected thread with \"%s\" event.",
-                    get_printable_name_of_ttrace_event( state.tts_event ));
-            }
-        }
-        else if( scan_tid != p->tid )
-            error( "Bad data in thread database." );
+      p = find_thread_info (scan_tid);
+      if (NULL == p)
+       {
+         add_tthread (real_pid, scan_tid);
+         p = find_thread_info (scan_tid);
+
+         /* This is either a newly-created thread or the
+          * result of a fork; in either case there's no
+          * actual event to worry about.
+          */
+         p->handled = 1;
+
+         if (state.tts_event != TTEVT_NONE)
+           {
+             /* Oops, do need to worry!
+              */
+             warning ("Unexpected thread with \"%s\" event.",
+                      get_printable_name_of_ttrace_event (state.tts_event));
+           }
+       }
+      else if (scan_tid != p->tid)
+       error ("Bad data in thread database.");
 
 #ifdef THREAD_DEBUG
-        if( debug_on )
-            if( p->terminated )
-                printf( "Why are we continuing a dead thread?\n" );
+      if (debug_on)
+       if (p->terminated)
+         printf ("Why are we continuing a dead thread?\n");
 #endif
 
-        p->seen = 1;
-            
-        scan_tid = get_process_next_stopped_thread_id( real_pid, &state );
+      p->seen = 1;
+
+      scan_tid = get_process_next_stopped_thread_id (real_pid, &state);
     }
 
-    /* Remove unseen threads.
-     */
-    update_thread_list();
+  /* Remove unseen threads.
+   */
+  update_thread_list ();
 
-    /* Now run down the thread list and continue or step.
-     */
-    for( p = thread_head.head; p; p = p->next ) {
-
-        /* Sanity check.
-         */
-        thread_dropping_event_check( p );
-
-        /* Pass the correct signals along.
-         */
-        if( p->have_signal ) {
-            thread_signal  = p->signal_value;
-            p->have_signal = 0;
-        }
-        else
-            thread_signal = 0;
-             
-        if( p->tid != real_tid ) {
-            /*
-             * Not the thread of interest, so continue it
-             * as the user expects.
-             */
-            if( p->stepping_mode == DO_STEP ) {
-                /* Just step this thread.
-                 */
-                call_ttrace(
-                     TT_LWP_SINGLE,
-                     p->tid,
-                     TT_USE_CURRENT_PC,
-                     (TTRACE_ARG_TYPE) target_signal_to_host( signal ),
-                     TT_NIL );
-            }
-            else {
-                /* Regular continue (default case).
-                 */
-                call_ttrace(
-                         TT_LWP_CONTINUE,
-                         p->tid,
-                         TT_USE_CURRENT_PC,
-                         (TTRACE_ARG_TYPE) target_signal_to_host( thread_signal ),
-                         TT_NIL );
-            }
-        }
-        else {
-           /* Step the thread of interest.
-            */
-            call_ttrace(
-                     TT_LWP_SINGLE,
-                     real_tid,
-                     TT_USE_CURRENT_PC,
-                     (TTRACE_ARG_TYPE) target_signal_to_host( signal ),
-                     TT_NIL );
-        }   
-    }   /* Loop over threads */
-}   /* End threads_continue_all_but_one */
+  /* Now run down the thread list and continue or step.
+   */
+  for (p = thread_head.head; p; p = p->next)
+    {
+
+      /* Sanity check.
+       */
+      thread_dropping_event_check (p);
+
+      /* Pass the correct signals along.
+       */
+      if (p->have_signal)
+       {
+         thread_signal = p->signal_value;
+         p->have_signal = 0;
+       }
+      else
+       thread_signal = 0;
+
+      if (p->tid != real_tid)
+       {
+         /*
+          * Not the thread of interest, so continue it
+          * as the user expects.
+          */
+         if (p->stepping_mode == DO_STEP)
+           {
+             /* Just step this thread.
+              */
+             call_ttrace (
+                           TT_LWP_SINGLE,
+                           p->tid,
+                           TT_USE_CURRENT_PC,
+                           (TTRACE_ARG_TYPE) target_signal_to_host (signal),
+                           TT_NIL);
+           }
+         else
+           {
+             /* Regular continue (default case).
+              */
+             call_ttrace (
+                           TT_LWP_CONTINUE,
+                           p->tid,
+                           TT_USE_CURRENT_PC,
+                   (TTRACE_ARG_TYPE) target_signal_to_host (thread_signal),
+                           TT_NIL);
+           }
+       }
+      else
+       {
+         /* Step the thread of interest.
+          */
+         call_ttrace (
+                       TT_LWP_SINGLE,
+                       real_tid,
+                       TT_USE_CURRENT_PC,
+                       (TTRACE_ARG_TYPE) target_signal_to_host (signal),
+                       TT_NIL);
+       }
+    }                          /* Loop over threads */
+}                              /* End threads_continue_all_but_one */
 
 /* Use a loop over the threads to continue all the threads.
  * This is done when a signal must be sent to any of the threads.
  */
 static void
-threads_continue_all_with_signals( gdb_tid, signal )
-    lwpid_t gdb_tid;
-    int     signal;
+threads_continue_all_with_signals (gdb_tid, signal)
+     lwpid_t gdb_tid;
+     int signal;
 {
-    thread_info  *p;
-    int           thread_signal;
-    lwpid_t       real_tid;
-    lwpid_t       scan_tid;
-    ttstate_t     state;
-    int           real_pid;
+  thread_info *p;
+  int thread_signal;
+  lwpid_t real_tid;
+  lwpid_t scan_tid;
+  ttstate_t state;
+  int real_pid;
 
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        printf( "Using loop over threads to resume with signals\n" );
+  if (debug_on)
+    printf ("Using loop over threads to resume with signals\n");
 #endif
 
-    /* Scan and update thread list.
-     */
-    set_all_unseen();
-    real_tid = map_from_gdb_tid( gdb_tid ); 
-    real_pid = get_pid_for( real_tid );
+  /* Scan and update thread list.
+   */
+  set_all_unseen ();
+  real_tid = map_from_gdb_tid (gdb_tid);
+  real_pid = get_pid_for (real_tid);
+
+  scan_tid = get_process_first_stopped_thread_id (real_pid, &state);
+  while (0 != scan_tid)
+    {
+
+#ifdef THREAD_DEBUG
+      if (debug_on)
+       if (state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED)
+         warning ("About to continue non-stopped thread %d\n", scan_tid);
+#endif
+
+      p = find_thread_info (scan_tid);
+      if (NULL == p)
+       {
+         add_tthread (real_pid, scan_tid);
+         p = find_thread_info (scan_tid);
+
+         /* This is either a newly-created thread or the
+          * result of a fork; in either case there's no
+          * actual event to worry about.
+          */
+         p->handled = 1;
+
+         if (state.tts_event != TTEVT_NONE)
+           {
+             /* Oops, do need to worry!
+              */
+             warning ("Unexpected thread with \"%s\" event.",
+                      get_printable_name_of_ttrace_event (state.tts_event));
+           }
+       }
 
-    scan_tid = get_process_first_stopped_thread_id( real_pid, &state );
-    while ( 0 != scan_tid ) {
-    
 #ifdef THREAD_DEBUG
-        if( debug_on )
-            if( state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED )
-                warning( "About to continue non-stopped thread %d\n", scan_tid );
+      if (debug_on)
+       if (p->terminated)
+         printf ("Why are we continuing a dead thread? (1)\n");
 #endif
 
-        p = find_thread_info( scan_tid );
-        if( NULL == p ) {
-            add_tthread( real_pid, scan_tid );
-            p = find_thread_info( scan_tid );
-
-            /* This is either a newly-created thread or the
-             * result of a fork; in either case there's no
-             * actual event to worry about.
-             */
-            p->handled = 1;
-
-            if( state.tts_event != TTEVT_NONE ) {
-                /* Oops, do need to worry!
-                 */
-                warning( "Unexpected thread with \"%s\" event.",
-                    get_printable_name_of_ttrace_event( state.tts_event ));
-            }
-        }
+      p->seen = 1;
 
-#ifdef THREAD_DEBUG
-        if( debug_on )
-            if( p->terminated )
-                printf( "Why are we continuing a dead thread? (1)\n" );
-#endif
+      scan_tid = get_process_next_stopped_thread_id (real_pid, &state);
+    }
 
-        p->seen = 1;
+  /* Remove unseen threads from our list.
+   */
+  update_thread_list ();
 
-        scan_tid = get_process_next_stopped_thread_id( real_pid, &state );
-    }
+  /* Continue the threads.
+   */
+  for (p = thread_head.head; p; p = p->next)
+    {
 
-    /* Remove unseen threads from our list.
-     */
-    update_thread_list();
+      /* Sanity check.
+       */
+      thread_dropping_event_check (p);
 
-    /* Continue the threads.
-     */
-    for( p = thread_head.head; p; p = p->next ) {
-
-        /* Sanity check.
-         */
-        thread_dropping_event_check( p );
-
-        /* Pass the correct signals along.
-         */
-        if( p->tid == real_tid ) {
-            thread_signal  = signal;
-            p->have_signal = 0;
-        }
-        else if( p->have_signal ) {
-            thread_signal  = p->signal_value;
-            p->have_signal = 0;
-        }
-        else
-            thread_signal  = 0;
-
-        if( p->stepping_mode == DO_STEP ) {
-            call_ttrace(
-                     TT_LWP_SINGLE,
-                     p->tid,
-                     TT_USE_CURRENT_PC,
-                     (TTRACE_ARG_TYPE) target_signal_to_host( signal ),
-                     TT_NIL );
-        }
-        else {
-            /* Continue this thread (default case).
-             */
-            call_ttrace(
-                    TT_LWP_CONTINUE,
-                    p->tid,
-                    TT_USE_CURRENT_PC,
-                    (TTRACE_ARG_TYPE) target_signal_to_host( thread_signal ),
-                    TT_NIL );
-        }
-    }
-}   /* End threads_continue_all_with_signals */
+      /* Pass the correct signals along.
+       */
+      if (p->tid == real_tid)
+       {
+         thread_signal = signal;
+         p->have_signal = 0;
+       }
+      else if (p->have_signal)
+       {
+         thread_signal = p->signal_value;
+         p->have_signal = 0;
+       }
+      else
+       thread_signal = 0;
+
+      if (p->stepping_mode == DO_STEP)
+       {
+         call_ttrace (
+                       TT_LWP_SINGLE,
+                       p->tid,
+                       TT_USE_CURRENT_PC,
+                       (TTRACE_ARG_TYPE) target_signal_to_host (signal),
+                       TT_NIL);
+       }
+      else
+       {
+         /* Continue this thread (default case).
+          */
+         call_ttrace (
+                       TT_LWP_CONTINUE,
+                       p->tid,
+                       TT_USE_CURRENT_PC,
+                   (TTRACE_ARG_TYPE) target_signal_to_host (thread_signal),
+                       TT_NIL);
+       }
+    }
+}                              /* End threads_continue_all_with_signals */
 
 /* Step one thread only.  
  */
 static void
-thread_fake_step( tid, signal )
-    lwpid_t            tid;
-    enum target_signal signal;
+thread_fake_step (tid, signal)
+     lwpid_t tid;
+     enum target_signal signal;
 {
-    thread_info *p;
+  thread_info *p;
 
 #ifdef THREAD_DEBUG
-    if( debug_on ) {
-        printf( "Doing a fake-step over a bpt, etc. for %d\n", tid );
+  if (debug_on)
+    {
+      printf ("Doing a fake-step over a bpt, etc. for %d\n", tid);
 
-        if( is_terminated( tid ))
-            printf( "Why are we continuing a dead thread? (4)\n" );
+      if (is_terminated (tid))
+       printf ("Why are we continuing a dead thread? (4)\n");
     }
 #endif
-          
-    if( doing_fake_step )
-        warning( "Step while step already in progress." );
 
-    /* See if there's a saved signal value for this
-     * thread to be passed on, but no current signal.
-     */
-    p = find_thread_info( tid );
-    if( p != NULL ) {
-        if( p->have_signal && signal == NULL ) {
-            /* Pass on a saved signal.
-             */
-            signal = p->signal_value;
-        }
-        
-        p->have_signal  = 0;
-    }
-
-    if( !p->handled )
-        warning( "Internal error: continuing unhandled thread." );
-        
-    call_ttrace( TT_LWP_SINGLE,
-                 tid,
-                 TT_USE_CURRENT_PC,
-                 (TTRACE_ARG_TYPE) target_signal_to_host (signal),
-                 TT_NIL );
-
-    /* Do bookkeeping so "call_ttrace_wait" knows it has to wait
-     * for this thread only, and clear any saved signal info.
-     */
-    doing_fake_step   = 1;
-    fake_step_tid     = tid;
+  if (doing_fake_step)
+    warning ("Step while step already in progress.");
+
+  /* See if there's a saved signal value for this
+   * thread to be passed on, but no current signal.
+   */
+  p = find_thread_info (tid);
+  if (p != NULL)
+    {
+      if (p->have_signal && signal == NULL)
+       {
+         /* Pass on a saved signal.
+          */
+         signal = p->signal_value;
+       }
+
+      p->have_signal = 0;
+    }
+
+  if (!p->handled)
+    warning ("Internal error: continuing unhandled thread.");
 
-}   /* End thread_fake_step */
+  call_ttrace (TT_LWP_SINGLE,
+              tid,
+              TT_USE_CURRENT_PC,
+              (TTRACE_ARG_TYPE) target_signal_to_host (signal),
+              TT_NIL);
+
+  /* Do bookkeeping so "call_ttrace_wait" knows it has to wait
+   * for this thread only, and clear any saved signal info.
+   */
+  doing_fake_step = 1;
+  fake_step_tid = tid;
+
+}                              /* End thread_fake_step */
 
 /* Continue one thread when a signal must be sent to it.
  */
 static void
-threads_continue_one_with_signal( gdb_tid, signal )
-    lwpid_t gdb_tid;
-    int     signal;
+threads_continue_one_with_signal (gdb_tid, signal)
+     lwpid_t gdb_tid;
+     int signal;
 {
-    thread_info  *p;
-    lwpid_t       real_tid;
-    int           real_pid;
-    
+  thread_info *p;
+  lwpid_t real_tid;
+  int real_pid;
+
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        printf( "Continuing one thread with a signal\n" );
+  if (debug_on)
+    printf ("Continuing one thread with a signal\n");
 #endif
 
-    real_tid = map_from_gdb_tid( gdb_tid );
-    real_pid = get_pid_for( real_tid );
+  real_tid = map_from_gdb_tid (gdb_tid);
+  real_pid = get_pid_for (real_tid);
 
-    p = find_thread_info( real_tid );
-    if( NULL == p ) {
-        add_tthread( real_pid, real_tid );
+  p = find_thread_info (real_tid);
+  if (NULL == p)
+    {
+      add_tthread (real_pid, real_tid);
     }
 
 #ifdef THREAD_DEBUG
-    if( debug_on )
-        if( p->terminated )
-            printf( "Why are we continuing a dead thread? (2)\n" );
+  if (debug_on)
+    if (p->terminated)
+      printf ("Why are we continuing a dead thread? (2)\n");
 #endif
 
-    if( !p->handled )
-        warning( "Internal error: continuing unhandled thread." );
-        
-    p->have_signal = 0;
-             
-    call_ttrace( TT_LWP_CONTINUE,
-                 gdb_tid,
-                 TT_USE_CURRENT_PC,
-                 (TTRACE_ARG_TYPE) target_signal_to_host( signal ),
-                 TT_NIL );
+  if (!p->handled)
+    warning ("Internal error: continuing unhandled thread.");
+
+  p->have_signal = 0;
+
+  call_ttrace (TT_LWP_CONTINUE,
+              gdb_tid,
+              TT_USE_CURRENT_PC,
+              (TTRACE_ARG_TYPE) target_signal_to_host (signal),
+              TT_NIL);
 }
 #endif
 
 #ifndef CHILD_RESUME
 
 /* Resume execution of the inferior process.
- *
+
  * This routine is in charge of setting the "handled" bits. 
  *
  *   If STEP is zero,      continue it.
@@ -4264,98 +4432,105 @@ threads_continue_one_with_signal( gdb_tid, signal )
  *       |                           user command.
  */
 void
-child_resume( gdb_tid, step, signal )
+child_resume (gdb_tid, step, signal)
      lwpid_t gdb_tid;
-     int     step;
+     int step;
      enum target_signal signal;
 {
-  int     resume_all_threads;
+  int resume_all_threads;
   lwpid_t tid;
-  process_state_t  new_process_state;
+  process_state_t new_process_state;
 
   resume_all_threads =
     (gdb_tid == INFTTRACE_ALL_THREADS) ||
     (vfork_in_flight);
 
-  if (resume_all_threads) {
-    /* Resume all threads, but first pick a tid value
-     * so we can get the pid when in call_ttrace doing
-     * the map.
-     */
-    if (vfork_in_flight)
-        tid = vforking_child_pid;
-    else
-        tid = map_from_gdb_tid( inferior_pid );
-  }
+  if (resume_all_threads)
+    {
+      /* Resume all threads, but first pick a tid value
+       * so we can get the pid when in call_ttrace doing
+       * the map.
+       */
+      if (vfork_in_flight)
+       tid = vforking_child_pid;
+      else
+       tid = map_from_gdb_tid (inferior_pid);
+    }
   else
-      tid = map_from_gdb_tid( gdb_tid );
+    tid = map_from_gdb_tid (gdb_tid);
 
 #ifdef THREAD_DEBUG
-  if( debug_on ) {
-      if( more_events_left )
-          printf( "More events; " );
+  if (debug_on)
+    {
+      if (more_events_left)
+       printf ("More events; ");
 
-      if( signal != 0 )
-          printf( "Sending signal %d; ", signal );
-      
-      if( resume_all_threads ) {
-          if( step == 0 )
-              printf( "Continue process %d\n", tid );
-          else
-              printf( "Step/continue thread %d\n", tid );
-      }
-      else {
-          if( step == 0 )
-              printf( "Continue thread %d\n", tid );
-          else
-              printf( "Step just thread %d\n", tid );
-      }
-
-      if( vfork_in_flight )
-          printf( "Vfork in flight\n" );
-  }
+      if (signal != 0)
+       printf ("Sending signal %d; ", signal);
+
+      if (resume_all_threads)
+       {
+         if (step == 0)
+           printf ("Continue process %d\n", tid);
+         else
+           printf ("Step/continue thread %d\n", tid);
+       }
+      else
+       {
+         if (step == 0)
+           printf ("Continue thread %d\n", tid);
+         else
+           printf ("Step just thread %d\n", tid);
+       }
+
+      if (vfork_in_flight)
+       printf ("Vfork in flight\n");
+    }
 #endif
 
-  if( process_state == RUNNING )
-      warning( "Internal error in resume logic; doing resume or step anyway." );
-      
-  if(   !step                    /* Asked to continue...       */
-     && resume_all_threads       /* whole process..            */
-     && signal != 0              /* with a signal...           */
-     && more_events_left > 0 ) { /* but we can't yet--save it! */
+  if (process_state == RUNNING)
+    warning ("Internal error in resume logic; doing resume or step anyway.");
+
+  if (!step                    /* Asked to continue...       */
+      && resume_all_threads    /* whole process..            */
+      && signal != 0           /* with a signal...           */
+      && more_events_left > 0)
+    {                          /* but we can't yet--save it! */
 
       /* Continue with signal means we have to set the pending
        * signal value for this thread.
        */
       thread_info *k;
-      
+
 #ifdef THREAD_DEBUG
-      if( debug_on )
-           printf( "Saving signal %d for thread %d\n", signal, tid );
+      if (debug_on)
+       printf ("Saving signal %d for thread %d\n", signal, tid);
 #endif
 
-       k = find_thread_info( tid );
-       if( k != NULL ) {
-           k->have_signal  = 1;
-           k->signal_value = signal;
+      k = find_thread_info (tid);
+      if (k != NULL)
+       {
+         k->have_signal = 1;
+         k->signal_value = signal;
 
 #ifdef THREAD_DEBUG
-           if( debug_on )
-               if( k->terminated )
-                   printf( "Why are we continuing a dead thread? (3)\n" );
+         if (debug_on)
+           if (k->terminated)
+             printf ("Why are we continuing a dead thread? (3)\n");
 #endif
 
-       }
+       }
 
 #ifdef THREAD_DEBUG
-       else if( debug_on ) {
-           printf( "No thread info for tid %d\n", tid );
-       }
+      else if (debug_on)
+       {
+         printf ("No thread info for tid %d\n", tid);
+       }
 #endif
-  }
+    }
 
   /* Are we faking this "continue" or "step"?
-   *
+
    * We used to do steps by continuing all the threads for 
    * which the events had been handled already.  While
    * conceptually nicer (hides it all in a lower level), this
@@ -4364,57 +4539,63 @@ child_resume( gdb_tid, step, signal )
    * and one thread is in the join, and the user wants to step that
    * thread).
    */
-  if( resume_all_threads       /* Whole process, therefore user command */
-   && more_events_left > 0 ) { /* But we can't do this yet--fake it! */
+  if (resume_all_threads       /* Whole process, therefore user command */
+      && more_events_left > 0)
+    {                          /* But we can't do this yet--fake it! */
       thread_info *p;
-      
-      if( !step ) {
-          /* No need to do any notes on a per-thread
-           * basis--we're done!
-           */
+
+      if (!step)
+       {
+         /* No need to do any notes on a per-thread
+          * basis--we're done!
+          */
 #ifdef WAIT_BUFFER_DEBUG
-          if( debug_on )
-              printf( "Faking a process resume.\n" );
+         if (debug_on)
+           printf ("Faking a process resume.\n");
 #endif
 
-          return;
-      }
-      else {
+         return;
+       }
+      else
+       {
 
 #ifdef WAIT_BUFFER_DEBUG
-          if( debug_on )
-              printf( "Faking a process step.\n" );
+         if (debug_on)
+           printf ("Faking a process step.\n");
 #endif
 
-      }
-      
-      p = find_thread_info( tid );
-      if( p == NULL ) {
-          warning( "No thread information for tid %d, 'next' command ignored.\n", tid );
-          return;
-      }
-      else {
+       }
+
+      p = find_thread_info (tid);
+      if (p == NULL)
+       {
+         warning ("No thread information for tid %d, 'next' command ignored.\n", tid);
+         return;
+       }
+      else
+       {
 
 #ifdef THREAD_DEBUG
-          if( debug_on )
-              if( p->terminated )
-                  printf( "Why are we continuing a dead thread? (3.5)\n" );
+         if (debug_on)
+           if (p->terminated)
+             printf ("Why are we continuing a dead thread? (3.5)\n");
 #endif
 
-          if( p->stepping_mode != DO_DEFAULT ) {
-              warning( "Step or continue command applied to thread which is already stepping or continuing; command ignored." );
+         if (p->stepping_mode != DO_DEFAULT)
+           {
+             warning ("Step or continue command applied to thread which is already stepping or continuing; command ignored.");
 
-              return;
-          }
+             return;
+           }
 
-          if( step )
-              p->stepping_mode = DO_STEP;
-          else
-              p->stepping_mode = DO_CONTINUE;
+         if (step)
+           p->stepping_mode = DO_STEP;
+         else
+           p->stepping_mode = DO_CONTINUE;
 
-          return;
-      }   /* Have thread info */
-  }   /* Must fake step or go */
+         return;
+       }                       /* Have thread info */
+    }                          /* Must fake step or go */
 
   /* Execept for fake-steps, from here on we know we are
    * going to wind up with a running process which will
@@ -4431,39 +4612,43 @@ child_resume( gdb_tid, step, signal )
    * continue request (by setting breakpoints on all possible successor
    * instructions), so we don't have to worry about that here.
    */
-  if (step) {
-      if( resume_all_threads ) {
-          /*
-           * Regular user step: other threads get a "continue".
-           */
-          threads_continue_all_but_one( tid, signal );
-          clear_all_handled();
-          clear_all_stepping_mode();
-      }
-
-      else {
-          /* "Fake step": gdb is stepping one thread over a
-           * breakpoint, watchpoint, or out of a library load
-           * event, etc.  The rest just stay where they are.
-           *
-           * Also used when there are pending events: we really
-           * step the current thread, but leave the rest stopped.
-           * Users can't request this, but "wait_for_inferior"
-           * does--a lot!
-           */
-          thread_fake_step( tid, signal );
-
-          /* Clear the "handled" state of this thread, because
-           * we'll soon get a new event for it.  Other events
-           * stay as they were.
-           */
-          clear_handled( tid );
-          clear_stepping_mode( tid );
-          new_process_state = FAKE_STEPPING;
-      }
-  }
-  
-  else {
+  if (step)
+    {
+      if (resume_all_threads)
+       {
+         /*
+          * Regular user step: other threads get a "continue".
+          */
+         threads_continue_all_but_one (tid, signal);
+         clear_all_handled ();
+         clear_all_stepping_mode ();
+       }
+
+      else
+       {
+         /* "Fake step": gdb is stepping one thread over a
+          * breakpoint, watchpoint, or out of a library load
+          * event, etc.  The rest just stay where they are.
+          *
+          * Also used when there are pending events: we really
+          * step the current thread, but leave the rest stopped.
+          * Users can't request this, but "wait_for_inferior"
+          * does--a lot!
+          */
+         thread_fake_step (tid, signal);
+
+         /* Clear the "handled" state of this thread, because
+          * we'll soon get a new event for it.  Other events
+          * stay as they were.
+          */
+         clear_handled (tid);
+         clear_stepping_mode (tid);
+         new_process_state = FAKE_STEPPING;
+       }
+    }
+
+  else
+    {
       /* TT_LWP_CONTINUE can pass signals to threads,
        * TT_PROC_CONTINUE can't.  So if there are any
        * signals to pass, we have to use the (slower)
@@ -4472,97 +4657,105 @@ child_resume( gdb_tid, step, signal )
        * Equally, if we have to not continue some threads,
        * due to saved events, we have to use the loop.
        */
-      if( (signal != 0) || saved_signals_exist()) {
-          if( resume_all_threads ) {
+      if ((signal != 0) || saved_signals_exist ())
+       {
+         if (resume_all_threads)
+           {
 
 #ifdef THREAD_DEBUG
-              if( debug_on )
-                  printf( "Doing a continue by loop of all threads\n" );
+             if (debug_on)
+               printf ("Doing a continue by loop of all threads\n");
 #endif
 
-              threads_continue_all_with_signals( tid, signal );
+             threads_continue_all_with_signals (tid, signal);
 
-              clear_all_handled();
-              clear_all_stepping_mode();
-          }
+             clear_all_handled ();
+             clear_all_stepping_mode ();
+           }
 
-          else {
+         else
+           {
 #ifdef THREAD_DEBUG
-              printf( "Doing a continue w/signal of just thread %d\n", tid );
+             printf ("Doing a continue w/signal of just thread %d\n", tid);
 #endif
 
-              threads_continue_one_with_signal( tid, signal );
-
-              /* Clear the "handled" state of this thread, because
-               * we'll soon get a new event for it.  Other events
-               * can stay as they were.
-               */
-              clear_handled( tid );
-              clear_stepping_mode( tid );
-          }
-      }
-
-      else {
-          /* No signals to send.
-           */
-          if( resume_all_threads ) {
+             threads_continue_one_with_signal (tid, signal);
+
+             /* Clear the "handled" state of this thread, because
+              * we'll soon get a new event for it.  Other events
+              * can stay as they were.
+              */
+             clear_handled (tid);
+             clear_stepping_mode (tid);
+           }
+       }
+
+      else
+       {
+         /* No signals to send.
+          */
+         if (resume_all_threads)
+           {
 #ifdef THREAD_DEBUG
-              if( debug_on )
-                  printf( "Doing a continue by process of process %d\n", tid );
+             if (debug_on)
+               printf ("Doing a continue by process of process %d\n", tid);
 #endif
 
-              if( more_events_left > 0 ) {
-                  warning( "Losing buffered events on continue." );
-                  more_events_left = 0;
-              }
+             if (more_events_left > 0)
+               {
+                 warning ("Losing buffered events on continue.");
+                 more_events_left = 0;
+               }
 
-              call_ttrace( TT_PROC_CONTINUE,
-                           tid,
-                           TT_NIL,
-                           TT_NIL,
-                           TT_NIL );
+             call_ttrace (TT_PROC_CONTINUE,
+                          tid,
+                          TT_NIL,
+                          TT_NIL,
+                          TT_NIL);
 
-              clear_all_handled();
-              clear_all_stepping_mode();
-          }
+             clear_all_handled ();
+             clear_all_stepping_mode ();
+           }
 
-          else {
+         else
+           {
 #ifdef THREAD_DEBUG
-              if( debug_on ) {
-                  printf( "Doing a continue of just thread %d\n", tid );
-                  if( is_terminated( tid ))
-                       printf( "Why are we continuing a dead thread? (5)\n" );
-              }
+             if (debug_on)
+               {
+                 printf ("Doing a continue of just thread %d\n", tid);
+                 if (is_terminated (tid))
+                   printf ("Why are we continuing a dead thread? (5)\n");
+               }
 #endif
 
-              call_ttrace( TT_LWP_CONTINUE,
-                           tid,
-                           TT_NIL,
-                           TT_NIL,
-                           TT_NIL );
-
-              /* Clear the "handled" state of this thread, because
-               * we'll soon get a new event for it.  Other events
-               * can stay as they were.
-               */
-              clear_handled( tid );
-              clear_stepping_mode( tid );
-          }
-      }
-  }
+             call_ttrace (TT_LWP_CONTINUE,
+                          tid,
+                          TT_NIL,
+                          TT_NIL,
+                          TT_NIL);
+
+             /* Clear the "handled" state of this thread, because
+              * we'll soon get a new event for it.  Other events
+              * can stay as they were.
+              */
+             clear_handled (tid);
+             clear_stepping_mode (tid);
+           }
+       }
+    }
 
   process_state = new_process_state;
 
 #ifdef WAIT_BUFFER_DEBUG
-  if( debug_on )
-      printf( "Process set to %s\n",
-              get_printable_name_of_process_state (process_state) );
+  if (debug_on)
+    printf ("Process set to %s\n",
+           get_printable_name_of_process_state (process_state));
 #endif
 
 }
 #endif /* CHILD_RESUME */
-
 \f
+
 #ifdef ATTACH_DETACH
 /*
  * Like it says.
@@ -4572,20 +4765,20 @@ child_resume( gdb_tid, step, signal )
  * 
  */
 static void
-update_thread_state_after_attach( pid, kind_of_go )
-  int               pid;
-  attach_continue_t kind_of_go;
+update_thread_state_after_attach (pid, kind_of_go)
+     int pid;
+     attach_continue_t kind_of_go;
 {
-  int        tt_status;
-  ttstate_t  thread_state;
-  lwpid_t    a_thread;
-  lwpid_t    tid;
+  int tt_status;
+  ttstate_t thread_state;
+  lwpid_t a_thread;
+  lwpid_t tid;
 
   /* The process better be stopped.
    */
-  ifprocess_state != STOPPED
-   && process_state != VFORKING )
-      warning( "Internal error attaching." );
+  if (process_state != STOPPED
+      && process_state != VFORKING)
+    warning ("Internal error attaching.");
 
   /* Clear out old tthread info and start over.  This has the
    * side effect of ensuring that the TRAP is reported as being
@@ -4596,7 +4789,7 @@ update_thread_state_after_attach( pid, kind_of_go )
    * "require_notification_of_events" doesn't clear the thread
    * info (it's called later than this routine).
    */
-  clear_thread_info();
+  clear_thread_info ();
   a_thread = 0;
 
   for (tid = get_process_first_stopped_thread_id (pid, &thread_state);
@@ -4604,16 +4797,16 @@ update_thread_state_after_attach( pid, kind_of_go )
        tid = get_process_next_stopped_thread_id (pid, &thread_state))
     {
       thread_info *p;
-    
+
       if (a_thread == 0)
-        {
-          a_thread = tid;
+       {
+         a_thread = tid;
 #ifdef THREAD_DEBUG
-          if( debug_on )
-              printf( "Attaching to process %d, thread %d\n",
-                      pid, a_thread );
+         if (debug_on)
+           printf ("Attaching to process %d, thread %d\n",
+                   pid, a_thread);
 #endif
-        }
+       }
 
       /* Tell ourselves and the "rest of gdb" that this thread
        * exists.
@@ -4628,76 +4821,80 @@ update_thread_state_after_attach( pid, kind_of_go )
        * NOTE: it probably isn't the originating thread,
        *       but that doesn't matter (we hope!).
        */
-      add_tthread( pid, tid );
-      p = find_thread_info( tid );
-      if( NULL == p ) /* ?We just added it! */
-          error( "Internal error adding a thread on attach." );
-          
-      copy_ttstate_t( &p->last_stop_state, thread_state );
+      add_tthread (pid, tid);
+      p = find_thread_info (tid);
+      if (NULL == p)           /* ?We just added it! */
+       error ("Internal error adding a thread on attach.");
+
+      copy_ttstate_t (&p->last_stop_state, thread_state);
       p->have_state = 1;
-      
-      if( DO_ATTACH_CONTINUE == kind_of_go ) {
-          /*
-           * If we are going to CONTINUE afterwards,
-           * raising a SIGTRAP, don't bother trying to
-           * handle this event.  But check first!
-           */
-          switch( p->last_stop_state.tts_event ) {
-
-          case TTEVT_NONE:
-             /* Ok to set this handled.
-              */
-              break;
-
-          default:
-              warning( "Internal error; skipping event %s on process %d, thread %d.",
-                  get_printable_name_of_ttrace_event(
-                       p->last_stop_state.tts_event ),
-                  p->pid, p->tid);
-          }
-
-          set_handled( pid, tid );
-
-      }
-      else {
-          /* There will be no "continue" opertion, so the
-           * process remains stopped.  Don't set any events
-           * handled except the "gimmies".
-           */
-          switch( p->last_stop_state.tts_event ) {
-
-          case TTEVT_NONE:
-              /* Ok to ignore this.
-               */
-              set_handled( pid, tid );
-              break;
-
-          case TTEVT_EXEC:
-          case TTEVT_FORK:
-              /* Expected "other" FORK or EXEC event from a
-               * fork or vfork.
-               */
-              break;
-
-          default:
-              printf( "Internal error: failed to handle event %s on process %d, thread %d.",
-                  get_printable_name_of_ttrace_event(
-                       p->last_stop_state.tts_event ),
-                  p->pid, p->tid);
-          }
-      }
-      
-      add_thread( tid );       /* in thread.c */
+
+      if (DO_ATTACH_CONTINUE == kind_of_go)
+       {
+         /*
+          * If we are going to CONTINUE afterwards,
+          * raising a SIGTRAP, don't bother trying to
+          * handle this event.  But check first!
+          */
+         switch (p->last_stop_state.tts_event)
+           {
+
+           case TTEVT_NONE:
+             /* Ok to set this handled.
+              */
+             break;
+
+           default:
+             warning ("Internal error; skipping event %s on process %d, thread %d.",
+                      get_printable_name_of_ttrace_event (
+                                             p->last_stop_state.tts_event),
+                      p->pid, p->tid);
+           }
+
+         set_handled (pid, tid);
+
+       }
+      else
+       {
+         /* There will be no "continue" opertion, so the
+          * process remains stopped.  Don't set any events
+          * handled except the "gimmies".
+          */
+         switch (p->last_stop_state.tts_event)
+           {
+
+           case TTEVT_NONE:
+             /* Ok to ignore this.
+              */
+             set_handled (pid, tid);
+             break;
+
+           case TTEVT_EXEC:
+           case TTEVT_FORK:
+             /* Expected "other" FORK or EXEC event from a
+              * fork or vfork.
+              */
+             break;
+
+           default:
+             printf ("Internal error: failed to handle event %s on process %d, thread %d.",
+                     get_printable_name_of_ttrace_event (
+                                             p->last_stop_state.tts_event),
+                     p->pid, p->tid);
+           }
+       }
+
+      add_thread (tid);                /* in thread.c */
     }
+
 #ifdef PARANOIA
-    if( debug_on )
-        print_tthreads();
+  if (debug_on)
+    print_tthreads ();
 #endif
 
   /* One mustn't call ttrace_wait() after attaching via ttrace,
      'cause the process is stopped already.
-     
+
      However, the upper layers of gdb's execution control will
      want to wait after attaching (but not after forks, in
      which case they will be doing a "target_resume", anticipating
@@ -4712,46 +4909,47 @@ update_thread_state_after_attach( pid, kind_of_go )
      need one that's either TTS_WASRUNNING--but we've stopped
      it and made it TTS_WASSUSPENDED.  Hum...FIXME!)
    */
-  if( DO_ATTACH_CONTINUE == kind_of_go ) {
-      tt_status = call_real_ttrace(
-                      TT_LWP_CONTINUE,
-                      pid,
-                      a_thread,
-                      TT_USE_CURRENT_PC,
-                      (TTRACE_ARG_TYPE) target_signal_to_host (TARGET_SIGNAL_TRAP),
-                      TT_NIL);
+  if (DO_ATTACH_CONTINUE == kind_of_go)
+    {
+      tt_status = call_real_ttrace (
+                                    TT_LWP_CONTINUE,
+                                    pid,
+                                    a_thread,
+                                    TT_USE_CURRENT_PC,
+              (TTRACE_ARG_TYPE) target_signal_to_host (TARGET_SIGNAL_TRAP),
+                                    TT_NIL);
       if (errno)
-          perror_with_name ("ttrace");
+       perror_with_name ("ttrace");
 
-      clear_handled( a_thread );  /* So TRAP will be reported. */
+      clear_handled (a_thread);        /* So TRAP will be reported. */
 
       /* Now running.
        */
       process_state = RUNNING;
-  }
+    }
 
   attach_flag = 1;
 }
 #endif /* ATTACH_DETACH */
-
 \f
+
 #ifdef ATTACH_DETACH
 /* Start debugging the process whose number is PID.
  * (A _real_ pid).
  */
 int
-attach( pid )
+attach (pid)
      int pid;
 {
-  int       tt_status;
-  
+  int tt_status;
+
   tt_status = call_real_ttrace (
-                           TT_PROC_ATTACH,
-                           pid,
-                           (lwpid_t) TT_NIL,
-                           TT_NIL,
-                           (TTRACE_ARG_TYPE) TT_VERSION,
-                           TT_NIL);
+                                TT_PROC_ATTACH,
+                                pid,
+                                (lwpid_t) TT_NIL,
+                                TT_NIL,
+                                (TTRACE_ARG_TYPE) TT_VERSION,
+                                TT_NIL);
   if (errno)
     perror_with_name ("ttrace attach");
 
@@ -4764,7 +4962,7 @@ attach( pid )
    * the attach, so make sure the inferior is
    * running when we're done.
    */
-  update_thread_state_after_attach( pid, DO_ATTACH_CONTINUE );
+  update_thread_state_after_attach (pid, DO_ATTACH_CONTINUE);
 
   return pid;
 }
@@ -4773,11 +4971,11 @@ attach( pid )
 #if defined(CHILD_POST_ATTACH)
 void
 child_post_attach (pid)
-  int  pid;
+     int pid;
 {
 #ifdef THREAD_DEBUG
-  if( debug_on )
-      printf( "child-post-attach call\n" );
+  if (debug_on)
+    printf ("child-post-attach call\n");
 #endif
 
   require_notification_of_events (pid);
@@ -4790,24 +4988,24 @@ child_post_attach (pid)
    SIGNAL = 0 means just continue it.
  */
 void
-detach( signal )
+detach (signal)
      int signal;
 {
   errno = 0;
   call_ttrace (TT_PROC_DETACH,
-               inferior_pid,
-               TT_NIL,
-               (TTRACE_ARG_TYPE) signal,
-               TT_NIL);
+              inferior_pid,
+              TT_NIL,
+              (TTRACE_ARG_TYPE) signal,
+              TT_NIL);
   attach_flag = 0;
 
-  clear_thread_info();
+  clear_thread_info ();
 
   /* Process-state? */
 }
 #endif /* ATTACH_DETACH */
-
 \f
+
 /* Default the type of the ttrace transfer to int.  */
 #ifndef TTRACE_XFER_TYPE
 #define TTRACE_XFER_TYPE int
@@ -4828,7 +5026,7 @@ _initialize_kernel_u_addr ()
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.
-  
+
    Returns the length copied, which is either the LEN argument or zero.
    This xfer function does not do partial moves, since child_ops
    doesn't allow memory operations to cross below us in the target stack
@@ -4840,40 +5038,41 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & - sizeof (TTRACE_XFER_TYPE);
+  register CORE_ADDR addr = memaddr & -sizeof (TTRACE_XFER_TYPE);
   /* Round ending address up; get number of longwords that makes.  */
   register int count
-    = (((memaddr + len) - addr) + sizeof (TTRACE_XFER_TYPE) - 1)
-      / sizeof (TTRACE_XFER_TYPE);
+  = (((memaddr + len) - addr) + sizeof (TTRACE_XFER_TYPE) - 1)
+  / sizeof (TTRACE_XFER_TYPE);
   /* Allocate buffer of that many longwords.  */
   register TTRACE_XFER_TYPE *buffer
-    = (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE));
+  = (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE));
 
   if (write)
     {
       /* Fill start and end extra bytes of buffer with existing memory data.  */
 
-      if (addr != memaddr || len < (int) sizeof (TTRACE_XFER_TYPE)) {
-       /* Need part of initial word -- fetch it.  */
-        buffer[0] = call_ttrace (TT_LWP_RDTEXT,
-                                 inferior_pid,
-                                 (TTRACE_ARG_TYPE) addr,
-                                 TT_NIL,
-                                 TT_NIL);
-      }
+      if (addr != memaddr || len < (int) sizeof (TTRACE_XFER_TYPE))
+       {
+         /* Need part of initial word -- fetch it.  */
+         buffer[0] = call_ttrace (TT_LWP_RDTEXT,
+                                  inferior_pid,
+                                  (TTRACE_ARG_TYPE) addr,
+                                  TT_NIL,
+                                  TT_NIL);
+       }
 
       if (count > 1)           /* FIXME, avoid if even boundary */
        {
          buffer[count - 1] = call_ttrace (TT_LWP_RDTEXT,
-                                           inferior_pid,
-                                           ((TTRACE_ARG_TYPE)
-                                            (addr + (count - 1) * sizeof (TTRACE_XFER_TYPE))),
-                                           TT_NIL,
-                                           TT_NIL);
+                                          inferior_pid,
+                                          ((TTRACE_ARG_TYPE)
+                         (addr + (count - 1) * sizeof (TTRACE_XFER_TYPE))),
+                                          TT_NIL,
+                                          TT_NIL);
        }
 
       /* Copy data to be written over corresponding part of buffer */
@@ -4888,20 +5087,20 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
        {
          errno = 0;
          call_ttrace (TT_LWP_WRDATA,
-                       inferior_pid,
-                       (TTRACE_ARG_TYPE) addr,
-                       (TTRACE_ARG_TYPE) buffer[i],
-                       TT_NIL);
+                      inferior_pid,
+                      (TTRACE_ARG_TYPE) addr,
+                      (TTRACE_ARG_TYPE) buffer[i],
+                      TT_NIL);
          if (errno)
            {
              /* Using the appropriate one (I or D) is necessary for
-                Gould NP1, at least.  */
+                Gould NP1, at least.  */
              errno = 0;
              call_ttrace (TT_LWP_WRTEXT,
-                           inferior_pid,
-                           (TTRACE_ARG_TYPE) addr,
-                           (TTRACE_ARG_TYPE) buffer[i],
-                           TT_NIL);
+                          inferior_pid,
+                          (TTRACE_ARG_TYPE) addr,
+                          (TTRACE_ARG_TYPE) buffer[i],
+                          TT_NIL);
            }
          if (errno)
            return 0;
@@ -4914,10 +5113,10 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
        {
          errno = 0;
          buffer[i] = call_ttrace (TT_LWP_RDTEXT,
-                                   inferior_pid,
-                                   (TTRACE_ARG_TYPE) addr,
-                                   TT_NIL,
-                                   TT_NIL);
+                                  inferior_pid,
+                                  (TTRACE_ARG_TYPE) addr,
+                                  TT_NIL,
+                                  TT_NIL);
          if (errno)
            return 0;
          QUIT;
@@ -4930,19 +5129,19 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
     }
   return len;
 }
-
 \f
+
 static void
 udot_info ()
 {
-  int udot_off;                /* Offset into user struct */
-  int udot_val;                /* Value from user struct at udot_off */
-  char mess[128];      /* For messages */
+  int udot_off;                        /* Offset into user struct */
+  int udot_val;                        /* Value from user struct at udot_off */
+  char mess[128];              /* For messages */
 
-   if (!target_has_execution)
-     {
-       error ("The program is not being run.");
-     }
+  if (!target_has_execution)
+    {
+      error ("The program is not being run.");
+    }
 
 #if !defined (KERNEL_U_SIZE)
 
@@ -4965,10 +5164,10 @@ udot_info ()
          printf_filtered ("%04x:", udot_off);
        }
       udot_val = call_ttrace (TT_LWP_RUREGS,
-                              inferior_pid,
-                              (TTRACE_ARG_TYPE) udot_off,
-                              TT_NIL,
-                              TT_NIL);
+                             inferior_pid,
+                             (TTRACE_ARG_TYPE) udot_off,
+                             TT_NIL,
+                             TT_NIL);
       if (errno != 0)
        {
          sprintf (mess, "\nreading user struct at offset 0x%x", udot_off);
@@ -4987,25 +5186,25 @@ udot_info ()
  */
 char *
 child_pid_to_exec_file (tid)
-    int  tid;
+     int tid;
 {
-  static char  exec_file_buffer[1024];
-  int  tt_status;
-  CORE_ADDR  top_of_stack;
-  char  four_chars[4];
-  int  name_index;
-  int  i;
-  int  done;
-  int  saved_inferior_pid;
-  
+  static char exec_file_buffer[1024];
+  int tt_status;
+  CORE_ADDR top_of_stack;
+  char four_chars[4];
+  int name_index;
+  int i;
+  int done;
+  int saved_inferior_pid;
+
   /* As of 10.x HP-UX, there's an explicit request to get the
    *pathname.
    */
   tt_status = call_ttrace (TT_PROC_GET_PATHNAME,
-                           tid,
-                           (TTRACE_ARG_TYPE) exec_file_buffer,
-                           (TTRACE_ARG_TYPE) sizeof (exec_file_buffer) - 1,
-                           TT_NIL);
+                          tid,
+                          (TTRACE_ARG_TYPE) exec_file_buffer,
+                          (TTRACE_ARG_TYPE) sizeof (exec_file_buffer) - 1,
+                          TT_NIL);
   if (tt_status >= 0)
     return exec_file_buffer;
 
@@ -5017,7 +5216,7 @@ child_pid_to_exec_file (tid)
      In any case, if it fails, try a really, truly amazingly gross
      hack that DDE uses, of pawing through the process' data
      segment to find the pathname.
-     */
+   */
   top_of_stack = 0x7b03a000;
   name_index = 0;
   done = 0;
@@ -5025,25 +5224,27 @@ child_pid_to_exec_file (tid)
   /* On the chance that pid != inferior_pid, set inferior_pid
      to pid, so that (grrrr!) implicit uses of inferior_pid get
      the right id.
-     */
+   */
   saved_inferior_pid = inferior_pid;
   inferior_pid = tid;
 
   /* Try to grab a null-terminated string. */
-  while (! done) {
-    if (target_read_memory (top_of_stack, four_chars, 4) != 0)
-      {
-        inferior_pid = saved_inferior_pid;
-        return NULL;
-      }
-    for (i = 0; i < 4; i++) {
-      exec_file_buffer[name_index++] = four_chars[i];
-      done = (four_chars[i] == '\0');
-      if (done)
-        break;
-    }
-    top_of_stack += 4;
-  }
+  while (!done)
+    {
+      if (target_read_memory (top_of_stack, four_chars, 4) != 0)
+       {
+         inferior_pid = saved_inferior_pid;
+         return NULL;
+       }
+      for (i = 0; i < 4; i++)
+       {
+         exec_file_buffer[name_index++] = four_chars[i];
+         done = (four_chars[i] == '\0');
+         if (done)
+           break;
+       }
+      top_of_stack += 4;
+    }
 
   if (exec_file_buffer[0] == '\0')
     {
@@ -5059,19 +5260,21 @@ child_pid_to_exec_file (tid)
 void
 pre_fork_inferior ()
 {
-  int  status;
+  int status;
 
   status = pipe (startup_semaphore.parent_channel);
-  if (status < 0) {
+  if (status < 0)
+    {
       warning ("error getting parent pipe for startup semaphore");
       return;
-  }
+    }
 
   status = pipe (startup_semaphore.child_channel);
-  if (status < 0) {
+  if (status < 0)
+    {
       warning ("error getting child pipe for startup semaphore");
       return;
-  }
+    }
 }
 
 /* Called via #define REQUIRE_ATTACH from inftarg.c,
@@ -5085,14 +5288,14 @@ pre_fork_inferior ()
  */
 int
 hppa_require_attach (pid)
-  int  pid;
+     int pid;
 {
-  int             tt_status;
-  CORE_ADDR       pc;
-  CORE_ADDR       pc_addr;
-  unsigned int    regs_offset;
+  int tt_status;
+  CORE_ADDR pc;
+  CORE_ADDR pc_addr;
+  unsigned int regs_offset;
   process_state_t old_process_state = process_state;
-  
+
   /* Are we already attached?  There appears to be no explicit
    * way to answer this via ttrace, so we try something which
    * should be innocuous if we are attached.  If that fails,
@@ -5101,53 +5304,53 @@ hppa_require_attach (pid)
    */
   errno = 0;
   tt_status = call_real_ttrace (TT_PROC_STOP,
-                                pid,
-                                (lwpid_t) TT_NIL,
-                                (TTRACE_ARG_TYPE) TT_NIL,
-                                (TTRACE_ARG_TYPE) TT_NIL,
-                                TT_NIL);
-  
+                               pid,
+                               (lwpid_t) TT_NIL,
+                               (TTRACE_ARG_TYPE) TT_NIL,
+                               (TTRACE_ARG_TYPE) TT_NIL,
+                               TT_NIL);
+
   if (errno)
     {
       /* No change to process-state!
        */
       errno = 0;
-      pid   = attach (pid);
+      pid = attach (pid);
     }
   else
     {
-     /* If successful, the process is now stopped.  But if
-      * we're VFORKING, the parent is still running, so don't
-      * change the process state.
-      */
-     if( process_state != VFORKING )
-         process_state = STOPPED;
-
-     /* If we were already attached, you'd think that we
-      * would need to start going again--but you'd be wrong,
-      * as the fork-following code is actually in the middle
-      * of the "resume" routine in in "infrun.c" and so
-      * will (almost) immediately do a resume.
-      *
-      * On the other hand, if we are VFORKING, which means
-      * that the child and the parent share a process for a
-      * while, we know that "resume" won't be resuming
-      * until the child EXEC event is seen.  But we still
-      * don't want to continue, as the event is already
-      * there waiting.
-      */
-     update_thread_state_after_attach( pid, DONT_ATTACH_CONTINUE );
-    }   /* STOP succeeded */
-    
+      /* If successful, the process is now stopped.  But if
+       * we're VFORKING, the parent is still running, so don't
+       * change the process state.
+       */
+      if (process_state != VFORKING)
+       process_state = STOPPED;
+
+      /* If we were already attached, you'd think that we
+       * would need to start going again--but you'd be wrong,
+       * as the fork-following code is actually in the middle
+       * of the "resume" routine in in "infrun.c" and so
+       * will (almost) immediately do a resume.
+       *
+       * On the other hand, if we are VFORKING, which means
+       * that the child and the parent share a process for a
+       * while, we know that "resume" won't be resuming
+       * until the child EXEC event is seen.  But we still
+       * don't want to continue, as the event is already
+       * there waiting.
+       */
+      update_thread_state_after_attach (pid, DONT_ATTACH_CONTINUE);
+    }                          /* STOP succeeded */
+
   return pid;
 }
 
 int
 hppa_require_detach (pid, signal)
-  int  pid;
-  int  signal;
+     int pid;
+     int signal;
 {
-  int  tt_status;
+  int tt_status;
 
   /* If signal is non-zero, we must pass the signal on to the active
      thread prior to detaching.  We do this by continuing the threads
@@ -5156,31 +5359,31 @@ hppa_require_detach (pid, signal)
   if (signal != 0)
     {
       errno = 0;
-      threads_continue_all_with_signals( pid, signal );
+      threads_continue_all_with_signals (pid, signal);
     }
 
   errno = 0;
   tt_status = call_ttrace (TT_PROC_DETACH,
-                           pid,
-                           TT_NIL,
-                           TT_NIL,
-                           TT_NIL);
+                          pid,
+                          TT_NIL,
+                          TT_NIL,
+                          TT_NIL);
 
-  errno = 0; /* Ignore any errors. */
+  errno = 0;                   /* Ignore any errors. */
 
   /* process_state? */
-  
+
   return pid;
 }
 
 /* Given the starting address of a memory page, hash it to a bucket in
    the memory page dictionary.
  */
+ */
 static int
 get_dictionary_bucket_of_page (page_start)
-  CORE_ADDR  page_start;
+     CORE_ADDR page_start;
 {
-  int  hash;
+  int hash;
 
   hash = (page_start / memory_page_dictionary.page_size);
   hash = hash % MEMORY_PAGE_DICTIONARY_BUCKET_COUNT;
@@ -5193,35 +5396,35 @@ get_dictionary_bucket_of_page (page_start)
    or create a new) dictionary entry for the page.  The page will be
    write-protected when this function returns, but may have a reference
    count of 0 (if the page was newly-added to the dictionary).
  */
+ */
 static memory_page_t *
 get_dictionary_entry_of_page (pid, page_start)
-  int  pid;
-  CORE_ADDR  page_start;
+     int pid;
+     CORE_ADDR page_start;
 {
-  int  bucket;
-  memory_page_t *  page = NULL;
-  memory_page_t *  previous_page = NULL;
+  int bucket;
+  memory_page_t *page = NULL;
+  memory_page_t *previous_page = NULL;
 
   /* We're going to be using the dictionary now, than-kew. */
   require_memory_page_dictionary (pid);
 
   /* Try to find an existing dictionary entry for this page.  Hash
      on the page's starting address.
-     */
+   */
   bucket = get_dictionary_bucket_of_page (page_start);
   page = &memory_page_dictionary.buckets[bucket];
   while (page != NULL)
     {
       if (page->page_start == page_start)
-        break;
+       break;
       previous_page = page;
       page = page->next;
     }
 
   /* Did we find a dictionary entry for this page?  If not, then
      add it to the dictionary now.
-     */
+   */
   if (page == NULL)
     {
       /* Create a new entry. */
@@ -5247,8 +5450,8 @@ get_dictionary_entry_of_page (pid, page_start)
 
 static void
 remove_dictionary_entry_of_page (pid, page)
-  int  pid;
-  memory_page_t *  page;
+     int pid;
+     memory_page_t *page;
 {
   /* Restore the page's original permissions. */
   unwrite_protect_page (pid, page->page_start, page->original_permissions);
@@ -5270,17 +5473,17 @@ remove_dictionary_entry_of_page (pid, page)
 
 static void
 hppa_enable_syscall_events (pid)
-  int  pid;
+     int pid;
 {
-  int  tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled. */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           pid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          pid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 
@@ -5289,10 +5492,10 @@ hppa_enable_syscall_events (pid)
   ttrace_events.tte_events |= TTEVT_SYSCALL_RETURN;
 
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           pid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          pid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 }
@@ -5300,17 +5503,17 @@ hppa_enable_syscall_events (pid)
 
 static void
 hppa_disable_syscall_events (pid)
-  int  pid;
+     int pid;
 {
-  int  tt_status;
-  ttevent_t  ttrace_events;
+  int tt_status;
+  ttevent_t ttrace_events;
 
   /* Get the set of events that are currently enabled. */
   tt_status = call_ttrace (TT_PROC_GET_EVENT_MASK,
-                           pid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          pid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 
@@ -5319,10 +5522,10 @@ hppa_disable_syscall_events (pid)
   ttrace_events.tte_events &= ~TTEVT_SYSCALL_RETURN;
 
   tt_status = call_ttrace (TT_PROC_SET_EVENT_MASK,
-                           pid,
-                           (TTRACE_ARG_TYPE) &ttrace_events,
-                           (TTRACE_ARG_TYPE) sizeof (ttrace_events),
-                           TT_NIL);
+                          pid,
+                          (TTRACE_ARG_TYPE) & ttrace_events,
+                          (TTRACE_ARG_TYPE) sizeof (ttrace_events),
+                          TT_NIL);
   if (errno)
     perror_with_name ("ttrace");
 }
@@ -5333,25 +5536,25 @@ hppa_disable_syscall_events (pid)
    Set protection for all pages that overlap that range.
 
    Note that our caller sets TYPE to:
-     0 for a bp_hardware_watchpoint,
-     1 for a bp_read_watchpoint,
-     2 for a bp_access_watchpoint
+   0 for a bp_hardware_watchpoint,
+   1 for a bp_read_watchpoint,
+   2 for a bp_access_watchpoint
 
    (Yes, this is intentionally (though lord only knows why) different
    from the TYPE that is passed to hppa_remove_hw_watchpoint.)
  */
+ */
 int
 hppa_insert_hw_watchpoint (pid, start, len, type)
-  int  pid;
-  CORE_ADDR  start;
-  LONGEST  len;
-  int  type;
+     int pid;
+     CORE_ADDR start;
+     LONGEST len;
+     int type;
 {
-  CORE_ADDR  page_start;
-  int  dictionary_was_empty;
-  int  page_size;
-  int  page_id;
-  LONGEST  range_size_in_pages;
+  CORE_ADDR page_start;
+  int dictionary_was_empty;
+  int page_size;
+  int page_id;
+  LONGEST range_size_in_pages;
 
   if (type != 0)
     error ("read or access hardware watchpoints not supported on HP-UX");
@@ -5365,13 +5568,13 @@ hppa_insert_hw_watchpoint (pid, start, len, type)
   page_start = (start / page_size) * page_size;
   range_size_in_pages = ((LONGEST) len + (LONGEST) page_size - 1) / (LONGEST) page_size;
 
-  for (page_id=0; page_id < range_size_in_pages; page_id++, page_start+=page_size)
+  for (page_id = 0; page_id < range_size_in_pages; page_id++, page_start += page_size)
     {
-      memory_page_t *  page;
+      memory_page_t *page;
 
       /* This gets the page entered into the dictionary if it was
          not already entered.
-         */
+       */
       page = get_dictionary_entry_of_page (pid, page_start);
       page->reference_count++;
     }
@@ -5403,7 +5606,7 @@ hppa_insert_hw_watchpoint (pid, start, len, type)
      If errno is set upon syscall exit to EFAULT, we must perform some fairly
      hackish stuff to determine whether the failure really was due to a
      page-protect trap on a watched location.
-     */
+   */
   if (dictionary_was_empty)
     hppa_enable_syscall_events (pid);
 
@@ -5416,19 +5619,19 @@ hppa_insert_hw_watchpoint (pid, start, len, type)
    which has been removed.  Remove protection for all pages that
    overlap that range, which are not also being watched by other
    watchpoints.
  */
+ */
 int
 hppa_remove_hw_watchpoint (pid, start, len, type)
-  int  pid;
-  CORE_ADDR  start;
-  LONGEST  len;
-  enum bptype  type;
+     int pid;
+     CORE_ADDR start;
+     LONGEST len;
+     enum bptype type;
 {
-  CORE_ADDR  page_start;
-  int  dictionary_is_empty;
-  int  page_size;
-  int  page_id;
-  LONGEST  range_size_in_pages;
+  CORE_ADDR page_start;
+  int dictionary_is_empty;
+  int page_size;
+  int page_id;
+  LONGEST range_size_in_pages;
 
   if (type != 0)
     error ("read or access hardware watchpoints not supported on HP-UX");
@@ -5440,9 +5643,9 @@ hppa_remove_hw_watchpoint (pid, start, len, type)
   page_start = (start / page_size) * page_size;
   range_size_in_pages = ((LONGEST) len + (LONGEST) page_size - 1) / (LONGEST) page_size;
 
-  for (page_id=0; page_id < range_size_in_pages; page_id++, page_start+=page_size)
+  for (page_id = 0; page_id < range_size_in_pages; page_id++, page_start += page_size)
     {
-      memory_page_t *  page;
+      memory_page_t *page;
 
       page = get_dictionary_entry_of_page (pid, page_start);
       page->reference_count--;
@@ -5450,9 +5653,9 @@ hppa_remove_hw_watchpoint (pid, start, len, type)
       /* Was this the last reference of this page?  If so, then we
          must scrub the entry from the dictionary, and also restore
          the page's original permissions.
-         */
+       */
       if (page->reference_count == 0)
-        remove_dictionary_entry_of_page (pid, page);
+       remove_dictionary_entry_of_page (pid, page);
     }
 
   dictionary_is_empty = (memory_page_dictionary.page_count == (LONGEST) 0);
@@ -5464,7 +5667,7 @@ hppa_remove_hw_watchpoint (pid, start, len, type)
 
      ??rehrauer: Yeah, it'd be better if we had a specific flag that said,
      "inferior is between syscall events now".  Oh well.
-     */
+   */
   if (dictionary_is_empty && memory_page_dictionary.page_protections_allowed)
     hppa_disable_syscall_events (pid);
 
@@ -5480,12 +5683,12 @@ hppa_remove_hw_watchpoint (pid, start, len, type)
    for such things.  See hppa_range_profitable_for_hw_watchpoint for a
    query that answers whether a particular range should be watched via
    hardware support.
  */
+ */
 int
 hppa_can_use_hw_watchpoint (type, cnt, ot)
-  enum bptype  type;
-  int  cnt;
-  enum bptype  ot;
+     enum bptype type;
+     int cnt;
+     enum bptype ot;
 {
   return (type == bp_hardware_watchpoint);
 }
@@ -5495,24 +5698,24 @@ hppa_can_use_hw_watchpoint (type, cnt, ot)
    we think it would be profitable ("a good idea") to do so?  If not,
    we can always set a regular (aka single-step & test) watchpoint
    on the address...
  */
+ */
 int
 hppa_range_profitable_for_hw_watchpoint (pid, start, len)
-  int  pid;
-  CORE_ADDR  start;
-  LONGEST  len;
+     int pid;
+     CORE_ADDR start;
+     LONGEST len;
 {
-  int  range_is_stack_based;
-  int  range_is_accessible;
-  CORE_ADDR  page_start;
-  int  page_size;
-  int  page;
-  LONGEST  range_size_in_pages;
+  int range_is_stack_based;
+  int range_is_accessible;
+  CORE_ADDR page_start;
+  int page_size;
+  int page;
+  LONGEST range_size_in_pages;
 
   /* ??rehrauer: For now, say that all addresses are potentially
      profitable.  Possibly later we'll want to test the address
      for "stackness"?
-     */
+   */
   range_is_stack_based = 0;
 
   /* If any page in the range is inaccessible, then we cannot
@@ -5520,8 +5723,8 @@ hppa_range_profitable_for_hw_watchpoint (pid, start, len)
      thinks we can.  In that case, it's actually an error to
      attempt to use hw watchpoints, so we'll tell our client
      that the range is "unprofitable", and hope that they listen...
-     */
-  range_is_accessible = 1;  /* Until proven otherwise. */
+   */
+  range_is_accessible = 1;     /* Until proven otherwise. */
 
   /* Examine all pages in the address range. */
   errno = 0;
@@ -5530,7 +5733,7 @@ hppa_range_profitable_for_hw_watchpoint (pid, start, len)
   /* If we can't determine page size, we're hosed.  Tell our
      client it's unprofitable to use hw watchpoints for this
      range.
-     */
+   */
   if (errno || (page_size <= 0))
     {
       errno = 0;
@@ -5538,39 +5741,39 @@ hppa_range_profitable_for_hw_watchpoint (pid, start, len)
     }
 
   page_start = (start / page_size) * page_size;
-  range_size_in_pages = len / (LONGEST)page_size;
+  range_size_in_pages = len / (LONGEST) page_size;
 
-  for (page=0; page < range_size_in_pages; page++, page_start+=page_size)
+  for (page = 0; page < range_size_in_pages; page++, page_start += page_size)
     {
-      int  tt_status;
-      int  page_permissions;
+      int tt_status;
+      int page_permissions;
 
       /* Is this page accessible? */
       errno = 0;
       tt_status = call_ttrace (TT_PROC_GET_MPROTECT,
-                               pid,
-                               (TTRACE_ARG_TYPE) page_start,
-                               TT_NIL,
-                               (TTRACE_ARG_TYPE) &page_permissions);
+                              pid,
+                              (TTRACE_ARG_TYPE) page_start,
+                              TT_NIL,
+                              (TTRACE_ARG_TYPE) & page_permissions);
       if (errno || (tt_status < 0))
-        {
-          errno = 0;
-          range_is_accessible = 0;
-          break;
-        }
+       {
+         errno = 0;
+         range_is_accessible = 0;
+         break;
+       }
 
       /* Yes, go for another... */
     }
 
-  return (! range_is_stack_based && range_is_accessible);
+  return (!range_is_stack_based && range_is_accessible);
 }
 
 
 char *
 hppa_pid_or_tid_to_str (id)
-  pid_t  id;
+     pid_t id;
 {
-  static char  buf[100]; /* Static because address returned. */
+  static char buf[100];                /* Static because address returned. */
 
   /* Does this appear to be a process?  If so, print it that way. */
   if (is_process_id (id))
@@ -5583,8 +5786,8 @@ hppa_pid_or_tid_to_str (id)
 
   return buf;
 }
-
 \f
+
 /* If the current pid is not the pid this module reported
  * from "ptrace_wait" with the most recent event, then the
  * user has switched threads.
@@ -5592,11 +5795,12 @@ hppa_pid_or_tid_to_str (id)
  * If the last reported event was a breakpoint, then return
  * the old thread id, else return 0.
  */
-pid_t 
-hppa_switched_threads( gdb_pid )
-  pid_t gdb_pid;
+pid_t
+hppa_switched_threads (gdb_pid)
+     pid_t gdb_pid;
 {
-  if( gdb_pid == old_gdb_pid ) {
+  if (gdb_pid == old_gdb_pid)
+    {
       /*
        * Core gdb is working with the same pid that it
        * was before we reported the last event.  This
@@ -5607,8 +5811,9 @@ hppa_switched_threads( gdb_pid )
        * No thread switch has happened.
        */
       return (pid_t) 0;
-  }
-  else if( gdb_pid == reported_pid ) {
+    }
+  else if (gdb_pid == reported_pid)
+    {
       /*
        * Core gdb is working with the pid we reported, so
        * any continue or step will be able to figure out
@@ -5616,33 +5821,35 @@ hppa_switched_threads( gdb_pid )
        * without our (i.e. PREPARE_TO_PROCEED's) help.
        */
       return (pid_t) 0;
-  }
-  else if( !reported_bpt ) {
-       /*
-        * The core switched, but we didn't just report a
-        * breakpoint, so there's no just-hit breakpoint
-        * instruction at "reported_pid"'s PC, and thus there
-        * is no need to step over it.
-        */
+    }
+  else if (!reported_bpt)
+    {
+      /*
+       * The core switched, but we didn't just report a
+       * breakpoint, so there's no just-hit breakpoint
+       * instruction at "reported_pid"'s PC, and thus there
+       * is no need to step over it.
+       */
       return (pid_t) 0;
-  }
-  else {
-       /* There's been a real switch, and we reported
-        * a hit breakpoint.  Let "hppa_prepare_to_proceed"
-        * know, so it can see whether the breakpoint is
-        * still active.
-        */
-       return reported_pid;
-  }
+    }
+  else
+    {
+      /* There's been a real switch, and we reported
+       * a hit breakpoint.  Let "hppa_prepare_to_proceed"
+       * know, so it can see whether the breakpoint is
+       * still active.
+       */
+      return reported_pid;
+    }
 
   /* Keep compiler happy with an obvious return at the end.
    */
-  return (pid_t) 0;  
+  return (pid_t) 0;
 }
 
 void
 hppa_ensure_vforking_parent_remains_stopped (pid)
-  int  pid;
+     int pid;
 {
   /* Nothing to do when using ttrace.  Only the ptrace-based implementation
      must do real work.
@@ -5653,16 +5860,16 @@ hppa_ensure_vforking_parent_remains_stopped (pid)
 int
 hppa_resume_execd_vforking_child_to_get_parent_vfork ()
 {
-  return 0;  /* No, the parent vfork is available now. */
+  return 0;                    /* No, the parent vfork is available now. */
 }
+\f
 
 
-\f
 void
 _initialize_infttrace ()
 {
   /* Initialize the ttrace-based hardware watchpoint implementation. */
-  memory_page_dictionary.page_count = (LONGEST) -1;
+  memory_page_dictionary.page_count = (LONGEST) - 1;
   memory_page_dictionary.page_protections_allowed = 1;
 
   errno = 0;
@@ -5671,4 +5878,3 @@ _initialize_infttrace ()
   if (errno || (memory_page_dictionary.page_size <= 0))
     perror_with_name ("sysconf");
 }
-
index 5a6e111222969e8f1064223d0a8621bdd11a2bf5..7646843df4e03061f4870080e6d737fa92f8ef23 100644 (file)
@@ -5,21 +5,22 @@
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
    Implemented for Irix 4.x by Garrett A. Wollman.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -42,23 +43,24 @@ fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR));
  * See the comment in m68k-tdep.c regarding the utility of these functions.
  */
 
-void 
+void
 supply_gregset (gregsetp)
      gregset_t *gregsetp;
 {
   register int regi;
-  register greg_t *regp = (greg_t *)(gregsetp->gp_regs);
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   /* FIXME: somewhere, there should be a #define for the meaning
      of this magic number 32; we should use that. */
-  for(regi = 0; regi < 32; regi++)
-    supply_register (regi, (char *)(regp + regi));
+  for (regi = 0; regi < 32; regi++)
+    supply_register (regi, (char *) (regp + regi));
 
-  supply_register (PC_REGNUM, (char *)&(gregsetp->gp_pc));
-  supply_register (HI_REGNUM, (char *)&(gregsetp->gp_mdhi));
-  supply_register (LO_REGNUM, (char *)&(gregsetp->gp_mdlo));
-  supply_register (CAUSE_REGNUM, (char *)&(gregsetp->gp_cause));
+  supply_register (PC_REGNUM, (char *) &(gregsetp->gp_pc));
+  supply_register (HI_REGNUM, (char *) &(gregsetp->gp_mdhi));
+  supply_register (LO_REGNUM, (char *) &(gregsetp->gp_mdlo));
+  supply_register (CAUSE_REGNUM, (char *) &(gregsetp->gp_cause));
 
   /* Fill inaccessible registers with zero.  */
   supply_register (BADVADDR_REGNUM, zerobuf);
@@ -70,24 +72,24 @@ fill_gregset (gregsetp, regno)
      int regno;
 {
   int regi;
-  register greg_t *regp = (greg_t *)(gregsetp->gp_regs);
+  register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
 
-  /* same FIXME as above wrt 32*/
+  /* same FIXME as above wrt 32 */
   for (regi = 0; regi < 32; regi++)
     if ((regno == -1) || (regno == regi))
-      *(regp + regi) = *(greg_t *) &registers[REGISTER_BYTE (regi)];
+      *(regp + regi) = *(greg_t *) & registers[REGISTER_BYTE (regi)];
 
   if ((regno == -1) || (regno == PC_REGNUM))
-    gregsetp->gp_pc = *(greg_t *) &registers[REGISTER_BYTE (PC_REGNUM)];
+    gregsetp->gp_pc = *(greg_t *) & registers[REGISTER_BYTE (PC_REGNUM)];
 
   if ((regno == -1) || (regno == CAUSE_REGNUM))
-    gregsetp->gp_cause = *(greg_t *) &registers[REGISTER_BYTE (CAUSE_REGNUM)];
+    gregsetp->gp_cause = *(greg_t *) & registers[REGISTER_BYTE (CAUSE_REGNUM)];
 
   if ((regno == -1) || (regno == HI_REGNUM))
-    gregsetp->gp_mdhi = *(greg_t *) &registers[REGISTER_BYTE (HI_REGNUM)];
+    gregsetp->gp_mdhi = *(greg_t *) & registers[REGISTER_BYTE (HI_REGNUM)];
 
   if ((regno == -1) || (regno == LO_REGNUM))
-    gregsetp->gp_mdlo = *(greg_t *) &registers[REGISTER_BYTE (LO_REGNUM)];
+    gregsetp->gp_mdlo = *(greg_t *) & registers[REGISTER_BYTE (LO_REGNUM)];
 }
 
 /*
@@ -103,13 +105,14 @@ supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
   register int regi;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   for (regi = 0; regi < 32; regi++)
     supply_register (FP0_REGNUM + regi,
-                    (char *)&fpregsetp->fp_r.fp_regs[regi]);
+                    (char *) &fpregsetp->fp_r.fp_regs[regi]);
 
-  supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr);
+  supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr);
 
   /* FIXME: how can we supply FCRIR_REGNUM?  SGI doesn't tell us. */
   supply_register (FCRIR_REGNUM, zerobuf);
@@ -129,12 +132,12 @@ fill_fpregset (fpregsetp, regno)
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
          to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
-         memcpy(to, from, REGISTER_RAW_SIZE (regi));
+         memcpy (to, from, REGISTER_RAW_SIZE (regi));
        }
     }
 
   if ((regno == -1) || (regno == FCRCS_REGNUM))
-    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE(FCRCS_REGNUM)];
+    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
 }
 
 
@@ -174,10 +177,10 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
       return;
     }
 
-  memcpy ((char *)registers, core_reg_sect, core_reg_size);
+  memcpy ((char *) registers, core_reg_sect, core_reg_size);
 }
-
 \f
+
 /* Register that we are able to handle irix4 core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index b3373a99168d6bd05762207e90165ef71b13161d..35445f7bf1d72241567768d440b89a84ef7b8e7c 100644 (file)
@@ -6,21 +6,22 @@
    Implemented for Irix 4.x by Garrett A. Wollman.
    Modified for Irix 5.x by Ian Lance Taylor.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -46,22 +47,23 @@ fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR));
  * any MIPS SVR4 target.
  */
 
-void 
+void
 supply_gregset (gregsetp)
      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[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
-  for(regi = 0; regi <= CTX_RA; regi++)
-    supply_register (regi, (char *)(regp + regi) + gregoff);
+  for (regi = 0; regi <= CTX_RA; regi++)
+    supply_register (regi, (char *) (regp + regi) + gregoff);
 
-  supply_register (PC_REGNUM, (char *)(regp + CTX_EPC) + gregoff);
-  supply_register (HI_REGNUM, (char *)(regp + CTX_MDHI) + gregoff);
-  supply_register (LO_REGNUM, (char *)(regp + CTX_MDLO) + gregoff);
-  supply_register (CAUSE_REGNUM, (char *)(regp + CTX_CAUSE) + gregoff);
+  supply_register (PC_REGNUM, (char *) (regp + CTX_EPC) + gregoff);
+  supply_register (HI_REGNUM, (char *) (regp + CTX_MDHI) + gregoff);
+  supply_register (LO_REGNUM, (char *) (regp + CTX_MDLO) + gregoff);
+  supply_register (CAUSE_REGNUM, (char *) (regp + CTX_CAUSE) + gregoff);
 
   /* Fill inaccessible registers with zero.  */
   supply_register (BADVADDR_REGNUM, zerobuf);
@@ -119,15 +121,16 @@ supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
   register int regi;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
 
   for (regi = 0; regi < 32; regi++)
     supply_register (FP0_REGNUM + regi,
-                    (char *)&fpregsetp->fp_r.fp_regs[regi]);
+                    (char *) &fpregsetp->fp_r.fp_regs[regi]);
 
-  supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr);
+  supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr);
 
   /* FIXME: how can we supply FCRIR_REGNUM?  SGI doesn't tell us. */
   supply_register (FCRIR_REGNUM, zerobuf);
@@ -149,12 +152,12 @@ fill_fpregset (fpregsetp, regno)
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
          to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
-         memcpy(to, from, REGISTER_RAW_SIZE (regi));
+         memcpy (to, from, REGISTER_RAW_SIZE (regi));
        }
     }
 
   if ((regno == -1) || (regno == FCRCS_REGNUM))
-    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE(FCRCS_REGNUM)];
+    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
 }
 
 
@@ -190,13 +193,13 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 {
   if (core_reg_size == REGISTER_BYTES)
     {
-      memcpy ((char *)registers, core_reg_sect, core_reg_size);
+      memcpy ((char *) registers, core_reg_sect, core_reg_size);
     }
   else if (MIPS_REGSIZE == 4 &&
           core_reg_size == (2 * MIPS_REGSIZE) * NUM_REGS)
     {
       /* This is a core file from a N32 executable, 64 bits are saved
-        for all registers.  */
+         for all registers.  */
       char *srcp = core_reg_sect;
       char *dstp = registers;
       int regno;
@@ -206,16 +209,16 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
          if (regno >= FP0_REGNUM && regno < (FP0_REGNUM + 32))
            {
              /* FIXME, this is wrong, N32 has 64 bit FP regs, but GDB
-                currently assumes that they are 32 bit.  */
+                currently assumes that they are 32 bit.  */
              *dstp++ = *srcp++;
              *dstp++ = *srcp++;
              *dstp++ = *srcp++;
              *dstp++ = *srcp++;
-             if (REGISTER_RAW_SIZE(regno) == 4)
+             if (REGISTER_RAW_SIZE (regno) == 4)
                {
                  /* copying 4 bytes from eight bytes?
                     I don't see how this can be right...  */
-                 srcp += 4;    
+                 srcp += 4;
                }
              else
                {
@@ -289,19 +292,21 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 
 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;
+  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 */
-};
+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
@@ -314,24 +319,25 @@ struct link_map {
 
 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;
-};
+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 debug_base;   /* Base of dynamic linker structures */
 static CORE_ADDR breakpoint_addr;      /* Address where end bkpt is set */
 
 /* Local function prototypes */
@@ -352,48 +358,48 @@ static int
 symbol_add_stub PARAMS ((char *));
 
 static struct so_list *
-find_solib PARAMS ((struct so_list *));
+  find_solib PARAMS ((struct so_list *));
 
 static struct link_map *
-first_link_map_member PARAMS ((void));
+  first_link_map_member PARAMS ((void));
 
 static struct link_map *
-next_link_map_member PARAMS ((struct so_list *));
+  next_link_map_member PARAMS ((struct so_list *));
 
 static void
 xfer_link_map_member PARAMS ((struct so_list *, struct link_map *));
 
 static CORE_ADDR
-locate_base PARAMS ((void));
+  locate_base PARAMS ((void));
 
 static int
 solib_map_sections PARAMS ((char *));
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       solib_map_sections -- open bfd and build sections for shared lib
+   solib_map_sections -- open bfd and build sections for shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int solib_map_sections (struct so_list *so)
+   static int solib_map_sections (struct so_list *so)
 
-DESCRIPTION
+   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.
+   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
+   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?).
+   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
@@ -407,10 +413,10 @@ solib_map_sections (arg)
   struct section_table *p;
   struct cleanup *old_chain;
   bfd *abfd;
-  
-  filename = tilde_expand (so -> so_name);
+
+  filename = tilde_expand (so->so_name);
   old_chain = make_cleanup (free, filename);
-  
+
   scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
                        &scratch_pathname);
   if (scratch_chan < 0)
@@ -432,31 +438,31 @@ solib_map_sections (arg)
             scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
   /* Leave bfd open, core_xfer_memory and "info files" need it.  */
-  so -> abfd = abfd;
-  abfd -> cacheable = true;
+  so->abfd = abfd;
+  abfd->cacheable = true;
 
   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))
+  if (build_section_table (abfd, &so->sections, &so->sections_end))
     {
-      error ("Can't find the file sections in `%s': %s", 
+      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++)
+  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"))
+         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;
+         so->textsection = p;
        }
     }
 
@@ -468,48 +474,48 @@ solib_map_sections (arg)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       locate_base -- locate the base address of dynamic linker structs
+   locate_base -- locate the base address of dynamic linker structs
 
-SYNOPSIS
+   SYNOPSIS
 
-       CORE_ADDR locate_base (void)
+   CORE_ADDR locate_base (void)
 
-DESCRIPTION
+   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 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.
+   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.
+   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.
+   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).
+   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).
 
  */
 
@@ -529,20 +535,20 @@ locate_base ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       first_link_map_member -- locate first member in dynamic linker's map
+   first_link_map_member -- locate first member in dynamic linker's map
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct link_map *first_link_map_member (void)
+   static struct link_map *first_link_map_member (void)
 
-DESCRIPTION
+   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.
-*/
+   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 ()
@@ -572,7 +578,7 @@ first_link_map_member ()
 
   /* The first entry in the list is the object file we are debugging,
      so skip it.  */
-  next_lladdr = (CORE_ADDR) list_old.next; 
+  next_lladdr = (CORE_ADDR) list_old.next;
 
 #ifdef HANDLE_NEW_OBJ_LIST
   if (list_old.data == NEW_OBJ_INFO_MAGIC)
@@ -582,7 +588,7 @@ first_link_map_member ()
       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; 
+      next_lladdr = (CORE_ADDR) list_32.oi_next;
     }
 #endif
 
@@ -596,49 +602,49 @@ first_link_map_member ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       next_link_map_member -- locate next member in dynamic linker's map
+   next_link_map_member -- locate next member in dynamic linker's map
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct link_map *next_link_map_member (so_list_ptr)
+   static struct link_map *next_link_map_member (so_list_ptr)
 
-DESCRIPTION
+   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.
-*/
+   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 (so_list_ptr)
      struct so_list *so_list_ptr;
 {
-  struct link_map *lm = &so_list_ptr -> lm;
-  CORE_ADDR next_lladdr = lm -> l_next;
+  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. */
+         added, but be quiet if we can't read from the target any more. */
       int status = 0;
 
-      if (lm -> l_variant == OBJ_LIST_OLD)
+      if (lm->l_variant == OBJ_LIST_OLD)
        {
          struct obj_list list_old;
 
-         status = target_read_memory (lm -> l_lladdr,
+         status = target_read_memory (lm->l_lladdr,
                                       (char *) &list_old,
                                       sizeof (struct obj_list));
          next_lladdr = (CORE_ADDR) list_old.next;
        }
 #ifdef HANDLE_NEW_OBJ_LIST
-      else if (lm -> l_variant == OBJ_LIST_32)
+      else if (lm->l_variant == OBJ_LIST_32)
        {
          Elf32_Obj_Info list_32;
-         status = target_read_memory (lm -> l_lladdr,
+         status = target_read_memory (lm->l_lladdr,
                                       (char *) &list_32,
                                       sizeof (Elf32_Obj_Info));
          next_lladdr = (CORE_ADDR) list_32.oi_next;
@@ -656,20 +662,20 @@ next_link_map_member (so_list_ptr)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       xfer_link_map_member -- set local variables from dynamic linker's map
+   xfer_link_map_member -- set local variables from dynamic linker's map
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void xfer_link_map_member (so_list_ptr, lm)
+   static void xfer_link_map_member (so_list_ptr, lm)
 
-DESCRIPTION
+   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.
-*/
+   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 (so_list_ptr, lm)
@@ -677,15 +683,15 @@ xfer_link_map_member (so_list_ptr, lm)
      struct link_map *lm;
 {
   struct obj_list list_old;
-  CORE_ADDR lladdr = lm -> l_lladdr;
-  struct link_map *new_lm = &so_list_ptr -> lm;
+  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 = (CORE_ADDR) list_old.next; 
+  new_lm->l_variant = OBJ_LIST_OLD;
+  new_lm->l_lladdr = lladdr;
+  new_lm->l_next = (CORE_ADDR) list_old.next;
 
 #ifdef HANDLE_NEW_OBJ_LIST
   if (list_old.data == NEW_OBJ_INFO_MAGIC)
@@ -695,11 +701,11 @@ xfer_link_map_member (so_list_ptr, lm)
       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; 
+      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,
+                         &so_list_ptr->so_name,
                          list_32.oi_pathname_len + 1, &errcode);
       if (errcode != 0)
        memory_error (errcode, (CORE_ADDR) list_32.oi_pathname);
@@ -713,16 +719,16 @@ xfer_link_map_member (so_list_ptr, lm)
     {
 #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.  */
+         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,
+                         &so_list_ptr->so_name,
                          INT_MAX, &errcode);
       if (errcode != 0)
        memory_error (errcode, extract_address (&buf[236], 4));
@@ -737,7 +743,7 @@ xfer_link_map_member (so_list_ptr, lm)
                   sizeof (struct obj));
 
       target_read_string ((CORE_ADDR) obj_old.o_path,
-                         &so_list_ptr -> so_name,
+                         &so_list_ptr->so_name,
                          INT_MAX, &errcode);
       if (errcode != 0)
        memory_error (errcode, (CORE_ADDR) obj_old.o_path);
@@ -756,22 +762,22 @@ xfer_link_map_member (so_list_ptr, lm)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       find_solib -- step through list of shared objects
+   find_solib -- step through list of shared objects
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct so_list *find_solib (struct so_list *so_list_ptr)
+   struct so_list *find_solib (struct so_list *so_list_ptr)
 
-DESCRIPTION
+   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.
+   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 *
@@ -781,7 +787,7 @@ find_solib (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. */
@@ -794,24 +800,24 @@ find_solib (so_list_ptr)
   else
     {
       /* We have been called before, and are in the process of walking
-        the shared library list.  Advance to the next shared object. */
+         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;
+      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. */
+         node if this is the first one. */
       if (so_list_ptr != NULL)
        {
-         so_list_ptr -> next = new;
+         so_list_ptr->next = new;
        }
       else
        {
          so_list_head = new;
-       }      
+       }
       so_list_next = new;
       xfer_link_map_member (new, lm);
     }
@@ -824,54 +830,54 @@ static int
 symbol_add_stub (arg)
      char *arg;
 {
-  register struct so_list *so = (struct so_list *) arg;        /* catch_errs bogon */
+  register struct so_list *so = (struct so_list *) arg;                /* catch_errs bogon */
   CORE_ADDR text_addr = 0;
 
-  if (so -> textsection)
-    text_addr = so -> textsection -> addr;
-  else if (so -> abfd != NULL)
+  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.  */
+         text_addr so that the relocation in symbol_file_add does no harm.  */
 
-      lowest_sect = bfd_get_section_by_name (so -> abfd, ".text");
+      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);
+       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);
+       text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
     }
-  
-  so -> objfile = symbol_file_add (so -> so_name, so -> from_tty,
-                                  text_addr,
-                                  0, 0, 0, 0, 0);
+
+  so->objfile = symbol_file_add (so->so_name, so->from_tty,
+                                text_addr,
+                                0, 0, 0, 0, 0);
   return (1);
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_add -- add a shared library file to the symtab and section list
+   solib_add -- add a shared library file to the symtab and section list
 
-SYNOPSIS
+   SYNOPSIS
 
-       void solib_add (char *arg_string, int from_tty,
-                       struct target_ops *target)
+   void solib_add (char *arg_string, int from_tty,
+   struct target_ops *target)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 void
 solib_add (arg_string, from_tty, target)
      char *arg_string;
      int from_tty;
      struct target_ops *target;
-{      
-  register struct so_list *so = NULL;          /* link map state variable */
+{
+  register struct so_list *so = NULL;  /* link map state variable */
 
   /* Last shared library that we read.  */
   struct so_list *so_last = NULL;
@@ -879,12 +885,12 @@ solib_add (arg_string, from_tty, target)
   char *re_err;
   int count;
   int old;
-  
+
   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)
@@ -894,12 +900,12 @@ solib_add (arg_string, from_tty, target)
       count = 0;
       while ((so = find_solib (so)) != NULL)
        {
-         if (so -> so_name[0])
+         if (so->so_name[0])
            {
-             count += so -> sections_end - so -> sections;
+             count += so->sections_end - so->sections;
            }
        }
-      
+
       if (count)
        {
          int update_coreops;
@@ -908,23 +914,23 @@ solib_add (arg_string, from_tty, target)
             here, otherwise we dereference a potential dangling pointer
             for each call to target_read/write_memory within this routine.  */
          update_coreops = core_ops.to_sections == target->to_sections;
-            
+
          /* Reallocate the target's section table including the new size.  */
-         if (target -> to_sections)
+         if (target->to_sections)
            {
-             old = target -> to_sections_end - target -> to_sections;
-             target -> to_sections = (struct section_table *)
-               xrealloc ((char *)target -> to_sections,
-                        (sizeof (struct section_table)) * (count + old));
+             old = target->to_sections_end - target->to_sections;
+             target->to_sections = (struct section_table *)
+               xrealloc ((char *) target->to_sections,
+                         (sizeof (struct section_table)) * (count + old));
            }
          else
            {
              old = 0;
-             target -> to_sections = (struct section_table *)
+             target->to_sections = (struct section_table *)
                xmalloc ((sizeof (struct section_table)) * count);
            }
-         target -> to_sections_end = target -> to_sections + (count + old);
-         
+         target->to_sections_end = target->to_sections + (count + old);
+
          /* Update the to_sections field in the core_ops structure
             if needed.  */
          if (update_coreops)
@@ -936,29 +942,29 @@ solib_add (arg_string, from_tty, target)
          /* Add these section table entries to the target's table.  */
          while ((so = find_solib (so)) != NULL)
            {
-             if (so -> so_name[0])
+             if (so->so_name[0])
                {
-                 count = so -> sections_end - so -> sections;
-                 memcpy ((char *) (target -> to_sections + old),
-                         so -> sections, 
+                 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))
+      if (so->so_name[0] && re_exec (so->so_name))
        {
-         so -> from_tty = from_tty;
-         if (so -> symbols_loaded)
+         so->from_tty = from_tty;
+         if (so->symbols_loaded)
            {
              if (from_tty)
                {
-                 printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name);
+                 printf_unfiltered ("Symbols already loaded for %s\n", so->so_name);
                }
            }
          else if (catch_errors
@@ -967,7 +973,7 @@ solib_add (arg_string, from_tty, target)
                    RETURN_MASK_ALL))
            {
              so_last = so;
-             so -> symbols_loaded = 1;
+             so->symbols_loaded = 1;
            }
        }
     }
@@ -980,28 +986,28 @@ solib_add (arg_string, from_tty, target)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       info_sharedlibrary_command -- code for "info sharedlibrary"
+   info_sharedlibrary_command -- code for "info sharedlibrary"
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void info_sharedlibrary_command ()
+   static void info_sharedlibrary_command ()
 
-DESCRIPTION
+   DESCRIPTION
 
-       Walk through the shared library list and print information
-       about each attached library.
-*/
+   Walk through the shared library list and print information
+   about each attached library.
+ */
 
 static void
 info_sharedlibrary_command (ignore, from_tty)
      char *ignore;
      int from_tty;
 {
-  register struct so_list *so = NULL;          /* link map state variable */
+  register struct so_list *so = NULL;  /* link map state variable */
   int header_done = 0;
-  
+
   if (exec_bfd == NULL)
     {
       printf_unfiltered ("No exec file.\n");
@@ -1009,66 +1015,66 @@ info_sharedlibrary_command (ignore, from_tty)
     }
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0])
+      if (so->so_name[0])
        {
          if (!header_done)
            {
-             printf_unfiltered("%-12s%-12s%-12s%s\n", "From", "To", "Syms Read",
-                    "Shared Object Library");
+             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"));
+                     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);
+                        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");        
+      printf_unfiltered ("No shared libraries loaded at this time.\n");
     }
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_address -- check to see if an address is in a shared lib
+   solib_address -- check to see if an address is in a shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       char *solib_address (CORE_ADDR address)
+   char *solib_address (CORE_ADDR address)
 
-DESCRIPTION
+   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.
+   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.
+   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 (address)
      CORE_ADDR address;
 {
-  register struct so_list *so = 0;     /* link map state variable */
-  
+  register struct so_list *so = 0;     /* link map state variable */
+
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0])
+      if (so->so_name[0])
        {
          if ((address >= (CORE_ADDR) LM_ADDR (so)) &&
-             (address < (CORE_ADDR) so -> lmend))
+             (address < (CORE_ADDR) so->lmend))
            return (so->so_name);
        }
     }
@@ -1077,24 +1083,24 @@ solib_address (address)
 
 /* Called by free_all_symtabs */
 
-void 
-clear_solib()
+void
+clear_solib ()
 {
   struct so_list *next;
   char *bfd_filename;
-  
+
   disable_breakpoints_in_shlibs (1);
 
   while (so_list_head)
     {
-      if (so_list_head -> sections)
+      if (so_list_head->sections)
        {
-         free ((PTR)so_list_head -> sections);
+         free ((PTR) so_list_head->sections);
        }
-      if (so_list_head -> abfd)
+      if (so_list_head->abfd)
        {
-         bfd_filename = bfd_get_filename (so_list_head -> abfd);
-         if (!bfd_close (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 ()));
        }
@@ -1102,11 +1108,11 @@ clear_solib()
        /* This happens for the executable on SVR4.  */
        bfd_filename = NULL;
 
-      next = so_list_head -> next;
+      next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR)bfd_filename);
+       free ((PTR) bfd_filename);
       free (so_list_head->so_name);
-      free ((PTR)so_list_head);
+      free ((PTR) so_list_head);
       so_list_head = next;
     }
   debug_base = 0;
@@ -1114,20 +1120,20 @@ clear_solib()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       disable_break -- remove the "mapping changed" breakpoint
+   disable_break -- remove the "mapping changed" breakpoint
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int disable_break ()
+   static int disable_break ()
 
-DESCRIPTION
+   DESCRIPTION
 
-       Removes the breakpoint that gets hit when the dynamic linker
-       completes a mapping change.
+   Removes the breakpoint that gets hit when the dynamic linker
+   completes a mapping change.
 
-*/
+ */
 
 static int
 disable_break ()
@@ -1157,19 +1163,19 @@ disable_break ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       enable_break -- arrange for dynamic linker to hit breakpoint
+   enable_break -- arrange for dynamic linker to hit breakpoint
 
-SYNOPSIS
+   SYNOPSIS
 
-       int enable_break (void)
+   int enable_break (void)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This functions inserts a breakpoint at the entry point of the
-       main executable, where all shared libraries are mapped in.
-*/
+   This functions inserts a breakpoint at the entry point of the
+   main executable, where all shared libraries are mapped in.
+ */
 
 static int
 enable_break ()
@@ -1184,61 +1190,61 @@ enable_break ()
 
   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()
+
+   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 ()
 {
   if (!enable_break ())
     {
@@ -1260,7 +1266,7 @@ solib_create_inferior_hook()
       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
@@ -1278,11 +1284,11 @@ solib_create_inferior_hook()
     }
 
   /*  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.  */
+     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.  */
   if (auto_solib_add)
     solib_add ((char *) 0, 0, (struct target_ops *) 0);
   stop_soon_quietly = 0;
@@ -1290,33 +1296,33 @@ solib_create_inferior_hook()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       sharedlibrary_command -- handle command to explicitly add library
+   sharedlibrary_command -- handle command to explicitly add library
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void sharedlibrary_command (char *args, int from_tty)
+   static void sharedlibrary_command (char *args, int from_tty)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 static void
 sharedlibrary_command (args, from_tty)
-char *args;
-int from_tty;
+     char *args;
+     int from_tty;
 {
   dont_repeat ();
   solib_add (args, from_tty, (struct target_ops *) 0);
 }
 
 void
-_initialize_solib()
+_initialize_solib ()
 {
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           "Load shared object library symbols for files matching REGEXP.");
-  add_info ("sharedlibrary", info_sharedlibrary_command, 
+  add_info ("sharedlibrary", info_sharedlibrary_command,
            "Status of loaded shared object libraries.");
 
   add_show_from_set
@@ -1330,8 +1336,8 @@ must be loaded manually, using `sharedlibrary'.",
                  &setlist),
      &showlist);
 }
-
 \f
+
 /* Register that we are able to handle irix5 core file formats.
    This really is bfd_target_unknown_flavour */
 
index 8773c83ea7a9437874055e2082ad9cd0b554d41a..b50c73e1634b7e669d0ecf8943e1578e2732641e 100644 (file)
@@ -1,20 +1,22 @@
 /* Copyright (C) 1993 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <machine/reg.h>
-int rloc[] = {
-    R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, FP, SP, PS, PC
+int rloc[] =
+{
+  R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, FP, SP, PS, PC
 };
index 049d10b9d9f4bcf5aa74aae130418b31fbff0f51..1dd4d4dfbef8befc347ec356407ca0eb040a44e1 100644 (file)
@@ -1,21 +1,22 @@
 /* Java language support routines for GDB, the GNU debugger.
    Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -48,16 +49,16 @@ struct type *java_void_type;
 
 extern void _initialize_java_language PARAMS ((void));
 
-static int java_demangled_signature_length PARAMS ((char*));
-static void java_demangled_signature_copy PARAMS ((char*, char*));
+static int java_demangled_signature_length PARAMS ((char *));
+static void java_demangled_signature_copy PARAMS ((char *, char *));
 
 static struct symtab *get_java_class_symtab PARAMS ((void));
-static char *get_java_utf8_name PARAMS ((struct obstack *obstack, value_ptr name));
+static char *get_java_utf8_name PARAMS ((struct obstack * obstack, value_ptr name));
 static int java_class_is_primitive PARAMS ((value_ptr clas));
 static struct type *java_lookup_type PARAMS ((char *signature));
 static value_ptr java_value_string PARAMS ((char *ptr, int len));
 
-static void java_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+static void java_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
 
 /* This objfile contains symtabs that have been dynamically created
    to record dynamically loaded Java classes and dynamically
@@ -91,7 +92,7 @@ get_java_class_symtab ()
 {
   if (class_symtab == NULL)
     {
-      struct objfile *objfile = get_dynamics_objfile();
+      struct objfile *objfile = get_dynamics_objfile ();
       struct blockvector *bv;
       struct block *bl;
       class_symtab = allocate_symtab ("<java-classes>", objfile);
@@ -143,12 +144,12 @@ add_class_symtab_symbol (sym)
       class_symtab->free_ptr = (char *) bl;
       BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = bl;
     }
-  
+
   BLOCK_SYM (bl, BLOCK_NSYMS (bl)) = sym;
   BLOCK_NSYMS (bl) = BLOCK_NSYMS (bl) + 1;
 }
 
-static struct symbol * add_class_symbol PARAMS ((struct type *type, CORE_ADDR addr));
+static struct symbol *add_class_symbol PARAMS ((struct type * type, CORE_ADDR addr));
 
 static struct symbol *
 add_class_symbol (type, addr)
@@ -162,7 +163,7 @@ add_class_symbol (type, addr)
   SYMBOL_LANGUAGE (sym) = language_java;
   SYMBOL_NAME (sym) = TYPE_TAG_NAME (type);
   SYMBOL_CLASS (sym) = LOC_TYPEDEF;
-  /*  SYMBOL_VALUE (sym) = valu;*/
+  /*  SYMBOL_VALUE (sym) = valu; */
   SYMBOL_TYPE (sym) = type;
   SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
   SYMBOL_VALUE_ADDRESS (sym) = addr;
@@ -184,7 +185,8 @@ java_lookup_class (name)
   if (called from parser)
     {
       call lookup_class (or similar) in inferior;
-      if not found:
+      if not
+      found:
        return NULL;
       addr = found in inferior;
     }
@@ -194,7 +196,7 @@ java_lookup_class (name)
   type = alloc_type (objfile);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (type);
-  TYPE_TAG_NAME (type) = obsavestring (name, strlen(name), &objfile->type_obstack);
+  TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->type_obstack);
   TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
   TYPE ? = addr;
   return type;
@@ -220,8 +222,8 @@ get_java_utf8_name (obstack, name)
   name_length = (int) value_as_long (temp);
   data_addr = VALUE_ADDRESS (temp) + VALUE_OFFSET (temp)
     + TYPE_LENGTH (VALUE_TYPE (temp));
-  chrs = obstack_alloc (obstack, name_length+1);
-  chrs [name_length] = '\0';
+  chrs = obstack_alloc (obstack, name_length + 1);
+  chrs[name_length] = '\0';
   read_memory_section (data_addr, chrs, name_length, NULL);
   return chrs;
 }
@@ -282,7 +284,7 @@ type_from_class (clas)
 #if 0
   get_java_class_symtab ();
   bl = BLOCKVECTOR_BLOCK (BLOCKVECTOR (class_symtab), GLOBAL_BLOCK);
-  for (i = BLOCK_NSYMS (bl);  --i >= 0; )
+  for (i = BLOCK_NSYMS (bl); --i >= 0;)
     {
       struct symbol *sym = BLOCK_SYM (bl, i);
       if (SYMBOL_VALUE_ADDRESS (sym) == addr)
@@ -290,7 +292,7 @@ type_from_class (clas)
     }
 #endif
 
-  objfile = get_dynamics_objfile();
+  objfile = get_dynamics_objfile ();
   if (java_class_is_primitive (clas))
     {
       value_ptr sig;
@@ -304,7 +306,7 @@ type_from_class (clas)
   temp = clas;
   utf8_name = value_struct_elt (&temp, NULL, "name", NULL, "structure");
   name = get_java_utf8_name (&objfile->type_obstack, utf8_name);
-  for (nptr = name;  *nptr != 0;  nptr++)
+  for (nptr = name; *nptr != 0; nptr++)
     {
       if (*nptr == '/')
        *nptr = '.';
@@ -323,7 +325,7 @@ type_from_class (clas)
       char *signature = name;
       int namelen = java_demangled_signature_length (signature);
       if (namelen > strlen (name))
-       name = obstack_alloc (&objfile->type_obstack, namelen+1);
+       name = obstack_alloc (&objfile->type_obstack, namelen + 1);
       java_demangled_signature_copy (name, signature);
       name[namelen] = '\0';
       is_array = 1;
@@ -341,7 +343,7 @@ type_from_class (clas)
   return java_link_class_type (type, clas);
 }
 
-/* Fill in class TYPE with data from the CLAS value. */ 
+/* Fill in class TYPE with data from the CLAS value. */
 
 struct type *
 java_link_class_type (type, clas)
@@ -357,7 +359,7 @@ java_link_class_type (type, clas)
   struct fn_fieldlist *fn_fieldlists;
   value_ptr fields, field, method, methods;
   int i, j;
-  struct objfile *objfile = get_dynamics_objfile();
+  struct objfile *objfile = get_dynamics_objfile ();
   struct type *tsuper;
 
   unqualified_name = strrchr (name, '.');
@@ -386,7 +388,7 @@ java_link_class_type (type, clas)
   temp = clas;
   nfields = value_as_long (value_struct_elt (&temp, NULL, "field_count", NULL, "structure"));
   nfields += TYPE_N_BASECLASSES (type);
-  nfields++;  /* Add one for dummy "class" field. */
+  nfields++;                   /* Add one for dummy "class" field. */
   TYPE_NFIELDS (type) = nfields;
   TYPE_FIELDS (type) = (struct field *)
     TYPE_ALLOC (type, sizeof (struct field) * nfields);
@@ -417,10 +419,10 @@ java_link_class_type (type, clas)
     }
 
   i = strlen (name);
-  if (i > 2 && name[i-1] == ']' && tsuper != NULL)
+  if (i > 2 && name[i - 1] == ']' && tsuper != NULL)
     {
       /* FIXME */
-      TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4;  /* size with "length" */
+      TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4;   /* size with "length" */
     }
   else
     {
@@ -430,14 +432,14 @@ java_link_class_type (type, clas)
     }
 
   fields = NULL;
-  nfields--;  /* First set up dummy "class" field. */
+  nfields--;                   /* First set up dummy "class" field. */
   SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields),
                      VALUE_ADDRESS (clas) + VALUE_OFFSET (clas));
   TYPE_FIELD_NAME (type, nfields) = "class";
   TYPE_FIELD_TYPE (type, nfields) = VALUE_TYPE (clas);
   SET_TYPE_FIELD_PRIVATE (type, nfields);
-  
-  for (i = TYPE_N_BASECLASSES (type);  i < nfields;  i++)
+
+  for (i = TYPE_N_BASECLASSES (type); i < nfields; i++)
     {
       int accflags;
       int boffset;
@@ -448,7 +450,7 @@ java_link_class_type (type, clas)
          field = value_ind (fields);
        }
       else
-       { /* Re-use field value for next field. */
+       {                       /* Re-use field value for next field. */
          VALUE_ADDRESS (field) += TYPE_LENGTH (VALUE_TYPE (field));
          VALUE_LAZY (field) = 1;
        }
@@ -462,26 +464,26 @@ java_link_class_type (type, clas)
       temp = field;
       temp = value_struct_elt (&temp, NULL, "info", NULL, "structure");
       boffset = value_as_long (value_struct_elt (&temp, NULL, "boffset",
-                                                 NULL, "structure"));
-      if (accflags & 0x0001) /* public access */
+                                                NULL, "structure"));
+      if (accflags & 0x0001)   /* public access */
        {
          /* ??? */
        }
-      if (accflags & 0x0002) /* private access */
+      if (accflags & 0x0002)   /* private access */
        {
          SET_TYPE_FIELD_PRIVATE (type, i);
        }
-      if (accflags & 0x0004) /* protected access */
+      if (accflags & 0x0004)   /* protected access */
        {
          SET_TYPE_FIELD_PROTECTED (type, i);
        }
-      if (accflags & 0x0008)  /* ACC_STATIC */
-       SET_FIELD_PHYSADDR(TYPE_FIELD(type, i), boffset);
+      if (accflags & 0x0008)   /* ACC_STATIC */
+       SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
       else
        TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
-      if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
+      if (accflags & 0x8000)   /* FIELD_UNRESOLVED_FLAG */
        {
-         TYPE_FIELD_TYPE (type, i) = get_java_object_type (); /* FIXME */
+         TYPE_FIELD_TYPE (type, i) = get_java_object_type ();  /* FIXME */
        }
       else
        {
@@ -500,14 +502,14 @@ java_link_class_type (type, clas)
                                              NULL, "structure"));
   TYPE_NFN_FIELDS_TOTAL (type) = nmethods;
   j = nmethods * sizeof (struct fn_field);
-  fn_fields = (struct fn_field*)
+  fn_fields = (struct fn_field *)
     obstack_alloc (&dynamics_objfile->symbol_obstack, j);
   memset (fn_fields, 0, j);
-  fn_fieldlists = (struct fn_fieldlist*)
+  fn_fieldlists = (struct fn_fieldlist *)
     alloca (nmethods * sizeof (struct fn_fieldlist));
 
   methods = NULL;
-  for (i = 0;  i < nmethods;  i++)
+  for (i = 0; i < nmethods; i++)
     {
       char *mname;
       int k;
@@ -518,7 +520,7 @@ java_link_class_type (type, clas)
          method = value_ind (methods);
        }
       else
-       { /* Re-use method value for next method. */
+       {                       /* Re-use method value for next method. */
          VALUE_ADDRESS (method) += TYPE_LENGTH (VALUE_TYPE (method));
          VALUE_LAZY (method) = 1;
        }
@@ -536,11 +538,11 @@ java_link_class_type (type, clas)
        * is worth it.  Note that we do maintain the order of methods
        * in the inferior's Method table (as long as that is grouped
        * by method name), which I think is desirable.  --PB */
-      for (k = 0, j = TYPE_NFN_FIELDS (type);  ; )
+      for (k = 0, j = TYPE_NFN_FIELDS (type);;)
        {
          if (--j < 0)
-           { /* No match - new method name. */
-             j = TYPE_NFN_FIELDS(type)++;
+           {                   /* No match - new method name. */
+             j = TYPE_NFN_FIELDS (type)++;
              fn_fieldlists[j].name = mname;
              fn_fieldlists[j].length = 1;
              fn_fieldlists[j].fn_fields = &fn_fields[i];
@@ -548,16 +550,17 @@ java_link_class_type (type, clas)
              break;
            }
          if (strcmp (mname, fn_fieldlists[j].name) == 0)
-           { /* Found an existing method with the same name. */
+           {                   /* Found an existing method with the same name. */
              int l;
              if (mname != unqualified_name)
                obstack_free (&objfile->type_obstack, mname);
              mname = fn_fieldlists[j].name;
              fn_fieldlists[j].length++;
-             k = i - k;  /* Index of new slot. */
+             k = i - k;        /* Index of new slot. */
              /* Shift intervening fn_fields (between k and i) down. */
-             for (l = i;  l > k;  l--) fn_fields[l] = fn_fields[l-1];
-             for (l = TYPE_NFN_FIELDS (type);  --l > j; )
+             for (l = i; l > k; l--)
+               fn_fields[l] = fn_fields[l - 1];
+             for (l = TYPE_NFN_FIELDS (type); --l > j;)
                fn_fieldlists[l].fn_fields++;
              break;
            }
@@ -565,15 +568,15 @@ java_link_class_type (type, clas)
        }
       fn_fields[k].physname = "";
       fn_fields[k].is_stub = 1;
-      fn_fields[k].type = make_function_type (java_void_type, NULL); /* FIXME*/
+      fn_fields[k].type = make_function_type (java_void_type, NULL);   /* FIXME */
       TYPE_CODE (fn_fields[k].type) = TYPE_CODE_METHOD;
     }
 
-  j = TYPE_NFN_FIELDS(type) * sizeof (struct fn_fieldlist);
-  TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist*)
+  j = TYPE_NFN_FIELDS (type) * sizeof (struct fn_fieldlist);
+  TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
     obstack_alloc (&dynamics_objfile->symbol_obstack, j);
   memcpy (TYPE_FN_FIELDLISTS (type), fn_fieldlists, j);
+
   return type;
 }
 
@@ -620,7 +623,7 @@ is_object_type (type)
       name = TYPE_TAG_NAME (ttype);
       if (name != NULL && strcmp (name, "java.lang.Object") == 0)
        return 1;
-      name = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char*)0;
+      name = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char *) 0;
       if (name != NULL && strcmp (name, "vtable") == 0)
        {
          if (java_object_type == NULL)
@@ -637,15 +640,24 @@ java_primitive_type (signature)
 {
   switch (signature)
     {
-    case 'B':  return java_byte_type;
-    case 'S':  return java_short_type;
-    case 'I':  return java_int_type;
-    case 'J':  return java_long_type;
-    case 'Z':  return java_boolean_type;
-    case 'C':  return java_char_type;
-    case 'F':  return java_float_type;
-    case 'D':  return java_double_type;
-    case 'V':  return java_void_type;
+    case 'B':
+      return java_byte_type;
+    case 'S':
+      return java_short_type;
+    case 'I':
+      return java_int_type;
+    case 'J':
+      return java_long_type;
+    case 'Z':
+      return java_boolean_type;
+    case 'C':
+      return java_char_type;
+    case 'F':
+      return java_float_type;
+    case 'D':
+      return java_double_type;
+    case 'V':
+      return java_void_type;
     }
   error ("unknown signature '%c' for primitive type", (char) signature);
 }
@@ -655,7 +667,7 @@ java_primitive_type (signature)
 
 struct type *
 java_primitive_type_from_name (name, namelen)
-     charname;
+     char *name;
      int namelen;
 {
   switch (name[0])
@@ -705,8 +717,8 @@ java_demangled_signature_length (signature)
      char *signature;
 {
   int array = 0;
-  for (; *signature == '[';  signature++)
-    array += 2;  /* Two chars for "[]". */
+  for (; *signature == '['; signature++)
+    array += 2;                        /* Two chars for "[]". */
   switch (signature[0])
     {
     case 'L':
@@ -738,7 +750,7 @@ java_demangled_signature_copy (result, signature)
       /* Subtract 2 for 'L' and ';', but add 1 for final nul. */
       signature++;
       ptr = result;
-      for ( ; *signature != ';' && *signature != '\0'; signature++)
+      for (; *signature != ';' && *signature != '\0'; signature++)
        {
          if (*signature == '/')
            *ptr++ = '.';
@@ -815,7 +827,7 @@ java_value_string (ptr, len)
      char *ptr;
      int len;
 {
-  error ("not implemented - java_value_string"); /* FIXME */
+  error ("not implemented - java_value_string");       /* FIXME */
 }
 
 /* Print the character C on STREAM as part of the contents of a literal
@@ -896,9 +908,9 @@ evaluate_subexp_java (expect_type, exp, pos, noside)
       if (noside == EVAL_SKIP)
        goto nosideret;
       /* If the user attempts to subscript something that is not an
-        array or pointer type (like a plain int variable for example),
-        then report this as an error. */
-      
+         array or pointer type (like a plain int variable for example),
+         then report this as an error. */
+
       COERCE_REF (arg1);
       type = check_typedef (VALUE_TYPE (arg1));
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
@@ -908,18 +920,18 @@ evaluate_subexp_java (expect_type, exp, pos, noside)
        name = TYPE_TAG_NAME (type);
       i = name == NULL ? 0 : strlen (name);
       if (TYPE_CODE (type) == TYPE_CODE_STRUCT
-         && i > 2 && name [i - 1] == ']')
+         && i > 2 && name[i - 1] == ']')
        {
          CORE_ADDR address;
          long length, index;
          struct type *el_type;
          char buf4[4];
 
-         value_ptr clas = java_class_from_object(arg1);
+         value_ptr clas = java_class_from_object (arg1);
          value_ptr temp = clas;
          /* Get CLASS_ELEMENT_TYPE of the array type. */
          temp = value_struct_elt (&temp, NULL, "methods",
-                                  NULL, "structure"); 
+                                  NULL, "structure");
          VALUE_TYPE (temp) = VALUE_TYPE (clas);
          el_type = type_from_class (temp);
          if (TYPE_CODE (el_type) == TYPE_CODE_STRUCT)
@@ -969,7 +981,7 @@ evaluate_subexp_java (expect_type, exp, pos, noside)
     }
 standard:
   return evaluate_subexp_standard (expect_type, exp, pos, noside);
- nosideret:
+nosideret:
   return value_from_longest (builtin_type_long, (LONGEST) 1);
 }
 
@@ -980,15 +992,28 @@ java_create_fundamental_type (objfile, typeid)
 {
   switch (typeid)
     {
-    case FT_VOID:           return java_void_type;
-    case FT_BOOLEAN:        return java_boolean_type;
-    case FT_CHAR:           return java_char_type;
-    case FT_FLOAT:          return java_float_type;
-    case FT_DBL_PREC_FLOAT: return java_double_type;
-    case FT_BYTE: case FT_SIGNED_CHAR:       return java_byte_type;
-    case FT_SHORT: case FT_SIGNED_SHORT:     return java_short_type;
-    case FT_INTEGER: case FT_SIGNED_INTEGER: return java_int_type;
-    case FT_LONG: case FT_SIGNED_LONG:       return java_long_type;
+    case FT_VOID:
+      return java_void_type;
+    case FT_BOOLEAN:
+      return java_boolean_type;
+    case FT_CHAR:
+      return java_char_type;
+    case FT_FLOAT:
+      return java_float_type;
+    case FT_DBL_PREC_FLOAT:
+      return java_double_type;
+    case FT_BYTE:
+    case FT_SIGNED_CHAR:
+      return java_byte_type;
+    case FT_SHORT:
+    case FT_SIGNED_SHORT:
+      return java_short_type;
+    case FT_INTEGER:
+    case FT_SIGNED_INTEGER:
+      return java_int_type;
+    case FT_LONG:
+    case FT_SIGNED_LONG:
+      return java_long_type;
     }
   return c_create_fundamental_type (objfile, typeid);
 }
@@ -997,44 +1022,45 @@ java_create_fundamental_type (objfile, typeid)
    and precedences of the operators.  */
 
 const struct op_print java_op_print_tab[] =
-  {
-    {",",  BINOP_COMMA, PREC_COMMA, 0},
-    {"=",  BINOP_ASSIGN, PREC_ASSIGN, 1},
-    {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
-    {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
-    {"|",  BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
-    {"^",  BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
-    {"&",  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_COMMA, PREC_COMMA, 0},
+  {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+  {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+  {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+  {"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
+  {"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
+  {"&", 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},
 #if 0
-    {">>>", BINOP_???, PREC_SHIFT, 0},
+  {">>>", BINOP_ ? ? ?, PREC_SHIFT, 0},
 #endif
-    {"+",  BINOP_ADD, PREC_ADD, 0},
-    {"-",  BINOP_SUB, PREC_ADD, 0},
-    {"*",  BINOP_MUL, PREC_MUL, 0},
-    {"/",  BINOP_DIV, PREC_MUL, 0},
-    {"%",  BINOP_REM, PREC_MUL, 0},
-    {"-",  UNOP_NEG, PREC_PREFIX, 0},
-    {"!",  UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
-    {"~",  UNOP_COMPLEMENT, PREC_PREFIX, 0},
-    {"*",  UNOP_IND, PREC_PREFIX, 0},
+  {"+", BINOP_ADD, PREC_ADD, 0},
+  {"-", BINOP_SUB, PREC_ADD, 0},
+  {"*", BINOP_MUL, PREC_MUL, 0},
+  {"/", BINOP_DIV, PREC_MUL, 0},
+  {"%", BINOP_REM, PREC_MUL, 0},
+  {"-", UNOP_NEG, PREC_PREFIX, 0},
+  {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+  {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
+  {"*", UNOP_IND, PREC_PREFIX, 0},
 #if 0
-    {"instanceof", ???, ???, 0},
+  {"instanceof", ? ? ?, ? ? ?, 0},
 #endif
-    {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
-    {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
-    {NULL, 0, 0, 0}
+  {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
+  {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
+  {NULL, 0, 0, 0}
 };
 
-const struct language_defn java_language_defn = {
-  "java",                              /* Language name */
+const struct language_defn java_language_defn =
+{
+  "java",                      /* Language name */
   language_java,
   c_builtin_types,
   range_check_off,
@@ -1049,14 +1075,14 @@ const struct language_defn java_language_defn = {
   java_print_type,             /* Print a type using appropriate syntax */
   java_val_print,              /* Print a value using appropriate syntax */
   java_value_print,            /* Print a top-level value */
-  {"",      "",    "",   ""},  /* Binary format info */
-  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
-  {"%ld",    "",    "d",  ""}, /* Decimal format info */
-  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   java_op_print_tab,           /* expression operators for printing */
   0,                           /* not c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
@@ -1064,15 +1090,15 @@ void
 _initialize_java_language ()
 {
 
-  java_int_type    = init_type (TYPE_CODE_INT,  4, 0, "int", NULL);
-  java_short_type  = init_type (TYPE_CODE_INT,  2, 0, "short", NULL);
-  java_long_type   = init_type (TYPE_CODE_INT,  8, 0, "long", NULL);
-  java_byte_type   = init_type (TYPE_CODE_INT,  1, 0, "byte", NULL);
-  java_boolean_type= init_type (TYPE_CODE_BOOL, 1, 0, "boolean", NULL);
-  java_char_type   = init_type (TYPE_CODE_CHAR, 2, TYPE_FLAG_UNSIGNED, "char", NULL);
-  java_float_type  = init_type (TYPE_CODE_FLT,  4, 0, "float", NULL);
-  java_double_type = init_type (TYPE_CODE_FLT,  8, 0, "double", NULL);
-  java_void_type   = init_type (TYPE_CODE_VOID, 1, 0, "void", NULL);
+  java_int_type = init_type (TYPE_CODE_INT, 4, 0, "int", NULL);
+  java_short_type = init_type (TYPE_CODE_INT, 2, 0, "short", NULL);
+  java_long_type = init_type (TYPE_CODE_INT, 8, 0, "long", NULL);
+  java_byte_type = init_type (TYPE_CODE_INT, 1, 0, "byte", NULL);
+  java_boolean_type = init_type (TYPE_CODE_BOOL, 1, 0, "boolean", NULL);
+  java_char_type = init_type (TYPE_CODE_CHAR, 2, TYPE_FLAG_UNSIGNED, "char", NULL);
+  java_float_type = init_type (TYPE_CODE_FLT, 4, 0, "float", NULL);
+  java_double_type = init_type (TYPE_CODE_FLT, 8, 0, "double", NULL);
+  java_void_type = init_type (TYPE_CODE_VOID, 1, 0, "void", NULL);
 
   add_language (&java_language_defn);
 }
@@ -1087,7 +1113,7 @@ java_rerun_cleanup ()
 {
   if (class_symtab != NULL)
     {
-      free_symtab (class_symtab); /* ??? */
+      free_symtab (class_symtab);      /* ??? */
       class_symtab = NULL;
     }
   if (dynamics_objfile != NULL)
index 44c44375a46a12c6e012877c9071db01e15d78c2..cec3aabf5b03af5fa4db953958d4d9687a6e01b4 100644 (file)
@@ -1,21 +1,22 @@
 /* Java language support definitions for GDB, the GNU debugger.
    Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 extern int
 java_parse PARAMS ((void));    /* Defined in jv-exp.y */
@@ -50,16 +51,16 @@ extern struct type *type_from_class PARAMS ((struct value *));
 
 extern struct type *java_primitive_type PARAMS ((int signature));
 
-extern struct type *java_primitive_type_from_name PARAMS ((char*, int));
+extern struct type *java_primitive_type_from_name PARAMS ((char *, int));
 
 extern struct type *java_array_type PARAMS ((struct type *, int));
 
 extern struct type *get_java_object_type PARAMS ((void));
 extern int get_java_object_header_size PARAMS ((void));
 
-extern struct type *java_lookup_class PARAMS((char *));
+extern struct type *java_lookup_class PARAMS ((char *));
 
-extern int is_object_type PARAMS ((struct type*));
+extern int is_object_type PARAMS ((struct type *));
 
 extern void                    /* Defined in jv-typeprint.c */
 java_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
index 822b586508a60ddb0c10626244115378c1af83d9..884bc1270462b8a750603edb68d46a65bcb3d17b 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for printing Java types for GDB, the GNU debugger.
    Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
@@ -30,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Local functions */
 
-static void java_type_print_base PARAMS ((struct type *type, GDB_FILE *stream, int show, int level));
+static void java_type_print_base PARAMS ((struct type * type, GDB_FILE * stream, int show, int level));
 
 static void
 java_type_print_derivation_info (stream, type)
@@ -48,7 +49,7 @@ java_type_print_derivation_info (stream, type)
     {
       int kind;
 
-      kind = BASETYPE_VIA_VIRTUAL(type, i) ? 'I' : 'E';
+      kind = BASETYPE_VIA_VIRTUAL (type, i) ? 'I' : 'E';
 
       fputs_filtered (kind == prev ? ", "
                      : kind == 'I' ? " implements "
@@ -149,7 +150,7 @@ java_type_print_base (type, stream, show, level)
       else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
        {
          java_type_print_derivation_info (stream, type);
-         
+
          fprintf_filtered (stream, "{\n");
          if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
            {
@@ -200,7 +201,7 @@ java_type_print_base (type, stream, show, level)
          /* If there are both fields and methods, put a space between. */
          len = TYPE_NFN_FIELDS (type);
          if (len)
-            fprintf_filtered (stream, "\n");
+           fprintf_filtered (stream, "\n");
 
          /* Print out the methods */
 
@@ -226,7 +227,7 @@ java_type_print_base (type, stream, show, level)
 
                  physname = TYPE_FN_FIELD_PHYSNAME (f, j);
 
-                 is_full_physname_constructor = 
+                 is_full_physname_constructor =
                    ((physname[0] == '_' && physname[1] == '_'
                      && strchr ("0123456789Qt", physname[2]))
                     || STREQN (physname, "__ct__", 6)
@@ -259,7 +260,7 @@ java_type_print_base (type, stream, show, level)
                    {
                      /* Keep GDB from crashing here.  */
                      fprintf_filtered (stream, "<undefined type> %s;\n",
-                              TYPE_FN_FIELD_PHYSNAME (f, j));
+                                       TYPE_FN_FIELD_PHYSNAME (f, j));
                      break;
                    }
                  else if (!is_constructor && !is_full_physname_constructor)
@@ -315,8 +316,8 @@ java_type_print_base (type, stream, show, level)
        }
       break;
 
-      default:
-       c_type_print_base (type, stream, show, level);
+    default:
+      c_type_print_base (type, stream, show, level);
     }
 }
 
@@ -346,6 +347,6 @@ java_print_type (type, varstring, stream, show, level)
   /* For demangled function names, we have the arglist as part of the name,
      so don't print an additional pair of ()'s */
 
-  demangled_args = strchr(varstring, '(') != NULL;
+  demangled_args = strchr (varstring, '(') != NULL;
   c_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
 }
index a19245a937a99de59c81d2150a583145f9e665f3..e19a307dac7c6de907dc93a3c95e5518812ad191 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for printing Java values for GDB, the GNU debugger.
    Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -32,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Local functions */
 
-static void java_print_value_fields PARAMS ((struct type *type, char *valaddr, CORE_ADDR address, GDB_FILE *stream, int format, int recurse, enum val_prettyprint pretty));
+static void java_print_value_fields PARAMS ((struct type * type, char *valaddr, CORE_ADDR address, GDB_FILE * stream, int format, int recurse, enum val_prettyprint pretty));
 
 
 int
@@ -67,17 +68,17 @@ java_value_print (val, stream, format, pretty)
        }
     }
 
-  if (TYPE_CODE (type) == TYPE_CODE_PTR && ! value_logical_not (val))
+  if (TYPE_CODE (type) == TYPE_CODE_PTR && !value_logical_not (val))
     type_print (TYPE_TARGET_TYPE (type), "", stream, -1);
 
   name = TYPE_TAG_NAME (type);
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT && name != NULL
-      && (i = strlen (name), name[i-1] == ']'))
+      && (i = strlen (name), name[i - 1] == ']'))
     {
       char buf4[4];
       long length;
       unsigned int things_printed = 0;
-      int reps; 
+      int reps;
       struct type *el_type = java_primitive_type_from_name (name, i - 2);
 
       i = 0;
@@ -90,7 +91,7 @@ java_value_print (val, stream, format, pretty)
        {
          CORE_ADDR element, next_element;
 
-         address += JAVA_OBJECT_SIZE + 4; /* Skip object header and length. */
+         address += JAVA_OBJECT_SIZE + 4;      /* Skip object header and length. */
 
          while (i < length && things_printed < print_max)
            {
@@ -103,16 +104,16 @@ java_value_print (val, stream, format, pretty)
                element = next_element;
              else
                {
-                 read_memory (address, buf, sizeof(buf));
+                 read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 element = extract_address (buf, sizeof(buf));
+                 element = extract_address (buf, sizeof (buf));
                }
 
-             for (reps = 1;  i + reps < length;  reps++)
+             for (reps = 1; i + reps < length; reps++)
                {
-                 read_memory (address, buf, sizeof(buf));
+                 read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 next_element = extract_address (buf, sizeof(buf));
+                 next_element = extract_address (buf, sizeof (buf));
                  if (next_element != element)
                    break;
                }
@@ -160,7 +161,7 @@ java_value_print (val, stream, format, pretty)
 
              VALUE_OFFSET (next_v) = VALUE_OFFSET (v);
 
-             for (reps = 1;  i + reps < length;  reps++)
+             for (reps = 1; i + reps < length; reps++)
                {
                  VALUE_LAZY (next_v) = 1;
                  VALUE_OFFSET (next_v) += TYPE_LENGTH (el_type);
@@ -195,7 +196,7 @@ java_value_print (val, stream, format, pretty)
   if (TYPE_CODE (type) == TYPE_CODE_PTR
       && TYPE_TARGET_TYPE (type)
       && TYPE_NAME (TYPE_TARGET_TYPE (type))
-      && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
+    && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
       && (format == 0 || format == 's')
       && address != 0)
     {
@@ -218,7 +219,7 @@ java_value_print (val, stream, format, pretty)
       count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
       count = value_as_pointer (count_val);
 
-      value_free_to_mark (mark); /* Release unnecessary values */
+      value_free_to_mark (mark);       /* Release unnecessary values */
 
       val_print_string (data + boffset, count, 2, stream);
 
@@ -264,7 +265,7 @@ java_print_value_fields (type, valaddr, address, stream,
          struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
          char *basename = TYPE_NAME (baseclass);
          char *base_valaddr;
-         
+
          if (BASETYPE_VIA_VIRTUAL (type, i))
            continue;
 
@@ -276,7 +277,7 @@ java_print_value_fields (type, valaddr, address, stream,
          if (pretty)
            {
              fprintf_filtered (stream, "\n");
-             print_spaces_filtered (2 * (recurse+1), stream);
+             print_spaces_filtered (2 * (recurse + 1), stream);
            }
          fputs_filtered ("<", stream);
          /* Not sure what the best notation is in the case where there is no
@@ -287,9 +288,9 @@ java_print_value_fields (type, valaddr, address, stream,
          base_valaddr = valaddr;
 
          java_print_value_fields (baseclass, base_valaddr, address + boffset,
-                                  stream, format, recurse+1, pretty);
+                                  stream, format, recurse + 1, pretty);
          fputs_filtered (", ", stream);
-         
+
        flush_it:
          ;
        }
@@ -334,7 +335,7 @@ java_print_value_fields (type, valaddr, address, stream,
              fprintf_filtered (stream, "\n");
              print_spaces_filtered (2 + 2 * recurse, stream);
            }
-         else 
+         else
            {
              wrap_here (n_spaces (2 + 2 * recurse));
            }
@@ -374,25 +375,25 @@ java_print_value_fields (type, valaddr, address, stream,
              value_ptr v;
 
              /* Bitfields require special handling, especially due to byte
-                order problems.  */
+                order problems.  */
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                  fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_filtered ("<optimized out or zero length>", stream);
                }
              else
                {
-                  v = value_from_longest (TYPE_FIELD_TYPE (type, i),
+                 v = value_from_longest (TYPE_FIELD_TYPE (type, i),
                                   unpack_field_as_long (type, valaddr, i));
 
-                   val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0,
-                             0, stream, format, 0, recurse + 1, pretty);
+                 val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0,
+                            0, stream, format, 0, recurse + 1, pretty);
                }
            }
          else
            {
              if (TYPE_FIELD_IGNORE (type, i))
                {
-                  fputs_filtered ("<optimized out or zero length>", stream);
+                 fputs_filtered ("<optimized out or zero length>", stream);
                }
              else if (TYPE_FIELD_STATIC (type, i))
                {
@@ -406,17 +407,17 @@ java_print_value_fields (type, valaddr, address, stream,
                        v = value_addr (v);
                      val_print (VALUE_TYPE (v),
                                 VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v),
-                                stream, format, 0, recurse+1, pretty);
+                                stream, format, 0, recurse + 1, pretty);
                    }
                }
              else if (TYPE_FIELD_TYPE (type, i) == NULL)
                fputs_filtered ("<unknown type>", stream);
              else
                {
-                  val_print (TYPE_FIELD_TYPE (type, i), 
-                             valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
-                             address + TYPE_FIELD_BITPOS (type, i) / 8,
-                             stream, format, 0, recurse + 1, pretty);
+                 val_print (TYPE_FIELD_TYPE (type, i),
+                            valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
+                            address + TYPE_FIELD_BITPOS (type, i) / 8,
+                            stream, format, 0, recurse + 1, pretty);
                }
            }
          annotate_field_end ();
@@ -456,7 +457,7 @@ java_val_print (type, valaddr, embedded_offset, address, stream, format,
      int recurse;
      enum val_prettyprint pretty;
 {
-  register unsigned int i = 0;         /* Number of characters printed */
+  register unsigned int i = 0; /* Number of characters printed */
   struct type *target_type;
   CORE_ADDR addr;
 
@@ -470,13 +471,13 @@ java_val_print (type, valaddr, embedded_offset, address, stream, format,
          break;
        }
 #if 0
-      if (vtblprint && cp_is_vtbl_ptr_type(type))
+      if (vtblprint && cp_is_vtbl_ptr_type (type))
        {
-          /* Print the unmangled name if desired.  */
+         /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if we ARE using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_STRUCT.) */
-         print_address_demangle(extract_address (valaddr, TYPE_LENGTH (type)),
-                                stream, demangle);
+         print_address_demangle (extract_address (valaddr, TYPE_LENGTH (type)),
+                                 stream, demangle);
          break;
        }
 #endif
index bec558f635da51bcd1879aa4d1b5c4df5fc819cf..7a4acb712089fe0315977550da7e41e50cedbe71 100644 (file)
@@ -1,27 +1,30 @@
 /* Main loop for the standalone kernel debugger, for GDB, the GNU Debugger.
    Copyright 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
-static char *args[] = {"kdb", "kdb-symbols", 0};
+static char *args[] =
+{"kdb", "kdb-symbols", 0};
 
-static char *environment[] = {0};
+static char *environment[] =
+{0};
 
 char **environ;
 
index 011fa21de9a8ae999ebc484ea65fc214aa01de44..d177918a0ac9576627602b4dbe5ef6fd1e2cb739 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by the Department of Computer Science at the State University
    of New York at Buffalo.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This file contains functions that return things that are specific
    to languages.  Each function should examine current_language if necessary,
@@ -86,16 +87,16 @@ static void
 set_type_range PARAMS ((void));
 
 static void
-unk_lang_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
+unk_lang_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
 
 static void
-unk_lang_printchar PARAMS ((int c, GDB_FILE *stream));
+unk_lang_printchar PARAMS ((int c, GDB_FILE * stream));
 
 static void
-unk_lang_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+unk_lang_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
 
 static struct type *
-unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
+  unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
 
 static void
 unk_lang_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
@@ -110,11 +111,11 @@ unk_lang_value_print PARAMS ((value_ptr, GDB_FILE *, int, enum val_prettyprint))
 /* Forward declaration */
 extern const struct language_defn unknown_language_defn;
 extern char *warning_pre_print;
-  
+
 /* The current (default at startup) state of type and range checking.
-    (If the modes are set to "auto", though, these are changed based
-    on the default language at startup, and then again based on the
-    language of the first source file.  */
+   (If the modes are set to "auto", though, these are changed based
+   on the default language at startup, and then again based on the
+   language of the first source file.  */
 
 enum range_mode range_mode = range_mode_auto;
 enum range_check range_check = range_check_off;
@@ -151,9 +152,9 @@ static char *range;
 /* Warning issued when current_language and the language of the current
    frame do not match. */
 char lang_frame_mismatch_warn[] =
-       "Warning: the current language does not match this frame.";
-
+"Warning: the current language does not match this frame.";
 \f
+
 /* This page contains the functions corresponding to GDB commands
    and their helpers. */
 
@@ -161,23 +162,23 @@ char lang_frame_mismatch_warn[] =
    does not match the frame. */
 static void
 show_language_command (ignore, from_tty)
-   char *ignore;
-   int from_tty;
+     char *ignore;
+     int from_tty;
 {
-   enum language flang;                /* The language of the current frame */
+  enum language flang;         /* The language of the current frame */
 
-   flang = get_frame_language();
-   if (flang != language_unknown &&
-       language_mode == language_mode_manual &&
-       current_language->la_language != flang)
-     printf_filtered("%s\n",lang_frame_mismatch_warn);
+  flang = get_frame_language ();
+  if (flang != language_unknown &&
+      language_mode == language_mode_manual &&
+      current_language->la_language != flang)
+    printf_filtered ("%s\n", lang_frame_mismatch_warn);
 }
 
 /* Set command.  Change the current working language. */
 static void
 set_language_command (ignore, from_tty)
-   char *ignore;
-   int from_tty;
+     char *ignore;
+     int from_tty;
 {
   int i;
   enum language flang;
@@ -185,7 +186,7 @@ set_language_command (ignore, from_tty)
 
   if (!language || !language[0])
     {
-      printf_unfiltered("The currently understood settings are:\n\n");
+      printf_unfiltered ("The currently understood settings are:\n\n");
       printf_unfiltered ("local or auto    Automatic setting based on source file\n");
 
       for (i = 0; i < languages_size; ++i)
@@ -199,137 +200,142 @@ set_language_command (ignore, from_tty)
             a capitalization of the internal name.  */
          printf_unfiltered ("%-16s Use the %c%s language\n",
                             languages[i]->la_name,
-                            /* Capitalize first letter of language
-                               name.  */
+         /* Capitalize first letter of language
+            name.  */
                             toupper (languages[i]->la_name[0]),
                             languages[i]->la_name + 1);
        }
       /* Restore the silly string. */
-      set_language(current_language->la_language);
+      set_language (current_language->la_language);
       return;
     }
 
   /* Search the list of languages for a match.  */
-  for (i = 0; i < languages_size; i++) {
-    if (STREQ (languages[i]->la_name, language)) {
-      /* Found it!  Go into manual mode, and use this language.  */
-      if (languages[i]->la_language == language_auto) {
-       /* Enter auto mode.  Set to the current frame's language, if known.  */
-       language_mode = language_mode_auto;
-       flang = get_frame_language();
-       if (flang!=language_unknown)
-         set_language(flang);
-       expected_language = current_language;
-       return;
-      } else {
-       /* Enter manual mode.  Set the specified language.  */
-       language_mode = language_mode_manual;
-       current_language = languages[i];
-       set_type_range ();
-       set_lang_str();
-       expected_language = current_language;
-       return;
-      }
+  for (i = 0; i < languages_size; i++)
+    {
+      if (STREQ (languages[i]->la_name, language))
+       {
+         /* Found it!  Go into manual mode, and use this language.  */
+         if (languages[i]->la_language == language_auto)
+           {
+             /* Enter auto mode.  Set to the current frame's language, if known.  */
+             language_mode = language_mode_auto;
+             flang = get_frame_language ();
+             if (flang != language_unknown)
+               set_language (flang);
+             expected_language = current_language;
+             return;
+           }
+         else
+           {
+             /* Enter manual mode.  Set the specified language.  */
+             language_mode = language_mode_manual;
+             current_language = languages[i];
+             set_type_range ();
+             set_lang_str ();
+             expected_language = current_language;
+             return;
+           }
+       }
     }
-  }
 
   /* Reset the language (esp. the global string "language") to the 
      correct values. */
-  err_lang=savestring(language,strlen(language));
+  err_lang = savestring (language, strlen (language));
   make_cleanup (free, err_lang);       /* Free it after error */
-  set_language(current_language->la_language);
-  error ("Unknown language `%s'.",err_lang);
+  set_language (current_language->la_language);
+  error ("Unknown language `%s'.", err_lang);
 }
 
 /* Show command.  Display a warning if the type setting does
    not match the current language. */
 static void
-show_type_command(ignore, from_tty)
-   char *ignore;
-   int from_tty;
+show_type_command (ignore, from_tty)
+     char *ignore;
+     int from_tty;
 {
-   if (type_check != current_language->la_type_check)
-      printf_unfiltered(
-"Warning: the current type check setting does not match the language.\n");
+  if (type_check != current_language->la_type_check)
+    printf_unfiltered (
+                       "Warning: the current type check setting does not match the language.\n");
 }
 
 /* Set command.  Change the setting for type checking. */
 static void
-set_type_command(ignore, from_tty)
-   char *ignore;
-   int from_tty;
+set_type_command (ignore, from_tty)
+     char *ignore;
+     int from_tty;
 {
-   if (STREQ(type,"on"))
-   {
+  if (STREQ (type, "on"))
+    {
       type_check = type_check_on;
       type_mode = type_mode_manual;
-   }
-   else if (STREQ(type,"warn"))
-   {
+    }
+  else if (STREQ (type, "warn"))
+    {
       type_check = type_check_warn;
       type_mode = type_mode_manual;
-   }
-   else if (STREQ(type,"off"))
-   {
+    }
+  else if (STREQ (type, "off"))
+    {
       type_check = type_check_off;
       type_mode = type_mode_manual;
-   }
-   else if (STREQ(type,"auto"))
-   {
+    }
+  else if (STREQ (type, "auto"))
+    {
       type_mode = type_mode_auto;
-      set_type_range();
+      set_type_range ();
       /* Avoid hitting the set_type_str call below.  We
          did it in set_type_range. */
       return;
-   }
-   set_type_str();
-   show_type_command((char *)NULL, from_tty);
+    }
+  set_type_str ();
+  show_type_command ((char *) NULL, from_tty);
 }
 
 /* Show command.  Display a warning if the range setting does
    not match the current language. */
 static void
-show_range_command(ignore, from_tty)
-   char *ignore;
-   int from_tty;
+show_range_command (ignore, from_tty)
+     char *ignore;
+     int from_tty;
 {
 
-   if (range_check != current_language->la_range_check)
-      printf_unfiltered(
-"Warning: the current range check setting does not match the language.\n");
+  if (range_check != current_language->la_range_check)
+    printf_unfiltered (
+                       "Warning: the current range check setting does not match the language.\n");
 }
 
 /* Set command.  Change the setting for range checking. */
 static void
-set_range_command(ignore, from_tty)
-   char *ignore;
-   int from_tty;
+set_range_command (ignore, from_tty)
+     char *ignore;
+     int from_tty;
 {
-   if (STREQ(range,"on"))
-   {
+  if (STREQ (range, "on"))
+    {
       range_check = range_check_on;
       range_mode = range_mode_manual;
-   }
-   else if (STREQ(range,"warn"))
-   {
+    }
+  else if (STREQ (range, "warn"))
+    {
       range_check = range_check_warn;
       range_mode = range_mode_manual;
-   }
-   else if (STREQ(range,"off"))
-   {
+    }
+  else if (STREQ (range, "off"))
+    {
       range_check = range_check_off;
       range_mode = range_mode_manual;
-   }
-   else if (STREQ(range,"auto"))
-   {
+    }
+  else if (STREQ (range, "auto"))
+    {
       range_mode = range_mode_auto;
-      set_type_range();
+      set_type_range ();
       /* Avoid hitting the set_range_str call below.  We
-        did it in set_type_range. */
+         did it in set_type_range. */
       return;
-   }
-   set_range_str();
-   show_range_command((char *)0, from_tty);
+    }
+  set_range_str ();
+  show_range_command ((char *) 0, from_tty);
 }
 
 /* Set the status of range and type checking based on
@@ -337,7 +343,7 @@ set_range_command(ignore, from_tty)
    If SHOW is non-zero, then print out the current language,
    type and range checking status. */
 static void
-set_type_range()
+set_type_range ()
 {
 
   if (range_mode == range_mode_auto)
@@ -346,29 +352,31 @@ set_type_range()
   if (type_mode == type_mode_auto)
     type_check = current_language->la_type_check;
 
-  set_type_str();
-  set_range_str();
+  set_type_str ();
+  set_range_str ();
 }
 
 /* Set current language to (enum language) LANG.  Returns previous language. */
 
 enum language
-set_language(lang)
-   enum language lang;
+set_language (lang)
+     enum language lang;
 {
   int i;
   enum language prev_language;
 
   prev_language = current_language->la_language;
 
-  for (i = 0; i < languages_size; i++) {
-    if (languages[i]->la_language == lang) {
-      current_language = languages[i];
-      set_type_range ();
-      set_lang_str();
-      break;
+  for (i = 0; i < languages_size; i++)
+    {
+      if (languages[i]->la_language == lang)
+       {
+         current_language = languages[i];
+         set_type_range ();
+         set_lang_str ();
+         break;
+       }
     }
-  }
 
   return prev_language;
 }
@@ -376,69 +384,69 @@ set_language(lang)
 /* This page contains functions that update the global vars
    language, type and range. */
 static void
-set_lang_str()
+set_lang_str ()
 {
-   char *prefix = "";
+  char *prefix = "";
 
-   free (language);
-   if (language_mode == language_mode_auto)
-      prefix = "auto; currently ";
+  free (language);
+  if (language_mode == language_mode_auto)
+    prefix = "auto; currently ";
 
-   language = concat(prefix, current_language->la_name, NULL);
+  language = concat (prefix, current_language->la_name, NULL);
 }
 
 static void
-set_type_str()
+set_type_str ()
 {
-   char *tmp, *prefix = "";
+  char *tmp, *prefix = "";
 
-   free (type);
-   if (type_mode==type_mode_auto)
-      prefix = "auto; currently ";
+  free (type);
+  if (type_mode == type_mode_auto)
+    prefix = "auto; currently ";
 
-   switch(type_check)
-   {
-   case type_check_on:
+  switch (type_check)
+    {
+    case type_check_on:
       tmp = "on";
       break;
-   case type_check_off:
+    case type_check_off:
       tmp = "off";
       break;
-   case type_check_warn:
+    case type_check_warn:
       tmp = "warn";
       break;
-      default:
+    default:
       error ("Unrecognized type check setting.");
-   }
+    }
 
-   type = concat(prefix,tmp,NULL);
+  type = concat (prefix, tmp, NULL);
 }
 
 static void
-set_range_str()
+set_range_str ()
 {
-   char *tmp, *pref = "";
+  char *tmp, *pref = "";
 
-   free (range);
-   if (range_mode==range_mode_auto)
-      pref = "auto; currently ";
+  free (range);
+  if (range_mode == range_mode_auto)
+    pref = "auto; currently ";
 
-   switch(range_check)
-   {
-   case range_check_on:
+  switch (range_check)
+    {
+    case range_check_on:
       tmp = "on";
       break;
-   case range_check_off:
+    case range_check_off:
       tmp = "off";
       break;
-   case range_check_warn:
+    case range_check_warn:
       tmp = "warn";
       break;
-      default:
+    default:
       error ("Unrecognized range check setting.");
-   }
+    }
 
-   range = concat(pref,tmp,NULL);
+  range = concat (pref, tmp, NULL);
 }
 
 
@@ -453,138 +461,138 @@ language_info (quietly)
     return;
 
   expected_language = current_language;
-  printf_unfiltered("Current language:  %s\n",language);
-  show_language_command((char *)0, 1);
+  printf_unfiltered ("Current language:  %s\n", language);
+  show_language_command ((char *) 0, 1);
 
   if (!quietly)
     {
-       printf_unfiltered("Type checking:     %s\n",type);
-       show_type_command((char *)0, 1);
-       printf_unfiltered("Range checking:    %s\n",range);
-       show_range_command((char *)0, 1);
+      printf_unfiltered ("Type checking:     %s\n", type);
+      show_type_command ((char *) 0, 1);
+      printf_unfiltered ("Range checking:    %s\n", range);
+      show_range_command ((char *) 0, 1);
     }
 }
 \f
 /* Return the result of a binary operation. */
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 struct type *
 binop_result_type (v1, v2)
-   value_ptr v1, v2;
+     value_ptr v1, v2;
 {
-   int size,uns;
-   struct type *t1 = check_typedef (VALUE_TYPE (v1));
-   struct type *t2 = check_typedef (VALUE_TYPE (v2));
-
-   int l1 = TYPE_LENGTH (t1);
-   int l2 = TYPE_LENGTH (t2);
-
-   switch(current_language->la_language)
-   {
-   case language_c:
-   case language_cplus:
-      if (TYPE_CODE (t1)==TYPE_CODE_FLT)
-        return TYPE_CODE(t2) == TYPE_CODE_FLT && l2 > l1 ?
-           VALUE_TYPE(v2) : VALUE_TYPE(v1);
-      else if (TYPE_CODE(t2)==TYPE_CODE_FLT)
-        return TYPE_CODE(t1) == TYPE_CODE_FLT && l1 > l2 ?
-           VALUE_TYPE(v1) : VALUE_TYPE(v2);
-      else if (TYPE_UNSIGNED(t1) && l1 > l2)
-        return VALUE_TYPE(v1);
-      else if (TYPE_UNSIGNED(t2) && l2 > l1)
-        return VALUE_TYPE(v2);
-      else  /* Both are signed.  Result is the longer type */
-        return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2);
+  int size, uns;
+  struct type *t1 = check_typedef (VALUE_TYPE (v1));
+  struct type *t2 = check_typedef (VALUE_TYPE (v2));
+
+  int l1 = TYPE_LENGTH (t1);
+  int l2 = TYPE_LENGTH (t2);
+
+  switch (current_language->la_language)
+    {
+    case language_c:
+    case language_cplus:
+      if (TYPE_CODE (t1) == TYPE_CODE_FLT)
+       return TYPE_CODE (t2) == TYPE_CODE_FLT && l2 > l1 ?
+         VALUE_TYPE (v2) : VALUE_TYPE (v1);
+      else if (TYPE_CODE (t2) == TYPE_CODE_FLT)
+       return TYPE_CODE (t1) == TYPE_CODE_FLT && l1 > l2 ?
+         VALUE_TYPE (v1) : VALUE_TYPE (v2);
+      else if (TYPE_UNSIGNED (t1) && l1 > l2)
+       return VALUE_TYPE (v1);
+      else if (TYPE_UNSIGNED (t2) && l2 > l1)
+       return VALUE_TYPE (v2);
+      else                     /* Both are signed.  Result is the longer type */
+       return l1 > l2 ? VALUE_TYPE (v1) : VALUE_TYPE (v2);
       break;
-   case language_m2:
+    case language_m2:
       /* If we are doing type-checking, l1 should equal l2, so this is
-        not needed. */
-      return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(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*/
-   }
-   abort();
-   return (struct type *)0;    /* For lint */
+    case language_chill:
+      error ("Missing Chill support in function binop_result_check."); /*FIXME */
+    }
+  abort ();
+  return (struct type *) 0;    /* For lint */
 }
 
-#endif /* 0 */
-
+#endif /* 0 */
 \f
+
 /* This page contains functions that return format strings for
    printf for printing out numbers in different formats */
 
 /* Returns the appropriate printf format for hexadecimal
    numbers. */
 char *
-local_hex_format_custom(pre)
-   char *pre;
+local_hex_format_custom (pre)
+     char *pre;
 {
-   static char form[50];
-
-   strcpy (form, local_hex_format_prefix ());
-   strcat (form, "%");
-   strcat (form, pre);
-   strcat (form, local_hex_format_specifier ());
-   strcat (form, local_hex_format_suffix ());
-   return form;
+  static char form[50];
+
+  strcpy (form, local_hex_format_prefix ());
+  strcat (form, "%");
+  strcat (form, pre);
+  strcat (form, local_hex_format_specifier ());
+  strcat (form, local_hex_format_suffix ());
+  return form;
 }
 
 /* Converts a number to hexadecimal and stores it in a static
    string.  Returns a pointer to this string. */
 char *
 local_hex_string (num)
-   unsigned long num;
+     unsigned long num;
 {
-   static char res[50];
+  static char res[50];
 
-   sprintf (res, local_hex_format(), num);
-   return res;
+  sprintf (res, local_hex_format (), num);
+  return res;
 }
 
 /* Converts a number to custom hexadecimal and stores it in a static
    string.  Returns a pointer to this string. */
 char *
-local_hex_string_custom(num,pre)
-   unsigned long num;
-   char *pre;
+local_hex_string_custom (num, pre)
+     unsigned long num;
+     char *pre;
 {
-   static char res[50];
+  static char res[50];
 
-   sprintf (res, local_hex_format_custom(pre), num);
-   return res;
+  sprintf (res, local_hex_format_custom (pre), num);
+  return res;
 }
 
 /* Returns the appropriate printf format for octal
    numbers. */
 char *
-local_octal_format_custom(pre)
-   char *pre;
+local_octal_format_custom (pre)
+     char *pre;
 {
-   static char form[50];
-
-   strcpy (form, local_octal_format_prefix ());
-   strcat (form, "%");
-   strcat (form, pre);
-   strcat (form, local_octal_format_specifier ());
-   strcat (form, local_octal_format_suffix ());
-   return form;
+  static char form[50];
+
+  strcpy (form, local_octal_format_prefix ());
+  strcat (form, "%");
+  strcat (form, pre);
+  strcat (form, local_octal_format_specifier ());
+  strcat (form, local_octal_format_suffix ());
+  return form;
 }
 
 /* Returns the appropriate printf format for decimal numbers. */
 char *
-local_decimal_format_custom(pre)
-   char *pre;
+local_decimal_format_custom (pre)
+     char *pre;
 {
-   static char form[50];
-
-   strcpy (form, local_decimal_format_prefix ());
-   strcat (form, "%");
-   strcat (form, pre);
-   strcat (form, local_decimal_format_specifier ());
-   strcat (form, local_decimal_format_suffix ());
-   return form;
+  static char form[50];
+
+  strcpy (form, local_decimal_format_prefix ());
+  strcat (form, "%");
+  strcat (form, pre);
+  strcat (form, local_decimal_format_specifier ());
+  strcat (form, local_decimal_format_suffix ());
+  return form;
 }
 \f
 #if 0
@@ -606,22 +614,23 @@ local_decimal_format_custom(pre)
    both Modula-2 and for C.  In the C case, TYPE_CODE_CHAR will never occur,
    and thus will never cause the failure of the test. */
 int
-simple_type(type)
-    struct type *type;
+simple_type (type)
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  switch (TYPE_CODE (type)) {
-  case TYPE_CODE_INT:
-  case TYPE_CODE_CHAR:
-  case TYPE_CODE_ENUM:
-  case TYPE_CODE_FLT:
-  case TYPE_CODE_RANGE:
-  case TYPE_CODE_BOOL:
-    return 1;
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_INT:
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_ENUM:
+    case TYPE_CODE_FLT:
+    case TYPE_CODE_RANGE:
+    case TYPE_CODE_BOOL:
+      return 1;
 
-  default:
-    return 0;
-  }
+    default:
+      return 0;
+    }
 }
 
 /* Returns non-zero if its argument is of an ordered type.
@@ -630,183 +639,185 @@ simple_type(type)
    operations "increment" or "decrement" make sense. */
 int
 ordered_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  switch (TYPE_CODE (type)) {
-  case TYPE_CODE_INT:
-  case TYPE_CODE_CHAR:
-  case TYPE_CODE_ENUM:
-  case TYPE_CODE_FLT:
-  case TYPE_CODE_RANGE:
-    return 1;
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_INT:
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_ENUM:
+    case TYPE_CODE_FLT:
+    case TYPE_CODE_RANGE:
+      return 1;
 
-  default:
-    return 0;
-  }
+    default:
+      return 0;
+    }
 }
 
 /* Returns non-zero if the two types are the same */
 int
 same_type (arg1, arg2)
-   struct type *arg1, *arg2;
+     struct type *arg1, *arg2;
 {
   CHECK_TYPEDEF (type);
-   if (structured_type(arg1) ? !structured_type(arg2) : structured_type(arg2))
-      /* One is structured and one isn't */
-      return 0;
-   else if (structured_type(arg1) && structured_type(arg2))
-      return arg1 == arg2;
-   else if (numeric_type(arg1) && numeric_type(arg2))
-      return (TYPE_CODE(arg2) == TYPE_CODE(arg1)) &&
-        (TYPE_UNSIGNED(arg1) == TYPE_UNSIGNED(arg2))
-           ? 1 : 0;
-   else
-      return arg1==arg2;
+  if (structured_type (arg1) ? !structured_type (arg2) : structured_type (arg2))
+    /* One is structured and one isn't */
+    return 0;
+  else if (structured_type (arg1) && structured_type (arg2))
+    return arg1 == arg2;
+  else if (numeric_type (arg1) && numeric_type (arg2))
+    return (TYPE_CODE (arg2) == TYPE_CODE (arg1)) &&
+      (TYPE_UNSIGNED (arg1) == TYPE_UNSIGNED (arg2))
+      ? 1 : 0;
+  else
+    return arg1 == arg2;
 }
 
 /* Returns non-zero if the type is integral */
 int
 integral_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-   switch(current_language->la_language)
-   {
-   case language_c:
-   case language_cplus:
-      return (TYPE_CODE(type) != TYPE_CODE_INT) &&
-        (TYPE_CODE(type) != TYPE_CODE_ENUM) ? 0 : 1;
-   case language_m2:
-      return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
-   case language_chill:
-      error ("Missing Chill support in function integral_type.");  /*FIXME*/
-   default:
+  switch (current_language->la_language)
+    {
+    case language_c:
+    case language_cplus:
+      return (TYPE_CODE (type) != TYPE_CODE_INT) &&
+       (TYPE_CODE (type) != TYPE_CODE_ENUM) ? 0 : 1;
+    case language_m2:
+      return TYPE_CODE (type) != TYPE_CODE_INT ? 0 : 1;
+    case language_chill:
+      error ("Missing Chill support in function integral_type.");      /*FIXME */
+    default:
       error ("Language not supported.");
-   }
+    }
 }
 
 /* Returns non-zero if the value is numeric */
 int
 numeric_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  switch (TYPE_CODE (type)) {
-  case TYPE_CODE_INT:
-  case TYPE_CODE_FLT:
-    return 1;
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_INT:
+    case TYPE_CODE_FLT:
+      return 1;
 
-  default:
-    return 0;
-  }
+    default:
+      return 0;
+    }
 }
 
 /* Returns non-zero if the value is a character type */
 int
 character_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  switch(current_language->la_language)
-   {
-   case language_chill:
-   case language_m2:
-      return TYPE_CODE(type) != TYPE_CODE_CHAR ? 0 : 1;
-
-   case language_c:
-   case language_cplus:
-      return (TYPE_CODE(type) == TYPE_CODE_INT) &&
-        TYPE_LENGTH(type) == sizeof(char)
-        ? 1 : 0;
-   default:
+  switch (current_language->la_language)
+    {
+    case language_chill:
+    case language_m2:
+      return TYPE_CODE (type) != TYPE_CODE_CHAR ? 0 : 1;
+
+    case language_c:
+    case language_cplus:
+      return (TYPE_CODE (type) == TYPE_CODE_INT) &&
+       TYPE_LENGTH (type) == sizeof (char)
+      ? 1 : 0;
+    default:
       return (0);
-   }
+    }
 }
 
 /* Returns non-zero if the value is a string type */
 int
 string_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  switch(current_language->la_language)
-   {
-   case language_chill:
-   case language_m2:
-      return TYPE_CODE(type) != TYPE_CODE_STRING ? 0 : 1;
-
-   case language_c:
-   case language_cplus:
+  switch (current_language->la_language)
+    {
+    case language_chill:
+    case language_m2:
+      return TYPE_CODE (type) != TYPE_CODE_STRING ? 0 : 1;
+
+    case language_c:
+    case language_cplus:
       /* C does not have distinct string type. */
       return (0);
-   default:
+    default:
       return (0);
-   }
+    }
 }
 
 /* Returns non-zero if the value is a boolean type */
 int
 boolean_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
   if (TYPE_CODE (type) == TYPE_CODE_BOOL)
     return 1;
-  switch(current_language->la_language)
+  switch (current_language->la_language)
     {
     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.  */
+         for CHILL and such languages, or a TYPE_CODE_INT_OR_BOOL for C.  */
       if (TYPE_CODE (type) == TYPE_CODE_INT)
        return 1;
-   default:
+    default:
       break;
-   }
+    }
   return 0;
 }
 
 /* Returns non-zero if the value is a floating-point type */
 int
 float_type (type)
-   struct type *type;
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-  return TYPE_CODE(type) == TYPE_CODE_FLT;
+  return TYPE_CODE (type) == TYPE_CODE_FLT;
 }
 
 /* Returns non-zero if the value is a pointer type */
 int
-pointer_type(type)
-   struct type *type;
+pointer_type (type)
+     struct type *type;
 {
-   return TYPE_CODE(type) == TYPE_CODE_PTR ||
-      TYPE_CODE(type) == TYPE_CODE_REF;
+  return TYPE_CODE (type) == TYPE_CODE_PTR ||
+    TYPE_CODE (type) == TYPE_CODE_REF;
 }
 
 /* Returns non-zero if the value is a structured type */
 int
-structured_type(type)
-   struct type *type;
+structured_type (type)
+     struct type *type;
 {
   CHECK_TYPEDEF (type);
-   switch(current_language->la_language)
-   {
-   case language_c:
-   case language_cplus:
-      return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
-        (TYPE_CODE(type) == TYPE_CODE_UNION) ||
-           (TYPE_CODE(type) == TYPE_CODE_ARRAY);
-   case language_m2:
-      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*/
-   default:
+  switch (current_language->la_language)
+    {
+    case language_c:
+    case language_cplus:
+      return (TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
+       (TYPE_CODE (type) == TYPE_CODE_UNION) ||
+       (TYPE_CODE (type) == TYPE_CODE_ARRAY);
+    case language_m2:
+      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 */
+    default:
       return (0);
-   }
+    }
 }
 #endif
 \f
@@ -815,7 +826,7 @@ lang_bool_type ()
 {
   struct symbol *sym;
   struct type *type;
-  switch(current_language->la_language)
+  switch (current_language->la_language)
     {
     case language_chill:
       return builtin_type_chill_bool;
@@ -862,179 +873,179 @@ value_true (val)
 /* Returns non-zero if the operator OP is defined on
    the values ARG1 and ARG2. */
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 void
-binop_type_check(arg1,arg2,op)
-   value_ptr arg1,arg2;
-   int op;
+binop_type_check (arg1, arg2, op)
+     value_ptr arg1, arg2;
+     int op;
 {
-   struct type *t1, *t2;
+  struct type *t1, *t2;
 
-   /* If we're not checking types, always return success. */
-   if (!STRICT_TYPE)
-      return;
+  /* If we're not checking types, always return success. */
+  if (!STRICT_TYPE)
+    return;
+
+  t1 = VALUE_TYPE (arg1);
+  if (arg2 != NULL)
+    t2 = VALUE_TYPE (arg2);
+  else
+    t2 = NULL;
 
-   t1=VALUE_TYPE(arg1);
-   if (arg2 != NULL)
-      t2=VALUE_TYPE(arg2);
-   else
-      t2=NULL;
-
-   switch(op)
-   {
-   case BINOP_ADD:
-   case BINOP_SUB:
-      if ((numeric_type(t1) && pointer_type(t2)) ||
-        (pointer_type(t1) && numeric_type(t2)))
-      {
-        warning ("combining pointer and integer.\n");
-        break;
-      }
-   case BINOP_MUL:
-   case BINOP_LSH:
-   case BINOP_RSH:
-      if (!numeric_type(t1) || !numeric_type(t2))
-        type_op_error ("Arguments to %s must be numbers.",op);
-      else if (!same_type(t1,t2))
-        type_op_error ("Arguments to %s must be of the same type.",op);
+  switch (op)
+    {
+    case BINOP_ADD:
+    case BINOP_SUB:
+      if ((numeric_type (t1) && pointer_type (t2)) ||
+         (pointer_type (t1) && numeric_type (t2)))
+       {
+         warning ("combining pointer and integer.\n");
+         break;
+       }
+    case BINOP_MUL:
+    case BINOP_LSH:
+    case BINOP_RSH:
+      if (!numeric_type (t1) || !numeric_type (t2))
+       type_op_error ("Arguments to %s must be numbers.", op);
+      else if (!same_type (t1, t2))
+       type_op_error ("Arguments to %s must be of the same type.", op);
       break;
 
-   case BINOP_LOGICAL_AND:
-   case BINOP_LOGICAL_OR:
-      if (!boolean_type(t1) || !boolean_type(t2))
-        type_op_error ("Arguments to %s must be of boolean type.",op);
+    case BINOP_LOGICAL_AND:
+    case BINOP_LOGICAL_OR:
+      if (!boolean_type (t1) || !boolean_type (t2))
+       type_op_error ("Arguments to %s must be of boolean type.", op);
       break;
 
-   case BINOP_EQUAL:
-      if ((pointer_type(t1) && !(pointer_type(t2) || integral_type(t2))) ||
-        (pointer_type(t2) && !(pointer_type(t1) || integral_type(t1))))
-        type_op_error ("A pointer can only be compared to an integer or pointer.",op);
-      else if ((pointer_type(t1) && integral_type(t2)) ||
-        (integral_type(t1) && pointer_type(t2)))
-      {
-        warning ("combining integer and pointer.\n");
-        break;
-      }
-      else if (!simple_type(t1) || !simple_type(t2))
-        type_op_error ("Arguments to %s must be of simple type.",op);
-      else if (!same_type(t1,t2))
-        type_op_error ("Arguments to %s must be of the same type.",op);
+    case BINOP_EQUAL:
+      if ((pointer_type (t1) && !(pointer_type (t2) || integral_type (t2))) ||
+         (pointer_type (t2) && !(pointer_type (t1) || integral_type (t1))))
+       type_op_error ("A pointer can only be compared to an integer or pointer.", op);
+      else if ((pointer_type (t1) && integral_type (t2)) ||
+              (integral_type (t1) && pointer_type (t2)))
+       {
+         warning ("combining integer and pointer.\n");
+         break;
+       }
+      else if (!simple_type (t1) || !simple_type (t2))
+       type_op_error ("Arguments to %s must be of simple type.", op);
+      else if (!same_type (t1, t2))
+       type_op_error ("Arguments to %s must be of the same type.", op);
       break;
 
-   case BINOP_REM:
-   case BINOP_MOD:
-      if (!integral_type(t1) || !integral_type(t2))
-        type_op_error ("Arguments to %s must be of integral type.",op);
+    case BINOP_REM:
+    case BINOP_MOD:
+      if (!integral_type (t1) || !integral_type (t2))
+       type_op_error ("Arguments to %s must be of integral type.", op);
       break;
 
-   case BINOP_LESS:
-   case BINOP_GTR:
-   case BINOP_LEQ:
-   case BINOP_GEQ:
-      if (!ordered_type(t1) || !ordered_type(t2))
-        type_op_error ("Arguments to %s must be of ordered type.",op);
-      else if (!same_type(t1,t2))
-        type_op_error ("Arguments to %s must be of the same type.",op);
+    case BINOP_LESS:
+    case BINOP_GTR:
+    case BINOP_LEQ:
+    case BINOP_GEQ:
+      if (!ordered_type (t1) || !ordered_type (t2))
+       type_op_error ("Arguments to %s must be of ordered type.", op);
+      else if (!same_type (t1, t2))
+       type_op_error ("Arguments to %s must be of the same type.", op);
       break;
 
-   case BINOP_ASSIGN:
-      if (pointer_type(t1) && !integral_type(t2))
-        type_op_error ("A pointer can only be assigned an integer.",op);
-      else if (pointer_type(t1) && integral_type(t2))
-      {
-        warning ("combining integer and pointer.");
-        break;
-      }
-      else if (!simple_type(t1) || !simple_type(t2))
-        type_op_error ("Arguments to %s must be of simple type.",op);
-      else if (!same_type(t1,t2))
-        type_op_error ("Arguments to %s must be of the same type.",op);
+    case BINOP_ASSIGN:
+      if (pointer_type (t1) && !integral_type (t2))
+       type_op_error ("A pointer can only be assigned an integer.", op);
+      else if (pointer_type (t1) && integral_type (t2))
+       {
+         warning ("combining integer and pointer.");
+         break;
+       }
+      else if (!simple_type (t1) || !simple_type (t2))
+       type_op_error ("Arguments to %s must be of simple type.", op);
+      else if (!same_type (t1, t2))
+       type_op_error ("Arguments to %s must be of the same type.", op);
       break;
 
     case BINOP_CONCAT:
       /* FIXME:  Needs to handle bitstrings as well. */
-      if (!(string_type(t1) || character_type(t1) || integral_type(t1))
-         || !(string_type(t2) || character_type(t2) || integral_type(t2)))
-         type_op_error ("Arguments to %s must be strings or characters.", op);
+      if (!(string_type (t1) || character_type (t1) || integral_type (t1))
+       || !(string_type (t2) || character_type (t2) || integral_type (t2)))
+       type_op_error ("Arguments to %s must be strings or characters.", op);
       break;
 
-   /* Unary checks -- arg2 is null */
+      /* Unary checks -- arg2 is null */
 
-   case UNOP_LOGICAL_NOT:
-      if (!boolean_type(t1))
-        type_op_error ("Argument to %s must be of boolean type.",op);
+    case UNOP_LOGICAL_NOT:
+      if (!boolean_type (t1))
+       type_op_error ("Argument to %s must be of boolean type.", op);
       break;
 
-   case UNOP_PLUS:
-   case UNOP_NEG:
-      if (!numeric_type(t1))
-        type_op_error ("Argument to %s must be of numeric type.",op);
+    case UNOP_PLUS:
+    case UNOP_NEG:
+      if (!numeric_type (t1))
+       type_op_error ("Argument to %s must be of numeric type.", op);
       break;
 
-   case UNOP_IND:
-      if (integral_type(t1))
-      {
-        warning ("combining pointer and integer.\n");
-        break;
-      }
-      else if (!pointer_type(t1))
-        type_op_error ("Argument to %s must be a pointer.",op);
+    case UNOP_IND:
+      if (integral_type (t1))
+       {
+         warning ("combining pointer and integer.\n");
+         break;
+       }
+      else if (!pointer_type (t1))
+       type_op_error ("Argument to %s must be a pointer.", op);
       break;
 
-   case UNOP_PREINCREMENT:
-   case UNOP_POSTINCREMENT:
-   case UNOP_PREDECREMENT:
-   case UNOP_POSTDECREMENT:
-      if (!ordered_type(t1))
-        type_op_error ("Argument to %s must be of an ordered type.",op);
+    case UNOP_PREINCREMENT:
+    case UNOP_POSTINCREMENT:
+    case UNOP_PREDECREMENT:
+    case UNOP_POSTDECREMENT:
+      if (!ordered_type (t1))
+       type_op_error ("Argument to %s must be of an ordered type.", op);
       break;
 
-   default:
+    default:
       /* Ok.  The following operators have different meanings in
-        different languages. */
-      switch(current_language->la_language)
-      {
+         different languages. */
+      switch (current_language->la_language)
+       {
 #ifdef _LANG_c
-      case language_c:
-      case language_cplus:
-        switch(op)
-        {
-        case BINOP_DIV:
-           if (!numeric_type(t1) || !numeric_type(t2))
-              type_op_error ("Arguments to %s must be numbers.",op);
-           break;
-        }
-        break;
+       case language_c:
+       case language_cplus:
+         switch (op)
+           {
+           case BINOP_DIV:
+             if (!numeric_type (t1) || !numeric_type (t2))
+               type_op_error ("Arguments to %s must be numbers.", op);
+             break;
+           }
+         break;
 #endif
 
 #ifdef _LANG_m2
-      case language_m2:
-        switch(op)
-        {
-        case BINOP_DIV:
-           if (!float_type(t1) || !float_type(t2))
-              type_op_error ("Arguments to %s must be floating point numbers.",op);
-           break;
-        case BINOP_INTDIV:
-           if (!integral_type(t1) || !integral_type(t2))
-              type_op_error ("Arguments to %s must be of integral type.",op);
-           break;
-        }
+       case language_m2:
+         switch (op)
+           {
+           case BINOP_DIV:
+             if (!float_type (t1) || !float_type (t2))
+               type_op_error ("Arguments to %s must be floating point numbers.", op);
+             break;
+           case BINOP_INTDIV:
+             if (!integral_type (t1) || !integral_type (t2))
+               type_op_error ("Arguments to %s must be of integral type.", op);
+             break;
+           }
 #endif
 
 #ifdef _LANG_chill
-       case language_chill:
-        error ("Missing Chill support in function binop_type_check.");/*FIXME*/
+       case language_chill:
+         error ("Missing Chill support in function binop_type_check.");        /*FIXME */
 #endif
 
-      }
-   }
+       }
+    }
 }
 
-#endif /* 0 */
-
+#endif /* 0 */
 \f
+
 /* This page contains functions for the printing out of
    error messages that occur during type- and range-
    checking. */
@@ -1044,17 +1055,17 @@ binop_type_check(arg1,arg2,op)
    this is an error and error () is called.  Otherwise, it is
    a warning and printf() is called. */
 void
-op_error (fmt,op,fatal)
-   char *fmt;
-   enum exp_opcode op;
-   int fatal;
+op_error (fmt, op, fatal)
+     char *fmt;
+     enum exp_opcode op;
+     int fatal;
 {
-   if (fatal)
-      error (fmt,op_string(op));
-   else
-   {
-      warning (fmt,op_string(op));
-   }
+  if (fatal)
+    error (fmt, op_string (op));
+  else
+    {
+      warning (fmt, op_string (op));
+    }
 }
 
 /* These are called when a language fails a type- or range-check.
@@ -1066,63 +1077,63 @@ op_error (fmt,op,fatal)
 
 void
 #ifdef ANSI_PROTOTYPES
-type_error (char *string, ...)
+type_error (char *string,...)
 #else
 type_error (va_alist)
      va_dcl
 #endif
 {
-   va_list args;
+  va_list args;
 #ifdef ANSI_PROTOTYPES
-   va_start (args, string);
+  va_start (args, string);
 #else
-   char *string;
-   va_start (args);
-   string = va_arg (args, char *);
+  char *string;
+  va_start (args);
+  string = va_arg (args, char *);
 #endif
 
-   if (type_check == type_check_warn)
-     fprintf_filtered (gdb_stderr, warning_pre_print);
-   else
-     error_begin ();
+  if (type_check == type_check_warn)
+    fprintf_filtered (gdb_stderr, warning_pre_print);
+  else
+    error_begin ();
 
-   vfprintf_filtered (gdb_stderr, string, args);
-   fprintf_filtered (gdb_stderr, "\n");
-   va_end (args);
-   if (type_check == type_check_on)
-     return_to_top_level (RETURN_ERROR);
+  vfprintf_filtered (gdb_stderr, string, args);
+  fprintf_filtered (gdb_stderr, "\n");
+  va_end (args);
+  if (type_check == type_check_on)
+    return_to_top_level (RETURN_ERROR);
 }
 
 void
 #ifdef ANSI_PROTOTYPES
-range_error (char *string, ...)
+range_error (char *string,...)
 #else
 range_error (va_alist)
      va_dcl
 #endif
 {
-   va_list args;
+  va_list args;
 #ifdef ANSI_PROTOTYPES
-   va_start (args, string);
+  va_start (args, string);
 #else
-   char *string;
-   va_start (args);
-   string = va_arg (args, char *);
+  char *string;
+  va_start (args);
+  string = va_arg (args, char *);
 #endif
 
-   if (range_check == range_check_warn)
-     fprintf_filtered (gdb_stderr, warning_pre_print);
-   else
-     error_begin ();
+  if (range_check == range_check_warn)
+    fprintf_filtered (gdb_stderr, warning_pre_print);
+  else
+    error_begin ();
 
-   vfprintf_filtered (gdb_stderr, string, args);
-   fprintf_filtered (gdb_stderr, "\n");
-   va_end (args);
-   if (range_check == range_check_on)
-     return_to_top_level (RETURN_ERROR);
+  vfprintf_filtered (gdb_stderr, string, args);
+  fprintf_filtered (gdb_stderr, "\n");
+  va_end (args);
+  if (range_check == range_check_on)
+    return_to_top_level (RETURN_ERROR);
 }
-
 \f
+
 /* This page contains miscellaneous functions */
 
 /* Return the language enum for a given language string. */
@@ -1133,7 +1144,7 @@ language_enum (str)
 {
   int i;
 
-  for (i = 0; i < languages_size; i++) 
+  for (i = 0; i < languages_size; i++)
     if (STREQ (languages[i]->la_name, str))
       return languages[i]->la_language;
 
@@ -1143,50 +1154,54 @@ language_enum (str)
 /* Return the language struct for a given language enum. */
 
 const struct language_defn *
-language_def(lang)
-   enum language lang;
+language_def (lang)
+     enum language lang;
 {
   int i;
 
-  for (i = 0; i < languages_size; i++) {
-    if (languages[i]->la_language == lang) {
-      return languages[i];
+  for (i = 0; i < languages_size; i++)
+    {
+      if (languages[i]->la_language == lang)
+       {
+         return languages[i];
+       }
     }
-  }
   return NULL;
 }
 
 /* Return the language as a string */
 char *
-language_str(lang)
-   enum language lang;
+language_str (lang)
+     enum language lang;
 {
   int i;
 
-  for (i = 0; i < languages_size; i++) {
-    if (languages[i]->la_language == lang) {
-      return languages[i]->la_name;
+  for (i = 0; i < languages_size; i++)
+    {
+      if (languages[i]->la_language == lang)
+       {
+         return languages[i]->la_name;
+       }
     }
-  }
   return "Unknown";
 }
 
 static void
 set_check (ignore, from_tty)
-   char *ignore;
-   int from_tty;
+     char *ignore;
+     int from_tty;
 {
-   printf_unfiltered(
-"\"set check\" must be followed by the name of a check subcommand.\n");
-   help_list(setchecklist, "set check ", -1, gdb_stdout);
+  printf_unfiltered (
+     "\"set check\" must be followed by the name of a check subcommand.\n");
+  help_list (setchecklist, "set check ", -1, gdb_stdout);
 }
 
 static void
 show_check (ignore, from_tty)
-   char *ignore;
-   int from_tty;
+     char *ignore;
+     int from_tty;
 {
-   cmd_show_list(showchecklist, from_tty, "");
+  cmd_show_list (showchecklist, from_tty, "");
 }
 \f
 /* Add a language to the set of known languages.  */
@@ -1197,9 +1212,9 @@ add_language (lang)
 {
   if (lang->la_magic != LANG_MAGIC)
     {
-      fprintf_unfiltered(gdb_stderr, "Magic number of %s language struct wrong\n",
-       lang->la_name);
-      abort();
+      fprintf_unfiltered (gdb_stderr, "Magic number of %s language struct wrong\n",
+                         lang->la_name);
+      abort ();
     }
 
   if (!languages)
@@ -1212,7 +1227,7 @@ add_language (lang)
     {
       languages_allocsize *= 2;
       languages = (const struct language_defn **) xrealloc ((char *) languages,
-       languages_allocsize * sizeof (*languages));
+                                languages_allocsize * sizeof (*languages));
     }
   languages[languages_size++] = lang;
 }
@@ -1280,7 +1295,7 @@ unk_lang_print_type (type, varstring, stream, show, level)
 }
 
 static int
-unk_lang_val_print (type, valaddr,  embedded_offset, address, stream, format, deref_ref,
+unk_lang_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
                    recurse, pretty)
      struct type *type;
      char *valaddr;
@@ -1305,12 +1320,17 @@ unk_lang_value_print (val, stream, format, pretty)
   error ("internal error - unimplemented function unk_lang_value_print called.");
 }
 
-static struct type ** CONST_PTR (unknown_builtin_types[]) = { 0 };
-static const struct op_print unk_op_print_tab[] = {
-    {NULL, OP_NULL, PREC_NULL, 0}
+static struct type **CONST_PTR (unknown_builtin_types[]) =
+{
+  0
+};
+static const struct op_print unk_op_print_tab[] =
+{
+  {NULL, OP_NULL, PREC_NULL, 0}
 };
 
-const struct language_defn unknown_language_defn = {
+const struct language_defn unknown_language_defn =
+{
   "unknown",
   language_unknown,
   &unknown_builtin_types[0],
@@ -1326,19 +1346,20 @@ const struct language_defn unknown_language_defn = {
   unk_lang_print_type,         /* Print a type using appropriate syntax */
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
-  {"",      "",    "",   ""},  /* Binary format info */
-  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
-  {"%ld",    "",    "d",  ""}, /* Decimal format info */
-  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
 /* These two structs define fake entries for the "local" and "auto" options. */
-const struct language_defn auto_language_defn = {
+const struct language_defn auto_language_defn =
+{
   "auto",
   language_auto,
   &unknown_builtin_types[0],
@@ -1354,18 +1375,19 @@ const struct language_defn auto_language_defn = {
   unk_lang_print_type,         /* Print a type using appropriate syntax */
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
-  {"",      "",    "",   ""},  /* Binary format info */
-  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
-  {"%ld",    "",    "d",  ""}, /* Decimal format info */
-  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
-const struct language_defn local_language_defn = {
+const struct language_defn local_language_defn =
+{
   "local",
   language_auto,
   &unknown_builtin_types[0],
@@ -1381,73 +1403,73 @@ const struct language_defn local_language_defn = {
   unk_lang_print_type,         /* Print a type using appropriate syntax */
   unk_lang_val_print,          /* Print a value using appropriate syntax */
   unk_lang_value_print,                /* Print a top-level value */
-  {"",      "",    "",   ""},  /* Binary format info */
-  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
-  {"%ld",    "",    "d",  ""}, /* Decimal format info */
-  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"0%lo", "0", "o", ""},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 \f
 /* Initialize the language routines */
 
 void
-_initialize_language()
+_initialize_language ()
 {
-   struct cmd_list_element *set, *show;
-
-   /* GDB commands for language specific stuff */
-
-   set = add_set_cmd ("language", class_support, var_string_noescape,
-                     (char *)&language,
-                     "Set the current source language.",
-                     &setlist);
-   show = add_show_from_set (set, &showlist);
-   set->function.cfunc = set_language_command;
-   show->function.cfunc = show_language_command;
-
-   add_prefix_cmd ("check", no_class, set_check,
-                  "Set the status of the type/range checker",
-                  &setchecklist, "set check ", 0, &setlist);
-   add_alias_cmd ("c", "check", no_class, 1, &setlist);
-   add_alias_cmd ("ch", "check", no_class, 1, &setlist);
-
-   add_prefix_cmd ("check", no_class, show_check,
-                  "Show the status of the type/range checker",
-                  &showchecklist, "show check ", 0, &showlist);
-   add_alias_cmd ("c", "check", no_class, 1, &showlist);
-   add_alias_cmd ("ch", "check", no_class, 1, &showlist);
-
-   set = add_set_cmd ("type", class_support, var_string_noescape,
-                     (char *)&type,
-                     "Set type checking.  (on/warn/off/auto)",
-                     &setchecklist);
-   show = add_show_from_set (set, &showchecklist);
-   set->function.cfunc = set_type_command;
-   show->function.cfunc = show_type_command;
-
-   set = add_set_cmd ("range", class_support, var_string_noescape,
-                     (char *)&range,
-                     "Set range checking.  (on/warn/off/auto)",
-                     &setchecklist);
-   show = add_show_from_set (set, &showchecklist);
-   set->function.cfunc = set_range_command;
-   show->function.cfunc = show_range_command;
-
-   add_language (&unknown_language_defn);
-   add_language (&local_language_defn);
-   add_language (&auto_language_defn);
-
-   language = savestring ("auto",strlen("auto"));
-   range = savestring ("auto",strlen("auto"));
-   type = savestring ("auto",strlen("auto"));
-
-   /* Have the above take effect */
-
-   set_language_command (language, 0);
-   set_type_command (NULL, 0);
-   set_range_command (NULL, 0);
+  struct cmd_list_element *set, *show;
+
+  /* GDB commands for language specific stuff */
+
+  set = add_set_cmd ("language", class_support, var_string_noescape,
+                    (char *) &language,
+                    "Set the current source language.",
+                    &setlist);
+  show = add_show_from_set (set, &showlist);
+  set->function.cfunc = set_language_command;
+  show->function.cfunc = show_language_command;
+
+  add_prefix_cmd ("check", no_class, set_check,
+                 "Set the status of the type/range checker",
+                 &setchecklist, "set check ", 0, &setlist);
+  add_alias_cmd ("c", "check", no_class, 1, &setlist);
+  add_alias_cmd ("ch", "check", no_class, 1, &setlist);
+
+  add_prefix_cmd ("check", no_class, show_check,
+                 "Show the status of the type/range checker",
+                 &showchecklist, "show check ", 0, &showlist);
+  add_alias_cmd ("c", "check", no_class, 1, &showlist);
+  add_alias_cmd ("ch", "check", no_class, 1, &showlist);
+
+  set = add_set_cmd ("type", class_support, var_string_noescape,
+                    (char *) &type,
+                    "Set type checking.  (on/warn/off/auto)",
+                    &setchecklist);
+  show = add_show_from_set (set, &showchecklist);
+  set->function.cfunc = set_type_command;
+  show->function.cfunc = show_type_command;
+
+  set = add_set_cmd ("range", class_support, var_string_noescape,
+                    (char *) &range,
+                    "Set range checking.  (on/warn/off/auto)",
+                    &setchecklist);
+  show = add_show_from_set (set, &showchecklist);
+  set->function.cfunc = set_range_command;
+  show->function.cfunc = show_range_command;
+
+  add_language (&unknown_language_defn);
+  add_language (&local_language_defn);
+  add_language (&auto_language_defn);
+
+  language = savestring ("auto", strlen ("auto"));
+  range = savestring ("auto", strlen ("auto"));
+  type = savestring ("auto", strlen ("auto"));
+
+  /* Have the above take effect */
+
+  set_language_command (language, 0);
+  set_type_command (NULL, 0);
+  set_range_command (NULL, 0);
 }
index 6b489a096a965925542b246c0f2e18402b29cfa8..0ead9f8dba9716bca88780ace4b3908b000efebf 100644 (file)
@@ -3,30 +3,31 @@
    Contributed by the Department of Computer Science at the State University
    of New York at Buffalo.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (LANGUAGE_H)
 #define LANGUAGE_H 1
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct value;
 struct objfile;
 struct expression;
-/* enum exp_opcode;    ANSI's `wisdom' didn't include forward enum decls. */
+/* enum exp_opcode;     ANSI's `wisdom' didn't include forward enum decls. */
 #endif
 
 /* This used to be included to configure GDB for one or more specific
@@ -37,13 +38,17 @@ struct expression;
 #define        _LANG_chill
 #define _LANG_fortran
 
-#define MAX_FORTRAN_DIMS  7   /* Maximum number of F77 array dims */ 
+#define MAX_FORTRAN_DIMS  7    /* Maximum number of F77 array dims */
 
 /* range_mode ==
    range_mode_auto:   range_check set automatically to default of language.
    range_mode_manual: range_check set manually by user.  */
 
-extern enum range_mode {range_mode_auto, range_mode_manual} range_mode;
+extern enum range_mode
+  {
+    range_mode_auto, range_mode_manual
+  }
+range_mode;
 
 /* range_check ==
    range_check_on:    Ranges are checked in GDB expressions, producing errors.
@@ -51,13 +56,20 @@ extern enum range_mode {range_mode_auto, range_mode_manual} range_mode;
    range_check_off:   Ranges are not checked in GDB expressions.  */
 
 extern enum range_check
-  {range_check_off, range_check_warn, range_check_on} range_check;
+  {
+    range_check_off, range_check_warn, range_check_on
+  }
+range_check;
 
 /* type_mode ==
    type_mode_auto:   type_check set automatically to default of language
    type_mode_manual: type_check set manually by user. */
 
-extern enum type_mode {type_mode_auto, type_mode_manual} type_mode;
+extern enum type_mode
+  {
+    type_mode_auto, type_mode_manual
+  }
+type_mode;
 
 /* type_check ==
    type_check_on:    Types are checked in GDB expressions, producing errors.
@@ -65,139 +77,142 @@ extern enum type_mode {type_mode_auto, type_mode_manual} type_mode;
    type_check_off:   Types are not checked in GDB expressions.  */
 
 extern enum type_check
-  {type_check_off, type_check_warn, type_check_on} type_check;
+  {
+    type_check_off, type_check_warn, type_check_on
+  }
+type_check;
 \f
 /* Information for doing language dependent formatting of printed values. */
 
 struct language_format_info
-{
-  /* The format that can be passed directly to standard C printf functions
-     to generate a completely formatted value in the format appropriate for
-     the language. */
+  {
+    /* The format that can be passed directly to standard C printf functions
+       to generate a completely formatted value in the format appropriate for
+       the language. */
 
-  char *la_format;
+    char *la_format;
 
-  /* The prefix to be used when directly printing a value, or constructing
-     a standard C printf format.  This generally is everything up to the
-     conversion specification (the part introduced by the '%' character
-     and terminated by the conversion specifier character). */
+    /* The prefix to be used when directly printing a value, or constructing
+       a standard C printf format.  This generally is everything up to the
+       conversion specification (the part introduced by the '%' character
+       and terminated by the conversion specifier character). */
 
-  char *la_format_prefix;
+    char *la_format_prefix;
 
-  /* The conversion specifier.  This is generally everything after the
-     field width and precision, typically only a single character such
-     as 'o' for octal format or 'x' for hexadecimal format. */
+    /* The conversion specifier.  This is generally everything after the
+       field width and precision, typically only a single character such
+       as 'o' for octal format or 'x' for hexadecimal format. */
 
-  char *la_format_specifier;
+    char *la_format_specifier;
 
-  /* The suffix to be used when directly printing a value, or constructing
-     a standard C printf format.  This generally is everything after the
-     conversion specification (the part introduced by the '%' character
-     and terminated by the conversion specifier character). */
+    /* The suffix to be used when directly printing a value, or constructing
+       a standard C printf format.  This generally is everything after the
+       conversion specification (the part introduced by the '%' character
+       and terminated by the conversion specifier character). */
 
-  char *la_format_suffix;              /* Suffix for custom format string */
-};
+    char *la_format_suffix;    /* Suffix for custom format string */
+  };
 
 /* Structure tying together assorted information about a language.  */
 
 struct language_defn
-{
-  /* Name of the language */
-  
-  char *la_name;
+  {
+    /* Name of the language */
 
-  /* its symtab language-enum (defs.h) */
+    char *la_name;
 
-  enum language la_language;
+    /* its symtab language-enum (defs.h) */
 
-  /* Its builtin types.  This is a vector ended by a NULL pointer.  These
-     types can be specified by name in parsing types in expressions,
-     regardless of whether the program being debugged actually defines
-     such a type.  */
+    enum language la_language;
 
-  struct type ** const *la_builtin_type_vector;
+    /* Its builtin types.  This is a vector ended by a NULL pointer.  These
+       types can be specified by name in parsing types in expressions,
+       regardless of whether the program being debugged actually defines
+       such a type.  */
 
-  /* Default range checking */
+    struct type **const *la_builtin_type_vector;
 
-  enum range_check la_range_check;
+    /* Default range checking */
 
-  /* Default type checking */
+    enum range_check la_range_check;
 
-  enum type_check la_type_check;
+    /* Default type checking */
 
-  /* Parser function. */
-  
-  int (*la_parser) PARAMS((void));
+    enum type_check la_type_check;
 
-  /* Parser error function */
+    /* Parser function. */
 
-  void (*la_error) PARAMS ((char *));
+    int (*la_parser) PARAMS ((void));
 
-  /* Evaluate an expression. */
-  struct value * (*evaluate_exp) PARAMS ((struct type *, struct expression *, 
-                                         int *, enum noside));
+    /* Parser error function */
 
-  void (*la_printchar) PARAMS ((int ch, GDB_FILE *stream));
+    void (*la_error) PARAMS ((char *));
 
-  void (*la_printstr) PARAMS ((GDB_FILE *stream, char *string,
-                              unsigned int length, int width,
-                              int force_ellipses));
+    /* Evaluate an expression. */
+    struct value *(*evaluate_exp) PARAMS ((struct type *, struct expression *,
+                                          int *, enum noside));
 
-  void (*la_emitchar) PARAMS ((int ch, GDB_FILE *stream, int quoter));
+    void (*la_printchar) PARAMS ((int ch, GDB_FILE * stream));
 
-  struct type *(*la_fund_type) PARAMS ((struct objfile *, int));
+    void (*la_printstr) PARAMS ((GDB_FILE * stream, char *string,
+                                unsigned int length, int width,
+                                int force_ellipses));
 
-  /* Print a type using syntax appropriate for this language. */
+    void (*la_emitchar) PARAMS ((int ch, GDB_FILE * stream, int quoter));
 
-  void (*la_print_type) PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+    struct type *(*la_fund_type) PARAMS ((struct objfile *, int));
 
-  /* Print a value using syntax appropriate for this language. */
+    /* Print a type using syntax appropriate for this language. */
 
-  int (*la_val_print) PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
-                              int, int, int, enum val_prettyprint));
+    void (*la_print_type) PARAMS ((struct type *, char *, GDB_FILE *, int, int));
 
-  /* Print a top-level value using syntax appropriate for this language. */
+    /* Print a value using syntax appropriate for this language. */
 
-  int (*la_value_print) PARAMS ((struct value *, GDB_FILE *,
-                                int, enum val_prettyprint));
+    int (*la_val_print) PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
+                                int, int, int, enum val_prettyprint));
 
-  /* Base 2 (binary) formats. */
+    /* Print a top-level value using syntax appropriate for this language. */
 
-  struct language_format_info la_binary_format;
+    int (*la_value_print) PARAMS ((struct value *, GDB_FILE *,
+                                  int, enum val_prettyprint));
 
-  /* Base 8 (octal) formats. */
+    /* Base 2 (binary) formats. */
 
-  struct language_format_info la_octal_format;
+    struct language_format_info la_binary_format;
 
-  /* Base 10 (decimal) formats */
+    /* Base 8 (octal) formats. */
 
-  struct language_format_info la_decimal_format;
+    struct language_format_info la_octal_format;
 
-  /* Base 16 (hexadecimal) formats */
+    /* Base 10 (decimal) formats */
 
-  struct language_format_info la_hex_format;
+    struct language_format_info la_decimal_format;
 
-  /* Table for printing expressions */
+    /* Base 16 (hexadecimal) formats */
 
-  const struct op_print *la_op_print_tab;
+    struct language_format_info la_hex_format;
 
-  /* Zero if the language has first-class arrays.  True if there are no
-     array values, and array objects decay to pointers, as in C. */
+    /* Table for printing expressions */
 
-  char c_style_arrays;
+    const struct op_print *la_op_print_tab;
 
-  /* Index to use for extracting the first element of a string. */
-  char string_lower_bound;
+    /* Zero if the language has first-class arrays.  True if there are no
+       array values, and array objects decay to pointers, as in C. */
 
-  /* Type of elements of strings. */
-  struct type **string_char_type;
+    char c_style_arrays;
 
-  /* Add fields above this point, so the magic number is always last. */
-  /* Magic number for compat checking */
+    /* Index to use for extracting the first element of a string. */
+    char string_lower_bound;
 
-  long la_magic;
+    /* Type of elements of strings. */
+    struct type **string_char_type;
 
-};
+    /* Add fields above this point, so the magic number is always last. */
+    /* Magic number for compat checking */
+
+    long la_magic;
+
+  };
 
 #define LANG_MAGIC     910823L
 
@@ -226,11 +241,14 @@ extern const struct language_defn *expected_language;
 
 /* language_mode == 
    language_mode_auto:   current_language automatically set upon selection
-                        of scope (e.g. stack frame)
+   of scope (e.g. stack frame)
    language_mode_manual: current_language set only by user.  */
 
 extern enum language_mode
-  {language_mode_auto, language_mode_manual} language_mode;
+  {
+    language_mode_auto, language_mode_manual
+  }
+language_mode;
 \f
 /* These macros define the behaviour of the expression 
    evaluator.  */
@@ -251,8 +269,8 @@ language_info PARAMS ((int));
 
 extern enum language
 set_language PARAMS ((enum language));
-
 \f
+
 /* This page contains functions that return things that are
    specific to languages.  Each of these functions is based on
    the current setting of working_lang, which the user sets
@@ -335,23 +353,23 @@ set_language PARAMS ((enum language));
    (to produce e.g. %08x or %lx).  */
 
 extern char *
-local_decimal_format_custom PARAMS ((char *)); /* language.c */
+  local_decimal_format_custom PARAMS ((char *));       /* language.c */
 
 extern char *
-local_octal_format_custom PARAMS ((char *));   /* language.c */
+  local_octal_format_custom PARAMS ((char *)); /* language.c */
 
 extern char *
-local_hex_format_custom PARAMS ((char *));     /* language.c */
+  local_hex_format_custom PARAMS ((char *));   /* language.c */
 
 /* Return a string that contains a number formatted in one of the local
    (language-specific) formats.  Result is static and is overwritten by
    the next call.  Takes printf options like "08" or "l".  */
 
 extern char *
-local_hex_string PARAMS ((unsigned long));             /* language.c */
+  local_hex_string PARAMS ((unsigned long));   /* language.c */
 
 extern char *
-local_hex_string_custom PARAMS ((unsigned long, char *)); /* language.c */
+  local_hex_string_custom PARAMS ((unsigned long, char *));    /* language.c */
 
 /* Type predicates */
 
@@ -403,37 +421,38 @@ op_error PARAMS ((char *fmt, enum exp_opcode, int));
    op_error((f),(o),range_check==range_check_on ? 1 : 0)
 
 extern void
-type_error PARAMS ((char *, ...))
-     ATTR_FORMAT(printf, 1, 2);
+  type_error
+PARAMS ((char *,...))
+ATTR_FORMAT (printf, 1, 2);
 
-void
-range_error PARAMS ((char *, ...))
-     ATTR_FORMAT(printf, 1, 2);
+     void
+     range_error PARAMS ((char *,...))
+  ATTR_FORMAT (printf, 1, 2);
 
 /* Data:  Does this value represent "truth" to the current language?  */
 
-extern int
-value_true PARAMS ((struct value *));
+     extern int
+     value_true PARAMS ((struct value *));
 
-extern struct type * lang_bool_type PARAMS ((void));
+     extern struct type *lang_bool_type PARAMS ((void));
 
 /* The type used for Boolean values in the current language. */
 #define LA_BOOL_TYPE lang_bool_type ()
 
 /* Misc:  The string representing a particular enum language.  */
 
-extern enum language language_enum PARAMS ((char *str));
+     extern enum language language_enum PARAMS ((char *str));
 
-extern const struct language_defn *language_def PARAMS ((enum language));
+     extern const struct language_defn *language_def PARAMS ((enum language));
 
-extern char *language_str PARAMS ((enum language));
+     extern char *language_str PARAMS ((enum language));
 
 /* Add a language to the set known by GDB (at initialization time).  */
 
-extern void
-add_language PARAMS ((const struct language_defn *));
+     extern void
+     add_language PARAMS ((const struct language_defn *));
 
-extern enum language
-get_frame_language PARAMS ((void));            /* In stack.c */
+     extern enum language
+     get_frame_language PARAMS ((void));       /* In stack.c */
 
-#endif /* defined (LANGUAGE_H) */
+#endif /* defined (LANGUAGE_H) */
index 38f72eabc1aad5918a99fb3de3bc966e8ed317c5..dba5559112c6f97898e9ed660b9b64287fd12dd0 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent code for LynxOS.
    Copyright 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -37,22 +38,22 @@ static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
 
 static int regmap[] =
 {
-  X(eax),
-  X(ecx),
-  X(edx),
-  X(ebx),
-  X(esp),                      /* sp */
-  X(ebp),                      /* fp */
-  X(esi),
-  X(edi),
-  X(eip),                      /* pc */
-  X(flags),                    /* ps */
-  X(cs),
-  X(ss),
-  X(ds),
-  X(es),
-  X(ecode),                    /* Lynx doesn't give us either fs or gs, so */
-  X(fault),                    /* we just substitute these two in the hopes
+  X (eax),
+  X (ecx),
+  X (edx),
+  X (ebx),
+  X (esp),                     /* sp */
+  X (ebp),                     /* fp */
+  X (esi),
+  X (edi),
+  X (eip),                     /* pc */
+  X (flags),                   /* ps */
+  X (cs),
+  X (ss),
+  X (ds),
+  X (es),
+  X (ecode),                   /* Lynx doesn't give us either fs or gs, so */
+  X (fault),                   /* we just substitute these two in the hopes
                                   that they are useful. */
 };
 #endif /* I386 */
@@ -62,39 +63,39 @@ static int regmap[] =
 
 static int regmap[] =
 {
-  X(regs[0]),                  /* d0 */
-  X(regs[1]),                  /* d1 */
-  X(regs[2]),                  /* d2 */
-  X(regs[3]),                  /* d3 */
-  X(regs[4]),                  /* d4 */
-  X(regs[5]),                  /* d5 */
-  X(regs[6]),                  /* d6 */
-  X(regs[7]),                  /* d7 */
-  X(regs[8]),                  /* a0 */
-  X(regs[9]),                  /* a1 */
-  X(regs[10]),                 /* a2 */
-  X(regs[11]),                 /* a3 */
-  X(regs[12]),                 /* a4 */
-  X(regs[13]),                 /* a5 */
-  X(regs[14]),                 /* fp */
-  offsetof (st_t, usp) - offsetof (st_t, ec), /* sp */
-  X(status),                   /* ps */
-  X(pc),
-
-  X(fregs[0*3]),               /* fp0 */
-  X(fregs[1*3]),               /* fp1 */
-  X(fregs[2*3]),               /* fp2 */
-  X(fregs[3*3]),               /* fp3 */
-  X(fregs[4*3]),               /* fp4 */
-  X(fregs[5*3]),               /* fp5 */
-  X(fregs[6*3]),               /* fp6 */
-  X(fregs[7*3]),               /* fp7 */
-
-  X(fcregs[0]),                        /* fpcontrol */
-  X(fcregs[1]),                        /* fpstatus */
-  X(fcregs[2]),                        /* fpiaddr */
-  X(ssw),                      /* fpcode */
-  X(fault),                    /* fpflags */
+  X (regs[0]),                 /* d0 */
+  X (regs[1]),                 /* d1 */
+  X (regs[2]),                 /* d2 */
+  X (regs[3]),                 /* d3 */
+  X (regs[4]),                 /* d4 */
+  X (regs[5]),                 /* d5 */
+  X (regs[6]),                 /* d6 */
+  X (regs[7]),                 /* d7 */
+  X (regs[8]),                 /* a0 */
+  X (regs[9]),                 /* a1 */
+  X (regs[10]),                        /* a2 */
+  X (regs[11]),                        /* a3 */
+  X (regs[12]),                        /* a4 */
+  X (regs[13]),                        /* a5 */
+  X (regs[14]),                        /* fp */
+  offsetof (st_t, usp) - offsetof (st_t, ec),  /* sp */
+  X (status),                  /* ps */
+  X (pc),
+
+  X (fregs[0 * 3]),            /* fp0 */
+  X (fregs[1 * 3]),            /* fp1 */
+  X (fregs[2 * 3]),            /* fp2 */
+  X (fregs[3 * 3]),            /* fp3 */
+  X (fregs[4 * 3]),            /* fp4 */
+  X (fregs[5 * 3]),            /* fp5 */
+  X (fregs[6 * 3]),            /* fp6 */
+  X (fregs[7 * 3]),            /* fp7 */
+
+  X (fcregs[0]),               /* fpcontrol */
+  X (fcregs[1]),               /* fpstatus */
+  X (fcregs[2]),               /* fpiaddr */
+  X (ssw),                     /* fpcode */
+  X (fault),                   /* fpflags */
 };
 #endif /* M68K */
 
@@ -106,67 +107,67 @@ static int regmap[] =
 static int regmap[] =
 {
   -1,                          /* g0 */
-  X(g1),
-  X(g2),
-  X(g3),
-  X(g4),
+  X (g1),
+  X (g2),
+  X (g3),
+  X (g4),
   -1,                          /* g5->g7 aren't saved by Lynx */
   -1,
   -1,
 
-  X(o[0]),
-  X(o[1]),
-  X(o[2]),
-  X(o[3]),
-  X(o[4]),
-  X(o[5]),
-  X(o[6]),                     /* sp */
-  X(o[7]),                     /* ra */
-
-  -1,-1,-1,-1,-1,-1,-1,-1,     /* l0 -> l7 */
-
-  -1,-1,-1,-1,-1,-1,-1,-1,     /* i0 -> i7 */
-
-  FX(f.fregs[0]),              /* f0 */
-  FX(f.fregs[1]),
-  FX(f.fregs[2]),
-  FX(f.fregs[3]),
-  FX(f.fregs[4]),
-  FX(f.fregs[5]),
-  FX(f.fregs[6]),
-  FX(f.fregs[7]),
-  FX(f.fregs[8]),
-  FX(f.fregs[9]),
-  FX(f.fregs[10]),
-  FX(f.fregs[11]),
-  FX(f.fregs[12]),
-  FX(f.fregs[13]),
-  FX(f.fregs[14]),
-  FX(f.fregs[15]),
-  FX(f.fregs[16]),
-  FX(f.fregs[17]),
-  FX(f.fregs[18]),
-  FX(f.fregs[19]),
-  FX(f.fregs[20]),
-  FX(f.fregs[21]),
-  FX(f.fregs[22]),
-  FX(f.fregs[23]),
-  FX(f.fregs[24]),
-  FX(f.fregs[25]),
-  FX(f.fregs[26]),
-  FX(f.fregs[27]),
-  FX(f.fregs[28]),
-  FX(f.fregs[29]),
-  FX(f.fregs[30]),
-  FX(f.fregs[31]),
-
-  X(y),
-  X(psr),
-  X(wim),
-  X(tbr),
-  X(pc),
-  X(npc),
-  FX(fsr),                     /* fpsr */
+  X (o[0]),
+  X (o[1]),
+  X (o[2]),
+  X (o[3]),
+  X (o[4]),
+  X (o[5]),
+  X (o[6]),                    /* sp */
+  X (o[7]),                    /* ra */
+
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* l0 -> l7 */
+
+  -1, -1, -1, -1, -1, -1, -1, -1,      /* i0 -> i7 */
+
+  FX (f.fregs[0]),             /* f0 */
+  FX (f.fregs[1]),
+  FX (f.fregs[2]),
+  FX (f.fregs[3]),
+  FX (f.fregs[4]),
+  FX (f.fregs[5]),
+  FX (f.fregs[6]),
+  FX (f.fregs[7]),
+  FX (f.fregs[8]),
+  FX (f.fregs[9]),
+  FX (f.fregs[10]),
+  FX (f.fregs[11]),
+  FX (f.fregs[12]),
+  FX (f.fregs[13]),
+  FX (f.fregs[14]),
+  FX (f.fregs[15]),
+  FX (f.fregs[16]),
+  FX (f.fregs[17]),
+  FX (f.fregs[18]),
+  FX (f.fregs[19]),
+  FX (f.fregs[20]),
+  FX (f.fregs[21]),
+  FX (f.fregs[22]),
+  FX (f.fregs[23]),
+  FX (f.fregs[24]),
+  FX (f.fregs[25]),
+  FX (f.fregs[26]),
+  FX (f.fregs[27]),
+  FX (f.fregs[28]),
+  FX (f.fregs[29]),
+  FX (f.fregs[30]),
+  FX (f.fregs[31]),
+
+  X (y),
+  X (psr),
+  X (wim),
+  X (tbr),
+  X (pc),
+  X (npc),
+  FX (fsr),                    /* fpsr */
   -1,                          /* cpsr */
 };
 #endif /* SPARC */
@@ -175,79 +176,79 @@ static int regmap[] =
 
 static int regmap[] =
 {
-  X(iregs[0]),                 /* r0 */
-  X(iregs[1]),
-  X(iregs[2]),
-  X(iregs[3]),
-  X(iregs[4]),
-  X(iregs[5]),
-  X(iregs[6]),
-  X(iregs[7]),
-  X(iregs[8]),
-  X(iregs[9]),
-  X(iregs[10]),
-  X(iregs[11]),
-  X(iregs[12]),
-  X(iregs[13]),
-  X(iregs[14]),
-  X(iregs[15]),
-  X(iregs[16]),
-  X(iregs[17]),
-  X(iregs[18]),
-  X(iregs[19]),
-  X(iregs[20]),
-  X(iregs[21]),
-  X(iregs[22]),
-  X(iregs[23]),
-  X(iregs[24]),
-  X(iregs[25]),
-  X(iregs[26]),
-  X(iregs[27]),
-  X(iregs[28]),
-  X(iregs[29]),
-  X(iregs[30]),
-  X(iregs[31]),
-
-  X(fregs[0]),                 /* f0 */
-  X(fregs[1]),
-  X(fregs[2]),
-  X(fregs[3]),
-  X(fregs[4]),
-  X(fregs[5]),
-  X(fregs[6]),
-  X(fregs[7]),
-  X(fregs[8]),
-  X(fregs[9]),
-  X(fregs[10]),
-  X(fregs[11]),
-  X(fregs[12]),
-  X(fregs[13]),
-  X(fregs[14]),
-  X(fregs[15]),
-  X(fregs[16]),
-  X(fregs[17]),
-  X(fregs[18]),
-  X(fregs[19]),
-  X(fregs[20]),
-  X(fregs[21]),
-  X(fregs[22]),
-  X(fregs[23]),
-  X(fregs[24]),
-  X(fregs[25]),
-  X(fregs[26]),
-  X(fregs[27]),
-  X(fregs[28]),
-  X(fregs[29]),
-  X(fregs[30]),
-  X(fregs[31]),
-
-  X(srr0),                     /* IAR (PC) */
-  X(srr1),                     /* MSR (PS) */
-  X(cr),                       /* CR */
-  X(lr),                       /* LR */
-  X(ctr),                      /* CTR */
-  X(xer),                      /* XER */
-  X(mq)                                /* MQ */
+  X (iregs[0]),                        /* r0 */
+  X (iregs[1]),
+  X (iregs[2]),
+  X (iregs[3]),
+  X (iregs[4]),
+  X (iregs[5]),
+  X (iregs[6]),
+  X (iregs[7]),
+  X (iregs[8]),
+  X (iregs[9]),
+  X (iregs[10]),
+  X (iregs[11]),
+  X (iregs[12]),
+  X (iregs[13]),
+  X (iregs[14]),
+  X (iregs[15]),
+  X (iregs[16]),
+  X (iregs[17]),
+  X (iregs[18]),
+  X (iregs[19]),
+  X (iregs[20]),
+  X (iregs[21]),
+  X (iregs[22]),
+  X (iregs[23]),
+  X (iregs[24]),
+  X (iregs[25]),
+  X (iregs[26]),
+  X (iregs[27]),
+  X (iregs[28]),
+  X (iregs[29]),
+  X (iregs[30]),
+  X (iregs[31]),
+
+  X (fregs[0]),                        /* f0 */
+  X (fregs[1]),
+  X (fregs[2]),
+  X (fregs[3]),
+  X (fregs[4]),
+  X (fregs[5]),
+  X (fregs[6]),
+  X (fregs[7]),
+  X (fregs[8]),
+  X (fregs[9]),
+  X (fregs[10]),
+  X (fregs[11]),
+  X (fregs[12]),
+  X (fregs[13]),
+  X (fregs[14]),
+  X (fregs[15]),
+  X (fregs[16]),
+  X (fregs[17]),
+  X (fregs[18]),
+  X (fregs[19]),
+  X (fregs[20]),
+  X (fregs[21]),
+  X (fregs[22]),
+  X (fregs[23]),
+  X (fregs[24]),
+  X (fregs[25]),
+  X (fregs[26]),
+  X (fregs[27]),
+  X (fregs[28]),
+  X (fregs[29]),
+  X (fregs[30]),
+  X (fregs[31]),
+
+  X (srr0),                    /* IAR (PC) */
+  X (srr1),                    /* MSR (PS) */
+  X (cr),                      /* CR */
+  X (lr),                      /* LR */
+  X (ctr),                     /* CTR */
+  X (xer),                     /* XER */
+  X (mq)                       /* MQ */
 };
 
 #endif /* rs6000 */
@@ -279,31 +280,31 @@ fetch_inferior_registers (regno)
 
   if (whatregs & WHATREGS_GEN)
     {
-      struct econtext ec;              /* general regs */
+      struct econtext ec;      /* general regs */
       char buf[MAX_REGISTER_RAW_SIZE];
       int retval;
       int i;
 
       errno = 0;
-      retval = ptrace (PTRACE_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &ec,
+      retval = ptrace (PTRACE_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) & ec,
                       0);
       if (errno)
        perror_with_name ("ptrace(PTRACE_GETREGS)");
-  
+
       memset (buf, 0, REGISTER_RAW_SIZE (G0_REGNUM));
       supply_register (G0_REGNUM, buf);
-      supply_register (TBR_REGNUM, (char *)&ec.tbr);
+      supply_register (TBR_REGNUM, (char *) &ec.tbr);
 
       memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
              4 * REGISTER_RAW_SIZE (G1_REGNUM));
       for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
        register_valid[i] = 1;
 
-      supply_register (PS_REGNUM, (char *)&ec.psr);
-      supply_register (Y_REGNUM, (char *)&ec.y);
-      supply_register (PC_REGNUM, (char *)&ec.pc);
-      supply_register (NPC_REGNUM, (char *)&ec.npc);
-      supply_register (WIM_REGNUM, (char *)&ec.wim);
+      supply_register (PS_REGNUM, (char *) &ec.psr);
+      supply_register (Y_REGNUM, (char *) &ec.y);
+      supply_register (PC_REGNUM, (char *) &ec.pc);
+      supply_register (NPC_REGNUM, (char *) &ec.npc);
+      supply_register (WIM_REGNUM, (char *) &ec.wim);
 
       memcpy (&registers[REGISTER_BYTE (O0_REGNUM)], ec.o,
              8 * REGISTER_RAW_SIZE (O0_REGNUM));
@@ -319,13 +320,13 @@ fetch_inferior_registers (regno)
       sp = read_register (SP_REGNUM);
 
       target_xfer_memory (sp + FRAME_SAVED_I0,
-                         &registers[REGISTER_BYTE(I0_REGNUM)],
+                         &registers[REGISTER_BYTE (I0_REGNUM)],
                          8 * REGISTER_RAW_SIZE (I0_REGNUM), 0);
       for (i = I0_REGNUM; i <= I7_REGNUM; i++)
        register_valid[i] = 1;
 
       target_xfer_memory (sp + FRAME_SAVED_L0,
-                         &registers[REGISTER_BYTE(L0_REGNUM)],
+                         &registers[REGISTER_BYTE (L0_REGNUM)],
                          8 * REGISTER_RAW_SIZE (L0_REGNUM), 0);
       for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
        register_valid[i] = 1;
@@ -333,22 +334,22 @@ fetch_inferior_registers (regno)
 
   if (whatregs & WHATREGS_FLOAT)
     {
-      struct fcontext fc;              /* fp regs */
+      struct fcontext fc;      /* fp regs */
       int retval;
       int i;
 
       errno = 0;
-      retval = ptrace (PTRACE_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("ptrace(PTRACE_GETFPREGS)");
-  
+
       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
              32 * REGISTER_RAW_SIZE (FP0_REGNUM));
       for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
        register_valid[i] = 1;
 
-      supply_register (FPS_REGNUM, (char *)&fc.fsr);
+      supply_register (FPS_REGNUM, (char *) &fc.fsr);
     }
 }
 
@@ -378,7 +379,7 @@ store_inferior_registers (regno)
 
   if (whatregs & WHATREGS_GEN)
     {
-      struct econtext ec;              /* general regs */
+      struct econtext ec;      /* general regs */
       int retval;
 
       ec.tbr = read_register (TBR_REGNUM);
@@ -395,7 +396,7 @@ store_inferior_registers (regno)
              8 * REGISTER_RAW_SIZE (O0_REGNUM));
 
       errno = 0;
-      retval = ptrace (PTRACE_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &ec,
+      retval = ptrace (PTRACE_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) & ec,
                       0);
       if (errno)
        perror_with_name ("ptrace(PTRACE_SETREGS)");
@@ -410,8 +411,8 @@ store_inferior_registers (regno)
 
       if (regno == -1 || regno == SP_REGNUM)
        {
-         if (!register_valid[L0_REGNUM+5])
-           abort();
+         if (!register_valid[L0_REGNUM + 5])
+           abort ();
          target_xfer_memory (sp + FRAME_SAVED_I0,
                              &registers[REGISTER_BYTE (I0_REGNUM)],
                              8 * REGISTER_RAW_SIZE (I0_REGNUM), 1);
@@ -423,7 +424,7 @@ store_inferior_registers (regno)
       else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
        {
          if (!register_valid[regno])
-           abort();
+           abort ();
          if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
            regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
              + FRAME_SAVED_L0;
@@ -437,27 +438,27 @@ store_inferior_registers (regno)
 
   if (whatregs & WHATREGS_FLOAT)
     {
-      struct fcontext fc;              /* fp regs */
+      struct fcontext fc;      /* fp regs */
       int retval;
 
 /* We read fcontext first so that we can get good values for fq_t... */
       errno = 0;
-      retval = ptrace (PTRACE_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("ptrace(PTRACE_GETFPREGS)");
-  
+
       memcpy (fc.f.fregs, &registers[REGISTER_BYTE (FP0_REGNUM)],
              32 * REGISTER_RAW_SIZE (FP0_REGNUM));
 
       fc.fsr = read_register (FPS_REGNUM);
 
       errno = 0;
-      retval = ptrace (PTRACE_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &fc,
+      retval = ptrace (PTRACE_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) & fc,
                       0);
       if (errno)
        perror_with_name ("ptrace(PTRACE_SETFPREGS)");
-      }
+    }
 }
 #endif /* SPARC */
 
@@ -467,20 +468,20 @@ store_inferior_registers (regno)
    saved context block.  */
 
 static unsigned long
-registers_addr(pid)
+registers_addr (pid)
      int pid;
 {
   CORE_ADDR stblock;
-  int ecpoff = offsetof(st_t, ecp);
+  int ecpoff = offsetof (st_t, ecp);
   CORE_ADDR ecp;
 
   errno = 0;
-  stblock = (CORE_ADDR) ptrace (PTRACE_THREADUSER, pid, (PTRACE_ARG3_TYPE)0,
+  stblock = (CORE_ADDR) ptrace (PTRACE_THREADUSER, pid, (PTRACE_ARG3_TYPE) 0,
                                0);
   if (errno)
     perror_with_name ("ptrace(PTRACE_THREADUSER)");
 
-  ecp = (CORE_ADDR) ptrace (PTRACE_PEEKTHREAD, pid, (PTRACE_ARG3_TYPE)ecpoff,
+  ecp = (CORE_ADDR) ptrace (PTRACE_PEEKTHREAD, pid, (PTRACE_ARG3_TYPE) ecpoff,
                            0);
   if (errno)
     perror_with_name ("ptrace(PTRACE_PEEKTHREAD)");
@@ -528,8 +529,8 @@ fetch_inferior_registers (regno)
                        (PTRACE_ARG3_TYPE) (ecp + regmap[regno] + i), 0);
          if (errno)
            perror_with_name ("ptrace(PTRACE_PEEKUSP)");
-  
-         *(int *)&buf[i] = reg;
+
+         *(int *) &buf[i] = reg;
        }
       supply_register (regno, buf);
     }
@@ -577,7 +578,7 @@ store_inferior_registers (regno)
        {
          unsigned int reg;
 
-         reg = *(unsigned int *)&registers[REGISTER_BYTE (regno) + i];
+         reg = *(unsigned int *) &registers[REGISTER_BYTE (regno) + i];
 
          errno = 0;
          ptrace (ptrace_fun, inferior_pid,
@@ -605,33 +606,33 @@ child_wait (pid, ourstatus)
     {
       int sig;
 
-      set_sigint_trap();       /* Causes SIGINT to be passed on to the
+      set_sigint_trap ();      /* Causes SIGINT to be passed on to the
                                   attached process. */
       pid = wait (&status);
 
       save_errno = errno;
 
-      clear_sigint_trap();
+      clear_sigint_trap ();
 
       if (pid == -1)
        {
          if (save_errno == EINTR)
            continue;
          fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
-                  safe_strerror (save_errno));
+                             safe_strerror (save_errno));
          /* Claim it exited with unknown signal.  */
          ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
          ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
          return -1;
        }
 
-      if (pid != PIDGET (inferior_pid))        /* Some other process?!? */
+      if (pid != PIDGET (inferior_pid))                /* Some other process?!? */
        continue;
 
       thread = status.w_tid;   /* Get thread id from status */
 
       /* Initial thread value can only be acquired via wait, so we have to
-        resort to this hack.  */
+         resort to this hack.  */
 
       if (TIDGET (inferior_pid) == 0 && thread != 0)
        {
@@ -646,18 +647,18 @@ child_wait (pid, ourstatus)
        inferior_pid = pid;
 
       /* Check for thread creation.  */
-      if (WIFSTOPPED(status)
-         && WSTOPSIG(status) == SIGTRAP
+      if (WIFSTOPPED (status)
+         && WSTOPSIG (status) == SIGTRAP
          && !in_thread_list (pid))
        {
          int realsig;
 
-         realsig = ptrace (PTRACE_GETTRACESIG, pid, (PTRACE_ARG3_TYPE)0, 0);
+         realsig = ptrace (PTRACE_GETTRACESIG, pid, (PTRACE_ARG3_TYPE) 0, 0);
 
          if (realsig == SIGNEWTHREAD)
            {
              /* It's a new thread notification.  We don't want to much with
-                realsig -- the code in wait_for_inferior expects SIGTRAP. */
+                realsig -- the code in wait_for_inferior expects SIGTRAP. */
              ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
              ourstatus->value.sig = TARGET_SIGNAL_0;
              return pid;
@@ -667,26 +668,26 @@ child_wait (pid, ourstatus)
        }
 
       /* Check for thread termination.  */
-      else if (WIFSTOPPED(status)
-              && WSTOPSIG(status) == SIGTRAP
+      else if (WIFSTOPPED (status)
+              && WSTOPSIG (status) == SIGTRAP
               && in_thread_list (pid))
        {
          int realsig;
 
-         realsig = ptrace (PTRACE_GETTRACESIG, pid, (PTRACE_ARG3_TYPE)0, 0);
+         realsig = ptrace (PTRACE_GETTRACESIG, pid, (PTRACE_ARG3_TYPE) 0, 0);
 
          if (realsig == SIGTHREADEXIT)
            {
-             ptrace (PTRACE_CONT, PIDGET (pid), (PTRACE_ARG3_TYPE)0, 0);
+             ptrace (PTRACE_CONT, PIDGET (pid), (PTRACE_ARG3_TYPE) 0, 0);
              continue;
            }
        }
 
 #ifdef SPARC
       /* SPARC Lynx uses an byte reversed wait status; we must use the
-        host macros to access it.  These lines just a copy of
-        store_waitstatus.  We can't use CHILD_SPECIAL_WAITSTATUS
-        because target.c can't include the Lynx <sys/wait.h>.  */
+         host macros to access it.  These lines just a copy of
+         store_waitstatus.  We can't use CHILD_SPECIAL_WAITSTATUS
+         because target.c can't include the Lynx <sys/wait.h>.  */
       if (WIFEXITED (status))
        {
          ourstatus->kind = TARGET_WAITKIND_EXITED;
@@ -789,11 +790,11 @@ lynx_pid_to_str (pid)
    CORE_REG_SECT points to the register values themselves, read into memory.
    CORE_REG_SIZE is the size of that area.
    WHICH says which set of registers we are handling (0 = int, 2 = float
-         on machines where they are discontiguous).
+   on machines where they are discontiguous).
    REG_ADDR is the offset from u.u_ar0 to the register values relative to
-            core_reg_sect.  This is used with old-fashioned core files to
-           locate the registers in a large upage-plus-stack ".reg" section.
-           Original upage address X is at location core_reg_sect+x+reg_addr.
+   core_reg_sect.  This is used with old-fashioned core files to
+   locate the registers in a large upage-plus-stack ".reg" section.
+   Original upage address X is at location core_reg_sect+x+reg_addr.
  */
 
 static void
@@ -818,8 +819,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   fetch_inferior_registers (I0_REGNUM);
 #endif
 }
-
 \f
+
 /* Register that we are able to handle lynx core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index a93e5f0ba5891755e0124c633f67f890c820b1cc..fd13349295a8a2e56352674b6868fb1d3832a1a6 100644 (file)
@@ -1,21 +1,22 @@
 /* Modula 2 language support routines for GDB, the GNU debugger.
    Copyright 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 extern void _initialize_m2_language PARAMS ((void));
 static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int));
-static void m2_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+static void m2_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
 static void m2_printchar PARAMS ((int, GDB_FILE *));
 static void m2_emit_char PARAMS ((int, GDB_FILE *, int));
 
@@ -133,7 +134,7 @@ m2_printstr (stream, string, length, width, force_ellipses)
   for (i = 0; i < length && things_printed < print_max; ++i)
     {
       /* 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;
@@ -211,190 +212,191 @@ m2_create_fundamental_type (objfile, typeid)
 
   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 Modula 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_BOOLEAN:
-       type = init_type (TYPE_CODE_BOOL,
-                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_UNSIGNED, "boolean", objfile);
-       break;
-      case FT_STRING:
-       type = init_type (TYPE_CODE_STRING,
-                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                         0, "string", objfile);
-       break;
-      case FT_CHAR:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                         0, "char", 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", objfile);
-       break;
-      case FT_SIGNED_SHORT:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-                         0, "short", objfile); /* FIXME-fnf */
-       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, "int", objfile);
-       break;
-      case FT_SIGNED_INTEGER:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
-                         0, "int", 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_FIXED_DECIMAL:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_INT_BIT / TARGET_CHAR_BIT,
-                         0, "fixed decimal", objfile);
-       break;
-      case FT_LONG:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
-                         0, "long", objfile);
-       break;
-      case FT_SIGNED_LONG:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_BIT / TARGET_CHAR_BIT,
-                         0, "long", objfile); /* FIXME -fnf */
-       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", objfile);
-       break;
-      case FT_SIGNED_LONG_LONG:
-       type = init_type (TYPE_CODE_INT,
-                         TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                         0, "signed long long", 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, "double", objfile);
-       break;
-      case FT_FLOAT_DECIMAL:
-       type = init_type (TYPE_CODE_FLT,
-                         TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
-                         0, "floating decimal", objfile);
-       break;
-      case FT_EXT_PREC_FLOAT:
-       type = init_type (TYPE_CODE_FLT,
-                         TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-                         0, "long double", objfile);
-       break;
-      case FT_COMPLEX:
-       type = init_type (TYPE_CODE_COMPLEX,
-                         2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
-                         0, "complex", objfile);
-       TYPE_TARGET_TYPE (type)
-         = m2_create_fundamental_type (objfile, FT_FLOAT);
-       break;
-      case FT_DBL_PREC_COMPLEX:
-       type = init_type (TYPE_CODE_COMPLEX,
-                         2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
-                         0, "double complex", objfile);
-       TYPE_TARGET_TYPE (type)
-         = m2_create_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
-       break;
-      case FT_EXT_PREC_COMPLEX:
-       type = init_type (TYPE_CODE_COMPLEX,
-                         2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-                         0, "long double complex", objfile);
-       TYPE_TARGET_TYPE (type)
-         = m2_create_fundamental_type (objfile, FT_EXT_PREC_FLOAT);
-       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 Modula 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_BOOLEAN:
+      type = init_type (TYPE_CODE_BOOL,
+                       TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                       TYPE_FLAG_UNSIGNED, "boolean", objfile);
+      break;
+    case FT_STRING:
+      type = init_type (TYPE_CODE_STRING,
+                       TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                       0, "string", objfile);
+      break;
+    case FT_CHAR:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                       0, "char", 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", objfile);
+      break;
+    case FT_SIGNED_SHORT:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                       0, "short", objfile);   /* FIXME-fnf */
+      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, "int", objfile);
+      break;
+    case FT_SIGNED_INTEGER:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       0, "int", 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_FIXED_DECIMAL:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_INT_BIT / TARGET_CHAR_BIT,
+                       0, "fixed decimal", objfile);
+      break;
+    case FT_LONG:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       0, "long", objfile);
+      break;
+    case FT_SIGNED_LONG:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                       0, "long", objfile);    /* FIXME -fnf */
+      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", objfile);
+      break;
+    case FT_SIGNED_LONG_LONG:
+      type = init_type (TYPE_CODE_INT,
+                       TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                       0, "signed long long", 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, "double", objfile);
+      break;
+    case FT_FLOAT_DECIMAL:
+      type = init_type (TYPE_CODE_FLT,
+                       TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+                       0, "floating decimal", objfile);
+      break;
+    case FT_EXT_PREC_FLOAT:
+      type = init_type (TYPE_CODE_FLT,
+                       TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+                       0, "long double", objfile);
+      break;
+    case FT_COMPLEX:
+      type = init_type (TYPE_CODE_COMPLEX,
+                       2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+                       0, "complex", objfile);
+      TYPE_TARGET_TYPE (type)
+       = m2_create_fundamental_type (objfile, FT_FLOAT);
+      break;
+    case FT_DBL_PREC_COMPLEX:
+      type = init_type (TYPE_CODE_COMPLEX,
+                       2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+                       0, "double complex", objfile);
+      TYPE_TARGET_TYPE (type)
+       = m2_create_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
+      break;
+    case FT_EXT_PREC_COMPLEX:
+      type = init_type (TYPE_CODE_COMPLEX,
+                       2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+                       0, "long double complex", objfile);
+      TYPE_TARGET_TYPE (type)
+       = m2_create_fundamental_type (objfile, FT_EXT_PREC_FLOAT);
+      break;
+    }
   return (type);
 }
-
 \f
+
 /* Table of operators and their precedences for printing expressions.  */
 
-static const struct op_print m2_op_print_tab[] = {
-    {"+",   BINOP_ADD, PREC_ADD, 0},
-    {"+",   UNOP_PLUS, PREC_PREFIX, 0},
-    {"-",   BINOP_SUB, PREC_ADD, 0},
-    {"-",   UNOP_NEG, PREC_PREFIX, 0},
-    {"*",   BINOP_MUL, PREC_MUL, 0},
-    {"/",   BINOP_DIV, PREC_MUL, 0},
-    {"DIV", BINOP_INTDIV, PREC_MUL, 0},
-    {"MOD", BINOP_REM, PREC_MUL, 0},
-    {":=",  BINOP_ASSIGN, PREC_ASSIGN, 1},
-    {"OR",  BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
-    {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
-    {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 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},
-    {"^",   UNOP_IND, PREC_PREFIX, 0},
-    {"@",   BINOP_REPEAT, PREC_REPEAT, 0},
-    {"CAP", UNOP_CAP, PREC_BUILTIN_FUNCTION, 0},
-    {"CHR", UNOP_CHR, PREC_BUILTIN_FUNCTION, 0},
-    {"ORD", UNOP_ORD, PREC_BUILTIN_FUNCTION, 0},
-    {"FLOAT",UNOP_FLOAT, PREC_BUILTIN_FUNCTION, 0},
-    {"HIGH", UNOP_HIGH, PREC_BUILTIN_FUNCTION, 0},
-    {"MAX", UNOP_MAX, PREC_BUILTIN_FUNCTION, 0},
-    {"MIN", UNOP_MIN, PREC_BUILTIN_FUNCTION, 0},
-    {"ODD", UNOP_ODD, PREC_BUILTIN_FUNCTION, 0},
-    {"TRUNC", UNOP_TRUNC, PREC_BUILTIN_FUNCTION, 0},
-    {NULL,  0, 0, 0}
+static const struct op_print m2_op_print_tab[] =
+{
+  {"+", BINOP_ADD, PREC_ADD, 0},
+  {"+", UNOP_PLUS, PREC_PREFIX, 0},
+  {"-", BINOP_SUB, PREC_ADD, 0},
+  {"-", UNOP_NEG, PREC_PREFIX, 0},
+  {"*", BINOP_MUL, PREC_MUL, 0},
+  {"/", BINOP_DIV, PREC_MUL, 0},
+  {"DIV", BINOP_INTDIV, PREC_MUL, 0},
+  {"MOD", BINOP_REM, PREC_MUL, 0},
+  {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+  {"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+  {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+  {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 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},
+  {"^", UNOP_IND, PREC_PREFIX, 0},
+  {"@", BINOP_REPEAT, PREC_REPEAT, 0},
+  {"CAP", UNOP_CAP, PREC_BUILTIN_FUNCTION, 0},
+  {"CHR", UNOP_CHR, PREC_BUILTIN_FUNCTION, 0},
+  {"ORD", UNOP_ORD, PREC_BUILTIN_FUNCTION, 0},
+  {"FLOAT", UNOP_FLOAT, PREC_BUILTIN_FUNCTION, 0},
+  {"HIGH", UNOP_HIGH, PREC_BUILTIN_FUNCTION, 0},
+  {"MAX", UNOP_MAX, PREC_BUILTIN_FUNCTION, 0},
+  {"MIN", UNOP_MIN, PREC_BUILTIN_FUNCTION, 0},
+  {"ODD", UNOP_ODD, PREC_BUILTIN_FUNCTION, 0},
+  {"TRUNC", UNOP_TRUNC, PREC_BUILTIN_FUNCTION, 0},
+  {NULL, 0, 0, 0}
 };
 \f
 /* The built-in types of Modula-2.  */
@@ -405,17 +407,18 @@ struct type *builtin_type_m2_card;
 struct type *builtin_type_m2_real;
 struct type *builtin_type_m2_bool;
 
-struct type ** CONST_PTR (m2_builtin_types[]) = 
+struct type **CONST_PTR (m2_builtin_types[]) =
 {
   &builtin_type_m2_char,
-  &builtin_type_m2_int,
-  &builtin_type_m2_card,
-  &builtin_type_m2_real,
-  &builtin_type_m2_bool,
-  0
+    &builtin_type_m2_int,
+    &builtin_type_m2_card,
+    &builtin_type_m2_real,
+    &builtin_type_m2_bool,
+    0
 };
 
-const struct language_defn m2_language_defn = {
+const struct language_defn m2_language_defn =
+{
   "modula-2",
   language_m2,
   m2_builtin_types,
@@ -431,14 +434,14 @@ const struct language_defn m2_language_defn = {
   m2_print_type,               /* Print a type using appropriate syntax */
   m2_val_print,                        /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
-  {"",      "",   "",   ""},   /* Binary format info */
-  {"%loB",   "",   "o",  "B"}, /* Octal format info */
-  {"%ld",    "",   "d",  ""},  /* Decimal format info */
-  {"0%lXH",  "0",  "X",  "H"}, /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"%loB", "", "o", "B"},      /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"0%lXH", "0", "X", "H"},    /* Hex format info */
   m2_op_print_tab,             /* expression operators for printing */
   0,                           /* arrays are first-class (not c-style) */
   0,                           /* String lower bound */
-  &builtin_type_m2_char,       /* Type of string elements */ 
+  &builtin_type_m2_char,       /* Type of string elements */
   LANG_MAGIC
 };
 
index dc627b7f4711c11c5797877c086928092b8ceb4b..190940e4b0bc1e8fa5b44c98efdf93b10a306daf 100644 (file)
@@ -1,21 +1,22 @@
 /* Modula 2 language support definitions for GDB, the GNU debugger.
    Copyright 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 extern int
 m2_parse PARAMS ((void));      /* Defined in m2-exp.y */
index 317f40189ef5dc687293d9a63846005a9cc9940e..c3c1e5db3a69b007e1568b582a8293ffa25f552e 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for printing Modula 2 types for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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"
index 12a2f27e1736bd525b7391b1e4dea4ebcd770d68..76b97c5ca777592054d74c47e0acbe9e5028a335 100644 (file)
@@ -1,21 +1,22 @@
 /* Support for printing Modula 2 values for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 int
 m2_val_print (type, valaddr, embedded_offset, address,
-              stream, format, deref_ref, recurse, pretty)
+             stream, format, deref_ref, recurse, pretty)
      struct type *type;
      char *valaddr;
      int embedded_offset;
@@ -41,7 +42,7 @@ m2_val_print (type, valaddr, embedded_offset, address,
 {
   extern int
   c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR,
-                       GDB_FILE *, int, int, int, enum val_prettyprint));
+                      GDB_FILE *, int, int, int, enum val_prettyprint));
   return (c_val_print (type, valaddr, 0, address, stream, format, deref_ref,
                       recurse, pretty));
 }
index 4614f6565505208f8468b037d5dc47ddf32148fd..61274bd98afbf8e36cc7f044b94e5c6a947c794b 100644 (file)
@@ -3,36 +3,37 @@
 
    Copyright (C) 1992, 1996, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Author: Jukka Virtanen <jtv@hut.fi>
- *        Computing Centre
+ *         Computing Centre
  *         Helsinki University of Technology
  *         Finland
  *
  * Thanks to my friends who helped with ideas and testing:
  *
- *     Johannes Helander, Antti Louko, Tero Mononen,
- *     jvh@cs.hut.fi      alo@hut.fi   tmo@cs.hut.fi
+ *      Johannes Helander, Antti Louko, Tero Mononen,
+ *      jvh@cs.hut.fi      alo@hut.fi   tmo@cs.hut.fi
  *
  *      Tero Kivinen       and          Eamonn McManus
- *     kivinen@cs.hut.fi               emcmanus@gr.osf.org
- *     
+ *      kivinen@cs.hut.fi               emcmanus@gr.osf.org
+ *      
  */
 
 #include <stdio.h>
@@ -64,12 +65,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif
 
 /* Included only for signal names and NSIG
- *
+
  * note: There are many problems in signal handling with
  *       gdb in Mach 3.0 in general.
  */
 #include <signal.h>
-#define SIG_UNKNOWN 0  /* Exception that has no matching unix signal */
+#define SIG_UNKNOWN 0          /* Exception that has no matching unix signal */
 
 #include <cthreads.h>
 
@@ -113,29 +114,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define CPROC_CONDWAIT 4
 
 /* For cproc and kernel thread mapping */
-typedef struct gdb_thread {
-  mach_port_t  name;
-  CORE_ADDR    sp;
-  CORE_ADDR    pc;
-  CORE_ADDR    fp;
-  boolean_t     in_emulator;
-  int          slotid;
-
-  /* This is for the mthreads list.  It points to the cproc list.
-     Perhaps the two lists should be merged (or perhaps it was a mistake
-     to make them both use a struct gdb_thread).  */
-  struct gdb_thread *cproc;
-
-  /* These are for the cproc list, which is linked through the next field
-     of the struct gdb_thread.  */
-  char raw_cproc[CPROC_SIZE];
-  /* The cthread which is pointed to by the incarnation field from the
-     cproc.  This points to the copy we've read into GDB.  */
-  cthread_t cthread;
-  /* Point back to the mthreads list.  */
-  int reverse_map;
-  struct gdb_thread *next;
-} *gdb_thread_t;
+typedef struct gdb_thread
+  {
+    mach_port_t name;
+    CORE_ADDR sp;
+    CORE_ADDR pc;
+    CORE_ADDR fp;
+    boolean_t in_emulator;
+    int slotid;
+
+    /* This is for the mthreads list.  It points to the cproc list.
+       Perhaps the two lists should be merged (or perhaps it was a mistake
+       to make them both use a struct gdb_thread).  */
+    struct gdb_thread *cproc;
+
+    /* These are for the cproc list, which is linked through the next field
+       of the struct gdb_thread.  */
+    char raw_cproc[CPROC_SIZE];
+    /* The cthread which is pointed to by the incarnation field from the
+       cproc.  This points to the copy we've read into GDB.  */
+    cthread_t cthread;
+    /* Point back to the mthreads list.  */
+    int reverse_map;
+    struct gdb_thread *next;
+  }
+ *gdb_thread_t;
 
 /* 
  * Actions for Mach exceptions.
@@ -146,23 +149,46 @@ typedef struct gdb_thread {
  * if SIG_UNKNOWN is specified.
  */
 
-struct exception_list {
-  char *name;
-  boolean_t forward;
-  boolean_t print;
-  int       sigmap;
-} exception_map[] = {
-  {"not_mach3_exception",      FALSE, TRUE,  SIG_UNKNOWN},
-  {"EXC_BAD_ACCESS",           FALSE, TRUE,  SIGSEGV},
-  {"EXC_BAD_INSTRUCTION",      FALSE, TRUE,  SIGILL},
-  {"EXC_ARITHMETIC",           FALSE, TRUE,  SIGFPE},
-  {"EXC_EMULATION",            FALSE, TRUE,  SIGEMT},  /* ??? */
-  {"EXC_SOFTWARE",             FALSE, TRUE,  SIG_UNKNOWN},
-  {"EXC_BREAKPOINT",           FALSE, FALSE, SIGTRAP}
+struct exception_list
+  {
+    char *name;
+    boolean_t forward;
+    boolean_t print;
+    int sigmap;
+  }
+exception_map[] =
+{
+  {
+    "not_mach3_exception", FALSE, TRUE, SIG_UNKNOWN
+  }
+  ,
+  {
+    "EXC_BAD_ACCESS", FALSE, TRUE, SIGSEGV
+  }
+  ,
+  {
+    "EXC_BAD_INSTRUCTION", FALSE, TRUE, SIGILL
+  }
+  ,
+  {
+    "EXC_ARITHMETIC", FALSE, TRUE, SIGFPE
+  }
+  ,
+  {
+    "EXC_EMULATION", FALSE, TRUE, SIGEMT
+  }
+  ,                            /* ??? */
+  {
+    "EXC_SOFTWARE", FALSE, TRUE, SIG_UNKNOWN
+  }
+  ,
+  {
+    "EXC_BREAKPOINT", FALSE, FALSE, SIGTRAP
+  }
 };
 
 /* Mach exception table size */
-int max_exception = sizeof(exception_map)/sizeof(struct exception_list) - 1;
+int max_exception = sizeof (exception_map) / sizeof (struct exception_list) - 1;
 
 #define MAX_EXCEPTION max_exception
 
@@ -172,7 +198,7 @@ WAITTYPE wait_status;
  * dumped while waiting the inferior to EXEC the correct
  * program
  */
-/* #define DUMP_SYSCALL                /* debugging interceptor */
+/* #define DUMP_SYSCALL         /* debugging interceptor */
 
 /* xx_debug() outputs messages if this is nonzero.
  * If > 1, DUMP_SYSCALL will dump message contents.
@@ -181,16 +207,16 @@ int debug_level = 0;
 
 /* "Temporary" debug stuff */
 void
-xx_debug (fmt, a,b,c)
-char *fmt;
-int a,b,c;
+xx_debug (fmt, a, b, c)
+     char *fmt;
+     int a, b, c;
 {
   if (debug_level)
     warning (fmt, a, b, c);
 }
 
 /* This is in libmach.a */
-extern  mach_port_t  name_server_port;
+extern mach_port_t name_server_port;
 
 /* Set in catch_exception_raise */
 int stop_exception, stop_code, stop_subcode;
@@ -204,23 +230,23 @@ char *hostname = "";
 /* Set when task is attached or created */
 boolean_t emulator_present = FALSE;
 
-task_t   inferior_task;
+task_t inferior_task;
 thread_t current_thread;
 
 /* Exception ports for inferior task */
-mach_port_t inferior_exception_port     = MACH_PORT_NULL;
+mach_port_t inferior_exception_port = MACH_PORT_NULL;
 mach_port_t inferior_old_exception_port = MACH_PORT_NULL;
 
 /* task exceptions and notifications */
-mach_port_t inferior_wait_port_set     = MACH_PORT_NULL;
-mach_port_t our_notify_port            = MACH_PORT_NULL;
+mach_port_t inferior_wait_port_set = MACH_PORT_NULL;
+mach_port_t our_notify_port = MACH_PORT_NULL;
 
 /* This is "inferior_wait_port_set" when not single stepping, and
  *         "singlestepped_thread_port" when we are single stepping.
  * 
  * This is protected by a cleanup function: discard_single_step()
  */
-mach_port_t currently_waiting_for      = MACH_PORT_NULL;
+mach_port_t currently_waiting_for = MACH_PORT_NULL;
 
 /* A port for external messages to gdb.
  * External in the meaning that they do not come
@@ -235,16 +261,16 @@ mach_port_t currently_waiting_for = MACH_PORT_NULL;
  *    (top-gdb) set stop_inferior_gdb ()
  *    (top-gdb) continue
  */
-mach_port_t our_message_port           = MACH_PORT_NULL;
+mach_port_t our_message_port = MACH_PORT_NULL;
 
 /* For single stepping */
-mach_port_t thread_exception_port      = MACH_PORT_NULL;
+mach_port_t thread_exception_port = MACH_PORT_NULL;
 mach_port_t thread_saved_exception_port = MACH_PORT_NULL;
-mach_port_t singlestepped_thread_port   = MACH_PORT_NULL;
+mach_port_t singlestepped_thread_port = MACH_PORT_NULL;
 
 /* For machid calls */
 mach_port_t mid_server = MACH_PORT_NULL;
-mach_port_t mid_auth   = MACH_PORT_NULL;
+mach_port_t mid_auth = MACH_PORT_NULL;
 
 /* If gdb thinks the inferior task is not suspended, it
  * must take suspend/abort the threads when it reads the state.
@@ -258,8 +284,8 @@ int must_suspend_thread = 0;
  */
 #define NULL_CLEANUP (struct cleanup *)0
 struct cleanup *cleanup_step = NULL_CLEANUP;
-
 \f
+
 static struct target_ops m3_ops;
 
 static void m3_kill_inferior ();
@@ -270,13 +296,14 @@ static void m3_kill_inferior ();
 
 /* Chain of ports to remember requested notifications. */
 
-struct port_chain {
-  struct port_chain *next;
-  mach_port_t       port;
-  int               type;
-  int               mid;  /* Now only valid with MACH_TYPE_THREAD and */
-                          /*  MACH_TYPE_THREAD */
-};
+struct port_chain
+  {
+    struct port_chain *next;
+    mach_port_t port;
+    int type;
+    int mid;                   /* Now only valid with MACH_TYPE_THREAD and */
+    /*  MACH_TYPE_THREAD */
+  };
 typedef struct port_chain *port_chain_t;
 
 /* Room for chain nodes comes from pchain_obstack */
@@ -294,18 +321,18 @@ port_chain_t
 port_chain_insert (list, name, type)
      port_chain_t list;
      mach_port_t name;
-     int        type;
+     int type;
 {
   kern_return_t ret;
   port_chain_t new;
   int mid;
 
-  if (! MACH_PORT_VALID (name))
+  if (!MACH_PORT_VALID (name))
     return list;
-  
+
   if (type == MACH_TYPE_TASK || type == MACH_TYPE_THREAD)
     {
-      if (! MACH_PORT_VALID (mid_server))
+      if (!MACH_PORT_VALID (mid_server))
        {
          warning ("Machid server port invalid, can not map port 0x%x to MID",
                   name);
@@ -314,7 +341,7 @@ port_chain_insert (list, name, type)
       else
        {
          ret = machid_mach_register (mid_server, mid_auth, name, type, &mid);
-         
+
          if (ret != KERN_SUCCESS)
            {
              warning ("Can not map name (0x%x) to MID with machid", name);
@@ -327,10 +354,10 @@ port_chain_insert (list, name, type)
 
   new = (port_chain_t) obstack_alloc (port_chain_obstack,
                                      sizeof (struct port_chain));
-  new->next  = list;
-  new->port  = name;
-  new->type  = type;
-  new->mid   = mid;
+  new->next = list;
+  new->port = name;
+  new->type = type;
+  new->mid = mid;
 
   return new;
 }
@@ -347,7 +374,7 @@ port_chain_delete (list, elem)
       while (list->next)
        {
          if (list->next->port == elem)
-           list->next = list->next->next; /* GCd with obstack_free() */
+           list->next = list->next->next;      /* GCd with obstack_free() */
          else
            list = list->next;
        }
@@ -378,8 +405,8 @@ port_chain_member (list, elem)
 \f
 int
 map_port_name_to_mid (name, type)
-mach_port_t name;
-int         type;
+     mach_port_t name;
+     int type;
 {
   port_chain_t elem;
 
@@ -390,11 +417,11 @@ int         type;
 
   if (elem && (elem->type == type))
     return elem->mid;
-  
+
   if (elem)
     return -1;
-  
-  if (! MACH_PORT_VALID (mid_server))
+
+  if (!MACH_PORT_VALID (mid_server))
     {
       warning ("Machid server port invalid, can not map port 0x%x to mid",
               name);
@@ -406,7 +433,7 @@ int         type;
       kern_return_t ret;
 
       ret = machid_mach_register (mid_server, mid_auth, name, type, &mid);
-      
+
       if (ret != KERN_SUCCESS)
        {
          warning ("Can not map name (0x%x) to mid with machid", name);
@@ -429,12 +456,12 @@ discard_single_step (thread)
 }
 
 setup_single_step (thread, start_step)
-     thread_t  thread;
+     thread_t thread;
      boolean_t start_step;
 {
   kern_return_t ret;
 
-  if (! MACH_PORT_VALID (thread))
+  if (!MACH_PORT_VALID (thread))
     error ("Invalid thread supplied to setup_single_step");
   else
     {
@@ -443,7 +470,7 @@ setup_single_step (thread, start_step)
       /* Get the current thread exception port */
       ret = thread_get_exception_port (thread, &teport);
       CHK ("Getting thread's exception port", ret);
-         
+
       if (start_step)
        {
          if (MACH_PORT_VALID (singlestepped_thread_port))
@@ -452,7 +479,7 @@ setup_single_step (thread, start_step)
                       singlestepped_thread_port);
              singlestepped_thread_port = MACH_PORT_NULL;
            }
-      
+
          /* If we are already stepping this thread */
          if (MACH_PORT_VALID (teport) && teport == thread_exception_port)
            {
@@ -465,7 +492,7 @@ setup_single_step (thread, start_step)
              CHK ("Setting exception port for thread", ret);
 #if 0
              /* Insert thread exception port to wait port set */
-             ret = mach_port_move_member (mach_task_self(), 
+             ret = mach_port_move_member (mach_task_self (),
                                           thread_exception_port,
                                           inferior_wait_port_set);
              CHK ("Moving thread exception port to inferior_wait_port_set",
@@ -473,42 +500,42 @@ setup_single_step (thread, start_step)
 #endif
              thread_saved_exception_port = teport;
            }
-         
+
          thread_trace (thread, TRUE);
-         
-         singlestepped_thread_port   = thread_exception_port;
-         currently_waiting_for       = singlestepped_thread_port;
+
+         singlestepped_thread_port = thread_exception_port;
+         currently_waiting_for = singlestepped_thread_port;
          cleanup_step = make_cleanup (discard_single_step, thread);
        }
       else
        {
-         if (! MACH_PORT_VALID (teport))
+         if (!MACH_PORT_VALID (teport))
            error ("Single stepped thread had an invalid exception port?");
 
          if (teport != thread_exception_port)
            error ("Single stepped thread had an unknown exception port?");
-         
+
          ret = mach_port_deallocate (mach_task_self (), teport);
          CHK ("Couldn't deallocate thread exception port", ret);
 #if 0
          /* Remove thread exception port from wait port set */
-         ret = mach_port_move_member (mach_task_self(), 
+         ret = mach_port_move_member (mach_task_self (),
                                       thread_exception_port,
                                       MACH_PORT_NULL);
          CHK ("Removing thread exception port from inferior_wait_port_set",
               ret);
-#endif   
+#endif
          /* Restore thread's old exception port */
          ret = thread_set_exception_port (thread,
                                           thread_saved_exception_port);
          CHK ("Restoring stepped thread's exception port", ret);
-         
+
          if (MACH_PORT_VALID (thread_saved_exception_port))
            (void) mach_port_deallocate (mach_task_self (),
                                         thread_saved_exception_port);
-         
+
          thread_trace (thread, FALSE);
-         
+
          singlestepped_thread_port = MACH_PORT_NULL;
          currently_waiting_for = inferior_wait_port_set;
          if (cleanup_step)
@@ -519,20 +546,20 @@ setup_single_step (thread, start_step)
 \f
 static
 request_notify (name, variant, type)
-     mach_port_t       name;
-     mach_msg_id_t     variant;
-     int               type;
+     mach_port_t name;
+     mach_msg_id_t variant;
+     int type;
 {
   kern_return_t ret;
-  mach_port_t  previous_port_dummy = MACH_PORT_NULL;
-  
-  if (! MACH_PORT_VALID (name))
+  mach_port_t previous_port_dummy = MACH_PORT_NULL;
+
+  if (!MACH_PORT_VALID (name))
     return;
-  
+
   if (port_chain_member (notify_chain, name))
     return;
 
-  ret = mach_port_request_notification (mach_task_self(),
+  ret = mach_port_request_notification (mach_task_self (),
                                        name,
                                        variant,
                                        1,
@@ -547,22 +574,22 @@ request_notify (name, variant, type)
   notify_chain = port_chain_insert (notify_chain, name, type);
 }
 
-reverse_msg_bits(msgp, type)
-     mach_msg_header_t *msgp;
+reverse_msg_bits (msgp, type)
+     mach_msg_header_t *msgp;
      int type;
 {
-  int          rbits,lbits;
-  rbits = MACH_MSGH_BITS_REMOTE(msgp->msgh_bits);
+  int rbits, lbits;
+  rbits = MACH_MSGH_BITS_REMOTE (msgp->msgh_bits);
   lbits = type;
   msgp->msgh_bits =
     (msgp->msgh_bits & ~MACH_MSGH_BITS_PORTS_MASK) |
-      MACH_MSGH_BITS(lbits,rbits);
+    MACH_MSGH_BITS (lbits, rbits);
 }
 \f
 /* On the third day He said:
 
-       Let this be global
-       and then it was global.
+   Let this be global
+   and then it was global.
 
    When creating the inferior fork, the
    child code in inflow.c sets the name of the
@@ -588,7 +615,7 @@ static void
 m3_trace_me ()
 {
   kern_return_t ret;
-  
+
   /* Get the NAME of the bootstrap port in this task
      so that GDB can read it */
   ret = task_get_bootstrap_port (mach_task_self (),
@@ -599,7 +626,7 @@ m3_trace_me ()
                              original_server_port_name);
   if (ret != KERN_SUCCESS)
     abort ();
-  
+
   /* Suspend this task to let the parent change my ports.
      Resumed by the debugger */
   ret = task_suspend (mach_task_self ());
@@ -621,11 +648,12 @@ intercept_exec_calls (exec_counter)
 {
   int terminal_initted = 0;
 
-  struct syscall_msg_t {
-    mach_msg_header_t  header;
-    mach_msg_type_t    type;
-    char room[ 2000 ]; /* Enuff space */
-  };
+  struct syscall_msg_t
+    {
+      mach_msg_header_t header;
+      mach_msg_type_t type;
+      char room[2000];         /* Enuff space */
+    };
 
   struct syscall_msg_t syscall_in, syscall_out;
 
@@ -642,20 +670,20 @@ intercept_exec_calls (exec_counter)
   kern_return_t ret;
 
   if (exec_counter <= 0)
-    return;            /* We are already set up in the correct program */
+    return;                    /* We are already set up in the correct program */
+
+  ret = mach_port_allocate (mach_task_self (),
+                           MACH_PORT_RIGHT_RECEIVE,
+                           &fake_server);
+  CHK ("create inferior_fake_server port failed", ret);
 
-  ret = mach_port_allocate(mach_task_self(), 
-                          MACH_PORT_RIGHT_RECEIVE,
-                          &fake_server);
-  CHK("create inferior_fake_server port failed", ret);
-  
   /* Wait for inferior_task to suspend itself */
-  while(1)
+  while (1)
     {
       info_count = sizeof (info);
       ret = task_info (inferior_task,
                       TASK_BASIC_INFO,
-                      (task_info_t)&info,
+                      (task_info_t) & info,
                       &info_count);
       CHK ("Task info", ret);
 
@@ -665,7 +693,7 @@ intercept_exec_calls (exec_counter)
       /* Note that the definition of the parameter was undefined
        * at the time of this writing, so I just use an `ad hoc' value.
        */
-      (void) swtch_pri (42); /* Universal Priority Value */
+      (void) swtch_pri (42);   /* Universal Priority Value */
     }
 
   /* Read the inferior's bootstrap port name */
@@ -682,62 +710,62 @@ intercept_exec_calls (exec_counter)
                                 MACH_MSG_TYPE_MOVE_SEND,
                                 &original_server_send,
                                 &acquired);
-  CHK("mach_port_extract_right (bsd server send)",ret);
-  
+  CHK ("mach_port_extract_right (bsd server send)", ret);
+
   if (acquired != MACH_MSG_TYPE_PORT_SEND)
-    error("Incorrect right extracted, send right to bsd server excpected");
+    error ("Incorrect right extracted, send right to bsd server excpected");
 
   ret = mach_port_insert_right (inferior_task,
                                original_server_port_name,
                                fake_server,
                                MACH_MSG_TYPE_MAKE_SEND);
-  CHK("mach_port_insert_right (fake server send)",ret);
+  CHK ("mach_port_insert_right (fake server send)", ret);
 
   xx_debug ("inferior task bsd server ports set up \nfs %x, ospn %x, oss %x\n",
            fake_server,
            original_server_port_name, original_server_send);
 
   /* A receive right to the reply generated by unix server exec() request */
-  ret = mach_port_allocate(mach_task_self(), 
-                          MACH_PORT_RIGHT_RECEIVE,
-                          &exec_reply);
-  CHK("create intercepted_reply_port port failed", ret);
-    
+  ret = mach_port_allocate (mach_task_self (),
+                           MACH_PORT_RIGHT_RECEIVE,
+                           &exec_reply);
+  CHK ("create intercepted_reply_port port failed", ret);
+
   /* Pass this send right to Unix server so it replies to us after exec() */
   ret = mach_port_extract_right (mach_task_self (),
                                 exec_reply,
                                 MACH_MSG_TYPE_MAKE_SEND_ONCE,
                                 &exec_reply_send,
                                 &acquired);
-  CHK("mach_port_extract_right (exec_reply)",ret);
+  CHK ("mach_port_extract_right (exec_reply)", ret);
 
   if (acquired != MACH_MSG_TYPE_PORT_SEND_ONCE)
-    error("Incorrect right extracted, send once excpected for exec reply");
+    error ("Incorrect right extracted, send once excpected for exec reply");
 
-  ret = mach_port_move_member(mach_task_self(), 
-                             fake_server,
-                             inferior_wait_port_set);
+  ret = mach_port_move_member (mach_task_self (),
+                              fake_server,
+                              inferior_wait_port_set);
   CHK ("Moving fake syscall port to inferior_wait_port_set", ret);
 
   xx_debug ("syscall fake server set up, resuming inferior\n");
-  
+
   ret = task_resume (inferior_task);
-  CHK("task_resume (startup)", ret);
-       
+  CHK ("task_resume (startup)", ret);
+
   /* Read requests from the inferior.
      Pass directly through everything else except exec() calls.
    */
-  while(exec_counter > 0)
+  while (exec_counter > 0)
     {
       ret = mach_msg (&syscall_in.header,      /* header */
-                     MACH_RCV_MSG,             /* options */
-                     0,                        /* send size */
-                     sizeof (struct syscall_msg_t), /* receive size */
-                     inferior_wait_port_set,        /* receive_name */
+                     MACH_RCV_MSG,     /* options */
+                     0,        /* send size */
+                     sizeof (struct syscall_msg_t),    /* receive size */
+                     inferior_wait_port_set,   /* receive_name */
                      MACH_MSG_TIMEOUT_NONE,
                      MACH_PORT_NULL);
-      CHK("mach_msg (intercepted sycall)", ret);
-           
+      CHK ("mach_msg (intercepted sycall)", ret);
+
 #ifdef DUMP_SYSCALL
       print_msg (&syscall_in.header);
 #endif
@@ -759,11 +787,11 @@ intercept_exec_calls (exec_counter)
          if (!terminal_initted)
            {
              /* Now that the child has exec'd we know it has already set its
-                process group.  On POSIX systems, tcsetpgrp will fail with
-                EPERM if we try it before the child's setpgid.  */
+                process group.  On POSIX systems, tcsetpgrp will fail with
+                EPERM if we try it before the child's setpgid.  */
 
              /* Set up the "saved terminal modes" of the inferior
-                based on what modes we are starting it with.  */
+                based on what modes we are starting it with.  */
              target_terminal_init ();
 
              /* Install inferior's terminal modes.  */
@@ -774,34 +802,34 @@ intercept_exec_calls (exec_counter)
 
          exec_counter--;
        }
-           
-      syscall_in.header.msgh_local_port  = syscall_in.header.msgh_remote_port;
+
+      syscall_in.header.msgh_local_port = syscall_in.header.msgh_remote_port;
       syscall_in.header.msgh_remote_port = original_server_send;
 
-      reverse_msg_bits(&syscall_in.header, MACH_MSG_TYPE_COPY_SEND);
+      reverse_msg_bits (&syscall_in.header, MACH_MSG_TYPE_COPY_SEND);
 
       ret = mach_msg_send (&syscall_in.header);
       CHK ("Forwarded syscall", ret);
     }
-       
-  ret = mach_port_move_member(mach_task_self(), 
-                             fake_server,
-                             MACH_PORT_NULL);
+
+  ret = mach_port_move_member (mach_task_self (),
+                              fake_server,
+                              MACH_PORT_NULL);
   CHK ("Moving fake syscall out of inferior_wait_port_set", ret);
 
-  ret = mach_port_move_member(mach_task_self(), 
-                             exec_reply,
-                             inferior_wait_port_set);
+  ret = mach_port_move_member (mach_task_self (),
+                              exec_reply,
+                              inferior_wait_port_set);
   CHK ("Moving exec_reply to inferior_wait_port_set", ret);
 
   ret = mach_msg (&syscall_in.header,  /* header */
-                 MACH_RCV_MSG,         /* options */
-                 0,                    /* send size */
+                 MACH_RCV_MSG, /* options */
+                 0,            /* send size */
                  sizeof (struct syscall_msg_t),        /* receive size */
-                 inferior_wait_port_set,               /* receive_name */
+                 inferior_wait_port_set,       /* receive_name */
                  MACH_MSG_TIMEOUT_NONE,
                  MACH_PORT_NULL);
-  CHK("mach_msg (exec reply)", ret);
+  CHK ("mach_msg (exec reply)", ret);
 
   ret = task_suspend (inferior_task);
   CHK ("Suspending inferior after last exec", ret);
@@ -811,7 +839,7 @@ intercept_exec_calls (exec_counter)
   xx_debug ("Received exec reply from bsd server, suspended inferior task\n");
 
 #ifdef DUMP_SYSCALL
-      print_msg (&syscall_in.header);
+  print_msg (&syscall_in.header);
 #endif
 
   /* Message should appear as if it came from the unix server */
@@ -820,7 +848,7 @@ intercept_exec_calls (exec_counter)
   /*  and go to the inferior task original reply port */
   syscall_in.header.msgh_remote_port = original_exec_reply;
 
-  reverse_msg_bits(&syscall_in.header, MACH_MSG_TYPE_MOVE_SEND_ONCE);
+  reverse_msg_bits (&syscall_in.header, MACH_MSG_TYPE_MOVE_SEND_ONCE);
 
   ret = mach_msg_send (&syscall_in.header);
   CHK ("Forwarding exec reply to inferior", ret);
@@ -839,12 +867,12 @@ intercept_exec_calls (exec_counter)
   ret = mach_port_destroy (mach_task_self (),
                           fake_server);
   fake_server = MACH_PORT_DEAD;
-  CHK("mach_port_destroy (fake_server)", ret);
+  CHK ("mach_port_destroy (fake_server)", ret);
 
   ret = mach_port_destroy (mach_task_self (),
                           exec_reply);
   exec_reply = MACH_PORT_DEAD;
-  CHK("mach_port_destroy (exec_reply)", ret);
+  CHK ("mach_port_destroy (exec_reply)", ret);
 
   xx_debug ("Done with exec call interception\n");
 }
@@ -852,7 +880,7 @@ intercept_exec_calls (exec_counter)
 void
 consume_send_rights (thread_list, thread_count)
      thread_array_t thread_list;
-     int            thread_count;
+     int thread_count;
 {
   int index;
 
@@ -863,7 +891,7 @@ consume_send_rights (thread_list, thread_count)
     {
       /* Since thread kill command kills threads, don't check ret */
       (void) mach_port_deallocate (mach_task_self (),
-                                  thread_list [ index ]);
+                                  thread_list[index]);
     }
 }
 
@@ -878,7 +906,7 @@ setup_thread (thread, what)
     {
       ret = thread_suspend (thread);
       CHK ("setup_thread thread_suspend", ret);
-      
+
       ret = thread_abort (thread);
       CHK ("setup_thread thread_abort", ret);
     }
@@ -900,34 +928,34 @@ map_slot_to_mid (slot, threads, thread_count)
   int index;
   int mid;
 
-  if (! threads)
+  if (!threads)
     {
       deallocate++;
       ret = task_threads (inferior_task, &threads, &thread_count);
       CHK ("Can not select a thread from a dead task", ret);
     }
-  
+
   if (slot < 0 || slot >= thread_count)
     {
       if (deallocate)
        {
          consume_send_rights (threads, thread_count);
-         (void) vm_deallocate (mach_task_self(), (vm_address_t)threads, 
-                               (thread_count * sizeof(mach_port_t)));
+         (void) vm_deallocate (mach_task_self (), (vm_address_t) threads,
+                               (thread_count * sizeof (mach_port_t)));
        }
       if (slot < 0)
        error ("invalid slot number");
       else
-       return -(slot+1);
+       return -(slot + 1);
     }
 
-  mid = map_port_name_to_mid (threads [slot], MACH_TYPE_THREAD);
+  mid = map_port_name_to_mid (threads[slot], MACH_TYPE_THREAD);
 
   if (deallocate)
     {
       consume_send_rights (threads, thread_count);
-      (void) vm_deallocate (mach_task_self(), (vm_address_t)threads, 
-                           (thread_count * sizeof(mach_port_t)));
+      (void) vm_deallocate (mach_task_self (), (vm_address_t) threads,
+                           (thread_count * sizeof (mach_port_t)));
     }
 
   return mid;
@@ -943,16 +971,16 @@ parse_thread_id (arg, thread_count, slots)
   int mid;
   int slot;
   int index;
-  
+
   if (arg == 0)
     return 0;
-  
+
   while (*arg && (*arg == ' ' || *arg == '\t'))
     arg++;
-  
-  if (! *arg)
+
+  if (!*arg)
     return 0;
-  
+
   /* Currently parse MID and @SLOTNUMBER */
   if (*arg != '@')
     {
@@ -961,7 +989,7 @@ parse_thread_id (arg, thread_count, slots)
        error ("valid thread mid expected");
       return mid;
     }
-  
+
   arg++;
   slot = atoi (arg);
 
@@ -969,19 +997,19 @@ parse_thread_id (arg, thread_count, slots)
     error ("invalid slot number");
 
   /* If you want slot numbers to remain slot numbers, set slots.
-   *
+
    * Well, since 0 is reserved, return the ordinal number
    * of the thread rather than the slot number. Awk, this
    * counts as a kludge.
    */
   if (slots)
-    return -(slot+1);
+    return -(slot + 1);
 
   if (thread_count && slot >= thread_count)
-    return -(slot+1);
+    return -(slot + 1);
 
   mid = map_slot_to_mid (slot);
-  
+
   return mid;
 }
 
@@ -1028,26 +1056,26 @@ select_thread (task, thread_id, flag)
       warning ("Task %d has no threads",
               map_port_name_to_mid (task, MACH_TYPE_TASK));
       current_thread = MACH_PORT_NULL;
-      (void) vm_deallocate(mach_task_self(),
-                          (vm_address_t) thread_list,
-                          (thread_count * sizeof(mach_port_t)));
+      (void) vm_deallocate (mach_task_self (),
+                           (vm_address_t) thread_list,
+                           (thread_count * sizeof (mach_port_t)));
       return KERN_FAILURE;
     }
 
-  if (! thread_id || flag == 2)
+  if (!thread_id || flag == 2)
     {
       /* First thread or a slotnumber */
-      if (! thread_id)
+      if (!thread_id)
        new_thread = thread_list[0];
       else
        {
          if (thread_id < thread_count)
-           new_thread = thread_list[ thread_id ];
+           new_thread = thread_list[thread_id];
          else
            {
-             (void) vm_deallocate(mach_task_self(),
-                                  (vm_address_t) thread_list,
-                                  (thread_count * sizeof(mach_port_t)));
+             (void) vm_deallocate (mach_task_self (),
+                                   (vm_address_t) thread_list,
+                                   (thread_count * sizeof (mach_port_t)));
              error ("No such thread slot number : %d", thread_id);
            }
        }
@@ -1055,27 +1083,27 @@ select_thread (task, thread_id, flag)
   else
     {
       for (index = 0; index < thread_count; index++)
-       if (thread_id == map_port_name_to_mid (thread_list [index],
+       if (thread_id == map_port_name_to_mid (thread_list[index],
                                               MACH_TYPE_THREAD))
          {
-           new_thread = thread_list [index];
+           new_thread = thread_list[index];
            index = -1;
            break;
          }
-      
+
       if (index != -1)
        error ("No thread with mid %d", thread_id);
     }
-  
+
   /* Notify when the selected thread dies */
   request_notify (new_thread, MACH_NOTIFY_DEAD_NAME, MACH_TYPE_THREAD);
-  
-  ret = vm_deallocate(mach_task_self(),
-                     (vm_address_t) thread_list,
-                     (thread_count * sizeof(mach_port_t)));
+
+  ret = vm_deallocate (mach_task_self (),
+                      (vm_address_t) thread_list,
+                      (thread_count * sizeof (mach_port_t)));
   CHK ("vm_deallocate", ret);
-  
-  if (! flag)
+
+  if (!flag)
     current_thread = new_thread;
   else
     {
@@ -1083,7 +1111,7 @@ select_thread (task, thread_id, flag)
       if (MACH_PORT_VALID (current_thread))
        {
          /* Store the gdb's view of the thread we are deselecting
-          *
+
           * @@ I think gdb updates registers immediately when they are
           * changed, so don't do this.
           */
@@ -1102,7 +1130,7 @@ select_thread (task, thread_id, flag)
       ret = thread_abort (current_thread);
       CHK ("Could not abort system calls when selecting a thread", ret);
 
-      stop_pc = read_pc();
+      stop_pc = read_pc ();
       flush_cached_frames ();
 
       select_frame (get_current_frame (), 0);
@@ -1132,7 +1160,7 @@ switch_to_thread (new_thread)
        current_thread = saved_thread;
       error ("Could not select thread %d", mid);
     }
-       
+
   return mid;
 }
 
@@ -1149,7 +1177,7 @@ m3_trace_him (pid)
 
   inferior_task = task_by_pid (pid);
 
-  if (! MACH_PORT_VALID (inferior_task))
+  if (!MACH_PORT_VALID (inferior_task))
     error ("Can not map Unix pid %d to Mach task", pid);
 
   /* Clean up previous notifications and create new ones */
@@ -1182,36 +1210,36 @@ setup_exception_port ()
 {
   kern_return_t ret;
 
-  ret = mach_port_allocate (mach_task_self(), 
+  ret = mach_port_allocate (mach_task_self (),
                            MACH_PORT_RIGHT_RECEIVE,
                            &inferior_exception_port);
-  CHK("mach_port_allocate",ret);
+  CHK ("mach_port_allocate", ret);
 
   /* add send right */
   ret = mach_port_insert_right (mach_task_self (),
                                inferior_exception_port,
                                inferior_exception_port,
                                MACH_MSG_TYPE_MAKE_SEND);
-  CHK("mach_port_insert_right",ret);
+  CHK ("mach_port_insert_right", ret);
 
-  ret = mach_port_move_member (mach_task_self(), 
+  ret = mach_port_move_member (mach_task_self (),
                               inferior_exception_port,
                               inferior_wait_port_set);
-  CHK("mach_port_move_member",ret);
+  CHK ("mach_port_move_member", ret);
 
-  ret = task_get_special_port (inferior_task, 
+  ret = task_get_special_port (inferior_task,
                               TASK_EXCEPTION_PORT,
                               &inferior_old_exception_port);
-  CHK ("task_get_special_port(old exc)",ret);
+  CHK ("task_get_special_port(old exc)", ret);
 
   ret = task_set_special_port (inferior_task,
-                              TASK_EXCEPTION_PORT, 
+                              TASK_EXCEPTION_PORT,
                               inferior_exception_port);
-  CHK("task_set_special_port",ret);
+  CHK ("task_set_special_port", ret);
 
   ret = mach_port_deallocate (mach_task_self (),
                              inferior_exception_port);
-  CHK("mack_port_deallocate",ret);
+  CHK ("mack_port_deallocate", ret);
 
 #if 0
   /* When notify appears, the inferior_task's exception
@@ -1233,7 +1261,7 @@ int mach_really_waiting;
 /* Wait for the inferior to stop for some reason.
    - Loop on notifications until inferior_task dies.
    - Loop on exceptions until stopped_in_exception comes true.
-     (e.g. we receive a single step trace trap)
+   (e.g. we receive a single step trace trap)
    - a message arrives to gdb's message port
 
    There is no other way to exit this loop.
@@ -1248,11 +1276,13 @@ mach_really_wait (pid, ourstatus)
   kern_return_t ret;
   int w;
 
-  struct msg {
-    mach_msg_header_t    header;
-    mach_msg_type_t foo;
-    int             data[8000];
-  } in_msg, out_msg;
+  struct msg
+    {
+      mach_msg_header_t header;
+      mach_msg_type_t foo;
+      int data[8000];
+    }
+  in_msg, out_msg;
 
   /* Either notify (death), exception or message can stop the inferior */
   stopped_in_exception = FALSE;
@@ -1265,15 +1295,15 @@ mach_really_wait (pid, ourstatus)
       stop_thread = MACH_PORT_NULL;
 
       mach_really_waiting = 1;
-      ret = mach_msg (&in_msg.header,          /* header */
-                     MACH_RCV_MSG,             /* options */
-                     0,                        /* send size */
+      ret = mach_msg (&in_msg.header,  /* header */
+                     MACH_RCV_MSG,     /* options */
+                     0,        /* send size */
                      sizeof (struct msg),      /* receive size */
                      currently_waiting_for,    /* receive name */
                      MACH_MSG_TIMEOUT_NONE,
                      MACH_PORT_NULL);
       mach_really_waiting = 0;
-      CHK("mach_msg (receive)", ret);
+      CHK ("mach_msg (receive)", ret);
 
       /* Check if we received a notify of the childs' death */
       if (notify_server (&in_msg.header, &out_msg.header))
@@ -1288,7 +1318,7 @@ mach_really_wait (pid, ourstatus)
            {
              /* Collect Unix exit status for gdb */
 
-             wait3(&w, WNOHANG, 0);
+             wait3 (&w, WNOHANG, 0);
 
              /* This mess is here to check that the rest of
               * gdb knows that the inferior died. It also
@@ -1297,22 +1327,22 @@ mach_really_wait (pid, ourstatus)
               * has happened to it's children when mach-magic
               * is applied on them.
               */
-             if ((!WIFEXITED(w) && WIFSTOPPED(w))         ||
-                 (WIFEXITED(w)  && WEXITSTATUS(w) > 0377))
+             if ((!WIFEXITED (w) && WIFSTOPPED (w)) ||
+                 (WIFEXITED (w) && WEXITSTATUS (w) > 0377))
                {
-                 WSETEXIT(w, 0);
+                 WSETEXIT (w, 0);
                  warning ("Using exit value 0 for terminated task");
                }
-             else if (!WIFEXITED(w))
+             else if (!WIFEXITED (w))
                {
-                 int sig = WTERMSIG(w);
+                 int sig = WTERMSIG (w);
 
                  /* Signals cause problems. Warn the user. */
-                 if (sig != SIGKILL) /* Bad luck if garbage matches this */
+                 if (sig != SIGKILL)   /* Bad luck if garbage matches this */
                    warning ("The terminating signal stuff may be nonsense");
                  else if (sig > NSIG)
                    {
-                     WSETEXIT(w, 0);
+                     WSETEXIT (w, 0);
                      warning ("Using exit value 0 for terminated task");
                    }
                }
@@ -1322,15 +1352,15 @@ mach_really_wait (pid, ourstatus)
        }
 
       /* Hmm. Check for exception, as it was not a notification.
-        exc_server() does an upcall to catch_exception_raise()
-        if this rpc is an exception. Further actions are decided
-        there.
+         exc_server() does an upcall to catch_exception_raise()
+         if this rpc is an exception. Further actions are decided
+         there.
        */
-      if (! exc_server (&in_msg.header, &out_msg.header))
+      if (!exc_server (&in_msg.header, &out_msg.header))
        {
 
          /* Not an exception, check for message.
-          *
+
           * Messages don't come from the inferior, or if they
           * do they better be asynchronous or it will hang.
           */
@@ -1343,11 +1373,11 @@ mach_really_wait (pid, ourstatus)
       /* Send the reply of the exception rpc to the suspended task */
       ret = mach_msg_send (&out_msg.header);
       CHK ("mach_msg_send (exc reply)", ret);
-      
+
       if (stopped_in_exception)
        {
          /* Get unix state. May be changed in mach3_exception_actions() */
-         wait3(&w, WNOHANG, 0);
+         wait3 (&w, WNOHANG, 0);
 
          mach3_exception_actions (&w, FALSE, "Task");
 
@@ -1365,11 +1395,11 @@ mach3_quit ()
 {
   int mid;
   kern_return_t ret;
-  
+
   if (mach_really_waiting)
     {
       ret = task_suspend (inferior_task);
-      
+
       if (ret != KERN_SUCCESS)
        {
          warning ("Could not suspend task for interrupt: %s",
@@ -1389,7 +1419,7 @@ mach3_quit ()
       mid = 0;
     }
 
-  current_thread = MACH_PORT_NULL; /* Force setup */
+  current_thread = MACH_PORT_NULL;     /* Force setup */
   select_thread (inferior_task, mid, 1);
 
   return;
@@ -1409,7 +1439,7 @@ mach3_request_quit ()
 {
   if (mach_really_waiting)
     immediate_quit = 1;
-}      
+}
 #endif
 
 /*
@@ -1427,23 +1457,24 @@ gdb_message_server (InP)
   if (InP->msgh_local_port == our_message_port)
     {
       /* A message coming to our_message_port. Check validity */
-      switch (InP->msgh_id) {
+      switch (InP->msgh_id)
+       {
 
-      case GDB_MESSAGE_ID_STOP:
-       ret = task_suspend (inferior_task);
-       if (ret != KERN_SUCCESS)
-         warning ("Could not suspend task for stop message: %s",
-                  mach_error_string (ret));
+       case GDB_MESSAGE_ID_STOP:
+         ret = task_suspend (inferior_task);
+         if (ret != KERN_SUCCESS)
+           warning ("Could not suspend task for stop message: %s",
+                    mach_error_string (ret));
 
-       /* QUIT in mach_really_wait() loop. */
-       request_quit (0);
-       break;
+         /* QUIT in mach_really_wait() loop. */
+         request_quit (0);
+         break;
 
-      default:
-       warning ("Invalid message id %d received, ignored.",
-                InP->msgh_id);
-       break;
-      }
+       default:
+         warning ("Invalid message id %d received, ignored.",
+                  InP->msgh_id);
+         break;
+       }
 
       return 1;
     }
@@ -1453,7 +1484,7 @@ gdb_message_server (InP)
 }
 
 /* NOTE: This is not an RPC call. It is a simpleroutine.
- *
+
  * This is not called from this gdb code.
  *
  * It may be called by another debugger to cause this
@@ -1470,29 +1501,31 @@ stop_inferior_gdb ()
   kern_return_t ret;
 
   /* Code generated by mig, with minor cleanups :-)
-   *
+
    * simpleroutine stop_inferior_gdb (our_message_port : mach_port_t);
    */
 
-  typedef struct {
-    mach_msg_header_t Head;
-  } Request;
+  typedef struct
+    {
+      mach_msg_header_t Head;
+    }
+  Request;
 
   Request Mess;
 
   register Request *InP = &Mess;
 
-  InP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
+  InP->Head.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0);
 
   /* msgh_size passed as argument */
   InP->Head.msgh_remote_port = our_message_port;
-  InP->Head.msgh_local_port  = MACH_PORT_NULL;
-  InP->Head.msgh_seqno       = 0;
-  InP->Head.msgh_id          = GDB_MESSAGE_ID_STOP;
+  InP->Head.msgh_local_port = MACH_PORT_NULL;
+  InP->Head.msgh_seqno = 0;
+  InP->Head.msgh_id = GDB_MESSAGE_ID_STOP;
 
   ret = mach_msg (&InP->Head,
-                 MACH_SEND_MSG|MACH_MSG_OPTION_NONE,
-                 sizeof(Request),
+                 MACH_SEND_MSG | MACH_MSG_OPTION_NONE,
+                 sizeof (Request),
                  0,
                  MACH_PORT_NULL,
                  MACH_MSG_TIMEOUT_NONE,
@@ -1515,13 +1548,13 @@ mach_thread_for_breakpoint (mid)
 
   if (mid < 0)
     {
-      mid = map_slot_to_mid (-(mid+1), 0, 0);
+      mid = map_slot_to_mid (-(mid + 1), 0, 0);
       if (mid < 0)
        return 0;               /* Don't stop, no such slot */
     }
 
-  if (! mid || cmid == -1)
-    return 1;  /* stop */
+  if (!mid || cmid == -1)
+    return 1;                  /* stop */
 
   return cmid == mid && stop_exception == EXC_BREAKPOINT;
 }
@@ -1560,12 +1593,12 @@ char *
 mach_thread_output_id (mid)
      int mid;
 {
-  static char foobar [20];
+  static char foobar[20];
 
   if (mid > 0)
     sprintf (foobar, "mid %d", mid);
   else if (mid < 0)
-    sprintf (foobar, "@%d", -(mid+1));
+    sprintf (foobar, "@%d", -(mid + 1));
   else
     sprintf (foobar, "*any thread*");
 
@@ -1574,7 +1607,7 @@ mach_thread_output_id (mid)
 #endif /* THREAD_OUTPUT_ID */
 
 /* Called with hook PREPARE_TO_PROCEED() from infrun.c.
- *
+
  * If we have switched threads and stopped at breakpoint return 1 otherwise 0.
  *
  *  if SELECT_IT is nonzero, reselect the thread that was active when
@@ -1591,7 +1624,7 @@ mach3_prepare_to_proceed (select_it)
     {
       int mid;
 
-      if (! select_it)
+      if (!select_it)
        return 1;
 
       mid = switch_to_thread (stop_thread);
@@ -1607,16 +1640,16 @@ mach3_prepare_to_proceed (select_it)
 
    The code will pass the exception to the inferior if:
 
-     - The task that signaled is not the inferior task
-       (e.g. when debugging another debugger)
+   - The task that signaled is not the inferior task
+   (e.g. when debugging another debugger)
 
-     - The user has explicitely requested to pass on the exceptions.
-       (e.g to the default unix exception handler, which maps
-       exceptions to signals, or the user has her own exception handler)
+   - The user has explicitely requested to pass on the exceptions.
+   (e.g to the default unix exception handler, which maps
+   exceptions to signals, or the user has her own exception handler)
 
-     - If the thread that signaled is being single-stepped and it
-       has set it's own exception port and the exception is not
-       EXC_BREAKPOINT. (Maybe this is not desirable?)
+   - If the thread that signaled is being single-stepped and it
+   has set it's own exception port and the exception is not
+   EXC_BREAKPOINT. (Maybe this is not desirable?)
  */
 
 kern_return_t
@@ -1630,10 +1663,10 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
   boolean_t signal_thread;
   int mid = map_port_name_to_mid (thread, MACH_TYPE_THREAD);
 
-  if (! MACH_PORT_VALID (thread))
+  if (!MACH_PORT_VALID (thread))
     {
       /* If the exception was sent and thread dies before we
-        receive it, THREAD will be MACH_PORT_DEAD
+         receive it, THREAD will be MACH_PORT_DEAD
        */
 
       current_thread = thread = MACH_PORT_NULL;
@@ -1643,7 +1676,7 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
   /* Check if the task died in transit.
    * @@ Isn't the thread also invalid in such case?
    */
-  if (! MACH_PORT_VALID (task))
+  if (!MACH_PORT_VALID (task))
     {
       current_thread = thread = MACH_PORT_NULL;
       error ("Received exception from nonexistent task");
@@ -1654,17 +1687,17 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
           exception,
           mid);
 
-  if (! MACH_PORT_VALID (inferior_task))
+  if (!MACH_PORT_VALID (inferior_task))
     error ("got an exception, but inferior_task is null or dead");
-  
+
   stop_exception = exception;
-  stop_code      = code;
-  stop_subcode   = subcode;  
-  stop_thread    = thread;
-  
-  signal_thread = exception != EXC_BREAKPOINT       &&
-                 port == singlestepped_thread_port &&
-                 MACH_PORT_VALID (thread_saved_exception_port);
+  stop_code = code;
+  stop_subcode = subcode;
+  stop_thread = thread;
+
+  signal_thread = exception != EXC_BREAKPOINT &&
+    port == singlestepped_thread_port &&
+    MACH_PORT_VALID (thread_saved_exception_port);
 
   /* If it was not our inferior or if we want to forward
    * the exception to the inferior's handler, do it here
@@ -1672,26 +1705,26 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
    * Note: If you have forwarded EXC_BREAKPOINT I trust you know why.
    */
   if (task != inferior_task ||
-      signal_thread         ||
-      exception_map [exception].forward)
+      signal_thread ||
+      exception_map[exception].forward)
     {
       mach_port_t eport = inferior_old_exception_port;
 
       if (signal_thread)
        {
          /*
-           GDB now forwards the exeption to thread's original handler,
-           since the user propably knows what he is doing.
-           Give a message, though.
+            GDB now forwards the exeption to thread's original handler,
+            since the user propably knows what he is doing.
+            Give a message, though.
           */
 
-         mach3_exception_actions ((WAITTYPE *)NULL, TRUE, "Thread");
+         mach3_exception_actions ((WAITTYPE *) NULL, TRUE, "Thread");
          eport = thread_saved_exception_port;
        }
 
       /* Send the exception to the original handler */
       ret = exception_raise (eport,
-                            thread, 
+                            thread,
                             task,
                             exception,
                             code,
@@ -1708,7 +1741,7 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
       /* Do not stop the inferior */
       return ret;
     }
-  
+
   /* Now gdb handles the exception */
   stopped_in_exception = TRUE;
 
@@ -1724,7 +1757,7 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
        error ("Exception from thread %d while singlestepping thread %d",
               mid,
               map_port_name_to_mid (current_thread, MACH_TYPE_THREAD));
-      
+
       /* Then select the thread that caused the exception */
       if (select_thread (inferior_task, mid, 0) != KERN_SUCCESS)
        error ("Could not select thread %d causing exception", mid);
@@ -1745,9 +1778,9 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
          /* Single step exception occurred, remove trace bit
           * and return to gdb.
           */
-         if (! MACH_PORT_VALID (current_thread))
+         if (!MACH_PORT_VALID (current_thread))
            error ("Single stepped thread is not valid");
-       
+
          /* Resume threads, but leave the task suspended */
          resume_all_threads (0);
        }
@@ -1756,7 +1789,7 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
 
       discard_single_step (current_thread);
     }
-  
+
   (void) mach_port_deallocate (mach_task_self (), task);
   (void) mach_port_deallocate (mach_task_self (), thread);
 
@@ -1765,8 +1798,8 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
 \f
 int
 port_valid (port, mask)
-  mach_port_t port;
-  int         mask;
+     mach_port_t port;
+     int mask;
 {
   kern_return_t ret;
   mach_port_type_t type;
@@ -1795,11 +1828,11 @@ mach3_read_inferior (addr, myaddr, length)
      int length;
 {
   kern_return_t ret;
-  vm_address_t low_address       = (vm_address_t) trunc_page (addr);
-  vm_size_t    aligned_length = 
-                       (vm_size_t) round_page (addr+length) - low_address;
-  pointer_t    copied_memory;
-  int         copy_count;
+  vm_address_t low_address = (vm_address_t) trunc_page (addr);
+  vm_size_t aligned_length =
+  (vm_size_t) round_page (addr + length) - low_address;
+  pointer_t copied_memory;
+  int copy_count;
 
   /* Get memory from inferior with page aligned addresses */
   ret = vm_read (inferior_task,
@@ -1816,7 +1849,7 @@ mach3_read_inferior (addr, myaddr, length)
        * to arrive via a SINGLE port set. (Including user input!)
        */
 
-      if (! port_valid (inferior_task, MACH_PORT_TYPE_SEND))
+      if (!port_valid (inferior_task, MACH_PORT_TYPE_SEND))
        {
          m3_kill_inferior ();
          error ("Inferior killed (task port invalid)");
@@ -1837,12 +1870,12 @@ mach3_read_inferior (addr, myaddr, length)
        }
     }
 
-  memcpy (myaddr, (char *)addr - low_address + copied_memory, length);
+  memcpy (myaddr, (char *) addr - low_address + copied_memory, length);
 
   ret = vm_deallocate (mach_task_self (),
                       copied_memory,
                       copy_count);
-  CHK("mach3_read_inferior vm_deallocate failed", ret);
+  CHK ("mach3_read_inferior vm_deallocate failed", ret);
 
   return length;
 }
@@ -1855,14 +1888,15 @@ mach3_read_inferior (addr, myaddr, length)
   do if (ret != KERN_SUCCESS) { errstr = str; goto out; } while(0)
 #endif
 
-struct vm_region_list {
+struct vm_region_list
+{
   struct vm_region_list *next;
-  vm_prot_t    protection;
-  vm_address_t  start;
-  vm_size_t    length;
+  vm_prot_t protection;
+  vm_address_t start;
+  vm_size_t length;
 };
 
-struct obstack  region_obstack;
+struct obstack region_obstack;
 
 /*
  * Write inferior task's LEN bytes from ADDR and copy it to MYADDR
@@ -1875,17 +1909,17 @@ mach3_write_inferior (addr, myaddr, length)
      int length;
 {
   kern_return_t ret;
-  vm_address_t low_address       = (vm_address_t) trunc_page (addr);
-  vm_size_t    aligned_length = 
-                       (vm_size_t) round_page (addr+length) - low_address;
-  pointer_t    copied_memory;
-  int         copy_count;
-  int         deallocate = 0;
+  vm_address_t low_address = (vm_address_t) trunc_page (addr);
+  vm_size_t aligned_length =
+  (vm_size_t) round_page (addr + length) - low_address;
+  pointer_t copied_memory;
+  int copy_count;
+  int deallocate = 0;
 
-  char         *errstr = "Bug in mach3_write_inferior";
+  char *errstr = "Bug in mach3_write_inferior";
 
   struct vm_region_list *region_element;
-  struct vm_region_list *region_head = (struct vm_region_list *)NULL;
+  struct vm_region_list *region_head = (struct vm_region_list *) NULL;
 
   /* Get memory from inferior with page aligned addresses */
   ret = vm_read (inferior_task,
@@ -1897,7 +1931,7 @@ mach3_write_inferior (addr, myaddr, length)
 
   deallocate++;
 
-  memcpy ((char *)addr - low_address + copied_memory, myaddr, length);
+  memcpy ((char *) addr - low_address + copied_memory, myaddr, length);
 
   obstack_init (&region_obstack);
 
@@ -1905,12 +1939,12 @@ mach3_write_inferior (addr, myaddr, length)
    * First check for holes and unwritable memory.
    */
   {
-    vm_size_t    remaining_length  = aligned_length;
-    vm_address_t region_address    = low_address;
+    vm_size_t remaining_length = aligned_length;
+    vm_address_t region_address = low_address;
 
     struct vm_region_list *scan;
 
-    while(region_address < low_address + aligned_length)
+    while (region_address < low_address + aligned_length)
       {
        vm_prot_t protection;
        vm_prot_t max_protection;
@@ -1918,9 +1952,9 @@ mach3_write_inferior (addr, myaddr, length)
        boolean_t shared;
        mach_port_t object_name;
        vm_offset_t offset;
-       vm_size_t   region_length = remaining_length;
-       vm_address_t old_address  = region_address;
-    
+       vm_size_t region_length = remaining_length;
+       vm_address_t old_address = region_address;
+
        ret = vm_region (inferior_task,
                         &region_address,
                         &region_length,
@@ -1952,18 +1986,18 @@ mach3_write_inferior (addr, myaddr, length)
          }
 
        /* Chain the regions for later use */
-       region_element = 
+       region_element =
          (struct vm_region_list *)
-           obstack_alloc (&region_obstack, sizeof (struct vm_region_list));
-    
+         obstack_alloc (&region_obstack, sizeof (struct vm_region_list));
+
        region_element->protection = protection;
-       region_element->start      = region_address;
-       region_element->length     = region_length;
+       region_element->start = region_address;
+       region_element->length = region_length;
 
        /* Chain the regions along with protections */
        region_element->next = region_head;
-       region_head          = region_element;
-       
+       region_head = region_element;
+
        region_address += region_length;
        remaining_length = remaining_length - region_length;
       }
@@ -1971,12 +2005,12 @@ mach3_write_inferior (addr, myaddr, length)
     /* If things fail after this, we give up.
      * Somebody is messing up inferior_task's mappings.
      */
-    
+
     /* Enable writes to the chained vm regions */
     for (scan = region_head; scan; scan = scan->next)
       {
        boolean_t protection_changed = FALSE;
-       
+
        if (!(scan->protection & VM_PROT_WRITE))
          {
            ret = vm_protect (inferior_task,
@@ -1993,12 +2027,12 @@ mach3_write_inferior (addr, myaddr, length)
                    copied_memory,
                    aligned_length);
     CHK_GOTO_OUT ("vm_write failed", ret);
-       
+
     /* Set up the original region protections, if they were changed */
     for (scan = region_head; scan; scan = scan->next)
       {
        boolean_t protection_changed = FALSE;
-       
+
        if (!(scan->protection & VM_PROT_WRITE))
          {
            ret = vm_protect (inferior_task,
@@ -2011,11 +2045,11 @@ mach3_write_inferior (addr, myaddr, length)
       }
   }
 
- out:
+out:
   if (deallocate)
     {
       obstack_free (&region_obstack, 0);
-      
+
       (void) vm_deallocate (mach_task_self (),
                            copied_memory,
                            copy_count);
@@ -2044,24 +2078,31 @@ m3_xfer_memory (memaddr, myaddr, len, write, target)
   if (write)
     result = mach3_write_inferior (memaddr, myaddr, len);
   else
-    result = mach3_read_inferior  (memaddr, myaddr, len);
+    result = mach3_read_inferior (memaddr, myaddr, len);
 
   return result;
 }
-
 \f
+
 static char *
-translate_state(state)
-int    state;
+translate_state (state)
+     int state;
 {
-  switch (state) {
-  case TH_STATE_RUNNING:       return("R");
-  case TH_STATE_STOPPED:       return("S");
-  case TH_STATE_WAITING:       return("W");
-  case TH_STATE_UNINTERRUPTIBLE: return("U");
-  case TH_STATE_HALTED:                return("H");
-  default:                     return("?");
-  }
+  switch (state)
+    {
+    case TH_STATE_RUNNING:
+      return ("R");
+    case TH_STATE_STOPPED:
+      return ("S");
+    case TH_STATE_WAITING:
+      return ("W");
+    case TH_STATE_UNINTERRUPTIBLE:
+      return ("U");
+    case TH_STATE_HALTED:
+      return ("H");
+    default:
+      return ("?");
+    }
 }
 
 static char *
@@ -2070,35 +2111,41 @@ translate_cstate (state)
 {
   switch (state)
     {
-    case CPROC_RUNNING:        return "R";
-    case CPROC_SWITCHING: return "S";
-    case CPROC_BLOCKED: return "B";
-    case CPROC_CONDWAIT: return "C";
-    case CPROC_CONDWAIT|CPROC_SWITCHING: return "CS";
-    default: return "?";
+    case CPROC_RUNNING:
+      return "R";
+    case CPROC_SWITCHING:
+      return "S";
+    case CPROC_BLOCKED:
+      return "B";
+    case CPROC_CONDWAIT:
+      return "C";
+    case CPROC_CONDWAIT | CPROC_SWITCHING:
+      return "CS";
+    default:
+      return "?";
     }
 }
 
 /* type == MACH_MSG_TYPE_COPY_SEND || type == MACH_MSG_TYPE_MAKE_SEND */
 
-mach_port_t           /* no mach_port_name_t found in include files. */
+mach_port_t                    /* no mach_port_name_t found in include files. */
 map_inferior_port_name (inferior_name, type)
      mach_port_t inferior_name;
      mach_msg_type_name_t type;
 {
-  kern_return_t        ret;
+  kern_return_t ret;
   mach_msg_type_name_t acquired;
-  mach_port_t          iport;
-  
+  mach_port_t iport;
+
   ret = mach_port_extract_right (inferior_task,
                                 inferior_name,
                                 type,
                                 &iport,
                                 &acquired);
-  CHK("mach_port_extract_right (map_inferior_port_name)", ret);
+  CHK ("mach_port_extract_right (map_inferior_port_name)", ret);
 
   if (acquired != MACH_MSG_TYPE_PORT_SEND)
-    error("Incorrect right extracted, (map_inferior_port_name)");
+    error ("Incorrect right extracted, (map_inferior_port_name)");
 
   ret = mach_port_deallocate (mach_task_self (),
                              iport);
@@ -2130,22 +2177,22 @@ get_thread_name (one_cproc, id)
     if (one_cproc->cthread == NULL)
       {
        /* cproc not mapped to any cthread */
-       sprintf(buf, "_C%d", id);
+       sprintf (buf, "_C%d", id);
       }
-    else if (! one_cproc->cthread->name)
+    else if (!one_cproc->cthread->name)
       {
        /* cproc and cthread, but no name */
-       sprintf(buf, "_t%d", id);
+       sprintf (buf, "_t%d", id);
       }
     else
-      return (char *)(one_cproc->cthread->name);
+      return (char *) (one_cproc->cthread->name);
   else
     {
       if (id < 0)
        warning ("Inconsistency in thread name id %d", id);
 
       /* Kernel thread without cproc */
-      sprintf(buf, "_K%d", id);
+      sprintf (buf, "_K%d", id);
     }
 
   return buf;
@@ -2153,28 +2200,28 @@ get_thread_name (one_cproc, id)
 
 int
 fetch_thread_info (task, mthreads_out)
-     mach_port_t       task;
-     gdb_thread_t      *mthreads_out;  /* out */
+     mach_port_t task;
+     gdb_thread_t *mthreads_out;       /* out */
 {
-  kern_return_t  ret;
+  kern_return_t ret;
   thread_array_t th_table;
-  int           th_count;
+  int th_count;
   gdb_thread_t mthreads = NULL;
-  int           index;
+  int index;
 
   ret = task_threads (task, &th_table, &th_count);
   if (ret != KERN_SUCCESS)
     {
       warning ("Error getting inferior's thread list:%s",
-              mach_error_string(ret));
+              mach_error_string (ret));
       m3_kill_inferior ();
       return -1;
     }
-  
+
   mthreads = (gdb_thread_t)
-               obstack_alloc
-                 (cproc_obstack,
-                  th_count * sizeof (struct gdb_thread));
+    obstack_alloc
+    (cproc_obstack,
+     th_count * sizeof (struct gdb_thread));
 
   for (index = 0; index < th_count; index++)
     {
@@ -2182,20 +2229,20 @@ fetch_thread_info (task, mthreads_out)
       int mid;
 
       if (must_suspend_thread)
-       setup_thread (th_table[ index ], 1);
+       setup_thread (th_table[index], 1);
 
       if (th_table[index] != current_thread)
        {
          saved_thread = current_thread;
-         
-         mid = switch_to_thread (th_table[ index ]);
+
+         mid = switch_to_thread (th_table[index]);
        }
 
-      mthreads[index].name  = th_table[index];
+      mthreads[index].name = th_table[index];
       mthreads[index].cproc = NULL;    /* map_cprocs_to_kernel_threads() */
       mthreads[index].in_emulator = FALSE;
       mthreads[index].slotid = index;
-      
+
       mthreads[index].sp = read_register (SP_REGNUM);
       mthreads[index].fp = read_register (FP_REGNUM);
       mthreads[index].pc = read_pc ();
@@ -2204,12 +2251,12 @@ fetch_thread_info (task, mthreads_out)
        mid = switch_to_thread (saved_thread);
 
       if (must_suspend_thread)
-       setup_thread (th_table[ index ], 0);
+       setup_thread (th_table[index], 0);
     }
-  
+
   consume_send_rights (th_table, th_count);
-  ret = vm_deallocate (mach_task_self(), (vm_address_t)th_table, 
-                      (th_count * sizeof(mach_port_t)));
+  ret = vm_deallocate (mach_task_self (), (vm_address_t) th_table,
+                      (th_count * sizeof (mach_port_t)));
   if (ret != KERN_SUCCESS)
     {
       warning ("Error trying to deallocate thread list : %s",
@@ -2232,9 +2279,9 @@ fetch_usp_from_emulator_stack (sp)
 {
   CORE_ADDR stack_pointer;
 
-  sp = (sp & ~(EMULATOR_STACK_SIZE-1)) +
-       EMULATOR_STACK_SIZE - sizeof (struct emul_stack_top);
-  
+  sp = (sp & ~(EMULATOR_STACK_SIZE - 1)) +
+    EMULATOR_STACK_SIZE - sizeof (struct emul_stack_top);
+
   if (mach3_read_inferior (sp,
                           &stack_pointer,
                           sizeof (CORE_ADDR)) != sizeof (CORE_ADDR))
@@ -2259,17 +2306,17 @@ boolean_t
 have_emulator_p (task)
      task_t task;
 {
-  kern_return_t        ret;
+  kern_return_t ret;
 #ifndef EMUL_VECTOR_COUNT
-  vm_offset_t  *emulation_vector;
-  int          n;
+  vm_offset_t *emulation_vector;
+  int n;
 #else
-  vm_offset_t  emulation_vector[ EMUL_VECTOR_COUNT ];
-  int          n = EMUL_VECTOR_COUNT;
+  vm_offset_t emulation_vector[EMUL_VECTOR_COUNT];
+  int n = EMUL_VECTOR_COUNT;
 #endif
-  int          i;
-  int          vector_start;
-  
+  int i;
+  int vector_start;
+
   ret = task_get_emulation_vector (task,
                                   &vector_start,
 #ifndef EMUL_VECTOR_COUNT
@@ -2278,13 +2325,13 @@ have_emulator_p (task)
                                   emulation_vector,
 #endif
                                   &n);
-  CHK("task_get_emulation_vector", ret);
+  CHK ("task_get_emulation_vector", ret);
   xx_debug ("%d vectors from %d at 0x%08x\n",
            n, vector_start, emulation_vector);
-  
-  for(i = 0; i < n; i++)
+
+  for (i = 0; i < n; i++)
     {
-      vm_offset_t entry = emulation_vector [i];
+      vm_offset_t entry = emulation_vector[i];
 
       if (EMULATOR_BASE <= entry && entry <= EMULATOR_END)
        return TRUE;
@@ -2293,8 +2340,8 @@ have_emulator_p (task)
          static boolean_t informed = FALSE;
          if (!informed)
            {
-             warning("Emulation vector address 0x08%x outside emulator space",
-                     entry);
+             warning ("Emulation vector address 0x08%x outside emulator space",
+                      entry);
              informed = TRUE;
            }
        }
@@ -2327,7 +2374,7 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
          stack_base =
            extract_signed_integer (scan->raw_cproc + CPROC_BASE_OFFSET,
                                    CPROC_BASE_SIZE);
-         stack_size = 
+         stack_size =
            extract_signed_integer (scan->raw_cproc + CPROC_SIZE_OFFSET,
                                    CPROC_SIZE_SIZE);
          if ((mthreads + index)->sp > stack_base &&
@@ -2354,7 +2401,7 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
    *  stack, and try to map that to the cprocs.
    *
    * Also set in_emulator for kernel threads.
-   */ 
+   */
 
   if (emulator_present)
     {
@@ -2363,28 +2410,28 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
          CORE_ADDR emul_sp;
          CORE_ADDR usp;
 
-         gdb_thread_t mthread = (mthreads+index);
+         gdb_thread_t mthread = (mthreads + index);
          emul_sp = mthread->sp;
 
          if (mthread->cproc == NULL &&
              EMULATOR_BASE <= emul_sp && emul_sp <= EMULATOR_END)
            {
              mthread->in_emulator = emulator_present;
-             
+
              if (!all_mapped && cprocs)
                {
                  usp = fetch_usp_from_emulator_stack (emul_sp);
-                 
+
                  /* @@ Could be more accurate */
-                 if (! usp)
+                 if (!usp)
                    error ("Zero stack pointer read from emulator?");
-                 
+
                  /* Try to match this stack pointer to the cprocs that
                   * don't yet have a kernel thread.
                   */
                  for (scan = cprocs; scan; scan = scan->next)
                    {
-                     
+
                      /* Check is this unmapped CPROC stack contains
                       * the user stack pointer saved in the
                       * emulator.
@@ -2393,12 +2440,12 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
                        {
                          stack_base =
                            extract_signed_integer
-                             (scan->raw_cproc + CPROC_BASE_OFFSET,
-                              CPROC_BASE_SIZE);
-                         stack_size = 
+                           (scan->raw_cproc + CPROC_BASE_OFFSET,
+                            CPROC_BASE_SIZE);
+                         stack_size =
                            extract_signed_integer
-                             (scan->raw_cproc + CPROC_SIZE_OFFSET,
-                              CPROC_SIZE_SIZE);
+                           (scan->raw_cproc + CPROC_SIZE_OFFSET,
+                            CPROC_SIZE_SIZE);
                          if (usp > stack_base &&
                              usp <= stack_base + stack_size)
                            {
@@ -2417,7 +2464,7 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
 /*
  * Format of the thread_list command
  *
- *                  slot mid sel   name  emul ks susp  cstate wired   address
+ *                   slot mid sel   name  emul ks susp  cstate wired   address
  */
 #define TL_FORMAT "%-2.2s %5d%c %-10.10s %1.1s%s%-5.5s %-2.2s %-5.5s "
 
@@ -2428,14 +2475,14 @@ print_tl_address (stream, pc)
      GDB_FILE *stream;
      CORE_ADDR pc;
 {
-  if (! lookup_minimal_symbol_by_pc (pc))
-    fprintf_filtered (stream, local_hex_format(), pc);
+  if (!lookup_minimal_symbol_by_pc (pc))
+    fprintf_filtered (stream, local_hex_format (), pc);
   else
     {
       extern int addressprint;
       extern int asm_demangle;
 
-      int store    = addressprint;
+      int store = addressprint;
       addressprint = 0;
       print_address_symbolic (pc, stream, asm_demangle, "");
       addressprint = store;
@@ -2455,15 +2502,15 @@ lookup_address_of_variable (name)
   struct minimal_symbol *msymbol;
 
   sym = lookup_symbol (name,
-                      (struct block *)NULL,
+                      (struct block *) NULL,
                       VAR_NAMESPACE,
-                      (int *)NULL,
-                      (struct symtab **)NULL);
+                      (int *) NULL,
+                      (struct symtab **) NULL);
 
   if (sym)
     symaddr = SYMBOL_VALUE (sym);
 
-  if (! symaddr)
+  if (!symaddr)
     {
       msymbol = lookup_minimal_symbol (name, NULL, NULL);
 
@@ -2475,7 +2522,7 @@ lookup_address_of_variable (name)
 }
 
 static gdb_thread_t
-get_cprocs()
+get_cprocs ()
 {
   gdb_thread_t cproc_head;
   gdb_thread_t cproc_copy;
@@ -2484,13 +2531,13 @@ get_cprocs()
   char *name;
   cthread_t cthread;
   CORE_ADDR symaddr;
-  
+
   symaddr = lookup_address_of_variable ("cproc_list");
 
-  if (! symaddr)
+  if (!symaddr)
     {
       /* cproc_list is not in a file compiled with debugging
-        symbols, but don't give up yet */
+         symbols, but don't give up yet */
 
       symaddr = lookup_address_of_variable ("cprocs");
 
@@ -2508,7 +2555,7 @@ get_cprocs()
     }
 
   /* Stripped or no -lthreads loaded or "cproc_list" is in wrong segment. */
-  if (! symaddr)
+  if (!symaddr)
     return NULL;
 
   /* Get the address of the first cproc in the task */
@@ -2524,7 +2571,7 @@ get_cprocs()
 
   cproc_head = NULL;
 
-  while (their_cprocs != (CORE_ADDR)0)
+  while (their_cprocs != (CORE_ADDR) 0)
     {
       CORE_ADDR cproc_copy_incarnation;
       cproc_copy = (gdb_thread_t) obstack_alloc (cproc_obstack,
@@ -2533,7 +2580,7 @@ get_cprocs()
       if (!mach3_read_inferior (their_cprocs,
                                &cproc_copy->raw_cproc[0],
                                CPROC_SIZE))
-       error("Can't read next cproc at 0x%x.", their_cprocs);
+       error ("Can't read next cproc at 0x%x.", their_cprocs);
 
       their_cprocs =
        extract_address (cproc_copy->raw_cproc + CPROC_LIST_OFFSET,
@@ -2542,19 +2589,19 @@ get_cprocs()
        extract_address (cproc_copy->raw_cproc + CPROC_INCARNATION_OFFSET,
                         CPROC_INCARNATION_SIZE);
 
-      if (cproc_copy_incarnation == (CORE_ADDR)0)
+      if (cproc_copy_incarnation == (CORE_ADDR) 0)
        cproc_copy->cthread = NULL;
       else
        {
          /* This CPROC has an attached CTHREAD. Get its name */
-         cthread = (cthread_t)obstack_alloc (cproc_obstack,
-                                             sizeof(struct cthread));
+         cthread = (cthread_t) obstack_alloc (cproc_obstack,
+                                              sizeof (struct cthread));
 
          if (!mach3_read_inferior (cproc_copy_incarnation,
                                    cthread,
-                                   sizeof(struct cthread)))
-           error("Can't read next thread at 0x%x.",
-                 cproc_copy_incarnation);
+                                   sizeof (struct cthread)))
+             error ("Can't read next thread at 0x%x.",
+                    cproc_copy_incarnation);
 
          cproc_copy->cthread = cthread;
 
@@ -2562,8 +2609,8 @@ get_cprocs()
            {
              name = (char *) obstack_alloc (cproc_obstack, MAX_NAME_LEN);
 
-             if (!mach3_read_inferior(cthread->name, name, MAX_NAME_LEN))
-               error("Can't read next thread's name at 0x%x.", cthread->name);
+             if (!mach3_read_inferior (cthread->name, name, MAX_NAME_LEN))
+               error ("Can't read next thread's name at 0x%x.", cthread->name);
 
              cthread->name = name;
            }
@@ -2594,7 +2641,7 @@ mach3_cproc_state (mthread)
 {
   int context;
 
-  if (! mthread || !mthread->cproc)
+  if (!mthread || !mthread->cproc)
     return -1;
 
   context = extract_signed_integer
@@ -2624,83 +2671,83 @@ mach3_cproc_state (mthread)
   return 0;
 }
 #endif /* FETCH_CPROC_STATE */
-
 \f
+
 void
-thread_list_command()
+thread_list_command ()
 {
   thread_basic_info_data_t ths;
-  int     thread_count;
+  int thread_count;
   gdb_thread_t cprocs;
   gdb_thread_t scan;
-  int     index;
-  char   *name;
-  char    selected;
-  char   *wired;
-  int     infoCnt;
+  int index;
+  char *name;
+  char selected;
+  char *wired;
+  int infoCnt;
   kern_return_t ret;
-  mach_port_t   mid_or_port;
-  gdb_thread_t  their_threads;
-  gdb_thread_t  kthread;
+  mach_port_t mid_or_port;
+  gdb_thread_t their_threads;
+  gdb_thread_t kthread;
 
   int neworder = 1;
 
   char *fmt = "There are %d kernel threads in task %d.\n";
-  
+
   int tmid = map_port_name_to_mid (inferior_task, MACH_TYPE_TASK);
-  
+
   MACH_ERROR_NO_INFERIOR;
-  
+
   thread_count = fetch_thread_info (inferior_task,
                                    &their_threads);
   if (thread_count == -1)
     return;
-  
+
   if (thread_count == 1)
     fmt = "There is %d kernel thread in task %d.\n";
-  
+
   printf_filtered (fmt, thread_count, tmid);
-  
+
   puts_filtered (TL_HEADER);
-  
-  cprocs = get_cprocs();
-  
+
+  cprocs = get_cprocs ();
+
   map_cprocs_to_kernel_threads (cprocs, their_threads, thread_count);
-  
+
   for (scan = cprocs; scan; scan = scan->next)
     {
       int mid;
       char buf[10];
       char slot[3];
       int cproc_state =
-       extract_signed_integer
-         (scan->raw_cproc + CPROC_STATE_OFFSET, CPROC_STATE_SIZE);
-      
+      extract_signed_integer
+      (scan->raw_cproc + CPROC_STATE_OFFSET, CPROC_STATE_SIZE);
+
       selected = ' ';
-      
+
       /* a wired cproc? */
       wired = (extract_address (scan->raw_cproc + CPROC_WIRED_OFFSET,
                                CPROC_WIRED_SIZE)
               ? "wired" : "");
 
       if (scan->reverse_map != -1)
-       kthread  = (their_threads + scan->reverse_map);
+       kthread = (their_threads + scan->reverse_map);
       else
-       kthread  = NULL;
+       kthread = NULL;
 
       if (kthread)
        {
          /* These cprocs have a kernel thread */
-         
+
          mid = map_port_name_to_mid (kthread->name, MACH_TYPE_THREAD);
-         
+
          infoCnt = THREAD_BASIC_INFO_COUNT;
-         
+
          ret = thread_info (kthread->name,
                             THREAD_BASIC_INFO,
-                            (thread_info_t)&ths,
+                            (thread_info_t) & ths,
                             &infoCnt);
-         
+
          if (ret != KERN_SUCCESS)
            {
              warning ("Unable to get basic info on thread %d : %s",
@@ -2710,11 +2757,11 @@ thread_list_command()
            }
 
          /* Who is the first to have more than 100 threads */
-         sprintf (slot, "%d", kthread->slotid%100);
+         sprintf (slot, "%d", kthread->slotid % 100);
 
          if (kthread->name == current_thread)
            selected = '*';
-         
+
          if (ths.suspend_count)
            sprintf (buf, "%d", ths.suspend_count);
          else
@@ -2752,7 +2799,7 @@ thread_list_command()
 #if 0
          /* jtv -> emcmanus: why do you want this here? */
          if (scan->incarnation == NULL)
-           continue; /* EMcM */
+           continue;           /* EMcM */
 #endif
 
          printf_filtered (TL_FORMAT,
@@ -2776,28 +2823,28 @@ thread_list_command()
        }
       puts_filtered ("\n");
     }
-  
+
   /* Scan for kernel threads without cprocs */
   for (index = 0; index < thread_count; index++)
     {
-      if (! their_threads[index].cproc)
+      if (!their_threads[index].cproc)
        {
          int mid;
-         
+
          char buf[10];
          char slot[3];
 
          mach_port_t name = their_threads[index].name;
-         
+
          mid = map_port_name_to_mid (name, MACH_TYPE_THREAD);
-         
+
          infoCnt = THREAD_BASIC_INFO_COUNT;
-         
-         ret = thread_info(name,
-                           THREAD_BASIC_INFO,
-                           (thread_info_t)&ths,
-                           &infoCnt);
-           
+
+         ret = thread_info (name,
+                            THREAD_BASIC_INFO,
+                            (thread_info_t) & ths,
+                            &infoCnt);
+
          if (ret != KERN_SUCCESS)
            {
              warning ("Unable to get basic info on thread %d : %s",
@@ -2806,7 +2853,7 @@ thread_list_command()
              continue;
            }
 
-         sprintf (slot, "%d", index%100);
+         sprintf (slot, "%d", index % 100);
 
          if (name == current_thread)
            selected = '*';
@@ -2834,19 +2881,19 @@ thread_list_command()
                           their_threads[index].in_emulator ? "E" : "",
                           translate_state (ths.run_state),
                           buf,
-                          "",   /* No cproc state */
+                          "",  /* No cproc state */
                           ""); /* Can't be wired */
          print_tl_address (gdb_stdout, their_threads[index].pc);
          puts_filtered ("\n");
        }
     }
-  
+
   obstack_free (cproc_obstack, 0);
   obstack_init (cproc_obstack);
 }
 \f
 void
-thread_select_command(args, from_tty)
+thread_select_command (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -2870,31 +2917,31 @@ thread_select_command(args, from_tty)
       args++;
     }
 
-  mid = atoi(args);
+  mid = atoi (args);
 
   if (mid == 0)
-    if (!is_slot || *args != '0') /* Rudimentary checks */
+    if (!is_slot || *args != '0')      /* Rudimentary checks */
       error ("You must select threads by MID or @SLOTNUMBER");
 
-  if (select_thread (inferior_task, mid, is_slot?2:1) != KERN_SUCCESS)
+  if (select_thread (inferior_task, mid, is_slot ? 2 : 1) != KERN_SUCCESS)
     return;
 
   if (from_tty)
     printf_filtered ("Thread %d selected\n",
                     is_slot ? map_port_name_to_mid (current_thread,
-                                                    MACH_TYPE_THREAD) : mid);
+                                                  MACH_TYPE_THREAD) : mid);
 }
 \f
 thread_trace (thread, set)
-mach_port_t thread;
-boolean_t   set;
+     mach_port_t thread;
+     boolean_t set;
 {
-  int                  flavor   = TRACE_FLAVOR;
-  unsigned int         stateCnt = TRACE_FLAVOR_SIZE;
-  kern_return_t                ret;
-  thread_state_data_t  state;
+  int flavor = TRACE_FLAVOR;
+  unsigned int stateCnt = TRACE_FLAVOR_SIZE;
+  kern_return_t ret;
+  thread_state_data_t state;
 
-  if (! MACH_PORT_VALID (thread))
+  if (!MACH_PORT_VALID (thread))
     {
       warning ("thread_trace: invalid thread");
       return;
@@ -2903,16 +2950,16 @@ boolean_t   set;
   if (must_suspend_thread)
     setup_thread (thread, 1);
 
-  ret = thread_get_state(thread, flavor, state, &stateCnt);
+  ret = thread_get_state (thread, flavor, state, &stateCnt);
   CHK ("thread_trace: error reading thread state", ret);
-  
+
   if (set)
     {
       TRACE_SET (thread, state);
     }
   else
     {
-      if (! TRACE_CLEAR (thread, state))
+      if (!TRACE_CLEAR (thread, state))
        {
          if (must_suspend_thread)
            setup_thread (thread, 0);
@@ -2920,11 +2967,11 @@ boolean_t   set;
        }
     }
 
-  ret = thread_set_state(thread, flavor, state, stateCnt);
+  ret = thread_set_state (thread, flavor, state, stateCnt);
   CHK ("thread_trace: error writing thread state", ret);
   if (must_suspend_thread)
     setup_thread (thread, 0);
-}  
+}
 
 #ifdef FLUSH_INFERIOR_CACHE
 
@@ -2933,12 +2980,12 @@ boolean_t   set;
    This definitely includes breakpoints, for instance, or else we
    end up looping in mysterious Bpt traps */
 
-flush_inferior_icache(pc, amount)
+flush_inferior_icache (pc, amount)
      CORE_ADDR pc;
 {
   vm_machine_attribute_val_t flush = MATTR_VAL_ICACHE_FLUSH;
-  kern_return_t   ret;
-  
+  kern_return_t ret;
+
   ret = vm_machine_attribute (inferior_task,
                              pc,
                              amount,
@@ -2948,20 +2995,20 @@ flush_inferior_icache(pc, amount)
     warning ("Error flushing inferior's cache : %s",
             mach_error_string (ret));
 }
-#endif FLUSH_INFERIOR_CACHE
-
+#endif /* FLUSH_INFERIOR_CACHE */
 \f
+
 static
 suspend_all_threads (from_tty)
      int from_tty;
 {
-  kern_return_t           ret;
-  thread_array_t   thread_list;
-  int             thread_count, index;
-  int             infoCnt;
+  kern_return_t ret;
+  thread_array_t thread_list;
+  int thread_count, index;
+  int infoCnt;
   thread_basic_info_data_t th_info;
 
-  
+
   ret = task_threads (inferior_task, &thread_list, &thread_count);
   if (ret != KERN_SUCCESS)
     {
@@ -2969,15 +3016,15 @@ suspend_all_threads (from_tty)
       m3_kill_inferior ();
       return_to_top_level (RETURN_ERROR);
     }
-  
+
   for (index = 0; index < thread_count; index++)
     {
       int mid;
 
-      mid = map_port_name_to_mid (thread_list[ index ],
+      mid = map_port_name_to_mid (thread_list[index],
                                  MACH_TYPE_THREAD);
-         
-      ret = thread_suspend(thread_list[ index ]);
+
+      ret = thread_suspend (thread_list[index]);
 
       if (ret != KERN_SUCCESS)
        warning ("Error trying to suspend thread %d : %s",
@@ -2986,21 +3033,21 @@ suspend_all_threads (from_tty)
       if (from_tty)
        {
          infoCnt = THREAD_BASIC_INFO_COUNT;
-         ret = thread_info (thread_list[ index ],
+         ret = thread_info (thread_list[index],
                             THREAD_BASIC_INFO,
-                            (thread_info_t) &th_info,
+                            (thread_info_t) & th_info,
                             &infoCnt);
          CHK ("suspend can't get thread info", ret);
-         
+
          warning ("Thread %d suspend count is %d",
                   mid, th_info.suspend_count);
        }
     }
 
   consume_send_rights (thread_list, thread_count);
-  ret = vm_deallocate(mach_task_self(),
-                     (vm_address_t)thread_list, 
-                     (thread_count * sizeof(int)));
+  ret = vm_deallocate (mach_task_self (),
+                      (vm_address_t) thread_list,
+                      (thread_count * sizeof (int)));
   CHK ("Error trying to deallocate thread list", ret);
 }
 
@@ -3010,17 +3057,18 @@ thread_suspend_command (args, from_tty)
      int from_tty;
 {
   kern_return_t ret;
-  int           mid;
-  mach_port_t   saved_thread;
-  int           infoCnt;
+  int mid;
+  mach_port_t saved_thread;
+  int infoCnt;
   thread_basic_info_data_t th_info;
-  
+
   MACH_ERROR_NO_INFERIOR;
 
-  if (!strcasecmp (args, "all")) {
-    suspend_all_threads (from_tty);
-    return;
-  }
+  if (!strcasecmp (args, "all"))
+    {
+      suspend_all_threads (from_tty);
+      return;
+    }
 
   saved_thread = current_thread;
 
@@ -3031,13 +3079,12 @@ thread_suspend_command (args, from_tty)
 
   if (mid == 0)
     mid = map_port_name_to_mid (current_thread, MACH_TYPE_THREAD);
-  else
-    if (select_thread (inferior_task, mid, 0) != KERN_SUCCESS)
-      {
-       if (current_thread)
-         current_thread = saved_thread;
-       error ("Could not select thread %d", mid);
-      }
+  else if (select_thread (inferior_task, mid, 0) != KERN_SUCCESS)
+    {
+      if (current_thread)
+       current_thread = saved_thread;
+      error ("Could not select thread %d", mid);
+    }
 
   ret = thread_suspend (current_thread);
   if (ret != KERN_SUCCESS)
@@ -3047,66 +3094,66 @@ thread_suspend_command (args, from_tty)
   infoCnt = THREAD_BASIC_INFO_COUNT;
   ret = thread_info (current_thread,
                     THREAD_BASIC_INFO,
-                    (thread_info_t) &th_info,
+                    (thread_info_t) & th_info,
                     &infoCnt);
   CHK ("suspend can't get thread info", ret);
-  
+
   warning ("Thread %d suspend count is %d", mid, th_info.suspend_count);
-  
+
   current_thread = saved_thread;
 }
 
 resume_all_threads (from_tty)
      int from_tty;
 {
-    kern_return_t  ret;
-    thread_array_t thread_list;
-    int                   thread_count, index;
-    int            mid;
-    int                   infoCnt;
-    thread_basic_info_data_t th_info;
+  kern_return_t ret;
+  thread_array_t thread_list;
+  int thread_count, index;
+  int mid;
+  int infoCnt;
+  thread_basic_info_data_t th_info;
 
-    ret = task_threads (inferior_task, &thread_list, &thread_count);
-    if (ret != KERN_SUCCESS)
-      {
-       m3_kill_inferior ();
-       error("task_threads", mach_error_string( ret));
-      }
+  ret = task_threads (inferior_task, &thread_list, &thread_count);
+  if (ret != KERN_SUCCESS)
+    {
+      m3_kill_inferior ();
+      error ("task_threads", mach_error_string (ret));
+    }
 
-    for (index = 0; index < thread_count; index++)
-      {
-       infoCnt = THREAD_BASIC_INFO_COUNT;
-       ret = thread_info (thread_list [ index ],
-                          THREAD_BASIC_INFO,
-                          (thread_info_t) &th_info,
-                          &infoCnt);
-       CHK ("resume_all can't get thread info", ret);
-       
-       mid = map_port_name_to_mid (thread_list[ index ],
-                                   MACH_TYPE_THREAD);
-       
-       if (! th_info.suspend_count)
-         {
-           if (mid != -1 && from_tty)
-             warning ("Thread %d is not suspended", mid);
-           continue;
-         }
+  for (index = 0; index < thread_count; index++)
+    {
+      infoCnt = THREAD_BASIC_INFO_COUNT;
+      ret = thread_info (thread_list[index],
+                        THREAD_BASIC_INFO,
+                        (thread_info_t) & th_info,
+                        &infoCnt);
+      CHK ("resume_all can't get thread info", ret);
 
-       ret = thread_resume (thread_list[ index ]);
+      mid = map_port_name_to_mid (thread_list[index],
+                                 MACH_TYPE_THREAD);
 
-       if (ret != KERN_SUCCESS)
-         warning ("Error trying to resume thread %d : %s",
-                  mid, mach_error_string (ret));
-       else if (mid != -1 && from_tty)
-         warning ("Thread %d suspend count is %d",
-                  mid, --th_info.suspend_count);
-      }
+      if (!th_info.suspend_count)
+       {
+         if (mid != -1 && from_tty)
+           warning ("Thread %d is not suspended", mid);
+         continue;
+       }
 
-    consume_send_rights (thread_list, thread_count);
-    ret = vm_deallocate(mach_task_self(),
-                       (vm_address_t)thread_list, 
-                       (thread_count * sizeof(int)));
-    CHK("Error trying to deallocate thread list", ret);
+      ret = thread_resume (thread_list[index]);
+
+      if (ret != KERN_SUCCESS)
+       warning ("Error trying to resume thread %d : %s",
+                mid, mach_error_string (ret));
+      else if (mid != -1 && from_tty)
+       warning ("Thread %d suspend count is %d",
+                mid, --th_info.suspend_count);
+    }
+
+  consume_send_rights (thread_list, thread_count);
+  ret = vm_deallocate (mach_task_self (),
+                      (vm_address_t) thread_list,
+                      (thread_count * sizeof (int)));
+  CHK ("Error trying to deallocate thread list", ret);
 }
 
 void
@@ -3119,13 +3166,14 @@ thread_resume_command (args, from_tty)
   kern_return_t ret;
   thread_basic_info_data_t th_info;
   int infoCnt = THREAD_BASIC_INFO_COUNT;
-  
+
   MACH_ERROR_NO_INFERIOR;
 
-  if (!strcasecmp (args, "all")) {
-    resume_all_threads (from_tty);
-    return;
-  }
+  if (!strcasecmp (args, "all"))
+    {
+      resume_all_threads (from_tty);
+      return;
+    }
 
   saved_thread = current_thread;
 
@@ -3136,21 +3184,20 @@ thread_resume_command (args, from_tty)
 
   if (mid == 0)
     mid = map_port_name_to_mid (current_thread, MACH_TYPE_THREAD);
-  else
-    if (select_thread (inferior_task, mid, 0) != KERN_SUCCESS)
-      {
-       if (current_thread)
-         current_thread = saved_thread;
-       return_to_top_level (RETURN_ERROR);
-      }
+  else if (select_thread (inferior_task, mid, 0) != KERN_SUCCESS)
+    {
+      if (current_thread)
+       current_thread = saved_thread;
+      return_to_top_level (RETURN_ERROR);
+    }
 
   ret = thread_info (current_thread,
                     THREAD_BASIC_INFO,
-                    (thread_info_t) &th_info,
+                    (thread_info_t) & th_info,
                     &infoCnt);
   CHK ("resume can't get thread info", ret);
-  
-  if (! th_info.suspend_count)
+
+  if (!th_info.suspend_count)
     {
       warning ("Thread %d is not suspended", mid);
       goto out;
@@ -3165,8 +3212,8 @@ thread_resume_command (args, from_tty)
       th_info.suspend_count--;
       warning ("Thread %d suspend count is %d", mid, th_info.suspend_count);
     }
-      
- out:
+
+out:
   current_thread = saved_thread;
 }
 
@@ -3179,10 +3226,10 @@ thread_kill_command (args, from_tty)
   kern_return_t ret;
   int thread_count;
   thread_array_t thread_table;
-  int   index;
+  int index;
   mach_port_t thread_to_kill = MACH_PORT_NULL;
-  
-  
+
+
   MACH_ERROR_NO_INFERIOR;
 
   if (!args)
@@ -3200,11 +3247,11 @@ thread_kill_command (args, from_tty)
     }
   else
     mid = map_port_name_to_mid (current_thread, MACH_TYPE_THREAD);
-      
+
   /* Don't allow gdb to kill *any* thread in the system. Use mkill program for that */
   ret = task_threads (inferior_task, &thread_table, &thread_count);
   CHK ("Error getting inferior's thread list", ret);
-  
+
   if (thread_to_kill == current_thread)
     {
       ret = thread_terminate (thread_to_kill);
@@ -3215,7 +3262,7 @@ thread_kill_command (args, from_tty)
     }
   else
     for (index = 0; index < thread_count; index++)
-      if (thread_table [ index ] == thread_to_kill)
+      if (thread_table[index] == thread_to_kill)
        {
          ret = thread_terminate (thread_to_kill);
          CHK ("Thread could not be terminated", ret);
@@ -3223,15 +3270,15 @@ thread_kill_command (args, from_tty)
 
   if (thread_count > 1)
     consume_send_rights (thread_table, thread_count);
-  
-  ret = vm_deallocate (mach_task_self(), (vm_address_t)thread_table, 
-                      (thread_count * sizeof(mach_port_t)));
+
+  ret = vm_deallocate (mach_task_self (), (vm_address_t) thread_table,
+                      (thread_count * sizeof (mach_port_t)));
   CHK ("Error trying to deallocate thread list", ret);
-  
+
   warning ("Thread %d killed", mid);
 }
-
 \f
+
 /* Task specific commands; add more if you like */
 
 void
@@ -3243,7 +3290,7 @@ task_resume_command (args, from_tty)
   task_basic_info_data_t ta_info;
   int infoCnt = TASK_BASIC_INFO_COUNT;
   int mid = map_port_name_to_mid (inferior_task, MACH_TYPE_TASK);
-  
+
   MACH_ERROR_NO_INFERIOR;
 
   /* Would be trivial to change, but is it desirable? */
@@ -3252,15 +3299,15 @@ task_resume_command (args, from_tty)
 
   ret = task_info (inferior_task,
                   TASK_BASIC_INFO,
-                  (task_info_t) &ta_info,
+                  (task_info_t) & ta_info,
                   &infoCnt);
   CHK ("task_resume_command: task_info failed", ret);
-  
+
   if (ta_info.suspend_count == 0)
     error ("Inferior task %d is not suspended", mid);
   else if (ta_info.suspend_count == 1 &&
           from_tty &&
-          !query ("Suspend count is now 1. Do you know what you are doing? "))
+       !query ("Suspend count is now 1. Do you know what you are doing? "))
     error ("Task not resumed");
 
   ret = task_resume (inferior_task);
@@ -3271,12 +3318,12 @@ task_resume_command (args, from_tty)
       warning ("Inferior task %d is no longer suspended", mid);
       must_suspend_thread = 1;
       /* @@ This is not complete: Registers change all the time when not
-        suspended! */
+         suspended! */
       registers_changed ();
     }
   else
     warning ("Inferior task %d suspend count is now %d",
-            mid, ta_info.suspend_count-1);
+            mid, ta_info.suspend_count - 1);
 }
 
 
@@ -3289,7 +3336,7 @@ task_suspend_command (args, from_tty)
   task_basic_info_data_t ta_info;
   int infoCnt = TASK_BASIC_INFO_COUNT;
   int mid = map_port_name_to_mid (inferior_task, MACH_TYPE_TASK);
-  
+
   MACH_ERROR_NO_INFERIOR;
 
   /* Would be trivial to change, but is it desirable? */
@@ -3303,10 +3350,10 @@ task_suspend_command (args, from_tty)
 
   ret = task_info (inferior_task,
                   TASK_BASIC_INFO,
-                  (task_info_t) &ta_info,
+                  (task_info_t) & ta_info,
                   &infoCnt);
   CHK ("task_suspend_command: task_info failed", ret);
-  
+
   warning ("Inferior task %d suspend count is now %d",
           mid, ta_info.suspend_count);
 }
@@ -3315,11 +3362,11 @@ static char *
 get_size (bytes)
      int bytes;
 {
-  static char size [ 30 ];
-  int zz = bytes/1024;
+  static char size[30];
+  int zz = bytes / 1024;
 
   if (zz / 1024)
-    sprintf (size, "%-2.1f M", ((float)bytes)/(1024.0*1024.0));
+    sprintf (size, "%-2.1f M", ((float) bytes) / (1024.0 * 1024.0));
   else
     sprintf (size, "%d K", zz);
 
@@ -3337,9 +3384,9 @@ task_info_command (args, from_tty)
   kern_return_t ret;
   task_basic_info_data_t ta_info;
   int infoCnt = TASK_BASIC_INFO_COUNT;
-  int page_size = round_page(1);
+  int page_size = round_page (1);
   int thread_count = 0;
-  
+
   if (MACH_PORT_VALID (inferior_task))
     mid = map_port_name_to_mid (inferior_task,
                                MACH_TYPE_TASK);
@@ -3366,7 +3413,7 @@ task_info_command (args, from_tty)
 
   ret = task_info (task,
                   TASK_BASIC_INFO,
-                  (task_info_t) &ta_info,
+                  (task_info_t) & ta_info,
                   &infoCnt);
   CHK ("task_info_command: task_info failed", ret);
 
@@ -3378,17 +3425,17 @@ task_info_command (args, from_tty)
 
   {
     thread_array_t thread_list;
-    
+
     ret = task_threads (task, &thread_list, &thread_count);
     CHK ("task_info_command: task_threads", ret);
-    
+
     printf_filtered (" Thread count  : %d\n", thread_count);
 
     consume_send_rights (thread_list, thread_count);
-    ret = vm_deallocate(mach_task_self(),
-                       (vm_address_t)thread_list, 
-                       (thread_count * sizeof(int)));
-    CHK("Error trying to deallocate thread list", ret);
+    ret = vm_deallocate (mach_task_self (),
+                        (vm_address_t) thread_list,
+                        (thread_count * sizeof (int)));
+    CHK ("Error trying to deallocate thread list", ret);
   }
   if (have_emulator_p (task))
     printf_filtered (" Emulator at   : 0x%x..0x%x\n",
@@ -3418,8 +3465,9 @@ exception_command (args, from_tty)
   if (!args)
     error_no_arg ("exception number action");
 
-  while (*scan == ' ' || *scan == '\t') scan++;
-  
+  while (*scan == ' ' || *scan == '\t')
+    scan++;
+
   if ('0' <= *scan && *scan <= '9')
     while ('0' <= *scan && *scan <= '9')
       scan++;
@@ -3434,7 +3482,8 @@ exception_command (args, from_tty)
   if (*scan != ' ' && *scan != '\t')
     error ("exception number must be followed by a space");
   else
-    while (*scan == ' ' || *scan == '\t') scan++;
+    while (*scan == ' ' || *scan == '\t')
+      scan++;
 
   args = scan;
   len = 0;
@@ -3445,12 +3494,12 @@ exception_command (args, from_tty)
     }
 
   if (!len)
-    error("exception number action");
+    error ("exception number action");
 
   if (!strncasecmp (args, "forward", len))
-    exception_map[ exception ].forward = TRUE;
+    exception_map[exception].forward = TRUE;
   else if (!strncasecmp (args, "keep", len))
-    exception_map[ exception ].forward = FALSE;
+    exception_map[exception].forward = FALSE;
   else
     error ("exception action is either \"keep\" or \"forward\"");
 }
@@ -3459,17 +3508,17 @@ static void
 print_exception_info (exception)
      int exception;
 {
-  boolean_t forward = exception_map[ exception ].forward;
+  boolean_t forward = exception_map[exception].forward;
 
-  printf_filtered ("%s\t(%d): ", exception_map[ exception ].name,
+  printf_filtered ("%s\t(%d): ", exception_map[exception].name,
                   exception);
   if (!forward)
-    if (exception_map[ exception ].sigmap != SIG_UNKNOWN)
+    if (exception_map[exception].sigmap != SIG_UNKNOWN)
       printf_filtered ("keep and handle as signal %d\n",
-                      exception_map[ exception ].sigmap);
+                      exception_map[exception].sigmap);
     else
       printf_filtered ("keep and handle as unknown signal %d\n",
-                      exception_map[ exception ].sigmap);
+                      exception_map[exception].sigmap);
   else
     printf_filtered ("forward exception to inferior\n");
 }
@@ -3504,7 +3553,7 @@ mach3_exception_actions (w, force_print_only, who)
 {
   boolean_t force_print = FALSE;
 
-  
+
   if (force_print_only ||
       exception_map[stop_exception].sigmap == SIG_UNKNOWN)
     force_print = TRUE;
@@ -3514,42 +3563,43 @@ mach3_exception_actions (w, force_print_only, who)
   if (exception_map[stop_exception].print || force_print)
     {
       target_terminal_ours ();
-      
+
       printf_filtered ("\n%s received %s exception : ",
                       who,
                       exception_map[stop_exception].name);
-      
+
       wrap_here ("   ");
 
-      switch(stop_exception) {
-      case EXC_BAD_ACCESS:
-       printf_filtered ("referencing address 0x%x : %s\n",
-                        stop_subcode,
-                        mach_error_string (stop_code));
-       break;
-      case EXC_BAD_INSTRUCTION:
-       printf_filtered
-         ("illegal or undefined instruction. code %d subcode %d\n",
-          stop_code, stop_subcode);
-       break;
-      case EXC_ARITHMETIC:
-       printf_filtered ("code %d\n", stop_code);
-       break;
-      case EXC_EMULATION:
-       printf_filtered ("code %d subcode %d\n", stop_code, stop_subcode);
-       break;
-      case EXC_SOFTWARE:
-       printf_filtered ("%s specific, code 0x%x\n",
-                        stop_code < 0xffff ? "hardware" : "os emulation",
-                        stop_code);
-       break;
-      case EXC_BREAKPOINT:
-       printf_filtered ("type %d (machine dependent)\n",
-                        stop_code);
-       break;
-      default:
-       fatal ("Unknown exception");
-      }
+      switch (stop_exception)
+       {
+       case EXC_BAD_ACCESS:
+         printf_filtered ("referencing address 0x%x : %s\n",
+                          stop_subcode,
+                          mach_error_string (stop_code));
+         break;
+       case EXC_BAD_INSTRUCTION:
+         printf_filtered
+           ("illegal or undefined instruction. code %d subcode %d\n",
+            stop_code, stop_subcode);
+         break;
+       case EXC_ARITHMETIC:
+         printf_filtered ("code %d\n", stop_code);
+         break;
+       case EXC_EMULATION:
+         printf_filtered ("code %d subcode %d\n", stop_code, stop_subcode);
+         break;
+       case EXC_SOFTWARE:
+         printf_filtered ("%s specific, code 0x%x\n",
+                          stop_code < 0xffff ? "hardware" : "os emulation",
+                          stop_code);
+         break;
+       case EXC_BREAKPOINT:
+         printf_filtered ("type %d (machine dependent)\n",
+                          stop_code);
+         break;
+       default:
+         fatal ("Unknown exception");
+       }
     }
 }
 \f
@@ -3565,22 +3615,22 @@ setup_notify_port (create_new)
     }
 
   our_notify_port = MACH_PORT_NULL;
-  notify_chain    = (port_chain_t) NULL;
+  notify_chain = (port_chain_t) NULL;
   port_chain_destroy (port_chain_obstack);
 
   if (create_new)
     {
-      ret = mach_port_allocate (mach_task_self(),
+      ret = mach_port_allocate (mach_task_self (),
                                MACH_PORT_RIGHT_RECEIVE,
                                &our_notify_port);
       if (ret != KERN_SUCCESS)
-       fatal("Creating notify port %s", mach_error_string(ret));
-      
-      ret = mach_port_move_member(mach_task_self(), 
-                                 our_notify_port,
-                                 inferior_wait_port_set);
+       fatal ("Creating notify port %s", mach_error_string (ret));
+
+      ret = mach_port_move_member (mach_task_self (),
+                                  our_notify_port,
+                                  inferior_wait_port_set);
       if (ret != KERN_SUCCESS)
-       fatal("initial move member %s",mach_error_string(ret));
+       fatal ("initial move member %s", mach_error_string (ret));
     }
 }
 
@@ -3596,7 +3646,7 @@ setup_notify_port (create_new)
  * Then, there should be a way to change it.
  */
 
-char registered_name[ MAX_NAME_LEN ];
+char registered_name[MAX_NAME_LEN];
 
 void
 message_port_info (args, from_tty)
@@ -3619,13 +3669,13 @@ gdb_register_port (name, port)
   static int already_signed = 0;
   int len;
 
-  if (! MACH_PORT_VALID (port) || !name || !*name)
+  if (!MACH_PORT_VALID (port) || !name || !*name)
     {
       warning ("Invalid registration request");
       return;
     }
 
-  if (! already_signed)
+  if (!already_signed)
     {
       ret = mach_port_insert_right (mach_task_self (),
                                    our_message_port,
@@ -3645,25 +3695,25 @@ gdb_register_port (name, port)
     }
 
   ret = netname_check_in (name_server_port,    /* Name server port */
-                         name,                 /* Name of service */
+                         name, /* Name of service */
                          our_message_port,     /* Signature */
-                         port);                /* Creates a new send right */
-  CHK("Failed to check in the port", ret);
-  
+                         port);        /* Creates a new send right */
+  CHK ("Failed to check in the port", ret);
+
   len = 0;
-  while(len < MAX_NAME_LEN && *(name+len))
+  while (len < MAX_NAME_LEN && *(name + len))
     {
-      registered_name[len] = *(name+len);
+      registered_name[len] = *(name + len);
       len++;
     }
   registered_name[len] = '\000';
   already_signed = 2;
-}  
+}
 
 struct cmd_list_element *cmd_thread_list;
 struct cmd_list_element *cmd_task_list;
 
-/*ARGSUSED*/
+/*ARGSUSED */
 static void
 thread_command (arg, from_tty)
      char *arg;
@@ -3673,7 +3723,7 @@ thread_command (arg, from_tty)
   help_list (cmd_thread_list, "thread ", -1, gdb_stdout);
 }
 
-/*ARGSUSED*/
+/*ARGSUSED */
 static void
 task_command (arg, from_tty)
      char *arg;
@@ -3690,15 +3740,15 @@ add_mach_specific_commands ()
   /* FIXME: Move our thread support into the generic thread.c stuff so we
      can share that code.  */
   add_prefix_cmd ("mthread", class_stack, thread_command,
-      "Generic command for handling Mach threads in the debugged task.",
-      &cmd_thread_list, "thread ", 0, &cmdlist);
+         "Generic command for handling Mach threads in the debugged task.",
+                 &cmd_thread_list, "thread ", 0, &cmdlist);
 
   add_com_alias ("th", "mthread", class_stack, 1);
 
-  add_cmd ("select", class_stack, thread_select_command, 
+  add_cmd ("select", class_stack, thread_select_command,
           "Select and print MID of the selected thread",
           &cmd_thread_list);
-  add_cmd ("list",   class_stack, thread_list_command,
+  add_cmd ("list", class_stack, thread_list_command,
           "List info of task's threads. Selected thread is marked with '*'",
           &cmd_thread_list);
   add_cmd ("suspend", class_run, thread_suspend_command,
@@ -3721,13 +3771,13 @@ add_mach_specific_commands ()
 #endif
   /* Thread command shorthands (for backward compatibility) */
   add_alias_cmd ("ts", "mthread select", 0, 0, &cmdlist);
-  add_alias_cmd ("tl", "mthread list",   0, 0, &cmdlist);
+  add_alias_cmd ("tl", "mthread list", 0, 0, &cmdlist);
 
   /* task handling commands */
 
   add_prefix_cmd ("task", class_stack, task_command,
-      "Generic command for handling debugged task.",
-      &cmd_task_list, "task ", 0, &cmdlist);
+                 "Generic command for handling debugged task.",
+                 &cmd_task_list, "task ", 0, &cmdlist);
 
   add_com_alias ("ta", "task", class_stack, 1);
 
@@ -3776,49 +3826,50 @@ do_mach_notify_dead_name (notify, name)
   /* Take name of from unreceived dead name notification list */
   notify_chain = port_chain_delete (notify_chain, name);
 
-  if (! element)
+  if (!element)
     error ("Received a dead name notify from unchained port (0x%x)", name);
-  
-  switch (element->type) {
 
-  case MACH_TYPE_THREAD:
-    target_terminal_ours_for_output ();
-    if (name == current_thread)
-      {
-       printf_filtered ("\nCurrent thread %d died", element->mid);
-       current_thread = MACH_PORT_NULL;
-      }
-    else
-      printf_filtered ("\nThread %d died", element->mid);
+  switch (element->type)
+    {
 
-    break;
+    case MACH_TYPE_THREAD:
+      target_terminal_ours_for_output ();
+      if (name == current_thread)
+       {
+         printf_filtered ("\nCurrent thread %d died", element->mid);
+         current_thread = MACH_PORT_NULL;
+       }
+      else
+       printf_filtered ("\nThread %d died", element->mid);
 
-  case MACH_TYPE_TASK:
-    target_terminal_ours_for_output ();
-    if (name != inferior_task)
-      printf_filtered ("Task %d died, but it was not the selected task",
-              element->mid);
-    else              
-      {
-       printf_filtered ("Current task %d died", element->mid);
-       
-       mach_port_destroy (mach_task_self(), name);
-       inferior_task = MACH_PORT_NULL;
-       
-       if (notify_chain)
-         warning ("There were still unreceived dead_name_notifications???");
-       
-       /* Destroy the old notifications */
-       setup_notify_port (0);
+      break;
 
-      }
-    break;
+    case MACH_TYPE_TASK:
+      target_terminal_ours_for_output ();
+      if (name != inferior_task)
+       printf_filtered ("Task %d died, but it was not the selected task",
+                        element->mid);
+      else
+       {
+         printf_filtered ("Current task %d died", element->mid);
 
-  default:
-    error ("Unregistered dead_name 0x%x notification received. Type is %d, mid is 0x%x",
-          name, element->type, element->mid);
-    break;
-  }
+         mach_port_destroy (mach_task_self (), name);
+         inferior_task = MACH_PORT_NULL;
+
+         if (notify_chain)
+           warning ("There were still unreceived dead_name_notifications???");
+
+         /* Destroy the old notifications */
+         setup_notify_port (0);
+
+       }
+      break;
+
+    default:
+      error ("Unregistered dead_name 0x%x notification received. Type is %d, mid is 0x%x",
+            name, element->type, element->mid);
+      break;
+    }
 
   return KERN_SUCCESS;
 }
@@ -3893,7 +3944,7 @@ kill_inferior_fast ()
   /* It's propably terminate already */
   (void) task_terminate (inferior_task);
 
-  inferior_task  = MACH_PORT_NULL;
+  inferior_task = MACH_PORT_NULL;
   current_thread = MACH_PORT_NULL;
 
   wait3 (&w, WNOHANG, 0);
@@ -3916,8 +3967,8 @@ m3_mourn_inferior ()
   unpush_target (&m3_ops);
   generic_mourn_inferior ();
 }
-
 \f
+
 /* Fork an inferior process, and start debugging it.  */
 
 static void
@@ -3929,7 +3980,7 @@ m3_create_inferior (exec_file, allargs, env)
   fork_inferior (exec_file, allargs, env, m3_trace_me, m3_trace_him, NULL, NULL);
   /* We are at the first instruction we care about.  */
   /* Pedal to the metal... */
-  proceed ((CORE_ADDR) -1, 0, 0);
+  proceed ((CORE_ADDR) - 1, 0, 0);
 }
 
 /* Mark our target-struct as eligible for stray "run" and "attach"
@@ -3943,8 +3994,8 @@ m3_can_run ()
 /* Mach 3.0 does not need ptrace for anything
  * Make sure nobody uses it on mach.
  */
-ptrace (a,b,c,d)
-int a,b,c,d;
+ptrace (a, b, c, d)
+     int a, b, c, d;
 {
   error ("Lose, Lose! Somebody called ptrace\n");
 }
@@ -3959,34 +4010,34 @@ m3_resume (pid, step, signal)
      int step;
      enum target_signal signal;
 {
-  kern_return_t        ret;
+  kern_return_t ret;
 
   if (step)
     {
       thread_basic_info_data_t th_info;
-      unsigned int            infoCnt = THREAD_BASIC_INFO_COUNT;
-      
+      unsigned int infoCnt = THREAD_BASIC_INFO_COUNT;
+
       /* There is no point in single stepping when current_thread
        * is dead.
        */
-      if (! MACH_PORT_VALID (current_thread))
+      if (!MACH_PORT_VALID (current_thread))
        error ("No thread selected; can not single step");
-      
+
       /* If current_thread is suspended, tracing it would never return.
        */
       ret = thread_info (current_thread,
                         THREAD_BASIC_INFO,
-                        (thread_info_t) &th_info,
+                        (thread_info_t) & th_info,
                         &infoCnt);
       CHK ("child_resume: can't get thread info", ret);
-      
+
       if (th_info.suspend_count)
        error ("Can't trace a suspended thread. Use \"thread resume\" command to resume it");
     }
 
   vm_read_cache_valid = FALSE;
 
-  if (signal && inferior_pid > 0) /* Do not signal, if attached by MID */
+  if (signal && inferior_pid > 0)      /* Do not signal, if attached by MID */
     kill (inferior_pid, target_signal_to_host (signal));
 
   if (step)
@@ -3994,20 +4045,20 @@ m3_resume (pid, step, signal)
       suspend_all_threads (0);
 
       setup_single_step (current_thread, TRUE);
-      
+
       ret = thread_resume (current_thread);
       CHK ("thread_resume", ret);
     }
-  
+
   ret = task_resume (inferior_task);
   if (ret == KERN_FAILURE)
     warning ("Task was not suspended");
   else
     CHK ("Resuming task", ret);
-  
+
   /* HACK HACK This is needed by the multiserver system HACK HACK */
-  while ((ret = task_resume(inferior_task)) == KERN_SUCCESS)
-    /* make sure it really runs */;
+  while ((ret = task_resume (inferior_task)) == KERN_SUCCESS)
+    /* make sure it really runs */ ;
   /* HACK HACK This is needed by the multiserver system HACK HACK */
 }
 \f
@@ -4016,13 +4067,13 @@ m3_resume (pid, step, signal)
 /* Start debugging the process with the given task */
 void
 task_attach (tid)
-  task_t tid;
+     task_t tid;
 {
   kern_return_t ret;
   inferior_task = tid;
 
   ret = task_suspend (inferior_task);
-  CHK("task_attach: task_suspend", ret);
+  CHK ("task_attach: task_suspend", ret);
 
   must_suspend_thread = 0;
 
@@ -4031,7 +4082,7 @@ task_attach (tid)
   request_notify (inferior_task, MACH_NOTIFY_DEAD_NAME, MACH_TYPE_TASK);
 
   setup_exception_port ();
-  
+
   emulator_present = have_emulator_p (inferior_task);
 
   attach_flag = 1;
@@ -4053,16 +4104,16 @@ attach_to_thread ()
 }
 
 mid_attach (mid)
-    int        mid;
+     int mid;
 {
-    kern_return_t ret;
+  kern_return_t ret;
 
-    ret = machid_mach_port (mid_server, mid_auth, mid, &inferior_task);
-    CHK("mid_attach: machid_mach_port", ret);
+  ret = machid_mach_port (mid_server, mid_auth, mid, &inferior_task);
+  CHK ("mid_attach: machid_mach_port", ret);
 
-    task_attach (inferior_task);
+  task_attach (inferior_task);
 
-    return mid;
+  return mid;
 }
 
 /* 
@@ -4080,10 +4131,10 @@ m3_do_attach (pid)
   kern_return_t ret;
 
   if (pid == 0)
-    error("MID=0, Debugging the master unix server does not compute");
+    error ("MID=0, Debugging the master unix server does not compute");
 
   /* Foo. This assumes gdb has a unix pid */
-  if (pid == getpid())
+  if (pid == getpid ())
     error ("I will debug myself only by mid. (Gdb would suspend itself!)");
 
   if (pid < 0)
@@ -4097,8 +4148,8 @@ m3_do_attach (pid)
     }
 
   inferior_task = task_by_pid (pid);
-  if (! MACH_PORT_VALID (inferior_task))
-    error("Cannot map Unix pid %d to Mach task port", pid);
+  if (!MACH_PORT_VALID (inferior_task))
+    error ("Cannot map Unix pid %d to Mach task port", pid);
 
   task_attach (inferior_task);
 
@@ -4123,7 +4174,7 @@ m3_attach (args, from_tty)
 
   pid = atoi (args);
 
-  if (pid == getpid())         /* Trying to masturbate? */
+  if (pid == getpid ())                /* Trying to masturbate? */
     error ("I refuse to debug myself!");
 
   if (from_tty)
@@ -4146,9 +4197,9 @@ m3_attach (args, from_tty)
 void
 deallocate_inferior_ports ()
 {
-  kern_return_t  ret;
+  kern_return_t ret;
   thread_array_t thread_list;
-  int           thread_count, index;
+  int thread_count, index;
 
   if (!MACH_PORT_VALID (inferior_task))
     return;
@@ -4157,7 +4208,7 @@ deallocate_inferior_ports ()
   if (ret != KERN_SUCCESS)
     {
       warning ("deallocate_inferior_ports: task_threads",
-              mach_error_string(ret));
+              mach_error_string (ret));
       return;
     }
 
@@ -4169,7 +4220,7 @@ deallocate_inferior_ports ()
                                thread_list[index],
                                MACH_PORT_RIGHT_SEND,
                                &rights);
-      CHK("deallocate_inferior_ports: get refs", ret);
+      CHK ("deallocate_inferior_ports: get refs", ret);
 
       if (rights > 0)
        {
@@ -4177,7 +4228,7 @@ deallocate_inferior_ports ()
                                    thread_list[index],
                                    MACH_PORT_RIGHT_SEND,
                                    -rights);
-         CHK("deallocate_inferior_ports: mod refs", ret);
+         CHK ("deallocate_inferior_ports: mod refs", ret);
        }
     }
 
@@ -4192,7 +4243,7 @@ deallocate_inferior_ports ()
   CHK ("deallocate_task_port: deallocating inferior_task", ret);
 
   current_thread = MACH_PORT_NULL;
-  inferior_task  = MACH_PORT_NULL;
+  inferior_task = MACH_PORT_NULL;
 }
 
 /* Stop debugging the process whose number is PID
@@ -4218,7 +4269,7 @@ m3_do_detach (signal)
     }
 
   ret = task_set_special_port (inferior_task,
-                              TASK_EXCEPTION_PORT, 
+                              TASK_EXCEPTION_PORT,
                               inferior_old_exception_port);
   CHK ("task_set_special_port", ret);
 
@@ -4227,15 +4278,15 @@ m3_do_detach (signal)
 
   if (remove_breakpoints ())
     warning ("Could not remove breakpoints when detaching");
-  
+
   if (signal && inferior_pid > 0)
     kill (inferior_pid, signal);
-  
+
   /* the task might be dead by now */
   (void) task_resume (inferior_task);
-  
+
   deallocate_inferior_ports ();
-  
+
   attach_flag = 0;
 }
 
@@ -4260,15 +4311,15 @@ m3_detach (args, from_tty)
       if (exec_file == 0)
        exec_file = "";
       printf_unfiltered ("Detaching from program: %s %s\n",
-             exec_file, target_pid_to_str (inferior_pid));
+                        exec_file, target_pid_to_str (inferior_pid));
       gdb_flush (gdb_stdout);
     }
   if (args)
     siggnal = atoi (args);
-  
+
   m3_do_detach (siggnal);
   inferior_pid = 0;
-  unpush_target (&m3_ops);             /* Pop out of handling an inferior */
+  unpush_target (&m3_ops);     /* Pop out of handling an inferior */
 }
 #endif /* ATTACH_DETACH */
 
@@ -4294,7 +4345,7 @@ m3_files_info (ignore)
 {
   /* FIXME: should print MID and all that crap.  */
   printf_unfiltered ("\tUsing the running image of %s %s.\n",
-                      attach_flag? "attached": "child", target_pid_to_str (inferior_pid));
+      attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
 }
 
 static void
@@ -4312,7 +4363,8 @@ m3_open (arg, from_tty)
 #define STR(x) "x"
 #endif
 
-char   *bsd1_names[] = {
+char *bsd1_names[] =
+{
   "execve",
   "fork",
   "take_signal",
@@ -4380,146 +4432,159 @@ char  *bsd1_names[] = {
   "pid_by_task",
 };
 
-int    bsd1_nnames = sizeof(bsd1_names)/sizeof(bsd1_names[0]);
+int bsd1_nnames = sizeof (bsd1_names) / sizeof (bsd1_names[0]);
 
-char*
-name_str(name,buf)
+char *
+name_str (name, buf)
 
-int    name;
-char   *buf;
+     int name;
+     char *buf;
 
 {
-  switch (name) {
-  case MACH_MSG_TYPE_BOOLEAN:
-    return "boolean";
-  case MACH_MSG_TYPE_INTEGER_16:
-    return "short";
-  case MACH_MSG_TYPE_INTEGER_32:
-    return "long";
-  case MACH_MSG_TYPE_CHAR:
-    return "char";
-  case MACH_MSG_TYPE_BYTE:
-    return "byte";
-  case MACH_MSG_TYPE_REAL:
-    return "real";
-  case MACH_MSG_TYPE_STRING:
-    return "string";
-  default:
-    sprintf(buf,"%d",name);
-    return buf;
-  }
+  switch (name)
+    {
+    case MACH_MSG_TYPE_BOOLEAN:
+      return "boolean";
+    case MACH_MSG_TYPE_INTEGER_16:
+      return "short";
+    case MACH_MSG_TYPE_INTEGER_32:
+      return "long";
+    case MACH_MSG_TYPE_CHAR:
+      return "char";
+    case MACH_MSG_TYPE_BYTE:
+      return "byte";
+    case MACH_MSG_TYPE_REAL:
+      return "real";
+    case MACH_MSG_TYPE_STRING:
+      return "string";
+    default:
+      sprintf (buf, "%d", name);
+      return buf;
+    }
 }
 
 char *
-id_str(id,buf)
+id_str (id, buf)
 
-int    id;
-char   *buf;
+     int id;
+     char *buf;
 
 {
-  char *p;
-  if (id >= 101000 && id < 101000+bsd1_nnames) {
-    if (p = bsd1_names[id-101000])
-      return p;
-  }
+  char *p;
+  if (id >= 101000 && id < 101000 + bsd1_nnames)
+    {
+      if (p = bsd1_names[id - 101000])
+       return p;
+    }
   if (id == 102000)
     return "psignal_retry";
   if (id == 100000)
     return "syscall";
-  sprintf(buf,"%d",id);
+  sprintf (buf, "%d", id);
   return buf;
 }
 
-print_msg(mp)
-mach_msg_header_t      *mp;
+print_msg (mp)
+     mach_msg_header_t *mp;
 {
-  char *fmt_x = "%20s : 0x%08x\n";
-  char *fmt_d = "%20s : %10d\n";
-  char *fmt_s = "%20s : %s\n";
-  char buf[100];
+  char *fmt_x = "%20s : 0x%08x\n";
+  char *fmt_d = "%20s : %10d\n";
+  char *fmt_s = "%20s : %s\n";
+  char buf[100];
 
   puts_filtered ("\n");
 #define pr(fmt,h,x) printf_filtered(fmt,STR(x),(h).x)
-  pr(fmt_x,(*mp),msgh_bits);
-  pr(fmt_d,(*mp),msgh_size);
-  pr(fmt_x,(*mp),msgh_remote_port);
-  pr(fmt_x,(*mp),msgh_local_port);
-  pr(fmt_d,(*mp),msgh_kind);
-  printf_filtered(fmt_s,STR(msgh_id),id_str(mp->msgh_id,buf));
-  
+  pr (fmt_x, (*mp), msgh_bits);
+  pr (fmt_d, (*mp), msgh_size);
+  pr (fmt_x, (*mp), msgh_remote_port);
+  pr (fmt_x, (*mp), msgh_local_port);
+  pr (fmt_d, (*mp), msgh_kind);
+  printf_filtered (fmt_s, STR (msgh_id), id_str (mp->msgh_id, buf));
+
   if (debug_level > 1)
-  {
-    char       *p,*ep,*dp;
-    int                plen;
-    p = (char*)mp;
-    ep = p+mp->msgh_size;
-    p += sizeof(*mp);
-    for(; p < ep; p += plen) {
-      mach_msg_type_t  *tp;
-      mach_msg_type_long_t     *tlp;
-      int      name,size,number;
-      tp = (mach_msg_type_t*)p;
-      if (tp->msgt_longform) {
-       tlp = (mach_msg_type_long_t*)tp;
-       name = tlp->msgtl_name;
-       size = tlp->msgtl_size;
-       number = tlp->msgtl_number;
-       plen = sizeof(*tlp);
-      } else {
-       name = tp->msgt_name;
-       size = tp->msgt_size;
-       number = tp->msgt_number;
-       plen = sizeof(*tp);
-      }
-      printf_filtered("name=%-16s size=%2d number=%7d inline=%d long=%d deal=%d\n",
-                     name_str(name,buf),size,number,tp->msgt_inline,
-                     tp->msgt_longform, tp->msgt_deallocate);
-      dp = p+plen;
-      if (tp->msgt_inline) {
-       int     l;
-       l = size*number/8;
-       l = (l+sizeof(long)-1)&~((sizeof(long))-1);
-       plen += l;
-       print_data(dp,size,number);
-      } else {
-       plen += sizeof(int*);
-      }
-      printf_filtered("plen=%d\n",plen);
+    {
+      char *p, *ep, *dp;
+      int plen;
+      p = (char *) mp;
+      ep = p + mp->msgh_size;
+      p += sizeof (*mp);
+      for (; p < ep; p += plen)
+       {
+         mach_msg_type_t *tp;
+         mach_msg_type_long_t *tlp;
+         int name, size, number;
+         tp = (mach_msg_type_t *) p;
+         if (tp->msgt_longform)
+           {
+             tlp = (mach_msg_type_long_t *) tp;
+             name = tlp->msgtl_name;
+             size = tlp->msgtl_size;
+             number = tlp->msgtl_number;
+             plen = sizeof (*tlp);
+           }
+         else
+           {
+             name = tp->msgt_name;
+             size = tp->msgt_size;
+             number = tp->msgt_number;
+             plen = sizeof (*tp);
+           }
+         printf_filtered ("name=%-16s size=%2d number=%7d inline=%d long=%d deal=%d\n",
+                       name_str (name, buf), size, number, tp->msgt_inline,
+                          tp->msgt_longform, tp->msgt_deallocate);
+         dp = p + plen;
+         if (tp->msgt_inline)
+           {
+             int l;
+             l = size * number / 8;
+             l = (l + sizeof (long) - 1) & ~((sizeof (long)) - 1);
+             plen += l;
+             print_data (dp, size, number);
+           }
+         else
+           {
+             plen += sizeof (int *);
+           }
+         printf_filtered ("plen=%d\n", plen);
+       }
     }
-  }
 }
 
-print_data(p,size,number)
+print_data (p, size, number)
 
-char   *p;
+     char *p;
 
 {
-  int  *ip;
-  short        *sp;
-  int  i;
-
-  switch (size) {
-  case 8:
-    for(i = 0; i < number; i++) {
-      printf_filtered(" %02x",p[i]);
-    }
-    break;
-  case 16:
-    sp = (short*)p;
-    for(i = 0; i < number; i++) {
-      printf_filtered(" %04x",sp[i]);
-    }
-    break;
-  case 32:
-    ip = (int*)p;
-    for(i = 0; i < number; i++) {
-      printf_filtered(" %08x",ip[i]);
+  int *ip;
+  short *sp;
+  int i;
+
+  switch (size)
+    {
+    case 8:
+      for (i = 0; i < number; i++)
+       {
+         printf_filtered (" %02x", p[i]);
+       }
+      break;
+    case 16:
+      sp = (short *) p;
+      for (i = 0; i < number; i++)
+       {
+         printf_filtered (" %04x", sp[i]);
+       }
+      break;
+    case 32:
+      ip = (int *) p;
+      for (i = 0; i < number; i++)
+       {
+         printf_filtered (" %08x", ip[i]);
+       }
+      break;
     }
-    break;
-  }
-  puts_filtered("\n");
+  puts_filtered ("\n");
 }
-#endif  DUMP_SYSCALL
+#endif /* DUMP_SYSCALL */
 
 static void
 m3_stop ()
@@ -4529,10 +4594,10 @@ m3_stop ()
 
 static char *
 m3_pid_to_exec_file (pid)
-int  pid;
+     int pid;
 {
   error ("to_pid_to_exec_file target function not implemented");
-  return NULL;  /* To keep all compilers happy. */
+  return NULL;                 /* To keep all compilers happy. */
 }
 
 static void
@@ -4581,36 +4646,36 @@ _initialize_m3_nat ()
   init_m3_ops ();
   add_target (&m3_ops);
 
-  ret = mach_port_allocate(mach_task_self(), 
-                          MACH_PORT_RIGHT_PORT_SET,
-                          &inferior_wait_port_set);
+  ret = mach_port_allocate (mach_task_self (),
+                           MACH_PORT_RIGHT_PORT_SET,
+                           &inferior_wait_port_set);
   if (ret != KERN_SUCCESS)
-    fatal("initial port set %s",mach_error_string(ret));
+    fatal ("initial port set %s", mach_error_string (ret));
 
   /* mach_really_wait now waits for this */
   currently_waiting_for = inferior_wait_port_set;
 
-  ret = netname_look_up(name_server_port, hostname, "MachID", &mid_server);
+  ret = netname_look_up (name_server_port, hostname, "MachID", &mid_server);
   if (ret != KERN_SUCCESS)
     {
       mid_server = MACH_PORT_NULL;
-      
+
       warning ("initialize machid: netname_lookup_up(MachID) : %s",
-              mach_error_string(ret));
+              mach_error_string (ret));
       warning ("Some (most?) features disabled...");
     }
-  
-  mid_auth = mach_privileged_host_port();
+
+  mid_auth = mach_privileged_host_port ();
   if (mid_auth == MACH_PORT_NULL)
-    mid_auth = mach_task_self();
-  
+    mid_auth = mach_task_self ();
+
   obstack_init (port_chain_obstack);
 
-  ret = mach_port_allocate (mach_task_self (), 
+  ret = mach_port_allocate (mach_task_self (),
                            MACH_PORT_RIGHT_RECEIVE,
                            &thread_exception_port);
   CHK ("Creating thread_exception_port for single stepping", ret);
-  
+
   ret = mach_port_insert_right (mach_task_self (),
                                thread_exception_port,
                                thread_exception_port,
@@ -4625,10 +4690,10 @@ _initialize_m3_nat ()
     warning ("Creating message port %s", mach_error_string (ret));
   else
     {
-      char buf[ MAX_NAME_LEN ];
-      ret = mach_port_move_member(mach_task_self (),
-                                 our_message_port,
-                                 inferior_wait_port_set);
+      char buf[MAX_NAME_LEN];
+      ret = mach_port_move_member (mach_task_self (),
+                                  our_message_port,
+                                  inferior_wait_port_set);
       if (ret != KERN_SUCCESS)
        warning ("message move member %s", mach_error_string (ret));
 
@@ -4638,7 +4703,7 @@ _initialize_m3_nat ()
       sprintf (buf, "gdb-%d", getpid ());
       gdb_register_port (buf, our_message_port);
     }
-  
+
   /* Heap for thread commands */
   obstack_init (cproc_obstack);
 
index ac18e1c6cc5bfa1c2073ae8cf99e6fc5a4aa6101..bbcc1c0cf7b6b31d807e48e40e87360deba93b16 100644 (file)
@@ -4,21 +4,22 @@
 
    Adapted by Michael Snyder of Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module defines communication with the Mitsubishi m32r monitor */
 
@@ -30,10 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "symtab.h"
 #include "command.h"
 #include "gdbcmd.h"
-#include "symfile.h"   /* for generic load */
-#include <time.h>      /* for time_t */
+#include "symfile.h"           /* for generic load */
+#include <time.h>              /* for time_t */
 #include "gdb_string.h"
-#include "objfiles.h"  /* for ALL_OBJFILES etc. */
+#include "objfiles.h"          /* for ALL_OBJFILES etc. */
 
 
 extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t));
@@ -43,10 +44,10 @@ extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t))
  * All this stuff just to get my host computer's IP address!
  */
 #include <sys/types.h>
-#include <netdb.h>     /* for hostent */
-#include <netinet/in.h>        /* for struct in_addr */
+#include <netdb.h>             /* for hostent */
+#include <netinet/in.h>                /* for struct in_addr */
 #if 1
-#include <arpa/inet.h> /* for inet_ntoa */
+#include <arpa/inet.h>         /* for inet_ntoa */
 #endif
 #endif
 
@@ -61,15 +62,15 @@ static char *download_path; /* user-settable path for SREC files     */
 
 static void
 m32r_load_section (abfd, s, data_count)
-     bfd      *abfd;
+     bfd *abfd;
      asection *s;
      unsigned int *data_count;
 {
   if (s->flags & SEC_LOAD)
     {
       bfd_size_type section_size = bfd_section_size (abfd, s);
-      bfd_vma       section_base = bfd_section_lma  (abfd, s);
-      unsigned int  buffer, i;
+      bfd_vma section_base = bfd_section_lma (abfd, s);
+      unsigned int buffer, i;
 
       *data_count += section_size;
 
@@ -78,7 +79,7 @@ m32r_load_section (abfd, s, data_count)
       print_address_numeric (section_base, 1, gdb_stdout);
       printf_filtered ("\n");
       gdb_flush (gdb_stdout);
-      monitor_printf ("%x mw\r" , section_base);
+      monitor_printf ("%x mw\r", section_base);
       for (i = 0; i < section_size; i += 4)
        {
          QUIT;
@@ -92,7 +93,7 @@ m32r_load_section (abfd, s, data_count)
     }
 }
 
-static int 
+static int
 m32r_load_1 (dummy)
      void *dummy;
 {
@@ -107,9 +108,9 @@ m32r_load_1 (dummy)
  */
 
 static void
-m32r_load (filename, from_tty) 
-    char *filename;
-    int from_tty;
+m32r_load (filename, from_tty)
+     char *filename;
+     int from_tty;
 {
   extern int inferior_pid;
   bfd *abfd;
@@ -131,8 +132,8 @@ m32r_load (filename, from_tty)
     if (s->flags & SEC_LOAD)
       {
        bfd_size_type section_size = bfd_section_size (abfd, s);
-       bfd_vma       section_base = bfd_section_vma  (abfd, s);
-       unsigned int  buffer;
+       bfd_vma section_base = bfd_section_vma (abfd, s);
+       unsigned int buffer;
 
        data_count += section_size;
 
@@ -140,8 +141,8 @@ m32r_load (filename, from_tty)
                         bfd_section_name (abfd, s), section_size);
        print_address_numeric (section_base, 1, gdb_stdout);
        printf_filtered ("\n");
-       gdb_flush (gdb_stdout);
-       monitor_printf ("%x mw\r" , section_base);
+       gdb_flush (gdb_stdout);
+       monitor_printf ("%x mw\r", section_base);
        for (i = 0; i < section_size; i += 4)
          {
            monitor_expect (" -> ", NULL, 0);
@@ -167,7 +168,7 @@ m32r_load (filename, from_tty)
   if (exec_bfd)
     write_pc (bfd_get_start_address (exec_bfd));
 
-  inferior_pid = 0;             /* No process now */
+  inferior_pid = 0;            /* No process now */
 
   /* This is necessary because many things were based on the PC at the
      time that we attached to the monitor, which is no longer valid
@@ -180,9 +181,9 @@ m32r_load (filename, from_tty)
 }
 
 static void
-m32r_load_gen (filename, from_tty) 
-    char *filename;
-    int from_tty;
+m32r_load_gen (filename, from_tty)
+     char *filename;
+     int from_tty;
 {
   generic_load (filename, from_tty);
 }
@@ -195,10 +196,10 @@ static void mon2000_open PARAMS ((char *args, int from_tty));
    different names than GDB does, and don't support all the registers
    either. So, typing "info reg sp" becomes an "A7". */
 
-static char *m32r_regnames[] = 
-{ "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7", 
-  "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15", 
-  "psw", "cbr", "spi", "spu", "bpc", "pc",  "accl", "acch", 
+static char *m32r_regnames[] =
+{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "psw", "cbr", "spi", "spu", "bpc", "pc", "accl", "acch",
 };
 
 static void
@@ -209,19 +210,19 @@ m32r_supply_register (regname, regnamelen, val, vallen)
      int vallen;
 {
   int regno;
-  int num_regs = sizeof(m32r_regnames) / sizeof(m32r_regnames[0]);
+  int num_regs = sizeof (m32r_regnames) / sizeof (m32r_regnames[0]);
 
   for (regno = 0; regno < num_regs; regno++)
-    if (strncmp(regname, m32r_regnames[regno], regnamelen) == 0)
+    if (strncmp (regname, m32r_regnames[regno], regnamelen) == 0)
       break;
 
   if (regno >= num_regs)
-    return;            /* no match */
+    return;                    /* no match */
 
   if (regno == ACCL_REGNUM)
-    { /* special handling for 64-bit acc reg */
+    {                          /* special handling for 64-bit acc reg */
       monitor_supply_register (ACCH_REGNUM, val);
-      val = strchr (val, ':'); /* skip past ':' to get 2nd word */
+      val = strchr (val, ':'); /* skip past ':' to get 2nd word */
       if (val != NULL)
        monitor_supply_register (ACCL_REGNUM, val + 1);
     }
@@ -257,15 +258,15 @@ m32r_supply_register (regname, regnamelen, val, vallen)
          monitor_supply_register (CBR_REGNUM, (psw & 0x1) ? one : zero);
 #endif
 #ifdef BPC_REGNUM
-         monitor_supply_register (BPC_REGNUM, zero); /* KLUDGE:   (???????) */
+         monitor_supply_register (BPC_REGNUM, zero);   /* KLUDGE:   (???????) */
 #endif
 #ifdef BCARRY_REGNUM
-         monitor_supply_register (BCARRY_REGNUM, zero); /* KLUDGE: (??????) */
+         monitor_supply_register (BCARRY_REGNUM, zero);        /* KLUDGE: (??????) */
 #endif
-       }         
+       }
 
-      if (regno == SPI_REGNUM || regno == SPU_REGNUM)  
-       { /* special handling for stack pointer (spu or spi) */
+      if (regno == SPI_REGNUM || regno == SPU_REGNUM)
+       {                       /* special handling for stack pointer (spu or spi) */
          unsigned long stackmode = read_register (PSW_REGNUM) & 0x80;
 
          if (regno == SPI_REGNUM && !stackmode)        /* SP == SPI */
@@ -280,61 +281,62 @@ m32r_supply_register (regname, regnamelen, val, vallen)
 
 static struct target_ops m32r_ops;
 
-static char *m32r_inits[] = {"\r", NULL};
+static char *m32r_inits[] =
+{"\r", NULL};
 
-static struct monitor_ops m32r_cmds ;
+static struct monitor_ops m32r_cmds;
 
-static void 
-init_m32r_cmds(void)
+static void
+init_m32r_cmds (void)
 {
-  m32r_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_REGISTER_VALUE_FIRST;
-  m32r_cmds.init =   m32r_inits;               /* Init strings */
-  m32r_cmds.cont =   "go\r";                   /* continue command */
-  m32r_cmds.step =   "step\r";                 /* single step */
-  m32r_cmds.stop =   NULL;                     /* interrupt command */
-  m32r_cmds.set_break =   "%x +bp\r";          /* set a breakpoint */
-  m32r_cmds.clr_break =   "%x -bp\r";          /* clear a breakpoint */
-  m32r_cmds.clr_all_break =   "bpoff\r";       /* clear all breakpoints */
-  m32r_cmds.fill =   "%x %x %x fill\r";                /* fill (start length val) */
-  m32r_cmds.setmem.cmdb =     "%x 1 %x fill\r";        /* setmem.cmdb (addr, value) */
-  m32r_cmds.setmem.cmdw =     "%x 1 %x fillh\r";/* setmem.cmdw (addr, value) */
-  m32r_cmds.setmem.cmdl =     "%x 1 %x fillw\r";/* setmem.cmdl (addr, value) */
-  m32r_cmds.setmem.cmdll =     NULL;           /* setmem.cmdll (addr, value) */
-  m32r_cmds.setmem.resp_delim =     NULL;      /* setmem.resp_delim */
-  m32r_cmds.setmem.term =     NULL;            /* setmem.term */
-  m32r_cmds.setmem.term_cmd =     NULL;                /* setmem.term_cmd */
-  m32r_cmds.getmem.cmdb =     "%x %x dump\r";  /* getmem.cmdb (addr, len) */
-  m32r_cmds.getmem.cmdw =     NULL;            /* getmem.cmdw (addr, len) */
-  m32r_cmds.getmem.cmdl =     NULL;            /* getmem.cmdl (addr, len) */
-  m32r_cmds.getmem.cmdll =     NULL;           /* getmem.cmdll (addr, len) */
-  m32r_cmds.getmem.resp_delim =     ": ";      /* getmem.resp_delim */
-  m32r_cmds.getmem.term =     NULL;            /* getmem.term */
-  m32r_cmds.getmem.term_cmd =     NULL ;       /* getmem.term_cmd */
-  m32r_cmds.setreg.cmd =     "%x to %%%s\r";   /* setreg.cmd (name, value) */
-  m32r_cmds.setreg.resp_delim =     NULL;      /* setreg.resp_delim */
-  m32r_cmds.setreg.term =     NULL;            /* setreg.term */
-  m32r_cmds.setreg.term_cmd =     NULL ;       /* setreg.term_cmd */
-  m32r_cmds.getreg.cmd =     NULL;             /* getreg.cmd (name) */
-  m32r_cmds.getreg.resp_delim =     NULL;      /* getreg.resp_delim */
-  m32r_cmds.getreg.term =     NULL;            /* getreg.term */
-  m32r_cmds.getreg.term_cmd =     NULL ;       /* getreg.term_cmd */
-  m32r_cmds.dump_registers =   ".reg\r";       /* dump_registers */
-  m32r_cmds.register_pattern =   "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
-  m32r_cmds.supply_register =   m32r_supply_register;  /* supply_register */
-  m32r_cmds.load_routine =   NULL;             /* load_routine (defaults to SRECs) */
-  m32r_cmds.load =   NULL;                     /* download command */
-  m32r_cmds.loadresp =   NULL;                 /* load response */
-  m32r_cmds.prompt =   "ok ";                  /* monitor command prompt */
-  m32r_cmds.line_term =   "\r";                        /* end-of-line terminator */
-  m32r_cmds.cmd_end =   NULL;                  /* optional command terminator */
-  m32r_cmds.target =   &m32r_ops;              /* target operations */
-  m32r_cmds.stopbits =   SERIAL_1_STOPBITS;    /* number of stop bits */
-  m32r_cmds.regnames =   m32r_regnames;                /* registers names */
-  m32r_cmds.magic =   MONITOR_OPS_MAGIC        ;       /* magic */
-} /* init_m32r_cmds */
+  m32r_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_REGISTER_VALUE_FIRST;
+  m32r_cmds.init = m32r_inits; /* Init strings */
+  m32r_cmds.cont = "go\r";     /* continue command */
+  m32r_cmds.step = "step\r";   /* single step */
+  m32r_cmds.stop = NULL;       /* interrupt command */
+  m32r_cmds.set_break = "%x +bp\r";    /* set a breakpoint */
+  m32r_cmds.clr_break = "%x -bp\r";    /* clear a breakpoint */
+  m32r_cmds.clr_all_break = "bpoff\r"; /* clear all breakpoints */
+  m32r_cmds.fill = "%x %x %x fill\r";  /* fill (start length val) */
+  m32r_cmds.setmem.cmdb = "%x 1 %x fill\r";    /* setmem.cmdb (addr, value) */
+  m32r_cmds.setmem.cmdw = "%x 1 %x fillh\r";   /* setmem.cmdw (addr, value) */
+  m32r_cmds.setmem.cmdl = "%x 1 %x fillw\r";   /* setmem.cmdl (addr, value) */
+  m32r_cmds.setmem.cmdll = NULL;       /* setmem.cmdll (addr, value) */
+  m32r_cmds.setmem.resp_delim = NULL;  /* setmem.resp_delim */
+  m32r_cmds.setmem.term = NULL;        /* setmem.term */
+  m32r_cmds.setmem.term_cmd = NULL;    /* setmem.term_cmd */
+  m32r_cmds.getmem.cmdb = "%x %x dump\r";      /* getmem.cmdb (addr, len) */
+  m32r_cmds.getmem.cmdw = NULL;        /* getmem.cmdw (addr, len) */
+  m32r_cmds.getmem.cmdl = NULL;        /* getmem.cmdl (addr, len) */
+  m32r_cmds.getmem.cmdll = NULL;       /* getmem.cmdll (addr, len) */
+  m32r_cmds.getmem.resp_delim = ": ";  /* getmem.resp_delim */
+  m32r_cmds.getmem.term = NULL;        /* getmem.term */
+  m32r_cmds.getmem.term_cmd = NULL;    /* getmem.term_cmd */
+  m32r_cmds.setreg.cmd = "%x to %%%s\r";       /* setreg.cmd (name, value) */
+  m32r_cmds.setreg.resp_delim = NULL;  /* setreg.resp_delim */
+  m32r_cmds.setreg.term = NULL;        /* setreg.term */
+  m32r_cmds.setreg.term_cmd = NULL;    /* setreg.term_cmd */
+  m32r_cmds.getreg.cmd = NULL; /* getreg.cmd (name) */
+  m32r_cmds.getreg.resp_delim = NULL;  /* getreg.resp_delim */
+  m32r_cmds.getreg.term = NULL;        /* getreg.term */
+  m32r_cmds.getreg.term_cmd = NULL;    /* getreg.term_cmd */
+  m32r_cmds.dump_registers = ".reg\r"; /* dump_registers */
+  m32r_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)";  /* register_pattern */
+  m32r_cmds.supply_register = m32r_supply_register;    /* supply_register */
+  m32r_cmds.load_routine = NULL;       /* load_routine (defaults to SRECs) */
+  m32r_cmds.load = NULL;       /* download command */
+  m32r_cmds.loadresp = NULL;   /* load response */
+  m32r_cmds.prompt = "ok ";    /* monitor command prompt */
+  m32r_cmds.line_term = "\r";  /* end-of-line terminator */
+  m32r_cmds.cmd_end = NULL;    /* optional command terminator */
+  m32r_cmds.target = &m32r_ops;        /* target operations */
+  m32r_cmds.stopbits = SERIAL_1_STOPBITS;      /* number of stop bits */
+  m32r_cmds.regnames = m32r_regnames;  /* registers names */
+  m32r_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
+}                              /* init_m32r_cmds */
 
 static void
-m32r_open(args, from_tty)
+m32r_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -346,57 +348,57 @@ m32r_open(args, from_tty)
 static struct target_ops mon2000_ops;
 static struct monitor_ops mon2000_cmds;
 
-static void 
-init_mon2000_cmds(void)
+static void
+init_mon2000_cmds (void)
 {
-  mon2000_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_REGISTER_VALUE_FIRST;
-  mon2000_cmds.init =   m32r_inits;            /* Init strings */
-  mon2000_cmds.cont =   "go\r";                        /* continue command */
-  mon2000_cmds.step =   "step\r";                      /* single step */
-  mon2000_cmds.stop =   NULL;                  /* interrupt command */
-  mon2000_cmds.set_break =   "%x +bp\r";               /* set a breakpoint */
-  mon2000_cmds.clr_break =   "%x -bp\r";               /* clear a breakpoint */
-  mon2000_cmds.clr_all_break =   "bpoff\r";    /* clear all breakpoints */
-  mon2000_cmds.fill =   "%x %x %x fill\r";             /* fill (start length val) */
-  mon2000_cmds.setmem.cmdb =     "%x 1 %x fill\r";     /* setmem.cmdb (addr, value) */
-  mon2000_cmds.setmem.cmdw =     "%x 1 %x fillh\r";/* setmem.cmdw (addr, value) */
-  mon2000_cmds.setmem.cmdl =     "%x 1 %x fillw\r";/* setmem.cmdl (addr, value) */
-  mon2000_cmds.setmem.cmdll =     NULL;                /* setmem.cmdll (addr, value) */
-  mon2000_cmds.setmem.resp_delim =     NULL;   /* setmem.resp_delim */
-  mon2000_cmds.setmem.term =     NULL;         /* setmem.term */
-  mon2000_cmds.setmem.term_cmd =     NULL;             /* setmem.term_cmd */
-  mon2000_cmds.getmem.cmdb =     "%x %x dump\r";       /* getmem.cmdb (addr, len) */
-  mon2000_cmds.getmem.cmdw =     NULL;         /* getmem.cmdw (addr, len) */
-  mon2000_cmds.getmem.cmdl =     NULL;         /* getmem.cmdl (addr, len) */
-  mon2000_cmds.getmem.cmdll =     NULL;                /* getmem.cmdll (addr, len) */
-  mon2000_cmds.getmem.resp_delim =     ": ";   /* getmem.resp_delim */
-  mon2000_cmds.getmem.term =     NULL;         /* getmem.term */
-  mon2000_cmds.getmem.term_cmd =     NULL      ;       /* getmem.term_cmd */
-  mon2000_cmds.setreg.cmd =     "%x to %%%s\r";        /* setreg.cmd (name, value) */
-  mon2000_cmds.setreg.resp_delim =     NULL;   /* setreg.resp_delim */
-  mon2000_cmds.setreg.term =     NULL;         /* setreg.term */
-  mon2000_cmds.setreg.term_cmd =     NULL      ;       /* setreg.term_cmd */
-  mon2000_cmds.getreg.cmd =     NULL;          /* getreg.cmd (name) */
-  mon2000_cmds.getreg.resp_delim =     NULL;   /* getreg.resp_delim */
-  mon2000_cmds.getreg.term =     NULL;         /* getreg.term */
-  mon2000_cmds.getreg.term_cmd =     NULL      ;       /* getreg.term_cmd */
-  mon2000_cmds.dump_registers =   ".reg\r";    /* dump_registers */
-  mon2000_cmds.register_pattern =   "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
-  mon2000_cmds.supply_register =   m32r_supply_register;       /* supply_register */
-  mon2000_cmds.load_routine =   NULL;          /* load_routine (defaults to SRECs) */
-  mon2000_cmds.load =   NULL;                  /* download command */
-  mon2000_cmds.loadresp =   NULL;                      /* load response */
-  mon2000_cmds.prompt =   "Mon2000>";                  /* monitor command prompt */
-  mon2000_cmds.line_term =   "\r";                     /* end-of-line terminator */
-  mon2000_cmds.cmd_end =   NULL;                       /* optional command terminator */
-  mon2000_cmds.target =   &mon2000_ops;                /* target operations */
-  mon2000_cmds.stopbits =   SERIAL_1_STOPBITS; /* number of stop bits */
-  mon2000_cmds.regnames =   m32r_regnames;             /* registers names */
-  mon2000_cmds.magic =   MONITOR_OPS_MAGIC     ;       /* magic */
-} /* init_mon2000_cmds */
+  mon2000_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_REGISTER_VALUE_FIRST;
+  mon2000_cmds.init = m32r_inits;      /* Init strings */
+  mon2000_cmds.cont = "go\r";  /* continue command */
+  mon2000_cmds.step = "step\r";        /* single step */
+  mon2000_cmds.stop = NULL;    /* interrupt command */
+  mon2000_cmds.set_break = "%x +bp\r"; /* set a breakpoint */
+  mon2000_cmds.clr_break = "%x -bp\r"; /* clear a breakpoint */
+  mon2000_cmds.clr_all_break = "bpoff\r";      /* clear all breakpoints */
+  mon2000_cmds.fill = "%x %x %x fill\r";       /* fill (start length val) */
+  mon2000_cmds.setmem.cmdb = "%x 1 %x fill\r"; /* setmem.cmdb (addr, value) */
+  mon2000_cmds.setmem.cmdw = "%x 1 %x fillh\r";                /* setmem.cmdw (addr, value) */
+  mon2000_cmds.setmem.cmdl = "%x 1 %x fillw\r";                /* setmem.cmdl (addr, value) */
+  mon2000_cmds.setmem.cmdll = NULL;    /* setmem.cmdll (addr, value) */
+  mon2000_cmds.setmem.resp_delim = NULL;       /* setmem.resp_delim */
+  mon2000_cmds.setmem.term = NULL;     /* setmem.term */
+  mon2000_cmds.setmem.term_cmd = NULL; /* setmem.term_cmd */
+  mon2000_cmds.getmem.cmdb = "%x %x dump\r";   /* getmem.cmdb (addr, len) */
+  mon2000_cmds.getmem.cmdw = NULL;     /* getmem.cmdw (addr, len) */
+  mon2000_cmds.getmem.cmdl = NULL;     /* getmem.cmdl (addr, len) */
+  mon2000_cmds.getmem.cmdll = NULL;    /* getmem.cmdll (addr, len) */
+  mon2000_cmds.getmem.resp_delim = ": ";       /* getmem.resp_delim */
+  mon2000_cmds.getmem.term = NULL;     /* getmem.term */
+  mon2000_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
+  mon2000_cmds.setreg.cmd = "%x to %%%s\r";    /* setreg.cmd (name, value) */
+  mon2000_cmds.setreg.resp_delim = NULL;       /* setreg.resp_delim */
+  mon2000_cmds.setreg.term = NULL;     /* setreg.term */
+  mon2000_cmds.setreg.term_cmd = NULL; /* setreg.term_cmd */
+  mon2000_cmds.getreg.cmd = NULL;      /* getreg.cmd (name) */
+  mon2000_cmds.getreg.resp_delim = NULL;       /* getreg.resp_delim */
+  mon2000_cmds.getreg.term = NULL;     /* getreg.term */
+  mon2000_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
+  mon2000_cmds.dump_registers = ".reg\r";      /* dump_registers */
+  mon2000_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)";       /* register_pattern */
+  mon2000_cmds.supply_register = m32r_supply_register; /* supply_register */
+  mon2000_cmds.load_routine = NULL;    /* load_routine (defaults to SRECs) */
+  mon2000_cmds.load = NULL;    /* download command */
+  mon2000_cmds.loadresp = NULL;        /* load response */
+  mon2000_cmds.prompt = "Mon2000>";    /* monitor command prompt */
+  mon2000_cmds.line_term = "\r";       /* end-of-line terminator */
+  mon2000_cmds.cmd_end = NULL; /* optional command terminator */
+  mon2000_cmds.target = &mon2000_ops;  /* target operations */
+  mon2000_cmds.stopbits = SERIAL_1_STOPBITS;   /* number of stop bits */
+  mon2000_cmds.regnames = m32r_regnames;       /* registers names */
+  mon2000_cmds.magic = MONITOR_OPS_MAGIC;      /* magic */
+}                              /* init_mon2000_cmds */
 
 static void
-mon2000_open(args, from_tty)
+mon2000_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -411,7 +413,7 @@ mon2000_open(args, from_tty)
 static void
 m32r_set_board_address (args, from_tty)
      char *args;
-     int  from_tty;
+     int from_tty;
 {
   int resp_len;
   char buf[1024];
@@ -419,7 +421,7 @@ m32r_set_board_address (args, from_tty)
   if (args && *args)
     {
       monitor_printf ("ulip %s\n", args);
-      resp_len = monitor_expect_prompt (buf, sizeof(buf));
+      resp_len = monitor_expect_prompt (buf, sizeof (buf));
       /* now parse the result for success */
     }
   else
@@ -432,7 +434,7 @@ m32r_set_board_address (args, from_tty)
 static void
 m32r_set_server_address (args, from_tty)
      char *args;
-     int  from_tty;
+     int from_tty;
 {
   int resp_len;
   char buf[1024];
@@ -440,7 +442,7 @@ m32r_set_server_address (args, from_tty)
   if (args && *args)
     {
       monitor_printf ("uhip %s\n", args);
-      resp_len = monitor_expect_prompt (buf, sizeof(buf));
+      resp_len = monitor_expect_prompt (buf, sizeof (buf));
       /* now parse the result for success */
     }
   else
@@ -453,7 +455,7 @@ m32r_set_server_address (args, from_tty)
 static void
 m32r_set_download_path (args, from_tty)
      char *args;
-     int  from_tty;
+     int from_tty;
 {
   int resp_len;
   char buf[1024];
@@ -461,7 +463,7 @@ m32r_set_download_path (args, from_tty)
   if (args && *args)
     {
       monitor_printf ("up %s\n", args);
-      resp_len = monitor_expect_prompt (buf, sizeof(buf));
+      resp_len = monitor_expect_prompt (buf, sizeof (buf));
       /* now parse the result for success */
     }
   else
@@ -484,35 +486,35 @@ m32r_upload_command (args, from_tty)
 
   /* first check to see if there's an ethernet port! */
   monitor_printf ("ust\r");
-  resp_len = monitor_expect_prompt (buf, sizeof(buf));
+  resp_len = monitor_expect_prompt (buf, sizeof (buf));
   if (!strchr (buf, ':'))
     error ("No ethernet connection!");
 
   if (board_addr == 0)
     {
       /* scan second colon in the output from the "ust" command */
-      char * myIPaddress = strchr (strchr (buf, ':') + 1, ':') + 1;
+      char *myIPaddress = strchr (strchr (buf, ':') + 1, ':') + 1;
 
-      while (isspace(*myIPaddress))
+      while (isspace (*myIPaddress))
        myIPaddress++;
 
-      if (!strncmp (myIPaddress, "0.0.", 4))    /* empty */
+      if (!strncmp (myIPaddress, "0.0.", 4))   /* empty */
        error ("Please use 'set board-address' to set the M32R-EVA board's IP address.");
       if (strchr (myIPaddress, '('))
-       *(strchr (myIPaddress, '(')) = '\0';    /* delete trailing junk */
+       *(strchr (myIPaddress, '(')) = '\0';    /* delete trailing junk */
       board_addr = strsave (myIPaddress);
     }
   if (server_addr == 0)
     {
       buf[0] = 0;
-      gethostname (buf, sizeof(buf));
+      gethostname (buf, sizeof (buf));
       if (buf[0] != 0)
        hostent = gethostbyname (buf);
       if (hostent != 0)
        {
 #if 1
-         memcpy (&inet_addr.s_addr, hostent->h_addr, 
-                 sizeof(inet_addr.s_addr));
+         memcpy (&inet_addr.s_addr, hostent->h_addr,
+                 sizeof (inet_addr.s_addr));
          server_addr = (char *) inet_ntoa (inet_addr);
 #else
          server_addr = (char *) inet_ntoa (hostent->h_addr);
@@ -535,30 +537,30 @@ m32r_upload_command (args, from_tty)
 
   start_time = time (NULL);
   monitor_printf ("uhip %s\r", server_addr);
-  resp_len = monitor_expect_prompt (buf, sizeof(buf));  /* parse result? */
+  resp_len = monitor_expect_prompt (buf, sizeof (buf));                /* parse result? */
   monitor_printf ("ulip %s\r", board_addr);
-  resp_len = monitor_expect_prompt (buf, sizeof(buf));  /* parse result? */
+  resp_len = monitor_expect_prompt (buf, sizeof (buf));                /* parse result? */
   if (args[0] != '/')
     monitor_printf ("up %s\r", download_path); /* use default path */
   else
-    monitor_printf ("up\r");                   /* rooted filename/path */
-  resp_len = monitor_expect_prompt (buf, sizeof(buf));  /* parse result? */
+    monitor_printf ("up\r");   /* rooted filename/path */
+  resp_len = monitor_expect_prompt (buf, sizeof (buf));                /* parse result? */
 
   if (strrchr (args, '.') && !strcmp (strrchr (args, '.'), ".srec"))
     monitor_printf ("ul %s\r", args);
-  else                                 /* add ".srec" suffix */
+  else                         /* add ".srec" suffix */
     monitor_printf ("ul %s.srec\r", args);
-  resp_len = monitor_expect_prompt (buf, sizeof(buf));  /* parse result? */
+  resp_len = monitor_expect_prompt (buf, sizeof (buf));                /* parse result? */
 
-  if (buf[0] == 0 || strstr(buf, "complete") == 0)
-    error("Upload file not found: %s.srec\nCheck IP addresses and download path.", args);
+  if (buf[0] == 0 || strstr (buf, "complete") == 0)
+    error ("Upload file not found: %s.srec\nCheck IP addresses and download path.", args);
   else
     printf_filtered (" -- Ethernet load complete.\n");
 
   end_time = time (NULL);
   abfd = bfd_openr (args, 0);
   if (abfd != NULL)
-    { /* Download is done -- print section statistics */
+    {                          /* Download is done -- print section statistics */
       if (bfd_check_format (abfd, bfd_object) == 0)
        {
          printf_filtered ("File is not an object file\n");
@@ -567,8 +569,8 @@ m32r_upload_command (args, from_tty)
        if (s->flags & SEC_LOAD)
          {
            bfd_size_type section_size = bfd_section_size (abfd, s);
-           bfd_vma       section_base = bfd_section_lma  (abfd, s);
-           unsigned int  buffer;
+           bfd_vma section_base = bfd_section_lma (abfd, s);
+           unsigned int buffer;
 
            data_count += section_size;
 
@@ -583,7 +585,7 @@ m32r_upload_command (args, from_tty)
       report_transfer_performance (data_count, start_time, end_time);
       printf_filtered ("Start address 0x%lx\n", bfd_get_start_address (abfd));
     }
-  inferior_pid = 0;             /* No process now */
+  inferior_pid = 0;            /* No process now */
 
   /* This is necessary because many things were based on the PC at the
      time that we attached to the monitor, which is no longer valid
@@ -601,7 +603,7 @@ void
 _initialize_m32r_rom ()
 {
   /* Initialize m32r RevC monitor target */
-  init_m32r_cmds () ;
+  init_m32r_cmds ();
   init_monitor_ops (&m32r_ops);
 
   m32r_ops.to_shortname = "m32r";
@@ -642,12 +644,12 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   add_show_from_set
     (add_set_cmd ("server-address", class_obscure, var_string,
                  (char *) &server_addr,
-                 "Set IP address for download server (GDB's host computer).",
+               "Set IP address for download server (GDB's host computer).",
                  &setlist),
      &showlist);
 
   add_com ("upload", class_obscure, m32r_upload_command,
-          "Upload the srec file via the monitor's Ethernet upload capability."); 
+      "Upload the srec file via the monitor's Ethernet upload capability.");
 
   add_com ("tload", class_obscure, m32r_load, "test upload command.");
 #endif
index b0195e8cdbc8c1faf79c24f58a8b52b68ae319ce..476dcf3785d3e9b36a4aaecab0f0c1450e05d8d1 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the Mitsubishi m32r for GDB, the GNU debugger.
    Copyright 1996, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -44,24 +45,25 @@ m32r_use_struct_convention (gcc_p, type)
    Doesn't really work for dummy frames, but it does pass back
    an empty frame_saved_regs, so I guess that's better than total failure */
 
-void 
+void
 m32r_frame_find_saved_regs (fi, regaddr)
      struct frame_info *fi;
      struct frame_saved_regs *regaddr;
 {
-  memcpy(regaddr, &fi->fsr, sizeof(struct frame_saved_regs));
+  memcpy (regaddr, &fi->fsr, sizeof (struct frame_saved_regs));
 }
 
 /* Turn this on if you want to see just how much instruction decoding
    if being done, its quite a lot
  */
+ */
 #if 0
-static void dump_insn(char * commnt,CORE_ADDR pc, int insn)
+static void
+dump_insn (char *commnt, CORE_ADDR pc, int insn)
 {
-  printf_filtered("  %s %08x %08x ",
-                 commnt,(unsigned int)pc,(unsigned int) insn);
-  (*tm_print_insn)(pc,&tm_print_insn_info);
-  printf_filtered("\n");
+  printf_filtered ("  %s %08x %08x ",
+                  commnt, (unsigned int) pc, (unsigned int) insn);
+  (*tm_print_insn) (pc, &tm_print_insn_info);
+  printf_filtered ("\n");
 }
 #define insn_debug(args) { printf_filtered args; }
 #else
@@ -69,7 +71,7 @@ static void dump_insn(char * commnt,CORE_ADDR pc, int insn)
 #define insn_debug(args) {}
 #endif
 
-#define DEFAULT_SEARCH_LIMIT 44 
+#define DEFAULT_SEARCH_LIMIT 44
 
 /* Function: scan_prologue
    This function decodes the target function prologue to determine
@@ -78,43 +80,44 @@ static void dump_insn(char * commnt,CORE_ADDR pc, int insn)
    and returns the frame size.  */
 
 /*
-  The sequence it currently generates is:
-  
-       if (varargs function) { ddi sp,#n }
-       push registers
-       if (additional stack <= 256) {  addi sp,#-stack }
-       else if (additional stack < 65k) { add3 sp,sp,#-stack
-
-       } else if (additional stack) {
-       seth sp,#(stack & 0xffff0000)
-       or3 sp,sp,#(stack & 0x0000ffff)
-       sub sp,r4
-       }
-       if (frame pointer) {
-               mv sp,fp
-       }
+   The sequence it currently generates is:
+
+   if (varargs function) { ddi sp,#n }
+   push registers
+   if (additional stack <= 256) {       addi sp,#-stack }
+   else if (additional stack < 65k) { add3 sp,sp,#-stack
+
+   } else if (additional stack) {
+   seth sp,#(stack & 0xffff0000)
+   or3 sp,sp,#(stack & 0x0000ffff)
+   sub sp,r4
+   }
+   if (frame pointer) {
+   mv sp,fp
+   }
 
-These instructions are scheduled like everything else, so you should stop at
-the first branch instruction.
-*/
+   These instructions are scheduled like everything else, so you should stop at
+   the first branch instruction.
+
+ */
 
 /* This is required by skip prologue and by m32r_init_extra_frame_info. 
    The results of decoding a prologue should be cached because this
    thrashing is getting nuts.
    I am thinking of making a container class with two indexes, name and
    address. It may be better to extend the symbol table.
  */
+ */
 
-static void decode_prologue (start_pc, scan_limit, 
-                            pl_endptr, framelength, 
-                            fi, fsr)
+static void
+decode_prologue (start_pc, scan_limit,
+                pl_endptr, framelength,
+                fi, fsr)
      CORE_ADDR start_pc;
      CORE_ADDR scan_limit;
-     CORE_ADDR * pl_endptr;  /* var parameter */
-     unsigned long * framelength;
-     struct frame_info * fi;
-     struct frame_saved_regs * fsr;
+     CORE_ADDR *pl_endptr;     /* var parameter */
+     unsigned long *framelength;
+     struct frame_info *fi;
+     struct frame_saved_regs *fsr;
 {
   unsigned long framesize;
   int insn;
@@ -127,56 +130,58 @@ static void decode_prologue (start_pc, scan_limit,
 
   framesize = 0;
   after_prologue = 0;
-  insn_debug(("rd prolog l(%d)\n",scan_limit - current_pc));
+  insn_debug (("rd prolog l(%d)\n", scan_limit - current_pc));
 
   for (current_pc = start_pc; current_pc < scan_limit; current_pc += 2)
     {
 
       insn = read_memory_unsigned_integer (current_pc, 2);
-      dump_insn("insn-1",current_pc,insn);    /* MTZ */
-      
-       /* If this is a 32 bit instruction, we dont want to examine its
-        immediate data as though it were an instruction */
+      dump_insn ("insn-1", current_pc, insn);  /* MTZ */
+
+      /* If this is a 32 bit instruction, we dont want to examine its
+         immediate data as though it were an instruction */
       if (current_pc & 0x02)
-       { /* Clear the parallel execution bit from 16 bit instruction */
+       {                       /* Clear the parallel execution bit from 16 bit instruction */
          if (maybe_one_more)
-           { /* The last instruction was a branch, usually terminates
-                the series, but if this is a parallel instruction,
-                it may be a stack framing instruction */
-             if (! (insn & 0x8000))
-               { insn_debug(("Really done"));
-                 break; /* nope, we are really done */
+           {                   /* The last instruction was a branch, usually terminates
+                                  the series, but if this is a parallel instruction,
+                                  it may be a stack framing instruction */
+             if (!(insn & 0x8000))
+               {
+                 insn_debug (("Really done"));
+                 break;        /* nope, we are really done */
                }
            }
-         insn &= 0x7fff;        /* decode this instruction further */
+         insn &= 0x7fff;       /* decode this instruction further */
        }
       else
        {
-         if (maybe_one_more) 
-           break; /* This isnt the one more */
+         if (maybe_one_more)
+           break;              /* This isnt the one more */
          if (insn & 0x8000)
            {
-             insn_debug(("32 bit insn\n"));
+             insn_debug (("32 bit insn\n"));
              if (current_pc == scan_limit)
-               scan_limit += 2; /* extend the search */
-             current_pc += 2;   /* skip the immediate data */
-             if (insn == 0x8faf)                       /* add3 sp, sp, xxxx */
+               scan_limit += 2;        /* extend the search */
+             current_pc += 2;  /* skip the immediate data */
+             if (insn == 0x8faf)       /* add3 sp, sp, xxxx */
                /* add 16 bit sign-extended offset */
-               { insn_debug(("stack increment\n"));
-               framesize += -((short) read_memory_unsigned_integer (current_pc, 2));
+               {
+                 insn_debug (("stack increment\n"));
+                 framesize += -((short) read_memory_unsigned_integer (current_pc, 2));
                }
              else
                {
-                 if (((insn >> 8) == 0xe4) && /* ld24 r4, xxxxxx; sub sp, r4 */
-                     read_memory_unsigned_integer (current_pc + 2, 2) == 0x0f24)
-                   { /* subtract 24 bit sign-extended negative-offset */
-                     dump_insn("insn-2",current_pc+2,insn);
+                 if (((insn >> 8) == 0xe4) &&  /* ld24 r4, xxxxxx; sub sp, r4 */
+                 read_memory_unsigned_integer (current_pc + 2, 2) == 0x0f24)
+                   {           /* subtract 24 bit sign-extended negative-offset */
+                     dump_insn ("insn-2", current_pc + 2, insn);
                      insn = read_memory_unsigned_integer (current_pc - 2, 4);
-                     dump_insn("insn-3(l4)",current_pc -2,insn);
+                     dump_insn ("insn-3(l4)", current_pc - 2, insn);
                      if (insn & 0x00800000)    /* sign extend */
-                       insn  |= 0xff000000;    /* negative */
+                       insn |= 0xff000000;     /* negative */
                      else
-                       insn  &= 0x00ffffff;    /* positive */
+                       insn &= 0x00ffffff;     /* positive */
                      framesize += insn;
                    }
                }
@@ -184,18 +189,18 @@ static void decode_prologue (start_pc, scan_limit,
              continue;
            }
        }
-      op1 = insn & 0xf000; /* isolate just the first nibble */
-      
+      op1 = insn & 0xf000;     /* isolate just the first nibble */
+
       if ((insn & 0xf0ff) == 0x207f)
-       {               /* st reg, @-sp */
+       {                       /* st reg, @-sp */
          int regno;
-         insn_debug(("push\n"));
-#if 0  /* No, PUSH FP is not an indication that we will use a frame pointer. */
-         if (((insn & 0xffff) == 0x2d7f) && fi) 
+         insn_debug (("push\n"));
+#if 0                          /* No, PUSH FP is not an indication that we will use a frame pointer. */
+         if (((insn & 0xffff) == 0x2d7f) && fi)
            fi->using_frame_pointer = 1;
 #endif
-         framesize  += 4;
-#if 0 
+         framesize += 4;
+#if 0
 /* Why should we increase the scan limit, just because we did a push? 
    And if there is a reason, surely we would only want to do it if we
    had already reached the scan limit... */
@@ -203,12 +208,12 @@ static void decode_prologue (start_pc, scan_limit,
            scan_limit += 2;
 #endif
          regno = ((insn >> 8) & 0xf);
-         if (fsr)                              /* save_regs offset */
+         if (fsr)              /* save_regs offset */
            fsr->regs[regno] = framesize;
          after_prologue = 0;
-           continue;
+         continue;
        }
-      if ((insn >> 8) == 0x4f)                 /* addi sp, xx */
+      if ((insn >> 8) == 0x4f) /* addi sp, xx */
        /* add 8 bit sign-extended offset */
        {
          int stack_adjust = (char) (insn & 0xff);
@@ -223,48 +228,52 @@ static void decode_prologue (start_pc, scan_limit,
              framesize -= stack_adjust;
              after_prologue = 0;
              /* A frameless function may have no "mv fp, sp".
-                In that case, this is the end of the prologue.  */
+                In that case, this is the end of the prologue.  */
              after_stack_adjust = current_pc + 2;
            }
          continue;
        }
-      if (insn == 0x1d8f) {    /* mv fp, sp */
-       if (fi) 
-         fi->using_frame_pointer = 1;  /* fp is now valid */
-       insn_debug(("done fp found\n"));
-       after_prologue = current_pc + 2;
-       break;                          /* end of stack adjustments */
-      }
-      if (insn ==  0x7000)  /* Nop looks like a branch, continue explicitly */
-       { insn_debug(("nop\n"));
-       after_prologue = current_pc + 2;
-       continue; /* nop occurs between pushes */
+      if (insn == 0x1d8f)
+       {                       /* mv fp, sp */
+         if (fi)
+           fi->using_frame_pointer = 1;        /* fp is now valid */
+         insn_debug (("done fp found\n"));
+         after_prologue = current_pc + 2;
+         break;                /* end of stack adjustments */
+       }
+      if (insn == 0x7000)      /* Nop looks like a branch, continue explicitly */
+       {
+         insn_debug (("nop\n"));
+         after_prologue = current_pc + 2;
+         continue;             /* nop occurs between pushes */
        }
       /* End of prolog if any of these are branch instructions */
       if ((op1 == 0x7000)
-         || ( op1 == 0xb000)
+         || (op1 == 0xb000)
          || (op1 == 0x7000))
        {
          after_prologue = current_pc;
-         insn_debug(("Done: branch\n"));
+         insn_debug (("Done: branch\n"));
          maybe_one_more = 1;
          continue;
        }
       /* Some of the branch instructions are mixed with other types */
       if (op1 == 0x1000)
-       {int subop = insn & 0x0ff0;
+       {
+         int subop = insn & 0x0ff0;
          if ((subop == 0x0ec0) || (subop == 0x0fc0))
-           { insn_debug(("done: jmp\n"));
+           {
+             insn_debug (("done: jmp\n"));
              after_prologue = current_pc;
              maybe_one_more = 1;
-             continue; /* jmp , jl */
+             continue;         /* jmp , jl */
            }
        }
     }
 
   if (current_pc >= scan_limit)
     {
-      if (pl_endptr) 
+      if (pl_endptr)
        {
 #if 1
          if (after_stack_adjust != 0)
@@ -283,18 +292,18 @@ static void decode_prologue (start_pc, scan_limit,
               The way we do that is to return the original start_pc.
               GDB will set a breakpoint at the start of the function (etc.) */
            *pl_endptr = start_pc;
-       }       
+       }
       return;
     }
-  if (after_prologue == 0) 
+  if (after_prologue == 0)
     after_prologue = current_pc;
 
-  insn_debug((" framesize %d, firstline %08x\n",framesize,after_prologue));
-  if (framelength) 
+  insn_debug ((" framesize %d, firstline %08x\n", framesize, after_prologue));
+  if (framelength)
     *framelength = framesize;
-  if (pl_endptr) 
+  if (pl_endptr)
     *pl_endptr = after_prologue;
-} /*  decode_prologue */
+}                              /*  decode_prologue */
 
 /* Function: skip_prologue
    Find end of function prologue */
@@ -314,8 +323,8 @@ m32r_skip_prologue (pc)
 
       if (sal.line != 0 && sal.end <= func_end)
        {
-         
-         insn_debug(("BP after prologue %08x\n",sal.end));
+
+         insn_debug (("BP after prologue %08x\n", sal.end));
          func_end = sal.end;
        }
       else
@@ -323,12 +332,12 @@ m32r_skip_prologue (pc)
           the end of the function.  In this case, there probably isn't a
           prologue.  */
        {
-         insn_debug(("No line info, line(%x) sal_end(%x) funcend(%x)\n",
-                     sal.line,sal.end,func_end));
-         func_end = min(func_end,func_addr + DEFAULT_SEARCH_LIMIT);
+         insn_debug (("No line info, line(%x) sal_end(%x) funcend(%x)\n",
+                      sal.line, sal.end, func_end));
+         func_end = min (func_end, func_addr + DEFAULT_SEARCH_LIMIT);
        }
     }
-  else 
+  else
     func_end = pc + DEFAULT_SEARCH_LIMIT;
   decode_prologue (pc, func_end, &sal.end, 0, 0, 0);
   return sal.end;
@@ -350,25 +359,25 @@ m32r_scan_prologue (fi, fsr)
     {
       sal = find_pc_line (prologue_start, 0);
 
-      if (sal.line == 0)               /* no line info, use current PC */
+      if (sal.line == 0)       /* no line info, use current PC */
        if (prologue_start == entry_point_address ())
          return 0;
     }
   else
     {
       prologue_start = fi->pc;
-      prologue_end = prologue_start + 48; /* We're in the boondocks: 
-                                             allow for 16 pushes, an add, 
-                                             and "mv fp,sp" */
+      prologue_end = prologue_start + 48;      /* We're in the boondocks: 
+                                                  allow for 16 pushes, an add, 
+                                                  and "mv fp,sp" */
     }
 #if 0
   prologue_end = min (prologue_end, fi->pc);
 #endif
-  insn_debug(("fipc(%08x) start(%08x) end(%08x)\n",
-             fi->pc,prologue_start,prologue_end));
-  prologue_end = min(prologue_end, prologue_start + DEFAULT_SEARCH_LIMIT);
-  decode_prologue (prologue_start,prologue_end,&prologue_end,&framesize,
-                  fi,fsr);
+  insn_debug (("fipc(%08x) start(%08x) end(%08x)\n",
+              fi->pc, prologue_start, prologue_end));
+  prologue_end = min (prologue_end, prologue_start + DEFAULT_SEARCH_LIMIT);
+  decode_prologue (prologue_start, prologue_end, &prologue_end, &framesize,
+                  fi, fsr);
   return framesize;
 }
 
@@ -393,12 +402,12 @@ m32r_init_extra_frame_info (fi)
   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.  */
+         by assuming it's always FP.  */
       fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
       fi->framesize = 0;
       return;
     }
-  else 
+  else
     {
       fi->using_frame_pointer = 0;
       fi->framesize = m32r_scan_prologue (fi, &fi->fsr);
@@ -410,10 +419,11 @@ m32r_init_extra_frame_info (fi)
          }
        else
          fi->frame = read_register (SP_REGNUM);
-      else     /* fi->next means this is not the innermost frame */
-       if (fi->using_frame_pointer)                /* we have an FP */
-         if (fi->next->fsr.regs[FP_REGNUM] != 0)   /* caller saved our FP */
-           fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
+      else
+       /* fi->next means this is not the innermost frame */ if (fi->using_frame_pointer)
+       /* we have an FP */
+       if (fi->next->fsr.regs[FP_REGNUM] != 0)         /* caller saved our FP */
+         fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
       for (reg = 0; reg < NUM_REGS; reg++)
        if (fi->fsr.regs[reg] != 0)
          fi->fsr.regs[reg] = fi->frame + fi->framesize - fi->fsr.regs[reg];
@@ -446,12 +456,12 @@ m32r_virtual_frame_pointer (pc, reg, offset)
   /* Results will tell us which type of frame it uses.  */
   if (fi.using_frame_pointer)
     {
-      *reg    = FP_REGNUM;
+      *reg = FP_REGNUM;
       *offset = 0;
     }
   else
     {
-      *reg    = SP_REGNUM;
+      *reg = SP_REGNUM;
       *offset = 0;
     }
 }
@@ -472,8 +482,8 @@ m32r_find_callers_reg (fi, regnum)
     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_integer (fi->fsr.regs[regnum], 
-                                 REGISTER_RAW_SIZE(regnum));
+      return read_memory_integer (fi->fsr.regs[regnum],
+                                 REGISTER_RAW_SIZE (regnum));
   return read_register (regnum);
 }
 
@@ -490,26 +500,26 @@ m32r_frame_chain (fi)
   CORE_ADDR fn_start, callers_pc, fp;
 
   /* is this a dummy frame? */
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
-    return fi->frame;  /* dummy frame same as caller's frame */
+  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: */
+  callers_pc = FRAME_SAVED_PC (fi);    /* find out who called us: */
   fp = m32r_find_callers_reg (fi, FP_REGNUM);
-  if (PC_IN_CALL_DUMMY(callers_pc, fp, fp))    
-    return fp;         /* dummy frame's frame may bear no relation to ours */
+  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 */
+      return 0;                        /* in _start fn, don't chain further */
   if (fi->framesize == 0)
     {
-      printf_filtered("cannot determine frame size @ %08x , pc(%08x)\n",
-                     (unsigned long) fi->frame,
-                     (unsigned long) fi->pc );
+      printf_filtered ("cannot determine frame size @ %08x , pc(%08x)\n",
+                      (unsigned long) fi->frame,
+                      (unsigned long) fi->pc);
       return 0;
     }
-  insn_debug(("m32rx frame %08x\n",fi->frame+fi->framesize));
+  insn_debug (("m32rx frame %08x\n", fi->frame + fi->framesize));
   return fi->frame + fi->framesize;
 }
 
@@ -544,7 +554,7 @@ m32r_pop_frame (frame)
     {
       for (regnum = 0; regnum < NUM_REGS; regnum++)
        if (frame->fsr.regs[regnum] != 0)
-         write_register (regnum, 
+         write_register (regnum,
                          read_memory_integer (frame->fsr.regs[regnum], 4));
 
       write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
@@ -566,8 +576,8 @@ CORE_ADDR
 m32r_frame_saved_pc (fi)
      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);
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+    return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
   else
     return m32r_find_callers_reg (fi, RP_REGNUM);
 }
@@ -584,7 +594,7 @@ m32r_frame_saved_pc (fi)
    register or a whole 32-bit word on the stack, and will be
    right-justified in the register or the stack word.  This includes
    chars, shorts, and small aggregate types.
+
    Arguments of 8 bytes size are split between two registers, if 
    available.  If only one register is available, the argument will 
    be split between the register and the stack.  Otherwise it is
@@ -624,62 +634,62 @@ m32r_push_arguments (nargs, args, sp, struct_return, struct_addr)
   /* first force sp to a 4-byte alignment */
   sp = sp & ~3;
 
-  argreg = ARG0_REGNUM;  
+  argreg = ARG0_REGNUM;
   /* The "struct return pointer" pseudo-argument goes in R0 */
   if (struct_return)
-      write_register (argreg++, struct_addr);
+    write_register (argreg++, struct_addr);
+
   /* Now make sure there's space on the stack */
   for (argnum = 0, stack_alloc = 0;
        argnum < nargs; argnum++)
-    stack_alloc += ((TYPE_LENGTH(VALUE_TYPE(args[argnum])) + 3) & ~3);
-  sp -= stack_alloc;    /* make room on stack for args */
+    stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
+  sp -= stack_alloc;           /* make room on stack for args */
+
+
   /* Now load as many as possible of the first arguments into
      registers, and push the rest onto the stack.  There are 16 bytes
      in four registers available.  Loop thru args from first to last.  */
+
   argreg = ARG0_REGNUM;
   for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
     {
       type = VALUE_TYPE (args[argnum]);
-      len  = TYPE_LENGTH (type);
-      memset(valbuf, 0, sizeof(valbuf));
+      len = TYPE_LENGTH (type);
+      memset (valbuf, 0, sizeof (valbuf));
       if (len < 4)
-        { /* value gets right-justified in the register or stack word */
-          memcpy(valbuf + (4 - len),
-                 (char *) VALUE_CONTENTS (args[argnum]), len);
-          val = valbuf;
-        }
+       {                       /* value gets right-justified in the register or stack word */
+         memcpy (valbuf + (4 - len),
+                 (char *) VALUE_CONTENTS (args[argnum]), len);
+         val = valbuf;
+       }
       else
-        val = (char *) VALUE_CONTENTS (args[argnum]);
+       val = (char *) VALUE_CONTENTS (args[argnum]);
+
       if (len > 4 && (len & 3) != 0)
-        odd_sized_struct = 1;           /* such structs go entirely on stack */
+       odd_sized_struct = 1;   /* such structs go entirely on stack */
       else
-        odd_sized_struct = 0;
+       odd_sized_struct = 0;
       while (len > 0)
-        {
-          if (argreg > ARGLAST_REGNUM || odd_sized_struct)
-            {                          /* must go on the stack */
-              write_memory (sp + stack_offset, val, 4);
-              stack_offset += 4;
-            }
-          /* NOTE WELL!!!!!  This is not an "else if" clause!!!
-             That's because some *&^%$ things get passed on the stack
-             AND in the registers!   */
-          if (argreg <= ARGLAST_REGNUM)
-            {                          /* there's room in a register */
-              regval = extract_address (val, REGISTER_RAW_SIZE(argreg));
-              write_register (argreg++, regval);
-            }
-          /* Store the value 4 bytes at a time.  This means that things
-             larger than 4 bytes may go partly in registers and partly
-             on the stack.  */
-          len -= REGISTER_RAW_SIZE(argreg);
-          val += REGISTER_RAW_SIZE(argreg);
-        }
+       {
+         if (argreg > ARGLAST_REGNUM || odd_sized_struct)
+           {                   /* must go on the stack */
+             write_memory (sp + stack_offset, val, 4);
+             stack_offset += 4;
+           }
+         /* NOTE WELL!!!!!  This is not an "else if" clause!!!
+            That's because some *&^%$ things get passed on the stack
+            AND in the registers!   */
+         if (argreg <= ARGLAST_REGNUM)
+           {                   /* there's room in a register */
+             regval = extract_address (val, REGISTER_RAW_SIZE (argreg));
+             write_register (argreg++, regval);
+           }
+         /* Store the value 4 bytes at a time.  This means that things
+            larger than 4 bytes may go partly in registers and partly
+            on the stack.  */
+         len -= REGISTER_RAW_SIZE (argreg);
+         val += REGISTER_RAW_SIZE (argreg);
+       }
     }
   return sp;
 }
@@ -714,7 +724,7 @@ m32r_write_sp (val)
 {
   unsigned long psw = read_register (PSW_REGNUM);
 
-  if (psw & 0x80)      /* stack mode: user or interrupt */
+  if (psw & 0x80)              /* stack mode: user or interrupt */
     write_register (SPU_REGNUM, val);
   else
     write_register (SPI_REGNUM, val);
@@ -726,4 +736,3 @@ _initialize_m32r_tdep ()
 {
   tm_print_insn = print_insn_m32r;
 }
-
index 769ffe80b50934cf71180ecf4afecf01f00403bb..87bcfeb758e2a69107f7df50cedf7340d6abe6e6 100644 (file)
@@ -1,21 +1,22 @@
 /* Target dependent code for the Motorola 68000 series.
    Copyright (C) 1990, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -24,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "value.h"
 #include "gdb_string.h"
 #include "inferior.h"
-
 \f
+
 /* The only reason this is here is the tm-altos.h reference below.  It
    was moved back here from tm-m68k.h.  FIXME? */
 
@@ -35,17 +36,17 @@ altos_skip_prologue (pc)
 {
   register int op = read_memory_integer (pc, 2);
   if (op == 0047126)
-    pc += 4;   /* Skip link #word */
+    pc += 4;                   /* Skip link #word */
   else if (op == 0044016)
-    pc += 6;   /* Skip link #long */
+    pc += 6;                   /* Skip link #long */
   /* Not sure why branches are here.  */
   /* From tm-isi.h, tm-altos.h */
   else if (op == 0060000)
-    pc += 4;   /* Skip bra #word */
+    pc += 4;                   /* Skip bra #word */
   else if (op == 00600377)
-    pc += 6;   /* skip bra #long */
+    pc += 6;                   /* skip bra #long */
   else if ((op & 0177400) == 0060000)
-    pc += 2;   /* skip bra #char */
+    pc += 2;                   /* skip bra #char */
   return pc;
 }
 
@@ -58,17 +59,17 @@ isi_skip_prologue (pc)
 {
   register int op = read_memory_integer (pc, 2);
   if (op == 0047126)
-    pc += 4;   /* Skip link #word */
+    pc += 4;                   /* Skip link #word */
   else if (op == 0044016)
-    pc += 6;   /* Skip link #long */
+    pc += 6;                   /* Skip link #long */
   /* Not sure why branches are here.  */
   /* From tm-isi.h, tm-altos.h */
   else if (op == 0060000)
-    pc += 4;   /* Skip bra #word */
+    pc += 4;                   /* Skip bra #word */
   else if (op == 00600377)
-    pc += 6;   /* skip bra #long */
+    pc += 6;                   /* skip bra #long */
   else if ((op & 0177400) == 0060000)
-    pc += 2;   /* skip bra #char */
+    pc += 2;                   /* skip bra #char */
   return pc;
 }
 
@@ -83,16 +84,16 @@ isi_frame_num_args (fi)
   CORE_ADDR pc = FRAME_SAVED_PC (fi);
   int insn = 0177777 & read_memory_integer (pc, 2);
   val = 0;
-  if (insn == 0047757 || insn == 0157374)  /* lea W(sp),sp or addaw #W,sp */
+  if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
     val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
-          || (insn & 0170777) == 0050117)  /* addqw */
+  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
+          || (insn & 0170777) == 0050117)      /* addqw */
     {
       val = (insn >> 9) & 7;
       if (val == 0)
        val = 8;
     }
-  else if (insn == 0157774) /* addal #WW, sp */
+  else if (insn == 0157774)    /* addal #WW, sp */
     val = read_memory_integer (pc + 2, 4);
   val >>= 2;
   return val;
@@ -106,16 +107,16 @@ delta68_frame_num_args (fi)
   CORE_ADDR pc = FRAME_SAVED_PC (fi);
   int insn = 0177777 & read_memory_integer (pc, 2);
   val = 0;
-  if (insn == 0047757 || insn == 0157374)  /* lea W(sp),sp or addaw #W,sp */
+  if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
     val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
-          || (insn & 0170777) == 0050117)  /* addqw */
+  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
+          || (insn & 0170777) == 0050117)      /* addqw */
     {
       val = (insn >> 9) & 7;
       if (val == 0)
        val = 8;
     }
-  else if (insn == 0157774) /* addal #WW, sp */
+  else if (insn == 0157774)    /* addal #WW, sp */
     val = read_memory_integer (pc + 2, 4);
   val >>= 2;
   return val;
@@ -129,16 +130,16 @@ news_frame_num_args (fi)
   CORE_ADDR pc = FRAME_SAVED_PC (fi);
   int insn = 0177777 & read_memory_integer (pc, 2);
   val = 0;
-  if (insn == 0047757 || insn == 0157374)  /* lea W(sp),sp or addaw #W,sp */
+  if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
     val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
-          || (insn & 0170777) == 0050117)  /* addqw */
+  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
+          || (insn & 0170777) == 0050117)      /* addqw */
     {
       val = (insn >> 9) & 7;
       if (val == 0)
        val = 8;
     }
-  else if (insn == 0157774) /* addal #WW, sp */
+  else if (insn == 0157774)    /* addal #WW, sp */
     val = read_memory_integer (pc + 2, 4);
   val >>= 2;
   return val;
@@ -187,7 +188,7 @@ m68k_pop_frame ()
 
   fp = FRAME_FP (frame);
   get_frame_saved_regs (frame, &fsr);
-  for (regnum = FP0_REGNUM + 7 ; regnum >= FP0_REGNUM ; regnum--)
+  for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
     {
       if (fsr.regs[regnum])
        {
@@ -195,7 +196,7 @@ m68k_pop_frame ()
          write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
        }
     }
-  for (regnum = FP_REGNUM - 1 ; regnum >= 0 ; regnum--)
+  for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
     {
       if (fsr.regs[regnum])
        {
@@ -211,8 +212,8 @@ m68k_pop_frame ()
   write_register (SP_REGNUM, fp + 8);
   flush_cached_frames ();
 }
-
 \f
+
 /* Given an ip value corresponding to the start of a function,
    return the ip of the first instruction after the function 
    prologue.  This is the generic m68k support.  Machines which
@@ -224,26 +225,26 @@ m68k_pop_frame ()
 
    A link instruction, word form:
 
-       link.w  %a6,&0                  4e56  XXXX
+   link.w       %a6,&0                  4e56  XXXX
 
    A link instruction, long form:
 
-       link.l  %fp,&F%1                480e  XXXX  XXXX
+   link.l  %fp,&F%1             480e  XXXX  XXXX
 
    A movm instruction to preserve integer regs:
 
-       movm.l  &M%1,(4,%sp)            48ef  XXXX  XXXX
+   movm.l  &M%1,(4,%sp)         48ef  XXXX  XXXX
 
    A fmovm instruction to preserve float regs:
 
-       fmovm   &FPM%1,(FPO%1,%sp)      f237  XXXX  XXXX  XXXX  XXXX
+   fmovm   &FPM%1,(FPO%1,%sp)   f237  XXXX  XXXX  XXXX  XXXX
 
    Some profiling setup code (FIXME, not recognized yet):
 
-       lea.l   (.L3,%pc),%a1           43fb  XXXX  XXXX  XXXX
-       bsr     _mcount                 61ff  XXXX  XXXX
+   lea.l   (.L3,%pc),%a1                43fb  XXXX  XXXX  XXXX
+   bsr     _mcount                      61ff  XXXX  XXXX
 
 */
+ */
 
 #define P_LINK_L       0x480e
 #define P_LINK_W       0x4e56
@@ -257,7 +258,7 @@ m68k_pop_frame ()
 
 CORE_ADDR
 m68k_skip_prologue (ip)
-CORE_ADDR ip;
+     CORE_ADDR ip;
 {
   register CORE_ADDR limit;
   struct symtab_and_line sal;
@@ -267,36 +268,36 @@ 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)
     {
       op = read_memory_integer (ip, 2);
       op &= 0xFFFF;
-      
+
       if (op == P_LINK_W)
        {
-         ip += 4;      /* Skip link.w */
+         ip += 4;              /* Skip link.w */
        }
       else if (op == 0x4856)
-       ip += 2; /* Skip pea %fp */
+       ip += 2;                /* Skip pea %fp */
       else if (op == 0x2c4f)
-       ip += 2; /* Skip move.l %sp, %fp */
+       ip += 2;                /* Skip move.l %sp, %fp */
       else if (op == P_LINK_L)
        {
-         ip += 6;      /* Skip link.l */
+         ip += 6;              /* Skip link.l */
        }
       else if (op == P_MOVM_L)
        {
-         ip += 6;      /* Skip movm.l */
+         ip += 6;              /* Skip movm.l */
        }
       else if (op == P_FMOVM)
        {
-         ip += 10;     /* Skip fmovm */
+         ip += 10;             /* Skip fmovm */
        }
       else
        {
-         break;        /* Found unknown code, bail out. */
+         break;                /* Found unknown code, bail out. */
        }
     }
   return (ip);
@@ -307,14 +308,14 @@ m68k_find_saved_regs (frame_info, saved_regs)
      struct frame_info *frame_info;
      struct frame_saved_regs *saved_regs;
 {
-  register int regnum;                                                 
-  register int regmask;                                                        
-  register CORE_ADDR next_addr;                                                
+  register int regnum;
+  register int regmask;
+  register CORE_ADDR next_addr;
   register CORE_ADDR pc;
 
   /* 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 - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4 - 8 * 12;
 
   int nextinsn;
   memset (saved_regs, 0, sizeof (*saved_regs));
@@ -323,23 +324,23 @@ m68k_find_saved_regs (frame_info, saved_regs)
     {
 
       /* It is a call dummy.  We could just stop now, since we know
-        what the call dummy saves and where.  But this code proceeds
-        to parse the "prologue" which is part of the call dummy.
-        This is needlessly complex and confusing.  FIXME.  */
+         what the call dummy saves and where.  But this code proceeds
+         to parse the "prologue" which is part of the call dummy.
+         This is needlessly complex and confusing.  FIXME.  */
 
       next_addr = (frame_info)->frame;
       pc = possible_call_dummy_start;
     }
-  else                                                                 
+  else
     {
-      pc = get_pc_function_start ((frame_info)->pc);                   
+      pc = get_pc_function_start ((frame_info)->pc);
 
       if (0x4856 == read_memory_integer (pc, 2)
          && 0x2c4f == read_memory_integer (pc + 2, 2))
        {
          /*
-           pea %fp
-            move.l %sp, %fp */
+            pea %fp
+            move.l %sp, %fp */
 
          pc += 4;
          next_addr = frame_info->frame;
@@ -348,49 +349,55 @@ m68k_find_saved_regs (frame_info, saved_regs)
        /* link.l %fp */
        /* Find the address above the saved   
           regs using the amount of storage from the link instruction.  */
-       next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc+=4; 
-      else if (047126 == read_memory_integer (pc, 2))                  
+       next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc += 4;
+      else if (047126 == read_memory_integer (pc, 2))
        /* link.w %fp */
        /* Find the address above the saved   
           regs using the amount of storage from the link instruction.  */
-       next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc+=2; 
-      else goto lose;
-
-      /* If have an addal #-n, sp next, adjust next_addr.  */          
-      if ((0177777 & read_memory_integer (pc, 2)) == 0157774)          
-       next_addr += read_memory_integer (pc += 2, 4), pc += 4;         
-    }                                                                  
-  regmask = read_memory_integer (pc + 2, 2);                           
-
-  /* Here can come an fmovem.  Check for it.  */               
-  nextinsn = 0xffff & read_memory_integer (pc, 2);                     
-  if (0xf227 == nextinsn                                               
-      && (regmask & 0xff00) == 0xe000)                                 
-    { pc += 4; /* Regmask's low bit is for register fp7, the first pushed */ 
-      for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1)             
-       if (regmask & 1)                                                
-          saved_regs->regs[regnum] = (next_addr -= 12);                
-      regmask = read_memory_integer (pc + 2, 2); }
-
-  /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */     
-  if (0044327 == read_memory_integer (pc, 2))                          
-    { pc += 4; /* Regmask's low bit is for register 0, the first written */ 
-      for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)           
-       if (regmask & 1)                                                
-          saved_regs->regs[regnum] = (next_addr += 4) - 4; }   
-  else if (0044347 == read_memory_integer (pc, 2))                     
+       next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc += 2;
+      else
+       goto lose;
+
+      /* If have an addal #-n, sp next, adjust next_addr.  */
+      if ((0177777 & read_memory_integer (pc, 2)) == 0157774)
+       next_addr += read_memory_integer (pc += 2, 4), pc += 4;
+    }
+  regmask = read_memory_integer (pc + 2, 2);
+
+  /* Here can come an fmovem.  Check for it.  */
+  nextinsn = 0xffff & read_memory_integer (pc, 2);
+  if (0xf227 == nextinsn
+      && (regmask & 0xff00) == 0xe000)
+    {
+      pc += 4;                 /* Regmask's low bit is for register fp7, the first pushed */
+      for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1)
+       if (regmask & 1)
+         saved_regs->regs[regnum] = (next_addr -= 12);
+      regmask = read_memory_integer (pc + 2, 2);
+    }
+
+  /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */
+  if (0044327 == read_memory_integer (pc, 2))
+    {
+      pc += 4;                 /* Regmask's low bit is for register 0, the first written */
+      for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
+       if (regmask & 1)
+         saved_regs->regs[regnum] = (next_addr += 4) - 4;
+    }
+  else if (0044347 == read_memory_integer (pc, 2))
     {
-      pc += 4; /* Regmask's low bit is for register 15, the first pushed */ 
-      for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1)          
-       if (regmask & 1)                                                
-          saved_regs->regs[regnum] = (next_addr -= 4);
+      pc += 4;                 /* Regmask's low bit is for register 15, the first pushed */
+      for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1)
+       if (regmask & 1)
+         saved_regs->regs[regnum] = (next_addr -= 4);
     }
-  else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2)))           
+  else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2)))
     {
-      regnum = 0xf & read_memory_integer (pc, 2); pc += 2;             
+      regnum = 0xf & read_memory_integer (pc, 2);
+      pc += 2;
       saved_regs->regs[regnum] = (next_addr -= 4);
       /* gcc, at least, may use a pair of movel instructions when saving
-        exactly 2 registers.  */
+         exactly 2 registers.  */
       if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2)))
        {
          regnum = 0xf & read_memory_integer (pc, 2);
@@ -399,24 +406,26 @@ m68k_find_saved_regs (frame_info, saved_regs)
        }
     }
 
-  /* fmovemx to index of sp may follow.  */                            
-  regmask = read_memory_integer (pc + 2, 2);                           
-  nextinsn = 0xffff & read_memory_integer (pc, 2);                     
-  if (0xf236 == nextinsn                                               
-      && (regmask & 0xff00) == 0xf000)                                 
-    { pc += 10; /* Regmask's low bit is for register fp0, the first written */ 
-      for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1)             
-       if (regmask & 1)                                                
-          saved_regs->regs[regnum] = (next_addr += 12) - 12;   
-      regmask = read_memory_integer (pc + 2, 2); }                     
-
-  /* clrw -(sp); movw ccr,-(sp) may follow.  */                                
-  if (0x426742e7 == read_memory_integer (pc, 4))                       
-    saved_regs->regs[PS_REGNUM] = (next_addr -= 4);            
-  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;               
+  /* fmovemx to index of sp may follow.  */
+  regmask = read_memory_integer (pc + 2, 2);
+  nextinsn = 0xffff & read_memory_integer (pc, 2);
+  if (0xf236 == nextinsn
+      && (regmask & 0xff00) == 0xf000)
+    {
+      pc += 10;                        /* Regmask's low bit is for register fp0, the first written */
+      for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1)
+       if (regmask & 1)
+         saved_regs->regs[regnum] = (next_addr += 12) - 12;
+      regmask = read_memory_integer (pc + 2, 2);
+    }
+
+  /* clrw -(sp); movw ccr,-(sp) may follow.  */
+  if (0x426742e7 == read_memory_integer (pc, 4))
+    saved_regs->regs[PS_REGNUM] = (next_addr -= 4);
+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;
 #ifdef SIG_SP_FP_OFFSET
   /* Adjust saved SP_REGNUM for fake _sigtramp frames.  */
   if (frame_info->signal_handler_caller && frame_info->next)
@@ -425,37 +434,37 @@ m68k_find_saved_regs (frame_info, saved_regs)
 }
 
 
-#ifdef USE_PROC_FS     /* Target dependent support for /proc */
+#ifdef USE_PROC_FS             /* Target dependent support for /proc */
 
 #include <sys/procfs.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.
+   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 actual structure passed through the ioctl interface is, of course,
-    naturally machine dependent, and is different for each set of registers.
-    For the m68k 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 m68k for example, the general register set is typically defined
+   by:
 
-       typedef int gregset_t[18];
+   typedef int gregset_t[18];
 
-       #define R_D0    0
-       ...
-       #define R_PS    17
+   #define      R_D0    0
+   ...
+   #define      R_PS    17
 
-    and the floating point set by:
+   and the floating point set by:
 
-       typedef struct fpregset {
-         int   f_pcr;
-         int   f_psr;
-         int   f_fpiaddr;
-         int   f_fpregs[8][3];         (8 regs, 96 bits each)
-       } fpregset_t;
+   typedef      struct fpregset {
+   int  f_pcr;
+   int  f_psr;
+   int  f_fpiaddr;
+   int  f_fpregs[8][3];         (8 regs, 96 bits each)
+   } fpregset_t;
 
-    These routines provide the packing and unpacking of gregset_t and
-    fpregset_t formatted data.
+   These routines provide the packing and unpacking of gregset_t and
+   fpregset_t formatted data.
 
  */
 
@@ -466,17 +475,17 @@ m68k_find_saved_regs (frame_info, saved_regs)
 #endif
 
 /*  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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 void
 supply_gregset (gregsetp)
-gregset_t *gregsetp;
+     gregset_t *gregsetp;
 {
   register int regi;
   register greg_t *regp = (greg_t *) gregsetp;
 
-  for (regi = 0 ; regi < R_PC ; regi++)
+  for (regi = 0; regi < R_PC; regi++)
     {
       supply_register (regi, (char *) (regp + regi));
     }
@@ -486,13 +495,13 @@ gregset_t *gregsetp;
 
 void
 fill_gregset (gregsetp, regno)
-gregset_t *gregsetp;
-int regno;
+     gregset_t *gregsetp;
+     int regno;
 {
   register int regi;
   register greg_t *regp = (greg_t *) gregsetp;
 
-  for (regi = 0 ; regi < R_PC ; regi++)
+  for (regi = 0; regi < R_PC; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
@@ -512,66 +521,66 @@ int regno;
 #if defined (FP0_REGNUM)
 
 /*  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. */
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
 
-void 
+void
 supply_fpregset (fpregsetp)
-fpregset_t *fpregsetp;
+     fpregset_t *fpregsetp;
 {
   register int regi;
   char *from;
-  
-  for (regi = FP0_REGNUM ; regi < FPC_REGNUM ; regi++)
+
+  for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++)
     {
-      from = (char *) &(fpregsetp -> f_fpregs[regi-FP0_REGNUM][0]);
+      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 (FPC_REGNUM, (char *) &(fpregsetp->f_pcr));
+  supply_register (FPS_REGNUM, (char *) &(fpregsetp->f_psr));
+  supply_register (FPI_REGNUM, (char *) &(fpregsetp->f_fpiaddr));
 }
 
 /*  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. */
+   (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. */
 
 void
 fill_fpregset (fpregsetp, regno)
-fpregset_t *fpregsetp;
-int regno;
+     fpregset_t *fpregsetp;
+     int regno;
 {
   int regi;
   char *to;
   char *from;
 
-  for (regi = FP0_REGNUM ; regi < FPC_REGNUM ; regi++)
+  for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
-         to = (char *) &(fpregsetp -> f_fpregs[regi-FP0_REGNUM][0]);
+         to = (char *) &(fpregsetp->f_fpregs[regi - FP0_REGNUM][0]);
          memcpy (to, from, REGISTER_RAW_SIZE (regi));
        }
     }
   if ((regno == -1) || (regno == FPC_REGNUM))
     {
-      fpregsetp -> f_pcr = *(int *) &registers[REGISTER_BYTE (FPC_REGNUM)];
+      fpregsetp->f_pcr = *(int *) &registers[REGISTER_BYTE (FPC_REGNUM)];
     }
   if ((regno == -1) || (regno == FPS_REGNUM))
     {
-      fpregsetp -> f_psr = *(int *) &registers[REGISTER_BYTE (FPS_REGNUM)];
+      fpregsetp->f_psr = *(int *) &registers[REGISTER_BYTE (FPS_REGNUM)];
     }
   if ((regno == -1) || (regno == FPI_REGNUM))
     {
-      fpregsetp -> f_fpiaddr = *(int *) &registers[REGISTER_BYTE (FPI_REGNUM)];
+      fpregsetp->f_fpiaddr = *(int *) &registers[REGISTER_BYTE (FPI_REGNUM)];
     }
 }
 
-#endif /* defined (FP0_REGNUM) */
+#endif /* defined (FP0_REGNUM) */
 
-#endif  /* USE_PROC_FS */
+#endif /* USE_PROC_FS */
 
 #ifdef GET_LONGJMP_TARGET
 /* Figure out where the longjmp will land.  Slurp the args out of the stack.
@@ -580,15 +589,15 @@ int regno;
    This routine returns true on success. */
 
 int
-get_longjmp_target(pc)
+get_longjmp_target (pc)
      CORE_ADDR *pc;
 {
   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
   CORE_ADDR sp, jb_addr;
 
-  sp = read_register(SP_REGNUM);
+  sp = read_register (SP_REGNUM);
 
-  if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
+  if (target_read_memory (sp + SP_ARG0,                /* Offset of first arg on stack */
                          buf,
                          TARGET_PTR_BIT / TARGET_CHAR_BIT))
     return 0;
@@ -611,7 +620,7 @@ get_longjmp_target(pc)
    prior to doing the trap. */
 
 CORE_ADDR
-m68k_saved_pc_after_call(frame)
+m68k_saved_pc_after_call (frame)
      struct frame_info *frame;
 {
 #ifdef SYSCALL_TRAP
index 8367b24820b04d334adc31358d007bad21b6f73c..4eed201fcaf9de7e2632ed6998e8899e659f5667 100644 (file)
@@ -1,21 +1,22 @@
 /* Motorola m68k native support for Linux
    Copyright (C) 1996,1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -41,10 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "floatformat.h"
 
 #include "target.h"
-
 \f
+
 /* This table must line up with REGISTER_NAMES in tm-m68k.h */
-static const int regmap[] = 
+static const int regmap[] =
 {
   PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
   PT_A0, PT_A1, PT_A2, PT_A3, PT_A4, PT_A5, PT_A6, PT_USP,
@@ -63,12 +64,12 @@ m68k_linux_register_u_addr (blockend, regnum)
      int blockend;
      int regnum;
 {
-    return (blockend + 4 * regmap[regnum]);
+  return (blockend + 4 * regmap[regnum]);
 }
 
 /*  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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 
 /* Note both m68k-tdep.c and m68klinux-nat.c contain definitions
@@ -77,7 +78,7 @@ m68k_linux_register_u_addr (blockend, regnum)
    the definitions in m68klinux-nat.c will be used. This is a 
    bit of a hack. The supply_* routines do not belong in 
    *_tdep.c files. But, there are several lynx ports that currently 
-   depend on these definitions. */ 
+   depend on these definitions. */
 
 #ifndef USE_PROC_FS
 
@@ -87,23 +88,23 @@ supply_gregset (gregsetp)
 {
   int regi;
 
-  for (regi = D0_REGNUM ; regi <= SP_REGNUM ; regi++)
+  for (regi = D0_REGNUM; regi <= SP_REGNUM; regi++)
     supply_register (regi, (char *) (*gregsetp + regmap[regi]));
   supply_register (PS_REGNUM, (char *) (*gregsetp + PT_SR));
   supply_register (PC_REGNUM, (char *) (*gregsetp + PT_PC));
 }
 
 /*  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. */
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
 
-void 
+void
 supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
   int regi;
 
-  for (regi = FP0_REGNUM ; regi < FPC_REGNUM ; regi++)
+  for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++)
     supply_register (regi, (char *) &fpregsetp->fpregs[(regi - FP0_REGNUM) * 3]);
   supply_register (FPC_REGNUM, (char *) &fpregsetp->fpcntl[0]);
   supply_register (FPS_REGNUM, (char *) &fpregsetp->fpcntl[1]);
@@ -111,8 +112,8 @@ supply_fpregset (fpregsetp)
 }
 
 #endif
-
 \f
+
 int
 kernel_u_size ()
 {
@@ -136,19 +137,19 @@ in_sigtramp (pc)
   if (read_memory_nobpt (pc, buf, sizeof (buf)))
     return 0;
   insn = extract_unsigned_integer (buf, sizeof (buf));
-  if (insn == 0xdefc /* addaw #,sp */
-      || insn == 0x7077 /* moveq #119,d0 */
-      || insn == 0x4e40 /* trap #0 */
-      || insn == 0x203c /* movel #,d0 */)
+  if (insn == 0xdefc           /* addaw #,sp */
+      || insn == 0x7077                /* moveq #119,d0 */
+      || insn == 0x4e40                /* trap #0 */
+      || insn == 0x203c /* movel #,d0 */ )
     return 1;
 
   if (read_memory_nobpt (pc - 2, buf, sizeof (buf)))
     return 0;
   insn = extract_unsigned_integer (buf, sizeof (buf));
-  if (insn == 0xdefc /* addaw #,sp */
-      || insn == 0x7077 /* moveq #119,d0 */
-      || insn == 0x4e40 /* trap #0 */
-      || insn == 0x203c /* movel #,d0 */)
+  if (insn == 0xdefc           /* addaw #,sp */
+      || insn == 0x7077                /* moveq #119,d0 */
+      || insn == 0x4e40                /* trap #0 */
+      || insn == 0x203c /* movel #,d0 */ )
     return 1;
 
   return 0;
index c2e71dfb5708631922dbe9321ead9424c6f441bb..326a89b612d5e01f0517b48e64a0be3f3309f289 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent code for Motorola m68k's running NetBSD, for GDB.
    Copyright 1988, 1989, 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -26,45 +27,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "inferior.h"
 
 void
-fetch_inferior_registers(regno)
+fetch_inferior_registers (regno)
      int regno;
 {
   struct reg inferior_registers;
   struct fpreg inferior_fp_registers;
 
-  ptrace (PT_GETREGS, inferior_pid, 
-         (PTRACE_ARG3_TYPE) &inferior_registers, 0);
-  memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers, 
-         sizeof(inferior_registers));
+  ptrace (PT_GETREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) & inferior_registers, 0);
+  memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers,
+         sizeof (inferior_registers));
 
-  ptrace (PT_GETFPREGS, inferior_pid, 
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
-  memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, 
-         sizeof(inferior_fp_registers));
+  ptrace (PT_GETFPREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
+  memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
+         sizeof (inferior_fp_registers));
 
   registers_fetched ();
 }
 
 void
-store_inferior_registers(regno)
+store_inferior_registers (regno)
      int regno;
 {
   struct reg inferior_registers;
   struct fpreg inferior_fp_registers;
 
   memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)],
-         sizeof(inferior_registers));
-  ptrace (PT_SETREGS, inferior_pid, 
-         (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+         sizeof (inferior_registers));
+  ptrace (PT_SETREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) & inferior_registers, 0);
 
   memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
-         sizeof(inferior_fp_registers));
-  ptrace (PT_SETFPREGS, inferior_pid, 
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0);
+         sizeof (inferior_fp_registers));
+  ptrace (PT_SETFPREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
 }
 
-struct md_core {
-  struct reg intreg; 
+struct md_core
+{
+  struct reg intreg;
   struct fpreg freg;
 };
 
@@ -75,12 +77,12 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
      int which;
      CORE_ADDR ignore;
 {
-  struct md_core *core_reg = (struct md_core *)core_reg_sect;
-  
+  struct md_core *core_reg = (struct md_core *) core_reg_sect;
+
   /* Integer registers */
-  memcpy(&registers[REGISTER_BYTE (0)],
-        &core_reg->intreg, sizeof(struct reg));
+  memcpy (&registers[REGISTER_BYTE (0)],
+         &core_reg->intreg, sizeof (struct reg));
   /* Floating point registers */
-  memcpy(&registers[REGISTER_BYTE (FP0_REGNUM)],
-        &core_reg->freg, sizeof(struct fpreg));
+  memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+         &core_reg->freg, sizeof (struct fpreg));
 }
index 27d72544606e5a4b5a314cc33105ec3eb5bb01a7..ed9dfffc306e29e94eb0dc2d6b5141e20e6a9c37 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent Motorola 88xxx support for GDB, the GNU Debugger.
    Copyright 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -54,7 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define SFIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u)
 #endif
 
-extern int have_symbol_file_p();
+extern int have_symbol_file_p ();
 
 extern jmp_buf stack_jmp;
 
@@ -62,7 +63,7 @@ extern int errno;
 
 void
 fetch_inferior_registers (regno)
-     int regno;                /* Original value discarded */
+     int regno;                        /* Original value discarded */
 {
   register unsigned int regaddr;
   char buf[MAX_REGISTER_RAW_SIZE];
@@ -71,33 +72,33 @@ fetch_inferior_registers (regno)
   struct USER u;
   unsigned int offset;
 
-  offset = (char *) &u.pt_r0 - (char *) &u; 
-  regaddr = offset; /* byte offset to r0;*/
+  offset = (char *) &u.pt_r0 - (char *) &u;
+  regaddr = offset;            /* byte offset to r0; */
 
 /*  offset = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */
   for (regno = 0; regno < NUM_REGS; regno++)
     {
-      /*regaddr = register_addr (regno, offset);*/
-       /* 88k enhancement  */
-        
+      /*regaddr = register_addr (regno, offset); */
+      /* 88k enhancement  */
+
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
-       {
-         *(int *) &buf[i] = ptrace (3, inferior_pid,
+       {
+         *(int *) &buf[i] = ptrace (3, inferior_pid,
                                     (PTRACE_ARG3_TYPE) regaddr, 0);
-         regaddr += sizeof (int);
-       }
+         regaddr += sizeof (int);
+       }
       supply_register (regno, buf);
     }
-    /* now load up registers 36 - 38; special pc registers */
-    *(int *) &buf[0] = ptrace (3,inferior_pid,
-                              (PTRACE_ARG3_TYPE) SXIP_OFFSET ,0);
-    supply_register (SXIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) SNIP_OFFSET,0);
-    supply_register (SNIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,
-                              (PTRACE_ARG3_TYPE) SFIP_OFFSET,0);
-    supply_register (SFIP_REGNUM, buf);
+  /* now load up registers 36 - 38; special pc registers */
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0);
+  supply_register (SXIP_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0);
+  supply_register (SNIP_REGNUM, buf);
+  *(int *) &buf[0] = ptrace (3, inferior_pid,
+                            (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0);
+  supply_register (SFIP_REGNUM, buf);
 }
 
 /* Store our register values back into the inferior.
@@ -124,7 +125,7 @@ store_inferior_registers (regno)
     {
       /*      regaddr = register_addr (regno, offset); */
       if (regno < PC_REGNUM)
-       { 
+       {
          regaddr = offset + regno * sizeof (int);
          errno = 0;
          ptrace (6, inferior_pid,
@@ -137,18 +138,18 @@ store_inferior_registers (regno)
        }
       else if (regno == SXIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register(regno));
+               (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno));
       else if (regno == SNIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register(regno));
+               (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno));
       else if (regno == SFIP_REGNUM)
        ptrace (6, inferior_pid,
-               (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register(regno));
+               (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); */
@@ -162,12 +163,12 @@ store_inferior_registers (regno)
              perror_with_name (buf);
            }
        }
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SXIP_OFFSET,read_register(SXIP_REGNUM));
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SNIP_OFFSET,read_register(SNIP_REGNUM));
-      ptrace (6,inferior_pid,
-             (PTRACE_ARG3_TYPE) SFIP_OFFSET,read_register(SFIP_REGNUM));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM));
+      ptrace (6, inferior_pid,
+             (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (SFIP_REGNUM));
     }
 }
 
@@ -212,19 +213,25 @@ m88k_register_u_addr (blockend, regnum)
     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);
+    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);
     }
 }
 
@@ -233,25 +240,25 @@ m88k_register_u_addr (blockend, regnum)
 #include <sys/procfs.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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 void
 supply_gregset (gregsetp)
      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));
+  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
@@ -259,25 +266,25 @@ fill_gregset (gregsetp, regno)
      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)];
+  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 */
index 2ac433526c7dd3880f15dbe0e3e85e2b9a912942..4ca3d68c3e9832cf0c04c7188596c7fe16e4ae2b 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-machine dependent code for Motorola 88000 series, for GDB.
    Copyright 1988, 1990, 1991, 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -65,8 +66,8 @@ frame_chain (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.  */
+     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
@@ -80,8 +81,8 @@ frameless_function_invocation (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.  */
+     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
@@ -93,8 +94,8 @@ init_extra_frame_info (fromleaf, frame)
      int fromleaf;
      struct frame_info *frame;
 {
-  frame->fsr = 0;                      /* Not yet allocated */
-  frame->args_pointer = 0;             /* Unknown */
+  frame->fsr = 0;              /* Not yet allocated */
+  frame->args_pointer = 0;     /* Unknown */
   frame->locals_pointer = 0;   /* Unknown */
 }
 \f
@@ -117,17 +118,17 @@ init_extra_frame_info (fromleaf, frame)
    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
+   subu r31,r31,n                       # stack pointer update
 
-   (st rn,r31,offset)?                 # save incoming regs
+   (st rn,r31,offset)?                  # save incoming regs
    (st.d rn,r31,offset)?
 
-   (addu r30,r31,n)?                   # frame pointer update
+   (addu r30,r31,n)?                    # frame pointer update
 
-   (pic sequence)?                     # PIC code prologue
+   (pic sequence)?                      # PIC code prologue
 
-   (or   rn,rm,0)?                     # Move parameters to other regs
-*/
+   (or   rn,rm,0)?                      # Move parameters to other regs
+ */
 
 /* Macros for extracting fields from instructions.  */
 
@@ -146,7 +147,8 @@ init_extra_frame_info (fromleaf, frame)
  * the state of certain machine registers and where the stack frame lives.
  */
 
-enum prologue_insn_action {
+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 */
@@ -155,41 +157,43 @@ enum prologue_insn_action {
   PIA_NOTE_PROLOGUE_END,       /* no more prologue */
 };
 
-struct prologue_insns {
+struct prologue_insns
+  {
     unsigned long insn;
     unsigned long mask;
     enum prologue_insn_action action;
-};
+  };
 
-struct prologue_insns prologue_insn_tbl[] = {
+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 */
+  {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 },
+  {0x67ff0000, 0xffff0007, PIA_NOTE_SP_ADJUSTMENT},
 
   /* Frame pointer assignment: "addu r30, r31, n" */
-  { 0x63df0000, 0xffff0000, PIA_NOTE_FP_ASSIGNMENT },
+  {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 */
+  {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 */
+  {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 */
+  {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 */
 
 };
 
@@ -219,17 +223,18 @@ next_insn (memaddr, pword1)
 /* Read a register from frames called by us (or from the hardware regs).  */
 
 static int
-read_next_frame_reg(frame, regno)
+read_next_frame_reg (frame, regno)
      struct frame_info *frame;
      int regno;
 {
-  for (; frame; frame = frame->next) {
+  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);
+       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.
@@ -264,51 +269,52 @@ examine_prologue (ip, limit, frame_sp, fsr, fi)
 
   while (next_ip)
     {
-      struct prologue_insns *pip; 
+      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 */
+      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;
-                 }
+       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;
+         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;
@@ -317,8 +323,8 @@ examine_prologue (ip, limit, frame_sp, fsr, fi)
 
 end_of_prologue_found:
 
-    if (prologue_end)
-       ip = prologue_end;
+  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,
@@ -330,16 +336,16 @@ end_of_prologue_found:
   /*
      OK, now we have:
 
-       sp_offset       original (before any alloca calls) displacement of SP
-                       (will be negative).
+     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.
+     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.
+     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.
+     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
@@ -350,24 +356,30 @@ end_of_prologue_found:
      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;
+  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) */
@@ -382,14 +394,14 @@ end_of_prologue_found:
   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 %x != %x, offset %x!\n",
-        fsr->regs[SP_REGNUM],
-       frame_sp - sp_offset, sp_offset);
+  if (fsr->regs[SP_REGNUM] != 0
+      && fsr->regs[SP_REGNUM] != frame_sp - sp_offset)
+    fprintf_unfiltered (gdb_stderr, "Bad saved SP value %x != %x, offset %x!\n",
+                       fsr->regs[SP_REGNUM],
+                       frame_sp - sp_offset, sp_offset);
 
   fsr->regs[SP_REGNUM] = frame_sp - sp_offset;
 
@@ -402,7 +414,7 @@ end_of_prologue_found:
 
 CORE_ADDR
 m88k_skip_prologue (ip)
-     CORE_ADDR (ip);
+CORE_ADDR (ip);
 {
   struct frame_saved_regs saved_regs_dummy;
   struct symtab_and_line sal;
@@ -412,7 +424,7 @@ m88k_skip_prologue (ip)
   limit = (sal.end) ? sal.end : 0xffffffff;
 
   return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy,
-                           (struct frame_info *)));
+                           (struct frame_info *) 0));
 }
 
 /* Put here the code to store, into a struct frame_saved_regs,
@@ -442,26 +454,26 @@ frame_find_saved_regs (fi, fsr)
       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. */
-         
+         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;
+      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);
+       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]);
+       SIGTRAMP_SP_FIXUP (fi->fsr->regs[SP_REGNUM]);
 #endif
     }
 
@@ -480,7 +492,7 @@ frame_locals_address (fi)
 {
   struct frame_saved_regs fsr;
 
-  if (fi->args_pointer)        /* Cached value is likely there.  */
+  if (fi->args_pointer)                /* Cached value is likely there.  */
     return fi->args_pointer;
 
   /* Nope, generate it.  */
@@ -518,7 +530,7 @@ CORE_ADDR
 frame_saved_pc (frame)
      struct frame_info *frame;
 {
-  return read_next_frame_reg(frame, SRP_REGNUM);
+  return read_next_frame_reg (frame, SRP_REGNUM);
 }
 
 
@@ -537,7 +549,7 @@ write_word (sp, word)
 }
 
 void
-m88k_push_dummy_frame()
+m88k_push_dummy_frame ()
 {
   register CORE_ADDR sp = read_register (SP_REGNUM);
   register int rn;
@@ -545,25 +557,25 @@ m88k_push_dummy_frame()
 
   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));
+  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));
+  write_word (sp + offset, read_register (SNIP_REGNUM));
   offset += 4;
 
-  write_word (sp+offset, read_register (SFIP_REGNUM));
+  write_word (sp + offset, read_register (SFIP_REGNUM));
   offset += 4;
 
-  write_word (sp+offset, read_register (PSR_REGNUM));
+  write_word (sp + offset, read_register (PSR_REGNUM));
   offset += 4;
 
-  write_word (sp+offset, read_register (FPSR_REGNUM));
+  write_word (sp + offset, read_register (FPSR_REGNUM));
   offset += 4;
 
-  write_word (sp+offset, read_register (FPCR_REGNUM));
+  write_word (sp + offset, read_register (FPCR_REGNUM));
   offset += 4;
 
   write_register (SP_REGNUM, sp);
@@ -584,39 +596,39 @@ pop_frame ()
   if (PC_IN_CALL_DUMMY (read_pc (), read_register (SP_REGNUM), FRAME_FP (fi)))
     {
       /* 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").  */
+         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));
+      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));
+      write_register (SNIP_REGNUM, read_memory_integer (sp + offset, 4));
       offset += 4;
 
-      write_register (SFIP_REGNUM, read_memory_integer (sp+offset, 4));
+      write_register (SFIP_REGNUM, read_memory_integer (sp + offset, 4));
       offset += 4;
 
-      write_register (PSR_REGNUM, read_memory_integer (sp+offset, 4));
+      write_register (PSR_REGNUM, read_memory_integer (sp + offset, 4));
       offset += 4;
 
-      write_register (FPSR_REGNUM, read_memory_integer (sp+offset, 4));
+      write_register (FPSR_REGNUM, read_memory_integer (sp + offset, 4));
       offset += 4;
 
-      write_register (FPCR_REGNUM, read_memory_integer (sp+offset, 4));
+      write_register (FPCR_REGNUM, read_memory_integer (sp + offset, 4));
       offset += 4;
 
     }
-  else 
+  else
     {
-      for (regnum = FP_REGNUM ; regnum > 0 ; regnum--)
-         if (fsr.regs[regnum])
-             write_register (regnum,
-                             read_memory_integer (fsr.regs[regnum], 4));
+      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 ();
index 82f7e71a338295019651f49a94f135db4e1e51d3..749640c78a0d1c1942e16b097d0b96030fb050c2 100644 (file)
@@ -30,5 +30,3 @@
 #define miDebugNext 6
 
 #define wConsole 128
-
-
index 3518fe5d5ce6ce6ddf21fa667f36e760d1ee1bb6..5bbe3399a955ad9a9be47af00e26f19f4c87727d 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1995 Free Software Foundation, Inc.
    Written by Stan Shebs.  Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can 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 eve nthe implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without eve nthe implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Note that because all the available Mac compilers are ANSI or very
    close, and this is a native-only file, the code may be purely ANSI.  */
@@ -103,7 +104,7 @@ child_attach (args, from_tty)
   psn.highLongOfPSN = 0;
   psn.lowLongOfPSN = pid;
 
-  inforec.processInfoLength = sizeof(ProcessInfoRec);
+  inforec.processInfoLength = sizeof (ProcessInfoRec);
   inforec.processName = name;
   inforec.processAppSpec = fsspec;
 
@@ -193,14 +194,14 @@ child_create_inferior (exec_file, allargs, env)
   launchparms.launchControlFlags = launchContinue | launchNoFileFlags;
   fsspec.vRefNum = 0;
   fsspec.parID = 0;
-  strcpy(fsspec.name + 1, exec_file);
-  fsspec.name[0] = strlen(exec_file);
+  strcpy (fsspec.name + 1, exec_file);
+  fsspec.name[0] = strlen (exec_file);
   launchparms.launchAppSpec = &fsspec;
   launchparms.launchAppParameters = nil;
 
   launch_err = LaunchApplication (&launchparms);
 
-  if (launch_err == 999 /*memFullErr*/)
+  if (launch_err == 999 /*memFullErr */ )
     {
       error ("Not enough memory to launch %s\n", exec_file);
     }
@@ -233,7 +234,7 @@ child_stop ()
 
 int
 child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
-                int write, struct target_ops *target)
+                  int write, struct target_ops *target)
 {
   int i;
 
@@ -294,7 +295,7 @@ info_proc (args, from_tty)
   psn.highLongOfPSN = 0;
   psn.lowLongOfPSN = kNoProcess;
 
-  inforec.processInfoLength = sizeof(ProcessInfoRec);
+  inforec.processInfoLength = sizeof (ProcessInfoRec);
   inforec.processName = name;
   inforec.processAppSpec = fsspec;
 
@@ -310,14 +311,14 @@ info_proc (args, from_tty)
          printf_filtered (" %c%c%c%c",
                           (code >> 24) & 0xff,
                           (code >> 16) & 0xff,
-                          (code >>  8) & 0xff,
-                          (code >>  0) & 0xff);
+                          (code >> 8) & 0xff,
+                          (code >> 0) & 0xff);
          code = inforec.processType;
          printf_filtered (" %c%c%c%c",
                           (code >> 24) & 0xff,
                           (code >> 16) & 0xff,
-                          (code >>  8) & 0xff,
-                          (code >>  0) & 0xff);
+                          (code >> 8) & 0xff,
+                          (code >> 0) & 0xff);
          if (psn.highLongOfPSN == 0)
            printf_filtered (" %9d", psn.lowLongOfPSN);
          else
@@ -332,80 +333,80 @@ info_proc (args, from_tty)
     }
 }
 
-struct target_ops child_ops ;
+struct target_ops child_ops;
 
-static void 
-init_child_ops(void)
+static void
+init_child_ops (void)
 {
-  child_ops.to_shortname =   "mac";            
-  child_ops.to_longname =   "MacOS application";
-  child_ops.to_doc    =  "MacOS application (started by the \"run\" command).";
-  child_ops.to_open   =  child_open; 
-  child_ops.to_close  =  child_close;
-  child_ops.to_attach =  child_attach;
+  child_ops.to_shortname = "mac";
+  child_ops.to_longname = "MacOS application";
+  child_ops.to_doc = "MacOS application (started by the \"run\" command).";
+  child_ops.to_open = child_open;
+  child_ops.to_close = child_close;
+  child_ops.to_attach = child_attach;
   child_ops.to_post_attach = NULL;
-  child_ops.to_require_attach = NULL;                         /* to_require_attach */  
-  child_ops.to_detach =  child_detach;
-  child_ops.to_require_detach = NULL;                         /* to_require_detach */
-  child_ops.to_resume =  child_resume;
-  child_ops.to_wait   =  child_wait;   
-  child_ops.to_post_wait = NULL;                         /* to_post_wait */
-  child_ops.to_fetch_registers  =   child_fetch_inferior_registers;
-  child_ops.to_store_registers  =   child_store_inferior_registers;
-  child_ops.to_prepare_to_store =   child_prepare_to_store;
-  child_ops.to_xfer_memory =   child_xfer_memory;              
-  child_ops.to_files_info  =   child_files_info;               
-  child_ops.to_insert_breakpoint =   memory_insert_breakpoint; 
-  child_ops.to_remove_breakpoint =   memory_remove_breakpoint; 
-  child_ops.to_terminal_init  =   0;                           
-  child_ops.to_terminal_inferior =   0;                                
-  child_ops.to_terminal_ours_for_output =  0;
-  child_ops.to_terminal_ours  =   0;                   
-  child_ops.to_terminal_info  =   0;                   
-  child_ops.to_kill  =   child_kill_inferior;  
-  child_ops.to_load  =   0;    
-  child_ops.to_lookup_symbol   = 0;                    
+  child_ops.to_require_attach = NULL;  /* to_require_attach */
+  child_ops.to_detach = child_detach;
+  child_ops.to_require_detach = NULL;  /* to_require_detach */
+  child_ops.to_resume = child_resume;
+  child_ops.to_wait = child_wait;
+  child_ops.to_post_wait = NULL;       /* to_post_wait */
+  child_ops.to_fetch_registers = child_fetch_inferior_registers;
+  child_ops.to_store_registers = child_store_inferior_registers;
+  child_ops.to_prepare_to_store = child_prepare_to_store;
+  child_ops.to_xfer_memory = child_xfer_memory;
+  child_ops.to_files_info = child_files_info;
+  child_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  child_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  child_ops.to_terminal_init = 0;
+  child_ops.to_terminal_inferior = 0;
+  child_ops.to_terminal_ours_for_output = 0;
+  child_ops.to_terminal_ours = 0;
+  child_ops.to_terminal_info = 0;
+  child_ops.to_kill = child_kill_inferior;
+  child_ops.to_load = 0;
+  child_ops.to_lookup_symbol = 0;
   child_ops.to_create_inferior = child_create_inferior;
-  child_ops.to_post_startup_inferior = NULL;                         /* to_post_startup_inferior */
-  child_ops.to_acknowledge_created_inferior = NULL;                         /* to_acknowledge_created_inferior */
-  child_ops.to_clone_and_follow_inferior = NULL;                         /* to_clone_and_follow_inferior */
-  child_ops.to_post_follow_inferior_by_clone = NULL;                         /* to_post_follow_inferior_by_clone */
+  child_ops.to_post_startup_inferior = NULL;   /* to_post_startup_inferior */
+  child_ops.to_acknowledge_created_inferior = NULL;    /* to_acknowledge_created_inferior */
+  child_ops.to_clone_and_follow_inferior = NULL;       /* to_clone_and_follow_inferior */
+  child_ops.to_post_follow_inferior_by_clone = NULL;   /* to_post_follow_inferior_by_clone */
   child_ops.to_insert_fork_catchpoint = NULL;
   child_ops.to_remove_fork_catchpoint = NULL;
   child_ops.to_insert_vfork_catchpoint = NULL;
   child_ops.to_remove_vfork_catchpoint = NULL;
-  child_ops.to_has_forked = NULL;                         /* to_has_forked */
-  child_ops.to_has_vforked = NULL;                         /* to_has_vforked */
+  child_ops.to_has_forked = NULL;      /* to_has_forked */
+  child_ops.to_has_vforked = NULL;     /* to_has_vforked */
   child_ops.to_can_follow_vfork_prior_to_exec = NULL;
-  child_ops.to_post_follow_vfork = NULL;                         /* to_post_follow_vfork */
+  child_ops.to_post_follow_vfork = NULL;       /* to_post_follow_vfork */
   child_ops.to_insert_exec_catchpoint = NULL;
   child_ops.to_remove_exec_catchpoint = NULL;
   child_ops.to_has_execd = NULL;
   child_ops.to_reported_exec_events_per_exec_call = NULL;
   child_ops.to_has_exited = NULL;
-  child_ops.to_mourn_inferior  = child_mourn_inferior;         
-  child_ops.to_can_run         = child_can_run;
-  child_ops.to_notice_signals =  0;      
-  child_ops.to_thread_alive  =   0;       
-  child_ops.to_stop  =   child_stop;      
-  child_ops.to_pid_to_exec_file =  NULL;                         /* to_pid_to_exec_file */
+  child_ops.to_mourn_inferior = child_mourn_inferior;
+  child_ops.to_can_run = child_can_run;
+  child_ops.to_notice_signals = 0;
+  child_ops.to_thread_alive = 0;
+  child_ops.to_stop = child_stop;
+  child_ops.to_pid_to_exec_file = NULL;                /* to_pid_to_exec_file */
   child_ops.to_core_file_to_sym_file = NULL;
-  child_ops.to_stratum =   process_stratum;
-  child_ops.DONT_USE =   0; 
-  child_ops.to_has_all_memory = 1; 
-  child_ops.to_has_memory     = 1; 
-  child_ops.to_has_stack      = 1; 
-  child_ops.to_has_registers  = 1; 
-  child_ops.to_has_execution  = 1; 
-  child_ops.to_sections       = 0; 
-  child_ops.to_sections_end   = 0; 
-  child_ops.to_magic =   OPS_MAGIC;
+  child_ops.to_stratum = process_stratum;
+  child_ops.DONT_USE = 0;
+  child_ops.to_has_all_memory = 1;
+  child_ops.to_has_memory = 1;
+  child_ops.to_has_stack = 1;
+  child_ops.to_has_registers = 1;
+  child_ops.to_has_execution = 1;
+  child_ops.to_sections = 0;
+  child_ops.to_sections_end = 0;
+  child_ops.to_magic = OPS_MAGIC;
 };
 
 void
 _initialize_mac_nat ()
 {
-  init_child_ops() ;
+  init_child_ops ();
 
   add_info ("proc", info_proc,
            "Show information about processes.");
index bf3f78deb1fd8772ba45829376a766bf97c930aa..ae5c4fafe5206381e2e767c556acc4af213945cc 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1994 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by Stan Shebs.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
@@ -100,7 +101,8 @@ int use_color_qd;
 
 int inbackground;
 
-Rect dragrect = { -32000, -32000, 32000, 32000 };
+Rect dragrect =
+{-32000, -32000, 32000, 32000};
 Rect sizerect;
 
 int sbarwid = 15;
@@ -118,7 +120,10 @@ TEHandle console_text;
 Rect console_text_rect;
 
 /* This will go away eventually. */
-gdb_has_a_terminal () { return 1; }
+gdb_has_a_terminal ()
+{
+  return 1;
+}
 
 mac_init ()
 {
@@ -137,13 +142,13 @@ mac_init ()
 
   mac_app = 0;
 
-  str = getenv("DEBUG_GDB");
+  str = getenv ("DEBUG_GDB");
   if (str != NULL && str[0] != '\0')
     {
-      if (strcmp(str, "openp") == 0)
+      if (strcmp (str, "openp") == 0)
        debug_openp = 1;
     }
-  
+
   /* Don't do anything if we`re running under MPW. */
   if (!StandAlone)
     return;
@@ -153,7 +158,7 @@ mac_init ()
      {RIncludes}siow.r, not be messed with.  If it is, then the
      standard Mac setup below will step on SIOW's Mac setup and
      most likely crash the machine. */
-  siow_resource = GetResource('siow', 0);
+  siow_resource = GetResource ('siow', 0);
   if (siow_resource != nil)
     return;
 
@@ -170,7 +175,7 @@ mac_init ()
   InitCursor ();
 
   /* Color Quickdraw is different from Classic QD. */
-  SysEnvirons(2, &se);
+  SysEnvirons (2, &se);
   has_color_qd = se.hasColorQD;
   /* Use it if we got it. */
   use_color_qd = has_color_qd;
@@ -178,10 +183,10 @@ mac_init ()
   sizerect.top = 50;
   sizerect.left = 50;
   sizerect.bottom = 1000;
-  sizerect.right  = 1000;
+  sizerect.right = 1000;
 #if 0
   sizerect.bottom = screenBits.bounds.bottom - screenBits.bounds.top;
-  sizerect.right  = screenBits.bounds.right  - screenBits.bounds.left;
+  sizerect.right = screenBits.bounds.right - screenBits.bounds.left;
 #endif
 
   /* Set up the menus. */
@@ -189,9 +194,10 @@ mac_init ()
   SetMenuBar (menubar);
   /* Add the DAs etc as usual. */
   menu = GetMHandle (mApple);
-  if (menu != nil) {
-    AddResMenu (menu, 'DRVR');
-  }
+  if (menu != nil)
+    {
+      AddResMenu (menu, 'DRVR');
+    }
   DrawMenuBar ();
 
   new_console_window ();
@@ -201,9 +207,9 @@ new_console_window ()
 {
   /* Create the main window we're going to play in. */
   if (has_color_qd)
-    console_window = GetNewCWindow (wConsole, NULL, (WindowPtr) -1L);
+    console_window = GetNewCWindow (wConsole, NULL, (WindowPtr) - 1L);
   else
-    console_window = GetNewWindow (wConsole, NULL, (WindowPtr) -1L);
+    console_window = GetNewWindow (wConsole, NULL, (WindowPtr) - 1L);
 
   SetPort (console_window);
   console_text_rect = console_window->portRect;
@@ -228,7 +234,7 @@ new_console_window ()
   SelectWindow (console_window);
 }
 
-mac_command_loop()
+mac_command_loop ()
 {
   SysEnvRec se;
   int eventloopdone = 0;
@@ -254,7 +260,7 @@ mac_command_loop()
        {
          get_global_mouse (&mouse);
          adjust_cursor (mouse, cursorRgn);
-         tm = GetCaretTime();
+         tm = GetCaretTime ();
          gotevent = WaitNextEvent (everyEvent, &event, tm, cursorRgn);
        }
       else
@@ -267,7 +273,7 @@ mac_command_loop()
        {
          short itemhit;
          DialogPtr dialog;
-      
+
          /* Handle all the modeless dialogs here. */
          if (DialogSelect (&event, &dialog, &itemhit))
            {
@@ -289,10 +295,10 @@ mac_command_loop()
 /* Collect the global coordinates of the mouse pointer.  */
 
 get_global_mouse (mouse)
-Point *mouse;
+     Point *mouse;
 {
   EventRecord evt;
-       
+
   OSEventAvail (0, &evt);
   *mouse = evt.where;
 }
@@ -301,15 +307,15 @@ Point *mouse;
    location.  */
 
 adjust_cursor (mouse, region)
-Point mouse;
-RgnHandle region;
+     Point mouse;
+     RgnHandle region;
 {
 }
 
 /* Decipher an event, maybe do something with it.  */
 
 do_event (evt)
-EventRecord *evt;
+     EventRecord *evt;
 {
   short part, err, rslt = 0;
   WindowPtr win;
@@ -339,10 +345,11 @@ EventRecord *evt;
              /* Fix the menu to match the new front window. */
              adjust_menus ();
              /* We always want to discard the event now, since clicks in a
-                windows are often irreversible actions. */
-           } else
-             /* Mouse clicks in the front window do something useful. */
-             do_mouse_down (win, evt);
+                windows are often irreversible actions. */
+           }
+         else
+           /* Mouse clicks in the front window do something useful. */
+           do_mouse_down (win, evt);
          break;
        case inDrag:
          /* Standard drag behavior, no tricks necessary. */
@@ -389,7 +396,7 @@ EventRecord *evt;
       break;
     case diskEvt:
       /* Call DIBadMount in response to a diskEvt, so that the user can format
-        a floppy. (from DTS Sample) */
+         a floppy. (from DTS Sample) */
       if (HiWord (evt->message) != noErr)
        {
          SetPt (&pnt, 50, 50);
@@ -429,8 +436,8 @@ do_idle ()
 }
 
 grow_window (win, where)
-WindowPtr win;
-Point where;
+     WindowPtr win;
+     Point where;
 {
   long winsize;
   int h, v;
@@ -455,9 +462,9 @@ Point where;
 }
 
 zoom_window (win, where, part)
-WindowPtr win;
-Point where;
-short part;
+     WindowPtr win;
+     Point where;
+     short part;
 {
   ZoomWindow (win, part, (win == FrontWindow ()));
   if (win == console_window)
@@ -475,7 +482,7 @@ resize_console_window ()
 }
 
 close_window (win)
-WindowPtr win;
+     WindowPtr win;
 {
 }
 
@@ -499,13 +506,13 @@ v_scroll_proc (ControlHandle control, short part)
          amount = pagesize;
          break;
        case inPageDown:
-         amount = - pagesize;
+         amount = -pagesize;
          break;
        default:
          /* (should freak out) */
          break;
        }
-      SetCtlValue(control, oldval - amount);
+      SetCtlValue (control, oldval - amount);
       newval = GetCtlValue (control);
       amount = oldval - newval;
       if (amount)
@@ -513,18 +520,18 @@ v_scroll_proc (ControlHandle control, short part)
     }
 }
 
-do_mouse_down (WindowPtr win, EventRecord *event)
+do_mouse_down (WindowPtr win, EventRecord * event)
 {
   short part, value;
   Point mouse;
   ControlHandle control;
 
-  if (1 /*is_app_window(win)*/)
+  if (1 /*is_app_window(win) */ )
     {
       SetPort (win);
       mouse = event->where;
       GlobalToLocal (&mouse);
-      part = FindControl(mouse, win, &control);
+      part = FindControl (mouse, win, &control);
       if (control == console_v_scrollbar)
        {
          switch (part)
@@ -536,13 +543,13 @@ do_mouse_down (WindowPtr win, EventRecord *event)
                {
                  value -= GetCtlValue (control);
                  if (value)
-                   TEScroll(0, value * (*console_text)->lineHeight,
-                            console_text);
+                   TEScroll (0, value * (*console_text)->lineHeight,
+                             console_text);
                }
              break;
            default:
-#if 0 /* don't deal with right now */
-#if 1 /* universal headers */
+#if 0                          /* don't deal with right now */
+#if 1                          /* universal headers */
              value = TrackControl (control, mouse, (ControlActionUPP) v_scroll_proc);
 #else
              value = TrackControl (control, mouse, (ProcPtr) v_scroll_proc);
@@ -559,21 +566,22 @@ do_mouse_down (WindowPtr win, EventRecord *event)
 }
 
 scroll_text (hlines, vlines)
-int hlines, vlines;
+     int hlines, vlines;
 {
 }
 
 activate_window (win, activate)
-WindowPtr win;
-int activate;
+     WindowPtr win;
+     int activate;
 {
   Rect grow_rect;
 
-  if (win == nil) return;
+  if (win == nil)
+    return;
   /* It's convenient to make the activated window also be the
      current GrafPort. */
   if (activate)
-    SetPort(win);
+    SetPort (win);
   /* Activate the console window's scrollbar. */
   if (win == console_window)
     {
@@ -596,7 +604,7 @@ int activate;
 }
 
 update_window (win)
-WindowPtr win;
+     WindowPtr win;
 {
   int controls = 1, growbox = 0;
   GrafPtr oldport;
@@ -625,7 +633,7 @@ adjust_menus ()
 }
 
 do_menu_command (which)
-long which;
+     long which;
 {
   short menuid, menuitem;
   short itemHit;
@@ -729,7 +737,7 @@ long which;
 char commandbuf[1000];
 
 do_keyboard_command (key)
-int key;
+     int key;
 {
   int startpos, endpos, i, len;
   char *last_newline;
@@ -757,13 +765,15 @@ int key;
          len = (text_str + startpos) - 1 - last_newline;
          cmd_start = last_newline + 1;
        }
-      if (len > 1000) len = 999;
-      if (len < 0) len = 0;
+      if (len > 1000)
+       len = 999;
+      if (len < 0)
+       len = 0;
       strncpy (commandbuf + 1, cmd_start, len);
       commandbuf[1 + len] = 0;
       command = commandbuf + 1;
       HUnlock ((Handle) text);
-      commandbuf[0] = strlen(command);
+      commandbuf[0] = strlen (command);
 
       /* Insert a newline and recalculate before doing any command. */
       key = '\015';
@@ -797,11 +807,12 @@ draw_console ()
 /* Cause an update of a given window's entire contents.  */
 
 force_update (win)
-WindowPtr win;
+     WindowPtr win;
 {
   GrafPtr oldport;
 
-  if (win == nil) return;
+  if (win == nil)
+    return;
   GetPort (&oldport);
   SetPort (win);
   EraseRect (&win->portRect);
@@ -821,12 +832,12 @@ adjust_console_sizes ()
   tmprect.left += 7;
   tmprect.right -= sbarwid;
   tmprect.bottom -= sbarwid;
-  InsetRect(&tmprect, 1, 1);
+  InsetRect (&tmprect, 1, 1);
   (*console_text)->destRect = tmprect;
   /* Fiddle bottom of viewrect to be even multiple of text lines. */
   tmprect.bottom = tmprect.top
     + ((tmprect.bottom - tmprect.top) / (*console_text)->lineHeight)
-      * (*console_text)->lineHeight;
+    * (*console_text)->lineHeight;
   (*console_text)->viewRect = tmprect;
 }
 
@@ -839,7 +850,8 @@ adjust_console_scrollbars ()
   newmax = lines - (((*console_text)->viewRect.bottom
                     - (*console_text)->viewRect.top)
                    / (*console_text)->lineHeight);
-  if (newmax < 0) newmax = 0;
+  if (newmax < 0)
+    newmax = 0;
   SetCtlMax (console_v_scrollbar, newmax);
   value = ((*console_text)->viewRect.top - (*console_text)->destRect.top)
     / (*console_text)->lineHeight;
@@ -854,7 +866,7 @@ adjust_console_text ()
 {
   TEScroll (((*console_text)->viewRect.left
             - (*console_text)->destRect.left)
-           - 0 /* get h scroll value */,
+           - 0 /* get h scroll value */ ,
            ((((*console_text)->viewRect.top - (*console_text)->destRect.top)
              / (*console_text)->lineHeight)
             - GetCtlValue (console_v_scrollbar))
@@ -939,7 +951,7 @@ tilde_expand (char *str)
 #undef fprintf
 
 int
-hacked_fprintf (FILE *fp, const char *fmt, ...)
+hacked_fprintf (FILE * fp, const char *fmt,...)
 {
   int ret;
   va_list ap;
@@ -949,8 +961,8 @@ hacked_fprintf (FILE *fp, const char *fmt, ...)
     {
       char buf[1000];
 
-      ret = vsprintf(buf, fmt, ap);
-      TEInsert (buf, strlen(buf), console_text);
+      ret = vsprintf (buf, fmt, ap);
+      TEInsert (buf, strlen (buf), console_text);
     }
   else
     ret = vfprintf (fp, fmt, ap);
@@ -961,30 +973,30 @@ hacked_fprintf (FILE *fp, const char *fmt, ...)
 #undef printf
 
 int
-hacked_printf (const char *fmt, ...)
+hacked_printf (const char *fmt,...)
 {
   int ret;
   va_list ap;
 
   va_start (ap, fmt);
-  ret = hacked_vfprintf(stdout, fmt, ap);
+  ret = hacked_vfprintf (stdout, fmt, ap);
   va_end (ap);
   return ret;
 }
 
 #undef vfprintf
 
-int 
-hacked_vfprintf (FILE *fp, const char *format, va_list args)
+int
+hacked_vfprintf (FILE * fp, const char *format, va_list args)
 {
   if (mac_app && (fp == stdout || fp == stderr))
     {
       char buf[1000];
       int ret;
 
-      ret = vsprintf(buf, format, args);
-      TEInsert (buf, strlen(buf), console_text);
-      if (strchr(buf, '\n'))
+      ret = vsprintf (buf, format, args);
+      TEInsert (buf, strlen (buf), console_text);
+      if (strchr (buf, '\n'))
        {
          adjust_console_sizes ();
          adjust_console_scrollbars ();
@@ -998,12 +1010,12 @@ hacked_vfprintf (FILE *fp, const char *format, va_list args)
 
 #undef fputs
 
-hacked_fputs (const char *s, FILE *fp)
+hacked_fputs (const char *s, FILE * fp)
 {
   if (mac_app && (fp == stdout || fp == stderr))
     {
-      TEInsert (s, strlen(s), console_text);
-      if (strchr(s, '\n'))
+      TEInsert (s, strlen (s), console_text);
+      if (strchr (s, '\n'))
        {
          adjust_console_sizes ();
          adjust_console_scrollbars ();
@@ -1017,7 +1029,7 @@ hacked_fputs (const char *s, FILE *fp)
 
 #undef fputc
 
-hacked_fputc (const char c, FILE *fp)
+hacked_fputc (const char c, FILE * fp)
 {
   if (mac_app && (fp == stdout || fp == stderr))
     {
@@ -1039,7 +1051,7 @@ hacked_fputc (const char c, FILE *fp)
 
 #undef putc
 
-hacked_putc (const char c, FILE *fp)
+hacked_putc (const char c, FILE * fp)
 {
   if (mac_app && (fp == stdout || fp == stderr))
     {
@@ -1061,7 +1073,7 @@ hacked_putc (const char c, FILE *fp)
 
 #undef fflush
 
-hacked_fflush (FILE *fp)
+hacked_fflush (FILE * fp)
 {
   if (mac_app && (fp == stdout || fp == stderr))
     {
@@ -1075,12 +1087,12 @@ hacked_fflush (FILE *fp)
 
 #undef fgetc
 
-hacked_fgetc (FILE *fp)
+hacked_fgetc (FILE * fp)
 {
   if (mac_app && (fp == stdin))
     {
       /* Catch any attempts to use this.  */
-      DebugStr("\pShould not be reading from stdin!");
+      DebugStr ("\pShould not be reading from stdin!");
       return '\n';
     }
   return fgetc (fp);
index b5daec3a0186d315e6562f6e894b2afd45ebbb9f..26a97cd697a908283a24df75aed6abe7ae374f59 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "top.h"
@@ -45,9 +46,9 @@ int display_time;
 int display_space;
 
 /* Whether this is the async version or not.  The async version is
-invoked on the command line with the -nw --async options.  In this
-version, the usual command_loop is substituted by and event loop which
-processes UI events asynchronously. */
+   invoked on the command line with the -nw --async options.  In this
+   version, the usual command_loop is substituted by and event loop which
+   processes UI events asynchronously. */
 int async_p = 1;
 
 /* Whether this is the command line version or not */
@@ -73,11 +74,11 @@ static void print_gdb_help PARAMS ((GDB_FILE *));
    out files to be edited by another program. */
 
 extern int enable_external_editor;
-extern char * external_editor_command;
+extern char *external_editor_command;
 
 #ifdef __CYGWIN__
-#include <windows.h> /* for MAX_PATH */
-#include <sys/cygwin.h> /* for cygwin32_conv_to_posix_path */
+#include <windows.h>           /* for MAX_PATH */
+#include <sys/cygwin.h>                /* for cygwin32_conv_to_posix_path */
 #endif
 
 int
@@ -113,7 +114,7 @@ main (argc, argv)
   int dirsize;
   /* Number of elements used.  */
   int ndir;
-  
+
   struct stat homebuf, cwdbuf;
   char *homedir, *homeinit;
 
@@ -140,9 +141,10 @@ main (argc, argv)
 #endif
 
   /* If error() is called from initialization code, just exit */
-  if (SET_TOP_LEVEL ()) {
-    exit(1);
-  }
+  if (SET_TOP_LEVEL ())
+    {
+      exit (1);
+    }
 
   cmdsize = 1;
   cmdarg = (char **) xmalloc (cmdsize * sizeof (*cmdarg));
@@ -163,13 +165,13 @@ main (argc, argv)
   /* not yet */
   gdb_stdout = stdio_fileopen (stdout);
   gdb_stderr = stdio_fileopen (stderr);
-  gdb_stdlog = gdb_stderr; /* for moment */
-  gdb_stdtarg = gdb_stderr; /* for moment */
+  gdb_stdlog = gdb_stderr;     /* for moment */
+  gdb_stdtarg = gdb_stderr;    /* for moment */
 #else
   gdb_stdout = tui_fileopen (stdout);
   gdb_stderr = tui_fileopen (stderr);
-  gdb_stdlog = gdb_stdout; /* for moment */
-  gdb_stdtarg = gdb_stderr; /* for moment */
+  gdb_stdlog = gdb_stdout;     /* for moment */
+  gdb_stdtarg = gdb_stderr;    /* for moment */
 #endif
 
   /* Parse arguments and options.  */
@@ -179,61 +181,61 @@ main (argc, argv)
        short option (or arbitrary numbers starting at 10 for those
        with no equivalent).  */
     static struct option long_options[] =
-       {
-        {"async", no_argument, &async_p, 1},  
-        {"noasync", no_argument, &async_p, 0},  
+    {
+      {"async", no_argument, &async_p, 1},
+      {"noasync", no_argument, &async_p, 0},
 #if defined(TUI)
-       {"tui", no_argument, &tui_version, 1},
+      {"tui", no_argument, &tui_version, 1},
 #endif
-       {"xdb", no_argument, &xdb_commands, 1},
-       {"dbx", no_argument, &dbx_commands, 1},
-       {"readnow", no_argument, &readnow_symbol_files, 1},
-       {"r", no_argument, &readnow_symbol_files, 1},
-       {"mapped", no_argument, &mapped_symbol_files, 1},
-       {"m", no_argument, &mapped_symbol_files, 1},
-       {"quiet", no_argument, &quiet, 1},
-       {"q", no_argument, &quiet, 1},
-       {"silent", no_argument, &quiet, 1},
-       {"nx", no_argument, &inhibit_gdbinit, 1},
-       {"n", no_argument, &inhibit_gdbinit, 1},
-       {"batch", no_argument, &batch, 1},
-       {"epoch", no_argument, &epoch_interface, 1},
-
-       /* This is a synonym for "--annotate=1".  --annotate is now preferred,
-          but keep this here for a long time because people will be running
-          emacses which use --fullname.  */
-       {"fullname", no_argument, 0, 'f'},
-       {"f", no_argument, 0, 'f'},
-
-       {"annotate", required_argument, 0, 12},
-       {"help", no_argument, &print_help, 1},
-       {"se", required_argument, 0, 10},
-       {"symbols", required_argument, 0, 's'},
-       {"s", required_argument, 0, 's'},
-       {"exec", required_argument, 0, 'e'},
-       {"e", required_argument, 0, 'e'},
-       {"core", required_argument, 0, 'c'},
-       {"c", required_argument, 0, 'c'},
-       {"command", required_argument, 0, 'x'},
-       {"version", no_argument, &print_version, 1},
-       {"x", required_argument, 0, 'x'},
-       {"directory", required_argument, 0, 'd'},
-       {"cd", required_argument, 0, 11},
-       {"tty", required_argument, 0, 't'},
-       {"baud", required_argument, 0, 'b'},
-       {"b", required_argument, 0, 'b'},
-       {"nw", no_argument, &use_windows, 0},
-       {"nowindows", no_argument, &use_windows, 0},
-       {"w", no_argument, &use_windows, 1},
-       {"windows", no_argument, &use_windows, 1},
-       {"statistics", no_argument, 0, 13},
-       {"write", no_argument, &write_files, 1},
+      {"xdb", no_argument, &xdb_commands, 1},
+      {"dbx", no_argument, &dbx_commands, 1},
+      {"readnow", no_argument, &readnow_symbol_files, 1},
+      {"r", no_argument, &readnow_symbol_files, 1},
+      {"mapped", no_argument, &mapped_symbol_files, 1},
+      {"m", no_argument, &mapped_symbol_files, 1},
+      {"quiet", no_argument, &quiet, 1},
+      {"q", no_argument, &quiet, 1},
+      {"silent", no_argument, &quiet, 1},
+      {"nx", no_argument, &inhibit_gdbinit, 1},
+      {"n", no_argument, &inhibit_gdbinit, 1},
+      {"batch", no_argument, &batch, 1},
+      {"epoch", no_argument, &epoch_interface, 1},
+
+    /* This is a synonym for "--annotate=1".  --annotate is now preferred,
+       but keep this here for a long time because people will be running
+       emacses which use --fullname.  */
+      {"fullname", no_argument, 0, 'f'},
+      {"f", no_argument, 0, 'f'},
+
+      {"annotate", required_argument, 0, 12},
+      {"help", no_argument, &print_help, 1},
+      {"se", required_argument, 0, 10},
+      {"symbols", required_argument, 0, 's'},
+      {"s", required_argument, 0, 's'},
+      {"exec", required_argument, 0, 'e'},
+      {"e", required_argument, 0, 'e'},
+      {"core", required_argument, 0, 'c'},
+      {"c", required_argument, 0, 'c'},
+      {"command", required_argument, 0, 'x'},
+      {"version", no_argument, &print_version, 1},
+      {"x", required_argument, 0, 'x'},
+      {"directory", required_argument, 0, 'd'},
+      {"cd", required_argument, 0, 11},
+      {"tty", required_argument, 0, 't'},
+      {"baud", required_argument, 0, 'b'},
+      {"b", required_argument, 0, 'b'},
+      {"nw", no_argument, &use_windows, 0},
+      {"nowindows", no_argument, &use_windows, 0},
+      {"w", no_argument, &use_windows, 1},
+      {"windows", no_argument, &use_windows, 1},
+      {"statistics", no_argument, 0, 13},
+      {"write", no_argument, &write_files, 1},
 /* Allow machine descriptions to add more options... */
 #ifdef ADDITIONAL_OPTIONS
-       ADDITIONAL_OPTIONS
+      ADDITIONAL_OPTIONS
 #endif
-       {0, no_argument, 0, 0}
-      };
+      {0, no_argument, 0, 0}
+    };
 
     while (1)
       {
@@ -288,7 +290,7 @@ main (argc, argv)
            if (ncmd >= cmdsize)
              {
                cmdsize *= 2;
-               cmdarg = (char **) xrealloc ((char *)cmdarg,
+               cmdarg = (char **) xrealloc ((char *) cmdarg,
                                             cmdsize * sizeof (*cmdarg));
              }
            break;
@@ -297,7 +299,7 @@ main (argc, argv)
            if (ndir >= dirsize)
              {
                dirsize *= 2;
-               dirarg = (char **) xrealloc ((char *)dirarg,
+               dirarg = (char **) xrealloc ((char *) dirarg,
                                             dirsize * sizeof (*dirarg));
              }
            break;
@@ -316,7 +318,7 @@ main (argc, argv)
              if (i == 0 && p == optarg)
 
                /* Don't use *_filtered or warning() (which relies on
-                   current_target) until after initialize_all_files(). */
+                  current_target) until after initialize_all_files(). */
 
                fprintf_unfiltered
                  (gdb_stderr,
@@ -333,23 +335,23 @@ main (argc, argv)
              if (i == 0 && p == optarg)
 
                /* Don't use *_filtered or warning() (which relies on
-                   current_target) until after initialize_all_files(). */
+                  current_target) until after initialize_all_files(). */
 
                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;
            }
            break;
 
 #ifdef ADDITIONAL_OPTION_CASES
-         ADDITIONAL_OPTION_CASES
+           ADDITIONAL_OPTION_CASES
 #endif
          case '?':
            fprintf_unfiltered (gdb_stderr,
-                    "Use `%s --help' for a complete list of options.\n",
-                    argv[0]);
+                       "Use `%s --help' for a complete list of options.\n",
+                               argv[0]);
            exit (1);
          }
       }
@@ -369,7 +371,7 @@ main (argc, argv)
        window system.  */
     if (tui_version)
       use_windows = 0;
-#endif      
+#endif
 
     /* OK, that's all the options.  The other arguments are filenames.  */
     count = 0;
@@ -385,8 +387,8 @@ main (argc, argv)
          break;
        case 3:
          fprintf_unfiltered (gdb_stderr,
-                  "Excess command line arguments ignored. (%s%s)\n",
-                  argv[optind], (optind == argc - 1) ? "" : " ...");
+                         "Excess command line arguments ignored. (%s%s)\n",
+                         argv[optind], (optind == argc - 1) ? "" : " ...");
          break;
        }
     if (batch)
@@ -423,12 +425,12 @@ main (argc, argv)
   if (!quiet)
     {
       /* Print all the junk at the top, with trailing "..." if we are about
-        to read a symbol file (possibly slowly).  */
+         to read a symbol file (possibly slowly).  */
       print_gdb_version (gdb_stdout);
       if (symarg)
        printf_filtered ("..");
-      wrap_here("");
-      gdb_flush (gdb_stdout);          /* Force to screen during slow operations */
+      wrap_here ("");
+      gdb_flush (gdb_stdout);  /* Force to screen during slow operations */
     }
 
   error_pre_print = "\n\n";
@@ -443,18 +445,18 @@ main (argc, argv)
      debugging or what directory you are in.  */
 #ifdef __CYGWIN32__
   {
-    char * tmp = getenv ("HOME");
-    
+    char *tmp = getenv ("HOME");
+
     if (tmp != NULL)
       {
-        homedir = (char *) alloca (MAX_PATH+1);
-        cygwin32_conv_to_posix_path (tmp, homedir);
+       homedir = (char *) alloca (MAX_PATH + 1);
+       cygwin32_conv_to_posix_path (tmp, homedir);
       }
     else
       homedir = NULL;
   }
 #else
-  homedir = getenv ("HOME");  
+  homedir = getenv ("HOME");
 #endif
   if (homedir)
     {
@@ -472,16 +474,16 @@ main (argc, argv)
       do_cleanups (ALL_CLEANUPS);
 
       /* Do stats; no need to do them elsewhere since we'll only
-        need them if homedir is set.  Make sure that they are
-        zero in case one of them fails (this guarantees that they
-        won't match if either exists).  */
-      
+         need them if homedir is set.  Make sure that they are
+         zero in case one of them fails (this guarantees that they
+         won't match if either exists).  */
+
       memset (&homebuf, 0, sizeof (struct stat));
       memset (&cwdbuf, 0, sizeof (struct stat));
-      
+
       stat (homeinit, &homebuf);
-      stat (gdbinit, &cwdbuf); /* We'll only need this if
-                                      homedir was set.  */
+      stat (gdbinit, &cwdbuf); /* We'll only need this if
+                                  homedir was set.  */
     }
 
   /* Now perform all the actions indicated by the arguments.  */
@@ -497,7 +499,7 @@ main (argc, argv)
   for (i = 0; i < ndir; i++)
     if (!SET_TOP_LEVEL ())
       directory_command (dirarg[i], 0);
-  free ((PTR)dirarg);
+  free ((PTR) dirarg);
   do_cleanups (ALL_CLEANUPS);
 
   if (execarg != NULL
@@ -505,7 +507,7 @@ main (argc, argv)
       && STREQ (execarg, symarg))
     {
       /* The exec file and the symbol-file are the same.  If we can't open
-        it, better only print one error message.  */
+         it, better only print one error message.  */
       if (!SET_TOP_LEVEL ())
        {
          exec_file_command (execarg, !batch);
@@ -557,7 +559,7 @@ main (argc, argv)
 
   /* Read the .gdbinit file in the current directory, *if* it isn't
      the same as the $HOME/.gdbinit file (it should exist, also).  */
-  
+
   if (!homedir
       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
     if (!inhibit_gdbinit)
@@ -573,7 +575,7 @@ main (argc, argv)
        {
          /* NOTE: I am commenting this out, because it is not clear
             where this feature is used. It is very old and
-            undocumented. ezannoni: 1999-05-04*/
+            undocumented. ezannoni: 1999-05-04 */
 #if 0
          if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0')
            read_command_file (stdin);
@@ -583,10 +585,10 @@ main (argc, argv)
          do_cleanups (ALL_CLEANUPS);
        }
     }
-  free ((PTR)cmdarg);
+  free ((PTR) cmdarg);
 
   /* Read in the old history after all the command files have been read. */
-  init_history();
+  init_history ();
 
   if (batch)
     {
@@ -632,7 +634,7 @@ main (argc, argv)
     {
       if (!SET_TOP_LEVEL ())
        {
-         do_cleanups (ALL_CLEANUPS);           /* Do complete cleanup */
+         do_cleanups (ALL_CLEANUPS);   /* Do complete cleanup */
          /* GUIs generally have their own command loop, mainloop, or whatever.
             This is a good place to gain control because many error
             conditions will end up here via longjmp(). */
@@ -640,7 +642,7 @@ main (argc, argv)
            command_loop_hook ();
          else
            command_loop ();
-          quit_command ((char *)0, instream == stdin);
+         quit_command ((char *) 0, instream == stdin);
        }
     }
   /* No exit -- exit is through quit_command.  */
@@ -654,24 +656,24 @@ main (argc, argv)
 
 static void
 print_gdb_help (stream)
-  GDB_FILE *stream;
+     GDB_FILE *stream;
 {
-      fputs_unfiltered ("\
+  fputs_unfiltered ("\
 This is the GNU debugger.  Usage:\n\n\
     gdb [options] [executable-file [core-file or process-id]]\n\n\
 Options:\n\n\
 ", stream);
-       fputs_unfiltered ("\
+  fputs_unfiltered ("\
   --[no]async        Enable (disable) asynchronous version of CLI\n\
 ", stream);
-      fputs_unfiltered ("\
+  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\
 ", stream);
-      fputs_unfiltered ("\
+  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\
@@ -679,40 +681,40 @@ Options:\n\n\
   --fullname         Output information used by emacs-GDB interface.\n\
   --help             Print this message.\n\
 ", stream);
-      fputs_unfiltered ("\
+  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 .gdbinit file.\n\
   --quiet            Do not print version number on startup.\n\
   --readnow          Fully read symbol files on first access.\n\
 ", stream);
-      fputs_unfiltered ("\
+  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);
 #if defined(TUI)
-      fputs_unfiltered ("\
+  fputs_unfiltered ("\
   --tui              Use a terminal user interface.\n\
 ", 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);
 #ifdef ADDITIONAL_OPTION_HELP
-      fputs_unfiltered (ADDITIONAL_OPTION_HELP, stream);
+  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@prep.ai.mit.edu\".\
 ", stream);
 }
-
 \f
+
 /* All TUI I/O sent to the *_filtered and *_unfiltered functions
    eventually ends up here.  The fputs_unfiltered_hook is primarily
    used by GUIs to collect all output and send it to the GUI, instead
@@ -744,39 +746,51 @@ tui_file_fputs (linebuffer, file)
   else
     {
 #if defined(TUI)
-      if (tui_version && tui_owns_terminal) {
-       /* If we get here somehow while updating the TUI (from
-        * within a tuiDo(), then we need to temporarily 
-        * set up the terminal for GDB output. This probably just
-        * happens on error output.
-        */
-
-        if (stream->ts_streamtype == astring) {
-           gdb_file_adjust_strbuf(strlen(linebuffer), stream);
-           strcat(stream->ts_strbuf, linebuffer);
-        } else {
-           tuiTermUnsetup(0, (tui_version) ? cmdWin->detail.commandInfo.curch : 0);
-           fputs (linebuffer, stream->ts_filestream);
-           tuiTermSetup(0);
-           if (linebuffer[strlen(linebuffer) - 1] == '\n')
-              tuiClearCommandCharCount();
-           else
-              tuiIncrCommandCharCountBy(strlen(linebuffer));
-        }
-      } else {
-        /* The normal case - just do a fputs() */
-        if (stream->ts_streamtype == astring) {
-           gdb_file_adjust_strbuf(strlen(linebuffer), stream);
-           strcat(stream->ts_strbuf, linebuffer);
-        } else fputs (linebuffer, stream->ts_filestream);
-      }
+      if (tui_version && tui_owns_terminal)
+       {
+         /* If we get here somehow while updating the TUI (from
+          * within a tuiDo(), then we need to temporarily 
+          * set up the terminal for GDB output. This probably just
+          * happens on error output.
+          */
+
+         if (stream->ts_streamtype == astring)
+           {
+             gdb_file_adjust_strbuf (strlen (linebuffer), stream);
+             strcat (stream->ts_strbuf, linebuffer);
+           }
+         else
+           {
+             tuiTermUnsetup (0, (tui_version) ? cmdWin->detail.commandInfo.curch : 0);
+             fputs (linebuffer, stream->ts_filestream);
+             tuiTermSetup (0);
+             if (linebuffer[strlen (linebuffer) - 1] == '\n')
+               tuiClearCommandCharCount ();
+             else
+               tuiIncrCommandCharCountBy (strlen (linebuffer));
+           }
+       }
+      else
+       {
+         /* The normal case - just do a fputs() */
+         if (stream->ts_streamtype == astring)
+           {
+             gdb_file_adjust_strbuf (strlen (linebuffer), stream);
+             strcat (stream->ts_strbuf, linebuffer);
+           }
+         else
+           fputs (linebuffer, stream->ts_filestream);
+       }
+
 
 #else
-      if (stream->ts_streamtype == astring) {
-           gdb_file_adjust_strbuf(strlen(linebuffer), file);
-           strcat(stream->ts_strbuf, linebuffer);
-        } else fputs (linebuffer, stream->ts_filestream);
+      if (stream->ts_streamtype == astring)
+       {
+         gdb_file_adjust_strbuf (strlen (linebuffer), file);
+         strcat (stream->ts_strbuf, linebuffer);
+       }
+      else
+       fputs (linebuffer, stream->ts_filestream);
 #endif
     }
 }
index 46e96d9fb602f0a85fbd73bef49b7596013da6e4..4ec051ad991c2aeda4ec8016a2d5e5f4e5303ea3 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbtypes.h"
 #include "demangle.h"
 #include "gdbcore.h"
-#include "expression.h" /* For language.h */
+#include "expression.h"                /* For language.h */
 #include "language.h"
 #include "symfile.h"
 #include "objfiles.h"
@@ -68,17 +69,17 @@ int watchdog = 0;
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       maintenance_command -- access the maintenance subcommands
+   maintenance_command -- access the maintenance subcommands
 
-SYNOPSIS
+   SYNOPSIS
 
-       void maintenance_command (char *args, int from_tty)
+   void maintenance_command (char *args, int from_tty)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 static void
 maintenance_command (args, from_tty)
@@ -105,12 +106,12 @@ maintenance_dump_me (args, from_tty)
 #endif
 
 /*  Someday we should allow demangling for things other than just
-    explicit strings.  For example, we might want to be able to
-    specify the address of a string in either GDB's process space
-    or the debuggee's process space, and have gdb fetch and demangle
-    that string.  If we have a char* pointer "ptr" that points to
-    a string, we might want to be able to given just the name and
-    have GDB demangle and print what it points to, etc.  (FIXME) */
+   explicit strings.  For example, we might want to be able to
+   specify the address of a string in either GDB's process space
+   or the debuggee's process space, and have gdb fetch and demangle
+   that string.  If we have a char* pointer "ptr" that points to
+   a string, we might want to be able to given just the name and
+   have GDB demangle and print what it points to, etc.  (FIXME) */
 
 static void
 maintenance_demangle (args, from_tty)
@@ -191,15 +192,15 @@ print_section_table (abfd, asect, ignore)
   /* FIXME-32x64: Need print_address_numeric with field width.  */
   printf_filtered ("    %s",
                   local_hex_string_custom
-                    ((unsigned long) bfd_section_vma (abfd, asect), "08l"));
+                  ((unsigned long) bfd_section_vma (abfd, asect), "08l"));
   printf_filtered ("->%s",
                   local_hex_string_custom
-                    ((unsigned long) (bfd_section_vma (abfd, asect)
-                                      + bfd_section_size (abfd, asect)),
-                     "08l"));
+                  ((unsigned long) (bfd_section_vma (abfd, asect)
+                                    + bfd_section_size (abfd, asect)),
+                   "08l"));
   printf_filtered (" at %s",
                   local_hex_string_custom
-                    ((unsigned long) asect->filepos, "08l"));
+                  ((unsigned long) asect->filepos, "08l"));
   printf_filtered (": %s", bfd_section_name (abfd, asect));
 
   if (flags & SEC_ALLOC)
@@ -239,19 +240,19 @@ maintenance_info_sections (arg, from_tty)
   if (exec_bfd)
     {
       printf_filtered ("Exec file:\n");
-      printf_filtered ("    `%s', ", bfd_get_filename(exec_bfd));
+      printf_filtered ("    `%s', ", bfd_get_filename (exec_bfd));
       wrap_here ("        ");
-      printf_filtered ("file type %s.\n", bfd_get_target(exec_bfd));
-      bfd_map_over_sections(exec_bfd, print_section_table, 0);
+      printf_filtered ("file type %s.\n", bfd_get_target (exec_bfd));
+      bfd_map_over_sections (exec_bfd, print_section_table, 0);
     }
 
   if (core_bfd)
     {
       printf_filtered ("Core file:\n");
-      printf_filtered ("    `%s', ", bfd_get_filename(core_bfd));
+      printf_filtered ("    `%s', ", bfd_get_filename (core_bfd));
       wrap_here ("        ");
-      printf_filtered ("file type %s.\n", bfd_get_target(core_bfd));
-      bfd_map_over_sections(core_bfd, print_section_table, 0);
+      printf_filtered ("file type %s.\n", bfd_get_target (core_bfd));
+      bfd_map_over_sections (core_bfd, print_section_table, 0);
     }
 }
 
@@ -281,9 +282,9 @@ maintenance_print_command (arg, from_tty)
 
 /* The "maintenance translate-address" command converts a section and address
    to a symbol.  This can be called in two ways:
-               maintenance translate-address <secname> <addr>
-       or      maintenance translate-address <addr>
-*/
+   maintenance translate-address <secname> <addr>
+   or   maintenance translate-address <addr>
+ */
 
 static void
 maintenance_translate_address (arg, from_tty)
@@ -304,19 +305,20 @@ maintenance_translate_address (arg, from_tty)
 
   if (!isdigit (*p))
     {                          /* See if we have a valid section name */
-      while (*p && !isspace (*p)) /* Find end of section name */
+      while (*p && !isspace (*p))      /* Find end of section name */
        p++;
       if (*p == '\000')                /* End of command? */
        error ("Need to specify <section-name> and <address>");
       *p++ = '\000';
-      while (isspace (*p)) p++;        /* Skip whitespace */
+      while (isspace (*p))
+       p++;                    /* Skip whitespace */
 
       ALL_OBJFILES (objfile)
-       {
-         sect = bfd_get_section_by_name (objfile->obfd, arg);
-         if (sect != NULL)
-           break;
-       }
+      {
+       sect = bfd_get_section_by_name (objfile->obfd, arg);
+       if (sect != NULL)
+         break;
+      }
 
       if (!sect)
        error ("Unknown section %s.", arg);
@@ -330,8 +332,8 @@ maintenance_translate_address (arg, from_tty)
     sym = lookup_minimal_symbol_by_pc (address);
 
   if (sym)
-    printf_filtered ("%s+%u\n", 
-                    SYMBOL_SOURCE_NAME (sym), 
+    printf_filtered ("%s+%u\n",
+                    SYMBOL_SOURCE_NAME (sym),
                     address - SYMBOL_VALUE_ADDRESS (sym));
   else if (sect)
     printf_filtered ("no symbol at %s:0x%08x\n", sect->name, address);
@@ -355,7 +357,7 @@ to test internal functions such as the C++ demangler, etc.",
   add_com_alias ("mt", "maintenance", class_maintenance, 1);
 
   add_prefix_cmd ("info", class_maintenance, maintenance_info_command,
-                 "Commands for showing internal info about the program being debugged.",
+     "Commands for showing internal info about the program being debugged.",
                  &maintenanceinfolist, "maintenance info ", 0,
                  &maintenancelist);
 
@@ -435,10 +437,10 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
           &maintenancelist);
 
   add_show_from_set (
-    add_set_cmd ("watchdog", class_maintenance, var_zinteger, (char *)&watchdog,
-                "Set watchdog timer.\n\
+                     add_set_cmd ("watchdog", class_maintenance, var_zinteger, (char *) &watchdog,
+                                  "Set watchdog timer.\n\
 When non-zero, this timeout is used instead of waiting forever for a target to\n\
 finish a low-level step or continue operation.  If the specified amount of time\n\
 passes without a response from the target, an error occurs.", &setlist),
-                    &showlist);
+                     &showlist);
 }
index 12b84553b0f1340dc1b2050b8e5074ba35010bbe..44f61bf29c9d3349ffc07f776cda515d70fadca5 100644 (file)
@@ -5,21 +5,22 @@
    CMU.  Major work by Per Bothner, John Gilmore and Ian Lance Taylor
    at Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module provides the function mdebug_build_psymtabs.  It reads
    ECOFF debugging information into partial symbol tables.  The
@@ -59,10 +60,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
 #include "coff/sym.h"
 #include "coff/symconst.h"
-typedef struct mips_extra_func_info {
-        long    numargs;
-        PDR     pdr;
-} *mips_extra_func_info_t;
+typedef struct mips_extra_func_info
+  {
+    long numargs;
+    PDR pdr;
+  }
+ *mips_extra_func_info_t;
 #ifndef RA_REGNUM
 #define RA_REGNUM 0
 #endif
@@ -101,26 +104,26 @@ extern void _initialize_mdebugread PARAMS ((void));
    case the symbol's ELF section could not be represented in ECOFF.  */
 #define ECOFF_IN_ELF(bfd) (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
                           && bfd_get_section_by_name (bfd, ".mdebug") != NULL)
-
 \f
+
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.  */
 
 struct symloc
-{
-  /* Index of the FDR that this psymtab represents.  */
-  int fdr_idx;
-  /* The BFD that the psymtab was created from.  */
-  bfd *cur_bfd;
-  const struct ecoff_debug_swap *debug_swap;
-  struct ecoff_debug_info *debug_info;
-  struct mdebug_pending **pending_list;
-  /* Pointer to external symbols for this file.  */
-  EXTR *extern_tab;
-  /* Size of extern_tab.  */
-  int extern_count;
-  enum language pst_language;
-};
+  {
+    /* Index of the FDR that this psymtab represents.  */
+    int fdr_idx;
+    /* The BFD that the psymtab was created from.  */
+    bfd *cur_bfd;
+    const struct ecoff_debug_swap *debug_swap;
+    struct ecoff_debug_info *debug_info;
+    struct mdebug_pending **pending_list;
+    /* Pointer to external symbols for this file.  */
+    EXTR *extern_tab;
+    /* Size of extern_tab.  */
+    int extern_count;
+    enum language pst_language;
+  };
 
 #define PST_PRIVATE(p) ((struct symloc *)(p)->read_symtab_private)
 #define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx)
@@ -141,8 +144,8 @@ struct symloc
 #define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon)
 #define SC_IS_BSS(sc) ((sc) == scBss || (sc) == scSBss)
 #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
-                                      
 \f
+
 /* Things we import explicitly from other modules */
 
 extern int info_verbose;
@@ -332,7 +335,7 @@ static void
 add_pending PARAMS ((FDR *, char *, struct type *));
 
 static struct mdebug_pending *
-is_pending_symbol PARAMS ((FDR *, char *));
+  is_pending_symbol PARAMS ((FDR *, char *));
 
 static void
 pop_parse_stack PARAMS ((void));
@@ -341,7 +344,7 @@ static void
 push_parse_stack PARAMS ((void));
 
 static char *
-fdr_name PARAMS ((FDR *));
+  fdr_name PARAMS ((FDR *));
 
 static void
 mdebug_psymtab_to_symtab PARAMS ((struct partial_symtab *));
@@ -354,7 +357,7 @@ parse_partial_symbols PARAMS ((struct objfile *,
                               struct section_offsets *));
 
 static FDR
-*get_rfd PARAMS ((int, int));
+* get_rfd PARAMS ((int, int));
 
 static int
 has_opaque_xref PARAMS ((FDR *, SYMR *));
@@ -364,38 +367,38 @@ cross_ref PARAMS ((int, union aux_ext *, struct type **, enum type_code,
                   char **, int, char *));
 
 static struct symbol *
-new_symbol PARAMS ((char *));
+  new_symbol PARAMS ((char *));
 
 static struct type *
-new_type PARAMS ((char *));
+  new_type PARAMS ((char *));
 
 static struct block *
-new_block PARAMS ((int));
+  new_block PARAMS ((int));
 
 static struct symtab *
-new_symtab PARAMS ((char *, int, int, struct objfile *));
+  new_symtab PARAMS ((char *, int, int, struct objfile *));
 
 static struct linetable *
-new_linetable PARAMS ((int));
+  new_linetable PARAMS ((int));
 
 static struct blockvector *
-new_bvect PARAMS ((int));
+  new_bvect PARAMS ((int));
 
 static int
 parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct section_offsets *));
 
 static struct type *
-parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *));
+  parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *));
 
 static struct symbol *
-mylookup_symbol PARAMS ((char *, struct block *, namespace_enum,
-                        enum address_class));
+  mylookup_symbol PARAMS ((char *, struct block *, namespace_enum,
+                          enum address_class));
 
 static struct block *
-shrink_block PARAMS ((struct block *, struct symtab *));
+  shrink_block PARAMS ((struct block *, struct symtab *));
 
 static PTR
-xzalloc PARAMS ((unsigned int));
+  xzalloc PARAMS ((unsigned int));
 
 static void
 sort_blocks PARAMS ((struct symtab *));
@@ -404,7 +407,7 @@ static int
 compare_blocks PARAMS ((const void *, const void *));
 
 static struct partial_symtab *
-new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
+  new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
 
 static void
 psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
@@ -419,13 +422,13 @@ static int
 add_line PARAMS ((struct linetable *, int, CORE_ADDR, int));
 
 static struct linetable *
-shrink_linetable PARAMS ((struct linetable *));
+  shrink_linetable PARAMS ((struct linetable *));
 
 static void
 handle_psymbol_enumerators PARAMS ((struct objfile *, FDR *, int, CORE_ADDR));
 
 static char *
-mdebug_next_symbol_text PARAMS ((struct objfile *));
+  mdebug_next_symbol_text PARAMS ((struct objfile *));
 \f
 /* Address bounds for the signal trampoline in inferior, if any */
 
@@ -492,10 +495,10 @@ get_rfd (cf, rf)
   if (f->rfdBase == 0)
     return fdrs + rf;
   (*debug_swap->swap_rfd_in) (cur_bfd,
-                            ((char *) debug_info->external_rfd
-                             + ((f->rfdBase + rf)
-                                * debug_swap->external_rfd_size)),
-                            &rfd);
+                             ((char *) debug_info->external_rfd
+                              + ((f->rfdBase + rf)
+                                 * debug_swap->external_rfd_size)),
+                             &rfd);
   return fdrs + rfd;
 }
 
@@ -554,7 +557,7 @@ mdebug_build_psymtabs (objfile, swap, info, section_offsets)
     {
       if (max_gdbinfo == 0)
        printf_unfiltered ("\n%s not compiled with -g, debugging support is limited.\n",
-                objfile->name);
+                          objfile->name);
       printf_unfiltered ("You should compile with -g2 or -g3 for best debugging support.\n");
       gdb_flush (gdb_stdout);
     }
@@ -579,25 +582,25 @@ struct pst_map
    after use. */
 
 static struct parse_stack
-{
-  struct parse_stack *next, *prev;
-  struct symtab *cur_st;       /* Current symtab. */
-  struct block *cur_block;     /* Block in it. */
-
-  /* What are we parsing.  stFile, or stBlock are for files and
-     blocks.  stProc or stStaticProc means we have seen the start of a
-     procedure, but not the start of the block within in.  When we see
-     the start of that block, we change it to stNil, without pushing a
-     new block, i.e. stNil means both a procedure and a block.  */
-
-  int blocktype;
-
-  int maxsyms;                 /* Max symbols in this block. */
-  struct type *cur_type;       /* Type we parse fields for. */
-  int cur_field;               /* Field number in cur_type. */
-  CORE_ADDR procadr;           /* Start addres of this procedure */
-  int numargs;                 /* Its argument count */
-}
+  {
+    struct parse_stack *next, *prev;
+    struct symtab *cur_st;     /* Current symtab. */
+    struct block *cur_block;   /* Block in it. */
+
+    /* What are we parsing.  stFile, or stBlock are for files and
+       blocks.  stProc or stStaticProc means we have seen the start of a
+       procedure, but not the start of the block within in.  When we see
+       the start of that block, we change it to stNil, without pushing a
+       new block, i.e. stNil means both a procedure and a block.  */
+
+    int blocktype;
+
+    int maxsyms;               /* Max symbols in this block. */
+    struct type *cur_type;     /* Type we parse fields for. */
+    int cur_field;             /* Field number in cur_type. */
+    CORE_ADDR procadr;         /* Start addres of this procedure */
+    int numargs;               /* Its argument count */
+  }
 
  *top_stack;                   /* Top stack ptr */
 
@@ -723,8 +726,8 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
      struct section_offsets *section_offsets;
 {
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
-  void (* const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
-    debug_swap->swap_sym_in;
+  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
+  debug_swap->swap_sym_in;
   char *name;
   struct symbol *s;
   struct block *b;
@@ -747,10 +750,10 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
     case scText:
     case scRConst:
       /* Do not relocate relative values.
-        The value of a stEnd symbol is the displacement from the
-        corresponding start symbol value.
-        The value of a stBlock symbol is the displacement from the
-        procedure address.  */
+         The value of a stEnd symbol is the displacement from the
+         corresponding start symbol value.
+         The value of a stBlock symbol is the displacement from the
+         procedure address.  */
       if (sh->st != stEnd && sh->st != stBlock)
        sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
       break;
@@ -784,7 +787,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       class = LOC_STATIC;
       b = top_stack->cur_block;
       s = new_symbol (name);
-      if (SC_IS_COMMON(sh->sc))
+      if (SC_IS_COMMON (sh->sc))
        {
          /* It is a FORTRAN common block.  At least for SGI Fortran the
             address is not in the symbol; we need to fix it later in
@@ -815,7 +818,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       add_symbol (s, b);
 
       /* Type could be missing if file is compiled without debugging info.  */
-      if (SC_IS_UNDEF(sh->sc)
+      if (SC_IS_UNDEF (sh->sc)
          || sh->sc == scNil || sh->index == indexNil)
        SYMBOL_TYPE (s) = nodebug_var_symbol_type;
       else
@@ -838,21 +841,21 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
        {
        case scRegister:
          /* Pass by value in register.  */
-         SYMBOL_CLASS(s) = LOC_REGPARM;
+         SYMBOL_CLASS (s) = LOC_REGPARM;
          svalue = ECOFF_REG_TO_REGNUM (svalue);
          break;
        case scVar:
          /* Pass by reference on stack.  */
-         SYMBOL_CLASS(s) = LOC_REF_ARG;
+         SYMBOL_CLASS (s) = LOC_REF_ARG;
          break;
        case scVarRegister:
          /* Pass by reference in register.  */
-         SYMBOL_CLASS(s) = LOC_REGPARM_ADDR;
+         SYMBOL_CLASS (s) = LOC_REGPARM_ADDR;
          svalue = ECOFF_REG_TO_REGNUM (svalue);
          break;
        default:
          /* Pass by value on stack.  */
-         SYMBOL_CLASS(s) = LOC_ARG;
+         SYMBOL_CLASS (s) = LOC_ARG;
          break;
        }
       SYMBOL_VALUE (s) = svalue;
@@ -875,23 +878,23 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
       SYMBOL_CLASS (s) = LOC_BLOCK;
       /* Type of the return value */
-      if (SC_IS_UNDEF(sh->sc) || sh->sc == scNil)
+      if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
        t = mdebug_type_int;
       else
        {
          t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
-         if (STREQ(name, "malloc") && t->code == TYPE_CODE_VOID)
+         if (STREQ (name, "malloc") && t->code == TYPE_CODE_VOID)
            {
              /* I don't know why, but, at least under Alpha GNU/Linux,
-                when linking against a malloc without debugging
-                symbols, its read as a function returning void---this
-                is bad because it means we cannot call functions with
-                string arguments interactively; i.e., "call
-                printf("howdy\n")" would fail with the error message
-                "program has no memory available".  To avoid this, we
-                patch up the type and make it void*
-                instead. (davidm@azstarnet.com)
-                */
+                when linking against a malloc without debugging
+                symbols, its read as a function returning void---this
+                is bad because it means we cannot call functions with
+                string arguments interactively; i.e., "call
+                printf("howdy\n")" would fail with the error message
+                "program has no memory available".  To avoid this, we
+                patch up the type and make it void*
+                instead. (davidm@azstarnet.com)
+              */
              t = make_pointer_type (t, NULL);
            }
        }
@@ -924,7 +927,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       add_block (b, top_stack->cur_st);
 
       /* Not if we only have partial info */
-      if (SC_IS_UNDEF(sh->sc) || sh->sc == scNil)
+      if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
        break;
 
       push_parse_stack ();
@@ -937,7 +940,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       break;
 
       /* Beginning of code for structure, union, and enum definitions.
-              They all share a common set of local variables, defined here.  */
+         They all share a common set of local variables, defined here.  */
       {
        enum type_code type_code;
        char *ext_tsym;
@@ -958,7 +961,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
        goto structured_common;
 
     case stBlock:              /* Either a lexical block, or some type */
-       if (sh->sc != scInfo && !SC_IS_COMMON(sh->sc))
+       if (sh->sc != scInfo && !SC_IS_COMMON (sh->sc))
          goto case_stBlock_code;       /* Lexical block */
 
        type_code = TYPE_CODE_UNDEF;    /* We have a type.  */
@@ -1024,14 +1027,14 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
 #if 0
                  /* This is a no-op; is it trying to tell us something
                     we should be checking?  */
-                 if (tsym.sc == scVariant);    /*UNIMPLEMENTED*/
+                 if (tsym.sc == scVariant);    /*UNIMPLEMENTED */
 #endif
                  if (tsym.index != 0)
                    {
                      /* This is something like a struct within a
-                        struct.  Skip over the fields of the inner
-                        struct.  The -1 is because the for loop will
-                        increment ext_tsym.  */
+                        struct.  Skip over the fields of the inner
+                        struct.  The -1 is because the for loop will
+                        increment ext_tsym.  */
                      ext_tsym = ((char *) debug_info->external_sym
                                  + ((cur_fdr->isymBase + tsym.index - 1)
                                     * external_sym_size));
@@ -1213,12 +1216,12 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
     case_stBlock_code:
       found_ecoff_debugging_info = 1;
       /* beginnning of (code) block. Value of symbol
-        is the displacement from procedure start */
+         is the displacement from procedure start */
       push_parse_stack ();
 
       /* Do not start a new block if this is the outermost block of a
-        procedure.  This allows the LOC_BLOCK symbol to point to the
-        block with the local variables, so funcname::var works.  */
+         procedure.  This allows the LOC_BLOCK symbol to point to the
+         block with the local variables, so funcname::var works.  */
       if (top_stack->blocktype == stProc
          || top_stack->blocktype == stStaticProc)
        {
@@ -1235,7 +1238,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       break;
 
     case stEnd:                /* end (of anything) */
-      if (sh->sc == scInfo || SC_IS_COMMON(sh->sc))
+      if (sh->sc == scInfo || SC_IS_COMMON (sh->sc))
        {
          /* Finished with type */
          top_stack->cur_type = 0;
@@ -1287,7 +1290,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
          if (TYPE_NFIELDS (ftype) <= 0)
            {
              /* No parameter type information is recorded with the function's
-                type.  Set that from the type of the parameter symbols. */
+                type.  Set that from the type of the parameter symbols. */
              int nparams = top_stack->numargs;
              int iparams;
              struct symbol *sym;
@@ -1297,7 +1300,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
                  TYPE_NFIELDS (ftype) = nparams;
                  TYPE_FIELDS (ftype) = (struct field *)
                    TYPE_ALLOC (ftype, nparams * sizeof (struct field));
-                                                   
+
                  for (i = iparams = 0; iparams < nparams; i++)
                    {
                      sym = BLOCK_SYM (b, i);
@@ -1354,14 +1357,14 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
 
     case stIndirect:           /* forward declaration on Irix5 */
       /* Forward declarations from Irix5 cc are handled by cross_ref,
-        skip them.  */
+         skip them.  */
       break;
 
     case stTypedef:            /* type definition */
       found_ecoff_debugging_info = 1;
 
       /* Typedefs for forward declarations and opaque structs from alpha cc
-        are handled by cross_ref, skip them.  */
+         are handled by cross_ref, skip them.  */
       if (sh->iss == 0)
        break;
 
@@ -1369,30 +1372,30 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       pend = is_pending_symbol (cur_fdr, ext_sh);
       if (pend == (struct mdebug_pending *) NULL)
        {
-         t = parse_type (cur_fd, ax, sh->index, (int *)NULL, bigend, name);
+         t = parse_type (cur_fd, ax, sh->index, (int *) NULL, bigend, name);
          add_pending (cur_fdr, ext_sh, t);
        }
       else
        t = pend->t;
 
       /* mips cc puts out a typedef with the name of the struct for forward
-        declarations. These should not go into the symbol table and
-        TYPE_NAME should not be set for them.
-        They can't be distinguished from an intentional typedef to
-        the same name however:
-        x.h:
-               struct x { int ix; int jx; };
-               struct xx;
-        x.c:
-               typedef struct x x;
-               struct xx {int ixx; int jxx; };
-        generates a cross referencing stTypedef for x and xx.
-        The user visible effect of this is that the type of a pointer
-        to struct foo sometimes is given as `foo *' instead of `struct foo *'.
-        The problem is fixed with alpha cc and Irix5 cc.  */
+         declarations. These should not go into the symbol table and
+         TYPE_NAME should not be set for them.
+         They can't be distinguished from an intentional typedef to
+         the same name however:
+         x.h:
+         struct x { int ix; int jx; };
+         struct xx;
+         x.c:
+         typedef struct x x;
+         struct xx {int ixx; int jxx; };
+         generates a cross referencing stTypedef for x and xx.
+         The user visible effect of this is that the type of a pointer
+         to struct foo sometimes is given as `foo *' instead of `struct foo *'.
+         The problem is fixed with alpha cc and Irix5 cc.  */
 
       /* However if the typedef cross references to an opaque aggregate, it
-        is safe to omit it from the symbol table.  */
+         is safe to omit it from the symbol table.  */
 
       if (has_opaque_xref (cur_fdr, sh))
        break;
@@ -1406,30 +1409,30 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       /* Incomplete definitions of structs should not get a name.  */
       if (TYPE_NAME (SYMBOL_TYPE (s)) == NULL
          && (TYPE_NFIELDS (SYMBOL_TYPE (s)) != 0
-              || (TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_STRUCT
+             || (TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_STRUCT
                  && TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_UNION)))
        {
          if (TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_PTR
              || TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_FUNC)
            {
              /* If we are giving a name to a type such as "pointer to
-                foo" or "function returning foo", we better not set
-                the TYPE_NAME.  If the program contains "typedef char
-                *caddr_t;", we don't want all variables of type char
-                * to print as caddr_t.  This is not just a
-                consequence of GDB's type management; CC and GCC (at
-                least through version 2.4) both output variables of
-                either type char * or caddr_t with the type
-                refering to the stTypedef symbol for caddr_t.  If a future
-                compiler cleans this up it GDB is not ready for it
-                yet, but if it becomes ready we somehow need to
-                disable this check (without breaking the PCC/GCC2.4
-                case).
-
-                Sigh.
-
-                Fortunately, this check seems not to be necessary
-                for anything except pointers or functions.  */
+                foo" or "function returning foo", we better not set
+                the TYPE_NAME.  If the program contains "typedef char
+                *caddr_t;", we don't want all variables of type char
+                * to print as caddr_t.  This is not just a
+                consequence of GDB's type management; CC and GCC (at
+                least through version 2.4) both output variables of
+                either type char * or caddr_t with the type
+                refering to the stTypedef symbol for caddr_t.  If a future
+                compiler cleans this up it GDB is not ready for it
+                yet, but if it becomes ready we somehow need to
+                disable this check (without breaking the PCC/GCC2.4
+                case).
+
+                Sigh.
+
+                Fortunately, this check seems not to be necessary
+                for anything except pointers or functions.  */
            }
          else
            TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_NAME (s);
@@ -1473,42 +1476,42 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
   /* Null entries in this map are treated specially */
   static struct type **map_bt[] =
   {
-    &mdebug_type_void,                 /* btNil */
-    &mdebug_type_adr_32,               /* btAdr */
-    &mdebug_type_char,                 /* btChar */
-    &mdebug_type_unsigned_char,                /* btUChar */
-    &mdebug_type_short,                        /* btShort */
+    &mdebug_type_void,         /* btNil */
+    &mdebug_type_adr_32,       /* btAdr */
+    &mdebug_type_char,         /* btChar */
+    &mdebug_type_unsigned_char,        /* btUChar */
+    &mdebug_type_short,                /* btShort */
     &mdebug_type_unsigned_short,       /* btUShort */
-    &mdebug_type_int_32,               /* btInt */
+    &mdebug_type_int_32,       /* btInt */
     &mdebug_type_unsigned_int_32,      /* btUInt */
-    &mdebug_type_long_32,              /* btLong */
+    &mdebug_type_long_32,      /* btLong */
     &mdebug_type_unsigned_long_32,     /* btULong */
-    &mdebug_type_float,                        /* btFloat */
-    &mdebug_type_double,               /* btDouble */
-    0,                                 /* btStruct */
-    0,                                 /* btUnion */
-    0,                                 /* btEnum */
-    0,                                 /* btTypedef */
-    0,                                 /* btRange */
-    0,                                 /* btSet */
-    &mdebug_type_complex,              /* btComplex */
+    &mdebug_type_float,                /* btFloat */
+    &mdebug_type_double,       /* btDouble */
+    0,                         /* btStruct */
+    0,                         /* btUnion */
+    0,                         /* btEnum */
+    0,                         /* btTypedef */
+    0,                         /* btRange */
+    0,                         /* btSet */
+    &mdebug_type_complex,      /* btComplex */
     &mdebug_type_double_complex,       /* btDComplex */
-    0,                                 /* btIndirect */
-    &mdebug_type_fixed_dec,            /* btFixedDec */
-    &mdebug_type_float_dec,            /* btFloatDec */
-    &mdebug_type_string,               /* btString */
-    0,                                 /* btBit */
-    0,                                 /* btPicture */
-    &mdebug_type_void,                 /* btVoid */
-    0,                                 /* DEC C++:  Pointer to member */
-    0,                                 /* DEC C++:  Virtual function table */
-    0,                                 /* DEC C++:  Class (Record) */
-    &mdebug_type_long_64,              /* btLong64  */
+    0,                         /* btIndirect */
+    &mdebug_type_fixed_dec,    /* btFixedDec */
+    &mdebug_type_float_dec,    /* btFloatDec */
+    &mdebug_type_string,       /* btString */
+    0,                         /* btBit */
+    0,                         /* btPicture */
+    &mdebug_type_void,         /* btVoid */
+    0,                         /* DEC C++:  Pointer to member */
+    0,                         /* DEC C++:  Virtual function table */
+    0,                         /* DEC C++:  Class (Record) */
+    &mdebug_type_long_64,      /* btLong64  */
     &mdebug_type_unsigned_long_64,     /* btULong64 */
-    &mdebug_type_long_long_64,         /* btLongLong64  */
-    &mdebug_type_unsigned_long_long_64,        /* btULongLong64 */
-    &mdebug_type_adr_64,               /* btAdr64 */
-    &mdebug_type_int_64,               /* btInt64  */
+    &mdebug_type_long_long_64, /* btLongLong64  */
+    &mdebug_type_unsigned_long_long_64,                /* btULongLong64 */
+    &mdebug_type_adr_64,       /* btAdr64 */
+    &mdebug_type_int_64,       /* btInt64  */
     &mdebug_type_unsigned_int_64,      /* btUInt64 */
   };
 
@@ -1584,8 +1587,8 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
       int width = AUX_GET_WIDTH (bigend, ax);
 
       /* Inhibit core dumps with some cfront generated objects that
-        corrupt the TIR.  */
-      if (bs == (int *)NULL)
+         corrupt the TIR.  */
+      if (bs == (int *) NULL)
        {
          /* Alpha cc -migrate encodes char and unsigned char types
             as short and unsigned short types with a field width of 8.
@@ -1600,7 +1603,7 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
            complain (&bad_fbitfield_complaint, sym_name);
        }
       else
-        *bs = width;
+       *bs = width;
       ax++;
     }
 
@@ -1631,7 +1634,7 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
       xref_fh = get_rfd (fd, rf);
       xref_fd = xref_fh - debug_info->fdr;
       tp = parse_type (xref_fd, debug_info->external_aux + xref_fh->iauxBase,
-                      rn->index, (int *) NULL, xref_fh->fBigendian, sym_name);
+                   rn->index, (int *) NULL, xref_fh->fBigendian, sym_name);
     }
 
   /* All these types really point to some (common) MIPS type
@@ -1641,8 +1644,8 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
       t->bt == btUnion ||
       t->bt == btEnum ||
 
-      /* btSet (I think) implies that the name is a tag name, not a typedef
-        name.  This apparently is a MIPS extension for C sets.  */
+  /* btSet (I think) implies that the name is a tag name, not a typedef
+     name.  This apparently is a MIPS extension for C sets.  */
       t->bt == btSet)
     {
       char *name;
@@ -1653,14 +1656,14 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
        tp = init_type (type_code, 0, 0, (char *) NULL, current_objfile);
 
       /* DEC c89 produces cross references to qualified aggregate types,
-        dereference them.  */
+         dereference them.  */
       while (TYPE_CODE (tp) == TYPE_CODE_PTR
             || TYPE_CODE (tp) == TYPE_CODE_ARRAY)
        tp = tp->target_type;
 
       /* Make sure that TYPE_CODE(tp) has an expected type code.
-        Any type may be returned from cross_ref if file indirect entries
-        are corrupted.  */
+         Any type may be returned from cross_ref if file indirect entries
+         are corrupted.  */
       if (TYPE_CODE (tp) != TYPE_CODE_STRUCT
          && TYPE_CODE (tp) != TYPE_CODE_UNION
          && TYPE_CODE (tp) != TYPE_CODE_ENUM)
@@ -1688,13 +1691,13 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
            }
 
          /* Do not set the tag name if it is a compiler generated tag name
-             (.Fxx or .xxfake or empty) for unnamed struct/union/enums.  */
+            (.Fxx or .xxfake or empty) for unnamed struct/union/enums.  */
          if (name[0] == '.' || name[0] == '\0')
            TYPE_TAG_NAME (tp) = NULL;
          else if (TYPE_TAG_NAME (tp) == NULL
                   || !STREQ (TYPE_TAG_NAME (tp), name))
            TYPE_TAG_NAME (tp) = obsavestring (name, strlen (name),
-                                              &current_objfile->type_obstack);
+                                           &current_objfile->type_obstack);
        }
     }
 
@@ -1712,8 +1715,8 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
        tp = init_type (type_code, 0, 0, (char *) NULL, current_objfile);
 
       /* Make sure that TYPE_CODE(tp) has an expected type code.
-        Any type may be returned from cross_ref if file indirect entries
-        are corrupted.  */
+         Any type may be returned from cross_ref if file indirect entries
+         are corrupted.  */
       if (TYPE_CODE (tp) != TYPE_CODE_RANGE)
        {
          complain (&unexpected_type_code_complaint, sym_name);
@@ -1752,11 +1755,11 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
       TYPE_FIELDS (tp) = ((struct field *)
                          TYPE_ALLOC (tp, 2 * sizeof (struct field)));
       TYPE_FIELD_NAME (tp, 0) = obsavestring ("Low", strlen ("Low"),
-                                             &current_objfile->type_obstack);
+                                           &current_objfile->type_obstack);
       TYPE_FIELD_BITPOS (tp, 0) = AUX_GET_DNLOW (bigend, ax);
       ax++;
       TYPE_FIELD_NAME (tp, 1) = obsavestring ("High", strlen ("High"),
-                                             &current_objfile->type_obstack);
+                                           &current_objfile->type_obstack);
       TYPE_FIELD_BITPOS (tp, 1) = AUX_GET_DNHIGH (bigend, ax);
       ax++;
     }
@@ -1791,7 +1794,7 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
   /* Complain for illegal continuations due to corrupt aux entries.  */
   if (t->continued)
     complain (&bad_continued_complaint, sym_name);
+
   return tp;
 }
 
@@ -1854,7 +1857,7 @@ upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
                         id, (int *) NULL, bigend, sym_name);
 
       /* The bounds type should be an integer type, but might be anything
-        else due to corrupt aux entries.  */
+         else due to corrupt aux entries.  */
       if (TYPE_CODE (indx) != TYPE_CODE_INT)
        {
          complain (&array_index_type_complaint, sym_name);
@@ -1875,21 +1878,21 @@ upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
       t = create_array_type ((struct type *) NULL, *tpp, range);
 
       /* We used to fill in the supplied array element bitsize
-        here if the TYPE_LENGTH of the target type was zero.
-        This happens for a `pointer to an array of anonymous structs',
-        but in this case the array element bitsize is also zero,
-        so nothing is gained.
-        And we used to check the TYPE_LENGTH of the target type against
-        the supplied array element bitsize.
-        gcc causes a mismatch for `pointer to array of object',
-        since the sdb directives it uses do not have a way of
-        specifying the bitsize, but it does no harm (the
-        TYPE_LENGTH should be correct) and we should be able to
-        ignore the erroneous bitsize from the auxiliary entry safely.
-        dbx seems to ignore it too.  */
+         here if the TYPE_LENGTH of the target type was zero.
+         This happens for a `pointer to an array of anonymous structs',
+         but in this case the array element bitsize is also zero,
+         so nothing is gained.
+         And we used to check the TYPE_LENGTH of the target type against
+         the supplied array element bitsize.
+         gcc causes a mismatch for `pointer to array of object',
+         since the sdb directives it uses do not have a way of
+         specifying the bitsize, but it does no harm (the
+         TYPE_LENGTH should be correct) and we should be able to
+         ignore the erroneous bitsize from the auxiliary entry safely.
+         dbx seems to ignore it too.  */
 
       /* TYPE_FLAG_TARGET_STUB now takes care of the zero TYPE_LENGTH
-        problem.  */
+         problem.  */
       if (TYPE_LENGTH (*tpp) == 0)
        {
          TYPE_FLAGS (t) |= TYPE_FLAG_TARGET_STUB;
@@ -1952,7 +1955,7 @@ parse_procedure (pr, search_symtab, pst)
        {
          /* external */
          EXTR she;
-         
+
          (*debug_swap->swap_ext_in) (cur_bfd,
                                      ((char *) debug_info->external_ext
                                       + (pr->isym
@@ -1978,12 +1981,12 @@ parse_procedure (pr, search_symtab, pst)
     {
 #if 0
       /* This loses both in the case mentioned (want a static, find a global),
-        but also if we are looking up a non-mangled name which happens to
-        match the name of a mangled function.  */
+         but also if we are looking up a non-mangled name which happens to
+         match the name of a mangled function.  */
       /* We have to save the cur_fdr across the call to lookup_symbol.
-        If the pdr is for a static function and if a global function with
-        the same name exists, lookup_symbol will eventually read in the symtab
-        for the global function and clobber cur_fdr.  */
+         If the pdr is for a static function and if a global function with
+         the same name exists, lookup_symbol will eventually read in the symtab
+         for the global function and clobber cur_fdr.  */
       FDR *save_cur_fdr = cur_fdr;
       s = lookup_symbol (sh_name, NULL, VAR_NAMESPACE, 0, NULL);
       cur_fdr = save_cur_fdr;
@@ -2022,7 +2025,7 @@ parse_procedure (pr, search_symtab, pst)
       BLOCK_FUNCTION (b) = s;
       BLOCK_START (b) = pr->adr;
       /* BOUND used to be the end of procedure's text, but the
-        argument is no longer passed in.  */
+         argument is no longer passed in.  */
       BLOCK_END (b) = bound;
       BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
       add_block (b, top_stack->cur_st);
@@ -2038,19 +2041,19 @@ parse_procedure (pr, search_symtab, pst)
       e->pdr.isym = (long) s;
 
       /* GDB expects the absolute function start address for the
-        procedure descriptor in e->pdr.adr.
-        As the address in the procedure descriptor is usually relative,
-        we would have to relocate e->pdr.adr with cur_fdr->adr and
-        ANOFFSET (pst->section_offsets, SECT_OFF_TEXT).
-        Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
-        in shared libraries on some systems, and on other systems
-        e->pdr.adr is sometimes offset by a bogus value.
-        To work around these problems, we replace e->pdr.adr with
-        the start address of the function.  */
+         procedure descriptor in e->pdr.adr.
+         As the address in the procedure descriptor is usually relative,
+         we would have to relocate e->pdr.adr with cur_fdr->adr and
+         ANOFFSET (pst->section_offsets, SECT_OFF_TEXT).
+         Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
+         in shared libraries on some systems, and on other systems
+         e->pdr.adr is sometimes offset by a bogus value.
+         To work around these problems, we replace e->pdr.adr with
+         the start address of the function.  */
       e->pdr.adr = BLOCK_START (b);
 
       /* Correct incorrect setjmp procedure descriptor from the library
-        to make backtrace through setjmp work.  */
+         to make backtrace through setjmp work.  */
       if (e->pdr.pcreg == 0 && STREQ (sh_name, "setjmp"))
        {
          complain (&bad_setjmp_pdr_complaint, 0);
@@ -2074,7 +2077,7 @@ parse_procedure (pr, search_symtab, pst)
      To work around these problems, the return value type of a TYPE_CODE_VOID
      function is adjusted accordingly if no debugging info was found in the
      compilation unit.  */
+
   if (processing_gcc_compilation == 0
       && found_ecoff_debugging_info == 0
       && TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (s))) == TYPE_CODE_VOID)
@@ -2091,7 +2094,7 @@ ecoff_relocate_efi (sym, delta)
   struct mips_extra_func_info *e;
 
   e = (struct mips_extra_func_info *) SYMBOL_VALUE (sym);
-  
+
   e->pdr.adr += delta;
 }
 
@@ -2124,7 +2127,7 @@ parse_external (es, bigend, section_offsets)
     }
 
   /* Reading .o files */
-  if (SC_IS_UNDEF(es->asym.sc) || es->asym.sc == scNil)
+  if (SC_IS_UNDEF (es->asym.sc) || es->asym.sc == scNil)
     {
       char *what;
       switch (es->asym.st)
@@ -2164,24 +2167,24 @@ parse_external (es, bigend, section_offsets)
     case stProc:
     case stStaticProc:
       /* There is no need to parse the external procedure symbols.
-        If they are from objects compiled without -g, their index will
-        be indexNil, and the symbol definition from the minimal symbol
-        is preferrable (yielding a function returning int instead of int).
-        If the index points to a local procedure symbol, the local
-        symbol already provides the correct type.
-        Note that the index of the external procedure symbol points
-        to the local procedure symbol in the local symbol table, and
-        _not_ to the auxiliary symbol info.  */
+         If they are from objects compiled without -g, their index will
+         be indexNil, and the symbol definition from the minimal symbol
+         is preferrable (yielding a function returning int instead of int).
+         If the index points to a local procedure symbol, the local
+         symbol already provides the correct type.
+         Note that the index of the external procedure symbol points
+         to the local procedure symbol in the local symbol table, and
+         _not_ to the auxiliary symbol info.  */
       break;
     case stGlobal:
     case stLabel:
       /* Global common symbols are resolved by the runtime loader,
-        ignore them.  */
-      if (SC_IS_COMMON(es->asym.sc))
+         ignore them.  */
+      if (SC_IS_COMMON (es->asym.sc))
        break;
 
       /* Note that the case of a symbol with indexNil must be handled
-        anyways by parse_symbol().  */
+         anyways by parse_symbol().  */
       parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets);
       break;
     default:
@@ -2228,18 +2231,18 @@ parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
        continue;
 
       /* Determine start and end address of compressed line bytes for
-        this procedure.  */
+         this procedure.  */
       base = debug_info->line + fh->cbLineOffset;
       if (j != (fh->cpd - 1))
-       halt = base + pr[1].cbLineOffset;
+       halt = base + pr[1].cbLineOffset;
       else
-       halt = base + fh->cbLine;
+       halt = base + fh->cbLine;
       base += pr->cbLineOffset;
 
       adr = pst->textlow + pr->adr - lowest_pdr_addr;
 
       l = adr >> 2;            /* in words */
-      for (lineno = pr->lnLow; base < halt; )
+      for (lineno = pr->lnLow; base < halt;)
        {
          count = *base & 0x0f;
          delta = *base++ >> 4;
@@ -2278,12 +2281,12 @@ parse_partial_symbols (objfile, section_offsets)
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
   const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
   const bfd_size_type external_ext_size = debug_swap->external_ext_size;
-  void (* const swap_ext_in) PARAMS ((bfd *, PTR, EXTR *))
-    = debug_swap->swap_ext_in;
-  void (* const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
-    = debug_swap->swap_sym_in;
-  void (* const swap_rfd_in) PARAMS ((bfd *, PTR, RFDT *))
-    = debug_swap->swap_rfd_in;
+  void (*const swap_ext_in) PARAMS ((bfd *, PTR, EXTR *))
+  = debug_swap->swap_ext_in;
+  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
+  = debug_swap->swap_sym_in;
+  void (*const swap_rfd_in) PARAMS ((bfd *, PTR, RFDT *))
+  = debug_swap->swap_rfd_in;
   int f_idx, s_idx;
   HDRR *hdr = &debug_info->symbolic_header;
   /* Running pointers */
@@ -2421,124 +2424,124 @@ parse_partial_symbols (objfile, section_offsets)
 
      To fix this, either :
      1) don't create the duplicate symbol
-        (assumes ECOFF symtab is a subset of the ELF symtab;
-        assumes no side-effects result from ignoring ECOFF symbol)
+     (assumes ECOFF symtab is a subset of the ELF symtab;
+     assumes no side-effects result from ignoring ECOFF symbol)
      2) create it, only if lookup for existing symbol in ELF's minimal 
-        symbols fails
-        (inefficient; 
-        assumes no side-effects result from ignoring ECOFF symbol)
+     symbols fails
+     (inefficient; 
+     assumes no side-effects result from ignoring ECOFF symbol)
      3) create it, but lookup ELF's minimal symbol and use it's section
-        during relocation, then modify "uniqify" phase to merge and 
-        eliminate the duplicate symbol
-        (highly inefficient)
+     during relocation, then modify "uniqify" phase to merge and 
+     eliminate the duplicate symbol
+     (highly inefficient)
 
      I've implemented #1 here...
      Skip the creation of the minimal symbols based on the ECOFF 
      symbol table. */
 
-    /* Pass 2 over external syms: fill in external symbols */
-    ext_in = ext_block;
-    ext_in_end = ext_in + hdr->iextMax;
-    for (; ext_in < ext_in_end; ext_in++)
-      {
-       enum minimal_symbol_type ms_type = mst_text;
-       CORE_ADDR svalue = ext_in->asym.value;
+  /* Pass 2 over external syms: fill in external symbols */
+  ext_in = ext_block;
+  ext_in_end = ext_in + hdr->iextMax;
+  for (; ext_in < ext_in_end; ext_in++)
+    {
+      enum minimal_symbol_type ms_type = mst_text;
+      CORE_ADDR svalue = ext_in->asym.value;
 
-       /* The Irix 5 native tools seem to sometimes generate bogus
-          external symbols.  */
-       if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
-         {
-           complain (&bad_ext_ifd_complaint, ext_in->ifd, hdr->ifdMax);
-           continue;
-         }
-       if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
-         {
-           complain (&bad_ext_iss_complaint, ext_in->asym.iss,
-                       hdr->issExtMax);
-           continue;
-         }
+      /* The Irix 5 native tools seem to sometimes generate bogus
+         external symbols.  */
+      if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
+       {
+         complain (&bad_ext_ifd_complaint, ext_in->ifd, hdr->ifdMax);
+         continue;
+       }
+      if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
+       {
+         complain (&bad_ext_iss_complaint, ext_in->asym.iss,
+                   hdr->issExtMax);
+         continue;
+       }
 
-       extern_tab[fdr_to_pst[ext_in->ifd].globals_offset
-                  + fdr_to_pst[ext_in->ifd].n_globals++] = *ext_in;
+      extern_tab[fdr_to_pst[ext_in->ifd].globals_offset
+                + fdr_to_pst[ext_in->ifd].n_globals++] = *ext_in;
 
 
-       if (SC_IS_UNDEF(ext_in->asym.sc) || ext_in->asym.sc == scNil)
-         continue;
+      if (SC_IS_UNDEF (ext_in->asym.sc) || ext_in->asym.sc == scNil)
+       continue;
 
-    
-       /* Pass 3 over files, over local syms: fill in static symbols */
-       name = debug_info->ssext + ext_in->asym.iss;
 
-       /* Process ECOFF Symbol Types and Storage Classes */
-       switch (ext_in->asym.st)
-         {
-         case stProc:
-           /* Beginnning of Procedure */
-           svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-           break;
-         case stStaticProc:
-           /* Load time only static procs */
-           ms_type = mst_file_text;
-           svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-           break;
-         case stGlobal:
-           /* External symbol */
-           if (SC_IS_COMMON (ext_in->asym.sc))
-             {
-               /* The value of a common symbol is its size, not its address.
-                  Ignore it.  */
-               continue;
-             }
-           else if (SC_IS_DATA (ext_in->asym.sc))
-             {
-               ms_type = mst_data;
-               svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
-             }
-           else if (SC_IS_BSS (ext_in->asym.sc))
-             {
-               ms_type = mst_bss;
-               svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
-             }
-           else
-             ms_type = mst_abs;
-           break;
-         case stLabel:
-           /* Label */
-           if (SC_IS_TEXT (ext_in->asym.sc))
-             {
-               ms_type = mst_file_text;
-               svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-             }
-           else if (SC_IS_DATA (ext_in->asym.sc))
-             {
-               ms_type = mst_file_data;
-               svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
-             }
-           else if (SC_IS_BSS (ext_in->asym.sc))
-             {
-               ms_type = mst_file_bss;
-               svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
-             }
-           else
-             ms_type = mst_abs;
-           break;
-         case stLocal:
-         case stNil:
-           /* The alpha has the section start addresses in stLocal symbols
-                whose name starts with a `.'. Skip those but complain for all
-                other stLocal symbols.
-                Irix6 puts the section start addresses in stNil symbols, skip
-                those too.*/
-           if (name[0] == '.')
+      /* Pass 3 over files, over local syms: fill in static symbols */
+      name = debug_info->ssext + ext_in->asym.iss;
+
+      /* Process ECOFF Symbol Types and Storage Classes */
+      switch (ext_in->asym.st)
+       {
+       case stProc:
+         /* Beginnning of Procedure */
+         svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+         break;
+       case stStaticProc:
+         /* Load time only static procs */
+         ms_type = mst_file_text;
+         svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+         break;
+       case stGlobal:
+         /* External symbol */
+         if (SC_IS_COMMON (ext_in->asym.sc))
+           {
+             /* The value of a common symbol is its size, not its address.
+                Ignore it.  */
              continue;
-           /* Fall through.  */
-         default:
-           ms_type = mst_unknown;
-           complain (&unknown_ext_complaint, name);
-         }
-        if (!ECOFF_IN_ELF(cur_bfd))
-         prim_record_minimal_symbol (name, svalue, ms_type, objfile);
-      }
+           }
+         else if (SC_IS_DATA (ext_in->asym.sc))
+           {
+             ms_type = mst_data;
+             svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
+           }
+         else if (SC_IS_BSS (ext_in->asym.sc))
+           {
+             ms_type = mst_bss;
+             svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
+           }
+         else
+           ms_type = mst_abs;
+         break;
+       case stLabel:
+         /* Label */
+         if (SC_IS_TEXT (ext_in->asym.sc))
+           {
+             ms_type = mst_file_text;
+             svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+           }
+         else if (SC_IS_DATA (ext_in->asym.sc))
+           {
+             ms_type = mst_file_data;
+             svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
+           }
+         else if (SC_IS_BSS (ext_in->asym.sc))
+           {
+             ms_type = mst_file_bss;
+             svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
+           }
+         else
+           ms_type = mst_abs;
+         break;
+       case stLocal:
+       case stNil:
+         /* The alpha has the section start addresses in stLocal symbols
+            whose name starts with a `.'. Skip those but complain for all
+            other stLocal symbols.
+            Irix6 puts the section start addresses in stNil symbols, skip
+            those too. */
+         if (name[0] == '.')
+           continue;
+         /* Fall through.  */
+       default:
+         ms_type = mst_unknown;
+         complain (&unknown_ext_complaint, name);
+       }
+      if (!ECOFF_IN_ELF (cur_bfd))
+       prim_record_minimal_symbol (name, svalue, ms_type, objfile);
+    }
 
   /* Pass 3 over files, over local syms: fill in static symbols */
   for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
@@ -2556,7 +2559,7 @@ parse_partial_symbols (objfile, section_offsets)
        }
 
       /* Determine the start address for this object file from the
-        file header and relocate it, except for Irix 5.2 zero fh->adr.  */
+         file header and relocate it, except for Irix 5.2 zero fh->adr.  */
       if (fh->cpd)
        {
          textlow = fh->adr;
@@ -2587,15 +2590,15 @@ parse_partial_symbols (objfile, section_offsets)
 
       /* Set up language for the pst.
          The language from the FDR is used if it is unambigious (e.g. cfront
-        with native cc and g++ will set the language to C).
-        Otherwise we have to deduce the language from the filename.
-        Native ecoff has every header file in a separate FDR, so
-        deduce_language_from_filename will return language_unknown for
-        a header file, which is not what we want.
-        But the FDRs for the header files are after the FDR for the source
-        file, so we can assign the language of the source file to the
-        following header files. Then we save the language in the private
-        pst data so that we can reuse it when building symtabs.  */
+         with native cc and g++ will set the language to C).
+         Otherwise we have to deduce the language from the filename.
+         Native ecoff has every header file in a separate FDR, so
+         deduce_language_from_filename will return language_unknown for
+         a header file, which is not what we want.
+         But the FDRs for the header files are after the FDR for the source
+         file, so we can assign the language of the source file to the
+         following header files. Then we save the language in the private
+         pst data so that we can reuse it when building symtabs.  */
       prev_language = psymtab_language;
 
       switch (fh->lang)
@@ -2614,11 +2617,11 @@ parse_partial_symbols (objfile, section_offsets)
       pst->texthigh = pst->textlow;
 
       /* For stabs-in-ecoff files, the second symbol must be @stab.
-        This symbol is emitted by mips-tfile to signal that the
-        current object file uses encapsulated stabs instead of mips
-        ecoff for local symbols.  (It is the second symbol because
-        the first symbol is the stFile used to signal the start of a
-        file). */
+         This symbol is emitted by mips-tfile to signal that the
+         current object file uses encapsulated stabs instead of mips
+         ecoff for local symbols.  (It is the second symbol because
+         the first symbol is the stFile used to signal the start of a
+         file). */
       processing_gcc_compilation = 0;
       if (fh->csym >= 2)
        {
@@ -2639,7 +2642,7 @@ parse_partial_symbols (objfile, section_offsets)
 
              (*swap_sym_in) (cur_bfd,
                              (((char *) debug_info->external_sym)
-                              + (fh->isymBase + cur_sdx) * external_sym_size),
+                           + (fh->isymBase + cur_sdx) * external_sym_size),
                              &sh);
              type_code = ECOFF_UNMARK_STAB (sh.index);
              if (!ECOFF_IS_STAB (&sh))
@@ -2648,7 +2651,7 @@ parse_partial_symbols (objfile, section_offsets)
                    {
                      CORE_ADDR procaddr;
                      long isym;
-       
+
                      sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
                      if (sh.st == stStaticProc)
                        {
@@ -2676,9 +2679,9 @@ parse_partial_symbols (objfile, section_offsets)
                        {
                          CORE_ADDR high = procaddr + sh.value;
 
-                         /* Kludge for Irix 5.2 zero fh->adr.  */
+                         /* Kludge for Irix 5.2 zero fh->adr.  */
                          if (!relocatable
-                             && (pst->textlow == 0 || procaddr < pst->textlow))
+                         && (pst->textlow == 0 || procaddr < pst->textlow))
                            pst->textlow = procaddr;
                          if (high > pst->texthigh)
                            pst->texthigh = high;
@@ -2700,7 +2703,7 @@ parse_partial_symbols (objfile, section_offsets)
                        case scPData:
                        case scXData:
                          namestring = debug_info->ss + fh->issBase + sh.iss;
-                         sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
+                         sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
                          prim_record_minimal_symbol_and_info (namestring,
                                                               sh.value,
                                                               mst_file_data,
@@ -2714,7 +2717,7 @@ parse_partial_symbols (objfile, section_offsets)
                          /* FIXME!  Shouldn't this use cases for bss, 
                             then have the default be abs? */
                          namestring = debug_info->ss + fh->issBase + sh.iss;
-                         sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
+                         sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
                          prim_record_minimal_symbol_and_info (namestring,
                                                               sh.value,
                                                               mst_file_bss,
@@ -2731,7 +2734,7 @@ parse_partial_symbols (objfile, section_offsets)
              {
                char *stabstring = debug_info->ss + fh->issBase + sh.iss;
                int len = strlen (stabstring);
-               while (stabstring[len-1] == '\\')
+               while (stabstring[len - 1] == '\\')
                  {
                    SYMR sh2;
                    char *stabstring1 = stabstring;
@@ -2745,7 +2748,7 @@ parse_partial_symbols (objfile, section_offsets)
                    cur_sdx++;
                    (*swap_sym_in) (cur_bfd,
                                    (((char *) debug_info->external_sym)
-                                    + (fh->isymBase + cur_sdx) 
+                                    + (fh->isymBase + cur_sdx)
                                     * external_sym_size),
                                    &sh2);
                    stabstring2 = debug_info->ss + fh->issBase + sh2.iss;
@@ -2753,7 +2756,7 @@ parse_partial_symbols (objfile, section_offsets)
 
                    /* Concatinate stabstring2 with stabstring1 */
                    if (stabstring
-                       && stabstring != debug_info->ss + fh->issBase + sh.iss)
+                    && stabstring != debug_info->ss + fh->issBase + sh.iss)
                      stabstring = xrealloc (stabstring, len + len2 + 1);
                    else
                      stabstring = xmalloc (len + len2 + 1);
@@ -2773,11 +2776,11 @@ parse_partial_symbols (objfile, section_offsets)
   if ((val) > save_pst->texthigh) save_pst->texthigh = (val);
 #include "partial-stab.h"
 
-               if (stabstring 
+               if (stabstring
                    && stabstring != debug_info->ss + fh->issBase + sh.iss)
                  free (stabstring);
              }
-           /* end - Handle continuation */
+             /* end - Handle continuation */
            }
        }
       else
@@ -2800,7 +2803,7 @@ parse_partial_symbols (objfile, section_offsets)
                }
 
              /* Non absolute static symbols go into the minimal table.  */
-             if (SC_IS_UNDEF(sh.sc) || sh.sc == scNil
+             if (SC_IS_UNDEF (sh.sc) || sh.sc == scNil
                  || (sh.index == indexNil
                      && (sh.st != stStatic || sh.sc == scAbs)))
                {
@@ -2863,18 +2866,18 @@ parse_partial_symbols (objfile, section_offsets)
                    add_psymbol_to_list (name, strlen (name),
                                         VAR_NAMESPACE, LOC_BLOCK,
                                         &objfile->global_psymbols,
-                                        0, sh.value, psymtab_language, objfile);
+                                   0, sh.value, psymtab_language, objfile);
                  else
                    add_psymbol_to_list (name, strlen (name),
                                         VAR_NAMESPACE, LOC_BLOCK,
                                         &objfile->static_psymbols,
-                                        0, sh.value, psymtab_language, objfile);
+                                   0, sh.value, psymtab_language, objfile);
 
                  /* Skip over procedure to next one. */
                  if (sh.index >= hdr->iauxMax)
                    {
                      /* Should not happen, but does when cross-compiling
-                          with the MIPS compiler.  FIXME -- pull later.  */
+                        with the MIPS compiler.  FIXME -- pull later.  */
                      complain (&index_complaint, name);
                      new_sdx = cur_sdx + 1;    /* Don't skip at all */
                    }
@@ -2912,7 +2915,7 @@ parse_partial_symbols (objfile, section_offsets)
                  continue;
 
                case stStatic:  /* Variable */
-                 if (SC_IS_DATA (sh.sc))
+                 if (SC_IS_DATA (sh.sc))
                    prim_record_minimal_symbol_and_info (name, sh.value,
                                                         mst_file_data, NULL,
                                                         SECT_OFF_DATA,
@@ -2927,11 +2930,11 @@ parse_partial_symbols (objfile, section_offsets)
                  class = LOC_STATIC;
                  break;
 
-               case stIndirect:/* Irix5 forward declaration */
+               case stIndirect:        /* Irix5 forward declaration */
                  /* Skip forward declarations from Irix5 cc */
                  goto skip;
 
-               case stTypedef:/* Typedef */
+               case stTypedef: /* Typedef */
                  /* Skip typedefs for forward declarations and opaque
                     structs from alpha and mips cc.  */
                  if (sh.iss == 0 || has_opaque_xref (fh, &sh))
@@ -2946,11 +2949,11 @@ parse_partial_symbols (objfile, section_offsets)
                case stUnion:
                case stStruct:
                case stEnum:
-               case stBlock:   /* { }, str, un, enum*/
+               case stBlock:   /* { }, str, un, enum */
                  /* Do not create a partial symbol for cc unnamed aggregates
                     and gcc empty aggregates. */
                  if ((sh.sc == scInfo
-                      || SC_IS_COMMON(sh.sc))
+                      || SC_IS_COMMON (sh.sc))
                      && sh.iss != 0
                      && sh.index != cur_sdx + 2)
                    {
@@ -3018,7 +3021,7 @@ parse_partial_symbols (objfile, section_offsets)
              psh = &ext_ptr->asym;
 
              /* Do not add undefined symbols to the partial symbol table.  */
-             if (SC_IS_UNDEF(psh->sc) || psh->sc == scNil)
+             if (SC_IS_UNDEF (psh->sc) || psh->sc == scNil)
                continue;
 
              svalue = psh->value;
@@ -3063,7 +3066,7 @@ parse_partial_symbols (objfile, section_offsets)
                case stGlobal:
                  /* Global common symbols are resolved by the runtime loader,
                     ignore them.  */
-                 if (SC_IS_COMMON(psh->sc))
+                 if (SC_IS_COMMON (psh->sc))
                    continue;
 
                  class = LOC_STATIC;
@@ -3079,11 +3082,11 @@ parse_partial_symbols (objfile, section_offsets)
        }
 
       /* Link pst to FDR. end_psymtab returns NULL if the psymtab was
-        empty and put on the free list.  */
+         empty and put on the free list.  */
       fdr_to_pst[f_idx].pst = end_psymtab (save_pst,
-                                          psymtab_include_list, includes_used,
+                                       psymtab_include_list, includes_used,
                                           -1, save_pst->texthigh,
-                                          dependency_list, dependencies_used, textlow_not_set);
+                      dependency_list, dependencies_used, textlow_not_set);
       includes_used = 0;
       dependencies_used = 0;
 
@@ -3095,32 +3098,32 @@ parse_partial_symbols (objfile, section_offsets)
        }
 
       /* The objfile has its functions reordered if this partial symbol
-        table overlaps any other partial symbol table.
-        We cannot assume a reordered objfile if a partial symbol table
-        is contained within another partial symbol table, as partial symbol
-        tables for include files with executable code are contained
-        within the partial symbol table for the including source file,
-        and we do not want to flag the objfile reordered for these cases.
-
-        This strategy works well for Irix-5.2 shared libraries, but we
-        might have to use a more elaborate (and slower) algorithm for
-        other cases.  */
+         table overlaps any other partial symbol table.
+         We cannot assume a reordered objfile if a partial symbol table
+         is contained within another partial symbol table, as partial symbol
+         tables for include files with executable code are contained
+         within the partial symbol table for the including source file,
+         and we do not want to flag the objfile reordered for these cases.
+
+         This strategy works well for Irix-5.2 shared libraries, but we
+         might have to use a more elaborate (and slower) algorithm for
+         other cases.  */
       save_pst = fdr_to_pst[f_idx].pst;
       if (save_pst != NULL
          && save_pst->textlow != 0
          && !(objfile->flags & OBJF_REORDERED))
        {
          ALL_OBJFILE_PSYMTABS (objfile, pst)
-           {
-             if (save_pst != pst
-                 && save_pst->textlow >= pst->textlow
-                 && save_pst->textlow < pst->texthigh
-                 && save_pst->texthigh > pst->texthigh)
-               {
-                 objfile->flags |= OBJF_REORDERED;
-                 break;
-               }
-           }
+         {
+           if (save_pst != pst
+               && save_pst->textlow >= pst->textlow
+               && save_pst->textlow < pst->texthigh
+               && save_pst->texthigh > pst->texthigh)
+             {
+               objfile->flags |= OBJF_REORDERED;
+               break;
+             }
+         }
        }
     }
 
@@ -3130,7 +3133,7 @@ parse_partial_symbols (objfile, section_offsets)
       fh = f_idx + debug_info->fdr;
       pst = fdr_to_pst[f_idx].pst;
 
-      if (pst == (struct partial_symtab *)NULL)
+      if (pst == (struct partial_symtab *) NULL)
        continue;
 
       /* This should catch stabs-in-ecoff. */
@@ -3138,7 +3141,7 @@ parse_partial_symbols (objfile, section_offsets)
        continue;
 
       /* Skip the first file indirect entry as it is a self dependency
-        for source files or a reverse .h -> .c dependency for header files.  */
+         for source files or a reverse .h -> .c dependency for header files.  */
       pst->number_of_dependencies = 0;
       pst->dependencies =
        ((struct partial_symtab **)
@@ -3164,7 +3167,7 @@ parse_partial_symbols (objfile, section_offsets)
            continue;
 
          /* Do not add to dependeny list if psymtab was empty.  */
-         if (fdr_to_pst[rh].pst == (struct partial_symtab *)NULL)
+         if (fdr_to_pst[rh].pst == (struct partial_symtab *) NULL)
            continue;
          pst->dependencies[pst->number_of_dependencies++] = fdr_to_pst[rh].pst;
        }
@@ -3191,10 +3194,10 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
      CORE_ADDR svalue;
 {
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
-  void (* const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
-    = debug_swap->swap_sym_in;
+  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
+  = debug_swap->swap_sym_in;
   char *ext_sym = ((char *) debug_info->external_sym
-                 + ((fh->isymBase + cur_sdx + 1) * external_sym_size));
+                  + ((fh->isymBase + cur_sdx + 1) * external_sym_size));
   SYMR sh;
   TIR tir;
 
@@ -3205,12 +3208,12 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
 
     case stBlock:
       /* It is an enumerated type if the next symbol entry is a stMember
-        and its auxiliary index is indexNil or its auxiliary entry
-        is a plain btNil or btVoid.
-        Alpha cc -migrate enums are recognized by a zero index and
-        a zero symbol value.
-        DU 4.0 cc enums are recognized by a member type of btEnum without
-        qualifiers and a zero symbol value.  */
+         and its auxiliary index is indexNil or its auxiliary entry
+         is a plain btNil or btVoid.
+         Alpha cc -migrate enums are recognized by a zero index and
+         a zero symbol value.
+         DU 4.0 cc enums are recognized by a member type of btEnum without
+         qualifiers and a zero symbol value.  */
       (*swap_sym_in) (cur_bfd, ext_sym, &sh);
       if (sh.st != stMember)
        return;
@@ -3243,7 +3246,7 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
       name = debug_info->ss + cur_fdr->issBase + sh.iss;
 
       /* Note that the value doesn't matter for enum constants
-        in psymtabs, just in symtabs.  */
+         in psymtabs, just in symtabs.  */
       add_psymbol_to_list (name, strlen (name),
                           VAR_NAMESPACE, LOC_CONST,
                           &objfile->static_psymbols, 0,
@@ -3392,8 +3395,8 @@ psymtab_to_symtab_1 (pst, filename)
              int type_code = ECOFF_UNMARK_STAB (sh.index);
 
              /* We should never get non N_STAB symbols here, but they
-                should be harmless, so keep process_one_symbol from
-                complaining about them.  */
+                should be harmless, so keep process_one_symbol from
+                complaining about them.  */
              if (type_code & N_STAB)
                {
                  process_one_symbol (type_code, 0, valu, name,
@@ -3410,9 +3413,9 @@ psymtab_to_symtab_1 (pst, filename)
                  /* Make up special symbol to contain
                     procedure specific info */
                  struct mips_extra_func_info *e =
-                   ((struct mips_extra_func_info *)
-                    obstack_alloc (&current_objfile->symbol_obstack,
-                                   sizeof (struct mips_extra_func_info)));
+                 ((struct mips_extra_func_info *)
+                  obstack_alloc (&current_objfile->symbol_obstack,
+                                 sizeof (struct mips_extra_func_info)));
                  struct symbol *s = new_symbol (MIPS_EFI_SYMBOL_NAME);
 
                  memset ((PTR) e, 0, sizeof (struct mips_extra_func_info));
@@ -3450,14 +3453,14 @@ psymtab_to_symtab_1 (pst, filename)
       end_stabs ();
 
       /* Sort the symbol table now, we are done adding symbols to it.
-        We must do this before parse_procedure calls lookup_symbol.  */
+         We must do this before parse_procedure calls lookup_symbol.  */
       sort_symtab_syms (st);
 
       /* There used to be a call to sort_blocks here, but this should not
-        be necessary for stabs symtabs.  And as sort_blocks modifies the
-        start address of the GLOBAL_BLOCK to the FIRST_LOCAL_BLOCK,
-        it did the wrong thing if the first procedure in a file was
-        generated via asm statements.  */
+         be necessary for stabs symtabs.  And as sort_blocks modifies the
+         start address of the GLOBAL_BLOCK to the FIRST_LOCAL_BLOCK,
+         it did the wrong thing if the first procedure in a file was
+         generated via asm statements.  */
 
       /* Fill in procedure info next.  */
       if (fh->cpd > 0)
@@ -3483,7 +3486,7 @@ psymtab_to_symtab_1 (pst, filename)
              (*swap_pdr_in) (cur_bfd, pdr_ptr, pdr_in);
 
              /* Determine lowest PDR address, the PDRs are not always
-                sorted.  */
+                sorted.  */
              if (pdr_in == pr_block)
                lowest_pdr_addr = pdr_in->adr;
              else if (pdr_in->adr < lowest_pdr_addr)
@@ -3561,7 +3564,7 @@ psymtab_to_symtab_1 (pst, filename)
              (*swap_sym_in) (cur_bfd, sym_ptr, &sh);
              c = parse_symbol (&sh,
                                debug_info->external_aux + fh->iauxBase,
-                               sym_ptr, fh->fBigendian, pst->section_offsets);
+                            sym_ptr, fh->fBigendian, pst->section_offsets);
              sym_ptr += c * external_sym_size;
            }
 
@@ -3616,8 +3619,8 @@ psymtab_to_symtab_1 (pst, filename)
       LINETABLE (st) = lines;
 
       /* .. and our share of externals.
-        XXX use the global list to speed up things here. how?
-        FIXME, Maybe quit once we have found the right number of ext's? */
+         XXX use the global list to speed up things here. how?
+         FIXME, Maybe quit once we have found the right number of ext's? */
       top_stack->cur_st = st;
       top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
                                                GLOBAL_BLOCK);
@@ -3632,8 +3635,8 @@ psymtab_to_symtab_1 (pst, filename)
        parse_external (ext_ptr, fh->fBigendian, pst->section_offsets);
 
       /* If there are undefined symbols, tell the user.
-        The alpha has an undefined symbol for every symbol that is
-        from a shared library, so tell the user only if verbose is on.  */
+         The alpha has an undefined symbol for every symbol that is
+         from a shared library, so tell the user only if verbose is on.  */
       if (info_verbose && n_undef_symbols)
        {
          printf_filtered ("File %s contains %d unresolved references:",
@@ -3647,7 +3650,7 @@ psymtab_to_symtab_1 (pst, filename)
 
       st->primary = 1;
 
-      /* Sort the symbol table now, we are done adding symbols to it.*/
+      /* Sort the symbol table now, we are done adding symbols to it. */
       sort_symtab_syms (st);
 
       sort_blocks (st);
@@ -3717,7 +3720,7 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
   int xref_fd;
   struct mdebug_pending *pend;
 
-  *tpp = (struct type *)NULL;
+  *tpp = (struct type *) NULL;
 
   (*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
 
@@ -3781,7 +3784,7 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
        || (sh.st != stBlock && sh.st != stTypedef && sh.st != stIndirect
           && sh.st != stStruct && sh.st != stUnion
           && sh.st != stEnum))
-      && (sh.st != stBlock || !SC_IS_COMMON(sh.sc)))
+      && (sh.st != stBlock || !SC_IS_COMMON (sh.sc)))
     {
       /* File indirect entry is corrupt.  */
       *pname = "<illegal>";
@@ -3806,14 +3809,14 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
          /* alpha cc puts out a stTypedef with a sh.iss of zero for
             two cases:
             a) forward declarations of structs/unions/enums which are not
-               defined in this compilation unit.
-               For these the type will be void. This is a bad design decision
-               as cross referencing across compilation units is impossible
-               due to the missing name.
+            defined in this compilation unit.
+            For these the type will be void. This is a bad design decision
+            as cross referencing across compilation units is impossible
+            due to the missing name.
             b) forward declarations of structs/unions/enums/typedefs which
-               are defined later in this file or in another file in the same
-               compilation unit. Irix5 cc uses a stIndirect symbol for this.
-               Simply cross reference those again to get the true type.
+            are defined later in this file or in another file in the same
+            compilation unit. Irix5 cc uses a stIndirect symbol for this.
+            Simply cross reference those again to get the true type.
             The forward references are not entered in the pending list and
             in the symbol table.  */
 
@@ -3828,7 +3831,7 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
            case btVoid:
              *tpp = init_type (type_code, 0, 0, (char *) NULL,
                                current_objfile);
-             *pname = "<undefined>";
+             *pname = "<undefined>";
              break;
 
            case btStruct:
@@ -3843,16 +3846,16 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
 
            case btTypedef:
              /* Follow a forward typedef. This might recursively
-                call cross_ref till we get a non typedef'ed type.
-                FIXME: This is not correct behaviour, but gdb currently
-                cannot handle typedefs without type copying. Type
-                copying is impossible as we might have mutual forward
-                references between two files and the copied type would not
-                get filled in when we later parse its definition.  */
+                call cross_ref till we get a non typedef'ed type.
+                FIXME: This is not correct behaviour, but gdb currently
+                cannot handle typedefs without type copying. Type
+                copying is impossible as we might have mutual forward
+                references between two files and the copied type would not
+                get filled in when we later parse its definition.  */
              *tpp = parse_type (xref_fd,
                                 debug_info->external_aux + fh->iauxBase,
                                 sh.index,
-                                (int *)NULL,
+                                (int *) NULL,
                                 fh->fBigendian,
                                 debug_info->ss + fh->issBase + sh.iss);
              add_pending (fh, esh, *tpp);
@@ -3878,7 +3881,7 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
          *tpp = parse_type (xref_fd,
                             debug_info->external_aux + fh->iauxBase,
                             sh.index,
-                            (int *)NULL,
+                            (int *) NULL,
                             fh->fBigendian,
                             debug_info->ss + fh->issBase + sh.iss);
        }
@@ -3951,13 +3954,13 @@ add_symbol (s, b)
     {
       complain (&block_overflow_complaint, SYMBOL_NAME (s));
       /* In this case shrink_block is actually grow_block, since
-                  BLOCK_NSYMS(b) is larger than its current size.  */
+         BLOCK_NSYMS(b) is larger than its current size.  */
       origb = b;
       b = shrink_block (top_stack->cur_block, top_stack->cur_st);
 
       /* Now run through the stack replacing pointers to the
-        original block.  shrink_block has already done this
-        for the blockvector and BLOCK_FUNCTION.  */
+         original block.  shrink_block has already done this
+         for the blockvector and BLOCK_FUNCTION.  */
       for (stackp = top_stack; stackp; stackp = stackp->next)
        {
          if (stackp->cur_block == origb)
@@ -4121,7 +4124,7 @@ new_symtab (name, maxsyms, maxlines, objfile)
 
   s->free_code = free_linetable;
   s->debugformat = obsavestring ("ECOFF", 5,
-                                &objfile -> symbol_obstack);
+                                &objfile->symbol_obstack);
   return (s);
 }
 
@@ -4236,7 +4239,7 @@ shrink_block (b, s)
                                       * sizeof (struct symbol *))));
 
   /* Should chase pointers to old one.  Fortunately, that`s just
-          the block`s function and inferior blocks */
+     the block`s function and inferior blocks */
   if (BLOCK_FUNCTION (new) && SYMBOL_BLOCK_VALUE (BLOCK_FUNCTION (new)) == b)
     SYMBOL_BLOCK_VALUE (BLOCK_FUNCTION (new)) = new;
   for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i++)
@@ -4389,8 +4392,8 @@ fixup_sigtramp ()
   /* Make a MIPS_EFI_SYMBOL_NAME entry for it */
   {
     struct mips_extra_func_info *e =
-      ((struct mips_extra_func_info *)
-       xzalloc (sizeof (struct mips_extra_func_info)));
+    ((struct mips_extra_func_info *)
+     xzalloc (sizeof (struct mips_extra_func_info)));
 
     e->numargs = 0;            /* the kernel thinks otherwise */
     e->pdr.frameoffset = 32;
@@ -4423,7 +4426,7 @@ fixup_sigtramp ()
   BLOCK_SYM (b, BLOCK_NSYMS (b)++) = s;
 }
 
-#endif /* TM_MIPS_H */
+#endif /* TM_MIPS_H */
 
 void
 _initialize_mdebugread ()
@@ -4484,7 +4487,7 @@ _initialize_mdebugread ()
     init_type (TYPE_CODE_INT, 8,
               0,
               "long long", (struct objfile *) NULL);
-  mdebug_type_unsigned_long_long_64 = 
+  mdebug_type_unsigned_long_long_64 =
     init_type (TYPE_CODE_INT, 8,
               TYPE_FLAG_UNSIGNED,
               "unsigned long long", (struct objfile *) NULL);
index b0a1b4f637146ae173d2b7592d673e5c8fdd3d0a..da400e041c30eb364636b69d7a5ad6e4dc05f241 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 1991, 1995 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by John Gilmore.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
@@ -101,7 +102,7 @@ memory_insert_breakpoint (addr, contents_cache)
 
   /* Write the breakpoint.  */
   if (val == 0)
-    val = target_write_memory (addr, (char *)bp, bplen);
+    val = target_write_memory (addr, (char *) bp, bplen);
 
   return val;
 }
index f60c4176f1cd0f18c4d7ae124f93f5d7f1c558c2..8840df4e2def64533c4fcaf04b9454e3e199e24a 100644 (file)
@@ -1,35 +1,36 @@
 /* Definitions and macros for support of AMD's remote debugger, MiniMON.
    Copyright (C) 1990, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
  * Some basic types.  FIXME, this should be done by declaring bitfield
  * sizes in the structs.  We can't portably depend on a "long int" being
  * 32 bits, etc.
  */
-typedef long int INT32;            /* 32 bit integer */
-typedef unsigned long int UINT32;  /* 32 bit integer (unsigned) */
-typedef unsigned long int ADDR32;  /* 32 bit address */
-typedef unsigned long int INST32;  /* 32 bit instruction */
-typedef long int BOOLEAN;          /* Boolean value (32 bit) */
-typedef unsigned char BYTE;        /* byte (8 bit) */
-typedef short int INT16;           /* 16 bit integer */
-typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */
+typedef long int INT32;                /* 32 bit integer */
+typedef unsigned long int UINT32;      /* 32 bit integer (unsigned) */
+typedef unsigned long int ADDR32;      /* 32 bit address */
+typedef unsigned long int INST32;      /* 32 bit instruction */
+typedef long int BOOLEAN;      /* Boolean value (32 bit) */
+typedef unsigned char BYTE;    /* byte (8 bit) */
+typedef short int INT16;       /* 16 bit integer */
+typedef unsigned short int UINT16;     /* 16 bit integer (unsigned) */
 
 /****************************************************************************/
 /************************* Message Information ******************************/
@@ -40,90 +41,90 @@ typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */
  */
 
 /* General errors */
-#define EMUSAGE     1  /* Bad args / flags               */
-#define EMFAIL      2  /* Unrecoverable error            */
-#define EMBADADDR   3  /* Illegal address                */
-#define EMBADREG    4  /* Illegal register               */
-#define EMSYNTAX    5  /* Illegal command syntax         */
-#define EMACCESS    6  /* Could not access memory        */
-#define EMALLOC     7  /* Could not allocate memory      */
-#define EMTARGET    8  /* Unknown target type            */
-#define EMHINIT     9  /* Could not initialize host      */
-#define EMCOMM     10  /* Could not open communication channel */
+#define EMUSAGE     1          /* Bad args / flags               */
+#define EMFAIL      2          /* Unrecoverable error            */
+#define EMBADADDR   3          /* Illegal address                */
+#define EMBADREG    4          /* Illegal register               */
+#define EMSYNTAX    5          /* Illegal command syntax         */
+#define EMACCESS    6          /* Could not access memory        */
+#define EMALLOC     7          /* Could not allocate memory      */
+#define EMTARGET    8          /* Unknown target type            */
+#define EMHINIT     9          /* Could not initialize host      */
+#define EMCOMM     10          /* Could not open communication channel */
 
 /* Message errors */
-#define EMBADMSG   11  /* Unknown message type           */
-#define EMMSG2BIG  12  /* Message to large for buffer    */
-#define EMNOSEND   13  /* Could not send message         */
-#define EMNORECV   14  /* Could not receive message      */
-
-#define EMRESET    15  /* Could not RESET target         */
-#define EMCONFIG   16  /* Could not get target CONFIG    */
-#define EMSTATUS   17  /* Could not get target STATUS    */
-#define EMREAD     18  /* Could not READ target memory   */
-#define EMWRITE    19  /* Could not WRITE target memory  */
-#define EMBKPTSET  20  /* Could not set breakpoint       */
-#define EMBKPTRM   21  /* Could not remove breakpoint    */
-#define EMBKPTSTAT 22  /* Could not get breakpoint status */
-#define EMBKPTNONE 23  /* All breakpoints in use         */
-#define EMBKPTUSED 24  /* Breakpoints already in use     */
-#define EMCOPY     25  /* Could not COPY target memory   */
-#define EMFILL     26  /* Could not FILL target memory   */
-#define EMINIT     27  /* Could not initialize target memory */
-#define EMGO       28  /* Could not start execution      */
-#define EMSTEP     29  /* Could not single step          */
-#define EMBREAK    30  /* Could not BREAK                */
-#define EMHIF      31  /* Could not perform HIF service  */
-#define EMCHANNEL0 32  /* Could not read CHANNEL0        */
-#define EMCHANNEL1 33  /* Could not write CHANNEL1       */
+#define EMBADMSG   11          /* Unknown message type           */
+#define EMMSG2BIG  12          /* Message to large for buffer    */
+#define EMNOSEND   13          /* Could not send message         */
+#define EMNORECV   14          /* Could not receive message      */
+
+#define EMRESET    15          /* Could not RESET target         */
+#define EMCONFIG   16          /* Could not get target CONFIG    */
+#define EMSTATUS   17          /* Could not get target STATUS    */
+#define EMREAD     18          /* Could not READ target memory   */
+#define EMWRITE    19          /* Could not WRITE target memory  */
+#define EMBKPTSET  20          /* Could not set breakpoint       */
+#define EMBKPTRM   21          /* Could not remove breakpoint    */
+#define EMBKPTSTAT 22          /* Could not get breakpoint status */
+#define EMBKPTNONE 23          /* All breakpoints in use         */
+#define EMBKPTUSED 24          /* Breakpoints already in use     */
+#define EMCOPY     25          /* Could not COPY target memory   */
+#define EMFILL     26          /* Could not FILL target memory   */
+#define EMINIT     27          /* Could not initialize target memory */
+#define EMGO       28          /* Could not start execution      */
+#define EMSTEP     29          /* Could not single step          */
+#define EMBREAK    30          /* Could not BREAK                */
+#define EMHIF      31          /* Could not perform HIF service  */
+#define EMCHANNEL0 32          /* Could not read CHANNEL0        */
+#define EMCHANNEL1 33          /* Could not write CHANNEL1       */
 
 /* COFF file loader errors */
-#define EMOPEN     34  /* Could not open COFF file       */
-#define EMHDR      35  /* Could not read COFF header     */
-#define EMMAGIC    36  /* Bad magic number               */
-#define EMAOUT     37  /* Could not read COFF a.out header */
-#define EMSCNHDR   38  /* Could not read COFF section header */
-#define EMSCN      39  /* Could not read COFF section    */
-#define EMCLOSE    40  /* Could not close COFF file      */
+#define EMOPEN     34          /* Could not open COFF file       */
+#define EMHDR      35          /* Could not read COFF header     */
+#define EMMAGIC    36          /* Bad magic number               */
+#define EMAOUT     37          /* Could not read COFF a.out header */
+#define EMSCNHDR   38          /* Could not read COFF section header */
+#define EMSCN      39          /* Could not read COFF section    */
+#define EMCLOSE    40          /* Could not close COFF file      */
 
 /* Log file errors */
-#define EMLOGOPEN  41  /* Could not open log file        */
-#define EMLOGREAD  42  /* Could not read log file        */
-#define EMLOGWRITE 43  /* Could not write to log file    */
-#define EMLOGCLOSE 44  /* Could not close log file       */
+#define EMLOGOPEN  41          /* Could not open log file        */
+#define EMLOGREAD  42          /* Could not read log file        */
+#define EMLOGWRITE 43          /* Could not write to log file    */
+#define EMLOGCLOSE 44          /* Could not close log file       */
 
 /* Command file errors */
-#define EMCMDOPEN  45  /* Could not open command file    */
-#define EMCMDREAD  46  /* Could not read command file    */
-#define EMCMDWRITE 47  /* Could not write to command file */
-#define EMCMDCLOSE 48  /* Could not close comand file    */
-
-#define EMTIMEOUT  49  /* Host timed out waiting for a message */
-#define EMCOMMTYPE 50  /* A '-t' flag must be specified  */
-#define EMCOMMERR  51  /* Communication error            */
-#define EMBAUD     52  /* Invalid baud rate specified    */
+#define EMCMDOPEN  45          /* Could not open command file    */
+#define EMCMDREAD  46          /* Could not read command file    */
+#define EMCMDWRITE 47          /* Could not write to command file */
+#define EMCMDCLOSE 48          /* Could not close comand file    */
+
+#define EMTIMEOUT  49          /* Host timed out waiting for a message */
+#define EMCOMMTYPE 50          /* A '-t' flag must be specified  */
+#define EMCOMMERR  51          /* Communication error            */
+#define EMBAUD     52          /* Invalid baud rate specified    */
 /*
  * Memory Spaces
  */
-#define LOCAL_REG    0  /* Local processor register     */
-#define GLOBAL_REG   1  /* Global processor register    */
-#define SPECIAL_REG  2  /* Special processor register   */
-#define TLB_REG      3  /* Translation Lookaside Buffer */
-#define COPROC_REG   4  /* Coprocessor register         */
-#define I_MEM        5  /* Instruction Memory           */
-#define D_MEM        6  /* Data Memory                  */
-#define I_ROM        7  /* Instruction ROM              */
-#define D_ROM        8  /* Data ROM                     */
-#define I_O          9  /* Input/Output                 */
-#define I_CACHE     10  /* Instruction Cache            */
-#define D_CACHE     11  /* Data Cache                   */
+#define LOCAL_REG    0         /* Local processor register     */
+#define GLOBAL_REG   1         /* Global processor register    */
+#define SPECIAL_REG  2         /* Special processor register   */
+#define TLB_REG      3         /* Translation Lookaside Buffer */
+#define COPROC_REG   4         /* Coprocessor register         */
+#define I_MEM        5         /* Instruction Memory           */
+#define D_MEM        6         /* Data Memory                  */
+#define I_ROM        7         /* Instruction ROM              */
+#define D_ROM        8         /* Data ROM                     */
+#define I_O          9         /* Input/Output                 */
+#define I_CACHE     10         /* Instruction Cache            */
+#define D_CACHE     11         /* Data Cache                   */
 
 /* To supress warnings for zero length array definitions */
 #define DUMMY 1
 
 /*
-** Host to target definitions
-*/
+   ** Host to target definitions
+ */
 
 #define RESET          0
 #define CONFIG_REQ     1
@@ -146,8 +147,8 @@ typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */
 
 
 /*
-** Target to host definitions
-*/
+   ** Target to host definitions
+ */
 
 #define RESET_ACK     32
 #define CONFIG        33
@@ -170,393 +171,431 @@ typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */
 
 
 /* A "generic" message */
-struct generic_msg_t {
-          INT32    code;  /* generic */
-          INT32    length;
-          BYTE     byte[DUMMY];
-};
+struct generic_msg_t
+  {
+    INT32 code;                        /* generic */
+    INT32 length;
+    BYTE byte[DUMMY];
+  };
 
 
 /* A "generic" message (with an INT32 array) */
-struct generic_int32_msg_t {
-          INT32    code;  /* generic */
-          INT32    length;
-          INT32    int32[DUMMY];
-};
+struct generic_int32_msg_t
+  {
+    INT32 code;                        /* generic */
+    INT32 length;
+    INT32 int32[DUMMY];
+  };
 
 
 /*
-** Host to target messages
-*/
-
-struct reset_msg_t {
-          INT32    code;  /* 0 */
-          INT32    length;
-};
-
-
-struct config_req_msg_t {
-          INT32    code;  /* 1 */
-          INT32    length;
-};
-
-
-struct status_req_msg_t {
-          INT32    code;  /* 2 */
-          INT32    length;
-};
-
-
-struct read_req_msg_t {
-          INT32    code;  /* 3 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-};
-
-
-struct write_req_msg_t {
-          INT32    code;  /* 4 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-          BYTE     data[DUMMY];
-};
-
-
-struct write_r_msg_t {
-          INT32    code;  /* 4 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-          INT32    data[DUMMY];
-};
-
-
-struct bkpt_set_msg_t {
-          INT32    code;  /* 5 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   bkpt_addr;
-          INT32    pass_count;
-          INT32    bkpt_type;
-};
-
-
-struct bkpt_rm_msg_t {
-          INT32    code;  /* 6 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   bkpt_addr;
-};
-
-
-struct bkpt_stat_msg_t {
-          INT32    code;  /* 7 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   bkpt_addr;
-};
-
-
-struct copy_msg_t {
-          INT32    code;  /* 8 */
-          INT32    length;
-          INT32    source_space;
-          ADDR32   source_addr;
-          INT32    dest_space;
-          ADDR32   dest_addr;
-          INT32    byte_count;
-};
-
-
-struct fill_msg_t {
-          INT32    code;  /* 9 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   start_addr;
-          INT32    fill_count;
-          INT32    byte_count;
-          BYTE     fill_data[DUMMY];
-};
-
-
-struct init_msg_t {
-          INT32    code;  /* 10 */
-          INT32    length;
-          ADDR32   text_start;
-          ADDR32   text_end;
-          ADDR32   data_start;
-          ADDR32   data_end;
-          ADDR32   entry_point;
-          INT32    mem_stack_size;
-          INT32    reg_stack_size;
-          ADDR32   arg_start;
-          INT32    os_control;
-};
-
-
-struct go_msg_t {
-          INT32    code;  /* 11 */
-          INT32    length;
-};
-
-
-struct step_msg_t {
-          INT32    code;  /* 12 */
-          INT32    length;
-          INT32    count;
-};
-
-
-struct break_msg_t {
-          INT32    code;  /* 13 */
-          INT32    length;
-};
-
-
-struct hif_call_rtn_msg_t {
-          INT32    code;  /* 64 */
-          INT32    length;
-          INT32    service_number;
-          INT32    gr121;
-          INT32    gr96;
-          INT32    gr97;
-};
-
-
-struct channel0_msg_t {
-          INT32    code;  /* 65 */
-          INT32    length;
-          BYTE     data;
-};
-
+   ** Host to target messages
+ */
 
-struct channel1_ack_msg_t {
-          INT32    code;  /* 66 */
-          INT32    length;
-};
+struct reset_msg_t
+  {
+    INT32 code;                        /* 0 */
+    INT32 length;
+  };
+
+
+struct config_req_msg_t
+  {
+    INT32 code;                        /* 1 */
+    INT32 length;
+  };
+
+
+struct status_req_msg_t
+  {
+    INT32 code;                        /* 2 */
+    INT32 length;
+  };
+
+
+struct read_req_msg_t
+  {
+    INT32 code;                        /* 3 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+  };
+
+
+struct write_req_msg_t
+  {
+    INT32 code;                        /* 4 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+    BYTE data[DUMMY];
+  };
+
+
+struct write_r_msg_t
+  {
+    INT32 code;                        /* 4 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+    INT32 data[DUMMY];
+  };
+
+
+struct bkpt_set_msg_t
+  {
+    INT32 code;                        /* 5 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 bkpt_addr;
+    INT32 pass_count;
+    INT32 bkpt_type;
+  };
+
+
+struct bkpt_rm_msg_t
+  {
+    INT32 code;                        /* 6 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 bkpt_addr;
+  };
+
+
+struct bkpt_stat_msg_t
+  {
+    INT32 code;                        /* 7 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 bkpt_addr;
+  };
+
+
+struct copy_msg_t
+  {
+    INT32 code;                        /* 8 */
+    INT32 length;
+    INT32 source_space;
+    ADDR32 source_addr;
+    INT32 dest_space;
+    ADDR32 dest_addr;
+    INT32 byte_count;
+  };
+
+
+struct fill_msg_t
+  {
+    INT32 code;                        /* 9 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 start_addr;
+    INT32 fill_count;
+    INT32 byte_count;
+    BYTE fill_data[DUMMY];
+  };
+
+
+struct init_msg_t
+  {
+    INT32 code;                        /* 10 */
+    INT32 length;
+    ADDR32 text_start;
+    ADDR32 text_end;
+    ADDR32 data_start;
+    ADDR32 data_end;
+    ADDR32 entry_point;
+    INT32 mem_stack_size;
+    INT32 reg_stack_size;
+    ADDR32 arg_start;
+    INT32 os_control;
+  };
+
+
+struct go_msg_t
+  {
+    INT32 code;                        /* 11 */
+    INT32 length;
+  };
+
+
+struct step_msg_t
+  {
+    INT32 code;                        /* 12 */
+    INT32 length;
+    INT32 count;
+  };
+
+
+struct break_msg_t
+  {
+    INT32 code;                        /* 13 */
+    INT32 length;
+  };
+
+
+struct hif_call_rtn_msg_t
+  {
+    INT32 code;                        /* 64 */
+    INT32 length;
+    INT32 service_number;
+    INT32 gr121;
+    INT32 gr96;
+    INT32 gr97;
+  };
+
+
+struct channel0_msg_t
+  {
+    INT32 code;                        /* 65 */
+    INT32 length;
+    BYTE data;
+  };
+
+
+struct channel1_ack_msg_t
+  {
+    INT32 code;                        /* 66 */
+    INT32 length;
+  };
 
 
 /*
-** Target to host messages
-*/
-
-
-struct reset_ack_msg_t {
-          INT32    code;  /* 32 */
-          INT32    length;
-};
-
-
-struct config_msg_t {
-          INT32    code;  /* 33 */
-          INT32    length;
-          INT32    processor_id;
-          INT32    version;
-          ADDR32   I_mem_start;
-          INT32    I_mem_size;
-          ADDR32   D_mem_start;
-          INT32    D_mem_size;
-          ADDR32   ROM_start;
-          INT32    ROM_size;
-          INT32    max_msg_size;
-          INT32    max_bkpts;
-          INT32    coprocessor;
-          INT32    reserved;
-};
-
-
-struct status_msg_t {
-          INT32    code;  /* 34 */
-          INT32    length;
-          INT32    msgs_sent;
-          INT32    msgs_received;
-          INT32    errors;
-          INT32    bkpts_hit;
-          INT32    bkpts_free;
-          INT32    traps;
-          INT32    fills;
-          INT32    spills;
-          INT32    cycles;
-          INT32    reserved;
-};
-
-
-struct read_ack_msg_t {
-          INT32    code;  /* 35 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-          BYTE     data[DUMMY];
-};
-
-struct read_r_ack_msg_t {
-          INT32    code;  /* 35 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-          INT32    data[DUMMY];
-};
-
-
-struct write_ack_msg_t {
-          INT32    code;  /* 36 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    byte_count;
-};
-
-
-struct bkpt_set_ack_msg_t {
-          INT32    code;  /* 37 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    pass_count;
-          INT32    bkpt_type;
-};
-
-
-struct bkpt_rm_ack_msg_t {
-          INT32    code;  /* 38 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   address;
-};
-
-
-struct bkpt_stat_ack_msg_t {
-          INT32    code;  /* 39 */
-          INT32    length; 
-          INT32    memory_space;
-          ADDR32   address;
-          INT32    pass_count;
-          INT32    bkpt_type;
-};
-
-
-struct copy_ack_msg_t {
-          INT32    code;  /* 40 */
-          INT32    length;
-          INT32    source_space;
-          ADDR32   source_addr;
-          INT32    dest_space;
-          ADDR32   dest_addr;
-          INT32    byte_count;
-};
-
-
-struct fill_ack_msg_t {
-          INT32    code;  /* 41 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   start_addr;
-          INT32    fill_count;
-          INT32    byte_count;
-};
-
-
-struct init_ack_msg_t {
-          INT32    code;  /* 42 */
-          INT32    length;
-};
-
-
-struct halt_msg_t {
-          INT32    code;  /* 43 */
-          INT32    length;
-          INT32    memory_space;
-          ADDR32   pc0;
-          ADDR32   pc1;
-          INT32    trap_number;
-};
-
-
-struct error_msg_t {
-          INT32    code;  /* 63 */
-          INT32    length;
-          INT32    error_code;
-          INT32    memory_space;
-          ADDR32   address;
-};
-
-
-struct hif_call_msg_t {
-          INT32    code;  /* 96 */
-          INT32    length;
-          INT32    service_number;
-          INT32    lr2;
-          INT32    lr3;
-          INT32    lr4;
-};
-
-
-struct channel0_ack_msg_t {
-          INT32    code;  /* 97 */
-          INT32    length;
-};
+   ** Target to host messages
+ */
 
 
-struct channel1_msg_t {
-          INT32    code;  /* 98 */
-          INT32    length;
-          BYTE     data[DUMMY];
-};
+struct reset_ack_msg_t
+  {
+    INT32 code;                        /* 32 */
+    INT32 length;
+  };
+
+
+struct config_msg_t
+  {
+    INT32 code;                        /* 33 */
+    INT32 length;
+    INT32 processor_id;
+    INT32 version;
+    ADDR32 I_mem_start;
+    INT32 I_mem_size;
+    ADDR32 D_mem_start;
+    INT32 D_mem_size;
+    ADDR32 ROM_start;
+    INT32 ROM_size;
+    INT32 max_msg_size;
+    INT32 max_bkpts;
+    INT32 coprocessor;
+    INT32 reserved;
+  };
+
+
+struct status_msg_t
+  {
+    INT32 code;                        /* 34 */
+    INT32 length;
+    INT32 msgs_sent;
+    INT32 msgs_received;
+    INT32 errors;
+    INT32 bkpts_hit;
+    INT32 bkpts_free;
+    INT32 traps;
+    INT32 fills;
+    INT32 spills;
+    INT32 cycles;
+    INT32 reserved;
+  };
+
+
+struct read_ack_msg_t
+  {
+    INT32 code;                        /* 35 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+    BYTE data[DUMMY];
+  };
+
+struct read_r_ack_msg_t
+  {
+    INT32 code;                        /* 35 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+    INT32 data[DUMMY];
+  };
+
+
+struct write_ack_msg_t
+  {
+    INT32 code;                        /* 36 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 byte_count;
+  };
+
+
+struct bkpt_set_ack_msg_t
+  {
+    INT32 code;                        /* 37 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 pass_count;
+    INT32 bkpt_type;
+  };
+
+
+struct bkpt_rm_ack_msg_t
+  {
+    INT32 code;                        /* 38 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+  };
+
+
+struct bkpt_stat_ack_msg_t
+  {
+    INT32 code;                        /* 39 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 address;
+    INT32 pass_count;
+    INT32 bkpt_type;
+  };
+
+
+struct copy_ack_msg_t
+  {
+    INT32 code;                        /* 40 */
+    INT32 length;
+    INT32 source_space;
+    ADDR32 source_addr;
+    INT32 dest_space;
+    ADDR32 dest_addr;
+    INT32 byte_count;
+  };
+
+
+struct fill_ack_msg_t
+  {
+    INT32 code;                        /* 41 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 start_addr;
+    INT32 fill_count;
+    INT32 byte_count;
+  };
+
+
+struct init_ack_msg_t
+  {
+    INT32 code;                        /* 42 */
+    INT32 length;
+  };
+
+
+struct halt_msg_t
+  {
+    INT32 code;                        /* 43 */
+    INT32 length;
+    INT32 memory_space;
+    ADDR32 pc0;
+    ADDR32 pc1;
+    INT32 trap_number;
+  };
+
+
+struct error_msg_t
+  {
+    INT32 code;                        /* 63 */
+    INT32 length;
+    INT32 error_code;
+    INT32 memory_space;
+    ADDR32 address;
+  };
+
+
+struct hif_call_msg_t
+  {
+    INT32 code;                        /* 96 */
+    INT32 length;
+    INT32 service_number;
+    INT32 lr2;
+    INT32 lr3;
+    INT32 lr4;
+  };
+
+
+struct channel0_ack_msg_t
+  {
+    INT32 code;                        /* 97 */
+    INT32 length;
+  };
+
+
+struct channel1_msg_t
+  {
+    INT32 code;                        /* 98 */
+    INT32 length;
+    BYTE data[DUMMY];
+  };
 
 
 
 /*
-** Union all of the message types together
-*/
-
-union msg_t {
-         struct generic_msg_t        generic_msg;
-         struct generic_int32_msg_t  generic_int32_msg;
-
-         struct reset_msg_t          reset_msg;
-         struct config_req_msg_t     config_req_msg;
-         struct status_req_msg_t     status_req_msg;
-         struct read_req_msg_t       read_req_msg;
-         struct write_req_msg_t      write_req_msg;
-         struct write_r_msg_t        write_r_msg;
-         struct bkpt_set_msg_t       bkpt_set_msg;
-         struct bkpt_rm_msg_t        bkpt_rm_msg;
-         struct bkpt_stat_msg_t      bkpt_stat_msg;
-         struct copy_msg_t           copy_msg;
-         struct fill_msg_t           fill_msg;
-         struct init_msg_t           init_msg;
-         struct go_msg_t             go_msg;
-         struct step_msg_t           step_msg;
-         struct break_msg_t          break_msg;
-
-         struct hif_call_rtn_msg_t   hif_call_rtn_msg;
-         struct channel0_msg_t       channel0_msg;
-         struct channel1_ack_msg_t   channel1_ack_msg;
-
-         struct reset_ack_msg_t      reset_ack_msg;
-         struct config_msg_t         config_msg;
-         struct status_msg_t         status_msg;
-         struct read_ack_msg_t       read_ack_msg;
-         struct read_r_ack_msg_t     read_r_ack_msg;
-         struct write_ack_msg_t      write_ack_msg;
-         struct bkpt_set_ack_msg_t   bkpt_set_ack_msg;
-         struct bkpt_rm_ack_msg_t    bkpt_rm_ack_msg;
-         struct bkpt_stat_ack_msg_t  bkpt_stat_ack_msg;
-         struct copy_ack_msg_t       copy_ack_msg;
-         struct fill_ack_msg_t       fill_ack_msg;
-         struct init_ack_msg_t       init_ack_msg;
-         struct halt_msg_t           halt_msg;
-
-         struct error_msg_t          error_msg;
-
-         struct hif_call_msg_t       hif_call_msg;
-         struct channel0_ack_msg_t   channel0_ack_msg;
-         struct channel1_msg_t       channel1_msg;
-};
+   ** Union all of the message types together
+ */
+
+union msg_t
+  {
+    struct generic_msg_t generic_msg;
+    struct generic_int32_msg_t generic_int32_msg;
+
+    struct reset_msg_t reset_msg;
+    struct config_req_msg_t config_req_msg;
+    struct status_req_msg_t status_req_msg;
+    struct read_req_msg_t read_req_msg;
+    struct write_req_msg_t write_req_msg;
+    struct write_r_msg_t write_r_msg;
+    struct bkpt_set_msg_t bkpt_set_msg;
+    struct bkpt_rm_msg_t bkpt_rm_msg;
+    struct bkpt_stat_msg_t bkpt_stat_msg;
+    struct copy_msg_t copy_msg;
+    struct fill_msg_t fill_msg;
+    struct init_msg_t init_msg;
+    struct go_msg_t go_msg;
+    struct step_msg_t step_msg;
+    struct break_msg_t break_msg;
+
+    struct hif_call_rtn_msg_t hif_call_rtn_msg;
+    struct channel0_msg_t channel0_msg;
+    struct channel1_ack_msg_t channel1_ack_msg;
+
+    struct reset_ack_msg_t reset_ack_msg;
+    struct config_msg_t config_msg;
+    struct status_msg_t status_msg;
+    struct read_ack_msg_t read_ack_msg;
+    struct read_r_ack_msg_t read_r_ack_msg;
+    struct write_ack_msg_t write_ack_msg;
+    struct bkpt_set_ack_msg_t bkpt_set_ack_msg;
+    struct bkpt_rm_ack_msg_t bkpt_rm_ack_msg;
+    struct bkpt_stat_ack_msg_t bkpt_stat_ack_msg;
+    struct copy_ack_msg_t copy_ack_msg;
+    struct fill_ack_msg_t fill_ack_msg;
+    struct init_ack_msg_t init_ack_msg;
+    struct halt_msg_t halt_msg;
+
+    struct error_msg_t error_msg;
+
+    struct hif_call_msg_t hif_call_msg;
+    struct channel0_ack_msg_t channel0_ack_msg;
+    struct channel1_msg_t channel1_msg;
+  };
index a271c9180c1e49537bb34e59dea8c55f1617f679..e878b916563ba9068a9fe382c85160a58acf1f8e 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1992, 93, 94, 96, 97, 1998 Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 /* This file contains support routines for creating, manipulating, and
@@ -30,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    In many cases, even if a file was compiled with no special options for
    debugging at all, as long as was not stripped it will contain sufficient
    information to build useful minimal symbol tables using this structure.
-   
+
    Even when a file contains enough debugging information to build a full
    symbol table, these minimal symbols are still useful for quickly mapping
    between names and addresses, and vice versa.  They are also sometimes used
@@ -53,10 +54,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define BUNCH_SIZE 127
 
 struct msym_bunch
-{
-  struct msym_bunch *next;
-  struct minimal_symbol contents[BUNCH_SIZE];
-};
+  {
+    struct msym_bunch *next;
+    struct minimal_symbol contents[BUNCH_SIZE];
+  };
 
 /* Bunch currently being filled up.
    The next field points to chain of filled bunches.  */
@@ -113,11 +114,11 @@ lookup_minimal_symbol (name, sfile, objf)
 
   for (objfile = object_files;
        objfile != NULL && found_symbol == NULL;
-       objfile = objfile -> next)
+       objfile = objfile->next)
     {
       if (objf == NULL || objf == objfile)
        {
-         for (msymbol = objfile -> msymbols;
+         for (msymbol = objfile->msymbols;
               msymbol != NULL && SYMBOL_NAME (msymbol) != NULL &&
               found_symbol == NULL;
               msymbol++)
@@ -134,20 +135,20 @@ lookup_minimal_symbol (name, sfile, objf)
                        found_file_symbol = msymbol;
 #else
                      /* We have neither the ability nor the need to
-                        deal with the SFILE parameter.  If we find
-                        more than one symbol, just return the latest
-                        one (the user can't expect useful behavior in
-                        that case).  */
+                        deal with the SFILE parameter.  If we find
+                        more than one symbol, just return the latest
+                        one (the user can't expect useful behavior in
+                        that case).  */
                      found_file_symbol = msymbol;
 #endif
                      break;
 
-                    case mst_solib_trampoline:
+                   case mst_solib_trampoline:
 
                      /* If a trampoline symbol is found, we prefer to
-                        keep looking for the *real* symbol. If the
-                        actual symbol is not found, then we'll use the
-                        trampoline entry. */
+                        keep looking for the *real* symbol. If the
+                        actual symbol is not found, then we'll use the
+                        trampoline entry. */
                      if (trampoline_symbol == NULL)
                        trampoline_symbol = msymbol;
                      break;
@@ -182,8 +183,8 @@ lookup_minimal_symbol (name, sfile, objf)
    the search to that objfile.  If SFILE is non-NULL, limit the search
    to that source file.  Returns a pointer to the minimal symbol that
    matches, or NULL if no match is found.
-*/
-   
+ */
+
 struct minimal_symbol *
 lookup_minimal_symbol_text (name, sfile, objf)
      register const char *name;
@@ -206,16 +207,16 @@ lookup_minimal_symbol_text (name, sfile, objf)
 
   for (objfile = object_files;
        objfile != NULL && found_symbol == NULL;
-       objfile = objfile -> next)
+       objfile = objfile->next)
     {
       if (objf == NULL || objf == objfile)
        {
-         for (msymbol = objfile -> msymbols;
+         for (msymbol = objfile->msymbols;
               msymbol != NULL && SYMBOL_NAME (msymbol) != NULL &&
               found_symbol == NULL;
               msymbol++)
            {
-             if (SYMBOL_MATCHES_NAME (msymbol, name) && 
+             if (SYMBOL_MATCHES_NAME (msymbol, name) &&
                  (MSYMBOL_TYPE (msymbol) == mst_text ||
                   MSYMBOL_TYPE (msymbol) == mst_file_text))
                {
@@ -227,10 +228,10 @@ lookup_minimal_symbol_text (name, sfile, objf)
                        found_file_symbol = msymbol;
 #else
                      /* We have neither the ability nor the need to
-                        deal with the SFILE parameter.  If we find
-                        more than one symbol, just return the latest
-                        one (the user can't expect useful behavior in
-                        that case).  */
+                        deal with the SFILE parameter.  If we find
+                        more than one symbol, just return the latest
+                        one (the user can't expect useful behavior in
+                        that case).  */
                      found_file_symbol = msymbol;
 #endif
                      break;
@@ -259,8 +260,8 @@ lookup_minimal_symbol_text (name, sfile, objf)
    the search to that objfile.  If SFILE is non-NULL, limit the search
    to that source file.  Returns a pointer to the minimal symbol that
    matches, or NULL if no match is found.
-*/
-   
+ */
+
 struct minimal_symbol *
 lookup_minimal_symbol_solib_trampoline (name, sfile, objf)
      register const char *name;
@@ -282,16 +283,16 @@ lookup_minimal_symbol_solib_trampoline (name, sfile, objf)
 
   for (objfile = object_files;
        objfile != NULL && found_symbol == NULL;
-       objfile = objfile -> next)
+       objfile = objfile->next)
     {
       if (objf == NULL || objf == objfile)
        {
-         for (msymbol = objfile -> msymbols;
+         for (msymbol = objfile->msymbols;
               msymbol != NULL && SYMBOL_NAME (msymbol) != NULL &&
               found_symbol == NULL;
               msymbol++)
            {
-             if (SYMBOL_MATCHES_NAME (msymbol, name) && 
+             if (SYMBOL_MATCHES_NAME (msymbol, name) &&
                  MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
                return msymbol;
            }
@@ -332,18 +333,18 @@ lookup_minimal_symbol_by_pc_section (pc, section)
 
   for (objfile = object_files;
        objfile != NULL;
-       objfile = objfile -> next)
+       objfile = objfile->next)
     {
       /* If this objfile has a minimal symbol table, go search it using
-        a binary search.  Note that a minimal symbol table always consists
-        of at least two symbols, a "real" symbol and the terminating
-        "null symbol".  If there are no real symbols, then there is no
-        minimal symbol table at all. */
+         a binary search.  Note that a minimal symbol table always consists
+         of at least two symbols, a "real" symbol and the terminating
+         "null symbol".  If there are no real symbols, then there is no
+         minimal symbol table at all. */
 
-      if ((msymbol = objfile -> msymbols) != NULL)
+      if ((msymbol = objfile->msymbols) != NULL)
        {
          lo = 0;
-         hi = objfile -> minimal_symbol_count - 1;
+         hi = objfile->minimal_symbol_count - 1;
 
          /* This code assumes that the minimal symbols are sorted by
             ascending address values.  If the pc value is greater than or
@@ -383,26 +384,26 @@ lookup_minimal_symbol_by_pc_section (pc, section)
                }
 
              /* If we have multiple symbols at the same address, we want
-                hi to point to the last one.  That way we can find the
-                right symbol if it has an index greater than hi.  */
-             while (hi < objfile -> minimal_symbol_count - 1
+                hi to point to the last one.  That way we can find the
+                right symbol if it has an index greater than hi.  */
+             while (hi < objfile->minimal_symbol_count - 1
                     && (SYMBOL_VALUE_ADDRESS (&msymbol[hi])
-                        == SYMBOL_VALUE_ADDRESS (&msymbol[hi+1])))
+                        == SYMBOL_VALUE_ADDRESS (&msymbol[hi + 1])))
                hi++;
 
              /* The minimal symbol indexed by hi now is the best one in this
-                objfile's minimal symbol table.  See if it is the best one
-                overall. */
+                objfile's minimal symbol table.  See if it is the best one
+                overall. */
 
              /* Skip any absolute symbols.  This is apparently what adb
-                and dbx do, and is needed for the CM-5.  There are two
-                known possible problems: (1) on ELF, apparently end, edata,
-                etc. are absolute.  Not sure ignoring them here is a big
-                deal, but if we want to use them, the fix would go in
-                elfread.c.  (2) I think shared library entry points on the
-                NeXT are absolute.  If we want special handling for this
-                it probably should be triggered by a special
-                mst_abs_or_lib or some such.  */
+                and dbx do, and is needed for the CM-5.  There are two
+                known possible problems: (1) on ELF, apparently end, edata,
+                etc. are absolute.  Not sure ignoring them here is a big
+                deal, but if we want to use them, the fix would go in
+                elfread.c.  (2) I think shared library entry points on the
+                NeXT are absolute.  If we want special handling for this
+                it probably should be triggered by a special
+                mst_abs_or_lib or some such.  */
              while (hi >= 0
                     && msymbol[hi].type == mst_abs)
                --hi;
@@ -416,7 +417,7 @@ lookup_minimal_symbol_by_pc_section (pc, section)
 
              if (hi >= 0
                  && ((best_symbol == NULL) ||
-                     (SYMBOL_VALUE_ADDRESS (best_symbol) < 
+                     (SYMBOL_VALUE_ADDRESS (best_symbol) <
                       SYMBOL_VALUE_ADDRESS (&msymbol[hi]))))
                {
                  best_symbol = &msymbol[hi];
@@ -460,8 +461,8 @@ find_stab_function_addr (namestring, pst, objfile)
   if (msym == NULL)
     {
       /* Sun Fortran appends an underscore to the minimal symbol name,
-        try again with an appended underscore if the minimal symbol
-        was not found.  */
+         try again with an appended underscore if the minimal symbol
+         was not found.  */
       p[n] = '_';
       p[n + 1] = 0;
       msym = lookup_minimal_symbol (p, pst->filename, objfile);
@@ -469,8 +470,8 @@ find_stab_function_addr (namestring, pst, objfile)
   return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
 }
 #endif /* SOFUN_ADDRESS_MAYBE_MISSING */
-
 \f
+
 /* Return leading symbol character for a BFD. If BFD is NULL,
    return the leading symbol character from the main objfile.  */
 
@@ -478,7 +479,7 @@ static int get_symbol_leading_char PARAMS ((bfd *));
 
 static int
 get_symbol_leading_char (abfd)
-     bfd * abfd;
+     bfd *abfd;
 {
   if (abfd != NULL)
     return bfd_get_symbol_leading_char (abfd);
@@ -551,10 +552,10 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
   if (ms_type == mst_file_text)
     {
       /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
-        the minimal symbols, because if there is also another symbol
-        at the same address (e.g. the first function of the file),
-        lookup_minimal_symbol_by_pc would have no way of getting the
-        right one.  */
+         the minimal symbols, because if there is also another symbol
+         at the same address (e.g. the first function of the file),
+         lookup_minimal_symbol_by_pc would have no way of getting the
+         right one.  */
       if (name[0] == 'g'
          && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0
              || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0))
@@ -573,10 +574,10 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
     {
       new = (struct msym_bunch *) xmalloc (sizeof (struct msym_bunch));
       msym_bunch_index = 0;
-      new -> next = msym_bunch;
+      new->next = msym_bunch;
       msym_bunch = new;
     }
-  msymbol = &msym_bunch -> contents[msym_bunch_index];
+  msymbol = &msym_bunch->contents[msym_bunch_index];
   SYMBOL_NAME (msymbol) = obsavestring ((char *) name, strlen (name),
                                        &objfile->symbol_obstack);
   SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
@@ -586,7 +587,7 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
 
   MSYMBOL_TYPE (msymbol) = ms_type;
   /* FIXME:  This info, if it remains, needs its own field.  */
-  MSYMBOL_INFO (msymbol) = info; /* FIXME! */
+  MSYMBOL_INFO (msymbol) = info;       /* FIXME! */
   msym_bunch_index++;
   msym_count++;
   OBJSTAT (objfile, n_minsyms++);
@@ -610,13 +611,14 @@ compare_minimal_symbols (fn1p, fn2p)
 
   if (SYMBOL_VALUE_ADDRESS (fn1) < SYMBOL_VALUE_ADDRESS (fn2))
     {
-      return (-1);     /* addr 1 is less than addr 2 */
+      return (-1);             /* addr 1 is less than addr 2 */
     }
   else if (SYMBOL_VALUE_ADDRESS (fn1) > SYMBOL_VALUE_ADDRESS (fn2))
     {
-      return (1);      /* addr 1 is greater than addr 2 */
+      return (1);              /* addr 1 is greater than addr 2 */
     }
-  else                 /* addrs are equal: sort by name */
+  else
+    /* addrs are equal: sort by name */
     {
       char *name1 = SYMBOL_NAME (fn1);
       char *name2 = SYMBOL_NAME (fn2);
@@ -624,11 +626,11 @@ compare_minimal_symbols (fn1p, fn2p)
       if (name1 && name2)      /* both have names */
        return strcmp (name1, name2);
       else if (name2)
-       return 1;       /* fn1 has no name, so it is "less" */
-      else if (name1)  /* fn2 has no name, so it is "less" */
+       return 1;               /* fn1 has no name, so it is "less" */
+      else if (name1)          /* fn2 has no name, so it is "less" */
        return -1;
       else
-       return (0);     /* neither has a name, so they're equal. */
+       return (0);             /* neither has a name, so they're equal. */
     }
 }
 
@@ -649,8 +651,8 @@ discard_minimal_symbols (foo)
 
   while (msym_bunch != NULL)
     {
-      next = msym_bunch -> next;
-      free ((PTR)msym_bunch);
+      next = msym_bunch->next;
+      free ((PTR) msym_bunch);
       msym_bunch = next;
     }
 }
@@ -704,11 +706,11 @@ compact_minimal_symbols (msymbol, mcount)
       copyfrom = copyto = msymbol;
       while (copyfrom < msymbol + mcount - 1)
        {
-         if (SYMBOL_VALUE_ADDRESS (copyfrom) == 
+         if (SYMBOL_VALUE_ADDRESS (copyfrom) ==
              SYMBOL_VALUE_ADDRESS ((copyfrom + 1)) &&
              (STREQ (SYMBOL_NAME (copyfrom), SYMBOL_NAME ((copyfrom + 1)))))
            {
-             if (MSYMBOL_TYPE((copyfrom + 1)) == mst_unknown)
+             if (MSYMBOL_TYPE ((copyfrom + 1)) == mst_unknown)
                {
                  MSYMBOL_TYPE ((copyfrom + 1)) = MSYMBOL_TYPE (copyfrom);
                }
@@ -762,67 +764,67 @@ install_minimal_symbols (objfile)
   if (msym_count > 0)
     {
       /* Allocate enough space in the obstack, into which we will gather the
-        bunches of new and existing minimal symbols, sort them, and then
-        compact out the duplicate entries.  Once we have a final table,
-        we will give back the excess space.  */
+         bunches of new and existing minimal symbols, sort them, and then
+         compact out the duplicate entries.  Once we have a final table,
+         we will give back the excess space.  */
 
       alloc_count = msym_count + objfile->minimal_symbol_count + 1;
       obstack_blank (&objfile->symbol_obstack,
                     alloc_count * sizeof (struct minimal_symbol));
       msymbols = (struct minimal_symbol *)
-                obstack_base (&objfile->symbol_obstack);
+       obstack_base (&objfile->symbol_obstack);
 
       /* Copy in the existing minimal symbols, if there are any.  */
 
       if (objfile->minimal_symbol_count)
-        memcpy ((char *)msymbols, (char *)objfile->msymbols, 
-               objfile->minimal_symbol_count * sizeof (struct minimal_symbol));
+       memcpy ((char *) msymbols, (char *) objfile->msymbols,
+           objfile->minimal_symbol_count * sizeof (struct minimal_symbol));
 
       /* Walk through the list of minimal symbol bunches, adding each symbol
-        to the new contiguous array of symbols.  Note that we start with the
-        current, possibly partially filled bunch (thus we use the current
-        msym_bunch_index for the first bunch we copy over), and thereafter
-        each bunch is full. */
-      
+         to the new contiguous array of symbols.  Note that we start with the
+         current, possibly partially filled bunch (thus we use the current
+         msym_bunch_index for the first bunch we copy over), and thereafter
+         each bunch is full. */
+
       mcount = objfile->minimal_symbol_count;
       leading_char = get_symbol_leading_char (objfile->obfd);
-      
-      for (bunch = msym_bunch; bunch != NULL; bunch = bunch -> next)
+
+      for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next)
        {
          for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)
            {
-             msymbols[mcount] = bunch -> contents[bindex];
+             msymbols[mcount] = bunch->contents[bindex];
              SYMBOL_LANGUAGE (&msymbols[mcount]) = language_auto;
              if (SYMBOL_NAME (&msymbols[mcount])[0] == leading_char)
                {
-                 SYMBOL_NAME(&msymbols[mcount])++;
+                 SYMBOL_NAME (&msymbols[mcount])++;
                }
            }
          msym_bunch_index = BUNCH_SIZE;
        }
 
       /* Sort the minimal symbols by address.  */
-      
+
       qsort (msymbols, mcount, sizeof (struct minimal_symbol),
             compare_minimal_symbols);
-      
+
       /* Compact out any duplicates, and free up whatever space we are
-        no longer using.  */
-      
+         no longer using.  */
+
       mcount = compact_minimal_symbols (msymbols, mcount);
 
       obstack_blank (&objfile->symbol_obstack,
-       (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol));
+              (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol));
       msymbols = (struct minimal_symbol *)
        obstack_finish (&objfile->symbol_obstack);
 
       /* We also terminate the minimal symbol table with a "null symbol",
-        which is *not* included in the size of the table.  This makes it
-        easier to find the end of the table when we are handed a pointer
-        to some symbol in the middle of it.  Zero out the fields in the
-        "null symbol" allocated at the end of the array.  Note that the
-        symbol count does *not* include this null symbol, which is why it
-        is indexed by mcount and not mcount-1. */
+         which is *not* included in the size of the table.  This makes it
+         easier to find the end of the table when we are handed a pointer
+         to some symbol in the middle of it.  Zero out the fields in the
+         "null symbol" allocated at the end of the array.  Note that the
+         symbol count does *not* include this null symbol, which is why it
+         is indexed by mcount and not mcount-1. */
 
       SYMBOL_NAME (&msymbols[mcount]) = NULL;
       SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
@@ -831,16 +833,16 @@ install_minimal_symbols (objfile)
       SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);
 
       /* Attach the minimal symbol table to the specified objfile.
-        The strings themselves are also located in the symbol_obstack
-        of this objfile.  */
+         The strings themselves are also located in the symbol_obstack
+         of this objfile.  */
 
-      objfile -> minimal_symbol_count = mcount;
-      objfile -> msymbols = msymbols;
+      objfile->minimal_symbol_count = mcount;
+      objfile->msymbols = msymbols;
 
       /* Now walk through all the minimal symbols, selecting the newly added
-        ones and attempting to cache their C++ demangled names. */
+         ones and attempting to cache their C++ demangled names. */
 
-      for ( ; mcount-- > 0 ; msymbols++)
+      for (; mcount-- > 0; msymbols++)
        {
          SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
        }
@@ -893,12 +895,11 @@ find_solib_trampoline_target (pc)
   if (tsymbol != NULL)
     {
       ALL_MSYMBOLS (objfile, msymbol)
-       {
-         if (MSYMBOL_TYPE (msymbol) == mst_text
-             && STREQ (SYMBOL_NAME (msymbol), SYMBOL_NAME (tsymbol)))
-           return SYMBOL_VALUE_ADDRESS (msymbol);
-       }
+      {
+       if (MSYMBOL_TYPE (msymbol) == mst_text
+           && STREQ (SYMBOL_NAME (msymbol), SYMBOL_NAME (tsymbol)))
+         return SYMBOL_VALUE_ADDRESS (msymbol);
+      }
     }
   return 0;
 }
-
index 9f5717475e11db578b74adf582d33be14a6f4b88..958aaea4d25df51b87282dfd59db629eb8724145 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -59,7 +60,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
   : regno >= FP0_REGNUM ?      FPR_BASE + (regno - FP0_REGNUM) \
   : 0)
 
-static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+{0};
 
 static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
 
@@ -79,11 +81,11 @@ fetch_inferior_registers (regno)
     {
       regaddr = REGISTER_PTRACE_ADDR (regno);
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
-       {
-         *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
+       {
+         *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
                                     (PTRACE_ARG3_TYPE) regaddr, 0);
-         regaddr += sizeof (int);
-       }
+         regaddr += sizeof (int);
+       }
       supply_register (regno, buf);
     }
 
@@ -134,7 +136,7 @@ store_inferior_registers (regno)
    This routine returns true on success. */
 
 int
-get_longjmp_target(pc)
+get_longjmp_target (pc)
      CORE_ADDR *pc;
 {
   CORE_ADDR jb_addr;
@@ -157,11 +159,11 @@ get_longjmp_target(pc)
    CORE_REG_SECT points to the register values themselves, read into memory.
    CORE_REG_SIZE is the size of that area.
    WHICH says which set of registers we are handling (0 = int, 2 = float
-         on machines where they are discontiguous).
+   on machines where they are discontiguous).
    REG_ADDR is the offset from u.u_ar0 to the register values relative to
-            core_reg_sect.  This is used with old-fashioned core files to
-           locate the registers in a large upage-plus-stack ".reg" section.
-           Original upage address X is at location core_reg_sect+x+reg_addr.
+   core_reg_sect.  This is used with old-fashioned core files to
+   locate the registers in a large upage-plus-stack ".reg" section.
+   Original upage address X is at location core_reg_sect+x+reg_addr.
  */
 
 static void
@@ -174,7 +176,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   register int regno;
   register unsigned int addr;
   int bad_reg = -1;
-  register reg_ptr = -reg_addr;                /* Original u.u_ar0 is -reg_addr. */
+  register reg_ptr = -reg_addr;        /* Original u.u_ar0 is -reg_addr. */
 
   /* If u.u_ar0 was an absolute address in the core file, relativize it now,
      so we can use it as an offset into core_reg_sect.  When we're done,
@@ -192,12 +194,15 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
   for (regno = 0; regno < NUM_REGS; regno++)
     {
       addr = register_addr (regno, reg_ptr);
-      if (addr >= core_reg_size) {
-       if (bad_reg < 0)
-         bad_reg = regno;
-      } else {
-       supply_register (regno, core_reg_sect + addr);
-      }
+      if (addr >= core_reg_size)
+       {
+         if (bad_reg < 0)
+           bad_reg = regno;
+       }
+      else
+       {
+         supply_register (regno, core_reg_sect + addr);
+       }
     }
   if (bad_reg >= 0)
     {
@@ -225,8 +230,8 @@ register_addr (regno, blockend)
 
   return addr;
 }
-
 \f
+
 /* Register that we are able to handle mips core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index 5d75e482af2167d37bb4ffb6d93b476c8241ad83..c00e58434f62596df254de9ebfa8d148c1a706c7 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
 
-This file is part of GDB.
+   This 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -37,21 +38,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "opcode/mips.h"
 
 struct frame_extra_info
-{
-  mips_extra_func_info_t proc_desc;
-  int num_args;
-};
+  {
+    mips_extra_func_info_t proc_desc;
+    int num_args;
+  };
 
 /* Some MIPS boards don't support floating point while others only
    support single-precision floating-point operations.  See also
    FP_REGISTER_DOUBLE. */
 
 enum mips_fpu_type
-{
-  MIPS_FPU_DOUBLE,     /* Full double precision floating point.  */
-  MIPS_FPU_SINGLE,     /* Single precision floating point (R4650).  */
-  MIPS_FPU_NONE                /* No floating point.  */
-};
+  {
+    MIPS_FPU_DOUBLE,           /* Full double precision floating point.  */
+    MIPS_FPU_SINGLE,           /* Single precision floating point (R4650).  */
+    MIPS_FPU_NONE              /* No floating point.  */
+  };
 
 #ifndef MIPS_DEFAULT_FPU_TYPE
 #define MIPS_DEFAULT_FPU_TYPE MIPS_FPU_DOUBLE
@@ -81,7 +82,7 @@ int gdb_print_insn_mips PARAMS ((bfd_vma, disassemble_info *));
 static void mips_print_register PARAMS ((int, int));
 
 static mips_extra_func_info_t
-heuristic_proc_desc PARAMS ((CORE_ADDR, CORE_ADDR, struct frame_info *));
+  heuristic_proc_desc PARAMS ((CORE_ADDR, CORE_ADDR, struct frame_info *));
 
 static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR));
 
@@ -97,7 +98,7 @@ static void reinit_frame_cache_sfunc PARAMS ((char *, int,
                                              struct cmd_list_element *));
 
 static mips_extra_func_info_t
-  find_proc_desc PARAMS ((CORE_ADDR pc, struct frame_info *next_frame));
+  find_proc_desc PARAMS ((CORE_ADDR pc, struct frame_info * next_frame));
 
 static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc,
                                         mips_extra_func_info_t proc_desc));
@@ -121,8 +122,6 @@ mips_register_name (i)
 {
   return mips_processor_reg_names[i];
 }
-
-
 /* *INDENT-OFF* */
 /* Names of IDT R3041 registers.  */
 
@@ -206,8 +205,12 @@ struct {
 };
 /* *INDENT-ON* */
 
+
+
+
 /* Table to translate MIPS16 register field to actual register number.  */
-static int mips16_to_32_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
+static int mips16_to_32_reg[8] =
+{16, 17, 2, 3, 4, 5, 6, 7};
 
 /* Heuristic_proc_start may hunt through the text section for a long
    time across a 2400 baud serial line.  Allows the user to limit this
@@ -215,8 +218,8 @@ static int mips16_to_32_reg[8] = { 16, 17, 2, 3, 4, 5, 6, 7 };
 
 static unsigned int heuristic_fence_post = 0;
 
-#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */
-#define PROC_HIGH_ADDR(proc) ((proc)->high_addr) /* upper address bound */
+#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr)  /* least address */
+#define PROC_HIGH_ADDR(proc) ((proc)->high_addr)       /* upper address bound */
 #define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset)
 #define PROC_FRAME_REG(proc) ((proc)->pdr.framereg)
 #define PROC_FRAME_ADJUST(proc)  ((proc)->frame_adjust)
@@ -231,10 +234,11 @@ static unsigned int heuristic_fence_post = 0;
 #define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_)
 
 struct linked_proc_info
-{
-  struct mips_extra_func_info info;
-  struct linked_proc_info *next;
-} *linked_proc_desc_table = NULL;
+  {
+    struct mips_extra_func_info info;
+    struct linked_proc_info *next;
+  }
+ *linked_proc_desc_table = NULL;
 
 void
 mips_print_extra_frame_info (fi)
@@ -261,7 +265,7 @@ mips_use_struct_convention (gcc_p, type)
   if (MIPS_EABI)
     return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
   else
-    return 1; /* Structures are returned by ref in extra arg0 */
+    return 1;                  /* Structures are returned by ref in extra arg0 */
 }
 
 /* Tell if the program counter value in MEMADDR is in a MIPS16 function.  */
@@ -303,7 +307,7 @@ after_prologue (pc, proc_desc)
   if (proc_desc)
     {
       /* If function is frameless, then we need to do it the hard way.  I
-        strongly suspect that frameless always means prologueless... */
+         strongly suspect that frameless always means prologueless... */
       if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
          && PROC_FRAME_OFFSET (proc_desc) == 0)
        return 0;
@@ -341,16 +345,16 @@ mips32_decode_reg_save (inst, gen_mask, float_mask)
       || (inst & 0xffe00000) == 0xffa00000)    /* sd reg,n($sp) */
     {
       /* It might be possible to use the instruction to
-        find the offset, rather than the code below which
-        is based on things being in a certain order in the
-        frame, but figuring out what the instruction's offset
-        is relative to might be a little tricky.  */
+         find the offset, rather than the code below which
+         is based on things being in a certain order in the
+         frame, but figuring out what the instruction's offset
+         is relative to might be a little tricky.  */
       reg = (inst & 0x001f0000) >> 16;
       *gen_mask |= (1 << reg);
     }
   else if ((inst & 0xffe00000) == 0xe7a00000   /* swc1 freg,n($sp) */
-          || (inst & 0xffe00000) == 0xe7c00000 /* swc1 freg,n($r30) */
-          || (inst & 0xffe00000) == 0xf7a00000)/* sdc1 freg,n($sp) */
+          || (inst & 0xffe00000) == 0xe7c00000         /* swc1 freg,n($r30) */
+          || (inst & 0xffe00000) == 0xf7a00000)        /* sdc1 freg,n($sp) */
 
     {
       reg = ((inst & 0x001f0000) >> 16);
@@ -368,17 +372,17 @@ mips16_decode_reg_save (inst, gen_mask)
      t_inst inst;
      unsigned long *gen_mask;
 {
-  if ((inst & 0xf800) == 0xd000)               /* sw reg,n($sp) */
+  if ((inst & 0xf800) == 0xd000)       /* sw reg,n($sp) */
     {
       int reg = mips16_to_32_reg[(inst & 0x700) >> 8];
       *gen_mask |= (1 << reg);
     }
-  else if ((inst & 0xff00) == 0xf900)          /* sd reg,n($sp) */
+  else if ((inst & 0xff00) == 0xf900)  /* sd reg,n($sp) */
     {
       int reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
       *gen_mask |= (1 << reg);
     }
-  else if ((inst & 0xff00) == 0x6200           /* sw $ra,n($sp) */
+  else if ((inst & 0xff00) == 0x6200   /* sw $ra,n($sp) */
           || (inst & 0xff00) == 0xfa00)        /* sd $ra,n($sp) */
     *gen_mask |= (1 << RA_REGNUM);
 }
@@ -389,7 +393,7 @@ mips16_decode_reg_save (inst, gen_mask)
 
 static t_inst
 mips_fetch_instruction (addr)
-    CORE_ADDR addr;
+     CORE_ADDR addr;
 {
   char buf[MIPS_INSTLEN];
   int instlen;
@@ -401,7 +405,7 @@ mips_fetch_instruction (addr)
       addr = UNMAKE_MIPS16_ADDR (addr);
     }
   else
-      instlen = MIPS_INSTLEN;
+    instlen = MIPS_INSTLEN;
   status = read_memory_nobpt (addr, buf, instlen);
   if (status)
     memory_error (status, addr);
@@ -422,298 +426,328 @@ mips_fetch_instruction (addr)
 #define rtype_op(x) (x >>25)
 #define rtype_rs(x) ((x>>21) & 0x1f)
 #define rtype_rt(x) ((x>>16)  & 0x1f)
-#define rtype_rd(x) ((x>>11) & 0x1f) 
+#define rtype_rd(x) ((x>>11) & 0x1f)
 #define rtype_shamt(x) ((x>>6) & 0x1f)
 #define rtype_funct(x) (x & 0x3f )
 
 static CORE_ADDR
-mips32_relative_offset(unsigned long inst)
-{ long x ;
-  x = itype_immediate(inst) ;
-  if (x & 0x8000) /* sign bit set */
+mips32_relative_offset (unsigned long inst)
+{
+  long x;
+  x = itype_immediate (inst);
+  if (x & 0x8000)              /* sign bit set */
     {
-      x |= 0xffff0000 ; /* sign extension */
+      x |= 0xffff0000;         /* sign extension */
     }
-  x = x << 2 ;
-  return x ;
+  x = x << 2;
+  return x;
 }
 
 /* Determine whate to set a single step breakpoint while considering
    branch prediction */
 CORE_ADDR
-mips32_next_pc(CORE_ADDR pc)
-{
-  unsigned long inst ;
-  int op ;
-  inst = mips_fetch_instruction(pc) ;
-  if ((inst & 0xe0000000) != 0) /* Not a special, junp or branch instruction */
-    { if ((inst >> 27) == 5) /* BEQL BNEZ BLEZL BGTZE , bits 0101xx */
-       { op = ((inst >> 25) & 0x03) ;
+mips32_next_pc (CORE_ADDR pc)
+{
+  unsigned long inst;
+  int op;
+  inst = mips_fetch_instruction (pc);
+  if ((inst & 0xe0000000) != 0)        /* Not a special, junp or branch instruction */
+    {
+      if ((inst >> 27) == 5)   /* BEQL BNEZ BLEZL BGTZE , bits 0101xx */
+       {
+         op = ((inst >> 25) & 0x03);
          switch (op)
            {
-           case 0 : goto equal_branch ; /* BEQL   */
-           case 1 : goto neq_branch ;   /* BNEZ   */
-           case 2 : goto less_branch ;  /* BLEZ   */
-           case 3 : goto greater_branch ; /* BGTZ */
-           default : pc += 4 ;
+           case 0:
+             goto equal_branch;        /* BEQL   */
+           case 1:
+             goto neq_branch;  /* BNEZ   */
+           case 2:
+             goto less_branch; /* BLEZ   */
+           case 3:
+             goto greater_branch;      /* BGTZ */
+           default:
+             pc += 4;
            }
        }
-      else pc += 4 ; /* Not a branch, next instruction is easy */
+      else
+       pc += 4;                /* Not a branch, next instruction is easy */
     }
   else
-    { /* This gets way messy */
-      
+    {                          /* This gets way messy */
+
       /* Further subdivide into SPECIAL, REGIMM and other */
-      switch (op = ((inst >> 26) & 0x07))  /* extract bits 28,27,26 */
+      switch (op = ((inst >> 26) & 0x07))      /* extract bits 28,27,26 */
        {
-         case 0 : /* SPECIAL */
-           op = rtype_funct(inst) ;
-           switch (op)
-             {
-             case 8 : /* JR */
-             case 9 : /* JALR */
-               pc = read_register(rtype_rs(inst)) ; /* Set PC to that address */
-               break ;
-             default: pc += 4 ;
-             }
-           
-           break ; /* end special */
-       case 1 :  /* REGIMM */
+       case 0:         /* SPECIAL */
+         op = rtype_funct (inst);
+         switch (op)
+           {
+           case 8:             /* JR */
+           case 9:             /* JALR */
+             pc = read_register (rtype_rs (inst));     /* Set PC to that address */
+             break;
+           default:
+             pc += 4;
+           }
+
+         break;                /* end special */
+       case 1:         /* REGIMM */
          {
-           op = jtype_op(inst) ; /* branch condition */
-           switch (jtype_op(inst))
+           op = jtype_op (inst);       /* branch condition */
+           switch (jtype_op (inst))
              {
-             case 0 : /* BLTZ */
-             case 2 : /* BLTXL */
-             case 16 : /* BLTZALL */
-             case 18 : /* BLTZALL */
+             case 0:           /* BLTZ */
+             case 2:           /* BLTXL */
+             case 16:          /* BLTZALL */
+             case 18:          /* BLTZALL */
              less_branch:
-               if (read_register(itype_rs(inst)) < 0)
-                 pc += mips32_relative_offset(inst) + 4 ;
-               else pc += 8 ;  /* after the delay slot */
-             break ;
-             case 1 : /* GEZ */
-             case 3 : /* BGEZL */
-             case 17 : /* BGEZAL */
-             case 19 : /* BGEZALL */
+               if (read_register (itype_rs (inst)) < 0)
+                 pc += mips32_relative_offset (inst) + 4;
+               else
+                 pc += 8;      /* after the delay slot */
+               break;
+             case 1:           /* GEZ */
+             case 3:           /* BGEZL */
+             case 17:          /* BGEZAL */
+             case 19:          /* BGEZALL */
              greater_equal_branch:
-             if (read_register(itype_rs(inst)) >= 0)
-                 pc += mips32_relative_offset(inst) + 4 ;
-             else pc += 8 ; /* after the delay slot */
-             break ;
-             /* All of the other intructions in the REGIMM catagory */
-             default: pc += 4 ;
+               if (read_register (itype_rs (inst)) >= 0)
+                 pc += mips32_relative_offset (inst) + 4;
+               else
+                 pc += 8;      /* after the delay slot */
+               break;
+               /* All of the other intructions in the REGIMM catagory */
+             default:
+               pc += 4;
              }
          }
-         break ; /* end REGIMM */
-       case 2 :  /* J */
-       case 3 :  /* JAL */
-         { unsigned long reg ;
-           reg = jtype_target(inst) << 2 ;
-           pc = reg + ((pc+4) & 0xf0000000)  ;
+         break;                /* end REGIMM */
+       case 2:         /* J */
+       case 3:         /* JAL */
+         {
+           unsigned long reg;
+           reg = jtype_target (inst) << 2;
+           pc = reg + ((pc + 4) & 0xf0000000);
            /* Whats this mysterious 0xf000000 adjustment ??? */
          }
-         break ;
-         /* FIXME case JALX :*/
-         { unsigned long reg ;
-           reg = jtype_target(inst) << 2 ;
-           pc = reg + ((pc+4) & 0xf0000000) + 1 ; /* yes, +1 */
+         break;
+         /* FIXME case JALX : */
+         {
+           unsigned long reg;
+           reg = jtype_target (inst) << 2;
+           pc = reg + ((pc + 4) & 0xf0000000) + 1;     /* yes, +1 */
            /* Add 1 to indicate 16 bit mode - Invert ISA mode */
          }
-         break ; /* The new PC will be alternate mode */
-       case 4 :     /* BEQ , BEQL */
-         equal_branch :
-          if (read_register(itype_rs(inst)) ==
-              read_register(itype_rt(inst)))
-            pc += mips32_relative_offset(inst) + 4 ;
-          else pc += 8 ;
-          break ;
-       case 5 : /* BNE , BNEL */
-         neq_branch :
-         if (read_register(itype_rs(inst)) != 
-             read_register(itype_rs(inst)))
-           pc += mips32_relative_offset(inst) + 4 ;
-         else pc += 8 ;
-         break ;
-       case 6 : /* BLEZ , BLEZL */
+         break;                /* The new PC will be alternate mode */
+       case 4:         /* BEQ , BEQL */
+       equal_branch:
+         if (read_register (itype_rs (inst)) ==
+             read_register (itype_rt (inst)))
+           pc += mips32_relative_offset (inst) + 4;
+         else
+           pc += 8;
+         break;
+       case 5:         /* BNE , BNEL */
+       neq_branch:
+         if (read_register (itype_rs (inst)) !=
+             read_register (itype_rs (inst)))
+           pc += mips32_relative_offset (inst) + 4;
+         else
+           pc += 8;
+         break;
+       case 6:         /* BLEZ , BLEZL */
        less_zero_branch:
-         if (read_register(itype_rs(inst) <= 0))
-            pc += mips32_relative_offset(inst) + 4 ;
-         else pc += 8 ;
-         break ;
-       case 7 :
-       greater_branch :   /* BGTZ BGTZL */
-         if (read_register(itype_rs(inst) > 0))
-           pc += mips32_relative_offset(inst) + 4 ;
-         else pc += 8 ;
-       break ;
-       default : pc += 8 ;
-       } /* switch */
-    }  /* else */
-  return pc ;
-} /* mips32_next_pc */
+         if (read_register (itype_rs (inst) <= 0))
+           pc += mips32_relative_offset (inst) + 4;
+         else
+           pc += 8;
+         break;
+       case 7:
+       greater_branch: /* BGTZ BGTZL */
+         if (read_register (itype_rs (inst) > 0))
+           pc += mips32_relative_offset (inst) + 4;
+         else
+           pc += 8;
+         break;
+       default:
+         pc += 8;
+       }                       /* switch */
+    }                          /* else */
+  return pc;
+}                              /* mips32_next_pc */
 
 /* Decoding the next place to set a breakpoint is irregular for the
    mips 16 variant, but fortunatly, there fewer instructions. We have to cope
    ith extensions for 16 bit instructions and a pair of actual 32 bit instructions.
    We dont want to set a single step instruction on the extend instruction
    either.
  */
+ */
 
 /* Lots of mips16 instruction formats */
 /* Predicting jumps requires itype,ritype,i8type
    and their extensions      extItype,extritype,extI8type
  */
+ */
 enum mips16_inst_fmts
 {
-  itype,          /* 0  immediate 5,10 */
-  ritype,         /* 1   5,3,8 */
-  rrtype,         /* 2   5,3,3,5 */
-  rritype,        /* 3   5,3,3,5 */
-  rrrtype,        /* 4   5,3,3,3,2 */ 
-  rriatype,       /* 5   5,3,3,1,4 */ 
-  shifttype,      /* 6   5,3,3,3,2 */
-  i8type,         /* 7   5,3,8 */
-  i8movtype,      /* 8   5,3,3,5 */
-  i8mov32rtype,   /* 9   5,3,5,3 */
-  i64type,        /* 10  5,3,8 */
-  ri64type,       /* 11  5,3,3,5 */
-  jalxtype,       /* 12  5,1,5,5,16 - a 32 bit instruction */
-  exiItype,       /* 13  5,6,5,5,1,1,1,1,1,1,5 */
-  extRitype,      /* 14  5,6,5,5,3,1,1,1,5 */
-  extRRItype,     /* 15  5,5,5,5,3,3,5 */
-  extRRIAtype,    /* 16  5,7,4,5,3,3,1,4 */
-  EXTshifttype,   /* 17  5,5,1,1,1,1,1,1,5,3,3,1,1,1,2 */
-  extI8type,      /* 18  5,6,5,5,3,1,1,1,5 */
-  extI64type,     /* 19  5,6,5,5,3,1,1,1,5 */
-  extRi64type,    /* 20  5,6,5,5,3,3,5 */
-  extshift64type  /* 21  5,5,1,1,1,1,1,1,5,1,1,1,3,5 */
-} ;
+  itype,                       /* 0  immediate 5,10 */
+  ritype,                      /* 1   5,3,8 */
+  rrtype,                      /* 2   5,3,3,5 */
+  rritype,                     /* 3   5,3,3,5 */
+  rrrtype,                     /* 4   5,3,3,3,2 */
+  rriatype,                    /* 5   5,3,3,1,4 */
+  shifttype,                   /* 6   5,3,3,3,2 */
+  i8type,                      /* 7   5,3,8 */
+  i8movtype,                   /* 8   5,3,3,5 */
+  i8mov32rtype,                        /* 9   5,3,5,3 */
+  i64type,                     /* 10  5,3,8 */
+  ri64type,                    /* 11  5,3,3,5 */
+  jalxtype,                    /* 12  5,1,5,5,16 - a 32 bit instruction */
+  exiItype,                    /* 13  5,6,5,5,1,1,1,1,1,1,5 */
+  extRitype,                   /* 14  5,6,5,5,3,1,1,1,5 */
+  extRRItype,                  /* 15  5,5,5,5,3,3,5 */
+  extRRIAtype,                 /* 16  5,7,4,5,3,3,1,4 */
+  EXTshifttype,                        /* 17  5,5,1,1,1,1,1,1,5,3,3,1,1,1,2 */
+  extI8type,                   /* 18  5,6,5,5,3,1,1,1,5 */
+  extI64type,                  /* 19  5,6,5,5,3,1,1,1,5 */
+  extRi64type,                 /* 20  5,6,5,5,3,3,5 */
+  extshift64type               /* 21  5,5,1,1,1,1,1,1,5,1,1,1,3,5 */
+};
 /* I am heaping all the fields of the formats into one structure and then,
    only the fields which are involved in instruction extension */
 struct upk_mips16
-{
-  unsigned short inst ;
-  enum mips16_inst_fmts fmt ;
-  unsigned long offset ;
-  unsigned int regx ; /* Function in i8 type */
-  unsigned int regy ;
-;
+  {
+    unsigned short inst;
+    enum mips16_inst_fmts fmt;
+    unsigned long offset;
+    unsigned int regx;         /* Function in i8 type */
+    unsigned int regy;
+  };
 
 
 
-static void print_unpack(char * comment,
-                        struct upk_mips16 * u)
+static void
+print_unpack (char *comment,
+             struct upk_mips16 *u)
 {
-  printf("%s %04x ,f(%d) off(%08x) (x(%x) y(%x)\n",
-        comment,u->inst,u->fmt,u->offset,u->regx,u->regy) ;
+  printf ("%s %04x ,f(%d) off(%08x) (x(%x) y(%x)\n",
+         comment, u->inst, u->fmt, u->offset, u->regx, u->regy);
 }
 
 /* The EXT-I, EXT-ri nad EXT-I8 instructions all have the same
    format for the bits which make up the immediatate extension.
  */
+ */
 static unsigned long
-extended_offset(unsigned long extension)
+extended_offset (unsigned long extension)
 {
-  unsigned long value  ;
-  value = (extension >> 21) & 0x3f ; /* * extract 15:11 */
-  value = value << 6 ;
-  value |= (extension >> 16) & 0x1f ; /* extrace 10:5 */
-  value = value << 5 ;
-  value |= extension & 0x01f ;         /* extract 4:0 */
-  return value ;
+  unsigned long value;
+  value = (extension >> 21) & 0x3f;    /* * extract 15:11 */
+  value = value << 6;
+  value |= (extension >> 16) & 0x1f;   /* extrace 10:5 */
+  value = value << 5;
+  value |= extension & 0x01f;  /* extract 4:0 */
+  return value;
 }
 
 /* Only call this function if you know that this is an extendable
    instruction, It wont malfunction, but why make excess remote memory references?
    If the immediate operands get sign extended or somthing, do it after
    the extension is performed.
  */
+ */
 /* FIXME: Every one of these cases needs to worry about sign extension
    when the offset is to be used in relative addressing */
 
 
-static unsigned short fetch_mips_16(CORE_ADDR pc)
+static unsigned short
+fetch_mips_16 (CORE_ADDR pc)
 {
-  char buf[8] ;
-  pc &= 0xfffffffe ; /* clear the low order bit */
-  target_read_memory(pc,buf,2) ;
-  return extract_unsigned_integer(buf,2) ;
+  char buf[8];
+  pc &= 0xfffffffe;            /* clear the low order bit */
+  target_read_memory (pc, buf, 2);
+  return extract_unsigned_integer (buf, 2);
 }
 
 static void
-unpack_mips16(CORE_ADDR pc,
-                 struct upk_mips16 * upk)
+unpack_mips16 (CORE_ADDR pc,
+              struct upk_mips16 *upk)
 {
-  CORE_ADDR extpc ;
-  unsigned long extension ;
-  int extended ;
-  extpc = (pc - 4) & ~0x01 ; /* Extensions are 32 bit instructions */
+  CORE_ADDR extpc;
+  unsigned long extension;
+  int extended;
+  extpc = (pc - 4) & ~0x01;    /* Extensions are 32 bit instructions */
   /* Decrement to previous address and loose the 16bit mode flag */
   /* return if the instruction was extendable, but not actually extended */
-  extended = ((mips32_op(extension) == 30) ? 1 : 0) ;
-  if (extended) { extension = mips_fetch_instruction(extpc) ;}
+  extended = ((mips32_op (extension) == 30) ? 1 : 0);
+  if (extended)
+    {
+      extension = mips_fetch_instruction (extpc);
+    }
   switch (upk->fmt)
     {
-    case itype :
+    case itype:
       {
-       unsigned long value  ;
+       unsigned long value;
        if (extended)
-         { value = extended_offset(extension) ;
-         value = value << 11 ;            /* rom for the original value */
-         value |= upk->inst & 0x7ff ;    /* eleven bits from instruction */
+         {
+           value = extended_offset (extension);
+           value = value << 11;        /* rom for the original value */
+           value |= upk->inst & 0x7ff;         /* eleven bits from instruction */
          }
        else
-         { value = upk->inst & 0x7ff ;
-         /* FIXME : Consider sign extension */
+         {
+           value = upk->inst & 0x7ff;
+           /* FIXME : Consider sign extension */
          }
-       upk->offset = value ;
+       upk->offset = value;
       }
-      break ;
-    case ritype :
-    case i8type :
-      { /* A register identifier and an offset */
+      break;
+    case ritype:
+    case i8type:
+      {                                /* A register identifier and an offset */
        /* Most of the fields are the same as I type but the
           immediate value is of a different length */
-       unsigned long value  ;
+       unsigned long value;
        if (extended)
          {
-           value = extended_offset(extension) ;
-           value = value << 8  ;          /* from the original instruction */
-           value |= upk->inst & 0xff ;    /* eleven bits from instruction */
-           upk->regx = (extension >> 8) & 0x07 ; /* or i8 funct */
-           if (value & 0x4000) /* test the sign bit , bit 26 */
-             { value &= ~ 0x3fff ; /* remove the sign bit */
-               value = -value ;
+           value = extended_offset (extension);
+           value = value << 8; /* from the original instruction */
+           value |= upk->inst & 0xff;  /* eleven bits from instruction */
+           upk->regx = (extension >> 8) & 0x07;        /* or i8 funct */
+           if (value & 0x4000) /* test the sign bit , bit 26 */
+             {
+               value &= ~0x3fff;       /* remove the sign bit */
+               value = -value;
              }
          }
-       else {
-         value = upk->inst & 0xff ;  /* 8 bits */
-         upk->regx = (upk->inst >> 8) & 0x07 ; /* or i8 funct */
-         /* FIXME: Do sign extension , this format needs it */
-         if (value & 0x80)   /* THIS CONFUSES ME */
-           { value &= 0xef ; /* remove the sign bit */
-             value = -value ;
-           }
-         
-       }
-       upk->offset = value ;
-       break ;
+       else
+         {
+           value = upk->inst & 0xff;   /* 8 bits */
+           upk->regx = (upk->inst >> 8) & 0x07;        /* or i8 funct */
+           /* FIXME: Do sign extension , this format needs it */
+           if (value & 0x80)   /* THIS CONFUSES ME */
+             {
+               value &= 0xef;  /* remove the sign bit */
+               value = -value;
+             }
+
+         }
+       upk->offset = value;
+       break;
       }
-    case jalxtype :
+    case jalxtype:
       {
-       unsigned long value ;
-       unsigned short nexthalf ;
-       value = ((upk->inst & 0x1f)  << 5) | ((upk->inst >> 5) & 0x1f) ;
-       value = value << 16 ;
-       nexthalf = mips_fetch_instruction(pc+2) ; /* low bit still set */
-       value |= nexthalf ;
-       upk->offset = value ;
-       break ;
+       unsigned long value;
+       unsigned short nexthalf;
+       value = ((upk->inst & 0x1f) << 5) | ((upk->inst >> 5) & 0x1f);
+       value = value << 16;
+       nexthalf = mips_fetch_instruction (pc + 2);     /* low bit still set */
+       value |= nexthalf;
+       upk->offset = value;
+       break;
       }
     default:
-      printf_filtered("Decoding unimplemented instruction format type\n") ;
-      break ;
+      printf_filtered ("Decoding unimplemented instruction format type\n");
+      break;
     }
   /* print_unpack("UPK",upk) ; */
 }
@@ -723,130 +757,150 @@ unpack_mips16(CORE_ADDR pc,
 
 /* This is a map of the opcodes which ae known to perform branches */
 static unsigned char map16[32] =
-{ 0,0,1,1,1,1,0,0,
 0,0,0,0,1,0,0,0,
 0,0,0,0,0,0,0,0,
 0,0,0,0,0,1,1,0
-} ;
+{0, 0, 1, 1, 1, 1, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0
+};
 
-static CORE_ADDR add_offset_16(CORE_ADDR pc, int offset)
+static CORE_ADDR
+add_offset_16 (CORE_ADDR pc, int offset)
 {
-  return ((offset << 2) | ((pc + 2) & (0xf0000000))) ;
-  
+  return ((offset << 2) | ((pc + 2) & (0xf0000000)));
+
 }
 
 
 
-static struct upk_mips16 upk ;
+static struct upk_mips16 upk;
 
-CORE_ADDR mips16_next_pc(CORE_ADDR pc)
+CORE_ADDR
+mips16_next_pc (CORE_ADDR pc)
 {
-  int op ;
-  t_inst inst ;
+  int op;
+  t_inst inst;
   /* inst = mips_fetch_instruction(pc) ; - This doesnt always work */
-  inst = fetch_mips_16(pc) ;
-  upk.inst = inst ;
-  op = mips16_op(upk.inst) ;
+  inst = fetch_mips_16 (pc);
+  upk.inst = inst;
+  op = mips16_op (upk.inst);
   if (map16[op])
     {
-      int reg ;
+      int reg;
       switch (op)
        {
-       case 2 : /* Branch */
-         upk.fmt = itype ;
-         unpack_mips16(pc,&upk) ;
-         { long offset ;
-           offset = upk.offset ;
+       case 2:         /* Branch */
+         upk.fmt = itype;
+         unpack_mips16 (pc, &upk);
+         {
+           long offset;
+           offset = upk.offset;
            if (offset & 0x800)
-             { offset &= 0xeff ;
-               offset = - offset ;
+             {
+               offset &= 0xeff;
+               offset = -offset;
              }
-           pc += (offset << 1) + 2 ;
+           pc += (offset << 1) + 2;
          }
-         break ;
-       case 3 : /* JAL , JALX - Watch out, these are 32 bit instruction*/
-          upk.fmt = jalxtype ;
-          unpack_mips16(pc,&upk) ;
-          pc = add_offset_16(pc,upk.offset) ;
-          if ((upk.inst >> 10) & 0x01) /* Exchange mode */
-            pc = pc & ~ 0x01 ; /* Clear low bit, indicate 32 bit mode */
-          else pc |= 0x01 ;
-         break ;
-       case 4 : /* beqz */
-           upk.fmt = ritype ;
-           unpack_mips16(pc,&upk) ;
-           reg = read_register(upk.regx) ;
-           if (reg == 0) 
-               pc += (upk.offset << 1) + 2 ;
-           else pc += 2 ;
-         break ;
-       case 5 : /* bnez */
-           upk.fmt = ritype ;
-           unpack_mips16(pc,&upk) ;
-           reg = read_register(upk.regx) ;
-           if (reg != 0)
-              pc += (upk.offset << 1) + 2 ;
-           else pc += 2 ;
-         break ;
-       case 12 : /* I8 Formats btez btnez */
-           upk.fmt = i8type ;
-           unpack_mips16(pc,&upk) ;
-           /* upk.regx contains the opcode */
-           reg = read_register(24) ; /* Test register is 24 */
-           if (((upk.regx == 0) && (reg == 0))        /* BTEZ */
-               || ((upk.regx == 1 ) && (reg != 0))) /* BTNEZ */
-             /* pc = add_offset_16(pc,upk.offset) ; */
-             pc += (upk.offset << 1) + 2 ; 
-           else pc += 2 ;
-         break ;
-       case 29 : /* RR Formats JR, JALR, JALR-RA */
-         upk.fmt = rrtype ;
-         op = upk.inst & 0x1f ;
+         break;
+       case 3:         /* JAL , JALX - Watch out, these are 32 bit instruction */
+         upk.fmt = jalxtype;
+         unpack_mips16 (pc, &upk);
+         pc = add_offset_16 (pc, upk.offset);
+         if ((upk.inst >> 10) & 0x01)  /* Exchange mode */
+           pc = pc & ~0x01;    /* Clear low bit, indicate 32 bit mode */
+         else
+           pc |= 0x01;
+         break;
+       case 4:         /* beqz */
+         upk.fmt = ritype;
+         unpack_mips16 (pc, &upk);
+         reg = read_register (upk.regx);
+         if (reg == 0)
+           pc += (upk.offset << 1) + 2;
+         else
+           pc += 2;
+         break;
+       case 5:         /* bnez */
+         upk.fmt = ritype;
+         unpack_mips16 (pc, &upk);
+         reg = read_register (upk.regx);
+         if (reg != 0)
+           pc += (upk.offset << 1) + 2;
+         else
+           pc += 2;
+         break;
+       case 12:                /* I8 Formats btez btnez */
+         upk.fmt = i8type;
+         unpack_mips16 (pc, &upk);
+         /* upk.regx contains the opcode */
+         reg = read_register (24);     /* Test register is 24 */
+         if (((upk.regx == 0) && (reg == 0))   /* BTEZ */
+             || ((upk.regx == 1) && (reg != 0)))       /* BTNEZ */
+           /* pc = add_offset_16(pc,upk.offset) ; */
+           pc += (upk.offset << 1) + 2;
+         else
+           pc += 2;
+         break;
+       case 29:                /* RR Formats JR, JALR, JALR-RA */
+         upk.fmt = rrtype;
+         op = upk.inst & 0x1f;
          if (op == 0)
-           { 
-             upk.regx = (upk.inst >> 8) & 0x07 ;
-             upk.regy = (upk.inst >> 5) & 0x07 ;
+           {
+             upk.regx = (upk.inst >> 8) & 0x07;
+             upk.regy = (upk.inst >> 5) & 0x07;
              switch (upk.regy)
                {
-               case 0 : reg = upk.regx ;   break ;
-               case 1 :   reg = 31 ;       break ; /* Function return instruction*/
-               case 2 :   reg = upk.regx ; break ;
-               default:   reg = 31 ; break ; /* BOGUS Guess */
+               case 0:
+                 reg = upk.regx;
+                 break;
+               case 1:
+                 reg = 31;
+                 break;        /* Function return instruction */
+               case 2:
+                 reg = upk.regx;
+                 break;
+               default:
+                 reg = 31;
+                 break;        /* BOGUS Guess */
                }
-             pc = read_register(reg) ;
+             pc = read_register (reg);
            }
-         else pc += 2 ;
-         break ;
-       case 30 : /* This is an extend instruction */
-         pc += 4 ; /* Dont be setting breakpints on the second half */
-         break ;
-       default :
-         printf("Filtered - next PC probably incorrrect due to jump inst\n");
-         pc += 2 ;
-         break ;
+         else
+           pc += 2;
+         break;
+       case 30:                /* This is an extend instruction */
+         pc += 4;              /* Dont be setting breakpints on the second half */
+         break;
+       default:
+         printf ("Filtered - next PC probably incorrrect due to jump inst\n");
+         pc += 2;
+         break;
        }
     }
-  else pc+= 2 ; /* just a good old instruction */
+  else
+    pc += 2;                   /* just a good old instruction */
   /* See if we CAN actually break on the next instruction */
   /* printf("NXTm16PC %08x\n",(unsigned long)pc) ; */
-  return pc ;
-} /* mips16_next_pc */
+  return pc;
+}                              /* mips16_next_pc */
 
 /* The mips_next_pc function supports single_tep when the remote target monitor or
    stub is not developed enough to so a single_step.
    It works by decoding the current instruction and predicting where a branch
    will go. This isnt hard because all the data is available.
    The MIPS32 and MIPS16 variants are quite different
-   */
-CORE_ADDR mips_next_pc(CORE_ADDR pc)
+ */
+CORE_ADDR
+mips_next_pc (CORE_ADDR pc)
 {
-  t_inst inst ;
+  t_inst inst;
   /* inst = mips_fetch_instruction(pc) ; */
   /* if (pc_is_mips16) <----- This is failing */
-  if (pc & 0x01) 
-    return mips16_next_pc(pc) ;
-  else return mips32_next_pc(pc) ;
-} /* mips_next_pc */
+  if (pc & 0x01)
+    return mips16_next_pc (pc);
+  else
+    return mips32_next_pc (pc);
+}                              /* mips_next_pc */
 
 /* Guaranteed to set fci->saved_regs to some values (it never leaves it
    NULL).  */
@@ -888,15 +942,15 @@ mips_find_saved_regs (fci)
     {
       for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
        {
-         reg_position = fci->frame + SIGFRAME_REGSAVE_OFF
-                        + ireg * SIGFRAME_REG_SIZE;
-         fci->saved_regs[ireg] = reg_position;
+         reg_position = fci->frame + SIGFRAME_REGSAVE_OFF
+           + ireg * SIGFRAME_REG_SIZE;
+         fci->saved_regs[ireg] = reg_position;
        }
       for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
        {
-         reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF
-                        + ireg * SIGFRAME_REG_SIZE;
-         fci->saved_regs[FP0_REGNUM + ireg] = reg_position;
+         reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF
+           + ireg * SIGFRAME_REG_SIZE;
+         fci->saved_regs[FP0_REGNUM + ireg] = reg_position;
        }
       fci->saved_regs[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF;
       return;
@@ -909,32 +963,32 @@ mips_find_saved_regs (fci)
        and set the saved_regs right away.  */
     return;
 
-  kernel_trap = PROC_REG_MASK(proc_desc) & 1;
-  gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK(proc_desc);
-  float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK(proc_desc);
+  kernel_trap = PROC_REG_MASK (proc_desc) & 1;
+  gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc);
+  float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc);
 
-  if (/* In any frame other than the innermost or a frame interrupted by
-        a signal, we assume that all registers have been saved.
-        This assumes that all register saves in a function happen before
-        the first function call.  */
-      (fci->next == NULL || fci->next->signal_handler_caller)
+  if (                         /* In any frame other than the innermost or a frame interrupted by
+                                  a signal, we assume that all registers have been saved.
+                                  This assumes that all register saves in a function happen before
+                                  the first function call.  */
+       (fci->next == NULL || fci->next->signal_handler_caller)
 
-      /* In a dummy frame we know exactly where things are saved.  */
-      && !PROC_DESC_IS_DUMMY (proc_desc)
+  /* In a dummy frame we know exactly where things are saved.  */
+       && !PROC_DESC_IS_DUMMY (proc_desc)
 
-      /* Don't bother unless we are inside a function prologue.  Outside the
-        prologue, we know where everything is. */
+  /* Don't bother unless we are inside a function prologue.  Outside the
+     prologue, we know where everything is. */
 
-      && in_prologue (fci->pc, PROC_LOW_ADDR (proc_desc))
+       && in_prologue (fci->pc, PROC_LOW_ADDR (proc_desc))
 
-      /* Not sure exactly what kernel_trap means, but if it means
-        the kernel saves the registers without a prologue doing it,
-        we better not examine the prologue to see whether registers
-        have been saved yet.  */
-      && !kernel_trap)
+  /* Not sure exactly what kernel_trap means, but if it means
+     the kernel saves the registers without a prologue doing it,
+     we better not examine the prologue to see whether registers
+     have been saved yet.  */
+       && !kernel_trap)
     {
       /* We need to figure out whether the registers that the proc_desc
-        claims are saved have been saved yet.  */
+         claims are saved have been saved yet.  */
 
       CORE_ADDR addr;
 
@@ -965,7 +1019,7 @@ mips_find_saved_regs (fci)
   /* Fill in the offsets for the registers which gen_mask says
      were saved.  */
   reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
-  for (ireg= MIPS_NUMREGS-1; gen_mask; --ireg, gen_mask <<= 1)
+  for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
     if (gen_mask & 0x80000000)
       {
        fci->saved_regs[ireg] = reg_position;
@@ -979,18 +1033,18 @@ mips_find_saved_regs (fci)
   if (pc_is_mips16 (PROC_LOW_ADDR (proc_desc)))
     {
       inst = mips_fetch_instruction (PROC_LOW_ADDR (proc_desc));
-      if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */
+      if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)                /* entry */
        {
          int reg;
          int sreg_count = (inst >> 6) & 3;
-         
+
          /* Check if the ra register was pushed on the stack.  */
          reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
          if (inst & 0x20)
            reg_position -= MIPS_SAVED_REGSIZE;
 
          /* Check if the s0 and s1 registers were pushed on the stack.  */
-         for (reg = 16; reg < sreg_count+16; reg++)
+         for (reg = 16; reg < sreg_count + 16; reg++)
            {
              fci->saved_regs[reg] = reg_position;
              reg_position -= MIPS_SAVED_REGSIZE;
@@ -1004,15 +1058,15 @@ mips_find_saved_regs (fci)
 
   /* The freg_offset points to where the first *double* register
      is saved.  So skip to the high-order word. */
-  if (! GDB_TARGET_IS_MIPS64)
+  if (!GDB_TARGET_IS_MIPS64)
     reg_position += MIPS_SAVED_REGSIZE;
 
   /* Fill in the offsets for the float registers which float_mask says
      were saved.  */
-  for (ireg = MIPS_NUMREGS-1; float_mask; --ireg, float_mask <<= 1)
+  for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1)
     if (float_mask & 0x80000000)
       {
-       fci->saved_regs[FP0_REGNUM+ireg] = reg_position;
+       fci->saved_regs[FP0_REGNUM + ireg] = reg_position;
        reg_position -= MIPS_SAVED_REGSIZE;
       }
 
@@ -1020,14 +1074,14 @@ mips_find_saved_regs (fci)
 }
 
 static CORE_ADDR
-read_next_frame_reg(fi, regno)
+read_next_frame_reg (fi, regno)
      struct frame_info *fi;
      int regno;
 {
   for (; fi; fi = fi->next)
     {
       /* We have to get the saved sp from the sigcontext
-        if it is a signal handler frame.  */
+         if it is a signal handler frame.  */
       if (regno == SP_REGNUM && !fi->signal_handler_caller)
        return fi->frame;
       else
@@ -1035,7 +1089,7 @@ read_next_frame_reg(fi, regno)
          if (fi->saved_regs == NULL)
            mips_find_saved_regs (fi);
          if (fi->saved_regs[regno])
-           return read_memory_integer(fi->saved_regs[regno], MIPS_SAVED_REGSIZE);
+           return read_memory_integer (fi->saved_regs[regno], MIPS_SAVED_REGSIZE);
        }
     }
   return read_register (regno);
@@ -1045,31 +1099,31 @@ read_next_frame_reg(fi, regno)
 
 CORE_ADDR
 mips_addr_bits_remove (addr)
-    CORE_ADDR addr;
+     CORE_ADDR addr;
 {
 #if GDB_TARGET_IS_MIPS64
-  if (mask_address_p && (addr >> 32 == (CORE_ADDR)0xffffffff))
+  if (mask_address_p && (addr >> 32 == (CORE_ADDR) 0xffffffff))
     {
       /* This hack is a work-around for existing boards using PMON,
-        the simulator, and any other 64-bit targets that doesn't have
-        true 64-bit addressing.  On these targets, the upper 32 bits
-        of addresses are ignored by the hardware.  Thus, the PC or SP
-        are likely to have been sign extended to all 1s by instruction
-        sequences that load 32-bit addresses.  For example, a typical
-        piece of code that loads an address is this:
-               lui $r2, <upper 16 bits>
-               ori $r2, <lower 16 bits>
-        But the lui sign-extends the value such that the upper 32 bits
-        may be all 1s.  The workaround is simply to mask off these bits.
-        In the future, gcc may be changed to support true 64-bit
-        addressing, and this masking will have to be disabled.  */
-        addr &= (CORE_ADDR)0xffffffff;
+         the simulator, and any other 64-bit targets that doesn't have
+         true 64-bit addressing.  On these targets, the upper 32 bits
+         of addresses are ignored by the hardware.  Thus, the PC or SP
+         are likely to have been sign extended to all 1s by instruction
+         sequences that load 32-bit addresses.  For example, a typical
+         piece of code that loads an address is this:
+         lui $r2, <upper 16 bits>
+         ori $r2, <lower 16 bits>
+         But the lui sign-extends the value such that the upper 32 bits
+         may be all 1s.  The workaround is simply to mask off these bits.
+         In the future, gcc may be changed to support true 64-bit
+         addressing, and this masking will have to be disabled.  */
+      addr &= (CORE_ADDR) 0xffffffff;
     }
 #else
   /* Even when GDB is configured for some 32-bit targets (e.g. mips-elf),
      BFD is configured to handle 64-bit targets, so CORE_ADDR is 64 bits.
      So we still have to mask off useless bits from addresses.  */
-  addr &= (CORE_ADDR)0xffffffff;
+  addr &= (CORE_ADDR) 0xffffffff;
 #endif
 
   return addr;
@@ -1083,14 +1137,14 @@ mips_init_frame_pc_first (fromleaf, prev)
   CORE_ADDR pc, tmp;
 
   pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) :
-        prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
+       prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
   tmp = mips_skip_stub (pc);
-  prev->pc =  tmp ? tmp : pc;
+  prev->pc = tmp ? tmp : pc;
 }
 
 
 CORE_ADDR
-mips_frame_saved_pc(frame)
+mips_frame_saved_pc (frame)
      struct frame_info *frame;
 {
   CORE_ADDR saved_pc;
@@ -1098,9 +1152,9 @@ mips_frame_saved_pc(frame)
   /* We have to get the saved pc from the sigcontext
      if it is a signal handler frame.  */
   int pcreg = frame->signal_handler_caller ? PC_REGNUM
-             : (proc_desc ? PROC_PC_REG(proc_desc) : RA_REGNUM);
+  : (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
 
-  if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc))
+  if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
     saved_pc = read_memory_integer (frame->frame - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
   else
     saved_pc = read_next_frame_reg (frame, pcreg);
@@ -1129,7 +1183,7 @@ set_reg_offset (regno, offset)
 /* Test whether the PC points to the return instruction at the
    end of a function. */
 
-static int 
+static int
 mips_about_to_return (pc)
      CORE_ADDR pc;
 {
@@ -1152,48 +1206,49 @@ mips_about_to_return (pc)
 
 static CORE_ADDR
 heuristic_proc_start (pc)
-    CORE_ADDR pc;
+     CORE_ADDR pc;
 {
-    CORE_ADDR start_pc;
-    CORE_ADDR fence;
-    int instlen;
-    int seen_adjsp = 0;
+  CORE_ADDR start_pc;
+  CORE_ADDR fence;
+  int instlen;
+  int seen_adjsp = 0;
 
-    pc = ADDR_BITS_REMOVE (pc);
-    start_pc = pc;
-    fence = start_pc - heuristic_fence_post;
-    if (start_pc == 0) return 0;
+  pc = ADDR_BITS_REMOVE (pc);
+  start_pc = pc;
+  fence = start_pc - heuristic_fence_post;
+  if (start_pc == 0)
+    return 0;
 
-    if (heuristic_fence_post == UINT_MAX
-       || fence < VM_MIN_ADDRESS)
-      fence = VM_MIN_ADDRESS;
+  if (heuristic_fence_post == UINT_MAX
+      || fence < VM_MIN_ADDRESS)
+    fence = VM_MIN_ADDRESS;
 
-    instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN;
+  instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN;
 
-    /* search back for previous return */
-    for (start_pc -= instlen; ; start_pc -= instlen)
-       if (start_pc < fence)
+  /* search back for previous return */
+  for (start_pc -= instlen;; start_pc -= instlen)
+    if (start_pc < fence)
+      {
+       /* It's not clear to me why we reach this point when
+          stop_soon_quietly, but with this test, at least we
+          don't print out warnings for every child forked (eg, on
+          decstation).  22apr93 rich@cygnus.com.  */
+       if (!stop_soon_quietly)
          {
-           /* It's not clear to me why we reach this point when
-              stop_soon_quietly, but with this test, at least we
-              don't print out warnings for every child forked (eg, on
-              decstation).  22apr93 rich@cygnus.com.  */
-           if (!stop_soon_quietly)
+           static int blurb_printed = 0;
+
+           warning ("Warning: GDB can't find the start of the function at 0x%s.",
+                    paddr_nz (pc));
+
+           if (!blurb_printed)
              {
-               static int blurb_printed = 0;
-
-               warning ("Warning: GDB can't find the start of the function at 0x%s.", 
-                        paddr_nz (pc));
-               
-               if (!blurb_printed)
-                 {
-                   /* This actually happens frequently in embedded
-                      development, when you first connect to a board
-                      and your stack pointer and pc are nowhere in
-                      particular.  This message needs to give people
-                      in that situation enough information to
-                      determine that it's no big deal.  */
-                   printf_filtered ("\n\
+               /* This actually happens frequently in embedded
+                  development, when you first connect to a board
+                  and your stack pointer and pc are nowhere in
+                  particular.  This message needs to give people
+                  in that situation enough information to
+                  determine that it's no big deal.  */
+               printf_filtered ("\n\
     GDB is unable to find the start of the function at 0x%s\n\
 and thus can't determine the size of that function's stack frame.\n\
 This means that GDB may be unable to access that stack frame, or\n\
@@ -1204,47 +1259,47 @@ stack pointer.\n\
 from 0x%s for code which looks like the beginning of a\n\
 function, you can increase the range of the search using the `set\n\
 heuristic-fence-post' command.\n",
-                                    paddr_nz (pc), paddr_nz (pc));
-                   blurb_printed = 1;
-                 }
+                                paddr_nz (pc), paddr_nz (pc));
+               blurb_printed = 1;
              }
-
-           return 0; 
-         }
-       else if (pc_is_mips16 (start_pc))
-         {
-           unsigned short inst;
-
-           /* On MIPS16, any one of the following is likely to be the
-              start of a function:
-                entry
-                addiu sp,-n
-                daddiu sp,-n
-                extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'  */
-           inst = mips_fetch_instruction (start_pc);
-           if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */
-               || (inst & 0xff80) == 0x6380    /* addiu sp,-n */
-               || (inst & 0xff80) == 0xfb80    /* daddiu sp,-n */
-               || ((inst & 0xf810) == 0xf010 && seen_adjsp))   /* extend -n */
-             break;
-           else if ((inst & 0xff00) == 0x6300          /* addiu sp */
-                    || (inst & 0xff00) == 0xfb00)      /* daddiu sp */
-             seen_adjsp = 1;
-           else
-             seen_adjsp = 0;
-         }
-       else if (mips_about_to_return (start_pc))
-         {
-           start_pc += 2 * MIPS_INSTLEN; /* skip return, and its delay slot */
-           break;
          }
 
+       return 0;
+      }
+    else if (pc_is_mips16 (start_pc))
+      {
+       unsigned short inst;
+
+       /* On MIPS16, any one of the following is likely to be the
+          start of a function:
+          entry
+          addiu sp,-n
+          daddiu sp,-n
+          extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'  */
+       inst = mips_fetch_instruction (start_pc);
+       if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)      /* entry */
+           || (inst & 0xff80) == 0x6380        /* addiu sp,-n */
+           || (inst & 0xff80) == 0xfb80        /* daddiu sp,-n */
+           || ((inst & 0xf810) == 0xf010 && seen_adjsp))       /* extend -n */
+         break;
+       else if ((inst & 0xff00) == 0x6300      /* addiu sp */
+                || (inst & 0xff00) == 0xfb00)  /* daddiu sp */
+         seen_adjsp = 1;
+       else
+         seen_adjsp = 0;
+      }
+    else if (mips_about_to_return (start_pc))
+      {
+       start_pc += 2 * MIPS_INSTLEN;   /* skip return, and its delay slot */
+       break;
+      }
+
 #if 0
-    /* skip nops (usually 1) 0 - is this */
-    while (start_pc < pc && read_memory_integer (start_pc, MIPS_INSTLEN) == 0)
-       start_pc += MIPS_INSTLEN;
+  /* skip nops (usually 1) 0 - is this */
+  while (start_pc < pc && read_memory_integer (start_pc, MIPS_INSTLEN) == 0)
+    start_pc += MIPS_INSTLEN;
 #endif
-    return start_pc;
+  return start_pc;
 }
 
 /* Fetch the immediate value from a MIPS16 instruction.
@@ -1254,18 +1309,18 @@ heuristic-fence-post' command.\n",
 
 static int
 mips16_get_imm (prev_inst, inst, nbits, scale, is_signed)
-    unsigned short prev_inst;  /* previous instruction */
-    unsigned short inst;       /* current instruction */
-    int nbits;                 /* number of bits in imm field */
-    int scale;                 /* scale factor to be applied to imm */
-    int is_signed;             /* is the imm field signed? */
+     unsigned short prev_inst; /* previous instruction */
+     unsigned short inst;      /* current instruction */
+     int nbits;                        /* number of bits in imm field */
+     int scale;                        /* scale factor to be applied to imm */
+     int is_signed;            /* is the imm field signed? */
 {
   int offset;
 
   if ((prev_inst & 0xf800) == 0xf000)  /* prev instruction was EXTEND? */
     {
       offset = ((prev_inst & 0x1f) << 11) | (prev_inst & 0x7e0);
-      if (offset & 0x8000)             /* check for negative extend */
+      if (offset & 0x8000)     /* check for negative extend */
        offset = 0 - (0x10000 - (offset & 0xffff));
       return offset | (inst & 0x1f);
     }
@@ -1287,10 +1342,10 @@ mips16_get_imm (prev_inst, inst, nbits, scale, is_signed)
    stream from start_pc to limit_pc.  */
 
 static void
-mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
-    CORE_ADDR start_pc, limit_pc;
-    struct frame_info *next_frame;
-    CORE_ADDR sp;
+mips16_heuristic_proc_desc (start_pc, limit_pc, next_frame, sp)
+     CORE_ADDR start_pc, limit_pc;
+     struct frame_info *next_frame;
+     CORE_ADDR sp;
 {
   CORE_ADDR cur_pc;
   CORE_ADDR frame_addr = 0;    /* Value of $r17, used as frame pointer */
@@ -1299,8 +1354,8 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
   unsigned entry_inst = 0;     /* the entry instruction */
   int reg, offset;
 
-  PROC_FRAME_OFFSET(&temp_proc_desc) = 0;      /* size of stack frame */
-  PROC_FRAME_ADJUST(&temp_proc_desc) = 0;      /* offset of FP from SP */
+  PROC_FRAME_OFFSET (&temp_proc_desc) = 0;     /* size of stack frame */
+  PROC_FRAME_ADJUST (&temp_proc_desc) = 0;     /* offset of FP from SP */
 
   for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS16_INSTLEN)
     {
@@ -1310,12 +1365,12 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
 
       /* Fetch and decode the instruction.   */
       inst = (unsigned short) mips_fetch_instruction (cur_pc);
-      if ((inst & 0xff00) == 0x6300            /* addiu sp */
+      if ((inst & 0xff00) == 0x6300    /* addiu sp */
          || (inst & 0xff00) == 0xfb00)         /* daddiu sp */
        {
          offset = mips16_get_imm (prev_inst, inst, 8, 8, 1);
-         if (offset < 0)                       /* negative stack adjustment? */
-           PROC_FRAME_OFFSET(&temp_proc_desc) -= offset;
+         if (offset < 0)       /* negative stack adjustment? */
+           PROC_FRAME_OFFSET (&temp_proc_desc) -= offset;
          else
            /* Exit loop if a positive stack adjustment is found, which
               usually means that the stack cleanup code in the function
@@ -1326,29 +1381,29 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
        {
          offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
          reg = mips16_to_32_reg[(inst & 0x700) >> 8];
-         PROC_REG_MASK(&temp_proc_desc) |= (1 << reg);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << reg);
          set_reg_offset (reg, sp + offset);
        }
       else if ((inst & 0xff00) == 0xf900)      /* sd reg,n($sp) */
        {
          offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
          reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         PROC_REG_MASK(&temp_proc_desc) |= (1 << reg);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << reg);
          set_reg_offset (reg, sp + offset);
        }
       else if ((inst & 0xff00) == 0x6200)      /* sw $ra,n($sp) */
        {
          offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
-         PROC_REG_MASK(&temp_proc_desc) |= (1 << RA_REGNUM);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM);
          set_reg_offset (RA_REGNUM, sp + offset);
        }
       else if ((inst & 0xff00) == 0xfa00)      /* sd $ra,n($sp) */
        {
          offset = mips16_get_imm (prev_inst, inst, 8, 8, 0);
-         PROC_REG_MASK(&temp_proc_desc) |= (1 << RA_REGNUM);
+         PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM);
          set_reg_offset (RA_REGNUM, sp + offset);
        }
-      else if (inst == 0x673d)                 /* move $s1, $sp */
+      else if (inst == 0x673d) /* move $s1, $sp */
        {
          frame_addr = sp;
          PROC_FRAME_REG (&temp_proc_desc) = 17;
@@ -1364,78 +1419,78 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
        {
          offset = mips16_get_imm (prev_inst, inst, 5, 4, 0);
          reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
          set_reg_offset (reg, frame_addr + offset);
        }
       else if ((inst & 0xFF00) == 0x7900)      /* sd reg,offset($s1) */
        {
          offset = mips16_get_imm (prev_inst, inst, 5, 8, 0);
          reg = mips16_to_32_reg[(inst & 0xe0) >> 5];
-         PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
          set_reg_offset (reg, frame_addr + offset);
        }
-      else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */
-       entry_inst = inst;                      /* save for later processing */
+      else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700)   /* entry */
+       entry_inst = inst;      /* save for later processing */
       else if ((inst & 0xf800) == 0x1800)      /* jal(x) */
-       cur_pc += MIPS16_INSTLEN;               /* 32-bit instruction */
+       cur_pc += MIPS16_INSTLEN;       /* 32-bit instruction */
     }
 
-    /* The entry instruction is typically the first instruction in a function,
-       and it stores registers at offsets relative to the value of the old SP
-       (before the prologue).  But the value of the sp parameter to this
-       function is the new SP (after the prologue has been executed).  So we
-       can't calculate those offsets until we've seen the entire prologue,
-       and can calculate what the old SP must have been. */
-    if (entry_inst != 0)
-      {
-       int areg_count = (entry_inst >> 8) & 7;
-       int sreg_count = (entry_inst >> 6) & 3;
+  /* The entry instruction is typically the first instruction in a function,
+     and it stores registers at offsets relative to the value of the old SP
+     (before the prologue).  But the value of the sp parameter to this
+     function is the new SP (after the prologue has been executed).  So we
+     can't calculate those offsets until we've seen the entire prologue,
+     and can calculate what the old SP must have been. */
+  if (entry_inst != 0)
+    {
+      int areg_count = (entry_inst >> 8) & 7;
+      int sreg_count = (entry_inst >> 6) & 3;
 
-       /* The entry instruction always subtracts 32 from the SP.  */
-       PROC_FRAME_OFFSET(&temp_proc_desc) += 32;
+      /* The entry instruction always subtracts 32 from the SP.  */
+      PROC_FRAME_OFFSET (&temp_proc_desc) += 32;
 
-       /* Now we can calculate what the SP must have been at the
-          start of the function prologue.  */
-       sp += PROC_FRAME_OFFSET(&temp_proc_desc);
+      /* Now we can calculate what the SP must have been at the
+         start of the function prologue.  */
+      sp += PROC_FRAME_OFFSET (&temp_proc_desc);
 
-       /* Check if a0-a3 were saved in the caller's argument save area.  */
-       for (reg = 4, offset = 0; reg < areg_count+4; reg++)
-         {
-           PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
-           set_reg_offset (reg, sp + offset);
-           offset += MIPS_SAVED_REGSIZE;
-         }
+      /* Check if a0-a3 were saved in the caller's argument save area.  */
+      for (reg = 4, offset = 0; reg < areg_count + 4; reg++)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (reg, sp + offset);
+         offset += MIPS_SAVED_REGSIZE;
+       }
 
-       /* Check if the ra register was pushed on the stack.  */
-       offset = -4;
-       if (entry_inst & 0x20)
-         {
-           PROC_REG_MASK(&temp_proc_desc) |= 1 << RA_REGNUM;
-           set_reg_offset (RA_REGNUM, sp + offset);
-           offset -= MIPS_SAVED_REGSIZE;
-         }
+      /* Check if the ra register was pushed on the stack.  */
+      offset = -4;
+      if (entry_inst & 0x20)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM;
+         set_reg_offset (RA_REGNUM, sp + offset);
+         offset -= MIPS_SAVED_REGSIZE;
+       }
 
-       /* Check if the s0 and s1 registers were pushed on the stack.  */
-       for (reg = 16; reg < sreg_count+16; reg++)
-         {
-           PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
-           set_reg_offset (reg, sp + offset);
-           offset -= MIPS_SAVED_REGSIZE;
-         }
-      }
+      /* Check if the s0 and s1 registers were pushed on the stack.  */
+      for (reg = 16; reg < sreg_count + 16; reg++)
+       {
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
+         set_reg_offset (reg, sp + offset);
+         offset -= MIPS_SAVED_REGSIZE;
+       }
+    }
 }
 
 static void
-mips32_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
-    CORE_ADDR start_pc, limit_pc;
-    struct frame_info *next_frame;
-    CORE_ADDR sp;
+mips32_heuristic_proc_desc (start_pc, limit_pc, next_frame, sp)
+     CORE_ADDR start_pc, limit_pc;
+     struct frame_info *next_frame;
+     CORE_ADDR sp;
 {
   CORE_ADDR cur_pc;
-  CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */
+  CORE_ADDR frame_addr = 0;    /* Value of $r30. Used by gcc for frame-pointer */
 restart:
   memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
-  PROC_FRAME_OFFSET(&temp_proc_desc) = 0;
+  PROC_FRAME_OFFSET (&temp_proc_desc) = 0;
   PROC_FRAME_ADJUST (&temp_proc_desc) = 0;     /* offset of FP from SP */
   for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS_INSTLEN)
     {
@@ -1450,12 +1505,12 @@ restart:
       low_word = inst & 0xffff;
       reg = high_word & 0x1f;
 
-      if (high_word == 0x27bd          /* addiu $sp,$sp,-i */
+      if (high_word == 0x27bd  /* addiu $sp,$sp,-i */
          || high_word == 0x23bd        /* addi $sp,$sp,-i */
          || high_word == 0x67bd)       /* daddiu $sp,$sp,-i */
        {
          if (low_word & 0x8000)        /* negative stack adjustment? */
-           PROC_FRAME_OFFSET(&temp_proc_desc) += 0x10000 - low_word;
+           PROC_FRAME_OFFSET (&temp_proc_desc) += 0x10000 - low_word;
          else
            /* Exit loop if a positive stack adjustment is found, which
               usually means that the stack cleanup code in the function
@@ -1464,7 +1519,7 @@ restart:
        }
       else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */
        {
-         PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
          set_reg_offset (reg, sp + low_word);
        }
       else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */
@@ -1472,20 +1527,20 @@ restart:
          /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra,
             but the register size used is only 32 bits. Make the address
             for the saved register point to the lower 32 bits.  */
-         PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
          set_reg_offset (reg, sp + low_word + 8 - MIPS_REGSIZE);
        }
-      else if (high_word == 0x27be)                    /* addiu $30,$sp,size */
+      else if (high_word == 0x27be)    /* addiu $30,$sp,size */
        {
          /* Old gcc frame, r30 is virtual frame pointer.  */
-         if ((long)low_word != PROC_FRAME_OFFSET(&temp_proc_desc))
-             frame_addr = sp + low_word;
+         if ((long) low_word != PROC_FRAME_OFFSET (&temp_proc_desc))
+           frame_addr = sp + low_word;
          else if (PROC_FRAME_REG (&temp_proc_desc) == SP_REGNUM)
            {
              unsigned alloca_adjust;
              PROC_FRAME_REG (&temp_proc_desc) = 30;
-             frame_addr = read_next_frame_reg(next_frame, 30);
-             alloca_adjust = (unsigned)(frame_addr - (sp + low_word));
+             frame_addr = read_next_frame_reg (next_frame, 30);
+             alloca_adjust = (unsigned) (frame_addr - (sp + low_word));
              if (alloca_adjust > 0)
                {
                  /* FP > SP + frame_size. This may be because
@@ -1497,9 +1552,9 @@ restart:
                }
            }
        }
-     /* move $30,$sp.  With different versions of gas this will be either
-       `addu $30,$sp,$zero' or `or $30,$sp,$zero' or `daddu 30,sp,$0'.
-       Accept any one of these.  */
+      /* move $30,$sp.  With different versions of gas this will be either
+         `addu $30,$sp,$zero' or `or $30,$sp,$zero' or `daddu 30,sp,$0'.
+         Accept any one of these.  */
       else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
        {
          /* New gcc frame, virtual frame pointer is at r30 + frame_size.  */
@@ -1507,8 +1562,8 @@ restart:
            {
              unsigned alloca_adjust;
              PROC_FRAME_REG (&temp_proc_desc) = 30;
-             frame_addr = read_next_frame_reg(next_frame, 30);
-             alloca_adjust = (unsigned)(frame_addr - sp);
+             frame_addr = read_next_frame_reg (next_frame, 30);
+             alloca_adjust = (unsigned) (frame_addr - sp);
              if (alloca_adjust > 0)
                {
                  /* FP > SP + frame_size. This may be because
@@ -1520,23 +1575,24 @@ restart:
                }
            }
        }
-      else if ((high_word & 0xFFE0) == 0xafc0)         /* sw reg,offset($30) */
+      else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */
        {
-         PROC_REG_MASK(&temp_proc_desc) |= 1 << reg;
+         PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
          set_reg_offset (reg, frame_addr + low_word);
        }
     }
 }
 
 static mips_extra_func_info_t
-heuristic_proc_desc(start_pc, limit_pc, next_frame)
-    CORE_ADDR start_pc, limit_pc;
-    struct frame_info *next_frame;
+heuristic_proc_desc (start_pc, limit_pc, next_frame)
+     CORE_ADDR start_pc, limit_pc;
+     struct frame_info *next_frame;
 {
   CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
 
-  if (start_pc == 0) return NULL;
-  memset (&temp_proc_desc, '\0', sizeof(temp_proc_desc));
+  if (start_pc == 0)
+    return NULL;
+  memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
   memset (&temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
   PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
   PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
@@ -1558,7 +1614,7 @@ non_heuristic_proc_desc (pc, addrptr)
 {
   CORE_ADDR startaddr;
   mips_extra_func_info_t proc_desc;
-  struct block *b = block_for_pc(pc);
+  struct block *b = block_for_pc (pc);
   struct symbol *sym;
 
   find_pc_partial_function (pc, NULL, &startaddr, NULL);
@@ -1614,20 +1670,20 @@ find_proc_desc (pc, next_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)
            {
              val = find_pc_line (BLOCK_START
-                                 (SYMBOL_BLOCK_VALUE(proc_symbol)),
+                                 (SYMBOL_BLOCK_VALUE (proc_symbol)),
                                  0);
              val.pc = val.end ? val.end : pc;
            }
          if (!proc_symbol || pc < val.pc)
            {
              mips_extra_func_info_t found_heuristic =
-               heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
-                                    pc, next_frame);
+             heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
+                                  pc, next_frame);
              if (found_heuristic)
                proc_desc = found_heuristic;
            }
@@ -1636,15 +1692,15 @@ find_proc_desc (pc, next_frame)
   else
     {
       /* Is linked_proc_desc_table really necessary?  It only seems to be used
-        by procedure call dummys.  However, the procedures being called ought
-        to have their own proc_descs, and even if they don't,
-        heuristic_proc_desc knows how to create them! */
+         by procedure call dummys.  However, the procedures being called ought
+         to have their own proc_descs, and even if they don't,
+         heuristic_proc_desc knows how to create them! */
 
       register struct linked_proc_info *link;
 
       for (link = linked_proc_desc_table; link; link = link->next)
-       if (PROC_LOW_ADDR(&link->info) <= pc
-           && PROC_HIGH_ADDR(&link->info) > pc)
+       if (PROC_LOW_ADDR (&link->info) <= pc
+           && PROC_HIGH_ADDR (&link->info) > pc)
          return &link->info;
 
       if (startaddr == 0)
@@ -1657,24 +1713,24 @@ find_proc_desc (pc, next_frame)
 }
 
 static CORE_ADDR
-get_frame_pointer(frame, proc_desc)
-    struct frame_info *frame;
-    mips_extra_func_info_t proc_desc;
+get_frame_pointer (frame, proc_desc)
+     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));
+                  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;
 
 CORE_ADDR
-mips_frame_chain(frame)
-    struct frame_info *frame;
+mips_frame_chain (frame)
+     struct frame_info *frame;
 {
   mips_extra_func_info_t proc_desc;
   CORE_ADDR tmp;
-  CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
+  CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
 
   if (saved_pc == 0 || inside_entry_file (saved_pc))
     return 0;
@@ -1685,7 +1741,7 @@ mips_frame_chain(frame)
     saved_pc = tmp;
 
   /* Look up the procedure descriptor for this PC.  */
-  proc_desc = find_proc_desc(saved_pc, frame);
+  proc_desc = find_proc_desc (saved_pc, frame);
   if (!proc_desc)
     return 0;
 
@@ -1696,8 +1752,8 @@ mips_frame_chain(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.  */
+  /* The previous frame from a sigtramp frame might be frameless
+     and have frame size zero.  */
       && !frame->signal_handler_caller)
     return 0;
   else
@@ -1705,7 +1761,7 @@ mips_frame_chain(frame)
 }
 
 void
-mips_init_extra_frame_info(fromleaf, fci)
+mips_init_extra_frame_info (fromleaf, fci)
      int fromleaf;
      struct frame_info *fci;
 {
@@ -1713,7 +1769,7 @@ mips_init_extra_frame_info(fromleaf, fci)
 
   /* 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);
+  fci->next ? cached_proc_desc : find_proc_desc (fci->pc, fci->next);
 
   fci->extra_info = (struct frame_extra_info *)
     frame_obstack_alloc (sizeof (struct frame_extra_info));
@@ -1725,8 +1781,8 @@ mips_init_extra_frame_info(fromleaf, fci)
     {
       /* Fixup frame-pointer - only needed for top frame */
       /* This may not be quite right, if proc has a real frame register.
-        Get the value of the frame relative sp, procedure might have been
-        interrupted by a signal at it's very start.  */
+         Get the value of the frame relative sp, procedure might have been
+         interrupted by a signal at it's very start.  */
       if (fci->pc == PROC_LOW_ADDR (proc_desc)
          && !PROC_DESC_IS_DUMMY (proc_desc))
        fci->frame = read_next_frame_reg (fci->next, SP_REGNUM);
@@ -1741,10 +1797,10 @@ mips_init_extra_frame_info(fromleaf, fci)
             mips_find_saved_registers will do that for us.
             We can't use fci->signal_handler_caller, it is not yet set.  */
          find_pc_partial_function (fci->pc, &name,
-                                   (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+                                   (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
          if (!IN_SIGTRAMP (fci->pc, name))
            {
-              frame_saved_regs_zalloc (fci);
+             frame_saved_regs_zalloc (fci);
              memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
              fci->saved_regs[PC_REGNUM]
                = fci->saved_regs[RA_REGNUM];
@@ -1756,12 +1812,12 @@ mips_init_extra_frame_info(fromleaf, fci)
       fci->extra_info->num_args = -1;
       for (regnum = MIPS_LAST_ARG_REGNUM; regnum >= A0_REGNUM; regnum--)
        {
-         if (PROC_REG_MASK(proc_desc) & (1 << regnum))
+         if (PROC_REG_MASK (proc_desc) & (1 << regnum))
            {
              fci->extra_info->num_args = regnum - A0_REGNUM + 1;
              break;
            }
-       } 
+       }
     }
 }
 
@@ -1806,7 +1862,7 @@ setup_arbitrary_frame (argc, argv)
 #endif
 
 CORE_ADDR
-mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
+mips_push_arguments (nargs, args, sp, struct_return, struct_addr)
      int nargs;
      value_ptr *args;
      CORE_ADDR sp;
@@ -1823,7 +1879,7 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
      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.
@@ -1831,12 +1887,12 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
      aligned, so we round to this widest known alignment. */
   sp = ROUND_DOWN (sp, 16);
   struct_addr = ROUND_DOWN (struct_addr, MIPS_SAVED_REGSIZE);
-      
+
   /* 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. */
   for (argnum = 0; argnum < nargs; argnum++)
-    len += ROUND_UP (TYPE_LENGTH(VALUE_TYPE(args[argnum])), MIPS_SAVED_REGSIZE);
+    len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), MIPS_SAVED_REGSIZE);
   sp -= ROUND_UP (len, 16);
 
   /* Initialize the integer and float register pointers.  */
@@ -1845,7 +1901,7 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
 
   /* the struct_return pointer occupies the first parameter-passing reg */
   if (struct_return)
-      write_register (argreg++, 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
@@ -1860,7 +1916,7 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
       enum type_code typecode = TYPE_CODE (arg_type);
 
       /* The EABI passes structures that do not fit in a register by
-        reference. In all other cases, pass the structure by value.  */
+         reference. In all other cases, pass the structure by value.  */
       if (MIPS_EABI && len > MIPS_SAVED_REGSIZE &&
          (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
        {
@@ -1870,23 +1926,23 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
          val = valbuf;
        }
       else
-       val = (char *)VALUE_CONTENTS (arg);
+       val = (char *) VALUE_CONTENTS (arg);
 
       /* 32-bit ABIs always start floating point arguments in an
          even-numbered floating point register.   */
       if (!FP_REGISTER_DOUBLE && typecode == TYPE_CODE_FLT
-          && (float_argreg & 1))
+         && (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 non-EABI processors, 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.  */
+         are passed in register pairs; the even register gets
+         the low word, and the odd register gets the high word.
+         On non-EABI processors, 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 (typecode == TYPE_CODE_FLT
          && float_argreg <= MIPS_LAST_FP_ARG_REGNUM
          && MIPS_FPU_TYPE != MIPS_FPU_NONE)
@@ -1897,16 +1953,16 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
              unsigned long regval;
 
              /* Write the low word of the double to the even register(s).  */
-             regval = extract_unsigned_integer (val+low_offset, 4);
+             regval = extract_unsigned_integer (val + low_offset, 4);
              write_register (float_argreg++, regval);
              if (!MIPS_EABI)
-               write_register (argreg+1, regval);
+               write_register (argreg + 1, regval);
 
              /* Write the high word of the double to the odd register(s).  */
-             regval = extract_unsigned_integer (val+4-low_offset, 4);
+             regval = extract_unsigned_integer (val + 4 - low_offset, 4);
              write_register (float_argreg++, regval);
              if (!MIPS_EABI)
-               {
+               {
                  write_register (argreg, regval);
                  argreg += 2;
                }
@@ -1919,7 +1975,7 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
              CORE_ADDR regval = extract_address (val, len);
              write_register (float_argreg++, regval);
              if (!MIPS_EABI)
-               {
+               {
                  write_register (argreg, regval);
                  argreg += FP_REGISTER_DOUBLE ? 1 : 2;
                }
@@ -1935,7 +1991,7 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
             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) && 
+         int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) &&
                                  (len % MIPS_SAVED_REGSIZE != 0));
          while (len > 0)
            {
@@ -1960,13 +2016,13 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
                               TYPE_LENGTH (arg_type) < STACK_ARGSIZE)
                        longword_offset = STACK_ARGSIZE - len;
                    }
-                 
-                 write_memory (sp + stack_offset + longword_offset, 
+
+                 write_memory (sp + stack_offset + longword_offset,
                                val, partial_len);
                }
 
              /* Note!!! This is NOT an else clause.
-                Odd sized structs may go thru BOTH paths.  */
+                Odd sized structs may go thru BOTH paths.  */
              if (argreg <= MIPS_LAST_ARG_REGNUM)
                {
                  CORE_ADDR regval = extract_address (val, partial_len);
@@ -1989,31 +2045,31 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
                      && partial_len < MIPS_SAVED_REGSIZE
                      && (typecode == TYPE_CODE_STRUCT ||
                          typecode == TYPE_CODE_UNION))
-                   regval <<= ((MIPS_SAVED_REGSIZE - partial_len) * 
+                   regval <<= ((MIPS_SAVED_REGSIZE - partial_len) *
                                TARGET_CHAR_BIT);
 
                  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;
                }
-    
+
              len -= partial_len;
              val += partial_len;
 
              /* The offset onto the stack at which we will start
-                copying parameters (after the registers are used up) 
-                begins at (4 * MIPS_REGSIZE) in the old ABI.  This 
-                leaves room for the "home" area for register parameters.
+                copying parameters (after the registers are used up) 
+                begins at (4 * MIPS_REGSIZE) in the old ABI.  This 
+                leaves room for the "home" area for register parameters.
 
-                In the new EABI (and the NABI32), the 8 register parameters 
-                do not have "home" stack space reserved for them, so the
-                stack offset does not get incremented until after
-                we have used up the 8 parameter registers.  */
+                In the new EABI (and the NABI32), the 8 register parameters 
+                do not have "home" stack space reserved for them, so the
+                stack offset does not get incremented until after
+                we have used up the 8 parameter registers.  */
 
              if (!(MIPS_EABI || MIPS_NABI32) ||
                  argnum >= 8)
@@ -2033,12 +2089,12 @@ mips_push_return_address (pc, sp)
 {
   /* Set the return address register to point to the entry
      point of the program, where a breakpoint lies in wait.  */
-  write_register (RA_REGNUM, CALL_DUMMY_ADDRESS());
+  write_register (RA_REGNUM, CALL_DUMMY_ADDRESS ());
   return sp;
 }
 
 static void
-mips_push_register (CORE_ADDR *sp, int regno)
+mips_push_register (CORE_ADDR * sp, int regno)
 {
   char buffer[MAX_REGISTER_RAW_SIZE];
   int regsize;
@@ -2067,8 +2123,8 @@ void
 mips_push_dummy_frame ()
 {
   int ireg;
-  struct linked_proc_info *link = (struct linked_proc_info*)
-      xmalloc(sizeof(struct linked_proc_info));
+  struct linked_proc_info *link = (struct linked_proc_info *)
+  xmalloc (sizeof (struct linked_proc_info));
   mips_extra_func_info_t proc_desc = &link->info;
   CORE_ADDR sp = ADDR_BITS_REMOVE (read_register (SP_REGNUM));
   CORE_ADDR old_sp = sp;
@@ -2076,7 +2132,7 @@ mips_push_dummy_frame ()
   linked_proc_desc_table = link;
 
 /* FIXME!   are these correct ? */
-#define PUSH_FP_REGNUM 16 /* must be a register preserved across calls */
+#define PUSH_FP_REGNUM 16      /* must be a register preserved across calls */
 #define GEN_REG_SAVE_MASK MASK(1,16)|MASK(24,28)|(1<<(MIPS_NUMREGS-1))
 #define FLOAT_REG_SAVE_MASK MASK(0,19)
 #define FLOAT_SINGLE_REG_SAVE_MASK \
@@ -2090,45 +2146,45 @@ mips_push_dummy_frame ()
    *
    * Dummy frame layout:
    *  (high memory)
-   *   Saved PC
-   *   Saved MMHI, MMLO, FPC_CSR
-   *   Saved R31
-   *   Saved R28
-   *   ...
-   *   Saved R1
+   *    Saved PC
+   *    Saved MMHI, MMLO, FPC_CSR
+   *    Saved R31
+   *    Saved R28
+   *    ...
+   *    Saved R1
    *    Saved D18 (i.e. F19, F18)
    *    ...
    *    Saved D0 (i.e. F1, F0)
-   *   Argument build area and stack arguments written via mips_push_arguments
+   *    Argument build area and stack arguments written via mips_push_arguments
    *  (low memory)
    */
 
   /* Save special registers (PC, MMHI, MMLO, FPC_CSR) */
-  PROC_FRAME_REG(proc_desc) = PUSH_FP_REGNUM;
-  PROC_FRAME_OFFSET(proc_desc) = 0;
-  PROC_FRAME_ADJUST(proc_desc) = 0;
+  PROC_FRAME_REG (proc_desc) = PUSH_FP_REGNUM;
+  PROC_FRAME_OFFSET (proc_desc) = 0;
+  PROC_FRAME_ADJUST (proc_desc) = 0;
   mips_push_register (&sp, PC_REGNUM);
   mips_push_register (&sp, HI_REGNUM);
   mips_push_register (&sp, LO_REGNUM);
   mips_push_register (&sp, MIPS_FPU_TYPE == MIPS_FPU_NONE ? 0 : FCRCS_REGNUM);
 
   /* Save general CPU registers */
-  PROC_REG_MASK(proc_desc) = GEN_REG_SAVE_MASK;
+  PROC_REG_MASK (proc_desc) = GEN_REG_SAVE_MASK;
   /* PROC_REG_OFFSET is the offset of the first saved register from FP.  */
-  PROC_REG_OFFSET(proc_desc) = sp - old_sp - MIPS_SAVED_REGSIZE;
-  for (ireg = 32; --ireg >= 0; )
-    if (PROC_REG_MASK(proc_desc) & (1 << ireg))
+  PROC_REG_OFFSET (proc_desc) = sp - old_sp - MIPS_SAVED_REGSIZE;
+  for (ireg = 32; --ireg >= 0;)
+    if (PROC_REG_MASK (proc_desc) & (1 << ireg))
       mips_push_register (&sp, ireg);
 
   /* Save floating point registers starting with high order word */
-  PROC_FREG_MASK(proc_desc) = 
+  PROC_FREG_MASK (proc_desc) =
     MIPS_FPU_TYPE == MIPS_FPU_DOUBLE ? FLOAT_REG_SAVE_MASK
     : MIPS_FPU_TYPE == MIPS_FPU_SINGLE ? FLOAT_SINGLE_REG_SAVE_MASK : 0;
   /* PROC_FREG_OFFSET is the offset of the first saved *double* register
      from FP.  */
-  PROC_FREG_OFFSET(proc_desc) = sp - old_sp - 8;
-  for (ireg = 32; --ireg >= 0; )
-    if (PROC_FREG_MASK(proc_desc) & (1 << ireg))
+  PROC_FREG_OFFSET (proc_desc) = sp - old_sp - 8;
+  for (ireg = 32; --ireg >= 0;)
+    if (PROC_FREG_MASK (proc_desc) & (1 << ireg))
       mips_push_register (&sp, ireg + FP0_REGNUM);
 
   /* Update the frame pointer for the call dummy and the stack pointer.
@@ -2136,14 +2192,14 @@ mips_push_dummy_frame ()
      call dummy address at the entry point.  */
   write_register (PUSH_FP_REGNUM, old_sp);
   write_register (SP_REGNUM, sp);
-  PROC_LOW_ADDR(proc_desc) = CALL_DUMMY_ADDRESS();
-  PROC_HIGH_ADDR(proc_desc) =  CALL_DUMMY_ADDRESS() + 4;
-  SET_PROC_DESC_IS_DUMMY(proc_desc);
-  PROC_PC_REG(proc_desc) = RA_REGNUM;
+  PROC_LOW_ADDR (proc_desc) = CALL_DUMMY_ADDRESS ();
+  PROC_HIGH_ADDR (proc_desc) = CALL_DUMMY_ADDRESS () + 4;
+  SET_PROC_DESC_IS_DUMMY (proc_desc);
+  PROC_PC_REG (proc_desc) = RA_REGNUM;
 }
 
 void
-mips_pop_frame()
+mips_pop_frame ()
 {
   register int regnum;
   struct frame_info *frame = get_current_frame ();
@@ -2151,7 +2207,7 @@ mips_pop_frame()
 
   mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
 
-  write_register (PC_REGNUM, FRAME_SAVED_PC(frame));
+  write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
   if (frame->saved_regs == NULL)
     mips_find_saved_regs (frame);
   for (regnum = 0; regnum < NUM_REGS; regnum++)
@@ -2160,12 +2216,12 @@ mips_pop_frame()
          && frame->saved_regs[regnum])
        write_register (regnum,
                        read_memory_integer (frame->saved_regs[regnum],
-                                            MIPS_SAVED_REGSIZE)); 
+                                            MIPS_SAVED_REGSIZE));
     }
   write_register (SP_REGNUM, new_sp);
   flush_cached_frames ();
 
-  if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc))
+  if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
     {
       struct linked_proc_info *pi_ptr, *prev_ptr;
 
@@ -2188,14 +2244,14 @@ mips_pop_frame()
       free (pi_ptr);
 
       write_register (HI_REGNUM,
-                     read_memory_integer (new_sp - 2*MIPS_SAVED_REGSIZE,
+                     read_memory_integer (new_sp - 2 * MIPS_SAVED_REGSIZE,
                                           MIPS_SAVED_REGSIZE));
       write_register (LO_REGNUM,
-                     read_memory_integer (new_sp - 3*MIPS_SAVED_REGSIZE,
+                     read_memory_integer (new_sp - 3 * MIPS_SAVED_REGSIZE,
                                           MIPS_SAVED_REGSIZE));
       if (MIPS_FPU_TYPE != MIPS_FPU_NONE)
        write_register (FCRCS_REGNUM,
-                       read_memory_integer (new_sp - 4*MIPS_SAVED_REGSIZE,
+                       read_memory_integer (new_sp - 4 * MIPS_SAVED_REGSIZE,
                                             MIPS_SAVED_REGSIZE));
     }
 }
@@ -2215,16 +2271,16 @@ mips_print_register (regnum, all)
 
   /* If an even floating point register, also print as double. */
   if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT
-      && !((regnum-FP0_REGNUM) & 1))
-    if (REGISTER_RAW_SIZE(regnum) == 4)        /* this would be silly on MIPS64 or N32 (Irix 6) */
+      && !((regnum - FP0_REGNUM) & 1))
+    if (REGISTER_RAW_SIZE (regnum) == 4)       /* this would be silly on MIPS64 or N32 (Irix 6) */
       {
-       char dbuffer[2 * MAX_REGISTER_RAW_SIZE]; 
+       char dbuffer[2 * MAX_REGISTER_RAW_SIZE];
 
        read_relative_register_raw_bytes (regnum, dbuffer);
-       read_relative_register_raw_bytes (regnum+1, dbuffer+MIPS_REGSIZE);
+       read_relative_register_raw_bytes (regnum + 1, dbuffer + MIPS_REGSIZE);
        REGISTER_CONVERT_TO_TYPE (regnum, builtin_type_double, dbuffer);
 
-       printf_filtered ("(d%d: ", regnum-FP0_REGNUM);
+       printf_filtered ("(d%d: ", regnum - FP0_REGNUM);
        val_print (builtin_type_double, dbuffer, 0, 0,
                   gdb_stdout, 0, 1, 0, Val_pretty_default);
        printf_filtered ("); ");
@@ -2243,7 +2299,7 @@ mips_print_register (regnum, all)
   /* If virtual format is floating, print it that way.  */
   if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
     if (FP_REGISTER_DOUBLE)
-      { /* show 8-byte floats as float AND double: */
+      {                                /* show 8-byte floats as float AND double: */
        int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
 
        printf_filtered (" (float) ");
@@ -2268,7 +2324,7 @@ mips_print_register (regnum, all)
 static int
 do_fp_register_row (regnum)
      int regnum;
-{ /* do values for FP (float) regs */
+{                              /* do values for FP (float) regs */
   char *raw_buffer[2];
   char *dbl_buffer;
   /* use HI and LO to control the order of combining two flt regs */
@@ -2276,7 +2332,7 @@ do_fp_register_row (regnum)
   int LO = (TARGET_BYTE_ORDER != BIG_ENDIAN);
   double doub, flt1, flt2;     /* doubles extracted from raw hex data */
   int inv1, inv2, inv3;
-   
+
   raw_buffer[0] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM));
   raw_buffer[1] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM));
   dbl_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM));
@@ -2284,41 +2340,41 @@ do_fp_register_row (regnum)
   /* Get the data in raw format.  */
   if (read_relative_register_raw_bytes (regnum, raw_buffer[HI]))
     error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
-  if (REGISTER_RAW_SIZE(regnum) == 4)
+  if (REGISTER_RAW_SIZE (regnum) == 4)
     {
       /* 4-byte registers: we can fit two registers per row. */
       /* Also print every pair of 4-byte regs as an 8-byte double. */
       if (read_relative_register_raw_bytes (regnum + 1, raw_buffer[LO]))
-       error ("can't read register %d (%s)", 
+       error ("can't read register %d (%s)",
               regnum + 1, REGISTER_NAME (regnum + 1));
 
       /* copy the two floats into one double, and unpack both */
-      memcpy (dbl_buffer, raw_buffer, sizeof(dbl_buffer));
-      flt1 = unpack_double (builtin_type_float,  raw_buffer[HI], &inv1);
-      flt2 = unpack_double (builtin_type_float,  raw_buffer[LO], &inv2);
-      doub = unpack_double (builtin_type_double, dbl_buffer,     &inv3);
-
-      printf_filtered (inv1 ? " %-5s: <invalid float>" : 
-                      " %-5s%-17.9g", REGISTER_NAME (regnum),     flt1);
-      printf_filtered (inv2 ? " %-5s: <invalid float>" : 
+      memcpy (dbl_buffer, raw_buffer, sizeof (dbl_buffer));
+      flt1 = unpack_double (builtin_type_float, raw_buffer[HI], &inv1);
+      flt2 = unpack_double (builtin_type_float, raw_buffer[LO], &inv2);
+      doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
+
+      printf_filtered (inv1 ? " %-5s: <invalid float>" :
+                      " %-5s%-17.9g", REGISTER_NAME (regnum), flt1);
+      printf_filtered (inv2 ? " %-5s: <invalid float>" :
                       " %-5s%-17.9g", REGISTER_NAME (regnum + 1), flt2);
-      printf_filtered (inv3 ? " dbl: <invalid double>\n" : 
+      printf_filtered (inv3 ? " dbl: <invalid double>\n" :
                       " dbl: %-24.17g\n", doub);
       /* may want to do hex display here (future enhancement) */
-      regnum +=2;
+      regnum += 2;
     }
   else
-    { /* eight byte registers: print each one as float AND as double. */
+    {                          /* eight byte registers: print each one as float AND as double. */
       int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
 
-      memcpy (dbl_buffer, raw_buffer[HI], sizeof(dbl_buffer));
-      flt1 = unpack_double (builtin_type_float, 
+      memcpy (dbl_buffer, raw_buffer[HI], sizeof (dbl_buffer));
+      flt1 = unpack_double (builtin_type_float,
                            &raw_buffer[HI][offset], &inv1);
-      doub = unpack_double (builtin_type_double, dbl_buffer,    &inv3);
+      doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
 
-      printf_filtered (inv1 ? " %-5s: <invalid float>" : 
+      printf_filtered (inv1 ? " %-5s: <invalid float>" :
                       " %-5s flt: %-17.9g", REGISTER_NAME (regnum), flt1);
-      printf_filtered (inv3 ? " dbl: <invalid double>\n" : 
+      printf_filtered (inv3 ? " dbl: <invalid double>\n" :
                       " dbl: %-24.17g\n", doub);
       /* may want to do hex display here (future enhancement) */
       regnum++;
@@ -2345,14 +2401,14 @@ do_gp_register_row (regnum)
   for (col = 0; col < ncols && regnum < numregs; regnum++)
     {
       if (*REGISTER_NAME (regnum) == '\0')
-       continue;       /* unused register */
+       continue;               /* unused register */
       if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
-       break;  /* end the row: reached FP register */
-      printf_filtered (MIPS_REGSIZE == 8 ? "%17s" : "%9s", 
+       break;                  /* end the row: reached FP register */
+      printf_filtered (MIPS_REGSIZE == 8 ? "%17s" : "%9s",
                       REGISTER_NAME (regnum));
       col++;
     }
-  printf_filtered (start_regnum < MIPS_NUMREGS ? "\n R%-4d" : "\n      ", 
+  printf_filtered (start_regnum < MIPS_NUMREGS ? "\n R%-4d" : "\n      ",
                   start_regnum);       /* print the R0 to R31 names */
 
   regnum = start_regnum;       /* go back to start of row */
@@ -2360,9 +2416,9 @@ do_gp_register_row (regnum)
   for (col = 0; col < ncols && regnum < numregs; regnum++)
     {
       if (*REGISTER_NAME (regnum) == '\0')
-       continue;       /* unused register */
+       continue;               /* unused register */
       if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
-       break;  /* end row: reached FP register */
+       break;                  /* end row: reached FP register */
       /* OK: get the data in raw format.  */
       if (read_relative_register_raw_bytes (regnum, raw_buffer))
        error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
@@ -2379,7 +2435,7 @@ do_gp_register_row (regnum)
       printf_filtered (" ");
       col++;
     }
-  if (col > 0) /* ie. if we actually printed anything... */
+  if (col > 0)                 /* ie. if we actually printed anything... */
     printf_filtered ("\n");
 
   return regnum;
@@ -2392,7 +2448,7 @@ mips_do_registers_info (regnum, fpregs)
      int regnum;
      int fpregs;
 {
-  if (regnum != -1)    /* do one specified register */
+  if (regnum != -1)            /* do one specified register */
     {
       if (*(REGISTER_NAME (regnum)) == '\0')
        error ("Not a valid register for the current processor type");
@@ -2400,13 +2456,14 @@ mips_do_registers_info (regnum, fpregs)
       mips_print_register (regnum, 0);
       printf_filtered ("\n");
     }
-  else                 /* do all (or most) registers */
+  else
+    /* do all (or most) registers */
     {
       regnum = 0;
       while (regnum < NUM_REGS)
        {
-         if (TYPE_CODE(REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
-           if (fpregs) /* true for "INFO ALL-REGISTERS" command */
+         if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
+           if (fpregs)         /* true for "INFO ALL-REGISTERS" command */
              regnum = do_fp_register_row (regnum);     /* FP regs */
            else
              regnum += MIPS_NUMREGS;   /* skip floating point regs */
@@ -2421,9 +2478,9 @@ mips_do_registers_info (regnum, fpregs)
 
 int
 mips_frame_num_args (frame)
-       struct frame_info *frame;
+     struct frame_info *frame;
 {
-#if 0 /* FIXME Use or lose this! */
+#if 0                          /* FIXME Use or lose this! */
   struct chain_info_t *p;
 
   p = mips_find_cached_frame (FRAME_FP (frame));
@@ -2465,7 +2522,7 @@ mips_step_skips_delay (pc)
   if (target_read_memory (pc, buf, MIPS_INSTLEN) != 0)
     /* If error reading memory, guess that it is not a delayed branch.  */
     return 0;
-  return is_delayed ((unsigned long)extract_unsigned_integer (buf, MIPS_INSTLEN));
+  return is_delayed ((unsigned long) extract_unsigned_integer (buf, MIPS_INSTLEN));
 }
 
 
@@ -2474,95 +2531,95 @@ mips_step_skips_delay (pc)
 
 static CORE_ADDR
 mips32_skip_prologue (pc, lenient)
-     CORE_ADDR pc;     /* starting PC to search from */
+     CORE_ADDR pc;             /* starting PC to search from */
      int lenient;
 {
-    t_inst inst;
-    CORE_ADDR end_pc;
-    int seen_sp_adjust = 0;
-    int load_immediate_bytes = 0;
-
-    /* Skip the typical prologue instructions. These are the stack adjustment
-       instruction and the instructions that save registers on the stack
-       or in the gcc frame.  */
-    for (end_pc = pc + 100; pc < end_pc; pc += MIPS_INSTLEN)
-      {
-       unsigned long high_word;
+  t_inst inst;
+  CORE_ADDR end_pc;
+  int seen_sp_adjust = 0;
+  int load_immediate_bytes = 0;
+
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (end_pc = pc + 100; pc < end_pc; pc += MIPS_INSTLEN)
+    {
+      unsigned long high_word;
 
-       inst = mips_fetch_instruction (pc);
-       high_word = (inst >> 16) & 0xffff;
+      inst = mips_fetch_instruction (pc);
+      high_word = (inst >> 16) & 0xffff;
 
 #if 0
-       if (lenient && is_delayed (inst))
-         continue;
+      if (lenient && is_delayed (inst))
+       continue;
 #endif
 
-       if (high_word == 0x27bd                 /* addiu $sp,$sp,offset */
-           || high_word == 0x67bd)             /* daddiu $sp,$sp,offset */
-           seen_sp_adjust = 1;
-       else if (inst == 0x03a1e823 ||          /* subu $sp,$sp,$at */
-                inst == 0x03a8e823)            /* subu $sp,$sp,$t0 */
-           seen_sp_adjust = 1;
-       else if (((inst & 0xFFE00000) == 0xAFA00000 /* sw reg,n($sp) */
-                 || (inst & 0xFFE00000) == 0xFFA00000) /* sd reg,n($sp) */
-                && (inst & 0x001F0000))        /* reg != $zero */
-           continue;
-                                               
-       else if ((inst & 0xFFE00000) == 0xE7A00000) /* swc1 freg,n($sp) */
-           continue;
-       else if ((inst & 0xF3E00000) == 0xA3C00000 && (inst & 0x001F0000))
-                                               /* sx reg,n($s8) */
-           continue;                           /* reg != $zero */
-        /* move $s8,$sp.  With different versions of gas this will be either
-           `addu $s8,$sp,$zero' or `or $s8,$sp,$zero' or `daddu s8,sp,$0'.
-           Accept any one of these.  */
-        else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
-           continue;
-
-       else if ((inst & 0xFF9F07FF) == 0x00800021) /* move reg,$a0-$a3 */
-           continue;
-       else if (high_word == 0x3c1c)           /* lui $gp,n */
-           continue;
-       else if (high_word == 0x279c)           /* addiu $gp,$gp,n */
-           continue;
-       else if (inst == 0x0399e021             /* addu $gp,$gp,$t9 */
-                || inst == 0x033ce021)         /* addu $gp,$t9,$gp */
-         continue;
-       /* The following instructions load $at or $t0 with an immediate
-          value in preparation for a stack adjustment via
-          subu $sp,$sp,[$at,$t0]. These instructions could also initialize
-          a local variable, so we accept them only before a stack adjustment
-          instruction was seen.  */
-       else if (!seen_sp_adjust)
-         {
-           if (high_word == 0x3c01 ||          /* lui $at,n */
-               high_word == 0x3c08)            /* lui $t0,n */
-             {
-               load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */
-               continue;
-             }
-           else if (high_word == 0x3421 ||     /* ori $at,$at,n */
-                    high_word == 0x3508 ||     /* ori $t0,$t0,n */
-                    high_word == 0x3401 ||     /* ori $at,$zero,n */
-                    high_word == 0x3408)       /* ori $t0,$zero,n */
-             {
-               load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */
-               continue;
-             }
-           else
-             break;
-         }
-       else
-         break;
+      if (high_word == 0x27bd  /* addiu $sp,$sp,offset */
+         || high_word == 0x67bd)       /* daddiu $sp,$sp,offset */
+       seen_sp_adjust = 1;
+      else if (inst == 0x03a1e823 ||   /* subu $sp,$sp,$at */
+              inst == 0x03a8e823)      /* subu $sp,$sp,$t0 */
+       seen_sp_adjust = 1;
+      else if (((inst & 0xFFE00000) == 0xAFA00000      /* sw reg,n($sp) */
+               || (inst & 0xFFE00000) == 0xFFA00000)   /* sd reg,n($sp) */
+              && (inst & 0x001F0000))  /* reg != $zero */
+       continue;
+
+      else if ((inst & 0xFFE00000) == 0xE7A00000)      /* swc1 freg,n($sp) */
+       continue;
+      else if ((inst & 0xF3E00000) == 0xA3C00000 && (inst & 0x001F0000))
+       /* sx reg,n($s8) */
+       continue;               /* reg != $zero */
+
+      /* move $s8,$sp.  With different versions of gas this will be either
+         `addu $s8,$sp,$zero' or `or $s8,$sp,$zero' or `daddu s8,sp,$0'.
+         Accept any one of these.  */
+      else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
+       continue;
+
+      else if ((inst & 0xFF9F07FF) == 0x00800021)      /* move reg,$a0-$a3 */
+       continue;
+      else if (high_word == 0x3c1c)    /* lui $gp,n */
+       continue;
+      else if (high_word == 0x279c)    /* addiu $gp,$gp,n */
+       continue;
+      else if (inst == 0x0399e021      /* addu $gp,$gp,$t9 */
+              || inst == 0x033ce021)   /* addu $gp,$t9,$gp */
+       continue;
+      /* The following instructions load $at or $t0 with an immediate
+         value in preparation for a stack adjustment via
+         subu $sp,$sp,[$at,$t0]. These instructions could also initialize
+         a local variable, so we accept them only before a stack adjustment
+         instruction was seen.  */
+      else if (!seen_sp_adjust)
+       {
+         if (high_word == 0x3c01 ||    /* lui $at,n */
+             high_word == 0x3c08)      /* lui $t0,n */
+           {
+             load_immediate_bytes += MIPS_INSTLEN;     /* FIXME!! */
+             continue;
+           }
+         else if (high_word == 0x3421 ||       /* ori $at,$at,n */
+                  high_word == 0x3508 ||       /* ori $t0,$t0,n */
+                  high_word == 0x3401 ||       /* ori $at,$zero,n */
+                  high_word == 0x3408)         /* ori $t0,$zero,n */
+           {
+             load_immediate_bytes += MIPS_INSTLEN;     /* FIXME!! */
+             continue;
+           }
+         else
+           break;
+       }
+      else
+       break;
     }
 
-    /* In a frameless function, we might have incorrectly
-       skipped some load immediate instructions. Undo the skipping
-       if the load immediate was not followed by a stack adjustment.  */
-    if (load_immediate_bytes && !seen_sp_adjust)
-      pc -= load_immediate_bytes;
-    return pc;
+  /* In a frameless function, we might have incorrectly
+     skipped some load immediate instructions. Undo the skipping
+     if the load immediate was not followed by a stack adjustment.  */
+  if (load_immediate_bytes && !seen_sp_adjust)
+    pc -= load_immediate_bytes;
+  return pc;
 }
 
 /* Skip the PC past function prologue instructions (16-bit version).
@@ -2570,68 +2627,105 @@ mips32_skip_prologue (pc, lenient)
 
 static CORE_ADDR
 mips16_skip_prologue (pc, lenient)
-     CORE_ADDR pc;     /* starting PC to search from */
+     CORE_ADDR pc;             /* starting PC to search from */
      int lenient;
 {
-    CORE_ADDR end_pc;
-    int extend_bytes = 0;
-    int prev_extend_bytes;
+  CORE_ADDR end_pc;
+  int extend_bytes = 0;
+  int prev_extend_bytes;
 
-    /* Table of instructions likely to be found in a function prologue.  */
-    static struct
+  /* Table of instructions likely to be found in a function prologue.  */
+  static struct
     {
       unsigned short inst;
       unsigned short mask;
-    } table[] =
+    }
+  table[] =
+  {
     {
-      { 0x6300, 0xff00 },      /* addiu $sp,offset */
-      { 0xfb00, 0xff00 },      /* daddiu $sp,offset */
-      { 0xd000, 0xf800 },      /* sw reg,n($sp) */
-      { 0xf900, 0xff00 },      /* sd reg,n($sp) */
-      { 0x6200, 0xff00 },      /* sw $ra,n($sp) */
-      { 0xfa00, 0xff00 },      /* sd $ra,n($sp) */
-      { 0x673d, 0xffff },      /* move $s1,sp */
-      { 0xd980, 0xff80 },      /* sw $a0-$a3,n($s1) */
-      { 0x6704, 0xff1c },      /* move reg,$a0-$a3 */
-      { 0xe809, 0xf81f },      /* entry pseudo-op */
-      { 0x0100, 0xff00 },      /* addiu $s1,$sp,n */
-      { 0, 0 }                 /* end of table marker */
-    };
-
-    /* Skip the typical prologue instructions. These are the stack adjustment
-       instruction and the instructions that save registers on the stack
-       or in the gcc frame.  */
-    for (end_pc = pc + 100; pc < end_pc; pc += MIPS16_INSTLEN)
-      {
-       unsigned short inst;
-       int i;
+      0x6300, 0xff00
+    }
+    ,                          /* addiu $sp,offset */
+    {
+      0xfb00, 0xff00
+    }
+    ,                          /* daddiu $sp,offset */
+    {
+      0xd000, 0xf800
+    }
+    ,                          /* sw reg,n($sp) */
+    {
+      0xf900, 0xff00
+    }
+    ,                          /* sd reg,n($sp) */
+    {
+      0x6200, 0xff00
+    }
+    ,                          /* sw $ra,n($sp) */
+    {
+      0xfa00, 0xff00
+    }
+    ,                          /* sd $ra,n($sp) */
+    {
+      0x673d, 0xffff
+    }
+    ,                          /* move $s1,sp */
+    {
+      0xd980, 0xff80
+    }
+    ,                          /* sw $a0-$a3,n($s1) */
+    {
+      0x6704, 0xff1c
+    }
+    ,                          /* move reg,$a0-$a3 */
+    {
+      0xe809, 0xf81f
+    }
+    ,                          /* entry pseudo-op */
+    {
+      0x0100, 0xff00
+    }
+    ,                          /* addiu $s1,$sp,n */
+    {
+      0, 0
+    }                          /* end of table marker */
+  };
+
+  /* Skip the typical prologue instructions. These are the stack adjustment
+     instruction and the instructions that save registers on the stack
+     or in the gcc frame.  */
+  for (end_pc = pc + 100; pc < end_pc; pc += MIPS16_INSTLEN)
+    {
+      unsigned short inst;
+      int i;
 
-       inst = mips_fetch_instruction (pc);
+      inst = mips_fetch_instruction (pc);
 
-       /* Normally we ignore an extend instruction.  However, if it is
-          not followed by a valid prologue instruction, we must adjust
-          the pc back over the extend so that it won't be considered
-          part of the prologue.  */
-       if ((inst & 0xf800) == 0xf000)          /* extend */
-         {
-           extend_bytes = MIPS16_INSTLEN;
-           continue;
-         }
-       prev_extend_bytes = extend_bytes;
-       extend_bytes = 0;
+      /* Normally we ignore an extend instruction.  However, if it is
+         not followed by a valid prologue instruction, we must adjust
+         the pc back over the extend so that it won't be considered
+         part of the prologue.  */
+      if ((inst & 0xf800) == 0xf000)   /* extend */
+       {
+         extend_bytes = MIPS16_INSTLEN;
+         continue;
+       }
+      prev_extend_bytes = extend_bytes;
+      extend_bytes = 0;
 
-       /* Check for other valid prologue instructions besides extend.  */
-       for (i = 0; table[i].mask != 0; i++)
-         if ((inst & table[i].mask) == table[i].inst)  /* found, get out */
-           break;
-       if (table[i].mask != 0)                 /* it was in table? */
-         continue;                             /* ignore it */
-       else                                    /* non-prologue */
-         {
-           /* Return the current pc, adjusted backwards by 2 if
-              the previous instruction was an extend.  */
-           return pc - prev_extend_bytes;
-         }
+      /* Check for other valid prologue instructions besides extend.  */
+      for (i = 0; table[i].mask != 0; i++)
+       if ((inst & table[i].mask) == table[i].inst)    /* found, get out */
+         break;
+      if (table[i].mask != 0)  /* it was in table? */
+       continue;               /* ignore it */
+      else
+       /* non-prologue */
+       {
+         /* Return the current pc, adjusted backwards by 2 if
+            the previous instruction was an extend.  */
+         return pc - prev_extend_bytes;
+       }
     }
   return pc;
 }
@@ -2706,7 +2800,7 @@ return_value_location (valtype, hi, lo)
      struct return_value_word *lo;
 {
   int len = TYPE_LENGTH (valtype);
-  
+
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT
       && ((MIPS_FPU_TYPE == MIPS_FPU_DOUBLE && (len == 4 || len == 8))
          || (MIPS_FPU_TYPE == MIPS_FPU_SINGLE && len == 4)))
@@ -2714,7 +2808,7 @@ return_value_location (valtype, hi, lo)
       if (!FP_REGISTER_DOUBLE && len == 8)
        {
          /* We need to break a 64bit float in two 32 bit halves and
-             spread them across a floating-point register pair. */
+            spread them across a floating-point register pair. */
          lo->buf_offset = TARGET_BYTE_ORDER == BIG_ENDIAN ? 4 : 0;
          hi->buf_offset = TARGET_BYTE_ORDER == BIG_ENDIAN ? 0 : 4;
          lo->reg_offset = ((TARGET_BYTE_ORDER == BIG_ENDIAN
@@ -2729,7 +2823,7 @@ return_value_location (valtype, hi, lo)
       else
        {
          /* The floating point value fits in a single floating-point
-             register. */
+            register. */
          lo->reg_offset = ((TARGET_BYTE_ORDER == BIG_ENDIAN
                             && REGISTER_RAW_SIZE (FP0_REGNUM) == 8
                             && len == 4)
@@ -2791,7 +2885,7 @@ return_value_location (valtype, hi, lo)
          && MIPS_SAVED_REGSIZE == 4)
        {
          /* Account for the fact that only the least-signficant part
-             of the register is being used */
+            of the register is being used */
          lo->reg_offset += 4;
          hi->reg_offset += 4;
        }
@@ -2805,9 +2899,9 @@ return_value_location (valtype, hi, lo)
 
 void
 mips_extract_return_value (valtype, regbuf, valbuf)
-    struct type *valtype;
-    char regbuf[REGISTER_BYTES];
-    char *valbuf;
+     struct type *valtype;
+     char regbuf[REGISTER_BYTES];
+     char *valbuf;
 {
   struct return_value_word lo;
   struct return_value_word hi;
@@ -2826,7 +2920,7 @@ mips_extract_return_value (valtype, regbuf, valbuf)
   int regnum;
   int offset = 0;
   int len = TYPE_LENGTH (valtype);
-  
+
   regnum = 2;
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT
       && (MIPS_FPU_TYPE == MIPS_FPU_DOUBLE
@@ -2835,10 +2929,10 @@ mips_extract_return_value (valtype, regbuf, valbuf)
     regnum = FP0_REGNUM;
 
   if (TARGET_BYTE_ORDER == BIG_ENDIAN)
-    { /* "un-left-justify" the value from the register */
+    {                          /* "un-left-justify" the value from the register */
       if (len < REGISTER_RAW_SIZE (regnum))
        offset = REGISTER_RAW_SIZE (regnum) - len;
-      if (len > REGISTER_RAW_SIZE (regnum)     &&      /* odd-size structs */
+      if (len > REGISTER_RAW_SIZE (regnum) &&  /* odd-size structs */
          len < REGISTER_RAW_SIZE (regnum) * 2 &&
          (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
           TYPE_CODE (valtype) == TYPE_CODE_UNION))
@@ -2854,8 +2948,8 @@ mips_extract_return_value (valtype, regbuf, valbuf)
 
 void
 mips_store_return_value (valtype, valbuf)
-    struct type *valtype;
-    char *valbuf;
+     struct type *valtype;
+     char *valbuf;
 {
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
   struct return_value_word lo;
@@ -2867,7 +2961,7 @@ mips_store_return_value (valtype, valbuf)
   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));
@@ -2882,7 +2976,7 @@ mips_store_return_value (valtype, valbuf)
   int offset = 0;
   int len = TYPE_LENGTH (valtype);
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
-  
+
   regnum = 2;
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT
       && (MIPS_FPU_TYPE == MIPS_FPU_DOUBLE
@@ -2891,20 +2985,20 @@ mips_store_return_value (valtype, valbuf)
     regnum = FP0_REGNUM;
 
   if (TARGET_BYTE_ORDER == BIG_ENDIAN)
-    { /* "left-justify" the value in the register */
+    {                          /* "left-justify" the value in the register */
       if (len < REGISTER_RAW_SIZE (regnum))
        offset = REGISTER_RAW_SIZE (regnum) - len;
-      if (len > REGISTER_RAW_SIZE (regnum)     &&      /* odd-size structs */
+      if (len > REGISTER_RAW_SIZE (regnum) &&  /* odd-size structs */
          len < REGISTER_RAW_SIZE (regnum) * 2 &&
          (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
           TYPE_CODE (valtype) == TYPE_CODE_UNION))
        offset = 2 * REGISTER_RAW_SIZE (regnum) - len;
     }
-  memcpy(raw_buffer + offset, valbuf, len);
-  REGISTER_CONVERT_FROM_TYPE(regnum, valtype, raw_buffer);
-  write_register_bytes(REGISTER_BYTE (regnum), raw_buffer, 
-                      len > REGISTER_RAW_SIZE (regnum) ? 
-                      len : REGISTER_RAW_SIZE (regnum));
+  memcpy (raw_buffer + offset, valbuf, len);
+  REGISTER_CONVERT_FROM_TYPE (regnum, valtype, raw_buffer);
+  write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,
+                       len > REGISTER_RAW_SIZE (regnum) ?
+                       len : REGISTER_RAW_SIZE (regnum));
 #endif
 }
 
@@ -3020,7 +3114,7 @@ mips_set_processor_type_command (args, from_tty)
 
       return;
     }
-  
+
   if (!mips_set_processor_type (tmp_mips_processor_type))
     {
       error ("Unknown processor type `%s'.", tmp_mips_processor_type);
@@ -3072,7 +3166,7 @@ mips_read_processor_type ()
   prid = read_register (PRID_REGNUM);
 
   if ((prid & ~0xf) == 0x700)
-    return savestring ("r3041", strlen("r3041"));
+    return savestring ("r3041", strlen ("r3041"));
 
   return NULL;
 }
@@ -3115,7 +3209,7 @@ gdb_print_insn_mips (memaddr, info)
 
   /* Round down the instruction address to the appropriate boundary.  */
   memaddr &= (info->mach == 16 ? ~1 : ~3);
-      
+
   /* Call the appropriate disassembler based on the target endian-ness.  */
   if (TARGET_BYTE_ORDER == BIG_ENDIAN)
     return print_insn_big_mips (memaddr, info);
@@ -3143,7 +3237,8 @@ gdb_print_insn_mips (memaddr, info)
    (if necessary) to point to the actual memory location where the
    breakpoint should be inserted.  */
 
-unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
+unsigned char *
+mips_breakpoint_from_pc (pcptr, lenptr)
      CORE_ADDR *pcptr;
      int *lenptr;
 {
@@ -3153,7 +3248,7 @@ unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
        {
          static char mips16_big_breakpoint[] = MIPS16_BIG_BREAKPOINT;
          *pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
-         *lenptr = sizeof(mips16_big_breakpoint);
+         *lenptr = sizeof (mips16_big_breakpoint);
          return mips16_big_breakpoint;
        }
       else
@@ -3162,7 +3257,7 @@ unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
          static char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT;
          static char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT;
 
-         *lenptr = sizeof(big_breakpoint);
+         *lenptr = sizeof (big_breakpoint);
 
          if (strcmp (target_shortname, "mips") == 0)
            return idt_big_breakpoint;
@@ -3180,7 +3275,7 @@ unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
        {
          static char mips16_little_breakpoint[] = MIPS16_LITTLE_BREAKPOINT;
          *pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
-         *lenptr = sizeof(mips16_little_breakpoint);
+         *lenptr = sizeof (mips16_little_breakpoint);
          return mips16_little_breakpoint;
        }
       else
@@ -3189,7 +3284,7 @@ unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
          static char pmon_little_breakpoint[] = PMON_LITTLE_BREAKPOINT;
          static char idt_little_breakpoint[] = IDT_LITTLE_BREAKPOINT;
 
-         *lenptr = sizeof(little_breakpoint);
+         *lenptr = sizeof (little_breakpoint);
 
          if (strcmp (target_shortname, "mips") == 0)
            return idt_little_breakpoint;
@@ -3208,19 +3303,19 @@ unsigned char *mips_breakpoint_from_pc (pcptr, lenptr)
    cases which must be handled:
 
    * If the PC is in __mips16_ret_{d,s}f, this is a return stub and the
-     target PC is in $31 ($ra).
+   target PC is in $31 ($ra).
    * If the PC is in __mips16_call_stub_{1..10}, this is a call stub
-     and the target PC is in $2.
+   and the target PC is in $2.
    * If the PC at the start of __mips16_call_stub_{s,d}f_{0..10}, i.e.
-     before the jal instruction, this is effectively a call stub
-     and the the target PC is in $2.  Otherwise this is effectively
-     a return stub and the target PC is in $18.
+   before the jal instruction, this is effectively a call stub
+   and the the target PC is in $2.  Otherwise this is effectively
+   a return stub and the target PC is in $18.
 
    See the source code for the stubs in gcc/config/mips/mips16.S for
    gory details.
 
    This function implements the SKIP_TRAMPOLINE_CODE macro.
-*/
+ */
 
 CORE_ADDR
 mips_skip_stub (pc)
@@ -3247,24 +3342,24 @@ mips_skip_stub (pc)
        return read_register (2);
 
       /* If the PC at the start of __mips16_call_stub_{s,d}f_{0..10}, i.e.
-        before the jal instruction, this is effectively a call stub
-        and the the target PC is in $2.  Otherwise this is effectively
-        a return stub and the target PC is in $18.  */
+         before the jal instruction, this is effectively a call stub
+         and the the target PC is in $2.  Otherwise this is effectively
+         a return stub and the target PC is in $18.  */
       else if (name[19] == 's' || name[19] == 'd')
        {
          if (pc == start_addr)
            {
              /* Check if the target of the stub is a compiler-generated
-                stub.  Such a stub for a function bar might have a name
-                like __fn_stub_bar, and might look like this:
-                     mfc1    $4,$f13
-                     mfc1    $5,$f12
-                     mfc1    $6,$f15
-                     mfc1    $7,$f14
-                     la      $1,bar   (becomes a lui/addiu pair)
-                     jr      $1
-                So scan down to the lui/addi and extract the target
-                address from those two instructions.  */
+                stub.  Such a stub for a function bar might have a name
+                like __fn_stub_bar, and might look like this:
+                mfc1    $4,$f13
+                mfc1    $5,$f12
+                mfc1    $6,$f15
+                mfc1    $7,$f14
+                la      $1,bar   (becomes a lui/addiu pair)
+                jr      $1
+                So scan down to the lui/addi and extract the target
+                address from those two instructions.  */
 
              CORE_ADDR target_pc = read_register (2);
              t_inst inst;
@@ -3279,15 +3374,15 @@ mips_skip_stub (pc)
                return target_pc;
 
              /* Scan through this _fn_stub_ code for the lui/addiu pair.
-                The limit on the search is arbitrarily set to 20
-                instructions.  FIXME.  */
+                The limit on the search is arbitrarily set to 20
+                instructions.  FIXME.  */
              for (i = 0, pc = 0; i < 20; i++, target_pc += MIPS_INSTLEN)
                {
-                  inst = mips_fetch_instruction (target_pc);
-                  if ((inst & 0xffff0000) == 0x3c010000)       /* lui $at */
-                     pc = (inst << 16) & 0xffff0000;           /* high word */
-                  else if ((inst & 0xffff0000) == 0x24210000)  /* addiu $at */
-                     return pc | (inst & 0xffff);              /* low word */
+                 inst = mips_fetch_instruction (target_pc);
+                 if ((inst & 0xffff0000) == 0x3c010000)        /* lui $at */
+                   pc = (inst << 16) & 0xffff0000;     /* high word */
+                 else if ((inst & 0xffff0000) == 0x24210000)   /* addiu $at */
+                   return pc | (inst & 0xffff);        /* low word */
                }
 
              /* Couldn't find the lui/addui pair, so return stub address.  */
@@ -3299,7 +3394,7 @@ mips_skip_stub (pc)
            return read_register (18);
        }
     }
-  return 0;    /* not a stub */
+  return 0;                    /* not a stub */
 }
 
 
@@ -3324,12 +3419,12 @@ mips_in_call_stub (pc, name)
       if (name[19] >= '0' && name[19] <= '9')
        return 1;
       /* If the PC at the start of __mips16_call_stub_{s,d}f_{0..10}, i.e.
-        before the jal instruction, this is effectively a call stub.  */
+         before the jal instruction, this is effectively a call stub.  */
       else if (name[19] == 's' || name[19] == 'd')
        return pc == start_addr;
     }
 
-  return 0;    /* not a stub */
+  return 0;                    /* not a stub */
 }
 
 
@@ -3353,13 +3448,13 @@ mips_in_return_stub (pc, name)
     return 1;
 
   /* If the PC is in __mips16_call_stub_{s,d}f_{0..10} but not at the start,
-      i.e. after the jal instruction, this is effectively a return stub.  */
+     i.e. after the jal instruction, this is effectively a return stub.  */
   if (strncmp (name, "__mips16_call_stub_", 19) == 0
       && (name[19] == 's' || name[19] == 'd')
       && pc != start_addr)
     return 1;
 
-  return 0;    /* not a stub */
+  return 0;                    /* not a stub */
 }
 
 
@@ -3408,7 +3503,7 @@ _initialize_mips_tdep ()
   static struct cmd_list_element *mipsfpulist = NULL;
   struct cmd_list_element *c;
 
-  if (!tm_print_insn) /* Someone may have already set it */
+  if (!tm_print_insn)          /* Someone may have already set it */
     tm_print_insn = gdb_print_insn_mips;
 
   /* Let the user turn off floating point and set the fence post for
@@ -3471,8 +3566,8 @@ 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.  */
   add_show_from_set
-    (add_set_cmd ("mask-address", no_class, var_boolean, (char *)&mask_address_p,
-          "Set zeroing of upper 32 bits of 64-bit addresses.\n\
+    (add_set_cmd ("mask-address", no_class, var_boolean, (char *) &mask_address_p,
+                 "Set zeroing of upper 32 bits of 64-bit addresses.\n\
 Use \"on\" to enable the masking, and \"off\" to disable it.\n\
 Without an argument, zeroing of upper address bits is enabled.", &setlist),
      &showlist);
index 089ecd6556c98f8b4b7af81b522b57f20393f6aa..5f4d50be078b3cdbcabea55208f540c251a5bfac 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions to make GDB run on a mips box under Mach 3.0
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Mach specific routines for little endian mips (e.g. pmax)
  * running Mach 3.0
@@ -49,70 +50,70 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  *
  * -1 means mach does not save it anywhere.
  */
-static int reg_offset[] = 
+static int reg_offset[] =
 {
-  /*  zero             at                v0                v1       */
-      -1,           REG_OFFSET(r1),   REG_OFFSET(r2),   REG_OFFSET(r3),
+  /*  zero              at                v0                v1       */
+  -1, REG_OFFSET (r1), REG_OFFSET (r2), REG_OFFSET (r3),
 
-  /*  a0               a1                a2                a3       */
-  REG_OFFSET(r4),   REG_OFFSET(r5),   REG_OFFSET(r6),   REG_OFFSET(r7),
+  /*  a0                a1                a2                a3       */
+  REG_OFFSET (r4), REG_OFFSET (r5), REG_OFFSET (r6), REG_OFFSET (r7),
 
-  /*  t0               t1                t2                t3       */
-  REG_OFFSET(r8),   REG_OFFSET(r9),   REG_OFFSET(r10),  REG_OFFSET(r11),
+  /*  t0                t1                t2                t3       */
+  REG_OFFSET (r8), REG_OFFSET (r9), REG_OFFSET (r10), REG_OFFSET (r11),
 
-  /*  t4               t5                t6                t7       */
-  REG_OFFSET(r12),  REG_OFFSET(r13),  REG_OFFSET(r14),  REG_OFFSET(r15),
+  /*  t4                t5                t6                t7       */
+  REG_OFFSET (r12), REG_OFFSET (r13), REG_OFFSET (r14), REG_OFFSET (r15),
 
-  /*  s0               s1                s2                s3       */
-  REG_OFFSET(r16),  REG_OFFSET(r17),  REG_OFFSET(r18),  REG_OFFSET(r19),
+  /*  s0                s1                s2                s3       */
+  REG_OFFSET (r16), REG_OFFSET (r17), REG_OFFSET (r18), REG_OFFSET (r19),
 
-  /*  s4               s5                s6                s7       */
-  REG_OFFSET(r20),  REG_OFFSET(r21),  REG_OFFSET(r22),  REG_OFFSET(r23),
+  /*  s4                s5                s6                s7       */
+  REG_OFFSET (r20), REG_OFFSET (r21), REG_OFFSET (r22), REG_OFFSET (r23),
 
-  /*  t8               t9                k0                k1       */
-  REG_OFFSET(r24),  REG_OFFSET(r25),  REG_OFFSET(r26),  REG_OFFSET(r27),
+  /*  t8                t9                k0                k1       */
+  REG_OFFSET (r24), REG_OFFSET (r25), REG_OFFSET (r26), REG_OFFSET (r27),
 
-  /*  gp               sp            s8(30) == fp(72)      ra       */
-  REG_OFFSET(r28),  REG_OFFSET(r29),  REG_OFFSET(r30),  REG_OFFSET(r31),
+  /*  gp                sp            s8(30) == fp(72)      ra       */
+  REG_OFFSET (r28), REG_OFFSET (r29), REG_OFFSET (r30), REG_OFFSET (r31),
 
   /*  sr(32) PS_REGNUM   */
-  EREG_OFFSET(coproc_state),
-
-  /*  lo(33)           hi(34)    */
-  REG_OFFSET(mdlo), REG_OFFSET(mdhi),
-
-  /*  bad(35)                        cause(36)          pc(37)  */
-  EREG_OFFSET(address),  EREG_OFFSET(cause), REG_OFFSET(pc),
-
-  /*  f0(38)            f1(39)             f2(40)             f3(41)   */
-  CREG_OFFSET(r0),   CREG_OFFSET(r1),   CREG_OFFSET(r2),   CREG_OFFSET(r3),
-  CREG_OFFSET(r4),   CREG_OFFSET(r5),   CREG_OFFSET(r6),   CREG_OFFSET(r7),
-  CREG_OFFSET(r8),   CREG_OFFSET(r9),   CREG_OFFSET(r10),  CREG_OFFSET(r11),
-  CREG_OFFSET(r12),  CREG_OFFSET(r13),  CREG_OFFSET(r14),  CREG_OFFSET(r15),
-  CREG_OFFSET(r16),  CREG_OFFSET(r17),  CREG_OFFSET(r18),  CREG_OFFSET(r19),
-  CREG_OFFSET(r20),  CREG_OFFSET(r21),  CREG_OFFSET(r22),  CREG_OFFSET(r23),
-  CREG_OFFSET(r24),  CREG_OFFSET(r25),  CREG_OFFSET(r26),  CREG_OFFSET(r27),
-  CREG_OFFSET(r28),  CREG_OFFSET(r29),  CREG_OFFSET(r30),  CREG_OFFSET(r31),
-
-  /*  fsr(70)          fir(71)         fp(72) == s8(30) */
-  CREG_OFFSET(csr),  CREG_OFFSET(esr),  REG_OFFSET(r30)
+  EREG_OFFSET (coproc_state),
+
+  /*  lo(33)            hi(34)    */
+  REG_OFFSET (mdlo), REG_OFFSET (mdhi),
+
+  /*  bad(35)                 cause(36)          pc(37)  */
+  EREG_OFFSET (address), EREG_OFFSET (cause), REG_OFFSET (pc),
+
+  /*  f0(38)             f1(39)             f2(40)             f3(41)   */
+  CREG_OFFSET (r0), CREG_OFFSET (r1), CREG_OFFSET (r2), CREG_OFFSET (r3),
+  CREG_OFFSET (r4), CREG_OFFSET (r5), CREG_OFFSET (r6), CREG_OFFSET (r7),
+  CREG_OFFSET (r8), CREG_OFFSET (r9), CREG_OFFSET (r10), CREG_OFFSET (r11),
+  CREG_OFFSET (r12), CREG_OFFSET (r13), CREG_OFFSET (r14), CREG_OFFSET (r15),
+  CREG_OFFSET (r16), CREG_OFFSET (r17), CREG_OFFSET (r18), CREG_OFFSET (r19),
+  CREG_OFFSET (r20), CREG_OFFSET (r21), CREG_OFFSET (r22), CREG_OFFSET (r23),
+  CREG_OFFSET (r24), CREG_OFFSET (r25), CREG_OFFSET (r26), CREG_OFFSET (r27),
+  CREG_OFFSET (r28), CREG_OFFSET (r29), CREG_OFFSET (r30), CREG_OFFSET (r31),
+
+  /*  fsr(70)           fir(71)         fp(72) == s8(30) */
+  CREG_OFFSET (csr), CREG_OFFSET (esr), REG_OFFSET (r30)
 };
 #else
 /* If the compiler does not grok the above defines */
-static int reg_offset[] = 
+static int reg_offset[] =
 {
 /* mach_thread_state offsets: */
-  -1,  0,  4,  8,  12, 16, 20, 24,  28, 32, 36, 40,  44, 48, 52, 56,
-  60, 64, 68, 72,  76, 80, 84, 88,  92, 96,100,104, 108,112,116,120,
+  -1, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
+  60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120,
 /*sr, lo, hi,addr,cause,pc   */
-   8,124,128,  4,   0,132,
+  8, 124, 128, 4, 0, 132,
 /* mach_float_state offsets: */
-   0,  4,  8, 12,  16, 20, 24, 28,  32, 36, 40, 44,  48, 52, 56, 60,
-  64, 68, 72, 76,  80, 84, 88, 92,  96,100,104,108, 112,116,120,124,
-/*fsr,fir*/
128,132,
+  0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
+  64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124,
+/*fsr,fir */
 128, 132,
 /* FP_REGNUM pseudo maps to s8==r30 in mach_thread_state */
- 116
 116
 };
 #endif
 
@@ -143,18 +144,18 @@ void
 fetch_inferior_registers (regno)
      int regno;
 {
-  kern_return_t ret;  
+  kern_return_t ret;
 
-  thread_state_data_t      state;
-  struct mips_exc_state    exc_state;
+  thread_state_data_t state;
+  struct mips_exc_state exc_state;
 
-  int stateCnt   = MIPS_THREAD_STATE_COUNT;
+  int stateCnt = MIPS_THREAD_STATE_COUNT;
 
-  int which_regs = 0; /* A bit mask */
+  int which_regs = 0;          /* A bit mask */
 
-  if (! MACH_PORT_VALID (current_thread))
+  if (!MACH_PORT_VALID (current_thread))
     error ("fetch inferior registers: Invalid thread");
-  
+
   if (regno < -1 || regno >= NUM_REGS)
     error ("invalid register %d supplied to fetch_inferior_registers", regno);
 
@@ -192,24 +193,24 @@ fetch_inferior_registers (regno)
          if (regno == MACH_FP_REGNUM || regno == FP_REGNUM)
            {
              supply_register (FP_REGNUM,
-                              (char *)state+reg_offset[ MACH_FP_REGNUM ]);
+                              (char *) state + reg_offset[MACH_FP_REGNUM]);
              supply_register (MACH_FP_REGNUM,
-                              (char *)state+reg_offset[ MACH_FP_REGNUM ]);
+                              (char *) state + reg_offset[MACH_FP_REGNUM]);
            }
          else
            supply_register (regno,
-                            (char *)state+reg_offset[ regno ]);
+                            (char *) state + reg_offset[regno]);
          return;
        }
-                          
+
       /* ZERO_REGNUM is always zero */
       *(int *) registers = 0;
-      
+
       /* Copy thread saved regs 1..31 to gdb's reg value array
        * Luckily, they are contiquous
        */
       FETCH_REGS (state, 1, 31);
-      
+
       /* Copy mdlo and mdhi */
       FETCH_REGS (state, LO_REGNUM, 2);
 
@@ -228,7 +229,7 @@ fetch_inferior_registers (regno)
       stateCnt = MIPS_EXC_STATE_COUNT;
       ret = thread_get_state (current_thread,
                              MIPS_EXC_STATE,
-                             (thread_state_t) &exc_state,
+                             (thread_state_t) & exc_state,
                              &stateCnt);
       CHK ("fetch inferior regs (exc): thread_get_state", ret);
 
@@ -238,15 +239,15 @@ fetch_inferior_registers (regno)
 
       /* cproc_state: Which coprocessors the thread uses */
       supply_register (PS_REGNUM,
-                      (char *)&exc_state+reg_offset[ PS_REGNUM ]);
-      
+                      (char *) &exc_state + reg_offset[PS_REGNUM]);
+
       if (which_regs == REGS_EXC || which_regs == REGS_ALL)
        {
          supply_register (BADVADDR_REGNUM,
-                          (char *)&exc_state+reg_offset[ BADVADDR_REGNUM ]);
-         
+                        (char *) &exc_state + reg_offset[BADVADDR_REGNUM]);
+
          supply_register (CAUSE_REGNUM,
-                          (char *)&exc_state+reg_offset[ CAUSE_REGNUM ]);
+                          (char *) &exc_state + reg_offset[CAUSE_REGNUM]);
          if (which_regs == REGS_EXC)
            return;
        }
@@ -256,9 +257,9 @@ fetch_inferior_registers (regno)
   if (which_regs & REGS_COP1)
     {
       /* If the thread does not have saved COPROC1, set regs to zero */
-      
-      if (! (exc_state.coproc_state & MIPS_STATUS_USE_COP1))
-       bzero (&registers[ REGISTER_BYTE (FP0_REGNUM) ],
+
+      if (!(exc_state.coproc_state & MIPS_STATUS_USE_COP1))
+       bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
               sizeof (struct mips_float_state));
       else
        {
@@ -268,18 +269,18 @@ fetch_inferior_registers (regno)
                                  state,
                                  &stateCnt);
          CHK ("fetch inferior regs (floats): thread_get_state", ret);
-         
+
          if (regno != -1)
            {
              supply_register (regno,
-                              (char *)state+reg_offset[ regno ]);
+                              (char *) state + reg_offset[regno]);
              return;
            }
-         
+
          FETCH_REGS (state, FP0_REGNUM, 34);
        }
     }
-  
+
   /* All registers are valid, if not returned yet */
   registers_fetched ();
 }
@@ -300,21 +301,21 @@ store_inferior_registers (regno)
 {
   thread_state_data_t state;
   kern_return_t ret;
-  
-  if (! MACH_PORT_VALID (current_thread))
+
+  if (!MACH_PORT_VALID (current_thread))
     error ("store inferior registers: Invalid thread");
-  
+
   /* Check for read only regs.
    * @@ If some of these is can be changed, fix this
    */
-  if (regno == ZERO_REGNUM     ||
-      regno == PS_REGNUM       ||
-      regno == BADVADDR_REGNUM ||
-      regno == CAUSE_REGNUM    ||
+  if (regno == ZERO_REGNUM ||
+      regno == PS_REGNUM ||
+      regno == BADVADDR_REGNUM ||
+      regno == CAUSE_REGNUM ||
       regno == FCRIR_REGNUM)
     {
       message ("You can not alter read-only register `%s'",
-              REGISTER_NAME ( regno ));
+              REGISTER_NAME (regno));
       fetch_inferior_registers (regno);
       return;
     }
@@ -324,8 +325,8 @@ store_inferior_registers (regno)
       /* Don't allow these to change */
 
       /* ZERO_REGNUM */
-      *(int *)registers = 0;
-      
+      *(int *) registers = 0;
+
       fetch_inferior_registers (PS_REGNUM);
       fetch_inferior_registers (BADVADDR_REGNUM);
       fetch_inferior_registers (CAUSE_REGNUM);
@@ -346,7 +347,7 @@ store_inferior_registers (regno)
              &registers[REGISTER_BYTE (FP_REGNUM)],
              REGISTER_RAW_SIZE (FP_REGNUM));
 #endif
-      
+
       /* Save gdb's regs 1..31 to thread saved regs 1..31
        * Luckily, they are contiquous
        */
@@ -355,7 +356,7 @@ store_inferior_registers (regno)
       /* Save mdlo, mdhi */
       STORE_REGS (state, LO_REGNUM, 2);
 
-     /* Save PC */
+      /* Save PC */
       STORE_REGS (state, PC_REGNUM, 1);
 
       ret = thread_set_state (current_thread,
@@ -364,7 +365,7 @@ store_inferior_registers (regno)
                              MIPS_FLOAT_STATE_COUNT);
       CHK ("store inferior regs : thread_set_state", ret);
     }
-  
+
   if (regno == -1 || regno >= FP0_REGNUM)
     {
       /* If thread has floating state, save it */
@@ -372,7 +373,7 @@ store_inferior_registers (regno)
        {
          /* Do NOT save FCRIR_REGNUM */
          STORE_REGS (state, FP0_REGNUM, 33);
-       
+
          ret = thread_set_state (current_thread,
                                  MIPS_FLOAT_STATE,
                                  state,
index 343a7b1027af59d9fbfbf78bbb5b197fec1247ee..94e70a9c4f9b0af0d4b8a7d9a1d3d5155b08b4c9 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Alessandro Forin (af@cs.cmu.edu) at CMU.  Major work
    by Per Bothner, John Gilmore and Ian Lance Taylor at Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Read symbols from an ECOFF file.  Most of the work is done in
    mdebugread.c.  */
@@ -58,7 +59,7 @@ mipscoff_symfile_finish PARAMS ((struct objfile *));
 
 static void
 read_alphacoff_dynamic_symtab PARAMS ((struct section_offsets *,
-                                      struct objfile *objfile));
+                                      struct objfile * objfile));
 
 /* Initialize anything that needs initializing when a completely new
    symbol file is specified (not just adding some symbols from another
@@ -92,7 +93,7 @@ mipscoff_symfile_read (objfile, section_offsets, mainline)
      int mainline;
 {
   bfd *abfd = objfile->obfd;
-  struct cleanup * back_to;
+  struct cleanup *back_to;
 
   init_minimal_symbol_collection ();
   back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
@@ -158,35 +159,42 @@ mipscoff_symfile_finish (objfile)
 
 /* Format of an alpha external ELF symbol.  */
 
-typedef struct {
-  unsigned char        st_name[4];             /* Symbol name, index in string tbl */
-  unsigned char        st_pad[4];              /* Pad to long word boundary */
-  unsigned char        st_value[8];            /* Value of the symbol */
-  unsigned char        st_size[4];             /* Associated symbol size */
-  unsigned char        st_info[1];             /* Type and binding attributes */
-  unsigned char        st_other[1];            /* No defined meaning, 0 */
-  unsigned char        st_shndx[2];            /* Associated section index */
-} Elfalpha_External_Sym;
+typedef struct
+{
+  unsigned char st_name[4];    /* Symbol name, index in string tbl */
+  unsigned char st_pad[4];     /* Pad to long word boundary */
+  unsigned char st_value[8];   /* Value of the symbol */
+  unsigned char st_size[4];    /* Associated symbol size */
+  unsigned char st_info[1];    /* Type and binding attributes */
+  unsigned char st_other[1];   /* No defined meaning, 0 */
+  unsigned char st_shndx[2];   /* Associated section index */
+}
+Elfalpha_External_Sym;
 
 /* Format of an alpha external ELF dynamic info structure.  */
 
-typedef struct {
-  unsigned char        d_tag[4];               /* Tag */
-  unsigned char        d_pad[4];               /* Pad to long word boundary */
-  union {
-    unsigned char d_ptr[8];            /* Pointer value */
-    unsigned char d_val[4];            /* Integer value */
-  } d_un;
-} Elfalpha_External_Dyn;
+typedef struct
+  {
+    unsigned char d_tag[4];    /* Tag */
+    unsigned char d_pad[4];    /* Pad to long word boundary */
+    union
+      {
+       unsigned char d_ptr[8]; /* Pointer value */
+       unsigned char d_val[4]; /* Integer value */
+      }
+    d_un;
+  }
+Elfalpha_External_Dyn;
 
 /* Struct to obtain the section pointers for alpha dynamic symbol info.  */
 
-struct alphacoff_dynsecinfo {
-  asection *sym_sect;          /* Section pointer for .dynsym section */
-  asection *str_sect;          /* Section pointer for .dynstr section */
-  asection *dyninfo_sect;      /* Section pointer for .dynamic section */
-  asection *got_sect;          /* Section pointer for .got section */
-};
+struct alphacoff_dynsecinfo
+  {
+    asection *sym_sect;                /* Section pointer for .dynsym section */
+    asection *str_sect;                /* Section pointer for .dynstr section */
+    asection *dyninfo_sect;    /* Section pointer for .dynamic section */
+    asection *got_sect;                /* Section pointer for .got section */
+  };
 
 static void
 alphacoff_locate_sections PARAMS ((bfd *, asection *, void *));
@@ -259,7 +267,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
 
   /* Locate the dynamic symbols sections and read them in.  */
   memset ((char *) &si, 0, sizeof (si));
-  bfd_map_over_sections (abfd, alphacoff_locate_sections, (PTR) &si);
+  bfd_map_over_sections (abfd, alphacoff_locate_sections, (PTR) & si);
   if (si.sym_sect == NULL
       || si.str_sect == NULL
       || si.dyninfo_sect == NULL
@@ -276,16 +284,16 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
   got_secptr = alloca (got_secsize);
 
   if (!bfd_get_section_contents (abfd, si.sym_sect, sym_secptr,
-                                (file_ptr)0, sym_secsize))
+                                (file_ptr) 0, sym_secsize))
     return;
   if (!bfd_get_section_contents (abfd, si.str_sect, str_secptr,
-                                (file_ptr)0, str_secsize))
+                                (file_ptr) 0, str_secsize))
     return;
   if (!bfd_get_section_contents (abfd, si.dyninfo_sect, dyninfo_secptr,
-                                (file_ptr)0, dyninfo_secsize))
+                                (file_ptr) 0, dyninfo_secsize))
     return;
   if (!bfd_get_section_contents (abfd, si.got_sect, got_secptr,
-                                (file_ptr)0, got_secsize))
+                                (file_ptr) 0, got_secsize))
     return;
 
   /* Find the number of local GOT entries and the index for the
@@ -294,7 +302,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
        dyninfo_p < dyninfo_end;
        dyninfo_p += sizeof (Elfalpha_External_Dyn))
     {
-      Elfalpha_External_Dyn *x_dynp = (Elfalpha_External_Dyn *)dyninfo_p;
+      Elfalpha_External_Dyn *x_dynp = (Elfalpha_External_Dyn *) dyninfo_p;
       long dyn_tag;
 
       dyn_tag = bfd_h_get_32 (abfd, (bfd_byte *) x_dynp->d_tag);
@@ -371,7 +379,7 @@ read_alphacoff_dynamic_symtab (section_offsets, objfile)
          if (sym_value == 0)
            {
              int got_entry_offset =
-               (i - dt_mips_gotsym + dt_mips_local_gotno) * got_entry_size;
+             (i - dt_mips_gotsym + dt_mips_local_gotno) * got_entry_size;
 
              if (got_entry_offset < 0 || got_entry_offset >= got_secsize)
                continue;
index df4b6e9a090e36b66eb4f61d6732cdcfc5eca607..8551186bc0fe847b6ec88e8ef4252010493fce8e 100644 (file)
@@ -1,21 +1,22 @@
 /* Native support for MIPS running SVR4, for GDB.
    Copyright 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -37,21 +38,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  * any MIPS SVR4 target.
  */
 
-void 
+void
 supply_gregset (gregsetp)
      gregset_t *gregsetp;
 {
   register int regi;
   register greg_t *regp = &(*gregsetp)[0];
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   for (regi = 0; regi <= CXT_RA; regi++)
-    supply_register (regi, (char *)(regp + regi));
+    supply_register (regi, (char *) (regp + regi));
 
-  supply_register (PC_REGNUM, (char *)(regp + CXT_EPC));
-  supply_register (HI_REGNUM, (char *)(regp + CXT_MDHI));
-  supply_register (LO_REGNUM, (char *)(regp + CXT_MDLO));
-  supply_register (CAUSE_REGNUM, (char *)(regp + CXT_CAUSE));
+  supply_register (PC_REGNUM, (char *) (regp + CXT_EPC));
+  supply_register (HI_REGNUM, (char *) (regp + CXT_MDHI));
+  supply_register (LO_REGNUM, (char *) (regp + CXT_MDLO));
+  supply_register (CAUSE_REGNUM, (char *) (regp + CXT_CAUSE));
 
   /* Fill inaccessible registers with zero.  */
   supply_register (PS_REGNUM, zerobuf);
@@ -72,19 +74,19 @@ fill_gregset (gregsetp, regno)
 
   for (regi = 0; regi <= 32; regi++)
     if ((regno == -1) || (regno == regi))
-      *(regp + regi) = *(greg_t *) &registers[REGISTER_BYTE (regi)];
+      *(regp + regi) = *(greg_t *) & registers[REGISTER_BYTE (regi)];
 
   if ((regno == -1) || (regno == PC_REGNUM))
-    *(regp + CXT_EPC) = *(greg_t *) &registers[REGISTER_BYTE (PC_REGNUM)];
+    *(regp + CXT_EPC) = *(greg_t *) & registers[REGISTER_BYTE (PC_REGNUM)];
 
   if ((regno == -1) || (regno == CAUSE_REGNUM))
-    *(regp + CXT_CAUSE) = *(greg_t *) &registers[REGISTER_BYTE (CAUSE_REGNUM)];
+    *(regp + CXT_CAUSE) = *(greg_t *) & registers[REGISTER_BYTE (CAUSE_REGNUM)];
 
   if ((regno == -1) || (regno == HI_REGNUM))
-    *(regp + CXT_MDHI) = *(greg_t *) &registers[REGISTER_BYTE (HI_REGNUM)];
+    *(regp + CXT_MDHI) = *(greg_t *) & registers[REGISTER_BYTE (HI_REGNUM)];
 
   if ((regno == -1) || (regno == LO_REGNUM))
-    *(regp + CXT_MDLO) = *(greg_t *) &registers[REGISTER_BYTE (LO_REGNUM)];
+    *(regp + CXT_MDLO) = *(greg_t *) & registers[REGISTER_BYTE (LO_REGNUM)];
 }
 
 /*
@@ -100,13 +102,14 @@ supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
   register int regi;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   for (regi = 0; regi < 32; regi++)
     supply_register (FP0_REGNUM + regi,
-                    (char *)&fpregsetp->fp_r.fp_regs[regi]);
+                    (char *) &fpregsetp->fp_r.fp_regs[regi]);
 
-  supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr);
+  supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr);
 
   /* FIXME: how can we supply FCRIR_REGNUM?  The ABI doesn't tell us. */
   supply_register (FCRIR_REGNUM, zerobuf);
@@ -126,12 +129,12 @@ fill_fpregset (fpregsetp, regno)
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
          to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
-         memcpy(to, from, REGISTER_RAW_SIZE (regi));
+         memcpy (to, from, REGISTER_RAW_SIZE (regi));
        }
     }
 
   if ((regno == -1) || (regno == FCRCS_REGNUM))
-    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE(FCRCS_REGNUM)];
+    fpregsetp->fp_csr = *(unsigned *) &registers[REGISTER_BYTE (FCRCS_REGNUM)];
 }
 
 
index 44188ba408cbe2be92632acd971b3f9f3e4600a1..f8637e89c39a550ec05e0dd207b29fb9089d10c2 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the Matsushita MN10200 for GDB, the GNU debugger.
    Copyright 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -28,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcore.h"
 #include "symfile.h"
 
-       
+
 /* Should call_function allocate stack space for a struct return?  */
 int
 mn10200_use_struct_convention (gcc_p, type)
@@ -37,8 +38,6 @@ mn10200_use_struct_convention (gcc_p, type)
 {
   return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 8);
 }
-
-
 /* *INDENT-OFF* */
 /* The main purpose of this file is dealing with prologues to extract
    information about stack frames and saved registers.
@@ -104,15 +103,18 @@ mn10200_use_struct_convention (gcc_p, type)
       frame chain to not bother trying to unwind past this frame.  */
 /* *INDENT-ON* */
 
+
+
+
 #define MY_FRAME_IN_SP 0x1
 #define MY_FRAME_IN_FP 0x2
 #define CALLER_A2_IN_A0 0x4
 #define NO_MORE_FRAMES 0x8
+
 static CORE_ADDR
 mn10200_analyze_prologue (fi, pc)
-    struct frame_info *fi;
-    CORE_ADDR pc;
+     struct frame_info *fi;
+     CORE_ADDR pc;
 {
   CORE_ADDR func_addr, func_end, addr, stop;
   CORE_ADDR stack_size;
@@ -137,7 +139,7 @@ mn10200_analyze_prologue (fi, pc)
   if (strcmp (name, "start") == 0)
     {
       if (fi)
-        fi->status = NO_MORE_FRAMES;
+       fi->status = NO_MORE_FRAMES;
       return pc;
     }
 
@@ -204,14 +206,14 @@ mn10200_analyze_prologue (fi, pc)
     }
 
   /* Now see if we have a frame pointer.
-       
+
      Search for mov a2,a0 (0xf278)
-        then   mov a3,a2 (0xf27e).  */
+     then       mov a3,a2 (0xf27e).  */
 
   if (buf[0] == 0xf2 && buf[1] == 0x78)
     {
       /* Our caller's $a2 will be found in $a0 now.  Note it for
-        our callers.  */
+         our callers.  */
       if (fi)
        fi->status |= CALLER_A2_IN_A0;
       addr += 2;
@@ -253,11 +255,11 @@ mn10200_analyze_prologue (fi, pc)
     }
 
   /* Next we should allocate the local frame.
-       
+
      Search for add imm8,a3 (0xd3XX)
-        or     add imm16,a3 (0xf70bXXXX)
-        or     add imm24,a3 (0xf467XXXXXX).
-       
+     or add imm16,a3 (0xf70bXXXX)
+     or add imm24,a3 (0xf467XXXXXX).
+
      If none of the above was found, then this prologue has
      no stack, and therefore can't have any register saves,
      so quit now.  */
@@ -335,11 +337,11 @@ mn10200_analyze_prologue (fi, pc)
       status = target_read_memory (addr + 1, buf, 2);
       if (status != 0)
        {
-         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
-           fi->frame = read_sp ();
+         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+           fi->frame = read_sp ();
          return addr;
        }
-      
+
       /* Get the PC this instruction will branch to.  */
       temp = (extract_signed_integer (buf, 2) + addr + 3) & 0xffffff;
 
@@ -347,8 +349,8 @@ mn10200_analyze_prologue (fi, pc)
       status = find_pc_partial_function (temp, &name, NULL, NULL);
       if (status == 0)
        {
-         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
-           fi->frame = read_sp ();
+         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+           fi->frame = read_sp ();
          return addr;
        }
 
@@ -376,11 +378,11 @@ mn10200_analyze_prologue (fi, pc)
       status = target_read_memory (addr + 2, buf, 3);
       if (status != 0)
        {
-         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
-           fi->frame = read_sp ();
+         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+           fi->frame = read_sp ();
          return addr;
        }
-      
+
       /* Get the PC this instruction will branch to.  */
       temp = (extract_signed_integer (buf, 3) + addr + 5) & 0xffffff;
 
@@ -388,8 +390,8 @@ mn10200_analyze_prologue (fi, pc)
       status = find_pc_partial_function (temp, &name, NULL, NULL);
       if (status == 0)
        {
-         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
-           fi->frame = read_sp ();
+         if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+           fi->frame = read_sp ();
          return addr;
        }
 
@@ -417,7 +419,7 @@ mn10200_analyze_prologue (fi, pc)
       int outgoing_args_size = 0;
 
       /* First adjust the stack size for this function.  The out of
-        line prologue saves 4 registers (16bytes of data).  */
+         line prologue saves 4 registers (16bytes of data).  */
       if (fi)
        fi->stack_size -= 16;
 
@@ -426,12 +428,12 @@ mn10200_analyze_prologue (fi, pc)
        fi->frame = read_sp () - fi->stack_size;
 
       /* After the out of line prologue, there may be another
-        stack adjustment for the outgoing arguments.
+         stack adjustment for the outgoing arguments.
+
+         Search for add imm8,a3 (0xd3XX)
+         or     add imm16,a3 (0xf70bXXXX)
+         or     add imm24,a3 (0xf467XXXXXX).  */
 
-        Search for add imm8,a3 (0xd3XX)
-           or  add imm16,a3 (0xf70bXXXX)
-           or  add imm24,a3 (0xf467XXXXXX).  */
-       
       status = target_read_memory (addr, buf, 2);
       if (status != 0)
        {
@@ -488,12 +490,12 @@ mn10200_analyze_prologue (fi, pc)
        outgoing_args_size = 0;
 
       /* Now that we know the size of the outgoing arguments, fix
-        fi->frame again if this is the innermost frame.  */
+         fi->frame again if this is the innermost frame.  */
       if (fi && fi->next == NULL)
        fi->frame -= outgoing_args_size;
 
       /* Note the register save information and update the stack
-        size for this frame too.  */
+         size for this frame too.  */
       if (fi)
        {
          fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
@@ -519,12 +521,12 @@ mn10200_analyze_prologue (fi, pc)
      and thus the number of different instructions we need to
      check is greatly reduced because we know the displacements
      will be small.
-       
+
      Search for movx d2,(X,a3) (0xf55eXX)
-        then   movx d3,(X,a3) (0xf55fXX)
-        then   mov  a1,(X,a3) (0x5dXX)    No frame pointer case
-        then   mov  a2,(X,a3) (0x5eXX)    No frame pointer case
-        or  mov  a0,(X,a3) (0x5cXX)       Frame pointer case.  */
+     then       movx d3,(X,a3) (0xf55fXX)
+     then       mov  a1,(X,a3) (0x5dXX)    No frame pointer case
+     then       mov  a2,(X,a3) (0x5eXX)    No frame pointer case
+     or  mov  a0,(X,a3) (0x5cXX)           Frame pointer case.  */
 
   status = target_read_memory (addr, buf, 2);
   if (status != 0)
@@ -598,7 +600,7 @@ mn10200_analyze_prologue (fi, pc)
     }
   return addr;
 }
-  
+
 /* Function: frame_chain
    Figure out and return the caller's frame pointer given current
    frame_info struct.
@@ -615,7 +617,7 @@ mn10200_frame_chain (fi)
   /* Walk through the prologue to determine the stack size,
      location of saved registers, end of the prologue, etc.  */
   if (fi->status == 0)
-    mn10200_analyze_prologue (fi, (CORE_ADDR)0);
+    mn10200_analyze_prologue (fi, (CORE_ADDR) 0);
 
   /* Quit now if mn10200_analyze_prologue set NO_MORE_FRAMES.  */
   if (fi->status & NO_MORE_FRAMES)
@@ -624,19 +626,19 @@ mn10200_frame_chain (fi)
   /* Now that we've analyzed our prologue, determine the frame
      pointer for our caller.
 
-       If our caller has a frame pointer, then we need to
-       find the entry value of $a2 to our function.
+     If our caller has a frame pointer, then we need to
+     find the entry value of $a2 to our function.
 
-        If CALLER_A2_IN_A0, then the chain is in $a0.
+     If CALLER_A2_IN_A0, then the chain is in $a0.
 
-        If fsr.regs[6] is nonzero, then it's at the memory
-        location pointed to by fsr.regs[6].
+     If fsr.regs[6] is nonzero, then it's at the memory
+     location pointed to by fsr.regs[6].
 
-        Else it's still in $a2.
+     Else it's still in $a2.
+
+     If our caller does not have a frame pointer, then his
+     frame base is fi->frame + -caller's stack size + 4.  */
 
-       If our caller does not have a frame pointer, then his
-       frame base is fi->frame + -caller's stack size + 4.  */
-       
   /* The easiest way to get that info is to analyze our caller's frame.
 
      So we set up a dummy frame and call mn10200_analyze_prologue to
@@ -651,7 +653,7 @@ mn10200_frame_chain (fi)
   if (dummy_frame.status & MY_FRAME_IN_FP)
     {
       /* Our caller has a frame pointer.  So find the frame in $a2, $a0,
-        or in the stack.  */
+         or in the stack.  */
       if (fi->fsr.regs[6])
        return (read_memory_integer (fi->fsr.regs[FP_REGNUM], REGISTER_SIZE)
                & 0xffffff);
@@ -663,7 +665,7 @@ mn10200_frame_chain (fi)
   else
     {
       /* Our caller does not have a frame pointer.  So his frame starts
-        at the base of our frame (fi->frame) + <his size> + 4 (saved pc).  */
+         at the base of our frame (fi->frame) + <his size> + 4 (saved pc).  */
       return fi->frame + -dummy_frame.stack_size + 4;
     }
 }
@@ -690,7 +692,7 @@ mn10200_pop_frame (frame)
 {
   int regnum;
 
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     generic_pop_dummy_frame ();
   else
     {
@@ -703,7 +705,7 @@ mn10200_pop_frame (frame)
            ULONGEST value;
 
            value = read_memory_unsigned_integer (frame->fsr.regs[regnum],
-                                                 REGISTER_RAW_SIZE (regnum));
+                                               REGISTER_RAW_SIZE (regnum));
            write_register (regnum, value);
          }
 
@@ -747,16 +749,16 @@ mn10200_push_arguments (nargs, args, sp, struct_return, struct_addr)
       int arg_length = (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 1) & ~1;
 
       /* If we've used all argument registers, then this argument is
-        pushed.  */
+         pushed.  */
       if (regsused >= 2 || arg_length > 4)
        {
          regsused = 2;
          len += arg_length;
        }
       /* We know we've got some arg register space left.  If this argument
-        will fit entirely in regs, then put it there.  */
+         will fit entirely in regs, then put it there.  */
       else if (arg_length <= 2
-              || TYPE_CODE (VALUE_TYPE (args[argnum])) == TYPE_CODE_PTR) 
+              || TYPE_CODE (VALUE_TYPE (args[argnum])) == TYPE_CODE_PTR)
        {
          regsused++;
        }
@@ -786,13 +788,13 @@ mn10200_push_arguments (nargs, args, sp, struct_return, struct_addr)
          && TYPE_LENGTH (VALUE_TYPE (*args)) > 8)
        {
          /* XXX Wrong, we want a pointer to this argument.  */
-          len = TYPE_LENGTH (VALUE_TYPE (*args));
-          val = (char *)VALUE_CONTENTS (*args);
+         len = TYPE_LENGTH (VALUE_TYPE (*args));
+         val = (char *) VALUE_CONTENTS (*args);
        }
       else
        {
          len = TYPE_LENGTH (VALUE_TYPE (*args));
-         val = (char *)VALUE_CONTENTS (*args);
+         val = (char *) VALUE_CONTENTS (*args);
        }
 
       if (regsused < 2
@@ -829,7 +831,7 @@ mn10200_push_arguments (nargs, args, sp, struct_return, struct_addr)
 /* Function: push_return_address (pc)
    Set up the return address for the inferior function call.
    Needed for targets where we don't actually execute a JSR/BSR instruction */
+
 CORE_ADDR
 mn10200_push_return_address (pc, sp)
      CORE_ADDR pc;
@@ -845,7 +847,7 @@ mn10200_push_return_address (pc, sp)
 /* Function: store_struct_return (addr,sp)
    Store the structure value return address for an inferior function
    call.  */
+
 CORE_ADDR
 mn10200_store_struct_return (addr, sp)
      CORE_ADDR addr;
@@ -855,7 +857,7 @@ mn10200_store_struct_return (addr, sp)
   write_register (0, addr);
   return sp;
 }
+
 /* 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
@@ -904,4 +906,3 @@ _initialize_mn10200_tdep ()
 {
   tm_print_insn = print_insn_mn10200;
 }
-
index c758d7748550c77c12112a84c478001d0157c7dd..9f54e0de1588e185fc3f2fb13deb2598cc7b6c62 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
    Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -28,23 +29,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcore.h"
 #include "symfile.h"
 
-static CORE_ADDR mn10300_analyze_prologue PARAMS ((struct frame_info *fi,
-                                                 CORE_ADDR pc));
+static CORE_ADDR mn10300_analyze_prologue PARAMS ((struct frame_info * fi,
+                                                  CORE_ADDR pc));
 
 /* Additional info used by the frame */
 
 struct frame_extra_info
-{
-  int status;
-  int stack_size;
-};
+  {
+    int status;
+    int stack_size;
+  };
 
 
-static char *mn10300_generic_register_names[] = 
-{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
 "sp", "pc", "mdr", "psw", "lir", "lar", "", "",
 "", "", "", "", "", "", "", "",
 "", "", "", "", "", "", "", "fp" };
+static char *mn10300_generic_register_names[] =
+{"d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
+ "sp", "pc", "mdr", "psw", "lir", "lar", "", "",
+ "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "fp"};
 
 static char **mn10300_register_names = mn10300_generic_register_names;
 
@@ -145,7 +146,8 @@ mn10300_breakpoint_from_pc (bp_addr, bp_size)
      CORE_ADDR *bp_addr;
      int *bp_size;
 {
-  static char breakpoint[] = {0xff};
+  static char breakpoint[] =
+  {0xff};
   *bp_size = 1;
   return breakpoint;
 }
@@ -156,8 +158,8 @@ mn10300_breakpoint_from_pc (bp_addr, bp_size)
 
 static void
 fix_frame_pointer (fi, stack_size)
-    struct frame_info *fi;
-    int stack_size;
+     struct frame_info *fi;
+     int stack_size;
 {
   if (fi && fi->next == NULL)
     {
@@ -174,8 +176,8 @@ fix_frame_pointer (fi, stack_size)
 
 static void
 set_movm_offsets (fi, movm_args)
-    struct frame_info *fi;
-    int movm_args;
+     struct frame_info *fi;
+     int movm_args;
 {
   int offset = 0;
 
@@ -210,53 +212,53 @@ set_movm_offsets (fi, movm_args)
 
    For reference here's how prologues look on the mn10300:
 
-     With frame pointer:
-       movm [d2,d3,a2,a3],sp
-       mov sp,a3
-       add <size>,sp
+   With frame pointer:
+   movm [d2,d3,a2,a3],sp
+   mov sp,a3
+   add <size>,sp
 
-     Without frame pointer:
-       movm [d2,d3,a2,a3],sp (if needed)
-        add <size>,sp
+   Without frame pointer:
+   movm [d2,d3,a2,a3],sp (if needed)
+   add <size>,sp
 
    One day we might keep the stack pointer constant, that won't
    change the code for prologues, but it will make the frame
    pointerless case much more common.  */
-       
+
 /* Analyze the prologue to determine where registers are saved,
    the end of the prologue, etc etc.  Return the end of the prologue
    scanned.
 
    We store into FI (if non-null) several tidbits of information:
 
-    * stack_size -- size of this stack frame.  Note that if we stop in
-    certain parts of the prologue/epilogue we may claim the size of the
-    current frame is zero.  This happens when the current frame has
-    not been allocated yet or has already been deallocated.
+   * stack_size -- size of this stack frame.  Note that if we stop in
+   certain parts of the prologue/epilogue we may claim the size of the
+   current frame is zero.  This happens when the current frame has
+   not been allocated yet or has already been deallocated.
 
-    * fsr -- Addresses of registers saved in the stack by this frame.
+   * fsr -- Addresses of registers saved in the stack by this frame.
 
-    * status -- A (relatively) generic status indicator.  It's a bitmask
-    with the following bits: 
+   * status -- A (relatively) generic status indicator.  It's a bitmask
+   with the following bits: 
 
-      MY_FRAME_IN_SP: The base of the current frame is actually in
-      the stack pointer.  This can happen for frame pointerless
-      functions, or cases where we're stopped in the prologue/epilogue
-      itself.  For these cases mn10300_analyze_prologue will need up
-      update fi->frame before returning or analyzing the register
-      save instructions.
+   MY_FRAME_IN_SP: The base of the current frame is actually in
+   the stack pointer.  This can happen for frame pointerless
+   functions, or cases where we're stopped in the prologue/epilogue
+   itself.  For these cases mn10300_analyze_prologue will need up
+   update fi->frame before returning or analyzing the register
+   save instructions.
 
-      MY_FRAME_IN_FP: The base of the current frame is in the
-      frame pointer register ($a2).
+   MY_FRAME_IN_FP: The base of the current frame is in the
+   frame pointer register ($a2).
 
-      NO_MORE_FRAMES: Set this if the current frame is "start" or
-      if the first instruction looks like mov <imm>,sp.  This tells
-      frame chain to not bother trying to unwind past this frame.  */
+   NO_MORE_FRAMES: Set this if the current frame is "start" or
+   if the first instruction looks like mov <imm>,sp.  This tells
+   frame chain to not bother trying to unwind past this frame.  */
 
 static CORE_ADDR
 mn10300_analyze_prologue (fi, pc)
-    struct frame_info *fi;
-    CORE_ADDR pc;
+     struct frame_info *fi;
+     CORE_ADDR pc;
 {
   CORE_ADDR func_addr, func_end, addr, stop;
   CORE_ADDR stack_size;
@@ -418,14 +420,14 @@ mn10300_analyze_prologue (fi, pc)
          return addr;
        }
     }
-  
+
   /* Next we should allocate the local frame.  No more prologue insns
      are found after allocating the local frame.
-       
+
      Search for add imm8,sp (0xf8feXX)
-        or     add imm16,sp (0xfafeXXXX)
-        or     add imm32,sp (0xfcfeXXXXXXXX).
-       
+     or add imm16,sp (0xfafeXXXX)
+     or add imm32,sp (0xfcfeXXXXXXXX).
+
      If none of the above was found, then this prologue has no 
      additional stack.  */
 
@@ -489,7 +491,7 @@ mn10300_analyze_prologue (fi, pc)
   set_movm_offsets (fi, movm_args);
   return addr;
 }
-  
+
 /* Function: frame_chain
    Figure out and return the caller's frame pointer given current
    frame_info struct.
@@ -505,7 +507,7 @@ mn10300_frame_chain (fi)
   /* Walk through the prologue to determine the stack size,
      location of saved registers, end of the prologue, etc.  */
   if (fi->extra_info->status == 0)
-    mn10300_analyze_prologue (fi, (CORE_ADDR)0);
+    mn10300_analyze_prologue (fi, (CORE_ADDR) 0);
 
   /* Quit now if mn10300_analyze_prologue set NO_MORE_FRAMES.  */
   if (fi->extra_info->status & NO_MORE_FRAMES)
@@ -514,17 +516,17 @@ mn10300_frame_chain (fi)
   /* Now that we've analyzed our prologue, determine the frame
      pointer for our caller.
 
-       If our caller has a frame pointer, then we need to
-       find the entry value of $a3 to our function.
+     If our caller has a frame pointer, then we need to
+     find the entry value of $a3 to our function.
+
+     If fsr.regs[A3_REGNUM] is nonzero, then it's at the memory
+     location pointed to by fsr.regs[A3_REGNUM].
 
-        If fsr.regs[A3_REGNUM] is nonzero, then it's at the memory
-        location pointed to by fsr.regs[A3_REGNUM].
+     Else it's still in $a3.
 
-        Else it's still in $a3.
+     If our caller does not have a frame pointer, then his
+     frame base is fi->frame + -caller's stack size.  */
 
-       If our caller does not have a frame pointer, then his
-       frame base is fi->frame + -caller's stack size.  */
-       
   /* The easiest way to get that info is to analyze our caller's frame.
      So we set up a dummy frame and call mn10300_analyze_prologue to
      find stuff for us.  */
@@ -549,8 +551,8 @@ mn10300_frame_chain (fi)
       adjust += (fi->saved_regs[A3_REGNUM] ? 4 : 0);
 
       /* Our caller does not have a frame pointer.  So his frame starts
-        at the base of our frame (fi->frame) + register save space
-        + <his size>.  */
+         at the base of our frame (fi->frame) + register save space
+         + <his size>.  */
       return fi->frame + adjust + -dummy->extra_info->stack_size;
     }
 }
@@ -578,7 +580,7 @@ mn10300_pop_frame (frame)
 {
   int regnum;
 
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     generic_pop_dummy_frame ();
   else
     {
@@ -591,7 +593,7 @@ mn10300_pop_frame (frame)
            ULONGEST value;
 
            value = read_memory_unsigned_integer (frame->saved_regs[regnum],
-                                                 REGISTER_RAW_SIZE (regnum));
+                                               REGISTER_RAW_SIZE (regnum));
            write_register (regnum, value);
          }
 
@@ -657,13 +659,13 @@ mn10300_push_arguments (nargs, args, sp, struct_return, struct_addr)
          && TYPE_LENGTH (VALUE_TYPE (*args)) > 8)
        {
          /* XXX Wrong, we want a pointer to this argument.  */
-          len = TYPE_LENGTH (VALUE_TYPE (*args));
-          val = (char *)VALUE_CONTENTS (*args);
+         len = TYPE_LENGTH (VALUE_TYPE (*args));
+         val = (char *) VALUE_CONTENTS (*args);
        }
       else
        {
          len = TYPE_LENGTH (VALUE_TYPE (*args));
-         val = (char *)VALUE_CONTENTS (*args);
+         val = (char *) VALUE_CONTENTS (*args);
        }
 
       while (regsused < 2 && len > 0)
@@ -693,7 +695,7 @@ mn10300_push_arguments (nargs, args, sp, struct_return, struct_addr)
 /* Function: push_return_address (pc)
    Set up the return address for the inferior function call.
    Needed for targets where we don't actually execute a JSR/BSR instruction */
+
 CORE_ADDR
 mn10300_push_return_address (pc, sp)
      CORE_ADDR pc;
@@ -709,7 +711,7 @@ mn10300_push_return_address (pc, sp)
 /* Function: store_struct_return (addr,sp)
    Store the structure value return address for an inferior function
    call.  */
+
 CORE_ADDR
 mn10300_store_struct_return (addr, sp)
      CORE_ADDR addr;
@@ -719,7 +721,7 @@ mn10300_store_struct_return (addr, sp)
   write_register (0, addr);
   return sp;
 }
+
 /* 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
@@ -789,16 +791,16 @@ mn10300_virtual_frame_pointer (pc, reg, offset)
   /* Results will tell us which type of frame it uses.  */
   if (dummy->extra_info->status & MY_FRAME_IN_SP)
     {
-      *reg    = SP_REGNUM;
+      *reg = SP_REGNUM;
       *offset = -(dummy->extra_info->stack_size);
     }
   else
     {
-      *reg    = A3_REGNUM;
+      *reg = A3_REGNUM;
       *offset = 0;
     }
 }
-  
+
 /* This can be made more generic later.  */
 static void
 set_machine_hook (filename)
@@ -823,4 +825,3 @@ _initialize_mn10300_tdep ()
 
   specify_exec_file_hook (set_machine_hook);
 }
-
index 32dcaff7a998fe4be881d6c83d97aeae5a4353b6..ab78b412ea35e26a737eb31d4218482564a963e9 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote target glue for the Intel 960 MON960 ROM monitor.
    Copyright 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
@@ -26,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "srec.h"
 #include "xmodem.h"
 #include "symtab.h"
-#include "symfile.h" /* for generic_load */
+#include "symfile.h"           /* for generic_load */
 
 
 #define USE_GENERIC_LOAD
@@ -38,9 +39,9 @@ static void mon960_open PARAMS ((char *args, int from_tty));
 #ifdef USE_GENERIC_LOAD
 
 static void
-mon960_load_gen (filename, from_tty) 
-    char *filename;
-    int from_tty;
+mon960_load_gen (filename, from_tty)
+     char *filename;
+     int from_tty;
 {
   extern int inferior_pid;
 
@@ -49,7 +50,7 @@ mon960_load_gen (filename, from_tty)
   if (exec_bfd)
     write_pc (bfd_get_start_address (exec_bfd));
 
-  inferior_pid = 0;             /* No process now */
+  inferior_pid = 0;            /* No process now */
 }
 
 #else
@@ -106,7 +107,7 @@ mon960_load (desc, file, hashmark)
        monitor_expect_prompt (NULL, 0);
        putchar_unfiltered ('\n');
       }                                /* Loadable sections */
-  if (hashmark) 
+  if (hashmark)
     putchar_unfiltered ('\n');
 }
 
@@ -118,16 +119,17 @@ mon960_load (desc, file, hashmark)
    either. So, typing "info reg sp" becomes a "r30".  */
 
 /* these correspond to the offsets from tm-* files from config directories */
-/* g0-g14, fp, pfp, sp, rip,r3-15, pc, ac, tc, fp0-3 */ 
+/* g0-g14, fp, pfp, sp, rip,r3-15, pc, ac, tc, fp0-3 */
 /* NOTE: "ip" is documented as "ir" in the Mon960 UG. */
 /* NOTE: "ir" can't be accessed... but there's an ip and rip. */
-static char *full_regnames[NUM_REGS] = {
-  /*  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",
-  };
+static char *full_regnames[NUM_REGS] =
+{
+  /*  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",
+};
 
 static char *mon960_regnames[NUM_REGS];
 
@@ -143,72 +145,74 @@ static char *mon960_regnames[NUM_REGS];
    is running on GNU/Linux.  The short string below works on Linux, and on
    SunOS using a tcp serial connection.  Must retest on SunOS using a
    direct serial connection; if that works, get rid of the long string. */
-static char *mon960_inits[] = {"\n\r\r\r\r\r\r\r\r\r\r\r\r\r\r\n\r\n\r\n", NULL};
+static char *mon960_inits[] =
+{"\n\r\r\r\r\r\r\r\r\r\r\r\r\r\r\n\r\n\r\n", NULL};
 #else
-static char *mon960_inits[] = { "\r", NULL};
+static char *mon960_inits[] =
+{"\r", NULL};
 #endif
 
-static struct monitor_ops mon960_cmds ;
+static struct monitor_ops mon960_cmds;
 
-static void 
+static void
 init_mon960_cmds (void)
 {
-  mon960_cmds.flags =   MO_CLR_BREAK_USES_ADDR
-    | MO_NO_ECHO_ON_OPEN   | MO_SEND_BREAK_ON_STOP   | MO_GETMEM_READ_SINGLE ;    /* flags */
-  mon960_cmds.init =   mon960_inits;   /* Init strings */
-  mon960_cmds.cont =   "go\n\r";       /* continue command */
-  mon960_cmds.step =   "st\n\r";               /* single step */
-  mon960_cmds.stop =   NULL;                   /* break interrupts the program */
-  mon960_cmds.set_break =   NULL;              /* set a breakpoint */
-  mon960_cmds.clr_break =                      /* can't use "br" because only 2 hw bps are supported */
-    mon960_cmds.clr_all_break =   NULL;                /* clear a breakpoint - "de" is for hw bps */
+  mon960_cmds.flags = MO_CLR_BREAK_USES_ADDR
+    | MO_NO_ECHO_ON_OPEN | MO_SEND_BREAK_ON_STOP | MO_GETMEM_READ_SINGLE;      /* flags */
+  mon960_cmds.init = mon960_inits;     /* Init strings */
+  mon960_cmds.cont = "go\n\r"; /* continue command */
+  mon960_cmds.step = "st\n\r"; /* single step */
+  mon960_cmds.stop = NULL;     /* break interrupts the program */
+  mon960_cmds.set_break = NULL;        /* set a breakpoint */
+  mon960_cmds.clr_break =      /* can't use "br" because only 2 hw bps are supported */
+    mon960_cmds.clr_all_break = NULL;  /* clear a breakpoint - "de" is for hw bps */
   NULL,                                /* clear all breakpoints */
-    mon960_cmds.fill =   NULL;                 /* fill (start end val) */
+    mon960_cmds.fill = NULL;   /* fill (start end val) */
   /* can't use "fi" because it takes words, not bytes */
   /* can't use "mb", "md" or "mo" because they require interaction */
-  mon960_cmds.setmem.cmdb =     NULL;          /* setmem.cmdb (addr, value) */
-  mon960_cmds.setmem.cmdw =     NULL;          /* setmem.cmdw (addr, value) */
-  mon960_cmds.setmem.cmdl =     "md %x %x\n\r";        /* setmem.cmdl (addr, value) */
-  mon960_cmds.setmem.cmdll =     NULL;         /* setmem.cmdll (addr, value) */
-  mon960_cmds.setmem.resp_delim =     NULL;    /* setmem.resp_delim */
-  mon960_cmds.setmem.term =     NULL;          /* setmem.term */
-  mon960_cmds.setmem.term_cmd =     NULL;                      /* setmem.term_cmd */
+  mon960_cmds.setmem.cmdb = NULL;      /* setmem.cmdb (addr, value) */
+  mon960_cmds.setmem.cmdw = NULL;      /* setmem.cmdw (addr, value) */
+  mon960_cmds.setmem.cmdl = "md %x %x\n\r";    /* setmem.cmdl (addr, value) */
+  mon960_cmds.setmem.cmdll = NULL;     /* setmem.cmdll (addr, value) */
+  mon960_cmds.setmem.resp_delim = NULL;                /* setmem.resp_delim */
+  mon960_cmds.setmem.term = NULL;      /* setmem.term */
+  mon960_cmds.setmem.term_cmd = NULL;  /* setmem.term_cmd */
   /* since the parsing of multiple bytes is difficult due to
      interspersed addresses, we'll only read 1 value at a time,
      even tho these can handle a count */
-  mon960_cmds.getmem.cmdb =     "db %x\n\r";   /* getmem.cmdb (addr, #bytes) */
-  mon960_cmds.getmem.cmdw =     "ds %x\n\r";   /* getmem.cmdw (addr, #swords) */
-  mon960_cmds.getmem.cmdl =     "di %x\n\r";   /* getmem.cmdl (addr, #words) */
-  mon960_cmds.getmem.cmdll =     "dd %x\n\r";  /* getmem.cmdll (addr, #dwords) */
-  mon960_cmds.getmem.resp_delim =     " : ";   /* getmem.resp_delim */
-  mon960_cmds.getmem.term =     NULL;          /* getmem.term */
-  mon960_cmds.getmem.term_cmd =     NULL;      /* getmem.term_cmd */
-  mon960_cmds.setreg.cmd =     "md %s %x\n\r"; /* setreg.cmd (name, value) */
-  mon960_cmds.setreg.resp_delim =     NULL;    /* setreg.resp_delim */
-  mon960_cmds.setreg.term =     NULL;          /* setreg.term */
-  mon960_cmds.setreg.term_cmd =     NULL,      /* setreg.term_cmd */
-    mon960_cmds.getreg.cmd =     "di %s\n\r";  /* getreg.cmd (name) */
-  mon960_cmds.getreg.resp_delim =     " : ";   /* getreg.resp_delim */
-  mon960_cmds.getreg.term =     NULL;          /* getreg.term */
-  mon960_cmds.getreg.term_cmd =     NULL;      /* getreg.term_cmd */
-  mon960_cmds.dump_registers =   "re\n\r";     /* dump_registers */
-  mon960_cmds.register_pattern =   "\\(\\w+\\)=\\([0-9a-fA-F]+\\)";    /* register_pattern */
-  mon960_cmds.supply_register =   NULL;                /* supply_register */
+  mon960_cmds.getmem.cmdb = "db %x\n\r";       /* getmem.cmdb (addr, #bytes) */
+  mon960_cmds.getmem.cmdw = "ds %x\n\r";       /* getmem.cmdw (addr, #swords) */
+  mon960_cmds.getmem.cmdl = "di %x\n\r";       /* getmem.cmdl (addr, #words) */
+  mon960_cmds.getmem.cmdll = "dd %x\n\r";      /* getmem.cmdll (addr, #dwords) */
+  mon960_cmds.getmem.resp_delim = " : ";       /* getmem.resp_delim */
+  mon960_cmds.getmem.term = NULL;      /* getmem.term */
+  mon960_cmds.getmem.term_cmd = NULL;  /* getmem.term_cmd */
+  mon960_cmds.setreg.cmd = "md %s %x\n\r";     /* setreg.cmd (name, value) */
+  mon960_cmds.setreg.resp_delim = NULL;                /* setreg.resp_delim */
+  mon960_cmds.setreg.term = NULL;      /* setreg.term */
+  mon960_cmds.setreg.term_cmd = NULL,  /* setreg.term_cmd */
+    mon960_cmds.getreg.cmd = "di %s\n\r";      /* getreg.cmd (name) */
+  mon960_cmds.getreg.resp_delim = " : ";       /* getreg.resp_delim */
+  mon960_cmds.getreg.term = NULL;      /* getreg.term */
+  mon960_cmds.getreg.term_cmd = NULL;  /* getreg.term_cmd */
+  mon960_cmds.dump_registers = "re\n\r";       /* dump_registers */
+  mon960_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)";      /* register_pattern */
+  mon960_cmds.supply_register = NULL;  /* supply_register */
 #ifdef USE_GENERIC_LOAD
-  mon960_cmds.load_routine =   NULL;           /* load_routine (defaults to SRECs) */
-  mon960_cmds.load = NULL;                     /* download command */
-  mon960_cmds.loadresp  = NULL;                        /* load response */
+  mon960_cmds.load_routine = NULL;     /* load_routine (defaults to SRECs) */
+  mon960_cmds.load = NULL;     /* download command */
+  mon960_cmds.loadresp = NULL; /* load response */
 #else
-  mon960_cmds.load_routine =   mon960_load ;   /* load_routine (defaults to SRECs) */
-  mon960_cmds.load =  "do\n\r";                /* download command */
-  mon960_cmds.loadresp =  "Downloading\n\r" ;/* load response */
+  mon960_cmds.load_routine = mon960_load;      /* load_routine (defaults to SRECs) */
+  mon960_cmds.load = "do\n\r"; /* download command */
+  mon960_cmds.loadresp = "Downloading\n\r";    /* load response */
 #endif
-  mon960_cmds.prompt =   "=>";         /* monitor command prompt */
-  mon960_cmds.line_term =  "\n\r";             /* end-of-command delimitor */  
-  mon960_cmds.cmd_end = NULL;          /* optional command terminator */
-  mon960_cmds.target =   &mon960_ops;          /* target operations */
-  mon960_cmds.stopbits =     SERIAL_1_STOPBITS;        /* number of stop bits */
-  mon960_cmds.regnames =  mon960_regnames;     /* registers names */
+  mon960_cmds.prompt = "=>";   /* monitor command prompt */
+  mon960_cmds.line_term = "\n\r";      /* end-of-command delimitor */
+  mon960_cmds.cmd_end = NULL;  /* optional command terminator */
+  mon960_cmds.target = &mon960_ops;    /* target operations */
+  mon960_cmds.stopbits = SERIAL_1_STOPBITS;    /* number of stop bits */
+  mon960_cmds.regnames = mon960_regnames;      /* registers names */
   mon960_cmds.magic = MONITOR_OPS_MAGIC;       /* magic */
 };
 
@@ -226,36 +230,36 @@ mon960_open (args, from_tty)
      this processor has no floating point registers, and nullify the 
      regnames entries that refer to FP registers.  */
 
-  monitor_printf (mon960_cmds.getreg.cmd, full_regnames[FP0_REGNUM]); /* di fp0 */
-  if (monitor_expect_prompt (buf, sizeof(buf)) != -1)
-    if (strstr(buf, "Bad") != NULL)
+  monitor_printf (mon960_cmds.getreg.cmd, full_regnames[FP0_REGNUM]);  /* di fp0 */
+  if (monitor_expect_prompt (buf, sizeof (buf)) != -1)
+    if (strstr (buf, "Bad") != NULL)
       {
        int i;
 
        for (i = FP0_REGNUM; i < FP0_REGNUM + 4; i++)
-           mon960_regnames[i] = NULL;
+         mon960_regnames[i] = NULL;
       }
 }
 
 void
 _initialize_mon960 ()
 {
-  memcpy(mon960_regnames, full_regnames, sizeof(full_regnames));
+  memcpy (mon960_regnames, full_regnames, sizeof (full_regnames));
 
   init_mon960_cmds ();
 
   init_monitor_ops (&mon960_ops);
 
-  mon960_ops.to_shortname = "mon960"; /* for the target command */
+  mon960_ops.to_shortname = "mon960";  /* for the target command */
   mon960_ops.to_longname = "Intel 960 MON960 monitor";
 #ifdef USE_GENERIC_LOAD
-  mon960_ops.to_load = mon960_load_gen; /* FIXME - should go back and try "do" */
+  mon960_ops.to_load = mon960_load_gen;                /* FIXME - should go back and try "do" */
 #endif
   /* use SW breaks; target only supports 2 HW breakpoints */
-  mon960_ops.to_insert_breakpoint = memory_insert_breakpoint; 
-  mon960_ops.to_remove_breakpoint = memory_remove_breakpoint; 
+  mon960_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  mon960_ops.to_remove_breakpoint = memory_remove_breakpoint;
 
-  mon960_ops.to_doc = 
+  mon960_ops.to_doc =
     "Use an Intel 960 board running the MON960 debug monitor.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).";
 
index 44a46cbdcb03a83d6007acdf40fdc4ad3fcde24d..1709a71f562f4666ace1a4847097753ddba7d57d 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Cygnus Support.  Written by Rob Savoye for Cygnus.
    Resurrected from the ashes by Stu Grossman.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This file was derived from various remote-* modules. It is a collection
    of generic support functions so GDB can talk directly to a ROM based
@@ -80,12 +81,12 @@ static void monitor_interrupt_twice PARAMS ((int signo));
 static void monitor_interrupt_query PARAMS ((void));
 static void monitor_wait_cleanup PARAMS ((void *old_timeout));
 
-static int monitor_wait PARAMS ((int pid, struct target_waitstatus *status));
+static int monitor_wait PARAMS ((int pid, struct target_waitstatus * status));
 static void monitor_fetch_registers PARAMS ((int regno));
 static void monitor_store_registers PARAMS ((int regno));
 static void monitor_prepare_to_store PARAMS ((void));
-static int monitor_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops *target));
-static void monitor_files_info PARAMS ((struct target_ops *ops));
+static int monitor_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops * target));
+static void monitor_files_info PARAMS ((struct target_ops * ops));
 static int monitor_insert_breakpoint PARAMS ((CORE_ADDR addr, char *shadow));
 static int monitor_remove_breakpoint PARAMS ((CORE_ADDR addr, char *shadow));
 static void monitor_kill PARAMS ((void));
@@ -93,17 +94,17 @@ static void monitor_load PARAMS ((char *file, int from_tty));
 static void monitor_mourn_inferior PARAMS ((void));
 static void monitor_stop PARAMS ((void));
 
-static int monitor_read_memory PARAMS ((CORE_ADDR addr, char *myaddr,int len));
-static int monitor_write_memory PARAMS ((CORE_ADDR addr, char *myaddr,int len));
+static int monitor_read_memory PARAMS ((CORE_ADDR addr, char *myaddr, int len));
+static int monitor_write_memory PARAMS ((CORE_ADDR addr, char *myaddr, int len));
 static int monitor_write_memory_bytes PARAMS ((CORE_ADDR addr,
-                                              char *myaddr,int len));
-static int monitor_write_memory_block PARAMS((
-                                             CORE_ADDR memaddr ,
-                                             char * myaddr ,
-                                             int len)) ;
-static int monitor_expect_regexp PARAMS ((struct re_pattern_buffer *pat,
+                                              char *myaddr, int len));
+static int monitor_write_memory_block PARAMS ((
+                                               CORE_ADDR memaddr,
+                                               char *myaddr,
+                                               int len));
+static int monitor_expect_regexp PARAMS ((struct re_pattern_buffer * pat,
                                          char *buf, int buflen));
-static void monitor_dump_regs PARAMS((void)) ;
+static void monitor_dump_regs PARAMS ((void));
 #if 0
 static int from_hex PARAMS ((int a));
 static unsigned long get_hex_word PARAMS ((void));
@@ -118,7 +119,7 @@ static int timeout = 30;
 
 static int in_monitor_wait = 0;        /* Non-zero means we are in monitor_wait() */
 
-static void (*ofunc)();                /* Old SIGINT signal handler */
+static void (*ofunc) ();       /* Old SIGINT signal handler */
 
 static CORE_ADDR *breakaddr;
 
@@ -146,8 +147,8 @@ static int dump_reg_flag;   /* Non-zero means do a dump_registers cmd when
                                   monitor_wait wakes up.  */
 
 static DCACHE *remote_dcache;
-static int first_time=0;       /* is this the first time we're executing after 
-                                       gaving created the child proccess? */
+static int first_time = 0;     /* is this the first time we're executing after 
+                                  gaving created the child proccess? */
 
 /* Convert a string into a printable representation, Return # byte in the
    new string.  */
@@ -163,7 +164,7 @@ monitor_printable_string (newstr, oldstr)
   while ((ch = *oldstr++) != '\0')
     {
       switch (ch)
-        {
+       {
        default:
          if (isprint (ch))
            *newstr++ = ch;
@@ -175,14 +176,35 @@ monitor_printable_string (newstr, oldstr)
            }
          break;
 
-       case '\\': *newstr++ = '\\'; *newstr++ = '\\';  break;
-       case '\b': *newstr++ = '\\'; *newstr++ = 'b';   break;
-       case '\f': *newstr++ = '\\'; *newstr++ = 't';   break;
-       case '\n': *newstr++ = '\\'; *newstr++ = 'n';   break;
-       case '\r': *newstr++ = '\\'; *newstr++ = 'r';   break;
-       case '\t': *newstr++ = '\\'; *newstr++ = 't';   break;
-       case '\v': *newstr++ = '\\'; *newstr++ = 'v';   break;
-        }
+       case '\\':
+         *newstr++ = '\\';
+         *newstr++ = '\\';
+         break;
+       case '\b':
+         *newstr++ = '\\';
+         *newstr++ = 'b';
+         break;
+       case '\f':
+         *newstr++ = '\\';
+         *newstr++ = 't';
+         break;
+       case '\n':
+         *newstr++ = '\\';
+         *newstr++ = 'n';
+         break;
+       case '\r':
+         *newstr++ = '\\';
+         *newstr++ = 'r';
+         break;
+       case '\t':
+         *newstr++ = '\\';
+         *newstr++ = 't';
+         break;
+       case '\v':
+         *newstr++ = '\\';
+         *newstr++ = 'v';
+         break;
+       }
     }
 
   *newstr++ = '\0';
@@ -200,16 +222,16 @@ monitor_error (format, memaddr, len, string, final_char)
      char *string;
      int final_char;
 {
-  int real_len = (len == 0 && string != (char *)0) ? strlen (string) : len;
+  int real_len = (len == 0 && string != (char *) 0) ? strlen (string) : len;
   char *safe_string = alloca ((real_len * 4) + 1);
   char *p, *q;
   int ch;
   int safe_len = monitor_printable_string (safe_string, string);
 
   if (final_char)
-    error (format, (int)memaddr, p - safe_string, safe_string, final_char);
+    error (format, (int) memaddr, p - safe_string, safe_string, final_char);
   else
-    error (format, (int)memaddr, p - safe_string, safe_string);
+    error (format, (int) memaddr, p - safe_string, safe_string);
 }
 
 /* Convert hex digit A to a number.  */
@@ -222,10 +244,10 @@ fromhex (a)
     return a - '0';
   else if (a >= 'a' && a <= 'f')
     return a - 'a' + 10;
+  else if (a >= 'A' && a <= 'F')
+    return a - 'A' + 10;
   else
-    if (a >= 'A' && a <= 'F')
-      return a - 'A' + 10 ;
-  else error ("Invalid hex digit %d", a);
+    error ("Invalid hex digit %d", a);
 }
 
 /* monitor_vsprintf - similar to vsprintf but handles 64-bit addresses
@@ -240,8 +262,8 @@ fromhex (a)
    argument is assumed to be a long integer.
 
    %% is also turned into a single %.
-*/
-  
+ */
+
 static void
 monitor_vsprintf (sndbuf, pattern, args)
      char *sndbuf;
@@ -266,7 +288,7 @@ monitor_vsprintf (sndbuf, pattern, args)
               i++, p++)
            format[i] = *p;
          format[i] = fmt = *p;
-         format[i+1] = '\0';
+         format[i + 1] = '\0';
 
          /* Fetch the next argument and print it.  */
          switch (fmt)
@@ -301,7 +323,7 @@ monitor_vsprintf (sndbuf, pattern, args)
 
 void
 #ifdef ANSI_PROTOTYPES
-monitor_printf_noecho (char *pattern, ...)
+monitor_printf_noecho (char *pattern,...)
 #else
 monitor_printf_noecho (va_alist)
      va_dcl
@@ -336,7 +358,7 @@ monitor_printf_noecho (va_alist)
       monitor_printable_string (safe_string, sndbuf);
       printf ("sent[%s]\n", safe_string);
     }
-  
+
   monitor_write (sndbuf, len);
 }
 
@@ -345,7 +367,7 @@ monitor_printf_noecho (va_alist)
 
 void
 #ifdef ANSI_PROTOTYPES
-monitor_printf (char *pattern, ...)
+monitor_printf (char *pattern,...)
 #else
 monitor_printf (va_alist)
      va_dcl
@@ -387,8 +409,8 @@ monitor_printf (va_alist)
      just output, but sometimes some extra junk appeared before the characters
      we expected, like an extra prompt, or a portmaster sending telnet negotiations.
      So, just start searching for what we sent, and skip anything unknown.  */
-  RDEBUG(("ExpectEcho\n"))
-  monitor_expect (sndbuf, (char *)0, 0);
+  RDEBUG (("ExpectEcho\n"))
+    monitor_expect (sndbuf, (char *) 0, 0);
 }
 
 
@@ -399,7 +421,7 @@ monitor_write (buf, buflen)
      char *buf;
      int buflen;
 {
-  if (SERIAL_WRITE(monitor_desc, buf, buflen))
+  if (SERIAL_WRITE (monitor_desc, buf, buflen))
     fprintf_unfiltered (gdb_stderr, "SERIAL_WRITE failed: %s\n",
                        safe_strerror (errno));
 }
@@ -421,7 +443,7 @@ monitor_readchar ()
       c = SERIAL_READCHAR (monitor_desc, timeout);
 
       if (c >= 0)
-       c &= 0xff;                      /* don't lose bit 7 */
+       c &= 0xff;              /* don't lose bit 7 */
     }
   while (looping);
 
@@ -429,7 +451,7 @@ monitor_readchar ()
     return c;
 
   if (c == SERIAL_TIMEOUT)
-      error ("Timeout reading from remote system.");
+    error ("Timeout reading from remote system.");
 
   perror_with_name ("remote-monitor");
 }
@@ -443,7 +465,11 @@ readchar (timeout)
      int timeout;
 {
   int c;
-  static enum { last_random, last_nl, last_cr, last_crnl } state = last_random;
+  static enum
+    {
+      last_random, last_nl, last_cr, last_crnl
+    }
+  state = last_random;
   int looping;
 
   do
@@ -464,8 +490,8 @@ readchar (timeout)
              buf[1] = '\0';
              puts_debug ("read -->", buf, "<--");
            }
-         
-#endif   
+
+#endif
        }
 
       /* Canonicialize \n\r combinations into one \r */
@@ -556,7 +582,7 @@ monitor_expect (string, buf, buflen)
        c = readchar (timeout);
 
       /* Don't expect any ^C sent to be echoed */
-       
+
       if (*p == '\003' || c == *p)
        {
          p++;
@@ -576,7 +602,7 @@ monitor_expect (string, buf, buflen)
       else if ((c == '\021' || c == '\023') &&
               (STREQ (targ_ops->to_shortname, "m32r")
                || STREQ (targ_ops->to_shortname, "mon2000")))
-       { /* m32r monitor emits random DC1/DC3 chars */
+       {                       /* m32r monitor emits random DC1/DC3 chars */
          continue;
        }
       else
@@ -598,7 +624,7 @@ monitor_expect_regexp (pat, buf, buflen)
 {
   char *mybuf;
   char *p;
-  RDEBUG(("MON Expecting regexp\n")) ;
+  RDEBUG (("MON Expecting regexp\n"));
   if (buf)
     mybuf = buf;
   else
@@ -649,8 +675,8 @@ monitor_expect_prompt (buf, buflen)
      char *buf;
      int buflen;
 {
-  RDEBUG(("MON Expecting prompt\n"))
-  return monitor_expect (current_monitor->prompt, buf, buflen);
+  RDEBUG (("MON Expecting prompt\n"))
+    return monitor_expect (current_monitor->prompt, buf, buflen);
 }
 
 /* Get N 32-bit words from remote, each preceded by a space, and put
@@ -666,7 +692,7 @@ get_hex_word ()
 
   do
     ch = readchar (timeout);
-  while (isspace(ch));
+  while (isspace (ch));
 
   val = from_hex (ch);
 
@@ -759,7 +785,7 @@ monitor_open (args, mon_ops, from_tty)
          perror_with_name (dev_name);
        }
     }
-  
+
   SERIAL_RAW (monitor_desc);
 
   SERIAL_FLUSH_INPUT (monitor_desc);
@@ -777,22 +803,22 @@ monitor_open (args, mon_ops, from_tty)
     {
       monitor_stop ();
       if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0)
-        {
-         RDEBUG(("EXP Open echo\n")) ;
-         monitor_expect_prompt (NULL, 0); 
-      }
+       {
+         RDEBUG (("EXP Open echo\n"));
+         monitor_expect_prompt (NULL, 0);
+       }
     }
 
   /* wake up the monitor and see if it's alive */
   for (p = mon_ops->init; *p != NULL; p++)
     {
       /* Some of the characters we send may not be echoed,
-        but we hope to get a prompt at the end of it all. */
-        
+         but we hope to get a prompt at the end of it all. */
+
       if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0)
-        monitor_printf(*p); 
+       monitor_printf (*p);
       else
-        monitor_printf_noecho (*p);
+       monitor_printf_noecho (*p);
       monitor_expect_prompt (NULL, 0);
     }
 
@@ -879,7 +905,7 @@ monitor_supply_register (regno, valstr)
   char *p;
 
   val = strtoul (valstr, &p, 16);
-  RDEBUG(("Supplying Register %d %s\n",regno,valstr)) ;
+  RDEBUG (("Supplying Register %d %s\n", regno, valstr));
 
   if (val == 0 && valstr == p)
     error ("monitor_supply_register (%d):  bad value from monitor: %s.",
@@ -908,13 +934,13 @@ monitor_resume (pid, step, sig)
      enum target_signal sig;
 {
   /* Some monitors require a different command when starting a program */
-  RDEBUG(("MON resume\n")) ;
+  RDEBUG (("MON resume\n"));
   if (current_monitor->flags & MO_RUN_FIRST_TIME && first_time == 1)
     {
       first_time = 0;
       monitor_printf ("run\r");
       if (current_monitor->flags & MO_NEED_REGDUMP_AFTER_CONT)
-           dump_reg_flag = 1;
+       dump_reg_flag = 1;
       return;
     }
   dcache_flush (remote_dcache);
@@ -923,8 +949,9 @@ monitor_resume (pid, step, sig)
   else
     {
       if (current_monitor->continue_hook)
-       (*current_monitor->continue_hook)() ;
-      else monitor_printf (current_monitor->cont);
+       (*current_monitor->continue_hook) ();
+      else
+       monitor_printf (current_monitor->cont);
       if (current_monitor->flags & MO_NEED_REGDUMP_AFTER_CONT)
        dump_reg_flag = 1;
     }
@@ -940,13 +967,13 @@ parse_register_dump (buf, len)
      char *buf;
      int len;
 {
-  RDEBUG(("MON Parsing  register dump\n")) 
-  while (1)
+  RDEBUG (("MON Parsing  register dump\n"))
+    while (1)
     {
       int regnamelen, vallen;
       char *regname, *val;
       /* Element 0 points to start of register name, and element 1
-        points to the start of the register value.  */
+         points to the start of the register value.  */
       struct re_registers register_strings;
 
       memset (&register_strings, 0, sizeof (struct re_registers));
@@ -976,7 +1003,7 @@ monitor_interrupt (signo)
 {
   /* If this doesn't work, try more severe steps.  */
   signal (signo, monitor_interrupt_twice);
-  
+
   if (remote_debug)
     printf_unfiltered ("monitor_interrupt called\n");
 
@@ -990,7 +1017,7 @@ monitor_interrupt_twice (signo)
      int signo;
 {
   signal (signo, ofunc);
-  
+
   monitor_interrupt_query ();
 
   signal (signo, monitor_interrupt);
@@ -1017,24 +1044,25 @@ static void
 monitor_wait_cleanup (old_timeout)
      void *old_timeout;
 {
-  timeout = *(int*)old_timeout;
+  timeout = *(int *) old_timeout;
   signal (SIGINT, ofunc);
   in_monitor_wait = 0;
 }
 
 
 
-void monitor_wait_filter(char * buf,
-                        int bufmax,
-                        int * ext_resp_len, 
-                        struct target_waitstatus * status
-                        )
+void
+monitor_wait_filter (char *buf,
+                    int bufmax,
+                    int *ext_resp_len,
+                    struct target_waitstatus *status
+)
 {
-  int resp_len ;
+  int resp_len;
   do
     {
       resp_len = monitor_expect_prompt (buf, bufmax);
-      * ext_resp_len =resp_len ;
+      *ext_resp_len = resp_len;
 
       if (resp_len <= 0)
        fprintf_unfiltered (gdb_stderr, "monitor_wait:  excessive response from monitor: %s.", buf);
@@ -1073,23 +1101,24 @@ monitor_wait (pid, status)
   status->value.integer = 0;
 
   old_chain = make_cleanup (monitor_wait_cleanup, &old_timeout);
-  RDEBUG(("MON wait\n"))
+  RDEBUG (("MON wait\n"))
 
 #if 0
-    /* This is somthing other than a maintenance command */
-  in_monitor_wait = 1;
+  /* This is somthing other than a maintenance command */
+    in_monitor_wait = 1;
   timeout = watchdog > 0 ? watchdog : -1;
 #else
-  timeout = -1;                /* Don't time out -- user program is running. */
+    timeout = -1;              /* Don't time out -- user program is running. */
 #endif
 
   ofunc = (void (*)()) signal (SIGINT, monitor_interrupt);
 
   if (current_monitor->wait_filter)
-    (*current_monitor->wait_filter)(buf,sizeof (buf),&resp_len,status) ;
-  else          monitor_wait_filter(buf,sizeof (buf),&resp_len,status) ;
-      
-#if 0 /* Transferred to monitor wait filter */
+    (*current_monitor->wait_filter) (buf, sizeof (buf), &resp_len, status);
+  else
+    monitor_wait_filter (buf, sizeof (buf), &resp_len, status);
+
+#if 0                          /* Transferred to monitor wait filter */
   do
     {
       resp_len = monitor_expect_prompt (buf, sizeof (buf));
@@ -1110,7 +1139,7 @@ monitor_wait (pid, status)
        if (buf[i] == 0x0f)
          putchar_unfiltered (buf[++i]);
     }
-#endif  
+#endif
 
   signal (SIGINT, ofunc);
 
@@ -1126,9 +1155,9 @@ monitor_wait (pid, status)
   if (current_monitor->register_pattern)
     parse_register_dump (buf, resp_len);
 #else
-  RDEBUG(("Wait fetching registers after stop\n")) ;
-  monitor_dump_regs() ;
-#endif  
+  RDEBUG (("Wait fetching registers after stop\n"));
+  monitor_dump_regs ();
+#endif
 
   status->kind = TARGET_WAITKIND_STOPPED;
   status->value.sig = TARGET_SIGNAL_TRAP;
@@ -1148,17 +1177,18 @@ monitor_fetch_register (regno)
      int regno;
 {
   char *name;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
   char regbuf[MAX_REGISTER_RAW_SIZE * 2 + 1];
   int i;
 
   name = current_monitor->regnames[regno];
-  RDEBUG(("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)")) 
+  RDEBUG (("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)"))
 
-  if (!name || (*name == '\0'))
+    if (!name || (*name == '\0'))
     {
       RDEBUG (("No register known for %d\n", regno))
-      supply_register (regno, zerobuf);
+       supply_register (regno, zerobuf);
       return;
     }
 
@@ -1172,18 +1202,19 @@ monitor_fetch_register (regno)
 
   if (current_monitor->getreg.resp_delim)
     {
-      RDEBUG(("EXP getreg.resp_delim\n")) 
-      monitor_expect (current_monitor->getreg.resp_delim, NULL, 0);
+      RDEBUG (("EXP getreg.resp_delim\n"))
+       monitor_expect (current_monitor->getreg.resp_delim, NULL, 0);
       /* Handle case of first 32 registers listed in pairs.  */
       if (current_monitor->flags & MO_32_REGS_PAIRED
          && (regno & 1) != 0 && regno < 32)
-       { RDEBUG(("EXP getreg.resp_delim\n")) ;
+       {
+         RDEBUG (("EXP getreg.resp_delim\n"));
          monitor_expect (current_monitor->getreg.resp_delim, NULL, 0);
        }
     }
 
   /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set */
-  if (current_monitor->flags & MO_HEX_PREFIX) 
+  if (current_monitor->flags & MO_HEX_PREFIX)
     {
       int c;
       c = readchar (timeout);
@@ -1192,8 +1223,8 @@ monitor_fetch_register (regno)
       if ((c == '0') && ((c = readchar (timeout)) == 'x'))
        ;
       else
-         error ("Bad value returned from monitor while fetching register %x.",
-                regno);
+       error ("Bad value returned from monitor while fetching register %x.",
+              regno);
     }
 
   /* Read upto the maximum number of hex digits for this register, skipping
@@ -1214,7 +1245,7 @@ monitor_fetch_register (regno)
     }
 
   regbuf[i] = '\000';          /* terminate the number */
-  RDEBUG(("REGVAL '%s'\n",regbuf)) ;
+  RDEBUG (("REGVAL '%s'\n", regbuf));
 
   /* If TERM is present, we wait for that to show up.  Also, (if TERM
      is present), we will send TERM_CMD if that is present.  In any
@@ -1223,17 +1254,18 @@ monitor_fetch_register (regno)
 
   if (current_monitor->getreg.term)
     {
-      RDEBUG(("EXP getreg.term\n"))
-      monitor_expect (current_monitor->getreg.term, NULL, 0); /* get response */
+      RDEBUG (("EXP getreg.term\n"))
+       monitor_expect (current_monitor->getreg.term, NULL, 0);         /* get response */
     }
 
   if (current_monitor->getreg.term_cmd)
-    { RDEBUG(("EMIT getreg.term.cmd\n"))
+    {
+      RDEBUG (("EMIT getreg.term.cmd\n"))
        monitor_printf (current_monitor->getreg.term_cmd);
     }
-  if (! current_monitor->getreg.term ||    /* Already expected or */
-      current_monitor->getreg.term_cmd)    /* ack expected */
-    monitor_expect_prompt (NULL, 0); /* get response */
+  if (!current_monitor->getreg.term || /* Already expected or */
+      current_monitor->getreg.term_cmd)                /* ack expected */
+    monitor_expect_prompt (NULL, 0);   /* get response */
 
   monitor_supply_register (regno, regbuf);
 }
@@ -1241,15 +1273,16 @@ monitor_fetch_register (regno)
 /* Sometimes, it takes several commands to dump the registers */
 /* This is a primitive for use by variations of monitor interfaces in
    case they need to compose the operation.
-   */
-int monitor_dump_reg_block(char * block_cmd)
+ */
+int
+monitor_dump_reg_block (char *block_cmd)
 {
   char buf[1024];
   int resp_len;
   monitor_printf (block_cmd);
   resp_len = monitor_expect_prompt (buf, sizeof (buf));
   parse_register_dump (buf, resp_len);
-  return 1 ;
+  return 1;
 }
 
 
@@ -1262,23 +1295,23 @@ monitor_dump_regs ()
   char buf[1024];
   int resp_len;
   if (current_monitor->dumpregs)
-     (*(current_monitor->dumpregs))() ; /* call supplied function */
-  else
-    if (current_monitor->dump_registers) /* default version */
-    { monitor_printf (current_monitor->dump_registers);
+    (*(current_monitor->dumpregs)) (); /* call supplied function */
+  else if (current_monitor->dump_registers)    /* default version */
+    {
+      monitor_printf (current_monitor->dump_registers);
       resp_len = monitor_expect_prompt (buf, sizeof (buf));
       parse_register_dump (buf, resp_len);
     }
   else
-    abort(); /* Need some way to read registers */
+    abort ();                  /* Need some way to read registers */
 }
 
 static void
 monitor_fetch_registers (regno)
      int regno;
 {
-  RDEBUG(("MON fetchregs\n")) ;
-  if (current_monitor->getreg.cmd) 
+  RDEBUG (("MON fetchregs\n"));
+  if (current_monitor->getreg.cmd)
     {
       if (regno >= 0)
        {
@@ -1289,9 +1322,10 @@ monitor_fetch_registers (regno)
       for (regno = 0; regno < NUM_REGS; regno++)
        monitor_fetch_register (regno);
     }
-  else {
-    monitor_dump_regs ();
-  }
+  else
+    {
+      monitor_dump_regs ();
+    }
 }
 
 /* Store register REGNO, or all if REGNO == 0.  Return errno value.  */
@@ -1305,16 +1339,17 @@ monitor_store_register (regno)
 
   name = current_monitor->regnames[regno];
   if (!name || (*name == '\0'))
-    { RDEBUG(("MON Cannot store unknown register\n"))
-      return;
+    {
+      RDEBUG (("MON Cannot store unknown register\n"))
+       return;
     }
 
   val = read_register (regno);
-  RDEBUG(("MON storeg %d %08x\n",regno,(unsigned int)val))
+  RDEBUG (("MON storeg %d %08x\n", regno, (unsigned int) val))
 
   /* send the register deposit command */
 
-  if (current_monitor->flags & MO_REGISTER_VALUE_FIRST)
+    if (current_monitor->flags & MO_REGISTER_VALUE_FIRST)
     monitor_printf (current_monitor->setreg.cmd, val, name);
   else if (current_monitor->flags & MO_SETREG_INTERACTIVE)
     monitor_printf (current_monitor->setreg.cmd, name);
@@ -1322,20 +1357,22 @@ monitor_store_register (regno)
     monitor_printf (current_monitor->setreg.cmd, name, val);
 
   if (current_monitor->setreg.term)
-    { RDEBUG(("EXP setreg.term\n"))
-      monitor_expect (current_monitor->setreg.term, NULL, 0);
+    {
+      RDEBUG (("EXP setreg.term\n"))
+       monitor_expect (current_monitor->setreg.term, NULL, 0);
       if (current_monitor->flags & MO_SETREG_INTERACTIVE)
        monitor_printf ("%x\r", val);
       monitor_expect_prompt (NULL, 0);
     }
   else
     monitor_expect_prompt (NULL, 0);
-  if (current_monitor->setreg.term_cmd) /* Mode exit required */
-    { RDEBUG(("EXP setreg_termcmd\n")) ;
-      monitor_printf("%s",current_monitor->setreg.term_cmd) ;
-      monitor_expect_prompt(NULL,0) ;
+  if (current_monitor->setreg.term_cmd)                /* Mode exit required */
+    {
+      RDEBUG (("EXP setreg_termcmd\n"));
+      monitor_printf ("%s", current_monitor->setreg.term_cmd);
+      monitor_expect_prompt (NULL, 0);
     }
-} /* monitor_store_register */
+}                              /* monitor_store_register */
 
 /* Store the remote registers.  */
 
@@ -1378,13 +1415,13 @@ monitor_write_memory (memaddr, myaddr, len)
      char *myaddr;
      int len;
 {
-  unsigned int val, hostval ;
+  unsigned int val, hostval;
   char *cmd;
   int i;
 
-  RDEBUG(("MON write %d %08x\n",len,(unsigned long)memaddr))
+  RDEBUG (("MON write %d %08x\n", len, (unsigned long) memaddr))
 
-  if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
+    if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
     memaddr = ADDR_BITS_REMOVE (memaddr);
 
   /* Use memory fill command for leading 0 bytes.  */
@@ -1397,11 +1434,11 @@ monitor_write_memory (memaddr, myaddr, len)
 
       if (i > 4)               /* More than 4 zeros is worth doing */
        {
-         RDEBUG(("MON FILL %d\n",i))
+         RDEBUG (("MON FILL %d\n", i))
            if (current_monitor->flags & MO_FILL_USES_ADDR)
-             monitor_printf (current_monitor->fill, memaddr, (memaddr + i)-1, 0);
-           else
-             monitor_printf (current_monitor->fill, memaddr, i, 0);
+           monitor_printf (current_monitor->fill, memaddr, (memaddr + i) - 1, 0);
+         else
+           monitor_printf (current_monitor->fill, memaddr, i, 0);
 
          monitor_expect_prompt (NULL, 0);
 
@@ -1435,10 +1472,11 @@ monitor_write_memory (memaddr, myaddr, len)
     }
 
   val = extract_unsigned_integer (myaddr, len);
-  
+
   if (len == 4)
-    { hostval = * (unsigned int *) myaddr ;
-      RDEBUG(("Hostval(%08x) val(%08x)\n",hostval,val)) ;
+    {
+      hostval = *(unsigned int *) myaddr;
+      RDEBUG (("Hostval(%08x) val(%08x)\n", hostval, val));
     }
 
 
@@ -1450,13 +1488,14 @@ monitor_write_memory (memaddr, myaddr, len)
       monitor_printf_noecho (cmd, memaddr);
 
       if (current_monitor->setmem.term)
-       { RDEBUG(("EXP setmem.term")) ;
+       {
+         RDEBUG (("EXP setmem.term"));
          monitor_expect (current_monitor->setmem.term, NULL, 0);
          monitor_printf ("%x\r", val);
        }
       if (current_monitor->setmem.term_cmd)
-       { /* Emit this to get out of the memory editing state */
-         monitor_printf("%s",current_monitor->setmem.term_cmd) ;
+       {                       /* Emit this to get out of the memory editing state */
+         monitor_printf ("%s", current_monitor->setmem.term_cmd);
          /* Drop through to expecting a prompt */
        }
     }
@@ -1470,150 +1509,164 @@ monitor_write_memory (memaddr, myaddr, len)
 
 
 static int
-monitor_write_even_block(memaddr,myaddr,len)
-     CORE_ADDR memaddr ;
-     char * myaddr ;
-     int len ;
+monitor_write_even_block (memaddr, myaddr, len)
+     CORE_ADDR memaddr;
+     char *myaddr;
+     int len;
 {
-  unsigned int val ;
-  int written = 0 ;;
+  unsigned int val;
+  int written = 0;;
   /* Enter the sub mode */
-  monitor_printf(current_monitor->setmem.cmdl,memaddr) ;
-  monitor_expect_prompt(NULL,0) ;
+  monitor_printf (current_monitor->setmem.cmdl, memaddr);
+  monitor_expect_prompt (NULL, 0);
+
   while (len)
     {
-      val = extract_unsigned_integer(myaddr,4) ; /* REALLY */
-      monitor_printf("%x\r",val) ;
-      myaddr += 4 ;
-      memaddr += 4 ;
-      written += 4 ;
-      RDEBUG((" @ %08x\n",memaddr))
+      val = extract_unsigned_integer (myaddr, 4);      /* REALLY */
+      monitor_printf ("%x\r", val);
+      myaddr += 4;
+      memaddr += 4;
+      written += 4;
+      RDEBUG ((" @ %08x\n", memaddr))
       /* If we wanted to, here we could validate the address */
-      monitor_expect_prompt(NULL,0) ;
+       monitor_expect_prompt (NULL, 0);
     }
   /* Now exit the sub mode */
   monitor_printf (current_monitor->getreg.term_cmd);
-  monitor_expect_prompt(NULL,0) ;
-  return written ;
+  monitor_expect_prompt (NULL, 0);
+  return written;
 }
 
 
-static int monitor_write_memory_bytes(memaddr,myaddr,len)
-     CORE_ADDR memaddr ;
-     char * myaddr ;
-     int len ;
+static int
+monitor_write_memory_bytes (memaddr, myaddr, len)
+     CORE_ADDR memaddr;
+     char *myaddr;
+     int len;
 {
-  unsigned char val ;
-  int written = 0 ;
-  if (len == 0) return 0 ;
+  unsigned char val;
+  int written = 0;
+  if (len == 0)
+    return 0;
   /* Enter the sub mode */
-  monitor_printf(current_monitor->setmem.cmdb,memaddr) ;
-  monitor_expect_prompt(NULL,0) ;
+  monitor_printf (current_monitor->setmem.cmdb, memaddr);
+  monitor_expect_prompt (NULL, 0);
   while (len)
     {
-      val = *myaddr ;
-      monitor_printf("%x\r",val) ;
-      myaddr++ ;
-      memaddr++ ;
-      written++ ;
+      val = *myaddr;
+      monitor_printf ("%x\r", val);
+      myaddr++;
+      memaddr++;
+      written++;
       /* If we wanted to, here we could validate the address */
-      monitor_expect_prompt(NULL,0) ;
-      len-- ;
+      monitor_expect_prompt (NULL, 0);
+      len--;
     }
   /* Now exit the sub mode */
   monitor_printf (current_monitor->getreg.term_cmd);
-  monitor_expect_prompt(NULL,0) ;
-  return written ;
+  monitor_expect_prompt (NULL, 0);
+  return written;
 }
 
 
 static void
-longlongendswap (unsigned char * a)
+longlongendswap (unsigned char *a)
 {
-  int i,j ;
-  unsigned char x ;
-  i = 0 ; j = 7 ;
+  int i, j;
+  unsigned char x;
+  i = 0;
+  j = 7;
   while (i < 4)
-    { x = *(a+i) ;
-      *(a+i) = *(a+j) ;
-      *(a+j) = x ;
-      i++ , j-- ;
+    {
+      x = *(a + i);
+      *(a + i) = *(a + j);
+      *(a + j) = x;
+      i++, j--;
     }
 }
 /* Format 32 chars of long long value, advance the pointer */
-static char * hexlate = "0123456789abcdef" ;
-static char * longlong_hexchars(unsigned long long value,
-                                char * outbuff )
+static char *hexlate = "0123456789abcdef";
+static char *
+longlong_hexchars (unsigned long long value,
+                  char *outbuff)
 {
-  if (value == 0) { *outbuff++ = '0' ; return outbuff ; }
+  if (value == 0)
+    {
+      *outbuff++ = '0';
+      return outbuff;
+    }
   else
-    { static unsigned char disbuf[8] ; /* disassembly buffer */
-      unsigned char * scan , * limit ; /* loop controls */
-      unsigned char c , nib ;
-      int leadzero = 1 ;
-      scan = disbuf ; limit = scan + 8 ;
-      { unsigned long long * dp ;
-       dp = (unsigned long long *) scan ;
-       *dp = value ;
+    {
+      static unsigned char disbuf[8];  /* disassembly buffer */
+      unsigned char *scan, *limit;     /* loop controls */
+      unsigned char c, nib;
+      int leadzero = 1;
+      scan = disbuf;
+      limit = scan + 8;
+      {
+       unsigned long long *dp;
+       dp = (unsigned long long *) scan;
+       *dp = value;
       }
-      longlongendswap(disbuf) ; /* FIXME: ONly on big endian hosts */
+      longlongendswap (disbuf);        /* FIXME: ONly on big endian hosts */
       while (scan < limit)
        {
-         c = *scan++; /* a byte of our long long value */
+         c = *scan++;          /* a byte of our long long value */
          if (leadzero)
            {
              if (c == 0)
                continue;
              else
-               leadzero = 0; /* henceforth we print even zeroes */
+               leadzero = 0;   /* henceforth we print even zeroes */
            }
-         nib = c >> 4;        /* high nibble bits */
+         nib = c >> 4;         /* high nibble bits */
          *outbuff++ = hexlate[nib];
-         nib = c & 0x0f;      /* low nibble bits */
+         nib = c & 0x0f;       /* low nibble bits */
          *outbuff++ = hexlate[nib];
        }
-      return outbuff ;
+      return outbuff;
     }
-} /* longlong_hexchars */
+}                              /* longlong_hexchars */
 
 
 
 /* I am only going to call this when writing virtual byte streams.
    Which possably entails endian conversions
-   */
-static int monitor_write_memory_longlongs(memaddr,myaddr,len)
-     CORE_ADDR memaddr ;
-     char * myaddr ;
-     int len ;
+ */
+static int
+monitor_write_memory_longlongs (memaddr, myaddr, len)
+     CORE_ADDR memaddr;
+     char *myaddr;
+     int len;
 {
-  static char hexstage[20] ; /* At least 16 digits required, plus null */
-  char * endstring ;
-  long long * llptr ;
-  long long value ;
-  int written = 0 ;
-  llptr = (unsigned long long *) myaddr ;
-  if (len == 0 ) return 0 ;
-  monitor_printf(current_monitor->setmem.cmdll,memaddr) ;
-  monitor_expect_prompt(NULL,0) ;
-  while (len >= 8 )
-    {
-      value = *llptr ;
-      endstring = longlong_hexchars(*llptr,hexstage) ;
-      *endstring = '\0' ; /* NUll terminate for printf */
-      monitor_printf("%s\r",hexstage) ;
-      llptr++ ;
-      memaddr += 8 ;
-      written += 8 ;
+  static char hexstage[20];    /* At least 16 digits required, plus null */
+  char *endstring;
+  long long *llptr;
+  long long value;
+  int written = 0;
+  llptr = (unsigned long long *) myaddr;
+  if (len == 0)
+    return 0;
+  monitor_printf (current_monitor->setmem.cmdll, memaddr);
+  monitor_expect_prompt (NULL, 0);
+  while (len >= 8)
+    {
+      value = *llptr;
+      endstring = longlong_hexchars (*llptr, hexstage);
+      *endstring = '\0';       /* NUll terminate for printf */
+      monitor_printf ("%s\r", hexstage);
+      llptr++;
+      memaddr += 8;
+      written += 8;
       /* If we wanted to, here we could validate the address */
-      monitor_expect_prompt(NULL,0) ;
-      len -= 8 ;
+      monitor_expect_prompt (NULL, 0);
+      len -= 8;
     }
   /* Now exit the sub mode */
   monitor_printf (current_monitor->getreg.term_cmd);
-  monitor_expect_prompt(NULL,0) ;
-  return written ;
-} /* */
+  monitor_expect_prompt (NULL, 0);
+  return written;
+}                              /* */
 
 
 
@@ -1624,40 +1677,41 @@ static int monitor_write_memory_longlongs(memaddr,myaddr,len)
    Without this, we will end up calling monitor_write_memory many times
    and do the entry and exit of the sub mode many times
    This currently assumes...
-     MO_SETMEM_INTERACTIVE
-     ! MO_NO_ECHO_ON_SETMEM
-     To use this, the you have to patch the monitor_cmds block with
-     this function. Otherwise, its not tuned up for use by all
-     monitor variations.
  */
+   MO_SETMEM_INTERACTIVE
+   ! MO_NO_ECHO_ON_SETMEM
+   To use this, the you have to patch the monitor_cmds block with
+   this function. Otherwise, its not tuned up for use by all
+   monitor variations.
+ */
 
-static int monitor_write_memory_block(memaddr,myaddr,len)
-     CORE_ADDR memaddr ;
-     char * myaddr ;
-     int len ;
+static int
+monitor_write_memory_block (memaddr, myaddr, len)
+     CORE_ADDR memaddr;
+     char *myaddr;
+     int len;
 {
-  int written ;
-  written = 0 ;
+  int written;
+  written = 0;
   /* FIXME: This would be a good place to put the zero test */
-#if 1 
+#if 1
   if ((len > 8) && (((len & 0x07)) == 0) && current_monitor->setmem.cmdll)
-       {
-        return monitor_write_memory_longlongs(memaddr,myaddr,len) ;
-       }
-#endif  
-#if 0 
+    {
+      return monitor_write_memory_longlongs (memaddr, myaddr, len);
+    }
+#endif
+#if 0
   if (len > 4)
     {
-      int sublen ;
-      written = monitor_write_even_block(memaddr,myaddr,len) ;
+      int sublen;
+      written = monitor_write_even_block (memaddr, myaddr, len);
       /* Adjust calling parameters by written amount */
-      memaddr += written ;
-      myaddr += written ;
-      len -= written ;
+      memaddr += written;
+      myaddr += written;
+      len -= written;
     }
 #endif
-  written = monitor_write_memory_bytes(memaddr,myaddr,len) ;
-  return written ;
+  written = monitor_write_memory_bytes (memaddr, myaddr, len);
+  return written;
 }
 
 /* This is an alternate form of monitor_read_memory which is used for monitors
@@ -1670,12 +1724,12 @@ monitor_read_memory_single (memaddr, myaddr, len)
      int len;
 {
   unsigned int val;
-  char membuf[sizeof(int) * 2 + 1];
+  char membuf[sizeof (int) * 2 + 1];
   char *p;
   char *cmd;
   int i;
 
-  RDEBUG(("MON read single\n")) ;
+  RDEBUG (("MON read single\n"));
 #if 0
   /* Can't actually use long longs (nice idea, though).  In fact, the
      call to strtoul below will fail if it tries to convert a value
@@ -1712,7 +1766,8 @@ monitor_read_memory_single (memaddr, myaddr, len)
      searching from the start of the buf.  */
 
   if (current_monitor->getmem.resp_delim)
-    { RDEBUG(("EXP getmem.resp_delim\n")) ;
+    {
+      RDEBUG (("EXP getmem.resp_delim\n"));
       monitor_expect_regexp (&getmem_resp_delim_pattern, NULL, 0);
     }
 
@@ -1720,7 +1775,7 @@ monitor_read_memory_single (memaddr, myaddr, len)
      skipping spaces.  */
 
   /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */
-  if (current_monitor->flags & MO_HEX_PREFIX) 
+  if (current_monitor->flags & MO_HEX_PREFIX)
     {
       int c;
 
@@ -1760,7 +1815,7 @@ monitor_read_memory_single (memaddr, myaddr, len)
 
   if (current_monitor->getmem.term)
     {
-      monitor_expect (current_monitor->getmem.term, NULL, 0); /* get response */
+      monitor_expect (current_monitor->getmem.term, NULL, 0);  /* get response */
 
       if (current_monitor->getmem.term_cmd)
        {
@@ -1769,7 +1824,7 @@ monitor_read_memory_single (memaddr, myaddr, len)
        }
     }
   else
-    monitor_expect_prompt (NULL, 0); /* get response */
+    monitor_expect_prompt (NULL, 0);   /* get response */
 
   p = membuf;
   val = strtoul (membuf, &p, 16);
@@ -1808,8 +1863,9 @@ monitor_read_memory (memaddr, myaddr, len)
       return 0;
     }
 
-  if (remote_debug) printf("MON read block ta(%08x) ha(%08x) %d\n",
-         (unsigned long) memaddr , (unsigned long)myaddr, len);
+  if (remote_debug)
+    printf ("MON read block ta(%08x) ha(%08x) %d\n",
+           (unsigned long) memaddr, (unsigned long) myaddr, len);
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
     memaddr = ADDR_BITS_REMOVE (memaddr);
@@ -1822,10 +1878,10 @@ monitor_read_memory (memaddr, myaddr, len)
   /* Some dumpers align the first data with the preceeding 16
      byte boundary. Some print blanks and start at the
      requested boundary. EXACT_DUMPADDR
-     */
+   */
 
   dumpaddr = (current_monitor->flags & MO_EXACT_DUMPADDR)
-    ? memaddr : memaddr & ~ 0x0f ;
+    ? memaddr : memaddr & ~0x0f;
 
   /* See if xfer would cross a 16 byte boundary.  If so, clip it.  */
   if (((memaddr ^ (memaddr + len - 1)) & ~0xf) != 0)
@@ -1847,7 +1903,7 @@ monitor_read_memory (memaddr, myaddr, len)
 
   if (current_monitor->getmem.term)
     {
-      resp_len = monitor_expect (current_monitor->getmem.term, buf, sizeof buf); /* get response */
+      resp_len = monitor_expect (current_monitor->getmem.term, buf, sizeof buf);       /* get response */
 
       if (resp_len <= 0)
        monitor_error ("monitor_read_memory (0x%x):  excessive response from monitor: %.*s.",
@@ -1861,7 +1917,7 @@ monitor_read_memory (memaddr, myaddr, len)
        }
     }
   else
-    resp_len = monitor_expect_prompt (buf, sizeof buf); /* get response */
+    resp_len = monitor_expect_prompt (buf, sizeof buf);                /* get response */
 
   p = buf;
 
@@ -1873,7 +1929,7 @@ monitor_read_memory (memaddr, myaddr, len)
     {
       int retval, tmp;
       struct re_registers resp_strings;
-      RDEBUG(("MON getmem.resp_delim %s\n",current_monitor->getmem.resp_delim)) ;
+      RDEBUG (("MON getmem.resp_delim %s\n", current_monitor->getmem.resp_delim));
 
       memset (&resp_strings, 0, sizeof (struct re_registers));
       tmp = strlen (p);
@@ -1893,35 +1949,42 @@ monitor_read_memory (memaddr, myaddr, len)
       p += strlen (current_monitor->getmem.resp_delim);
 #endif
     }
-  if (remote_debug) printf("MON scanning  %d ,%08x '%s'\n",len,p,p) ;
+  if (remote_debug)
+    printf ("MON scanning  %d ,%08x '%s'\n", len, p, p);
   if (current_monitor->flags & MO_GETMEM_16_BOUNDARY)
     {
-      char c ;
-      int fetched = 0 ;
+      char c;
+      int fetched = 0;
       i = len;
-      c = *p ;
+      c = *p;
 
-                           
-      while (!(c  == '\000' || c == '\n' || c == '\r') && i > 0)
-       { if (isxdigit (c))
-           { if ((dumpaddr >= memaddr) && (i > 0))
-               { val = fromhex (c) * 16 + fromhex (*(p+1));
+
+      while (!(c == '\000' || c == '\n' || c == '\r') && i > 0)
+       {
+         if (isxdigit (c))
+           {
+             if ((dumpaddr >= memaddr) && (i > 0))
+               {
+                 val = fromhex (c) * 16 + fromhex (*(p + 1));
                  *myaddr++ = val;
-                 if (remote_debug) printf("[%02x]",val) ;
+                 if (remote_debug)
+                   printf ("[%02x]", val);
                  --i;
-                 fetched++ ;
+                 fetched++;
                }
              ++dumpaddr;
              ++p;
            }
-         ++p; /* skip a blank or other non hex char */
-         c = *p ;
+         ++p;                  /* skip a blank or other non hex char */
+         c = *p;
        }
-      if (fetched == 0) error("Failed to read via monitor") ;
-      if (remote_debug) printf("\n") ;
-      return fetched ; /* Return the number of bytes actually read */
+      if (fetched == 0)
+       error ("Failed to read via monitor");
+      if (remote_debug)
+       printf ("\n");
+      return fetched;          /* Return the number of bytes actually read */
     }
-  RDEBUG(("MON scanning bytes\n")) ;
+  RDEBUG (("MON scanning bytes\n"));
 
   for (i = len; i > 0; i--)
     {
@@ -1961,7 +2024,7 @@ monitor_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   return dcache_xfer_memory (remote_dcache, memaddr, myaddr, len, write);
 }
@@ -1969,7 +2032,7 @@ monitor_xfer_memory (memaddr, myaddr, len, write, target)
 static void
 monitor_kill ()
 {
-  return;              /* ignore attempts to kill target system */
+  return;                      /* ignore attempts to kill target system */
 }
 
 /* All we actually do is set the PC to the start address of exec_bfd, and start
@@ -2012,8 +2075,8 @@ monitor_insert_breakpoint (addr, shadow)
   unsigned char *bp;
   int bplen;
 
-  RDEBUG(("MON inst bkpt %08x\n",addr)) 
-  if (current_monitor->set_break == NULL)
+  RDEBUG (("MON inst bkpt %08x\n", addr))
+    if (current_monitor->set_break == NULL)
     error ("No set_break defined for this monitor");
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
@@ -2046,8 +2109,8 @@ monitor_remove_breakpoint (addr, shadow)
 {
   int i;
 
-  RDEBUG(("MON rmbkpt %08x\n",addr))
-  if (current_monitor->clr_break == NULL)
+  RDEBUG (("MON rmbkpt %08x\n", addr))
+    if (current_monitor->clr_break == NULL)
     error ("No clr_break defined for this monitor");
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
@@ -2105,13 +2168,13 @@ monitor_wait_srec_ack ()
 
 static void
 monitor_load (file, from_tty)
-    char *file;
-    int  from_tty;
+     char *file;
+     int from_tty;
 {
   dcache_flush (remote_dcache);
-  RDEBUG(("MON load\n"))
+  RDEBUG (("MON load\n"))
 
-  if (current_monitor->load_routine)
+    if (current_monitor->load_routine)
     current_monitor->load_routine (monitor_desc, file, hashmark);
   else
     {                          /* The default is ascii S-records */
@@ -2133,7 +2196,7 @@ monitor_load (file, from_tty)
       load_srec (monitor_desc, file, (bfd_vma) load_offset,
                 32, SREC_ALL, hashmark,
                 current_monitor->flags & MO_SREC_ACK ?
-                  monitor_wait_srec_ack : NULL);
+                monitor_wait_srec_ack : NULL);
 
       monitor_expect_prompt (NULL, 0);
     }
@@ -2157,7 +2220,7 @@ monitor_load (file, from_tty)
 static void
 monitor_stop ()
 {
-  RDEBUG(("MON stop\n")) ;
+  RDEBUG (("MON stop\n"));
   if ((current_monitor->flags & MO_SEND_BREAK_ON_STOP) != 0)
     SERIAL_SEND_BREAK (monitor_desc);
   if (current_monitor->stop)
@@ -2189,7 +2252,7 @@ monitor_command (args, from_tty)
 
   resp_len = monitor_expect_prompt (buf, sizeof buf);
 
-  fputs_unfiltered (buf, gdb_stdout); /* Output the response */
+  fputs_unfiltered (buf, gdb_stdout);  /* Output the response */
 }
 
 /* Convert hex digit A to a number.  */
@@ -2198,7 +2261,7 @@ monitor_command (args, from_tty)
 static int
 from_hex (a)
      int a;
-{  
+{
   if (a >= '0' && a <= '9')
     return a - '0';
   if (a >= 'a' && a <= 'f')
@@ -2284,7 +2347,7 @@ init_base_monitor_ops (void)
   monitor_ops.to_sections = 0;
   monitor_ops.to_sections_end = 0;
   monitor_ops.to_magic = OPS_MAGIC;
-} /* init_base_monitor_ops */
+}                              /* init_base_monitor_ops */
 
 /* Init the target_ops structure pointed at by OPS */
 
@@ -2305,14 +2368,12 @@ _initialize_remote_monitors ()
 {
   init_base_monitor_ops ();
   add_show_from_set (add_set_cmd ("hash", no_class, var_boolean,
-                                  (char *)&hashmark,
+                                 (char *) &hashmark,
                                  "Set display of activity while downloading a file.\n\
 When enabled, a hashmark \'#\' is displayed.",
-                                  &setlist),
+                                 &setlist),
                     &showlist);
 
   add_com ("monitor", class_obscure, monitor_command,
-          "Send a command to the debug monitor."); 
+          "Send a command to the debug monitor.");
 }
-
-
index 927d58724c558d3350a7692ebbf5322a98e5e281..cef907bc41debefe5c90e286e56cefb0c15f814d 100644 (file)
@@ -1,23 +1,24 @@
 /* Definitions for remote debugging interface for ROM monitors.
-    Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
-    Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
-  
+   Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
+   Contributed by Cygnus Support. Written by Rob Savoye for 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.
-*/
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+ */
 
 #include "serial.h"
 
    will also be ignored if TERM is NULL.  */
 
 struct memrw_cmd
-{
-  char *cmdb;                  /* Command to send for byte read/write */
-  char *cmdw;                  /* Command for word (16 bit) read/write */
-  char *cmdl;                  /* Command for long (32 bit) read/write */
-  char *cmdll;                 /* Command for long long (64 bit) read/write */
-  char *resp_delim;            /* String just prior to the desired value */
-  char *term;                  /* Terminating string to search for */
-  char *term_cmd;              /* String to get out of sub-mode (if necessary) */
-};
+  {
+    char *cmdb;                        /* Command to send for byte read/write */
+    char *cmdw;                        /* Command for word (16 bit) read/write */
+    char *cmdl;                        /* Command for long (32 bit) read/write */
+    char *cmdll;               /* Command for long long (64 bit) read/write */
+    char *resp_delim;          /* String just prior to the desired value */
+    char *term;                        /* Terminating string to search for */
+    char *term_cmd;            /* String to get out of sub-mode (if necessary) */
+  };
 
 struct regrw_cmd
-{
-  char *cmd;                   /* Command to send for reg read/write */
-  char *resp_delim;            /* String (actually a regexp if getmem) just
+  {
+    char *cmd;                 /* Command to send for reg read/write */
+    char *resp_delim;          /* String (actually a regexp if getmem) just
                                   prior to the desired value */
-  char *term;                  /* Terminating string to search for */
-  char *term_cmd;              /* String to get out of sub-mode (if necessary) */
-};
+    char *term;                        /* Terminating string to search for */
+    char *term_cmd;            /* String to get out of sub-mode (if necessary) */
+  };
 
 struct monitor_ops
-{
-  int flags;                   /* See below */
-  char **init;                 /* List of init commands.  NULL terminated. */
-  char *cont;                  /* continue command */
-  char *step;                  /* single step */
-  char *stop;                  /* Interrupt program string */
-  char *set_break;             /* set a breakpoint. If NULL, monitor implementation
+  {
+    int flags;                 /* See below */
+    char **init;               /* List of init commands.  NULL terminated. */
+    char *cont;                        /* continue command */
+    char *step;                        /* single step */
+    char *stop;                        /* Interrupt program string */
+    char *set_break;           /* set a breakpoint. If NULL, monitor implementation
                                   sets its own to_insert_breakpoint method. */
-  char *clr_break;             /* clear a breakpoint */
-  char *clr_all_break;         /* Clear all breakpoints */
-  char *fill;                  /* Memory fill cmd (addr len val) */
-  struct memrw_cmd setmem;     /* set memory to a value */
-  struct memrw_cmd getmem;     /* display memory */
-  struct regrw_cmd setreg;     /* set a register */
-  struct regrw_cmd getreg;     /* get a register */
-                               /* Some commands can dump a bunch of registers
-                                  at once.  This comes as a set of REG=VAL
-                                  pairs.  This should be called for each pair
-                                  of registers that we can parse to supply
-                                  GDB with the value of a register.  */
-  char *dump_registers;                /* Command to dump all regs at once */
-  char *register_pattern;      /* Pattern that picks out register from reg dump */
-  void (*supply_register) PARAMS ((char *name, int namelen,
-                                  char *val, int vallen));
-  void (*load_routine) PARAMS ((serial_t desc, char *file,
-                               int hashmark)); /* Download routine */
-  int (*dumpregs) PARAMS((void)) ;    /* routine to dump all registers */
-  int (*continue_hook) PARAMS((void)) ; /* Emit the continue command */
-  int (*wait_filter) PARAMS((char * buf, /* Maybe contains registers */
-                           int bufmax ,
-                           int * response_length,
-                           struct target_waitstatus * status)) ;
-  char *load;                  /* load command */
-  char *loadresp;              /* Response to load command */
-  char *prompt;                        /* monitor command prompt */
-  char *line_term;             /* end-of-command delimitor */
-  char *cmd_end;               /* optional command terminator */
-  struct target_ops *target;   /* target operations */
-  int stopbits;                        /* number of stop bits */
-  char **regnames;             /* array of register names in ascii */
-  int num_breakpoints;          /* If set_break != NULL, number of supported
+    char *clr_break;           /* clear a breakpoint */
+    char *clr_all_break;       /* Clear all breakpoints */
+    char *fill;                        /* Memory fill cmd (addr len val) */
+    struct memrw_cmd setmem;   /* set memory to a value */
+    struct memrw_cmd getmem;   /* display memory */
+    struct regrw_cmd setreg;   /* set a register */
+    struct regrw_cmd getreg;   /* get a register */
+    /* Some commands can dump a bunch of registers
+       at once.  This comes as a set of REG=VAL
+       pairs.  This should be called for each pair
+       of registers that we can parse to supply
+       GDB with the value of a register.  */
+    char *dump_registers;      /* Command to dump all regs at once */
+    char *register_pattern;    /* Pattern that picks out register from reg dump */
+    void (*supply_register) PARAMS ((char *name, int namelen,
+                                    char *val, int vallen));
+    void (*load_routine) PARAMS ((serial_t desc, char *file,
+                                 int hashmark));       /* Download routine */
+    int (*dumpregs) PARAMS ((void));   /* routine to dump all registers */
+    int (*continue_hook) PARAMS ((void));      /* Emit the continue command */
+    int (*wait_filter) PARAMS ((char *buf,     /* Maybe contains registers */
+                               int bufmax,
+                               int *response_length,
+                               struct target_waitstatus * status));
+    char *load;                        /* load command */
+    char *loadresp;            /* Response to load command */
+    char *prompt;              /* monitor command prompt */
+    char *line_term;           /* end-of-command delimitor */
+    char *cmd_end;             /* optional command terminator */
+    struct target_ops *target; /* target operations */
+    int stopbits;              /* number of stop bits */
+    char **regnames;           /* array of register names in ascii */
+    int num_breakpoints;       /* If set_break != NULL, number of supported
                                   breakpoints */
-  int magic;                   /* Check value */
-};
+    int magic;                 /* Check value */
+  };
 
 /* The monitor ops magic number, used to detect if an ops structure doesn't
    have the right number of entries filled in. */
@@ -217,8 +218,8 @@ struct monitor_ops
 #define MO_PRINT_PROGRAM_OUTPUT 0x200000
 
 /* Some dump bytes commands align the first data with the preceeding
-16 byte boundary. Some print blanks and start at the exactly the
-requested boundary. */
+   16 byte boundary. Some print blanks and start at the exactly the
+   requested boundary. */
 
 #define MO_EXACT_DUMPADDR 0x400000
 
@@ -227,24 +228,25 @@ requested boundary. */
    the memory editing mode. You only need to worry about this
    if you are doing memory downloading.
    This engages a new write function registered with dcache.
  */
+ */
 #define MO_HAS_BLOCKWRITES 0x800000
 
 #define SREC_SIZE 160
 
-extern void monitor_open PARAMS ((char *args, struct monitor_ops *ops,
+extern void monitor_open PARAMS ((char *args, struct monitor_ops * ops,
                                  int from_tty));
 extern void monitor_close PARAMS ((int quitting));
 extern char *monitor_supply_register PARAMS ((int regno, char *valstr));
 extern int monitor_expect PARAMS ((char *prompt, char *buf, int buflen));
 extern int monitor_expect_prompt PARAMS ((char *buf, int buflen));
-extern void monitor_printf PARAMS ((char *, ...))
-     ATTR_FORMAT(printf, 1, 2);
-extern void monitor_printf_noecho PARAMS ((char *, ...))
-     ATTR_FORMAT(printf, 1, 2);
-extern void monitor_write PARAMS ((char *buf, int buflen));
-extern int monitor_readchar PARAMS ((void));
-extern char *monitor_get_dev_name PARAMS ((void));
-extern void init_monitor_ops PARAMS ((struct target_ops *));
-extern int monitor_dump_reg_block PARAMS((char * dump_cmd)) ;
-extern void flush_monitor_dcache PARAMS ((void));
+extern void monitor_printf
+PARAMS ((char *,...))
+ATTR_FORMAT (printf, 1, 2);
+     extern void monitor_printf_noecho PARAMS ((char *,...))
+  ATTR_FORMAT (printf, 1, 2);
+     extern void monitor_write PARAMS ((char *buf, int buflen));
+     extern int monitor_readchar PARAMS ((void));
+     extern char *monitor_get_dev_name PARAMS ((void));
+     extern void init_monitor_ops PARAMS ((struct target_ops *));
+     extern int monitor_dump_reg_block PARAMS ((char *dump_cmd));
+     extern void flush_monitor_dcache PARAMS ((void));
index 7f57aeb1d46a95781890ed19653f75ef29af6a6f..b3732fb1c5985e5cc28c37ac9729941253d4b864 100644 (file)
@@ -1,38 +1,39 @@
 /* Low level interface to ptrace, for GDB when running under Unix.
    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifdef __GNUC__
 /* Bad implement execle(3). It's depend for "/bin/cc".
 
    main()
    {
-     printf("execle:\n");
-     execle(FILE, ARGS, envp);
-     exit(1);
+   printf("execle:\n");
+   execle(FILE, ARGS, envp);
+   exit(1);
    }
 
    GCC:
    link a6,#0
-   pea LC5     ; call printf
+   pea LC5      ; call printf
    jbsr _printf
-   ;           ; (not popd stack)
-   pea _envp   ; call execle
+   ;            ; (not popd stack)
+   pea _envp    ; call execle
    clrl sp@-
    pea LC4
    pea LC4
@@ -40,26 +41,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    pea LC3
    pea LC6
    jbsr _execle
-   addw #32,sp ; delayed pop !!
+   addw #32,sp  ; delayed pop !!
 
    /bin/cc:
-   link.l      fp,#L23
-   movem.l     #L24,(sp)
-   pea L26             ; call printf
-   jbsr        _printf
-   addq.l      #4,sp   ; <--- popd stack !!
-   pea _envp           ; call execle
-   clr.l       -(sp)
-   pea L32
-   
  */
+   link.l       fp,#L23
+   movem.l      #L24,(sp)
+   pea  L26             ; call printf
+   jbsr _printf
+   addq.l       #4,sp   ; <--- popd stack !!
+   pea  _envp           ; call execle
+   clr.l        -(sp)
+   pea  L32
+
+ */
 
-execle(name, args)
+execle (name, args)
      char *name, *args;
 {
-  register char        **env = &args;
+  register char **env = &args;
   while (*env++)
     ;
-  execve(name, (char **)&args, (char **)*env);
+  execve (name, (char **) &args, (char **) *env);
 }
 #endif
index 2e0b10c6a94f6e3eb440d893f5ac93ed7cef7275..4f4fd53655902433b7a80eb7f1e3a76bc89df88c 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1991 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Miscellaneous NINDY-dependent routines.
    Some replace macros normally defined in "tm.h".  */
@@ -34,41 +35,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 int
 nindy_frame_chain_valid (chain, curframe)
-    CORE_ADDR chain;
-    struct frame_info *curframe;
+     CORE_ADDR chain;
+     struct frame_info *curframe;
 {
-       struct symbol *sym;
-       struct minimal_symbol *msymbol;
+  struct symbol *sym;
+  struct minimal_symbol *msymbol;
 
-       /* crtnindy.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 crtnindy.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;
+  /* crtnindy.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 crtnindy.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;
-       }
+  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);
-       }
+  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) );
+  return (chain != read_memory_integer (a, 4));
 }
index f85d2b5ea09fe35ded70d0017cd849df12829263..71018ddae9d549d81de8710ba2e43db9bb541a29 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support (fnf@cygnus.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -43,7 +44,7 @@ static void
 nlm_symfile_finish PARAMS ((struct objfile *));
 
 static void
-nlm_symtab_read PARAMS ((bfd *,  CORE_ADDR, struct objfile *));
+nlm_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *));
 
 /* Initialize anything that needs initializing when a completely new symbol
    file is specified (not just adding some symbols from another file, e.g. a
@@ -78,22 +79,22 @@ nlm_symfile_init (ignore)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       nlm_symtab_read -- read the symbol table of an NLM file
+   nlm_symtab_read -- read the symbol table of an NLM file
 
-SYNOPSIS
+   SYNOPSIS
 
-       void nlm_symtab_read (bfd *abfd, CORE_ADDR addr,
-                             struct objfile *objfile)
+   void nlm_symtab_read (bfd *abfd, CORE_ADDR addr,
+   struct objfile *objfile)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an open bfd, a base address to relocate symbols to, and a
-       flag that specifies whether or not this bfd is for an executable
-       or not (may be shared library for example), add all the global
-       function and data symbols to the minimal symbol table.
-*/
+   Given an open bfd, a base address to relocate symbols to, and a
+   flag that specifies whether or not this bfd is for an executable
+   or not (may be shared library for example), add all the global
+   function and data symbols to the minimal symbol table.
+ */
 
 static void
 nlm_symtab_read (abfd, addr, objfile)
@@ -109,7 +110,7 @@ nlm_symtab_read (abfd, addr, objfile)
   struct cleanup *back_to;
   CORE_ADDR symaddr;
   enum minimal_symbol_type ms_type;
-  
+
   storage_needed = bfd_get_symtab_upper_bound (abfd);
   if (storage_needed < 0)
     error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
@@ -118,33 +119,33 @@ nlm_symtab_read (abfd, addr, objfile)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
       back_to = make_cleanup (free, symbol_table);
-      number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); 
+      number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
       if (number_of_symbols < 0)
        error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
               bfd_errmsg (bfd_get_error ()));
-  
+
       for (i = 0; i < number_of_symbols; i++)
        {
          sym = symbol_table[i];
-         if (/*sym -> flags & BSF_GLOBAL*/ 1)
+         if ( /*sym -> flags & BSF_GLOBAL */ 1)
            {
              /* Bfd symbols are section relative. */
-             symaddr = sym -> value + sym -> section -> vma;
+             symaddr = sym->value + sym->section->vma;
              /* Relocate all non-absolute symbols by base address.  */
-             if (sym -> section != &bfd_abs_section)
+             if (sym->section != &bfd_abs_section)
                symaddr += addr;
 
              /* For non-absolute symbols, use the type of the section
-                they are relative to, to intuit text/data.  BFD provides
-                no way of figuring this out for absolute symbols. */
-             if (sym -> section -> flags & SEC_CODE)
+                they are relative to, to intuit text/data.  BFD provides
+                no way of figuring this out for absolute symbols. */
+             if (sym->section->flags & SEC_CODE)
                ms_type = mst_text;
-             else if (sym -> section -> flags & SEC_DATA)
+             else if (sym->section->flags & SEC_DATA)
                ms_type = mst_data;
              else
                ms_type = mst_unknown;
 
-             prim_record_minimal_symbol (sym -> name, symaddr, ms_type,
+             prim_record_minimal_symbol (sym->name, symaddr, ms_type,
                                          objfile);
            }
        }
@@ -186,7 +187,7 @@ nlm_symfile_read (objfile, section_offsets, mainline)
      struct section_offsets *section_offsets;
      int mainline;
 {
-  bfd *abfd = objfile -> obfd;
+  bfd *abfd = objfile->obfd;
   struct cleanup *back_to;
   CORE_ADDR offset;
   struct symbol *mainsym;
@@ -209,7 +210,7 @@ nlm_symfile_read (objfile, section_offsets, mainline)
   mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL);
 
   if (mainsym
-      && SYMBOL_CLASS(mainsym) == LOC_BLOCK)
+      && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
     {
       objfile->ei.main_func_lowpc = BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
       objfile->ei.main_func_highpc = BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
@@ -236,9 +237,9 @@ static void
 nlm_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (objfile -> sym_private != NULL)
+  if (objfile->sym_private != NULL)
     {
-      mfree (objfile -> md, objfile -> sym_private);
+      mfree (objfile->md, objfile->sym_private);
     }
 }
 
@@ -247,13 +248,13 @@ nlm_symfile_finish (objfile)
 static struct sym_fns nlm_sym_fns =
 {
   bfd_target_nlm_flavour,
-  nlm_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  nlm_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  nlm_symfile_read,    /* sym_read: read a symbol file into symtab */
-  nlm_symfile_finish,  /* sym_finish: finished with file, cleanup */
+  nlm_new_init,                        /* sym_new_init: init anything gbl to entire symtab */
+  nlm_symfile_init,            /* sym_init: read initial info, setup for sym_read() */
+  nlm_symfile_read,            /* sym_read: read a symbol file into symtab */
+  nlm_symfile_finish,          /* sym_finish: finished with file, cleanup */
   default_symfile_offsets,
                        /* sym_offsets:  Translate ext. to int. relocation */
-  NULL                 /* next: pointer to next struct sym_fns */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
index bf5208a2b5ae5c512e62c8d1d88c9fe2c7b32edc..fc166de5ee01963327a31649fc000de83981696b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1988, 1991, 1992, 1994, 1995
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 
@@ -36,12 +37,13 @@ merlin_skip_prologue (pc)
   register int op = read_memory_integer (pc, 1);
   if (op == 0x82)
     {
-      op = read_memory_integer (pc+2,1);
+      op = read_memory_integer (pc + 2, 1);
       if ((op & 0x80) == 0)
        pc += 3;
       else if ((op & 0xc0) == 0x80)
        pc += 4;
-      else pc += 6;
+      else
+       pc += 6;
     }
   return pc;
 }
@@ -53,14 +55,14 @@ umax_skip_prologue (pc)
   register unsigned char op = read_memory_integer (pc, 1);
   if (op == 0x82)
     {
-      op = read_memory_integer (pc+2,1);
+      op = read_memory_integer (pc + 2, 1);
       if ((op & 0x80) == 0)
        pc += 3;
       else if ((op & 0xc0) == 0x80)
        pc += 4;
       else
        pc += 6;
-    } 
+    }
   return pc;
 }
 
@@ -78,22 +80,22 @@ merlin_frame_num_args (fi)
   int width;
 
   pc = FRAME_SAVED_PC (fi);
-  insn = read_memory_integer (pc,2);
+  insn = read_memory_integer (pc, 2);
   addr_mode = (insn >> 11) & 0x1f;
   insn = insn & 0x7ff;
   if ((insn & 0x7fc) == 0x57c
-      && addr_mode == 0x14) /* immediate */
+      && addr_mode == 0x14)    /* immediate */
     {
-      if (insn == 0x57c) /* adjspb */
+      if (insn == 0x57c)       /* adjspb */
        width = 1;
-      else if (insn == 0x57d) /* adjspw */
+      else if (insn == 0x57d)  /* adjspw */
        width = 2;
-      else if (insn == 0x57f) /* adjspd */
+      else if (insn == 0x57f)  /* adjspd */
        width = 4;
-      numargs = read_memory_integer (pc+2,width);
+      numargs = read_memory_integer (pc + 2, width);
       if (width > 1)
        flip_bytes (&numargs, width);
-      numargs = - sign_extend (numargs, width*8) / 4;
+      numargs = -sign_extend (numargs, width * 8) / 4;
     }
   else
     numargs = -1;
@@ -124,22 +126,22 @@ umax_frame_num_args (fi)
       pc = ((enter_addr == 1)
            ? SAVED_PC_AFTER_CALL (fi)
            : FRAME_SAVED_PC (fi));
-      insn = read_memory_integer (pc,2);
+      insn = read_memory_integer (pc, 2);
       addr_mode = (insn >> 11) & 0x1f;
       insn = insn & 0x7ff;
       if ((insn & 0x7fc) == 0x57c
-         && addr_mode == 0x14) /* immediate */
+         && addr_mode == 0x14) /* immediate */
        {
-         if (insn == 0x57c) /* adjspb */
+         if (insn == 0x57c)    /* adjspb */
            width = 1;
-         else if (insn == 0x57d) /* adjspw */
+         else if (insn == 0x57d)       /* adjspw */
            width = 2;
-         else if (insn == 0x57f) /* adjspd */
+         else if (insn == 0x57f)       /* adjspd */
            width = 4;
-         numargs = read_memory_integer (pc+2,width);
+         numargs = read_memory_integer (pc + 2, width);
          if (width > 1)
            flip_bytes (&numargs, width);
-         numargs = - sign_extend (numargs, width*8) / 4;
+         numargs = -sign_extend (numargs, width * 8) / 4;
        }
     }
   return numargs;
@@ -149,7 +151,7 @@ umax_frame_num_args (fi)
 sign_extend (value, bits)
 {
   value = value & ((1 << bits) - 1);
-  return (value & (1 << (bits-1))
+  return (value & (1 << (bits - 1))
          ? value | (~((1 << bits) - 1))
          : value);
 }
@@ -164,8 +166,8 @@ flip_bytes (ptr, count)
   while (count > 0)
     {
       tmp = *ptr;
-      ptr[0] = ptr[count-1];
-      ptr[count-1] = tmp;
+      ptr[0] = ptr[count - 1];
+      ptr[count - 1] = tmp;
       ptr++;
       count -= 2;
     }
@@ -182,17 +184,17 @@ ns32k_localcount (enter_pc)
   unsigned char localtype;
   int localcount;
 
-  localtype = read_memory_integer (enter_pc+2, 1);
+  localtype = read_memory_integer (enter_pc + 2, 1);
   if ((localtype & 0x80) == 0)
     localcount = localtype;
   else if ((localtype & 0xc0) == 0x80)
     localcount = (((localtype & 0x3f) << 8)
-                 | (read_memory_integer (enter_pc+3, 1) & 0xff));
+                 | (read_memory_integer (enter_pc + 3, 1) & 0xff));
   else
     localcount = (((localtype & 0x3f) << 24)
-                 | ((read_memory_integer (enter_pc+3, 1) & 0xff) << 16)
-                 | ((read_memory_integer (enter_pc+4, 1) & 0xff) << 8 )
-                 | (read_memory_integer (enter_pc+5, 1) & 0xff));
+                 | ((read_memory_integer (enter_pc + 3, 1) & 0xff) << 16)
+                 | ((read_memory_integer (enter_pc + 4, 1) & 0xff) << 8)
+                 | (read_memory_integer (enter_pc + 5, 1) & 0xff));
   return localcount;
 }
 
@@ -226,17 +228,17 @@ ns32k_get_enter_addr (pc)
     return 0;
 
   if (ns32k_about_to_return (pc))
-    return 1;          /* after exit */
+    return 1;                  /* after exit */
 
   enter_addr = get_pc_function_start (pc);
 
-  if (pc == enter_addr) 
-    return 1;          /* before enter */
+  if (pc == enter_addr)
+    return 1;                  /* before enter */
 
   op = read_memory_integer (enter_addr, 1);
 
   if (op != 0x82)
-    return 0;          /* function has no enter/exit */
+    return 0;                  /* function has no enter/exit */
 
-  return enter_addr;   /* pc is between enter and exit */
+  return enter_addr;           /* pc is between enter and exit */
 }
index cdafb9ce0d448cec8269c608b47235d7ac0ff0e7..bd4f70d6fdd4cf8a62ee41477d52d4db6817955e 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface to ns532 running mach 3.0.
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -28,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <mach_error.h>
 
 #define private static
-
 \f
+
 /* 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 :-)
@@ -42,16 +43,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  * location where the gdb registers[i] is stored.
  */
 
-static int reg_offset[] = 
+static int reg_offset[] =
 {
-  REG_N_OFFSET(r0),  REG_N_OFFSET(r1), REG_N_OFFSET(r2), REG_N_OFFSET(r3),
-  REG_N_OFFSET(r4),  REG_N_OFFSET(r5), REG_N_OFFSET(r6), REG_N_OFFSET(r7),
-  REG_F_OFFSET(l0a), REG_F_OFFSET(l0b),REG_F_OFFSET(l2a),REG_F_OFFSET(l2b),
-  REG_F_OFFSET(l4a), REG_F_OFFSET(l4b),REG_F_OFFSET(l6a),REG_F_OFFSET(l6b),
-  REG_N_OFFSET(sp),  REG_N_OFFSET(fp), REG_N_OFFSET(pc), REG_N_OFFSET(psr),
-  REG_F_OFFSET(fsr),
-  REG_F_OFFSET(l0a), REG_F_OFFSET(l1a),REG_F_OFFSET(l2a),REG_F_OFFSET(l3a),
-  REG_F_OFFSET(l4a), REG_F_OFFSET(l5a),REG_F_OFFSET(l6a),REG_F_OFFSET(l7a),
+  REG_N_OFFSET (r0), REG_N_OFFSET (r1), REG_N_OFFSET (r2), REG_N_OFFSET (r3),
+  REG_N_OFFSET (r4), REG_N_OFFSET (r5), REG_N_OFFSET (r6), REG_N_OFFSET (r7),
+  REG_F_OFFSET (l0a), REG_F_OFFSET (l0b), REG_F_OFFSET (l2a), REG_F_OFFSET (l2b),
+  REG_F_OFFSET (l4a), REG_F_OFFSET (l4b), REG_F_OFFSET (l6a), REG_F_OFFSET (l6b),
+REG_N_OFFSET (sp), REG_N_OFFSET (fp), REG_N_OFFSET (pc), REG_N_OFFSET (psr),
+  REG_F_OFFSET (fsr),
+  REG_F_OFFSET (l0a), REG_F_OFFSET (l1a), REG_F_OFFSET (l2a), REG_F_OFFSET (l3a),
+  REG_F_OFFSET (l4a), REG_F_OFFSET (l5a), REG_F_OFFSET (l6a), REG_F_OFFSET (l7a),
 };
 
 #define REG_ADDRESS(state,regnum) ((char *)(state)+reg_offset[regnum])
@@ -83,8 +84,8 @@ fetch_inferior_registers (regno)
   thread_state_data_t state;
   unsigned int stateCnt = NS532_COMBINED_STATE_COUNT;
   int index;
-  
-  if (! MACH_PORT_VALID (current_thread))
+
+  if (!MACH_PORT_VALID (current_thread))
     error ("fetch inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -103,12 +104,12 @@ fetch_inferior_registers (regno)
    * since we fetched them all anyway
    */
   else if (regno != -1)
-    supply_register (regno, (char *)state+reg_offset[regno]);
+    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]);
+      for (index = 0; index < NUM_REGS; index++)
+       supply_register (index, (char *) state + reg_offset[index]);
     }
 
   if (must_suspend_thread)
@@ -130,7 +131,7 @@ store_inferior_registers (regno)
   unsigned int stateCnt = NS532_COMBINED_STATE_COUNT;
   register int index;
 
-  if (! MACH_PORT_VALID (current_thread))
+  if (!MACH_PORT_VALID (current_thread))
     error ("store inferior registers: Invalid thread");
 
   if (must_suspend_thread)
@@ -142,7 +143,7 @@ store_inferior_registers (regno)
                          state,
                          &stateCnt);
 
-   if (ret != KERN_SUCCESS) 
+  if (ret != KERN_SUCCESS)
     {
       warning ("store_inferior_registers (get): %s",
               mach_error_string (ret));
@@ -152,7 +153,7 @@ store_inferior_registers (regno)
     }
 
   /* 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)
@@ -163,17 +164,17 @@ store_inferior_registers (regno)
   else
 #endif
     {
-      for (index = 0; index < NUM_REGS; index++) 
+      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,
                          NS532_COMBINED_STATE,
                          state,
                          NS532_COMBINED_STATE_COUNT);
-  
+
   if (ret != KERN_SUCCESS)
     warning ("store_inferior_registers (set): %s",
             mach_error_string (ret));
index c9f75cac87f64edd6fffb4c1d1141ea90671f6aa..01c2a5030e77be66142c7f2fd46c799b88757d86 100644 (file)
@@ -1,21 +1,22 @@
 /* Functions specific to running gdb native on an ns32k running NetBSD
    Copyright 1989, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -42,34 +43,34 @@ fetch_inferior_registers (regno)
   struct fpreg inferior_fpregisters;
 
   ptrace (PT_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+         (PTRACE_ARG3_TYPE) & inferior_registers, 0);
   ptrace (PT_GETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
-
-  RF(R0_REGNUM + 0, inferior_registers.r_r0);
-  RF(R0_REGNUM + 1, inferior_registers.r_r1);
-  RF(R0_REGNUM + 2, inferior_registers.r_r2);
-  RF(R0_REGNUM + 3, inferior_registers.r_r3);
-  RF(R0_REGNUM + 4, inferior_registers.r_r4);
-  RF(R0_REGNUM + 5, inferior_registers.r_r5);
-  RF(R0_REGNUM + 6, inferior_registers.r_r6);
-  RF(R0_REGNUM + 7, inferior_registers.r_r7);
-
-  RF(SP_REGNUM   , inferior_registers.r_sp);
-  RF(FP_REGNUM   , inferior_registers.r_fp);
-  RF(PC_REGNUM   , inferior_registers.r_pc);
-  RF(PS_REGNUM   , inferior_registers.r_psr);
-
-  RF(FPS_REGNUM   , inferior_fpregisters.r_fsr);
-  RF(FP0_REGNUM +0, inferior_fpregisters.r_freg[0]);
-  RF(FP0_REGNUM +2, inferior_fpregisters.r_freg[2]);
-  RF(FP0_REGNUM +4, inferior_fpregisters.r_freg[4]);
-  RF(FP0_REGNUM +6, inferior_fpregisters.r_freg[6]);
-  RF(LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]);
-  RF(LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]);
-  RF(LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]);
-  RF(LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]);
-   registers_fetched ();
+         (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0);
+
+  RF (R0_REGNUM + 0, inferior_registers.r_r0);
+  RF (R0_REGNUM + 1, inferior_registers.r_r1);
+  RF (R0_REGNUM + 2, inferior_registers.r_r2);
+  RF (R0_REGNUM + 3, inferior_registers.r_r3);
+  RF (R0_REGNUM + 4, inferior_registers.r_r4);
+  RF (R0_REGNUM + 5, inferior_registers.r_r5);
+  RF (R0_REGNUM + 6, inferior_registers.r_r6);
+  RF (R0_REGNUM + 7, inferior_registers.r_r7);
+
+  RF (SP_REGNUM, inferior_registers.r_sp);
+  RF (FP_REGNUM, inferior_registers.r_fp);
+  RF (PC_REGNUM, inferior_registers.r_pc);
+  RF (PS_REGNUM, inferior_registers.r_psr);
+
+  RF (FPS_REGNUM, inferior_fpregisters.r_fsr);
+  RF (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]);
+  RF (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]);
+  RF (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]);
+  RF (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]);
+  RF (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]);
+  RF (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]);
+  RF (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]);
+  RF (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]);
+  registers_fetched ();
 }
 
 void
@@ -79,39 +80,40 @@ store_inferior_registers (regno)
   struct reg inferior_registers;
   struct fpreg inferior_fpregisters;
 
-  RS(R0_REGNUM + 0, inferior_registers.r_r0);
-  RS(R0_REGNUM + 1, inferior_registers.r_r1);
-  RS(R0_REGNUM + 2, inferior_registers.r_r2);
-  RS(R0_REGNUM + 3, inferior_registers.r_r3);
-  RS(R0_REGNUM + 4, inferior_registers.r_r4);
-  RS(R0_REGNUM + 5, inferior_registers.r_r5);
-  RS(R0_REGNUM + 6, inferior_registers.r_r6);
-  RS(R0_REGNUM + 7, inferior_registers.r_r7);
-
-  RS(SP_REGNUM   , inferior_registers.r_sp);
-  RS(FP_REGNUM   , inferior_registers.r_fp);
-  RS(PC_REGNUM   , inferior_registers.r_pc);
-  RS(PS_REGNUM   , inferior_registers.r_psr);
-
-  RS(FPS_REGNUM   , inferior_fpregisters.r_fsr);
-  RS(FP0_REGNUM +0, inferior_fpregisters.r_freg[0]);
-  RS(FP0_REGNUM +2, inferior_fpregisters.r_freg[2]);
-  RS(FP0_REGNUM +4, inferior_fpregisters.r_freg[4]);
-  RS(FP0_REGNUM +6, inferior_fpregisters.r_freg[6]);
-  RS(LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]);
-  RS(LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]);
-  RS(LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]);
-  RS(LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]);
+  RS (R0_REGNUM + 0, inferior_registers.r_r0);
+  RS (R0_REGNUM + 1, inferior_registers.r_r1);
+  RS (R0_REGNUM + 2, inferior_registers.r_r2);
+  RS (R0_REGNUM + 3, inferior_registers.r_r3);
+  RS (R0_REGNUM + 4, inferior_registers.r_r4);
+  RS (R0_REGNUM + 5, inferior_registers.r_r5);
+  RS (R0_REGNUM + 6, inferior_registers.r_r6);
+  RS (R0_REGNUM + 7, inferior_registers.r_r7);
+
+  RS (SP_REGNUM, inferior_registers.r_sp);
+  RS (FP_REGNUM, inferior_registers.r_fp);
+  RS (PC_REGNUM, inferior_registers.r_pc);
+  RS (PS_REGNUM, inferior_registers.r_psr);
+
+  RS (FPS_REGNUM, inferior_fpregisters.r_fsr);
+  RS (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]);
+  RS (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]);
+  RS (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]);
+  RS (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]);
+  RS (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]);
+  RS (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]);
+  RS (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]);
+  RS (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]);
 
   ptrace (PT_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers, 0);
+         (PTRACE_ARG3_TYPE) & inferior_registers, 0);
   ptrace (PT_SETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
+         (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0);
 }
 \f
 
 /* XXX - Add this to machine/regs.h instead? */
-struct coreregs {
+struct coreregs
+{
   struct reg intreg;
   struct fpreg freg;
 };
@@ -126,7 +128,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 {
   struct coreregs *core_reg;
 
-  core_reg = (struct coreregs *)core_reg_sect;
+  core_reg = (struct coreregs *) core_reg_sect;
 
   /*
    * We have *all* registers
@@ -134,36 +136,37 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
    * Ignore which.
    */
 
-  if (core_reg_size < sizeof(*core_reg)) {
-    fprintf_unfiltered (gdb_stderr, "Couldn't read regs from core file\n");
-    return;
-  }
+  if (core_reg_size < sizeof (*core_reg))
+    {
+      fprintf_unfiltered (gdb_stderr, "Couldn't read regs from core file\n");
+      return;
+    }
 
   /* Integer registers */
-  RF(R0_REGNUM + 0, core_reg->intreg.r_r0);
-  RF(R0_REGNUM + 1, core_reg->intreg.r_r1);
-  RF(R0_REGNUM + 2, core_reg->intreg.r_r2);
-  RF(R0_REGNUM + 3, core_reg->intreg.r_r3);
-  RF(R0_REGNUM + 4, core_reg->intreg.r_r4);
-  RF(R0_REGNUM + 5, core_reg->intreg.r_r5);
-  RF(R0_REGNUM + 6, core_reg->intreg.r_r6);
-  RF(R0_REGNUM + 7, core_reg->intreg.r_r7);
-
-  RF(SP_REGNUM   , core_reg->intreg.r_sp);
-  RF(FP_REGNUM   , core_reg->intreg.r_fp);
-  RF(PC_REGNUM   , core_reg->intreg.r_pc);
-  RF(PS_REGNUM   , core_reg->intreg.r_psr);
+  RF (R0_REGNUM + 0, core_reg->intreg.r_r0);
+  RF (R0_REGNUM + 1, core_reg->intreg.r_r1);
+  RF (R0_REGNUM + 2, core_reg->intreg.r_r2);
+  RF (R0_REGNUM + 3, core_reg->intreg.r_r3);
+  RF (R0_REGNUM + 4, core_reg->intreg.r_r4);
+  RF (R0_REGNUM + 5, core_reg->intreg.r_r5);
+  RF (R0_REGNUM + 6, core_reg->intreg.r_r6);
+  RF (R0_REGNUM + 7, core_reg->intreg.r_r7);
+
+  RF (SP_REGNUM, core_reg->intreg.r_sp);
+  RF (FP_REGNUM, core_reg->intreg.r_fp);
+  RF (PC_REGNUM, core_reg->intreg.r_pc);
+  RF (PS_REGNUM, core_reg->intreg.r_psr);
 
   /* Floating point registers */
-  RF(FPS_REGNUM   , core_reg->freg.r_fsr);
-  RF(FP0_REGNUM +0, core_reg->freg.r_freg[0]);
-  RF(FP0_REGNUM +2, core_reg->freg.r_freg[2]);
-  RF(FP0_REGNUM +4, core_reg->freg.r_freg[4]);
-  RF(FP0_REGNUM +6, core_reg->freg.r_freg[6]);
-  RF(LP0_REGNUM + 1, core_reg->freg.r_freg[1]);
-  RF(LP0_REGNUM + 3, core_reg->freg.r_freg[3]);
-  RF(LP0_REGNUM + 5, core_reg->freg.r_freg[5]);
-  RF(LP0_REGNUM + 7, core_reg->freg.r_freg[7]);
+  RF (FPS_REGNUM, core_reg->freg.r_fsr);
+  RF (FP0_REGNUM + 0, core_reg->freg.r_freg[0]);
+  RF (FP0_REGNUM + 2, core_reg->freg.r_freg[2]);
+  RF (FP0_REGNUM + 4, core_reg->freg.r_freg[4]);
+  RF (FP0_REGNUM + 6, core_reg->freg.r_freg[6]);
+  RF (LP0_REGNUM + 1, core_reg->freg.r_freg[1]);
+  RF (LP0_REGNUM + 3, core_reg->freg.r_freg[3]);
+  RF (LP0_REGNUM + 5, core_reg->freg.r_freg[5]);
+  RF (LP0_REGNUM + 7, core_reg->freg.r_freg[7]);
   registers_fetched ();
 }
 
@@ -203,74 +206,74 @@ fetch_kcore_registers (pcb)
   int dummy;
 
   /* Integer registers */
-  if (target_read_memory((CORE_ADDR)pcb->pcb_ksp, (char *)&sf, sizeof sf))
-     error("Cannot read integer registers.");
+  if (target_read_memory ((CORE_ADDR) pcb->pcb_ksp, (char *) &sf, sizeof sf))
+    error ("Cannot read integer registers.");
 
   /* We use the psr at kernel entry */
-  if (target_read_memory((CORE_ADDR)pcb->pcb_onstack, (char *)&intreg, sizeof intreg))
-     error("Cannot read processor status register.");
+  if (target_read_memory ((CORE_ADDR) pcb->pcb_onstack, (char *) &intreg, sizeof intreg))
+    error ("Cannot read processor status register.");
 
   dummy = 0;
-  RF(R0_REGNUM + 0, dummy);
-  RF(R0_REGNUM + 1, dummy);
-  RF(R0_REGNUM + 2, dummy);
-  RF(R0_REGNUM + 3, sf.sf_r3);
-  RF(R0_REGNUM + 4, sf.sf_r4);
-  RF(R0_REGNUM + 5, sf.sf_r5);
-  RF(R0_REGNUM + 6, sf.sf_r6);
-  RF(R0_REGNUM + 7, sf.sf_r7);
+  RF (R0_REGNUM + 0, dummy);
+  RF (R0_REGNUM + 1, dummy);
+  RF (R0_REGNUM + 2, dummy);
+  RF (R0_REGNUM + 3, sf.sf_r3);
+  RF (R0_REGNUM + 4, sf.sf_r4);
+  RF (R0_REGNUM + 5, sf.sf_r5);
+  RF (R0_REGNUM + 6, sf.sf_r6);
+  RF (R0_REGNUM + 7, sf.sf_r7);
 
   dummy = pcb->pcb_kfp + 8;
-  RF(SP_REGNUM   , dummy);
-  RF(FP_REGNUM   , sf.sf_fp);
-  RF(PC_REGNUM   , sf.sf_pc);
-  RF(PS_REGNUM   , intreg.r_psr);
+  RF (SP_REGNUM, dummy);
+  RF (FP_REGNUM, sf.sf_fp);
+  RF (PC_REGNUM, sf.sf_pc);
+  RF (PS_REGNUM, intreg.r_psr);
 
   /* Floating point registers */
-  RF(FPS_REGNUM   , pcb->pcb_fsr);
-  RF(FP0_REGNUM +0, pcb->pcb_freg[0]);
-  RF(FP0_REGNUM +2, pcb->pcb_freg[2]);
-  RF(FP0_REGNUM +4, pcb->pcb_freg[4]);
-  RF(FP0_REGNUM +6, pcb->pcb_freg[6]);
-  RF(LP0_REGNUM + 1, pcb->pcb_freg[1]);
-  RF(LP0_REGNUM + 3, pcb->pcb_freg[3]);
-  RF(LP0_REGNUM + 5, pcb->pcb_freg[5]);
-  RF(LP0_REGNUM + 7, pcb->pcb_freg[7]);
+  RF (FPS_REGNUM, pcb->pcb_fsr);
+  RF (FP0_REGNUM + 0, pcb->pcb_freg[0]);
+  RF (FP0_REGNUM + 2, pcb->pcb_freg[2]);
+  RF (FP0_REGNUM + 4, pcb->pcb_freg[4]);
+  RF (FP0_REGNUM + 6, pcb->pcb_freg[6]);
+  RF (LP0_REGNUM + 1, pcb->pcb_freg[1]);
+  RF (LP0_REGNUM + 3, pcb->pcb_freg[3]);
+  RF (LP0_REGNUM + 5, pcb->pcb_freg[5]);
+  RF (LP0_REGNUM + 7, pcb->pcb_freg[7]);
   registers_fetched ();
 }
-#endif /* FETCH_KCORE_REGISTERS */
+#endif /* FETCH_KCORE_REGISTERS */
 
 void
-clear_regs()
+clear_regs ()
 {
   double zero = 0.0;
   int null = 0;
-  
+
   /* Integer registers */
-  RF(R0_REGNUM + 0, null);
-  RF(R0_REGNUM + 1, null);
-  RF(R0_REGNUM + 2, null);
-  RF(R0_REGNUM + 3, null);
-  RF(R0_REGNUM + 4, null);
-  RF(R0_REGNUM + 5, null);
-  RF(R0_REGNUM + 6, null);
-  RF(R0_REGNUM + 7, null);
-
-  RF(SP_REGNUM   , null);
-  RF(FP_REGNUM   , null);
-  RF(PC_REGNUM   , null);
-  RF(PS_REGNUM   , null);
+  RF (R0_REGNUM + 0, null);
+  RF (R0_REGNUM + 1, null);
+  RF (R0_REGNUM + 2, null);
+  RF (R0_REGNUM + 3, null);
+  RF (R0_REGNUM + 4, null);
+  RF (R0_REGNUM + 5, null);
+  RF (R0_REGNUM + 6, null);
+  RF (R0_REGNUM + 7, null);
+
+  RF (SP_REGNUM, null);
+  RF (FP_REGNUM, null);
+  RF (PC_REGNUM, null);
+  RF (PS_REGNUM, null);
 
   /* Floating point registers */
-  RF(FPS_REGNUM   , zero);
-  RF(FP0_REGNUM +0, zero);
-  RF(FP0_REGNUM +2, zero);
-  RF(FP0_REGNUM +4, zero);
-  RF(FP0_REGNUM +6, zero);
-  RF(LP0_REGNUM + 0, zero);
-  RF(LP0_REGNUM + 1, zero);
-  RF(LP0_REGNUM + 2, zero);
-  RF(LP0_REGNUM + 3, zero);
+  RF (FPS_REGNUM, zero);
+  RF (FP0_REGNUM + 0, zero);
+  RF (FP0_REGNUM + 2, zero);
+  RF (FP0_REGNUM + 4, zero);
+  RF (FP0_REGNUM + 6, zero);
+  RF (LP0_REGNUM + 0, zero);
+  RF (LP0_REGNUM + 1, zero);
+  RF (LP0_REGNUM + 2, zero);
+  RF (LP0_REGNUM + 3, zero);
   return;
 }
 
@@ -278,76 +281,87 @@ clear_regs()
    Can return -1, meaning no way to tell. */
 
 int
-frame_num_args(fi)
-struct frame_info *fi;
+frame_num_args (fi)
+     struct frame_info *fi;
 {
-       CORE_ADDR       enter_addr;
-       CORE_ADDR       argp;
-       int             inst;
-       int             args;
-       int             i;
-
-       if (read_memory_integer (fi->frame, 4) == 0 && fi->pc < 0x10000) {
-               /* main is always called with three args */
-               return(3);
-       }
-       enter_addr = ns32k_get_enter_addr(fi->pc);
-       if (enter_addr = 0)
-               return(-1);
-       argp = enter_addr == 1 ? SAVED_PC_AFTER_CALL(fi) : FRAME_SAVED_PC(fi);
-       for (i = 0; i < 16; i++) {
-               /*
-                * After a bsr gcc may emit the following instructions
-                * to remove the arguments from the stack:
-                *   cmpqd 0,tos        - to remove 4 bytes from the stack
-                *   cmpd tos,tos       - to remove 8 bytes from the stack
-                *   adjsp[bwd] -n      - to remove n bytes from the stack
-                * Gcc sometimes delays emitting these instructions and
-                * may even throw a branch between our feet.
-                */              
-               inst = read_memory_integer(argp    , 4);
-               args = read_memory_integer(argp + 2, 4);
-               if ((inst & 0xff) == 0xea) {            /* br */
-                       args = ((inst >> 8) & 0xffffff) | (args << 24);
-                       if (args & 0x80) {
-                               if (args & 0x40) {
-                                       args = ntohl(args);
-                               } else {
-                                       args = ntohs(args & 0xffff);
-                                       if (args & 0x2000)
-                                               args |= 0xc000;
-                               }
-                       } else {
-                               args = args & 0xff;
-                               if (args & 0x40)
-                                       args |= 0x80;
-                       }
-                       argp += args;
-                       continue;
+  CORE_ADDR enter_addr;
+  CORE_ADDR argp;
+  int inst;
+  int args;
+  int i;
+
+  if (read_memory_integer (fi->frame, 4) == 0 && fi->pc < 0x10000)
+    {
+      /* main is always called with three args */
+      return (3);
+    }
+  enter_addr = ns32k_get_enter_addr (fi->pc);
+  if (enter_addr = 0)
+    return (-1);
+  argp = enter_addr == 1 ? SAVED_PC_AFTER_CALL (fi) : FRAME_SAVED_PC (fi);
+  for (i = 0; i < 16; i++)
+    {
+      /*
+       * After a bsr gcc may emit the following instructions
+       * to remove the arguments from the stack:
+       *   cmpqd 0,tos        - to remove 4 bytes from the stack
+       *   cmpd tos,tos       - to remove 8 bytes from the stack
+       *   adjsp[bwd] -n      - to remove n bytes from the stack
+       * Gcc sometimes delays emitting these instructions and
+       * may even throw a branch between our feet.
+       */
+      inst = read_memory_integer (argp, 4);
+      args = read_memory_integer (argp + 2, 4);
+      if ((inst & 0xff) == 0xea)
+       {                       /* br */
+         args = ((inst >> 8) & 0xffffff) | (args << 24);
+         if (args & 0x80)
+           {
+             if (args & 0x40)
+               {
+                 args = ntohl (args);
                }
-               if ((inst & 0xffff) == 0xb81f)          /* cmpqd 0,tos */
-                       return(1);
-               else if ((inst & 0xffff) == 0xbdc7)     /* cmpd tos,tos */
-                       return(2);
-               else if ((inst & 0xfffc) == 0xa57c) {   /* adjsp[bwd] */
-                       switch (inst & 3) {
-                       case 0:
-                               args = ((args & 0xff) + 0x80);
-                               break;
-                       case 1:
-                               args = ((ntohs(args) & 0xffff) + 0x8000);
-                               break;
-                       case 3:
-                               args = -ntohl(args);
-                               break;
-                       default:
-                               return(-1);
-                       }
-                       if (args / 4 > 10 || (args & 3) != 0)
-                               continue;
-                       return(args / 4);
+             else
+               {
+                 args = ntohs (args & 0xffff);
+                 if (args & 0x2000)
+                   args |= 0xc000;
                }
-               argp += 1;
+           }
+         else
+           {
+             args = args & 0xff;
+             if (args & 0x40)
+               args |= 0x80;
+           }
+         argp += args;
+         continue;
+       }
+      if ((inst & 0xffff) == 0xb81f)   /* cmpqd 0,tos */
+       return (1);
+      else if ((inst & 0xffff) == 0xbdc7)      /* cmpd tos,tos */
+       return (2);
+      else if ((inst & 0xfffc) == 0xa57c)
+       {                       /* adjsp[bwd] */
+         switch (inst & 3)
+           {
+           case 0:
+             args = ((args & 0xff) + 0x80);
+             break;
+           case 1:
+             args = ((ntohs (args) & 0xffff) + 0x8000);
+             break;
+           case 3:
+             args = -ntohl (args);
+             break;
+           default:
+             return (-1);
+           }
+         if (args / 4 > 10 || (args & 3) != 0)
+           continue;
+         return (args / 4);
        }
-       return(-1);
+      argp += 1;
+    }
+  return (-1);
 }
index 91f4aa472f95b70f8e83e14bca4fb59eafcba957..436dcb8bf3e9ad9444c968e90ed3ca75c9c10409 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This file contains support routines for creating, manipulating, and
    destroying objfile structures. */
@@ -48,9 +49,9 @@ static int
 open_mapped_file PARAMS ((char *filename, long mtime, int mapped));
 
 static PTR
-map_to_file PARAMS ((int));
+  map_to_file PARAMS ((int));
 
-#endif  /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
+#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
 static void
 add_to_objfile_sections PARAMS ((bfd *, sec_ptr, PTR));
@@ -58,12 +59,12 @@ add_to_objfile_sections PARAMS ((bfd *, sec_ptr, PTR));
 /* Externally visible variables that are owned by this module.
    See declarations in objfile.h for more info. */
 
-struct objfile *object_files;          /* Linked list of all objfiles */
+struct objfile *object_files;  /* Linked list of all objfiles */
 struct objfile *current_objfile;       /* For symbol file being read in */
 struct objfile *symfile_objfile;       /* Main symbol table loaded from */
 struct objfile *rt_common_objfile;     /* For runtime common symbols */
 
-int mapped_symbol_files;               /* Try to use mapped symbol files */
+int mapped_symbol_files;       /* Try to use mapped symbol files */
 
 /* Locate all mappable sections of a BFD file. 
    objfile_p_char is a char * to get it through
@@ -85,7 +86,7 @@ add_to_objfile_sections (abfd, asect, objfile_p_char)
 
   aflag = bfd_get_section_flags (abfd, asect);
 
-  if (!(aflag & SEC_ALLOC) && !(TARGET_KEEP_SECTION(asect)))
+  if (!(aflag & SEC_ALLOC) && !(TARGET_KEEP_SECTION (asect)))
     return;
 
   if (0 == bfd_section_size (abfd, asect))
@@ -96,7 +97,7 @@ add_to_objfile_sections (abfd, asect, objfile_p_char)
   section.ovly_mapped = 0;
   section.addr = bfd_section_vma (abfd, asect);
   section.endaddr = section.addr + bfd_section_size (abfd, asect);
-  obstack_grow (&objfile->psymbol_obstack, (char *) &section, sizeof(section));
+  obstack_grow (&objfile->psymbol_obstack, (char *) &section, sizeof (section));
   objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1);
 }
 
@@ -115,11 +116,11 @@ build_objfile_section_table (objfile)
      waste some memory.  */
 
   objfile->sections_end = 0;
-  bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *)objfile);
+  bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *) objfile);
   objfile->sections = (struct obj_section *)
     obstack_finish (&objfile->psymbol_obstack);
   objfile->sections_end = objfile->sections + (unsigned long) objfile->sections_end;
-  return(0);
+  return (0);
 }
 
 /* Given a pointer to an initialized bfd (ABFD) and a flag that indicates
@@ -138,8 +139,8 @@ struct objfile *
 allocate_objfile (abfd, mapped, user_loaded, is_solib)
      bfd *abfd;
      int mapped;
-     int  user_loaded;
-     int  is_solib;
+     int user_loaded;
+     int is_solib;
 {
   struct objfile *objfile = NULL;
   struct objfile *last_one = NULL;
@@ -148,101 +149,101 @@ allocate_objfile (abfd, mapped, user_loaded, is_solib)
 
 #if defined(USE_MMALLOC) && defined(HAVE_MMAP)
   if (abfd != NULL)
-  {
+    {
 
-    /* If we can support mapped symbol files, try to open/reopen the
-       mapped file that corresponds to the file from which we wish to
-       read symbols.  If the objfile is to be mapped, we must malloc
-       the structure itself using the mmap version, and arrange that
-       all memory allocation for the objfile uses the mmap routines.
-       If we are reusing an existing mapped file, from which we get
-       our objfile pointer, we have to make sure that we update the
-       pointers to the alloc/free functions in the obstack, in case
-       these functions have moved within the current gdb.  */
-
-    int fd;
-
-    fd = open_mapped_file (bfd_get_filename (abfd), bfd_get_mtime (abfd),
-                          mapped);
-    if (fd >= 0)
-      {
-       PTR md;
+      /* If we can support mapped symbol files, try to open/reopen the
+         mapped file that corresponds to the file from which we wish to
+         read symbols.  If the objfile is to be mapped, we must malloc
+         the structure itself using the mmap version, and arrange that
+         all memory allocation for the objfile uses the mmap routines.
+         If we are reusing an existing mapped file, from which we get
+         our objfile pointer, we have to make sure that we update the
+         pointers to the alloc/free functions in the obstack, in case
+         these functions have moved within the current gdb.  */
+
+      int fd;
+
+      fd = open_mapped_file (bfd_get_filename (abfd), bfd_get_mtime (abfd),
+                            mapped);
+      if (fd >= 0)
+       {
+         PTR md;
 
-       if ((md = map_to_file (fd)) == NULL)
-         {
-           close (fd);
-         }
-       else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL)
-         {
-           /* Update memory corruption handler function addresses. */
-           init_malloc (md);
-           objfile -> md = md;
-           objfile -> mmfd = fd;
-           /* Update pointers to functions to *our* copies */
-           obstack_chunkfun (&objfile -> psymbol_cache.cache, xmmalloc);
-           obstack_freefun (&objfile -> psymbol_cache.cache, mfree);
-           obstack_chunkfun (&objfile -> psymbol_obstack, xmmalloc);
-           obstack_freefun (&objfile -> psymbol_obstack, mfree);
-           obstack_chunkfun (&objfile -> symbol_obstack, xmmalloc);
-           obstack_freefun (&objfile -> symbol_obstack, mfree);
-           obstack_chunkfun (&objfile -> type_obstack, xmmalloc);
-           obstack_freefun (&objfile -> type_obstack, mfree);
-           /* If already in objfile list, unlink it. */
-           unlink_objfile (objfile);
-           /* Forget things specific to a particular gdb, may have changed. */
-           objfile -> sf = NULL;
-         }
-       else
-         {
+         if ((md = map_to_file (fd)) == NULL)
+           {
+             close (fd);
+           }
+         else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL)
+           {
+             /* Update memory corruption handler function addresses. */
+             init_malloc (md);
+             objfile->md = md;
+             objfile->mmfd = fd;
+             /* Update pointers to functions to *our* copies */
+             obstack_chunkfun (&objfile->psymbol_cache.cache, xmmalloc);
+             obstack_freefun (&objfile->psymbol_cache.cache, mfree);
+             obstack_chunkfun (&objfile->psymbol_obstack, xmmalloc);
+             obstack_freefun (&objfile->psymbol_obstack, mfree);
+             obstack_chunkfun (&objfile->symbol_obstack, xmmalloc);
+             obstack_freefun (&objfile->symbol_obstack, mfree);
+             obstack_chunkfun (&objfile->type_obstack, xmmalloc);
+             obstack_freefun (&objfile->type_obstack, mfree);
+             /* If already in objfile list, unlink it. */
+             unlink_objfile (objfile);
+             /* Forget things specific to a particular gdb, may have changed. */
+             objfile->sf = NULL;
+           }
+         else
+           {
 
-           /* Set up to detect internal memory corruption.  MUST be
-              done before the first malloc.  See comments in
-              init_malloc() and mmcheck().  */
-
-           init_malloc (md);
-
-           objfile = (struct objfile *)
-             xmmalloc (md, sizeof (struct objfile));
-           memset (objfile, 0, sizeof (struct objfile));
-           objfile -> md = md;
-           objfile -> mmfd = fd;
-           objfile -> flags |= OBJF_MAPPED;
-           mmalloc_setkey (objfile -> md, 0, objfile);
-           obstack_specify_allocation_with_arg (&objfile -> psymbol_cache.cache,
-                                                0, 0, xmmalloc, mfree,
-                                                objfile -> md);
-           obstack_specify_allocation_with_arg (&objfile -> psymbol_obstack,
-                                                0, 0, xmmalloc, mfree,
-                                                objfile -> md);
-           obstack_specify_allocation_with_arg (&objfile -> symbol_obstack,
-                                                0, 0, xmmalloc, mfree,
-                                                objfile -> md);
-           obstack_specify_allocation_with_arg (&objfile -> type_obstack,
-                                                0, 0, xmmalloc, mfree,
-                                                objfile -> md);
-         }
-      }
+             /* Set up to detect internal memory corruption.  MUST be
+                done before the first malloc.  See comments in
+                init_malloc() and mmcheck().  */
+
+             init_malloc (md);
+
+             objfile = (struct objfile *)
+               xmmalloc (md, sizeof (struct objfile));
+             memset (objfile, 0, sizeof (struct objfile));
+             objfile->md = md;
+             objfile->mmfd = fd;
+             objfile->flags |= OBJF_MAPPED;
+             mmalloc_setkey (objfile->md, 0, objfile);
+             obstack_specify_allocation_with_arg (&objfile->psymbol_cache.cache,
+                                                  0, 0, xmmalloc, mfree,
+                                                  objfile->md);
+             obstack_specify_allocation_with_arg (&objfile->psymbol_obstack,
+                                                  0, 0, xmmalloc, mfree,
+                                                  objfile->md);
+             obstack_specify_allocation_with_arg (&objfile->symbol_obstack,
+                                                  0, 0, xmmalloc, mfree,
+                                                  objfile->md);
+             obstack_specify_allocation_with_arg (&objfile->type_obstack,
+                                                  0, 0, xmmalloc, mfree,
+                                                  objfile->md);
+           }
+       }
 
-    if (mapped && (objfile == NULL))
-      {
-       warning ("symbol table for '%s' will not be mapped",
-                bfd_get_filename (abfd));
-      }
-  }
-#else  /* !defined(USE_MMALLOC) || !defined(HAVE_MMAP) */
+      if (mapped && (objfile == NULL))
+       {
+         warning ("symbol table for '%s' will not be mapped",
+                  bfd_get_filename (abfd));
+       }
+    }
+#else /* !defined(USE_MMALLOC) || !defined(HAVE_MMAP) */
 
   if (mapped)
     {
       warning ("mapped symbol tables are not supported on this machine; missing or broken mmap().");
 
       /* Turn off the global flag so we don't try to do mapped symbol tables
-        any more, which shuts up gdb unless the user specifically gives the
-        "mapped" keyword again. */
+         any more, which shuts up gdb unless the user specifically gives the
+         "mapped" keyword again. */
 
       mapped_symbol_files = 0;
     }
 
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
+#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
   /* If we don't support mapped symbol files, didn't ask for the file to be
      mapped, or failed to open the mapped file for some reason, then revert
@@ -252,14 +253,14 @@ allocate_objfile (abfd, mapped, user_loaded, is_solib)
     {
       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,
+      objfile->md = NULL;
+      obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
                                  xmalloc, free);
-      obstack_specify_allocation (&objfile -> psymbol_obstack, 0, 0, xmalloc,
+      obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
                                  free);
-      obstack_specify_allocation (&objfile -> symbol_obstack, 0, 0, xmalloc,
+      obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
                                  free);
-      obstack_specify_allocation (&objfile -> type_obstack, 0, 0, xmalloc,
+      obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
                                  free);
     }
 
@@ -267,45 +268,45 @@ allocate_objfile (abfd, mapped, user_loaded, is_solib)
      that any data that is reference is saved in the per-objfile data
      region. */
 
-  objfile -> obfd = abfd;
-  if (objfile -> name != NULL)
+  objfile->obfd = abfd;
+  if (objfile->name != NULL)
     {
-      mfree (objfile -> md, objfile -> name);
+      mfree (objfile->md, objfile->name);
     }
   if (abfd != NULL)
     {
-      objfile -> name = mstrsave (objfile -> md, bfd_get_filename (abfd));
-      objfile -> mtime = bfd_get_mtime (abfd);
+      objfile->name = mstrsave (objfile->md, bfd_get_filename (abfd));
+      objfile->mtime = bfd_get_mtime (abfd);
 
       /* Build section table.  */
 
       if (build_objfile_section_table (objfile))
        {
-         error ("Can't find the file sections in `%s': %s", 
-                objfile -> name, bfd_errmsg (bfd_get_error ()));
+         error ("Can't find the file sections in `%s': %s",
+                objfile->name, bfd_errmsg (bfd_get_error ()));
        }
     }
 
   /* Add this file onto the tail of the linked list of other such files. */
 
-  objfile -> next = NULL;
+  objfile->next = NULL;
   if (object_files == NULL)
     object_files = objfile;
   else
     {
       for (last_one = object_files;
-          last_one -> next;
-          last_one = last_one -> next);
-      last_one -> next = objfile;
+          last_one->next;
+          last_one = last_one->next);
+      last_one->next = objfile;
     }
 
   /* Record whether this objfile was created because the user explicitly
      caused it (e.g., used the add-symbol-file command).
-     */
-  objfile -> user_loaded = user_loaded;
+   */
+  objfile->user_loaded = user_loaded;
 
   /* Record whether this objfile definitely represents a solib. */
-  objfile -> is_solib = is_solib;
+  objfile->is_solib = is_solib;
 
   return (objfile);
 }
@@ -348,14 +349,14 @@ void
 unlink_objfile (objfile)
      struct objfile *objfile;
 {
-  struct objfile** objpp;
+  struct objfile **objpp;
 
-  for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp) -> next))
+  for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next))
     {
-      if (*objpp == objfile) 
+      if (*objpp == objfile)
        {
-         *objpp = (*objpp) -> next;
-         objfile -> next = NULL;
+         *objpp = (*objpp)->next;
+         objfile->next = NULL;
          break;
        }
     }
@@ -369,7 +370,7 @@ unlink_objfile (objfile)
    Things which we do NOT free because they are not in malloc'd memory
    or not in memory specific to the objfile include:
 
-       objfile -> sf
+   objfile -> sf
 
    FIXME:  If the objfile is using reusable symbol information (via mmalloc),
    then we need to take into account the fact that more than one process
@@ -389,17 +390,17 @@ free_objfile (objfile)
      freeing things which are valid only during this particular gdb
      execution, or leaving them to be reused during the next one. */
 
-  if (objfile -> sf != NULL)
+  if (objfile->sf != NULL)
     {
-      (*objfile -> sf -> sym_finish) (objfile);
+      (*objfile->sf->sym_finish) (objfile);
     }
 
   /* We always close the bfd. */
 
-  if (objfile -> obfd != NULL)
+  if (objfile->obfd != NULL)
     {
       char *name = bfd_get_filename (objfile->obfd);
-      if (!bfd_close (objfile -> obfd))
+      if (!bfd_close (objfile->obfd))
        warning ("cannot close \"%s\": %s",
                 name, bfd_errmsg (bfd_get_error ()));
       free (name);
@@ -421,7 +422,7 @@ free_objfile (objfile)
      symbol table was blown away.  How much still needs to be done
      is unknown, but we play it safe for now and keep each action until
      it is shown to be no longer needed. */
-     
+
 #if defined (CLEAR_SOLIB)
   CLEAR_SOLIB ();
   /* CLEAR_SOLIB closes the bfd's for any shared libraries.  But
@@ -444,39 +445,39 @@ free_objfile (objfile)
 
 #if defined(USE_MMALLOC) && defined(HAVE_MMAP)
 
-  if (objfile -> flags & OBJF_MAPPED)
+  if (objfile->flags & OBJF_MAPPED)
     {
       /* Remember the fd so we can close it.  We can't close it before
-        doing the detach, and after the detach the objfile is gone. */
+         doing the detach, and after the detach the objfile is gone. */
       int mmfd;
 
-      mmfd = objfile -> mmfd;
-      mmalloc_detach (objfile -> md);
+      mmfd = objfile->mmfd;
+      mmalloc_detach (objfile->md);
       objfile = NULL;
       close (mmfd);
     }
 
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
+#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
   /* If we still have an objfile, then either we don't support reusable
      objfiles or this one was not reusable.  So free it normally. */
 
   if (objfile != NULL)
     {
-      if (objfile -> name != NULL)
+      if (objfile->name != NULL)
        {
-         mfree (objfile -> md, objfile -> name);
+         mfree (objfile->md, objfile->name);
        }
       if (objfile->global_psymbols.list)
        mfree (objfile->md, objfile->global_psymbols.list);
       if (objfile->static_psymbols.list)
        mfree (objfile->md, objfile->static_psymbols.list);
       /* Free the obstacks for non-reusable objfiles */
-      obstack_free (&objfile -> psymbol_cache.cache, 0);
-      obstack_free (&objfile -> psymbol_obstack, 0);
-      obstack_free (&objfile -> symbol_obstack, 0);
-      obstack_free (&objfile -> type_obstack, 0);
-      mfree (objfile -> md, objfile);
+      obstack_free (&objfile->psymbol_cache.cache, 0);
+      obstack_free (&objfile->psymbol_obstack, 0);
+      obstack_free (&objfile->symbol_obstack, 0);
+      obstack_free (&objfile->type_obstack, 0);
+      mfree (objfile->md, objfile);
       objfile = NULL;
     }
 }
@@ -490,9 +491,9 @@ free_all_objfiles ()
   struct objfile *objfile, *temp;
 
   ALL_OBJFILES_SAFE (objfile, temp)
-    {
-      free_objfile (objfile);
-    }
+  {
+    free_objfile (objfile);
+  }
   clear_symtab_users ();
 }
 \f
@@ -503,9 +504,9 @@ objfile_relocate (objfile, new_offsets)
      struct objfile *objfile;
      struct section_offsets *new_offsets;
 {
-  struct section_offsets *delta = (struct section_offsets *) 
-    alloca (sizeof (struct section_offsets)
-           + objfile->num_sections * sizeof (delta->offsets));
+  struct section_offsets *delta = (struct section_offsets *)
+  alloca (sizeof (struct section_offsets)
+         + objfile->num_sections * sizeof (delta->offsets));
 
   {
     int i;
@@ -526,71 +527,70 @@ objfile_relocate (objfile, new_offsets)
     struct symtab *s;
 
     ALL_OBJFILE_SYMTABS (objfile, s)
-      {
-       struct linetable *l;
-       struct blockvector *bv;
-       int i;
-       
-       /* First the line table.  */
-       l = LINETABLE (s);
-       if (l)
-         {
-           for (i = 0; i < l->nitems; ++i)
-             l->item[i].pc += ANOFFSET (delta, s->block_line_section);
-         }
+    {
+      struct linetable *l;
+      struct blockvector *bv;
+      int i;
+
+      /* First the line table.  */
+      l = LINETABLE (s);
+      if (l)
+       {
+         for (i = 0; i < l->nitems; ++i)
+           l->item[i].pc += ANOFFSET (delta, s->block_line_section);
+       }
 
-       /* Don't relocate a shared blockvector more than once.  */
-       if (!s->primary)
-         continue;
+      /* Don't relocate a shared blockvector more than once.  */
+      if (!s->primary)
+       continue;
 
-       bv = BLOCKVECTOR (s);
-       for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
-         {
-           struct block *b;
-           int j;
-           
-           b = BLOCKVECTOR_BLOCK (bv, i);
-           BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
-           BLOCK_END (b)   += ANOFFSET (delta, s->block_line_section);
-
-           for (j = 0; j < BLOCK_NSYMS (b); ++j)
-             {
-               struct symbol *sym = BLOCK_SYM (b, j);
-               /* The RS6000 code from which this was taken skipped
-                  any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
-                  But I'm leaving out that test, on the theory that
-                  they can't possibly pass the tests below.  */
-               if ((SYMBOL_CLASS (sym) == LOC_LABEL
-                    || SYMBOL_CLASS (sym) == LOC_STATIC 
-                     || SYMBOL_CLASS (sym) == LOC_INDIRECT)
-                   && SYMBOL_SECTION (sym) >= 0)
-                 {
-                   SYMBOL_VALUE_ADDRESS (sym) += 
-                     ANOFFSET (delta, SYMBOL_SECTION (sym));
-                 }
+      bv = BLOCKVECTOR (s);
+      for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
+       {
+         struct block *b;
+         int j;
+
+         b = BLOCKVECTOR_BLOCK (bv, i);
+         BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
+         BLOCK_END (b) += ANOFFSET (delta, s->block_line_section);
+
+         for (j = 0; j < BLOCK_NSYMS (b); ++j)
+           {
+             struct symbol *sym = BLOCK_SYM (b, j);
+             /* The RS6000 code from which this was taken skipped
+                any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
+                But I'm leaving out that test, on the theory that
+                they can't possibly pass the tests below.  */
+             if ((SYMBOL_CLASS (sym) == LOC_LABEL
+                  || SYMBOL_CLASS (sym) == LOC_STATIC
+                  || SYMBOL_CLASS (sym) == LOC_INDIRECT)
+                 && SYMBOL_SECTION (sym) >= 0)
+               {
+                 SYMBOL_VALUE_ADDRESS (sym) +=
+                   ANOFFSET (delta, SYMBOL_SECTION (sym));
+               }
 #ifdef MIPS_EFI_SYMBOL_NAME
-               /* Relocate Extra Function Info for ecoff.  */
+             /* Relocate Extra Function Info for ecoff.  */
 
-               else
-                 if (SYMBOL_CLASS (sym) == LOC_CONST
-                     && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE
-                     && STRCMP (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0)
-               ecoff_relocate_efi (sym, ANOFFSET (delta, 
+             else if (SYMBOL_CLASS (sym) == LOC_CONST
+                      && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE
+                  && STRCMP (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0)
+               ecoff_relocate_efi (sym, ANOFFSET (delta,
                                                   s->block_line_section));
 #endif
-             }
-         }
-      }
+           }
+       }
+    }
   }
 
   {
     struct partial_symtab *p;
 
     ALL_OBJFILE_PSYMTABS (objfile, p)
-      {
-       p->textlow += ANOFFSET (delta, SECT_OFF_TEXT);
-       p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT);
-      }
+    {
+      p->textlow += ANOFFSET (delta, SECT_OFF_TEXT);
+      p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT);
+    }
   }
 
   {
@@ -600,13 +600,13 @@ objfile_relocate (objfile, new_offsets)
         psym < objfile->global_psymbols.next;
         psym++)
       if (SYMBOL_SECTION (*psym) >= 0)
-       SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta, 
+       SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
                                                  SYMBOL_SECTION (*psym));
     for (psym = objfile->static_psymbols.list;
         psym < objfile->static_psymbols.next;
         psym++)
       if (SYMBOL_SECTION (*psym) >= 0)
-       SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta, 
+       SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
                                                  SYMBOL_SECTION (*psym));
   }
 
@@ -614,7 +614,7 @@ objfile_relocate (objfile, new_offsets)
     struct minimal_symbol *msym;
     ALL_OBJFILE_MSYMBOLS (objfile, msym)
       if (SYMBOL_SECTION (msym) >= 0)
-       SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
+      SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
   }
   /* Relocating different sections by different amounts may cause the symbols
      to be out of order.  */
@@ -641,40 +641,40 @@ objfile_relocate (objfile, new_offsets)
 
        if (flags & SEC_CODE)
          {
-           s->addr    += ANOFFSET (delta, SECT_OFF_TEXT);
+           s->addr += ANOFFSET (delta, SECT_OFF_TEXT);
            s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT);
          }
        else if (flags & (SEC_DATA | SEC_LOAD))
          {
-           s->addr    += ANOFFSET (delta, SECT_OFF_DATA);
+           s->addr += ANOFFSET (delta, SECT_OFF_DATA);
            s->endaddr += ANOFFSET (delta, SECT_OFF_DATA);
          }
        else if (flags & SEC_ALLOC)
          {
-           s->addr    += ANOFFSET (delta, SECT_OFF_BSS);
+           s->addr += ANOFFSET (delta, SECT_OFF_BSS);
            s->endaddr += ANOFFSET (delta, SECT_OFF_BSS);
          }
       }
   }
 
-  if (objfile->ei.entry_point != ~(CORE_ADDR)0)
+  if (objfile->ei.entry_point != ~(CORE_ADDR) 0)
     objfile->ei.entry_point += ANOFFSET (delta, SECT_OFF_TEXT);
 
   if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC)
     {
-      objfile->ei.entry_func_lowpc  += ANOFFSET (delta, SECT_OFF_TEXT);
+      objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
       objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
     }
 
   if (objfile->ei.entry_file_lowpc != INVALID_ENTRY_LOWPC)
     {
-      objfile->ei.entry_file_lowpc  += ANOFFSET (delta, SECT_OFF_TEXT);
+      objfile->ei.entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
       objfile->ei.entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
     }
 
   if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
     {
-      objfile->ei.main_func_lowpc  += ANOFFSET (delta, SECT_OFF_TEXT);
+      objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT);
       objfile->ei.main_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT);
     }
 
@@ -692,12 +692,12 @@ have_partial_symbols ()
   struct objfile *ofp;
 
   ALL_OBJFILES (ofp)
-    {
-      if (ofp -> psymtabs != NULL)
-       {
-         return 1;
-       }
-    }
+  {
+    if (ofp->psymtabs != NULL)
+      {
+       return 1;
+      }
+  }
   return 0;
 }
 
@@ -711,12 +711,12 @@ have_full_symbols ()
   struct objfile *ofp;
 
   ALL_OBJFILES (ofp)
-    {
-      if (ofp -> symtabs != NULL)
-       {
-         return 1;
-       }
-    }
+  {
+    if (ofp->symtabs != NULL)
+      {
+       return 1;
+      }
+  }
   return 0;
 }
 
@@ -724,19 +724,19 @@ have_full_symbols ()
 /* This operations deletes all objfile entries that represent solibs that
    weren't explicitly loaded by the user, via e.g., the add-symbol-file
    command.
  */
+ */
 void
 objfile_purge_solibs ()
 {
-  struct objfile *  objf;
-  struct objfile *  temp;
+  struct objfile *objf;
+  struct objfile *temp;
 
   ALL_OBJFILES_SAFE (objf, temp)
   {
     /* We assume that the solib package has been purged already, or will
        be soon.
-       */
-    if (! objf->user_loaded && objf->is_solib)
+     */
+    if (!objf->user_loaded && objf->is_solib)
       free_objfile (objf);
   }
 }
@@ -752,12 +752,12 @@ have_minimal_symbols ()
   struct objfile *ofp;
 
   ALL_OBJFILES (ofp)
-    {
-      if (ofp -> msymbols != NULL)
-       {
-         return 1;
-       }
-    }
+  {
+    if (ofp->msymbols != NULL)
+      {
+       return 1;
+      }
+  }
   return 0;
 }
 
@@ -914,8 +914,8 @@ map_to_file (fd)
          if (mapto != 0)
            {
              /* To avoid reusing the freshly created mapping file, at the 
-                address selected by mmap, we must truncate it before trying
-                to do an attach at the address we want. */
+                address selected by mmap, we must truncate it before trying
+                to do an attach at the address we want. */
              ftruncate (fd, 0);
              md = mmalloc_attach (fd, (PTR) mapto);
              if (md != NULL)
@@ -928,7 +928,7 @@ map_to_file (fd)
   return (md);
 }
 
-#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
+#endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
 /* Returns a section whose range includes PC and SECTION, 
    or NULL if none found.  Note the distinction between the return type, 
@@ -943,48 +943,48 @@ find_pc_sect_section (pc, section)
 {
   struct obj_section *s;
   struct objfile *objfile;
-  
+
   ALL_OBJFILES (objfile)
     for (s = objfile->sections; s < objfile->sections_end; ++s)
 #if defined(HPUXHPPA)
-      if ((section == 0 || section == s->the_bfd_section) && 
-         s->addr <= pc && pc <= s->endaddr)
+    if ((section == 0 || section == s->the_bfd_section) &&
+       s->addr <= pc && pc <= s->endaddr)
 #else
-      if ((section == 0 || section == s->the_bfd_section) && 
-         s->addr <= pc && pc < s->endaddr)
+    if ((section == 0 || section == s->the_bfd_section) &&
+       s->addr <= pc && pc < s->endaddr)
 #endif
-       return(s);
+      return (s);
 
-  return(NULL);
+  return (NULL);
 }
 
 /* Returns a section whose range includes PC or NULL if none found. 
    Backward compatibility, no section.  */
 
 struct obj_section *
-find_pc_section(pc)
+find_pc_section (pc)
      CORE_ADDR pc;
 {
   return find_pc_sect_section (pc, find_pc_mapped_section (pc));
 }
-  
+
 
 /* In SVR4, we recognize a trampoline by it's section name. 
    That is, if the pc is in a section named ".plt" then we are in
    a trampoline.  */
 
 int
-in_plt_section(pc, name)
+in_plt_section (pc, name)
      CORE_ADDR pc;
      char *name;
 {
   struct obj_section *s;
   int retval = 0;
-  
-  s = find_pc_section(pc);
-  
+
+  s = find_pc_section (pc);
+
   retval = (s != NULL
            && s->the_bfd_section->name != NULL
            && STREQ (s->the_bfd_section->name, ".plt"));
-  return(retval);
+  return (retval);
 }
index 31bd124d0a67d536a6bcb434b5fbf5908c8b3c7c..96890be646dad4186192794361c677f5c5e4b9b9 100644 (file)
@@ -1,21 +1,22 @@
 /* Definitions for symbol file management in GDB.
    Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (OBJFILES_H)
 #define OBJFILES_H
@@ -76,41 +77,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
    To use this method, define your FRAME_CHAIN_VALID macro like:
 
-       #define FRAME_CHAIN_VALID(chain, thisframe)     \
-         (chain != 0                                   \
-          && !(inside_main_func ((thisframe)->pc))     \
-          && !(inside_entry_func ((thisframe)->pc)))
+   #define FRAME_CHAIN_VALID(chain, thisframe)     \
+   (chain != 0                                   \
+   && !(inside_main_func ((thisframe)->pc))     \
+   && !(inside_entry_func ((thisframe)->pc)))
 
    and add initializations of the four scope controlling variables inside
    the object file / debugging information processing modules.  */
 
 struct entry_info
-{
-  
-  /* The value we should use for this objects entry point.
-     The illegal/unknown value needs to be something other than 0, ~0
-     for instance, which is much less likely than 0. */
+  {
 
-  CORE_ADDR entry_point;
+    /* The value we should use for this objects entry point.
+       The illegal/unknown value needs to be something other than 0, ~0
+       for instance, which is much less likely than 0. */
 
-#define INVALID_ENTRY_POINT (~0) /* ~0 will not be in any file, we hope.  */
+    CORE_ADDR entry_point;
 
-  /* Start (inclusive) and end (exclusive) of function containing the
-     entry point. */
+#define INVALID_ENTRY_POINT (~0)       /* ~0 will not be in any file, we hope.  */
 
-  CORE_ADDR entry_func_lowpc;
-  CORE_ADDR entry_func_highpc;
+    /* Start (inclusive) and end (exclusive) of function containing the
+       entry point. */
 
-  /* Start (inclusive) and end (exclusive) of object file containing the
-     entry point. */
-  
-  CORE_ADDR entry_file_lowpc;
-  CORE_ADDR entry_file_highpc;
+    CORE_ADDR entry_func_lowpc;
+    CORE_ADDR entry_func_highpc;
 
-  /* Start (inclusive) and end (exclusive) of the user code main() function. */
+    /* Start (inclusive) and end (exclusive) of object file containing the
+       entry point. */
 
-  CORE_ADDR main_func_lowpc;
-  CORE_ADDR main_func_highpc;
+    CORE_ADDR entry_file_lowpc;
+    CORE_ADDR entry_file_highpc;
+
+    /* Start (inclusive) and end (exclusive) of the user code main() function. */
+
+    CORE_ADDR main_func_lowpc;
+    CORE_ADDR main_func_highpc;
 
 /* Use these values when any of the above ranges is invalid.  */
 
@@ -121,7 +122,7 @@ struct entry_info
 #define INVALID_ENTRY_LOWPC (3)
 #define INVALID_ENTRY_HIGHPC (1)
 
-};
+  };
 
 /* Sections in an objfile.
 
@@ -136,44 +137,47 @@ struct entry_info
 
    I'm not sure this could or should be changed, however.  */
 
-struct obj_section {
-  CORE_ADDR    addr;    /* lowest address in section */
-  CORE_ADDR    endaddr; /* 1+highest address in section */
+struct obj_section
+  {
+    CORE_ADDR addr;            /* lowest address in section */
+    CORE_ADDR endaddr;         /* 1+highest address in section */
 
-  /* This field is being used for nefarious purposes by syms_from_objfile.
-     It is said to be redundant with section_offsets; it's not really being
-     used that way, however, it's some sort of hack I don't understand
-     and am not going to try to eliminate (yet, anyway).  FIXME.
+    /* This field is being used for nefarious purposes by syms_from_objfile.
+       It is said to be redundant with section_offsets; it's not really being
+       used that way, however, it's some sort of hack I don't understand
+       and am not going to try to eliminate (yet, anyway).  FIXME.
 
-     It was documented as "offset between (end)addr and actual memory
-     addresses", but that's not true; addr & endaddr are actual memory
-     addresses.  */
-  CORE_ADDR offset;
+       It was documented as "offset between (end)addr and actual memory
+       addresses", but that's not true; addr & endaddr are actual memory
+       addresses.  */
+    CORE_ADDR offset;
 
-  sec_ptr the_bfd_section; /* BFD section pointer */
+    sec_ptr the_bfd_section;   /* BFD section pointer */
 
-  /* Objfile this section is part of.  */
-  struct objfile *objfile;
+    /* Objfile this section is part of.  */
+    struct objfile *objfile;
 
-  /* True if this "overlay section" is mapped into an "overlay region". */
-  int ovly_mapped;
-};
+    /* True if this "overlay section" is mapped into an "overlay region". */
+    int ovly_mapped;
+  };
 
 /* An import entry contains information about a symbol that
    is used in this objfile but not defined in it, and so needs
    to be imported from some other objfile */
-/* Currently we just store the name; no attributes. 1997-08-05 */ 
-typedef char * ImportEntry;
+/* Currently we just store the name; no attributes. 1997-08-05 */
+typedef char *ImportEntry;
 
 
 /* An export entry contains information about a symbol that
    is defined in this objfile and available for use in other
-   objfiles */ 
-typedef struct {
-  char * name; /* name of exported symbol */ 
-  int address; /* offset subject to relocation */ 
-  /* Currently no other attributes 1997-08-05 */ 
-} ExportEntry;
+   objfiles */
+typedef struct
+  {
+    char *name;                        /* name of exported symbol */
+    int address;               /* offset subject to relocation */
+    /* Currently no other attributes 1997-08-05 */
+  }
+ExportEntry;
 
 
 /* The "objstats" structure provides a place for gdb to record some
@@ -181,14 +185,15 @@ typedef struct {
    per objfile basis, such as information about the number of symbols
    read, size of string table (if any), etc. */
 
-struct objstats {
-  int n_minsyms;       /* Number of minimal symbols read */
-  int n_psyms;         /* Number of partial symbols read */
-  int n_syms;          /* Number of full symbols read */
-  int n_stabs;         /* Number of ".stabs" read (if applicable) */
-  int n_types;         /* Number of types */
-  int sz_strtab;       /* Size of stringtable, (if applicable) */
-};
+struct objstats
+  {
+    int n_minsyms;             /* Number of minimal symbols read */
+    int n_psyms;               /* Number of partial symbols read */
+    int n_syms;                        /* Number of full symbols read */
+    int n_stabs;               /* Number of ".stabs" read (if applicable) */
+    int n_types;               /* Number of types */
+    int sz_strtab;             /* Size of stringtable, (if applicable) */
+  };
 
 #define OBJSTAT(objfile, expr) (objfile -> stats.expr)
 #define OBJSTATS struct objstats stats
@@ -204,195 +209,194 @@ extern void print_symbol_bcache_statistics PARAMS ((void));
    (see remote-vx.c).  */
 
 struct objfile
-{
+  {
 
-  /* All struct objfile's are chained together by their next pointers.
-     The global variable "object_files" points to the first link in this
-     chain.
+    /* All struct objfile's are chained together by their next pointers.
+       The global variable "object_files" points to the first link in this
+       chain.
 
-     FIXME:  There is a problem here if the objfile is reusable, and if
-     multiple users are to be supported.  The problem is that the objfile
-     list is linked through a member of the objfile struct itself, which
-     is only valid for one gdb process.  The list implementation needs to
-     be changed to something like:
+       FIXME:  There is a problem here if the objfile is reusable, and if
+       multiple users are to be supported.  The problem is that the objfile
+       list is linked through a member of the objfile struct itself, which
+       is only valid for one gdb process.  The list implementation needs to
+       be changed to something like:
 
-     struct list {struct list *next; struct objfile *objfile};
+       struct list {struct list *next; struct objfile *objfile};
 
-     where the list structure is completely maintained separately within
-     each gdb process. */
+       where the list structure is completely maintained separately within
+       each gdb process. */
 
-  struct objfile *next;
+    struct objfile *next;
 
-  /* The object file's name.  Malloc'd; free it if you free this struct.  */
+    /* The object file's name.  Malloc'd; free it if you free this struct.  */
 
-  char *name;
+    char *name;
 
-  /* TRUE if this objfile was created because the user explicitly caused
-     it (e.g., used the add-symbol-file command).
+    /* TRUE if this objfile was created because the user explicitly caused
+       it (e.g., used the add-symbol-file command).
      */
-  int  user_loaded;
+    int user_loaded;
 
-  /* TRUE if this objfile was explicitly created to represent a solib.
+    /* TRUE if this objfile was explicitly created to represent a solib.
 
-     (If FALSE, the objfile may actually be a solib.  This can happen if
-     the user created the objfile by using the add-symbol-file command.
-     GDB doesn't in that situation actually check whether the file is a
-     solib.  Rather, the target's implementation of the solib interface
-     is responsible for setting this flag when noticing solibs used by
-     an inferior.)
+       (If FALSE, the objfile may actually be a solib.  This can happen if
+       the user created the objfile by using the add-symbol-file command.
+       GDB doesn't in that situation actually check whether the file is a
+       solib.  Rather, the target's implementation of the solib interface
+       is responsible for setting this flag when noticing solibs used by
+       an inferior.)
      */
-  int  is_solib;
+    int is_solib;
 
-  /* Some flag bits for this objfile. */
+    /* Some flag bits for this objfile. */
 
-  unsigned short flags;
+    unsigned short flags;
 
-  /* Each objfile points to a linked list of symtabs derived from this file,
-     one symtab structure for each compilation unit (source file).  Each link
-     in the symtab list contains a backpointer to this objfile. */
+    /* Each objfile points to a linked list of symtabs derived from this file,
+       one symtab structure for each compilation unit (source file).  Each link
+       in the symtab list contains a backpointer to this objfile. */
 
-  struct symtab *symtabs;
+    struct symtab *symtabs;
 
-  /* Each objfile points to a linked list of partial symtabs derived from
-     this file, one partial symtab structure for each compilation unit
-     (source file). */
+    /* Each objfile points to a linked list of partial symtabs derived from
+       this file, one partial symtab structure for each compilation unit
+       (source file). */
 
-  struct partial_symtab *psymtabs;
+    struct partial_symtab *psymtabs;
 
-  /* List of freed partial symtabs, available for re-use */
+    /* List of freed partial symtabs, available for re-use */
 
-  struct partial_symtab *free_psymtabs;
+    struct partial_symtab *free_psymtabs;
 
-  /* The object file's BFD.  Can be null if the objfile contains only
-     minimal symbols, e.g. the run time common symbols for SunOS4.  */
+    /* The object file's BFD.  Can be null if the objfile contains only
+       minimal symbols, e.g. the run time common symbols for SunOS4.  */
 
-  bfd *obfd;
+    bfd *obfd;
 
-  /* The modification timestamp of the object file, as of the last time
-     we read its symbols.  */
+    /* The modification timestamp of the object file, as of the last time
+       we read its symbols.  */
 
-  long mtime;
+    long mtime;
 
-  /* Obstacks to hold objects that should be freed when we load a new symbol
-     table from this object file. */
+    /* Obstacks to hold objects that should be freed when we load a new symbol
+       table from this object file. */
 
-  struct obstack psymbol_obstack;      /* Partial symbols */
-  struct obstack symbol_obstack;       /* Full symbols */
-  struct obstack type_obstack;         /* Types */
+    struct obstack psymbol_obstack;    /* Partial symbols */
+    struct obstack symbol_obstack;     /* Full symbols */
+    struct obstack type_obstack;       /* Types */
 
-  /* A byte cache where we can stash arbitrary "chunks" of bytes that
-     will not change. */
+    /* 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 psymbol_cache;       /* Byte cache for partial syms */
 
-  /* Vectors of all partial symbols read in from file.  The actual data
-     is stored in the psymbol_obstack. */
+    /* Vectors of all partial symbols read in from file.  The actual data
+       is stored in the psymbol_obstack. */
 
-  struct psymbol_allocation_list global_psymbols;
-  struct psymbol_allocation_list static_psymbols;
+    struct psymbol_allocation_list global_psymbols;
+    struct psymbol_allocation_list static_psymbols;
 
-  /* Each file contains a pointer to an array of minimal symbols for all
-     global symbols that are defined within the file.  The array is terminated
-     by a "null symbol", one that has a NULL pointer for the name and a zero
-     value for the address.  This makes it easy to walk through the array
-     when passed a pointer to somewhere in the middle of it.  There is also
-     a count of the number of symbols, which does not include the terminating
-     null symbol.  The array itself, as well as all the data that it points
-     to, should be allocated on the symbol_obstack for this file. */
+    /* Each file contains a pointer to an array of minimal symbols for all
+       global symbols that are defined within the file.  The array is terminated
+       by a "null symbol", one that has a NULL pointer for the name and a zero
+       value for the address.  This makes it easy to walk through the array
+       when passed a pointer to somewhere in the middle of it.  There is also
+       a count of the number of symbols, which does not include the terminating
+       null symbol.  The array itself, as well as all the data that it points
+       to, should be allocated on the symbol_obstack for this file. */
 
-  struct minimal_symbol *msymbols;
-  int minimal_symbol_count;
+    struct minimal_symbol *msymbols;
+    int minimal_symbol_count;
 
-  /* For object file formats which don't specify fundamental types, gdb
-     can create such types.  For now, it maintains a vector of pointers
-     to these internally created fundamental types on a per objfile basis,
-     however it really should ultimately keep them on a per-compilation-unit
-     basis, to account for linkage-units that consist of a number of
-     compilation units that may have different fundamental types, such as
-     linking C modules with ADA modules, or linking C modules that are
-     compiled with 32-bit ints with C modules that are compiled with 64-bit
-     ints (not inherently evil with a smarter linker). */
+    /* For object file formats which don't specify fundamental types, gdb
+       can create such types.  For now, it maintains a vector of pointers
+       to these internally created fundamental types on a per objfile basis,
+       however it really should ultimately keep them on a per-compilation-unit
+       basis, to account for linkage-units that consist of a number of
+       compilation units that may have different fundamental types, such as
+       linking C modules with ADA modules, or linking C modules that are
+       compiled with 32-bit ints with C modules that are compiled with 64-bit
+       ints (not inherently evil with a smarter linker). */
 
-  struct type **fundamental_types;
+    struct type **fundamental_types;
 
-  /* The mmalloc() malloc-descriptor for this objfile if we are using
-     the memory mapped malloc() package to manage storage for this objfile's
-     data.  NULL if we are not. */
+    /* The mmalloc() malloc-descriptor for this objfile if we are using
+       the memory mapped malloc() package to manage storage for this objfile's
+       data.  NULL if we are not. */
 
-  PTR md;
+    PTR md;
 
-  /* The file descriptor that was used to obtain the mmalloc descriptor
-     for this objfile.  If we call mmalloc_detach with the malloc descriptor
-     we should then close this file descriptor. */
+    /* The file descriptor that was used to obtain the mmalloc descriptor
+       for this objfile.  If we call mmalloc_detach with the malloc descriptor
+       we should then close this file descriptor. */
 
-  int mmfd;
+    int mmfd;
 
-  /* Structure which keeps track of functions that manipulate objfile's
-     of the same type as this objfile.  I.E. the function to read partial
-     symbols for example.  Note that this structure is in statically
-     allocated memory, and is shared by all objfiles that use the
-     object module reader of this type. */
+    /* Structure which keeps track of functions that manipulate objfile's
+       of the same type as this objfile.  I.E. the function to read partial
+       symbols for example.  Note that this structure is in statically
+       allocated memory, and is shared by all objfiles that use the
+       object module reader of this type. */
 
-  struct sym_fns *sf;
+    struct sym_fns *sf;
 
-  /* The per-objfile information about the entry point, the scope (file/func)
-     containing the entry point, and the scope of the user's main() func. */
+    /* The per-objfile information about the entry point, the scope (file/func)
+       containing the entry point, and the scope of the user's main() func. */
 
-  struct entry_info ei;
+    struct entry_info ei;
 
-  /* Information about stabs.  Will be filled in with a dbx_symfile_info
-     struct by those readers that need it. */
+    /* Information about stabs.  Will be filled in with a dbx_symfile_info
+       struct by those readers that need it. */
 
-  struct dbx_symfile_info *sym_stab_info;
+    struct dbx_symfile_info *sym_stab_info;
 
-  /* Hook for information for use by the symbol reader (currently used
-     for information shared by sym_init and sym_read).  It is
-     typically a pointer to malloc'd memory.  The symbol reader's finish
-     function is responsible for freeing the memory thusly allocated.  */
+    /* Hook for information for use by the symbol reader (currently used
+       for information shared by sym_init and sym_read).  It is
+       typically a pointer to malloc'd memory.  The symbol reader's finish
+       function is responsible for freeing the memory thusly allocated.  */
 
-  PTR sym_private;
+    PTR sym_private;
 
-  /* Hook for target-architecture-specific information.  This must
-     point to memory allocated on one of the obstacks in this objfile,
-     so that it gets freed automatically when reading a new object
-     file. */
+    /* Hook for target-architecture-specific information.  This must
+       point to memory allocated on one of the obstacks in this objfile,
+       so that it gets freed automatically when reading a new object
+       file. */
 
-  PTR obj_private;
+    PTR obj_private;
 
-  /* Set of relocation offsets to apply to each section.
-     Currently on the psymbol_obstack (which makes no sense, but I'm
-     not sure it's harming anything).
+    /* Set of relocation offsets to apply to each section.
+       Currently on the psymbol_obstack (which makes no sense, but I'm
+       not sure it's harming anything).
 
-     These offsets indicate that all symbols (including partial and
-     minimal symbols) which have been read have been relocated by this
-     much.  Symbols which are yet to be read need to be relocated by
-     it.  */
+       These offsets indicate that all symbols (including partial and
+       minimal symbols) which have been read have been relocated by this
+       much.  Symbols which are yet to be read need to be relocated by
+       it.  */
 
-  struct section_offsets *section_offsets;
-  int num_sections;
+    struct section_offsets *section_offsets;
+    int num_sections;
 
-  /* set of section begin and end addresses used to map pc addresses
-     into sections.  Currently on the psymbol_obstack (which makes no
-     sense, but I'm not sure it's harming anything).  */
+    /* set of section begin and end addresses used to map pc addresses
+       into sections.  Currently on the psymbol_obstack (which makes no
+       sense, but I'm not sure it's harming anything).  */
 
-  struct obj_section
-    *sections,
-    *sections_end;
+    struct obj_section
+     *sections, *sections_end;
 
-  /* two auxiliary fields, used to hold the fp of separate symbol files */
-  FILE *auxf1, *auxf2;
+    /* two auxiliary fields, used to hold the fp of separate symbol files */
+    FILE *auxf1, *auxf2;
 
-  /* Imported symbols */
-  ImportEntry * import_list;
-  int import_list_size;
+    /* Imported symbols */
+    ImportEntry *import_list;
+    int import_list_size;
 
-  /* Exported symbols */
-  ExportEntry * export_list;
-  int export_list_size;
+    /* Exported symbols */
+    ExportEntry *export_list;
+    int export_list_size;
 
-  /* Place to stash various statistics about this objfile */
-  OBJSTATS;
-};
+    /* Place to stash various statistics about this objfile */
+      OBJSTATS;
+  };
 
 /* Defines for the objfile flag word. */
 
@@ -421,11 +425,11 @@ struct objfile
    whose setting is determined upon symbol table read in.  */
 
 #define OBJF_REORDERED (1 << 2)        /* Functions are reordered */
-                       
+
 /* Distinguish between an objfile for a shared library and a
    "vanilla" objfile. */
 
-#define OBJF_SHARED     (1 << 3)        /* From a shared library */
+#define OBJF_SHARED     (1 << 3)       /* From a shared library */
 
 /* The object file that the main symbol table was loaded from (e.g. the
    argument to the "symbol-file" or "file" command).  */
@@ -460,7 +464,7 @@ extern struct objfile *object_files;
 /* Declarations for functions defined in objfiles.c */
 
 extern struct objfile *
-allocate_objfile PARAMS ((bfd *, int, int, int));
+  allocate_objfile PARAMS ((bfd *, int, int, int));
 
 extern int
 build_objfile_section_table PARAMS ((struct objfile *));
@@ -488,7 +492,7 @@ have_full_symbols PARAMS ((void));
 /* This operation deletes all objfile entries that represent solibs that
    weren't explicitly loaded by the user, via e.g., the add-symbol-file
    command.
  */
+ */
 extern void
 objfile_purge_solibs PARAMS ((void));
 
@@ -499,10 +503,10 @@ extern int
 have_minimal_symbols PARAMS ((void));
 
 extern struct obj_section *
-find_pc_section PARAMS((CORE_ADDR pc));
+  find_pc_section PARAMS ((CORE_ADDR pc));
 
 extern struct obj_section *
-find_pc_sect_section PARAMS((CORE_ADDR pc, asection *section));
+  find_pc_sect_section PARAMS ((CORE_ADDR pc, asection * section));
 
 extern int
 in_plt_section PARAMS ((CORE_ADDR, char *));
@@ -559,4 +563,4 @@ in_plt_section PARAMS ((CORE_ADDR, char *));
   ALL_OBJFILES (objfile)                       \
     ALL_OBJFILE_OSECTIONS (objfile, osect)
 
-#endif /* !defined (OBJFILES_H) */
+#endif /* !defined (OBJFILES_H) */
index 343fa627e4f57f78be8e594a962cc1122b057312..826677540e307a5fdc6ba5111f9c1ec531ead0ba 100644 (file)
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -1,21 +1,22 @@
 /* Target communications support for Macraigor Systems' On-Chip Debugging
    Copyright 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -39,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Prototypes for local functions */
 
 static int ocd_read_bytes PARAMS ((CORE_ADDR memaddr,
-                                     char *myaddr, int len));
+                                  char *myaddr, int len));
 
 static int ocd_start_remote PARAMS ((PTR dummy));
 
@@ -59,11 +60,11 @@ static void ocd_interrupt_twice PARAMS ((int signo));
 
 static void interrupt_query PARAMS ((void));
 
-static unsigned char * ocd_do_command PARAMS ((int cmd, int *statusp, int *lenp));
+static unsigned char *ocd_do_command PARAMS ((int cmd, int *statusp, int *lenp));
 
 static void ocd_put_packet PARAMS ((unsigned char *packet, int pktlen));
 
-static unsigned char * ocd_get_packet PARAMS ((int cmd, int *pktlen, int timeout));
+static unsigned char *ocd_get_packet PARAMS ((int cmd, int *pktlen, int timeout));
 
 static struct target_ops *current_ops = NULL;
 
@@ -97,21 +98,51 @@ ocd_error (s, error_code)
 
   switch (error_code)
     {
-    case 0x1: s = "Unknown fault"; break;
-    case 0x2: s = "Power failed"; break;
-    case 0x3: s = "Cable disconnected"; break;
-    case 0x4: s = "Couldn't enter OCD mode"; break;
-    case 0x5: s = "Target stuck in reset"; break;
-    case 0x6: s = "OCD hasn't been initialized"; break;
-    case 0x7: s = "Write verify failed"; break;
-    case 0x8: s = "Reg buff error (during MPC5xx fp reg read/write)"; break;
-    case 0x9: s = "Invalid CPU register access attempt failed"; break;
-    case 0x11: s = "Bus error"; break;
-    case 0x12: s = "Checksum error"; break;
-    case 0x13: s = "Illegal command"; break;
-    case 0x14: s = "Parameter error"; break;
-    case 0x15: s = "Internal error"; break;
-    case 0x80: s = "Flash erase error"; break;
+    case 0x1:
+      s = "Unknown fault";
+      break;
+    case 0x2:
+      s = "Power failed";
+      break;
+    case 0x3:
+      s = "Cable disconnected";
+      break;
+    case 0x4:
+      s = "Couldn't enter OCD mode";
+      break;
+    case 0x5:
+      s = "Target stuck in reset";
+      break;
+    case 0x6:
+      s = "OCD hasn't been initialized";
+      break;
+    case 0x7:
+      s = "Write verify failed";
+      break;
+    case 0x8:
+      s = "Reg buff error (during MPC5xx fp reg read/write)";
+      break;
+    case 0x9:
+      s = "Invalid CPU register access attempt failed";
+      break;
+    case 0x11:
+      s = "Bus error";
+      break;
+    case 0x12:
+      s = "Checksum error";
+      break;
+    case 0x13:
+      s = "Illegal command";
+      break;
+    case 0x14:
+      s = "Parameter error";
+      break;
+    case 0x15:
+      s = "Internal error";
+      break;
+    case 0x80:
+      s = "Flash erase error";
+      break;
     default:
       sprintf (buf, "Unknown error code %d", error_code);
       s = buf;
@@ -154,11 +185,11 @@ ocd_start_remote (dummy)
   int speed;
   enum ocd_target_type target_type;
 
-  target_type = *(enum ocd_target_type*)dummy;
+  target_type = *(enum ocd_target_type *) dummy;
 
   immediate_quit = 1;          /* Allow user to interrupt it */
 
-  SERIAL_SEND_BREAK (ocd_desc); /* Wake up the wiggler */
+  SERIAL_SEND_BREAK (ocd_desc);        /* Wake up the wiggler */
 
   speed = 80;                  /* Divide clock by 4000 */
 
@@ -189,7 +220,7 @@ ocd_start_remote (dummy)
   /* Reset the target */
 
   ocd_do_command (OCD_RESET_RUN, &status, &pktlen);
-/*  ocd_do_command (OCD_RESET, &status, &pktlen);*/
+/*  ocd_do_command (OCD_RESET, &status, &pktlen); */
 #endif
 
   /* If processor is still running, stop it.  */
@@ -233,12 +264,12 @@ ocd_start_remote (dummy)
   print_stack_frame (selected_frame, -1, 1);
 
   buf[0] = OCD_LOG_FILE;
-  buf[1] = 3;   /* close existing WIGGLERS.LOG */
+  buf[1] = 3;                  /* close existing WIGGLERS.LOG */
   ocd_put_packet (buf, 2);
   p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
 
   buf[0] = OCD_LOG_FILE;
-  buf[1] = 2;   /* append to existing WIGGLERS.LOG */
+  buf[1] = 2;                  /* append to existing WIGGLERS.LOG */
   ocd_put_packet (buf, 2);
   p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
 
@@ -273,28 +304,29 @@ device the OCD device is attached to (e.g. /dev/ttya).");
 
   ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
 
-  if (strncmp(name,"wiggler",7) == 0)
-      {
-         ocd_desc = SERIAL_OPEN ("ocd");
-          if (!ocd_desc)
-            perror_with_name (name);
-
-         buf[0] = OCD_LOG_FILE;
-         buf[1] = 1;   /* open new or overwrite existing WIGGLERS.LOG */
-         ocd_put_packet (buf, 2);
-         p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
-
-         buf[0] = OCD_SET_CONNECTION;
-         buf[1] = 0x01;        /* atoi (name[11]); */
-         ocd_put_packet (buf, 2);
-         p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
-      }
-  else /* not using Wigglers.dll */
-      {
-          ocd_desc = SERIAL_OPEN (name);
-         if (!ocd_desc)
-             perror_with_name (name);
-      }
+  if (strncmp (name, "wiggler", 7) == 0)
+    {
+      ocd_desc = SERIAL_OPEN ("ocd");
+      if (!ocd_desc)
+       perror_with_name (name);
+
+      buf[0] = OCD_LOG_FILE;
+      buf[1] = 1;              /* open new or overwrite existing WIGGLERS.LOG */
+      ocd_put_packet (buf, 2);
+      p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
+
+      buf[0] = OCD_SET_CONNECTION;
+      buf[1] = 0x01;           /* atoi (name[11]); */
+      ocd_put_packet (buf, 2);
+      p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
+    }
+  else
+    /* not using Wigglers.dll */
+    {
+      ocd_desc = SERIAL_OPEN (name);
+      if (!ocd_desc)
+       perror_with_name (name);
+    }
 
   if (baud_rate != -1)
     {
@@ -334,7 +366,7 @@ device the OCD device is attached to (e.g. /dev/ttya).");
                     "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     {
-      pop_target();
+      pop_target ();
       error ("Failed to connect to OCD.");
     }
 }
@@ -397,7 +429,7 @@ ocd_interrupt (signo)
 {
   /* If this doesn't work, try more severe steps.  */
   signal (signo, ocd_interrupt_twice);
-  
+
   if (remote_debug)
     printf_unfiltered ("ocd_interrupt called\n");
 
@@ -411,7 +443,7 @@ ocd_interrupt (signo)
   }
 }
 
-static void (*ofunc)();
+static void (*ofunc) ();
 
 /* The user typed ^C twice.  */
 static void
@@ -419,7 +451,7 @@ ocd_interrupt_twice (signo)
      int signo;
 {
   signal (signo, ofunc);
-  
+
   interrupt_query ();
 
   signal (signo, ocd_interrupt);
@@ -601,7 +633,7 @@ ocd_write_bdm_register (bdm_regno, reg)
   ocd_write_bdm_registers (bdm_regno, buf, 4);
 }
 \f
-void 
+void
 ocd_prepare_to_store ()
 {
 }
@@ -769,7 +801,7 @@ ocd_xfer_memory (memaddr, myaddr, len, should_write, target)
      char *myaddr;
      int len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   return dcache_xfer_memory (ocd_dcache, memaddr, myaddr, len, should_write);
 }
@@ -836,7 +868,7 @@ get_quoted_char (timeout)
     }
 }
 
-static unsigned char pkt[256 * 2 + 10], *pktp; /* Worst case */
+static unsigned char pkt[256 * 2 + 10], *pktp; /* Worst case */
 
 static void
 reset_packet ()
@@ -934,7 +966,7 @@ ocd_put_packet (buf, len)
   unsigned char c;
   unsigned char *packet, *packet_ptr;
 
-  packet = alloca (len + 1 + 1); /* packet + SYN + checksum */
+  packet = alloca (len + 1 + 1);       /* packet + SYN + checksum */
   packet_ptr = packet;
 
   checksum = 0;
@@ -960,7 +992,7 @@ ocd_put_packet (buf, len)
    first byte of the packet.  Subsequent bytes are expected to arrive in
    time <= remote_timeout.  Returns a pointer to a static buffer containing
    the payload of the packet.  *LENP contains the length of the packet.
-*/
+ */
 
 static unsigned char *
 stu_get_packet (cmd, lenp, timeout)
@@ -972,7 +1004,7 @@ stu_get_packet (cmd, lenp, timeout)
   static unsigned char buf[256 + 10], *p;
   unsigned char checksum;
 
- find_packet:
+find_packet:
 
   ch = get_quoted_char (timeout);
 
@@ -982,7 +1014,7 @@ stu_get_packet (cmd, lenp, timeout)
   if (ch != RAW_SYN)
     goto find_packet;
 
- found_syn:                    /* Found the start of a packet */
+found_syn:                     /* Found the start of a packet */
 
   p = buf;
   checksum = 0;
@@ -1025,7 +1057,7 @@ stu_get_packet (cmd, lenp, timeout)
    first byte of the packet.  Subsequent bytes are expected to arrive in
    time <= remote_timeout.  Returns a pointer to a static buffer containing
    the payload of the packet.  *LENP contains the length of the packet.
-*/
+ */
 
 static unsigned char *
 ocd_get_packet (cmd, lenp, timeout)
@@ -1086,7 +1118,7 @@ ocd_get_packet (cmd, lenp, timeout)
       len = 8;                 /* write address, value read back */
       break;
     case 0x11:                 /* Bus error? */
-                               /* write address, read flag */
+      /* write address, read flag */
     case 0x15:                 /* Internal error */
       len = 5;                 /* error code, vector */
       break;
@@ -1096,43 +1128,43 @@ ocd_get_packet (cmd, lenp, timeout)
     case 0x0:                  /* Normal result */
       switch (packet[0])
        {
-       case OCD_AYT:   /* Are You There? */
-       case OCD_SET_BAUD_RATE: /* Set Baud Rate */
-       case OCD_INIT:  /* Initialize OCD device */
+       case OCD_AYT:           /* Are You There? */
+       case OCD_SET_BAUD_RATE: /* Set Baud Rate */
+       case OCD_INIT:          /* Initialize OCD device */
        case OCD_SET_SPEED:     /* Set Speed */
-       case OCD_SET_FUNC_CODE: /* Set Function Code */
-       case OCD_SET_CTL_FLAGS: /* Set Control Flags */
-       case OCD_SET_BUF_ADDR: /* Set Register Buffer Address */
-       case OCD_RUN:   /* Run Target from PC  */
+       case OCD_SET_FUNC_CODE: /* Set Function Code */
+       case OCD_SET_CTL_FLAGS: /* Set Control Flags */
+       case OCD_SET_BUF_ADDR:  /* Set Register Buffer Address */
+       case OCD_RUN:           /* Run Target from PC  */
        case OCD_RUN_ADDR:      /* Run Target from Specified Address  */
-       case OCD_STOP:  /* Stop Target */
+       case OCD_STOP:          /* Stop Target */
        case OCD_RESET_RUN:     /* Reset Target and Run */
        case OCD_RESET: /* Reset Target and Halt */
-       case OCD_STEP:  /* Single Step */
-       case OCD_WRITE_REGS: /* Write Register */
+       case OCD_STEP:          /* Single Step */
+       case OCD_WRITE_REGS:    /* Write Register */
        case OCD_WRITE_MEM:     /* Write Memory */
        case OCD_FILL_MEM:      /* Fill Memory */
        case OCD_MOVE_MEM:      /* Move Memory */
-       case OCD_WRITE_INT_MEM: /* Write Internal Memory */
-       case OCD_JUMP:  /* Jump to Subroutine */
-       case OCD_ERASE_FLASH: /* Erase flash memory */
-       case OCD_PROGRAM_FLASH: /* Write flash memory */
+       case OCD_WRITE_INT_MEM: /* Write Internal Memory */
+       case OCD_JUMP:          /* Jump to Subroutine */
+       case OCD_ERASE_FLASH:   /* Erase flash memory */
+       case OCD_PROGRAM_FLASH: /* Write flash memory */
        case OCD_EXIT_MON:      /* Exit the flash programming monitor  */
        case OCD_ENTER_MON:     /* Enter the flash programming monitor  */
        case OCD_LOG_FILE:      /* Make Wigglers.dll save Wigglers.log */
-       case OCD_SET_CONNECTION: /* Set type of connection in Wigglers.dll */
+       case OCD_SET_CONNECTION:        /* Set type of connection in Wigglers.dll */
          len = 0;
          break;
-       case OCD_GET_VERSION: /* Get Version */
+       case OCD_GET_VERSION:   /* Get Version */
          len = 10;
          break;
-       case OCD_GET_STATUS_MASK: /* Get Status Mask */
+       case OCD_GET_STATUS_MASK:       /* Get Status Mask */
          len = 1;
          break;
        case OCD_GET_CTRS:      /* Get Error Counters */
        case OCD_READ_REGS:     /* Read Register */
        case OCD_READ_MEM:      /* Read Memory */
-       case OCD_READ_INT_MEM: /* Read Internal Memory */
+       case OCD_READ_INT_MEM:  /* Read Internal Memory */
          len = 257;
          break;
        default:
@@ -1169,7 +1201,7 @@ ocd_get_packet (cmd, lenp, timeout)
   if (cmd != -1 && cmd != packet[0])
     error ("Response phase error.  Got 0x%x, expected 0x%x", packet[0], cmd);
 
-  *lenp = packet_ptr - packet - 1; /* Subtract checksum byte */
+  *lenp = packet_ptr - packet - 1;     /* Subtract checksum byte */
   return packet;
 }
 #endif
@@ -1191,7 +1223,7 @@ ocd_do_command (cmd, statusp, lenp)
   int logpktlen;
 
   buf[0] = cmd;
-  ocd_put_packet (buf, 1);             /* Send command */
+  ocd_put_packet (buf, 1);     /* Send command */
   p = ocd_get_packet (*buf, lenp, remote_timeout);
 
   if (*lenp < 3)
@@ -1214,12 +1246,12 @@ ocd_do_command (cmd, statusp, lenp)
   *statusp = status;
 
   logbuf[0] = OCD_LOG_FILE;
-  logbuf[1] = 3;   /* close existing WIGGLERS.LOG */
+  logbuf[1] = 3;               /* close existing WIGGLERS.LOG */
   ocd_put_packet (logbuf, 2);
   ocd_get_packet (logbuf[0], &logpktlen, remote_timeout);
 
   logbuf[0] = OCD_LOG_FILE;
-  logbuf[1] = 2;   /* append to existing WIGGLERS.LOG */
+  logbuf[1] = 2;               /* append to existing WIGGLERS.LOG */
   ocd_put_packet (logbuf, 2);
   ocd_get_packet (logbuf[0], &logpktlen, remote_timeout);
 
@@ -1287,10 +1319,10 @@ ocd_load (args, from_tty)
 /* This should be defined for each target */
 /* But we want to be able to compile this file for some configurations
    not yet supported fully */
-   
-#define BDM_BREAKPOINT {0x0,0x0,0x0,0x0} /* For ppc 8xx */
+
+#define BDM_BREAKPOINT {0x0,0x0,0x0,0x0}       /* For ppc 8xx */
 #if 0
-#define BDM_BREAKPOINT {0x4a,0xfa} /* BGND insn used for CPU32 */
+#define BDM_BREAKPOINT {0x4a,0xfa}     /* BGND insn used for CPU32 */
 #endif
 
 /* BDM (at least on CPU32) uses a different breakpoint */
@@ -1388,7 +1420,7 @@ bdm_update_flash_command (args, from_tty)
   if (!args)
     error ("Must specify file containing new OCD code.");
 
-/*  old_chain = make_cleanup (flash_cleanup, 0);*/
+/*  old_chain = make_cleanup (flash_cleanup, 0); */
 
   ocd_do_command (OCD_ENTER_MON, &status, &pktlen);
 
@@ -1405,7 +1437,7 @@ bdm_update_flash_command (args, from_tty)
 
   ocd_do_command (OCD_EXIT_MON, &status, &pktlen);
 
-/*  discard_cleanups (old_chain);*/
+/*  discard_cleanups (old_chain); */
 }
 
 static void
@@ -1430,8 +1462,8 @@ _initialize_remote_ocd ()
   static struct cmd_list_element *ocd_cmd_list = NULL;
 
   add_show_from_set (add_set_cmd ("remotetimeout", no_class,
-                                 var_integer, (char *)&remote_timeout,
-                                 "Set timeout value for remote read.\n", &setlist),
+                                 var_integer, (char *) &remote_timeout,
+                         "Set timeout value for remote read.\n", &setlist),
                     &showlist);
 
   add_prefix_cmd ("ocd", class_obscure, bdm_command, "", &ocd_cmd_list, "ocd ",
@@ -1440,5 +1472,5 @@ _initialize_remote_ocd ()
   add_cmd ("reset", class_obscure, bdm_reset_command, "", &ocd_cmd_list);
   add_cmd ("restart", class_obscure, bdm_restart_command, "", &ocd_cmd_list);
   add_cmd ("update-flash", class_obscure, bdm_update_flash_command, "", &ocd_cmd_list);
-  /*  add_cmd ("read-register", class_obscure, bdm_read_register_command, "", &ocd_cmd_list);*/
+  /*  add_cmd ("read-register", class_obscure, bdm_read_register_command, "", &ocd_cmd_list); */
 }
index 020d3e2a41d74c70d2c37b6f6569c350f6445f75..6a71d6a51a432078112dce0debf942afef7f930c 100644 (file)
--- a/gdb/ocd.h
+++ b/gdb/ocd.h
@@ -1,21 +1,22 @@
 /* Definitions for the Macraigor Systems BDM Wiggler
    Copyright 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef OCD_H
 #define OCD_H
@@ -24,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define DLE 020                        /* Quote char */
 #define SYN 026                        /* Start of packet */
-#define RAW_SYN ((026 << 8) | 026) /* get_quoted_char found a naked SYN */
+#define RAW_SYN ((026 << 8) | 026)     /* get_quoted_char found a naked SYN */
 
 /* Status flags */
 
@@ -32,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define OCD_FLAG_STOPPED 0x02  /* Target is halted */
 #define OCD_FLAG_BDM 0x04      /* Target is in BDM */
 #define OCD_FLAG_PWF 0x08      /* Power failed */
-#define OCD_FLAG_CABLE_DISC 0x10 /* BDM cable disconnected */
+#define OCD_FLAG_CABLE_DISC 0x10       /* BDM cable disconnected */
 
 /* Commands */
 
@@ -41,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define OCD_SET_BAUD_RATE 0x2  /* Set Baud Rate */
 #define OCD_INIT 0x10          /* Initialize Wiggler */
 #define OCD_SET_SPEED 0x11     /* Set Speed */
-#define OCD_GET_STATUS_MASK 0x12 /* Get Status Mask */
+#define OCD_GET_STATUS_MASK 0x12       /* Get Status Mask */
 #define OCD_GET_CTRS 0x13      /* Get Error Counters */
 #define OCD_SET_FUNC_CODE 0x14 /* Set Function Code */
 #define OCD_SET_CTL_FLAGS 0x15 /* Set Control Flags */
@@ -73,18 +74,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define OCD_LOG_FILE 0xf1      /* Cmd to get Wigglers.dll to log cmds */
 #define OCD_FLAG_STOP 0x0      /* Stop the target, enter BDM */
 #define OCD_FLAG_START 0x01    /* Start the target at PC */
-#define OCD_FLAG_RETURN_STATUS 0x04 /* Return async status */
+#define OCD_FLAG_RETURN_STATUS 0x04    /* Return async status */
 
 /* Target type (for OCD_INIT command) */
 
-enum ocd_target_type {
-  OCD_TARGET_CPU32=0x0,                /* Moto cpu32 family */
-  OCD_TARGET_CPU16=0x1,
-  OCD_TARGET_MOTO_PPC=0x2,     /* Motorola PPC 5xx/8xx */
-  OCD_TARGET_IBM_PPC=0x3};     /* IBM PPC 4xx */
+enum ocd_target_type
+  {
+    OCD_TARGET_CPU32 = 0x0,    /* Moto cpu32 family */
+    OCD_TARGET_CPU16 = 0x1,
+    OCD_TARGET_MOTO_PPC = 0x2, /* Motorola PPC 5xx/8xx */
+    OCD_TARGET_IBM_PPC = 0x3
+  };                           /* IBM PPC 4xx */
 
 void ocd_open PARAMS ((char *name, int from_tty, enum ocd_target_type,
-                          struct target_ops *ops));
+                      struct target_ops * ops));
 
 void ocd_close PARAMS ((int quitting));
 
@@ -96,18 +99,18 @@ void ocd_prepare_to_store PARAMS ((void));
 
 void ocd_stop PARAMS ((void));
 
-void ocd_files_info PARAMS ((struct target_ops *ignore));
+void ocd_files_info PARAMS ((struct target_ops * ignore));
 
 
 int ocd_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
-                                int len, int should_write,
-                                struct target_ops *target));
+                            int len, int should_write,
+                            struct target_ops * target));
 
 void ocd_mourn PARAMS ((void));
 
 void ocd_create_inferior PARAMS ((char *exec_file,
-                                     char *args,
-                                     char **env));
+                                 char *args,
+                                 char **env));
 
 int ocd_thread_alive PARAMS ((int th));
 
@@ -115,17 +118,17 @@ void ocd_error PARAMS ((char *s, int error_code));
 
 void ocd_kill PARAMS ((void));
 
-void ocd_load PARAMS((char *args, int from_tty));
+void ocd_load PARAMS ((char *args, int from_tty));
 
-unsigned char * ocd_read_bdm_registers PARAMS ((int first_bdm_regno,
-                                                   int last_bdm_regno,
-                                                   int *reglen));
+unsigned char *ocd_read_bdm_registers PARAMS ((int first_bdm_regno,
+                                              int last_bdm_regno,
+                                              int *reglen));
 
 CORE_ADDR ocd_read_bdm_register PARAMS ((int bdm_regno));
 
 void ocd_write_bdm_registers PARAMS ((int first_bdm_regno,
-                                         unsigned char *regptr,
-                                         int reglen));
+                                     unsigned char *regptr,
+                                     int reglen));
 
 void ocd_write_bdm_register PARAMS ((int bdm_regno, CORE_ADDR reg));
 
index 326209184142c7eeb915c52f5c34d013046214ef..997b77ace4a78e4beaec4064d10adbf54551db00 100644 (file)
@@ -2,21 +2,22 @@
 
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -41,7 +42,7 @@ static char *op50n_regnames[NUM_REGS] =
   "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
   "cr11", "p", NULL, NULL, NULL, "cr15", "cr19", "cr20",
   "cr21", "cr22", NULL, NULL, NULL, NULL, NULL, NULL,
-  NULL, NULL, NULL, "cr0", "cr8", "cr9", "cr10","cr12",
+  NULL, NULL, NULL, "cr0", "cr8", "cr9", "cr10", "cr12",
   "cr13", "cr24", "cr25", "cr26",
 };
 
@@ -53,69 +54,70 @@ static char *op50n_regnames[NUM_REGS] =
 
 static struct target_ops op50n_ops;
 
-static char *op50n_inits[] = {".\r", NULL};
+static char *op50n_inits[] =
+{".\r", NULL};
 
-static struct monitor_ops op50n_cmds ;
+static struct monitor_ops op50n_cmds;
 
-static void 
-init_op50n_cmds(void)
+static void
+init_op50n_cmds (void)
 {
-  op50n_cmds.flags =   MO_CLR_BREAK_USES_ADDR /*| MO_GETMEM_READ_SINGLE*/; /* flags */
-  op50n_cmds.init =   op50n_inits;                     /* Init strings */
-  op50n_cmds.cont =   "g\r";                   /* continue command */
-  op50n_cmds.step =   "t\r";                   /* single step */
-  op50n_cmds.stop =   "\003.\r";                       /* Interrupt char */
-  op50n_cmds.set_break =   "b %x\r";                   /* set a breakpoint */
-  op50n_cmds.clr_break =   "b %x;0\r";                 /* clear breakpoint at addr */
-  op50n_cmds.clr_all_break =   "bx\r";                 /* clear all breakpoints */
-  op50n_cmds.fill =   "fx %x s%x %x\r";                /* memory fill cmd (addr, len, val) */
-  op50n_cmds.setmem.cmdb =     "sx %x %x\r";           /* setmem.cmdb (addr, value) */
-  op50n_cmds.setmem.cmdw =     "sh %x %x\r";           /* setmem.cmdw (addr, value) */
-  op50n_cmds.setmem.cmdl =     "s %x %x\r";            /* setmem.cmdl (addr, value) */
-  op50n_cmds.setmem.cmdll =     NULL;                  /* setmem.cmdll (addr, value) */
-  op50n_cmds.setmem.resp_delim =     NULL;                     /* setmem.resp_delim */
-  op50n_cmds.setmem.term =     NULL;                   /* setmem.term */
-  op50n_cmds.setmem.term_cmd =     NULL;                       /* setmem.term_cmd */
+  op50n_cmds.flags = MO_CLR_BREAK_USES_ADDR /*| MO_GETMEM_READ_SINGLE */ ;     /* flags */
+  op50n_cmds.init = op50n_inits;       /* Init strings */
+  op50n_cmds.cont = "g\r";     /* continue command */
+  op50n_cmds.step = "t\r";     /* single step */
+  op50n_cmds.stop = "\003.\r"; /* Interrupt char */
+  op50n_cmds.set_break = "b %x\r";     /* set a breakpoint */
+  op50n_cmds.clr_break = "b %x;0\r";   /* clear breakpoint at addr */
+  op50n_cmds.clr_all_break = "bx\r";   /* clear all breakpoints */
+  op50n_cmds.fill = "fx %x s%x %x\r";  /* memory fill cmd (addr, len, val) */
+  op50n_cmds.setmem.cmdb = "sx %x %x\r";       /* setmem.cmdb (addr, value) */
+  op50n_cmds.setmem.cmdw = "sh %x %x\r";       /* setmem.cmdw (addr, value) */
+  op50n_cmds.setmem.cmdl = "s %x %x\r";                /* setmem.cmdl (addr, value) */
+  op50n_cmds.setmem.cmdll = NULL;      /* setmem.cmdll (addr, value) */
+  op50n_cmds.setmem.resp_delim = NULL; /* setmem.resp_delim */
+  op50n_cmds.setmem.term = NULL;       /* setmem.term */
+  op50n_cmds.setmem.term_cmd = NULL;   /* setmem.term_cmd */
 #if 0
   {
     "sx %x\r",                 /* getmem.cmdb (addr, len) */
-      "sh %x\r",                       /* getmem.cmdw (addr, len) */
+      "sh %x\r",               /* getmem.cmdw (addr, len) */
       "s %x\r",                        /* getmem.cmdl (addr, len) */
       NULL,                    /* getmem.cmdll (addr, len) */
       " : ",                   /* getmem.resp_delim */
       " ",                     /* getmem.term */
       ".\r",                   /* getmem.term_cmd */
-      } ;
+  };
 #else
-  op50n_cmds.getmem.cmdb =     "dx %x s%x\r";          /* getmem.cmdb (addr, len) */
-  op50n_cmds.getmem.cmdw =     NULL;                   /* getmem.cmdw (addr, len) */
-  op50n_cmds.getmem.cmdl =     NULL;                   /* getmem.cmdl (addr, len) */
-  op50n_cmds.getmem.cmdll =     NULL;                  /* getmem.cmdll (addr, len) */
-  op50n_cmds.getmem.resp_delim =     " : ";                    /* getmem.resp_delim */
-  op50n_cmds.getmem.term =     NULL;                   /* getmem.term */
-  op50n_cmds.getmem.term_cmd =     NULL;                       /* getmem.term_cmd */
+  op50n_cmds.getmem.cmdb = "dx %x s%x\r";      /* getmem.cmdb (addr, len) */
+  op50n_cmds.getmem.cmdw = NULL;       /* getmem.cmdw (addr, len) */
+  op50n_cmds.getmem.cmdl = NULL;       /* getmem.cmdl (addr, len) */
+  op50n_cmds.getmem.cmdll = NULL;      /* getmem.cmdll (addr, len) */
+  op50n_cmds.getmem.resp_delim = " : ";                /* getmem.resp_delim */
+  op50n_cmds.getmem.term = NULL;       /* getmem.term */
+  op50n_cmds.getmem.term_cmd = NULL;   /* getmem.term_cmd */
 #endif
-  op50n_cmds.setreg.cmd =     "x %s %x\r";             /* setreg.cmd (name, value) */
-  op50n_cmds.setreg.resp_delim =     NULL;                     /* setreg.resp_delim */
-  op50n_cmds.setreg.term =     NULL;                   /* setreg.term */
-  op50n_cmds.setreg.term_cmd =     NULL;                       /* setreg.term_cmd */
-  op50n_cmds.getreg.cmd =     "x %s\r";                        /* getreg.cmd (name) */
-  op50n_cmds.getreg.resp_delim =     "=";                      /* getreg.resp_delim */
-  op50n_cmds.getreg.term =     " ";                    /* getreg.term */
-  op50n_cmds.getreg.term_cmd =     ".\r";                      /* getreg.term_cmd */
-  op50n_cmds.dump_registers =   NULL;                          /* dump_registers */
-  op50n_cmds.register_pattern =   NULL;                                /* register_pattern */
-  op50n_cmds.supply_register =   NULL;                         /* supply_register */
-  op50n_cmds.load_routine =   NULL;                            /* load routine */
-  op50n_cmds.load =   "r 0\r";                 /* download command */
-  op50n_cmds.loadresp =   NULL;                                /* load response */
-  op50n_cmds.prompt =   "\n#";                 /* monitor command prompt */
-  op50n_cmds.line_term =   "\r";                               /* end-of-command delimitor */
-  op50n_cmds.cmd_end =   NULL;                         /* optional command terminator */
-  op50n_cmds.target =   &op50n_ops;                    /* target operations */
-  op50n_cmds.stopbits =   SERIAL_1_STOPBITS;           /* number of stop bits */
-  op50n_cmds.regnames =   op50n_regnames;              /* register names */
-  op50n_cmds.magic =   MONITOR_OPS_MAGIC;              /* magic */
+  op50n_cmds.setreg.cmd = "x %s %x\r"; /* setreg.cmd (name, value) */
+  op50n_cmds.setreg.resp_delim = NULL; /* setreg.resp_delim */
+  op50n_cmds.setreg.term = NULL;       /* setreg.term */
+  op50n_cmds.setreg.term_cmd = NULL;   /* setreg.term_cmd */
+  op50n_cmds.getreg.cmd = "x %s\r";    /* getreg.cmd (name) */
+  op50n_cmds.getreg.resp_delim = "=";  /* getreg.resp_delim */
+  op50n_cmds.getreg.term = " ";        /* getreg.term */
+  op50n_cmds.getreg.term_cmd = ".\r";  /* getreg.term_cmd */
+  op50n_cmds.dump_registers = NULL;    /* dump_registers */
+  op50n_cmds.register_pattern = NULL;  /* register_pattern */
+  op50n_cmds.supply_register = NULL;   /* supply_register */
+  op50n_cmds.load_routine = NULL;      /* load routine */
+  op50n_cmds.load = "r 0\r";   /* download command */
+  op50n_cmds.loadresp = NULL;  /* load response */
+  op50n_cmds.prompt = "\n#";   /* monitor command prompt */
+  op50n_cmds.line_term = "\r"; /* end-of-command delimitor */
+  op50n_cmds.cmd_end = NULL;   /* optional command terminator */
+  op50n_cmds.target = &op50n_ops;      /* target operations */
+  op50n_cmds.stopbits = SERIAL_1_STOPBITS;     /* number of stop bits */
+  op50n_cmds.regnames = op50n_regnames;                /* register names */
+  op50n_cmds.magic = MONITOR_OPS_MAGIC;                /* magic */
 };
 
 static void
@@ -129,7 +131,7 @@ op50n_open (args, from_tty)
 void
 _initialize_op50n ()
 {
-  init_op50n_cmds() ;
+  init_op50n_cmds ();
   init_monitor_ops (&op50n_ops);
 
   op50n_ops.to_shortname = "op50n";
index a9193388d27137f81f94fd538c4e7cc9a1c0fc18..402130c1e0a611a52bf3064f94e52dc6fc9dbc0f 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 96, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module provides three functions: os9k_symfile_init,
    which initializes to read a symbol file; os9k_new_init, which 
@@ -49,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "command.h"
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
-#include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
+#include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
 #include "symfile.h"
 #include "objfiles.h"
 #include "buildsym.h"
@@ -78,10 +79,11 @@ extern void _initialize_os9kread PARAMS ((void));
 #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;
-};
+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;
@@ -116,10 +118,10 @@ 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};
+{"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};
+{"IBE/IDE symbol mismatch at symtab pos %d", 0, 0};
 #endif
 \f
 /* Local function prototypes */
@@ -138,7 +140,7 @@ os9k_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
 
 static void
 read_os9k_psymtab PARAMS ((struct section_offsets *, struct objfile *,
-                         CORE_ADDR, int));
+                          CORE_ADDR, int));
 
 static int
 fill_sym PARAMS ((FILE *, bfd *));
@@ -156,21 +158,21 @@ static void
 os9k_symfile_finish PARAMS ((struct objfile *));
 
 static void
-os9k_process_one_symbol PARAMS ((int, int, CORE_ADDR, char *, 
-     struct section_offsets *, struct objfile *));
+os9k_process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
+                              struct section_offsets *, struct objfile *));
 
 static struct partial_symtab *
-os9k_start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
-                       CORE_ADDR, int, int, struct partial_symbol **,
-                       struct partial_symbol **));
+  os9k_start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
+                             CORE_ADDR, int, int, struct partial_symbol **,
+                             struct partial_symbol **));
 
 static struct partial_symtab *
-os9k_end_psymtab PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR,
-                     struct partial_symtab **, int));
+  os9k_end_psymtab PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR,
+                           struct partial_symtab **, int));
 
 static void
-record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *, 
-                    struct section_offsets *));
+record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *,
+                              struct section_offsets *));
 \f
 #define HANDLE_RBRAC(val) \
   if ((val) > pst->texthigh) pst->texthigh = (val);
@@ -208,103 +210,113 @@ record_minimal_symbol (name, address, type, objfile, section_offsets)
   switch (type)
     {
     case N_TEXT:
-         ms_type = mst_text;
-         address += ANOFFSET(section_offsets, SECT_OFF_TEXT);
-         break;
+      ms_type = mst_text;
+      address += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+      break;
     case N_DATA:
-         ms_type = mst_data;
-         break;
+      ms_type = mst_data;
+      break;
     case N_BSS:
-          ms_type = mst_bss;
-         break;
+      ms_type = mst_bss;
+      break;
     case N_RDATA:
-         ms_type = mst_bss;
-         break;
-    case N_IDATA:      
-         ms_type = mst_data;
-         break;
+      ms_type = mst_bss;
+      break;
+    case N_IDATA:
+      ms_type = mst_data;
+      break;
     case N_ABS:
-         ms_type = mst_abs;
-         break;
+      ms_type = mst_abs;
+      break;
     default:
-          ms_type = mst_unknown; break;
-  }
+      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;
-};
+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(objfile, section_offsets)
+read_minimal_symbols (objfile, section_offsets)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
 {
-FILE *fp;
-bfd *abfd;
-struct stbhdr hdr;
-struct stbsymbol sym;
-int ch, i, j, off;
-char buf[64], buf1[128];
-               
+  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;
+  if (fp == NULL)
+    return;
   abfd = objfile->obfd;
-  fread(&hdr.comhdr[0], sizeof(mhhdr), 1, fp);
+  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);
+  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);      
-       
+  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();
+  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);
+  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, section_offsets);
+      off += STBSYMSIZE;
     };
-    record_minimal_symbol(buf1, sym.value, sym.type&7, objfile, section_offsets);
-    off += STBSYMSIZE;
-  };
   install_minimal_symbols (objfile);
   return;
 }
@@ -323,15 +335,15 @@ static void
 os9k_symfile_read (objfile, section_offsets, mainline)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
-     int mainline;     /* FIXME comments above */
+     int mainline;             /* FIXME comments above */
 {
   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)
+  if (mainline || objfile->global_psymbols.size == 0 ||
+      objfile->static_psymbols.size == 0)
     init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
 
   free_pending_blocks ();
@@ -361,8 +373,8 @@ os9k_new_init (ignore)
   buildsym_new_init ();
   psymfile_depth = 0;
 /*
-  init_header_files ();
-*/
+   init_header_files ();
+ */
 }
 
 /* os9k_symfile_init ()
@@ -386,24 +398,26 @@ os9k_symfile_init (objfile)
   FILE *minfile = 0;
   asection *text_sect;
 
-  strcpy(dbgname, name);
-  strcat(dbgname, ".dbg");
-  strcpy(stbname, name);
-  strcat(stbname, ".stb");
+  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);
-  }
+  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);
-  }
+  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));
+    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");
@@ -412,9 +426,9 @@ os9k_symfile_init (objfile)
   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 */
+  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
@@ -428,15 +442,16 @@ os9k_symfile_finish (objfile)
 {
   if (objfile->sym_stab_info != NULL)
     {
-      mfree (objfile -> md, objfile->sym_stab_info);
+      mfree (objfile->md, objfile->sym_stab_info);
     }
 /*
-  free_header_files ();
-*/
+   free_header_files ();
+ */
 }
-
 \f
-struct st_dbghdr {
+
+struct st_dbghdr
+{
   int sync;
   short rev;
   int crc;
@@ -461,12 +476,13 @@ struct st_dbghdr {
 #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;
-};
+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];
@@ -481,12 +497,12 @@ fill_sym (dbg_file, abfd)
      FILE *dbg_file;
      bfd *abfd;
 {
-short si, nmask;
-long li;
-int ii;
-char *p;
+  short si, nmask;
+  long li;
+  int ii;
+  char *p;
 
-  int nbytes = fread(&si, sizeof(si), 1, dbg_file);
+  int nbytes = fread (&si, sizeof (si), 1, dbg_file);
   if (nbytes == 0)
     return 0;
   if (nbytes < 0)
@@ -494,54 +510,57 @@ char *p;
   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 = 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);
+      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);
+      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);
+      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);
+      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)
+       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);
+         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);
+      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);
+      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;
+  return 1;
 }
 \f
 /* Given pointers to an a.out symbol table in core containing dbx
@@ -558,7 +577,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
      CORE_ADDR text_addr;
      int text_size;
 {
-  register struct internal_symstruct *bufp = 0;        /* =0 avoids gcc -Wall glitch*/
+  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;
@@ -600,66 +619,70 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
   end_of_text_addr = END_OF_TEXT_DEFAULT;
 #else
   end_of_text_addr = text_addr + section_offsets->offsets[SECT_OFF_TEXT]
-                              + text_size;     /* Relocate */
+    + 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);      
+  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)
+  while (1)
     {
-    int ret;
-    long cursymoffset;
+      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++;
+      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;
+      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;
+         char *p;
 
        case N_SYM_CMPLR:
          continue;
 
        case N_SYM_SE:
-          CUR_SYMBOL_VALUE += ANOFFSET(section_offsets, SECT_OFF_TEXT);
+         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
          if (psymfile_depth == 1 && pst)
            {
              os9k_end_psymtab (pst, psymtab_include_list, includes_used,
-                      symnum, CUR_SYMBOL_VALUE,
-                      dependency_list, dependencies_used);
+                               symnum, CUR_SYMBOL_VALUE,
+                               dependency_list, dependencies_used);
              pst = (struct partial_symtab *) 0;
              includes_used = 0;
              dependencies_used = 0;
            }
-         psymfile_depth--;
+         psymfile_depth--;
          continue;
 
-       case N_SYM_SYM:         /* Typedef or automatic variable. */
+       case N_SYM_SYM: /* Typedef or automatic variable. */
          namestring = bufp->n_strx;
-          p = (char *) strchr (namestring, ':');
-          if (!p)
-            continue;           /* Not a debugging symbol.   */
+         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
@@ -670,69 +693,74 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
 
          switch (p[1])
            {
-           case 'S' :
+           case 'S':
              {
                unsigned long valu;
-               enum language tmp_language;
+               enum language tmp_language;
                char *str, *p;
                int n;
-               
+
                valu = CUR_SYMBOL_VALUE;
                if (valu)
                  valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
                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, section_offsets,
-                                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;
+               p = strchr (namestring, ':');
+               if (p)
+                 n = p - namestring;
+               else
+                 n = strlen (namestring);
+               str = alloca (n + 1);
+               strncpy (str, namestring, n);
+               str[n] = '\0';
 
-/*
-                 if (pst && STREQ (str, pst->filename))
-                   continue;
+               if (psymfile_depth == 0)
                  {
-                   register int i;
-                   for (i = 0; i < includes_used; i++)
-                     if (STREQ (str, psymtab_include_list[i]))
-                       {
-                         i = -1; 
-                         break;
-                       }
-                   if (i == -1)
-                     continue;
+                   if (!pst)
+                     pst = os9k_start_psymtab (objfile, section_offsets,
+                                               str, valu,
+                                               cursymoffset,
+                                               symnum - 1,
+                                             objfile->global_psymbols.next,
+                                            objfile->static_psymbols.next);
                  }
-*/
-
-                  psymtab_include_list[includes_used++] = str;
-                  if (includes_used >= includes_allocated)
-                    {
-                      char **orig = psymtab_include_list;
+               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;
 
-                      psymtab_include_list = (char **)
-                         alloca ((includes_allocated *= 2) * sizeof (char *));
-                      memcpy ((PTR)psymtab_include_list, (PTR)orig,
-                          includes_used * sizeof (char *));
-                   }
+/*
+   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++;
+                 }
+               psymfile_depth++;
                continue;
              }
 
@@ -765,7 +793,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
                      add_psymbol_to_list (namestring, p - namestring,
                                           VAR_NAMESPACE, LOC_TYPEDEF,
                                           &objfile->static_psymbols,
-                                          CUR_SYMBOL_VALUE, 0, psymtab_language,
+                                     CUR_SYMBOL_VALUE, 0, psymtab_language,
                                           objfile);
                      p += 1;
                    }
@@ -775,14 +803,14 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
                     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,
+                                     CUR_SYMBOL_VALUE, 0, psymtab_language,
                                           objfile);
-                  }
+                   }
                }
              goto check_enum;
            case 't':
@@ -796,22 +824,22 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
                }
            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.  */
+                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> ","} ";".  */
+                <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.  */
+                in pairs like (0,26).  Skip over it.  */
              while ((*p >= '0' && *p <= '9')
                     || *p == '(' || *p == ',' || *p == ')'
                     || *p == '=')
@@ -820,7 +848,8 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
              if (*p++ == 'e')
                {
                  /* We have found an enumerated type. skip size */
-                 while (*p >= '0' && *p <= '9') p++;
+                 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.
@@ -830,17 +859,17 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
                      char *q;
 
                      /* Check for and handle cretinous dbx symbol name
-                        continuation! 
-                     if (*p == '\\')
-                       p = next_symbol_text (objfile);
-                     */
+                        continuation! 
+                        if (*p == '\\')
+                        p = next_symbol_text (objfile);
+                      */
 
                      /* Point to the character after the name
-                        of the enum constant.  */
+                        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.  */
+                        enum constants in psymtabs, just in symtabs.  */
                      add_psymbol_to_list (p, q - p,
                                           VAR_NAMESPACE, LOC_CONST,
                                           &objfile->static_psymbols, 0,
@@ -860,63 +889,63 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
              /* Constant, e.g. from "const" in Pascal.  */
              add_psymbol_to_list (namestring, p - namestring,
                                   VAR_NAMESPACE, LOC_CONST,
-                                  &objfile->static_psymbols, CUR_SYMBOL_VALUE,
+                               &objfile->static_psymbols, CUR_SYMBOL_VALUE,
                                   0, psymtab_language, objfile);
              continue;
 
            case 'f':
-             CUR_SYMBOL_VALUE += ANOFFSET(section_offsets, SECT_OFF_TEXT);
-              if (pst && pst->textlow == 0)
-                pst->textlow = CUR_SYMBOL_VALUE;
+             CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+             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,
+                               &objfile->static_psymbols, CUR_SYMBOL_VALUE,
                                   0, psymtab_language, objfile);
              continue;
 
            case 'F':
-             CUR_SYMBOL_VALUE += ANOFFSET(section_offsets, SECT_OFF_TEXT);
-              if (pst && pst->textlow == 0)
-                pst->textlow = CUR_SYMBOL_VALUE;
+             CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+             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,
+                               &objfile->global_psymbols, CUR_SYMBOL_VALUE,
                                   0, psymtab_language, objfile);
              continue;
 
            case 'p':
            case 'l':
-            case 's':
+           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.  */
+                (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 ':'.  */
+                /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.  */
+                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(section_offsets, SECT_OFF_TEXT);
+         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 #ifdef HANDLE_RBRAC
-         HANDLE_RBRAC(CUR_SYMBOL_VALUE);
+         HANDLE_RBRAC (CUR_SYMBOL_VALUE);
          continue;
 #endif
        case N_SYM_LBRAC:
@@ -937,22 +966,22 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
   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_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;
+      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);
+                       symnum, end_of_text_addr,
+                       dependency_list, dependencies_used);
     }
 /*
-  do_cleanups (back_to);
-*/
+   do_cleanups (back_to);
+ */
 }
 
 /* Allocate and partially fill a partial symtab.  It will be
@@ -965,7 +994,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
 
 static struct partial_symtab *
 os9k_start_psymtab (objfile, section_offsets,
-              filename, textlow, ldsymoff,ldsymcnt,  global_syms, static_syms)
+           filename, textlow, ldsymoff, ldsymcnt, global_syms, static_syms)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
      char *filename;
@@ -976,14 +1005,14 @@ os9k_start_psymtab (objfile, section_offsets,
      struct partial_symbol **static_syms;
 {
   struct partial_symtab *result =
-      start_psymtab_common(objfile, section_offsets,
-                          filename, textlow, global_syms, static_syms);
+  start_psymtab_common (objfile, section_offsets,
+                       filename, textlow, global_syms, static_syms);
 
   result->read_symtab_private = (char *)
-    obstack_alloc (&objfile -> psymbol_obstack, sizeof (struct symloc));
+    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
 
-  LDSYMOFF(result) = ldsymoff;
-  LDSYMCNT(result) = ldsymcnt;
+  LDSYMOFF (result) = ldsymoff;
+  LDSYMCNT (result) = ldsymcnt;
   result->read_symtab = os9k_psymtab_to_symtab;
 
   /* Deduce the source language from the filename for this psymtab. */
@@ -997,7 +1026,7 @@ os9k_start_psymtab (objfile, section_offsets,
 
 static struct partial_symtab *
 os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
-            capping_text, dependency_list, number_dependencies)
+                 capping_text, dependency_list, number_dependencies)
      struct partial_symtab *pst;
      char **include_list;
      int num_includes;
@@ -1009,10 +1038,10 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
 {
   int i;
   struct partial_symtab *p1;
-  struct objfile *objfile = pst -> objfile;
+  struct objfile *objfile = pst->objfile;
 
   if (capping_symbol_cnt != -1)
-      LDSYMCNT(pst) = capping_symbol_cnt - LDSYMCNT(pst);
+    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,
@@ -1037,45 +1066,49 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
      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.  */
+  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;
     }
-    last_function_name = NULL;
-  }
 
   /* this test will be true if the last .o file is only data */
   if (pst->textlow == 0)
@@ -1086,16 +1119,19 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
      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;
+  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.  */
 
@@ -1109,9 +1145,9 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
     {
       pst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+                   number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
-            number_dependencies * sizeof (struct partial_symtab *));
+             number_dependencies * sizeof (struct partial_symtab *));
     }
   else
     pst->dependencies = 0;
@@ -1119,19 +1155,19 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
   for (i = 0; i < num_includes; i++)
     {
       struct partial_symtab *subpst =
-       allocate_psymtab (include_list[i], objfile);
+      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;
+       (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.  */
+         shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
                       sizeof (struct partial_symtab *));
@@ -1140,8 +1176,8 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
 
       subpst->globals_offset =
        subpst->n_global_syms =
-         subpst->statics_offset =
-           subpst->n_static_syms = 0;
+       subpst->statics_offset =
+       subpst->n_static_syms = 0;
 
       subpst->readin = 0;
       subpst->symtab = 0;
@@ -1157,17 +1193,18 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
   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.  */
+      && 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);
+      discard_psymtab (pst);
 
-    pst = (struct partial_symtab *)NULL;
-  }
+      pst = (struct partial_symtab *) NULL;
+    }
   return pst;
 }
 \f
@@ -1177,14 +1214,14 @@ os9k_psymtab_to_symtab_1 (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);
+                         pst->filename);
       return;
     }
 
@@ -1200,13 +1237,13 @@ os9k_psymtab_to_symtab_1 (pst)
            fputs_filtered ("and ", gdb_stdout);
            wrap_here ("");
            printf_filtered ("%s...", pst->dependencies[i]->filename);
-           wrap_here ("");             /* Flush output */
+           wrap_here ("");     /* Flush output */
            gdb_flush (gdb_stdout);
          }
        os9k_psymtab_to_symtab_1 (pst->dependencies[i]);
       }
 
-  if (LDSYMCNT(pst))           /* Otherwise it's a dummy */
+  if (LDSYMCNT (pst))          /* Otherwise it's a dummy */
     {
       /* Init stuff necessary for reading in symbols */
       stabsread_init ();
@@ -1237,14 +1274,14 @@ os9k_psymtab_to_symtab (pst)
   if (pst->readin)
     {
       fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in.  Shouldn't happen.\n",
-              pst->filename);
+                         pst->filename);
       return;
     }
 
-  if (LDSYMCNT(pst) || pst->number_of_dependencies)
+  if (LDSYMCNT (pst) || pst->number_of_dependencies)
     {
       /* Print the message now, before reading the string table,
-        to avoid disconcerting pauses.  */
+         to avoid disconcerting pauses.  */
       if (info_verbose)
        {
          printf_filtered ("Reading in symbols for %s...", pst->filename);
@@ -1281,8 +1318,8 @@ os9k_read_ofile_symtab (pst)
   FILE *dbg_file;
 
   objfile = pst->objfile;
-  sym_offset = LDSYMOFF(pst);
-  max_symnum = LDSYMCNT(pst);
+  sym_offset = LDSYMOFF (pst);
+  max_symnum = LDSYMCNT (pst);
   text_offset = pst->textlow;
   text_size = pst->texthigh - pst->textlow;
   section_offsets = pst->section_offsets;
@@ -1300,10 +1337,10 @@ os9k_read_ofile_symtab (pst)
      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)
+  if (!processing_acc_compilation && sym_offset >= (int) symbol_size)
     {
       fseek (objefile->auxf2, sym_offset, SEEK_CUR);
-      fill_sym(objfile->auxf2, abfd);
+      fill_sym (objfile->auxf2, abfd);
       bufp = symbuf;
 
       processing_gcc_compilation = 0;
@@ -1316,7 +1353,7 @@ os9k_read_ofile_symtab (pst)
        }
 
       /* Try to select a C++ demangling based on the compilation unit
-        producer. */
+         producer. */
 
       if (processing_gcc_compilation)
        {
@@ -1329,33 +1366,34 @@ os9k_read_ofile_symtab (pst)
   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.  */
+         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);
+  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");
-*/
+   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);
+      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, section_offsets, objfile);
+      os9k_process_one_symbol ((int) type, (int) bufp->n_desc,
+        (CORE_ADDR) bufp->n_value, bufp->n_strx, 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)
+      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
@@ -1373,9 +1411,10 @@ os9k_read_ofile_symtab (pst)
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
        }
-      else if (type & N_EXT || type == (unsigned char)N_TEXT
-              || type == (unsigned char)N_NBTEXT
-              ) {
+      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
@@ -1386,7 +1425,7 @@ os9k_read_ofile_symtab (pst)
             be satisfied in each file as it appears. So we skip this
             section. */
          ;
-        }
+       }
 #endif /* 0 */
     }
 
@@ -1400,8 +1439,8 @@ os9k_read_ofile_symtab (pst)
   pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT);
   end_stabs ();
 }
-
 \f
+
 /* This handles a single symbol from the symbol-file, building symbols
    into a GDB symtab.  It takes these arguments and an implicit argument.
 
@@ -1410,11 +1449,11 @@ os9k_read_ofile_symtab (pst)
    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.
+   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.  */
+   It is used in end_symtab.  */
 
 static void
 os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
@@ -1432,12 +1471,12 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 #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)
+  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 ().  */
+         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 */
@@ -1446,20 +1485,20 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
     {
     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); 
+         N_SO, the linker did not relocate them (sigh).  */
+      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
       new = push_context (desc, valu);
       break;
 
     case N_SYM_RBRAC:
-      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); 
-      new = pop_context();
+      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+      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))
+      if (!OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
        local_symbols = new->locals;
 
       if (context_stack_depth > 1)
@@ -1473,7 +1512,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          if (local_symbols != NULL)
            {
              /* Muzzle a compiler bug that makes end < start.  (which
-                compilers?  Is this ever harmful?).  */
+                compilers?  Is this ever harmful?).  */
              if (new->start_addr > valu)
                {
                  complain (&lbrac_rbrac_complaint);
@@ -1491,23 +1530,26 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
              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);
+                           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;
+             if (!new->locals)
+               new->locals = local_symbols;
+             else
+               {
+                 struct pending *p;
 
-               p = new->locals;
-               while (p->next) p = p->next; 
-               p->next = local_symbols;
-             }
+                 p = new->locals;
+                 while (p->next)
+                   p = p->next;
+                 p->next = local_symbols;
+               }
            }
        }
 
-      if (OS9K_VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
+      if (OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
        /* Now pop locals of block just finished.  */
        local_symbols = new->locals;
       break;
@@ -1515,16 +1557,16 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
     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. */
+         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); 
+      valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
       /* FIXME: loses if sizeof (char *) > sizeof (int) */
-      record_line (current_subfile, (int)name, valu);
+      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.  */
+      /* 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)
@@ -1541,35 +1583,42 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          switch (deftype)
            {
            case 'S':
-             valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-             n = strrchr(name, '/');
-             if (n != NULL) {
-               *n = '\0';
-               n++;
-               dirn = name;
-             } else {
-               n = name;
-               dirn = NULL;
-             }
+             valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+             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);
-                 end_stabs ();
+             if (symfile_depth++ == 0)
+               {
+                 if (last_source_file)
+                   {
+                     end_symtab (valu, objfile, SECT_OFF_TEXT);
+                     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);
                }
-               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);
+             valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
              function_stab_type = type;
 
              within_function = 1;
@@ -1579,7 +1628,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 
            case 'V':
            case 'v':
-              valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
+             valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
              define_symbol (valu, name, desc, type, objfile);
              break;
 
@@ -1591,13 +1640,13 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       break;
 
     case N_SYM_SE:
-       if (--symfile_depth != 0)
-         start_subfile(pop_subfile(), current_subfile->dirname);
+      if (--symfile_depth != 0)
+       start_subfile (pop_subfile (), current_subfile->dirname);
       break;
 
     default:
       complain (&unknown_symtype_complaint,
-               local_hex_string((unsigned long) type));
+               local_hex_string ((unsigned long) type));
       /* FALLTHROUGH */
       break;
 
@@ -1610,17 +1659,17 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
 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 */
+  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 */
+                       /* sym_offsets: parse user's offsets to internal form */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
 _initialize_os9kread ()
 {
-  add_symtab_fns(&os9k_sym_fns);
+  add_symtab_fns (&os9k_sym_fns);
 }
index 31c9bf998935236ba073d47e17df701d17e8bbbb..753960852039bb033e70cc9c8bf2978c5c86f3cf 100644 (file)
@@ -1,21 +1,22 @@
 /* Handle OSF/1 shared libraries for GDB, the GNU Debugger.
    Copyright 1993, 94, 95, 96, 98, 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 file is part of GDB.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is free software; you can 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.
 
-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 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.  */
 
 /* FIXME: Most of this code could be merged with solib.c by using
    next_link_map_member and xfer_link_map_member in solib.c.  */
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "language.h"
 #include "gdbcmd.h"
 
-#define MAX_PATH_SIZE 1024             /* FIXME: Should be dynamic */
+#define MAX_PATH_SIZE 1024     /* FIXME: Should be dynamic */
 
 /* When handling shared libraries, GDB has to find out the pathnames
    of all shared libraries that are currently loaded (to read in their
@@ -50,16 +51,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
    Under OSF/1 there are two possibilities to get at this information:
    1) Peek around in the runtime loader structures.
-      These are not documented, and they are not defined in the system
-      header files. The definitions below were obtained by experimentation,
-      but they seem stable enough.
+   These are not documented, and they are not defined in the system
+   header files. The definitions below were obtained by experimentation,
+   but they seem stable enough.
    2) Use the undocumented libxproc.a library, which contains the
-      equivalent ldr_* routines.
-      This approach is somewhat cleaner, but it requires that the GDB
-      executable is dynamically linked. In addition it requires a
-      NAT_CLIBS= -lxproc -Wl,-expect_unresolved,ldr_process_context
-      linker specification for GDB and all applications that are using
-      libgdb.
+   equivalent ldr_* routines.
+   This approach is somewhat cleaner, but it requires that the GDB
+   executable is dynamically linked. In addition it requires a
+   NAT_CLIBS= -lxproc -Wl,-expect_unresolved,ldr_process_context
+   linker specification for GDB and all applications that are using
+   libgdb.
    We will use the peeking approach until it becomes unwieldy.  */
 
 #ifndef USE_LDR_ROUTINES
@@ -68,37 +69,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define RLD_CONTEXT_ADDRESS    0x3ffc0000000
 
 typedef struct
-{
-       CORE_ADDR next;
-       CORE_ADDR previous;
-       CORE_ADDR unknown1;
-       char *module_name;
-       CORE_ADDR modinfo_addr;
-       long module_id;
-       CORE_ADDR unknown2;
-       CORE_ADDR unknown3;
-       long region_count;
-       CORE_ADDR regioninfo_addr;
-} ldr_module_info_t;
+  {
+    CORE_ADDR next;
+    CORE_ADDR previous;
+    CORE_ADDR unknown1;
+    char *module_name;
+    CORE_ADDR modinfo_addr;
+    long module_id;
+    CORE_ADDR unknown2;
+    CORE_ADDR unknown3;
+    long region_count;
+    CORE_ADDR regioninfo_addr;
+  }
+ldr_module_info_t;
 
 typedef struct
-{
-       long unknown1;
-       CORE_ADDR regionname_addr;
-       long protection;
-       CORE_ADDR vaddr;
-       CORE_ADDR mapaddr;
-       long size;
-       long unknown2[5];
-} ldr_region_info_t;
+  {
+    long unknown1;
+    CORE_ADDR regionname_addr;
+    long protection;
+    CORE_ADDR vaddr;
+    CORE_ADDR mapaddr;
+    long size;
+    long unknown2[5];
+  }
+ldr_region_info_t;
 
 typedef struct
-{
-       CORE_ADDR unknown1;
-       CORE_ADDR unknown2;
-       CORE_ADDR head;
-       CORE_ADDR tail;
-} ldr_context_t;
+  {
+    CORE_ADDR unknown1;
+    CORE_ADDR unknown2;
+    CORE_ADDR head;
+    CORE_ADDR tail;
+  }
+ldr_context_t;
 
 static ldr_context_t ldr_context;
 
@@ -125,7 +129,7 @@ ldr_read_memory (memaddr, myaddr, len, readstring)
     {
       target_read_string (memaddr, &buffer, len, &result);
       if (result == 0)
-        strcpy (myaddr, buffer);
+       strcpy (myaddr, buffer);
       free (buffer);
     }
   else
@@ -141,34 +145,36 @@ ldr_read_memory (memaddr, myaddr, len, readstring)
 /* Define our own link_map structure.
    This will help to share code with solib.c.  */
 
-struct link_map {
-  CORE_ADDR l_offset;                  /* prelink to load address offset */
-  char *l_name;                                /* full name of loaded object */
+struct link_map
+{
+  CORE_ADDR l_offset;          /* prelink to load address offset */
+  char *l_name;                        /* full name of loaded object */
   ldr_module_info_t module_info;       /* corresponding module info */
 };
 
 #define LM_OFFSET(so) ((so) -> lm.l_offset)
 #define LM_NAME(so) ((so) -> lm.l_name)
 
-struct so_list {
-  struct so_list *next;                        /* next structure in linked list */
-  struct link_map lm;                  /* copy of link map from inferior */
-  struct link_map *lmaddr;             /* addr in inferior lm was read from */
-  CORE_ADDR lmend;                     /* upper addr bound of mapped object */
-  char so_name[MAX_PATH_SIZE];         /* shared object lib name (FIXME) */
-  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;
-};
+struct so_list
+  {
+    struct so_list *next;      /* next structure in linked list */
+    struct link_map lm;                /* copy of link map from inferior */
+    struct link_map *lmaddr;   /* addr in inferior lm was read from */
+    CORE_ADDR lmend;           /* upper addr bound of mapped object */
+    char so_name[MAX_PATH_SIZE];       /* shared object lib name (FIXME) */
+    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 */
 
 extern int
-fdmatch PARAMS ((int, int));           /* In libiberty */
+fdmatch PARAMS ((int, int));   /* In libiberty */
 
 /* Local function prototypes */
 
@@ -182,13 +188,13 @@ static int
 symbol_add_stub PARAMS ((char *));
 
 static struct so_list *
-find_solib PARAMS ((struct so_list *));
+  find_solib PARAMS ((struct so_list *));
 
 static struct link_map *
-first_link_map_member PARAMS ((void));
+  first_link_map_member PARAMS ((void));
 
 static struct link_map *
-next_link_map_member PARAMS ((struct so_list *));
+  next_link_map_member PARAMS ((struct so_list *));
 
 static void
 xfer_link_map_member PARAMS ((struct so_list *, struct link_map *));
@@ -198,29 +204,29 @@ solib_map_sections PARAMS ((char *));
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       solib_map_sections -- open bfd and build sections for shared lib
+   solib_map_sections -- open bfd and build sections for shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int solib_map_sections (struct so_list *so)
+   static int solib_map_sections (struct so_list *so)
 
-DESCRIPTION
+   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.
+   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
+   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?).
+   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
@@ -234,10 +240,10 @@ solib_map_sections (arg)
   struct section_table *p;
   struct cleanup *old_chain;
   bfd *abfd;
-  
-  filename = tilde_expand (so -> so_name);
+
+  filename = tilde_expand (so->so_name);
   old_chain = make_cleanup (free, filename);
-  
+
   scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
                        &scratch_pathname);
   if (scratch_chan < 0)
@@ -259,31 +265,31 @@ solib_map_sections (arg)
             scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
   /* Leave bfd open, core_xfer_memory and "info files" need it.  */
-  so -> abfd = abfd;
-  abfd -> cacheable = true;
+  so->abfd = abfd;
+  abfd->cacheable = true;
 
   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))
+  if (build_section_table (abfd, &so->sections, &so->sections_end))
     {
-      error ("Can't find the file sections in `%s': %s", 
+      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++)
+  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"))
+         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;
+         so->textsection = p;
        }
     }
 
@@ -295,20 +301,20 @@ solib_map_sections (arg)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       first_link_map_member -- locate first member in dynamic linker's map
+   first_link_map_member -- locate first member in dynamic linker's map
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct link_map *first_link_map_member (void)
+   static struct link_map *first_link_map_member (void)
 
-DESCRIPTION
+   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 copy in our address space.
-*/
+   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 copy in our address space.
+ */
 
 static struct link_map *
 first_link_map_member ()
@@ -324,11 +330,11 @@ first_link_map_member ()
   ldr_set_core_reader (ldr_read_memory);
   ldr_xdetach (fake_ldr_process);
   if (ldr_xattach (fake_ldr_process) != 0
-      || ldr_next_module(fake_ldr_process, &mod_id) != 0
+      || ldr_next_module (fake_ldr_process, &mod_id) != 0
       || mod_id == LDR_NULL_MODULE
-      || ldr_inq_module(fake_ldr_process, mod_id,
-                       &first_lm.module_info, sizeof(ldr_module_info_t),
-                       &retsize) != 0)
+      || ldr_inq_module (fake_ldr_process, mod_id,
+                        &first_lm.module_info, sizeof (ldr_module_info_t),
+                        &retsize) != 0)
     return lm;
 #else
   CORE_ADDR ldr_context_addr;
@@ -363,11 +369,11 @@ next_link_map_member (so_list_ptr)
   ldr_module_t mod_id = so_list_ptr->lm.module_info.lmi_modid;
   size_t retsize;
 
-  if (ldr_next_module(fake_ldr_process, &mod_id) != 0
+  if (ldr_next_module (fake_ldr_process, &mod_id) != 0
       || mod_id == LDR_NULL_MODULE
-      || ldr_inq_module(fake_ldr_process, mod_id,
-                       &next_lm.module_info, sizeof(ldr_module_info_t),
-                       &retsize) != 0)
+      || ldr_inq_module (fake_ldr_process, mod_id,
+                        &next_lm.module_info, sizeof (ldr_module_info_t),
+                        &retsize) != 0)
     return lm;
 
   lm = &next_lm;
@@ -440,7 +446,7 @@ xfer_link_map_member (so_list_ptr, lm)
                              &retsize) != 0)
            break;
          region_offset = (CORE_ADDR) region_info.lri_mapaddr
-                         - (CORE_ADDR) region_info.lri_vaddr;
+           - (CORE_ADDR) region_info.lri_vaddr;
          if (i == 0)
            LM_OFFSET (so_list_ptr) = region_offset;
          else if (LM_OFFSET (so_list_ptr) != region_offset)
@@ -465,7 +471,7 @@ xfer_link_map_member (so_list_ptr, lm)
          CORE_ADDR region_offset;
 
          if (target_read_memory (lm->module_info.regioninfo_addr
-                                  + i * sizeof (region_info),
+                                 + i * sizeof (region_info),
                                  (char *) &region_info,
                                  sizeof (region_info)) != 0)
            break;
@@ -482,7 +488,7 @@ xfer_link_map_member (so_list_ptr, lm)
              else
                region_name = "??";
              warning ("cannot handle shared library relocation for %s (%s)",
-                       so_list_ptr->so_name, region_name);
+                      so_list_ptr->so_name, region_name);
              free (buffer);
            }
        }
@@ -496,25 +502,25 @@ xfer_link_map_member (so_list_ptr, lm)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       find_solib -- step through list of shared objects
+   find_solib -- step through list of shared objects
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct so_list *find_solib (struct so_list *so_list_ptr)
+   struct so_list *find_solib (struct so_list *so_list_ptr)
 
-DESCRIPTION
+   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.
+   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.
 
-       The arg and return value are "struct link_map" pointers, as defined
-       in <link.h>.
+   The arg and return value are "struct link_map" pointers, as defined
+   in <link.h>.
  */
 
 static struct so_list *
@@ -524,7 +530,7 @@ find_solib (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. */
@@ -537,27 +543,27 @@ find_solib (so_list_ptr)
   else
     {
       /* We have been called before, and are in the process of walking
-        the shared library list.  Advance to the next shared object. */
+         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;
+      so_list_next = so_list_ptr->next;
     }
   if ((so_list_next == NULL) && (lm != NULL))
     {
       /* Get next link map structure from inferior image and build a local
-        abbreviated load_map structure */
+         abbreviated load_map structure */
       new = (struct so_list *) xmalloc (sizeof (struct so_list));
       memset ((char *) new, 0, sizeof (struct so_list));
-      new -> lmaddr = lm;
+      new->lmaddr = lm;
       /* Add the new node as the next node in the list, or as the root
-        node if this is the first one. */
+         node if this is the first one. */
       if (so_list_ptr != NULL)
        {
-         so_list_ptr -> next = new;
+         so_list_ptr->next = new;
        }
       else
        {
          so_list_head = new;
-       }      
+       }
       so_list_next = new;
       xfer_link_map_member (new, lm);
     }
@@ -570,54 +576,54 @@ static int
 symbol_add_stub (arg)
      char *arg;
 {
-  register struct so_list *so = (struct so_list *) arg;        /* catch_errs bogon */
+  register struct so_list *so = (struct so_list *) arg;                /* catch_errs bogon */
   CORE_ADDR text_addr = 0;
 
-  if (so -> textsection)
-    text_addr = so -> textsection -> addr;
-  else if (so -> abfd != NULL)
+  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.  */
+         text_addr so that the relocation in symbol_file_add does no harm.  */
 
-      lowest_sect = bfd_get_section_by_name (so -> abfd, ".text");
+      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);
+       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);
+       text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
     }
-  
-  so -> objfile = symbol_file_add (so -> so_name, so -> from_tty,
-                                  text_addr,
-                                  0, 0, 0, 0, 1);
+
+  so->objfile = symbol_file_add (so->so_name, so->from_tty,
+                                text_addr,
+                                0, 0, 0, 0, 1);
   return (1);
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_add -- add a shared library file to the symtab and section list
+   solib_add -- add a shared library file to the symtab and section list
 
-SYNOPSIS
+   SYNOPSIS
 
-       void solib_add (char *arg_string, int from_tty,
-                       struct target_ops *target)
+   void solib_add (char *arg_string, int from_tty,
+   struct target_ops *target)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 void
 solib_add (arg_string, from_tty, target)
      char *arg_string;
      int from_tty;
      struct target_ops *target;
-{      
-  register struct so_list *so = NULL;          /* link map state variable */
+{
+  register struct so_list *so = NULL;  /* link map state variable */
 
   /* Last shared library that we read.  */
   struct so_list *so_last = NULL;
@@ -625,13 +631,13 @@ solib_add (arg_string, from_tty, target)
   char *re_err;
   int count;
   int old;
-  
+
   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)
@@ -641,12 +647,12 @@ solib_add (arg_string, from_tty, target)
       count = 0;
       while ((so = find_solib (so)) != NULL)
        {
-         if (so -> so_name[0])
+         if (so->so_name[0])
            {
-             count += so -> sections_end - so -> sections;
+             count += so->sections_end - so->sections;
            }
        }
-      
+
       if (count)
        {
          int update_coreops;
@@ -655,23 +661,23 @@ solib_add (arg_string, from_tty, target)
             here, otherwise we dereference a potential dangling pointer
             for each call to target_read/write_memory within this routine.  */
          update_coreops = core_ops.to_sections == target->to_sections;
-            
+
          /* Reallocate the target's section table including the new size.  */
-         if (target -> to_sections)
+         if (target->to_sections)
            {
-             old = target -> to_sections_end - target -> to_sections;
-             target -> to_sections = (struct section_table *)
-               xrealloc ((char *)target -> to_sections,
-                        (sizeof (struct section_table)) * (count + old));
+             old = target->to_sections_end - target->to_sections;
+             target->to_sections = (struct section_table *)
+               xrealloc ((char *) target->to_sections,
+                         (sizeof (struct section_table)) * (count + old));
            }
          else
            {
              old = 0;
-             target -> to_sections = (struct section_table *)
+             target->to_sections = (struct section_table *)
                xmalloc ((sizeof (struct section_table)) * count);
            }
-         target -> to_sections_end = target -> to_sections + (count + old);
-         
+         target->to_sections_end = target->to_sections + (count + old);
+
          /* Update the to_sections field in the core_ops structure
             if needed.  */
          if (update_coreops)
@@ -683,30 +689,30 @@ solib_add (arg_string, from_tty, target)
          /* Add these section table entries to the target's table.  */
          while ((so = find_solib (so)) != NULL)
            {
-             if (so -> so_name[0])
+             if (so->so_name[0])
                {
-                 count = so -> sections_end - so -> sections;
-                 memcpy ((char *) (target -> to_sections + old),
-                         so -> sections, 
+                 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.  */
   so = NULL;
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0] && re_exec (so -> so_name))
+      if (so->so_name[0] && re_exec (so->so_name))
        {
-         so -> from_tty = from_tty;
-         if (so -> symbols_loaded)
+         so->from_tty = from_tty;
+         if (so->symbols_loaded)
            {
              if (from_tty)
                {
-                 printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name);
+                 printf_unfiltered ("Symbols already loaded for %s\n", so->so_name);
                }
            }
          else if (catch_errors
@@ -715,7 +721,7 @@ solib_add (arg_string, from_tty, target)
                    RETURN_MASK_ALL))
            {
              so_last = so;
-             so -> symbols_loaded = 1;
+             so->symbols_loaded = 1;
            }
        }
     }
@@ -728,28 +734,28 @@ solib_add (arg_string, from_tty, target)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       info_sharedlibrary_command -- code for "info sharedlibrary"
+   info_sharedlibrary_command -- code for "info sharedlibrary"
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void info_sharedlibrary_command ()
+   static void info_sharedlibrary_command ()
 
-DESCRIPTION
+   DESCRIPTION
 
-       Walk through the shared library list and print information
-       about each attached library.
-*/
+   Walk through the shared library list and print information
+   about each attached library.
+ */
 
 static void
 info_sharedlibrary_command (ignore, from_tty)
      char *ignore;
      int from_tty;
 {
-  register struct so_list *so = NULL;          /* link map state variable */
+  register struct so_list *so = NULL;  /* link map state variable */
   int header_done = 0;
-  
+
   if (exec_bfd == NULL)
     {
       printf_unfiltered ("No exec file.\n");
@@ -757,70 +763,70 @@ info_sharedlibrary_command (ignore, from_tty)
     }
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0])
+      if (so->so_name[0])
        {
          unsigned long txt_start = 0;
          unsigned long txt_end = 0;
 
          if (!header_done)
            {
-             printf_unfiltered("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
-                    "Shared Object Library");
+             printf_unfiltered ("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
+                                "Shared Object Library");
              header_done++;
            }
-         if (so -> textsection)
+         if (so->textsection)
            {
-             txt_start = (unsigned long) so -> textsection -> addr;
-             txt_end = (unsigned long) so -> textsection -> endaddr;
+             txt_start = (unsigned long) so->textsection->addr;
+             txt_end = (unsigned long) so->textsection->endaddr;
            }
          printf_unfiltered ("%-20s", local_hex_string_custom (txt_start, "08l"));
          printf_unfiltered ("%-20s", local_hex_string_custom (txt_end, "08l"));
-         printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No");
-         printf_unfiltered ("%s\n",  so -> so_name);
+         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");        
+      printf_unfiltered ("No shared libraries loaded at this time.\n");
     }
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_address -- check to see if an address is in a shared lib
+   solib_address -- check to see if an address is in a shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       char *solib_address (CORE_ADDR address)
+   char *solib_address (CORE_ADDR address)
 
-DESCRIPTION
+   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.
+   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.
+   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 (address)
      CORE_ADDR address;
 {
-  register struct so_list *so = 0;     /* link map state variable */
-  
+  register struct so_list *so = 0;     /* link map state variable */
+
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0] && so -> textsection)
+      if (so->so_name[0] && so->textsection)
        {
-         if ((address >= (CORE_ADDR) so -> textsection -> addr) &&
-             (address < (CORE_ADDR) so -> textsection -> endaddr))
+         if ((address >= (CORE_ADDR) so->textsection->addr) &&
+             (address < (CORE_ADDR) so->textsection->endaddr))
            return (so->so_name);
        }
     }
@@ -829,24 +835,24 @@ solib_address (address)
 
 /* Called by free_all_symtabs */
 
-void 
-clear_solib()
+void
+clear_solib ()
 {
   struct so_list *next;
   char *bfd_filename;
-  
+
   disable_breakpoints_in_shlibs (1);
 
   while (so_list_head)
     {
-      if (so_list_head -> sections)
+      if (so_list_head->sections)
        {
-         free ((PTR)so_list_head -> sections);
+         free ((PTR) so_list_head->sections);
        }
-      if (so_list_head -> abfd)
+      if (so_list_head->abfd)
        {
-         bfd_filename = bfd_get_filename (so_list_head -> abfd);
-         if (!bfd_close (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 ()));
        }
@@ -854,52 +860,52 @@ clear_solib()
        /* This happens for the executable on SVR4.  */
        bfd_filename = NULL;
 
-      next = so_list_head -> next;
+      next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR)bfd_filename);
-      free ((PTR)so_list_head);
+       free ((PTR) bfd_filename);
+      free ((PTR) so_list_head);
       so_list_head = next;
     }
 }
-  
+
 /*
-  
-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 a statically bound executable, this first instruction is the
-       one at "_start", or a similar text label. No further processing is
-       needed in that case.
-       For a dynamically bound executable, this first instruction is somewhere
-       in the rld, and the actual user executable is not yet mapped in.
-       We continue the inferior again, rld then maps in the actual user
-       executable and any needed shared libraries and then sends
-       itself a SIGTRAP.
-       At that point we discover the names of all shared libraries and
-       read their symbols in.
-
-FIXME
-
-       This code does not properly handle hitting breakpoints which the
-       user might have set in the rld itself.  Proper handling would have
-       to check if the SIGTRAP happened due to a kill call.
-
-       Also, what if child has exit()ed?  Must exit loop somehow.
 */
+
+   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 a statically bound executable, this first instruction is the
+   one at "_start", or a similar text label. No further processing is
+   needed in that case.
+   For a dynamically bound executable, this first instruction is somewhere
+   in the rld, and the actual user executable is not yet mapped in.
+   We continue the inferior again, rld then maps in the actual user
+   executable and any needed shared libraries and then sends
+   itself a SIGTRAP.
+   At that point we discover the names of all shared libraries and
+   read their symbols in.
+
+   FIXME
+
+   This code does not properly handle hitting breakpoints which the
+   user might have set in the rld itself.  Proper handling would have
+   to check if the SIGTRAP happened due to a kill call.
+
+   Also, what if child has exit()ed?  Must exit loop somehow.
+ */
 
 void
-solib_create_inferior_hook()
+solib_create_inferior_hook ()
 {
 
   /* Nothing to do for statically bound executables.  */
@@ -913,7 +919,7 @@ solib_create_inferior_hook()
      which point all of the libraries will have been mapped in and we
      can go groveling around in the rld structures to find
      out what we need to know about them. */
+
   clear_proceed_status ();
   stop_soon_quietly = 1;
   stop_signal = TARGET_SIGNAL_0;
@@ -925,11 +931,11 @@ solib_create_inferior_hook()
   while (stop_signal != TARGET_SIGNAL_TRAP);
 
   /*  solib_add will call reinit_frame_cache.
-      But we are stopped in the runtime loader and we do not have symbols
-      for the runtime loader. So heuristic_proc_start will be called
-      and will put out an annoying warning.
-      Delaying the resetting of stop_soon_quietly until after symbol loading
-      suppresses the warning.  */
+     But we are stopped in the runtime loader and we do not have symbols
+     for the runtime loader. So heuristic_proc_start will be called
+     and will put out an annoying warning.
+     Delaying the resetting of stop_soon_quietly until after symbol loading
+     suppresses the warning.  */
   if (auto_solib_add)
     solib_add ((char *) 0, 0, (struct target_ops *) 0);
   stop_soon_quietly = 0;
@@ -938,33 +944,33 @@ solib_create_inferior_hook()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       sharedlibrary_command -- handle command to explicitly add library
+   sharedlibrary_command -- handle command to explicitly add library
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void sharedlibrary_command (char *args, int from_tty)
+   static void sharedlibrary_command (char *args, int from_tty)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 static void
 sharedlibrary_command (args, from_tty)
-char *args;
-int from_tty;
+     char *args;
+     int from_tty;
 {
   dont_repeat ();
   solib_add (args, from_tty, (struct target_ops *) 0);
 }
 
 void
-_initialize_solib()
+_initialize_solib ()
 {
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           "Load shared object library symbols for files matching REGEXP.");
-  add_info ("sharedlibrary", info_sharedlibrary_command, 
+  add_info ("sharedlibrary", info_sharedlibrary_command,
            "Status of loaded shared object libraries.");
 
   add_show_from_set
index 86267ea6730061f6091d3106c8ddf4cbfbccddcf..9876817b6df8ae5b9127f89cb23bc65aea61f23c 100644 (file)
@@ -3,21 +3,22 @@
    Modified from expread.y by the Department of Computer Science at the
    State University of New York at Buffalo, 1991.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Parse an expression from text in a string,
    and return the result as a  struct expression  pointer.
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    What is important here is that it can be built up sequentially
    during the process of parsing; the lower levels of the tree always
    come first in the result.  */
-   
+
 #include <ctype.h>
 
 #include "defs.h"
@@ -41,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "language.h"
 #include "parser-defs.h"
 #include "gdbcmd.h"
-#include "symfile.h"   /* for overlay functions */
+#include "symfile.h"           /* for overlay functions */
 \f
 /* Global variables declared in parser-defs.h (and commented there).  */
 struct expression *expout;
@@ -104,7 +105,7 @@ target_map_name_to_register (str, len)
      systems standard names can be context dependent (eg. $pc on a 
      multiprocessor can be could be any of several PCs).  */
 #ifdef REGISTER_NAME_ALIAS_HOOK
-  i =  REGISTER_NAME_ALIAS_HOOK (str, len);
+  i = REGISTER_NAME_ALIAS_HOOK (str, len);
   if (i >= 0)
     return i;
 #endif
@@ -153,7 +154,7 @@ end_arglist ()
   register struct funcall *call = funcall_chain;
   funcall_chain = call->next;
   arglist_len = call->arglist_len;
-  free ((PTR)call);
+  free ((PTR) call);
   return val;
 }
 
@@ -168,7 +169,7 @@ free_funcalls ()
   for (call = funcall_chain; call; call = next)
     {
       next = call->next;
-      free ((PTR)call);
+      free ((PTR) call);
     }
 }
 \f
@@ -403,11 +404,11 @@ write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
   if (overlay_debugging)
     addr = symbol_overlayed_address (addr, SYMBOL_BFD_SECTION (msymbol));
   write_exp_elt_longcst ((LONGEST) addr);
-                                               
+
   write_exp_elt_opcode (OP_LONG);
 
   write_exp_elt_opcode (UNOP_MEMVAL);
-  switch (msymbol -> type)
+  switch (msymbol->type)
     {
     case mst_text:
     case mst_file_text:
@@ -431,26 +432,26 @@ write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
 \f
 /* Recognize tokens that start with '$'.  These include:
 
-       $regname        A native register name or a "standard
-                       register name".
+   $regname     A native register name or a "standard
+   register name".
 
-       $variable       A convenience variable with a name chosen
-                       by the user.
+   $variable    A convenience variable with a name chosen
+   by the user.
 
-       $digits         Value history with index <digits>, starting
-                       from the first value which has index 1.
+   $digits              Value history with index <digits>, starting
+   from the first value which has index 1.
 
-       $$digits        Value history with index <digits> relative
-                       to the last value.  I.E. $$0 is the last
-                       value, $$1 is the one previous to that, $$2
-                       is the one previous to $$1, etc.
+   $$digits     Value history with index <digits> relative
+   to the last value.  I.E. $$0 is the last
+   value, $$1 is the one previous to that, $$2
+   is the one previous to $$1, etc.
 
-       $ | $0 | $$0    The last value in the value history.
+   $ | $0 | $$0 The last value in the value history.
 
-       $$              An abbreviation for the second to the last
-                       value in the value history, I.E. $$1
+   $$           An abbreviation for the second to the last
+   value in the value history, I.E. $$1
 
  */
+ */
 
 void
 write_dollar_variable (str)
@@ -459,8 +460,8 @@ write_dollar_variable (str)
   /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
      and $$digits (equivalent to $<-digits> if you could type that). */
 
-  struct symbol * sym = NULL;
-  struct minimal_symbol * msym = NULL;
+  struct symbol *sym = NULL;
+  struct minimal_symbol *msym = NULL;
 
   int negate = 0;
   int i = 1;
@@ -474,7 +475,7 @@ write_dollar_variable (str)
   if (i == str.length)
     {
       /* Just dollars (one or two) */
-      i = - negate;
+      i = -negate;
       goto handle_last;
     }
   /* Is the rest of the token digits?  */
@@ -485,14 +486,14 @@ write_dollar_variable (str)
     {
       i = atoi (str.ptr + 1 + negate);
       if (negate)
-       i = - i;
+       i = -i;
       goto handle_last;
     }
-  
+
   /* Handle tokens that refer to machine registers:
      $ followed by a register name.  */
-  i = target_map_name_to_register( str.ptr + 1, str.length - 1 );
-  if( i >= 0 )
+  i = target_map_name_to_register (str.ptr + 1, str.length - 1);
+  if (i >= 0)
     goto handle_register;
 
   /* On HP-UX, certain system routines (millicode) have names beginning
@@ -500,11 +501,11 @@ write_dollar_variable (str)
      calls on PA-RISC. Check for those, first. */
 
   sym = lookup_symbol (copy_name (str), (struct block *) NULL,
-                       VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
+                      VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
   if (sym)
     {
       write_exp_elt_opcode (OP_VAR_VALUE);
-      write_exp_elt_block (block_found); /* set by lookup_symbol */
+      write_exp_elt_block (block_found);       /* set by lookup_symbol */
       write_exp_elt_sym (sym);
       write_exp_elt_opcode (OP_VAR_VALUE);
       return;
@@ -513,26 +514,26 @@ write_dollar_variable (str)
   if (msym)
     {
       write_exp_msymbol (msym,
-                         lookup_function_type (builtin_type_int),
-                         builtin_type_int);
+                        lookup_function_type (builtin_type_int),
+                        builtin_type_int);
       return;
     }
-  
+
   /* Any other names starting in $ are debugger internal variables.  */
 
   write_exp_elt_opcode (OP_INTERNALVAR);
   write_exp_elt_intern (lookup_internalvar (copy_name (str) + 1));
-  write_exp_elt_opcode (OP_INTERNALVAR); 
+  write_exp_elt_opcode (OP_INTERNALVAR);
   return;
- handle_last:
+handle_last:
   write_exp_elt_opcode (OP_LAST);
   write_exp_elt_longcst ((LONGEST) i);
   write_exp_elt_opcode (OP_LAST);
   return;
- handle_register:
+handle_register:
   write_exp_elt_opcode (OP_REGISTER);
   write_exp_elt_longcst (i);
-  write_exp_elt_opcode (OP_REGISTER); 
+  write_exp_elt_opcode (OP_REGISTER);
   return;
 }
 
@@ -560,20 +561,21 @@ write_dollar_variable (str)
 
    Callers must free memory allocated for the output string TOKEN.  */
 
-static const char coloncolon[2] = {':',':'};
+static const char coloncolon[2] =
+{':', ':'};
 
 struct symbol *
 parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
-  char * name;
-  int len;
-  char ** token;
-  int * class_prefix;
-  char ** argptr;
+     char *name;
+     int len;
+     char **token;
+     int *class_prefix;
+     char **argptr;
 {
-   /* Comment below comes from decode_line_1 which has very similar
-      code, which is called for "break" command parsing. */
-  
-   /* We have what looks like a class or namespace
+  /* Comment below comes from decode_line_1 which has very similar
+     code, which is called for "break" command parsing. */
+
+  /* We have what looks like a class or namespace
      scope specification (A::B), possibly with many
      levels of namespaces or classes (A::B::C::D).
 
@@ -593,18 +595,18 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
      consider *prefixes* of the string; there is no need to look up
      "B::C" separately as a symbol in the previous example. */
 
-  register char * p;
-  char * start, * end;
-  char * prefix = NULL;
-  char * tmp;
-  struct symbol * sym_class = NULL;
-  struct symbol * sym_var = NULL;
-  struct type * t;
+  register char *p;
+  char *start, *end;
+  char *prefix = NULL;
+  char *tmp;
+  struct symbol *sym_class = NULL;
+  struct symbol *sym_var = NULL;
+  struct type *t;
   register int i;
   int colons_found = 0;
   int prefix_len = 0;
   int done = 0;
-  char * q; 
+  char *q;
 
   /* Check for HP-compiled executable -- in other cases
      return NULL, and caller must default to standard GDB
@@ -615,95 +617,100 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
 
   p = name;
 
-  /* Skip over whitespace and possible global "::" */ 
-  while (*p && (*p == ' ' || *p == '\t')) p++;
+  /* Skip over whitespace and possible global "::" */
+  while (*p && (*p == ' ' || *p == '\t'))
+    p++;
   if (p[0] == ':' && p[1] == ':')
     p += 2;
-  while (*p && (*p == ' ' || *p == '\t')) p++;
-  
+  while (*p && (*p == ' ' || *p == '\t'))
+    p++;
+
   while (1)
     {
       /* Get to the end of the next namespace or class spec. */
       /* If we're looking at some non-token, fail immediately */
       start = p;
       if (!(isalpha (*p) || *p == '$' || *p == '_'))
-        return (struct symbol *) NULL;
+       return (struct symbol *) NULL;
       p++;
-      while (*p && (isalnum (*p) || *p == '$' || *p == '_')) p++;
-
-      if (*p == '<') 
-        {
-          /* If we have the start of a template specification,
-             scan right ahead to its end */ 
-          q = find_template_name_end (p);
-          if (q)
-            p = q;
-        }
-        
+      while (*p && (isalnum (*p) || *p == '$' || *p == '_'))
+       p++;
+
+      if (*p == '<')
+       {
+         /* If we have the start of a template specification,
+            scan right ahead to its end */
+         q = find_template_name_end (p);
+         if (q)
+           p = q;
+       }
+
       end = p;
 
-      /* Skip over "::" and whitespace for next time around */ 
-      while (*p && (*p == ' ' || *p == '\t')) p++;
+      /* Skip over "::" and whitespace for next time around */
+      while (*p && (*p == ' ' || *p == '\t'))
+       p++;
       if (p[0] == ':' && p[1] == ':')
-        p += 2;
-      while (*p && (*p == ' ' || *p == '\t')) p++;
+       p += 2;
+      while (*p && (*p == ' ' || *p == '\t'))
+       p++;
 
-      /* Done with tokens? */ 
+      /* Done with tokens? */
       if (!*p || !(isalpha (*p) || *p == '$' || *p == '_'))
-        done = 1;
+       done = 1;
 
       tmp = (char *) alloca (prefix_len + end - start + 3);
       if (prefix)
-        {
-          memcpy (tmp, prefix, prefix_len);
-          memcpy (tmp + prefix_len, coloncolon, 2);
-          memcpy (tmp + prefix_len + 2, start, end - start);
-          tmp[prefix_len + 2 + end - start] = '\000';
-        }
+       {
+         memcpy (tmp, prefix, prefix_len);
+         memcpy (tmp + prefix_len, coloncolon, 2);
+         memcpy (tmp + prefix_len + 2, start, end - start);
+         tmp[prefix_len + 2 + end - start] = '\000';
+       }
       else
-        {
-          memcpy (tmp, start, end - start);
-          tmp[end - start] = '\000';
-        }
-      
+       {
+         memcpy (tmp, start, end - start);
+         tmp[end - start] = '\000';
+       }
+
       prefix = tmp;
       prefix_len = strlen (prefix);
-      
+
       /* See if the prefix we have now is something we know about */
 
-      if (!done) 
-        {
-          /* More tokens to process, so this must be a class/namespace */
-          sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
-                                     0, (struct symtab **) NULL);
-        }
+      if (!done)
+       {
+         /* More tokens to process, so this must be a class/namespace */
+         sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
+                                    0, (struct symtab **) NULL);
+       }
       else
-        {
-          /* No more tokens, so try as a variable first */ 
-          sym_var = lookup_symbol (prefix, 0, VAR_NAMESPACE,
-                               0, (struct symtab **) NULL);
-          /* If failed, try as class/namespace */ 
-          if (!sym_var)
-            sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
-                                       0, (struct symtab **) NULL);
-        }
+       {
+         /* No more tokens, so try as a variable first */
+         sym_var = lookup_symbol (prefix, 0, VAR_NAMESPACE,
+                                  0, (struct symtab **) NULL);
+         /* If failed, try as class/namespace */
+         if (!sym_var)
+           sym_class = lookup_symbol (prefix, 0, STRUCT_NAMESPACE,
+                                      0, (struct symtab **) NULL);
+       }
 
       if (sym_var ||
-          (sym_class &&
-           (t = check_typedef (SYMBOL_TYPE (sym_class)),
-            (TYPE_CODE (t) == TYPE_CODE_STRUCT
-             || TYPE_CODE (t) == TYPE_CODE_UNION))))
-        {
-          /* We found a valid token */
-          *token = (char *) xmalloc (prefix_len + 1 );
-          memcpy (*token, prefix, prefix_len);
-          (*token)[prefix_len] = '\000';
-          break;
-        }
-
-      /* No variable or class/namespace found, no more tokens */ 
+         (sym_class &&
+          (t = check_typedef (SYMBOL_TYPE (sym_class)),
+           (TYPE_CODE (t) == TYPE_CODE_STRUCT
+            || TYPE_CODE (t) == TYPE_CODE_UNION))))
+       {
+         /* We found a valid token */
+         *token = (char *) xmalloc (prefix_len + 1);
+         memcpy (*token, prefix, prefix_len);
+         (*token)[prefix_len] = '\000';
+         break;
+       }
+
+      /* No variable or class/namespace found, no more tokens */
       if (done)
-        return (struct symbol *) NULL;
+       return (struct symbol *) NULL;
     }
 
   /* Out of loop, so we must have found a valid token */
@@ -715,70 +722,72 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
   if (argptr)
     *argptr = done ? p : end;
 
-  return sym_var ? sym_var : sym_class; /* found */ 
+  return sym_var ? sym_var : sym_class;                /* found */
 }
 
 char *
 find_template_name_end (p)
-  char * p;
+     char *p;
 {
   int depth = 1;
   int just_seen_right = 0;
   int just_seen_colon = 0;
   int just_seen_space = 0;
-  
+
   if (!p || (*p != '<'))
     return 0;
 
   while (*++p)
     {
       switch (*p)
-        {
-          case '\'': case '\"':
-          case '{': case '}':
-            /* In future, may want to allow these?? */ 
-            return 0;
-          case '<':
-            depth++;                /* start nested template */ 
-            if (just_seen_colon || just_seen_right || just_seen_space)    
-              return 0;             /* but not after : or :: or > or space */ 
-            break;
-          case '>': 
-            if (just_seen_colon || just_seen_right)
-              return 0;             /* end a (nested?) template */
-            just_seen_right = 1;    /* but not after : or :: */ 
-            if (--depth == 0)       /* also disallow >>, insist on > > */ 
-              return ++p;           /* if outermost ended, return */ 
-            break;
-          case ':':
-            if (just_seen_space || (just_seen_colon > 1))
-              return 0;             /* nested class spec coming up */ 
-            just_seen_colon++;      /* we allow :: but not :::: */ 
-            break;
-          case ' ':
-            break;
-          default:
-            if (!((*p >= 'a' && *p <= 'z') ||   /* allow token chars */ 
-                  (*p >= 'A' && *p <= 'Z') ||
-                  (*p >= '0' && *p <= '9') ||
-                  (*p == '_') || (*p == ',') || /* commas for template args */
-                  (*p == '&') || (*p == '*') || /* pointer and ref types */
-                  (*p == '(') || (*p == ')') || /* function types */ 
-                  (*p == '[') || (*p == ']') )) /* array types */  
-              return 0;
-        }
+       {
+       case '\'':
+       case '\"':
+       case '{':
+       case '}':
+         /* In future, may want to allow these?? */
+         return 0;
+       case '<':
+         depth++;              /* start nested template */
+         if (just_seen_colon || just_seen_right || just_seen_space)
+           return 0;           /* but not after : or :: or > or space */
+         break;
+       case '>':
+         if (just_seen_colon || just_seen_right)
+           return 0;           /* end a (nested?) template */
+         just_seen_right = 1;  /* but not after : or :: */
+         if (--depth == 0)     /* also disallow >>, insist on > > */
+           return ++p;         /* if outermost ended, return */
+         break;
+       case ':':
+         if (just_seen_space || (just_seen_colon > 1))
+           return 0;           /* nested class spec coming up */
+         just_seen_colon++;    /* we allow :: but not :::: */
+         break;
+       case ' ':
+         break;
+       default:
+         if (!((*p >= 'a' && *p <= 'z') ||     /* allow token chars */
+               (*p >= 'A' && *p <= 'Z') ||
+               (*p >= '0' && *p <= '9') ||
+               (*p == '_') || (*p == ',') ||   /* commas for template args */
+               (*p == '&') || (*p == '*') ||   /* pointer and ref types */
+               (*p == '(') || (*p == ')') ||   /* function types */
+               (*p == '[') || (*p == ']')))    /* array types */
+           return 0;
+       }
       if (*p != ' ')
-        just_seen_space = 0;
+       just_seen_space = 0;
       if (*p != ':')
-        just_seen_colon = 0;
+       just_seen_colon = 0;
       if (*p != '>')
-        just_seen_right = 0;
+       just_seen_right = 0;
     }
   return 0;
 }
+\f
 
 
-\f
 /* Return a null-terminated temporary copy of the name
    of a string token.  */
 
@@ -799,7 +808,7 @@ prefixify_expression (expr)
      register struct expression *expr;
 {
   register int len =
-    sizeof (struct expression) + EXP_ELEM_TO_BYTES (expr->nelts);
+  sizeof (struct expression) + EXP_ELEM_TO_BYTES (expr->nelts);
   register struct expression *temp;
   register int inpos = expr->nelts, outpos = 0;
 
@@ -851,9 +860,9 @@ length_of_subexp (expr, endpos)
       break;
 
     case OP_COMPLEX:
-      oplen = 1; 
+      oplen = 1;
       args = 2;
-      break; 
+      break;
 
     case OP_FUNCALL:
     case OP_F77_UNDETERMINED_ARGLIST:
@@ -866,9 +875,9 @@ length_of_subexp (expr, endpos)
       oplen = 3;
       break;
 
-   case BINOP_VAL:
-   case UNOP_CAST:
-   case UNOP_MEMVAL:
+    case BINOP_VAL:
+    case UNOP_CAST:
+    case UNOP_MEMVAL:
       oplen = 3;
       args = 1;
       break;
@@ -918,9 +927,9 @@ length_of_subexp (expr, endpos)
       break;
 
       /* Modula-2 */
-   case MULTI_SUBSCRIPT:
+    case MULTI_SUBSCRIPT:
       oplen = 3;
-      args = 1 + longest_to_int (expr->elts[endpos- 2].longconst);
+      args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
       break;
 
     case BINOP_ASSIGN_MODIFY:
@@ -991,9 +1000,9 @@ prefixify_subexp (inexpr, outexpr, inend, outbeg)
       break;
 
     case OP_COMPLEX:
-      oplen = 1; 
-      args = 2; 
-      break; 
+      oplen = 1;
+      args = 2;
+      break;
 
     case OP_FUNCALL:
     case OP_F77_UNDETERMINED_ARGLIST:
@@ -1020,8 +1029,8 @@ prefixify_subexp (inexpr, outexpr, inend, outbeg)
     case UNOP_ODD:
     case UNOP_ORD:
     case UNOP_TRUNC:
-      oplen=1;
-      args=1;
+      oplen = 1;
+      args = 1;
       break;
 
     case STRUCTOP_STRUCT:
@@ -1062,7 +1071,7 @@ prefixify_subexp (inexpr, outexpr, inend, outbeg)
       break;
 
       /* Modula-2 */
-   case MULTI_SUBSCRIPT:
+    case MULTI_SUBSCRIPT:
       oplen = 3;
       args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
       break;
@@ -1198,7 +1207,7 @@ parse_expression (string)
 /* Stuff for maintaining a stack of types.  Currently just used by C, but
    probably useful for any language which declares its types "backwards".  */
 
-void 
+void
 push_type (tp)
      enum type_pieces tp;
 {
@@ -1224,7 +1233,7 @@ push_type_int (n)
   type_stack[type_stack_depth++].int_val = n;
 }
 
-enum type_pieces 
+enum type_pieces
 pop_type ()
 {
   if (type_stack_depth)
@@ -1275,7 +1284,7 @@ follow_types (follow_type)
          create_array_type ((struct type *) NULL,
                             follow_type, range_type);
        if (array_size < 0)
-         TYPE_ARRAY_UPPER_BOUND_TYPE(follow_type)
+         TYPE_ARRAY_UPPER_BOUND_TYPE (follow_type)
            = BOUND_CANNOT_BE_DETERMINED;
        break;
       case tp_function:
@@ -1372,10 +1381,10 @@ _initialize_parse ()
   register_gdbarch_swap (NULL, 0, build_parse);
 
   add_show_from_set (
-     add_set_cmd ("expressiondebug", class_maintenance, var_zinteger,
-                 (char *)&expressiondebug,
-                "Set expression debugging.\n\
+           add_set_cmd ("expressiondebug", class_maintenance, var_zinteger,
+                        (char *) &expressiondebug,
+                        "Set expression debugging.\n\
 When non-zero, the internal representation of expressions will be printed.",
-                 &setlist),
-     &showlist);
+                        &setlist),
+                     &showlist);
 }
index dc50694678bbfc6c04ac04d612451a151e66541d..1458b494df896ad0b0208ea3a522e4312892e7be 100644 (file)
@@ -3,29 +3,31 @@
    Modified from expread.y by the Department of Computer Science at the
    State University of New York at Buffalo.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (PARSER_DEFS_H)
 #define PARSER_DEFS_H 1
 
-struct std_regs {
-       char *name;
-       int regnum;
-};
+struct std_regs
+  {
+    char *name;
+    int regnum;
+  };
 
 extern struct std_regs *std_regs;
 extern unsigned num_std_regs;
@@ -78,12 +80,15 @@ struct symtoken
 /* For parsing of complicated types.
    An array should be preceded in the list by the size of the array.  */
 enum type_pieces
-  {tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
+  {
+    tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function
+  };
 /* The stack can contain either an enum type_pieces or an int.  */
-union type_stack_elt {
-  enum type_pieces piece;
-  int int_val;
-};
+union type_stack_elt
+  {
+    enum type_pieces piece;
+    int int_val;
+  };
 extern union type_stack_elt *type_stack;
 extern int type_stack_depth, type_stack_size;
 
@@ -112,9 +117,9 @@ extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
 
 extern void write_dollar_variable PARAMS ((struct stoken str));
 
-extern struct symbol * parse_nested_classes_for_hpacc PARAMS ((char *, int, char **, int *, char **));
+extern struct symbol *parse_nested_classes_for_hpacc PARAMS ((char *, int, char **, int *, char **));
 
-extern char * find_template_name_end PARAMS ((char *));
+extern char *find_template_name_end PARAMS ((char *));
 
 extern void
 start_arglist PARAMS ((void));
@@ -123,15 +128,15 @@ extern int
 end_arglist PARAMS ((void));
 
 extern char *
-copy_name PARAMS ((struct stoken));
+  copy_name PARAMS ((struct stoken));
 
-extern void 
+extern void
 push_type PARAMS ((enum type_pieces));
 
 extern void
 push_type_int PARAMS ((int));
 
-extern enum type_pieces 
+extern enum type_pieces
 pop_type PARAMS ((void));
 
 extern int
@@ -175,25 +180,27 @@ extern int comma_terminates;
    they are used as the "surrounding precedence" to force
    various kinds of things to be parenthesized.  */
 enum precedence
-{ PREC_NULL, PREC_COMMA, PREC_ABOVE_COMMA, PREC_ASSIGN, PREC_LOGICAL_OR,
-  PREC_LOGICAL_AND, PREC_BITWISE_IOR, PREC_BITWISE_AND, PREC_BITWISE_XOR,
-  PREC_EQUAL, PREC_ORDER, PREC_SHIFT, PREC_ADD, PREC_MUL, PREC_REPEAT,
-  PREC_HYPER, PREC_PREFIX, PREC_SUFFIX, PREC_BUILTIN_FUNCTION };
+  {
+    PREC_NULL, PREC_COMMA, PREC_ABOVE_COMMA, PREC_ASSIGN, PREC_LOGICAL_OR,
+    PREC_LOGICAL_AND, PREC_BITWISE_IOR, PREC_BITWISE_AND, PREC_BITWISE_XOR,
+    PREC_EQUAL, PREC_ORDER, PREC_SHIFT, PREC_ADD, PREC_MUL, PREC_REPEAT,
+    PREC_HYPER, PREC_PREFIX, PREC_SUFFIX, PREC_BUILTIN_FUNCTION
+  };
 
 /* Table mapping opcodes into strings for printing operators
    and precedences of the operators.  */
 
 struct op_print
-{
-  char *string;
-  enum exp_opcode opcode;
-  /* Precedence of operator.  These values are used only by comparisons.  */
-  enum precedence precedence;
-
-  /* For a binary operator:  1 iff right associate.
-     For a unary operator:  1 iff postfix. */
-  int right_assoc;
-};
+  {
+    char *string;
+    enum exp_opcode opcode;
+    /* Precedence of operator.  These values are used only by comparisons.  */
+    enum precedence precedence;
+
+    /* For a binary operator:  1 iff right associate.
+       For a unary operator:  1 iff postfix. */
+    int right_assoc;
+  };
 
 /* The generic method for targets to specify how their registers are
    named.  The mapping can be derived from three sources:
@@ -201,4 +208,4 @@ struct op_print
 
 extern int target_map_name_to_register PARAMS ((char *, int));
 
-#endif /* PARSER_DEFS_H */
+#endif /* PARSER_DEFS_H */
index ffaaa5140c2aab3f59897e8a038415d402b87e98..f627c8e3232a355d0d87ed4a0b24fb4c18d34410 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The following need to be defined:
    SET_NAMESTRING() --Set namestring to name of symbol.
@@ -27,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    pst - the partial symbol table being built.
 
    psymtab_include_list, includes_used, includes_allocated - list of include
-     file names (N_SOL) seen so far.
+   file names (N_SOL) seen so far.
    dependency_list, dependencies_used, dependencies_allocated - list of
-     N_EXCL stabs seen so far.
+   N_EXCL stabs seen so far.
 
    END_PSYMTAB -- end a partial symbol table.
    START_PSYMTAB -- start a partial symbol table.
@@ -37,776 +38,782 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* End of macro definitions, now let's handle them symbols!  */
 
-      switch (CUR_SYMBOL_TYPE)
-       {
-         char *p;
-         /*
-          * Standard, external, non-debugger, symbols
-          */
-
-       case N_TEXT | N_EXT:
-       case N_NBTEXT | N_EXT:
-         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-         goto record_it;
-
-       case N_DATA | N_EXT:
-       case N_NBDATA | N_EXT:
-         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
-         goto record_it;
-
-       case N_BSS:
-       case N_BSS | N_EXT:
-       case N_NBBSS | N_EXT:
-        case N_SETV | N_EXT:           /* FIXME, is this in BSS? */
-         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_BSS);
-         goto record_it;
-
-       case N_ABS | N_EXT:
-       record_it:
+switch (CUR_SYMBOL_TYPE)
+  {
+    char *p;
+    /*
+     * Standard, external, non-debugger, symbols
+     */
+
+  case N_TEXT | N_EXT:
+  case N_NBTEXT | N_EXT:
+    CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+    goto record_it;
+
+  case N_DATA | N_EXT:
+  case N_NBDATA | N_EXT:
+    CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
+    goto record_it;
+
+  case N_BSS:
+  case N_BSS | N_EXT:
+  case N_NBBSS | N_EXT:
+  case N_SETV | N_EXT:         /* FIXME, is this in BSS? */
+    CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_BSS);
+    goto record_it;
+
+  case N_ABS | N_EXT:
+  record_it:
 #ifdef DBXREAD_ONLY
-         SET_NAMESTRING();
+    SET_NAMESTRING ();
 
-       bss_ext_symbol:
-         record_minimal_symbol (namestring, CUR_SYMBOL_VALUE,
-                                CUR_SYMBOL_TYPE, objfile); /* Always */
+  bss_ext_symbol:
+    record_minimal_symbol (namestring, CUR_SYMBOL_VALUE,
+                          CUR_SYMBOL_TYPE, objfile);   /* Always */
 #endif /* DBXREAD_ONLY */
-         continue;
+    continue;
 
-         /* Standard, local, non-debugger, symbols */
+    /* Standard, local, non-debugger, symbols */
 
-       case N_NBTEXT:
+  case N_NBTEXT:
 
-         /* We need to be able to deal with both N_FN or N_TEXT,
-            because we have no way of knowing whether the sys-supplied ld
-            or GNU ld was used to make the executable.  Sequents throw
-            in another wrinkle -- they renumbered N_FN.  */
+    /* We need to be able to deal with both N_FN or N_TEXT,
+       because we have no way of knowing whether the sys-supplied ld
+       or GNU ld was used to make the executable.  Sequents throw
+       in another wrinkle -- they renumbered N_FN.  */
 
-       case N_FN:
-       case N_FN_SEQ:
-       case N_TEXT:
+  case N_FN:
+  case N_FN_SEQ:
+  case N_TEXT:
 #ifdef DBXREAD_ONLY
-         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-         SET_NAMESTRING();
-         if ((namestring[0] == '-' && namestring[1] == 'l')
-             || (namestring [(nsl = strlen (namestring)) - 1] == 'o'
-                 && namestring [nsl - 2] == '.'))
-           {
-             if (objfile -> ei.entry_point <  CUR_SYMBOL_VALUE &&
-                 objfile -> ei.entry_point >= last_o_file_start)
-               {
-                 objfile -> ei.entry_file_lowpc = last_o_file_start;
-                 objfile -> ei.entry_file_highpc = CUR_SYMBOL_VALUE;
-               }
-             if (past_first_source_file && pst
-                 /* The gould NP1 uses low values for .o and -l symbols
-                    which are not the address.  */
-                 && CUR_SYMBOL_VALUE >= pst->textlow)
-               {
-                 END_PSYMTAB (pst, psymtab_include_list, includes_used,
-                              symnum * symbol_size,
-                              CUR_SYMBOL_VALUE > pst->texthigh
-                                ? CUR_SYMBOL_VALUE : pst->texthigh, 
-                              dependency_list, dependencies_used, textlow_not_set);
-                 pst = (struct partial_symtab *) 0;
-                 includes_used = 0;
-                 dependencies_used = 0;
-               }
-             else
-               past_first_source_file = 1;
-             last_o_file_start = CUR_SYMBOL_VALUE;
-           }
-         else
-           goto record_it;
+    CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+    SET_NAMESTRING ();
+    if ((namestring[0] == '-' && namestring[1] == 'l')
+       || (namestring[(nsl = strlen (namestring)) - 1] == 'o'
+           && namestring[nsl - 2] == '.'))
+      {
+       if (objfile->ei.entry_point < CUR_SYMBOL_VALUE &&
+           objfile->ei.entry_point >= last_o_file_start)
+         {
+           objfile->ei.entry_file_lowpc = last_o_file_start;
+           objfile->ei.entry_file_highpc = CUR_SYMBOL_VALUE;
+         }
+       if (past_first_source_file && pst
+       /* The gould NP1 uses low values for .o and -l symbols
+          which are not the address.  */
+           && CUR_SYMBOL_VALUE >= pst->textlow)
+         {
+           END_PSYMTAB (pst, psymtab_include_list, includes_used,
+                        symnum * symbol_size,
+                        CUR_SYMBOL_VALUE > pst->texthigh
+                        ? CUR_SYMBOL_VALUE : pst->texthigh,
+                      dependency_list, dependencies_used, textlow_not_set);
+           pst = (struct partial_symtab *) 0;
+           includes_used = 0;
+           dependencies_used = 0;
+         }
+       else
+         past_first_source_file = 1;
+       last_o_file_start = CUR_SYMBOL_VALUE;
+      }
+    else
+      goto record_it;
 #endif /* DBXREAD_ONLY */
-         continue;
+    continue;
 
-       case N_DATA:
-         CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
-         goto record_it;
+  case N_DATA:
+    CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
+    goto record_it;
 
-       case N_UNDF | N_EXT:
+  case N_UNDF | N_EXT:
 #ifdef DBXREAD_ONLY
-         if (CUR_SYMBOL_VALUE != 0) {
-           /* This is a "Fortran COMMON" symbol.  See if the target
-              environment knows where it has been relocated to.  */
+    if (CUR_SYMBOL_VALUE != 0)
+      {
+       /* This is a "Fortran COMMON" symbol.  See if the target
+          environment knows where it has been relocated to.  */
 
-           CORE_ADDR reladdr;
+       CORE_ADDR reladdr;
 
-           SET_NAMESTRING();
-           if (target_lookup_symbol (namestring, &reladdr)) {
-             continue;         /* Error in lookup; ignore symbol for now.  */
-           }
-           CUR_SYMBOL_TYPE ^= (N_BSS^N_UNDF);  /* Define it as a bss-symbol */
-           CUR_SYMBOL_VALUE = reladdr;
-           goto bss_ext_symbol;
+       SET_NAMESTRING ();
+       if (target_lookup_symbol (namestring, &reladdr))
+         {
+           continue;           /* Error in lookup; ignore symbol for now.  */
          }
+       CUR_SYMBOL_TYPE ^= (N_BSS ^ N_UNDF);    /* Define it as a bss-symbol */
+       CUR_SYMBOL_VALUE = reladdr;
+       goto bss_ext_symbol;
+      }
 #endif /* DBXREAD_ONLY */
-         continue;     /* Just undefined, not COMMON */
+    continue;                  /* Just undefined, not COMMON */
 
-       case N_UNDF:
+  case N_UNDF:
 #ifdef DBXREAD_ONLY
-         if (processing_acc_compilation && CUR_SYMBOL_STRX == 1) {
-           /* Deal with relative offsets in the string table
-              used in ELF+STAB under Solaris.  If we want to use the
-              n_strx field, which contains the name of the file,
-              we must adjust file_string_table_offset *before* calling
-              SET_NAMESTRING().  */
-           past_first_source_file = 1;
-           file_string_table_offset = next_file_string_table_offset;
-           next_file_string_table_offset =
-             file_string_table_offset + CUR_SYMBOL_VALUE;
-           if (next_file_string_table_offset < file_string_table_offset)
-             error ("string table offset backs up at %d", symnum);
-  /* FIXME -- replace error() with complaint.  */
-           continue;
-         }
+    if (processing_acc_compilation && CUR_SYMBOL_STRX == 1)
+      {
+       /* Deal with relative offsets in the string table
+          used in ELF+STAB under Solaris.  If we want to use the
+          n_strx field, which contains the name of the file,
+          we must adjust file_string_table_offset *before* calling
+          SET_NAMESTRING().  */
+       past_first_source_file = 1;
+       file_string_table_offset = next_file_string_table_offset;
+       next_file_string_table_offset =
+         file_string_table_offset + CUR_SYMBOL_VALUE;
+       if (next_file_string_table_offset < file_string_table_offset)
+         error ("string table offset backs up at %d", symnum);
+       /* FIXME -- replace error() with complaint.  */
+       continue;
+      }
 #endif /* DBXREAD_ONLY */
-         continue;
-
-           /* Lots of symbol types we can just ignore.  */
-
-       case N_ABS:
-       case N_NBDATA:
-       case N_NBBSS:
-         continue;
-
-         /* Keep going . . .*/
-
-         /*
-          * Special symbol types for GNU
-          */
-       case N_INDR:
-       case N_INDR | N_EXT:
-       case N_SETA:
-       case N_SETA | N_EXT:
-       case N_SETT:
-       case N_SETT | N_EXT:
-       case N_SETD:
-       case N_SETD | N_EXT:
-       case N_SETB:
-       case N_SETB | N_EXT:
-       case N_SETV:
-         continue;
-
-         /*
-          * Debugger symbols
-          */
-
-       case N_SO: {
-         unsigned long valu;
-         static int prev_so_symnum = -10;
-         static int first_so_symnum;
-         char *p;
-         int prev_textlow_not_set;
-
-         valu = CUR_SYMBOL_VALUE + ANOFFSET (section_offsets, SECT_OFF_TEXT);
-
-         prev_textlow_not_set = textlow_not_set;
+    continue;
+
+    /* Lots of symbol types we can just ignore.  */
+
+  case N_ABS:
+  case N_NBDATA:
+  case N_NBBSS:
+    continue;
+
+    /* Keep going . . . */
+
+    /*
+     * Special symbol types for GNU
+     */
+  case N_INDR:
+  case N_INDR | N_EXT:
+  case N_SETA:
+  case N_SETA | N_EXT:
+  case N_SETT:
+  case N_SETT | N_EXT:
+  case N_SETD:
+  case N_SETD | N_EXT:
+  case N_SETB:
+  case N_SETB | N_EXT:
+  case N_SETV:
+    continue;
+
+    /*
+     * Debugger symbols
+     */
+
+  case N_SO:
+    {
+      unsigned long valu;
+      static int prev_so_symnum = -10;
+      static int first_so_symnum;
+      char *p;
+      int prev_textlow_not_set;
+
+      valu = CUR_SYMBOL_VALUE + ANOFFSET (section_offsets, SECT_OFF_TEXT);
+
+      prev_textlow_not_set = textlow_not_set;
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-         /* A zero value is probably an indication for the SunPRO 3.0
-            compiler. end_psymtab explicitly tests for zero, so
-            don't relocate it.  */
+      /* A zero value is probably an indication for the SunPRO 3.0
+         compiler. end_psymtab explicitly tests for zero, so
+         don't relocate it.  */
 
-         if (CUR_SYMBOL_VALUE == 0)
-           {
-             textlow_not_set = 1;
-             valu = 0;
-           }
-         else
-           textlow_not_set = 0;
+      if (CUR_SYMBOL_VALUE == 0)
+       {
+         textlow_not_set = 1;
+         valu = 0;
+       }
+      else
+       textlow_not_set = 0;
 #else
-         textlow_not_set = 0;
+      textlow_not_set = 0;
 #endif
-         past_first_source_file = 1;
+      past_first_source_file = 1;
 
-         if (prev_so_symnum != symnum - 1)
-           {                   /* Here if prev stab wasn't N_SO */
-             first_so_symnum = symnum;
-
-             if (pst)
-               {
-                 END_PSYMTAB (pst, psymtab_include_list, includes_used,
-                              symnum * symbol_size,
-                              valu > pst->texthigh ? valu : pst->texthigh,
-                              dependency_list, dependencies_used,
-                              prev_textlow_not_set);
-                 pst = (struct partial_symtab *) 0;
-                 includes_used = 0;
-                 dependencies_used = 0;
-               }
+      if (prev_so_symnum != symnum - 1)
+       {                       /* Here if prev stab wasn't N_SO */
+         first_so_symnum = symnum;
+
+         if (pst)
+           {
+             END_PSYMTAB (pst, psymtab_include_list, includes_used,
+                          symnum * symbol_size,
+                          valu > pst->texthigh ? valu : pst->texthigh,
+                          dependency_list, dependencies_used,
+                          prev_textlow_not_set);
+             pst = (struct partial_symtab *) 0;
+             includes_used = 0;
+             dependencies_used = 0;
            }
+       }
 
-         prev_so_symnum = symnum;
+      prev_so_symnum = symnum;
 
-         /* End the current partial symtab and start a new one */
+      /* End the current partial symtab and start a new one */
 
-         SET_NAMESTRING();
+      SET_NAMESTRING ();
 
-         /* Null name means end of .o file.  Don't start a new one. */
-         if (*namestring == '\000')
-           continue;
+      /* Null name means end of .o file.  Don't start a new one. */
+      if (*namestring == '\000')
+       continue;
 
-         /* Some compilers (including gcc) emit a pair of initial N_SOs.
-            The first one is a directory name; the second the file name.
-            If pst exists, is empty, and has a filename ending in '/',
-            we assume the previous N_SO was a directory name. */
-
-         p = strrchr (namestring, '/');
-         if (p && *(p+1) == '\000')
-           continue;           /* Simply ignore directory name SOs */
-
-         /* Some other compilers (C++ ones in particular) emit useless
-            SOs for non-existant .c files.  We ignore all subsequent SOs that
-            immediately follow the first.  */
-
-         if (!pst)
-           pst = START_PSYMTAB (objfile, section_offsets,
-                                namestring, valu,
-                                first_so_symnum * symbol_size,
-                                objfile -> global_psymbols.next,
-                                objfile -> static_psymbols.next);
-         continue;
-       }
+      /* Some compilers (including gcc) emit a pair of initial N_SOs.
+         The first one is a directory name; the second the file name.
+         If pst exists, is empty, and has a filename ending in '/',
+         we assume the previous N_SO was a directory name. */
 
-       case N_BINCL:
-         {
+      p = strrchr (namestring, '/');
+      if (p && *(p + 1) == '\000')
+       continue;               /* Simply ignore directory name SOs */
+
+      /* Some other compilers (C++ ones in particular) emit useless
+         SOs for non-existant .c files.  We ignore all subsequent SOs that
+         immediately follow the first.  */
+
+      if (!pst)
+       pst = START_PSYMTAB (objfile, section_offsets,
+                            namestring, valu,
+                            first_so_symnum * symbol_size,
+                            objfile->global_psymbols.next,
+                            objfile->static_psymbols.next);
+      continue;
+    }
+
+  case N_BINCL:
+    {
 #ifdef DBXREAD_ONLY
-           enum language tmp_language;
-           /* Add this bincl to the bincl_list for future EXCLs.  No
-              need to save the string; it'll be around until
-              read_dbx_symtab function returns */
+      enum language tmp_language;
+      /* Add this bincl to the bincl_list for future EXCLs.  No
+         need to save the string; it'll be around until
+         read_dbx_symtab function returns */
 
-           SET_NAMESTRING();
+      SET_NAMESTRING ();
 
-           tmp_language = deduce_language_from_filename (namestring);
+      tmp_language = deduce_language_from_filename (namestring);
 
-           /* Only change the psymtab's language if we've learned
-              something useful (eg. tmp_language is not language_unknown).
-              In addition, to match what start_subfile does, never change
-              from C++ to C.  */
-           if (tmp_language != language_unknown
-               && (tmp_language != language_c
-                   || psymtab_language != language_cplus))
-             psymtab_language = tmp_language;
+      /* Only change the psymtab's language if we've learned
+         something useful (eg. tmp_language is not language_unknown).
+         In addition, to match what start_subfile does, never change
+         from C++ to C.  */
+      if (tmp_language != language_unknown
+         && (tmp_language != language_c
+             || psymtab_language != language_cplus))
+       psymtab_language = tmp_language;
 
-           if (pst == NULL)
-             {
-               /* FIXME: we should not get here without a PST to work on.
-                  Attempt to recover.  */
-               complain (&unclaimed_bincl_complaint, namestring, symnum);
-               continue;
-             }
-           add_bincl_to_list (pst, namestring, CUR_SYMBOL_VALUE);
+      if (pst == NULL)
+       {
+         /* FIXME: we should not get here without a PST to work on.
+            Attempt to recover.  */
+         complain (&unclaimed_bincl_complaint, namestring, symnum);
+         continue;
+       }
+      add_bincl_to_list (pst, namestring, CUR_SYMBOL_VALUE);
 
-           /* Mark down an include file in the current psymtab */
+      /* Mark down an include file in the current psymtab */
 
-           goto record_include_file;
+      goto record_include_file;
 
 #else /* DBXREAD_ONLY */
-           continue;
+      continue;
 #endif
-         }
-
-       case N_SOL:
-         {
-           enum language tmp_language;
-           /* Mark down an include file in the current psymtab */
-           
-           SET_NAMESTRING();
-  
-           tmp_language = deduce_language_from_filename (namestring);
-  
-           /* Only change the psymtab's language if we've learned
-              something useful (eg. tmp_language is not language_unknown).
-              In addition, to match what start_subfile does, never change
-              from C++ to C.  */
-           if (tmp_language != language_unknown
-               && (tmp_language != language_c
-                   || psymtab_language != language_cplus))
-             psymtab_language = tmp_language;
-           
-           /* In C++, one may expect the same filename to come round many
-              times, when code is coming alternately from the main file
-              and from inline functions in other files. So I check to see
-              if this is a file we've seen before -- either the main
-              source file, or a previously included file.
-              
-              This seems to be a lot of time to be spending on N_SOL, but
-              things like "break c-exp.y:435" need to work (I
-              suppose the psymtab_include_list could be hashed or put
-              in a binary tree, if profiling shows this is a major hog).  */
-           if (pst && STREQ (namestring, pst->filename))
-             continue;
+    }
+
+  case N_SOL:
+    {
+      enum language tmp_language;
+      /* Mark down an include file in the current psymtab */
+
+      SET_NAMESTRING ();
+
+      tmp_language = deduce_language_from_filename (namestring);
+
+      /* Only change the psymtab's language if we've learned
+         something useful (eg. tmp_language is not language_unknown).
+         In addition, to match what start_subfile does, never change
+         from C++ to C.  */
+      if (tmp_language != language_unknown
+         && (tmp_language != language_c
+             || psymtab_language != language_cplus))
+       psymtab_language = tmp_language;
+
+      /* In C++, one may expect the same filename to come round many
+         times, when code is coming alternately from the main file
+         and from inline functions in other files. So I check to see
+         if this is a file we've seen before -- either the main
+         source file, or a previously included file.
+
+         This seems to be a lot of time to be spending on N_SOL, but
+         things like "break c-exp.y:435" need to work (I
+         suppose the psymtab_include_list could be hashed or put
+         in a binary tree, if profiling shows this is a major hog).  */
+      if (pst && STREQ (namestring, pst->filename))
+       continue;
+      {
+       register int i;
+       for (i = 0; i < includes_used; i++)
+         if (STREQ (namestring, psymtab_include_list[i]))
            {
-             register int i;
-             for (i = 0; i < includes_used; i++)
-               if (STREQ (namestring, psymtab_include_list[i]))
-                 {
-                   i = -1; 
-                   break;
-                 }
-             if (i == -1)
-               continue;
+             i = -1;
+             break;
            }
-           
+       if (i == -1)
+         continue;
+      }
+
 #ifdef DBXREAD_ONLY
-         record_include_file:
+    record_include_file:
 #endif
-           
-           psymtab_include_list[includes_used++] = namestring;
-           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 *));
-             }
-           continue;
-         }
-       case N_LSYM:            /* Typedef or automatic variable. */
-       case N_STSYM:           /* Data seg var -- static  */
-       case N_LCSYM:           /* BSS      "  */
-       case N_ROSYM:           /* Read-only data seg var -- static.  */
-       case N_NBSTS:           /* Gould nobase.  */
-       case N_NBLCS:           /* symbols.  */
-       case N_FUN:
-       case N_GSYM:            /* Global (extern) variable; can be
+
+      psymtab_include_list[includes_used++] = namestring;
+      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 *));
+       }
+      continue;
+    }
+  case N_LSYM:                 /* Typedef or automatic variable. */
+  case N_STSYM:                /* Data seg var -- static  */
+  case N_LCSYM:                /* BSS      "  */
+  case N_ROSYM:                /* Read-only data seg var -- static.  */
+  case N_NBSTS:                /* Gould nobase.  */
+  case N_NBLCS:                /* symbols.  */
+  case N_FUN:
+  case N_GSYM:                 /* Global (extern) variable; can be
                                   data or bss (sigh FIXME).  */
 
-       /* Following may probably be ignored; I'll leave them here
-          for now (until I do Pascal and Modula 2 extensions).  */
+    /* Following may probably be ignored; I'll leave them here
+       for now (until I do Pascal and Modula 2 extensions).  */
 
-       case N_PC:              /* I may or may not need this; I
+  case N_PC:                   /* I may or may not need this; I
                                   suspect not.  */
-       case N_M2C:             /* I suspect that I can ignore this here. */
-       case N_SCOPE:           /* Same.   */
+  case N_M2C:                  /* I suspect that I can ignore this here. */
+  case N_SCOPE:                /* Same.   */
 
-         SET_NAMESTRING();
+    SET_NAMESTRING ();
 
 #ifdef DBXREAD_ONLY
-         /* See if this is an end of function stab.  */
-         if (CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
-           {
-             unsigned long valu;
-
-             /* It's value is the size (in bytes) of the function for
-                function relative stabs, or the address of the function's
-                end for old style stabs.  */
-             valu = CUR_SYMBOL_VALUE + last_function_start;
-             if (pst->texthigh == 0 || valu > pst->texthigh)
-               pst->texthigh = valu;
-             break;
-            }
+    /* See if this is an end of function stab.  */
+    if (CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
+      {
+       unsigned long valu;
+
+       /* It's value is the size (in bytes) of the function for
+          function relative stabs, or the address of the function's
+          end for old style stabs.  */
+       valu = CUR_SYMBOL_VALUE + last_function_start;
+       if (pst->texthigh == 0 || valu > pst->texthigh)
+         pst->texthigh = valu;
+       break;
+      }
 #endif
 
-         p = (char *) strchr (namestring, ':');
-         if (!p)
-           continue;           /* Not a debugging symbol.   */
+    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.  */
+    /* 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':
-             CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
+    switch (p[1])
+      {
+      case 'S':
+       CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
 #ifdef STATIC_TRANSFORM_NAME
-             namestring = STATIC_TRANSFORM_NAME (namestring);
+       namestring = STATIC_TRANSFORM_NAME (namestring);
 #endif
-             add_psymbol_to_list (namestring, p - namestring,
-                                  VAR_NAMESPACE, LOC_STATIC,
-                                  &objfile->static_psymbols,
-                                  0, CUR_SYMBOL_VALUE,
-                                  psymtab_language, objfile);
-             continue;
-           case 'G':
-             CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
-             /* The addresses in these entries are reported to be
-                wrong.  See the code that reads 'G's for symtabs. */
-             add_psymbol_to_list (namestring, p - namestring,
-                                  VAR_NAMESPACE, LOC_STATIC,
-                                  &objfile->global_psymbols,
-                                  0, CUR_SYMBOL_VALUE,
-                                  psymtab_language, objfile);
-             continue;
-
-           case 'T':
-             /* When a 'T' entry is defining an anonymous enum, it
-                may have a name which is the empty string, or a
-                single space.  Since they're not really defining a
-                symbol, those shouldn't go in the partial symbol
-                table.  We do pick up the elements of such enums at
-                'check_enum:', below.  */
-             if (p >= namestring + 2
-                 || (p == namestring + 1
-                     && namestring[0] != ' '))
-               {
-                 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"
-                {<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 == '=')
+       add_psymbol_to_list (namestring, p - namestring,
+                            VAR_NAMESPACE, LOC_STATIC,
+                            &objfile->static_psymbols,
+                            0, CUR_SYMBOL_VALUE,
+                            psymtab_language, objfile);
+       continue;
+      case 'G':
+       CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
+       /* The addresses in these entries are reported to be
+          wrong.  See the code that reads 'G's for symtabs. */
+       add_psymbol_to_list (namestring, p - namestring,
+                            VAR_NAMESPACE, LOC_STATIC,
+                            &objfile->global_psymbols,
+                            0, CUR_SYMBOL_VALUE,
+                            psymtab_language, objfile);
+       continue;
+
+      case 'T':
+       /* When a 'T' entry is defining an anonymous enum, it
+          may have a name which is the empty string, or a
+          single space.  Since they're not really defining a
+          symbol, those shouldn't go in the partial symbol
+          table.  We do pick up the elements of such enums at
+          'check_enum:', below.  */
+       if (p >= namestring + 2
+           || (p == namestring + 1
+               && namestring[0] != ' '))
+         {
+           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"
+          {<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')
+         {
+           /* The aix4 compiler emits extra crud before the members.  */
+           if (*p == '-')
+             {
+               /* Skip over the type (?).  */
+               while (*p != ':')
+                 p++;
+
+               /* Skip over the colon.  */
                p++;
+             }
 
-             if (*p++ == 'e')
-               {
-                 /* The aix4 compiler emits extra crud before the members.  */
-                 if (*p == '-')
-                   {
-                     /* Skip over the type (?).  */
-                     while (*p != ':')
-                       p++;
-
-                     /* Skip over the colon.  */
-                     p++;
-                   }
-
-                 /* We have found an enumerated type.  */
-                 /* 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 == '?' && p[1] == '\0'))
-                       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 (section_offsets, SECT_OFF_TEXT);
+           /* We have found an enumerated type.  */
+           /* 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 == '?' && p[1] == '\0'))
+                 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 (section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-             /* Keep track of the start of the last function so we
-                can handle end of function symbols.  */
-             last_function_start = CUR_SYMBOL_VALUE;
-             /* Kludges for ELF/STABS with Sun ACC */
-             last_function_name = namestring;
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+       /* Kludges for ELF/STABS with Sun ACC */
+       last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-             /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
-                value for the bottom of the text seg in those cases. */
-             if (pst && textlow_not_set)
-               {
-                 pst->textlow =
-                   find_stab_function_addr (namestring, pst, objfile);
-                 textlow_not_set = 0;
-               }
+       /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
+          value for the bottom of the text seg in those cases. */
+       if (pst && textlow_not_set)
+         {
+           pst->textlow =
+             find_stab_function_addr (namestring, pst, objfile);
+           textlow_not_set = 0;
+         }
 #endif
-             /* End kludge.  */
-
-             /* In reordered executables this function may lie outside
-                the bounds created by N_SO symbols.  If that's the case
-                use the address of this function as the low bound for
-                the partial symbol table.  */
-             if (textlow_not_set
-                 || (CUR_SYMBOL_VALUE < pst->textlow
-                     && CUR_SYMBOL_VALUE
-                          != ANOFFSET (section_offsets, SECT_OFF_TEXT)))
-               {
-                 pst->textlow = CUR_SYMBOL_VALUE;
-                 textlow_not_set = 0;
-               }
+       /* End kludge.  */
+
+       /* In reordered executables this function may lie outside
+          the bounds created by N_SO symbols.  If that's the case
+          use the address of this function as the low bound for
+          the partial symbol table.  */
+       if (textlow_not_set
+           || (CUR_SYMBOL_VALUE < pst->textlow
+               && CUR_SYMBOL_VALUE
+               != ANOFFSET (section_offsets, SECT_OFF_TEXT)))
+         {
+           pst->textlow = CUR_SYMBOL_VALUE;
+           textlow_not_set = 0;
+         }
 #endif /* DBXREAD_ONLY */
-             add_psymbol_to_list (namestring, p - namestring,
-                                  VAR_NAMESPACE, LOC_BLOCK,
-                                  &objfile->static_psymbols,
-                                  0, CUR_SYMBOL_VALUE,
-                                  psymtab_language, objfile);
-             continue;
-
-             /* Global functions were ignored here, but now they
-                are put into the global psymtab like one would expect.
-                They're also in the minimal symbol table.  */
-           case 'F':
-             CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
+       add_psymbol_to_list (namestring, p - namestring,
+                            VAR_NAMESPACE, LOC_BLOCK,
+                            &objfile->static_psymbols,
+                            0, CUR_SYMBOL_VALUE,
+                            psymtab_language, objfile);
+       continue;
+
+       /* Global functions were ignored here, but now they
+          are put into the global psymtab like one would expect.
+          They're also in the minimal symbol table.  */
+      case 'F':
+       CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-             /* Keep track of the start of the last function so we
-                can handle end of function symbols.  */
-             last_function_start = CUR_SYMBOL_VALUE;
-             /* Kludges for ELF/STABS with Sun ACC */
-             last_function_name = namestring;
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+       /* Kludges for ELF/STABS with Sun ACC */
+       last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-             /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
-                value for the bottom of the text seg in those cases. */
-             if (pst && textlow_not_set)
-               {
-                 pst->textlow =
-                   find_stab_function_addr (namestring, pst, objfile);
-                 textlow_not_set = 0;
-               }
+       /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
+          value for the bottom of the text seg in those cases. */
+       if (pst && textlow_not_set)
+         {
+           pst->textlow =
+             find_stab_function_addr (namestring, pst, objfile);
+           textlow_not_set = 0;
+         }
 #endif
-             /* End kludge.  */
-             /* In reordered executables this function may lie outside
-                the bounds created by N_SO symbols.  If that's the case
-                use the address of this function as the low bound for
-                the partial symbol table.  */
-             if (textlow_not_set
-                 || (CUR_SYMBOL_VALUE < pst->textlow
-                     && CUR_SYMBOL_VALUE
-                          != ANOFFSET (section_offsets, SECT_OFF_TEXT)))
-               {
-                 pst->textlow = CUR_SYMBOL_VALUE;
-                 textlow_not_set = 0;
-               }
+       /* End kludge.  */
+       /* In reordered executables this function may lie outside
+          the bounds created by N_SO symbols.  If that's the case
+          use the address of this function as the low bound for
+          the partial symbol table.  */
+       if (textlow_not_set
+           || (CUR_SYMBOL_VALUE < pst->textlow
+               && CUR_SYMBOL_VALUE
+               != ANOFFSET (section_offsets, SECT_OFF_TEXT)))
+         {
+           pst->textlow = CUR_SYMBOL_VALUE;
+           textlow_not_set = 0;
+         }
 #endif /* DBXREAD_ONLY */
-             add_psymbol_to_list (namestring, p - namestring,
-                                  VAR_NAMESPACE, LOC_BLOCK,
-                                  &objfile->global_psymbols,
-                                  0, CUR_SYMBOL_VALUE,
-                                  psymtab_language, objfile);
-             continue;
-
-             /* Two things show up here (hopefully); static symbols of
-                local scope (static used inside braces) or extensions
-                of structure symbols.  We can ignore both.  */
-           case 'V':
-           case '(':
-           case '0':
-           case '1':
-           case '2':
-           case '3':
-           case '4':
-           case '5':
-           case '6':
-           case '7':
-           case '8':
-           case '9':
-           case '-':
-           case '#':   /* for symbol identification (used in live ranges) */
-          /* added to support cfront stabs strings */
-           case 'Z':   /* for definition continuations */
-           case 'P':   /* for prototypes */
-             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]);
-
-             /* Ignore it; perhaps it is an extension that we don't
-                know about.  */
-             continue;
-           }
-
-       case N_EXCL:
+       add_psymbol_to_list (namestring, p - namestring,
+                            VAR_NAMESPACE, LOC_BLOCK,
+                            &objfile->global_psymbols,
+                            0, CUR_SYMBOL_VALUE,
+                            psymtab_language, objfile);
+       continue;
+
+       /* Two things show up here (hopefully); static symbols of
+          local scope (static used inside braces) or extensions
+          of structure symbols.  We can ignore both.  */
+      case 'V':
+      case '(':
+      case '0':
+      case '1':
+      case '2':
+      case '3':
+      case '4':
+      case '5':
+      case '6':
+      case '7':
+      case '8':
+      case '9':
+      case '-':
+      case '#':                /* for symbol identification (used in live ranges) */
+       /* added to support cfront stabs strings */
+      case 'Z':                /* for definition continuations */
+      case 'P':                /* for prototypes */
+       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]);
+
+       /* Ignore it; perhaps it is an extension that we don't
+          know about.  */
+       continue;
+      }
+
+  case N_EXCL:
 #ifdef DBXREAD_ONLY
 
-         SET_NAMESTRING();
+    SET_NAMESTRING ();
 
-         /* Find the corresponding bincl and mark that psymtab on the
-            psymtab dependency list */
-         {
-           struct partial_symtab *needed_pst =
-             find_corresponding_bincl_psymtab (namestring, CUR_SYMBOL_VALUE);
+    /* Find the corresponding bincl and mark that psymtab on the
+       psymtab dependency list */
+    {
+      struct partial_symtab *needed_pst =
+      find_corresponding_bincl_psymtab (namestring, CUR_SYMBOL_VALUE);
 
-           /* If this include file was defined earlier in this file,
-              leave it alone.  */
-           if (needed_pst == pst) continue;
+      /* If this include file was defined earlier in this file,
+         leave it alone.  */
+      if (needed_pst == pst)
+       continue;
 
-           if (needed_pst)
+      if (needed_pst)
+       {
+         int i;
+         int found = 0;
+
+         for (i = 0; i < dependencies_used; i++)
+           if (dependency_list[i] == needed_pst)
              {
-               int i;
-               int found = 0;
-
-               for (i = 0; i < dependencies_used; i++)
-                 if (dependency_list[i] == needed_pst)
-                   {
-                     found = 1;
-                     break;
-                   }
-
-               /* If it's already in the list, skip the rest.  */
-               if (found) continue;
-
-               dependency_list[dependencies_used++] = needed_pst;
-               if (dependencies_used >= dependencies_allocated)
-                 {
-                   struct partial_symtab **orig = dependency_list;
-                   dependency_list =
-                     (struct partial_symtab **)
-                       alloca ((dependencies_allocated *= 2)
-                               * sizeof (struct partial_symtab *));
-                   memcpy ((PTR)dependency_list, (PTR)orig,
-                          (dependencies_used
-                           * sizeof (struct partial_symtab *)));
+               found = 1;
+               break;
+             }
+
+         /* If it's already in the list, skip the rest.  */
+         if (found)
+           continue;
+
+         dependency_list[dependencies_used++] = needed_pst;
+         if (dependencies_used >= dependencies_allocated)
+           {
+             struct partial_symtab **orig = dependency_list;
+             dependency_list =
+               (struct partial_symtab **)
+               alloca ((dependencies_allocated *= 2)
+                       * sizeof (struct partial_symtab *));
+             memcpy ((PTR) dependency_list, (PTR) orig,
+                     (dependencies_used
+                      * sizeof (struct partial_symtab *)));
 #ifdef DEBUG_INFO
-                   fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
-                   fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
-                            dependencies_allocated);
+             fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
+             fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
+                                 dependencies_allocated);
 #endif
-                 }
-             }
-         }
+           }
+       }
+    }
 #endif /* DBXREAD_ONLY */
-         continue;
+    continue;
 
-       case N_ENDM:
+  case N_ENDM:
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-         /* Solaris 2 end of module, finish current partial symbol table.
-            END_PSYMTAB will set pst->texthigh to the proper value, which
-            is necessary if a module compiled without debugging info
-            follows this module.  */
-         if (pst)
-           {
-             END_PSYMTAB (pst, psymtab_include_list, includes_used,
-                          symnum * symbol_size,
-                          (CORE_ADDR) 0,
-                          dependency_list, dependencies_used, textlow_not_set);
-             pst = (struct partial_symtab *) 0;
-             includes_used = 0;
-             dependencies_used = 0;
-           }
+    /* Solaris 2 end of module, finish current partial symbol table.
+       END_PSYMTAB will set pst->texthigh to the proper value, which
+       is necessary if a module compiled without debugging info
+       follows this module.  */
+    if (pst)
+      {
+       END_PSYMTAB (pst, psymtab_include_list, includes_used,
+                    symnum * symbol_size,
+                    (CORE_ADDR) 0,
+                    dependency_list, dependencies_used, textlow_not_set);
+       pst = (struct partial_symtab *) 0;
+       includes_used = 0;
+       dependencies_used = 0;
+      }
 #endif
-         continue;
+    continue;
 
-       case N_RBRAC:
+  case N_RBRAC:
 #ifdef HANDLE_RBRAC
-         HANDLE_RBRAC(CUR_SYMBOL_VALUE);
-         continue;
+    HANDLE_RBRAC (CUR_SYMBOL_VALUE);
+    continue;
 #endif
-       case N_EINCL:
-       case N_DSLINE:
-       case N_BSLINE:
-       case N_SSYM:            /* Claim: Structure or union element.
+  case N_EINCL:
+  case N_DSLINE:
+  case N_BSLINE:
+  case N_SSYM:                 /* Claim: Structure or union element.
                                   Hopefully, I can ignore this.  */
-       case N_ENTRY:           /* Alternate entry point; can ignore. */
-       case N_MAIN:            /* Can definitely ignore this.   */
-       case N_CATCH:           /* These are GNU C++ extensions */
-       case N_EHDECL:          /* that can safely be ignored here. */
-       case N_LENG:
-       case N_BCOMM:
-       case N_ECOMM:
-       case N_ECOML:
-       case N_FNAME:
-       case N_SLINE:
-       case N_RSYM:
-       case N_PSYM:
-       case N_LBRAC:
-       case N_NSYMS:           /* Ultrix 4.0: symbol count */
-       case N_DEFD:            /* GNU Modula-2 */
-       case N_ALIAS:           /* SunPro F77: alias name, ignore for now.  */
-
-       case N_OBJ:             /* useless types from Solaris */
-       case N_OPT:
-         /* These symbols aren't interesting; don't worry about them */
-
-         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 (CUR_SYMBOL_TYPE));
-         continue;
-       }
+  case N_ENTRY:                /* Alternate entry point; can ignore. */
+  case N_MAIN:                 /* Can definitely ignore this.   */
+  case N_CATCH:                /* These are GNU C++ extensions */
+  case N_EHDECL:               /* that can safely be ignored here. */
+  case N_LENG:
+  case N_BCOMM:
+  case N_ECOMM:
+  case N_ECOML:
+  case N_FNAME:
+  case N_SLINE:
+  case N_RSYM:
+  case N_PSYM:
+  case N_LBRAC:
+  case N_NSYMS:                /* Ultrix 4.0: symbol count */
+  case N_DEFD:                 /* GNU Modula-2 */
+  case N_ALIAS:                /* SunPro F77: alias name, ignore for now.  */
+
+  case N_OBJ:                  /* useless types from Solaris */
+  case N_OPT:
+    /* These symbols aren't interesting; don't worry about them */
+
+    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 (CUR_SYMBOL_TYPE));
+    continue;
+  }
index e6b6adfdd71741f94b71c1b2804a7e58b155c6f5..99b82ece16abd659733ed96f59b7e2e987d1ce0d 100644 (file)
@@ -2,21 +2,22 @@
    talking to a Motorola PPC 8xx ADS board
    Copyright 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -39,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 static void bdm_ppc_open PARAMS ((char *name, int from_tty));
 
 static int bdm_ppc_wait PARAMS ((int pid,
-                                struct target_waitstatus *target_status));
+                                struct target_waitstatus * target_status));
 
 static void bdm_ppc_fetch_registers PARAMS ((int regno));
 
@@ -47,7 +48,7 @@ static void bdm_ppc_store_registers PARAMS ((int regno));
 
 extern struct target_ops bdm_ppc_ops;  /* Forward decl */
 \f
-/*#define BDM_NUM_REGS 71*/
+/*#define BDM_NUM_REGS 71 */
 #define BDM_NUM_REGS 24
 
 #define BDM_REGMAP \
@@ -67,10 +68,11 @@ extern struct target_ops bdm_ppc_ops;       /* Forward decl */
        8,         /* lr (SPR 8) */ \
        9,         /* cnt (CTR (SPR 9)) */ \
        1,         /* xer (SPR 1) */ \
-       0,         /* mq (SPR 0) */
-
+       0,                      /* mq (SPR 0) */
 \f
-char nowatchdog[4] = {0xff,0xff,0xff,0x88};
+
+char nowatchdog[4] =
+{0xff, 0xff, 0xff, 0x88};
 
 /* Open a connection to a remote debugger.
    NAME is the filename used for communication.  */
@@ -114,14 +116,14 @@ bdm_ppc_wait (pid, target_status)
       return inferior_pid;
     }
 
-  target_status->value.sig = TARGET_SIGNAL_TRAP; /* XXX for now */
+  target_status->value.sig = TARGET_SIGNAL_TRAP;       /* XXX for now */
 
 #if 0
   {
     unsigned long ecr, der;
 
-    ecr = ocd_read_bdm_register (148); /* Read the exception cause register */
-    der = ocd_read_bdm_register (149); /* Read the debug enables register */
+    ecr = ocd_read_bdm_register (148); /* Read the exception cause register */
+    der = ocd_read_bdm_register (149); /* Read the debug enables register */
     fprintf_unfiltered (gdb_stdout, "ecr = 0x%x, der = 0x%x\n", ecr, der);
   }
 #endif
@@ -129,25 +131,26 @@ bdm_ppc_wait (pid, target_status)
   return inferior_pid;
 }
 \f
-static int bdm_regmap[] = {BDM_REGMAP};
+static int bdm_regmap[] =
+{BDM_REGMAP};
 
 /* Read the remote registers into regs.
    Fetch register REGNO, or all registers if REGNO == -1
 
    The Wiggler uses the following codes to access the registers:
 
-   0 -> 1023           SPR 0 -> 1023
-       0 - SPR 0 - MQ
-       1 - SPR 1 - XER
-       8 - SPR 8 - LR
-       9 - SPR 9 - CTR (known as cnt in GDB)
-       26 - SPR 26 - SRR0 - pc
-   1024 -> 2047                DCR 0 -> DCR 1023 (IBM PPC 4xx only)
-   2048 -> 2079                R0 -> R31
-   2080 -> 2143                FP0 -> FP31 (64 bit regs) (IBM PPC 5xx only)
-   2144                        CR (known as cnd in GDB)
-   2145                        FPCSR
-   2146                        MSR (known as ps in GDB)
+   0 -> 1023            SPR 0 -> 1023
+   0 - SPR 0 - MQ
+   1 - SPR 1 - XER
+   8 - SPR 8 - LR
+   9 - SPR 9 - CTR (known as cnt in GDB)
+   26 - SPR 26 - SRR0 - pc
+   1024 -> 2047         DCR 0 -> DCR 1023 (IBM PPC 4xx only)
+   2048 -> 2079         R0 -> R31
+   2080 -> 2143         FP0 -> FP31 (64 bit regs) (IBM PPC 5xx only)
+   2144                 CR (known as cnd in GDB)
+   2145                 FPCSR
+   2146                 MSR (known as ps in GDB)
  */
 
 static void
@@ -183,8 +186,8 @@ bdm_ppc_fetch_registers (regno)
       first_regno = regno;
       last_regno = regno;
 
-      first_bdm_regno = bdm_regmap [regno];
-      last_bdm_regno = bdm_regmap [regno];
+      first_bdm_regno = bdm_regmap[regno];
+      last_bdm_regno = bdm_regmap[regno];
     }
 
   if (first_bdm_regno == -1)
@@ -202,26 +205,27 @@ bdm_ppc_fetch_registers (regno)
 
       /* if asking for an invalid register */
       if ((first_regno == MQ_REGNUM) ||
-          ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
+         ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
        {
 /*          printf("invalid reg request!\n"); */
-          supply_register (first_regno, NULL);
-          return;                   /* Unsupported register */
-        }
+         supply_register (first_regno, NULL);
+         return;               /* Unsupported register */
+       }
       else
        {
-          regs = ocd_read_bdm_registers (first_bdm_regno,
-                                               last_bdm_regno, &reglen);
-        }
+         regs = ocd_read_bdm_registers (first_bdm_regno,
+                                        last_bdm_regno, &reglen);
+       }
     }
-  else         /* want all regs */
+  else
+    /* want all regs */
     {
 /*      printf("Asking for registers %d to %d\n", first_regno, last_regno); */
       beginregs = ocd_read_bdm_registers (first_bdm_regno,
-                                       FP0_REGNUM - 1, &beginreglen);
-      endregs = (strcat (midregs, 
-                               ocd_read_bdm_registers (FPLAST_REGNUM + 1,
-                                       last_bdm_regno - 1, &endreglen)));
+                                         FP0_REGNUM - 1, &beginreglen);
+      endregs = (strcat (midregs,
+                        ocd_read_bdm_registers (FPLAST_REGNUM + 1,
+                                         last_bdm_regno - 1, &endreglen)));
       almostregs = (strcat (beginregs, endregs));
       regs = (strcat (almostregs, mqreg));
       reglen = beginreglen + 32 + endreglen + 1;
@@ -236,7 +240,7 @@ bdm_ppc_fetch_registers (regno)
     {
       int bdm_regno, regoffset;
 
-      bdm_regno = bdm_regmap [i];
+      bdm_regno = bdm_regmap[i];
       if (bdm_regno != -1)
        {
          regoffset = bdm_regno - first_bdm_regno;
@@ -247,7 +251,7 @@ bdm_ppc_fetch_registers (regno)
          supply_register (i, regs + 4 * regoffset);
        }
       else
-       supply_register (i, NULL); /* Unsupported register */
+       supply_register (i, NULL);      /* Unsupported register */
     }
 }
 
@@ -275,8 +279,8 @@ bdm_ppc_store_registers (regno)
       first_regno = regno;
       last_regno = regno;
 
-      first_bdm_regno = bdm_regmap [regno];
-      last_bdm_regno = bdm_regmap [regno];
+      first_bdm_regno = bdm_regmap[regno];
+      last_bdm_regno = bdm_regmap[regno];
     }
 
   if (first_bdm_regno == -1)
@@ -286,102 +290,102 @@ bdm_ppc_store_registers (regno)
     {
       int bdm_regno;
 
-      bdm_regno = bdm_regmap [i];
+      bdm_regno = bdm_regmap[i];
 
       /* only attempt to write if it's a valid ppc 8xx register */
       /* (need to avoid FP regs and MQ reg) */
       if ((i != MQ_REGNUM) && ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
        {
 /*          printf("write valid reg %d\n", bdm_regno); */
-          ocd_write_bdm_registers (bdm_regno, registers + REGISTER_BYTE (i), 4);
-        }
+         ocd_write_bdm_registers (bdm_regno, registers + REGISTER_BYTE (i), 4);
+       }
 /*
-      else if (i == MQ_REGNUM)
-        printf("don't write invalid reg %d (MQ_REGNUM)\n", bdm_regno);
-      else
-        printf("don't write invalid reg %d\n", bdm_regno);
-*/
+   else if (i == MQ_REGNUM)
+   printf("don't write invalid reg %d (MQ_REGNUM)\n", bdm_regno);
+   else
+   printf("don't write invalid reg %d\n", bdm_regno);
+ */
     }
 }
 \f
 /* Define the target subroutine names */
 
-struct target_ops bdm_ppc_ops ;
+struct target_ops bdm_ppc_ops;
 
-static void 
-init_bdm_ppc_ops(void)
+static void
+init_bdm_ppc_ops (void)
 {
-  bdm_ppc_ops.to_shortname =   "ocd";          
-  bdm_ppc_ops.to_longname =   "Remote target with On-Chip Debugging";
-  bdm_ppc_ops.to_doc =   "Use a remote target with On-Chip Debugging.  To use a target box;\n\
+  bdm_ppc_ops.to_shortname = "ocd";
+  bdm_ppc_ops.to_longname = "Remote target with On-Chip Debugging";
+  bdm_ppc_ops.to_doc = "Use a remote target with On-Chip Debugging.  To use a target box;\n\
 specify the serial device it is connected to (e.g. /dev/ttya).  To use\n\
 a wiggler, specify wiggler and then the port it is connected to\n\
-(e.g. wiggler lpt1)." ;        /* to_doc */
-  bdm_ppc_ops.to_open =   bdm_ppc_open;        
-  bdm_ppc_ops.to_close =   ocd_close;  
-  bdm_ppc_ops.to_attach =   NULL;
+(e.g. wiggler lpt1)."        /* to_doc */
+  bdm_ppc_ops.to_open = bdm_ppc_open;
+  bdm_ppc_ops.to_close = ocd_close;
+  bdm_ppc_ops.to_attach = NULL;
   bdm_ppc_ops.to_post_attach = NULL;
   bdm_ppc_ops.to_require_attach = NULL;
-  bdm_ppc_ops.to_detach =   ocd_detach;
+  bdm_ppc_ops.to_detach = ocd_detach;
   bdm_ppc_ops.to_require_detach = NULL;
-  bdm_ppc_ops.to_resume =   ocd_resume;        
-  bdm_ppc_ops.to_wait  =   bdm_ppc_wait;
+  bdm_ppc_ops.to_resume = ocd_resume;
+  bdm_ppc_ops.to_wait = bdm_ppc_wait;
   bdm_ppc_ops.to_post_wait = NULL;
-  bdm_ppc_ops.to_fetch_registers  =   bdm_ppc_fetch_registers;
-  bdm_ppc_ops.to_store_registers  =   bdm_ppc_store_registers;
-  bdm_ppc_ops.to_prepare_to_store =   ocd_prepare_to_store;    
-  bdm_ppc_ops.to_xfer_memory  =   ocd_xfer_memory;             
-  bdm_ppc_ops.to_files_info  =   ocd_files_info;               
-  bdm_ppc_ops.to_insert_breakpoint =   ocd_insert_breakpoint;  
-  bdm_ppc_ops.to_remove_breakpoint =   ocd_remove_breakpoint;  
-  bdm_ppc_ops.to_terminal_init  =   NULL;                      
-  bdm_ppc_ops.to_terminal_inferior =   NULL;                   
-  bdm_ppc_ops.to_terminal_ours_for_output =   NULL;            
-  bdm_ppc_ops.to_terminal_ours  =   NULL;                      
-  bdm_ppc_ops.to_terminal_info  =   NULL;                      
-  bdm_ppc_ops.to_kill  =   ocd_kill;           
-  bdm_ppc_ops.to_load  =   ocd_load;           
-  bdm_ppc_ops.to_lookup_symbol =   NULL;       
-  bdm_ppc_ops.to_create_inferior =   ocd_create_inferior;
+  bdm_ppc_ops.to_fetch_registers = bdm_ppc_fetch_registers;
+  bdm_ppc_ops.to_store_registers = bdm_ppc_store_registers;
+  bdm_ppc_ops.to_prepare_to_store = ocd_prepare_to_store;
+  bdm_ppc_ops.to_xfer_memory = ocd_xfer_memory;
+  bdm_ppc_ops.to_files_info = ocd_files_info;
+  bdm_ppc_ops.to_insert_breakpoint = ocd_insert_breakpoint;
+  bdm_ppc_ops.to_remove_breakpoint = ocd_remove_breakpoint;
+  bdm_ppc_ops.to_terminal_init = NULL;
+  bdm_ppc_ops.to_terminal_inferior = NULL;
+  bdm_ppc_ops.to_terminal_ours_for_output = NULL;
+  bdm_ppc_ops.to_terminal_ours = NULL;
+  bdm_ppc_ops.to_terminal_info = NULL;
+  bdm_ppc_ops.to_kill = ocd_kill;
+  bdm_ppc_ops.to_load = ocd_load;
+  bdm_ppc_ops.to_lookup_symbol = NULL;
+  bdm_ppc_ops.to_create_inferior = ocd_create_inferior;
   bdm_ppc_ops.to_post_startup_inferior = NULL;
   bdm_ppc_ops.to_acknowledge_created_inferior = NULL;
-  bdm_ppc_ops.to_clone_and_follow_inferior = NULL;          
-  bdm_ppc_ops.to_post_follow_inferior_by_clone = NULL;  
+  bdm_ppc_ops.to_clone_and_follow_inferior = NULL;
+  bdm_ppc_ops.to_post_follow_inferior_by_clone = NULL;
   bdm_ppc_ops.to_insert_fork_catchpoint = NULL;
   bdm_ppc_ops.to_remove_fork_catchpoint = NULL;
   bdm_ppc_ops.to_insert_vfork_catchpoint = NULL;
-  bdm_ppc_ops.to_remove_vfork_catchpoint = NULL;                      
+  bdm_ppc_ops.to_remove_vfork_catchpoint = NULL;
   bdm_ppc_ops.to_has_forked = NULL;
-  bdm_ppc_ops.to_has_vforked = NULL;            
-  bdm_ppc_ops.to_can_follow_vfork_prior_to_exec = NULL;            
+  bdm_ppc_ops.to_has_vforked = NULL;
+  bdm_ppc_ops.to_can_follow_vfork_prior_to_exec = NULL;
   bdm_ppc_ops.to_post_follow_vfork = NULL;
   bdm_ppc_ops.to_insert_exec_catchpoint = NULL;
   bdm_ppc_ops.to_remove_exec_catchpoint = NULL;
   bdm_ppc_ops.to_has_execd = NULL;
   bdm_ppc_ops.to_reported_exec_events_per_exec_call = NULL;
   bdm_ppc_ops.to_has_exited = NULL;
-  bdm_ppc_ops.to_mourn_inferior =   ocd_mourn; 
-  bdm_ppc_ops.to_can_run  =   0;               
-  bdm_ppc_ops.to_notice_signals =   0;         
-  bdm_ppc_ops.to_thread_alive  =   ocd_thread_alive;
-  bdm_ppc_ops.to_stop  =   ocd_stop;
+  bdm_ppc_ops.to_mourn_inferior = ocd_mourn;
+  bdm_ppc_ops.to_can_run = 0;
+  bdm_ppc_ops.to_notice_signals = 0;
+  bdm_ppc_ops.to_thread_alive = ocd_thread_alive;
+  bdm_ppc_ops.to_stop = ocd_stop;
   bdm_ppc_ops.to_pid_to_exec_file = NULL;
-  bdm_ppc_ops.to_core_file_to_sym_file = NULL;                 
-  bdm_ppc_ops.to_stratum =   process_stratum;          
-  bdm_ppc_ops.DONT_USE =   NULL;                       
-  bdm_ppc_ops.to_has_all_memory =   1;                 
-  bdm_ppc_ops.to_has_memory =   1;                     
-  bdm_ppc_ops.to_has_stack =   1;                      
-  bdm_ppc_ops.to_has_registers =   1;                  
-  bdm_ppc_ops.to_has_execution =   1;                  
-  bdm_ppc_ops.to_sections =   NULL;                    
-  bdm_ppc_ops.to_sections_end =   NULL;                        
-  bdm_ppc_ops.to_magic =   OPS_MAGIC ;                 
-} /* init_bdm_ppc_ops */
+  bdm_ppc_ops.to_core_file_to_sym_file = NULL;
+  bdm_ppc_ops.to_stratum = process_stratum;
+  bdm_ppc_ops.DONT_USE = NULL;
+  bdm_ppc_ops.to_has_all_memory = 1;
+  bdm_ppc_ops.to_has_memory = 1;
+  bdm_ppc_ops.to_has_stack = 1;
+  bdm_ppc_ops.to_has_registers = 1;
+  bdm_ppc_ops.to_has_execution = 1;
+  bdm_ppc_ops.to_sections = NULL;
+  bdm_ppc_ops.to_sections_end = NULL;
+  bdm_ppc_ops.to_magic = OPS_MAGIC;
+}                              /* init_bdm_ppc_ops */
 
 void
 _initialize_bdm_ppc ()
 {
-  init_bdm_ppc_ops() ;
+  init_bdm_ppc_ops ();
   add_target (&bdm_ppc_ops);
 }
index 9496916f44b75fcff7947ce4d538357fbd06f424..3eac535e7a4aa2b85c7502a0081d77869b78aacd 100644 (file)
@@ -4,21 +4,22 @@
 
    Written by Stu Grossman of Cygnus Support
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -107,18 +108,18 @@ ppcbug_supply_register (regname, regnamelen, val, vallen)
 
 static char *ppcbug_regnames[NUM_REGS] =
 {
-  "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",
+  "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",
 
-  "fr0",  "fr1",  "fr2",  "fr3",  "fr4",  "fr5",  "fr6",  "fr7",
-  "fr8",  "fr9",  "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
+  "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
+  "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
   "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
   "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31",
 
 /* pc      ps      cnd     lr      cnt     xer     mq */
-  "ip",   "msr",  "cr",   "spr8", "spr9", "spr1", "spr0"
+  "ip", "msr", "cr", "spr8", "spr9", "spr1", "spr0"
 };
 
 /*
@@ -130,65 +131,66 @@ static char *ppcbug_regnames[NUM_REGS] =
 static struct target_ops ppcbug_ops0;
 static struct target_ops ppcbug_ops1;
 
-static char *ppcbug_inits[] = {"\r", NULL};
+static char *ppcbug_inits[] =
+{"\r", NULL};
 
 static void
-init_ppc_cmds (char  * LOAD_CMD,
-              struct monitor_ops * OPS,
-              struct target_ops * targops)
+init_ppc_cmds (char *LOAD_CMD,
+              struct monitor_ops *OPS,
+              struct target_ops *targops)
 {
-  OPS->flags = MO_CLR_BREAK_USES_ADDR | MO_HANDLE_NL;  
-  OPS->init = ppcbug_inits;            /* Init strings */
-  OPS->cont = "g\r";                   /* continue command */          
-  OPS->step = "t\r";                   /* single step */               
-  OPS->stop = NULL;                    /* interrupt command */ 
-  OPS->set_break = "br %x\r";          /* set a breakpoint */  
-  OPS->clr_break = "nobr %x\r";                /* clear a breakpoint */
+  OPS->flags = MO_CLR_BREAK_USES_ADDR | MO_HANDLE_NL;
+  OPS->init = ppcbug_inits;    /* Init strings */
+  OPS->cont = "g\r";           /* continue command */
+  OPS->step = "t\r";           /* single step */
+  OPS->stop = NULL;            /* interrupt command */
+  OPS->set_break = "br %x\r";  /* set a breakpoint */
+  OPS->clr_break = "nobr %x\r";        /* clear a breakpoint */
   OPS->clr_all_break = "nobr\r";       /* clear all breakpoints */
-  OPS->fill = "bf %x:%x %x;b\r";       /* fill (start count val) */            
-  OPS->setmem.cmdb = "ms %x %02x\r";   /* setmem.cmdb (addr, value) */         
-  OPS->setmem.cmdw = "ms %x %04x\r";   /* setmem.cmdw (addr, value) */         
-  OPS->setmem.cmdl = "ms %x %08x\r";   /* setmem.cmdl (addr, value) */         
-  OPS->setmem.cmdll = NULL;            /* setmem.cmdll (addr, value) */        
-  OPS->setmem.resp_delim = NULL;       /* setreg.resp_delim */         
-  OPS->setmem.term = NULL;             /* setreg.term */                       
-  OPS->setmem.term_cmd = NULL;         /* setreg.term_cmd */           
-  OPS->getmem.cmdb = "md %x:%x;b\r";   /* getmem.cmdb (addr, len) */           
-  OPS->getmem.cmdw = "md %x:%x;b\r";   /* getmem.cmdw (addr, len) */           
-  OPS->getmem.cmdl = "md %x:%x;b\r";   /* getmem.cmdl (addr, len) */           
-  OPS->getmem.cmdll = NULL;            /* getmem.cmdll (addr, len) */          
-  OPS->getmem.resp_delim = " ";                /* getmem.resp_delim */         
-  OPS->getmem.term = NULL;             /* getmem.term */                       
-  OPS->getmem.term_cmd = NULL;         /* getmem.term_cmd */           
-  OPS->setreg.cmd = "rs %s %x\r";      /* setreg.cmd (name, value) */          
-  OPS->setreg.resp_delim = NULL;       /* setreg.resp_delim */         
-  OPS->setreg.term = NULL;             /* setreg.term */                       
-  OPS->setreg.term_cmd = NULL  ;       /* setreg.term_cmd */                   
-  OPS->getreg.cmd = "rs %s\r";         /* getreg.cmd (name) */         
-  OPS->getreg.resp_delim = "=";                /* getreg.resp_delim */         
-  OPS->getreg.term = NULL;             /* getreg.term */                       
-  OPS->getreg.term_cmd = NULL  ;       /* getreg.term_cmd */                   
-  OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ 
-  OPS->supply_register = ppcbug_supply_register;       /* supply_register */           
-  OPS->dump_registers = "rd\r";                /* dump all registers */
-  OPS->load_routine = NULL;            /* load_routine (defaults to SRECs) */  
-  OPS->load = LOAD_CMD;                        /* download command */                          
-  OPS->loadresp = NULL;                        /* load response */                     
-  OPS->prompt = "PPC1-Bug>";           /* monitor command prompt */            
-  OPS->line_term = "\r";               /* end-of-line terminator */    
-  OPS->cmd_end = NULL;                 /* optional command terminator */       
-  OPS->target = targops ;              /* target operations */                 
-  OPS->stopbits = SERIAL_1_STOPBITS;   /* number of stop bits */               
-  OPS->regnames = ppcbug_regnames;     /* registers names */                   
-  OPS->magic = MONITOR_OPS_MAGIC;      /* magic */                             
+  OPS->fill = "bf %x:%x %x;b\r";       /* fill (start count val) */
+  OPS->setmem.cmdb = "ms %x %02x\r";   /* setmem.cmdb (addr, value) */
+  OPS->setmem.cmdw = "ms %x %04x\r";   /* setmem.cmdw (addr, value) */
+  OPS->setmem.cmdl = "ms %x %08x\r";   /* setmem.cmdl (addr, value) */
+  OPS->setmem.cmdll = NULL;    /* setmem.cmdll (addr, value) */
+  OPS->setmem.resp_delim = NULL;       /* setreg.resp_delim */
+  OPS->setmem.term = NULL;     /* setreg.term */
+  OPS->setmem.term_cmd = NULL; /* setreg.term_cmd */
+  OPS->getmem.cmdb = "md %x:%x;b\r";   /* getmem.cmdb (addr, len) */
+  OPS->getmem.cmdw = "md %x:%x;b\r";   /* getmem.cmdw (addr, len) */
+  OPS->getmem.cmdl = "md %x:%x;b\r";   /* getmem.cmdl (addr, len) */
+  OPS->getmem.cmdll = NULL;    /* getmem.cmdll (addr, len) */
+  OPS->getmem.resp_delim = " ";        /* getmem.resp_delim */
+  OPS->getmem.term = NULL;     /* getmem.term */
+  OPS->getmem.term_cmd = NULL; /* getmem.term_cmd */
+  OPS->setreg.cmd = "rs %s %x\r";      /* setreg.cmd (name, value) */
+  OPS->setreg.resp_delim = NULL;       /* setreg.resp_delim */
+  OPS->setreg.term = NULL;     /* setreg.term */
+  OPS->setreg.term_cmd = NULL; /* setreg.term_cmd */
+  OPS->getreg.cmd = "rs %s\r"; /* getreg.cmd (name) */
+  OPS->getreg.resp_delim = "=";        /* getreg.resp_delim */
+  OPS->getreg.term = NULL;     /* getreg.term */
+  OPS->getreg.term_cmd = NULL; /* getreg.term_cmd */
+  OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";                /* register_pattern */
+  OPS->supply_register = ppcbug_supply_register;       /* supply_register */
+  OPS->dump_registers = "rd\r";        /* dump all registers */
+  OPS->load_routine = NULL;    /* load_routine (defaults to SRECs) */
+  OPS->load = LOAD_CMD;                /* download command */
+  OPS->loadresp = NULL;                /* load response */
+  OPS->prompt = "PPC1-Bug>";   /* monitor command prompt */
+  OPS->line_term = "\r";       /* end-of-line terminator */
+  OPS->cmd_end = NULL;         /* optional command terminator */
+  OPS->target = targops;       /* target operations */
+  OPS->stopbits = SERIAL_1_STOPBITS;   /* number of stop bits */
+  OPS->regnames = ppcbug_regnames;     /* registers names */
+  OPS->magic = MONITOR_OPS_MAGIC;      /* magic */
 }
 
 
-static struct monitor_ops ppcbug_cmds0 ;
-static struct monitor_ops ppcbug_cmds1 ;
+static struct monitor_ops ppcbug_cmds0;
+static struct monitor_ops ppcbug_cmds1;
 
 static void
-ppcbug_open0(args, from_tty)
+ppcbug_open0 (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -196,7 +198,7 @@ ppcbug_open0(args, from_tty)
 }
 
 static void
-ppcbug_open1(args, from_tty)
+ppcbug_open1 (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -206,8 +208,8 @@ ppcbug_open1(args, from_tty)
 void
 _initialize_ppcbug_rom ()
 {
-  init_ppc_cmds("lo 0\r", &ppcbug_cmds0, &ppcbug_ops0) ;
-  init_ppc_cmds("lo 1\r", &ppcbug_cmds1, &ppcbug_ops1);
+  init_ppc_cmds ("lo 0\r", &ppcbug_cmds0, &ppcbug_ops0);
+  init_ppc_cmds ("lo 1\r", &ppcbug_cmds1, &ppcbug_ops1);
   init_monitor_ops (&ppcbug_ops0);
 
   ppcbug_ops0.to_shortname = "ppcbug";
index 839d1c14bfcd35edc61567c82d8f1823410541b6..252af4a2bc5b10cdc0897af4b86226fa102c4d8b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 93, 94, 95, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -33,18 +34,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "demangle.h"
 #include "valprint.h"
 #include "annotate.h"
-#include "symfile.h"   /* for overlay functions */
-#include "objfiles.h"  /* ditto */
+#include "symfile.h"           /* for overlay functions */
+#include "objfiles.h"          /* ditto */
 
 extern int asm_demangle;       /* Whether to demangle syms in asm printouts */
 extern int addressprint;       /* Whether to print hex addresses in HLL " */
 
 struct format_data
-{
-  int count;
-  char format;
-  char size;
-};
+  {
+    int count;
+    char format;
+    char size;
+  };
 
 /* Last specified output format.  */
 
@@ -94,20 +95,20 @@ int current_display_number;
 int inspect_it = 0;
 
 struct display
-{
-  /* Chain link to next auto-display item.  */
-  struct display *next;
-  /* Expression to be evaluated and displayed.  */
-  struct expression *exp;
-  /* Item number of this auto-display item.  */
-  int number;
-  /* Display format specified.  */
-  struct format_data format;
-  /* Innermost block required by this expression when evaluated */
-  struct block *block;
-  /* Status of this display (enabled or disabled) */
-  enum enable status;
-};
+  {
+    /* Chain link to next auto-display item.  */
+    struct display *next;
+    /* Expression to be evaluated and displayed.  */
+    struct expression *exp;
+    /* Item number of this auto-display item.  */
+    int number;
+    /* Display format specified.  */
+    struct format_data format;
+    /* Innermost block required by this expression when evaluated */
+    struct block *block;
+    /* Status of this display (enabled or disabled) */
+    enum enable status;
+  };
 
 /* Chain of expressions whose values should be displayed
    automatically each time the program stops.  */
@@ -163,7 +164,7 @@ static void print_command_1 PARAMS ((char *, int, int));
 
 static void validate_format PARAMS ((struct format_data, char *));
 
-static void do_examine PARAMS ((struct format_data, CORE_ADDR addr, asection *section));
+static void do_examine PARAMS ((struct format_data, CORE_ADDR addr, asection * section));
 
 static void print_formatted PARAMS ((value_ptr, int, int));
 
@@ -172,8 +173,8 @@ static struct format_data decode_format PARAMS ((char **, int, int));
 static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
 
 static void sym_info PARAMS ((char *, int));
-
 \f
+
 /* Decode a format specification.  *STRING_PTR should point to it.
    OFORMAT and OSIZE are used as defaults for the format and size
    if none are given in the format specification.
@@ -199,7 +200,8 @@ decode_format (string_ptr, oformat, osize)
 
   if (*p >= '0' && *p <= '9')
     val.count = atoi (p);
-  while (*p >= '0' && *p <= '9') p++;
+  while (*p >= '0' && *p <= '9')
+    p++;
 
   /* Now process size or format letters that follow.  */
 
@@ -213,7 +215,8 @@ decode_format (string_ptr, oformat, osize)
        break;
     }
 
-  while (*p == ' ' || *p == '\t') p++;
+  while (*p == ' ' || *p == '\t')
+    p++;
   *string_ptr = p;
 
   /* Set defaults for format and size if not specified.  */
@@ -299,10 +302,10 @@ print_formatted (val, format, size)
 
     case 'i':
       /* The old comment says
-        "Force output out, print_insn not using _filtered".
-        I'm not completely sure what that means, I suspect most print_insn
-        now do use _filtered, so I guess it's obsolete.
-          --Yes, it does filter now, and so this is obsolete.  -JB  */
+         "Force output out, print_insn not using _filtered".
+         I'm not completely sure what that means, I suspect most print_insn
+         now do use _filtered, so I guess it's obsolete.
+         --Yes, it does filter now, and so this is obsolete.  -JB  */
 
       /* We often wrap here if there are long symbolic names.  */
       wrap_here ("    ");
@@ -317,16 +320,16 @@ print_formatted (val, format, size)
          || TYPE_CODE (type) == TYPE_CODE_STRING
          || TYPE_CODE (type) == TYPE_CODE_STRUCT
          || TYPE_CODE (type) == TYPE_CODE_UNION)
-        /* If format is 0, use the 'natural' format for
-         * that type of value.  If the type is non-scalar,
-         * we have to use language rules to print it as
-         * a series of scalars.
-         */
+       /* If format is 0, use the 'natural' format for
+        * that type of value.  If the type is non-scalar,
+        * we have to use language rules to print it as
+        * a series of scalars.
+        */
        value_print (val, gdb_stdout, format, Val_pretty_default);
       else
-        /* User specified format, so don't look to the
-         * the type to tell us what to do.
-         */
+       /* User specified format, so don't look to the
+        * the type to tell us what to do.
+        */
        print_scalar_formatted (VALUE_CONTENTS (val), type,
                                format, size, gdb_stdout);
     }
@@ -358,8 +361,8 @@ print_scalar_formatted (valaddr, type, format, size, stream)
          || format == 'd'
          || format == 'x'))
     {
-      if (! TYPE_UNSIGNED (type)
-         || ! extract_long_unsigned_integer (valaddr, len, &val_long))
+      if (!TYPE_UNSIGNED (type)
+         || !extract_long_unsigned_integer (valaddr, len, &val_long))
        {
          /* We can't print it normally, but we can print it in hex.
             Printing it in the wrong radix is more useful than saying
@@ -369,19 +372,18 @@ print_scalar_formatted (valaddr, type, format, size, stream)
          /* FIXME:  we should be using the size field to give us a
             minimum field width to print.  */
 
-          if( format == 'o' )
-              print_octal_chars (stream, valaddr, len);
-          else if( format == 'd' )
-              print_decimal_chars (stream, valaddr, len );
-          else if( format == 't' )
-              print_binary_chars (stream, valaddr, len);
-          else
-
-              /* replace with call to print_hex_chars? Looks
-                 like val_print_type_code_int is redoing
-                 work.  - edie */
+         if (format == 'o')
+           print_octal_chars (stream, valaddr, len);
+         else if (format == 'd')
+           print_decimal_chars (stream, valaddr, len);
+         else if (format == 't')
+           print_binary_chars (stream, valaddr, len);
+         else
+           /* replace with call to print_hex_chars? Looks
+              like val_print_type_code_int is redoing
+              work.  - edie */
 
-             val_print_type_code_int (type, valaddr, stream);
+           val_print_type_code_int (type, valaddr, stream);
 
          return;
        }
@@ -448,9 +450,9 @@ print_scalar_formatted (valaddr, type, format, size, stream)
 
     case 'f':
       if (len == sizeof (float))
-       type = builtin_type_float;
+         type = builtin_type_float;
       else if (len == sizeof (double))
-       type = builtin_type_double;
+         type = builtin_type_double;
       print_floating (valaddr, type, stream);
       break;
 
@@ -460,15 +462,15 @@ print_scalar_formatted (valaddr, type, format, size, stream)
     case 't':
       /* Binary; 't' stands for "two".  */
       {
-        char bits[8*(sizeof val_long) + 1];
-        char buf[8*(sizeof val_long) + 32];
+       char bits[8 * (sizeof val_long) + 1];
+       char buf[8 * (sizeof val_long) + 32];
        char *cp = bits;
        int width;
 
-        if (!size)
-         width = 8*(sizeof val_long);
-        else
-          switch (size)
+       if (!size)
+         width = 8 * (sizeof val_long);
+       else
+         switch (size)
            {
            case 'b':
              width = 8;
@@ -486,12 +488,12 @@ print_scalar_formatted (valaddr, type, format, size, stream)
              error ("Undefined output size \"%c\".", size);
            }
 
-        bits[width] = '\0';
-        while (width-- > 0)
-          {
-            bits[width] = (val_long & 1) ? '1' : '0';
-            val_long >>= 1;
-          }
+       bits[width] = '\0';
+       while (width-- > 0)
+         {
+           bits[width] = (val_long & 1) ? '1' : '0';
+           val_long >>= 1;
+         }
        if (!size)
          {
            while (*cp && *cp == '0')
@@ -499,10 +501,10 @@ print_scalar_formatted (valaddr, type, format, size, stream)
            if (*cp == '\0')
              cp--;
          }
-       strcpy (buf, local_binary_format_prefix());
+       strcpy (buf, local_binary_format_prefix ());
        strcat (buf, cp);
-       strcat (buf, local_binary_format_suffix());     
-        fprintf_filtered (stream, buf);
+       strcat (buf, local_binary_format_suffix ());
+       fprintf_filtered (stream, buf);
       }
       break;
 
@@ -522,7 +524,7 @@ set_next_address (addr)
 
   /* Make address available to the user as $_.  */
   set_internalvar (lookup_internalvar ("_"),
-                  value_from_longest (lookup_pointer_type (builtin_type_void),
+               value_from_longest (lookup_pointer_type (builtin_type_void),
                                    (LONGEST) addr));
 }
 
@@ -634,7 +636,7 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
     fputs_filtered ("<", stream);
   fputs_filtered (name, stream);
   if (addr != name_location)
-    fprintf_filtered (stream, "+%u", (unsigned int)(addr - name_location));
+    fprintf_filtered (stream, "+%u", (unsigned int) (addr - name_location));
 
   /* Append source filename and line number if desired.  Give specific
      line # of this addr, if we have it; else line # of the nearest symbol.  */
@@ -788,14 +790,14 @@ do_examine (fmt, addr, sect)
            value_free (last_examine_value);
 
          /* The value to be displayed is not fetched greedily.
-             Instead, to avoid the posibility of a fetched value not
-             being used, its retreval is delayed until the print code
-             uses it.  When examining an instruction stream, the
-             disassembler will perform its own memory fetch using just
-             the address stored in LAST_EXAMINE_VALUE.  FIXME: Should
-             the disassembler be modified so that LAST_EXAMINE_VALUE
-             is left with the byte sequence from the last complete
-             instruction fetched from memory? */
+            Instead, to avoid the posibility of a fetched value not
+            being used, its retreval is delayed until the print code
+            uses it.  When examining an instruction stream, the
+            disassembler will perform its own memory fetch using just
+            the address stored in LAST_EXAMINE_VALUE.  FIXME: Should
+            the disassembler be modified so that LAST_EXAMINE_VALUE
+            is left with the byte sequence from the last complete
+            instruction fetched from memory? */
          last_examine_value = value_at_lazy (val_type, next_address, sect);
 
          if (last_examine_value)
@@ -824,9 +826,9 @@ validate_format (fmt, cmdname)
 }
 
 /*  Evaluate string EXP as an expression in the current language and
-    print the resulting value.  EXP may contain a format specifier as the
-    first argument ("/x myvar" for example, to print myvar in hex).
   */
+   print the resulting value.  EXP may contain a format specifier as the
+   first argument ("/x myvar" for example, to print myvar in hex).
+ */
 
 static void
 print_command_1 (exp, inspect, voidprint)
@@ -862,8 +864,8 @@ print_command_1 (exp, inspect, voidprint)
     {
       struct type *type;
       expr = parse_expression (exp);
-      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                &expr);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                               &expr);
       cleanup = 1;
       val = evaluate_expression (expr);
 
@@ -871,9 +873,9 @@ print_command_1 (exp, inspect, voidprint)
       type = VALUE_TYPE (val);
 
       if (objectprint
-         && (   TYPE_CODE (type) == TYPE_CODE_PTR
+         && (TYPE_CODE (type) == TYPE_CODE_PTR
              || TYPE_CODE (type) == TYPE_CODE_REF)
-         && (   TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
+         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
              || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION))
        {
          value_ptr v;
@@ -890,7 +892,7 @@ print_command_1 (exp, inspect, voidprint)
     val = access_value_history (0);
 
   if (voidprint || (val && VALUE_TYPE (val) &&
-                    TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_VOID))
+                   TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_VOID))
     {
       int histindex = record_latest_value (val);
 
@@ -901,8 +903,8 @@ print_command_1 (exp, inspect, voidprint)
 
       if (inspect)
        printf_unfiltered ("\031(gdb-makebuffer \"%s\"  %d '(\"", exp, histindex);
-      else
-       if (histindex >= 0) printf_filtered ("$%d = ", histindex);
+      else if (histindex >= 0)
+       printf_filtered ("$%d = ", histindex);
 
       if (histindex >= 0)
        annotate_value_history_value ();
@@ -916,12 +918,12 @@ print_command_1 (exp, inspect, voidprint)
        annotate_value_end ();
 
       if (inspect)
-       printf_unfiltered("\") )\030");
+       printf_unfiltered ("\") )\030");
     }
 
   if (cleanup)
     do_cleanups (old_chain);
-  inspect_it = 0;      /* Reset print routines to normal */
+  inspect_it = 0;              /* Reset print routines to normal */
 }
 
 /* ARGSUSED */
@@ -997,7 +999,7 @@ set_command (exp, from_tty)
 {
   struct expression *expr = parse_expression (exp);
   register struct cleanup *old_chain
-    = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+  = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
   evaluate_expression (expr);
   do_cleanups (old_chain);
 }
@@ -1006,45 +1008,45 @@ set_command (exp, from_tty)
 static void
 sym_info (arg, from_tty)
      char *arg;
-     int   from_tty;
+     int from_tty;
 {
   struct minimal_symbol *msymbol;
-  struct objfile        *objfile;
-  struct obj_section    *osect;
-  asection              *sect;
-  CORE_ADDR              addr, sect_addr;
-  int                    matches = 0;
-  unsigned int           offset;
+  struct objfile *objfile;
+  struct obj_section *osect;
+  asection *sect;
+  CORE_ADDR addr, sect_addr;
+  int matches = 0;
+  unsigned int offset;
 
   if (!arg)
     error_no_arg ("address");
 
   addr = parse_and_eval_address (arg);
   ALL_OBJSECTIONS (objfile, osect)
-    {
-      sect = osect->the_bfd_section;
-      sect_addr = overlay_mapped_address (addr, sect);
+  {
+    sect = osect->the_bfd_section;
+    sect_addr = overlay_mapped_address (addr, sect);
 
-      if (osect->addr <= sect_addr && sect_addr < osect->endaddr &&
-         (msymbol = lookup_minimal_symbol_by_pc_section (sect_addr, sect)))
-       {
-         matches = 1;
-         offset = sect_addr - SYMBOL_VALUE_ADDRESS (msymbol);
-         if (offset)
-           printf_filtered ("%s + %u in ", 
-                            SYMBOL_SOURCE_NAME (msymbol), offset);
-         else
-           printf_filtered ("%s in ", 
-                            SYMBOL_SOURCE_NAME (msymbol));
-         if (pc_in_unmapped_range (addr, sect))
-           printf_filtered ("load address range of ");
-         if (section_is_overlay (sect))
-           printf_filtered ("%s overlay ", 
-                            section_is_mapped (sect) ? "mapped" : "unmapped");
-         printf_filtered ("section %s", sect->name);
-         printf_filtered ("\n");
-       }
-    }
+    if (osect->addr <= sect_addr && sect_addr < osect->endaddr &&
+       (msymbol = lookup_minimal_symbol_by_pc_section (sect_addr, sect)))
+      {
+       matches = 1;
+       offset = sect_addr - SYMBOL_VALUE_ADDRESS (msymbol);
+       if (offset)
+         printf_filtered ("%s + %u in ",
+                          SYMBOL_SOURCE_NAME (msymbol), offset);
+       else
+         printf_filtered ("%s in ",
+                          SYMBOL_SOURCE_NAME (msymbol));
+       if (pc_in_unmapped_range (addr, sect))
+         printf_filtered ("load address range of ");
+       if (section_is_overlay (sect))
+         printf_filtered ("%s overlay ",
+                          section_is_mapped (sect) ? "mapped" : "unmapped");
+       printf_filtered ("section %s", sect->name);
+       printf_filtered ("\n");
+      }
+  }
   if (matches == 0)
     printf_filtered ("No symbol matches %s.\n", arg);
 }
@@ -1067,8 +1069,8 @@ address_info (exp, from_tty)
   if (exp == 0)
     error ("Argument required.");
 
-  sym = lookup_symbol (exp, get_selected_block (), VAR_NAMESPACE, 
-                      &is_a_field_of_this, (struct symtab **)NULL);
+  sym = lookup_symbol (exp, get_selected_block (), VAR_NAMESPACE,
+                      &is_a_field_of_this, (struct symtab **) NULL);
   if (sym == NULL)
     {
       if (is_a_field_of_this)
@@ -1111,7 +1113,7 @@ address_info (exp, from_tty)
   fprintf_symbol_filtered (gdb_stdout, SYMBOL_NAME (sym),
                           current_language->la_language, DMGL_ANSI);
   printf_filtered ("\" is ");
-  val     = SYMBOL_VALUE (sym);
+  val = SYMBOL_VALUE (sym);
   basereg = SYMBOL_BASEREG (sym);
   section = SYMBOL_BFD_SECTION (sym);
 
@@ -1124,7 +1126,7 @@ address_info (exp, from_tty)
 
     case LOC_LABEL:
       printf_filtered ("a label at address ");
-      print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (sym), 
+      print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (sym),
                             1, gdb_stdout);
       if (section_is_overlay (section))
        {
@@ -1141,7 +1143,7 @@ address_info (exp, from_tty)
 
     case LOC_STATIC:
       printf_filtered ("static storage at address ");
-      print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (sym), 
+      print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (sym),
                             1, gdb_stdout);
       if (section_is_overlay (section))
        {
@@ -1192,12 +1194,12 @@ address_info (exp, from_tty)
 
     case LOC_BASEREG:
       printf_filtered ("a variable at offset %ld from register %s",
-             val, REGISTER_NAME (basereg));
+                      val, REGISTER_NAME (basereg));
       break;
 
     case LOC_BASEREG_ARG:
       printf_filtered ("an argument at offset %ld from register %s",
-             val, REGISTER_NAME (basereg));
+                      val, REGISTER_NAME (basereg));
       break;
 
     case LOC_TYPEDEF:
@@ -1208,10 +1210,10 @@ address_info (exp, from_tty)
       printf_filtered ("a function at address ");
 #ifdef GDB_TARGET_MASK_DISAS_PC
       print_address_numeric
-       (load_addr= GDB_TARGET_MASK_DISAS_PC (BLOCK_START (SYMBOL_BLOCK_VALUE (sym))),
+       (load_addr = GDB_TARGET_MASK_DISAS_PC (BLOCK_START (SYMBOL_BLOCK_VALUE (sym))),
         1, gdb_stdout);
 #else
-      print_address_numeric (load_addr=BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
+      print_address_numeric (load_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
                             1, gdb_stdout);
 #endif
       if (section_is_overlay (section))
@@ -1234,7 +1236,7 @@ address_info (exp, from_tty)
          {
            section = SYMBOL_BFD_SECTION (msym);
            printf_filtered ("static storage at address ");
-           print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (msym), 
+           print_address_numeric (load_addr = SYMBOL_VALUE_ADDRESS (msym),
                                   1, gdb_stdout);
            if (section_is_overlay (section))
              {
@@ -1249,14 +1251,14 @@ address_info (exp, from_tty)
 
     case LOC_THREAD_LOCAL_STATIC:
       printf_filtered (
-              "a thread-local variable at offset %ld from the thread base register %s",
-             val, REGISTER_NAME (basereg));
+                       "a thread-local variable at offset %ld from the thread base register %s",
+                       val, REGISTER_NAME (basereg));
       break;
 
     case LOC_OPTIMIZED_OUT:
       printf_filtered ("optimized out");
       break;
-      
+
     default:
       printf_filtered ("of unknown (botched) type");
       break;
@@ -1290,20 +1292,20 @@ x_command (exp, from_tty)
     {
       expr = parse_expression (exp);
       /* Cause expression not to be there any more
-        if this command is repeated with Newline.
-        But don't clobber a user-defined command's definition.  */
+         if this command is repeated with Newline.
+         But don't clobber a user-defined command's definition.  */
       if (from_tty)
        *exp = 0;
-      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                &expr);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                               &expr);
       val = evaluate_expression (expr);
       if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
        val = value_ind (val);
       /* In rvalue contexts, such as this, functions are coerced into
-        pointers to functions.  This makes "x/i main" work.  */
-      if (/* last_format == 'i'
-         && */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
-         && VALUE_LVAL (val) == lval_memory)
+         pointers to functions.  This makes "x/i main" work.  */
+      if (                     /* last_format == 'i'
+                                  && */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
+          && VALUE_LVAL (val) == lval_memory)
        next_address = VALUE_ADDRESS (val);
       else
        next_address = value_as_pointer (val);
@@ -1322,13 +1324,13 @@ x_command (exp, from_tty)
   if (last_examine_value)
     {
       /* Make last address examined available to the user as $_.  Use
-        the correct pointer type.  */
+         the correct pointer type.  */
       set_internalvar (lookup_internalvar ("_"),
-              value_from_longest (
-                lookup_pointer_type (VALUE_TYPE (last_examine_value)),
-                                  (LONGEST) last_examine_address));
-      
-      /* Make contents of last address examined available to the user as $__.*/
+                      value_from_longest (
+                     lookup_pointer_type (VALUE_TYPE (last_examine_value)),
+                                           (LONGEST) last_examine_address));
+
+      /* Make contents of last address examined available to the user as $__. */
       /* If the last value has not been fetched from memory then don't
          fetch it now - instead mark it by voiding the $__ variable. */
       if (VALUE_LAZY (last_examine_value))
@@ -1338,8 +1340,8 @@ x_command (exp, from_tty)
        set_internalvar (lookup_internalvar ("__"), last_examine_value);
     }
 }
-
 \f
+
 /* Add an expression to the auto-display chain.
    Specify the expression.  */
 
@@ -1355,8 +1357,8 @@ display_command (exp, from_tty)
 
 #if defined(TUI)
   if (tui_version && *exp == '$')
-    display_it = ((TuiStatus)tuiDo(
-                 (TuiOpaqueFuncPtr)tui_vSetLayoutTo, exp) == TUI_FAILURE);
+    display_it = ((TuiStatus) tuiDo (
+                 (TuiOpaqueFuncPtr) tui_vSetLayoutTo, exp) == TUI_FAILURE);
 #endif
 
   if (display_it)
@@ -1407,8 +1409,8 @@ static void
 free_display (d)
      struct display *d;
 {
-  free ((PTR)d->exp);
-  free ((PTR)d);
+  free ((PTR) d->exp);
+  free ((PTR) d);
 }
 
 /* Clear out the display_chain.
@@ -1422,9 +1424,9 @@ clear_displays ()
 
   while ((d = display_chain) != NULL)
     {
-      free ((PTR)d->exp);
+      free ((PTR) d->exp);
       display_chain = d->next;
-      free ((PTR)d);
+      free ((PTR) d);
     }
 }
 
@@ -1446,7 +1448,7 @@ delete_display (num)
       free_display (d1);
     }
   else
-    for (d = display_chain; ; d = d->next)
+    for (d = display_chain;; d = d->next)
       {
        if (d->next == 0)
          error ("No display number %d.", num);
@@ -1483,7 +1485,8 @@ undisplay_command (args, from_tty)
   while (*p)
     {
       p1 = p;
-      while (*p1 >= '0' && *p1 <= '9') p1++;
+      while (*p1 >= '0' && *p1 <= '9')
+       p1++;
       if (*p1 && *p1 != ' ' && *p1 != '\t')
        error ("Arguments must be display numbers.");
 
@@ -1492,7 +1495,8 @@ undisplay_command (args, from_tty)
       delete_display (num);
 
       p = p1;
-      while (*p == ' ' || *p == '\t') p++;
+      while (*p == ' ' || *p == '\t')
+       p++;
     }
   dont_repeat ();
 }
@@ -1547,7 +1551,7 @@ do_one_display (d)
        printf_filtered ("\n");
       else
        printf_filtered ("  ");
-      
+
       val = evaluate_expression (d->exp);
       addr = value_as_pointer (val);
       if (d->format.format == 'i')
@@ -1613,7 +1617,7 @@ disable_display (num)
       }
   printf_unfiltered ("No display number %d.\n", num);
 }
-  
+
 void
 disable_current_display ()
 {
@@ -1621,7 +1625,7 @@ disable_current_display ()
     {
       disable_display (current_display_number);
       fprintf_unfiltered (gdb_stderr, "Disabling display %d to avoid infinite recursion.\n",
-              current_display_number);
+                         current_display_number);
     }
   current_display_number = -1;
 }
@@ -1636,15 +1640,15 @@ display_info (ignore, from_tty)
   if (!display_chain)
     printf_unfiltered ("There are no auto-display expressions now.\n");
   else
-      printf_filtered ("Auto-display expressions now in effect:\n\
+    printf_filtered ("Auto-display expressions now in effect:\n\
 Num Enb Expression\n");
 
   for (d = display_chain; d; d = d->next)
     {
-      printf_filtered ("%d:   %c  ", d->number, "ny"[(int)d->status]);
+      printf_filtered ("%d:   %c  ", d->number, "ny"[(int) d->status]);
       if (d->format.size)
        printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
-               d->format.format);
+                        d->format.format);
       else if (d->format.format)
        printf_filtered ("/%c ", d->format.format);
       print_expression (d->exp, gdb_stdout);
@@ -1678,9 +1682,9 @@ enable_display (args, from_tty)
          p1++;
        if (*p1 && *p1 != ' ' && *p1 != '\t')
          error ("Arguments must be display numbers.");
-       
+
        num = atoi (p);
-       
+
        for (d = display_chain; d; d = d->next)
          if (d->number == num)
            {
@@ -1718,7 +1722,7 @@ disable_display_command (args, from_tty)
          p1++;
        if (*p1 && *p1 != ' ' && *p1 != '\t')
          error ("Arguments must be display numbers.");
-       
+
        disable_display (atoi (p));
 
        p = p1;
@@ -1726,8 +1730,8 @@ disable_display_command (args, from_tty)
          p++;
       }
 }
-
 \f
+
 /* Print the value in stack frame FRAME of a variable
    specified by a struct symbol.  */
 
@@ -1783,88 +1787,89 @@ print_frame_args (func, fi, num, stream)
       sym = BLOCK_SYM (b, i);
 
       /* Keep track of the highest stack argument offset seen, and
-        skip over any kinds of symbols we don't care about.  */
+         skip over any kinds of symbols we don't care about.  */
 
-      switch (SYMBOL_CLASS (sym)) {
-      case LOC_ARG:
-      case LOC_REF_ARG:
+      switch (SYMBOL_CLASS (sym))
        {
-         long current_offset = SYMBOL_VALUE (sym);
-         arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-         
-         /* Compute address of next argument by adding the size of
-            this argument and rounding to an int boundary.  */
-         current_offset
-           = ((current_offset + arg_size + sizeof (int) - 1)
-              & ~(sizeof (int) - 1));
-
-         /* If this is the highest offset seen yet, set highest_offset.  */
-         if (highest_offset == -1
-             || (current_offset > highest_offset))
-           highest_offset = current_offset;
-
-         /* Add the number of ints we're about to print to args_printed.  */
-         args_printed += (arg_size + sizeof (int) - 1) / sizeof (int);
-       }
+       case LOC_ARG:
+       case LOC_REF_ARG:
+         {
+           long current_offset = SYMBOL_VALUE (sym);
+           arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
+
+           /* Compute address of next argument by adding the size of
+              this argument and rounding to an int boundary.  */
+           current_offset
+             = ((current_offset + arg_size + sizeof (int) - 1)
+                & ~(sizeof (int) - 1));
+
+           /* If this is the highest offset seen yet, set highest_offset.  */
+           if (highest_offset == -1
+               || (current_offset > highest_offset))
+             highest_offset = current_offset;
+
+           /* Add the number of ints we're about to print to args_printed.  */
+           args_printed += (arg_size + sizeof (int) - 1) / sizeof (int);
+         }
 
-      /* We care about types of symbols, but don't need to keep track of
-        stack offsets in them.  */
-      case LOC_REGPARM:
-      case LOC_REGPARM_ADDR:
-      case LOC_LOCAL_ARG:
-      case LOC_BASEREG_ARG:
-       break;
+         /* We care about types of symbols, but don't need to keep track of
+            stack offsets in them.  */
+       case LOC_REGPARM:
+       case LOC_REGPARM_ADDR:
+       case LOC_LOCAL_ARG:
+       case LOC_BASEREG_ARG:
+         break;
 
-      /* Other types of symbols we just skip over.  */
-      default:
-       continue;
-      }
+         /* Other types of symbols we just skip over.  */
+       default:
+         continue;
+       }
 
       /* We have to look up the symbol because arguments can have
-        two entries (one a parameter, one a local) and the one we
-        want is the local, which lookup_symbol will find for us.
-        This includes gcc1 (not gcc2) on the sparc when passing a
-        small structure and gcc2 when the argument type is float
-        and it is passed as a double and converted to float by
-        the prologue (in the latter case the type of the LOC_ARG
-        symbol is double and the type of the LOC_LOCAL symbol is
-        float).  */
+         two entries (one a parameter, one a local) and the one we
+         want is the local, which lookup_symbol will find for us.
+         This includes gcc1 (not gcc2) on the sparc when passing a
+         small structure and gcc2 when the argument type is float
+         and it is passed as a double and converted to float by
+         the prologue (in the latter case the type of the LOC_ARG
+         symbol is double and the type of the LOC_LOCAL symbol is
+         float).  */
       /* But if the parameter name is null, don't try it.
-        Null parameter names occur on the RS/6000, for traceback tables.
-        FIXME, should we even print them?  */
+         Null parameter names occur on the RS/6000, for traceback tables.
+         FIXME, should we even print them?  */
 
       if (*SYMBOL_NAME (sym))
        {
          struct symbol *nsym;
          nsym = lookup_symbol
            (SYMBOL_NAME (sym),
-            b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
+            b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
          if (SYMBOL_CLASS (nsym) == LOC_REGISTER)
            {
              /* There is a LOC_ARG/LOC_REGISTER pair.  This means that
-                it was passed on the stack and loaded into a register,
-                or passed in a register and stored in a stack slot.
-                GDB 3.x used the LOC_ARG; GDB 4.0-4.11 used the LOC_REGISTER.
-
-                Reasons for using the LOC_ARG:
-                (1) because find_saved_registers may be slow for remote
-                debugging,
-                (2) because registers are often re-used and stack slots
-                rarely (never?) are.  Therefore using the stack slot is
-                much less likely to print garbage.
-
-                Reasons why we might want to use the LOC_REGISTER:
-                (1) So that the backtrace prints the same value as
-                "print foo".  I see no compelling reason why this needs
-                to be the case; having the backtrace print the value which
-                was passed in, and "print foo" print the value as modified
-                within the called function, makes perfect sense to me.
-
-                Additional note:  It might be nice if "info args" displayed
-                both values.
-                One more note:  There is a case with sparc structure passing
-                where we need to use the LOC_REGISTER, but this is dealt with
-                by creating a single LOC_REGPARM in symbol reading.  */
+                it was passed on the stack and loaded into a register,
+                or passed in a register and stored in a stack slot.
+                GDB 3.x used the LOC_ARG; GDB 4.0-4.11 used the LOC_REGISTER.
+
+                Reasons for using the LOC_ARG:
+                (1) because find_saved_registers may be slow for remote
+                debugging,
+                (2) because registers are often re-used and stack slots
+                rarely (never?) are.  Therefore using the stack slot is
+                much less likely to print garbage.
+
+                Reasons why we might want to use the LOC_REGISTER:
+                (1) So that the backtrace prints the same value as
+                "print foo".  I see no compelling reason why this needs
+                to be the case; having the backtrace print the value which
+                was passed in, and "print foo" print the value as modified
+                within the called function, makes perfect sense to me.
+
+                Additional note:  It might be nice if "info args" displayed
+                both values.
+                One more note:  There is a case with sparc structure passing
+                where we need to use the LOC_REGISTER, but this is dealt with
+                by creating a single LOC_REGPARM in symbol reading.  */
 
              /* Leave sym (the LOC_ARG) alone.  */
              ;
@@ -1874,22 +1879,22 @@ print_frame_args (func, fi, num, stream)
        }
 
       /* Print the current arg.  */
-      if (! first)
+      if (!first)
        fprintf_filtered (stream, ", ");
       wrap_here ("    ");
 
       annotate_arg_begin ();
 
       fprintf_symbol_filtered (stream, SYMBOL_SOURCE_NAME (sym),
-                              SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
+                           SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
       annotate_arg_name_end ();
       fputs_filtered ("=", stream);
 
       /* Avoid value_print because it will deref ref parameters.  We just
-        want to print their addresses.  Print ??? for args whose address
-        we do not know.  We pass 2 as "recurse" to val_print because our
-        standard indentation here is 4 spaces, and val_print indents
-        2 for each recurse.  */
+         want to print their addresses.  Print ??? for args whose address
+         we do not know.  We pass 2 as "recurse" to val_print because our
+         standard indentation here is 4 spaces, and val_print indents
+         2 for each recurse.  */
       val = read_var_value (sym, fi);
 
       annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val));
@@ -1897,11 +1902,11 @@ print_frame_args (func, fi, num, stream)
       if (val)
        {
          if (GDB_TARGET_IS_D10V
-             && SYMBOL_CLASS(sym) == LOC_REGPARM && TYPE_CODE(VALUE_TYPE(val)) == TYPE_CODE_PTR)
-           TYPE_LENGTH(VALUE_TYPE(val)) = 2;
+             && SYMBOL_CLASS (sym) == LOC_REGPARM && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
+           TYPE_LENGTH (VALUE_TYPE (val)) = 2;
          val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
-                    VALUE_ADDRESS (val),
-                   stream, 0, 0, 2, Val_no_prettyprint);
+                    VALUE_ADDRESS (val),
+                    stream, 0, 0, 2, Val_no_prettyprint);
        }
       else
        fputs_filtered ("???", stream);
@@ -1992,14 +1997,15 @@ printf_command (arg, from_tty)
   struct cleanup *old_cleanups;
 
   val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
-  old_cleanups = make_cleanup ((make_cleanup_func) free_current_contents, 
-                               &val_args);
+  old_cleanups = make_cleanup ((make_cleanup_func) free_current_contents,
+                              &val_args);
 
   if (s == 0)
     error_no_arg ("format-control string and values to print");
 
   /* Skip white space before format string */
-  while (*s == ' ' || *s == '\t') s++;
+  while (*s == ' ' || *s == '\t')
+    s++;
 
   /* A format string should follow, enveloped in double quotes */
   if (*s++ != '"')
@@ -2028,7 +2034,7 @@ printf_command (arg, from_tty)
 #ifdef __STDC__
              *f++ = '\a';
 #else
-             *f++ = '\007';  /* Bell */
+             *f++ = '\007';    /* Bell */
 #endif
              break;
            case 'b':
@@ -2067,13 +2073,16 @@ printf_command (arg, from_tty)
   /* Skip over " and following space and comma.  */
   s++;
   *f++ = '\0';
-  while (*s == ' ' || *s == '\t') s++;
+  while (*s == ' ' || *s == '\t')
+    s++;
 
   if (*s != ',' && *s != 0)
     error ("Invalid argument syntax");
 
-  if (*s == ',') s++;
-  while (*s == ' ' || *s == '\t') s++;
+  if (*s == ',')
+    s++;
+  while (*s == ' ' || *s == '\t')
+    s++;
 
   /* Need extra space for the '\0's.  Doubling the size is sufficient.  */
   substrings = alloca (strlen (string) * 2);
@@ -2084,7 +2093,10 @@ printf_command (arg, from_tty)
        argclass[I] classifies the %-specs so we can give printf_filtered
        something of the right size.  */
 
-    enum argclass {no_arg, int_arg, string_arg, double_arg, long_long_arg};
+    enum argclass
+      {
+       no_arg, int_arg, string_arg, double_arg, long_long_arg
+      };
     enum argclass *argclass;
     enum argclass this_argclass;
     char *last_arg;
@@ -2100,7 +2112,7 @@ printf_command (arg, from_tty)
       if (*f++ == '%')
        {
          lcount = 0;
-         while (strchr ("0123456789.hlL-+ #", *f)) 
+         while (strchr ("0123456789.hlL-+ #", *f))
            {
              if (*f == 'l' || *f == 'L')
                lcount++;
@@ -2158,24 +2170,24 @@ printf_command (arg, from_tty)
                                             * sizeof (value_ptr));
        s1 = s;
        val_args[nargs] = parse_to_comma_and_eval (&s1);
+
        /* If format string wants a float, unchecked-convert the value to
           floating point of the same size */
+
        if (argclass[nargs] == double_arg)
          {
            struct type *type = VALUE_TYPE (val_args[nargs]);
            if (TYPE_LENGTH (type) == sizeof (float))
-             VALUE_TYPE (val_args[nargs]) = builtin_type_float;
+               VALUE_TYPE (val_args[nargs]) = builtin_type_float;
            if (TYPE_LENGTH (type) == sizeof (double))
-             VALUE_TYPE (val_args[nargs]) = builtin_type_double;
+               VALUE_TYPE (val_args[nargs]) = builtin_type_double;
          }
        nargs++;
        s = s1;
        if (*s == ',')
          s++;
       }
+
     if (nargs != nargs_wanted)
       error ("Wrong number of arguments for specified format-string");
 
@@ -2193,7 +2205,7 @@ printf_command (arg, from_tty)
              tem = value_as_pointer (val_args[i]);
 
              /* This is a %s argument.  Find the length of the string.  */
-             for (j = 0; ; j++)
+             for (j = 0;; j++)
                {
                  char c;
                  QUIT;
@@ -2234,8 +2246,8 @@ printf_command (arg, from_tty)
              printf_filtered (current_substring, val);
              break;
            }
-         default: /* purecov: deadcode */
-           error ("internal error in printf_command"); /* purecov: deadcode */
+         default:              /* purecov: deadcode */
+           error ("internal error in printf_command");         /* purecov: deadcode */
          }
        /* Skip to the next substring.  */
        current_substring += strlen (current_substring) + 1;
@@ -2278,9 +2290,9 @@ disassemble_command (arg, from_tty)
        error ("No function contains program counter for selected frame.\n");
 #if defined(TUI)
       else if (tui_version)
-        low = (CORE_ADDR)tuiDo((TuiOpaqueFuncPtr)tui_vGetLowDisassemblyAddress, 
-                              (Opaque)low, 
-                              (Opaque)pc);
+       low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
+                                (Opaque) low,
+                                (Opaque) pc);
 #endif
       low += FUNCTION_START_OFFSET;
     }
@@ -2292,9 +2304,9 @@ disassemble_command (arg, from_tty)
        error ("No function contains specified address.\n");
 #if defined(TUI)
       else if (tui_version)
-        low = (CORE_ADDR)tuiDo((TuiOpaqueFuncPtr)tui_vGetLowDisassemblyAddress, 
-                              (Opaque)low, 
-                              (Opaque)pc);
+       low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
+                                (Opaque) low,
+                                (Opaque) pc);
 #endif
 #if 0
       if (overlay_debugging)
@@ -2303,9 +2315,9 @@ disassemble_command (arg, from_tty)
          if (pc_in_unmapped_range (pc, section))
            {
              /* find_pc_partial_function will have returned low and high
-                relative to the symbolic (mapped) address range.  Need to
-                translate them back to the unmapped range where PC is.  */
-             low  = overlay_unmapped_address (low, section);
+                relative to the symbolic (mapped) address range.  Need to
+                translate them back to the unmapped range where PC is.  */
+             low = overlay_unmapped_address (low, section);
              high = overlay_unmapped_address (high, section);
            }
        }
@@ -2322,7 +2334,7 @@ disassemble_command (arg, from_tty)
 
 #if defined(TUI)
   if (!tui_version ||
-      m_winPtrIsNull(disassemWin) || !disassemWin->generic.isVisible)
+      m_winPtrIsNull (disassemWin) || !disassemWin->generic.isVisible)
 #endif
     {
       printf_filtered ("Dump of assembler code ");
@@ -2370,8 +2382,8 @@ disassemble_command (arg, from_tty)
 #if defined(TUI)
   else
     {
-      tuiDo((TuiOpaqueFuncPtr)tui_vAddWinToLayout, DISASSEM_WIN);
-      tuiDo((TuiOpaqueFuncPtr)tui_vUpdateSourceWindowsWithAddr, low);
+      tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, DISASSEM_WIN);
+      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithAddr, low);
     }
 #endif
 }
@@ -2395,17 +2407,17 @@ print_insn (memaddr, stream)
 
   return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
 }
-
 \f
+
 void
 _initialize_printcmd ()
 {
   current_display_number = -1;
 
   add_info ("address", address_info,
-          "Describe where symbol SYM is stored.");
+           "Describe where symbol SYM is stored.");
 
-  add_info ("symbol", sym_info, 
+  add_info ("symbol", sym_info,
            "Describe what symbol is at location ADDR.\n\
 Only for symbols with fixed locations (global or static scope).");
 
@@ -2415,7 +2427,7 @@ ADDRESS is an expression for the memory address to examine.\n\
 FMT is a repeat count followed by a format letter and a size letter.\n\
 Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\
   t(binary), f(float), a(address), i(instruction), c(char) and s(string).\n",
-"Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\
+                  "Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\
 The specified number of objects of the specified size are printed\n\
 according to the format.\n\n\
 Defaults for format and size letters are those previously used.\n\
@@ -2428,13 +2440,13 @@ Default is the function surrounding the pc of the selected frame.\n\
 With a single argument, the function surrounding that address is dumped.\n\
 Two arguments are taken as a range of memory to dump.");
   if (xdb_commands)
-       add_com_alias ("va", "disassemble", class_xdb, 0);
+    add_com_alias ("va", "disassemble", class_xdb, 0);
 
 #if 0
   add_com ("whereis", class_vars, whereis_command,
           "Print line number and file of definition of variable.");
 #endif
-  
+
   add_info ("display", display_info,
            "Expressions to display when program stops, with code numbers.");
 
@@ -2444,7 +2456,7 @@ Arguments are the code numbers of the expressions to stop displaying.\n\
 No argument means cancel all automatic-display expressions.\n\
 \"delete display\" has the same effect as this command.\n\
 Do \"info display\" to see current list of code numbers.",
-                 &cmdlist);
+          &cmdlist);
 
   add_com ("display", class_vars, display_command,
           "Print value of expression EXP each time the program stops.\n\
@@ -2454,28 +2466,28 @@ as in the \"x\" command, and then EXP is used to get the address to examine\n\
 and examining is done as in the \"x\" command.\n\n\
 With no argument, display all currently requested auto-display expressions.\n\
 Use \"undisplay\" to cancel display requests previously made."
-);
+    );
 
-  add_cmd ("display", class_vars, enable_display, 
+  add_cmd ("display", class_vars, enable_display,
           "Enable some expressions to be displayed when program stops.\n\
 Arguments are the code numbers of the expressions to resume displaying.\n\
 No argument means enable all automatic-display expressions.\n\
 Do \"info display\" to see current list of code numbers.", &enablelist);
 
-  add_cmd ("display", class_vars, disable_display_command, 
+  add_cmd ("display", class_vars, disable_display_command,
           "Disable some expressions to be displayed when program stops.\n\
 Arguments are the code numbers of the expressions to stop displaying.\n\
 No argument means disable all automatic-display expressions.\n\
 Do \"info display\" to see current list of code numbers.", &disablelist);
 
-  add_cmd ("display", class_vars, undisplay_command, 
+  add_cmd ("display", class_vars, undisplay_command,
           "Cancel some expressions to be displayed when program stops.\n\
 Arguments are the code numbers of the expressions to stop displaying.\n\
 No argument means cancel all automatic-display expressions.\n\
 Do \"info display\" to see current list of code numbers.", &deletelist);
 
   add_com ("printf", class_vars, printf_command,
-       "printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
+          "printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
 This is useful for formatted output in user-defined commands.");
 
   add_com ("output", class_vars, output_command,
@@ -2483,23 +2495,23 @@ This is useful for formatted output in user-defined commands.");
 This is useful in user-defined commands.");
 
   add_prefix_cmd ("set", class_vars, set_command,
-concat ("Evaluate expression EXP and assign result to variable VAR, using assignment\n\
+                 concat ("Evaluate expression EXP and assign result to variable VAR, using assignment\n\
 syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\
 example).  VAR may be a debugger \"convenience\" variable (names starting\n\
 with $), a register (a few standard names starting with $), or an actual\n\
 variable in the program being debugged.  EXP is any valid expression.\n",
-"Use \"set variable\" for variables with names identical to set subcommands.\n\
+                         "Use \"set variable\" for variables with names identical to set subcommands.\n\
 \nWith a subcommand, this command modifies parts of the gdb environment.\n\
 You can see these environment settings with the \"show\" command.", NULL),
-                  &setlist, "set ", 1, &cmdlist);
+                 &setlist, "set ", 1, &cmdlist);
   if (dbx_commands)
-    add_com("assign", class_vars, set_command, concat ("Evaluate expression \
+    add_com ("assign", class_vars, set_command, concat ("Evaluate expression \
 EXP and assign result to variable VAR, using assignment\n\
 syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\
 example).  VAR may be a debugger \"convenience\" variable (names starting\n\
 with $), a register (a few standard names starting with $), or an actual\n\
 variable in the program being debugged.  EXP is any valid expression.\n",
-"Use \"set variable\" for variables with names identical to set subcommands.\n\
+                                                       "Use \"set variable\" for variables with names identical to set subcommands.\n\
 \nWith a subcommand, this command modifies parts of the gdb environment.\n\
 You can see these environment settings with the \"show\" command.", NULL));
 
@@ -2511,13 +2523,13 @@ current working language.  The result is printed and saved in the value\n\
 history, if it is not void.");
 
   add_cmd ("variable", class_vars, set_command,
-"Evaluate expression EXP and assign result to variable VAR, using assignment\n\
+          "Evaluate expression EXP and assign result to variable VAR, using assignment\n\
 syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\
 example).  VAR may be a debugger \"convenience\" variable (names starting\n\
 with $), a register (a few standard names starting with $), or an actual\n\
 variable in the program being debugged.  EXP is any valid expression.\n\
 This may usually be abbreviated to simply \"set\".",
-           &setlist);
+          &setlist);
 
   add_com ("print", class_vars, print_command,
           concat ("Print value of expression EXP.\n\
@@ -2527,7 +2539,7 @@ stack frame, plus all those whose scope is global or an entire file.\n\
 $NUM gets previous value number NUM.  $ and $$ are the last two values.\n\
 $$NUM refers to NUM'th value back from the last one.\n\
 Names starting with $ refer to registers (with the values they would have\n",
-"if the program were to return to the stack frame now selected, restoring\n\
+                  "if the program were to return to the stack frame now selected, restoring\n\
 all registers saved by frames farther in) or else to debugger\n\
 \"convenience\" variables (any such name not a known register).\n\
 Use assignment expressions to give values to convenience variables.\n",
@@ -2544,21 +2556,21 @@ but no count or size letter (see \"x\" command).", NULL));
   add_com_alias ("p", "print", class_vars, 1);
 
   add_com ("inspect", class_vars, inspect_command,
-"Same as \"print\" command, except that if you are running in the epoch\n\
+          "Same as \"print\" command, except that if you are running in the epoch\n\
 environment, the value is printed in its own window.");
 
   add_show_from_set (
-      add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,
-                  (char *)&max_symbolic_offset,
-       "Set the largest offset that will be printed in <symbol+1234> form.",
-                  &setprintlist),
-      &showprintlist);
+                add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,
+                             (char *) &max_symbolic_offset,
+       "Set the largest offset that will be printed in <symbol+1234> form.",
+                             &setprintlist),
+                     &showprintlist);
   add_show_from_set (
-      add_set_cmd ("symbol-filename", no_class, var_boolean,
-                  (char *)&print_symbol_filename,
-       "Set printing of source filename and line number with <symbol>.",
-                  &setprintlist),
-      &showprintlist);
+                     add_set_cmd ("symbol-filename", no_class, var_boolean,
+                                  (char *) &print_symbol_filename,
+          "Set printing of source filename and line number with <symbol>.",
+                                  &setprintlist),
+                     &showprintlist);
 
   /* For examine/instruction a single byte quantity is specified as
      the data.  This avoids problems with value_at_lazy() requiring a
index 8a68a8964976f485d487ca2231cb845310989872..5d03c8b8453e63cfcc353f4cda42f6bc58dde2a0 100644 (file)
@@ -3,32 +3,33 @@
    Written by Fred Fish at Cygnus Support.  Changes for sysv4.2mp procfs
    compatibility by Geoffrey Noer at Cygnus Solutions.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
-/*                     N  O  T  E  S
+/*                      N  O  T  E  S
 
-For information on the details of using /proc consult section proc(4)
-in the UNIX System V Release 4 System Administrator's Reference Manual.
+   For information on the details of using /proc consult section proc(4)
+   in the UNIX System V Release 4 System Administrator's Reference Manual.
 
-The general register and floating point register sets are manipulated
-separately.  This file makes the assumption that if FP0_REGNUM is
-defined, then support for the floating point register set is desired,
-regardless of whether or not the actual target has floating point hardware.
+   The general register and floating point register sets are manipulated
+   separately.  This file makes the assumption that if FP0_REGNUM is
+   defined, then support for the floating point register set is desired,
+   regardless of whether or not the actual target has floating point hardware.
 
  */
 
@@ -55,48 +56,48 @@ regardless of whether or not the actual target has floating point hardware.
 #include "gdbthread.h"
 
 #if !defined(SYS_lwp_create) && defined(SYS_lwpcreate)
-# define SYS_lwp_create SYS_lwpcreate
+#define SYS_lwp_create SYS_lwpcreate
 #endif
 
 #if !defined(SYS_lwp_exit) && defined(SYS_lwpexit)
-# define SYS_lwp_exit SYS_lwpexit
+#define SYS_lwp_exit SYS_lwpexit
 #endif
 
 #if !defined(SYS_lwp_wait) && defined(SYS_lwpwait)
-# define SYS_lwp_wait SYS_lwpwait
+#define SYS_lwp_wait SYS_lwpwait
 #endif
 
 #if !defined(SYS_lwp_self) && defined(SYS_lwpself)
-# define SYS_lwp_self SYS_lwpself
+#define SYS_lwp_self SYS_lwpself
 #endif
 
 #if !defined(SYS_lwp_info) && defined(SYS_lwpinfo)
-# define SYS_lwp_info SYS_lwpinfo
+#define SYS_lwp_info SYS_lwpinfo
 #endif
 
 #if !defined(SYS_lwp_private) && defined(SYS_lwpprivate)
-# define SYS_lwp_private SYS_lwpprivate
+#define SYS_lwp_private SYS_lwpprivate
 #endif
 
 #if !defined(SYS_lwp_kill) && defined(SYS_lwpkill)
-# define SYS_lwp_kill SYS_lwpkill
+#define SYS_lwp_kill SYS_lwpkill
 #endif
 
 #if !defined(SYS_lwp_suspend) && defined(SYS_lwpsuspend)
-# define SYS_lwp_suspend SYS_lwpsuspend
+#define SYS_lwp_suspend SYS_lwpsuspend
 #endif
 
 #if !defined(SYS_lwp_continue) && defined(SYS_lwpcontinue)
-# define SYS_lwp_continue SYS_lwpcontinue
+#define SYS_lwp_continue SYS_lwpcontinue
 #endif
 
 /* the name of the proc status struct depends on the implementation */
 /* Wrap Light Weight Process member in THE_PR_LWP macro for clearer code */
 #ifndef HAVE_PSTATUS_T
-  typedef prstatus_t gdb_prstatus_t;
+typedef prstatus_t gdb_prstatus_t;
 #define THE_PR_LWP(a)  a
-#else  /* HAVE_PSTATUS_T */
-  typedef pstatus_t gdb_prstatus_t;
+#else /* HAVE_PSTATUS_T */
+typedef pstatus_t gdb_prstatus_t;
 #define THE_PR_LWP(a)  a.pr_lwp
 #if !defined(HAVE_PRRUN_T) && defined(HAVE_MULTIPLE_PROC_FDS)
   /* Fallback definitions - for using configure information directly */
@@ -106,26 +107,26 @@ regardless of whether or not the actual target has floating point hardware.
 #if !defined(PROCFS_USE_READ_WRITE) && !defined(HAVE_PROCFS_PIOCSET)
 #define PROCFS_USE_READ_WRITE  1
 #endif
-#endif /* !HAVE_PRRUN_T && HAVE_MULTIPLE_PROC_FDS */
-#endif /* HAVE_PSTATUS_T */
+#endif /* !HAVE_PRRUN_T && HAVE_MULTIPLE_PROC_FDS */
+#endif /* HAVE_PSTATUS_T */
 
 #define MAX_SYSCALLS   256     /* Maximum number of syscalls for table */
 
 /* proc name formats may vary depending on the proc implementation */
 #ifdef HAVE_MULTIPLE_PROC_FDS
-#  ifndef CTL_PROC_NAME_FMT
-#  define CTL_PROC_NAME_FMT "/proc/%d/ctl"
-#  define AS_PROC_NAME_FMT "/proc/%d/as"
-#  define MAP_PROC_NAME_FMT "/proc/%d/map"
-#  define STATUS_PROC_NAME_FMT "/proc/%d/status"
-#  endif
+#ifndef CTL_PROC_NAME_FMT
+#define CTL_PROC_NAME_FMT "/proc/%d/ctl"
+#define AS_PROC_NAME_FMT "/proc/%d/as"
+#define MAP_PROC_NAME_FMT "/proc/%d/map"
+#define STATUS_PROC_NAME_FMT "/proc/%d/status"
+#endif
 #else /* HAVE_MULTIPLE_PROC_FDS */
-#  ifndef CTL_PROC_NAME_FMT
-#  define CTL_PROC_NAME_FMT "/proc/%05d"
-#  define AS_PROC_NAME_FMT "/proc/%05d"
-#  define MAP_PROC_NAME_FMT "/proc/%05d"
-#  define STATUS_PROC_NAME_FMT "/proc/%05d"
-#  endif
+#ifndef CTL_PROC_NAME_FMT
+#define CTL_PROC_NAME_FMT "/proc/%05d"
+#define AS_PROC_NAME_FMT "/proc/%05d"
+#define MAP_PROC_NAME_FMT "/proc/%05d"
+#define STATUS_PROC_NAME_FMT "/proc/%05d"
+#endif
 #endif /* HAVE_MULTIPLE_PROC_FDS */
 
 
@@ -135,15 +136,15 @@ regardless of whether or not the actual target has floating point hardware.
    use prgregset_t (and prfpregset_t) everywhere. */
 
 #ifdef GDB_GREGSET_TYPE
-  typedef GDB_GREGSET_TYPE gdb_gregset_t;
+typedef GDB_GREGSET_TYPE gdb_gregset_t;
 #else
-  typedef gregset_t gdb_gregset_t;
+typedef gregset_t gdb_gregset_t;
 #endif
 
 #ifdef GDB_FPREGSET_TYPE
-  typedef GDB_FPREGSET_TYPE gdb_fpregset_t;
+typedef GDB_FPREGSET_TYPE gdb_fpregset_t;
 #else
-  typedef fpregset_t gdb_fpregset_t;
+typedef fpregset_t gdb_fpregset_t;
 #endif
 
 
@@ -156,7 +157,7 @@ int procfs_suppress_run = 0;        /* Non-zero if procfs should pretend not to
                                   that can sit atop procfs, such as solaris
                                   thread support.  */
 
-#if 1  /* FIXME: Gross and ugly hack to resolve coredep.c global */
+#if 1                          /* FIXME: Gross and ugly hack to resolve coredep.c global */
 CORE_ADDR kernel_u_addr;
 #endif
 
@@ -170,164 +171,173 @@ CORE_ADDR kernel_u_addr;
 /* Define structures for passing commands to /proc/pid/ctl file.  Note that
    while we create these for the PROCFS_USE_READ_WRITE world, we use them
    and ignore the extra cmd int in other proc schemes.
-*/
+ */
 /* generic ctl msg */
-struct proc_ctl {
-        int     cmd;
-        long    data;
-};
+struct proc_ctl
+  {
+    int cmd;
+    long data;
+  };
 
 /* set general registers */
-struct greg_ctl {
-        int             cmd;
-        gdb_gregset_t  gregset;
-};
+struct greg_ctl
+  {
+    int cmd;
+    gdb_gregset_t gregset;
+  };
 
 /* set fp registers */
-struct fpreg_ctl {
-        int             cmd;
-        gdb_fpregset_t fpregset;
-};
+struct fpreg_ctl
+  {
+    int cmd;
+    gdb_fpregset_t fpregset;
+  };
 
 /* set signals to be traced */
-struct sig_ctl {
-        int             cmd;
-        sigset_t        sigset;
-};
+struct sig_ctl
+  {
+    int cmd;
+    sigset_t sigset;
+  };
 
 /* set faults to be traced */
-struct flt_ctl {
-        int             cmd;
-        fltset_t        fltset;
-};
+struct flt_ctl
+  {
+    int cmd;
+    fltset_t fltset;
+  };
 
 /* set system calls to be traced */
-struct sys_ctl {
-        int             cmd;
-        sysset_t        sysset;
-};
+struct sys_ctl
+  {
+    int cmd;
+    sysset_t sysset;
+  };
 
 /* set current signal to be traced */
-struct sigi_ctl {
-        int             cmd;
-        siginfo_t       siginfo;
-};
+struct sigi_ctl
+  {
+    int cmd;
+    siginfo_t siginfo;
+  };
 
 /*  All access to the inferior, either one started by gdb or one that has
-    been attached to, is controlled by an instance of a procinfo structure,
-    defined below.  Since gdb currently only handles one inferior at a time,
-    the procinfo structure for the inferior is statically allocated and
-    only one exists at any given time.  There is a separate procinfo
-    structure for use by the "info proc" command, so that we can print
-    useful information about any random process without interfering with
-    the inferior's procinfo information. */
-
-struct procinfo {
-  struct procinfo *next;
-  int pid;                     /* Process ID of inferior */
-  int ctl_fd;                  /* File descriptor for /proc ctl file */
-  int status_fd;               /* File descriptor for /proc status file */
-  int as_fd;                   /* File descriptor for /proc as file */
-  int map_fd;                  /* File descriptor for /proc map file */
-  char *pathname;              /* Pathname to /proc entry */
-  int had_event;               /* poll/select says something happened */
-  int was_stopped;             /* Nonzero if was stopped prior to attach */
-  int nopass_next_sigstop;     /* Don't pass a sigstop on next resume */
+   been attached to, is controlled by an instance of a procinfo structure,
+   defined below.  Since gdb currently only handles one inferior at a time,
+   the procinfo structure for the inferior is statically allocated and
+   only one exists at any given time.  There is a separate procinfo
+   structure for use by the "info proc" command, so that we can print
+   useful information about any random process without interfering with
+   the inferior's procinfo information. */
+
+struct procinfo
+  {
+    struct procinfo *next;
+    int pid;                   /* Process ID of inferior */
+    int ctl_fd;                        /* File descriptor for /proc ctl file */
+    int status_fd;             /* File descriptor for /proc status file */
+    int as_fd;                 /* File descriptor for /proc as file */
+    int map_fd;                        /* File descriptor for /proc map file */
+    char *pathname;            /* Pathname to /proc entry */
+    int had_event;             /* poll/select says something happened */
+    int was_stopped;           /* Nonzero if was stopped prior to attach */
+    int nopass_next_sigstop;   /* Don't pass a sigstop on next resume */
 #ifdef HAVE_PRRUN_T
-  prrun_t prrun;               /* Control state when it is run */
-#endif
-  gdb_prstatus_t prstatus;     /* Current process status info */
-  struct greg_ctl gregset;     /* General register set */
-  struct fpreg_ctl fpregset;   /* Floating point register set */
-  struct flt_ctl fltset;       /* Current traced hardware fault set */
-  struct sig_ctl trace;                /* Current traced signal set */
-  struct sys_ctl exitset;      /* Current traced system call exit set */
-  struct sys_ctl entryset;     /* Current traced system call entry set */
-  struct sig_ctl saved_sighold;        /* Saved held signal set */
-  struct flt_ctl saved_fltset;  /* Saved traced hardware fault set */
-  struct sig_ctl saved_trace;   /* Saved traced signal set */
-  struct sys_ctl saved_exitset; /* Saved traced system call exit set */
-  struct sys_ctl saved_entryset;/* Saved traced system call entry set */
-  int num_syscall_handlers;    /* Number of syscall trap handlers
+    prrun_t prrun;             /* Control state when it is run */
+#endif
+    gdb_prstatus_t prstatus;   /* Current process status info */
+    struct greg_ctl gregset;   /* General register set */
+    struct fpreg_ctl fpregset; /* Floating point register set */
+    struct flt_ctl fltset;     /* Current traced hardware fault set */
+    struct sig_ctl trace;      /* Current traced signal set */
+    struct sys_ctl exitset;    /* Current traced system call exit set */
+    struct sys_ctl entryset;   /* Current traced system call entry set */
+    struct sig_ctl saved_sighold;      /* Saved held signal set */
+    struct flt_ctl saved_fltset;       /* Saved traced hardware fault set */
+    struct sig_ctl saved_trace;        /* Saved traced signal set */
+    struct sys_ctl saved_exitset;      /* Saved traced system call exit set */
+    struct sys_ctl saved_entryset;     /* Saved traced system call entry set */
+    int num_syscall_handlers;  /* Number of syscall trap handlers
                                   currently installed */
-                               /* Pointer to list of syscall trap handlers */
-  struct procfs_syscall_handler *syscall_handlers; 
-  int saved_rtnval;            /* return value and status for wait(), */
-  int saved_statval;           /*  as supplied by a syscall handler. */
-  int new_child;               /* Non-zero if it's a new thread */
-};
+    /* Pointer to list of syscall trap handlers */
+    struct procfs_syscall_handler *syscall_handlers;
+    int saved_rtnval;          /* return value and status for wait(), */
+    int saved_statval;         /*  as supplied by a syscall handler. */
+    int new_child;             /* Non-zero if it's a new thread */
+  };
 
 /* List of inferior process information */
 static struct procinfo *procinfo_list = NULL;
-static struct pollfd *poll_list; /* pollfds used for waiting on /proc */
+static struct pollfd *poll_list;       /* pollfds used for waiting on /proc */
 
 static int num_poll_list = 0;  /* Number of entries in poll_list */
 
 /*  Much of the information used in the /proc interface, particularly for
-    printing status information, is kept as tables of structures of the
-    following form.  These tables can be used to map numeric values to
-    their symbolic names and to a string that describes their specific use. */
-
-struct trans {
-  int value;                   /* The numeric value */
-  char *name;                  /* The equivalent symbolic value */
-  char *desc;                  /* Short description of value */
-};
+   printing status information, is kept as tables of structures of the
+   following form.  These tables can be used to map numeric values to
+   their symbolic names and to a string that describes their specific use. */
+
+struct trans
+  {
+    int value;                 /* The numeric value */
+    char *name;                        /* The equivalent symbolic value */
+    char *desc;                        /* Short description of value */
+  };
 
 /*  Translate bits in the pr_flags member of the prstatus structure, into the
-    names and desc information. */
+   names and desc information. */
 
 static struct trans pr_flag_table[] =
 {
 #if defined (PR_STOPPED)
-  { PR_STOPPED, "PR_STOPPED", "Process is stopped" },
+  {PR_STOPPED, "PR_STOPPED", "Process is stopped"},
 #endif
 #if defined (PR_ISTOP)
-  { PR_ISTOP, "PR_ISTOP", "Stopped on an event of interest" },
+  {PR_ISTOP, "PR_ISTOP", "Stopped on an event of interest"},
 #endif
 #if defined (PR_DSTOP)
-  { PR_DSTOP, "PR_DSTOP", "A stop directive is in effect" },
+  {PR_DSTOP, "PR_DSTOP", "A stop directive is in effect"},
 #endif
 #if defined (PR_ASLEEP)
-  { PR_ASLEEP, "PR_ASLEEP", "Sleeping in an interruptible system call" },
+  {PR_ASLEEP, "PR_ASLEEP", "Sleeping in an interruptible system call"},
 #endif
 #if defined (PR_FORK)
-  { PR_FORK, "PR_FORK", "Inherit-on-fork is in effect" },
+  {PR_FORK, "PR_FORK", "Inherit-on-fork is in effect"},
 #endif
 #if defined (PR_RLC)
-  { PR_RLC, "PR_RLC", "Run-on-last-close is in effect" },
+  {PR_RLC, "PR_RLC", "Run-on-last-close is in effect"},
 #endif
 #if defined (PR_PTRACE)
-  { PR_PTRACE, "PR_PTRACE", "Process is being controlled by ptrace" },
+  {PR_PTRACE, "PR_PTRACE", "Process is being controlled by ptrace"},
 #endif
 #if defined (PR_PCINVAL)
-  { PR_PCINVAL, "PR_PCINVAL", "PC refers to an invalid virtual address" },
+  {PR_PCINVAL, "PR_PCINVAL", "PC refers to an invalid virtual address"},
 #endif
 #if defined (PR_ISSYS)
-  { PR_ISSYS, "PR_ISSYS", "Is a system process" },
+  {PR_ISSYS, "PR_ISSYS", "Is a system process"},
 #endif
 #if defined (PR_STEP)
-  { PR_STEP, "PR_STEP", "Process has single step pending" },
+  {PR_STEP, "PR_STEP", "Process has single step pending"},
 #endif
 #if defined (PR_KLC)
-  { PR_KLC, "PR_KLC", "Kill-on-last-close is in effect" },
+  {PR_KLC, "PR_KLC", "Kill-on-last-close is in effect"},
 #endif
 #if defined (PR_ASYNC)
-  { PR_ASYNC, "PR_ASYNC", "Asynchronous stop is in effect" },
+  {PR_ASYNC, "PR_ASYNC", "Asynchronous stop is in effect"},
 #endif
 #if defined (PR_PCOMPAT)
-  { PR_PCOMPAT, "PR_PCOMPAT", "Ptrace compatibility mode in effect" },
+  {PR_PCOMPAT, "PR_PCOMPAT", "Ptrace compatibility mode in effect"},
 #endif
 #if defined (PR_MSACCT)
-  { PR_MSACCT, "PR_MSACCT", "Microstate accounting enabled" },
+  {PR_MSACCT, "PR_MSACCT", "Microstate accounting enabled"},
 #endif
 #if defined (PR_BPTADJ)
-  { PR_BPTADJ, "PR_BPTADJ", "Breakpoint PC adjustment in effect" },
+  {PR_BPTADJ, "PR_BPTADJ", "Breakpoint PC adjustment in effect"},
 #endif
 #if defined (PR_ASLWP)
-  { PR_ASLWP, "PR_ASLWP", "Asynchronus signal LWP" },
+  {PR_ASLWP, "PR_ASLWP", "Asynchronus signal LWP"},
 #endif
-  { 0, NULL, NULL }
+  {0, NULL, NULL}
 };
 
 /*  Translate values in the pr_why field of the prstatus struct. */
@@ -335,30 +345,30 @@ static struct trans pr_flag_table[] =
 static struct trans pr_why_table[] =
 {
 #if defined (PR_REQUESTED)
-  { PR_REQUESTED, "PR_REQUESTED", "Directed to stop via PIOCSTOP/PIOCWSTOP" },
+  {PR_REQUESTED, "PR_REQUESTED", "Directed to stop via PIOCSTOP/PIOCWSTOP"},
 #endif
 #if defined (PR_SIGNALLED)
-  { PR_SIGNALLED, "PR_SIGNALLED", "Receipt of a traced signal" },
+  {PR_SIGNALLED, "PR_SIGNALLED", "Receipt of a traced signal"},
 #endif
 #if defined (PR_SYSENTRY)
-  { PR_SYSENTRY, "PR_SYSENTRY", "Entry to a traced system call" },
+  {PR_SYSENTRY, "PR_SYSENTRY", "Entry to a traced system call"},
 #endif
 #if defined (PR_SYSEXIT)
-  { PR_SYSEXIT, "PR_SYSEXIT", "Exit from a traced system call" },
+  {PR_SYSEXIT, "PR_SYSEXIT", "Exit from a traced system call"},
 #endif
 #if defined (PR_JOBCONTROL)
-  { PR_JOBCONTROL, "PR_JOBCONTROL", "Default job control stop signal action" },
+  {PR_JOBCONTROL, "PR_JOBCONTROL", "Default job control stop signal action"},
 #endif
 #if defined (PR_FAULTED)
-  { PR_FAULTED, "PR_FAULTED", "Incurred a traced hardware fault" },
+  {PR_FAULTED, "PR_FAULTED", "Incurred a traced hardware fault"},
 #endif
 #if defined (PR_SUSPENDED)
-  { PR_SUSPENDED, "PR_SUSPENDED", "Process suspended" },
+  {PR_SUSPENDED, "PR_SUSPENDED", "Process suspended"},
 #endif
 #if defined (PR_CHECKPOINT)
-  { PR_CHECKPOINT, "PR_CHECKPOINT", "(???)" },
+  {PR_CHECKPOINT, "PR_CHECKPOINT", "(???)"},
 #endif
-  { 0, NULL, NULL }
+  {0, NULL, NULL}
 };
 
 /*  Hardware fault translation table. */
@@ -366,156 +376,266 @@ static struct trans pr_why_table[] =
 static struct trans faults_table[] =
 {
 #if defined (FLTILL)
-  { FLTILL, "FLTILL", "Illegal instruction" },
+  {FLTILL, "FLTILL", "Illegal instruction"},
 #endif
 #if defined (FLTPRIV)
-  { FLTPRIV, "FLTPRIV", "Privileged instruction" },
+  {FLTPRIV, "FLTPRIV", "Privileged instruction"},
 #endif
 #if defined (FLTBPT)
-  { FLTBPT, "FLTBPT", "Breakpoint trap" },
+  {FLTBPT, "FLTBPT", "Breakpoint trap"},
 #endif
 #if defined (FLTTRACE)
-  { FLTTRACE, "FLTTRACE", "Trace trap" },
+  {FLTTRACE, "FLTTRACE", "Trace trap"},
 #endif
 #if defined (FLTACCESS)
-  { FLTACCESS, "FLTACCESS", "Memory access fault" },
+  {FLTACCESS, "FLTACCESS", "Memory access fault"},
 #endif
 #if defined (FLTBOUNDS)
-  { FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
+  {FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation"},
 #endif
 #if defined (FLTIOVF)
-  { FLTIOVF, "FLTIOVF", "Integer overflow" },
+  {FLTIOVF, "FLTIOVF", "Integer overflow"},
 #endif
 #if defined (FLTIZDIV)
-  { FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
+  {FLTIZDIV, "FLTIZDIV", "Integer zero divide"},
 #endif
 #if defined (FLTFPE)
-  { FLTFPE, "FLTFPE", "Floating-point exception" },
+  {FLTFPE, "FLTFPE", "Floating-point exception"},
 #endif
 #if defined (FLTSTACK)
-  { FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
+  {FLTSTACK, "FLTSTACK", "Unrecoverable stack fault"},
 #endif
 #if defined (FLTPAGE)
-  { FLTPAGE, "FLTPAGE", "Recoverable page fault" },
+  {FLTPAGE, "FLTPAGE", "Recoverable page fault"},
 #endif
-  { 0, NULL, NULL }
+  {0, NULL, NULL}
 };
 
 /* Translation table for signal generation information.  See UNIX System
    V Release 4 Programmer's Reference Manual, siginfo(5).  */
 
-static struct sigcode {
-  int signo;
-  int code;
-  char *codename;
-  char *desc;
-} siginfo_table[] = {
+static struct sigcode
+  {
+    int signo;
+    int code;
+    char *codename;
+    char *desc;
+  }
+siginfo_table[] =
+{
 #if defined (SIGILL) && defined (ILL_ILLOPC)
-  { SIGILL, ILL_ILLOPC, "ILL_ILLOPC", "Illegal opcode" },
+  {
+    SIGILL, ILL_ILLOPC, "ILL_ILLOPC", "Illegal opcode"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_ILLOPN)
-  { SIGILL, ILL_ILLOPN, "ILL_ILLOPN", "Illegal operand", },
+  {
+    SIGILL, ILL_ILLOPN, "ILL_ILLOPN", "Illegal operand",
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_ILLADR)
-  { SIGILL, ILL_ILLADR, "ILL_ILLADR", "Illegal addressing mode" },
+  {
+    SIGILL, ILL_ILLADR, "ILL_ILLADR", "Illegal addressing mode"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_ILLTRP)
-  { SIGILL, ILL_ILLTRP, "ILL_ILLTRP", "Illegal trap" },
+  {
+    SIGILL, ILL_ILLTRP, "ILL_ILLTRP", "Illegal trap"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_PRVOPC)
-  { SIGILL, ILL_PRVOPC, "ILL_PRVOPC", "Privileged opcode" },
+  {
+    SIGILL, ILL_PRVOPC, "ILL_PRVOPC", "Privileged opcode"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_PRVREG)
-  { SIGILL, ILL_PRVREG, "ILL_PRVREG", "Privileged register" },
+  {
+    SIGILL, ILL_PRVREG, "ILL_PRVREG", "Privileged register"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_COPROC)
-  { SIGILL, ILL_COPROC, "ILL_COPROC", "Coprocessor error" },
+  {
+    SIGILL, ILL_COPROC, "ILL_COPROC", "Coprocessor error"
+  }
+  ,
 #endif
 #if defined (SIGILL) && defined (ILL_BADSTK)
-  { SIGILL, ILL_BADSTK, "ILL_BADSTK", "Internal stack error" },
+  {
+    SIGILL, ILL_BADSTK, "ILL_BADSTK", "Internal stack error"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_INTDIV)
-  { SIGFPE, FPE_INTDIV, "FPE_INTDIV", "Integer divide by zero" },
+  {
+    SIGFPE, FPE_INTDIV, "FPE_INTDIV", "Integer divide by zero"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_INTOVF)
-  { SIGFPE, FPE_INTOVF, "FPE_INTOVF", "Integer overflow" },
+  {
+    SIGFPE, FPE_INTOVF, "FPE_INTOVF", "Integer overflow"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTDIV)
-  { SIGFPE, FPE_FLTDIV, "FPE_FLTDIV", "Floating point divide by zero" },
+  {
+    SIGFPE, FPE_FLTDIV, "FPE_FLTDIV", "Floating point divide by zero"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTOVF)
-  { SIGFPE, FPE_FLTOVF, "FPE_FLTOVF", "Floating point overflow" },
+  {
+    SIGFPE, FPE_FLTOVF, "FPE_FLTOVF", "Floating point overflow"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTUND)
-  { SIGFPE, FPE_FLTUND, "FPE_FLTUND", "Floating point underflow" },
+  {
+    SIGFPE, FPE_FLTUND, "FPE_FLTUND", "Floating point underflow"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTRES)
-  { SIGFPE, FPE_FLTRES, "FPE_FLTRES", "Floating point inexact result" },
+  {
+    SIGFPE, FPE_FLTRES, "FPE_FLTRES", "Floating point inexact result"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTINV)
-  { SIGFPE, FPE_FLTINV, "FPE_FLTINV", "Invalid floating point operation" },
+  {
+    SIGFPE, FPE_FLTINV, "FPE_FLTINV", "Invalid floating point operation"
+  }
+  ,
 #endif
 #if defined (SIGFPE) && defined (FPE_FLTSUB)
-  { SIGFPE, FPE_FLTSUB, "FPE_FLTSUB", "Subscript out of range" },
+  {
+    SIGFPE, FPE_FLTSUB, "FPE_FLTSUB", "Subscript out of range"
+  }
+  ,
 #endif
 #if defined (SIGSEGV) && defined (SEGV_MAPERR)
-  { SIGSEGV, SEGV_MAPERR, "SEGV_MAPERR", "Address not mapped to object" },
+  {
+    SIGSEGV, SEGV_MAPERR, "SEGV_MAPERR", "Address not mapped to object"
+  }
+  ,
 #endif
 #if defined (SIGSEGV) && defined (SEGV_ACCERR)
-  { SIGSEGV, SEGV_ACCERR, "SEGV_ACCERR", "Invalid permissions for object" },
+  {
+    SIGSEGV, SEGV_ACCERR, "SEGV_ACCERR", "Invalid permissions for object"
+  }
+  ,
 #endif
 #if defined (SIGBUS) && defined (BUS_ADRALN)
-  { SIGBUS, BUS_ADRALN, "BUS_ADRALN", "Invalid address alignment" },
+  {
+    SIGBUS, BUS_ADRALN, "BUS_ADRALN", "Invalid address alignment"
+  }
+  ,
 #endif
 #if defined (SIGBUS) && defined (BUS_ADRERR)
-  { SIGBUS, BUS_ADRERR, "BUS_ADRERR", "Non-existent physical address" },
+  {
+    SIGBUS, BUS_ADRERR, "BUS_ADRERR", "Non-existent physical address"
+  }
+  ,
 #endif
 #if defined (SIGBUS) && defined (BUS_OBJERR)
-  { SIGBUS, BUS_OBJERR, "BUS_OBJERR", "Object specific hardware error" },
+  {
+    SIGBUS, BUS_OBJERR, "BUS_OBJERR", "Object specific hardware error"
+  }
+  ,
 #endif
 #if defined (SIGTRAP) && defined (TRAP_BRKPT)
-  { SIGTRAP, TRAP_BRKPT, "TRAP_BRKPT", "Process breakpoint" },
+  {
+    SIGTRAP, TRAP_BRKPT, "TRAP_BRKPT", "Process breakpoint"
+  }
+  ,
 #endif
 #if defined (SIGTRAP) && defined (TRAP_TRACE)
-  { SIGTRAP, TRAP_TRACE, "TRAP_TRACE", "Process trace trap" },
+  {
+    SIGTRAP, TRAP_TRACE, "TRAP_TRACE", "Process trace trap"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_EXITED)
-  { SIGCLD, CLD_EXITED, "CLD_EXITED", "Child has exited" },
+  {
+    SIGCLD, CLD_EXITED, "CLD_EXITED", "Child has exited"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_KILLED)
-  { SIGCLD, CLD_KILLED, "CLD_KILLED", "Child was killed" },
+  {
+    SIGCLD, CLD_KILLED, "CLD_KILLED", "Child was killed"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_DUMPED)
-  { SIGCLD, CLD_DUMPED, "CLD_DUMPED", "Child has terminated abnormally" },
+  {
+    SIGCLD, CLD_DUMPED, "CLD_DUMPED", "Child has terminated abnormally"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_TRAPPED)
-  { SIGCLD, CLD_TRAPPED, "CLD_TRAPPED", "Traced child has trapped" },
+  {
+    SIGCLD, CLD_TRAPPED, "CLD_TRAPPED", "Traced child has trapped"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_STOPPED)
-  { SIGCLD, CLD_STOPPED, "CLD_STOPPED", "Child has stopped" },
+  {
+    SIGCLD, CLD_STOPPED, "CLD_STOPPED", "Child has stopped"
+  }
+  ,
 #endif
 #if defined (SIGCLD) && defined (CLD_CONTINUED)
-  { SIGCLD, CLD_CONTINUED, "CLD_CONTINUED", "Stopped child had continued" },
+  {
+    SIGCLD, CLD_CONTINUED, "CLD_CONTINUED", "Stopped child had continued"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_IN)
-  { SIGPOLL, POLL_IN, "POLL_IN", "Input input available" },
+  {
+    SIGPOLL, POLL_IN, "POLL_IN", "Input input available"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_OUT)
-  { SIGPOLL, POLL_OUT, "POLL_OUT", "Output buffers available" },
+  {
+    SIGPOLL, POLL_OUT, "POLL_OUT", "Output buffers available"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_MSG)
-  { SIGPOLL, POLL_MSG, "POLL_MSG", "Input message available" },
+  {
+    SIGPOLL, POLL_MSG, "POLL_MSG", "Input message available"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_ERR)
-  { SIGPOLL, POLL_ERR, "POLL_ERR", "I/O error" },
+  {
+    SIGPOLL, POLL_ERR, "POLL_ERR", "I/O error"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_PRI)
-  { SIGPOLL, POLL_PRI, "POLL_PRI", "High priority input available" },
+  {
+    SIGPOLL, POLL_PRI, "POLL_PRI", "High priority input available"
+  }
+  ,
 #endif
 #if defined (SIGPOLL) && defined (POLL_HUP)
-  { SIGPOLL, POLL_HUP, "POLL_HUP", "Device disconnected" },
+  {
+    SIGPOLL, POLL_HUP, "POLL_HUP", "Device disconnected"
+  }
+  ,
 #endif
-  { 0, 0, NULL, NULL }
+  {
+    0, 0, NULL, NULL
+  }
 };
 
 static char *syscall_table[MAX_SYSCALLS];
@@ -546,7 +666,7 @@ static void procfs_attach PARAMS ((char *, int));
 
 static void proc_set_exec_trap PARAMS ((void));
 
-static void  procfs_init_inferior PARAMS ((int));
+static void procfs_init_inferior PARAMS ((int));
 
 static struct procinfo *create_procinfo PARAMS ((int));
 
@@ -582,127 +702,128 @@ static int open_proc_file PARAMS ((int, struct procinfo *, int, int));
 
 static void close_proc_file PARAMS ((struct procinfo *));
 
-static void close_proc_file_cleanup PARAMS ((void*));
+static void close_proc_file_cleanup PARAMS ((void *));
 
 static struct cleanup *make_cleanup_close_proc_file PARAMS ((struct procinfo *));
 
 static void unconditionally_kill_inferior PARAMS ((struct procinfo *));
 
-static NORETURN void proc_init_failed PARAMS ((struct procinfo *, char *, int)) ATTR_NORETURN;
+static NORETURN void proc_init_failed
+PARAMS ((struct procinfo *, char *, int)) ATTR_NORETURN;
 
-static void info_proc PARAMS ((char *, int));
+     static void info_proc PARAMS ((char *, int));
 
-static void info_proc_flags PARAMS ((struct procinfo *, int));
+     static void info_proc_flags PARAMS ((struct procinfo *, int));
 
-static void info_proc_stop PARAMS ((struct procinfo *, int));
+     static void info_proc_stop PARAMS ((struct procinfo *, int));
 
-static void info_proc_siginfo PARAMS ((struct procinfo *, int));
+     static void info_proc_siginfo PARAMS ((struct procinfo *, int));
 
-static void info_proc_syscalls PARAMS ((struct procinfo *, int));
+     static void info_proc_syscalls PARAMS ((struct procinfo *, int));
 
-static void info_proc_mappings PARAMS ((struct procinfo *, int));
+     static void info_proc_mappings PARAMS ((struct procinfo *, int));
 
-static void info_proc_signals PARAMS ((struct procinfo *, int));
+     static void info_proc_signals PARAMS ((struct procinfo *, int));
 
-static void info_proc_faults PARAMS ((struct procinfo *, int));
+     static void info_proc_faults PARAMS ((struct procinfo *, int));
 
-static char *mappingflags PARAMS ((long));
+     static char *mappingflags PARAMS ((long));
 
-static char *lookupname PARAMS ((struct trans *, unsigned int, char *));
+     static char *lookupname PARAMS ((struct trans *, unsigned int, char *));
 
-static char *lookupdesc PARAMS ((struct trans *, unsigned int));
+     static char *lookupdesc PARAMS ((struct trans *, unsigned int));
 
-static int do_attach PARAMS ((int pid));
+     static int do_attach PARAMS ((int pid));
 
-static void do_detach PARAMS ((int siggnal));
+     static void do_detach PARAMS ((int siggnal));
 
-static void procfs_create_inferior PARAMS ((char *, char *, char **));
+     static void procfs_create_inferior PARAMS ((char *, char *, char **));
 
-static void procfs_notice_signals PARAMS ((int pid));
+     static void procfs_notice_signals PARAMS ((int pid));
 
-static void notice_signals PARAMS ((struct procinfo *, struct sig_ctl *));
+     static void notice_signals PARAMS ((struct procinfo *, struct sig_ctl *));
 
-static struct procinfo *find_procinfo PARAMS ((pid_t pid, int okfail));
+     static struct procinfo *find_procinfo PARAMS ((pid_t pid, int okfail));
 
-static int procfs_write_pcwstop PARAMS ((struct procinfo *));
-static int procfs_read_status PARAMS ((struct procinfo *));
-static void procfs_write_pckill PARAMS ((struct procinfo *));
+     static int procfs_write_pcwstop PARAMS ((struct procinfo *));
+     static int procfs_read_status PARAMS ((struct procinfo *));
+     static void procfs_write_pckill PARAMS ((struct procinfo *));
 
-typedef int syscall_func_t PARAMS ((struct procinfo *pi, int syscall_num,
-                                   int why, int *rtnval, int *statval));
+     typedef int syscall_func_t PARAMS ((struct procinfo * pi, int syscall_num,
+                                      int why, int *rtnval, int *statval));
 
-static void procfs_set_syscall_trap PARAMS ((struct procinfo *pi,
-                                            int syscall_num, int flags,
-                                            syscall_func_t *func));
+     static void procfs_set_syscall_trap PARAMS ((struct procinfo * pi,
+                                                 int syscall_num, int flags,
+                                                 syscall_func_t * func));
 
-static void procfs_clear_syscall_trap PARAMS ((struct procinfo *pi,
+     static void procfs_clear_syscall_trap PARAMS ((struct procinfo * pi,
                                               int syscall_num, int errok));
 
-#define PROCFS_SYSCALL_ENTRY 0x1 /* Trap on entry to sys call */
+#define PROCFS_SYSCALL_ENTRY 0x1       /* Trap on entry to sys call */
 #define PROCFS_SYSCALL_EXIT 0x2        /* Trap on exit from sys call */
 
-static syscall_func_t procfs_exit_handler;
+     static syscall_func_t procfs_exit_handler;
 
-static syscall_func_t procfs_exec_handler;
+     static syscall_func_t procfs_exec_handler;
 
 #ifdef SYS_sproc
-static syscall_func_t procfs_sproc_handler;
-static syscall_func_t procfs_fork_handler;
+     static syscall_func_t procfs_sproc_handler;
+     static syscall_func_t procfs_fork_handler;
 #endif
 
 #ifdef SYS_lwp_create
-static syscall_func_t procfs_lwp_creation_handler;
+     static syscall_func_t procfs_lwp_creation_handler;
 #endif
 
-static void modify_inherit_on_fork_flag PARAMS ((int fd, int flag));
-static void modify_run_on_last_close_flag PARAMS ((int fd, int flag));
+     static void modify_inherit_on_fork_flag PARAMS ((int fd, int flag));
+     static void modify_run_on_last_close_flag PARAMS ((int fd, int flag));
 
 /* */
 
-struct procfs_syscall_handler
-{
-  int syscall_num;             /* The number of the system call being handled */
-                               /* The function to be called */
-  syscall_func_t *func;
-};
+     struct procfs_syscall_handler
+       {
+        int syscall_num;       /* The number of the system call being handled */
+        /* The function to be called */
+        syscall_func_t *func;
+       };
 
-static void procfs_resume PARAMS ((int pid, int step,
-                                  enum target_signal signo));
+     static void procfs_resume PARAMS ((int pid, int step,
+                                       enum target_signal signo));
 
-static void init_procfs_ops PARAMS ((void));
+     static void init_procfs_ops PARAMS ((void));
 
 /* External function prototypes that can't be easily included in any
    header file because the args are typedefs in system include files. */
 
-extern void supply_gregset PARAMS ((gdb_gregset_t *));
+     extern void supply_gregset PARAMS ((gdb_gregset_t *));
 
-extern void fill_gregset PARAMS ((gdb_gregset_t *, int));
+     extern void fill_gregset PARAMS ((gdb_gregset_t *, int));
 
 #ifdef FP0_REGNUM
-extern void supply_fpregset PARAMS ((gdb_fpregset_t *));
+     extern void supply_fpregset PARAMS ((gdb_fpregset_t *));
 
-extern void fill_fpregset PARAMS ((gdb_fpregset_t *, int));
+     extern void fill_fpregset PARAMS ((gdb_fpregset_t *, int));
 #endif
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
+
+   find_procinfo -- convert a process id to a struct procinfo
 
-       find_procinfo -- convert a process id to a struct procinfo
+   SYNOPSIS
 
-SYNOPSIS
+   static struct procinfo * find_procinfo (pid_t pid, int okfail);
 
-       static struct procinfo * find_procinfo (pid_t pid, int okfail);
+   DESCRIPTION
 
-DESCRIPTION
-       
-       Given a process id, look it up in the procinfo chain.  Returns
-       a struct procinfo *.  If can't find pid, then call error(),
-       unless okfail is set, in which case, return NULL;
+   Given a process id, look it up in the procinfo chain.  Returns
+   a struct procinfo *.  If can't find pid, then call error(),
+   unless okfail is set, in which case, return NULL;
  */
 
-static struct procinfo *
-find_procinfo (pid, okfail)
+     static struct procinfo *
+       find_procinfo (pid, okfail)
      pid_t pid;
      int okfail;
 {
@@ -720,36 +841,36 @@ find_procinfo (pid, okfail)
 
 /*
 
-LOCAL MACRO
+   LOCAL MACRO
+
+   current_procinfo -- convert inferior_pid to a struct procinfo
 
-       current_procinfo -- convert inferior_pid to a struct procinfo
+   SYNOPSIS
 
-SYNOPSIS
+   static struct procinfo * current_procinfo;
 
-       static struct procinfo * current_procinfo;
+   DESCRIPTION
 
-DESCRIPTION
-       
-       Looks up inferior_pid in the procinfo chain.  Always returns a
-       struct procinfo *.  If process can't be found, we error() out.
+   Looks up inferior_pid in the procinfo chain.  Always returns a
+   struct procinfo *.  If process can't be found, we error() out.
  */
 
 #define current_procinfo find_procinfo (inferior_pid, 0)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       add_fd -- Add the fd to the poll/select list
+   add_fd -- Add the fd to the poll/select list
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void add_fd (struct procinfo *);
+   static void add_fd (struct procinfo *);
 
-DESCRIPTION
-       
-       Add the fd of the supplied procinfo to the list of fds used for
-       poll/select operations.
+   DESCRIPTION
+
+   Add the fd of the supplied procinfo to the list of fds used for
+   poll/select operations.
  */
 
 static void
@@ -774,18 +895,18 @@ add_fd (pi)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
+
+   remove_fd -- Remove the fd from the poll/select list
 
-       remove_fd -- Remove the fd from the poll/select list
+   SYNOPSIS
 
-SYNOPSIS
+   static void remove_fd (struct procinfo *);
 
-       static void remove_fd (struct procinfo *);
+   DESCRIPTION
 
-DESCRIPTION
-       
-       Remove the fd of the supplied procinfo from the list of fds used 
-       for poll/select operations.
+   Remove the fd of the supplied procinfo from the list of fds used 
+   for poll/select operations.
  */
 
 static void
@@ -809,7 +930,7 @@ remove_fd (pi)
          else
            poll_list = (struct pollfd *) xrealloc (poll_list,
                                                    num_poll_list
-                                                   * sizeof (struct pollfd));
+                                                 * sizeof (struct pollfd));
          return;
        }
     }
@@ -817,29 +938,29 @@ remove_fd (pi)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_read_status - get procfs fd status
+   procfs_read_status - get procfs fd status
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int procfs_read_status (pi) struct procinfo *pi;
+   static int procfs_read_status (pi) struct procinfo *pi;
 
-DESCRIPTION
-       
-       Given a pointer to a procinfo struct, get the status of
-       the status_fd in the appropriate way.  Returns 0 on failure,
-       1 on success.
+   DESCRIPTION
+
+   Given a pointer to a procinfo struct, get the status of
+   the status_fd in the appropriate way.  Returns 0 on failure,
+   1 on success.
  */
 
 static int
 procfs_read_status (pi)
-  struct procinfo *pi;
+     struct procinfo *pi;
 {
 #ifdef PROCFS_USE_READ_WRITE
-   if ((lseek (pi->status_fd, 0, SEEK_SET) < 0) ||
-           (read (pi->status_fd, (char *) &pi->prstatus, 
-             sizeof (gdb_prstatus_t)) != sizeof (gdb_prstatus_t)))
+  if ((lseek (pi->status_fd, 0, SEEK_SET) < 0) ||
+      (read (pi->status_fd, (char *) &pi->prstatus,
+            sizeof (gdb_prstatus_t)) != sizeof (gdb_prstatus_t)))
 #else
   if (ioctl (pi->status_fd, PIOCSTATUS, &pi->prstatus) < 0)
 #endif
@@ -850,24 +971,24 @@ procfs_read_status (pi)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
+
+   procfs_write_pcwstop - send a PCWSTOP to procfs fd
 
-       procfs_write_pcwstop - send a PCWSTOP to procfs fd
+   SYNOPSIS
 
-SYNOPSIS
+   static int procfs_write_pcwstop (pi) struct procinfo *pi;
 
-       static int procfs_write_pcwstop (pi) struct procinfo *pi;
+   DESCRIPTION
 
-DESCRIPTION
-       
-       Given a pointer to a procinfo struct, send a PCWSTOP to
-       the ctl_fd in the appropriate way.  Returns 0 on failure,
-       1 on success.
+   Given a pointer to a procinfo struct, send a PCWSTOP to
+   the ctl_fd in the appropriate way.  Returns 0 on failure,
+   1 on success.
  */
 
 static int
 procfs_write_pcwstop (pi)
-  struct procinfo *pi;
+     struct procinfo *pi;
 {
 #ifdef PROCFS_USE_READ_WRITE
   long cmd = PCWSTOP;
@@ -882,24 +1003,24 @@ procfs_write_pcwstop (pi)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_write_pckill - send a kill to procfs fd
+   procfs_write_pckill - send a kill to procfs fd
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void procfs_write_pckill (pi) struct procinfo *pi;
+   static void procfs_write_pckill (pi) struct procinfo *pi;
 
-DESCRIPTION
-       
-       Given a pointer to a procinfo struct, send a kill to
-       the ctl_fd in the appropriate way.  Returns 0 on failure,
-       1 on success.
+   DESCRIPTION
+
+   Given a pointer to a procinfo struct, send a kill to
+   the ctl_fd in the appropriate way.  Returns 0 on failure,
+   1 on success.
  */
 
 static void
 procfs_write_pckill (pi)
-  struct procinfo *pi;
+     struct procinfo *pi;
 {
 #ifdef PROCFS_USE_READ_WRITE
   struct proc_ctl pctl;
@@ -921,11 +1042,11 @@ wait_fd ()
   int i;
 #endif
 
-  set_sigint_trap ();  /* Causes SIGINT to be passed on to the
-                          attached process. */
+  set_sigint_trap ();          /* Causes SIGINT to be passed on to the
+                                  attached process. */
   set_sigio_trap ();
 
- wait_again:
+wait_again:
 #ifndef LOSING_POLL
   while (1)
     {
@@ -956,7 +1077,7 @@ wait_fd ()
     }
   pi->had_event = 1;
 #endif /* LOSING_POLL */
-  
+
   clear_sigint_trap ();
   clear_sigio_trap ();
 
@@ -964,7 +1085,7 @@ wait_fd ()
 
   for (i = 0; i < num_poll_list && num_fds > 0; i++)
     {
-      if (0 == (poll_list[i].revents & 
+      if (0 == (poll_list[i].revents &
                (POLLWRNORM | POLLPRI | POLLERR | POLLHUP | POLLNVAL)))
        continue;
       for (pi = procinfo_list; pi; pi = next_pi)
@@ -973,9 +1094,9 @@ wait_fd ()
          if (poll_list[i].fd == pi->ctl_fd)
            {
              num_fds--;
-             if ((poll_list[i].revents & POLLHUP) != 0 ||
-                 !procfs_read_status(pi))
-               { /* The LWP has apparently terminated.  */
+             if ((poll_list[i].revents & POLLHUP) != 0 ||
+                 !procfs_read_status (pi))
+               {               /* The LWP has apparently terminated.  */
                  if (num_poll_list <= 1)
                    {
                      pi->prstatus.pr_flags = 0;
@@ -983,14 +1104,14 @@ wait_fd ()
                      break;
                    }
                  if (info_verbose)
-                   printf_filtered ("LWP %d exited.\n", 
+                   printf_filtered ("LWP %d exited.\n",
                                     (pi->pid >> 16) & 0xffff);
                  close_proc_file (pi);
-                 i--;                  /* don't skip deleted entry */
+                 i--;          /* don't skip deleted entry */
                  if (num_fds != 0)
-                   break;              /* already another event to process */
+                   break;      /* already another event to process */
                  else
-                   goto wait_again;    /* wait for another event */
+                   goto wait_again;    /* wait for another event */
                }
              pi->had_event = 1;
              break;
@@ -1007,18 +1128,18 @@ wait_fd ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       lookupdesc -- translate a value to a summary desc string
+   lookupdesc -- translate a value to a summary desc string
 
-SYNOPSIS
+   SYNOPSIS
 
-       static char *lookupdesc (struct trans *transp, unsigned int val);
+   static char *lookupdesc (struct trans *transp, unsigned int val);
 
-DESCRIPTION
-       
-       Given a pointer to a translation table and a value to be translated,
-       lookup the desc string and return it.
+   DESCRIPTION
+
+   Given a pointer to a translation table and a value to be translated,
+   lookup the desc string and return it.
  */
 
 static char *
@@ -1027,12 +1148,12 @@ lookupdesc (transp, val)
      unsigned int val;
 {
   char *desc;
-  
-  for (desc = NULL; transp -> name != NULL; transp++)
+
+  for (desc = NULL; transp->name != NULL; transp++)
     {
-      if (transp -> value == val)
+      if (transp->value == val)
        {
-         desc = transp -> desc;
+         desc = transp->desc;
          break;
        }
     }
@@ -1048,25 +1169,25 @@ lookupdesc (transp, val)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       lookupname -- translate a value to symbolic name
+   lookupname -- translate a value to symbolic name
 
-SYNOPSIS
+   SYNOPSIS
 
-       static char *lookupname (struct trans *transp, unsigned int val,
-                                char *prefix);
+   static char *lookupname (struct trans *transp, unsigned int val,
+   char *prefix);
 
-DESCRIPTION
-       
-       Given a pointer to a translation table, a value to be translated,
-       and a default prefix to return if the value can't be translated,
-       match the value with one of the translation table entries and
-       return a pointer to the symbolic name.
+   DESCRIPTION
 
-       If no match is found it just returns the value as a printable string,
-       with the given prefix.  The previous such value, if any, is freed
-       at this time.
+   Given a pointer to a translation table, a value to be translated,
+   and a default prefix to return if the value can't be translated,
+   match the value with one of the translation table entries and
+   return a pointer to the symbolic name.
+
+   If no match is found it just returns the value as a printable string,
+   with the given prefix.  The previous such value, if any, is freed
+   at this time.
  */
 
 static char *
@@ -1077,12 +1198,12 @@ lookupname (transp, val, prefix)
 {
   static char *locbuf;
   char *name;
-  
-  for (name = NULL; transp -> name != NULL; transp++)
+
+  for (name = NULL; transp->name != NULL; transp++)
     {
-      if (transp -> value == val)
+      if (transp->value == val)
        {
-         name = transp -> name;
+         name = transp->name;
          break;
        }
     }
@@ -1111,19 +1232,19 @@ sigcodename (sip)
   struct sigcode *scp;
   char *name = NULL;
   static char locbuf[32];
-  
-  for (scp = siginfo_table; scp -> codename != NULL; scp++)
+
+  for (scp = siginfo_table; scp->codename != NULL; scp++)
     {
-      if ((scp -> signo == sip -> si_signo) &&
-         (scp -> code == sip -> si_code))
+      if ((scp->signo == sip->si_signo) &&
+         (scp->code == sip->si_code))
        {
-         name = scp -> codename;
+         name = scp->codename;
          break;
        }
     }
   if (name == NULL)
     {
-      sprintf (locbuf, "sigcode %u", sip -> si_signo);
+      sprintf (locbuf, "sigcode %u", sip->si_signo);
       name = locbuf;
     }
   return (name);
@@ -1135,13 +1256,13 @@ sigcodedesc (sip)
 {
   struct sigcode *scp;
   char *desc = NULL;
-  
-  for (scp = siginfo_table; scp -> codename != NULL; scp++)
+
+  for (scp = siginfo_table; scp->codename != NULL; scp++)
     {
-      if ((scp -> signo == sip -> si_signo) &&
-         (scp -> code == sip -> si_code))
+      if ((scp->signo == sip->si_signo) &&
+         (scp->code == sip->si_code))
        {
-         desc = scp -> desc;
+         desc = scp->desc;
          break;
        }
     }
@@ -1154,19 +1275,19 @@ sigcodedesc (sip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       syscallname - translate a system call number into a system call name
+   syscallname - translate a system call number into a system call name
 
-SYNOPSIS
+   SYNOPSIS
 
-       char *syscallname (int syscallnum)
+   char *syscallname (int syscallnum)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a system call number, translate it into the printable name
-       of a system call, or into "syscall <num>" if it is an unknown
-       number.
+   Given a system call number, translate it into the printable name
+   of a system call, or into "syscall <num>" if it is an unknown
+   number.
  */
 
 static char *
@@ -1174,7 +1295,7 @@ syscallname (syscallnum)
      int syscallnum;
 {
   static char locbuf[32];
-  
+
   if (syscallnum >= 0 && syscallnum < MAX_SYSCALLS
       && syscall_table[syscallnum] != NULL)
     return syscall_table[syscallnum];
@@ -1187,24 +1308,24 @@ syscallname (syscallnum)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       init_syscall_table - initialize syscall translation table
+   init_syscall_table - initialize syscall translation table
 
-SYNOPSIS
+   SYNOPSIS
 
-       void init_syscall_table (void)
+   void init_syscall_table (void)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Dynamically initialize the translation table to convert system
-       call numbers into printable system call names.  Done once per
-       gdb run, on initialization.
+   Dynamically initialize the translation table to convert system
+   call numbers into printable system call names.  Done once per
+   gdb run, on initialization.
 
-NOTES
+   NOTES
 
-       This is awfully ugly, but preprocessor tricks to make it prettier
-       tend to be nonportable.
+   This is awfully ugly, but preprocessor tricks to make it prettier
+   tend to be nonportable.
  */
 
 static void
@@ -1829,25 +1950,25 @@ init_syscall_table ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_kill_inferior - kill any current inferior
+   procfs_kill_inferior - kill any current inferior
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_kill_inferior (void)
+   void procfs_kill_inferior (void)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Kill any current inferior.
+   Kill any current inferior.
 
-NOTES
+   NOTES
 
-       Kills even attached inferiors.  Presumably the user has already
-       been prompted that the inferior is an attached one rather than
-       one started by gdb.  (FIXME?)
+   Kills even attached inferiors.  Presumably the user has already
+   been prompted that the inferior is an attached one rather than
+   one started by gdb.  (FIXME?)
 
-*/
+ */
 
 static void
 procfs_kill_inferior ()
@@ -1857,26 +1978,26 @@ procfs_kill_inferior ()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       unconditionally_kill_inferior - terminate the inferior
+   unconditionally_kill_inferior - terminate the inferior
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void unconditionally_kill_inferior (struct procinfo *)
+   static void unconditionally_kill_inferior (struct procinfo *)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Kill the specified inferior.
+   Kill the specified inferior.
 
-NOTE
+   NOTE
 
-       A possibly useful enhancement would be to first try sending
-       the inferior a terminate signal, politely asking it to commit
-       suicide, before we murder it (we could call that
-       politely_kill_inferior()).
+   A possibly useful enhancement would be to first try sending
+   the inferior a terminate signal, politely asking it to commit
+   suicide, before we murder it (we could call that
+   politely_kill_inferior()).
 
-*/
+ */
 
 static void
 unconditionally_kill_inferior (pi)
@@ -1884,7 +2005,7 @@ unconditionally_kill_inferior (pi)
 {
   int ppid;
   struct proc_ctl pctl;
-  
+
   ppid = pi->prstatus.pr_ppid;
 
 #ifdef PROCFS_NEED_CLEAR_CURSIG_FOR_KILL
@@ -1919,35 +2040,35 @@ unconditionally_kill_inferior (pi)
 /* Only wait() for our direct children.  Our grandchildren zombies are killed
    by the death of their parents.  */
 
-  if (ppid == getpid())
+  if (ppid == getpid ())
     wait ((int *) 0);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
+
+   procfs_xfer_memory -- copy data to or from inferior memory space
 
-       procfs_xfer_memory -- copy data to or from inferior memory space
+   SYNOPSIS
 
-SYNOPSIS
+   int procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+   int dowrite, struct target_ops target)
 
-       int procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
-               int dowrite, struct target_ops target)
+   DESCRIPTION
 
-DESCRIPTION
+   Copy LEN bytes to/from inferior's memory starting at MEMADDR
+   from/to debugger memory starting at MYADDR.  Copy from inferior
+   if DOWRITE is zero or to inferior if DOWRITE is nonzero.
 
-       Copy LEN bytes to/from inferior's memory starting at MEMADDR
-       from/to debugger memory starting at MYADDR.  Copy from inferior
-       if DOWRITE is zero or to inferior if DOWRITE is nonzero.
-  
-       Returns the length copied, which is either the LEN argument or
-       zero.  This xfer function does not do partial moves, since procfs_ops
-       doesn't allow memory operations to cross below us in the target stack
-       anyway.
+   Returns the length copied, which is either the LEN argument or
+   zero.  This xfer function does not do partial moves, since procfs_ops
+   doesn't allow memory operations to cross below us in the target stack
+   anyway.
 
-NOTES
+   NOTES
 
-       The /proc interface makes this an almost trivial task.
+   The /proc interface makes this an almost trivial task.
  */
 
 static int
@@ -1956,14 +2077,14 @@ procfs_xfer_memory (memaddr, myaddr, len, dowrite, target)
      char *myaddr;
      int len;
      int dowrite;
-     struct target_ops *target; /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   int nbytes = 0;
   struct procinfo *pi;
 
   pi = current_procinfo;
 
-  if (lseek(pi->as_fd, (off_t) memaddr, SEEK_SET) == (off_t) memaddr)
+  if (lseek (pi->as_fd, (off_t) memaddr, SEEK_SET) == (off_t) memaddr)
     {
       if (dowrite)
        {
@@ -1983,39 +2104,39 @@ procfs_xfer_memory (memaddr, myaddr, len, dowrite, target)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_store_registers -- copy register values back to inferior
+   procfs_store_registers -- copy register values back to inferior
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_store_registers (int regno)
+   void procfs_store_registers (int regno)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Store our current register values back into the inferior.  If
-       REGNO is -1 then store all the register, otherwise store just
-       the value specified by REGNO.
+   Store our current register values back into the inferior.  If
+   REGNO is -1 then store all the register, otherwise store just
+   the value specified by REGNO.
 
-NOTES
+   NOTES
 
-       If we are storing only a single register, we first have to get all
-       the current values from the process, overwrite the desired register
-       in the gregset with the one we want from gdb's registers, and then
-       send the whole set back to the process.  For writing all the
-       registers, all we have to do is generate the gregset and send it to
-       the process.
+   If we are storing only a single register, we first have to get all
+   the current values from the process, overwrite the desired register
+   in the gregset with the one we want from gdb's registers, and then
+   send the whole set back to the process.  For writing all the
+   registers, all we have to do is generate the gregset and send it to
+   the process.
 
-       Also note that the process has to be stopped on an event of interest
-       for this to work, which basically means that it has to have been
-       run under the control of one of the other /proc ioctl calls and not
-       ptrace.  Since we don't use ptrace anyway, we don't worry about this
-       fine point, but it is worth noting for future reference.
+   Also note that the process has to be stopped on an event of interest
+   for this to work, which basically means that it has to have been
+   run under the control of one of the other /proc ioctl calls and not
+   ptrace.  Since we don't use ptrace anyway, we don't worry about this
+   fine point, but it is worth noting for future reference.
 
-       Gdb is confused about what this function is supposed to return.
-       Some versions return a value, others return nothing.  Some are
-       declared to return a value and actually return nothing.  Gdb ignores
-       anything returned.  (FIXME)
+   Gdb is confused about what this function is supposed to return.
+   Some versions return a value, others return nothing.  Some are
+   declared to return a value and actually return nothing.  Gdb ignores
+   anything returned.  (FIXME)
 
  */
 
@@ -2036,8 +2157,8 @@ procfs_store_registers (regno)
     {
       procfs_read_status (pi);
       memcpy ((char *) &greg.gregset,
-         (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.gregs,
-         sizeof (gdb_gregset_t));
+             (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.gregs,
+             sizeof (gdb_gregset_t));
     }
   fill_gregset (&greg.gregset, regno);
   greg.cmd = PCSREG;
@@ -2062,8 +2183,8 @@ procfs_store_registers (regno)
     {
       procfs_read_status (pi);
       memcpy ((char *) &fpreg.fpregset,
-          (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs,
-          sizeof (gdb_fpregset_t));
+             (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs,
+             sizeof (gdb_fpregset_t));
     }
   fill_fpregset (&fpreg.fpregset, regno);
   fpreg.cmd = PCSFPREG;
@@ -2077,30 +2198,30 @@ procfs_store_registers (regno)
   ioctl (pi->ctl_fd, PIOCSFPREG, &pi->fpregset.fpregset);
 #endif /* PROCFS_USE_READ_WRITE */
 
-#endif /* FP0_REGNUM */
+#endif /* FP0_REGNUM */
 
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       init_procinfo - setup a procinfo struct and connect it to a process
+   init_procinfo - setup a procinfo struct and connect it to a process
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct procinfo * init_procinfo (int pid)
+   struct procinfo * init_procinfo (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Allocate a procinfo structure, open the /proc file and then set up the
-       set of signals and faults that are to be traced.  Returns a pointer to
-       the new procinfo structure.  
+   Allocate a procinfo structure, open the /proc file and then set up the
+   set of signals and faults that are to be traced.  Returns a pointer to
+   the new procinfo structure.  
 
-NOTES
+   NOTES
 
-       If proc_init_failed ever gets called, control returns to the command
-       processing loop via the standard error handling code.
+   If proc_init_failed ever gets called, control returns to the command
+   processing loop via the standard error handling code.
 
  */
 
@@ -2109,10 +2230,10 @@ init_procinfo (pid, kill)
      int pid;
      int kill;
 {
-  struct procinfo *pi = (struct procinfo *) 
-    xmalloc (sizeof (struct procinfo));
-  struct sig_ctl  sctl;
-  struct flt_ctl  fctl;
+  struct procinfo *pi = (struct procinfo *)
+  xmalloc (sizeof (struct procinfo));
+  struct sig_ctl sctl;
+  struct flt_ctl fctl;
 
   memset ((char *) pi, 0, sizeof (*pi));
   if (!open_proc_file (pid, pi, O_RDWR, 1))
@@ -2120,7 +2241,7 @@ init_procinfo (pid, kill)
 
   /* open_proc_file may modify pid.  */
 
-  pid = pi -> pid;
+  pid = pi->pid;
 
   /* Add new process to process info list */
 
@@ -2130,7 +2251,7 @@ init_procinfo (pid, kill)
   add_fd (pi);                 /* Add to list for poll/select */
 
   /*  Remember some things about the inferior that we will, or might, change
-      so that we can restore them when we detach. */
+     so that we can restore them when we detach. */
 #ifdef UNIXWARE
   memcpy ((char *) &pi->saved_trace.sigset,
          (char *) &pi->prstatus.pr_sigtrace, sizeof (sigset_t));
@@ -2154,9 +2275,9 @@ init_procinfo (pid, kill)
   ioctl (pi->ctl_fd, PIOCGFAULT, &pi->saved_fltset.fltset);
   ioctl (pi->ctl_fd, PIOCGENTRY, &pi->saved_entryset.sysset);
   ioctl (pi->ctl_fd, PIOCGEXIT, &pi->saved_exitset.sysset);
-  
+
   /* Set up trace and fault sets, as gdb expects them. */
-  
+
   memset ((char *) &pi->prrun, 0, sizeof (pi->prrun));
   prfillset (&pi->prrun.pr_trace);
   procfs_notice_signals (pid);
@@ -2175,24 +2296,24 @@ init_procinfo (pid, kill)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       create_procinfo - initialize access to a /proc entry
+   create_procinfo - initialize access to a /proc entry
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct procinfo * create_procinfo (int pid)
+   struct procinfo * create_procinfo (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Allocate a procinfo structure, open the /proc file and then set up the
-       set of signals and faults that are to be traced.  Returns a pointer to
-       the new procinfo structure.
+   Allocate a procinfo structure, open the /proc file and then set up the
+   set of signals and faults that are to be traced.  Returns a pointer to
+   the new procinfo structure.
 
-NOTES
+   NOTES
 
-       If proc_init_failed ever gets called, control returns to the command
-       processing loop via the standard error handling code.
+   If proc_init_failed ever gets called, control returns to the command
+   processing loop via the standard error handling code.
 
  */
 
@@ -2201,8 +2322,8 @@ create_procinfo (pid)
      int pid;
 {
   struct procinfo *pi;
-  struct sig_ctl  sctl;
-  struct flt_ctl  fctl;
+  struct sig_ctl sctl;
+  struct flt_ctl fctl;
 
   pi = find_procinfo (pid, 1);
   if (pi != NULL)
@@ -2221,7 +2342,7 @@ create_procinfo (pid)
 #ifdef PROCFS_USE_READ_WRITE
   fctl.cmd = PCSFAULT;
   if (write (pi->ctl_fd, (char *) &fctl, sizeof (struct flt_ctl)) < 0)
-    proc_init_failed (pi, "PCSFAULT failed", 1);
+      proc_init_failed (pi, "PCSFAULT failed", 1);
 #else
   if (ioctl (pi->ctl_fd, PIOCSFAULT, &pi->prrun.pr_fault) < 0)
     proc_init_failed (pi, "PIOCSFAULT failed", 1);
@@ -2232,23 +2353,23 @@ create_procinfo (pid)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_exit_handler - handle entry into the _exit syscall
+   procfs_exit_handler - handle entry into the _exit syscall
 
-SYNOPSIS
+   SYNOPSIS
 
-       int procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
+   int procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This routine is called when an inferior process enters the _exit()
-       system call.  It continues the process, and then collects the exit
-       status and pid which are returned in *statvalp and *rtnvalp.  After
-       that it returns non-zero to indicate that procfs_wait should wake up.
+   This routine is called when an inferior process enters the _exit()
+   system call.  It continues the process, and then collects the exit
+   status and pid which are returned in *statvalp and *rtnvalp.  After
+   that it returns non-zero to indicate that procfs_wait should wake up.
 
-NOTES
-       There is probably a better way to do this.
+   NOTES
+   There is probably a better way to do this.
 
  */
 
@@ -2271,7 +2392,7 @@ procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
 #endif
 
 #ifdef PROCFS_USE_READ_WRITE
-  if (write (pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+  if (write (pi->ctl_fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
 #else
   if (ioctl (pi->ctl_fd, PIOCRUN, &pi->prrun) != 0)
 #endif
@@ -2283,7 +2404,7 @@ procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
       if (info_verbose)
        printf_filtered ("(attached process has exited)\n");
       *statvalp = 0;
-      *rtnvalp  = inferior_pid;
+      *rtnvalp = inferior_pid;
     }
   else
     {
@@ -2306,24 +2427,24 @@ procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_exec_handler - handle exit from the exec family of syscalls
+   procfs_exec_handler - handle exit from the exec family of syscalls
 
-SYNOPSIS
+   SYNOPSIS
 
-       int procfs_exec_handler (pi, syscall_num, why, rtnvalp, statvalp)
+   int procfs_exec_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This routine is called when an inferior process is about to finish any
-       of the exec() family of system calls.  It pretends that we got a
-       SIGTRAP (for compatibility with ptrace behavior), and returns non-zero
-       to tell procfs_wait to wake up.
+   This routine is called when an inferior process is about to finish any
+   of the exec() family of      system calls.  It pretends that we got a
+   SIGTRAP (for compatibility with ptrace behavior), and returns non-zero
+   to tell procfs_wait to wake up.
 
-NOTES
-       This need for compatibility with ptrace is questionable.  In the
-       future, it shouldn't be necessary.
+   NOTES
+   This need for compatibility with ptrace is questionable.  In the
+   future, it shouldn't be necessary.
 
  */
 
@@ -2345,30 +2466,30 @@ procfs_exec_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_sproc_handler - handle exit from the sproc syscall
+   procfs_sproc_handler - handle exit from the sproc syscall
 
-SYNOPSIS
+   SYNOPSIS
 
-       int procfs_sproc_handler (pi, syscall_num, why, rtnvalp, statvalp)
+   int procfs_sproc_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This routine is called when an inferior process is about to finish an
-       sproc() system call.  This is the system call that IRIX uses to create
-       a lightweight process.  When the target process gets this event, we can
-       look at rval1 to find the new child processes ID, and create a new
-       procinfo struct from that.
+   This routine is called when an inferior process is about to finish an
+   sproc() system call.  This is the system call that IRIX uses to create
+   a lightweight process.  When the target process gets this event, we can
+   look at rval1 to find the new child processes ID, and create a new
+   procinfo struct from that.
 
-       After that, it pretends that we got a SIGTRAP, and returns non-zero
-       to tell procfs_wait to wake up.  Subsequently, wait_for_inferior gets
-       woken up, sees the new process and continues it.
+   After that, it pretends that we got a SIGTRAP, and returns non-zero
+   to tell procfs_wait to wake up.  Subsequently, wait_for_inferior gets
+   woken up, sees the new process and continues it.
 
-NOTES
-       We actually never see the child exiting from sproc because we will
-       shortly stop the child with PIOCSTOP, which is then registered as the
-       event of interest.
+   NOTES
+   We actually never see the child exiting from sproc because we will
+   shortly stop the child with PIOCSTOP, which is then registered as the
+   event of interest.
  */
 
 static int
@@ -2411,28 +2532,28 @@ procfs_sproc_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_fork_handler - handle exit from the fork syscall
+   procfs_fork_handler - handle exit from the fork syscall
 
-SYNOPSIS
+   SYNOPSIS
 
-       int procfs_fork_handler (pi, syscall_num, why, rtnvalp, statvalp)
+   int procfs_fork_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This routine is called when an inferior process is about to finish a
-       fork() system call.  We will open up the new process, and then close
-       it, which releases it from the clutches of the debugger.
+   This routine is called when an inferior process is about to finish a
+   fork() system call.  We will open up the new process, and then close
+   it, which releases it from the clutches of the debugger.
 
-       After that, we continue the target process as though nothing had
-       happened.
+   After that, we continue the target process as though nothing had
+   happened.
 
-NOTES
-       This is necessary for IRIX because we have to set PR_FORK in order
-       to catch the creation of lwps (via sproc()).  When an actual fork
-       occurs, it becomes necessary to reset the forks debugger flags and
-       continue it because we can't hack multiple processes yet.
+   NOTES
+   This is necessary for IRIX because we have to set PR_FORK in order
+   to catch the creation of lwps (via sproc()).  When an actual fork
+   occurs, it becomes necessary to reset the forks debugger flags and
+   continue it because we can't hack multiple processes yet.
  */
 
 static int
@@ -2466,19 +2587,19 @@ procfs_fork_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_set_inferior_syscall_traps - setup the syscall traps 
+   procfs_set_inferior_syscall_traps - setup the syscall traps 
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_set_inferior_syscall_traps (struct procinfo *pip)
+   void procfs_set_inferior_syscall_traps (struct procinfo *pip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Called for each "procinfo" (process, thread, or LWP) in the
-       inferior, to register for notification of and handlers for
-       syscall traps in the inferior.
+   Called for each "procinfo" (process, thread, or LWP) in the
+   inferior, to register for notification of and handlers for
+   syscall traps in the inferior.
 
  */
 
@@ -2502,7 +2623,7 @@ procfs_set_inferior_syscall_traps (pip)
   procfs_set_syscall_trap (pip, SYS_execve, PROCFS_SYSCALL_EXIT,
                           procfs_exec_handler);
 #endif
-#endif  /* PRFS_STOPEXEC */
+#endif /* PRFS_STOPEXEC */
 
   /* Setup traps on exit from sproc() */
 
@@ -2531,32 +2652,32 @@ procfs_set_inferior_syscall_traps (pip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_init_inferior - initialize target vector and access to a
-       /proc entry
+   procfs_init_inferior - initialize target vector and access to a
+   /proc entry
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_init_inferior (int pid)
+   void procfs_init_inferior (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       When gdb starts an inferior, this function is called in the parent
-       process immediately after the fork.  It waits for the child to stop
-       on the return from the exec system call (the child itself takes care
-       of ensuring that this is set up), then sets up the set of signals
-       and faults that are to be traced.  Returns the pid, which may have had
-       the thread-id added to it.
+   When gdb starts an inferior, this function is called in the parent
+   process immediately after the fork.  It waits for the child to stop
+   on the return from the exec system call (the child itself takes care
+   of ensuring that this is set up), then sets up the set of signals
+   and faults that are to be traced.  Returns the pid, which may have had
+   the thread-id added to it.
 
-NOTES
+   NOTES
 
-       If proc_init_failed ever gets called, control returns to the command
-       processing loop via the standard error handling code.
+   If proc_init_failed ever gets called, control returns to the command
+   processing loop via the standard error handling code.
 
  */
 
-static void 
+static void
 procfs_init_inferior (pid)
      int pid;
 {
@@ -2571,10 +2692,10 @@ procfs_init_inferior (pid)
   /* create_procinfo may change the pid, so we have to update inferior_pid
      here before calling other gdb routines that need the right pid.  */
 
-  pid = pip -> pid;
+  pid = pip->pid;
   inferior_pid = pid;
 
-  add_thread (pip -> pid);     /* Setup initial thread */
+  add_thread (pip->pid);       /* Setup initial thread */
 
 #ifdef START_INFERIOR_TRAPS_EXPECTED
   startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
@@ -2586,27 +2707,27 @@ procfs_init_inferior (pid)
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       procfs_notice_signals
+   procfs_notice_signals
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void procfs_notice_signals (int pid);
+   static void procfs_notice_signals (int pid);
 
-DESCRIPTION
+   DESCRIPTION
 
-       When the user changes the state of gdb's signal handling via the
-       "handle" command, this function gets called to see if any change
-       in the /proc interface is required.  It is also called internally
-       by other /proc interface functions to initialize the state of
-       the traced signal set.
+   When the user changes the state of gdb's signal handling via the
+   "handle" command, this function gets called to see if any change
+   in the /proc interface is required.  It is also called internally
+   by other /proc interface functions to initialize the state of
+   the traced signal set.
 
-       One thing it does is that signals for which the state is "nostop",
-       "noprint", and "pass", have their trace bits reset in the pr_trace
-       field, so that they are no longer traced.  This allows them to be
-       delivered directly to the inferior without the debugger ever being
-       involved.
+   One thing it does is that signals for which the state is "nostop",
+   "noprint", and "pass", have their trace bits reset in the pr_trace
+   field, so that they are no longer traced.  This allows them to be
+   delivered directly to the inferior without the debugger ever being
+   involved.
  */
 
 static void
@@ -2614,7 +2735,7 @@ procfs_notice_signals (pid)
      int pid;
 {
   struct procinfo *pi;
-  struct sig_ctl  sctl;
+  struct sig_ctl sctl;
 
   pi = find_procinfo (pid, 0);
 
@@ -2633,8 +2754,8 @@ procfs_notice_signals (pid)
 
 static void
 notice_signals (pi, sctl)
-       struct procinfo *pi;
-       struct sig_ctl *sctl;
+     struct procinfo *pi;
+     struct sig_ctl *sctl;
 {
   int signo;
 
@@ -2664,33 +2785,33 @@ notice_signals (pi, sctl)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       proc_set_exec_trap -- arrange for exec'd child to halt at startup
+   proc_set_exec_trap -- arrange for exec'd child to halt at startup
 
-SYNOPSIS
+   SYNOPSIS
 
-       void proc_set_exec_trap (void)
+   void proc_set_exec_trap (void)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function is called in the child process when starting up
-       an inferior, prior to doing the exec of the actual inferior.
-       It sets the child process's exitset to make exit from the exec
-       system call an event of interest to stop on, and then simply
-       returns.  The child does the exec, the system call returns, and
-       the child stops at the first instruction, ready for the gdb
-       parent process to take control of it.
+   This function is called in the child process when starting up
+   an inferior, prior to doing the exec of the actual inferior.
+   It sets the child process's exitset to make exit from the exec
+   system call an event of interest to stop on, and then simply
+   returns.  The child does the exec, the system call returns, and
+   the child stops at the first instruction, ready for the gdb
+   parent process to take control of it.
 
-NOTE
+   NOTE
 
-       We need to use all local variables since the child may be sharing
-       it's data space with the parent, if vfork was used rather than
-       fork.
+   We need to use all local variables since the child may be sharing
+   it's data space with the parent, if vfork was used rather than
+   fork.
 
-       Also note that we want to turn off the inherit-on-fork flag in
-       the child process so that any grand-children start with all
-       tracing flags cleared.
+   Also note that we want to turn off the inherit-on-fork flag in
+   the child process so that any grand-children start with all
+   tracing flags cleared.
  */
 
 static void
@@ -2700,7 +2821,7 @@ proc_set_exec_trap ()
   struct sys_ctl entryset;
   char procname[MAX_PROC_NAME_SIZE];
   int fd;
-  
+
   sprintf (procname, CTL_PROC_NAME_FMT, getpid ());
 #ifdef UNIXWARE
   if ((fd = open (procname, O_WRONLY)) < 0)
@@ -2788,8 +2909,8 @@ proc_set_exec_trap ()
 
   modify_run_on_last_close_flag (fd, 1);
 
-#ifndef UNIXWARE       /* since this is a solaris-ism, we don't want it */
-                       /* NOTE: revisit when doing thread support for UW */
+#ifndef UNIXWARE               /* since this is a solaris-ism, we don't want it */
+  /* NOTE: revisit when doing thread support for UW */
 #ifdef PR_ASYNC
   {
     long pr_flags;
@@ -2802,33 +2923,33 @@ proc_set_exec_trap ()
     pr_flags = PR_ASYNC;
 #ifdef PROCFS_USE_READ_WRITE
     pctl.cmd = PCSET;
-    pctl.data = PR_FORK|PR_ASYNC;
+    pctl.data = PR_FORK | PR_ASYNC;
     write (fd, (char *) &pctl, sizeof (struct proc_ctl));
 #else
     ioctl (fd, PIOCSET, &pr_flags);
 #endif
   }
-#endif /* PR_ASYNC */
-#endif /* !UNIXWARE */
+#endif /* PR_ASYNC */
+#endif /* !UNIXWARE */
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       proc_iterate_over_mappings -- call function for every mapped space
+   proc_iterate_over_mappings -- call function for every mapped space
 
-SYNOPSIS
+   SYNOPSIS
 
-       int proc_iterate_over_mappings (int (*func)())
+   int proc_iterate_over_mappings (int (*func)())
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a function, call that function for every
-       mapped address space, passing it an open file descriptor for
-       the file corresponding to that mapped address space (if any)
-       and the base address of the mapped space.  Quit when we hit
-       the end of the mappings or the function returns nonzero.
+   Given a pointer to a function, call that function for every
+   mapped address space, passing it an open file descriptor for
+   the file corresponding to that mapped address space (if any)
+   and the base address of the mapped space.  Quit when we hit
+   the end of the mappings or the function returns nonzero.
  */
 
 #ifdef UNIXWARE
@@ -2850,25 +2971,25 @@ proc_iterate_over_mappings (func)
     return 0;
 
   nmap = sbuf.st_size / sizeof (prmap_t);
-  prmaps = (prmap_t *) alloca (nmap * sizeof(prmap_t));
+  prmaps = (prmap_t *) alloca (nmap * sizeof (prmap_t));
   if ((lseek (pi->map_fd, 0, SEEK_SET) == 0) &&
-       (read (pi->map_fd, (char *) prmaps, nmap * sizeof (prmap_t)) ==
-       (nmap * sizeof (prmap_t))))
+      (read (pi->map_fd, (char *) prmaps, nmap * sizeof (prmap_t)) ==
+       (nmap * sizeof (prmap_t))))
     {
       int i = 0;
       for (prmap = prmaps; i < nmap && funcstat == 0; ++prmap, ++i)
-        {
-          char name[sizeof ("/proc/1234567890/object") +
-               sizeof (prmap->pr_mapname)];
-          sprintf (name, "/proc/%d/object/%s", pi->pid, prmap->pr_mapname);
-          if ((fd = open (name, O_RDONLY)) == -1)
-            {
-              funcstat = 1;
-              break;
-            }
-          funcstat = (*func) (fd, (CORE_ADDR) prmap->pr_vaddr);
-          close (fd);
-        }
+       {
+         char name[sizeof ("/proc/1234567890/object") +
+                   sizeof (prmap->pr_mapname)];
+         sprintf (name, "/proc/%d/object/%s", pi->pid, prmap->pr_mapname);
+         if ((fd = open (name, O_RDONLY)) == -1)
+           {
+             funcstat = 1;
+             break;
+           }
+         funcstat = (*func) (fd, (CORE_ADDR) prmap->pr_vaddr);
+         close (fd);
+       }
     }
   return (funcstat);
 }
@@ -2891,10 +3012,10 @@ proc_iterate_over_mappings (func)
       prmaps = (struct prmap *) alloca ((nmap + 1) * sizeof (*prmaps));
       if (ioctl (pi->map_fd, PIOCMAP, prmaps) == 0)
        {
-         for (prmap = prmaps; prmap -> pr_size && funcstat == 0; ++prmap)
+         for (prmap = prmaps; prmap->pr_size && funcstat == 0; ++prmap)
            {
-             fd = proc_address_to_fd (pi, (CORE_ADDR) prmap -> pr_vaddr, 0);
-             funcstat = (*func) (fd, (CORE_ADDR) prmap -> pr_vaddr);
+             fd = proc_address_to_fd (pi, (CORE_ADDR) prmap->pr_vaddr, 0);
+             funcstat = (*func) (fd, (CORE_ADDR) prmap->pr_vaddr);
              close (fd);
            }
        }
@@ -2903,27 +3024,27 @@ proc_iterate_over_mappings (func)
 }
 #endif /* UNIXWARE */
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       proc_base_address -- find base address for segment containing address
+   proc_base_address -- find base address for segment containing address
 
-SYNOPSIS
+   SYNOPSIS
 
-       CORE_ADDR proc_base_address (CORE_ADDR addr)
+   CORE_ADDR proc_base_address (CORE_ADDR addr)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an address of a location in the inferior, find and return
-       the base address of the mapped segment containing that address.
+   Given an address of a location in the inferior, find and return
+   the base address of the mapped segment containing that address.
 
-       This is used for example, by the shared library support code,
-       where we have the pc value for some location in the shared library
-       where we are stopped, and need to know the base address of the
-       segment containing that address.
-*/
+   This is used for example, by the shared library support code,
+   where we have the pc value for some location in the shared library
+   where we are stopped, and need to know the base address of the
+   segment containing that address.
+ */
 
 CORE_ADDR
 proc_base_address (addr)
@@ -2942,12 +3063,12 @@ proc_base_address (addr)
       prmaps = (struct prmap *) alloca ((nmap + 1) * sizeof (*prmaps));
       if (ioctl (pi->map_fd, PIOCMAP, prmaps) == 0)
        {
-         for (prmap = prmaps; prmap -> pr_size; ++prmap)
+         for (prmap = prmaps; prmap->pr_size; ++prmap)
            {
-             if ((prmap -> pr_vaddr <= (caddr_t) addr) &&
-                 (prmap -> pr_vaddr + prmap -> pr_size > (caddr_t) addr))
+             if ((prmap->pr_vaddr <= (caddr_t) addr) &&
+                 (prmap->pr_vaddr + prmap->pr_size > (caddr_t) addr))
                {
-                 baseaddr = (CORE_ADDR) prmap -> pr_vaddr;
+                 baseaddr = (CORE_ADDR) prmap->pr_vaddr;
                  break;
                }
            }
@@ -2956,28 +3077,28 @@ proc_base_address (addr)
   return (baseaddr);
 }
 
-#endif /* 0 */
+#endif /* 0 */
 
 #ifndef UNIXWARE
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       proc_address_to_fd -- return open fd for file mapped to address
+   proc_address_to_fd -- return open fd for file mapped to address
 
-SYNOPSIS
+   SYNOPSIS
 
-       int proc_address_to_fd (struct procinfo *pi, CORE_ADDR addr, complain)
+   int proc_address_to_fd (struct procinfo *pi, CORE_ADDR addr, complain)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an address in the current inferior's address space, use the
-       /proc interface to find an open file descriptor for the file that
-       this address was mapped in from.  Return -1 if there is no current
-       inferior.  Print a warning message if there is an inferior but
-       the address corresponds to no file (IE a bogus address).
+   Given an address in the current inferior's address space, use the
+   /proc interface to find an open file descriptor for the file that
+   this address was mapped in from.  Return -1 if there is no current
+   inferior.  Print a warning message if there is an inferior but
+   the address corresponds to no file (IE a bogus address).
 
-*/
+ */
 
 static int
 proc_address_to_fd (pi, addr, complain)
@@ -2987,7 +3108,7 @@ proc_address_to_fd (pi, addr, complain)
 {
   int fd = -1;
 
-  if ((fd = ioctl (pi->ctl_fd, PIOCOPENM, (caddr_t *) &addr)) < 0)
+  if ((fd = ioctl (pi->ctl_fd, PIOCOPENM, (caddr_t *) & addr)) < 0)
     {
       if (complain)
        {
@@ -3015,7 +3136,7 @@ procfs_attach (args, from_tty)
 
   pid = atoi (args);
 
-  if (pid == getpid())         /* Trying to masturbate? */
+  if (pid == getpid ())                /* Trying to masturbate? */
     error ("I refuse to debug myself!");
 
   if (from_tty)
@@ -3056,15 +3177,15 @@ procfs_detach (args, from_tty)
       if (exec_file == 0)
        exec_file = "";
       printf_unfiltered ("Detaching from program: %s %s\n",
-             exec_file, target_pid_to_str (inferior_pid));
+                        exec_file, target_pid_to_str (inferior_pid));
       gdb_flush (gdb_stdout);
     }
   if (args)
     siggnal = atoi (args);
-  
+
   do_detach (siggnal);
   inferior_pid = 0;
-  unpush_target (&procfs_ops);         /* Pop out of handling an inferior */
+  unpush_target (&procfs_ops); /* Pop out of handling an inferior */
 }
 
 /* Get ready to modify the registers array.  On machines which store
@@ -3088,7 +3209,7 @@ procfs_files_info (ignore)
      struct target_ops *ignore;
 {
   printf_unfiltered ("\tUsing the running image of %s %s via /proc.\n",
-         attach_flag? "attached": "child", target_pid_to_str (inferior_pid));
+      attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid));
 }
 
 /* ARGSUSED */
@@ -3102,28 +3223,28 @@ procfs_open (arg, from_tty)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       do_attach -- attach to an already existing process
+   do_attach -- attach to an already existing process
 
-SYNOPSIS
+   SYNOPSIS
 
-       int do_attach (int pid)
+   int do_attach (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Attach to an already existing process with the specified process
-       id.  If the process is not already stopped, query whether to
-       stop it or not.
+   Attach to an already existing process with the specified process
+   id.  If the process is not already stopped, query whether to
+   stop it or not.
 
-NOTES
+   NOTES
 
-       The option of stopping at attach time is specific to the /proc
-       versions of gdb.  Versions using ptrace force the attachee
-       to stop.  (I have changed this version to do so, too.  All you
-       have to do is "continue" to make it go on. -- gnu@cygnus.com)
+   The option of stopping at attach time is specific to the /proc
+   versions of gdb.  Versions using ptrace force the attachee
+   to stop.  (I have changed this version to do so, too.  All you
+   have to do is "continue" to make it go on. -- gnu@cygnus.com)
 
-*/
+ */
 
 static int
 do_attach (pid)
@@ -3134,7 +3255,7 @@ do_attach (pid)
   struct flt_ctl fctl;
   int nlwp, *lwps;
 
-  pi  = init_procinfo (pid, 0);
+  pi = init_procinfo (pid, 0);
 
 #ifdef PIOCLWPIDS
   nlwp = pi->prstatus.pr_nlwp;
@@ -3142,7 +3263,7 @@ do_attach (pid)
 
   if (ioctl (pi->ctl_fd, PIOCLWPIDS, lwps))
     {
-      print_sys_errmsg (pi -> pathname, errno);
+      print_sys_errmsg (pi->pathname, errno);
       error ("PIOCLWPIDS failed");
     }
 #else /* PIOCLWPIDS */
@@ -3156,7 +3277,7 @@ do_attach (pid)
       if ((pi = find_procinfo ((*lwps << 16) | pid, 1)) == 0)
        pi = init_procinfo ((*lwps << 16) | pid, 0);
 
-      if (THE_PR_LWP(pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP))
+      if (THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP))
        {
          pi->was_stopped = 1;
        }
@@ -3185,13 +3306,13 @@ do_attach (pid)
                  print_sys_errmsg (pi->pathname, errno);
                  close_proc_file (pi);
                  error ("procfs_read_status failed");
-               } 
+               }
 #endif
              pi->nopass_next_sigstop = 1;
            }
          else
            {
-             printf_unfiltered ("Ok, gdb will wait for %s to stop.\n", 
+             printf_unfiltered ("Ok, gdb will wait for %s to stop.\n",
                                 target_pid_to_str (pi->pid));
            }
        }
@@ -3199,7 +3320,7 @@ do_attach (pid)
 #ifdef PROCFS_USE_READ_WRITE
       fctl.cmd = PCSFAULT;
       if (write (pi->ctl_fd, (char *) &fctl, sizeof (struct flt_ctl)) < 0)
-       print_sys_errmsg ("PCSFAULT failed", errno);
+         print_sys_errmsg ("PCSFAULT failed", errno);
 #else /* PROCFS_USE_READ_WRITE */
       if (ioctl (pi->ctl_fd, PIOCSFAULT, &pi->prrun.pr_fault))
        {
@@ -3219,31 +3340,31 @@ do_attach (pid)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       do_detach -- detach from an attached-to process
+   do_detach -- detach from an attached-to process
 
-SYNOPSIS
+   SYNOPSIS
 
-       void do_detach (int signal)
+   void do_detach (int signal)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Detach from the current attachee.
+   Detach from the current attachee.
 
-       If signal is non-zero, the attachee is started running again and sent
-       the specified signal.
+   If signal is non-zero, the attachee is started running again and sent
+   the specified signal.
 
-       If signal is zero and the attachee was not already stopped when we
-       attached to it, then we make it runnable again when we detach.
+   If signal is zero and the attachee was not already stopped when we
+   attached to it, then we make it runnable again when we detach.
 
-       Otherwise, we query whether or not to make the attachee runnable
-       again, since we may simply want to leave it in the state it was in
-       when we attached.
+   Otherwise, we query whether or not to make the attachee runnable
+   again, since we may simply want to leave it in the state it was in
+   when we attached.
 
-       We report any problems, but do not consider them errors, since we
-       MUST detach even if some things don't seem to go right.  This may not
-       be the ideal situation.  (FIXME).
+   We report any problems, but do not consider them errors, since we
+   MUST detach even if some things don't seem to go right.  This may not
+   be the ideal situation.  (FIXME).
  */
 
 static void
@@ -3263,34 +3384,34 @@ do_detach (signal)
       if (write (pi->ctl_fd, (char *) &pi->saved_exitset,
                 sizeof (struct sys_ctl)) < 0)
 #else
-       if (ioctl (pi->ctl_fd, PIOCSEXIT, &pi->saved_exitset.sysset) < 0)
+      if (ioctl (pi->ctl_fd, PIOCSEXIT, &pi->saved_exitset.sysset) < 0)
 #endif
-         {
-           print_sys_errmsg (pi->pathname, errno);
-           printf_unfiltered ("PIOCSEXIT failed.\n");
-         }
+       {
+         print_sys_errmsg (pi->pathname, errno);
+         printf_unfiltered ("PIOCSEXIT failed.\n");
+       }
 #ifdef PROCFS_USE_READ_WRITE
       pi->saved_entryset.cmd = PCSENTRY;
       if (write (pi->ctl_fd, (char *) &pi->saved_entryset,
                 sizeof (struct sys_ctl)) < 0)
 #else
-       if (ioctl (pi->ctl_fd, PIOCSENTRY, &pi->saved_entryset.sysset) < 0)
+      if (ioctl (pi->ctl_fd, PIOCSENTRY, &pi->saved_entryset.sysset) < 0)
 #endif
-         {
-           print_sys_errmsg (pi->pathname, errno);
-           printf_unfiltered ("PIOCSENTRY failed.\n");
-         }
+       {
+         print_sys_errmsg (pi->pathname, errno);
+         printf_unfiltered ("PIOCSENTRY failed.\n");
+       }
 #ifdef PROCFS_USE_READ_WRITE
       pi->saved_trace.cmd = PCSTRACE;
       if (write (pi->ctl_fd, (char *) &pi->saved_trace,
                 sizeof (struct sig_ctl)) < 0)
 #else
-       if (ioctl (pi->ctl_fd, PIOCSTRACE, &pi->saved_trace.sigset) < 0)
+      if (ioctl (pi->ctl_fd, PIOCSTRACE, &pi->saved_trace.sigset) < 0)
 #endif
-         {
-           print_sys_errmsg (pi->pathname, errno);
-           printf_unfiltered ("PIOCSTRACE failed.\n");
-         }
+       {
+         print_sys_errmsg (pi->pathname, errno);
+         printf_unfiltered ("PIOCSTRACE failed.\n");
+       }
 #ifndef UNIXWARE
       if (ioctl (pi->ctl_fd, PIOCSHOLD, &pi->saved_sighold.sigset) < 0)
        {
@@ -3317,13 +3438,13 @@ do_detach (signal)
       else
        {
          if (signal
-         || (THE_PR_LWP(pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
+         || (THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
            {
              long cmd;
              struct proc_ctl pctl;
 
              if (signal || !pi->was_stopped ||
-                 query ("Was stopped when attached, make it runnable again? "))
+             query ("Was stopped when attached, make it runnable again? "))
                {
                  /* Clear any pending signal if we want to detach without
                     a signal.  */
@@ -3354,29 +3475,29 @@ do_detach (signal)
 }
 
 /*  emulate wait() as much as possible.
-    Wait for child to do something.  Return pid of child, or -1 in case
-    of error; store status in *OURSTATUS.
-
-    Not sure why we can't
-    just use wait(), but it seems to have problems when applied to a
-    process being controlled with the /proc interface.
-
-    We have a race problem here with no obvious solution.  We need to let
-    the inferior run until it stops on an event of interest, which means
-    that we need to use the PIOCWSTOP ioctl.  However, we cannot use this
-    ioctl if the process is already stopped on something that is not an
-    event of interest, or the call will hang indefinitely.  Thus we first
-    use PIOCSTATUS to see if the process is not stopped.  If not, then we
-    use PIOCWSTOP.  But during the window between the two, if the process
-    stops for any reason that is not an event of interest (such as a job
-    control signal) then gdb will hang.  One possible workaround is to set
-    an alarm to wake up every minute of so and check to see if the process
-    is still running, and if so, then reissue the PIOCWSTOP.  But this is
-    a real kludge, so has not been implemented.  FIXME: investigate
-    alternatives.
-
-    FIXME:  Investigate why wait() seems to have problems with programs
-    being control by /proc routines.  */
+   Wait for child to do something.  Return pid of child, or -1 in case
+   of error; store status in *OURSTATUS.
+
+   Not sure why we can't
+   just use wait(), but it seems to have problems when applied to a
+   process being controlled with the /proc interface.
+
+   We have a race problem here with no obvious solution.  We need to let
+   the inferior run until it stops on an event of interest, which means
+   that we need to use the PIOCWSTOP ioctl.  However, we cannot use this
+   ioctl if the process is already stopped on something that is not an
+   event of interest, or the call will hang indefinitely.  Thus we first
+   use PIOCSTATUS to see if the process is not stopped.  If not, then we
+   use PIOCWSTOP.  But during the window between the two, if the process
+   stops for any reason that is not an event of interest (such as a job
+   control signal) then gdb will hang.  One possible workaround is to set
+   an alarm to wake up every minute of so and check to see if the process
+   is still running, and if so, then reissue the PIOCWSTOP.  But this is
+   a real kludge, so has not been implemented.  FIXME: investigate
+   alternatives.
+
+   FIXME:  Investigate why wait() seems to have problems with programs
+   being control by /proc routines.  */
 static int
 procfs_wait (pid, ourstatus)
      int pid;
@@ -3400,11 +3521,11 @@ scan_again:
       if (!pi->had_event)
        continue;
 
-      if (! (THE_PR_LWP(pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)) )
+      if (!(THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
        continue;
 
-      why = THE_PR_LWP(pi->prstatus).pr_why;
-      what = THE_PR_LWP(pi->prstatus).pr_what;
+      why = THE_PR_LWP (pi->prstatus).pr_why;
+      what = THE_PR_LWP (pi->prstatus).pr_what;
       if (why == PR_SYSENTRY || why == PR_SYSEXIT)
        {
          int i;
@@ -3445,7 +3566,7 @@ scan_again:
     }
 
   if (!checkerr
-  && !(THE_PR_LWP(pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
+      && !(THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
     {
       if (!procfs_write_pcwstop (pi))
        {
@@ -3472,15 +3593,15 @@ scan_again:
          /* NOTREACHED */
        }
     }
-  else if (THE_PR_LWP(pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP))
+  else if (THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP))
     {
 #ifdef UNIXWARE
       rtnval = pi->prstatus.pr_pid;
 #else
       rtnval = pi->pid;
 #endif
-      why = THE_PR_LWP(pi->prstatus).pr_why;
-      what = THE_PR_LWP(pi->prstatus).pr_what;
+      why = THE_PR_LWP (pi->prstatus).pr_why;
+      what = THE_PR_LWP (pi->prstatus).pr_what;
 
       switch (why)
        {
@@ -3513,7 +3634,7 @@ scan_again:
 #endif
 #ifndef FAULTED_USE_SIGINFO
              /* Irix, contrary to the documentation, fills in 0 for si_signo.
-                Solaris fills in si_signo.  I'm not sure about others.  */
+                Solaris fills in si_signo.  I'm not sure about others.  */
            case FLTPRIV:
            case FLTILL:
              statval = (SIGILL << 8) | 0177;
@@ -3532,14 +3653,14 @@ scan_again:
            case FLTFPE:
              statval = (SIGFPE << 8) | 0177;
              break;
-           case FLTPAGE:               /* Recoverable page fault */
+           case FLTPAGE:       /* Recoverable page fault */
 #endif /* not FAULTED_USE_SIGINFO */
            default:
              /* Use the signal which the kernel assigns.  This is better than
-                trying to second-guess it from the fault.  In fact, I suspect
-                that FLTACCESS can be either SIGSEGV or SIGBUS.  */
-              statval =
-                ((THE_PR_LWP(pi->prstatus).pr_info.si_signo) << 8) | 0177;
+                trying to second-guess it from the fault.  In fact, I suspect
+                that FLTACCESS can be either SIGSEGV or SIGBUS.  */
+             statval =
+               ((THE_PR_LWP (pi->prstatus).pr_info.si_signo) << 8) | 0177;
              break;
            }
          break;
@@ -3571,7 +3692,7 @@ scan_again:
                  {
                    /* The LWP has apparently terminated.  */
                    if (info_verbose)
-                     printf_filtered ("LWP %d doesn't respond.\n", 
+                     printf_filtered ("LWP %d doesn't respond.\n",
                                       (procinfo->pid >> 16) & 0xffff);
                    close_proc_file (procinfo);
                    continue;
@@ -3592,7 +3713,7 @@ scan_again:
   else
     {
       error ("PIOCWSTOP, stopped for unknown/unhandled reason, flags %#x",
-            THE_PR_LWP(pi->prstatus).pr_flags);
+            THE_PR_LWP (pi->prstatus).pr_flags);
     }
 
   store_waitstatus (ourstatus, statval);
@@ -3612,41 +3733,41 @@ scan_again:
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       set_proc_siginfo - set a process's current signal info
+   set_proc_siginfo - set a process's current signal info
 
-SYNOPSIS
+   SYNOPSIS
 
-       void set_proc_siginfo (struct procinfo *pip, int signo);
+   void set_proc_siginfo (struct procinfo *pip, int signo);
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a pointer to a process info struct in PIP and a signal number
-       in SIGNO, set the process's current signal and its associated signal
-       information.  The signal will be delivered to the process immediately
-       after execution is resumed, even if it is being held.  In addition,
-       this particular delivery will not cause another PR_SIGNALLED stop
-       even if the signal is being traced.
+   Given a pointer to a process info struct in PIP and a signal number
+   in SIGNO, set the process's current signal and its associated signal
+   information.  The signal will be delivered to the process immediately
+   after execution is resumed, even if it is being held.  In addition,
+   this particular delivery will not cause another PR_SIGNALLED stop
+   even if the signal is being traced.
 
-       If we are not delivering the same signal that the prstatus siginfo
-       struct contains information about, then synthesize a siginfo struct
-       to match the signal we are going to deliver, make it of the type
-       "generated by a user process", and send this synthesized copy.  When
-       used to set the inferior's signal state, this will be required if we
-       are not currently stopped because of a traced signal, or if we decide
-       to continue with a different signal.
+   If we are not delivering the same signal that the prstatus siginfo
+   struct contains information about, then synthesize a siginfo struct
+   to match the signal we are going to deliver, make it of the type
+   "generated by a user process", and send this synthesized copy.  When
+   used to set the inferior's signal state, this will be required if we
+   are not currently stopped because of a traced signal, or if we decide
+   to continue with a different signal.
 
-       Note that when continuing the inferior from a stop due to receipt
-       of a traced signal, we either have set PRCSIG to clear the existing
-       signal, or we have to call this function to do a PIOCSSIG with either
-       the existing siginfo struct from pr_info, or one we have synthesized
-       appropriately for the signal we want to deliver.  Otherwise if the
-       signal is still being traced, the inferior will immediately stop
-       again.
+   Note that when continuing the inferior from a stop due to receipt
+   of a traced signal, we either have set PRCSIG to clear the existing
+   signal, or we have to call this function to do a PIOCSSIG with either
+   the existing siginfo struct from pr_info, or one we have synthesized
+   appropriately for the signal we want to deliver.  Otherwise if the
+   signal is still being traced, the inferior will immediately stop
+   again.
 
-       See siginfo(5) for more details.
-*/
+   See siginfo(5) for more details.
+ */
 
 static void
 set_proc_siginfo (pip, signo)
@@ -3661,20 +3782,20 @@ set_proc_siginfo (pip, signo)
   /* With Alpha OSF/1 procfs, the kernel gets really confused if it
      receives a PIOCSSIG with a signal identical to the current signal,
      it messes up the current signal. Work around the kernel bug.  */
-  if (signo == THE_PR_LWP(pip->prstatus).pr_cursig)
+  if (signo == THE_PR_LWP (pip->prstatus).pr_cursig)
     return;
 #endif
 
 #ifdef UNIXWARE
-  if (signo == THE_PR_LWP(pip->prstatus).pr_info.si_signo)
+  if (signo == THE_PR_LWP (pip->prstatus).pr_info.si_signo)
     {
       memcpy ((char *) &sictl.siginfo, (char *) &pip->prstatus.pr_lwp.pr_info,
-               sizeof (siginfo_t));
+             sizeof (siginfo_t));
     }
 #else
-  if (signo == THE_PR_LWP(pip->prstatus).pr_info.si_signo)
+  if (signo == THE_PR_LWP (pip->prstatus).pr_info.si_signo)
     {
-      sip = &pip -> prstatus.pr_info;
+      sip = &pip->prstatus.pr_info;
     }
 #endif
   else
@@ -3686,11 +3807,11 @@ set_proc_siginfo (pip, signo)
       memset ((char *) &newsiginfo, 0, sizeof (newsiginfo));
       sip = &newsiginfo;
 #endif
-      sip -> si_signo = signo;
-      sip -> si_code = 0;
-      sip -> si_errno = 0;
-      sip -> si_pid = getpid ();
-      sip -> si_uid = getuid ();
+      sip->si_signo = signo;
+      sip->si_code = 0;
+      sip->si_errno = 0;
+      sip->si_pid = getpid ();
+      sip->si_uid = getuid ();
     }
 #ifdef PROCFS_USE_READ_WRITE
   sictl.cmd = PCSSIG;
@@ -3699,7 +3820,7 @@ set_proc_siginfo (pip, signo)
   if (ioctl (pip->ctl_fd, PIOCSSIG, sip) < 0)
 #endif
     {
-      print_sys_errmsg (pip -> pathname, errno);
+      print_sys_errmsg (pip->pathname, errno);
       warning ("PIOCSSIG failed");
     }
 }
@@ -3731,11 +3852,11 @@ procfs_resume (pid, step, signo)
 #if 0
   /* It should not be necessary.  If the user explicitly changes the value,
      value_assign calls write_register_bytes, which writes it.  */
-/*     It may not be absolutely necessary to specify the PC value for
-       restarting, but to be safe we use the value that gdb considers
-       to be current.  One case where this might be necessary is if the
-       user explicitly changes the PC value that gdb considers to be
-       current.  FIXME:  Investigate if this is necessary or not.  */
+/*      It may not be absolutely necessary to specify the PC value for
+   restarting, but to be safe we use the value that gdb considers
+   to be current.  One case where this might be necessary is if the
+   user explicitly changes the PC value that gdb considers to be
+   current.  FIXME:  Investigate if this is necessary or not.  */
 
 #ifdef PRSVADDR_BROKEN
 /* Can't do this under Solaris running on a Sparc, as there seems to be no
@@ -3743,7 +3864,7 @@ procfs_resume (pid, step, signo)
    random garbage.  We have to rely on the fact that PC and nPC have been
    written previously via PIOCSREG during a register flush. */
 
-  pi->prrun.pr_vaddr = (caddr_t) *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
+  pi->prrun.pr_vaddr = (caddr_t) * (int *) &registers[REGISTER_BYTE (PC_REGNUM)];
   pi->prrun.pr_flags != PRSVADDR;
 #endif
 #endif
@@ -3761,9 +3882,9 @@ procfs_resume (pid, step, signo)
        an inferior to continue running at the same time as gdb.  (FIXME?)  */
     signal_to_pass = 0;
   else if (signo == TARGET_SIGNAL_TSTP
-          && THE_PR_LWP(pi->prstatus).pr_cursig == SIGTSTP
-          && THE_PR_LWP(pi->prstatus).pr_action.sa_handler == SIG_DFL
-          )
+          && THE_PR_LWP (pi->prstatus).pr_cursig == SIGTSTP
+          && THE_PR_LWP (pi->prstatus).pr_action.sa_handler == SIG_DFL
+    )
 
     /* We are about to pass the inferior a SIGTSTP whose action is
        SIG_DFL.  The SIG_DFL action for a SIGTSTP is to stop
@@ -3812,7 +3933,7 @@ procfs_resume (pid, step, signo)
     {
       /* The LWP has apparently terminated.  */
       if (info_verbose)
-       printf_filtered ("LWP %d doesn't respond.\n", 
+       printf_filtered ("LWP %d doesn't respond.\n",
                         (pi->pid >> 16) & 0xffff);
       close_proc_file (pi);
     }
@@ -3827,7 +3948,7 @@ procfs_resume (pid, step, signo)
        {
          /* The LWP has apparently terminated.  */
          if (info_verbose)
-           printf_filtered ("LWP %d doesn't respond.\n", 
+           printf_filtered ("LWP %d doesn't respond.\n",
                             (pi->pid >> 16) & 0xffff);
          close_proc_file (pi);
        }
@@ -3843,7 +3964,7 @@ procfs_resume (pid, step, signo)
       {
        next_pi = procinfo->next;
        if (pi != procinfo)
-         if (!procinfo->had_event || 
+         if (!procinfo->had_event ||
              (procinfo->nopass_next_sigstop && signo == TARGET_SIGNAL_STOP))
            {
              procinfo->had_event = procinfo->nopass_next_sigstop = 0;
@@ -3853,9 +3974,9 @@ procfs_resume (pid, step, signo)
                         sizeof (struct proc_ctl)) < 0)
                {
                  if (!procfs_read_status (procinfo))
-                   fprintf_unfiltered(gdb_stderr, 
-                                      "procfs_read_status failed, errno=%d\n",
-                                      errno);
+                   fprintf_unfiltered (gdb_stderr,
+                                   "procfs_read_status failed, errno=%d\n",
+                                       errno);
                  print_sys_errmsg (procinfo->pathname, errno);
                  error ("PCRUN failed");
                }
@@ -3866,22 +3987,22 @@ procfs_resume (pid, step, signo)
                {
                  /* The LWP has apparently terminated.  */
                  if (info_verbose)
-                   printf_filtered ("LWP %d doesn't respond.\n", 
+                   printf_filtered ("LWP %d doesn't respond.\n",
                                     (procinfo->pid >> 16) & 0xffff);
                  close_proc_file (procinfo);
                  continue;
                }
 
              /* Don't try to start a process unless it's stopped on an
-                `event of interest'.  Doing so will cause errors.  */
+                `event of interest'.  Doing so will cause errors.  */
 
              if ((procinfo->prstatus.pr_flags & PR_ISTOP)
                  && ioctl (procinfo->ctl_fd, PIOCRUN, &procinfo->prrun) < 0)
                {
                  if (!procfs_read_status (procinfo))
-                   fprintf_unfiltered(gdb_stderr, 
-                                      "procfs_read_status failed, errno=%d\n",
-                                      errno);
+                   fprintf_unfiltered (gdb_stderr,
+                                   "procfs_read_status failed, errno=%d\n",
+                                       errno);
                  print_sys_errmsg (procinfo->pathname, errno);
                  warning ("PIOCRUN failed");
                }
@@ -3893,21 +4014,21 @@ procfs_resume (pid, step, signo)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_fetch_registers -- fetch current registers from inferior
+   procfs_fetch_registers -- fetch current registers from inferior
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_fetch_registers (int regno)
+   void procfs_fetch_registers (int regno)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Read the current values of the inferior's registers, both the
-       general register set and floating point registers (if supported)
-       and update gdb's idea of their current values.
+   Read the current values of the inferior's registers, both the
+   general register set and floating point registers (if supported)
+   and update gdb's idea of their current values.
 
-*/
+ */
 
 static void
 procfs_fetch_registers (regno)
@@ -3922,7 +4043,7 @@ procfs_fetch_registers (regno)
     {
       supply_gregset (&pi->prstatus.pr_lwp.pr_context.uc_mcontext.gregs);
 #if defined (FP0_REGNUM)
-      supply_fpregset (&pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs); 
+      supply_fpregset (&pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs);
 #endif
     }
 #else /* UNIXWARE */
@@ -3941,29 +4062,29 @@ procfs_fetch_registers (regno)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       proc_init_failed - called when /proc access initialization fails
-fails
+   proc_init_failed - called when /proc access initialization fails
+   fails
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void proc_init_failed (struct procinfo *pi, 
-                                     char *why, int kill_p)
+   static void proc_init_failed (struct procinfo *pi, 
+   char *why, int kill_p)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function is called whenever initialization of access to a /proc
-       entry fails.  It prints a suitable error message, does some cleanup,
-       and then invokes the standard error processing routine which dumps
-       us back into the command loop.  If KILL_P is true, sends SIGKILL.
+   This function is called whenever initialization of access to a /proc
+   entry fails.  It prints a suitable error message, does some cleanup,
+   and then invokes the standard error processing routine which dumps
+   us back into the command loop.  If KILL_P is true, sends SIGKILL.
  */
 
 static void
 proc_init_failed (pi, why, kill_p)
      struct procinfo *pi;
      char *why;
-     int  kill_p;
+     int kill_p;
 {
   print_sys_errmsg (pi->pathname, errno);
   if (kill_p)
@@ -3975,20 +4096,20 @@ proc_init_failed (pi, why, kill_p)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       close_proc_file - close any currently open /proc entry
+   close_proc_file - close any currently open /proc entry
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void close_proc_file (struct procinfo *pip)
+   static void close_proc_file (struct procinfo *pip)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Close any currently open /proc entry and mark the process information
-       entry as invalid.  In order to ensure that we don't try to reuse any
-       stale information, the pid, fd, and pathnames are explicitly
-       invalidated, which may be overkill.
+   Close any currently open /proc entry and mark the process information
+   entry as invalid.  In order to ensure that we don't try to reuse any
+   stale information, the pid, fd, and pathnames are explicitly
+   invalidated, which may be overkill.
 
  */
 
@@ -4008,7 +4129,7 @@ close_proc_file (pip)
   close (pip->map_fd);
 #endif
 
-  free (pip -> pathname);
+  free (pip->pathname);
 
   /* Unlink pip from the procinfo chain.  Note pip might not be on the list. */
 
@@ -4017,13 +4138,13 @@ close_proc_file (pip)
   else
     {
       for (procinfo = procinfo_list; procinfo; procinfo = procinfo->next)
-        {
-          if (procinfo->next == pip)
+       {
+         if (procinfo->next == pip)
            {
              procinfo->next = pip->next;
              break;
            }
-        }
+       }
       free (pip);
     }
 }
@@ -4044,31 +4165,31 @@ make_cleanup_close_proc_file (pip)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       open_proc_file - open a /proc entry for a given process id
+   open_proc_file - open a /proc entry for a given process id
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int open_proc_file (int pid, struct procinfo *pip, int mode)
+   static int open_proc_file (int pid, struct procinfo *pip, int mode)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given a process id and a mode, close the existing open /proc
-       entry (if any) and open one for the new process id, in the
-       specified mode.  Once it is open, then mark the local process
-       information structure as valid, which guarantees that the pid,
-       fd, and pathname fields match an open /proc entry.  Returns
-       zero if the open fails, nonzero otherwise.
+   Given a process id and a mode, close the existing open /proc
+   entry (if any) and open one for the new process id, in the
+   specified mode.  Once it is open, then mark the local process
+   information structure as valid, which guarantees that the pid,
+   fd, and pathname fields match an open /proc entry.  Returns
+   zero if the open fails, nonzero otherwise.
 
-       Note that the pathname is left intact, even when the open fails,
-       so that callers can use it to construct meaningful error messages
-       rather than just "file open failed".
+   Note that the pathname is left intact, even when the open fails,
+   so that callers can use it to construct meaningful error messages
+   rather than just "file open failed".
 
-       Note that for Solaris, the process-id also includes an LWP-id, so we
-       actually attempt to open that.  If we are handed a pid with a 0 LWP-id,
-       then we will ask the kernel what it is and add it to the pid.  Hence,
-       the pid can be changed by us.
+   Note that for Solaris, the process-id also includes an LWP-id, so we
+   actually attempt to open that.  If we are handed a pid with a 0 LWP-id,
+   then we will ask the kernel what it is and add it to the pid.  Hence,
+   the pid can be changed by us.
  */
 
 static int
@@ -4080,10 +4201,10 @@ open_proc_file (pid, pip, mode, control)
 {
   int tmp, tmpfd;
 
-  pip -> next = NULL;
-  pip -> had_event = 0;
-  pip -> pathname = xmalloc (MAX_PROC_NAME_SIZE);
-  pip -> pid = pid;
+  pip->next = NULL;
+  pip->had_event = 0;
+  pip->pathname = xmalloc (MAX_PROC_NAME_SIZE);
+  pip->pid = pid;
 
 #ifndef PIOCOPENLWP
   tmp = pid;
@@ -4119,40 +4240,40 @@ open_proc_file (pid, pip, mode, control)
       if ((pip->ctl_fd = open (pip->pathname, O_WRONLY)) < 0)
        {
          close (pip->status_fd);
-          close (pip->as_fd);
-          close (pip->map_fd);
-          return 0;
-        }
+         close (pip->as_fd);
+         close (pip->map_fd);
+         return 0;
+       }
     }
 
 #else /* HAVE_MULTIPLE_PROC_FDS */
-  sprintf (pip -> pathname, CTL_PROC_NAME_FMT, tmp);
+  sprintf (pip->pathname, CTL_PROC_NAME_FMT, tmp);
 
-  if ((tmpfd = open (pip -> pathname, mode)) < 0)
+  if ((tmpfd = open (pip->pathname, mode)) < 0)
     return 0;
 
 #ifndef PIOCOPENLWP
-    pip -> ctl_fd = tmpfd;
-    pip -> as_fd = tmpfd;
-    pip -> map_fd = tmpfd;
-    pip -> status_fd = tmpfd;
+  pip->ctl_fd = tmpfd;
+  pip->as_fd = tmpfd;
+  pip->map_fd = tmpfd;
+  pip->status_fd = tmpfd;
 #else
   tmp = (pid >> 16) & 0xffff;  /* Extract thread id */
 
   if (tmp == 0)
     {                          /* Don't know thread id yet */
-      if (ioctl (tmpfd, PIOCSTATUS, &pip -> prstatus) < 0)
+      if (ioctl (tmpfd, PIOCSTATUS, &pip->prstatus) < 0)
        {
-         print_sys_errmsg (pip -> pathname, errno);
+         print_sys_errmsg (pip->pathname, errno);
          close (tmpfd);
          error ("open_proc_file: PIOCSTATUS failed");
        }
 
-      tmp = pip -> prstatus.pr_who; /* Get thread id from prstatus_t */
-      pip -> pid = (tmp << 16) | pid; /* Update pip */
+      tmp = pip->prstatus.pr_who;      /* Get thread id from prstatus_t */
+      pip->pid = (tmp << 16) | pid;    /* Update pip */
     }
 
-  if ((pip -> ctl_fd = ioctl (tmpfd, PIOCOPENLWP, &tmp)) < 0)
+  if ((pip->ctl_fd = ioctl (tmpfd, PIOCOPENLWP, &tmp)) < 0)
     {
       close (tmpfd);
       return 0;
@@ -4160,9 +4281,9 @@ open_proc_file (pid, pip, mode, control)
 
 #ifdef PIOCSET                 /* New method */
   {
-      long pr_flags;
-      pr_flags = PR_ASYNC;
-      ioctl (pip -> ctl_fd, PIOCSET, &pr_flags);
+    long pr_flags;
+    pr_flags = PR_ASYNC;
+    ioctl (pip->ctl_fd, PIOCSET, &pr_flags);
   }
 #endif
 
@@ -4172,7 +4293,7 @@ open_proc_file (pid, pip, mode, control)
   pip->status_fd = pip->ctl_fd;
 
   close (tmpfd);               /* All done with main pid */
-#endif /* PIOCOPENLWP */
+#endif /* PIOCOPENLWP */
 
 #endif /* HAVE_MULTIPLE_PROC_FDS */
 
@@ -4184,17 +4305,24 @@ mappingflags (flags)
      long flags;
 {
   static char asciiflags[8];
-  
+
   strcpy (asciiflags, "-------");
 #if defined (MA_PHYS)
-  if (flags & MA_PHYS)   asciiflags[0] = 'd';
-#endif
-  if (flags & MA_STACK)  asciiflags[1] = 's';
-  if (flags & MA_BREAK)  asciiflags[2] = 'b';
-  if (flags & MA_SHARED) asciiflags[3] = 's';
-  if (flags & MA_READ)   asciiflags[4] = 'r';
-  if (flags & MA_WRITE)  asciiflags[5] = 'w';
-  if (flags & MA_EXEC)   asciiflags[6] = 'x';
+  if (flags & MA_PHYS)
+    asciiflags[0] = 'd';
+#endif
+  if (flags & MA_STACK)
+    asciiflags[1] = 's';
+  if (flags & MA_BREAK)
+    asciiflags[2] = 'b';
+  if (flags & MA_SHARED)
+    asciiflags[3] = 's';
+  if (flags & MA_READ)
+    asciiflags[4] = 'r';
+  if (flags & MA_WRITE)
+    asciiflags[5] = 'w';
+  if (flags & MA_EXEC)
+    asciiflags[6] = 'x';
   return (asciiflags);
 }
 
@@ -4215,17 +4343,17 @@ info_proc_flags (pip, summary)
     {
       printf_filtered ("\n\n");
     }
-  for (transp = pr_flag_table; transp -> name != NULL; transp++)
+  for (transp = pr_flag_table; transp->name != NULL; transp++)
     {
-      if (flags & transp -> value)
+      if (flags & transp->value)
        {
          if (summary)
            {
-             printf_filtered ("%s ", transp -> name);
+             printf_filtered ("%s ", transp->name);
            }
          else
            {
-             printf_filtered ("\t%-16s %s.\n", transp -> name, transp -> desc);
+             printf_filtered ("\t%-16s %s.\n", transp->name, transp->desc);
            }
        }
     }
@@ -4241,89 +4369,89 @@ info_proc_stop (pip, summary)
   int why;
   int what;
 
-  why = THE_PR_LWP(pip->prstatus).pr_why;
-  what = THE_PR_LWP(pip->prstatus).pr_what;
+  why = THE_PR_LWP (pip->prstatus).pr_why;
+  what = THE_PR_LWP (pip->prstatus).pr_what;
 
-  if (THE_PR_LWP(pip->prstatus).pr_flags & PR_STOPPED)
+  if (THE_PR_LWP (pip->prstatus).pr_flags & PR_STOPPED)
     {
       printf_filtered ("%-32s", "Reason for stopping:");
       if (!summary)
        {
          printf_filtered ("\n\n");
        }
-      for (transp = pr_why_table; transp -> name != NULL; transp++)
+      for (transp = pr_why_table; transp->name != NULL; transp++)
        {
-         if (why == transp -> value)
+         if (why == transp->value)
            {
              if (summary)
                {
-                 printf_filtered ("%s ", transp -> name);
+                 printf_filtered ("%s ", transp->name);
                }
              else
                {
                  printf_filtered ("\t%-16s %s.\n",
-                                  transp -> name, transp -> desc);
+                                  transp->name, transp->desc);
                }
              break;
            }
        }
-      
+
       /* Use the pr_why field to determine what the pr_what field means, and
-        print more information. */
-      
+         print more information. */
+
       switch (why)
        {
-         case PR_REQUESTED:
-           /* pr_what is unused for this case */
-           break;
-         case PR_JOBCONTROL:
-         case PR_SIGNALLED:
-           if (summary)
-             {
-               printf_filtered ("%s ", signalname (what));
-             }
-           else
-             {
-               printf_filtered ("\t%-16s %s.\n", signalname (what),
-                                safe_strsignal (what));
-             }
-           break;
-         case PR_SYSENTRY:
-           if (summary)
-             {
-               printf_filtered ("%s ", syscallname (what));
-             }
-           else
-             {
-               printf_filtered ("\t%-16s %s.\n", syscallname (what),
-                                "Entered this system call");
-             }
-           break;
-         case PR_SYSEXIT:
-           if (summary)
-             {
-               printf_filtered ("%s ", syscallname (what));
-             }
-           else
-             {
-               printf_filtered ("\t%-16s %s.\n", syscallname (what),
-                                "Returned from this system call");
-             }
-           break;
-         case PR_FAULTED:
-           if (summary)
-             {
-               printf_filtered ("%s ",
-                                lookupname (faults_table, what, "fault"));
-             }
-           else
-             {
-               printf_filtered ("\t%-16s %s.\n",
-                                lookupname (faults_table, what, "fault"),
-                                lookupdesc (faults_table, what));
-             }
-           break;
-         }
+       case PR_REQUESTED:
+         /* pr_what is unused for this case */
+         break;
+       case PR_JOBCONTROL:
+       case PR_SIGNALLED:
+         if (summary)
+           {
+             printf_filtered ("%s ", signalname (what));
+           }
+         else
+           {
+             printf_filtered ("\t%-16s %s.\n", signalname (what),
+                              safe_strsignal (what));
+           }
+         break;
+       case PR_SYSENTRY:
+         if (summary)
+           {
+             printf_filtered ("%s ", syscallname (what));
+           }
+         else
+           {
+             printf_filtered ("\t%-16s %s.\n", syscallname (what),
+                              "Entered this system call");
+           }
+         break;
+       case PR_SYSEXIT:
+         if (summary)
+           {
+             printf_filtered ("%s ", syscallname (what));
+           }
+         else
+           {
+             printf_filtered ("\t%-16s %s.\n", syscallname (what),
+                              "Returned from this system call");
+           }
+         break;
+       case PR_FAULTED:
+         if (summary)
+           {
+             printf_filtered ("%s ",
+                              lookupname (faults_table, what, "fault"));
+           }
+         else
+           {
+             printf_filtered ("\t%-16s %s.\n",
+                              lookupname (faults_table, what, "fault"),
+                              lookupdesc (faults_table, what));
+           }
+         break;
+       }
       printf_filtered ("\n");
     }
 }
@@ -4335,94 +4463,94 @@ info_proc_siginfo (pip, summary)
 {
   struct siginfo *sip;
 
-  if ((THE_PR_LWP(pip->prstatus).pr_flags & PR_STOPPED) &&
-      (THE_PR_LWP(pip->prstatus).pr_why == PR_SIGNALLED ||
-       THE_PR_LWP(pip->prstatus).pr_why == PR_FAULTED))
+  if ((THE_PR_LWP (pip->prstatus).pr_flags & PR_STOPPED) &&
+      (THE_PR_LWP (pip->prstatus).pr_why == PR_SIGNALLED ||
+       THE_PR_LWP (pip->prstatus).pr_why == PR_FAULTED))
     {
       printf_filtered ("%-32s", "Additional signal/fault info:");
-      sip = &(THE_PR_LWP(pip->prstatus).pr_info);
+      sip = &(THE_PR_LWP (pip->prstatus).pr_info);
       if (summary)
        {
-         printf_filtered ("%s ", signalname (sip -> si_signo));
-         if (sip -> si_errno > 0)
+         printf_filtered ("%s ", signalname (sip->si_signo));
+         if (sip->si_errno > 0)
            {
-             printf_filtered ("%s ", errnoname (sip -> si_errno));
+             printf_filtered ("%s ", errnoname (sip->si_errno));
            }
-         if (sip -> si_code <= 0)
+         if (sip->si_code <= 0)
            {
              printf_filtered ("sent by %s, uid %d ",
-                              target_pid_to_str (sip -> si_pid),
-                              sip -> si_uid);
+                              target_pid_to_str (sip->si_pid),
+                              sip->si_uid);
            }
          else
            {
              printf_filtered ("%s ", sigcodename (sip));
-             if ((sip -> si_signo == SIGILL) ||
-                 (sip -> si_signo == SIGFPE) ||
-                 (sip -> si_signo == SIGSEGV) ||
-                 (sip -> si_signo == SIGBUS))
+             if ((sip->si_signo == SIGILL) ||
+                 (sip->si_signo == SIGFPE) ||
+                 (sip->si_signo == SIGSEGV) ||
+                 (sip->si_signo == SIGBUS))
                {
                  printf_filtered ("addr=%#lx ",
-                                  (unsigned long) sip -> si_addr);
+                                  (unsigned long) sip->si_addr);
                }
-             else if ((sip -> si_signo == SIGCHLD))
+             else if ((sip->si_signo == SIGCHLD))
                {
                  printf_filtered ("child %s, status %u ",
-                                  target_pid_to_str (sip -> si_pid),
-                                  sip -> si_status);
+                                  target_pid_to_str (sip->si_pid),
+                                  sip->si_status);
                }
-             else if ((sip -> si_signo == SIGPOLL))
+             else if ((sip->si_signo == SIGPOLL))
                {
-                 printf_filtered ("band %u ", sip -> si_band);
+                 printf_filtered ("band %u ", sip->si_band);
                }
            }
        }
       else
        {
          printf_filtered ("\n\n");
-         printf_filtered ("\t%-16s %s.\n", signalname (sip -> si_signo),
-                          safe_strsignal (sip -> si_signo));
-         if (sip -> si_errno > 0)
+         printf_filtered ("\t%-16s %s.\n", signalname (sip->si_signo),
+                          safe_strsignal (sip->si_signo));
+         if (sip->si_errno > 0)
            {
              printf_filtered ("\t%-16s %s.\n",
-                              errnoname (sip -> si_errno),
-                              safe_strerror (sip -> si_errno));
+                              errnoname (sip->si_errno),
+                              safe_strerror (sip->si_errno));
            }
-         if (sip -> si_code <= 0)
+         if (sip->si_code <= 0)
            {
-             printf_filtered ("\t%-16u %s\n", sip -> si_pid, /* XXX need target_pid_to_str() */
+             printf_filtered ("\t%-16u %s\n", sip->si_pid,     /* XXX need target_pid_to_str() */
                               "PID of process sending signal");
-             printf_filtered ("\t%-16u %s\n", sip -> si_uid,
+             printf_filtered ("\t%-16u %s\n", sip->si_uid,
                               "UID of process sending signal");
            }
          else
            {
              printf_filtered ("\t%-16s %s.\n", sigcodename (sip),
                               sigcodedesc (sip));
-             if ((sip -> si_signo == SIGILL) ||
-                 (sip -> si_signo == SIGFPE))
+             if ((sip->si_signo == SIGILL) ||
+                 (sip->si_signo == SIGFPE))
                {
                  printf_filtered ("\t%#-16lx %s.\n",
-                                  (unsigned long) sip -> si_addr,
+                                  (unsigned long) sip->si_addr,
                                   "Address of faulting instruction");
                }
-             else if ((sip -> si_signo == SIGSEGV) ||
-                      (sip -> si_signo == SIGBUS))
+             else if ((sip->si_signo == SIGSEGV) ||
+                      (sip->si_signo == SIGBUS))
                {
                  printf_filtered ("\t%#-16lx %s.\n",
-                                  (unsigned long) sip -> si_addr,
+                                  (unsigned long) sip->si_addr,
                                   "Address of faulting memory reference");
                }
-             else if ((sip -> si_signo == SIGCHLD))
+             else if ((sip->si_signo == SIGCHLD))
                {
-                 printf_filtered ("\t%-16u %s.\n", sip -> si_pid, /* XXX need target_pid_to_str() */
+                 printf_filtered ("\t%-16u %s.\n", sip->si_pid,        /* XXX need target_pid_to_str() */
                                   "Child process ID");
-                 printf_filtered ("\t%-16u %s.\n", sip -> si_status,
+                 printf_filtered ("\t%-16u %s.\n", sip->si_status,
                                   "Child process exit value or signal");
                }
-             else if ((sip -> si_signo == SIGPOLL))
+             else if ((sip->si_signo == SIGPOLL))
                {
-                 printf_filtered ("\t%-16u %s.\n", sip -> si_band,
+                 printf_filtered ("\t%-16u %s.\n", sip->si_band,
                                   "Band event for POLL_{IN,OUT,MSG}");
                }
            }
@@ -4441,10 +4569,10 @@ info_proc_syscalls (pip, summary)
   if (!summary)
     {
 
-#if 0  /* FIXME:  Needs to use gdb-wide configured info about system calls. */
-      if (pip -> prstatus.pr_flags & PR_ASLEEP)
+#if 0                          /* FIXME:  Needs to use gdb-wide configured info about system calls. */
+      if (pip->prstatus.pr_flags & PR_ASLEEP)
        {
-         int syscallnum = pip -> prstatus.pr_reg[R_D0];
+         int syscallnum = pip->prstatus.pr_reg[R_D0];
          if (summary)
            {
              printf_filtered ("%-32s", "Sleeping in system call:");
@@ -4459,21 +4587,21 @@ info_proc_syscalls (pip, summary)
 #endif
 
 #ifndef UNIXWARE
-      if (ioctl (pip -> ctl_fd, PIOCGENTRY, &pip -> entryset) < 0)
+      if (ioctl (pip->ctl_fd, PIOCGENTRY, &pip->entryset) < 0)
        {
-         print_sys_errmsg (pip -> pathname, errno);
+         print_sys_errmsg (pip->pathname, errno);
          error ("PIOCGENTRY failed");
        }
-      
-      if (ioctl (pip -> ctl_fd, PIOCGEXIT, &pip -> exitset) < 0)
+
+      if (ioctl (pip->ctl_fd, PIOCGEXIT, &pip->exitset) < 0)
        {
-         print_sys_errmsg (pip -> pathname, errno);
+         print_sys_errmsg (pip->pathname, errno);
          error ("PIOCGEXIT failed");
        }
 #endif
-      
+
       printf_filtered ("System call tracing information:\n\n");
-      
+
       printf_filtered ("\t%-12s %-8s %-8s\n",
                       "System call",
                       "Entry",
@@ -4488,17 +4616,17 @@ info_proc_syscalls (pip, summary)
 
 #ifdef UNIXWARE
          printf_filtered ("%-8s ",
-                          prismember (&pip->prstatus.pr_sysentry, syscallnum)
+                        prismember (&pip->prstatus.pr_sysentry, syscallnum)
                           ? "on" : "off");
          printf_filtered ("%-8s ",
                           prismember (&pip->prstatus.pr_sysexit, syscallnum)
                           ? "on" : "off");
 #else
          printf_filtered ("%-8s ",
-                          prismember (&pip -> entryset, syscallnum)
+                          prismember (&pip->entryset, syscallnum)
                           ? "on" : "off");
          printf_filtered ("%-8s ",
-                          prismember (&pip -> exitset, syscallnum)
+                          prismember (&pip->exitset, syscallnum)
                           ? "on" : "off");
 #endif
          printf_filtered ("\n");
@@ -4555,13 +4683,13 @@ info_proc_signals (pip, summary)
   if (!summary)
     {
 #ifndef PROCFS_USE_READ_WRITE
-      if (ioctl (pip -> ctl_fd, PIOCGTRACE, &pip -> trace) < 0)
+      if (ioctl (pip->ctl_fd, PIOCGTRACE, &pip->trace) < 0)
        {
-         print_sys_errmsg (pip -> pathname, errno);
+         print_sys_errmsg (pip->pathname, errno);
          error ("PIOCGTRACE failed");
        }
 #endif
-      
+
       printf_filtered ("Disposition of signals:\n\n");
       printf_filtered ("\t%-15s %-8s %-8s %-8s  %s\n\n",
                       "Signal", "Trace", "Hold", "Pending", "Description");
@@ -4571,37 +4699,37 @@ info_proc_signals (pip, summary)
          printf_filtered ("\t%-15s ", signalname (signo));
 #ifdef UNIXWARE
          printf_filtered ("%-8s ",
-                          prismember (&pip -> prstatus.pr_sigtrace, signo)
+                          prismember (&pip->prstatus.pr_sigtrace, signo)
                           ? "on" : "off");
          printf_filtered ("%-8s ",
-                          prismember (&pip -> prstatus.pr_lwp.pr_context.uc_sigmask, signo)
+            prismember (&pip->prstatus.pr_lwp.pr_context.uc_sigmask, signo)
                           ? "on" : "off");
 #else
          printf_filtered ("%-8s ",
-                          prismember (&pip -> trace, signo)
+                          prismember (&pip->trace, signo)
                           ? "on" : "off");
          printf_filtered ("%-8s ",
-                          prismember (&pip -> prstatus.pr_sighold, signo)
+                          prismember (&pip->prstatus.pr_sighold, signo)
                           ? "on" : "off");
 #endif
 
 #ifdef UNIXWARE
          if (prismember (&pip->prstatus.pr_sigpend, signo) ||
-               prismember (&pip->prstatus.pr_lwp.pr_lwppend, signo))
-           printf_filtered("%-8s ", "yes");
+             prismember (&pip->prstatus.pr_lwp.pr_lwppend, signo))
+           printf_filtered ("%-8s ", "yes");
          else
-           printf_filtered("%-8s ", "no");
+           printf_filtered ("%-8s ", "no");
 #else /* UNIXWARE */
 #ifdef PROCFS_SIGPEND_OFFSET
          /* Alpha OSF/1 numbers the pending signals from 1.  */
          printf_filtered ("%-8s ",
-                          (signo ? prismember (&pip -> prstatus.pr_sigpend,
+                          (signo ? prismember (&pip->prstatus.pr_sigpend,
                                                signo - 1)
-                                 : 0)
+                           : 0)
                           ? "yes" : "no");
 #else
          printf_filtered ("%-8s ",
-                          prismember (&pip -> prstatus.pr_sigpend, signo)
+                          prismember (&pip->prstatus.pr_sigpend, signo)
                           ? "yes" : "no");
 #endif
 #endif /* UNIXWARE */
@@ -4621,25 +4749,25 @@ info_proc_faults (pip, summary)
   if (!summary)
     {
 #ifndef UNIXWARE
-      if (ioctl (pip -> ctl_fd, PIOCGFAULT, &pip->fltset.fltset) < 0)
+      if (ioctl (pip->ctl_fd, PIOCGFAULT, &pip->fltset.fltset) < 0)
        {
-         print_sys_errmsg (pip -> pathname, errno);
+         print_sys_errmsg (pip->pathname, errno);
          error ("PIOCGFAULT failed");
        }
 #endif
-      
+
       printf_filtered ("Current traced hardware fault set:\n\n");
       printf_filtered ("\t%-12s %-8s\n", "Fault", "Trace");
 
-      for (transp = faults_table; transp -> name != NULL; transp++)
+      for (transp = faults_table; transp->name != NULL; transp++)
        {
          QUIT;
-         printf_filtered ("\t%-12s ", transp -> name);
+         printf_filtered ("\t%-12s ", transp->name);
 #ifdef UNIXWARE
-         printf_filtered ("%-8s", prismember (&pip->prstatus.pr_flttrace, transp -> value)
+         printf_filtered ("%-8s", prismember (&pip->prstatus.pr_flttrace, transp->value)
                           ? "on" : "off");
 #else
-         printf_filtered ("%-8s", prismember (&pip->fltset.fltset, transp -> value)
+         printf_filtered ("%-8s", prismember (&pip->fltset.fltset, transp->value)
                           ? "on" : "off");
 #endif
          printf_filtered ("\n");
@@ -4673,22 +4801,22 @@ info_proc_mappings (pip, summary)
                       "Flags");
 #ifdef PROCFS_USE_READ_WRITE
       if (fstat (pip->map_fd, &sbuf) == 0)
-        {
-          nmap = sbuf.st_size / sizeof (prmap_t);
+       {
+         nmap = sbuf.st_size / sizeof (prmap_t);
          prmaps = (struct prmap *) alloca ((nmap + 1) * sizeof (*prmaps));
-          if ((lseek (pip->map_fd, 0, SEEK_SET) == 0) &&
-               (read (pip->map_fd, (char *) prmaps,
-               nmap * sizeof (*prmaps)) == (nmap * sizeof (*prmaps))))
+         if ((lseek (pip->map_fd, 0, SEEK_SET) == 0) &&
+             (read (pip->map_fd, (char *) prmaps,
+                    nmap * sizeof (*prmaps)) == (nmap * sizeof (*prmaps))))
            {
              int i = 0;
              for (prmap = prmaps; i < nmap; ++prmap, ++i)
 #else
-      if (ioctl (pip -> ctl_fd, PIOCNMAP, &nmap) == 0)
+      if (ioctl (pip->ctl_fd, PIOCNMAP, &nmap) == 0)
        {
          prmaps = (struct prmap *) alloca ((nmap + 1) * sizeof (*prmaps));
-         if (ioctl (pip -> ctl_fd, PIOCMAP, prmaps) == 0)
+         if (ioctl (pip->ctl_fd, PIOCMAP, prmaps) == 0)
            {
-             for (prmap = prmaps; prmap -> pr_size; ++prmap)
+             for (prmap = prmaps; prmap->pr_size; ++prmap)
 #endif /* PROCFS_USE_READ_WRITE */
                {
 #ifdef BFD_HOST_64_BIT
@@ -4696,12 +4824,12 @@ info_proc_mappings (pip, summary)
 #else
                  printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
 #endif
-                                  (unsigned long)prmap -> pr_vaddr,
-                                  (unsigned long)prmap -> pr_vaddr
-                                    + prmap -> pr_size - 1,
-                                  prmap -> pr_size,
-                                  prmap -> pr_off,
-                                  mappingflags (prmap -> pr_mflags));
+                                  (unsigned long) prmap->pr_vaddr,
+                                  (unsigned long) prmap->pr_vaddr
+                                  + prmap->pr_size - 1,
+                                  prmap->pr_size,
+                                  prmap->pr_off,
+                                  mappingflags (prmap->pr_mflags));
                }
            }
        }
@@ -4711,31 +4839,31 @@ info_proc_mappings (pip, summary)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       info_proc -- implement the "info proc" command
+   info_proc -- implement the "info proc" command
 
-SYNOPSIS
+   SYNOPSIS
 
-       void info_proc (char *args, int from_tty)
+   void info_proc (char *args, int from_tty)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Implement gdb's "info proc" command by using the /proc interface
-       to print status information about any currently running process.
+   Implement gdb's "info proc" command by using the /proc interface
+   to print status information about any currently running process.
 
-       Examples of the use of "info proc" are:
+   Examples of the use of "info proc" are:
 
-       info proc               (prints summary info for current inferior)
-       info proc 123           (prints summary info for process with pid 123)
-       info proc mappings      (prints address mappings)
-       info proc times         (prints process/children times)
-       info proc id            (prints pid, ppid, gid, sid, etc)
-               FIXME:  i proc id not implemented.
-       info proc status        (prints general process state info)
-               FIXME:  i proc status not implemented.
-       info proc signals       (prints info about signal handling)
-       info proc all           (prints all info)
+   info proc            (prints summary info for current inferior)
+   info proc 123                (prints summary info for process with pid 123)
+   info proc mappings   (prints address mappings)
+   info proc times              (prints process/children times)
+   info proc id         (prints pid, ppid, gid, sid, etc)
+   FIXME:  i proc id not implemented.
+   info proc status     (prints general process state info)
+   FIXME:  i proc status not implemented.
+   info proc signals    (prints info about signal handling)
+   info proc all                (prints all info)
 
  */
 
@@ -4767,10 +4895,10 @@ info_proc (args, from_tty)
   /* Default to using the current inferior if no pid specified.  Note
      that inferior_pid may be 0, hence we set okerr.  */
 
-  pid = inferior_pid & 0x7fffffff;             /* strip off sol-thread bit */
-  if (!(pip = find_procinfo (pid, 1)))         /* inferior_pid no good?  */
-    pip = procinfo_list;                       /* take first available */
-  pid = pid & 0xffff;                          /* extract "real" pid */
+  pid = inferior_pid & 0x7fffffff;     /* strip off sol-thread bit */
+  if (!(pip = find_procinfo (pid, 1))) /* inferior_pid no good?  */
+    pip = procinfo_list;       /* take first available */
+  pid = pid & 0xffff;          /* extract "real" pid */
 
   if (args != NULL)
     {
@@ -4836,7 +4964,7 @@ info_proc (args, from_tty)
              pip->pid = pid;
              if (!open_proc_file (pid, pip, O_RDONLY, 0))
                {
-                 perror_with_name (pip -> pathname);
+                 perror_with_name (pip->pathname);
                  /* NOTREACHED */
                }
              pid = pip->pid;
@@ -4861,7 +4989,7 @@ No process.  Start debugging a program or specify an explicit process ID.");
 
   if (!procfs_read_status (pip))
     {
-      print_sys_errmsg (pip -> pathname, errno);
+      print_sys_errmsg (pip->pathname, errno);
       error ("procfs_read_status failed");
     }
 
@@ -4872,7 +5000,7 @@ No process.  Start debugging a program or specify an explicit process ID.");
 
   if (ioctl (pip->ctl_fd, PIOCLWPIDS, lwps))
     {
-      print_sys_errmsg (pip -> pathname, errno);
+      print_sys_errmsg (pip->pathname, errno);
       error ("PIOCLWPIDS failed");
     }
 #else /* PIOCLWPIDS */
@@ -4896,7 +5024,7 @@ No process.  Start debugging a program or specify an explicit process ID.");
 
          if (!procfs_read_status (pip))
            {
-             print_sys_errmsg (pip -> pathname, errno);
+             print_sys_errmsg (pip->pathname, errno);
              error ("procfs_read_status failed");
            }
        }
@@ -4904,9 +5032,9 @@ No process.  Start debugging a program or specify an explicit process ID.");
 #endif /* PROCFS_USE_READ_WRITE */
 
       /* Print verbose information of the requested type(s), or just a summary
-        of the information for all types. */
+         of the information for all types. */
 
-      printf_filtered ("\nInformation for %s.%d:\n\n", pip -> pathname, *lwps);
+      printf_filtered ("\nInformation for %s.%d:\n\n", pip->pathname, *lwps);
       if (summary || all || flags)
        {
          info_proc_flags (pip, summary);
@@ -4946,7 +5074,7 @@ No process.  Start debugging a program or specify an explicit process ID.");
       printf_filtered ("\n");
 
       /* All done, deal with closing any temporary process info structure,
-        freeing temporary memory , etc. */
+         freeing temporary memory , etc. */
 
       do_cleanups (old_chain);
 #ifndef PROCFS_USE_READ_WRITE
@@ -4956,19 +5084,19 @@ No process.  Start debugging a program or specify an explicit process ID.");
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       modify_inherit_on_fork_flag - Change the inherit-on-fork flag
+   modify_inherit_on_fork_flag - Change the inherit-on-fork flag
 
-SYNOPSIS
+   SYNOPSIS
 
-       void modify_inherit_on_fork_flag (fd, flag)
+   void modify_inherit_on_fork_flag (fd, flag)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Call this routine to modify the inherit-on-fork flag.  This routine is
-       just a nice wrapper to hide the #ifdefs needed by various systems to
-       control this flag.
+   Call this routine to modify the inherit-on-fork flag.  This routine is
+   just a nice wrapper to hide the #ifdefs needed by various systems to
+   control this flag.
 
  */
 
@@ -4991,7 +5119,7 @@ modify_inherit_on_fork_flag (fd, flag)
       pctl.cmd = PCSET;
       pctl.data = PR_FORK;
       if (write (fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
-       retval = -1;
+         retval = -1;
 #else
       retval = ioctl (fd, PIOCSET, &pr_flags);
 #endif
@@ -5002,7 +5130,7 @@ modify_inherit_on_fork_flag (fd, flag)
       pctl.cmd = PCRESET;
       pctl.data = PR_FORK;
       if (write (fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
-       retval = -1;
+         retval = -1;
 #else
       retval = ioctl (fd, PIOCRESET, &pr_flags);
 #endif
@@ -5019,12 +5147,12 @@ modify_inherit_on_fork_flag (fd, flag)
       retval = ioctl (fd, PIOCRFORK, NULL);
     }
 #else
-  Neither PR_FORK nor PIOCSFORK exist!!!
+  Neither PR_FORK nor PIOCSFORK exist ! !!
 #endif
 #endif
 
   if (!retval)
-    return;
+      return;
 
   print_sys_errmsg ("modify_inherit_on_fork_flag", errno);
   error ("PIOCSFORK or PR_FORK modification failed");
@@ -5032,19 +5160,19 @@ modify_inherit_on_fork_flag (fd, flag)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       modify_run_on_last_close_flag - Change the run-on-last-close flag
+   modify_run_on_last_close_flag - Change the run-on-last-close flag
 
-SYNOPSIS
+   SYNOPSIS
 
-       void modify_run_on_last_close_flag (fd, flag)
+   void modify_run_on_last_close_flag (fd, flag)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Call this routine to modify the run-on-last-close flag.  This routine
-       is just a nice wrapper to hide the #ifdefs needed by various systems to
-       control this flag.
+   Call this routine to modify the run-on-last-close flag.  This routine
+   is just a nice wrapper to hide the #ifdefs needed by various systems to
+   control this flag.
 
  */
 
@@ -5067,7 +5195,7 @@ modify_run_on_last_close_flag (fd, flag)
       pctl.cmd = PCSET;
       pctl.data = PR_RLC;
       if (write (fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
-       retval = -1;
+         retval = -1;
 #else
       retval = ioctl (fd, PIOCSET, &pr_flags);
 #endif
@@ -5078,7 +5206,7 @@ modify_run_on_last_close_flag (fd, flag)
       pctl.cmd = PCRESET;
       pctl.data = PR_RLC;
       if (write (fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
-       retval = -1;
+         retval = -1;
 #else
       retval = ioctl (fd, PIOCRESET, &pr_flags);
 #endif
@@ -5091,12 +5219,12 @@ modify_run_on_last_close_flag (fd, flag)
   else
     retval = ioctl (fd, PIOCRRLC, NULL);
 #else
-  Neither PR_RLC nor PIOCSRLC exist!!!
+  Neither PR_RLC nor PIOCSRLC exist ! !!
 #endif
 #endif
 
   if (!retval)
-    return;
+      return;
 
   print_sys_errmsg ("modify_run_on_last_close_flag", errno);
   error ("PIOCSRLC or PR_RLC modification failed");
@@ -5104,18 +5232,18 @@ modify_run_on_last_close_flag (fd, flag)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_clear_syscall_trap -- Deletes the trap for the specified system call.
+   procfs_clear_syscall_trap -- Deletes the trap for the specified system call.
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_clear_syscall_trap (struct procinfo *, int syscall_num, int errok)
+   void procfs_clear_syscall_trap (struct procinfo *, int syscall_num, int errok)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function function disables traps for the specified system call.
-       errok is non-zero if errors should be ignored.
+   This function function disables traps for the specified system call.
+   errok is non-zero if errors should be ignored.
  */
 
 static void
@@ -5191,7 +5319,7 @@ procfs_clear_syscall_trap (pi, syscall_num, errok)
 
        pi->syscall_handlers = xrealloc (pi->syscall_handlers,
                                         (pi->num_syscall_handlers - 1)
-                                        * sizeof (struct procfs_syscall_handler));
+                                 * sizeof (struct procfs_syscall_handler));
        pi->num_syscall_handlers--;
        return;
       }
@@ -5203,24 +5331,24 @@ procfs_clear_syscall_trap (pi, syscall_num, errok)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_set_syscall_trap -- arrange for a function to be called when the
-                                  child executes the specified system call.
+   procfs_set_syscall_trap -- arrange for a function to be called when the
+   child executes the specified system call.
 
-SYNOPSIS
+   SYNOPSIS
 
-       void procfs_set_syscall_trap (struct procinfo *, int syscall_num, int flags,
-                                     syscall_func_t *function)
+   void procfs_set_syscall_trap (struct procinfo *, int syscall_num, int flags,
+   syscall_func_t *function)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function sets up an entry and/or exit trap for the specified system
-       call.  When the child executes the specified system call, your function
-       will be called with the call #, a flag that indicates entry or exit, and
-       pointers to rtnval and statval (which are used by procfs_wait).  The
-       function should return non-zero if something interesting happened, zero
-       otherwise.
+   This function sets up an entry and/or exit trap for the specified system
+   call.  When the child executes the specified system call, your function
+   will be      called with the call #, a flag that indicates entry or exit, and
+   pointers to rtnval and statval (which are used by procfs_wait).  The
+   function should return non-zero if something interesting happened, zero
+   otherwise.
  */
 
 static void
@@ -5289,7 +5417,7 @@ procfs_set_syscall_trap (pi, syscall_num, flags, func)
          }
 
       pi->syscall_handlers = xrealloc (pi->syscall_handlers, (i + 1)
-                                      * sizeof (struct procfs_syscall_handler));
+                                 * sizeof (struct procfs_syscall_handler));
       pi->syscall_handlers[i].syscall_num = syscall_num;
       pi->syscall_handlers[i].func = func;
       pi->num_syscall_handlers++;
@@ -5300,32 +5428,32 @@ procfs_set_syscall_trap (pi, syscall_num, flags, func)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       procfs_lwp_creation_handler - handle exit from the _lwp_create syscall
+   procfs_lwp_creation_handler - handle exit from the _lwp_create syscall
 
-SYNOPSIS
+   SYNOPSIS
 
-       int procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
+   int procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This routine is called both when an inferior process and it's new lwp
-       are about to finish a _lwp_create() system call.  This is the system
-       call that Solaris uses to create a lightweight process.  When the
-       target process gets this event, we can look at sysarg[2] to find the
-       new childs lwp ID, and create a procinfo struct from that.  After that,
-       we pretend that we got a SIGTRAP, and return non-zero to tell
-       procfs_wait to wake up.  Subsequently, wait_for_inferior gets woken up,
-       sees the new process and continues it.
+   This routine is called both when an inferior process and it's new lwp
+   are about to finish a _lwp_create() system call.  This is the system
+   call that Solaris uses to create a lightweight process.  When the
+   target process gets this event, we can look at sysarg[2] to find the
+   new childs lwp ID, and create a procinfo struct from that.  After that,
+   we pretend that we got a SIGTRAP, and return non-zero to tell
+   procfs_wait to wake up.  Subsequently, wait_for_inferior gets woken up,
+   sees the new process and continues it.
 
-       When we see the child exiting from lwp_create, we just contine it,
-       since everything was handled when the parent trapped.
+   When we see the child exiting from lwp_create, we just contine it,
+   since everything was handled when the parent trapped.
 
-NOTES
-       In effect, we are only paying attention to the parent's completion of
-       the lwp_create syscall.  If we only paid attention to the child
-       instead, then we wouldn't detect the creation of a suspended thread.
+   NOTES
+   In effect, we are only paying attention to the parent's completion of
+   the lwp_create syscall.  If we only paid attention to the child
+   instead, then we wouldn't detect the creation of a suspended thread.
  */
 
 static int
@@ -5350,12 +5478,12 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
 #ifdef UNIXWARE
   /* Joel ... can you check this logic out please? JKJ */
   if (pi->prstatus.pr_lwp.pr_context.uc_mcontext.gregs[R_EFL] & 1)
-    { /* _lwp_create failed */
+    {                          /* _lwp_create failed */
       pctl.cmd = PCRUN;
       pctl.data = PRCFAULT;
 
       if (write (pi->ctl_fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
-       perror_with_name (pi->pathname);
+         perror_with_name (pi->pathname);
 
       return 0;
     }
@@ -5381,7 +5509,7 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
       pctl.cmd = PCRUN;
       pctl.data = PRCFAULT;
 
-      if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+      if (write (pi->ctl_fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
 #else /* !UNIXWARE */
       pi->prrun.pr_flags &= PRSTEP;
       pi->prrun.pr_flags |= PRCFAULT;
@@ -5401,7 +5529,7 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
 
   /* Third arg is pointer to new thread id. */
   lwp_id = read_memory_integer (
-     THE_PR_LWP(pi->prstatus).pr_sysarg[2], sizeof (int));
+                     THE_PR_LWP (pi->prstatus).pr_sysarg[2], sizeof (int));
 
   lwp_id = (lwp_id << 16) | PIDGET (pi->pid);
 
@@ -5420,7 +5548,7 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
   pctl.cmd = PCRUN;
   pctl.data = PRCFAULT;
 
-  if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+  if (write (pi->ctl_fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
 #else
   pi->prrun.pr_flags &= PRSTEP;
   pi->prrun.pr_flags |= PRCFAULT;
@@ -5432,7 +5560,7 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
      SUSPENDED or RUNNABLE.  If runnable, we will simply signal it to run.
      If suspended, we flag it to be continued later, when it has an event.  */
 
-  if (THE_PR_LWP(childpi->prstatus).pr_why == PR_SUSPENDED)
+  if (THE_PR_LWP (childpi->prstatus).pr_why == PR_SUSPENDED)
     childpi->new_child = 1;    /* Flag this as an unseen child process */
   else
     {
@@ -5441,7 +5569,7 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
       pctl.cmd = PCRUN;
       pctl.data = PRCFAULT;
 
-      if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+      if (write (pi->ctl_fd, (char *) &pctl, sizeof (struct proc_ctl)) < 0)
 #else
       childpi->prrun.pr_flags &= PRSTEP;
       childpi->prrun.pr_flags |= PRCFAULT;
@@ -5468,30 +5596,30 @@ procfs_create_inferior (exec_file, allargs, env)
     {
 
       /* We will be looking down the PATH to find shell_file.  If we
-        just do this the normal way (via execlp, which operates by
-        attempting an exec for each element of the PATH until it
-        finds one which succeeds), then there will be an exec for
-        each failed attempt, each of which will cause a PR_SYSEXIT
-        stop, and we won't know how to distinguish the PR_SYSEXIT's
-        for these failed execs with the ones for successful execs
-        (whether the exec has succeeded is stored at that time in the
-        carry bit or some such architecture-specific and
-        non-ABI-specified place).
-
-        So I can't think of anything better than to search the PATH
-        now.  This has several disadvantages: (1) There is a race
-        condition; if we find a file now and it is deleted before we
-        exec it, we lose, even if the deletion leaves a valid file
-        further down in the PATH, (2) there is no way to know exactly
-        what an executable (in the sense of "capable of being
-        exec'd") file is.  Using access() loses because it may lose
-        if the caller is the superuser; failing to use it loses if
-        there are ACLs or some such.  */
+         just do this the normal way (via execlp, which operates by
+         attempting an exec for each element of the PATH until it
+         finds one which succeeds), then there will be an exec for
+         each failed attempt, each of which will cause a PR_SYSEXIT
+         stop, and we won't know how to distinguish the PR_SYSEXIT's
+         for these failed execs with the ones for successful execs
+         (whether the exec has succeeded is stored at that time in the
+         carry bit or some such architecture-specific and
+         non-ABI-specified place).
+
+         So I can't think of anything better than to search the PATH
+         now.  This has several disadvantages: (1) There is a race
+         condition; if we find a file now and it is deleted before we
+         exec it, we lose, even if the deletion leaves a valid file
+         further down in the PATH, (2) there is no way to know exactly
+         what an executable (in the sense of "capable of being
+         exec'd") file is.  Using access() loses because it may lose
+         if the caller is the superuser; failing to use it loses if
+         there are ACLs or some such.  */
 
       char *p;
       char *p1;
       /* FIXME-maybe: might want "set path" command so user can change what
-        path is used from within GDB.  */
+         path is used from within GDB.  */
       char *path = getenv ("PATH");
       int len;
       struct stat statbuf;
@@ -5500,7 +5628,7 @@ procfs_create_inferior (exec_file, allargs, env)
        path = "/bin:/usr/bin";
 
       tryname = alloca (strlen (path) + strlen (shell_file) + 2);
-      for (p = path; p != NULL; p = p1 ? p1 + 1: NULL)
+      for (p = path; p != NULL; p = p1 ? p1 + 1 : NULL)
        {
          p1 = strchr (p, ':');
          if (p1 != NULL)
@@ -5537,7 +5665,7 @@ procfs_create_inferior (exec_file, allargs, env)
   /* We are at the first instruction we care about.  */
   /* Pedal to the metal... */
 
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
 }
 
 /* Clean up after the inferior dies.  */
@@ -5574,17 +5702,17 @@ procfs_can_run ()
 \f
 /* Insert a watchpoint */
 int
-procfs_set_watchpoint(pid, addr, len, rw)
-     int               pid;
-     CORE_ADDR         addr;
-     int               len;
-     int               rw;
+procfs_set_watchpoint (pid, addr, len, rw)
+     int pid;
+     CORE_ADDR addr;
+     int len;
+     int rw;
 {
-  struct procinfo      *pi;
-  prwatch_t            wpt;
+  struct procinfo *pi;
+  prwatch_t wpt;
 
   pi = find_procinfo (pid == -1 ? inferior_pid : pid, 0);
-  wpt.pr_vaddr = (caddr_t)addr;
+  wpt.pr_vaddr = (caddr_t) addr;
   wpt.pr_size = len;
   wpt.pr_wflags = ((rw & 1) ? MA_READ : 0) | ((rw & 2) ? MA_WRITE : 0);
   if (ioctl (pi->ctl_fd, PIOCSWATCH, &wpt) < 0)
@@ -5592,7 +5720,7 @@ procfs_set_watchpoint(pid, addr, len, rw)
       if (errno == E2BIG)
        return -1;
       /* Currently it sometimes happens that the same watchpoint gets
-        deleted twice - don't die in this case (FIXME please) */
+         deleted twice - don't die in this case (FIXME please) */
       if (errno == ESRCH && len == 0)
        return 0;
       print_sys_errmsg (pi->pathname, errno);
@@ -5602,30 +5730,30 @@ procfs_set_watchpoint(pid, addr, len, rw)
 }
 
 int
-procfs_stopped_by_watchpoint(pid)
-    int                        pid;
+procfs_stopped_by_watchpoint (pid)
+     int pid;
 {
-  struct procinfo      *pi;
-  short                what;
-  short                why;
+  struct procinfo *pi;
+  short what;
+  short why;
 
   pi = find_procinfo (pid == -1 ? inferior_pid : pid, 0);
   if (pi->prstatus.pr_flags & (PR_STOPPED | PR_ISTOP))
     {
       why = pi->prstatus.pr_why;
       what = pi->prstatus.pr_what;
-      if (why == PR_FAULTED 
+      if (why == PR_FAULTED
 #if defined (FLTWATCH) && defined (FLTKWATCH)
          && (what == FLTWATCH || what == FLTKWATCH)
 #else
 #ifdef FLTWATCH
-         && (what == FLTWATCH) 
+         && (what == FLTWATCH)
 #endif
 #ifdef FLTKWATCH
          && (what == FLTKWATCH)
 #endif
 #endif
-         )
+       )
        return what;
     }
   return 0;
@@ -5645,10 +5773,11 @@ procfs_thread_alive (pid)
   for (pi = procinfo_list; pi; pi = next_pi)
     {
       next_pi = pi->next;
-      if (pi -> pid == pid)
+      if (pi->pid == pid)
        if (procfs_read_status (pi))    /* alive */
          return 1;
-       else                            /* defunct (exited) */
+       else
+         /* defunct (exited) */
          {
            close_proc_file (pi);
            return 0;
@@ -5710,8 +5839,8 @@ procfs_pid_to_str (pid)
   return buf;
 }
 #endif /* TIDGET */
-
 \f
+
 static void
 init_procfs_ops ()
 {
@@ -5770,8 +5899,8 @@ _initialize_procfs ()
   init_procfs_ops ();
   add_target (&procfs_ops);
 
-  add_info ("processes", info_proc, 
-"Show process status information using /proc entry.\n\
+  add_info ("processes", info_proc,
+           "Show process status information using /proc entry.\n\
 Specify process id or use current inferior by default.\n\
 Specify keywords for detailed information; default is summary.\n\
 Keywords are: `all', `faults', `flags', `id', `mappings', `signals',\n\
index ef83ccc955e77028ec1873f7d91d0da431008b03..9640d283eba5cd7e2145fdd318d537e463566b62 100644 (file)
@@ -1,21 +1,22 @@
 /* Native-dependent code for ptx 4.0
    Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -26,23 +27,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <fcntl.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. */
+   unpack the register contents and supply them as gdb's idea of the current
+   register values. */
 
 void
 supply_gregset (gregsetp)
      gregset_t *gregsetp;
 {
-       supply_register(EAX_REGNUM, (char *)&(*gregsetp)[EAX]);
-       supply_register(EDX_REGNUM, (char *)&(*gregsetp)[EDX]);
-       supply_register(ECX_REGNUM, (char *)&(*gregsetp)[ECX]);
-       supply_register(EBX_REGNUM, (char *)&(*gregsetp)[EBX]);
-       supply_register(ESI_REGNUM, (char *)&(*gregsetp)[ESI]);
-       supply_register(EDI_REGNUM, (char *)&(*gregsetp)[EDI]);
-       supply_register(ESP_REGNUM, (char *)&(*gregsetp)[UESP]);
-       supply_register(EBP_REGNUM, (char *)&(*gregsetp)[EBP]);
-       supply_register(EIP_REGNUM, (char *)&(*gregsetp)[EIP]);
-       supply_register(EFLAGS_REGNUM, (char *)&(*gregsetp)[EFL]);
+  supply_register (EAX_REGNUM, (char *) &(*gregsetp)[EAX]);
+  supply_register (EDX_REGNUM, (char *) &(*gregsetp)[EDX]);
+  supply_register (ECX_REGNUM, (char *) &(*gregsetp)[ECX]);
+  supply_register (EBX_REGNUM, (char *) &(*gregsetp)[EBX]);
+  supply_register (ESI_REGNUM, (char *) &(*gregsetp)[ESI]);
+  supply_register (EDI_REGNUM, (char *) &(*gregsetp)[EDI]);
+  supply_register (ESP_REGNUM, (char *) &(*gregsetp)[UESP]);
+  supply_register (EBP_REGNUM, (char *) &(*gregsetp)[EBP]);
+  supply_register (EIP_REGNUM, (char *) &(*gregsetp)[EIP]);
+  supply_register (EFLAGS_REGNUM, (char *) &(*gregsetp)[EFL]);
 }
 
 void
@@ -52,11 +53,11 @@ fill_gregset (gregsetp, regno)
 {
   int regi;
 
-  for (regi = 0 ; regi < NUM_REGS ; regi++)
+  for (regi = 0; regi < NUM_REGS; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
-         (*gregsetp)[regi] = *(greg_t *)&registers[REGISTER_BYTE (regi)];
+         (*gregsetp)[regi] = *(greg_t *) & registers[REGISTER_BYTE (regi)];
        }
     }
 }
@@ -64,21 +65,21 @@ fill_gregset (gregsetp, regno)
 #if defined (FP0_REGNUM)
 
 /*  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. */
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
 
-void 
+void
 supply_fpregset (fpregsetp)
      fpregset_t *fpregsetp;
 {
-  supply_fpu_registers((struct fpusave *)&fpregsetp->fp_reg_set);
-  supply_fpa_registers((struct fpasave *)&fpregsetp->f_wregs);
+  supply_fpu_registers ((struct fpusave *) &fpregsetp->fp_reg_set);
+  supply_fpa_registers ((struct fpasave *) &fpregsetp->f_wregs);
 }
 
 /*  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. */
+   (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. */
 
 void
 fill_fpregset (fpregsetp, regno)
@@ -92,7 +93,7 @@ fill_fpregset (fpregsetp, regno)
   /* FIXME: see m68k-tdep.c for an example, for the m68k. */
 }
 
-#endif /* defined (FP0_REGNUM) */
+#endif /* defined (FP0_REGNUM) */
 
 /*
  * This doesn't quite do the same thing as the procfs.c version, but give
@@ -100,108 +101,117 @@ fill_fpregset (fpregsetp, regno)
  */
 /* this could use elf_interpreter() from elfread.c */
 int
-proc_iterate_over_mappings(func)
-       int (*func) PARAMS ((int, CORE_ADDR));
+proc_iterate_over_mappings (func)
+     int (*func) PARAMS ((int, CORE_ADDR));
 {
-       vaddr_t curseg, memptr;
-       pt_vseg_t pv;
-       int rv, cmperr;
-       sec_ptr interp_sec;
-       char *interp_content;
-       int interp_fd, funcstat;
-       unsigned int size;
-       char buf1[NBPG], buf2[NBPG];
-
-       /*
-        * The following is really vile.  We can get the name of the
-        * shared library from the exec_bfd, and we can get a list of
-        * each virtual memory segment, but there is no simple way to
-        * find the mapped segment from the shared library (ala
-        * procfs's PIOCOPENMEM).  As a pretty nasty kludge, we
-        * compare the virtual memory segment to the contents of the
-        * .interp file.  If they match, we assume that we've got the
-        * right one.
-        */
-
-       /*
-        * TODO: for attach, use XPT_OPENT to get the executable, in
-        * case we're attached without knowning the executable's
-        * filename.
-        */
+  vaddr_t curseg, memptr;
+  pt_vseg_t pv;
+  int rv, cmperr;
+  sec_ptr interp_sec;
+  char *interp_content;
+  int interp_fd, funcstat;
+  unsigned int size;
+  char buf1[NBPG], buf2[NBPG];
+
+  /*
+   * The following is really vile.  We can get the name of the
+   * shared library from the exec_bfd, and we can get a list of
+   * each virtual memory segment, but there is no simple way to
+   * find the mapped segment from the shared library (ala
+   * procfs's PIOCOPENMEM).  As a pretty nasty kludge, we
+   * compare the virtual memory segment to the contents of the
+   * .interp file.  If they match, we assume that we've got the
+   * right one.
+   */
+
+  /*
+   * TODO: for attach, use XPT_OPENT to get the executable, in
+   * case we're attached without knowning the executable's
+   * filename.
+   */
 
 #ifdef VERBOSE_DEBUG
-       printf("proc_iter\n");
+  printf ("proc_iter\n");
 #endif
-       interp_sec = bfd_get_section_by_name(exec_bfd, ".interp");
-       if (!interp_sec) {
-               return 0;
-       }
+  interp_sec = bfd_get_section_by_name (exec_bfd, ".interp");
+  if (!interp_sec)
+    {
+      return 0;
+    }
 
-       size = bfd_section_size(exec_bfd, interp_sec);
-       interp_content = alloca(size);
-       if (0 == bfd_get_section_contents(exec_bfd, interp_sec,
-               interp_content, (file_ptr)0, size)) {
-               return 0;
-       }
+  size = bfd_section_size (exec_bfd, interp_sec);
+  interp_content = alloca (size);
+  if (0 == bfd_get_section_contents (exec_bfd, interp_sec,
+                                    interp_content, (file_ptr) 0, size))
+    {
+      return 0;
+    }
 
 #ifdef VERBOSE_DEBUG
-       printf("proc_iter: \"%s\"\n", interp_content);
+  printf ("proc_iter: \"%s\"\n", interp_content);
 #endif
-       interp_fd = open(interp_content, O_RDONLY, 0);
-       if (-1 == interp_fd) {
-               return 0;
-       }
+  interp_fd = open (interp_content, O_RDONLY, 0);
+  if (-1 == interp_fd)
+    {
+      return 0;
+    }
 
-       curseg = 0;
-       while (1) {
-               rv = ptrace(PT_NEXT_VSEG, inferior_pid, &pv, curseg);
+  curseg = 0;
+  while (1)
+    {
+      rv = ptrace (PT_NEXT_VSEG, inferior_pid, &pv, curseg);
 #ifdef VERBOSE_DEBUG
-               printf("PT_NEXT_VSEG: rv %d errno %d\n", rv, errno);
+      printf ("PT_NEXT_VSEG: rv %d errno %d\n", rv, errno);
 #endif
-               if (-1 == rv)
-                       break;
-               if (0 == rv)
-                       break;
+      if (-1 == rv)
+       break;
+      if (0 == rv)
+       break;
 #ifdef VERBOSE_DEBUG
-               printf("pv.pv_start 0x%x pv_size 0x%x pv_prot 0x%x\n",
-                      pv.pv_start, pv.pv_size, pv.pv_prot);
+      printf ("pv.pv_start 0x%x pv_size 0x%x pv_prot 0x%x\n",
+             pv.pv_start, pv.pv_size, pv.pv_prot);
 #endif
-               curseg = pv.pv_start + pv.pv_size;
-
-               rv = lseek(interp_fd, 0, SEEK_SET);
-               if (-1 == rv) {
-                       perror("lseek");
-                       close(interp_fd);
-                       return 0;
-               }
-               for (memptr = pv.pv_start; memptr < pv.pv_start + pv.pv_size;
-                    memptr += NBPG) {
+      curseg = pv.pv_start + pv.pv_size;
+
+      rv = lseek (interp_fd, 0, SEEK_SET);
+      if (-1 == rv)
+       {
+         perror ("lseek");
+         close (interp_fd);
+         return 0;
+       }
+      for (memptr = pv.pv_start; memptr < pv.pv_start + pv.pv_size;
+          memptr += NBPG)
+       {
 #ifdef VERBOSE_DEBUG
-                       printf("memptr 0x%x\n", memptr);
+         printf ("memptr 0x%x\n", memptr);
 #endif
-                       rv = read(interp_fd, buf1, NBPG);
-                       if (-1 == rv) {
-                               perror("read");
-                               close(interp_fd);
-                               return 0;
-                       }
-                       rv = ptrace(PT_RDATA_PAGE, inferior_pid, buf2,
-                                   memptr);
-                       if (-1 == rv) {
-                               perror("ptrace");
-                               close(interp_fd);
-                               return 0;
-                       }
-                       cmperr = memcmp(buf1, buf2, NBPG);
-                       if (cmperr)
-                               break;
-               }
-               if (0 == cmperr) {
-                       /* this is it */
-                       funcstat = (*func)(interp_fd, pv.pv_start);
-                       break;
-               }
+         rv = read (interp_fd, buf1, NBPG);
+         if (-1 == rv)
+           {
+             perror ("read");
+             close (interp_fd);
+             return 0;
+           }
+         rv = ptrace (PT_RDATA_PAGE, inferior_pid, buf2,
+                      memptr);
+         if (-1 == rv)
+           {
+             perror ("ptrace");
+             close (interp_fd);
+             return 0;
+           }
+         cmperr = memcmp (buf1, buf2, NBPG);
+         if (cmperr)
+           break;
+       }
+      if (0 == cmperr)
+       {
+         /* this is it */
+         funcstat = (*func) (interp_fd, pv.pv_start);
+         break;
        }
-       close(interp_fd);
-       return 0;
+    }
+  close (interp_fd);
+  return 0;
 }
index f8c570ef49ea9c6dc64cb1054a9ab4f4f30e8019..e5e4043328d29f9b708e78a6dd7d67bd71c85540 100644 (file)
 /* OBSOLETE  */
 /* OBSOLETE   for (regno = 0; regno < 16; regno++) { */
 /* OBSOLETE     printf_unfiltered/*_filtered*x/ ("%6.6s: %8x  %6.6s: %8x  %6s: %8x  %6s: %8x\n", */
-/* OBSOLETE                 REGISTER_NAME (regno), reg_buf[regno], */
-/* OBSOLETE                 REGISTER_NAME (regno+16), reg_buf[regno+16], */
-/* OBSOLETE                 REGISTER_NAME (regno+32), reg_buf[regno+32], */
-/* OBSOLETE                 REGISTER_NAME (regno+48), reg_buf[regno+48]); */
+/* OBSOLETE                  REGISTER_NAME (regno), reg_buf[regno], */
+/* OBSOLETE                  REGISTER_NAME (regno+16), reg_buf[regno+16], */
+/* OBSOLETE                  REGISTER_NAME (regno+32), reg_buf[regno+32], */
+/* OBSOLETE                  REGISTER_NAME (regno+48), reg_buf[regno+48]); */
 /* OBSOLETE   } */
 /* OBSOLETE   usp = ptrace (3, inferior_pid, */
-/* OBSOLETE            (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_usp) - */
-/* OBSOLETE            ((char *)&u), 0); */
+/* OBSOLETE             (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_usp) - */
+/* OBSOLETE             ((char *)&u), 0); */
 /* OBSOLETE   ksp = ptrace (3, inferior_pid, */
-/* OBSOLETE            (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_ksp) - */
-/* OBSOLETE            ((char *)&u), 0); */
+/* OBSOLETE             (PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_ksp) - */
+/* OBSOLETE             ((char *)&u), 0); */
 /* OBSOLETE   printf_unfiltered/*_filtered*x/ ("\n%6.6s: %8x  %6.6s: %8x (%08x) %6.6s %8x\n", */
-/* OBSOLETE               REGISTER_NAME (CSP_REGNUM),reg_buf[CSP_REGNUM], */
-/* OBSOLETE               REGISTER_NAME (KSP_REGNUM), reg_buf[KSP_REGNUM], ksp, */
-/* OBSOLETE               "usp", usp); */
+/* OBSOLETE                REGISTER_NAME (CSP_REGNUM),reg_buf[CSP_REGNUM], */
+/* OBSOLETE                REGISTER_NAME (KSP_REGNUM), reg_buf[KSP_REGNUM], ksp, */
+/* OBSOLETE                "usp", usp); */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE /* Print the register regnum, or all registers if regnum is -1. */
 /* OBSOLETE   else */
 /* OBSOLETE     for (i = 0; i < NUM_REGS; i++) */
 /* OBSOLETE       if (i == regnum) { */
-/* OBSOLETE    long val = raw_regs[i]; */
-/* OBSOLETE     */
-/* OBSOLETE    fputs_filtered (REGISTER_NAME (i), gdb_stdout); */
-/* OBSOLETE    printf_filtered(":"); */
-/* OBSOLETE    print_spaces_filtered (6 - strlen (REGISTER_NAME (i)), gdb_stdout); */
-/* OBSOLETE    if (val == 0) */
-/* OBSOLETE      printf_filtered ("0"); */
-/* OBSOLETE    else */
-/* OBSOLETE      printf_filtered ("%s  %d", local_hex_string_custom(val,"08"), val); */
-/* OBSOLETE    printf_filtered("\n"); */
+/* OBSOLETE     long val = raw_regs[i]; */
+/* OBSOLETE      */
+/* OBSOLETE     fputs_filtered (REGISTER_NAME (i), gdb_stdout); */
+/* OBSOLETE     printf_filtered(":"); */
+/* OBSOLETE     print_spaces_filtered (6 - strlen (REGISTER_NAME (i)), gdb_stdout); */
+/* OBSOLETE     if (val == 0) */
+/* OBSOLETE       printf_filtered ("0"); */
+/* OBSOLETE     else */
+/* OBSOLETE       printf_filtered ("%s  %d", local_hex_string_custom(val,"08"), val); */
+/* OBSOLETE     printf_filtered("\n"); */
 /* OBSOLETE       } */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE   register int result = read_memory_integer (addr, 4); */
 /* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */
 /* OBSOLETE   fprintf_unfiltered (gdb_stderr, */
-/* OBSOLETE       "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */
-/* OBSOLETE       frame->frame, */
-/* OBSOLETE       REGISTER_NAME (CFP_REGNUM), */
-/* OBSOLETE       result, addr, */
-/* OBSOLETE       frame->frame_cfp, (CFP_REGNUM), */
+/* OBSOLETE        "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */
+/* OBSOLETE        frame->frame, */
+/* OBSOLETE        REGISTER_NAME (CFP_REGNUM), */
+/* OBSOLETE        result, addr, */
+/* OBSOLETE        frame->frame_cfp, (CFP_REGNUM), */
 /* OBSOLETE  */
 /* OBSOLETE  */
-/* OBSOLETE       read_register(13), read_register(29), read_register(61), */
-/* OBSOLETE       find_saved_register(frame, 61)); */
+/* OBSOLETE        read_register(13), read_register(29), read_register(61), */
+/* OBSOLETE        find_saved_register(frame, 61)); */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; */
 /* OBSOLETE  */
 /* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */
 /* OBSOLETE   fprintf_unfiltered (gdb_stderr, */
-/* OBSOLETE       "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */
-/* OBSOLETE       frame->frame, */
-/* OBSOLETE       REGISTER_NAME (CFP_REGNUM), */
-/* OBSOLETE       result, addr, */
-/* OBSOLETE       frame->frame_cfp, read_register(CFP_REGNUM), */
-/* OBSOLETE  */
-/* OBSOLETE       read_register(13), read_register(29), read_register(61), */
-/* OBSOLETE       find_saved_register(frame, 61)); */
+/* OBSOLETE        "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n", */
+/* OBSOLETE        frame->frame, */
+/* OBSOLETE        REGISTER_NAME (CFP_REGNUM), */
+/* OBSOLETE        result, addr, */
+/* OBSOLETE        frame->frame_cfp, read_register(CFP_REGNUM), */
+/* OBSOLETE  */
+/* OBSOLETE        read_register(13), read_register(29), read_register(61), */
+/* OBSOLETE        find_saved_register(frame, 61)); */
 /* OBSOLETE #endif /*  PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer; */
 /* OBSOLETE     int foo=0; */
 /* OBSOLETE     foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4); */
 /* OBSOLETE     printf_unfiltered ("..reading pc from frame 0x%0x+%d regs: got %0x\n", */
-/* OBSOLETE        frame, 60/4, foo); */
+/* OBSOLETE         frame, 60/4, foo); */
 /* OBSOLETE     return foo; */
 /* OBSOLETE } */
 /* OBSOLETE  */
 /* OBSOLETE   register char *d; */
 /* OBSOLETE   register int insn_opcode, operand_mode; */
 /* OBSOLETE   register int index_multiplier, index_reg_regno, op_1_regno, op_2_regno ; */
-/* OBSOLETE   long insn;                       /* first word of the insn, not broken down. *x/ */
-/* OBSOLETE   pyr_insn_format insn_decode;     /* the same, broken out into op{code,erands} *x/ */
+/* OBSOLETE   long insn;                        /* first word of the insn, not broken down. *x/ */
+/* OBSOLETE   pyr_insn_format insn_decode;      /* the same, broken out into op{code,erands} *x/ */
 /* OBSOLETE   long extra_1, extra_2; */
 /* OBSOLETE  */
 /* OBSOLETE   read_memory (memaddr, buffer, MAXLEN); */
 /* OBSOLETE   } */
 /* OBSOLETE  */
 /* OBSOLETE   for (i = 0; i < NOPCODES; i++) */
-/* OBSOLETE      if (pyr_opcodes[i].datum.code == insn_opcode) */
-/* OBSOLETE              break; */
+/* OBSOLETE       if (pyr_opcodes[i].datum.code == insn_opcode) */
+/* OBSOLETE               break; */
 /* OBSOLETE  */
 /* OBSOLETE   if (i == NOPCODES) */
-/* OBSOLETE      /* FIXME: Handle unrecognised instructions better.  *x/ */
-/* OBSOLETE      fprintf_unfiltered (stream, "???\t#%08x\t(op=%x mode =%x)", */
-/* OBSOLETE               insn, insn_decode.operator, insn_decode.mode); */
+/* OBSOLETE       /* FIXME: Handle unrecognised instructions better.  *x/ */
+/* OBSOLETE       fprintf_unfiltered (stream, "???\t#%08x\t(op=%x mode =%x)", */
+/* OBSOLETE                insn, insn_decode.operator, insn_decode.mode); */
 /* OBSOLETE   else */
 /* OBSOLETE     { */
 /* OBSOLETE       /* Print the mnemonic for the instruction.  Pyramid insn operands */
 /* OBSOLETE          are so regular that we can deal with almost all of them */
 /* OBSOLETE          separately. */
-/* OBSOLETE     Unconditional branches are an exception: they are encoded as */
-/* OBSOLETE     conditional branches (branch if false condition, I think) */
-/* OBSOLETE     with no condition specified. The average user will not be */
-/* OBSOLETE     aware of this. To maintain their illusion that an */
-/* OBSOLETE     unconditional branch insn exists, we will have to FIXME to */
-/* OBSOLETE     treat the insn mnemnonic of all branch instructions here as a */
-/* OBSOLETE     special case: check the operands of branch insn and print an */
-/* OBSOLETE     appropriate mnemonic. *x/  */
+/* OBSOLETE      Unconditional branches are an exception: they are encoded as */
+/* OBSOLETE      conditional branches (branch if false condition, I think) */
+/* OBSOLETE      with no condition specified. The average user will not be */
+/* OBSOLETE      aware of this. To maintain their illusion that an */
+/* OBSOLETE      unconditional branch insn exists, we will have to FIXME to */
+/* OBSOLETE      treat the insn mnemnonic of all branch instructions here as a */
+/* OBSOLETE      special case: check the operands of branch insn and print an */
+/* OBSOLETE      appropriate mnemonic. *x/  */
 /* OBSOLETE  */
 /* OBSOLETE       fprintf_unfiltered (stream, "%s\t", pyr_opcodes[i].name); */
 /* OBSOLETE  */
 /* OBSOLETE       register int i; */
 /* OBSOLETE       register int displacement = (insn & 0x0000ffff) << 2; */
 /* OBSOLETE  */
-/* OBSOLETE       static char cc_bit_names[] = "cvzn"; /* z,n,c,v: strange order? *x/ */
+/* OBSOLETE       static char cc_bit_names[] = "cvzn";  /* z,n,c,v: strange order? *x/ */
 /* OBSOLETE  */
 /* OBSOLETE       /* Is bfc and no bits specified an unconditional branch?*x/ */
 /* OBSOLETE       for (i=0;i<4;i++) { */
-/* OBSOLETE    if ((bit_codes) & 0x1) */
-/* OBSOLETE            fputc_unfiltered (cc_bit_names[i], stream); */
-/* OBSOLETE    bit_codes >>= 1; */
+/* OBSOLETE     if ((bit_codes) & 0x1) */
+/* OBSOLETE             fputc_unfiltered (cc_bit_names[i], stream); */
+/* OBSOLETE     bit_codes >>= 1; */
 /* OBSOLETE       } */
 /* OBSOLETE  */
 /* OBSOLETE       fprintf_unfiltered (stream, ",%0x", */
-/* OBSOLETE           displacement + memaddr); */
+/* OBSOLETE            displacement + memaddr); */
 /* OBSOLETE       return (insn_size); */
 /* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE       switch (operand_mode) { */
 /* OBSOLETE       case 0: */
-/* OBSOLETE    fprintf_unfiltered (stream, "%s,%s", */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno)); */
-/* OBSOLETE    break; */
-/* OBSOLETE         */
+/* OBSOLETE     fprintf_unfiltered (stream, "%s,%s", */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno)); */
+/* OBSOLETE     break; */
+/* OBSOLETE          */
 /* OBSOLETE       case 1: */
-/* OBSOLETE    fprintf_unfiltered (stream, " 0x%0x,%s", */
-/* OBSOLETE             op_1_regno, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno)); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     fprintf_unfiltered (stream, " 0x%0x,%s", */
+/* OBSOLETE              op_1_regno, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno)); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 2: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, " $0x%0x,%s", */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno)); */
-/* OBSOLETE    break; */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, " $0x%0x,%s", */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno)); */
+/* OBSOLETE     break; */
 /* OBSOLETE       case 3: */
-/* OBSOLETE    fprintf_unfiltered (stream, " (%s),%s", */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno)); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     fprintf_unfiltered (stream, " (%s),%s", */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno)); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 4: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, " 0x%0x(%s),%s", */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno)); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
-/* OBSOLETE    /* S1 destination mode *x/ */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, " 0x%0x(%s),%s", */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno)); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
+/* OBSOLETE     /* S1 destination mode *x/ */
 /* OBSOLETE       case 5: */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"), */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"), */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 6: */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */
-/* OBSOLETE              : " $%#0x,(%s)"), */
-/* OBSOLETE             op_1_regno, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */
+/* OBSOLETE               : " $%#0x,(%s)"), */
+/* OBSOLETE              op_1_regno, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 7: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */
-/* OBSOLETE              : " $%#0x,(%s)"), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]" */
+/* OBSOLETE               : " $%#0x,(%s)"), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 8: */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"), */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"), */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 9: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) */
-/* OBSOLETE              ? "%#0x(%s),(%s)[%s*%1d]" */
-/* OBSOLETE              : "%#0x(%s),(%s)"), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
-/* OBSOLETE    /* S2 destination mode *x/ */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) */
+/* OBSOLETE               ? "%#0x(%s),(%s)[%s*%1d]" */
+/* OBSOLETE               : "%#0x(%s),(%s)"), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
+/* OBSOLETE     /* S2 destination mode *x/ */
 /* OBSOLETE       case 10: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"), */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"), */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
 /* OBSOLETE       case 11: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? */
-/* OBSOLETE              " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */
-/* OBSOLETE             op_1_regno, */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? */
+/* OBSOLETE               " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */
+/* OBSOLETE              op_1_regno, */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
 /* OBSOLETE       case 12: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    read_memory (memaddr+8, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_2 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? */
-/* OBSOLETE              " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             extra_2, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     read_memory (memaddr+8, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_2 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? */
+/* OBSOLETE               " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              extra_2, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       case 13: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) */
-/* OBSOLETE              ? " (%s),%#0x(%s)[%s*%1d]"  */
-/* OBSOLETE              : " (%s),%#0x(%s)"), */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) */
+/* OBSOLETE               ? " (%s),%#0x(%s)[%s*%1d]"  */
+/* OBSOLETE               : " (%s),%#0x(%s)"), */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
 /* OBSOLETE       case 14: */
-/* OBSOLETE    read_memory (memaddr+4, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_1 = * ((int *) buffer); */
-/* OBSOLETE    read_memory (memaddr+8, buffer, MAXLEN); */
-/* OBSOLETE    insn_size += 4; */
-/* OBSOLETE    extra_2 = * ((int *) buffer); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]" */
-/* OBSOLETE              : "%#0x(%s),%#0x(%s) "), */
-/* OBSOLETE             extra_1, */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             extra_2, */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    break; */
-/* OBSOLETE     */
+/* OBSOLETE     read_memory (memaddr+4, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_1 = * ((int *) buffer); */
+/* OBSOLETE     read_memory (memaddr+8, buffer, MAXLEN); */
+/* OBSOLETE     insn_size += 4; */
+/* OBSOLETE     extra_2 = * ((int *) buffer); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]" */
+/* OBSOLETE               : "%#0x(%s),%#0x(%s) "), */
+/* OBSOLETE              extra_1, */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              extra_2, */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     break; */
+/* OBSOLETE      */
 /* OBSOLETE       default: */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"), */
-/* OBSOLETE             REGISTER_NAME (op_1_regno), */
-/* OBSOLETE             REGISTER_NAME (op_2_regno), */
-/* OBSOLETE             REGISTER_NAME (index_reg_regno), */
-/* OBSOLETE             index_multiplier); */
-/* OBSOLETE    fprintf_unfiltered (stream, */
-/* OBSOLETE             "\t\t# unknown mode in %08x", */
-/* OBSOLETE             insn); */
-/* OBSOLETE    break; */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"), */
+/* OBSOLETE              REGISTER_NAME (op_1_regno), */
+/* OBSOLETE              REGISTER_NAME (op_2_regno), */
+/* OBSOLETE              REGISTER_NAME (index_reg_regno), */
+/* OBSOLETE              index_multiplier); */
+/* OBSOLETE     fprintf_unfiltered (stream, */
+/* OBSOLETE              "\t\t# unknown mode in %08x", */
+/* OBSOLETE              insn); */
+/* OBSOLETE     break; */
 /* OBSOLETE       } /* switch *x/ */
 /* OBSOLETE     } */
 /* OBSOLETE    */
index 0ca79e1dae6d049102eecbaac9004fabb7f5903d..32224500f5c12f7130ee2cbd89b2d390df29c4fb 100644 (file)
@@ -28,7 +28,7 @@
 /* OBSOLETE /* #include <fcntl.h>  Can we live without this?  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #include "gdbcore.h" */
-/* OBSOLETE #include <sys/user.h>              /* After a.out.h  *x/ */
+/* OBSOLETE #include <sys/user.h>               /* After a.out.h  *x/ */
 /* OBSOLETE #include <sys/file.h> */
 /* OBSOLETE #include "gdb_stat.h" */
 /* OBSOLETE  */
 /* OBSOLETE      */
 /* OBSOLETE #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */
 /* OBSOLETE     printf_unfiltered ("Fetching register %s, got %0x\n", */
-/* OBSOLETE        REGISTER_NAME (regno), */
-/* OBSOLETE        reg_buf[regno]); */
+/* OBSOLETE         REGISTER_NAME (regno), */
+/* OBSOLETE         reg_buf[regno]); */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE      */
 /* OBSOLETE     if (reg_buf[regno] == -1 && errno == EIO) { */
 /* OBSOLETE       printf_unfiltered("fetch_interior_registers: fetching register %s\n", */
-/* OBSOLETE         REGISTER_NAME (regno)); */
+/* OBSOLETE          REGISTER_NAME (regno)); */
 /* OBSOLETE       errno = 0; */
 /* OBSOLETE     } */
 /* OBSOLETE     supply_register (regno, reg_buf+regno); */
 /* OBSOLETE   } */
 /* OBSOLETE   /* that leaves regs 64, 65, and 66 *x/ */
 /* OBSOLETE   datum = ptrace (3, inferior_pid, */
-/* OBSOLETE              (PTRACE_ARG3_TYPE) (((char *)&u.u_pcb.pcb_csp) - */
-/* OBSOLETE              ((char *)&u)), 0); */
+/* OBSOLETE               (PTRACE_ARG3_TYPE) (((char *)&u.u_pcb.pcb_csp) - */
+/* OBSOLETE               ((char *)&u)), 0); */
 /* OBSOLETE    */
 /* OBSOLETE    */
 /* OBSOLETE    */
 /* OBSOLETE   while (1) { */
 /* OBSOLETE     register int inferior_saved_pc; */
 /* OBSOLETE     inferior_saved_pc = ptrace (1, inferior_pid, */
-/* OBSOLETE                            (PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0); */
+/* OBSOLETE                             (PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0); */
 /* OBSOLETE     if (inferior_saved_pc > 0) break; */
 /* OBSOLETE #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */
 /* OBSOLETE     printf_unfiltered("skipping kernel frame %08x, pc=%08x\n", datum, */
-/* OBSOLETE       inferior_saved_pc); */
+/* OBSOLETE        inferior_saved_pc); */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE     skipped_frames++; */
 /* OBSOLETE     datum -= CONTROL_STACK_FRAME_SIZE; */
 /* OBSOLETE #ifdef  PYRAMID_CONTROL_FRAME_DEBUGGING */
 /* OBSOLETE   if (skipped_frames) { */
 /* OBSOLETE     fprintf_unfiltered (gdb_stderr, */
-/* OBSOLETE         "skipped %d frames from %x to %x; cfp was %x, now %x\n", */
-/* OBSOLETE         skipped_frames, reg_buf[CSP_REGNUM]); */
+/* OBSOLETE          "skipped %d frames from %x to %x; cfp was %x, now %x\n", */
+/* OBSOLETE          skipped_frames, reg_buf[CSP_REGNUM]); */
 /* OBSOLETE   } */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE } */
 /* OBSOLETE   if (regno >= 0) */
 /* OBSOLETE     { */
 /* OBSOLETE       if ((0 <= regno) && (regno < 64)) { */
-/* OBSOLETE    /*regaddr = register_addr (regno, offset);*x/ */
-/* OBSOLETE    regaddr = regno; */
-/* OBSOLETE    errno = 0; */
-/* OBSOLETE    ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */
-/* OBSOLETE            read_register (regno)); */
-/* OBSOLETE    if (errno != 0) */
-/* OBSOLETE      { */
-/* OBSOLETE        sprintf (buf, "writing register number %d", regno); */
-/* OBSOLETE        perror_with_name (buf); */
-/* OBSOLETE      } */
+/* OBSOLETE     /*regaddr = register_addr (regno, offset);*x/ */
+/* OBSOLETE     regaddr = regno; */
+/* OBSOLETE     errno = 0; */
+/* OBSOLETE     ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */
+/* OBSOLETE             read_register (regno)); */
+/* OBSOLETE     if (errno != 0) */
+/* OBSOLETE       { */
+/* OBSOLETE         sprintf (buf, "writing register number %d", regno); */
+/* OBSOLETE         perror_with_name (buf); */
+/* OBSOLETE       } */
 /* OBSOLETE       } */
 /* OBSOLETE     } */
 /* OBSOLETE   else */
 /* OBSOLETE     { */
 /* OBSOLETE       for (regno = 0; regno < NUM_REGS; regno++) */
-/* OBSOLETE    { */
-/* OBSOLETE      /*regaddr = register_addr (regno, offset);*x/ */
-/* OBSOLETE      regaddr = regno; */
-/* OBSOLETE      errno = 0; */
-/* OBSOLETE      ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */
-/* OBSOLETE              read_register (regno)); */
-/* OBSOLETE      if (errno != 0) */
-/* OBSOLETE        { */
-/* OBSOLETE          sprintf (buf, "writing all regs, number %d", regno); */
-/* OBSOLETE          perror_with_name (buf); */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       /*regaddr = register_addr (regno, offset);*x/ */
+/* OBSOLETE       regaddr = regno; */
+/* OBSOLETE       errno = 0; */
+/* OBSOLETE       ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, */
+/* OBSOLETE               read_register (regno)); */
+/* OBSOLETE       if (errno != 0) */
+/* OBSOLETE         { */
+/* OBSOLETE           sprintf (buf, "writing all regs, number %d", regno); */
+/* OBSOLETE           perror_with_name (buf); */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE } */
 /* OBSOLETE \f */
 /* OBSOLETE /*** Extensions to  core and dump files, for GDB. *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #ifdef PYRAMID_CORE */
 /* OBSOLETE   reg_stack_start = CONTROL_STACK_ADDR; */
-/* OBSOLETE   reg_stack_end = CONTROL_STACK_ADDR;      /* this isn't strictly true...*x/ */
+/* OBSOLETE   reg_stack_end = CONTROL_STACK_ADDR;       /* this isn't strictly true...*x/ */
 /* OBSOLETE #endif /* PYRAMID_CORE *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   /* Now, if a new core file was specified, open it and digest it.  *x/ */
 /* OBSOLETE       make_cleanup (free, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
-/* OBSOLETE    error ("To look at a core file, you must kill the program with \"kill\"."); */
+/* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
 /* OBSOLETE       corechan = open (filename, O_RDONLY, 0); */
 /* OBSOLETE       if (corechan < 0) */
-/* OBSOLETE    perror_with_name (filename); */
+/* OBSOLETE     perror_with_name (filename); */
 /* OBSOLETE       /* 4.2-style (and perhaps also sysV-style) core dump file.  *x/ */
 /* OBSOLETE       { */
-/* OBSOLETE    struct user u; */
+/* OBSOLETE     struct user u; */
 /* OBSOLETE  */
-/* OBSOLETE    unsigned int reg_offset; */
+/* OBSOLETE     unsigned int reg_offset; */
 /* OBSOLETE  */
-/* OBSOLETE    val = myread (corechan, &u, sizeof u); */
-/* OBSOLETE    if (val < 0) */
-/* OBSOLETE      perror_with_name ("Not a core file: reading upage"); */
-/* OBSOLETE    if (val != sizeof u) */
-/* OBSOLETE      error ("Not a core file: could only read %d bytes", val); */
-/* OBSOLETE    data_start = exec_data_start; */
+/* OBSOLETE     val = myread (corechan, &u, sizeof u); */
+/* OBSOLETE     if (val < 0) */
+/* OBSOLETE       perror_with_name ("Not a core file: reading upage"); */
+/* OBSOLETE     if (val != sizeof u) */
+/* OBSOLETE       error ("Not a core file: could only read %d bytes", val); */
+/* OBSOLETE     data_start = exec_data_start; */
 /* OBSOLETE  */
-/* OBSOLETE    data_end = data_start + NBPG * u.u_dsize; */
-/* OBSOLETE    data_offset = NBPG * UPAGES; */
-/* OBSOLETE    stack_offset = NBPG * (UPAGES + u.u_dsize); */
+/* OBSOLETE     data_end = data_start + NBPG * u.u_dsize; */
+/* OBSOLETE     data_offset = NBPG * UPAGES; */
+/* OBSOLETE     stack_offset = NBPG * (UPAGES + u.u_dsize); */
 /* OBSOLETE  */
-/* OBSOLETE    /* find registers in core file *x/ */
+/* OBSOLETE     /* find registers in core file *x/ */
 /* OBSOLETE #ifdef PYRAMID_PTRACE */
-/* OBSOLETE    stack_start = stack_end - NBPG * u.u_ussize; */
-/* OBSOLETE    reg_stack_offset = stack_offset + (NBPG *u.u_ussize); */
-/* OBSOLETE    reg_stack_end = reg_stack_start + NBPG * u.u_cssize; */
-/* OBSOLETE  */
-/* OBSOLETE    last_frame_address = ((int) u.u_pcb.pcb_csp); */
-/* OBSOLETE    last_frame_offset = reg_stack_offset + last_frame_address */
-/* OBSOLETE            - CONTROL_STACK_ADDR ; */
-/* OBSOLETE    global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ; */
-/* OBSOLETE  */
-/* OBSOLETE    /* skip any control-stack frames that were executed in the */
-/* OBSOLETE       kernel. *x/ */
-/* OBSOLETE  */
-/* OBSOLETE    while (1) { */
-/* OBSOLETE        char buf[4]; */
-/* OBSOLETE        val = lseek (corechan, last_frame_offset+(47*4), 0); */
-/* OBSOLETE        if (val < 0) */
-/* OBSOLETE                perror_with_name (filename); */
-/* OBSOLETE        val = myread (corechan, buf, sizeof buf); */
-/* OBSOLETE        if (val < 0) */
-/* OBSOLETE                perror_with_name (filename); */
-/* OBSOLETE  */
-/* OBSOLETE        if (*(int *)buf >= 0) */
-/* OBSOLETE                break; */
-/* OBSOLETE        printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address)); */
-/* OBSOLETE        last_frame_offset -= CONTROL_STACK_FRAME_SIZE; */
-/* OBSOLETE        last_frame_address -= CONTROL_STACK_FRAME_SIZE; */
-/* OBSOLETE    } */
-/* OBSOLETE    reg_offset = last_frame_offset; */
+/* OBSOLETE     stack_start = stack_end - NBPG * u.u_ussize; */
+/* OBSOLETE     reg_stack_offset = stack_offset + (NBPG *u.u_ussize); */
+/* OBSOLETE     reg_stack_end = reg_stack_start + NBPG * u.u_cssize; */
+/* OBSOLETE  */
+/* OBSOLETE     last_frame_address = ((int) u.u_pcb.pcb_csp); */
+/* OBSOLETE     last_frame_offset = reg_stack_offset + last_frame_address */
+/* OBSOLETE             - CONTROL_STACK_ADDR ; */
+/* OBSOLETE     global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ; */
+/* OBSOLETE  */
+/* OBSOLETE     /* skip any control-stack frames that were executed in the */
+/* OBSOLETE        kernel. *x/ */
+/* OBSOLETE  */
+/* OBSOLETE     while (1) { */
+/* OBSOLETE         char buf[4]; */
+/* OBSOLETE         val = lseek (corechan, last_frame_offset+(47*4), 0); */
+/* OBSOLETE         if (val < 0) */
+/* OBSOLETE                 perror_with_name (filename); */
+/* OBSOLETE         val = myread (corechan, buf, sizeof buf); */
+/* OBSOLETE         if (val < 0) */
+/* OBSOLETE                 perror_with_name (filename); */
+/* OBSOLETE  */
+/* OBSOLETE         if (*(int *)buf >= 0) */
+/* OBSOLETE                 break; */
+/* OBSOLETE         printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address)); */
+/* OBSOLETE         last_frame_offset -= CONTROL_STACK_FRAME_SIZE; */
+/* OBSOLETE         last_frame_address -= CONTROL_STACK_FRAME_SIZE; */
+/* OBSOLETE     } */
+/* OBSOLETE     reg_offset = last_frame_offset; */
 /* OBSOLETE  */
 /* OBSOLETE #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */
-/* OBSOLETE    printf_unfiltered ("Control stack pointer = %s\n", */
-/* OBSOLETE            local_hex_string (u.u_pcb.pcb_csp)); */
-/* OBSOLETE    printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n", */
-/* OBSOLETE          reg_stack_offset, reg_offset, local_hex_string (last_frame_address)); */
+/* OBSOLETE     printf_unfiltered ("Control stack pointer = %s\n", */
+/* OBSOLETE             local_hex_string (u.u_pcb.pcb_csp)); */
+/* OBSOLETE     printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n", */
+/* OBSOLETE           reg_stack_offset, reg_offset, local_hex_string (last_frame_address)); */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #else /* not PYRAMID_CORE *x/ */
-/* OBSOLETE    stack_start = stack_end - NBPG * u.u_ssize; */
+/* OBSOLETE     stack_start = stack_end - NBPG * u.u_ssize; */
 /* OBSOLETE         reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; */
 /* OBSOLETE #endif /* not PYRAMID_CORE *x/ */
 /* OBSOLETE  */
 /* OBSOLETE #ifdef __not_on_pyr_yet */
-/* OBSOLETE    /* Some machines put an absolute address in here and some put */
-/* OBSOLETE       the offset in the upage of the regs.  *x/ */
-/* OBSOLETE    reg_offset = (int) u.u_ar0; */
-/* OBSOLETE    if (reg_offset > NBPG * UPAGES) */
-/* OBSOLETE      reg_offset -= KERNEL_U_ADDR; */
+/* OBSOLETE     /* Some machines put an absolute address in here and some put */
+/* OBSOLETE        the offset in the upage of the regs.  *x/ */
+/* OBSOLETE     reg_offset = (int) u.u_ar0; */
+/* OBSOLETE     if (reg_offset > NBPG * UPAGES) */
+/* OBSOLETE       reg_offset -= KERNEL_U_ADDR; */
 /* OBSOLETE #endif */
 /* OBSOLETE  */
-/* OBSOLETE    /* I don't know where to find this info. */
-/* OBSOLETE       So, for now, mark it as not available.  *x/ */
-/* OBSOLETE    N_SET_MAGIC (core_aouthdr, 0); */
-/* OBSOLETE  */
-/* OBSOLETE    /* Read the register values out of the core file and store */
-/* OBSOLETE       them where `read_register' will find them.  *x/ */
-/* OBSOLETE  */
-/* OBSOLETE    { */
-/* OBSOLETE      register int regno; */
-/* OBSOLETE  */
-/* OBSOLETE      for (regno = 0; regno < 64; regno++) */
-/* OBSOLETE        { */
-/* OBSOLETE          char buf[MAX_REGISTER_RAW_SIZE]; */
-/* OBSOLETE  */
-/* OBSOLETE          val = lseek (corechan, register_addr (regno, reg_offset), 0); */
-/* OBSOLETE          if (val < 0 */
-/* OBSOLETE              || (val = myread (corechan, buf, sizeof buf)) < 0) */
-/* OBSOLETE            { */
-/* OBSOLETE              char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
-/* OBSOLETE                                               + 30); */
-/* OBSOLETE              strcpy (buffer, "Reading register "); */
-/* OBSOLETE              strcat (buffer, REGISTER_NAME (regno)); */
-/* OBSOLETE                                                */
-/* OBSOLETE              perror_with_name (buffer); */
-/* OBSOLETE            } */
-/* OBSOLETE  */
-/* OBSOLETE          if (val < 0) */
-/* OBSOLETE            perror_with_name (filename); */
+/* OBSOLETE     /* I don't know where to find this info. */
+/* OBSOLETE        So, for now, mark it as not available.  *x/ */
+/* OBSOLETE     N_SET_MAGIC (core_aouthdr, 0); */
+/* OBSOLETE  */
+/* OBSOLETE     /* Read the register values out of the core file and store */
+/* OBSOLETE        them where `read_register' will find them.  *x/ */
+/* OBSOLETE  */
+/* OBSOLETE     { */
+/* OBSOLETE       register int regno; */
+/* OBSOLETE  */
+/* OBSOLETE       for (regno = 0; regno < 64; regno++) */
+/* OBSOLETE         { */
+/* OBSOLETE           char buf[MAX_REGISTER_RAW_SIZE]; */
+/* OBSOLETE  */
+/* OBSOLETE           val = lseek (corechan, register_addr (regno, reg_offset), 0); */
+/* OBSOLETE           if (val < 0 */
+/* OBSOLETE               || (val = myread (corechan, buf, sizeof buf)) < 0) */
+/* OBSOLETE             { */
+/* OBSOLETE               char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
+/* OBSOLETE                                                + 30); */
+/* OBSOLETE               strcpy (buffer, "Reading register "); */
+/* OBSOLETE               strcat (buffer, REGISTER_NAME (regno)); */
+/* OBSOLETE                                                 */
+/* OBSOLETE               perror_with_name (buffer); */
+/* OBSOLETE             } */
+/* OBSOLETE  */
+/* OBSOLETE           if (val < 0) */
+/* OBSOLETE             perror_with_name (filename); */
 /* OBSOLETE #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING */
 /* OBSOLETE       printf_unfiltered ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n", */
-/* OBSOLETE          REGISTER_NAME (regno), regno, filename, */
-/* OBSOLETE          register_addr(regno, reg_offset), */
-/* OBSOLETE          regno * 4 + last_frame_address, */
-/* OBSOLETE          *((int *)buf)); */
+/* OBSOLETE           REGISTER_NAME (regno), regno, filename, */
+/* OBSOLETE           register_addr(regno, reg_offset), */
+/* OBSOLETE           regno * 4 + last_frame_address, */
+/* OBSOLETE           *((int *)buf)); */
 /* OBSOLETE #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING *x/ */
-/* OBSOLETE          supply_register (regno, buf); */
-/* OBSOLETE        } */
-/* OBSOLETE    } */
+/* OBSOLETE           supply_register (regno, buf); */
+/* OBSOLETE         } */
+/* OBSOLETE     } */
 /* OBSOLETE       } */
 /* OBSOLETE       if (filename[0] == '/') */
-/* OBSOLETE    corefile = savestring (filename, strlen (filename)); */
+/* OBSOLETE     corefile = savestring (filename, strlen (filename)); */
 /* OBSOLETE       else */
-/* OBSOLETE    { */
-/* OBSOLETE      corefile = concat (current_directory, "/", filename, NULL); */
-/* OBSOLETE    } */
+/* OBSOLETE     { */
+/* OBSOLETE       corefile = concat (current_directory, "/", filename, NULL); */
+/* OBSOLETE     } */
 /* OBSOLETE  */
 /* OBSOLETE #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING) */
 /* OBSOLETE       printf_unfiltered ("Providing CSP (%s) as nominal address of current frame.\n", */
-/* OBSOLETE          local_hex_string(last_frame_address)); */
+/* OBSOLETE           local_hex_string(last_frame_address)); */
 /* OBSOLETE #endif PYRAMID_CONTROL_FRAME_DEBUGGING */
 /* OBSOLETE       /* FIXME: Which of the following is correct? *x/ */
 /* OBSOLETE #if 0 */
 /* OBSOLETE       set_current_frame ( create_new_frame (read_register (FP_REGNUM), */
-/* OBSOLETE                                        read_pc ())); */
+/* OBSOLETE                                         read_pc ())); */
 /* OBSOLETE #else */
 /* OBSOLETE       set_current_frame ( create_new_frame (last_frame_address, */
-/* OBSOLETE                                        read_pc ())); */
+/* OBSOLETE                                         read_pc ())); */
 /* OBSOLETE #endif */
 /* OBSOLETE  */
 /* OBSOLETE       select_frame (get_current_frame (), 0); */
index b22f180885cc4c9ecda3928a64a660a490624694..b8b3edb56fee5db11a8b5dc9875733ad6e32f8c6 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by David Wood at New York University (wood@lab.ultra.nyu.edu).
    Adapted from work done at Cygnus Support in remote-eb.c.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is like remote.c but is for an esoteric situation--
    having a 29k board attached to an Adapt inline monitor. 
@@ -25,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    running gdb. 
 
    3/91 -  developed on Sun3 OS 4.1, by David Wood
-       o - I can't get binary coff to load. 
-       o - I can't get 19200 baud rate to work. 
+   o - I can't get binary coff to load. 
+   o - I can't get 19200 baud rate to work. 
    7/91 o - Freeze mode tracing can be done on a 29050.  */
 
 
@@ -47,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* This processor is getting rusty but I am trying to keep it
    up to date at least with data structure changes.
    Activate this block to compile just this file.
  */
+ */
 #define COMPILE_CHECK 0
 #if COMPILE_CHECK
 #define Q_REGNUM 0
@@ -73,24 +74,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define TERMINAL int
 #define RAW 1
 #define ANYP 1
-extern int a29k_freeze_mode ;
-extern int processor_type ;
-extern char * processor_name ;
+extern int a29k_freeze_mode;
+extern int processor_type;
+extern char *processor_name;
 #endif
 
 /* External data declarations */
-extern int stop_soon_quietly;           /* for wait_for_inferior */
+extern int stop_soon_quietly;  /* for wait_for_inferior */
 
 /* Forward data declarations */
-extern struct target_ops adapt_ops;            /* Forward declaration */
+extern struct target_ops adapt_ops;    /* Forward declaration */
 
 /* Forward function declarations */
 static void adapt_fetch_registers ();
 static void adapt_store_registers ();
 static void adapt_close ();
-static int  adapt_clear_breakpoints();
+static int adapt_clear_breakpoints ();
 
-#define FREEZE_MODE    (read_register(CPS_REGNUM) && 0x400) 
+#define FREEZE_MODE    (read_register(CPS_REGNUM) && 0x400)
 #define USE_SHADOW_PC  ((processor_type == a29k_freeze_mode) && FREEZE_MODE)
 
 /* Can't seem to get binary coff working */
@@ -99,7 +100,7 @@ static int  adapt_clear_breakpoints();
 /* FIXME: Replace with `set remotedebug'.  */
 #define LOG_FILE "adapt.log"
 #if defined (LOG_FILE)
-FILE *log_file=NULL;
+FILE *log_file = NULL;
 #endif
 
 static int timeout = 5;
@@ -117,11 +118,11 @@ FILE *adapt_stream;
 #define ON     1
 #define OFF    0
 static void
-rawmode(desc, turnon)
-int    desc;
-int    turnon;
+rawmode (desc, turnon)
+     int desc;
+     int turnon;
 {
-  
+
   TERMINAL sg;
 
   if (desc < 0)
@@ -129,24 +130,27 @@ int       turnon;
 
   ioctl (desc, TIOCGETP, &sg);
 
-  if (turnon) {
+  if (turnon)
+    {
 #ifdef HAVE_TERMIO
-       sg.c_lflag &= ~(ICANON);
+      sg.c_lflag &= ~(ICANON);
 #else
-       sg.sg_flags |= RAW;
+      sg.sg_flags |= RAW;
 #endif
-  } else {
+    }
+  else
+    {
 #ifdef HAVE_TERMIO
-       sg.c_lflag |= ICANON;
+      sg.c_lflag |= ICANON;
 #else
-       sg.sg_flags &= ~(RAW);
+      sg.sg_flags &= ~(RAW);
 #endif
-  }
+    }
   ioctl (desc, TIOCSETP, &sg);
 }
 
 /* Suck up all the input from the adapt */
-slurp_input()
+slurp_input ()
 {
   char buf[8];
 
@@ -199,11 +203,11 @@ expect (string)
 {
   char *p = string;
 
-  fflush(adapt_stream);
+  fflush (adapt_stream);
   immediate_quit = 1;
   while (1)
     {
-      if (readchar() == *p)
+      if (readchar () == *p)
        {
          p++;
          if (*p == '\0')
@@ -239,7 +243,7 @@ expect_prompt ()
      enough that we never lose much data if we terminate abnormally.  */
   fflush (log_file);
 #endif
-  fflush(adapt_stream);
+  fflush (adapt_stream);
   expect ("\n# ");
 }
 
@@ -283,15 +287,15 @@ get_hex_byte (byt)
 }
 
 /* Read a 32-bit hex word from the adapt, preceded by a space  */
-static long 
-get_hex_word()
+static long
+get_hex_word ()
 {
   long val;
   int j;
-      
+
   val = 0;
   for (j = 0; j < 8; j++)
-       val = (val << 4) + get_hex_digit (j == 0);
+    val = (val << 4) + get_hex_digit (j == 0);
   return val;
 }
 /* Get N 32-bit hex words from remote, each preceded by a space 
@@ -301,18 +305,20 @@ get_hex_regs (n, regno)
      int n;
      int regno;
 {
-       long val;
-       while (n--) {
-               val = get_hex_word();
-               supply_register(regno++,(char *) &val);
-       }
+  long val;
+  while (n--)
+    {
+      val = get_hex_word ();
+      supply_register (regno++, (char *) &val);
+    }
 }
 /* Called when SIGALRM signal sent due to alarm() timeout.  */
 #ifndef HAVE_TERMIO
 
 #ifndef __STDC__
-# ifndef volatile
-#  define volatile /**/
+#ifndef volatile
+#define volatile
+/**/
 # endif
 #endif
 volatile int n_alarms;
@@ -338,66 +344,86 @@ static char *prog_name = NULL;
 static int need_artificial_trap = 0;
 
 void
-adapt_kill(arg,from_tty)
-char   *arg;
-int    from_tty;
+adapt_kill (arg, from_tty)
+     char *arg;
+     int from_tty;
 {
-       fprintf (adapt_stream, "K");
-       fprintf (adapt_stream, "\r");
-       expect_prompt ();
+  fprintf (adapt_stream, "K");
+  fprintf (adapt_stream, "\r");
+  expect_prompt ();
 }
 /*
  * Download a file specified in 'args', to the adapt. 
  * FIXME: Assumes the file to download is a binary coff file.
  */
 static void
-adapt_load(args,fromtty)
-char   *args;
-int    fromtty;
+adapt_load (args, fromtty)
+     char *args;
+     int fromtty;
 {
-       FILE *fp;
-       int     n;
-       char    buffer[1024];
-       
-       if (!adapt_stream) {
-               printf_filtered("Adapt not open. Use 'target' command to open adapt\n");
-               return;
-       }
+  FILE *fp;
+  int n;
+  char buffer[1024];
 
-       /* OK, now read in the file.  Y=read, C=COFF, T=dTe port
-               0=start address.  */
-
-#ifdef ASCII_COFF      /* Ascii coff */
-       fprintf (adapt_stream, "YA T,0\r");
-       fflush(adapt_stream);   /* Just in case */
-       /* FIXME: should check args for only 1 argument */
-       sprintf(buffer,"cat %s | btoa > /tmp/#adapt-btoa",args);
-       system(buffer);
-       fp = fopen("/tmp/#adapt-btoa","r");
-       rawmode(adapt_desc,OFF);        
-       while (n=fread(buffer,1,1024,fp)) {
-               do { n -= write(adapt_desc,buffer,n); } while (n>0);
-               if (n<0) { perror("writing ascii coff"); break; }
+  if (!adapt_stream)
+    {
+      printf_filtered ("Adapt not open. Use 'target' command to open adapt\n");
+      return;
+    }
+
+  /* OK, now read in the file.  Y=read, C=COFF, T=dTe port
+     0=start address.  */
+
+#ifdef ASCII_COFF              /* Ascii coff */
+  fprintf (adapt_stream, "YA T,0\r");
+  fflush (adapt_stream);       /* Just in case */
+  /* FIXME: should check args for only 1 argument */
+  sprintf (buffer, "cat %s | btoa > /tmp/#adapt-btoa", args);
+  system (buffer);
+  fp = fopen ("/tmp/#adapt-btoa", "r");
+  rawmode (adapt_desc, OFF);
+  while (n = fread (buffer, 1, 1024, fp))
+    {
+      do
+       {
+         n -= write (adapt_desc, buffer, n);
        }
-       fclose(fp);
-       rawmode(adapt_desc,ON); 
-       system("rm /tmp/#adapt-btoa");
-#else  /* Binary coff - can't get it to work .*/
-       fprintf (adapt_stream, "YC T,0\r");
-       fflush(adapt_stream);   /* Just in case */
-       if (!(fp = fopen(args,"r"))) {
-               printf_filtered("Can't open %s\n",args);
-               return;
+      while (n > 0);
+      if (n < 0)
+       {
+         perror ("writing ascii coff");
+         break;
        }
-       while (n=fread(buffer,1,512,fp)) {
-               do { n -= write(adapt_desc,buffer,n); } while (n>0);
-               if (n<0) { perror("writing ascii coff"); break; }
+    }
+  fclose (fp);
+  rawmode (adapt_desc, ON);
+  system ("rm /tmp/#adapt-btoa");
+#else /* Binary coff - can't get it to work . */
+  fprintf (adapt_stream, "YC T,0\r");
+  fflush (adapt_stream);       /* Just in case */
+  if (!(fp = fopen (args, "r")))
+    {
+      printf_filtered ("Can't open %s\n", args);
+      return;
+    }
+  while (n = fread (buffer, 1, 512, fp))
+    {
+      do
+       {
+         n -= write (adapt_desc, buffer, n);
        }
-       fclose(fp);
+      while (n > 0);
+      if (n < 0)
+       {
+         perror ("writing ascii coff");
+         break;
+       }
+    }
+  fclose (fp);
 #endif
-       expect_prompt ();       /* Skip garbage that comes out */
-       fprintf (adapt_stream, "\r");
-       expect_prompt ();
+  expect_prompt ();            /* Skip garbage that comes out */
+  fprintf (adapt_stream, "\r");
+  expect_prompt ();
 }
 
 /* This is called not only when we first attach, but also when the
@@ -418,38 +444,42 @@ adapt_create_inferior (execfile, args, env)
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
-  if (adapt_stream) {
-       adapt_kill(NULL,NULL);   
-       adapt_clear_breakpoints();
-       init_wait_for_inferior ();
-       /* Clear the input because what the adapt sends back is different
-        * depending on whether it was running or not.
-        */
-       slurp_input();  /* After this there should be a prompt */
-       fprintf(adapt_stream,"\r"); 
-       expect_prompt();
-       printf_filtered("Do you want to download '%s' (y/n)? [y] : ",prog_name);
-       {       
-               char buffer[10];
-               gets(buffer);
-               if (*buffer != 'n') {
-                       adapt_load(prog_name,0);
-               }
-       }
+  if (adapt_stream)
+    {
+      adapt_kill (NULL, NULL);
+      adapt_clear_breakpoints ();
+      init_wait_for_inferior ();
+      /* Clear the input because what the adapt sends back is different
+       * depending on whether it was running or not.
+       */
+      slurp_input ();          /* After this there should be a prompt */
+      fprintf (adapt_stream, "\r");
+      expect_prompt ();
+      printf_filtered ("Do you want to download '%s' (y/n)? [y] : ", prog_name);
+      {
+       char buffer[10];
+       gets (buffer);
+       if (*buffer != 'n')
+         {
+           adapt_load (prog_name, 0);
+         }
+      }
 
 #ifdef NOTDEF
-       /* Set the PC and wait for a go/cont */
-         fprintf (adapt_stream, "G %x,N\r",entry_pt);
-         printf_filtered("Now use the 'continue' command to start.\n"); 
-         expect_prompt ();
+      /* Set the PC and wait for a go/cont */
+      fprintf (adapt_stream, "G %x,N\r", entry_pt);
+      printf_filtered ("Now use the 'continue' command to start.\n");
+      expect_prompt ();
 #else
-       insert_breakpoints ();  /* Needed to get correct instruction in cache */
-       proceed(entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+      insert_breakpoints ();   /* Needed to get correct instruction in cache */
+      proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 #endif
 
-  } else {
-       printf_filtered("Adapt not open yet.\n");
-  }
+    }
+  else
+    {
+      printf_filtered ("Adapt not open yet.\n");
+    }
 }
 
 /* Translate baud rates from integers to damn B_codes.  Unix should
@@ -462,34 +492,92 @@ adapt_create_inferior (execfile, args, env)
 #define B38400 EXTB
 #endif
 
-static struct {int rate, damn_b;} baudtab[] = {
-       {0, B0},
-       {50, B50},
-       {75, B75},
-       {110, B110},
-       {134, B134},
-       {150, B150},
-       {200, B200},
-       {300, B300},
-       {600, B600},
-       {1200, B1200},
-       {1800, B1800},
-       {2400, B2400},
-       {4800, B4800},
-       {9600, B9600},
-       {19200, B19200},
-       {38400, B38400},
-       {-1, -1},
+static struct
+{
+  int rate, damn_b;
+}
+baudtab[] =
+{
+  {
+    0, B0
+  }
+  ,
+  {
+    50, B50
+  }
+  ,
+  {
+    75, B75
+  }
+  ,
+  {
+    110, B110
+  }
+  ,
+  {
+    134, B134
+  }
+  ,
+  {
+    150, B150
+  }
+  ,
+  {
+    200, B200
+  }
+  ,
+  {
+    300, B300
+  }
+  ,
+  {
+    600, B600
+  }
+  ,
+  {
+    1200, B1200
+  }
+  ,
+  {
+    1800, B1800
+  }
+  ,
+  {
+    2400, B2400
+  }
+  ,
+  {
+    4800, B4800
+  }
+  ,
+  {
+    9600, B9600
+  }
+  ,
+  {
+    19200, B19200
+  }
+  ,
+  {
+    38400, B38400
+  }
+  ,
+  {
+    -1, -1
+  }
+  ,
 };
 
-static int damn_b (rate)
+static int
+damn_b (rate)
      int rate;
 {
   int i;
 
   for (i = 0; baudtab[i].rate != -1; i++)
-    if (rate == baudtab[i].rate) return baudtab[i].damn_b;
-  return B38400;       /* Random */
+    if (rate == baudtab[i].rate)
+      return baudtab[i].damn_b;
+  return B38400;               /* Random */
 }
 
 
@@ -517,27 +605,27 @@ adapt_open (name, from_tty)
        *p != '\0' && !isspace (*p); p++)
     ;
   if (*p == '\0')
-erroid:
+  erroid:
     error ("\
 Please include the name of the device for the serial port,\n\
 the baud rate, and the name of the program to run on the remote system.");
-  dev_name = (char*)xmalloc(p - name + 1);
+  dev_name = (char *) xmalloc (p - name + 1);
   strncpy (dev_name, name, p - name);
   dev_name[p - name] = '\0';
 
   /* Skip over the whitespace after dev_name */
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (1 != sscanf (p, "%d ", &baudrate))
     goto erroid;
 
   /* Skip the number and then the spaces */
   for (; isdigit (*p); p++)
-    /*EMPTY*/;
+    /*EMPTY */ ;
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (prog_name != NULL)
     free (prog_name);
   prog_name = savestring (p, strlen (p));
@@ -548,7 +636,7 @@ the baud rate, and the name of the program to run on the remote system.");
   if (adapt_desc < 0)
     perror_with_name (dev_name);
   ioctl (adapt_desc, TIOCGETP, &sg);
-#if ! defined(COMPILE_CHECK) 
+#if ! defined(COMPILE_CHECK)
 #ifdef HAVE_TERMIO
   sg.c_cc[VMIN] = 0;           /* read with timeout.  */
   sg.c_cc[VTIME] = timeout * 10;
@@ -586,27 +674,28 @@ the baud rate, and the name of the program to run on the remote system.");
 #endif
 
   /* Put this port into NORMAL mode, send the 'normal' character */
-  write(adapt_desc, "\ 1", 1);   /* Control A */
-  write(adapt_desc, "\r", 1);  
+  write (adapt_desc, "\ 1", 1);  /* Control A */
+  write (adapt_desc, "\r", 1);
   expect_prompt ();
-  
+
   /* Hello?  Are you there?  */
   write (adapt_desc, "\r", 1);
+
   expect_prompt ();
 
   /* Clear any break points */
-  adapt_clear_breakpoints();
+  adapt_clear_breakpoints ();
 
   /* Print out some stuff, letting the user now what's going on */
-  printf_filtered("Connected to an Adapt via %s.\n", dev_name);
-    /* FIXME: can this restriction be removed? */
-  printf_filtered("Remote debugging using virtual addresses works only\n");
-  printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n"); 
-  if (processor_type != a29k_freeze_mode) {
-       fprintf_filtered(gdb_stderr,
-       "Freeze-mode debugging not available, and can only be done on an A29050.\n");
-  }
+  printf_filtered ("Connected to an Adapt via %s.\n", dev_name);
+  /* FIXME: can this restriction be removed? */
+  printf_filtered ("Remote debugging using virtual addresses works only\n");
+  printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n");
+  if (processor_type != a29k_freeze_mode)
+    {
+      fprintf_filtered (gdb_stderr,
+                       "Freeze-mode debugging not available, and can only be done on an A29050.\n");
+    }
 }
 
 /* Close out all files and local state before this target loses control. */
@@ -617,14 +706,15 @@ adapt_close (quitting)
 {
 
   /* Clear any break points */
-  adapt_clear_breakpoints();
+  adapt_clear_breakpoints ();
 
-  /* Put this port back into REMOTE mode */ 
-  if (adapt_stream) {
-     fflush(adapt_stream);
-     sleep(1);         /* Let any output make it all the way back */
-     write(adapt_desc, "R\r", 2);
-  }
+  /* Put this port back into REMOTE mode */
+  if (adapt_stream)
+    {
+      fflush (adapt_stream);
+      sleep (1);               /* Let any output make it all the way back */
+      write (adapt_desc, "R\r", 2);
+    }
 
   /* Due to a bug in Unix, fclose closes not only the stdio stream,
      but also the file descriptor.  So we don't actually close
@@ -634,18 +724,19 @@ adapt_close (quitting)
   if (adapt_desc >= 0)
     /* close (adapt_desc); */
 
-  /* Do not try to close adapt_desc again, later in the program.  */
-  adapt_stream = NULL;
+    /* Do not try to close adapt_desc again, later in the program.  */
+    adapt_stream = NULL;
   adapt_desc = -1;
 
 #if defined (LOG_FILE)
-  if (log_file) {
-    if (ferror (log_file))
-      printf_filtered ("Error writing log file.\n");
-    if (fclose (log_file) != 0)
-      printf_filtered ("Error closing log file.\n");
-    log_file = NULL;
-  }
+  if (log_file)
+    {
+      if (ferror (log_file))
+       printf_filtered ("Error writing log file.\n");
+      if (fclose (log_file) != 0)
+       printf_filtered ("Error closing log file.\n");
+      log_file = NULL;
+    }
 #endif
 }
 
@@ -657,11 +748,12 @@ adapt_attach (args, from_tty)
 {
 
   if (from_tty)
-      printf_filtered ("Attaching to remote program %s.\n", prog_name);
+    printf_filtered ("Attaching to remote program %s.\n", prog_name);
 
   /* Send the adapt a kill. It is ok if it is not already running */
-  fprintf(adapt_stream, "K\r"); fflush(adapt_stream);
-  expect_prompt();             /* Slurp the echo */
+  fprintf (adapt_stream, "K\r");
+  fflush (adapt_stream);
+  expect_prompt ();            /* Slurp the echo */
 }
 
 
@@ -669,21 +761,22 @@ adapt_attach (args, from_tty)
    Use this when you want to detach and do something else
    with your gdb.  */
 void
-adapt_detach (args,from_tty)
+adapt_detach (args, from_tty)
      char *args;
      int from_tty;
 {
 
-  if (adapt_stream) { /* Send it on its way (tell it to continue)  */
-       adapt_clear_breakpoints();
-       fprintf(adapt_stream,"G\r");
-  }
-  pop_target();                /* calls adapt_close to do the real work */
+  if (adapt_stream)
+    {                          /* Send it on its way (tell it to continue)  */
+      adapt_clear_breakpoints ();
+      fprintf (adapt_stream, "G\r");
+    }
+
+  pop_target ();               /* calls adapt_close to do the real work */
   if (from_tty)
     printf_filtered ("Ending remote %s debugging\n", target_shortname);
 }
+
 /* Tell the remote machine to resume.  */
 
 void
@@ -691,7 +784,7 @@ adapt_resume (pid, step, sig)
      int pid, step;
      enum target_signal sig;
 {
-  if (step)    
+  if (step)
     {
       write (adapt_desc, "t 1,s\r", 6);
       /* Wait for the echo.  */
@@ -710,7 +803,7 @@ adapt_resume (pid, step, sig)
     {
       write (adapt_desc, "G\r", 2);
       /* Swallow the echo.  */
-      expect_prompt(); 
+      expect_prompt ();
     }
 }
 
@@ -725,7 +818,7 @@ adapt_wait (status)
      Note that with the algorithm we use, the initial character
      of the string cannot recur in the string, or we will not
      find some cases of the string in the input.  */
-  
+
   static char bpt[] = "@";
   /* It would be tempting to look for "\n[__exit + 0x8]\n"
      but that requires loading symbols with "yc i" and even if
@@ -755,22 +848,26 @@ adapt_wait (status)
       return 0;
     }
 
-  timeout = 0;         /* Don't time out -- user program is running. */
-  immediate_quit = 1;  /* Helps ability to QUIT */
-  while (1) {
-      QUIT;            /* Let user quit and leave process running */
+  timeout = 0;                 /* Don't time out -- user program is running. */
+  immediate_quit = 1;          /* Helps ability to QUIT */
+  while (1)
+    {
+      QUIT;                    /* Let user quit and leave process running */
       ch_handled = 0;
       ch = readchar ();
-      if (ch == *bp) {
+      if (ch == *bp)
+       {
          bp++;
          if (*bp == '\0')
            break;
          ch_handled = 1;
 
          *swallowed_p++ = ch;
-      } else
+       }
+      else
        bp = bpt;
-      if (ch == *ep || *ep == '?') {
+      if (ch == *ep || *ep == '?')
+       {
          ep++;
          if (*ep == '\0')
            break;
@@ -778,19 +875,21 @@ adapt_wait (status)
          if (!ch_handled)
            *swallowed_p++ = ch;
          ch_handled = 1;
-      } else
+       }
+      else
        ep = exitmsg;
-      if (!ch_handled) {
+      if (!ch_handled)
+       {
          char *p;
          /* Print out any characters which have been swallowed.  */
          for (p = swallowed; p < swallowed_p; ++p)
            putc (*p, stdout);
          swallowed_p = swallowed;
          putc (ch, stdout);
-      }
-  }
+       }
+    }
   expect_prompt ();
-  if (*bp== '\0')
+  if (*bp == '\0')
     {
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
@@ -814,15 +913,15 @@ get_reg_name (regno)
      int regno;
 {
   static char buf[80];
-  if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32 )
+  if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
     sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96);
 #if defined(GR64_REGNUM)
-  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
+  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32)
     sprintf (buf, "GR%03d", regno - GR64_REGNUM + 64);
 #endif
   else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
     sprintf (buf, "LR%03d", regno - LR0_REGNUM);
-  else if (regno == Q_REGNUM) 
+  else if (regno == Q_REGNUM)
     strcpy (buf, "SR131");
   else if (regno >= BP_REGNUM && regno <= CR_REGNUM)
     sprintf (buf, "SR%03d", regno - BP_REGNUM + 133);
@@ -830,13 +929,14 @@ get_reg_name (regno)
     strcpy (buf, "SR132");
   else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM)
     sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128);
-  else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) {
-    /* When a 29050 is in freeze-mode, read shadow pcs instead */
-    if ((regno >= NPC_REGNUM && regno <= PC2_REGNUM) && USE_SHADOW_PC)
-       sprintf (buf, "SR%03d", regno - NPC_REGNUM + 20);
-    else
-       sprintf (buf, "SR%03d", regno - VAB_REGNUM);
-  }
+  else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM)
+    {
+      /* When a 29050 is in freeze-mode, read shadow pcs instead */
+      if ((regno >= NPC_REGNUM && regno <= PC2_REGNUM) && USE_SHADOW_PC)
+       sprintf (buf, "SR%03d", regno - NPC_REGNUM + 20);
+      else
+       sprintf (buf, "SR%03d", regno - VAB_REGNUM);
+    }
   else if (regno == GR1_REGNUM)
     strcpy (buf, "GR001");
   return buf;
@@ -850,8 +950,8 @@ adapt_fetch_registers ()
   int reg_index;
   int regnum_index;
   char tempbuf[10];
-  int  sreg_buf[16];
-  int i,j;
+  int sreg_buf[16];
+  int i, j;
 
 /* 
  * Global registers
@@ -885,7 +985,7 @@ adapt_fetch_registers ()
   for (i = 0; i < 128; i += 32)
     {
       /* The PC has a tendency to hang if we get these
-        all in one fell swoop ("dw lr0,lr127").  */
+         all in one fell swoop ("dw lr0,lr127").  */
       sprintf (tempbuf, "dw lr%d\r", i);
       write (adapt_desc, tempbuf, strlen (tempbuf));
       for (reg_index = i, regnum_index = LR0_REGNUM + i;
@@ -904,42 +1004,45 @@ adapt_fetch_registers ()
  */
   sprintf (tempbuf, "dw sr0\r");
   write (adapt_desc, tempbuf, strlen (tempbuf));
-  for (i=0 ; i<4 ; i++) {                      /* SR0 - SR14 */
-        sprintf (tempbuf, "SR%3d",i*4);
-       expect(tempbuf);
-       for (j=0 ; j < (i==3 ? 3 : 4) ; j++)
-               sreg_buf[i*4 + j] = get_hex_word();
-  }            
-  expect_prompt();
+  for (i = 0; i < 4; i++)
+    {                          /* SR0 - SR14 */
+      sprintf (tempbuf, "SR%3d", i * 4);
+      expect (tempbuf);
+      for (j = 0; j < (i == 3 ? 3 : 4); j++)
+       sreg_buf[i * 4 + j] = get_hex_word ();
+    }
+  expect_prompt ();
   /* 
    * Read the pcs individually if we are in freeze mode.
    * See get_reg_name(), it translates the register names for the pcs to
    * the names of the shadow pcs.
-   */ 
-  if (USE_SHADOW_PC)  {
-         sreg_buf[10] = read_register(NPC_REGNUM);     /* pc0 */
-         sreg_buf[11] = read_register(PC_REGNUM);      /* pc1 */
-         sreg_buf[12] = read_register(PC2_REGNUM);     /* pc2 */
-  }
-  for (i=0 ; i<14 ; i++)               /* Supply vab -> lru */
-       supply_register(VAB_REGNUM+i, (char *) &sreg_buf[i]);
+   */
+  if (USE_SHADOW_PC)
+    {
+      sreg_buf[10] = read_register (NPC_REGNUM);       /* pc0 */
+      sreg_buf[11] = read_register (PC_REGNUM);                /* pc1 */
+      sreg_buf[12] = read_register (PC2_REGNUM);       /* pc2 */
+    }
+  for (i = 0; i < 14; i++)     /* Supply vab -> lru */
+    supply_register (VAB_REGNUM + i, (char *) &sreg_buf[i]);
   sprintf (tempbuf, "dw sr128\r");
   write (adapt_desc, tempbuf, strlen (tempbuf));
-  for (i=0 ; i<2 ; i++) {                      /* SR128 - SR135 */
-        sprintf (tempbuf, "SR%3d",128 + i*4);
-       expect(tempbuf);
-       for (j=0 ; j<4 ; j++)
-               sreg_buf[i*4 + j] = get_hex_word();
-  }            
-  expect_prompt();
-  supply_register(IPC_REGNUM,(char *) &sreg_buf[0]);
-  supply_register(IPA_REGNUM,(char *) &sreg_buf[1]);
-  supply_register(IPB_REGNUM,(char *) &sreg_buf[2]);
-  supply_register(Q_REGNUM,  (char *) &sreg_buf[3]);
-               /* Skip ALU */
-  supply_register(BP_REGNUM, (char *) &sreg_buf[5]);
-  supply_register(FC_REGNUM, (char *) &sreg_buf[6]);
-  supply_register(CR_REGNUM, (char *) &sreg_buf[7]);
+  for (i = 0; i < 2; i++)
+    {                          /* SR128 - SR135 */
+      sprintf (tempbuf, "SR%3d", 128 + i * 4);
+      expect (tempbuf);
+      for (j = 0; j < 4; j++)
+       sreg_buf[i * 4 + j] = get_hex_word ();
+    }
+  expect_prompt ();
+  supply_register (IPC_REGNUM, (char *) &sreg_buf[0]);
+  supply_register (IPA_REGNUM, (char *) &sreg_buf[1]);
+  supply_register (IPB_REGNUM, (char *) &sreg_buf[2]);
+  supply_register (Q_REGNUM, (char *) &sreg_buf[3]);
+  /* Skip ALU */
+  supply_register (BP_REGNUM, (char *) &sreg_buf[5]);
+  supply_register (FC_REGNUM, (char *) &sreg_buf[6]);
+  supply_register (CR_REGNUM, (char *) &sreg_buf[7]);
 
   /* There doesn't seem to be any way to get these.  */
   {
@@ -989,7 +1092,7 @@ adapt_store_registers ()
   for (j = 0; j < 32; j += 16)
     {
       fprintf (adapt_stream, "s gr%d,", j + 64);
-      for (i = 0; i < 15; ++i) 
+      for (i = 0; i < 15; ++i)
        fprintf (adapt_stream, "%x,", read_register (GR64_REGNUM + j + i));
       fprintf (adapt_stream, "%x\r", read_register (GR64_REGNUM + j + 15));
       expect_prompt ();
@@ -998,7 +1101,7 @@ adapt_store_registers ()
   for (j = 0; j < 32; j += 16)
     {
       fprintf (adapt_stream, "s gr%d,", j + 96);
-      for (i = 0; i < 15; ++i) 
+      for (i = 0; i < 15; ++i)
        fprintf (adapt_stream, "%x,", read_register (GR96_REGNUM + j + i));
       fprintf (adapt_stream, "%x\r", read_register (GR96_REGNUM + j + 15));
       expect_prompt ();
@@ -1007,7 +1110,7 @@ adapt_store_registers ()
   for (j = 0; j < 128; j += 16)
     {
       fprintf (adapt_stream, "s lr%d,", j);
-      for (i = 0; i < 15; ++i) 
+      for (i = 0; i < 15; ++i)
        fprintf (adapt_stream, "%x,", read_register (LR0_REGNUM + j + i));
       fprintf (adapt_stream, "%x\r", read_register (LR0_REGNUM + j + 15));
       expect_prompt ();
@@ -1022,11 +1125,11 @@ adapt_store_registers ()
   fprintf (adapt_stream, "s sr131,%x\r", read_register (Q_REGNUM));
   expect_prompt ();
   fprintf (adapt_stream, "s sr0,");
-  for (i=0 ; i<7 ; ++i)
+  for (i = 0; i < 7; ++i)
     fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i));
   expect_prompt ();
   fprintf (adapt_stream, "s sr7,");
-  for (i=7; i<14 ; ++i)
+  for (i = 7; i < 14; ++i)
     fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i));
   expect_prompt ();
 }
@@ -1045,11 +1148,11 @@ adapt_store_register (regno)
       char *name = get_reg_name (regno);
       fprintf (adapt_stream, "s %s,%x\r", name, read_register (regno));
       /* Setting GR1 changes the numbers of all the locals, so
-        invalidate the register cache.  Do this *after* calling
-        read_register, because we want read_register to return the
-        value that write_register has just stuffed into the registers
-        array, not the value of the register fetched from the
-        inferior.  */
+         invalidate the register cache.  Do this *after* calling
+         read_register, because we want read_register to return the
+         value that write_register has just stuffed into the registers
+         array, not the value of the register fetched from the
+         inferior.  */
       if (regno == GR1_REGNUM)
        registers_changed ();
       expect_prompt ();
@@ -1068,22 +1171,25 @@ adapt_prepare_to_store ()
   /* Do nothing, since we can store individual regs */
 }
 
-static CORE_ADDR 
-translate_addr(addr)
-CORE_ADDR addr;
+static CORE_ADDR
+translate_addr (addr)
+     CORE_ADDR addr;
 {
 #if defined(KERNEL_DEBUGGING)
-       /* Check for a virtual address in the kernel */
-       /* Assume physical address of ublock is in  paddr_u register */
-       if (addr >= UVADDR) {
-               /* PADDR_U register holds the physical address of the ublock */
-               CORE_ADDR i = (CORE_ADDR)read_register(PADDR_U_REGNUM); 
-               return(i + addr - (CORE_ADDR)UVADDR);
-       } else {
-               return(addr);
-       }
+  /* Check for a virtual address in the kernel */
+  /* Assume physical address of ublock is in  paddr_u register */
+  if (addr >= UVADDR)
+    {
+      /* PADDR_U register holds the physical address of the ublock */
+      CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM);
+      return (i + addr - (CORE_ADDR) UVADDR);
+    }
+  else
+    {
+      return (addr);
+    }
 #else
-       return(addr);
+  return (addr);
 #endif
 }
 
@@ -1097,7 +1203,7 @@ adapt_xfer_inferior_memory (memaddr, myaddr, len, write)
      int write;
 {
 
-  memaddr = translate_addr(memaddr);
+  memaddr = translate_addr (memaddr);
 
   if (write)
     return adapt_write_inferior_memory (memaddr, myaddr, len);
@@ -1108,14 +1214,14 @@ adapt_xfer_inferior_memory (memaddr, myaddr, len, write)
 void
 adapt_files_info ()
 {
-  printf_filtered("\tAttached to %s at %d baud and running program %s\n",
-         dev_name, baudrate, prog_name);
-  printf_filtered("\ton an %s processor.\n", processor_name[processor_type]);
+  printf_filtered ("\tAttached to %s at %d baud and running program %s\n",
+                  dev_name, baudrate, prog_name);
+  printf_filtered ("\ton an %s processor.\n", processor_name[processor_type]);
 }
 
 /* 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. 
  * sb/sh instructions don't work on unaligned addresses, when TU=1. 
  */
 int
 adapt_write_inferior_memory (memaddr, myaddr, len)
@@ -1127,9 +1233,9 @@ adapt_write_inferior_memory (memaddr, myaddr, len)
   unsigned int cps;
 
   /* Turn TU bit off so we can do 'sb' commands */
-  cps = read_register(CPS_REGNUM);
+  cps = read_register (CPS_REGNUM);
   if (cps & 0x00000800)
-       write_register(CPS_REGNUM,cps&~(0x00000800));
+    write_register (CPS_REGNUM, cps & ~(0x00000800));
 
   for (i = 0; i < len; i++)
     {
@@ -1137,22 +1243,22 @@ adapt_write_inferior_memory (memaddr, myaddr, len)
        fprintf (adapt_stream, "sb %x,", memaddr + i);
       if ((i % 16) == 15 || i == len - 1)
        {
-         fprintf (adapt_stream, "%x\r", ((unsigned char *)myaddr)[i]);
+         fprintf (adapt_stream, "%x\r", ((unsigned char *) myaddr)[i]);
          expect_prompt ();
        }
       else
-       fprintf (adapt_stream, "%x,", ((unsigned char *)myaddr)[i]);
+       fprintf (adapt_stream, "%x,", ((unsigned char *) myaddr)[i]);
     }
   /* Restore the old value of cps if the TU bit was on */
   if (cps & 0x00000800)
-       write_register(CPS_REGNUM,cps);
+    write_register (CPS_REGNUM, cps);
   return len;
 }
 
 /* Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns errno value.  */
 int
-adapt_read_inferior_memory(memaddr, myaddr, len)
+adapt_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
@@ -1180,7 +1286,7 @@ adapt_read_inferior_memory(memaddr, myaddr, len)
 
   if (((memaddr - 1) + len) < memaddr)
     return EIO;
-  
+
   startaddr = memaddr;
   count = 0;
   while (count < len)
@@ -1194,7 +1300,7 @@ adapt_read_inferior_memory(memaddr, myaddr, len)
       fprintf (adapt_stream, "db %x,%x\r", startaddr,
               (startaddr - 1) + len_this_pass);
 
-#ifdef NOTDEF  /* Why do this */
+#ifdef NOTDEF                  /* Why do this */
       expect ("\n");
       /* Look for 8 hex digits.  */
       i = 0;
@@ -1225,57 +1331,62 @@ adapt_read_inferior_memory(memaddr, myaddr, len)
 }
 
 #define MAX_BREAKS     8
-static int num_brkpts=0;
+static int num_brkpts = 0;
 static int
-adapt_insert_breakpoint(addr, save)
-CORE_ADDR      addr;
-char           *save;  /* Throw away, let adapt save instructions */
+adapt_insert_breakpoint (addr, save)
+     CORE_ADDR addr;
+     char *save;               /* Throw away, let adapt save instructions */
 {
-  if (num_brkpts < MAX_BREAKS) {
-       num_brkpts++;
-       fprintf (adapt_stream, "B %x", addr);
-       fprintf (adapt_stream, "\r");
-       expect_prompt ();
-       return(0);      /* Success */
-  } else {
-       fprintf_filtered(gdb_stderr,
-               "Too many break points, break point not installed\n");
-       return(1);      /* Failure */
-  }
+  if (num_brkpts < MAX_BREAKS)
+    {
+      num_brkpts++;
+      fprintf (adapt_stream, "B %x", addr);
+      fprintf (adapt_stream, "\r");
+      expect_prompt ();
+      return (0);              /* Success */
+    }
+  else
+    {
+      fprintf_filtered (gdb_stderr,
+                     "Too many break points, break point not installed\n");
+      return (1);              /* Failure */
+    }
 
 }
 static int
-adapt_remove_breakpoint(addr, save)
-CORE_ADDR      addr;
-char           *save;  /* Throw away, let adapt save instructions */
+adapt_remove_breakpoint (addr, save)
+     CORE_ADDR addr;
+     char *save;               /* Throw away, let adapt save instructions */
 {
-  if (num_brkpts > 0) {
-         num_brkpts--;
-         fprintf (adapt_stream, "BR %x", addr);
-         fprintf (adapt_stream, "\r");
-         fflush (adapt_stream);
-         expect_prompt ();
-  }
-  return(0);
+  if (num_brkpts > 0)
+    {
+      num_brkpts--;
+      fprintf (adapt_stream, "BR %x", addr);
+      fprintf (adapt_stream, "\r");
+      fflush (adapt_stream);
+      expect_prompt ();
+    }
+  return (0);
 }
 
 /* Clear the adapts notion of what the break points are */
 static int
-adapt_clear_breakpoints() 
-{ 
-  if (adapt_stream) {
-       fprintf (adapt_stream, "BR");   /* Clear all break points */
-       fprintf (adapt_stream, "\r");
-       fflush(adapt_stream);
-       expect_prompt ();
-  }
+adapt_clear_breakpoints ()
+{
+  if (adapt_stream)
+    {
+      fprintf (adapt_stream, "BR");    /* Clear all break points */
+      fprintf (adapt_stream, "\r");
+      fflush (adapt_stream);
+      expect_prompt ();
+    }
   num_brkpts = 0;
 }
 static void
-adapt_mourn() 
-{ 
-  adapt_clear_breakpoints();
-  pop_target ();                /* Pop back to no-child state */
+adapt_mourn ()
+{
+  adapt_clear_breakpoints ();
+  pop_target ();               /* Pop back to no-child state */
   generic_mourn_inferior ();
 }
 
@@ -1283,24 +1394,30 @@ adapt_mourn()
  * specified string
  */
 static int
-display_until(str)
-char   *str;
+display_until (str)
+     char *str;
 {
-       int     i=0,j,c;
-
-       while (c=readchar()) {
-               if (c==str[i]) {
-                       i++;
-                       if (i == strlen(str)) return;
-               } else {
-                       if (i) {
-                           for (j=0 ; j<i ; j++) /* Put everthing we matched */
-                               putchar(str[j]);
-                           i=0;
-                       }
-                       putchar(c);
-               }       
+  int i = 0, j, c;
+
+  while (c = readchar ())
+    {
+      if (c == str[i])
+       {
+         i++;
+         if (i == strlen (str))
+           return;
+       }
+      else
+       {
+         if (i)
+           {
+             for (j = 0; j < i; j++)   /* Put everthing we matched */
+               putchar (str[j]);
+             i = 0;
+           }
+         putchar (c);
        }
+    }
 
 }
 
@@ -1313,131 +1430,134 @@ char  *str;
 
 void
 adapt_com (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
-       if (!adapt_stream) {
-               printf_filtered("Adapt not open.  Use the 'target' command to open.\n");
-               return;
-       }
+  if (!adapt_stream)
+    {
+      printf_filtered ("Adapt not open.  Use the 'target' command to open.\n");
+      return;
+    }
+
+  /* Clear all input so only command relative output is displayed */
+  slurp_input ();
 
-       /* Clear all input so only command relative output is displayed */
-       slurp_input();  
-
-       switch(islower(args[0]) ? toupper(args[0]) : args[0]) {
-       default:
-               printf_filtered("Unknown/Unimplemented adapt command '%s'\n",args);
-               break;
-       case 'G':       /* Go, begin execution */
-               write(adapt_desc,args,strlen(args));
-               write(adapt_desc,"\r",1);
-               expect_prompt();
-               break;
-       case 'B':       /* Break points, B or BR */
-       case 'C':       /* Check current 29k status (running/halted) */
-       case 'D':       /* Display data/registers */ 
-       case 'I':       /* Input from i/o space */
-       case 'J':       /* Jam an instruction */
-       case 'K':       /* Kill, stop execution */
-       case 'L':       /* Disassemble */
-       case 'O':       /* Output to i/o space */
-       case 'T':       /* Trace */ 
-       case 'P':       /* Pulse an input line */ 
-       case 'X':       /* Examine special purpose registers */ 
-       case 'Z':       /* Display trace buffer */ 
-               write(adapt_desc,args,strlen(args));
-               write(adapt_desc,"\r",1);
-               expect(args);           /* Don't display the command */
-               display_until("# ");
-               break;
-       /* Begin commands that take input in the form 'c x,y[,z...]' */
-       case 'S':       /* Set memory or register */
-               if (strchr(args,',')) { /* Assume it is properly formatted */
-                       write(adapt_desc,args,strlen(args));
-                       write(adapt_desc,"\r",1);
-                       expect_prompt();
-               }
-               break;
+  switch (islower (args[0]) ? toupper (args[0]) : args[0])
+    {
+    default:
+      printf_filtered ("Unknown/Unimplemented adapt command '%s'\n", args);
+      break;
+    case 'G':                  /* Go, begin execution */
+      write (adapt_desc, args, strlen (args));
+      write (adapt_desc, "\r", 1);
+      expect_prompt ();
+      break;
+    case 'B':                  /* Break points, B or BR */
+    case 'C':                  /* Check current 29k status (running/halted) */
+    case 'D':                  /* Display data/registers */
+    case 'I':                  /* Input from i/o space */
+    case 'J':                  /* Jam an instruction */
+    case 'K':                  /* Kill, stop execution */
+    case 'L':                  /* Disassemble */
+    case 'O':                  /* Output to i/o space */
+    case 'T':                  /* Trace */
+    case 'P':                  /* Pulse an input line */
+    case 'X':                  /* Examine special purpose registers */
+    case 'Z':                  /* Display trace buffer */
+      write (adapt_desc, args, strlen (args));
+      write (adapt_desc, "\r", 1);
+      expect (args);           /* Don't display the command */
+      display_until ("# ");
+      break;
+      /* Begin commands that take input in the form 'c x,y[,z...]' */
+    case 'S':                  /* Set memory or register */
+      if (strchr (args, ','))
+       {                       /* Assume it is properly formatted */
+         write (adapt_desc, args, strlen (args));
+         write (adapt_desc, "\r", 1);
+         expect_prompt ();
        }
+      break;
+    }
 }
 
 /* Define the target subroutine names */
 
-struct target_ops adapt_ops ;
+struct target_ops adapt_ops;
 
-static void 
-init_adapt_ops(void)
+static void
+init_adapt_ops (void)
 {
-  adapt_ops.to_shortname =     "adapt";
-  adapt_ops.to_longname =      "Remote AMD `Adapt' target";
-  adapt_ops.to_doc =   "Remote debug an AMD 290*0 using an `Adapt' monitor via RS232";
-  adapt_ops.to_open =  adapt_open;
-  adapt_ops.to_close =         adapt_close;
+  adapt_ops.to_shortname = "adapt";
+  adapt_ops.to_longname = "Remote AMD `Adapt' target";
+  adapt_ops.to_doc = "Remote debug an AMD 290*0 using an `Adapt' monitor via RS232";
+  adapt_ops.to_open = adapt_open;
+  adapt_ops.to_close = adapt_close;
   adapt_ops.to_attach = adapt_attach;
   adapt_ops.to_post_attach = NULL;
-  adapt_ops.to_require_attach = NULL;  
+  adapt_ops.to_require_attach = NULL;
   adapt_ops.to_detach = adapt_detach;
   adapt_ops.to_require_detach = NULL;
   adapt_ops.to_resume = adapt_resume;
-  adapt_ops.to_wait  =         adapt_wait;
+  adapt_ops.to_wait = adapt_wait;
   adapt_ops.to_post_wait = NULL;
-  adapt_ops.to_fetch_registers  = adapt_fetch_register;
-  adapt_ops.to_store_registers  = adapt_store_register;
+  adapt_ops.to_fetch_registers = adapt_fetch_register;
+  adapt_ops.to_store_registers = adapt_store_register;
   adapt_ops.to_prepare_to_store = adapt_prepare_to_store;
-  adapt_ops.to_xfer_memory  =  adapt_xfer_inferior_memory;
-  adapt_ops.to_files_info  =   adapt_files_info;
+  adapt_ops.to_xfer_memory = adapt_xfer_inferior_memory;
+  adapt_ops.to_files_info = adapt_files_info;
   adapt_ops.to_insert_breakpoint = adapt_insert_breakpoint;
-  adapt_ops.to_remove_breakpoint = adapt_remove_breakpoint; 
-  adapt_ops.to_terminal_init  =        0;
-  adapt_ops.to_terminal_inferior =     0;
-  adapt_ops.to_terminal_ours_for_output =      0;
-  adapt_ops.to_terminal_ours  =        0;
-  adapt_ops.to_terminal_info  =        0;
-  adapt_ops.to_kill  =         adapt_kill;             
-  adapt_ops.to_load  =         adapt_load;
-  adapt_ops.to_lookup_symbol =         0;              
-  adapt_ops.to_create_inferior =  adapt_create_inferior;
+  adapt_ops.to_remove_breakpoint = adapt_remove_breakpoint;
+  adapt_ops.to_terminal_init = 0;
+  adapt_ops.to_terminal_inferior = 0;
+  adapt_ops.to_terminal_ours_for_output = 0;
+  adapt_ops.to_terminal_ours = 0;
+  adapt_ops.to_terminal_info = 0;
+  adapt_ops.to_kill = adapt_kill;
+  adapt_ops.to_load = adapt_load;
+  adapt_ops.to_lookup_symbol = 0;
+  adapt_ops.to_create_inferior = adapt_create_inferior;
   adapt_ops.to_post_startup_inferior = NULL;
   adapt_ops.to_acknowledge_created_inferior = NULL;
-  adapt_ops.to_clone_and_follow_inferior = NULL;          
-  adapt_ops.to_post_follow_inferior_by_clone = NULL;  
+  adapt_ops.to_clone_and_follow_inferior = NULL;
+  adapt_ops.to_post_follow_inferior_by_clone = NULL;
   adapt_ops.to_insert_fork_catchpoint = NULL;
   adapt_ops.to_remove_fork_catchpoint = NULL;
   adapt_ops.to_insert_vfork_catchpoint = NULL;
-  adapt_ops.to_remove_vfork_catchpoint = NULL;                     
+  adapt_ops.to_remove_vfork_catchpoint = NULL;
   adapt_ops.to_has_forked = NULL;
   adapt_ops.to_has_vforked = NULL;
-  adapt_ops.to_can_follow_vfork_prior_to_exec = NULL;                        
-  adapt_ops.to_post_follow_vfork = NULL;       
+  adapt_ops.to_can_follow_vfork_prior_to_exec = NULL;
+  adapt_ops.to_post_follow_vfork = NULL;
   adapt_ops.to_insert_exec_catchpoint = NULL;
   adapt_ops.to_remove_exec_catchpoint = NULL;
   adapt_ops.to_has_execd = NULL;
   adapt_ops.to_reported_exec_events_per_exec_call = NULL;
   adapt_ops.to_has_exited = NULL;
-  adapt_ops.to_mourn_inferior =   adapt_mourn;                 
-  adapt_ops.to_can_run  =      0; 
-  adapt_ops.to_notice_signals =        0;
-  adapt_ops.to_thread_alive  =         0;
-  adapt_ops.to_stop  =         0 ; /* process_stratum; */
+  adapt_ops.to_mourn_inferior = adapt_mourn;
+  adapt_ops.to_can_run = 0;
+  adapt_ops.to_notice_signals = 0;
+  adapt_ops.to_thread_alive = 0;
+  adapt_ops.to_stop = 0;       /* process_stratum; */
   adapt_ops.to_pid_to_exec_file = NULL;
   adapt_ops.to_core_file_to_sym_file = NULL;
-  adapt_ops.to_stratum =       0; 
-  adapt_ops.DONT_USE =         0 ;
-  adapt_ops.to_has_all_memory =        1;
-  adapt_ops.to_has_memory =    1;
-  adapt_ops.to_has_stack =     1;
-  adapt_ops.to_has_registers =         1;
-  adapt_ops.to_has_execution =         0;
-  adapt_ops.to_sections =      0;
-  adapt_ops.to_sections_end =  0 ;
-  adapt_ops.to_magic =         OPS_MAGIC; 
-} /* init_adapt_ops */
+  adapt_ops.to_stratum = 0;
+  adapt_ops.DONT_USE = 0;
+  adapt_ops.to_has_all_memory = 1;
+  adapt_ops.to_has_memory = 1;
+  adapt_ops.to_has_stack = 1;
+  adapt_ops.to_has_registers = 1;
+  adapt_ops.to_has_execution = 0;
+  adapt_ops.to_sections = 0;
+  adapt_ops.to_sections_end = 0;
+  adapt_ops.to_magic = OPS_MAGIC;
+}                              /* init_adapt_ops */
 
 void
 _initialize_remote_adapt ()
 {
-  init_adapt_ops() ;
+  init_adapt_ops ();
   add_target (&adapt_ops);
   add_com ("adapt <command>", class_obscure, adapt_com,
-       "Send a command to the AMD Adapt remote monitor.");
+          "Send a command to the AMD Adapt remote monitor.");
 }
index 624871cff020d30083889d0150d6eed3e16ec4fc..62a15d33665fffa1847101d14f7dc18b31576ebd 100644 (file)
@@ -7,21 +7,22 @@
    (or possibly TELNET) stream to a terminal multiplexor,
    which in turn talks to the target board.
 
-  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 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"
@@ -64,33 +65,33 @@ extern int baud_rate;
     }                                                                  \
   while (0)
 
-static void debuglogs PARAMS((int, char *, ...));
-static void array_open();
-static void array_close();
-static void array_detach();
-static void array_attach();
-static void array_resume();
-static void array_fetch_register();
-static void array_store_register();
-static void array_fetch_registers();
-static void array_store_registers();
-static void array_prepare_to_store();
-static void array_files_info();
-static void array_kill();
-static void array_create_inferior();
-static void array_mourn_inferior();
-static void make_gdb_packet();
-static int array_xfer_memory();
-static int array_wait();
-static int array_insert_breakpoint();
-static int array_remove_breakpoint();
-static int tohex();
-static int to_hex();
-static int from_hex();
-static int array_send_packet();
-static int array_get_packet();
-static unsigned long ascii2hexword();
-static void hexword2ascii();
+static void debuglogs PARAMS ((int, char *,...));
+static void array_open ();
+static void array_close ();
+static void array_detach ();
+static void array_attach ();
+static void array_resume ();
+static void array_fetch_register ();
+static void array_store_register ();
+static void array_fetch_registers ();
+static void array_store_registers ();
+static void array_prepare_to_store ();
+static void array_files_info ();
+static void array_kill ();
+static void array_create_inferior ();
+static void array_mourn_inferior ();
+static void make_gdb_packet ();
+static int array_xfer_memory ();
+static int array_wait ();
+static int array_insert_breakpoint ();
+static int array_remove_breakpoint ();
+static int tohex ();
+static int to_hex ();
+static int from_hex ();
+static int array_send_packet ();
+static int array_get_packet ();
+static unsigned long ascii2hexword ();
+static void hexword2ascii ();
 
 extern char *version;
 
@@ -120,79 +121,79 @@ serial_t array_desc = NULL;
  * registers either. So, typing "info reg sp" becomes a "r30".
  */
 extern char *tmp_mips_processor_type;
-extern int mips_set_processor_type();
+extern int mips_set_processor_type ();
 
-static struct target_ops array_ops ;
+static struct target_ops array_ops;
 
-static void 
-init_array_ops(void)
+static void
+init_array_ops (void)
 {
-  array_ops.to_shortname =   "array";  
-  array_ops.to_longname =              
+  array_ops.to_shortname = "array";
+  array_ops.to_longname =
     "Debug using the standard GDB remote protocol for the Array Tech target.",
-    array_ops.to_doc =                         
+    array_ops.to_doc =
     "Debug using the standard GDB remote protocol for the Array Tech target.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya)." ;
-  array_ops.to_open =   array_open;    
-  array_ops.to_close =   array_close;  
-  array_ops.to_attach =   NULL;
-  array_ops.to_post_attach = NULL;             
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  array_ops.to_open = array_open;
+  array_ops.to_close = array_close;
+  array_ops.to_attach = NULL;
+  array_ops.to_post_attach = NULL;
   array_ops.to_require_attach = NULL;
-  array_ops.to_detach =   array_detach;        
+  array_ops.to_detach = array_detach;
   array_ops.to_require_detach = NULL;
-  array_ops.to_resume =   array_resume;        
-  array_ops.to_wait  =   array_wait;   
+  array_ops.to_resume = array_resume;
+  array_ops.to_wait = array_wait;
   array_ops.to_post_wait = NULL;
-  array_ops.to_fetch_registers  =   array_fetch_registers;
-  array_ops.to_store_registers  =   array_store_registers;
-  array_ops.to_prepare_to_store =   array_prepare_to_store;
-  array_ops.to_xfer_memory  =   array_xfer_memory;             
-  array_ops.to_files_info  =   array_files_info;               
-  array_ops.to_insert_breakpoint =   array_insert_breakpoint;  
-  array_ops.to_remove_breakpoint =   array_remove_breakpoint;  
-  array_ops.to_terminal_init  =   0;                           
-  array_ops.to_terminal_inferior =   0;                                
-  array_ops.to_terminal_ours_for_output =   0;                 
-  array_ops.to_terminal_ours  =   0;                           
-  array_ops.to_terminal_info  =   0;                           
-  array_ops.to_kill  =   array_kill;           
-  array_ops.to_load  =   0;                    
-  array_ops.to_lookup_symbol =   0;            
-  array_ops.to_create_inferior =   array_create_inferior;      
+  array_ops.to_fetch_registers = array_fetch_registers;
+  array_ops.to_store_registers = array_store_registers;
+  array_ops.to_prepare_to_store = array_prepare_to_store;
+  array_ops.to_xfer_memory = array_xfer_memory;
+  array_ops.to_files_info = array_files_info;
+  array_ops.to_insert_breakpoint = array_insert_breakpoint;
+  array_ops.to_remove_breakpoint = array_remove_breakpoint;
+  array_ops.to_terminal_init = 0;
+  array_ops.to_terminal_inferior = 0;
+  array_ops.to_terminal_ours_for_output = 0;
+  array_ops.to_terminal_ours = 0;
+  array_ops.to_terminal_info = 0;
+  array_ops.to_kill = array_kill;
+  array_ops.to_load = 0;
+  array_ops.to_lookup_symbol = 0;
+  array_ops.to_create_inferior = array_create_inferior;
   array_ops.to_post_startup_inferior = NULL;
   array_ops.to_acknowledge_created_inferior = NULL;
-  array_ops.to_clone_and_follow_inferior = NULL;          
-  array_ops.to_post_follow_inferior_by_clone = NULL;  
+  array_ops.to_clone_and_follow_inferior = NULL;
+  array_ops.to_post_follow_inferior_by_clone = NULL;
   array_ops.to_insert_fork_catchpoint = NULL;
   array_ops.to_remove_fork_catchpoint = NULL;
   array_ops.to_insert_vfork_catchpoint = NULL;
-  array_ops.to_remove_vfork_catchpoint = NULL;                      
+  array_ops.to_remove_vfork_catchpoint = NULL;
   array_ops.to_has_forked = NULL;
-  array_ops.to_has_vforked = NULL;            
-  array_ops.to_can_follow_vfork_prior_to_exec = NULL;            
+  array_ops.to_has_vforked = NULL;
+  array_ops.to_can_follow_vfork_prior_to_exec = NULL;
   array_ops.to_post_follow_vfork = NULL;
   array_ops.to_insert_exec_catchpoint = NULL;
   array_ops.to_remove_exec_catchpoint = NULL;
   array_ops.to_has_execd = NULL;
   array_ops.to_reported_exec_events_per_exec_call = NULL;
   array_ops.to_has_exited = NULL;
-  array_ops.to_mourn_inferior =   array_mourn_inferior;                
-  array_ops.to_can_run  =   0;         
-  array_ops.to_notice_signals =   0;   
-  array_ops.to_thread_alive  =   0;    
-  array_ops.to_stop  =   0;
+  array_ops.to_mourn_inferior = array_mourn_inferior;
+  array_ops.to_can_run = 0;
+  array_ops.to_notice_signals = 0;
+  array_ops.to_thread_alive = 0;
+  array_ops.to_stop = 0;
   array_ops.to_pid_to_exec_file = NULL;
-  array_ops.to_core_file_to_sym_file = NULL;         
-  array_ops.to_stratum =   process_stratum;    
-  array_ops.DONT_USE =   0;                    
-  array_ops.to_has_all_memory =   1;           
-  array_ops.to_has_memory =   1;               
-  array_ops.to_has_stack =   1;                        
-  array_ops.to_has_registers =   1;            
-  array_ops.to_has_execution =   1;            
-  array_ops.to_sections =   0;                 
-  array_ops.to_sections_end =   0;             
-  array_ops.to_magic =   OPS_MAGIC;            
+  array_ops.to_core_file_to_sym_file = NULL;
+  array_ops.to_stratum = process_stratum;
+  array_ops.DONT_USE = 0;
+  array_ops.to_has_all_memory = 1;
+  array_ops.to_has_memory = 1;
+  array_ops.to_has_stack = 1;
+  array_ops.to_has_registers = 1;
+  array_ops.to_has_execution = 1;
+  array_ops.to_sections = 0;
+  array_ops.to_sections_end = 0;
+  array_ops.to_magic = OPS_MAGIC;
 };
 
 /*
@@ -200,9 +201,9 @@ Specify the serial device it is connected to (e.g. /dev/ttya)." ;
  */
 static void
 #ifdef ANSI_PROTOTYPES
-printf_monitor(char *pattern, ...)
+printf_monitor (char *pattern,...)
 #else
-printf_monitor(va_alist)
+printf_monitor (va_alist)
      va_dcl
 #endif
 {
@@ -211,49 +212,49 @@ printf_monitor(va_alist)
   int i;
 
 #ifdef ANSI_PROTOTYPES
-  va_start(args, pattern);
+  va_start (args, pattern);
 #else
   char *pattern;
-  va_start(args);
-  pattern = va_arg(args, char *);
+  va_start (args);
+  pattern = va_arg (args, char *);
 #endif
 
-  vsprintf(buf, pattern, args);
+  vsprintf (buf, pattern, args);
 
   debuglogs (1, "printf_monitor(), Sending: \"%s\".", buf);
 
-  if (strlen(buf) > PBUFSIZ)
+  if (strlen (buf) > PBUFSIZ)
     error ("printf_monitor(): string too long");
-  if (SERIAL_WRITE(array_desc, buf, strlen(buf)))
-    fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
+  if (SERIAL_WRITE (array_desc, buf, strlen (buf)))
+    fprintf (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));
 }
 /*
  * write_monitor -- send raw data to monitor.
  */
 static void
-write_monitor(data, len)
+write_monitor (data, len)
      char data[];
      int len;
 {
-  if (SERIAL_WRITE(array_desc, data, len))
-    fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
-  *(data + len+1) = '\0';
+  if (SERIAL_WRITE (array_desc, data, len))
+    fprintf (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));
+
+  *(data + len + 1) = '\0';
   debuglogs (1, "write_monitor(), Sending: \"%s\".", data);
 
 }
 
 /*
  * debuglogs -- deal with debugging info to multiple sources. This takes
- *     two real args, the first one is the level to be compared against 
- *     the sr_get_debug() value, the second arg is a printf buffer and args
- *     to be formatted and printed. A CR is added after each string is printed.
+ *      two real args, the first one is the level to be compared against 
+ *      the sr_get_debug() value, the second arg is a printf buffer and args
+ *      to be formatted and printed. A CR is added after each string is printed.
  */
 static void
 #ifdef ANSI_PROTOTYPES
-debuglogs(int level, char *pattern, ...)
+debuglogs (int level, char *pattern,...)
 #else
-debuglogs(va_alist)
+debuglogs (va_alist)
      va_dcl
 #endif
 {
@@ -264,116 +265,124 @@ debuglogs(va_alist)
   int i;
 
 #ifdef ANSI_PROTOTYPES
-  va_start(args, pattern);
+  va_start (args, pattern);
 #else
   char *pattern;
   int level;
-  va_start(args);
-  level = va_arg(args, int);                   /* get the debug level */
-  pattern = va_arg(args, char *);              /* get the printf style pattern */
+  va_start (args);
+  level = va_arg (args, int);  /* get the debug level */
+  pattern = va_arg (args, char *);     /* get the printf style pattern */
 #endif
 
-  if ((level <0) || (level > 100)) {
-    error ("Bad argument passed to debuglogs(), needs debug level");
-    return;
-  }
-      
-  vsprintf(buf, pattern, args);                        /* format the string */
-  
+  if ((level < 0) || (level > 100))
+    {
+      error ("Bad argument passed to debuglogs(), needs debug level");
+      return;
+    }
+
+  vsprintf (buf, pattern, args);       /* format the string */
+
   /* convert some characters so it'll look right in the log */
   p = newbuf;
-  for (i = 0 ; buf[i] != '\0'; i++) {
-    if (i > PBUFSIZ)
-      error ("Debug message too long");
-    switch (buf[i]) {
-    case '\n':                                 /* newlines */
-      *p++ = '\\';
-      *p++ = 'n';
-      continue;
-    case '\r':                                 /* carriage returns */
-      *p++ = '\\';
-      *p++ = 'r';
-      continue;
-    case '\033':                               /* escape */
-      *p++ = '\\';
-      *p++ = 'e';
-      continue;
-    case '\t':                                 /* tab */
-      *p++ = '\\';
-      *p++ = 't';
-      continue;
-    case '\b':                                 /* backspace */
-      *p++ = '\\';
-      *p++ = 'b';
-      continue;
-    default:                                   /* no change */
-      *p++ = buf[i];
-    }
+  for (i = 0; buf[i] != '\0'; i++)
+    {
+      if (i > PBUFSIZ)
+       error ("Debug message too long");
+      switch (buf[i])
+       {
+       case '\n':              /* newlines */
+         *p++ = '\\';
+         *p++ = 'n';
+         continue;
+       case '\r':              /* carriage returns */
+         *p++ = '\\';
+         *p++ = 'r';
+         continue;
+       case '\033':            /* escape */
+         *p++ = '\\';
+         *p++ = 'e';
+         continue;
+       case '\t':              /* tab */
+         *p++ = '\\';
+         *p++ = 't';
+         continue;
+       case '\b':              /* backspace */
+         *p++ = '\\';
+         *p++ = 'b';
+         continue;
+       default:                /* no change */
+         *p++ = buf[i];
+       }
 
-    if (buf[i] < 26) {                         /* modify control characters */
-      *p++ = '^';
-      *p++ = buf[i] + 'A';
-      continue;
-    }
-     if (buf[i] >= 128) {                      /* modify control characters */
-      *p++ = '!';
-      *p++ = buf[i] + 'A';
-      continue;
+      if (buf[i] < 26)
+       {                       /* modify control characters */
+         *p++ = '^';
+         *p++ = buf[i] + 'A';
+         continue;
+       }
+      if (buf[i] >= 128)
+       {                       /* modify control characters */
+         *p++ = '!';
+         *p++ = buf[i] + 'A';
+         continue;
+       }
     }
- }
-  *p = '\0';                                   /* terminate the string */
+  *p = '\0';                   /* terminate the string */
 
-  if (sr_get_debug() > level)
+  if (sr_get_debug () > level)
     printf_unfiltered ("%s\n", newbuf);
 
-#ifdef LOG_FILE                                        /* write to the monitor log */
-  if (log_file != 0x0) {
-    fputs (newbuf, log_file);
-    fputc ('\n', log_file);
-    fflush (log_file);
-  }
+#ifdef LOG_FILE                        /* write to the monitor log */
+  if (log_file != 0x0)
+    {
+      fputs (newbuf, log_file);
+      fputc ('\n', log_file);
+      fflush (log_file);
+    }
 #endif
 }
 
 /* readchar -- read a character from the remote system, doing all the fancy
- *     timeout stuff.
+ *    timeout stuff.
  */
 static int
-readchar(timeout)
+readchar (timeout)
      int timeout;
 {
   int c;
 
-  c = SERIAL_READCHAR(array_desc, abs(timeout));
+  c = SERIAL_READCHAR (array_desc, abs (timeout));
 
-  if (sr_get_debug() > 5) {
-    putchar(c & 0x7f);
-    debuglogs (5, "readchar: timeout = %d\n", timeout);
-  }
+  if (sr_get_debug () > 5)
+    {
+      putchar (c & 0x7f);
+      debuglogs (5, "readchar: timeout = %d\n", timeout);
+    }
 
 #ifdef LOG_FILE
   if (isascii (c))
-    putc(c & 0x7f, log_file);
+    putc (c & 0x7f, log_file);
 #endif
 
   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.");
+  if (c == SERIAL_TIMEOUT)
+    {
+      if (timeout <= 0)
+       return c;               /* Polls shouldn't generate timeout errors */
+      error ("Timeout reading from remote system.");
 #ifdef LOG_FILE
       fputs ("ERROR: Timeout reading from remote system", log_file);
 #endif
-  }
-  perror_with_name("readchar");
+    }
+  perror_with_name ("readchar");
 }
 
 /* 
  * expect --  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.
+ *      If DISCARD is non-zero, then discard non-matching input, else print
+ *      it out. Let the user break out immediately.
  */
 static void
 expect (string, discard)
@@ -387,23 +396,29 @@ expect (string, discard)
   debuglogs (1, "Expecting \"%s\".", string);
 
   immediate_quit = 1;
-  while (1) {
-    c = readchar(timeout);
-    if (!isascii (c))
-      continue;
-    if (c == *p++) {
-      if (*p == '\0') {
-       immediate_quit = 0;
-       debuglogs (4, "Matched");
-       return;
-      }
-    } else {
-      if (!discard) {
-       fputc_unfiltered (c, gdb_stdout);
-      }
-      p = string;
+  while (1)
+    {
+      c = readchar (timeout);
+      if (!isascii (c))
+       continue;
+      if (c == *p++)
+       {
+         if (*p == '\0')
+           {
+             immediate_quit = 0;
+             debuglogs (4, "Matched");
+             return;
+           }
+       }
+      else
+       {
+         if (!discard)
+           {
+             fputc_unfiltered (c, gdb_stdout);
+           }
+         p = string;
+       }
     }
-  }
 }
 
 /* Keep discarding input until we see the MONITOR array_cmds->prompt.
@@ -421,7 +436,7 @@ expect (string, discard)
    necessary to prevent getting into states from which we can't
    recover.  */
 static void
-expect_prompt(discard)
+expect_prompt (discard)
      int discard;
 {
   expect (ARRAY_PROMPT, discard);
@@ -431,70 +446,77 @@ expect_prompt(discard)
  * junk -- ignore junk characters. Returns a 1 if junk, 0 otherwise
  */
 static int
-junk(ch)
+junk (ch)
      char ch;
 {
-  switch (ch) {
-  case '\0':
-  case ' ':
-  case '-':
-  case '\t':
-  case '\r':
-  case '\n':
-    if (sr_get_debug() > 5)
-      debuglogs (5, "Ignoring \'%c\'.", ch);
-    return 1;
-  default:
-    if (sr_get_debug() > 5)
-      debuglogs (5, "Accepting \'%c\'.", ch);
-    return 0;
-  }
+  switch (ch)
+    {
+    case '\0':
+    case ' ':
+    case '-':
+    case '\t':
+    case '\r':
+    case '\n':
+      if (sr_get_debug () > 5)
+       debuglogs (5, "Ignoring \'%c\'.", ch);
+      return 1;
+    default:
+      if (sr_get_debug () > 5)
+       debuglogs (5, "Accepting \'%c\'.", ch);
+      return 0;
+    }
 }
 
 /* 
  *  get_hex_digit -- Get a hex digit from the remote system & return its value.
- *             If ignore is nonzero, ignore spaces, newline & tabs.
+ *              If ignore is nonzero, ignore spaces, newline & tabs.
  */
 static int
-get_hex_digit(ignore)
+get_hex_digit (ignore)
      int ignore;
 {
   static int ch;
-  while (1) {
-    ch = readchar(timeout);
-    if (junk(ch))
-      continue;
-    if (sr_get_debug() > 4) {
-      debuglogs (4, "get_hex_digit() got a 0x%x(%c)", ch, ch);
-    } else {
-#ifdef LOG_FILE                                        /* write to the monitor log */
-      if (log_file != 0x0) {
-       fputs ("get_hex_digit() got a 0x", log_file);
-       fputc (ch, log_file);
-       fputc ('\n', log_file);
-       fflush (log_file);
-      }
+  while (1)
+    {
+      ch = readchar (timeout);
+      if (junk (ch))
+       continue;
+      if (sr_get_debug () > 4)
+       {
+         debuglogs (4, "get_hex_digit() got a 0x%x(%c)", ch, ch);
+       }
+      else
+       {
+#ifdef LOG_FILE                        /* write to the monitor log */
+         if (log_file != 0x0)
+           {
+             fputs ("get_hex_digit() got a 0x", log_file);
+             fputc (ch, log_file);
+             fputc ('\n', log_file);
+             fflush (log_file);
+           }
 #endif
-    }
+       }
 
-    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)
-      ;
-    else {
-     expect_prompt(1);
-      debuglogs (4, "Invalid hex digit from remote system. (0x%x)", ch);
-      error("Invalid hex digit from remote system. (0x%x)", ch);
+      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)
+       ;
+      else
+       {
+         expect_prompt (1);
+         debuglogs (4, "Invalid hex digit from remote system. (0x%x)", ch);
+         error ("Invalid hex digit from remote system. (0x%x)", ch);
+       }
     }
-  }
 }
 
 /* get_hex_byte -- Get a byte from monitor and put it in *BYT. 
- *     Accept any number leading spaces.
+ *    Accept any number leading spaces.
  */
 static void
 get_hex_byte (byt)
@@ -504,17 +526,17 @@ get_hex_byte (byt)
 
   val = get_hex_digit (1) << 4;
   debuglogs (4, "get_hex_byte() -- Read first nibble 0x%x", val);
+
   val |= get_hex_digit (0);
   debuglogs (4, "get_hex_byte() -- Read second nibble 0x%x", val);
   *byt = val;
-  
+
   debuglogs (4, "get_hex_byte() -- Read a 0x%x", val);
 }
 
 /* 
  * get_hex_word --  Get N 32-bit words from remote, each preceded by a space,
- *     and put them in registers starting at REGNO.
+ *      and put them in registers starting at REGNO.
  */
 static int
 get_hex_word ()
@@ -525,15 +547,18 @@ get_hex_word ()
   val = 0;
 
 #if 0
-  if (HOST_BYTE_ORDER == BIG_ENDIAN) {
+  if (HOST_BYTE_ORDER == BIG_ENDIAN)
+    {
 #endif
-    for (i = 0; i < 8; i++)
-      val = (val << 4) + get_hex_digit (i == 0);
+      for (i = 0; i < 8; i++)
+       val = (val << 4) + get_hex_digit (i == 0);
 #if 0
-  } else {
-    for (i = 7; i >= 0; i--)
-      val = (val << 4) + get_hex_digit (i == 0);
-  }
+    }
+  else
+    {
+      for (i = 7; i >= 0; i--)
+       val = (val << 4) + get_hex_digit (i == 0);
+    }
 #endif
 
   debuglogs (4, "get_hex_word() got a 0x%x for a %s host.", val, (HOST_BYTE_ORDER == BIG_ENDIAN) ? "big endian" : "little endian");
@@ -552,10 +577,10 @@ array_create_inferior (execfile, args, env)
   int entry_pt;
 
   if (args && *args)
-    error("Can't pass arguments to remote MONITOR process");
+    error ("Can't pass arguments to remote MONITOR process");
 
   if (execfile == 0 || exec_bfd == 0)
-    error("No executable file specified");
+    error ("No executable file specified");
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
@@ -577,18 +602,18 @@ array_create_inferior (execfile, args, env)
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
 
   /* Let 'er rip... */
-  proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /*
  * array_open -- open a connection to a remote debugger.
- *     NAME is the filename used for communication.
+ *      NAME is the filename used for communication.
  */
 static int baudrate = 9600;
 static char dev_name[100];
 
 static void
-array_open(args, name, from_tty)
+array_open (args, name, from_tty)
      char *args;
      char *name;
      int from_tty;
@@ -600,7 +625,7 @@ array_open(args, name, from_tty)
 `target %s HOST-NAME:PORT-NUMBER' to use a network connection.", name, name);
 
 /*  if (is_open) */
-    array_close(0);
+  array_close (0);
 
   target_preopen (from_tty);
   unpush_target (&array_ops);
@@ -608,20 +633,22 @@ array_open(args, name, from_tty)
   tmp_mips_processor_type = "lsi33k";  /* change the default from r3051 */
   mips_set_processor_type_command ("lsi33k", 0);
 
-  strcpy(dev_name, args);
-  array_desc = SERIAL_OPEN(dev_name);
+  strcpy (dev_name, args);
+  array_desc = SERIAL_OPEN (dev_name);
 
   if (array_desc == NULL)
-    perror_with_name(dev_name);
+    perror_with_name (dev_name);
 
-  if (baud_rate != -1) {
-    if (SERIAL_SETBAUDRATE (array_desc, baud_rate)) {
-      SERIAL_CLOSE (array_desc);
-      perror_with_name (name);
+  if (baud_rate != -1)
+    {
+      if (SERIAL_SETBAUDRATE (array_desc, baud_rate))
+       {
+         SERIAL_CLOSE (array_desc);
+         perror_with_name (name);
+       }
     }
-  }
-  
-  SERIAL_RAW(array_desc);
+
+  SERIAL_RAW (array_desc);
 
 #if defined (LOG_FILE)
   log_file = fopen (LOG_FILE, "w");
@@ -636,53 +663,54 @@ array_open(args, name, from_tty)
      expect_prompt to print a few times. For the GDB remote protocol, the application
      being debugged is sitting at a breakpoint and waiting for GDB to initialize
      the connection. We force it to give us an empty packet to see if it's alive.
-     */
-    debuglogs (3, "Trying to ACK the target's debug stub");
-    /* unless your are on the new hardware, the old board won't initialize
-       because the '@' doesn't flush output like it does on the new ROMS.
-     */
-    printf_monitor ("@");      /* ask for the last signal */
-    expect_prompt(1);          /* See if we get a expect_prompt */
+   */
+  debuglogs (3, "Trying to ACK the target's debug stub");
+  /* unless your are on the new hardware, the old board won't initialize
+     because the '@' doesn't flush output like it does on the new ROMS.
+   */
+  printf_monitor ("@");                /* ask for the last signal */
+  expect_prompt (1);           /* See if we get a expect_prompt */
 #ifdef TEST_ARRAY              /* skip packet for testing */
-    make_gdb_packet (packet, "?");     /* ask for a bogus packet */
-    if (array_send_packet (packet) == 0)
-      error ("Couldn't transmit packet\n");
-    printf_monitor ("@\n");    /* force it to flush stdout */
-   expect_prompt(1);           /* See if we get a expect_prompt */
+  make_gdb_packet (packet, "?");       /* ask for a bogus packet */
+  if (array_send_packet (packet) == 0)
+    error ("Couldn't transmit packet\n");
+  printf_monitor ("@\n");      /* force it to flush stdout */
+  expect_prompt (1);           /* See if we get a expect_prompt */
 #endif
   push_target (&array_ops);
   if (from_tty)
-    printf("Remote target %s connected to %s\n", array_ops.to_shortname, dev_name);
+    printf ("Remote target %s connected to %s\n", array_ops.to_shortname, dev_name);
 }
 
 /*
  * array_close -- Close out all files and local state before this
- *     target loses control.
+ *      target loses control.
  */
 
 static void
 array_close (quitting)
      int quitting;
 {
-  SERIAL_CLOSE(array_desc);
+  SERIAL_CLOSE (array_desc);
   array_desc = NULL;
 
   debuglogs (1, "array_close (quitting=%d)", quitting);
 
 #if defined (LOG_FILE)
-  if (log_file) {
-    if (ferror(log_file))
-      printf_filtered ("Error writing log file.\n");
-    if (fclose(log_file) != 0)
-      printf_filtered ("Error closing log file.\n");
-  }
+  if (log_file)
+    {
+      if (ferror (log_file))
+       printf_filtered ("Error writing log file.\n");
+      if (fclose (log_file) != 0)
+       printf_filtered ("Error closing log file.\n");
+    }
 #endif
 }
 
 /* 
  * array_detach -- terminate the open connection to the remote
- *     debugger. Use this when you want to detach and do something
- *     else with your gdb.
+ *      debugger. Use this when you want to detach and do something
+ *      else with your gdb.
  */
 static void
 array_detach (from_tty)
@@ -691,7 +719,7 @@ array_detach (from_tty)
 
   debuglogs (1, "array_detach ()");
 
-  pop_target();                /* calls array_close to do the real work */
+  pop_target ();               /* calls array_close to do the real work */
   if (from_tty)
     printf ("Ending remote %s debugging\n", target_shortname);
 }
@@ -706,14 +734,14 @@ array_attach (args, from_tty)
 {
   if (from_tty)
     printf ("Starting remote %s debugging\n", target_shortname);
+
   debuglogs (1, "array_attach (args=%s)", args);
-  
+
   printf_monitor ("go %x\n");
   /* swallow the echo.  */
   expect ("go %x\n", 1);
 }
-  
+
 /*
  * array_resume -- Tell the remote machine to resume.
  */
@@ -724,11 +752,14 @@ array_resume (pid, step, sig)
 {
   debuglogs (1, "array_resume (step=%d, sig=%d)", step, sig);
 
-  if (step) {
-    printf_monitor ("s\n");
-  } else {
-    printf_monitor ("go\n");
-  }
+  if (step)
+    {
+      printf_monitor ("s\n");
+    }
+  else
+    {
+      printf_monitor ("go\n");
+    }
 }
 
 #define TMPBUFSIZ 5
@@ -748,13 +779,13 @@ array_wait (pid, status)
   serial_t tty_desc;
   serial_ttystate ttystate;
 
-  debuglogs(1, "array_wait (), printing extraneous text.");
-  
+  debuglogs (1, "array_wait (), printing extraneous text.");
+
   status->kind = TARGET_WAITKIND_EXITED;
   status->value.integer = 0;
 
-  timeout = 0;         /* Don't time out -- user program is running. */
+  timeout = 0;                 /* Don't time out -- user program is running. */
+
 #if !defined(__GO32__) && !defined(__MSDOS__) && !defined(_WIN32)
   tty_desc = SERIAL_FDOPEN (0);
   ttystate = SERIAL_GET_TTY_STATE (tty_desc);
@@ -762,35 +793,42 @@ array_wait (pid, status)
 
   i = 0;
   /* poll on the serial port and the keyboard. */
-  while (1) {
-    c = readchar(timeout);
-    if (c > 0) {
-      if (c == *(ARRAY_PROMPT + i)) {
-       if (++i >= strlen (ARRAY_PROMPT)) { /* matched the prompt */
-         debuglogs (4, "array_wait(), got the expect_prompt.");
-         break;
+  while (1)
+    {
+      c = readchar (timeout);
+      if (c > 0)
+       {
+         if (c == *(ARRAY_PROMPT + i))
+           {
+             if (++i >= strlen (ARRAY_PROMPT))
+               {               /* matched the prompt */
+                 debuglogs (4, "array_wait(), got the expect_prompt.");
+                 break;
+               }
+           }
+         else
+           {                   /* not the prompt */
+             i = 0;
+           }
+         fputc_unfiltered (c, gdb_stdout);
+         gdb_flush (gdb_stdout);
        }
-      } else {         /* not the prompt */
-       i = 0;
-      }
-      fputc_unfiltered (c, gdb_stdout);
-      gdb_flush (gdb_stdout);
-    }
-    c = SERIAL_READCHAR(tty_desc, timeout);
-    if (c > 0) {
-      SERIAL_WRITE(array_desc, &c, 1);
-      /* do this so it looks like there's keyboard echo */
-      if (c == 3)              /* exit on Control-C */
-       break;
+      c = SERIAL_READCHAR (tty_desc, timeout);
+      if (c > 0)
+       {
+         SERIAL_WRITE (array_desc, &c, 1);
+         /* do this so it looks like there's keyboard echo */
+         if (c == 3)           /* exit on Control-C */
+           break;
 #if 0
-      fputc_unfiltered (c, gdb_stdout);
-      gdb_flush (gdb_stdout);
+         fputc_unfiltered (c, gdb_stdout);
+         gdb_flush (gdb_stdout);
 #endif
+       }
     }
-  }
   SERIAL_SET_TTY_STATE (tty_desc, ttystate);
 #else
-  expect_prompt(1);
+  expect_prompt (1);
   debuglogs (4, "array_wait(), got the expect_prompt.");
 #endif
 
@@ -804,7 +842,7 @@ array_wait (pid, status)
 
 /*
  * array_fetch_registers -- read the remote registers into the
- *     block regs.
+ *      block regs.
  */
 static void
 array_fetch_registers (ignored)
@@ -824,17 +862,18 @@ array_fetch_registers (ignored)
   if (array_send_packet (packet) == 0)
     error ("Couldn't transmit packet\n");
   if (array_get_packet (packet) == 0)
-    error ("Couldn't receive packet\n");  
+    error ("Couldn't receive packet\n");
   /* FIXME: read bytes from packet */
   debuglogs (4, "array_fetch_registers: Got a \"%s\" back\n", packet);
-  for (regno = 0; regno <= PC_REGNUM+4; regno++) {
-    /* supply register stores in target byte order, so swap here */
-    /* FIXME: convert from ASCII hex to raw bytes */
-    i = ascii2hexword (packet + (regno * 8));
-    debuglogs (5, "Adding register %d = %x\n", regno, i);
-    SWAP_TARGET_AND_HOST (&i, 4);
-    supply_register (regno, (char *)&i);
-  }
+  for (regno = 0; regno <= PC_REGNUM + 4; regno++)
+    {
+      /* supply register stores in target byte order, so swap here */
+      /* FIXME: convert from ASCII hex to raw bytes */
+      i = ascii2hexword (packet + (regno * 8));
+      debuglogs (5, "Adding register %d = %x\n", regno, i);
+      SWAP_TARGET_AND_HOST (&i, 4);
+      supply_register (regno, (char *) &i);
+    }
 }
 
 /* 
@@ -860,7 +899,7 @@ array_store_registers (ignored)
   char packet[PBUFSIZ];
   char buf[PBUFSIZ];
   char num[9];
-  
+
   debuglogs (1, "array_store_registers()");
 
   memset (packet, 0, PBUFSIZ);
@@ -869,20 +908,21 @@ array_store_registers (ignored)
 
   /* Unimplemented registers read as all bits zero.  */
   /* FIXME: read bytes from packet */
-  for (regno = 0; regno < 41; regno++) { /* FIXME */
-    /* supply register stores in target byte order, so swap here */
-    /* FIXME: convert from ASCII hex to raw bytes */
-    i = (unsigned long)read_register (regno);
-    hexword2ascii (num, i);
-    strcpy (buf+(regno * 8)+1, num);
-  }
+  for (regno = 0; regno < 41; regno++)
+    {                          /* FIXME */
+      /* supply register stores in target byte order, so swap here */
+      /* FIXME: convert from ASCII hex to raw bytes */
+      i = (unsigned long) read_register (regno);
+      hexword2ascii (num, i);
+      strcpy (buf + (regno * 8) + 1, num);
+    }
   *(buf + (regno * 8) + 2) = 0;
   make_gdb_packet (packet, buf);
   if (array_send_packet (packet) == 0)
     error ("Couldn't transmit packet\n");
   if (array_get_packet (packet) == 0)
-    error ("Couldn't receive packet\n");  
-  
+    error ("Couldn't receive packet\n");
+
   registers_changed ();
 }
 
@@ -918,7 +958,7 @@ array_files_info ()
 
 /*
  * array_write_inferior_memory -- Copy LEN bytes of data from debugger
- *     memory at MYADDR to inferior's memory at MEMADDR.  Returns length moved.
+ *      memory at MYADDR to inferior's memory at MEMADDR.  Returns length moved.
  */
 static int
 array_write_inferior_memory (memaddr, myaddr, len)
@@ -932,43 +972,44 @@ array_write_inferior_memory (memaddr, myaddr, len)
   char buf[PBUFSIZ];
   char num[9];
   char *p;
-  
+
   debuglogs (1, "array_write_inferior_memory (memaddr=0x%x, myaddr=0x%x, len=%d)", memaddr, myaddr, len);
-  memset (buf, '\0', PBUFSIZ);         /* this also sets the string terminator */
+  memset (buf, '\0', PBUFSIZ); /* this also sets the string terminator */
   p = buf;
 
-  *p++ = 'M';                          /* The command to write memory */
+  *p++ = 'M';                  /* The command to write memory */
   hexword2ascii (num, memaddr);        /* convert the address */
-  strcpy (p, num);                     /* copy the address */
+  strcpy (p, num);             /* copy the address */
   p += 8;
-  *p++ = ',';                          /* add comma delimeter */
-  hexword2ascii (num, len);            /* Get the length as a 4 digit number */
+  *p++ = ',';                  /* add comma delimeter */
+  hexword2ascii (num, len);    /* Get the length as a 4 digit number */
   *p++ = num[4];
   *p++ = num[5];
   *p++ = num[6];
   *p++ = num[7];
-  *p++ = ':';                          /* add the colon delimeter */
-  for (j = 0; j < len; j++) {          /* copy the data in after converting it */
-    *p++ = tohex ((myaddr[j] >> 4) & 0xf);
-    *p++ = tohex  (myaddr[j] & 0xf);
-  }
-  
+  *p++ = ':';                  /* add the colon delimeter */
+  for (j = 0; j < len; j++)
+    {                          /* copy the data in after converting it */
+      *p++ = tohex ((myaddr[j] >> 4) & 0xf);
+      *p++ = tohex (myaddr[j] & 0xf);
+    }
+
   make_gdb_packet (packet, buf);
   if (array_send_packet (packet) == 0)
     error ("Couldn't transmit packet\n");
   if (array_get_packet (packet) == 0)
-    error ("Couldn't receive packet\n");  
+    error ("Couldn't receive packet\n");
 
   return len;
 }
 
 /*
  * array_read_inferior_memory -- read LEN bytes from inferior memory
- *     at MEMADDR.  Put the result at debugger address MYADDR.  Returns
- *     length moved.
+ *      at MEMADDR.  Put the result at debugger address MYADDR.  Returns
+ *      length moved.
  */
 static int
-array_read_inferior_memory(memaddr, myaddr, len)
+array_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
@@ -991,11 +1032,12 @@ array_read_inferior_memory(memaddr, myaddr, len)
      array_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 (((memaddr - 1) + len) < memaddr)
+    {
+      errno = EIO;
+      return 0;
+    }
+
   for (count = 0, startaddr = memaddr; count < len; startaddr += len_this_pass)
     {
       /* Try to align to 16 byte boundry (why?) */
@@ -1020,7 +1062,7 @@ array_read_inferior_memory(memaddr, myaddr, len)
        }
       if (array_get_packet (packet) == 0)
        {
-         error ("Couldn't receive packet\n");  
+         error ("Couldn't receive packet\n");
        }
       if (*packet == 0)
        {
@@ -1028,11 +1070,11 @@ array_read_inferior_memory(memaddr, myaddr, len)
        }
       /* Pick packet apart and xfer bytes to myaddr */
       debuglogs (4, "array_read_inferior_memory: Got a \"%s\" back\n", packet);
-      for (j = 0; j < len_this_pass ; j++)
+      for (j = 0; j < len_this_pass; j++)
        {
          /* extract the byte values */
-         myaddr[count++] = from_hex (*(packet+(j*2))) * 16 + from_hex (*(packet+(j*2)+1));
-         debuglogs (5, "myaddr[%d] set to %x\n", count-1, myaddr[count-1]);
+         myaddr[count++] = from_hex (*(packet + (j * 2))) * 16 + from_hex (*(packet + (j * 2) + 1));
+         debuglogs (5, "myaddr[%d] set to %x\n", count - 1, myaddr[count - 1]);
        }
     }
   return (count);
@@ -1045,7 +1087,7 @@ array_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   if (write)
     return array_write_inferior_memory (memaddr, myaddr, len);
@@ -1058,7 +1100,7 @@ array_kill (args, from_tty)
      char *args;
      int from_tty;
 {
-  return;              /* ignore attempts to kill target system */
+  return;                      /* ignore attempts to kill target system */
 }
 
 /* Clean up when a program exits.
@@ -1075,7 +1117,8 @@ array_mourn_inferior ()
 
 #define MAX_ARRAY_BREAKPOINTS 16
 
-static CORE_ADDR breakaddr[MAX_ARRAY_BREAKPOINTS] = {0};
+static CORE_ADDR breakaddr[MAX_ARRAY_BREAKPOINTS] =
+{0};
 
 /*
  * array_insert_breakpoint -- add a breakpoint
@@ -1092,19 +1135,21 @@ array_insert_breakpoint (addr, shadow)
   debuglogs (1, "array_insert_breakpoint() addr = 0x%x", addr);
   BREAKPOINT_FROM_PC (&bp_addr, &bp_size);
 
-  for (i = 0; i <= MAX_ARRAY_BREAKPOINTS; i++) {
-    if (breakaddr[i] == 0) {
-      breakaddr[i] = addr;
-      if (sr_get_debug() > 4)
-       printf ("Breakpoint at %x\n", addr);
-      array_read_inferior_memory (bp_addr, shadow, bp_size);
-      printf_monitor("b 0x%x\n", addr);
-      expect_prompt(1);
-      return 0;
+  for (i = 0; i <= MAX_ARRAY_BREAKPOINTS; i++)
+    {
+      if (breakaddr[i] == 0)
+       {
+         breakaddr[i] = addr;
+         if (sr_get_debug () > 4)
+           printf ("Breakpoint at %x\n", addr);
+         array_read_inferior_memory (bp_addr, shadow, bp_size);
+         printf_monitor ("b 0x%x\n", addr);
+         expect_prompt (1);
+         return 0;
+       }
     }
-  }
 
-  fprintf(stderr, "Too many breakpoints (> 16) for monitor\n");
+  fprintf (stderr, "Too many breakpoints (> 16) for monitor\n");
   return 1;
 }
 
@@ -1120,16 +1165,18 @@ array_remove_breakpoint (addr, shadow)
 
   debuglogs (1, "array_remove_breakpoint() addr = 0x%x", addr);
 
-  for (i = 0; i < MAX_ARRAY_BREAKPOINTS; i++) {
-    if (breakaddr[i] == addr) {
-      breakaddr[i] = 0;
-      /* some monitors remove breakpoints based on the address */
-      printf_monitor("bd %x\n", i);
-      expect_prompt(1);
-      return 0;
+  for (i = 0; i < MAX_ARRAY_BREAKPOINTS; i++)
+    {
+      if (breakaddr[i] == addr)
+       {
+         breakaddr[i] = 0;
+         /* some monitors remove breakpoints based on the address */
+         printf_monitor ("bd %x\n", i);
+         expect_prompt (1);
+         return 0;
+       }
     }
-  }
-  fprintf(stderr, "Can't find breakpoint associated with 0x%x\n", addr);
+  fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
   return 1;
 }
 
@@ -1137,38 +1184,38 @@ static void
 array_stop ()
 {
   debuglogs (1, "array_stop()");
-  printf_monitor("\003");
expect_prompt(1);
+  printf_monitor ("\003");
 expect_prompt (1);
 }
 
 /* 
  * array_command -- put a command string, in args, out to MONITOR.
- *     Output from MONITOR is placed on the users terminal until the
- *     expect_prompt is seen. FIXME
+ *      Output from MONITOR is placed on the users terminal until the
+ *      expect_prompt is seen. FIXME
  */
 static void
 monitor_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   debuglogs (1, "monitor_command (args=%s)", args);
 
   if (array_desc == NULL)
-    error("monitor target not open.");
+    error ("monitor target not open.");
 
   if (!args)
-    error("Missing command.");
-       
+    error ("Missing command.");
+
   printf_monitor ("%s\n", args);
-  expect_prompt(0);
+  expect_prompt (0);
 }
 
 /*
  * make_gdb_packet -- make a GDB packet. The data is always ASCII.
- *      A debug packet whose contents are <data>
- *      is encapsulated for transmission in the form:
+ *       A debug packet whose contents are <data>
+ *       is encapsulated for transmission in the form:
  *
- *             $ <data> # CSUM1 CSUM2
+ *              $ <data> # CSUM1 CSUM2
  *
  *       <data> must be ASCII alphanumeric and cannot include characters
  *       '$' or '#'.  If <data> starts with two characters followed by
@@ -1189,7 +1236,7 @@ make_gdb_packet (buf, data)
   char *p;
 
   debuglogs (3, "make_gdb_packet(%s)\n", data);
-  cnt  = strlen (data);
+  cnt = strlen (data);
   if (cnt > PBUFSIZ)
     error ("make_gdb_packet(): to much data\n");
 
@@ -1198,25 +1245,26 @@ make_gdb_packet (buf, data)
   *p++ = '$';
 
   /* calculate the checksum */
-  for (i = 0; i < cnt; i++) {
-    csum += data[i];
-    *p++ = data[i];
-  }
+  for (i = 0; i < cnt; i++)
+    {
+      csum += data[i];
+      *p++ = data[i];
+    }
 
   /* terminate the data with a '#' */
   *p++ = '#';
-  
+
   /* add the checksum as two ascii digits */
   *p++ = tohex ((csum >> 4) & 0xf);
   *p++ = tohex (csum & 0xf);
-  *p  = 0x0;                   /* Null terminator on string */
+  *p = 0x0;                    /* Null terminator on string */
 }
 
 /*
  * array_send_packet -- send a GDB packet to the target with error handling. We
- *             get a '+' (ACK) back if the packet is received and the checksum
- *             matches. Otherwise a '-' (NAK) is returned. It returns a 1 for a
- *             successful transmition, or a 0 for a failure.
+ *              get a '+' (ACK) back if the packet is received and the checksum
+ *              matches. Otherwise a '-' (NAK) is returned. It returns a 1 for a
+ *              successful transmition, or a 0 for a failure.
  */
 static int
 array_send_packet (packet)
@@ -1232,83 +1280,90 @@ array_send_packet (packet)
      this may sound silly, but sometimes a garbled packet will hang
      the target board. We scan the whole thing, then print the error
      message.
-     */
-  for (i = 0; i < strlen(packet); i++) {
-    debuglogs (5, "array_send_packet(): Scanning \'%c\'\n", packet[i]);
-    /* legit hex numbers or command */
-    if ((isxdigit(packet[i])) || (isalpha(packet[i])))
-      continue;
-    switch (packet[i]) {
-    case '+':                  /* ACK */
-    case '-':                  /* NAK */
-    case '#':                  /* end of packet */
-    case '$':                  /* start of packet */
-      continue;
-    default:                   /* bogus character */
-      retries++;
-      debuglogs (4, "array_send_packet(): Found a non-ascii digit \'%c\' in the packet.\n", packet[i]);
+   */
+  for (i = 0; i < strlen (packet); i++)
+    {
+      debuglogs (5, "array_send_packet(): Scanning \'%c\'\n", packet[i]);
+      /* legit hex numbers or command */
+      if ((isxdigit (packet[i])) || (isalpha (packet[i])))
+       continue;
+      switch (packet[i])
+       {
+       case '+':               /* ACK */
+       case '-':               /* NAK */
+       case '#':               /* end of packet */
+       case '$':               /* start of packet */
+         continue;
+       default:                /* bogus character */
+         retries++;
+         debuglogs (4, "array_send_packet(): Found a non-ascii digit \'%c\' in the packet.\n", packet[i]);
+       }
     }
-  }
-#endif  
+#endif
 
   if (retries > 0)
     error ("Can't send packet, found %d non-ascii characters", retries);
 
   /* ok, try to send the packet */
   retries = 0;
-  while (retries++ <= 10) {
-    printf_monitor ("%s", packet);
-    
-    /* read until either a timeout occurs (-2) or '+' is read */
-    while (retries <= 10) {
-      c = readchar (-timeout);
-      debuglogs (3, "Reading a GDB protocol packet... Got a '%c'\n", c);
-      switch (c) {
-      case '+':
-       debuglogs (3, "Got Ack\n");
-       return 1;
-      case SERIAL_TIMEOUT:
-       debuglogs (3, "Timed out reading serial port\n");
-       printf_monitor("@");            /* resync with the monitor */
-       expect_prompt(1);               /* See if we get a expect_prompt */   
-       break;            /* Retransmit buffer */
-      case '-':
-       debuglogs (3, "Got NAK\n");
-       printf_monitor("@");            /* resync with the monitor */
-       expect_prompt(1);               /* See if we get a expect_prompt */   
-       break;
-      case '$':
-       /* it's probably an old response, or the echo of our command.
-        * just gobble up the packet and ignore it.
-        */
-       debuglogs (3, "Got a junk packet\n");
-       i = 0;
-       do {
-         c = readchar (timeout);
-         junk[i++] = c;
-       } while (c != '#');
-       c = readchar (timeout);
-       junk[i++] = c;
-       c = readchar (timeout);
-       junk[i++] = c;
-       junk[i++] = '\0';
-       debuglogs (3, "Reading a junk packet, got a \"%s\"\n", junk);
-       continue;               /* Now, go look for next packet */
-      default:
-       continue;
-      }
-      retries++;
-      debuglogs (3, "Retransmitting packet \"%s\"\n", packet);
-      break;                /* Here to retransmit */
-    }
-  } /* outer while */
+  while (retries++ <= 10)
+    {
+      printf_monitor ("%s", packet);
+
+      /* read until either a timeout occurs (-2) or '+' is read */
+      while (retries <= 10)
+       {
+         c = readchar (-timeout);
+         debuglogs (3, "Reading a GDB protocol packet... Got a '%c'\n", c);
+         switch (c)
+           {
+           case '+':
+             debuglogs (3, "Got Ack\n");
+             return 1;
+           case SERIAL_TIMEOUT:
+             debuglogs (3, "Timed out reading serial port\n");
+             printf_monitor ("@");     /* resync with the monitor */
+             expect_prompt (1);        /* See if we get a expect_prompt */
+             break;            /* Retransmit buffer */
+           case '-':
+             debuglogs (3, "Got NAK\n");
+             printf_monitor ("@");     /* resync with the monitor */
+             expect_prompt (1);        /* See if we get a expect_prompt */
+             break;
+           case '$':
+             /* it's probably an old response, or the echo of our command.
+              * just gobble up the packet and ignore it.
+              */
+             debuglogs (3, "Got a junk packet\n");
+             i = 0;
+             do
+               {
+                 c = readchar (timeout);
+                 junk[i++] = c;
+               }
+             while (c != '#');
+             c = readchar (timeout);
+             junk[i++] = c;
+             c = readchar (timeout);
+             junk[i++] = c;
+             junk[i++] = '\0';
+             debuglogs (3, "Reading a junk packet, got a \"%s\"\n", junk);
+             continue;         /* Now, go look for next packet */
+           default:
+             continue;
+           }
+         retries++;
+         debuglogs (3, "Retransmitting packet \"%s\"\n", packet);
+         break;                /* Here to retransmit */
+       }
+    }                          /* outer while */
   return 0;
 }
 
 /*
  * array_get_packet -- get a GDB packet from the target. Basically we read till we
- *             see a '#', then check the checksum. It returns a 1 if it's gotten a
- *             packet, or a 0 it the packet wasn't transmitted correctly.
+ *              see a '#', then check the checksum. It returns a 1 if it's gotten a
+ *              packet, or a 0 it the packet wasn't transmitted correctly.
  */
 static int
 array_get_packet (packet)
@@ -1325,72 +1380,81 @@ array_get_packet (packet)
 
   memset (packet, 1, PBUFSIZ);
   retries = 0;
-  while (retries <= 10) {
-    do {
-      c = readchar (timeout);
-      if (c == SERIAL_TIMEOUT) {
-       debuglogs (3, "array_get_packet: got time out from serial port.\n");
-      }
-      debuglogs (3, "Waiting for a '$', got a %c\n", c);
-    } while (c != '$');
-    
-    retries = 0;
-    while (retries <= 10) {
-      c = readchar (timeout);
-      debuglogs (3, "array_get_packet: got a '%c'\n", c);
-      switch (c) {
-      case SERIAL_TIMEOUT:
-       debuglogs (3, "Timeout in mid-packet, retrying\n");
-       return 0;
-      case '$':
-       debuglogs (3, "Saw new packet start in middle of old one\n");
-       return 0;             /* Start a new packet, count retries */
-      case '#':        
-       *bp = '\0';
-       pktcsum = from_hex (readchar (timeout)) << 4;
-       pktcsum |= from_hex (readchar (timeout));
-       if (csum == 0)
-         debuglogs (3, "\nGDB packet checksum zero, must be a bogus packet\n");
-       if (csum == pktcsum) {
-         debuglogs (3, "\nGDB packet checksum correct, packet data is \"%s\",\n", packet);
-         printf_monitor ("@");
-        expect_prompt (1);
-         return 1;
-       }
-       debuglogs (3, "Bad checksum, sentsum=0x%x, csum=0x%x\n", pktcsum, csum);
-       return 0;
-      case '*':               /* Run length encoding */
-       debuglogs (5, "Run length encoding in packet\n");
-       csum += c;
-       c = readchar (timeout);
-       csum += c;
-       c = c - ' ' + 3;      /* Compute repeat count */
-       
-       if (c > 0 && c < 255 && bp + c - 1 < packet + PBUFSIZ - 1) {
-         memset (bp, *(bp - 1), c);
-         bp += c;
-         continue;
+  while (retries <= 10)
+    {
+      do
+       {
+         c = readchar (timeout);
+         if (c == SERIAL_TIMEOUT)
+           {
+             debuglogs (3, "array_get_packet: got time out from serial port.\n");
+           }
+         debuglogs (3, "Waiting for a '$', got a %c\n", c);
        }
-       *bp = '\0';
-       printf_filtered ("Repeat count %d too large for buffer.\n", c);
-       return 0;
-       
-      default:
-       if ((!isxdigit(c)) && (!ispunct(c)))
-         debuglogs (4, "Got a non-ascii digit \'%c\'.\\n", c);
-       if (bp < packet + PBUFSIZ - 1) {
-         *bp++ = c;
-         csum += c;
-         continue;
+      while (c != '$');
+
+      retries = 0;
+      while (retries <= 10)
+       {
+         c = readchar (timeout);
+         debuglogs (3, "array_get_packet: got a '%c'\n", c);
+         switch (c)
+           {
+           case SERIAL_TIMEOUT:
+             debuglogs (3, "Timeout in mid-packet, retrying\n");
+             return 0;
+           case '$':
+             debuglogs (3, "Saw new packet start in middle of old one\n");
+             return 0;         /* Start a new packet, count retries */
+           case '#':
+             *bp = '\0';
+             pktcsum = from_hex (readchar (timeout)) << 4;
+             pktcsum |= from_hex (readchar (timeout));
+             if (csum == 0)
+               debuglogs (3, "\nGDB packet checksum zero, must be a bogus packet\n");
+             if (csum == pktcsum)
+               {
+                 debuglogs (3, "\nGDB packet checksum correct, packet data is \"%s\",\n", packet);
+                 printf_monitor ("@");
+                 expect_prompt (1);
+                 return 1;
+               }
+             debuglogs (3, "Bad checksum, sentsum=0x%x, csum=0x%x\n", pktcsum, csum);
+             return 0;
+           case '*':           /* Run length encoding */
+             debuglogs (5, "Run length encoding in packet\n");
+             csum += c;
+             c = readchar (timeout);
+             csum += c;
+             c = c - ' ' + 3;  /* Compute repeat count */
+
+             if (c > 0 && c < 255 && bp + c - 1 < packet + PBUFSIZ - 1)
+               {
+                 memset (bp, *(bp - 1), c);
+                 bp += c;
+                 continue;
+               }
+             *bp = '\0';
+             printf_filtered ("Repeat count %d too large for buffer.\n", c);
+             return 0;
+
+           default:
+             if ((!isxdigit (c)) && (!ispunct (c)))
+               debuglogs (4, "Got a non-ascii digit \'%c\'.\\n", c);
+             if (bp < packet + PBUFSIZ - 1)
+               {
+                 *bp++ = c;
+                 csum += c;
+                 continue;
+               }
+
+             *bp = '\0';
+             puts_filtered ("Remote packet too long.\n");
+             return 0;
+           }
        }
-       
-       *bp = '\0';
-       puts_filtered ("Remote packet too long.\n");
-       return 0;
-      }
     }
-  }
-  return 0; /* exceeded retries */
+  return 0;                    /* exceeded retries */
 }
 
 /*
@@ -1405,16 +1469,17 @@ ascii2hexword (mem)
   char buf[9];
 
   val = 0;
-  for (i = 0; i < 8; i++) {
-    val <<= 4;
-    if (mem[i] >= 'A' && mem[i] <= 'F')
-      val = val + mem[i] - 'A' + 10;      
-    if (mem[i] >= 'a' && mem[i] <= 'f')
-      val = val + mem[i] - 'a' + 10;
-    if (mem[i] >= '0' && mem[i] <= '9')
-      val = val + mem[i] - '0';
-    buf[i] = mem[i];
-  }
+  for (i = 0; i < 8; i++)
+    {
+      val <<= 4;
+      if (mem[i] >= 'A' && mem[i] <= 'F')
+       val = val + mem[i] - 'A' + 10;
+      if (mem[i] >= 'a' && mem[i] <= 'f')
+       val = val + mem[i] - 'a' + 10;
+      if (mem[i] >= '0' && mem[i] <= '9')
+       val = val + mem[i] - '0';
+      buf[i] = mem[i];
+    }
   buf[8] = '\0';
   debuglogs (4, "ascii2hexword() got a 0x%x from %s(%x).\n", val, buf, mem);
   return val;
@@ -1422,7 +1487,7 @@ ascii2hexword (mem)
 
 /*
  * ascii2hexword -- convert a hex value to an ascii number represented by 8
- *     digits.
+ *      digits.
  */
 static void
 hexword2ascii (mem, num)
@@ -1431,13 +1496,14 @@ hexword2ascii (mem, num)
 {
   int i;
   unsigned char ch;
-  
+
   debuglogs (4, "hexword2ascii() converting %x ", num);
-  for (i = 7; i >= 0; i--) {    
-    mem[i] = tohex ((num >> 4) & 0xf);
-    mem[i] = tohex (num & 0xf);
-    num = num >> 4;
-  }
+  for (i = 7; i >= 0; i--)
+    {
+      mem[i] = tohex ((num >> 4) & 0xf);
+      mem[i] = tohex (num & 0xf);
+      num = num >> 4;
+    }
   mem[8] = '\0';
   debuglogs (4, "\tto a %s", mem);
 }
@@ -1446,20 +1512,21 @@ hexword2ascii (mem, num)
 static int
 from_hex (a)
      int a;
-{  
+{
   if (a == 0)
     return 0;
 
-  debuglogs (4, "from_hex got a 0x%x(%c)\n",a,a);
+  debuglogs (4, "from_hex got a 0x%x(%c)\n", a, a);
   if (a >= '0' && a <= '9')
     return a - '0';
   if (a >= 'a' && a <= 'f')
     return a - 'a' + 10;
   if (a >= 'A' && a <= 'F')
     return a - 'A' + 10;
-  else {
-    error ("Reply contains invalid hex digit 0x%x", a);
-  }
+  else
+    {
+      error ("Reply contains invalid hex digit 0x%x", a);
+    }
 }
 
 /* Convert number NIB to a hex digit.  */
@@ -1468,21 +1535,21 @@ tohex (nib)
      int nib;
 {
   if (nib < 10)
-    return '0'+nib;
+    return '0' + nib;
   else
-    return 'a'+nib-10;
+    return 'a' + nib - 10;
 }
 
 /*
  * _initialize_remote_monitors -- setup a few addtitional commands that
- *             are usually only used by monitors.
+ *              are usually only used by monitors.
  */
 void
 _initialize_remote_monitors ()
 {
   /* generic monitor command */
   add_com ("monitor", class_obscure, monitor_command,
-          "Send a command to the debug monitor."); 
+          "Send a command to the debug monitor.");
 
 }
 
@@ -1492,6 +1559,6 @@ _initialize_remote_monitors ()
 void
 _initialize_array ()
 {
-  init_array_ops() ;
+  init_array_ops ();
   add_target (&array_ops);
 }
index 2efd710a6b5549f3a485f5b80b5f37cfb153f8a0..fe9e4d233e3e47e25fee3e16929ea44096ed1dec 100644 (file)
@@ -4,21 +4,22 @@
    Copyright 1992, 1993 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by K. Richard Pixley.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -38,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "remote-utils.h"
 
 
-extern int sleep();
+extern int sleep ();
 
 /* External data declarations */
 extern int stop_soon_quietly;  /* for wait_for_inferior */
@@ -47,15 +48,15 @@ extern int stop_soon_quietly;       /* for wait_for_inferior */
 extern struct target_ops bug_ops;      /* Forward declaration */
 
 /* Forward function declarations */
-static int bug_clear_breakpoints PARAMS((void));
+static int bug_clear_breakpoints PARAMS ((void));
 
-static int bug_read_memory PARAMS((CORE_ADDR memaddr,
-                                           unsigned char *myaddr,
-                                           int len));
+static int bug_read_memory PARAMS ((CORE_ADDR memaddr,
+                                   unsigned char *myaddr,
+                                   int len));
 
-static int bug_write_memory PARAMS((CORE_ADDR memaddr,
-                                            unsigned char *myaddr,
-                                            int len));
+static int bug_write_memory PARAMS ((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.  */
@@ -122,7 +123,7 @@ bug_load (args, fromtty)
 
   sr_check_open ();
 
-  dcache_flush (gr_get_dcache());
+  dcache_flush (gr_get_dcache ());
   inferior_pid = 0;
   abfd = bfd_openr (args, 0);
   if (!abfd)
@@ -200,17 +201,19 @@ get_word (p)
 }
 #endif
 
-static struct gr_settings bug_settings = {
-  NULL,        /* dcache */
-  "Bug>", /* prompt */
-  &bug_ops, /* ops */
-  bug_clear_breakpoints, /* clear_all_breakpoints */
-  bug_read_memory, /* readfunc */
-  bug_write_memory, /* writefunc */
-  gr_generic_checkin, /* checkin */
+static struct gr_settings bug_settings =
+{
+  NULL,                                /* dcache */
+  "Bug>",                      /* prompt */
+  &bug_ops,                    /* ops */
+  bug_clear_breakpoints,       /* clear_all_breakpoints */
+  bug_read_memory,             /* readfunc */
+  bug_write_memory,            /* writefunc */
+  gr_generic_checkin,          /* checkin */
 };
 
-static char *cpu_check_strings[] = {
+static char *cpu_check_strings[] =
+{
   "=",
   "Invalid Register",
 };
@@ -221,23 +224,23 @@ bug_open (args, from_tty)
      int from_tty;
 {
   if (args == NULL)
-      args = "";
+    args = "";
 
-  gr_open(args, from_tty, &bug_settings);
+  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");
+  sr_write_cr ("rs cr06");
+  sr_expect ("rs cr06");
 
-  switch (gr_multi_scan(cpu_check_strings, 0))
+  switch (gr_multi_scan (cpu_check_strings, 0))
     {
-    case 0: /* this is an m88100 */
+    case 0:                    /* this is an m88100 */
       target_is_m88110 = 0;
       break;
-    case 1: /* this is an m88110 */
+    case 1:                    /* this is an m88110 */
       target_is_m88110 = 1;
       break;
     default:
-      abort();
+      abort ();
     }
 }
 
@@ -248,19 +251,19 @@ bug_resume (pid, step, sig)
      int pid, step;
      enum target_signal sig;
 {
-  dcache_flush (gr_get_dcache());
+  dcache_flush (gr_get_dcache ());
 
   if (step)
     {
-      sr_write_cr("t");
+      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.  */
+         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");
+    sr_write_cr ("g");
 
   return;
 }
@@ -268,10 +271,11 @@ bug_resume (pid, step, sig)
 /* Wait until the remote machine stops, then return,
    storing status in STATUS just as `wait' would.  */
 
-static char *wait_strings[] = {
+static char *wait_strings[] =
+{
   "At Breakpoint",
   "Exception: Data Access Fault (Local Bus Timeout)",
-  "\r8??\?-Bug>",      /* The '\?' avoids creating a trigraph */
+  "\r8??\?-Bug>",              /* The '\?' avoids creating a trigraph */
   "\r197-Bug>",
   NULL,
 };
@@ -281,7 +285,7 @@ bug_wait (pid, status)
      int pid;
      struct target_waitstatus *status;
 {
-  int old_timeout = sr_get_timeout();
+  int old_timeout = sr_get_timeout ();
   int old_immediate_quit = immediate_quit;
 
   status->kind = TARGET_WAITKIND_EXITED;
@@ -291,31 +295,31 @@ bug_wait (pid, status)
      back out as stdout.  */
   if (need_artificial_trap == 0)
     {
-      sr_expect("Effective address: ");
-      (void) sr_get_hex_word();
+      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 */
+  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))
+  switch (gr_multi_scan (wait_strings, need_artificial_trap == 0))
     {
-    case 0: /* breakpoint case */
+    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();
+      gr_expect_prompt ();
       break;
 
-    case 1: /* bus error */
+    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();
+      gr_expect_prompt ();
       break;
 
-    case 2: /* normal case */
+    case 2:                    /* normal case */
     case 3:
       if (need_artificial_trap != 0)
        {
@@ -333,14 +337,14 @@ bug_wait (pid, status)
          break;
        }
 
-    case -1: /* trouble */
+    case -1:                   /* trouble */
     default:
       fprintf_filtered (gdb_stderr,
                        "Trouble reading target during wait\n");
       break;
     }
 
-  sr_set_timeout(old_timeout);
+  sr_set_timeout (old_timeout);
   immediate_quit = old_immediate_quit;
   return 0;
 }
@@ -353,21 +357,22 @@ static char *
 get_reg_name (regno)
      int regno;
 {
-  static char *rn[] = {
+  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. */
+  /* these get confusing because we omit a few and switch some ordering around. */
 
-    "cr01",  /* 32 = psr */
-    "fcr62", /* 33 = fpsr*/
-    "fcr63", /* 34 = fpcr */
+    "cr01",                    /* 32 = psr */
+    "fcr62",                   /* 33 = fpsr */
+    "fcr63",                   /* 34 = fpcr */
     "ip",                      /* this is something of a cheat. */
   /* 35 = sxip */
-    "cr05", /* 36 = snip */
-    "cr06", /* 37 = sfip */
+    "cr05",                    /* 36 = snip */
+    "cr06",                    /* 37 = sfip */
 
     "x00", "x01", "x02", "x03", "x04", "x05", "x06", "x07",
     "x08", "x09", "x10", "x11", "x12", "x13", "x14", "x15",
@@ -378,7 +383,7 @@ get_reg_name (regno)
   return rn[regno];
 }
 
-#if 0 /* not currently used */
+#if 0                          /* not currently used */
 /* Read from remote while the input matches STRING.  Return zero on
    success, -1 on failure.  */
 
@@ -390,16 +395,16 @@ bug_scan (s)
 
   while (*s)
     {
-      c = sr_readchar();
+      c = sr_readchar ();
       if (c != *s++)
        {
-         fflush(stdout);
-         printf("\nNext character is '%c' - %d and s is \"%s\".\n", c, c, --s);
-         return(-1);
+         fflush (stdout);
+         printf ("\nNext character is '%c' - %d and s is \"%s\".\n", c, c, --s);
+         return (-1);
        }
     }
 
-  return(0);
+  return (0);
 }
 #endif /* never */
 
@@ -412,52 +417,52 @@ bug_srec_write_cr (s)
   if (srec_echo_pace)
     for (p = s; *p; ++p)
       {
-       if (sr_get_debug() > 0)
+       if (sr_get_debug () > 0)
          printf ("%c", *p);
 
        do
-         SERIAL_WRITE(sr_get_desc(), p, 1);
-       while (sr_pollchar() != *p);
+         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);
+  return (0);
 }
 
 /* Store register REGNO, or all if REGNO == -1. */
 
 static void
-bug_fetch_register(regno)
+bug_fetch_register (regno)
      int regno;
 {
-  sr_check_open();
+  sr_check_open ();
 
   if (regno == -1)
     {
       int i;
 
       for (i = 0; i < NUM_REGS; ++i)
-       bug_fetch_register(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);
+      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_write_cr (get_reg_name (regno));
       sr_expect ("=");
       store_unsigned_integer (buffer, REGISTER_RAW_SIZE (regno),
-                             sr_get_hex_word());
+                             sr_get_hex_word ());
       gr_expect_prompt ();
       supply_register (regno, buffer);
     }
@@ -467,41 +472,41 @@ bug_fetch_register(regno)
       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("=");
+      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);
+      p = sr_get_hex_digit (1);
       fpreg_buf[0] = p << 7;
 
       /* exponent */
-      sr_expect("_");
-      p = sr_get_hex_digit(1);
+      sr_expect ("_");
+      p = sr_get_hex_digit (1);
       fpreg_buf[0] += (p << 4);
-      fpreg_buf[0] += sr_get_hex_digit(1);
+      fpreg_buf[0] += sr_get_hex_digit (1);
 
-      fpreg_buf[1] = sr_get_hex_digit(1) << 4;
+      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);
+      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);
+      gr_expect_prompt ();
+      supply_register (regno, fpreg_buf);
     }
 
   return;
@@ -514,51 +519,51 @@ bug_store_register (regno)
      int regno;
 {
   char buffer[1024];
-  sr_check_open();
+  sr_check_open ();
 
   if (regno == -1)
     {
       int i;
 
       for (i = 0; i < NUM_REGS; ++i)
-       bug_store_register(i);
+       bug_store_register (i);
     }
   else
     {
       char *regname;
 
-      regname = get_reg_name(regno);
+      regname = get_reg_name (regno);
 
       if (target_is_m88110 && regno == SFIP_REGNUM)
        return;
       else if (regno < XFP_REGNUM)
-       sprintf(buffer, "rs %s %08x",
-               regname,
-               read_register(regno));
+       sprintf (buffer, "rs %s %08x",
+                regname,
+                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]);
+         (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();
+      sr_write_cr (buffer);
+      gr_expect_prompt ();
     }
 
   return;
@@ -644,7 +649,7 @@ bug_xfer_memory (memaddr, myaddr, len, write, target)
 }
 
 static void
-start_load()
+start_load ()
 {
   char *command;
 
@@ -670,7 +675,8 @@ start_load()
    data records each containing srec_bytes, and an S7 termination
    record.  */
 
-static char *srecord_strings[] = {
+static char *srecord_strings[] =
+{
   "S-RECORD",
   "-Bug>",
   NULL,
@@ -695,22 +701,22 @@ bug_write_memory (memaddr, myaddr, len)
       done = 0;
 
       if (retries > srec_max_retries)
-       return(-1);
+       return (-1);
 
       if (retries > 0)
        {
-         if (sr_get_debug() > 0)
-           printf("\n<retrying...>\n");
+         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();
+         gr_expect_prompt ();
        }
 
-      start_load();
+      start_load ();
 
       while (done < len)
        {
@@ -730,7 +736,7 @@ bug_write_memory (memaddr, myaddr, len)
 
          checksum += (thisgo + 4 + 1
                       + (address & 0xff)
-                      + ((address >>  8) & 0xff)
+                      + ((address >> 8) & 0xff)
                       + ((address >> 16) & 0xff)
                       + ((address >> 24) & 0xff));
 
@@ -744,8 +750,8 @@ bug_write_memory (memaddr, myaddr, len)
          if (srec_noise > 0)
            {
              /* FIXME-NOW: insert a deliberate error every now and then.
-                This is intended for testing/debugging the error handling
-                stuff.  */
+                This is intended for testing/debugging the error handling
+                stuff.  */
              static int counter = 0;
              if (++counter > srec_noise)
                {
@@ -754,11 +760,11 @@ bug_write_memory (memaddr, myaddr, len)
                }
            }
 
-         sprintf(buf, "%02X", ~checksum & 0xff);
+         sprintf (buf, "%02X", ~checksum & 0xff);
          bug_srec_write_cr (buffer);
 
          if (srec_sleep != 0)
-           sleep(srec_sleep);
+           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
@@ -766,18 +772,18 @@ bug_write_memory (memaddr, myaddr, len)
             full speed from a typical sun4, error messages tend to
             appear to arrive only *after* the s7 record.   */
 
-         if ((x = sr_pollchar()) != 0)
+         if ((x = sr_pollchar ()) != 0)
            {
-             if (sr_get_debug() > 0)
-               printf("\n<retrying...>\n");
+             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();
+                at the prompt level. */
+             gr_expect_prompt ();
              /* start all over again. */
-             start_load();
+             start_load ();
              done = 0;
              continue;
            }
@@ -785,19 +791,20 @@ bug_write_memory (memaddr, myaddr, len)
          done += thisgo;
        }
 
-      bug_srec_write_cr("S7060000000000F9");
+      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);;
+         had any errors.  */
+    }
+  while (gr_multi_scan (srecord_strings, 0) == 0);;
 
-  return(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.
  * sb/sh instructions don't work on unaligned addresses, when TU=1.
  */
 
 /* Read LEN bytes from inferior memory at MEMADDR.  Put the result
@@ -817,24 +824,24 @@ bug_read_memory (memaddr, myaddr, len)
   unsigned int inaddr;
   unsigned int checksum;
 
-  sprintf(request, "du 0 %x:&%d", memaddr, len);
-  sr_write_cr(request);
+  sprintf (request, "du 0 %x:&%d", memaddr, len);
+  sr_write_cr (request);
 
-  p = buffer = alloca(len);
+  p = buffer = alloca (len);
 
   /* scan up through the header */
-  sr_expect("S0030000FC");
+  sr_expect ("S0030000FC");
 
   while (p < buffer + len)
     {
       /* scan off any white space. */
-      while (sr_readchar() != 'S') ;;
+      while (sr_readchar () != 'S');;
 
       /* what kind of s-rec? */
-      type = sr_readchar();
+      type = sr_readchar ();
 
       /* scan record size */
-      sr_get_hex_byte(&size);
+      sr_get_hex_byte (&size);
       checksum = size;
       --size;
       inaddr = 0;
@@ -847,23 +854,23 @@ bug_read_memory (memaddr, myaddr, len)
          goto done;
 
        case '3':
-         sr_get_hex_byte(&c);
+         sr_get_hex_byte (&c);
          inaddr = (inaddr << 8) + c;
          checksum += c;
          --size;
          /* intentional fall through */
        case '2':
-         sr_get_hex_byte(&c);
+         sr_get_hex_byte (&c);
          inaddr = (inaddr << 8) + c;
          checksum += c;
          --size;
          /* intentional fall through */
        case '1':
-         sr_get_hex_byte(&c);
+         sr_get_hex_byte (&c);
          inaddr = (inaddr << 8) + c;
          checksum += c;
          --size;
-         sr_get_hex_byte(&c);
+         sr_get_hex_byte (&c);
          inaddr = (inaddr << 8) + c;
          checksum += c;
          --size;
@@ -871,34 +878,34 @@ bug_read_memory (memaddr, myaddr, len)
 
        default:
          /* bonk */
-         error("reading s-records.");
+         error ("reading s-records.");
        }
 
       if (inaddr < memaddr
          || (memaddr + len) < (inaddr + size))
-       error("srec out of memory range.");
+       error ("srec out of memory range.");
 
       if (p != buffer + inaddr - memaddr)
-       error("srec out of sequence.");
+       error ("srec out of sequence.");
 
       for (; size; --size, ++p)
        {
-         sr_get_hex_byte(p);
+         sr_get_hex_byte (p);
          checksum += *p;
        }
 
-      sr_get_hex_byte(&c);
+      sr_get_hex_byte (&c);
       if (c != (~checksum & 0xff))
-       error("bad s-rec checksum");
+       error ("bad s-rec checksum");
     }
 
- done:
-  gr_expect_prompt();
+done:
+  gr_expect_prompt ();
   if (p != buffer + len)
-    return(1);
+    return (1);
 
-  memcpy(myaddr, buffer, len);
-  return(0);
+  memcpy (myaddr, buffer, len);
+  return (0);
 }
 
 #define MAX_BREAKS     16
@@ -918,13 +925,13 @@ bug_insert_breakpoint (addr, save)
       sprintf (buffer, "br %x", addr);
       sr_write_cr (buffer);
       gr_expect_prompt ();
-      return(0);
+      return (0);
     }
   else
     {
       fprintf_filtered (gdb_stderr,
                      "Too many break points, break point not installed\n");
-      return(1);
+      return (1);
     }
 
 }
@@ -951,90 +958,91 @@ static int
 bug_clear_breakpoints ()
 {
 
-  if (sr_is_open())
+  if (sr_is_open ())
     {
       sr_write_cr ("nobr");
-      sr_expect("nobr");
+      sr_expect ("nobr");
       gr_expect_prompt ();
     }
   num_brkpts = 0;
-  return(0);
+  return (0);
 }
 
-struct target_ops bug_ops ;
+struct target_ops bug_ops;
 
-static void 
-init_bug_ops(void)
+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_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_detach = gr_detach;
   bug_ops.to_require_detach = NULL;
-  bug_ops.to_resume =   bug_resume;
-  bug_ops.to_wait  =   bug_wait;
+  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_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_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_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_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_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_core_file_to_sym_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 */
+  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 ()
 {
-  init_bug_ops() ;
+  init_bug_ops ();
   add_target (&bug_ops);
 
   add_show_from_set
@@ -1093,7 +1101,7 @@ This affects the communication protocol with the remote target.",
                  "\
 Set echo-verification.\n\
 When on, use verification by echo when downloading S-records.  This is\n\
-much slower, but generally more reliable.", 
+much slower, but generally more reliable.",
                  &setlist),
      &showlist);
 }
index aaf9d6899fabf2f5fb34b52be140636658ca8044..9e4441b04fb17bf5076dea95c578f2fb32a6b215 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free
    Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "symfile.h"
 #include "target.h"
 #include "wait.h"
-/*#include "terminal.h"*/
+/*#include "terminal.h" */
 #include "gdbcmd.h"
 #include "objfiles.h"
 #include "gdb-stabs.h"
@@ -85,139 +86,140 @@ remote_d10v_translate_xfer_address (memaddr, nr_bytes, targ_addr, targ_len)
 
   /* GDB interprets addresses as:
 
-       0x00xxxxxx: Logical data address segment        (DMAP translated memory)
-       0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
-       0x10xxxxxx: Physical data memory segment        (On-chip data memory)
-       0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
-       0x12xxxxxx: Phisical unified memory segment     (Unified memory)
+     0x00xxxxxx: Logical data address segment        (DMAP translated memory)
+     0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
+     0x10xxxxxx: Physical data memory segment        (On-chip data memory)
+     0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
+     0x12xxxxxx: Phisical unified memory segment     (Unified memory)
 
      The remote d10v board interprets addresses as:
 
-       0x00xxxxxx: Phisical unified memory segment     (Unified memory)
-       0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
-       0x02xxxxxx: Physical data memory segment        (On-chip data memory)
+     0x00xxxxxx: Phisical unified memory segment     (Unified memory)
+     0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
+     0x02xxxxxx: Physical data memory segment        (On-chip data memory)
 
      Translate according to current IMAP/dmap registers */
 
-  enum {
-    targ_unified = 0x00000000,
-    targ_insn = 0x01000000,
-    targ_data = 0x02000000,
-  };
+  enum
+    {
+      targ_unified = 0x00000000,
+      targ_insn = 0x01000000,
+      targ_data = 0x02000000,
+    };
 
   seg = (memaddr >> 24);
   off = (memaddr & 0xffffffL);
 
-  switch (seg) 
+  switch (seg)
+    {
+    case 0x00:                 /* in logical data address segment */
       {
-      case 0x00: /* in logical data address segment */
-       {
-         from = "logical-data";
-         if (off <= 0x7fffL)
-           {
-             /* On chip data */
-             phys = targ_data + off;
-             if (off + nr_bytes > 0x7fffL)
-               /* don't cross VM boundary */
-               nr_bytes = 0x7fffL - off + 1;
-             to = "chip-data";
-           }
-         else if (off <= 0xbfffL)
-           {
-             short map = dmap;
-             if (map & 0x1000)
-               {
-                 /* Instruction memory */
-                 phys = targ_insn | ((map & 0xf) << 14) | (off & 0x3fff);
-                 to = "chip-insn";
-               }
-             else
-               {
-                 /* Unified memory */
-                 phys = targ_unified | ((map & 0x3ff) << 14) | (off & 0x3fff);
-                 to = "unified";
-               }
-             if (off + nr_bytes > 0xbfffL)
-               /* don't cross VM boundary */
-               nr_bytes = (0xbfffL - off + 1);
-           }       
-         else
-           {
-             /* Logical address out side of data segments, not supported */
-             *targ_len = 0;
-             return;
-           }
-         break;
-       }
-
-      case 0x01: /* in logical instruction address segment */
-       {
-         short map;
-         from = "logical-insn";
-         if (off <= 0x1ffffL)
-           {
-             map = imap0;
-           }
-         else if (off <= 0x3ffffL)
-           {
-             map = imap1;
-           }
-         else
-           {
-             /* Logical address outside of IMAP[01] segment, not
-                supported */
-             *targ_len = 0;
-             return;
-           }
-         if ((off & 0x1ffff) + nr_bytes > 0x1ffffL)
-           {
+       from = "logical-data";
+       if (off <= 0x7fffL)
+         {
+           /* On chip data */
+           phys = targ_data + off;
+           if (off + nr_bytes > 0x7fffL)
              /* don't cross VM boundary */
-             nr_bytes = 0x1ffffL - (off & 0x1ffffL) + 1;
-           }
-         if (map & 0x1000)
-           /* Instruction memory */
-           {
-             phys = targ_insn | off;
-             to = "chip-insn";
-           }
-         else
-           {
-             phys = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
-             if (phys > 0xffffffL)
-               {
-                 /* Address outside of unified address segment */
-                 *targ_len = 0;
-                 return;
-               }
-             phys |= targ_unified;
-             to = "unified";
-           }
-         break;
-       }
-
-      case 0x10: /* Physical data memory segment */
-       from = "phys-data";
-       phys = targ_data | off;
-       to = "chip-data";
-       break;
-
-      case 0x11: /* Physical instruction memory */
-       from = "phys-insn";
-       phys = targ_insn | off;
-       to = "chip-insn";
+             nr_bytes = 0x7fffL - off + 1;
+           to = "chip-data";
+         }
+       else if (off <= 0xbfffL)
+         {
+           short map = dmap;
+           if (map & 0x1000)
+             {
+               /* Instruction memory */
+               phys = targ_insn | ((map & 0xf) << 14) | (off & 0x3fff);
+               to = "chip-insn";
+             }
+           else
+             {
+               /* Unified memory */
+               phys = targ_unified | ((map & 0x3ff) << 14) | (off & 0x3fff);
+               to = "unified";
+             }
+           if (off + nr_bytes > 0xbfffL)
+             /* don't cross VM boundary */
+             nr_bytes = (0xbfffL - off + 1);
+         }
+       else
+         {
+           /* Logical address out side of data segments, not supported */
+           *targ_len = 0;
+           return;
+         }
        break;
+      }
 
-      case 0x12: /* Physical unified memory */
-       from = "phys-unified";
-       phys = targ_unified | off;
-       to = "unified";
+    case 0x01:                 /* in logical instruction address segment */
+      {
+       short map;
+       from = "logical-insn";
+       if (off <= 0x1ffffL)
+         {
+           map = imap0;
+         }
+       else if (off <= 0x3ffffL)
+         {
+           map = imap1;
+         }
+       else
+         {
+           /* Logical address outside of IMAP[01] segment, not
+              supported */
+           *targ_len = 0;
+           return;
+         }
+       if ((off & 0x1ffff) + nr_bytes > 0x1ffffL)
+         {
+           /* don't cross VM boundary */
+           nr_bytes = 0x1ffffL - (off & 0x1ffffL) + 1;
+         }
+       if (map & 0x1000)
+         /* Instruction memory */
+         {
+           phys = targ_insn | off;
+           to = "chip-insn";
+         }
+       else
+         {
+           phys = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
+           if (phys > 0xffffffL)
+             {
+               /* Address outside of unified address segment */
+               *targ_len = 0;
+               return;
+             }
+           phys |= targ_unified;
+           to = "unified";
+         }
        break;
-
-      default:
-       *targ_len = 0;
-       return;
       }
 
+    case 0x10:                 /* Physical data memory segment */
+      from = "phys-data";
+      phys = targ_data | off;
+      to = "chip-data";
+      break;
+
+    case 0x11:                 /* Physical instruction memory */
+      from = "phys-insn";
+      phys = targ_insn | off;
+      to = "chip-insn";
+      break;
+
+    case 0x12:                 /* Physical unified memory */
+      from = "phys-unified";
+      phys = targ_unified | off;
+      to = "unified";
+      break;
+
+    default:
+      *targ_len = 0;
+      return;
+    }
+
 
   *targ_addr = phys;
   *targ_len = nr_bytes;
index 9343d53bad153ec9f1b01fe0a20b3b11f14695b2..5e1017f4f7dc01c39ea8cb490586706fd6d1df34 100644 (file)
@@ -18,7 +18,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The E7000 is an in-circuit emulator for the Hitachi H8/300-H and
    Hitachi-SH processor.  It has serial port and a lan port.  
@@ -96,11 +97,11 @@ static int e7000_parse_device PARAMS ((char *args, char *dev_name,
 static serial_t e7000_desc;
 
 /* Allow user to chose between using hardware breakpoints or memory. */
-static int use_hard_breakpoints = 0; /* use sw breakpoints by default */
+static int use_hard_breakpoints = 0;   /* use sw breakpoints by default */
 
 /* Nonzero if using the tcp serial driver.  */
 
-static int using_tcp;  /* direct tcp connection to target */
+static int using_tcp;          /* direct tcp connection to target */
 static int using_tcp_remote;   /* indirect connection to target 
                                   via tcp to controller */
 
@@ -195,7 +196,7 @@ readchar (timeout)
   else if (c < 0)
     error ("Serial communication error");
 
-  if (remote_debug) 
+  if (remote_debug)
     {
       putchar_unfiltered (c);
       gdb_flush (gdb_stdout);
@@ -213,14 +214,14 @@ tl (x)
 
   p++;
   p &= 7;
-  if (x >= ' ') 
-    { 
+  if (x >= ' ')
+    {
       b[p][0] = x;
       b[p][1] = 0;
     }
   else
     {
-      sprintf(b[p], "<%d>", x);
+      sprintf (b[p], "<%d>", x);
     }
 
   return b[p];
@@ -244,20 +245,20 @@ expect (string)
       c = readchar (timeout);
 #if 0
       notice_quit ();
-      if (quit_flag == 1) 
+      if (quit_flag == 1)
        {
          if (ctrl_c)
            {
-             putchar_e7000(CTRLC);
+             putchar_e7000 (CTRLC);
              --ctrl_c;
            }
-         else 
+         else
            {
              quit ();
            }
        }
 #endif
-      
+
       if (echo)
        {
          if (c == '\r' || c == '\n')
@@ -503,11 +504,11 @@ e7000_ftp_command (args, from_tty)
   timeout = oldtimeout;
 }
 
-static int 
-e7000_parse_device (args, dev_name, baudrate) 
-    char *args;
-    char *dev_name;
-    int baudrate;
+static int
+e7000_parse_device (args, dev_name, baudrate)
+     char *args;
+     char *dev_name;
+     int baudrate;
 {
   char junk[128];
   int n = 0;
@@ -516,18 +517,18 @@ e7000_parse_device (args, dev_name, baudrate)
       strcpy (dev_name, args);
       using_pc = 1;
     }
-  else 
+  else
     {
       /* FIXME! temp hack to allow use with port master -
-            target tcp_remote <device> */
-      if (args && strncmp (args, "tcp", 10) == 0) 
-        {
+         target tcp_remote <device> */
+      if (args && strncmp (args, "tcp", 10) == 0)
+       {
          char com_type[128];
          n = sscanf (args, " %s %s %d %s", com_type, dev_name, &baudrate, junk);
-         using_tcp_remote=1;
+         using_tcp_remote = 1;
          n--;
-        }
-      else if (args) 
+       }
+      else if (args)
        {
          n = sscanf (args, " %s %d %s", dev_name, &baudrate, junk);
        }
@@ -550,7 +551,7 @@ or \t\ttarget e7000 pc\n");
        }
 #endif
       if (!using_tcp_remote && strchr (dev_name, ':'))
-        using_tcp = 1;
+       using_tcp = 1;
     }
 
   return n;
@@ -571,7 +572,7 @@ e7000_start_remote (dummy)
 
   /* Hello?  Are you there?  */
   sync = 0;
-  loop =  0;
+  loop = 0;
   try = 0;
   quit_trying = 20;
   putchar_e7000 (CTRLC);
@@ -600,20 +601,20 @@ e7000_start_remote (dummy)
          if (c == ':')
            sync = 1;
 
-         if (loop++ == 20) 
+         if (loop++ == 20)
            {
              putchar_e7000 (CTRLC);
              loop = 0;
            }
 
-         QUIT ;
+         QUIT;
 
          if (quit_flag)
            {
              putchar_e7000 (CTRLC);
              /* Was-> quit_flag = 0; */
              c = -1;
-             quit_trying = try+1;  /* we don't want to try anymore */
+             quit_trying = try + 1;    /* we don't want to try anymore */
            }
          else
            {
@@ -624,7 +625,7 @@ e7000_start_remote (dummy)
 
   if (!sync)
     {
-      fprintf_unfiltered (gdb_stderr, "Giving up after %d tries...\n",try);
+      fprintf_unfiltered (gdb_stderr, "Giving up after %d tries...\n", try);
       error ("Unable to syncronize with target.\n");
     }
 
@@ -677,11 +678,11 @@ e7000_open (args, from_tty)
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it
      (we'd be in an inconsistent state otherwise).  */
-  if (!catch_errors (e7000_start_remote, (char *)0, 
-                    "Couldn't establish connection to remote target\n", RETURN_MASK_ALL))
-  if (from_tty)
-    printf_filtered ("Remote target %s connected to %s\n", target_shortname,
-                    dev_name);
+  if (!catch_errors (e7000_start_remote, (char *) 0,
+       "Couldn't establish connection to remote target\n", RETURN_MASK_ALL))
+    if (from_tty)
+      printf_filtered ("Remote target %s connected to %s\n", target_shortname,
+                      dev_name);
 }
 
 /* Close out all files and local state before this target loses control. */
@@ -731,7 +732,7 @@ e7000_resume (pid, step, sig)
    000218           MOV.B     R1L,R2L
    STEP NORMAL END or
    BREAK POINT
  */
+ */
 
 #ifdef GDB_TARGET_IS_H8300
 
@@ -807,7 +808,7 @@ gbyte ()
 
 void
 fetch_regs_from_dump (nextchar, want)
-     int (*nextchar)();
+     int (*nextchar) ();
      char *want;
 {
   int regno;
@@ -821,9 +822,9 @@ fetch_regs_from_dump (nextchar, want)
        {
        case '\n':
          /* Skip to end of line and then eat all new line type stuff */
-         while (thischar != '\n' && thischar != '\r') 
+         while (thischar != '\n' && thischar != '\r')
            thischar = nextchar ();
-         while (thischar == '\n' || thischar == '\r') 
+         while (thischar == '\n' || thischar == '\r')
            thischar = nextchar ();
          want++;
          break;
@@ -836,24 +837,25 @@ fetch_regs_from_dump (nextchar, want)
            thischar = nextchar ();
          want++;
          break;
-         
+
        default:
          if (*want == thischar)
            {
              want++;
              if (*want)
                thischar = nextchar ();
-             
+
            }
          else if (thischar == ' ' || thischar == '\n' || thischar == '\r')
            {
              thischar = nextchar ();
            }
-         else {
-           error ("out of sync in fetch registers wanted <%s>, got <%c 0x%x>",
-                  want, thischar, thischar);
-         }
-    
+         else
+           {
+             error ("out of sync in fetch registers wanted <%s>, got <%c 0x%x>",
+                    want, thischar, thischar);
+           }
+
          break;
        case '%':
          /* Got a register command */
@@ -886,25 +888,25 @@ fetch_regs_from_dump (nextchar, want)
 #endif
 
            default:
-             if (isdigit (want[0])) 
+             if (isdigit (want[0]))
                {
                  if (isdigit (want[1]))
                    {
                      regno = (want[0] - '0') * 10 + want[1] - '0';
                      want += 2;
                    }
-                 else 
+                 else
                    {
                      regno = want[0] - '0';
                      want++;
                    }
                }
-             
+
              else
                abort ();
            }
          store_signed_integer (buf,
-                               REGISTER_RAW_SIZE(regno),
+                               REGISTER_RAW_SIZE (regno),
                                (LONGEST) get_hex (&thischar, nextchar));
          supply_register (regno, buf);
          break;
@@ -1119,17 +1121,17 @@ write_small (memaddr, myaddr, len)
 /* Write a large ammount of memory, this only works with the serial
    mode enabled.  Command is sent as
 
-       il ;s:s\r        ->
-                       <- il ;s:s\r
-                       <-      ENQ
-       ACK             ->
-                       <- LO s\r
-       Srecords...
-       ^Z              ->
-                       <-      ENQ
-       ACK             ->  
-                       <-      :       
 */
+   il ;s:s\r     ->
+   <- il ;s:s\r
+   <-   ENQ
+   ACK          ->
+   <- LO s\r
+   Srecords...
+   ^Z           ->
+   <-   ENQ
+   ACK          ->  
+   <-   :       
+ */
 
 static int
 write_large (memaddr, myaddr, len)
@@ -1205,9 +1207,9 @@ write_large (memaddr, myaddr, len)
       else
        {
          printf_unfiltered ("@%d}@", j);
-         while ((j = readchar (0)) > 0) 
+         while ((j = readchar (0)) > 0)
            {
-             printf_unfiltered ("@{%d}@",j);
+             printf_unfiltered ("@{%d}@", j);
            }
        }
     }
@@ -1243,10 +1245,10 @@ e7000_write_inferior_memory (memaddr, myaddr, len)
 /* Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns length moved. 
 
-  Small transactions we send
-  m <addr>;l
-  and receive
-    00000000 12345678 ?
+   Small transactions we send
+   m <addr>;l
+   and receive
+   00000000 12345678 ?
  */
 
 static int
@@ -1261,7 +1263,7 @@ e7000_read_inferior_memory (memaddr, myaddr, len)
   char buf[200];
   /* Starting address of this pass.  */
 
-/*  printf("READ INF %x %x %d\n", memaddr, myaddr, len);*/
+/*  printf("READ INF %x %x %d\n", memaddr, myaddr, len); */
   if (((memaddr - 1) + len) < memaddr)
     {
       errno = EIO;
@@ -1271,64 +1273,65 @@ e7000_read_inferior_memory (memaddr, myaddr, len)
   sprintf (buf, "m %x;l\r", memaddr);
   puts_e7000debug (buf);
 
-  for (count = 0; count < len; count += 4) 
+  for (count = 0; count < len; count += 4)
     {
       /* Suck away the address */
-      c = gch ();      
+      c = gch ();
       while (c != ' ')
-       c = gch ();     
+       c = gch ();
       c = gch ();
-      if (c == '*') 
+      if (c == '*')
        {                       /* Some kind of error */
-         puts_e7000debug (".\r"); /* Some errors leave us in memory input mode */
-         expect_full_prompt();
+         puts_e7000debug (".\r");      /* Some errors leave us in memory input mode */
+         expect_full_prompt ();
          return -1;
        }
       while (c != ' ')
-       c = gch ();     
+       c = gch ();
 
       /* Now read in the data */
-      for (i = 0; i < 4; i++) 
+      for (i = 0; i < 4; i++)
        {
-         int b = gbyte();
-         if (count + i < len) {
-           myaddr[count + i] = b;
-         }
+         int b = gbyte ();
+         if (count + i < len)
+           {
+             myaddr[count + i] = b;
+           }
        }
 
       /* Skip the trailing ? and send a . to end and a cr for more */
-      gch ();  
+      gch ();
       gch ();
       if (count + 4 >= len)
-       puts_e7000debug(".\r");
+       puts_e7000debug (".\r");
       else
-       puts_e7000debug("\r");
+       puts_e7000debug ("\r");
 
     }
-  expect_prompt();
+  expect_prompt ();
   return len;
 }
 
 
 
 /*
-  For large transfers we used to send
+   For large transfers we used to send
 
 
-  d <addr> <endaddr>\r
+   d <addr> <endaddr>\r
 
-  and receive
+   and receive
    <ADDRESS>           <    D   A   T   A    >               <   ASCII CODE   >
    00000000 5F FD FD FF DF 7F DF FF  01 00 01 00 02 00 08 04  "_..............."
    00000010 FF D7 FF 7F D7 F1 7F FF  00 05 00 00 08 00 40 00  "..............@."
    00000020 7F FD FF F7 7F FF FF F7  00 00 00 00 00 00 00 00  "................"
 
-  A cost in chars for each transaction of 80 + 5*n-bytes. 
+   A cost in chars for each transaction of 80 + 5*n-bytes. 
 
-  Large transactions could be done with the srecord load code, but
-  there is a pause for a second before dumping starts, which slows the
-  average rate down!
-*/
+   Large transactions could be done with the srecord load code, but
+   there is a pause for a second before dumping starts, which slows the
+   average rate down!
+ */
 
 static int
 e7000_read_inferior_memory_large (memaddr, myaddr, len)
@@ -1353,12 +1356,12 @@ e7000_read_inferior_memory_large (memaddr, myaddr, len)
 
   count = 0;
   c = gch ();
-  
+
   /* skip down to the first ">" */
-  while( c != '>' )
+  while (c != '>')
     c = gch ();
   /* now skip to the end of that line */
-  while( c != '\r' )
+  while (c != '\r')
     c = gch ();
   c = gch ();
 
@@ -1382,7 +1385,7 @@ e7000_read_inferior_memory_large (memaddr, myaddr, len)
            }
        }
       /* throw out the rest of the line */
-      while( c != '\r' )
+      while (c != '\r')
        c = gch ();
     }
 
@@ -1494,12 +1497,11 @@ e7000_xfer_inferior_memory (memaddr, myaddr, len, write, target)
      struct target_ops *target;        /* ignored */
 {
   if (write)
-    return e7000_write_inferior_memory( memaddr, myaddr, len);
-  else 
-    if( len < 16 )
-      return e7000_read_inferior_memory( memaddr, myaddr, len);
-    else
-      return e7000_read_inferior_memory_large( memaddr, myaddr, len);
+    return e7000_write_inferior_memory (memaddr, myaddr, len);
+  else if (len < 16)
+    return e7000_read_inferior_memory (memaddr, myaddr, len);
+  else
+    return e7000_read_inferior_memory_large (memaddr, myaddr, len);
 }
 
 static void
@@ -1519,13 +1521,13 @@ e7000_load (args, from_tty)
   bfd *pbfd;
   bfd_vma entry;
 #define WRITESIZE 0x1000
-  char buf[2 + 4 + 4 + WRITESIZE]; /* `DT' + <addr> + <len> + <data> */
+  char buf[2 + 4 + 4 + WRITESIZE];     /* `DT' + <addr> + <len> + <data> */
   char *filename;
   int quiet;
   int nostart;
   time_t start_time, end_time; /* Start and end times of download */
   unsigned long data_count;    /* Number of bytes transferred to memory */
-  int oldtimeout = timeout;    
+  int oldtimeout = timeout;
 
   timeout = remote_timeout;
 
@@ -1548,11 +1550,13 @@ e7000_load (args, from_tty)
     {
       char *arg;
 
-      while (isspace (*args)) args++;
+      while (isspace (*args))
+       args++;
 
       arg = args;
 
-      while ((*args != '\000') && !isspace (*args)) args++;
+      while ((*args != '\000') && !isspace (*args))
+       args++;
 
       if (*args != '\000')
        *args++ = '\000';
@@ -1578,7 +1582,7 @@ e7000_load (args, from_tty)
     }
   old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
 
-  if (!bfd_check_format (pbfd, bfd_object)) 
+  if (!bfd_check_format (pbfd, bfd_object))
     error ("\"%s\" is not an object file: %s", filename,
           bfd_errmsg (bfd_get_error ()));
 
@@ -1589,7 +1593,7 @@ e7000_load (args, from_tty)
 
   expect ("\nOK");
 
-  for (section = pbfd->sections; section; section = section->next) 
+  for (section = pbfd->sections; section; section = section->next)
     {
       if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
        {
@@ -1607,7 +1611,7 @@ e7000_load (args, from_tty)
                             section_size);
 
          fptr = 0;
-         
+
          data_count += section_size;
 
          while (section_size > 0)
@@ -1635,7 +1639,7 @@ e7000_load (args, from_tty)
              if (SERIAL_WRITE (e7000_desc, buf, count + 10))
                fprintf_unfiltered (gdb_stderr,
                                    "e7000_load: SERIAL_WRITE failed: %s\n",
-                                   safe_strerror(errno));
+                                   safe_strerror (errno));
 
              expect ("OK");
 
@@ -1680,7 +1684,7 @@ e7000_load (args, from_tty)
       if (!quiet)
        printf_unfiltered ("[Starting %s at 0x%x]\n", filename, entry);
 
-/*      start_routine (entry);*/
+/*      start_routine (entry); */
     }
 
   report_transfer_performance (data_count, start_time, end_time);
@@ -1712,7 +1716,8 @@ e7000_mourn_inferior ()
 
 /* Since we can change to soft breakpoints dynamically, we must define 
    more than enough.  Was breakaddr[MAX_E7000DEBUG_BREAKPOINTS]. */
-static CORE_ADDR breakaddr[MAX_BREAKPOINTS] = {0};
+static CORE_ADDR breakaddr[MAX_BREAKPOINTS] =
+{0};
 
 static int
 e7000_insert_breakpoint (addr, shadow)
@@ -1731,12 +1736,12 @@ e7000_insert_breakpoint (addr, shadow)
        breakaddr[i] = addr;
        /* Save old contents, and insert a nop in the space */
 #ifdef HARD_BREAKPOINTS
-       if (BC_BREAKPOINTS) 
+       if (BC_BREAKPOINTS)
          {
-           sprintf (buf, "BC%d A=%x\r", i+1, addr);
+           sprintf (buf, "BC%d A=%x\r", i + 1, addr);
            puts_e7000debug (buf);
          }
-       else 
+       else
          {
            sprintf (buf, "B %x\r", addr);
            puts_e7000debug (buf);
@@ -1772,14 +1777,14 @@ e7000_remove_breakpoint (addr, shadow)
       {
        breakaddr[i] = 0;
 #ifdef HARD_BREAKPOINTS
-       if (BC_BREAKPOINTS) 
+       if (BC_BREAKPOINTS)
          {
-           sprintf (buf, "BC%d - \r",  i+1);
+           sprintf (buf, "BC%d - \r", i + 1);
            puts_e7000debug (buf);
          }
-       else 
+       else
          {
-           sprintf (buf, "B - %x\r",  addr);
+           sprintf (buf, "B - %x\r", addr);
            puts_e7000debug (buf);
          }
        expect_prompt ();
@@ -1846,14 +1851,14 @@ e7000_drain_command (args, fromtty)
 {
   int c;
 
-  puts_e7000debug("end\r");
+  puts_e7000debug ("end\r");
   putchar_e7000 (CTRLC);
 
   while ((c = readchar (1) != -1))
     {
       if (quit_flag)
        {
-         putchar_e7000(CTRLC);
+         putchar_e7000 (CTRLC);
          quit_flag = 0;
        }
       if (c > ' ' && c < 127)
@@ -1868,7 +1873,8 @@ e7000_drain_command (args, fromtty)
 static int
 why_stop ()
 {
-  static  char *strings[NITEMS] = {
+  static char *strings[NITEMS] =
+  {
     "STEP NORMAL",
     "BREAK POINT",
     "BREAK KEY",
@@ -1883,17 +1889,17 @@ why_stop ()
 
   for (i = 0; i < NITEMS; ++i)
     p[i] = strings[i];
-  
+
   c = gch ();
   while (1)
     {
       for (i = 0; i < NITEMS; i++)
        {
-         if (c == *(p[i])) 
+         if (c == *(p[i]))
            {
              p[i]++;
-             if (*(p[i]) == 0) 
-               { 
+             if (*(p[i]) == 0)
+               {
                  /* found one of the choices */
                  return i;
                }
@@ -1911,16 +1917,16 @@ why_stop ()
 
 int
 expect_n (strings)
-char **strings;
+     char **strings;
 {
   char *(ptr[10]);
-  int n; 
+  int n;
   int c;
   char saveaway[100];
   char *buffer = saveaway;
   /* Count number of expect strings  */
 
-  for (n = 0; strings[n]; n++) 
+  for (n = 0; strings[n]; n++)
     {
       ptr[n] = strings[n];
     }
@@ -1938,7 +1944,7 @@ char **strings;
 #ifdef __GO32__
       if (kbhit ())
        {
-         int k = getkey();
+         int k = getkey ();
 
          if (k == 1)
            quit_flag = 1;
@@ -1952,7 +1958,7 @@ char **strings;
 
       for (i = 0; i < n; i++)
        {
-         if (c == ptr[i][0]) 
+         if (c == ptr[i][0])
            {
              ptr[i]++;
              if (ptr[i][0] == 0)
@@ -1967,15 +1973,15 @@ char **strings;
              ptr[i] = strings[i];
            }
        }
-    
+
       if (gotone)
        {
          /* Save it up incase we find that there was no match */
-         *buffer ++ = c;
+         *buffer++ = c;
        }
       else
        {
-         if (buffer != saveaway) 
+         if (buffer != saveaway)
            {
              *buffer++ = 0;
              printf_unfiltered ("%s", buffer);
@@ -2001,8 +2007,8 @@ sub2_from_pc ()
   char buf2[200];
 
   store_signed_integer (buf,
-                       REGISTER_RAW_SIZE(PC_REGNUM), 
-                       read_register (PC_REGNUM) -2);
+                       REGISTER_RAW_SIZE (PC_REGNUM),
+                       read_register (PC_REGNUM) - 2);
   supply_register (PC_REGNUM, buf);
   sprintf (buf2, ".PC %x\r", read_register (PC_REGNUM));
   puts_e7000debug (buf2);
@@ -2013,7 +2019,8 @@ sub2_from_pc ()
 #define WAS_RUNNING 2
 #define WAS_OTHER 3
 
-static char *estrings[] = {
+static char *estrings[] =
+{
   "** SLEEP",
   "BREAK !",
   "** PC",
@@ -2043,7 +2050,7 @@ e7000_wait (pid, status)
   while (loop)
     {
       switch (expect_n (estrings))
-       {        
+       {
        case WAS_OTHER:
          /* how did this happen ? */
          loop = 0;
@@ -2107,38 +2114,38 @@ e7000_wait (pid, status)
   switch (stop_reason)
     {
     case 1:                    /* Breakpoint */
-      write_pc (read_pc ()); /* PC is always off by 2 for breakpoints */
-      status->value.sig = TARGET_SIGNAL_TRAP;      
+      write_pc (read_pc ());   /* PC is always off by 2 for breakpoints */
+      status->value.sig = TARGET_SIGNAL_TRAP;
       break;
     case 0:                    /* Single step */
-      status->value.sig = TARGET_SIGNAL_TRAP;      
+      status->value.sig = TARGET_SIGNAL_TRAP;
       break;
     case 2:                    /* Interrupt */
       if (had_sleep)
        {
-         status->value.sig = TARGET_SIGNAL_TRAP;      
+         status->value.sig = TARGET_SIGNAL_TRAP;
          sub2_from_pc ();
        }
       else
        {
-         status->value.sig = TARGET_SIGNAL_INT;      
+         status->value.sig = TARGET_SIGNAL_INT;
        }
       break;
     case 3:
       break;
     case 4:
       printf_unfiltered ("a cycle address error?\n");
-      status->value.sig = TARGET_SIGNAL_UNKNOWN;      
+      status->value.sig = TARGET_SIGNAL_UNKNOWN;
       break;
     case 5:
-      status->value.sig = TARGET_SIGNAL_ILL;      
+      status->value.sig = TARGET_SIGNAL_ILL;
       break;
     case 6:
-      status->value.sig = TARGET_SIGNAL_SEGV;      
+      status->value.sig = TARGET_SIGNAL_SEGV;
       break;
     case 7:                    /* Anything else (NITEMS + 1) */
       printf_unfiltered ("a write protect error?\n");
-      status->value.sig = TARGET_SIGNAL_UNKNOWN;      
+      status->value.sig = TARGET_SIGNAL_UNKNOWN;
       break;
     default:
       /* Get the user's attention - this should never happen. */
@@ -2151,7 +2158,7 @@ e7000_wait (pid, status)
 /* Stop the running program.  */
 
 static void
-e7000_stop ()  
+e7000_stop ()
 {
   /* Sending a ^C is supposed to stop the running program.  */
   putchar_e7000 (CTRLC);
@@ -2159,86 +2166,86 @@ e7000_stop ()
 
 /* Define the target subroutine names. */
 
-struct target_ops e7000_ops ;
+struct target_ops e7000_ops;
 
-static void 
-init_e7000_ops(void)
+static void
+init_e7000_ops (void)
 {
-  e7000_ops.to_shortname =   "e7000";
-  e7000_ops.to_longname =   "Remote Hitachi e7000 target";
-  e7000_ops.to_doc =   "Use a remote Hitachi e7000 ICE connected by a serial line;\n\
+  e7000_ops.to_shortname = "e7000";
+  e7000_ops.to_longname = "Remote Hitachi e7000 target";
+  e7000_ops.to_doc = "Use a remote Hitachi e7000 ICE connected by a serial line;\n\
 or a network connection.\n\
 Arguments are the name of the device for the serial line,\n\
 the speed to connect at in bits per second.\n\
 eg\n\
 target e7000 /dev/ttya 9600\n\
-target e7000 foobar" ;
-  e7000_ops.to_open =   e7000_open;    
-  e7000_ops.to_close =   e7000_close;  
-  e7000_ops.to_attach =   0;
+target e7000 foobar";
+  e7000_ops.to_open = e7000_open;
+  e7000_ops.to_close = e7000_close;
+  e7000_ops.to_attach = 0;
   e7000_ops.to_post_attach = NULL;
-  e7000_ops.to_require_attach = NULL;  
-  e7000_ops.to_detach =   e7000_detach;
-  e7000_ops.to_require_detach = NULL;  
-  e7000_ops.to_resume =   e7000_resume;        
-  e7000_ops.to_wait  =   e7000_wait;
-  e7000_ops.to_post_wait = NULL;       
-  e7000_ops.to_fetch_registers  =   e7000_fetch_register;
-  e7000_ops.to_store_registers  =   e7000_store_register;
-  e7000_ops.to_prepare_to_store =   e7000_prepare_to_store;
-  e7000_ops.to_xfer_memory  =   e7000_xfer_inferior_memory;
-  e7000_ops.to_files_info  =   e7000_files_info;               
-  e7000_ops.to_insert_breakpoint =   e7000_insert_breakpoint;  
-  e7000_ops.to_remove_breakpoint =   e7000_remove_breakpoint;  
-  e7000_ops.to_terminal_init  =   0;                           
-  e7000_ops.to_terminal_inferior =   0;                                
-  e7000_ops.to_terminal_ours_for_output =   0;                 
-  e7000_ops.to_terminal_ours  =   0;                           
-  e7000_ops.to_terminal_info  =   0;                           
-  e7000_ops.to_kill  =   e7000_kill;           
-  e7000_ops.to_load  =   e7000_load;           
-  e7000_ops.to_lookup_symbol =   0;            
-  e7000_ops.to_create_inferior =   e7000_create_inferior;
+  e7000_ops.to_require_attach = NULL;
+  e7000_ops.to_detach = e7000_detach;
+  e7000_ops.to_require_detach = NULL;
+  e7000_ops.to_resume = e7000_resume;
+  e7000_ops.to_wait = e7000_wait;
+  e7000_ops.to_post_wait = NULL;
+  e7000_ops.to_fetch_registers = e7000_fetch_register;
+  e7000_ops.to_store_registers = e7000_store_register;
+  e7000_ops.to_prepare_to_store = e7000_prepare_to_store;
+  e7000_ops.to_xfer_memory = e7000_xfer_inferior_memory;
+  e7000_ops.to_files_info = e7000_files_info;
+  e7000_ops.to_insert_breakpoint = e7000_insert_breakpoint;
+  e7000_ops.to_remove_breakpoint = e7000_remove_breakpoint;
+  e7000_ops.to_terminal_init = 0;
+  e7000_ops.to_terminal_inferior = 0;
+  e7000_ops.to_terminal_ours_for_output = 0;
+  e7000_ops.to_terminal_ours = 0;
+  e7000_ops.to_terminal_info = 0;
+  e7000_ops.to_kill = e7000_kill;
+  e7000_ops.to_load = e7000_load;
+  e7000_ops.to_lookup_symbol = 0;
+  e7000_ops.to_create_inferior = e7000_create_inferior;
   e7000_ops.to_post_startup_inferior = NULL;
   e7000_ops.to_acknowledge_created_inferior = NULL;
-  e7000_ops.to_clone_and_follow_inferior = NULL;          
-  e7000_ops.to_post_follow_inferior_by_clone = NULL;  
+  e7000_ops.to_clone_and_follow_inferior = NULL;
+  e7000_ops.to_post_follow_inferior_by_clone = NULL;
   e7000_ops.to_insert_fork_catchpoint = NULL;
   e7000_ops.to_remove_fork_catchpoint = NULL;
   e7000_ops.to_insert_vfork_catchpoint = NULL;
-  e7000_ops.to_remove_vfork_catchpoint = NULL;                      
+  e7000_ops.to_remove_vfork_catchpoint = NULL;
   e7000_ops.to_has_forked = NULL;
   e7000_ops.to_has_vforked = NULL;
-  e7000_ops.to_can_follow_vfork_prior_to_exec = NULL;                        
+  e7000_ops.to_can_follow_vfork_prior_to_exec = NULL;
   e7000_ops.to_post_follow_vfork = NULL;
   e7000_ops.to_insert_exec_catchpoint = NULL;
   e7000_ops.to_remove_exec_catchpoint = NULL;
   e7000_ops.to_has_execd = NULL;
   e7000_ops.to_reported_exec_events_per_exec_call = NULL;
   e7000_ops.to_has_exited = NULL;
-  e7000_ops.to_mourn_inferior =   e7000_mourn_inferior;                
-  e7000_ops.to_can_run  =   0;                 
-  e7000_ops.to_notice_signals =   0;           
-  e7000_ops.to_thread_alive  =   0;            
-  e7000_ops.to_stop  =   e7000_stop;
-  e7000_ops.to_pid_to_exec_file = NULL;        
+  e7000_ops.to_mourn_inferior = e7000_mourn_inferior;
+  e7000_ops.to_can_run = 0;
+  e7000_ops.to_notice_signals = 0;
+  e7000_ops.to_thread_alive = 0;
+  e7000_ops.to_stop = e7000_stop;
+  e7000_ops.to_pid_to_exec_file = NULL;
   e7000_ops.to_core_file_to_sym_file = NULL;
-  e7000_ops.to_stratum =   process_stratum;    
-  e7000_ops.DONT_USE =   0;                    
-  e7000_ops.to_has_all_memory =   1;           
-  e7000_ops.to_has_memory =   1;               
-  e7000_ops.to_has_stack =   1;                        
-  e7000_ops.to_has_registers =   1;            
-  e7000_ops.to_has_execution =   1;            
-  e7000_ops.to_sections =   0;                 
-  e7000_ops.to_sections_end =   0;             
-  e7000_ops.to_magic =   OPS_MAGIC;            
+  e7000_ops.to_stratum = process_stratum;
+  e7000_ops.DONT_USE = 0;
+  e7000_ops.to_has_all_memory = 1;
+  e7000_ops.to_has_memory = 1;
+  e7000_ops.to_has_stack = 1;
+  e7000_ops.to_has_registers = 1;
+  e7000_ops.to_has_execution = 1;
+  e7000_ops.to_sections = 0;
+  e7000_ops.to_sections_end = 0;
+  e7000_ops.to_magic = OPS_MAGIC;
 };
 
 void
 _initialize_remote_e7000 ()
 {
-  init_e7000_ops() ;
+  init_e7000_ops ();
   add_target (&e7000_ops);
 
   add_com ("e7000", class_obscure, e7000_command,
@@ -2254,7 +2261,7 @@ _initialize_remote_e7000 ()
           "Drain pending e7000 text buffers.");
 
   add_show_from_set (add_set_cmd ("usehardbreakpoints", no_class,
-                                 var_integer, (char *)&use_hard_breakpoints,
-                                 "Set use of hardware breakpoints for all breakpoints.\n", &setlist),
+                               var_integer, (char *) &use_hard_breakpoints,
+       "Set use of hardware breakpoints for all breakpoints.\n", &setlist),
                     &showlist);
 }
index d3a3c4169c16cef2afcc134a21b23e7989247914..95cf7acd9bf1954fcdfae813ae881bbb2fb49070 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by Jim Kingdon for Cygnus.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is like remote.c but is for an esoteric situation--
    having a a29k board in a PC hooked up to a unix machine with
@@ -41,9 +42,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "gdbcore.h"
 
-extern struct target_ops eb_ops;               /* Forward declaration */
+extern struct target_ops eb_ops;       /* Forward declaration */
 
-static void eb_close();
+static void eb_close ();
 
 #define LOG_FILE "eb.log"
 #if defined (LOG_FILE)
@@ -103,7 +104,7 @@ expect (string)
   immediate_quit = 1;
   while (1)
     {
-      if (readchar() == *p)
+      if (readchar () == *p)
        {
          p++;
          if (*p == '\0')
@@ -194,7 +195,7 @@ get_hex_regs (n, regno)
   for (i = 0; i < n; i++)
     {
       int j;
-      
+
       val = 0;
       for (j = 0; j < 8; j++)
        val = (val << 4) + get_hex_digit (j == 0);
@@ -206,7 +207,8 @@ get_hex_regs (n, regno)
 #ifndef HAVE_TERMIO
 
 #ifndef __STDC__
-#define volatile /**/
+#define volatile
+/**/
 #endif
 volatile int n_alarms;
 
@@ -259,7 +261,7 @@ eb_create_inferior (execfile, args, env)
     fprintf (eb_stream, "YC D,0:%s", prog_name);
 
     if (args != NULL)
-       fprintf(eb_stream, " %s", args);
+      fprintf (eb_stream, " %s", args);
 
     fprintf (eb_stream, "\n");
     fflush (eb_stream);
@@ -285,7 +287,7 @@ eb_create_inferior (execfile, args, env)
   target_terminal_inferior ();
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
-  proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);             /* Let 'er rip... */
+  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);    /* Let 'er rip... */
 }
 
 /* Translate baud rates from integers to damn B_codes.  Unix should
@@ -298,34 +300,92 @@ eb_create_inferior (execfile, args, env)
 #define B38400 EXTB
 #endif
 
-struct {int rate, damn_b;} baudtab[] = {
-       {0, B0},
-       {50, B50},
-       {75, B75},
-       {110, B110},
-       {134, B134},
-       {150, B150},
-       {200, B200},
-       {300, B300},
-       {600, B600},
-       {1200, B1200},
-       {1800, B1800},
-       {2400, B2400},
-       {4800, B4800},
-       {9600, B9600},
-       {19200, B19200},
-       {38400, B38400},
-       {-1, -1},
+struct
+{
+  int rate, damn_b;
+}
+baudtab[] =
+{
+  {
+    0, B0
+  }
+  ,
+  {
+    50, B50
+  }
+  ,
+  {
+    75, B75
+  }
+  ,
+  {
+    110, B110
+  }
+  ,
+  {
+    134, B134
+  }
+  ,
+  {
+    150, B150
+  }
+  ,
+  {
+    200, B200
+  }
+  ,
+  {
+    300, B300
+  }
+  ,
+  {
+    600, B600
+  }
+  ,
+  {
+    1200, B1200
+  }
+  ,
+  {
+    1800, B1800
+  }
+  ,
+  {
+    2400, B2400
+  }
+  ,
+  {
+    4800, B4800
+  }
+  ,
+  {
+    9600, B9600
+  }
+  ,
+  {
+    19200, B19200
+  }
+  ,
+  {
+    38400, B38400
+  }
+  ,
+  {
+    -1, -1
+  }
+  ,
 };
 
-int damn_b (rate)
+int
+damn_b (rate)
      int rate;
 {
   int i;
 
   for (i = 0; baudtab[i].rate != -1; i++)
-    if (rate == baudtab[i].rate) return baudtab[i].damn_b;
-  return B38400;       /* Random */
+    if (rate == baudtab[i].rate)
+      return baudtab[i].damn_b;
+  return B38400;               /* Random */
 }
 
 
@@ -345,7 +405,7 @@ eb_open (name, from_tty)
   char *p;
 
   target_preopen (from_tty);
-  
+
   /* Find the first whitespace character, it separates dev_name from
      prog_name.  */
   if (name == 0)
@@ -355,7 +415,7 @@ eb_open (name, from_tty)
        *p != '\0' && !isspace (*p); p++)
     ;
   if (*p == '\0')
-erroid:
+  erroid:
     error ("\
 Please include the name of the device for the serial port,\n\
 the baud rate, and the name of the program to run on the remote system.");
@@ -365,17 +425,17 @@ the baud rate, and the name of the program to run on the remote system.");
 
   /* Skip over the whitespace after dev_name */
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (1 != sscanf (p, "%d ", &baudrate))
     goto erroid;
 
   /* Skip the number and then the spaces */
   for (; isdigit (*p); p++)
-    /*EMPTY*/;
+    /*EMPTY */ ;
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (prog_name != NULL)
     free (prog_name);
   prog_name = savestring (p, strlen (p));
@@ -427,7 +487,7 @@ the baud rate, and the name of the program to run on the remote system.");
 
   /* Hello?  Are you there?  */
   write (eb_desc, "\n", 1);
-  
+
   expect_prompt ();
 }
 
@@ -442,21 +502,22 @@ eb_close (quitting)
      but also the file descriptor.  So we don't actually close
      eb_desc.  */
   if (eb_stream)
-    fclose (eb_stream);        /* This also closes eb_desc */
+    fclose (eb_stream);                /* This also closes eb_desc */
   if (eb_desc >= 0)
     /* close (eb_desc); */
 
-  /* Do not try to close eb_desc again, later in the program.  */
-  eb_stream = NULL;
+    /* Do not try to close eb_desc again, later in the program.  */
+    eb_stream = NULL;
   eb_desc = -1;
 
 #if defined (LOG_FILE)
-  if (log_file) {
-    if (ferror (log_file))
-      printf ("Error writing log file.\n");
-    if (fclose (log_file) != 0)
-      printf ("Error closing log file.\n");
-  }
+  if (log_file)
+    {
+      if (ferror (log_file))
+       printf ("Error writing log file.\n");
+      if (fclose (log_file) != 0)
+       printf ("Error closing log file.\n");
+    }
 #endif
 }
 
@@ -467,11 +528,11 @@ void
 eb_detach (from_tty)
      int from_tty;
 {
-  pop_target();                /* calls eb_close to do the real work */
+  pop_target ();               /* calls eb_close to do the real work */
   if (from_tty)
     printf ("Ending remote %s debugging\n", target_shortname);
 }
+
 /* Tell the remote machine to resume.  */
 
 void
@@ -500,7 +561,7 @@ eb_resume (pid, step, sig)
        {
          need_gi = 0;
          write (eb_desc, "gi\n", 3);
-         
+
          /* Swallow the echo of "gi".  */
          expect ("gi\r");
        }
@@ -524,7 +585,7 @@ eb_wait (status)
      Note that with the algorithm we use, the initial character
      of the string cannot recur in the string, or we will not
      find some cases of the string in the input.  */
-  
+
   static char bpt[] = "Invalid interrupt taken - #0x50 - ";
   /* It would be tempting to look for "\n[__exit + 0x8]\n"
      but that requires loading symbols with "yc i" and even if
@@ -554,7 +615,7 @@ eb_wait (status)
       return 0;
     }
 
-  timeout = 0;         /* Don't time out -- user program is running. */
+  timeout = 0;                 /* Don't time out -- user program is running. */
   while (1)
     {
       ch_handled = 0;
@@ -592,12 +653,12 @@ eb_wait (status)
          for (p = swallowed; p < swallowed_p; ++p)
            putc (*p, stdout);
          swallowed_p = swallowed;
-         
+
          putc (ch, stdout);
        }
     }
   expect_prompt ();
-  if (*bp== '\0')
+  if (*bp == '\0')
     {
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
@@ -674,7 +735,7 @@ eb_fetch_registers ()
   for (i = 0; i < 128; i += 32)
     {
       /* The PC has a tendency to hang if we get these
-        all in one fell swoop ("dw lr0,lr127").  */
+         all in one fell swoop ("dw lr0,lr127").  */
       sprintf (tempbuf, "dw lr%d\n", i);
       write (eb_desc, tempbuf, strlen (tempbuf));
       for (reg_index = i, regnum_index = LR0_REGNUM + i;
@@ -806,11 +867,11 @@ eb_store_register (regno)
       char *name = get_reg_name (regno);
       fprintf (eb_stream, "s %s,%x\n", name, read_register (regno));
       /* Setting GR1 changes the numbers of all the locals, so
-        invalidate the register cache.  Do this *after* calling
-        read_register, because we want read_register to return the
-        value that write_register has just stuffed into the registers
-        array, not the value of the register fetched from the
-        inferior.  */
+         invalidate the register cache.  Do this *after* calling
+         read_register, because we want read_register to return the
+         value that write_register has just stuffed into the registers
+         array, not the value of the register fetched from the
+         inferior.  */
       if (regno == GR1_REGNUM)
        registers_changed ();
       expect_prompt ();
@@ -837,7 +898,7 @@ eb_xfer_inferior_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   if (write)
     return eb_write_inferior_memory (memaddr, myaddr, len);
@@ -868,11 +929,11 @@ eb_write_inferior_memory (memaddr, myaddr, len)
        fprintf (eb_stream, "sb %x,", memaddr + i);
       if ((i % 16) == 15 || i == len - 1)
        {
-         fprintf (eb_stream, "%x\n", ((unsigned char *)myaddr)[i]);
+         fprintf (eb_stream, "%x\n", ((unsigned char *) myaddr)[i]);
          expect_prompt ();
        }
       else
-       fprintf (eb_stream, "%x,", ((unsigned char *)myaddr)[i]);
+       fprintf (eb_stream, "%x,", ((unsigned char *) myaddr)[i]);
     }
   return len;
 }
@@ -880,7 +941,7 @@ eb_write_inferior_memory (memaddr, myaddr, len)
 /* Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns length moved.  */
 int
-eb_read_inferior_memory(memaddr, myaddr, len)
+eb_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
@@ -905,11 +966,12 @@ eb_read_inferior_memory(memaddr, myaddr, len)
      eb_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 (((memaddr - 1) + len) < memaddr)
+    {
+      errno = EIO;
+      return 0;
+    }
+
   startaddr = memaddr;
   count = 0;
   while (count < len)
@@ -956,7 +1018,7 @@ eb_kill (args, from_tty)
      char *args;
      int from_tty;
 {
-  return;              /* Ignore attempts to kill target system */
+  return;                      /* Ignore attempts to kill target system */
 }
 
 /* Clean up when a program exits.
@@ -974,83 +1036,83 @@ eb_mourn_inferior ()
 }
 /* Define the target subroutine names */
 
-struct target_ops eb_ops ;
+struct target_ops eb_ops;
 
-static void 
-init_eb_ops(void)
+static void
+init_eb_ops (void)
 {
-  eb_ops.to_shortname =        "amd-eb";
-  eb_ops.to_longname =         "Remote serial AMD EBMON target";
-  eb_ops.to_doc =      "Use a remote computer running EBMON connected by a serial line.\n\
+  eb_ops.to_shortname = "amd-eb";
+  eb_ops.to_longname = "Remote serial AMD EBMON target";
+  eb_ops.to_doc = "Use a remote computer running EBMON connected by a serial line.\n\
 Arguments are the name of the device for the serial line,\n\
 the speed to connect at in bits per second, and the filename of the\n\
 executable as it exists on the remote computer.  For example,\n\
 target amd-eb /dev/ttya 9600 demo",
-    eb_ops.to_open =   eb_open;
-  eb_ops.to_close =    eb_close;
-  eb_ops.to_attach =   0;
+    eb_ops.to_open = eb_open;
+  eb_ops.to_close = eb_close;
+  eb_ops.to_attach = 0;
   eb_ops.to_post_attach = NULL;
   eb_ops.to_require_attach = NULL;
-  eb_ops.to_detach =   eb_detach;
+  eb_ops.to_detach = eb_detach;
   eb_ops.to_require_detach = NULL;
-  eb_ops.to_resume =   eb_resume;
-  eb_ops.to_wait  =    eb_wait;
+  eb_ops.to_resume = eb_resume;
+  eb_ops.to_wait = eb_wait;
   eb_ops.to_post_wait = NULL;
-  eb_ops.to_fetch_registers  =         eb_fetch_register;
-  eb_ops.to_store_registers  =         eb_store_register;
-  eb_ops.to_prepare_to_store =         eb_prepare_to_store;
-  eb_ops.to_xfer_memory  =     eb_xfer_inferior_memory;
-  eb_ops.to_files_info  =      eb_files_info;
-  eb_ops.to_insert_breakpoint =        0;
-  eb_ops.to_remove_breakpoint =        0;      /* Breakpoints */
-  eb_ops.to_terminal_init  =   0;
-  eb_ops.to_terminal_inferior =        0;
-  eb_ops.to_terminal_ours_for_output =         0;
-  eb_ops.to_terminal_ours  =   0;
-  eb_ops.to_terminal_info  =   0;      /* Terminal handling */
-  eb_ops.to_kill  =    eb_kill;
-  eb_ops.to_load  =    generic_load;   /* load */
-  eb_ops.to_lookup_symbol =    0; /* lookup_symbol */
-  eb_ops.to_create_inferior =  eb_create_inferior;
+  eb_ops.to_fetch_registers = eb_fetch_register;
+  eb_ops.to_store_registers = eb_store_register;
+  eb_ops.to_prepare_to_store = eb_prepare_to_store;
+  eb_ops.to_xfer_memory = eb_xfer_inferior_memory;
+  eb_ops.to_files_info = eb_files_info;
+  eb_ops.to_insert_breakpoint = 0;
+  eb_ops.to_remove_breakpoint = 0;     /* Breakpoints */
+  eb_ops.to_terminal_init = 0;
+  eb_ops.to_terminal_inferior = 0;
+  eb_ops.to_terminal_ours_for_output = 0;
+  eb_ops.to_terminal_ours = 0;
+  eb_ops.to_terminal_info = 0; /* Terminal handling */
+  eb_ops.to_kill = eb_kill;
+  eb_ops.to_load = generic_load;       /* load */
+  eb_ops.to_lookup_symbol = 0; /* lookup_symbol */
+  eb_ops.to_create_inferior = eb_create_inferior;
   eb_ops.to_post_startup_inferior = NULL;
   eb_ops.to_acknowledge_created_inferior = NULL;
-  eb_ops.to_clone_and_follow_inferior = NULL;      
+  eb_ops.to_clone_and_follow_inferior = NULL;
   eb_ops.to_post_follow_inferior_by_clone = NULL;
   eb_ops.to_insert_fork_catchpoint = NULL;
   eb_ops.to_remove_fork_catchpoint = NULL;
   eb_ops.to_insert_vfork_catchpoint = NULL;
-  eb_ops.to_remove_vfork_catchpoint = NULL;                  
+  eb_ops.to_remove_vfork_catchpoint = NULL;
   eb_ops.to_has_forked = NULL;
-  eb_ops.to_has_vforked = NULL;            
-  eb_ops.to_can_follow_vfork_prior_to_exec = NULL;        
+  eb_ops.to_has_vforked = NULL;
+  eb_ops.to_can_follow_vfork_prior_to_exec = NULL;
   eb_ops.to_post_follow_vfork = NULL;
   eb_ops.to_insert_exec_catchpoint = NULL;
   eb_ops.to_remove_exec_catchpoint = NULL;
   eb_ops.to_has_execd = NULL;
   eb_ops.to_reported_exec_events_per_exec_call = NULL;
   eb_ops.to_has_exited = NULL;
-  eb_ops.to_mourn_inferior =   eb_mourn_inferior;
-  eb_ops.to_can_run  =         0;      /* can_run */
-  eb_ops.to_notice_signals =           0; /* notice_signals */
-  eb_ops.to_thread_alive  =    0; /* thread-alive */
-  eb_ops.to_stop  =    0;                      /* to_stop */
+  eb_ops.to_mourn_inferior = eb_mourn_inferior;
+  eb_ops.to_can_run = 0;       /* can_run */
+  eb_ops.to_notice_signals = 0;        /* notice_signals */
+  eb_ops.to_thread_alive = 0;  /* thread-alive */
+  eb_ops.to_stop = 0;          /* to_stop */
   eb_ops.to_pid_to_exec_file = NULL;
   eb_ops.to_core_file_to_sym_file = NULL;
-  eb_ops.to_stratum =  process_stratum;
-  eb_ops.DONT_USE =    0; /* next */
-  eb_ops.to_has_all_memory =   1;
-  eb_ops.to_has_memory =       1;
-  eb_ops.to_has_stack =        1;
-  eb_ops.to_has_registers =    1;
-  eb_ops.to_has_execution =    1;      /* all mem, mem, stack, regs, exec */
-  eb_ops.to_sections =         0; /* sections */
-  eb_ops.to_sections_end =     0; /* sections end */
-  eb_ops.to_magic =    OPS_MAGIC;              /* Always the last thing */
+  eb_ops.to_stratum = process_stratum;
+  eb_ops.DONT_USE = 0;         /* next */
+  eb_ops.to_has_all_memory = 1;
+  eb_ops.to_has_memory = 1;
+  eb_ops.to_has_stack = 1;
+  eb_ops.to_has_registers = 1;
+  eb_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */
+  eb_ops.to_sections = 0;      /* sections */
+  eb_ops.to_sections_end = 0;  /* sections end */
+  eb_ops.to_magic = OPS_MAGIC; /* Always the last thing */
 };
 
 void
 _initialize_remote_eb ()
 {
-  init_eb_ops() ;
+  init_eb_ops ();
   add_target (&eb_ops);
 }
index d26e85b7890b0ae4bcab0cb092adc9150615a4eb..b433fe8e8083b94079f7ae3412b741191e6086cf 100644 (file)
@@ -7,87 +7,88 @@
    TT/SJ. It was modified for gdb 4.0 by TX/DK Jan Nordenand by TX/DKG
    Harald Johansen.
 
-This file is part of GDB.
+   This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+   GDB is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 1, or (at your option)
+   any later version.
 
-GDB is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GDB is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 /* Emulator communication protocol.
    All values are encoded in ascii hex digits.
 
-        Request
-Command
-Reply
-       read registers:
-DR<cr>
-     - 0 -    - 1 -    - 2 -    - 3 -      - 4 -    - 5 -    -- 6 -   - 7 - 
-D = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX   XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
-A = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX   XXXXXXXX XXXXXXXX XXXXXXXX 
-    PC = XXXXXX       SSP = XXXXXX    USP = XXXXXX     SR = XXXXXXXX
- >
-Each byte of register data is described by two hex digits.
-
-       write regs
-D0=XXXXXXXX<cr>
- >D1=XXXXXXXX<cr>
- >D2=XXXXXXXX<cr>
- >D3=XXXXXXXX<cr>
- >D4=XXXXXXXX<cr>
- >D5=XXXXXXXX<cr>
- >D6=XXXXXXXX<cr>
- >D7=XXXXXXXX<cr>
- >A0=XXXXXXXX<cr>
- >A1=XXXXXXXX<cr>
- >A2=XXXXXXXX<cr>
- >A3=XXXXXXXX<cr>
- >A4=XXXXXXXX<cr>
- >A5=XXXXXXXX<cr>
- >A6=XXXXXXXX<cr>
- >A7=XXXXXXXX<cr>
- >SR=XXXXXXXX<cr>
- >PC=XXXXXX<cr>
- >
-Each byte of register data is described by two hex digits.
-
-       read mem
-@.BAA..AA
-$FFFFFFXX
- >
-AA..AA is address, XXXXXXX is the contents
-
-       write mem
-       @.BAA..AA=$XXXXXXXX
- >
-AA..AA is address, XXXXXXXX is data
-
-       cont
-PC=$AA..AA
- >RBK
-R>
-AA..AA is address to resume. If AA..AA is omitted, resume at same address.
-
-       step
-PC=$AA..AA
- >STP
-R>
-AA..AA is address to resume. If AA..AA is omitted, resume at same address.
-
-       kill req
-STP
- >
-*/
+   Request
+   Command
+   Reply
+   read registers:
+   DR<cr>
+   - 0 -    - 1 -    - 2 -    - 3 -      - 4 -    - 5 -    -- 6 -   - 7 - 
+   D = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX   XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
+   A = XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX   XXXXXXXX XXXXXXXX XXXXXXXX 
+   PC = XXXXXX       SSP = XXXXXX    USP = XXXXXX     SR = XXXXXXXX
  >
+   Each byte of register data is described by two hex digits.
+
+   write regs
+   D0=XXXXXXXX<cr>
  >D1=XXXXXXXX<cr>
  >D2=XXXXXXXX<cr>
  >D3=XXXXXXXX<cr>
  >D4=XXXXXXXX<cr>
  >D5=XXXXXXXX<cr>
  >D6=XXXXXXXX<cr>
  >D7=XXXXXXXX<cr>
  >A0=XXXXXXXX<cr>
  >A1=XXXXXXXX<cr>
  >A2=XXXXXXXX<cr>
  >A3=XXXXXXXX<cr>
  >A4=XXXXXXXX<cr>
  >A5=XXXXXXXX<cr>
  >A6=XXXXXXXX<cr>
  >A7=XXXXXXXX<cr>
  >SR=XXXXXXXX<cr>
  >PC=XXXXXX<cr>
  >
+   Each byte of register data is described by two hex digits.
+
+   read mem
+   @.BAA..AA
+   $FFFFFFXX
  >
+   AA..AA is address, XXXXXXX is the contents
+
+   write mem
+   @.BAA..AA=$XXXXXXXX
  >
+   AA..AA is address, XXXXXXXX is data
+
+   cont
+   PC=$AA..AA
  >RBK
+   R>
+   AA..AA is address to resume. If AA..AA is omitted, resume at same address.
+
+   step
+   PC=$AA..AA
  >STP
+   R>
+   AA..AA is address to resume. If AA..AA is omitted, resume at same address.
+
+   kill req
+   STP
  >
+ */
 
 
 #include <stdio.h>
@@ -117,7 +118,7 @@ es1800_child_detach PARAMS ((char *, int));
 static void
 es1800_child_open PARAMS ((char *, int));
 
-static void 
+static void
 es1800_transparent PARAMS ((char *, int));
 
 static void
@@ -145,7 +146,7 @@ static int
 es1800_xfer_inferior_memory PARAMS ((CORE_ADDR, char *, int, int,
                                     struct target_ops *));
 
-static void 
+static void
 es1800_prepare_to_store PARAMS ((void));
 
 static int es1800_wait PARAMS ((int, struct target_waitstatus *));
@@ -246,14 +247,14 @@ es1800_init_break PARAMS ((char *, int));
 static FILE *log_file;
 #endif
 
-extern struct target_ops es1800_ops;           /* Forward decl */
+extern struct target_ops es1800_ops;   /* Forward decl */
 extern struct target_ops es1800_child_ops;     /* Forward decl */
 
 static int kiodebug;
-static int timeout = 100; 
-static char *savename;                         /* Name of i/o device used */
+static int timeout = 100;
+static char *savename;         /* Name of i/o device used */
 static serial_ttystate es1800_saved_ttystate;
-static int es1800_fc_save;                     /* Save fcntl state */
+static int es1800_fc_save;     /* Save fcntl state */
 
 /* indicates that the emulator uses 32-bit data-adress (68020-mode) 
    instead of 24-bit (68000 -mode) */
@@ -280,7 +281,7 @@ static serial_t es1800_desc = NULL;
 static int es1800_break_vec = 0;
 static char es1800_break_insn[2];
 static long es1800_break_address;
-static void (*old_sigint)();           /* Old signal-handler for sigint */
+static void (*old_sigint) ();  /* Old signal-handler for sigint */
 static jmp_buf interrupt;
 
 /* Local signalhandler to allow breaking tranfers or program run.
@@ -297,7 +298,7 @@ es1800_request_quit ()
 
 /* Reset emulator.
    Sending reset character(octal 32) to emulator.
-   quit - return to '(esgdb)' prompt or continue       */
+   quit - return to '(esgdb)' prompt or continue        */
 
 static void
 es1800_reset (quit)
@@ -338,7 +339,7 @@ es1800_open (name, from_tty)
 
   m68020 = 0;
 
-  if (!name)           /* no device name given in target command */
+  if (!name)                   /* no device name given in target command */
     {
       error_no_arg ("serial port device name");
     }
@@ -365,7 +366,7 @@ es1800_open (name, from_tty)
     }
   es1800_fc_save = fcflag;
 
-  fcflag = (fcflag & (FREAD | FWRITE)); /* mask out any funny stuff */
+  fcflag = (fcflag & (FREAD | FWRITE));                /* mask out any funny stuff */
   if (fcntl (es1800_desc->fd, F_SETFL, fcflag) == -1)
     {
       perror_with_name ("fcntl serial");
@@ -386,7 +387,7 @@ es1800_open (name, from_tty)
      response to a command, which would be bad.  */
   SERIAL_FLUSH_INPUT (es1800_desc);
 
-#endif /* DEBUG_STDIN */
+#endif /* DEBUG_STDIN */
 
   push_target (&es1800_ops);   /* Switch to using remote target now */
   if (from_tty)
@@ -402,29 +403,37 @@ es1800_open (name, from_tty)
       perror_with_name (LOG_FILE);
     }
 
-#endif /* LOG_FILE */
+#endif /* LOG_FILE */
 
   /* Hello?  Are you there?, also check mode  */
 
   /*  send_with_reply( "DB 0 TO 1", buf, sizeof(buf)); */
-  /*  for (p = buf, i = 0; *p++ =='0';)  */   /* count the number of zeros */
+  /*  for (p = buf, i = 0; *p++ =='0';)  *//* count the number of zeros */
   /*      i++; */
 
   send ("\032");
-  getmessage (buf, sizeof (buf));  /* send reset character */
+  getmessage (buf, sizeof (buf));      /* send reset character */
 
   if (from_tty)
     {
       printf ("Checking mode.... ");
     }
-  /*  m68020 = (i==8); */   /* if eight zeros then we are in m68020 mode */
+  /*  m68020 = (i==8); *//* if eight zeros then we are in m68020 mode */
 
-  /* What kind of processor am i talking to ?*/
+  /* What kind of processor am i talking to ? */
   p = buf;
-  while (*p++ != '\n') {;}
-  while (*p++ != '\n') {;}
-  while (*p++ != '\n') {;}
-  for (i = 0; i < 20; i++, p++) {;}
+  while (*p++ != '\n')
+    {;
+    }
+  while (*p++ != '\n')
+    {;
+    }
+  while (*p++ != '\n')
+    {;
+    }
+  for (i = 0; i < 20; i++, p++)
+    {;
+    }
   m68020 = !strncmp (p, "68020", 5);
   if (from_tty)
     {
@@ -450,7 +459,7 @@ es1800_open (name, from_tty)
 }
 
 /*  Close out all files and local state before this target loses control.
-    quitting - are we quitting gdb now? */
+   quitting - are we quitting gdb now? */
 
 static void
 es1800_close (quitting)
@@ -486,18 +495,18 @@ es1800_close (quitting)
       log_file = NULL;
     }
 
-#endif /* LOG_FILE */
+#endif /* LOG_FILE */
 
 }
 
 /*  Attaches to a process on the target side
-    proc_id  - the id of the process to be attached.
-    from_tty - says whether to be verbose or not */
+   proc_id  - the id of the process to be attached.
+   from_tty - says whether to be verbose or not */
 
 static void
 es1800_attach (args, from_tty)
-    char *args;
-    int from_tty;
+     char *args;
+     int from_tty;
 {
   error ("Cannot attach to pid %s, this feature is not implemented yet.",
         args);
@@ -510,7 +519,7 @@ es1800_attach (args, from_tty)
    Close the open connection to the remote debugger.
    Use this when you want to detach and do something else
    with your gdb.
+
    args     - arguments given to the 'detach' command
    from_tty - says whether to be verbose or not */
 
@@ -549,7 +558,7 @@ es1800_resume (pid, step, siggnal)
     }
   if (step)
     {
-      strcpy (buf,"STP\r");
+      strcpy (buf, "STP\r");
       send (buf);
     }
   else
@@ -561,7 +570,7 @@ es1800_resume (pid, step, siggnal)
 /* Wait until the remote machine stops, then return,
    storing status in STATUS just as `wait' would.
    status -  */
+
 static int
 es1800_wait (pid, status)
      int pid;
@@ -573,14 +582,14 @@ es1800_wait (pid, status)
   status->kind = TARGET_WAITKIND_EXITED;
   status->value.integer = 0;
 
-  timeout = 0;         /* Don't time out -- user program is running. */
+  timeout = 0;                 /* Don't time out -- user program is running. */
   if (!setjmp (interrupt))
     {
       old_sigint = signal (SIGINT, es1800_request_quit);
       while (1)
-        {
-         getmessage (buf, sizeof(buf));
-         if (strncmp ( buf, "\r\n* BREAK *", 11) == 0) 
+       {
+         getmessage (buf, sizeof (buf));
+         if (strncmp (buf, "\r\n* BREAK *", 11) == 0)
            {
              status->kind = TARGET_WAITKIND_STOPPED;
              status->value.sig = TARGET_SIGNAL_TRAP;
@@ -608,7 +617,7 @@ es1800_wait (pid, status)
              status->value.sig = TARGET_SIGNAL_QUIT;
              break;
            }
-        }
+       }
     }
   else
     {
@@ -621,11 +630,11 @@ es1800_wait (pid, status)
          printf (" emulator stopped\n");
          status->kind = TARGET_WAITKIND_STOPPED;
          status->value.sig = TARGET_SIGNAL_INT;
-        }
+       }
       else
        {
          fflush (stdin);
-         es1800_reset ((char*) 1);
+         es1800_reset ((char *) 1);
        }
     }
   signal (SIGINT, old_sigint);
@@ -645,12 +654,12 @@ es1800_fetch_register (regno)
   int k;
   int r;
   char *p;
-  static char regtab[18][4] = 
-    {
-      "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ",
-      "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP",
-      "SR ", "PC "
-    };
+  static char regtab[18][4] =
+  {
+    "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ",
+    "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP",
+    "SR ", "PC "
+  };
 
   if ((regno < 15) || (regno == 16) || (regno == 17))
     {
@@ -659,11 +668,11 @@ es1800_fetch_register (regno)
       p = buf;
       for (k = 0; k < 4; k++)
        {
-         if ((p[k*2 + 1] == 0) || (p[k*2 + 2] == 0))
+         if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0))
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = (fromhex (p[k*2 + 1]) * 16) + fromhex (p[k*2 + 2]);
+         registers[r++] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]);
        }
     }
   else
@@ -695,16 +704,18 @@ es1800_fetch_registers ()
 
   /*  parsing row one - D0-D7-registers  */
 
-  while (*p++ != '\n') {;}
+  while (*p++ != '\n')
+    {;
+    }
   for (i = 4; i < 70; i += (i == 39 ? 3 : 1))
     {
       for (k = 0; k < 4; k++)
        {
-         if (p[i+0] == 0 || p[i+1] == 0)
+         if (p[i + 0] == 0 || p[i + 1] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = (fromhex (p[i+0]) * 16) + fromhex (p[i+1]);
+         registers[r++] = (fromhex (p[i + 0]) * 16) + fromhex (p[i + 1]);
          i += 2;
        }
     }
@@ -712,22 +723,26 @@ es1800_fetch_registers ()
 
   /*  parsing row two - A0-A6-registers  */
 
-  while (*p++ != '\n') {;}
+  while (*p++ != '\n')
+    {;
+    }
   for (i = 4; i < 61; i += (i == 39 ? 3 : 1))
     {
       for (k = 0; k < 4; k++)
        {
-         if (p[i+0] == 0 || p[i+1] == 0)
+         if (p[i + 0] == 0 || p[i + 1] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = (fromhex (p[i+0])) * 16 + fromhex (p[i+1]);
+         registers[r++] = (fromhex (p[i + 0])) * 16 + fromhex (p[i + 1]);
          i += 2;
        }
     }
   p += i;
 
-  while (*p++ != '\n') {;}
+  while (*p++ != '\n')
+    {;
+    }
 
   /* fetch SSP-, SR- and PC-registers  */
 
@@ -739,7 +754,7 @@ es1800_fetch_registers ()
 
   if (m68020)
     {
-      if (*p == '3')            /* use masterstackpointer MSP */
+      if (*p == '3')           /* use masterstackpointer MSP */
        {
          send_with_reply ("MSP", buf, sizeof (buf));
        }
@@ -747,50 +762,53 @@ es1800_fetch_registers ()
        {
          send_with_reply ("ISP", buf, sizeof (buf));
        }
-      else                     /* use userstackpointer USP  */
+      else
+       /* use userstackpointer USP  */
        {
-         send_with_reply ("USP", buf, sizeof (buf)); 
+         send_with_reply ("USP", buf, sizeof (buf));
        }
       p = buf;
-      for (k = 0; k<4; k++)
+      for (k = 0; k < 4; k++)
        {
-         if (p[k*2+1] == 0 || p[k*2+2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = fromhex (buf[k*2+1]) * 16 + fromhex (buf[k*2+2]);
+         registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
        }
 
       p = SR_buf;
       for (k = 0; k < 4; k++)
        {
-         if (p[k*2+1] == 0 || p[k*2+2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
          registers[r++] =
-           fromhex (SR_buf[k*2+1]) * 16 + fromhex (SR_buf[k*2+2]);
+           fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]);
        }
       send_with_reply ("PC", buf, sizeof (buf));
       p = buf;
-      for (k = 0; k<4; k++)
+      for (k = 0; k < 4; k++)
        {
-         if (p[k*2+1] == 0 || p[k*2+2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = fromhex (buf[k*2+1]) * 16 + fromhex (buf[k*2+2]);
+         registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
        }
     }
-  else    /* 68000-mode */
-    {                       
-      if (*p == '2') /* use supervisorstackpointer SSP  */
+  else
+    /* 68000-mode */
+    {
+      if (*p == '2')           /* use supervisorstackpointer SSP  */
        {
-         send_with_reply ("SSP", buf, sizeof (buf)); 
+         send_with_reply ("SSP", buf, sizeof (buf));
        }
-      else  /* use userstackpointer USP  */
+      else
+       /* use userstackpointer USP  */
        {
-         send_with_reply ("USP", buf, sizeof (buf)); 
+         send_with_reply ("USP", buf, sizeof (buf));
        }
 
       /* fetch STACKPOINTER */
@@ -798,11 +816,11 @@ es1800_fetch_registers ()
       p = buf;
       for (k = 0; k < 4; k++)
        {
-         if (p[k*2 + 1] == 0 || p[k*2 + 2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = fromhex (buf[k*2+1]) * 16 + fromhex (buf[k*2+2]);
+         registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
        }
 
       /* fetch STATUS */
@@ -810,45 +828,45 @@ es1800_fetch_registers ()
       p = SR_buf;
       for (k = 0; k < 4; k++)
        {
-         if (p[k*2+1] == 0 || p[k*2+2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
          registers[r++] =
-           fromhex (SR_buf[k*2+1]) * 16 + fromhex (SR_buf[k*2+2]);
+           fromhex (SR_buf[k * 2 + 1]) * 16 + fromhex (SR_buf[k * 2 + 2]);
        }
 
       /* fetch PC */
 
-      send_with_reply ("PC", buf, sizeof (buf)); 
+      send_with_reply ("PC", buf, sizeof (buf));
       p = buf;
       for (k = 0; k < 4; k++)
        {
-         if (p[k*2+1] == 0 || p[k*2+2] == 0)
+         if (p[k * 2 + 1] == 0 || p[k * 2 + 2] == 0)
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         registers[r++] = fromhex (buf[k*2+1]) * 16 + fromhex (buf[k*2+2]);
-       }    
+         registers[r++] = fromhex (buf[k * 2 + 1]) * 16 + fromhex (buf[k * 2 + 2]);
+       }
     }
 }
 
 /* Store register value, located in REGISTER, on the target processor.
    regno - the register-number of the register to store
-           (-1 means store them all)
+   (-1 means store them all)
    FIXME: Return errno value.  */
 
 static void
-es1800_store_register(regno)
+es1800_store_register (regno)
      int regno;
 {
 
   static char regtab[18][4] =
-    {
-      "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ",
-      "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP",
-      "SR ", "PC "
-    };
+  {
+    "D0 ", "D1 ", "D2 ", "D3 ", "D4 ", "D5 ", "D6 ", "D7 ",
+    "A0 ", "A1 ", "A2 ", "A3 ", "A4 ", "A5 ", "A6 ", "SSP",
+    "SR ", "PC "
+  };
 
   char buf[PBUFSIZ];
   char SR_buf[PBUFSIZ];
@@ -861,17 +879,18 @@ es1800_store_register(regno)
 
   r = (unsigned char *) registers;
 
-  if (regno == -1)  /* write all registers */
+  if (regno == -1)             /* write all registers */
     {
       j = 0;
       k = 18;
     }
-  else              /* write one register */
+  else
+    /* write one register */
     {
       j = regno;
-      k = regno+1;
-      r += regno * 4; 
-    }    
+      k = regno + 1;
+      r += regno * 4;
+    }
 
   if ((regno == -1) || (regno == 15))
     {
@@ -881,37 +900,38 @@ es1800_store_register(regno)
       p += 5;
       if (m68020)
        {
-         if (*p == '3') /* use masterstackpointer MSP */
+         if (*p == '3')        /* use masterstackpointer MSP */
            {
-             strcpy (stack_pointer,"MSP");  
+             strcpy (stack_pointer, "MSP");
            }
          else
            {
-             if (*p == '2') /* use interruptstackpointer ISP  */
+             if (*p == '2')    /* use interruptstackpointer ISP  */
                {
-                 strcpy (stack_pointer,"ISP");  
+                 strcpy (stack_pointer, "ISP");
                }
              else
                {
-                 strcpy (stack_pointer,"USP");  /* use userstackpointer USP  */
+                 strcpy (stack_pointer, "USP");        /* use userstackpointer USP  */
                }
            }
        }
-      else  /* 68000-mode */
+      else
+       /* 68000-mode */
        {
-         if (*p == '2') /* use supervisorstackpointer SSP  */
+         if (*p == '2')        /* use supervisorstackpointer SSP  */
            {
-             strcpy (stack_pointer,"SSP");  
+             strcpy (stack_pointer, "SSP");
            }
          else
            {
-             strcpy (stack_pointer,"USP");/* use userstackpointer USP  */  
+             strcpy (stack_pointer, "USP");    /* use userstackpointer USP  */
            }
        }
-      strcpy (regtab[15],stack_pointer);
+      strcpy (regtab[15], stack_pointer);
     }
 
-  for (i = j; i<k; i++)
+  for (i = j; i < k; i++)
     {
       buf[0] = regtab[i][0];
       buf[1] = regtab[i][1];
@@ -928,14 +948,14 @@ es1800_store_register(regno)
       buf[12] = tohex (*r++ & 0x0f);
       buf[13] = 0;
 
-      send_with_reply (buf, buf, sizeof (buf)); /* FIXME, reply not used? */
+      send_with_reply (buf, buf, sizeof (buf));                /* FIXME, reply not used? */
     }
 }
 
 
 /* Prepare to store registers.  */
 
-static void 
+static void
 es1800_prepare_to_store ()
 {
   /* Do nothing, since we can store individual regs */
@@ -986,11 +1006,11 @@ tohex (nib)
 /* Read or write LEN bytes from inferior memory at MEMADDR, transferring
    to or from debugger address MYADDR.  Write to inferior if WRITE is
    nonzero.  Returns length of data written or read; 0 for error. 
+
    memaddr - the target's address
    myaddr  - gdb's address
    len     - number of bytes 
-   write   - write if != 0 otherwise read      */
+   write   - write if != 0 otherwise read       */
 
 static int
 es1800_xfer_inferior_memory (memaddr, myaddr, len, write, tops)
@@ -1018,7 +1038,7 @@ es1800_xfer_inferior_memory (memaddr, myaddr, len, write, tops)
       myaddr += xfersize;
       len -= xfersize;
     }
-  return (origlen); /* no error possible */
+  return (origlen);            /* no error possible */
 }
 
 
@@ -1027,7 +1047,7 @@ es1800_xfer_inferior_memory (memaddr, myaddr, len, write, tops)
    MEMADDR is the address in the remote memory space.
    MYADDR is the address of the buffer in our space.
    LEN is the number of bytes.
+
    memaddr - the target's address
    myaddr  - gdb's address
    len     - number of bytes   */
@@ -1045,15 +1065,15 @@ es1800_write_bytes (memaddr, myaddr, len)
   p = myaddr;
   for (i = 0; i < len; i++)
     {
-      sprintf (buf, "@.B$%x=$%x", memaddr+i, (*p++) & 0xff);
-      send_with_reply (buf, buf, sizeof (buf));      /* FIXME send_command? */
+      sprintf (buf, "@.B$%x=$%x", memaddr + i, (*p++) & 0xff);
+      send_with_reply (buf, buf, sizeof (buf));                /* FIXME send_command? */
     }
 }
 
 
 /* Read memory data directly from the emulator.
    This does not use the data cache; the data cache uses this.
+
    memaddr - the target's address
    myaddr  - gdb's address
    len     - number of bytes   */
@@ -1064,7 +1084,8 @@ es1800_read_bytes (memaddr, myaddr, len)
      char *myaddr;
      int len;
 {
-  static int DB_tab[16] = {8,11,14,17,20,23,26,29,34,37,40,43,46,49,52,55};
+  static int DB_tab[16] =
+  {8, 11, 14, 17, 20, 23, 26, 29, 34, 37, 40, 43, 46, 49, 52, 55};
   char buf[PBUFSIZ];
   int i;
   int low_addr;
@@ -1076,31 +1097,33 @@ es1800_read_bytes (memaddr, myaddr, len)
       abort ();
     }
 
-  if (len == 1)        /* The emulator does not like expressions like:  */
+  if (len == 1)                        /* The emulator does not like expressions like:  */
     {
-      len = 2; /* DB.B $20018 TO $20018                       */
+      len = 2;                 /* DB.B $20018 TO $20018                       */
     }
 
   /* Reply describes registers byte by byte, each byte encoded as two hex
      characters.  */
 
-  sprintf (buf, "DB.B $%x TO $%x", memaddr, memaddr+len-1);
+  sprintf (buf, "DB.B $%x TO $%x", memaddr, memaddr + len - 1);
   send_with_reply (buf, buf, sizeof (buf));
   b = buf;
-  low_addr = memaddr&0x0f;
+  low_addr = memaddr & 0x0f;
   for (i = low_addr; i < low_addr + len; i++)
     {
       if ((!(i % 16)) && i)
-       {   /* if (i = 16,32,48)  */
-         while (*p++!='\n') {;}
+       {                       /* if (i = 16,32,48)  */
+         while (*p++ != '\n')
+           {;
+           }
          b = p;
        }
-      p = b + DB_tab[i%16] + (m68020 ? 2 : 0);
+      p = b + DB_tab[i % 16] + (m68020 ? 2 : 0);
       if (p[0] == 32 || p[1] == 32)
        {
          error ("Emulator reply is too short: %s", buf);
        }
-      myaddr[i-low_addr] = fromhex (p[0]) * 16 + fromhex (p[1]);
+      myaddr[i - low_addr] = fromhex (p[0]) * 16 + fromhex (p[1]);
     }
 }
 
@@ -1117,12 +1140,12 @@ es1800_files_info (tops)
 
 /* We read the contents of the target location and stash it,
    then overwrite it with a breakpoint instruction.
+
    addr           - is the target location in the target machine.
    contents_cache - is a pointer to memory allocated for saving the target contents.
-                    It is guaranteed by the caller to be long enough to save sizeof 
-                    BREAKPOINT bytes.
+   It is guaranteed by the caller to be long enough to save sizeof 
+   BREAKPOINT bytes.
+
    FIXME: This size is target_arch dependent and should be available in
    the target_arch transfer vector, if we ever have one...  */
 
@@ -1131,7 +1154,7 @@ es1800_insert_breakpoint (addr, contents_cache)
      CORE_ADDR addr;
      char *contents_cache;
 {
-  int val; 
+  int val;
 
   val = target_read_memory (addr, contents_cache, sizeof (es1800_break_insn));
 
@@ -1146,12 +1169,12 @@ es1800_insert_breakpoint (addr, contents_cache)
 
 
 /* Write back the stashed instruction
+
    addr           - is the target location in the target machine.
    contents_cache - is a pointer to memory allocated for saving the target contents.
-                    It is guaranteed by the caller to be long enough to save sizeof 
-                    BREAKPOINT bytes.  */
+   It is guaranteed by the caller to be long enough to save sizeof 
+   BREAKPOINT bytes.    */
+
 static int
 es1800_remove_breakpoint (addr, contents_cache)
      CORE_ADDR addr;
@@ -1189,28 +1212,28 @@ verify_break (vec)
 {
   CORE_ADDR memaddress;
   char buf[8];
-  char *instr = "NqNqNqNs";      /* breakpoint routine */
+  char *instr = "NqNqNqNs";    /* breakpoint routine */
   int status;
 
   get_break_addr (vec, &memaddress);
 
   if (memaddress)
     {
-      status = target_read_memory (memaddress, buf, 8); 
+      status = target_read_memory (memaddress, buf, 8);
       if (status != 0)
        {
          memory_error (status, memaddress);
        }
       return (STRCMP (instr, buf));
     }
-    return (-1);
+  return (-1);
 }
 
 
 /* get_break_addr ()
    find address of breakpint routine
    vec - trap vector used for breakpoints
-   addrp - store the address here      */
+   addrp - store the address here       */
 
 static void
 get_break_addr (vec, addrp)
@@ -1230,22 +1253,22 @@ get_break_addr (vec, addrp)
       p = buf;
       for (k = 0; k < 4; k++)
        {
-         if ((p[k*2 + 1] == 0) || (p[k*2 + 2] == 0))
+         if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0))
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         base_addr[k] = (fromhex (p[k*2 + 1]) * 16) + fromhex (p[k*2 + 2]);
+         base_addr[k] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]);
        }
       /* base addr of exception vector table */
       memaddress = *((CORE_ADDR *) base_addr);
     }
 
-    memaddress += (vec + 32) * 4;     /* address of trap vector */
-    status = target_read_memory (memaddress, (char *) addrp, 4); 
-    if (status != 0)                                                   
-      {
-       memory_error (status, memaddress);
-      }
+  memaddress += (vec + 32) * 4;        /* address of trap vector */
+  status = target_read_memory (memaddress, (char *) addrp, 4);
+  if (status != 0)
+    {
+      memory_error (status, memaddress);
+    }
 }
 
 
@@ -1268,8 +1291,8 @@ es1800_kill ()
    Also loads the trap routine, and sets the ES1800 breakpoint on it
    filename - the a.out to be loaded
    from_tty - says whether to be verbose or not
-   FIXME Uses emulator overlay memory for trap routine */
+   FIXME Uses emulator overlay memory for trap routine  */
+
 static void
 es1800_load (filename, from_tty)
      char *filename;
@@ -1282,7 +1305,7 @@ es1800_load (filename, from_tty)
   struct cleanup *old_chain;
   int es1800_load_format = 5;
 
-  if (es1800_desc == NULL) 
+  if (es1800_desc == NULL)
     {
       printf ("No emulator attached, type emulator-command first\n");
       return;
@@ -1293,40 +1316,40 @@ es1800_load (filename, from_tty)
 
   switch (es1800_load_format)
     {
-      case 2:   /* Extended Tekhex  */
-        if (from_tty)
-         {
-           printf ("Converting \"%s\" to Extended Tekhex Format\n", filename);
-         }
-       sprintf (buf, "tekhex %s", filename);
-       system (buf);
-       sprintf (loadname, "out.hex");
-       break;
-
-      case 5:   /* Motorola S-rec  */
-       if (from_tty)
-         {
-           printf ("Converting \"%s\" to Motorola S-record format\n",
-                   filename);
-         }
-       /* in the future the source code in copy (part of binutils-1.93) will
-          be included in this file */
-       sprintf (buf,
-                "copy -s \"a.out-sunos-big\" -d \"srec\" %s /tmp/out.hex",
-                filename);
-       system (buf);
-       sprintf (loadname, "/tmp/out.hex");
-       break;
-
-      default:
-       error ("Downloading format not defined\n");
-    }
+    case 2:                    /* Extended Tekhex  */
+      if (from_tty)
+       {
+         printf ("Converting \"%s\" to Extended Tekhex Format\n", filename);
+       }
+      sprintf (buf, "tekhex %s", filename);
+      system (buf);
+      sprintf (loadname, "out.hex");
+      break;
+
+    case 5:                    /* Motorola S-rec  */
+      if (from_tty)
+       {
+         printf ("Converting \"%s\" to Motorola S-record format\n",
+                 filename);
+       }
+      /* in the future the source code in copy (part of binutils-1.93) will
+         be included in this file */
+      sprintf (buf,
+              "copy -s \"a.out-sunos-big\" -d \"srec\" %s /tmp/out.hex",
+              filename);
+      system (buf);
+      sprintf (loadname, "/tmp/out.hex");
+      break;
+
+    default:
+      error ("Downloading format not defined\n");
+    }
+
   breakpoint_init_inferior ();
   inferior_pid = 0;
   if (from_tty)
     {
-      printf ("Downloading \"%s\" to the ES 1800\n",filename);
+      printf ("Downloading \"%s\" to the ES 1800\n", filename);
     }
   if ((instream = fopen (loadname, "r")) == NULL)
     {
@@ -1356,7 +1379,7 @@ es1800_load (filename, from_tty)
 
   do_cleanups (old_chain);
   expect_prompt ();
-  readchar ();  /* FIXME I am getting a ^G = 7 after the prompt  */
+  readchar ();                 /* FIXME I am getting a ^G = 7 after the prompt  */
   printf ("\n");
 
   if (fclose (instream) == EOF)
@@ -1370,7 +1393,7 @@ es1800_load (filename, from_tty)
       system (buf);
     }
 
-  symbol_file_command (filename, from_tty);   /* reading symbol table */
+  symbol_file_command (filename, from_tty);    /* reading symbol table */
   immediate_quit--;
 }
 
@@ -1403,23 +1426,23 @@ bfd_copy (from_bfd, to_bfd)
          error ("bfd_set_section_flags");
        }
       new->vma = p->vma;
-      
-      for (i = 0; (i + NUMCPYBYTES) < p->_cooked_size ; i += NUMCPYBYTES)
+
+      for (i = 0; (i + NUMCPYBYTES) < p->_cooked_size; i += NUMCPYBYTES)
        {
          if (!bfd_get_section_contents (from_bfd, p, (PTR) buf, (file_ptr) i,
-                                       (bfd_size_type) NUMCPYBYTES))
+                                        (bfd_size_type) NUMCPYBYTES))
            {
              error ("bfd_get_section_contents\n");
            }
-       if (!bfd_set_section_contents (to_bfd, new, (PTR) buf, (file_ptr) i,
-                                     (bfd_size_type) NUMCPYBYTES))
-         {
-           error ("bfd_set_section_contents\n");
-         }
-      }
+         if (!bfd_set_section_contents (to_bfd, new, (PTR) buf, (file_ptr) i,
+                                        (bfd_size_type) NUMCPYBYTES))
+           {
+             error ("bfd_set_section_contents\n");
+           }
+       }
       bfd_get_section_contents (from_bfd, p, (PTR) buf, (file_ptr) i,
                                (bfd_size_type) (p->_cooked_size - i));
-      bfd_set_section_contents (to_bfd, new, (PTR) buf,(file_ptr) i,
+      bfd_set_section_contents (to_bfd, new, (PTR) buf, (file_ptr) i,
                                (bfd_size_type) (p->_cooked_size - i));
     }
 }
@@ -1430,7 +1453,7 @@ bfd_copy (from_bfd, to_bfd)
    process' pid.
    execfile - the file to run
    args     - arguments passed to the program
-   env      - the environment vector to pass   */
+   env      - the environment vector to pass    */
 
 static void
 es1800_create_inferior (execfile, args, env)
@@ -1525,12 +1548,12 @@ es1800_mourn_inferior ()
    Let the user break out immediately. 
    string - the string to expect
    nowait - break out if string not the emulator's first respond otherwise
-            read until string is found (== 0)   */
+   read until string is found (== 0)   */
+
 static void
 expect (string, nowait)
      char *string;
-    int nowait;
+     int nowait;
 {
   char c;
   char *p = string;
@@ -1558,9 +1581,9 @@ expect (string, nowait)
        }
       else
        {
-         printf ("\'%s\' expected\n" , string);
+         printf ("\'%s\' expected\n", string);
          printf ("char %d is %d", p - string, c);
-         error ("\n" );
+         error ("\n");
        }
     }
 }
@@ -1596,7 +1619,7 @@ readchar ()
   return (buf[0] & 0x7f);
 }
 
-#else  /* !DEBUG_STDIN */
+#else /* !DEBUG_STDIN */
 
 /* Read a character from the remote system, doing all the fancy
    timeout stuff.  */
@@ -1623,7 +1646,7 @@ readchar ()
   return (ch);
 }
 
-#endif /* DEBUG_STDIN */
+#endif /* DEBUG_STDIN */
 
 
 /* Send a command to the emulator and save the reply.
@@ -1634,8 +1657,8 @@ readchar ()
 
 static void
 send_with_reply (string, buf, len)
-    char *string, *buf;
-    int len;
+     char *string, *buf;
+     int len;
 {
   send (string);
   SERIAL_WRITE (es1800_desc, "\r", 1);
@@ -1652,7 +1675,7 @@ send_with_reply (string, buf, len)
 /* Send the command in STR to the emulator adding \r. check
    the echo for consistency. 
    string - the es1800 command  */
+
 static void
 send_command (string)
      char *string;
@@ -1674,7 +1697,7 @@ static void
 send (string)
      char *string;
 {
-  if (kiodebug) 
+  if (kiodebug)
     {
       fprintf (stderr, "Sending: %s\n", string);
     }
@@ -1685,7 +1708,7 @@ send (string)
 /* Read a message from the emulator and store it in BUF. 
    buf    - containing the emulator reply on return
    len    - size of buf  */
+
 static void
 getmessage (buf, len)
      char *buf;
@@ -1706,9 +1729,9 @@ getmessage (buf, len)
   c = readchar ();
   do
     {
-      if (c) 
+      if (c)
        {
-         if (len-- < 2) /* char and terminaling NULL */
+         if (len-- < 2)        /* char and terminaling NULL */
            {
              error ("input buffer overrun\n");
            }
@@ -1722,16 +1745,16 @@ getmessage (buf, len)
     }
   while (!prompt_found);
   *bp = 0;
-  
+
   if (kiodebug)
     {
-      fprintf (stderr,"message received :%s\n", buf);
+      fprintf (stderr, "message received :%s\n", buf);
     }
 }
 
 static void
 download (instream, from_tty, format)
-FILE *instream;
+     FILE *instream;
      int from_tty;
      int format;
 {
@@ -1739,15 +1762,15 @@ FILE *instream;
   char buf[160];
   int i = 0;
 
-  send_command ("SET #2,$1A");                  /* reset char = ^Z */
-  send_command ("SET #3,$11,$13");              /* XON  XOFF */
+  send_command ("SET #2,$1A"); /* reset char = ^Z */
+  send_command ("SET #3,$11,$13");     /* XON  XOFF */
   if (format == 2)
     {
       send_command ("SET #26,#2");
     }
   else
     {
-      send_command ("SET #26,#5");             /* Format=Extended Tekhex */
+      send_command ("SET #26,#5");     /* Format=Extended Tekhex */
     }
   send_command ("DFB = $10");
   send_command ("PUR");
@@ -1759,18 +1782,18 @@ FILE *instream;
       printf ("    0 records loaded...\r");
     }
   while (fgets (buf, 160, instream))
-      {
-       send (buf);
-       if (from_tty)
-         {
-           printf ("%5d\b\b\b\b\b",++i);
-           fflush (stdout);
-         }
-       if ((c = readchar ()) != 006) 
-         {
-           error ("expected ACK");
-         }
-      }
+    {
+      send (buf);
+      if (from_tty)
+       {
+         printf ("%5d\b\b\b\b\b", ++i);
+         fflush (stdout);
+       }
+      if ((c = readchar ()) != 006)
+       {
+         error ("expected ACK");
+       }
+    }
   if (from_tty)
     {
       printf ("- All");
@@ -1787,8 +1810,8 @@ FILE *instream;
 /* Talk directly to the emulator
    FIXME, uses busy wait, and is SUNOS (or at least BSD) specific  */
 
-/*ARGSUSED*/
-static void 
+/*ARGSUSED */
+static void
 es1800_transparent (args, from_tty)
      char *args;
      int from_tty;
@@ -1809,7 +1832,7 @@ es1800_transparent (args, from_tty)
   int i;
 
   dont_repeat ();
-  if (es1800_desc == NULL) 
+  if (es1800_desc == NULL)
     {
       printf ("No emulator attached, type emulator-command first\n");
       return;
@@ -1822,7 +1845,7 @@ es1800_transparent (args, from_tty)
   printf (" >");
   fflush (stdout);
 
-  if ((console = open ("/dev/tty", O_RDWR)) == -1) 
+  if ((console = open ("/dev/tty", O_RDWR)) == -1)
     {
       perror_with_name ("/dev/tty:");
     }
@@ -1846,7 +1869,7 @@ es1800_transparent (args, from_tty)
     }
 
   console_mode_save = modebl;
-  modebl.sg_flags = RAW; 
+  modebl.sg_flags = RAW;
 
   if (ioctl (console, TIOCSETP, &modebl))
     {
@@ -1867,7 +1890,7 @@ es1800_transparent (args, from_tty)
     }
 
   while (1)
-    { 
+    {
       cc = read (console, inputbuf, inputcnt);
       if (cc != -1)
        {
@@ -1875,7 +1898,7 @@ es1800_transparent (args, from_tty)
            {
              break;
            }
-         for (i = 0; i < cc; )
+         for (i = 0; i < cc;)
            {
              es1800_buf[es1800_cnt++] = inputbuf[i++];
            }
@@ -1884,11 +1907,11 @@ es1800_transparent (args, from_tty)
              perror_with_name ("FEL! write:");
            }
          es1800_cnt -= cc;
-         if (es1800_cnt && cc) 
+         if (es1800_cnt && cc)
            {
              for (i = 0; i < es1800_cnt; i++)
                {
-                 es1800_buf[i] = es1800_buf[cc+i];
+                 es1800_buf[i] = es1800_buf[cc + i];
                }
            }
        }
@@ -1896,24 +1919,24 @@ es1800_transparent (args, from_tty)
        {
          perror_with_name ("FEL! read:");
        }
-      
-      cc = read (es1800_desc->fd,inputbuf,inputcnt);
+
+      cc = read (es1800_desc->fd, inputbuf, inputcnt);
       if (cc != -1)
        {
-         for (i = 0; i < cc; )
+         for (i = 0; i < cc;)
            {
              consolebuf[consolecnt++] = inputbuf[i++];
            }
-         if ((cc = write (console,consolebuf,consolecnt)) == -1)
+         if ((cc = write (console, consolebuf, consolecnt)) == -1)
            {
              perror_with_name ("FEL! write:");
            }
          consolecnt -= cc;
-         if (consolecnt && cc) 
+         if (consolecnt && cc)
            {
              for (i = 0; i < consolecnt; i++)
                {
-                 consolebuf[i] = consolebuf[cc+i];
+                 consolebuf[i] = consolebuf[cc + i];
                }
            }
        }
@@ -1981,38 +2004,38 @@ es1800_init_break (args, from_tty)
       p = buf;
       for (k = 0; k < 4; k++)
        {
-         if ((p[k*2 + 1] == 0) || (p[k*2 + 2] == 0))
+         if ((p[k * 2 + 1] == 0) || (p[k * 2 + 2] == 0))
            {
              error ("Emulator reply is too short: %s", buf);
            }
-         base_addr[k] = (fromhex (p[k*2 + 1]) * 16) + fromhex (p[k*2 + 2]);
+         base_addr[k] = (fromhex (p[k * 2 + 1]) * 16) + fromhex (p[k * 2 + 2]);
        }
       /* base addr of exception vector table */
-      memaddress =  *((CORE_ADDR *) base_addr);
+      memaddress = *((CORE_ADDR *) base_addr);
     }
 
-  memaddress += (es1800_break_vec + 32) * 4;     /* address of trap vector */
+  memaddress += (es1800_break_vec + 32) * 4;   /* address of trap vector */
 
   sprintf (buf, "@.L%lx=$%lx", memaddress, es1800_break_address);
-  send_command (buf);   /* set the address of the break routine in the */
-                      /* trap vector */
-  
-  sprintf (buf, "@.L%lx=$4E714E71", es1800_break_address);      /* NOP; NOP */
+  send_command (buf);          /* set the address of the break routine in the */
+  /* trap vector */
+
+  sprintf (buf, "@.L%lx=$4E714E71", es1800_break_address);     /* NOP; NOP */
   send_command (buf);
-  sprintf (buf, "@.L%lx=$4E714E73", es1800_break_address + 4);  /* NOP; RTE */
+  sprintf (buf, "@.L%lx=$4E714E73", es1800_break_address + 4); /* NOP; RTE */
   send_command (buf);
-  
+
   sprintf (buf, "AC2=$%lx", es1800_break_address + 4);
   /* breakpoint at es1800-break_address */
   send_command (buf);
-  send_command ("WHEN AC2 THEN BRK");          /* ie in exception routine */
+  send_command ("WHEN AC2 THEN BRK");  /* ie in exception routine */
 
   if (from_tty)
     {
       printf ("Breakpoint (trap $%x) routine at address: %lx\n",
              es1800_break_vec, es1800_break_address);
     }
-}        
+}
 
 static void
 es1800_child_open (arg, from_tty)
@@ -2031,7 +2054,7 @@ es1800_child_detach (args, from_tty)
     {
       error ("Argument given to \"detach\" when remotely debugging.");
     }
-  
+
   pop_target ();
   if (from_tty)
     {
@@ -2042,114 +2065,114 @@ es1800_child_detach (args, from_tty)
 
 /* Define the target subroutine names  */
 
-struct target_ops es1800_ops ;
+struct target_ops es1800_ops;
 
-static void 
-init_es1800_ops(void)
+static void
+init_es1800_ops (void)
 {
-  es1800_ops.to_shortname =   "es1800";                
-  es1800_ops.to_longname =   "Remote serial target in ES1800-emulator protocol";
-  es1800_ops.to_doc =   "Remote debugging on the es1800 emulator via a serial line.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya)." ;
-  es1800_ops.to_open =   es1800_open;          
-  es1800_ops.to_close =   es1800_close;                
-  es1800_ops.to_attach =   es1800_attach;
-  es1800_ops.to_post_attach = NULL;    
+  es1800_ops.to_shortname = "es1800";
+  es1800_ops.to_longname = "Remote serial target in ES1800-emulator protocol";
+  es1800_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  es1800_ops.to_open = es1800_open;
+  es1800_ops.to_close = es1800_close;
+  es1800_ops.to_attach = es1800_attach;
+  es1800_ops.to_post_attach = NULL;
   es1800_ops.to_require_attach = NULL;
-  es1800_ops.to_detach =   es1800_detach;      
+  es1800_ops.to_detach = es1800_detach;
   es1800_ops.to_require_detach = NULL;
-  es1800_ops.to_resume =   es1800_resume;      
-  es1800_ops.to_wait  =   NULL;
-  es1800_ops.to_post_wait = NULL;      
-  es1800_ops.to_fetch_registers  =   NULL;     
-  es1800_ops.to_store_registers  =   NULL;     
-  es1800_ops.to_prepare_to_store =   es1800_prepare_to_store;
-  es1800_ops.to_xfer_memory  =   es1800_xfer_inferior_memory;
-  es1800_ops.to_files_info  =   es1800_files_info;             
-  es1800_ops.to_insert_breakpoint =   es1800_insert_breakpoint;        
-  es1800_ops.to_remove_breakpoint =   es1800_remove_breakpoint;        
-  es1800_ops.to_terminal_init  =   NULL;                       
-  es1800_ops.to_terminal_inferior =   NULL;                    
-  es1800_ops.to_terminal_ours_for_output =   NULL;             
-  es1800_ops.to_terminal_ours  =   NULL;                       
-  es1800_ops.to_terminal_info  =   NULL;                       
-  es1800_ops.to_kill  =   NULL;                        
-  es1800_ops.to_load  =   es1800_load;         
-  es1800_ops.to_lookup_symbol =   NULL;                
-  es1800_ops.to_create_inferior =   es1800_create_inferior;
+  es1800_ops.to_resume = es1800_resume;
+  es1800_ops.to_wait = NULL;
+  es1800_ops.to_post_wait = NULL;
+  es1800_ops.to_fetch_registers = NULL;
+  es1800_ops.to_store_registers = NULL;
+  es1800_ops.to_prepare_to_store = es1800_prepare_to_store;
+  es1800_ops.to_xfer_memory = es1800_xfer_inferior_memory;
+  es1800_ops.to_files_info = es1800_files_info;
+  es1800_ops.to_insert_breakpoint = es1800_insert_breakpoint;
+  es1800_ops.to_remove_breakpoint = es1800_remove_breakpoint;
+  es1800_ops.to_terminal_init = NULL;
+  es1800_ops.to_terminal_inferior = NULL;
+  es1800_ops.to_terminal_ours_for_output = NULL;
+  es1800_ops.to_terminal_ours = NULL;
+  es1800_ops.to_terminal_info = NULL;
+  es1800_ops.to_kill = NULL;
+  es1800_ops.to_load = es1800_load;
+  es1800_ops.to_lookup_symbol = NULL;
+  es1800_ops.to_create_inferior = es1800_create_inferior;
   es1800_ops.to_post_startup_inferior = NULL;
   es1800_ops.to_acknowledge_created_inferior = NULL;
-  es1800_ops.to_clone_and_follow_inferior = NULL;  
+  es1800_ops.to_clone_and_follow_inferior = NULL;
   es1800_ops.to_post_follow_inferior_by_clone = NULL;
   es1800_ops.to_insert_fork_catchpoint = NULL;
   es1800_ops.to_remove_fork_catchpoint = NULL;
   es1800_ops.to_insert_vfork_catchpoint = NULL;
-  es1800_ops.to_remove_vfork_catchpoint = NULL;              
+  es1800_ops.to_remove_vfork_catchpoint = NULL;
   es1800_ops.to_has_forked = NULL;
-  es1800_ops.to_has_vforked = NULL;            
-  es1800_ops.to_can_follow_vfork_prior_to_exec = NULL;    
+  es1800_ops.to_has_vforked = NULL;
+  es1800_ops.to_can_follow_vfork_prior_to_exec = NULL;
   es1800_ops.to_post_follow_vfork = NULL;
   es1800_ops.to_insert_exec_catchpoint = NULL;
   es1800_ops.to_remove_exec_catchpoint = NULL;
   es1800_ops.to_has_execd = NULL;
   es1800_ops.to_reported_exec_events_per_exec_call = NULL;
   es1800_ops.to_has_exited = NULL;
-  es1800_ops.to_mourn_inferior =   NULL;                       
-  es1800_ops.to_can_run  =   0;                        
-  es1800_ops.to_notice_signals =   0;          
-  es1800_ops.to_thread_alive  =   0;           
-  es1800_ops.to_stop  =   0;
+  es1800_ops.to_mourn_inferior = NULL;
+  es1800_ops.to_can_run = 0;
+  es1800_ops.to_notice_signals = 0;
+  es1800_ops.to_thread_alive = 0;
+  es1800_ops.to_stop = 0;
   es1800_ops.to_pid_to_exec_file = NULL;
-  es1800_ops.to_core_file_to_sym_file = NULL;  
-  es1800_ops.to_stratum =   core_stratum;      
-  es1800_ops.DONT_USE =   0;                   
-  es1800_ops.to_has_all_memory =   0;          
-  es1800_ops.to_has_memory =   1;              
-  es1800_ops.to_has_stack =   0;               
-  es1800_ops.to_has_registers =   0;           
-  es1800_ops.to_has_execution =   0;           
-  es1800_ops.to_sections =   NULL;             
-  es1800_ops.to_sections_end =   NULL;         
-  es1800_ops.to_magic =   OPS_MAGIC ;          
+  es1800_ops.to_core_file_to_sym_file = NULL;
+  es1800_ops.to_stratum = core_stratum;
+  es1800_ops.DONT_USE = 0;
+  es1800_ops.to_has_all_memory = 0;
+  es1800_ops.to_has_memory = 1;
+  es1800_ops.to_has_stack = 0;
+  es1800_ops.to_has_registers = 0;
+  es1800_ops.to_has_execution = 0;
+  es1800_ops.to_sections = NULL;
+  es1800_ops.to_sections_end = NULL;
+  es1800_ops.to_magic = OPS_MAGIC;
 }
 
 /* Define the target subroutine names  */
 
-struct target_ops es1800_child_ops ;
+struct target_ops es1800_child_ops;
 
-static void 
-init_es1800_child_ops(void)
+static void
+init_es1800_child_ops (void)
 {
-  es1800_child_ops.to_shortname =   "es1800_process";  
-  es1800_child_ops.to_longname =   "Remote serial target in ES1800-emulator protocol";
-  es1800_child_ops.to_doc =   "Remote debugging on the es1800 emulator via a serial line.\n\
+  es1800_child_ops.to_shortname = "es1800_process";
+  es1800_child_ops.to_longname = "Remote serial target in ES1800-emulator protocol";
+  es1800_child_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).";
-  es1800_child_ops.to_open =   es1800_child_open;      
-  es1800_child_ops.to_close =   NULL;                  
-  es1800_child_ops.to_attach =   es1800_attach;
+  es1800_child_ops.to_open = es1800_child_open;
+  es1800_child_ops.to_close = NULL;
+  es1800_child_ops.to_attach = es1800_attach;
   es1800_child_ops.to_post_attach = NULL;
-  es1800_child_ops.to_require_attach = NULL;   
-  es1800_child_ops.to_detach =   es1800_child_detach;
-  es1800_child_ops.to_require_detach = NULL;   
-  es1800_child_ops.to_resume =   es1800_resume;        
-  es1800_child_ops.to_wait  =   es1800_wait;
-  es1800_child_ops.to_post_wait = NULL;        
-  es1800_child_ops.to_fetch_registers  =   es1800_fetch_register;
-  es1800_child_ops.to_store_registers  =   es1800_store_register;
-  es1800_child_ops.to_prepare_to_store =   es1800_prepare_to_store;
-  es1800_child_ops.to_xfer_memory  =   es1800_xfer_inferior_memory;
-  es1800_child_ops.to_files_info  =   es1800_files_info;               
-  es1800_child_ops.to_insert_breakpoint =   es1800_insert_breakpoint;  
-  es1800_child_ops.to_remove_breakpoint =   es1800_remove_breakpoint;  
-  es1800_child_ops.to_terminal_init  =   NULL;                 
-  es1800_child_ops.to_terminal_inferior =   NULL;                      
-  es1800_child_ops.to_terminal_ours_for_output =   NULL;               
-  es1800_child_ops.to_terminal_ours  =   NULL;                 
-  es1800_child_ops.to_terminal_info  =   NULL;                 
-  es1800_child_ops.to_kill  =   es1800_kill;                   
-  es1800_child_ops.to_load  =   es1800_load;                   
-  es1800_child_ops.to_lookup_symbol =   NULL;                  
-  es1800_child_ops.to_create_inferior =   es1800_create_inferior;
+  es1800_child_ops.to_require_attach = NULL;
+  es1800_child_ops.to_detach = es1800_child_detach;
+  es1800_child_ops.to_require_detach = NULL;
+  es1800_child_ops.to_resume = es1800_resume;
+  es1800_child_ops.to_wait = es1800_wait;
+  es1800_child_ops.to_post_wait = NULL;
+  es1800_child_ops.to_fetch_registers = es1800_fetch_register;
+  es1800_child_ops.to_store_registers = es1800_store_register;
+  es1800_child_ops.to_prepare_to_store = es1800_prepare_to_store;
+  es1800_child_ops.to_xfer_memory = es1800_xfer_inferior_memory;
+  es1800_child_ops.to_files_info = es1800_files_info;
+  es1800_child_ops.to_insert_breakpoint = es1800_insert_breakpoint;
+  es1800_child_ops.to_remove_breakpoint = es1800_remove_breakpoint;
+  es1800_child_ops.to_terminal_init = NULL;
+  es1800_child_ops.to_terminal_inferior = NULL;
+  es1800_child_ops.to_terminal_ours_for_output = NULL;
+  es1800_child_ops.to_terminal_ours = NULL;
+  es1800_child_ops.to_terminal_info = NULL;
+  es1800_child_ops.to_kill = es1800_kill;
+  es1800_child_ops.to_load = es1800_load;
+  es1800_child_ops.to_lookup_symbol = NULL;
+  es1800_child_ops.to_create_inferior = es1800_create_inferior;
   es1800_child_ops.to_post_startup_inferior = NULL;
   es1800_child_ops.to_acknowledge_created_inferior = NULL;
   es1800_child_ops.to_clone_and_follow_inferior = NULL;
@@ -2157,9 +2180,9 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   es1800_child_ops.to_insert_fork_catchpoint = NULL;
   es1800_child_ops.to_remove_fork_catchpoint = NULL;
   es1800_child_ops.to_insert_vfork_catchpoint = NULL;
-  es1800_child_ops.to_remove_vfork_catchpoint = NULL;        
+  es1800_child_ops.to_remove_vfork_catchpoint = NULL;
   es1800_child_ops.to_has_forked = NULL;
-  es1800_child_ops.to_has_vforked = NULL;          
+  es1800_child_ops.to_has_vforked = NULL;
   es1800_child_ops.to_can_follow_vfork_prior_to_exec = NULL;
   es1800_child_ops.to_post_follow_vfork = NULL;
   es1800_child_ops.to_insert_exec_catchpoint = NULL;
@@ -2167,30 +2190,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   es1800_child_ops.to_has_execd = NULL;
   es1800_child_ops.to_reported_exec_events_per_exec_call = NULL;
   es1800_child_ops.to_has_exited = NULL;
-  es1800_child_ops.to_mourn_inferior =   es1800_mourn_inferior;        
-  es1800_child_ops.to_can_run  =   0;                          
-  es1800_child_ops.to_notice_signals =   0;                    
-  es1800_child_ops.to_thread_alive  =   0;                     
-  es1800_child_ops.to_stop  =   0;
+  es1800_child_ops.to_mourn_inferior = es1800_mourn_inferior;
+  es1800_child_ops.to_can_run = 0;
+  es1800_child_ops.to_notice_signals = 0;
+  es1800_child_ops.to_thread_alive = 0;
+  es1800_child_ops.to_stop = 0;
   es1800_child_ops.to_pid_to_exec_file = NULL;
   es1800_child_ops.to_core_file_to_sym_file = NULL;
-  es1800_child_ops.to_stratum =   process_stratum;             
-  es1800_child_ops.DONT_USE =   0;                             
-  es1800_child_ops.to_has_all_memory =   1;                    
-  es1800_child_ops.to_has_memory =   1;                        
-  es1800_child_ops.to_has_stack =   1;                 
-  es1800_child_ops.to_has_registers =   1;                     
-  es1800_child_ops.to_has_execution =   1;                     
-  es1800_child_ops.to_sections =   NULL;                       
-  es1800_child_ops.to_sections_end =   NULL;                   
-  es1800_child_ops.to_magic =   OPS_MAGIC;                     
+  es1800_child_ops.to_stratum = process_stratum;
+  es1800_child_ops.DONT_USE = 0;
+  es1800_child_ops.to_has_all_memory = 1;
+  es1800_child_ops.to_has_memory = 1;
+  es1800_child_ops.to_has_stack = 1;
+  es1800_child_ops.to_has_registers = 1;
+  es1800_child_ops.to_has_execution = 1;
+  es1800_child_ops.to_sections = NULL;
+  es1800_child_ops.to_sections_end = NULL;
+  es1800_child_ops.to_magic = OPS_MAGIC;
 }
 
 void
 _initialize_es1800 ()
 {
-  init_es1800_ops() ;
-  init_es1800_child_ops() ;
+  init_es1800_ops ();
+  init_es1800_child_ops ();
   add_target (&es1800_ops);
   add_target (&es1800_child_ops);
 #ifdef PROVIDE_TRANSPARENT
@@ -2198,5 +2221,5 @@ _initialize_es1800 ()
           "Start transparent communication with the ES 1800 emulator.");
 #endif /* PROVIDE_TRANSPARENT */
   add_com ("init_break", class_support, es1800_init_break,
-          "Download break routine and initialize break facility on ES 1800");
+        "Download break routine and initialize break facility on ES 1800");
 }
index 27fd8aa518416115b230a6a2eaa0136aa3eb51c3..1810a6adf24c034698ca447fc71be4b3f41e5e7f 100644 (file)
@@ -5,21 +5,22 @@
    Written by Steve Chamberlain for Cygnus Support.
    Re-written by Stu Grossman of Cygnus Support
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -92,63 +93,64 @@ static char *est_regnames[NUM_REGS] =
 
 static struct target_ops est_ops;
 
-static char *est_inits[] = {"he\r", /* Resets the prompt, and clears repeated cmds */
-                             NULL};
+static char *est_inits[] =
+{"he\r",                       /* Resets the prompt, and clears repeated cmds */
+ NULL};
 
-static struct monitor_ops est_cmds ;
+static struct monitor_ops est_cmds;
 
-static void 
-init_est_cmds(void)
+static void
+init_est_cmds (void)
 {
-  est_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_NEED_REGDUMP_AFTER_CONT |
-    MO_SREC_ACK | MO_SREC_ACK_PLUS ;
-  est_cmds.init =   est_inits;                 /* Init strings */
-  est_cmds.cont =   "go\r";                    /* continue command */
-  est_cmds.step =   "sidr\r";                  /* single step */
-  est_cmds.stop =   "\003";                    /* ^C interrupts the program */
-  est_cmds.set_break =   "sb %x\r";                    /* set a breakpoint */
-  est_cmds.clr_break =   "rb %x\r";                    /* clear a breakpoint */
-  est_cmds.clr_all_break =   "rb\r";                   /* clear all breakpoints */
-  est_cmds.fill =   "bfb %x %x %x\r";          /* fill (start end val) */
-  est_cmds.setmem.cmdb =     "smb %x %x\r";            /* setmem.cmdb (addr, value) */
-  est_cmds.setmem.cmdw =     "smw %x %x\r";            /* setmem.cmdw (addr, value) */
-  est_cmds.setmem.cmdl =     "sml %x %x\r";            /* setmem.cmdl (addr, value) */
-  est_cmds.setmem.cmdll =     NULL;                    /* setmem.cmdll (addr, value) */
-  est_cmds.setmem.resp_delim =     NULL;                       /* setreg.resp_delim */
-  est_cmds.setmem.term =     NULL;                     /* setreg.term */
-  est_cmds.setmem.term_cmd =     NULL;                 /* setreg.term_cmd */
-  est_cmds.getmem.cmdb =     "dmb %x %x\r";            /* getmem.cmdb (addr, len) */
-  est_cmds.getmem.cmdw =     "dmw %x %x\r";            /* getmem.cmdw (addr, len) */
-  est_cmds.getmem.cmdl =     "dml %x %x\r";            /* getmem.cmdl (addr, len) */
-  est_cmds.getmem.cmdll =     NULL;                    /* getmem.cmdll (addr, len) */
-  est_cmds.getmem.resp_delim =     ": ";                       /* getmem.resp_delim */
-  est_cmds.getmem.term =     NULL;                     /* getmem.term */
-  est_cmds.getmem.term_cmd =     NULL;                 /* getmem.term_cmd */
-  est_cmds.setreg.cmd =     "sr %s %x\r";              /* setreg.cmd (name, value) */
-  est_cmds.setreg.resp_delim =     NULL;                       /* setreg.resp_delim */
-  est_cmds.setreg.term =     NULL;                     /* setreg.term */
-  est_cmds.setreg.term_cmd =     NULL;                 /* setreg.term_cmd */
-  est_cmds.getreg.cmd =     "dr %s\r";                 /* getreg.cmd (name) */
-  est_cmds.getreg.resp_delim =     " = ";                      /* getreg.resp_delim */
-  est_cmds.getreg.term =     NULL;                     /* getreg.term */
-  est_cmds.getreg.term_cmd =     NULL ;                        /* getreg.term_cmd */
-  est_cmds.dump_registers =   "dr\r";                  /* dump_registers */
-  est_cmds.register_pattern =   "\\(\\w+\\) = \\([0-9a-fA-F]+\\)"; /* register_pattern */
-  est_cmds.supply_register =   est_supply_register;            /* supply_register */
-  est_cmds.load_routine =   NULL;                              /* load_routine (defaults to SRECs) */
-  est_cmds.load =   "dl\r";                    /* download command */
-  est_cmds.loadresp =   "+";                           /* load response */
-  est_cmds.prompt =   ">BKM>";                 /* monitor command prompt */
-  est_cmds.line_term =   "\r";                         /* end-of-line terminator */
-  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.magic =   MONITOR_OPS_MAGIC ;       /* magic */
-} /* init_est_cmds */
+  est_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_NEED_REGDUMP_AFTER_CONT |
+    MO_SREC_ACK | MO_SREC_ACK_PLUS;
+  est_cmds.init = est_inits;   /* Init strings */
+  est_cmds.cont = "go\r";      /* continue command */
+  est_cmds.step = "sidr\r";    /* single step */
+  est_cmds.stop = "\003";      /* ^C interrupts the program */
+  est_cmds.set_break = "sb %x\r";      /* set a breakpoint */
+  est_cmds.clr_break = "rb %x\r";      /* clear a breakpoint */
+  est_cmds.clr_all_break = "rb\r";     /* clear all breakpoints */
+  est_cmds.fill = "bfb %x %x %x\r";    /* fill (start end val) */
+  est_cmds.setmem.cmdb = "smb %x %x\r";                /* setmem.cmdb (addr, value) */
+  est_cmds.setmem.cmdw = "smw %x %x\r";                /* setmem.cmdw (addr, value) */
+  est_cmds.setmem.cmdl = "sml %x %x\r";                /* setmem.cmdl (addr, value) */
+  est_cmds.setmem.cmdll = NULL;        /* setmem.cmdll (addr, value) */
+  est_cmds.setmem.resp_delim = NULL;   /* setreg.resp_delim */
+  est_cmds.setmem.term = NULL; /* setreg.term */
+  est_cmds.setmem.term_cmd = NULL;     /* setreg.term_cmd */
+  est_cmds.getmem.cmdb = "dmb %x %x\r";                /* getmem.cmdb (addr, len) */
+  est_cmds.getmem.cmdw = "dmw %x %x\r";                /* getmem.cmdw (addr, len) */
+  est_cmds.getmem.cmdl = "dml %x %x\r";                /* getmem.cmdl (addr, len) */
+  est_cmds.getmem.cmdll = NULL;        /* getmem.cmdll (addr, len) */
+  est_cmds.getmem.resp_delim = ": ";   /* getmem.resp_delim */
+  est_cmds.getmem.term = NULL; /* getmem.term */
+  est_cmds.getmem.term_cmd = NULL;     /* getmem.term_cmd */
+  est_cmds.setreg.cmd = "sr %s %x\r";  /* setreg.cmd (name, value) */
+  est_cmds.setreg.resp_delim = NULL;   /* setreg.resp_delim */
+  est_cmds.setreg.term = NULL; /* setreg.term */
+  est_cmds.setreg.term_cmd = NULL;     /* setreg.term_cmd */
+  est_cmds.getreg.cmd = "dr %s\r";     /* getreg.cmd (name) */
+  est_cmds.getreg.resp_delim = " = ";  /* getreg.resp_delim */
+  est_cmds.getreg.term = NULL; /* getreg.term */
+  est_cmds.getreg.term_cmd = NULL;     /* getreg.term_cmd */
+  est_cmds.dump_registers = "dr\r";    /* dump_registers */
+  est_cmds.register_pattern = "\\(\\w+\\) = \\([0-9a-fA-F]+\\)";       /* register_pattern */
+  est_cmds.supply_register = est_supply_register;      /* supply_register */
+  est_cmds.load_routine = NULL;        /* load_routine (defaults to SRECs) */
+  est_cmds.load = "dl\r";      /* download command */
+  est_cmds.loadresp = "+";     /* load response */
+  est_cmds.prompt = ">BKM>";   /* monitor command prompt */
+  est_cmds.line_term = "\r";   /* end-of-line terminator */
+  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.magic = MONITOR_OPS_MAGIC;  /* magic */
+}                              /* init_est_cmds */
 
 static void
-est_open(args, from_tty)
+est_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -158,7 +160,7 @@ est_open(args, from_tty)
 void
 _initialize_est ()
 {
-  init_est_cmds() ;
+  init_est_cmds ();
   init_monitor_ops (&est_ops);
 
   est_ops.to_shortname = "est";
index 3ca8455d979243c7811800b4f1164d1ea55f425f..328fc01965c4173426a55710e379df9bdb1b7c6b 100644 (file)
@@ -17,7 +17,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -82,56 +83,56 @@ static char *hms_inits[] =
 {"\003",                       /* Resets the prompt, and clears repeated cmds */
  NULL};
 
-static struct monitor_ops hms_cmds ;
+static struct monitor_ops hms_cmds;
 
-static void 
-init_hms_cmds(void)
+static void
+init_hms_cmds (void)
 {
-  hms_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_GETMEM_NEEDS_RANGE;
-  hms_cmds.init =   hms_inits;         /* Init strings */
-  hms_cmds.cont =   "g\r";             /* continue command */
-  hms_cmds.step =   "s\r";             /* single step */
-  hms_cmds.stop =   "\003";            /* ^C interrupts the program */
-  hms_cmds.set_break =   "b %x\r";     /* set a breakpoint */
-  hms_cmds.clr_break =   "b - %x\r";   /* clear a breakpoint */
-  hms_cmds.clr_all_break =   "b -\r";  /* clear all breakpoints */
-  hms_cmds.fill =   "f %x %x %x\r";    /* fill (start end val) */
-  hms_cmds.setmem.cmdb =     "m.b %x=%x\r";    /* setmem.cmdb (addr, value) */
-  hms_cmds.setmem.cmdw =     "m.w %x=%x\r";    /* setmem.cmdw (addr, value) */
-  hms_cmds.setmem.cmdl =     NULL;     /* setmem.cmdl (addr, value) */
-  hms_cmds.setmem.cmdll =     NULL;    /* setmem.cmdll (addr, value) */
-  hms_cmds.setmem.resp_delim =     NULL;/* setreg.resp_delim */
-  hms_cmds.setmem.term =     NULL;     /* setreg.term */
-  hms_cmds.setmem.term_cmd =     NULL; /* setreg.term_cmd */
-  hms_cmds.getmem.cmdb =     "m.b %x %x\r";    /* getmem.cmdb (addr, addr) */
-  hms_cmds.getmem.cmdw =     "m.w %x %x\r";    /* getmem.cmdw (addr, addr) */
-  hms_cmds.getmem.cmdl =     NULL;     /* getmem.cmdl (addr, addr) */
-  hms_cmds.getmem.cmdll =     NULL;    /* getmem.cmdll (addr, addr) */
-  hms_cmds.getmem.resp_delim =     ": ";/* getmem.resp_delim */
-  hms_cmds.getmem.term =     ">";      /* getmem.term */
-  hms_cmds.getmem.term_cmd =     "\003";/* getmem.term_cmd */
-  hms_cmds.setreg.cmd =     "r %s=%x\r";/* setreg.cmd (name, value) */
-  hms_cmds.setreg.resp_delim =     NULL;/* setreg.resp_delim */
-  hms_cmds.setreg.term =     NULL;     /* setreg.term */
-  hms_cmds.setreg.term_cmd =     NULL; /* setreg.term_cmd */
-  hms_cmds.getreg.cmd =     "r %s\r";  /* getreg.cmd (name) */
-  hms_cmds.getreg.resp_delim =     " (";/* getreg.resp_delim */
-  hms_cmds.getreg.term =     ":";      /* getreg.term */
-  hms_cmds.getreg.term_cmd =     "\003";/* getreg.term_cmd */
-  hms_cmds.dump_registers =   "r\r";   /* dump_registers */
-  hms_cmds.register_pattern =   "\\(\\w+\\)=\\([0-9a-fA-F]+\\)";       /* register_pattern */
-  hms_cmds.supply_register =   hms_supply_register;    /* supply_register */
-  hms_cmds.load_routine =   NULL;      /* load_routine (defaults to SRECs) */
-  hms_cmds.load =   "tl\r";            /* download command */
-  hms_cmds.loadresp =   NULL;          /* load response */
-  hms_cmds.prompt =   ">";             /* monitor command prompt */
-  hms_cmds.line_term =   "\r";         /* end-of-command delimitor */
-  hms_cmds.cmd_end =   NULL;           /* optional command terminator */
-  hms_cmds.target =   &hms_ops;                /* target operations */
-  hms_cmds.stopbits =   SERIAL_1_STOPBITS;/* number of stop bits */
-  hms_cmds.regnames =   hms_regnames;  /* registers names */
-  hms_cmds.magic =   MONITOR_OPS_MAGIC;        /* magic */
-} /* init_hms-cmds */
+  hms_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_FILL_USES_ADDR | MO_GETMEM_NEEDS_RANGE;
+  hms_cmds.init = hms_inits;   /* Init strings */
+  hms_cmds.cont = "g\r";       /* continue command */
+  hms_cmds.step = "s\r";       /* single step */
+  hms_cmds.stop = "\003";      /* ^C interrupts the program */
+  hms_cmds.set_break = "b %x\r";       /* set a breakpoint */
+  hms_cmds.clr_break = "b - %x\r";     /* clear a breakpoint */
+  hms_cmds.clr_all_break = "b -\r";    /* clear all breakpoints */
+  hms_cmds.fill = "f %x %x %x\r";      /* fill (start end val) */
+  hms_cmds.setmem.cmdb = "m.b %x=%x\r";                /* setmem.cmdb (addr, value) */
+  hms_cmds.setmem.cmdw = "m.w %x=%x\r";                /* setmem.cmdw (addr, value) */
+  hms_cmds.setmem.cmdl = NULL; /* setmem.cmdl (addr, value) */
+  hms_cmds.setmem.cmdll = NULL;        /* setmem.cmdll (addr, value) */
+  hms_cmds.setmem.resp_delim = NULL;   /* setreg.resp_delim */
+  hms_cmds.setmem.term = NULL; /* setreg.term */
+  hms_cmds.setmem.term_cmd = NULL;     /* setreg.term_cmd */
+  hms_cmds.getmem.cmdb = "m.b %x %x\r";                /* getmem.cmdb (addr, addr) */
+  hms_cmds.getmem.cmdw = "m.w %x %x\r";                /* getmem.cmdw (addr, addr) */
+  hms_cmds.getmem.cmdl = NULL; /* getmem.cmdl (addr, addr) */
+  hms_cmds.getmem.cmdll = NULL;        /* getmem.cmdll (addr, addr) */
+  hms_cmds.getmem.resp_delim = ": ";   /* getmem.resp_delim */
+  hms_cmds.getmem.term = ">";  /* getmem.term */
+  hms_cmds.getmem.term_cmd = "\003";   /* getmem.term_cmd */
+  hms_cmds.setreg.cmd = "r %s=%x\r";   /* setreg.cmd (name, value) */
+  hms_cmds.setreg.resp_delim = NULL;   /* setreg.resp_delim */
+  hms_cmds.setreg.term = NULL; /* setreg.term */
+  hms_cmds.setreg.term_cmd = NULL;     /* setreg.term_cmd */
+  hms_cmds.getreg.cmd = "r %s\r";      /* getreg.cmd (name) */
+  hms_cmds.getreg.resp_delim = " (";   /* getreg.resp_delim */
+  hms_cmds.getreg.term = ":";  /* getreg.term */
+  hms_cmds.getreg.term_cmd = "\003";   /* getreg.term_cmd */
+  hms_cmds.dump_registers = "r\r";     /* dump_registers */
+  hms_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */
+  hms_cmds.supply_register = hms_supply_register;      /* supply_register */
+  hms_cmds.load_routine = NULL;        /* load_routine (defaults to SRECs) */
+  hms_cmds.load = "tl\r";      /* download command */
+  hms_cmds.loadresp = NULL;    /* load response */
+  hms_cmds.prompt = ">";       /* monitor command prompt */
+  hms_cmds.line_term = "\r";   /* end-of-command delimitor */
+  hms_cmds.cmd_end = NULL;     /* optional command terminator */
+  hms_cmds.target = &hms_ops;  /* target operations */
+  hms_cmds.stopbits = SERIAL_1_STOPBITS;       /* number of stop bits */
+  hms_cmds.regnames = hms_regnames;    /* registers names */
+  hms_cmds.magic = MONITOR_OPS_MAGIC;  /* magic */
+}                              /* init_hms-cmds */
 
 static void
 hms_open (args, from_tty)
@@ -146,7 +147,7 @@ int write_dos_tick_delay;
 void
 _initialize_remote_hms ()
 {
-  init_hms_cmds() ;
+  init_hms_cmds ();
   init_monitor_ops (&hms_ops);
 
   hms_ops.to_shortname = "hms";
@@ -1321,41 +1322,41 @@ hms_open (name, from_tty)
 
 /* Define the target subroutine names */
 
-struct target_ops hms_ops ;
+struct target_ops hms_ops;
 
-static void 
-init_hms_ops(void)
+static void
+init_hms_ops (void)
 {
-  hms_ops.to_shortname =   "hms";
-  hms_ops.to_longname =   "Remote HMS monitor";
-  hms_ops.to_doc =   "Use the H8 evaluation board running the HMS monitor connected\n\
+  hms_ops.to_shortname = "hms";
+  hms_ops.to_longname = "Remote HMS monitor";
+  hms_ops.to_doc = "Use the H8 evaluation board running the HMS monitor connected\n\
 by a serial line.";
-  hms_ops.to_open =   hms_open;
-  hms_ops.to_close =   hms_close;
-  hms_ops.to_attach =   0;
+  hms_ops.to_open = hms_open;
+  hms_ops.to_close = hms_close;
+  hms_ops.to_attach = 0;
   hms_ops.to_post_attach = NULL;
   hms_ops.to_require_attach = NULL;
-  hms_ops.to_detach =   hms_detach;
+  hms_ops.to_detach = hms_detach;
   hms_ops.to_require_detach = NULL;
-  hms_ops.to_resume =   hms_resume;
-  hms_ops.to_wait  =   hms_wait;
+  hms_ops.to_resume = hms_resume;
+  hms_ops.to_wait = hms_wait;
   hms_ops.to_post_wait = NULL;
-  hms_ops.to_fetch_registers  =   hms_fetch_register;
-  hms_ops.to_store_registers  =   hms_store_register;
-  hms_ops.to_prepare_to_store =   hms_prepare_to_store;
-  hms_ops.to_xfer_memory  =   hms_xfer_inferior_memory;
-  hms_ops.to_files_info  =   hms_files_info;
-  hms_ops.to_insert_breakpoint =   hms_insert_breakpoint;
-  hms_ops.to_remove_breakpoint =   hms_remove_breakpoint;
-  hms_ops.to_terminal_init  =   0;
-  hms_ops.to_terminal_inferior =   0;
-  hms_ops.to_terminal_ours_for_output =   0;
-  hms_ops.to_terminal_ours  =   0;
-  hms_ops.to_terminal_info  =   0;
-  hms_ops.to_kill  =   hms_kill;       
-  hms_ops.to_load  =   generic_load;
-  hms_ops.to_lookup_symbol =   0;
-  hms_ops.to_create_inferior =   hms_create_inferior;
+  hms_ops.to_fetch_registers = hms_fetch_register;
+  hms_ops.to_store_registers = hms_store_register;
+  hms_ops.to_prepare_to_store = hms_prepare_to_store;
+  hms_ops.to_xfer_memory = hms_xfer_inferior_memory;
+  hms_ops.to_files_info = hms_files_info;
+  hms_ops.to_insert_breakpoint = hms_insert_breakpoint;
+  hms_ops.to_remove_breakpoint = hms_remove_breakpoint;
+  hms_ops.to_terminal_init = 0;
+  hms_ops.to_terminal_inferior = 0;
+  hms_ops.to_terminal_ours_for_output = 0;
+  hms_ops.to_terminal_ours = 0;
+  hms_ops.to_terminal_info = 0;
+  hms_ops.to_kill = hms_kill;
+  hms_ops.to_load = generic_load;
+  hms_ops.to_lookup_symbol = 0;
+  hms_ops.to_create_inferior = hms_create_inferior;
   hms_ops.to_post_startup_inferior = NULL;
   hms_ops.to_acknowledge_created_inferior = NULL;
   hms_ops.to_clone_and_follow_inferior = NULL;
@@ -1373,23 +1374,23 @@ by a serial line.";
   hms_ops.to_has_execd = NULL;
   hms_ops.to_reported_exec_events_per_exec_call = NULL;
   hms_ops.to_has_exited = NULL;
-  hms_ops.to_mourn_inferior =   hms_mourn;
-  hms_ops.to_can_run  =   0;
-  hms_ops.to_notice_signals =   0;
-  hms_ops.to_thread_alive  =   0;
-  hms_ops.to_stop  =   0;
+  hms_ops.to_mourn_inferior = hms_mourn;
+  hms_ops.to_can_run = 0;
+  hms_ops.to_notice_signals = 0;
+  hms_ops.to_thread_alive = 0;
+  hms_ops.to_stop = 0;
   hms_ops.to_pid_to_exec_file = NULL;
-  hms_ops.to_core_file_to_sym_file = NULL;                     
-  hms_ops.to_stratum =   process_stratum;
-  hms_ops.DONT_USE =   0;      
-  hms_ops.to_has_all_memory =   1;
-  hms_ops.to_has_memory =   1;
-  hms_ops.to_has_stack =   1;
-  hms_ops.to_has_registers =   1;
-  hms_ops.to_has_execution =   1;
-  hms_ops.to_sections =   0;
-  hms_ops.to_sections_end =   0;                       
-  hms_ops.to_magic =   OPS_MAGIC;              
+  hms_ops.to_core_file_to_sym_file = NULL;
+  hms_ops.to_stratum = process_stratum;
+  hms_ops.DONT_USE = 0;
+  hms_ops.to_has_all_memory = 1;
+  hms_ops.to_has_memory = 1;
+  hms_ops.to_has_stack = 1;
+  hms_ops.to_has_registers = 1;
+  hms_ops.to_has_execution = 1;
+  hms_ops.to_sections = 0;
+  hms_ops.to_sections_end = 0;
+  hms_ops.to_magic = OPS_MAGIC;
 };
 
 hms_quiet ()                   /* FIXME - this routine can be removed after Dec '94 */
@@ -1478,7 +1479,7 @@ remove_commands ()
 void
 _initialize_remote_hms ()
 {
-  init_hms_ops() ;
+  init_hms_ops ();
   add_target (&hms_ops);
 
   add_com ("hms <command>", class_obscure, hms_com,
@@ -1497,4 +1498,3 @@ _initialize_remote_hms ()
   dev_name = NULL;
 }
 #endif
-
index f5aca89d15cf79f867cff046532b3eae01aec748..6d6329d6dca554b2e29fdcb28a7b8f4cbbf87a16 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Cygnus Support.  Written by Ian Lance Taylor
    <ian@cygnus.com>.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -46,19 +47,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif
 
 extern void mips_set_processor_type_command PARAMS ((char *, int));
-
 \f
+
 /* Breakpoint types.  Values 0, 1, and 2 must agree with the watch
    types passed by breakpoint.c to target_insert_watchpoint.
    Value 3 is our own invention, and is used for ordinary instruction
    breakpoints.  Value 4 is used to mark an unused watchpoint in tables.  */
-enum break_type {
-  BREAK_WRITE, /* 0 */
-  BREAK_READ,  /* 1 */
-  BREAK_ACCESS,        /* 2 */
-  BREAK_FETCH, /* 3 */
-  BREAK_UNUSED /* 4 */
-};
+enum break_type
+  {
+    BREAK_WRITE,               /* 0 */
+    BREAK_READ,                        /* 1 */
+    BREAK_ACCESS,              /* 2 */
+    BREAK_FETCH,               /* 3 */
+    BREAK_UNUSED               /* 4 */
+  };
 
 /* Prototypes for local functions.  */
 
@@ -82,8 +84,8 @@ static int mips_receive_packet PARAMS ((char *buff, int throw_error,
                                        int timeout));
 
 static CORE_ADDR mips_request PARAMS ((int cmd, CORE_ADDR addr,
-                                CORE_ADDR data, int *perr, int timeout,
-                                char *buff));
+                                    CORE_ADDR data, int *perr, int timeout,
+                                      char *buff));
 
 static void mips_initialize PARAMS ((void));
 
@@ -102,7 +104,7 @@ static void mips_detach PARAMS ((char *args, int from_tty));
 static void mips_resume PARAMS ((int pid, int step,
                                 enum target_signal siggnal));
 
-static int mips_wait PARAMS ((int pid, struct target_waitstatus *status));
+static int mips_wait PARAMS ((int pid, struct target_waitstatus * status));
 
 static int mips_map_regno PARAMS ((int regno));
 
@@ -118,9 +120,9 @@ static int mips_store_word PARAMS ((CORE_ADDR addr, unsigned int value,
                                    char *old_contents));
 
 static int mips_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
-                                    int write, struct target_ops *ignore));
+                                    int write, struct target_ops * ignore));
 
-static void mips_files_info PARAMS ((struct target_ops *ignore));
+static void mips_files_info PARAMS ((struct target_ops * ignore));
 
 static void mips_create_inferior PARAMS ((char *execfile, char *args,
                                          char **env));
@@ -130,13 +132,13 @@ static void mips_mourn_inferior PARAMS ((void));
 static int pmon_makeb64 PARAMS ((unsigned long v, char *p, int n, int *chksum));
 
 static int pmon_zeroset PARAMS ((int recsize, char **buff, int *amount,
-                                 unsigned int *chksum));
+                                unsigned int *chksum));
 
 static int pmon_checkset PARAMS ((int recsize, char **buff, int *value));
 
 static void pmon_make_fastrec PARAMS ((char **outbuf, unsigned char *inbuf,
-                                       int *inptr, int inamount, int *recsize,
-                                       unsigned int *csum, unsigned int *zerofill));
+                                    int *inptr, int inamount, int *recsize,
+                              unsigned int *csum, unsigned int *zerofill));
 
 static int pmon_check_ack PARAMS ((char *mesg));
 
@@ -166,66 +168,65 @@ static int common_breakpoint PARAMS ((int set, CORE_ADDR addr, int len,
 extern struct target_ops mips_ops;
 extern struct target_ops pmon_ops;
 extern struct target_ops ddb_ops;
-\f
-/* *INDENT-OFF* */
+\f/* *INDENT-OFF* */
 /* The MIPS remote debugging interface is built on top of a simple
    packet protocol.  Each packet is organized as follows:
 
-   SYN The first character is always a SYN (ASCII 026, or ^V).  SYN
-       may not appear anywhere else in the packet.  Any time a SYN is
-       seen, a new packet should be assumed to have begun.
+   SYN  The first character is always a SYN (ASCII 026, or ^V).  SYN
+   may not appear anywhere else in the packet.  Any time a SYN is
+   seen, a new packet should be assumed to have begun.
 
    TYPE_LEN
-       This byte contains the upper five bits of the logical length
-       of the data section, plus a single bit indicating whether this
-       is a data packet or an acknowledgement.  The documentation
-       indicates that this bit is 1 for a data packet, but the actual
-       board uses 1 for an acknowledgement.  The value of the byte is
-               0x40 + (ack ? 0x20 : 0) + (len >> 6)
-       (we always have 0 <= len < 1024).  Acknowledgement packets do
-       not carry data, and must have a data length of 0.
+   This byte contains the upper five bits of the logical length
+   of the data section, plus a single bit indicating whether this
+   is a data packet or an acknowledgement.  The documentation
+   indicates that this bit is 1 for a data packet, but the actual
+   board uses 1 for an acknowledgement.  The value of the byte is
+   0x40 + (ack ? 0x20 : 0) + (len >> 6)
+   (we always have 0 <= len < 1024).  Acknowledgement packets do
+   not carry data, and must have a data length of 0.
 
    LEN1 This byte contains the lower six bits of the logical length of
-       the data section.  The value is
-               0x40 + (len & 0x3f)
-
-   SEQ This byte contains the six bit sequence number of the packet.
-       The value is
-               0x40 + seq
-       An acknowlegment packet contains the sequence number of the
-       packet being acknowledged plus 1 modulo 64.  Data packets are
-       transmitted in sequence.  There may only be one outstanding
-       unacknowledged data packet at a time.  The sequence numbers
-       are independent in each direction.  If an acknowledgement for
-       the previous packet is received (i.e., an acknowledgement with
-       the sequence number of the packet just sent) the packet just
-       sent should be retransmitted.  If no acknowledgement is
-       received within a timeout period, the packet should be
-       retransmitted.  This has an unfortunate failure condition on a
-       high-latency line, as a delayed acknowledgement may lead to an
-       endless series of duplicate packets.
-
-   DATA        The actual data bytes follow.  The following characters are
-       escaped inline with DLE (ASCII 020, or ^P):
-               SYN (026)       DLE S
-               DLE (020)       DLE D
-               ^C  (003)       DLE C
-               ^S  (023)       DLE s
-               ^Q  (021)       DLE q
-       The additional DLE characters are not counted in the logical
-       length stored in the TYPE_LEN and LEN1 bytes.
+   the data section.  The value is
+   0x40 + (len & 0x3f)
+
+   SEQ  This byte contains the six bit sequence number of the packet.
+   The value is
+   0x40 + seq
+   An acknowlegment packet contains the sequence number of the
+   packet being acknowledged plus 1 modulo 64.  Data packets are
+   transmitted in sequence.  There may only be one outstanding
+   unacknowledged data packet at a time.  The sequence numbers
+   are independent in each direction.  If an acknowledgement for
+   the previous packet is received (i.e., an acknowledgement with
+   the sequence number of the packet just sent) the packet just
+   sent should be retransmitted.  If no acknowledgement is
+   received within a timeout period, the packet should be
+   retransmitted.  This has an unfortunate failure condition on a
+   high-latency line, as a delayed acknowledgement may lead to an
+   endless series of duplicate packets.
+
+   DATA The actual data bytes follow.  The following characters are
+   escaped inline with DLE (ASCII 020, or ^P):
+   SYN (026)    DLE S
+   DLE (020)    DLE D
+   ^C  (003)    DLE C
+   ^S  (023)    DLE s
+   ^Q  (021)    DLE q
+   The additional DLE characters are not counted in the logical
+   length stored in the TYPE_LEN and LEN1 bytes.
 
    CSUM1
    CSUM2
    CSUM3
-       These bytes contain an 18 bit checksum of the complete
-       contents of the packet excluding the SEQ byte and the
-       CSUM[123] bytes.  The checksum is simply the twos complement
-       addition of all the bytes treated as unsigned characters.  The
-       values of the checksum bytes are:
-               CSUM1: 0x40 + ((cksum >> 12) & 0x3f)
-               CSUM2: 0x40 + ((cksum >> 6) & 0x3f)
-               CSUM3: 0x40 + (cksum & 0x3f)
+   These bytes contain an 18 bit checksum of the complete
+   contents of the packet excluding the SEQ byte and the
+   CSUM[123] bytes.  The checksum is simply the twos complement
+   addition of all the bytes treated as unsigned characters.  The
+   values of the checksum bytes are:
+   CSUM1: 0x40 + ((cksum >> 12) & 0x3f)
+   CSUM2: 0x40 + ((cksum >> 6) & 0x3f)
+   CSUM3: 0x40 + (cksum & 0x3f)
 
    It happens that the MIPS remote debugging protocol always
    communicates with ASCII strings.  Because of this, this
@@ -233,6 +234,7 @@ extern struct target_ops ddb_ops;
    since it will never be required.  */
 /* *INDENT-ON* */
 
+
 /* The SYN character which starts each packet.  */
 #define SYN '\026'
 
@@ -313,16 +315,17 @@ extern struct target_ops ddb_ops;
    vector later.  */
 struct target_ops mips_ops, pmon_ops, ddb_ops, lsi_ops;
 
-enum mips_monitor_type {
-  /* IDT/SIM monitor being used: */
-  MON_IDT,
-  /* PMON monitor being used: */
-  MON_PMON, /* 3.0.83 [COGENT,EB,FP,NET] Algorithmics Ltd. Nov  9 1995 17:19:50 */
-  MON_DDB,  /* 2.7.473 [DDBVR4300,EL,FP,NET] Risq Modular Systems,  Thu Jun 6 09:28:40 PDT 1996 */
-  MON_LSI,  /* 4.3.12 [EB,FP], LSI LOGIC Corp. Tue Feb 25 13:22:14 1997 */
-  /* Last and unused value, for sizing vectors, etc. */
-  MON_LAST
-};
+enum mips_monitor_type
+  {
+    /* IDT/SIM monitor being used: */
+    MON_IDT,
+    /* PMON monitor being used: */
+    MON_PMON,                  /* 3.0.83 [COGENT,EB,FP,NET] Algorithmics Ltd. Nov  9 1995 17:19:50 */
+    MON_DDB,                   /* 2.7.473 [DDBVR4300,EL,FP,NET] Risq Modular Systems,  Thu Jun 6 09:28:40 PDT 1996 */
+    MON_LSI,                   /* 4.3.12 [EB,FP], LSI LOGIC Corp. Tue Feb 25 13:22:14 1997 */
+    /* Last and unused value, for sizing vectors, etc. */
+    MON_LAST
+  };
 static enum mips_monitor_type mips_monitor = MON_LAST;
 
 /* The monitor prompt text.  If the user sets the PMON prompt
@@ -331,12 +334,12 @@ static enum mips_monitor_type mips_monitor = MON_LAST;
    will not be able to connect to PMON in mips_initialize().
    If the `set monitor-prompt' command is not used, the expected
    default prompt will be set according the target:
-       target          prompt
-       -----           -----
-       pmon            PMON> 
-       ddb             NEC010>
-       lsi             PMON>
-*/
+   target               prompt
+   -----                -----
+   pmon         PMON> 
+   ddb          NEC010>
+   lsi          PMON>
+ */
 static char *mips_monitor_prompt;
 
 /* Set to 1 if the target is open.  */
@@ -400,7 +403,7 @@ static monitor_supports_breakpoints = 0;
 
 /* Data cache header.  */
 
-#if 0  /* not used (yet?) */
+#if 0                          /* not used (yet?) */
 static DCACHE *mips_dcache;
 #endif
 
@@ -410,52 +413,53 @@ static int hit_watchpoint;
 /* Table of breakpoints/watchpoints (used only on LSI PMON target).
    The table is indexed by a breakpoint number, which is an integer
    from 0 to 255 returned by the LSI PMON when a breakpoint is set.
-*/
+ */
 #define MAX_LSI_BREAKPOINTS 256
 struct lsi_breakpoint_info
-{
-  enum break_type type;                /* type of breakpoint */
-  CORE_ADDR addr;              /* address of breakpoint */
-  int len;                     /* length of region being watched */
-  unsigned long value;         /* value to watch */
-} lsi_breakpoints [MAX_LSI_BREAKPOINTS];
+  {
+    enum break_type type;      /* type of breakpoint */
+    CORE_ADDR addr;            /* address of breakpoint */
+    int len;                   /* length of region being watched */
+    unsigned long value;       /* value to watch */
+  }
+lsi_breakpoints[MAX_LSI_BREAKPOINTS];
 
 /* Error/warning codes returned by LSI PMON for breakpoint commands.
    Warning values may be ORed together; error values may not.  */
-#define W_WARN 0x100   /* This bit is set if the error code is a warning */
-#define W_MSK   0x101  /* warning: Range feature is supported via mask */
-#define W_VAL   0x102  /* warning: Value check is not supported in hardware */
-#define W_QAL   0x104  /* warning: Requested qualifiers are not supported in hardware */
-
-#define E_ERR  0x200   /* This bit is set if the error code is an error */
-#define E_BPT   0x200  /* error: No such breakpoint number */
-#define E_RGE   0x201  /* error: Range is not supported */
-#define E_QAL   0x202  /* error: The requested qualifiers can not be used */
-#define E_OUT   0x203  /* error: Out of hardware resources */
-#define E_NON   0x204  /* error: Hardware breakpoint not supported */
+#define W_WARN 0x100           /* This bit is set if the error code is a warning */
+#define W_MSK   0x101          /* warning: Range feature is supported via mask */
+#define W_VAL   0x102          /* warning: Value check is not supported in hardware */
+#define W_QAL   0x104          /* warning: Requested qualifiers are not supported in hardware */
+
+#define E_ERR  0x200           /* This bit is set if the error code is an error */
+#define E_BPT   0x200          /* error: No such breakpoint number */
+#define E_RGE   0x201          /* error: Range is not supported */
+#define E_QAL   0x202          /* error: The requested qualifiers can not be used */
+#define E_OUT   0x203          /* error: Out of hardware resources */
+#define E_NON   0x204          /* error: Hardware breakpoint not supported */
 
 struct lsi_error
-{
-  int code;            /* error code */
-  char *string;                /* string associated with this code */
-};
+  {
+    int code;                  /* error code */
+    char *string;              /* string associated with this code */
+  };
 
 struct lsi_error lsi_warning_table[] =
 {
-  { W_MSK,     "Range feature is supported via mask" },
-  { W_VAL,     "Value check is not supported in hardware" },
-  { W_QAL,     "Requested qualifiers are not supported in hardware" },
-  { 0,         NULL }
+  {W_MSK, "Range feature is supported via mask"},
+  {W_VAL, "Value check is not supported in hardware"},
+  {W_QAL, "Requested qualifiers are not supported in hardware"},
+  {0, NULL}
 };
 
 struct lsi_error lsi_error_table[] =
-{  
-  { E_BPT,     "No such breakpoint number" },
-  { E_RGE,     "Range is not supported" },
-  { E_QAL,     "The requested qualifiers can not be used" },
-  { E_OUT,     "Out of hardware resources" },
-  { E_NON,     "Hardware breakpoint not supported" },
-  { 0,         NULL }
+{
+  {E_BPT, "No such breakpoint number"},
+  {E_RGE, "Range is not supported"},
+  {E_QAL, "The requested qualifiers can not be used"},
+  {E_OUT, "Out of hardware resources"},
+  {E_NON, "Hardware breakpoint not supported"},
+  {0, NULL}
 };
 
 /* Set to 1 with the 'set monitor-warnings' command to enable printing
@@ -464,7 +468,7 @@ static int monitor_warnings;
 
 
 static void
-close_ports()
+close_ports ()
 {
   mips_is_open = 0;
   SERIAL_CLOSE (mips_desc);
@@ -476,7 +480,7 @@ close_ports()
     }
   tftp_in_use = 0;
 }
-    
+
 /* Handle low-level error that we can't recover from.  Note that just
    error()ing out from target_wait or some such low-level place will cause
    all hell to break loose--the rest of GDB will tend to get left in an
@@ -484,7 +488,7 @@ close_ports()
 
 static NORETURN void
 #ifdef ANSI_PROTOTYPES
-mips_error (char *string, ...)
+mips_error (char *string,...)
 #else
 mips_error (va_alist)
      va_dcl
@@ -499,9 +503,9 @@ mips_error (va_alist)
   va_start (args);
   string = va_arg (args, char *);
 #endif
+
   target_terminal_ours ();
-  wrap_here("");                       /* Force out any buffered output */
+  wrap_here ("");              /* Force out any buffered output */
   gdb_flush (gdb_stdout);
   if (error_pre_print)
     fprintf_filtered (gdb_stderr, error_pre_print);
@@ -533,9 +537,9 @@ fputc_readable (ch, file)
     fputc_unfiltered ('\n', file);
   else if (ch == '\r')
     fprintf_unfiltered (file, "\\r");
-  else if (ch < 0x20)  /* ASCII control character */
+  else if (ch < 0x20)          /* ASCII control character */
     fprintf_unfiltered (file, "^%c", ch + '@');
-  else if (ch >= 0x7f) /* non-ASCII characters (rubout or greater) */
+  else if (ch >= 0x7f)         /* non-ASCII characters (rubout or greater) */
     fprintf_unfiltered (file, "[%02x]", ch & 0xff);
   else
     fputc_unfiltered (ch, file);
@@ -559,7 +563,7 @@ fputs_readable (string, file)
 
 /* Wait until STRING shows up in mips_desc.  Returns 1 if successful, else 0 if
    timed out.  TIMEOUT specifies timeout value in seconds.
-*/
+ */
 
 int
 mips_expect_timeout (string, timeout)
@@ -596,7 +600,7 @@ mips_expect_timeout (string, timeout)
        fputc_readable (c, gdb_stdlog);
 
       if (c == *p++)
-       {       
+       {
          if (*p == '\0')
            {
              immediate_quit = 0;
@@ -617,13 +621,13 @@ mips_expect_timeout (string, timeout)
 /* Wait until STRING shows up in mips_desc.  Returns 1 if successful, else 0 if
    timed out.  The timeout value is hard-coded to 2 seconds.  Use
    mips_expect_timeout if a different timeout value is needed.
-*/
+ */
 
 int
 mips_expect (string)
      char *string;
 {
-    return mips_expect_timeout (string, 2);
+  return mips_expect_timeout (string, 2);
 }
 
 /* Read the required number of characters into the given buffer (which
@@ -641,11 +645,12 @@ mips_getstring (string, n)
     {
       c = SERIAL_READCHAR (mips_desc, 2);
 
-      if (c == SERIAL_TIMEOUT) {
-        fprintf_unfiltered (gdb_stderr,
-                           "Failed to read %d characters from target (TIMEOUT)\n", n);
-       return 0;
-      }
+      if (c == SERIAL_TIMEOUT)
+       {
+         fprintf_unfiltered (gdb_stderr,
+                "Failed to read %d characters from target (TIMEOUT)\n", n);
+         return 0;
+       }
 
       *p++ = c;
       n--;
@@ -681,14 +686,14 @@ mips_readchar (timeout)
 
     i = timeout;
     if (i == -1 && watchdog > 0)
-     i = watchdog;
+      i = watchdog;
   }
 
   if (state == mips_monitor_prompt_len)
     timeout = 1;
   ch = SERIAL_READCHAR (mips_desc, timeout);
 
-  if (ch == SERIAL_TIMEOUT && timeout == -1) /* Watchdog went off */
+  if (ch == SERIAL_TIMEOUT && timeout == -1)   /* Watchdog went off */
     {
       target_mourn_inferior ();
       error ("Watchdog has expired.  Target detached.\n");
@@ -701,7 +706,7 @@ mips_readchar (timeout)
   if (remote_debug > 1)
     {
       /* Don't use _filtered; we can't deal with a QUIT out of
-        target_wait, and I think this might be called from there.  */
+         target_wait, and I think this might be called from there.  */
       if (ch != SERIAL_TIMEOUT)
        fprintf_unfiltered (gdb_stdlog, "Read '%c' %d 0x%x\n", ch, ch, ch);
       else
@@ -715,8 +720,8 @@ mips_readchar (timeout)
      more than 64 characters long, which ours never are.  */
   if ((ch == SERIAL_TIMEOUT || ch == '@')
       && state == mips_monitor_prompt_len
-      && ! mips_initializing
-      && ! mips_exiting)
+      && !mips_initializing
+      && !mips_exiting)
     {
       if (remote_debug > 0)
        /* Don't use _filtered; we can't deal with a QUIT out of
@@ -729,7 +734,7 @@ mips_readchar (timeout)
       state = 0;
 
       /* At this point, about the only thing we can do is abort the command
-        in progress and get back to command level as quickly as possible. */
+         in progress and get back to command level as quickly as possible. */
 
       error ("Remote board reset, debug protocol re-initialized.");
     }
@@ -759,21 +764,21 @@ mips_receive_header (hdr, pgarbage, ch, timeout)
   while (1)
     {
       /* Wait for a SYN.  mips_syn_garbage is intended to prevent
-        sitting here indefinitely if the board sends us one garbage
-        character per second.  ch may already have a value from the
-        last time through the loop.  */
+         sitting here indefinitely if the board sends us one garbage
+         character per second.  ch may already have a value from the
+         last time through the loop.  */
       while (ch != SYN)
        {
          ch = mips_readchar (timeout);
          if (ch == SERIAL_TIMEOUT)
-           return -1;
+           return -1;
          if (ch != SYN)
            {
              /* Printing the character here lets the user of gdb see
-                what the program is outputting, if the debugging is
-                being done on the console port.  Don't use _filtered;
-                we can't deal with a QUIT out of target_wait.  */
-             if (! mips_initializing || remote_debug > 0)
+                what the program is outputting, if the debugging is
+                being done on the console port.  Don't use _filtered;
+                we can't deal with a QUIT out of target_wait.  */
+             if (!mips_initializing || remote_debug > 0)
                {
                  fputc_readable (ch, gdb_stdlog);
                  gdb_flush (gdb_stdlog);
@@ -782,7 +787,7 @@ mips_receive_header (hdr, pgarbage, ch, timeout)
              ++*pgarbage;
              if (mips_syn_garbage > 0
                  && *pgarbage > mips_syn_garbage)
-               mips_error ("Debug protocol failure:  more than %d characters before a sync.", 
+               mips_error ("Debug protocol failure:  more than %d characters before a sync.",
                            mips_syn_garbage);
            }
        }
@@ -792,18 +797,18 @@ mips_receive_header (hdr, pgarbage, ch, timeout)
        {
          ch = mips_readchar (timeout);
          if (ch == SERIAL_TIMEOUT)
-            return -1;
+           return -1;
          /* Make sure this is a header byte.  */
-         if (ch == SYN || ! HDR_CHECK (ch))
+         if (ch == SYN || !HDR_CHECK (ch))
            break;
 
          hdr[i] = ch;
        }
 
       /* If we got the complete header, we can return.  Otherwise we
-        loop around and keep looking for SYN.  */
+         loop around and keep looking for SYN.  */
       if (i >= HDR_LENGTH)
-        return 0;
+       return 0;
     }
 }
 
@@ -828,7 +833,7 @@ mips_receive_trailer (trlr, pgarbage, pch, timeout)
       *pch = ch;
       if (ch == SERIAL_TIMEOUT)
        return -1;
-      if (! TRLR_CHECK (ch))
+      if (!TRLR_CHECK (ch))
        return -2;
       trlr[i] = ch;
     }
@@ -855,7 +860,7 @@ mips_cksum (hdr, data, len)
   p = hdr + 1;
   while (c-- != 0)
     cksum += *p++;
-  
+
   c = len;
   p = data;
   while (c-- != 0)
@@ -918,7 +923,7 @@ mips_send_packet (s, get_ack)
                        HDR_LENGTH + len + TRLR_LENGTH) != 0)
        mips_error ("write to target failed: %s", safe_strerror (errno));
 
-      if (! get_ack)
+      if (!get_ack)
        return;
 
       garbage = 0;
@@ -942,36 +947,37 @@ mips_send_packet (s, get_ack)
             ignore it.  FIXME: If the acknowledgement is lost, this
             data packet may be the packet the remote sends after the
             acknowledgement.  */
-         if (HDR_IS_DATA (hdr)) {
-            int i;
-
-            /* Ignore any errors raised whilst attempting to ignore
-               packet. */
-
-            len = HDR_GET_LEN (hdr);
-
-            for (i = 0; i < len; i++)
-              {
-                int rch;
-
-                rch = mips_readchar (2);
-                if (rch == SYN)
-                  {
-                    ch = SYN;
-                    break;
-                  }
-                if (rch == SERIAL_TIMEOUT)
-                  break;
-                /* ignore the character */
-              }
-
-            if (i == len)
-              (void) mips_receive_trailer (trlr, &garbage, &ch, 2);
-
-            /* We don't bother checking the checksum, or providing an
-               ACK to the packet. */
-           continue;
-          }
+         if (HDR_IS_DATA (hdr))
+           {
+             int i;
+
+             /* Ignore any errors raised whilst attempting to ignore
+                packet. */
+
+             len = HDR_GET_LEN (hdr);
+
+             for (i = 0; i < len; i++)
+               {
+                 int rch;
+
+                 rch = mips_readchar (2);
+                 if (rch == SYN)
+                   {
+                     ch = SYN;
+                     break;
+                   }
+                 if (rch == SERIAL_TIMEOUT)
+                   break;
+                 /* ignore the character */
+               }
+
+             if (i == len)
+               (void) mips_receive_trailer (trlr, &garbage, &ch, 2);
+
+             /* We don't bother checking the checksum, or providing an
+                ACK to the packet. */
+             continue;
+           }
 
          /* If the length is not 0, this is a garbled packet.  */
          if (HDR_GET_LEN (hdr) != 0)
@@ -1000,7 +1006,7 @@ mips_send_packet (s, get_ack)
              hdr[HDR_LENGTH] = '\0';
              trlr[TRLR_LENGTH] = '\0';
              /* Don't use _filtered; we can't deal with a QUIT out of
-                target_wait, and I think this might be called from there.  */
+                target_wait, and I think this might be called from there.  */
              fprintf_unfiltered (gdb_stdlog, "Got ack %d \"%s%s\"\n",
                                  HDR_GET_SEQ (hdr), hdr + 1, trlr);
            }
@@ -1064,17 +1070,17 @@ mips_receive_packet (buff, throw_error, timeout)
       ch = 0;
 
       /* An acknowledgement is probably a duplicate; ignore it.  */
-      if (! HDR_IS_DATA (hdr))
+      if (!HDR_IS_DATA (hdr))
        {
-          len = HDR_GET_LEN (hdr);
-          /* Check if the length is valid for an ACK, we may aswell
-             try and read the remainder of the packet: */
-          if (len == 0)
-            {
-              /* Ignore the error condition, since we are going to
-                 ignore the packet anyway. */
-              (void) mips_receive_trailer (trlr, &garbage, &ch, timeout);
-            }
+         len = HDR_GET_LEN (hdr);
+         /* Check if the length is valid for an ACK, we may aswell
+            try and read the remainder of the packet: */
+         if (len == 0)
+           {
+             /* Ignore the error condition, since we are going to
+                ignore the packet anyway. */
+             (void) mips_receive_trailer (trlr, &garbage, &ch, timeout);
+           }
          /* Don't use _filtered; we can't deal with a QUIT out of
             target_wait, and I think this might be called from there.  */
          if (remote_debug > 0)
@@ -1138,23 +1144,23 @@ mips_receive_packet (buff, throw_error, timeout)
             target_wait, and I think this might be called from there.  */
          if (remote_debug > 0)
            fprintf_unfiltered (gdb_stdlog,
-                              "Ignoring sequence number %d (want %d)\n",
-                              HDR_GET_SEQ (hdr), mips_receive_seq);
+                               "Ignoring sequence number %d (want %d)\n",
+                               HDR_GET_SEQ (hdr), mips_receive_seq);
          continue;
        }
 
       if (mips_cksum (hdr, buff, len) == TRLR_GET_CKSUM (trlr))
-        break;
+       break;
 
       if (remote_debug > 0)
        /* Don't use _filtered; we can't deal with a QUIT out of
           target_wait, and I think this might be called from there.  */
        printf_unfiltered ("Bad checksum; data %d, trailer %d\n",
-                        mips_cksum (hdr, buff, len),
-                        TRLR_GET_CKSUM (trlr));
+                          mips_cksum (hdr, buff, len),
+                          TRLR_GET_CKSUM (trlr));
 
       /* The checksum failed.  Send an acknowledgement for the
-        previous packet to tell the remote to resend the packet.  */
+         previous packet to tell the remote to resend the packet.  */
       ack[HDR_INDX_SYN] = HDR_SET_SYN (0, 0, mips_receive_seq);
       ack[HDR_INDX_TYPE_LEN] = HDR_SET_TYPE_LEN (0, 0, mips_receive_seq);
       ack[HDR_INDX_LEN1] = HDR_SET_LEN1 (0, 0, mips_receive_seq);
@@ -1172,7 +1178,7 @@ mips_receive_packet (buff, throw_error, timeout)
          /* Don't use _filtered; we can't deal with a QUIT out of
             target_wait, and I think this might be called from there.  */
          printf_unfiltered ("Writing ack %d \"%s\"\n", mips_receive_seq,
-                          ack + 1);
+                            ack + 1);
        }
 
       if (SERIAL_WRITE (mips_desc, ack, HDR_LENGTH + TRLR_LENGTH) != 0)
@@ -1188,7 +1194,7 @@ mips_receive_packet (buff, throw_error, timeout)
     {
       buff[len] = '\0';
       /* Don't use _filtered; we can't deal with a QUIT out of
-        target_wait, and I think this might be called from there.  */
+         target_wait, and I think this might be called from there.  */
       printf_unfiltered ("Got packet \"%s\"\n", buff);
     }
 
@@ -1210,9 +1216,9 @@ mips_receive_packet (buff, throw_error, timeout)
     {
       ack[HDR_LENGTH + TRLR_LENGTH] = '\0';
       /* Don't use _filtered; we can't deal with a QUIT out of
-        target_wait, and I think this might be called from there.  */
+         target_wait, and I think this might be called from there.  */
       printf_unfiltered ("Writing ack %d \"%s\"\n", mips_receive_seq,
-                      ack + 1);
+                        ack + 1);
     }
 
   if (SERIAL_WRITE (mips_desc, ack, HDR_LENGTH + TRLR_LENGTH) != 0)
@@ -1232,15 +1238,15 @@ mips_receive_packet (buff, throw_error, timeout)
    request has an ADDR argument and a DATA argument.  The following
    requests are defined:
 
-   \0  don't send a request; just wait for a reply
-   i   read word from instruction space at ADDR
-   d   read word from data space at ADDR
-   I   write DATA to instruction space at ADDR
-   D   write DATA to data space at ADDR
-   r   read register number ADDR
-   R   set register number ADDR to value DATA
-   c   continue execution (if ADDR != 1, set pc to ADDR)
-   s   single step (if ADDR != 1, set pc to ADDR)
+   \0   don't send a request; just wait for a reply
+   i    read word from instruction space at ADDR
+   d    read word from data space at ADDR
+   I    write DATA to instruction space at ADDR
+   D    write DATA to data space at ADDR
+   r    read register number ADDR
+   R    set register number ADDR to value DATA
+   c    continue execution (if ADDR != 1, set pc to ADDR)
+   s    single step (if ADDR != 1, set pc to ADDR)
 
    The read requests return the value requested.  The write requests
    return the previous value in the changed location.  The execution
@@ -1251,7 +1257,7 @@ mips_receive_packet (buff, throw_error, timeout)
    occurs, it sets *PERR to 1 and sets errno according to what the
    target board reports.  */
 
-static CORE_ADDR 
+static CORE_ADDR
 mips_request (cmd, addr, data, perr, timeout, buff)
      int cmd;
      CORE_ADDR addr;
@@ -1282,7 +1288,7 @@ mips_request (cmd, addr, data, perr, timeout, buff)
   if (perr == (int *) NULL)
     return 0;
 
-  if (! mips_need_reply)
+  if (!mips_need_reply)
     fatal ("mips_request: Trying to get reply before command");
 
   mips_need_reply = 0;
@@ -1300,9 +1306,9 @@ mips_request (cmd, addr, data, perr, timeout, buff)
       *perr = 1;
 
       /* FIXME: This will returns MIPS errno numbers, which may or may
-        not be the same as errno values used on other systems.  If
-        they stick to common errno values, they will be the same, but
-        if they don't, they must be translated.  */
+         not be the same as errno values used on other systems.  If
+         they stick to common errno values, they will be the same, but
+         if they don't, they must be translated.  */
       errno = rresponse;
 
       return 0;
@@ -1331,7 +1337,7 @@ mips_send_command (cmd, prompt)
      const char *cmd;
      int prompt;
 {
-  SERIAL_WRITE (mips_desc, cmd, strlen(cmd));
+  SERIAL_WRITE (mips_desc, cmd, strlen (cmd));
   mips_expect (cmd);
   mips_expect ("\n");
   if (prompt)
@@ -1348,10 +1354,10 @@ mips_enter_debug ()
 
   if (mips_monitor != MON_IDT)
     mips_send_command ("debug\r", 0);
-  else /* assume IDT monitor by default */
+  else                         /* assume IDT monitor by default */
     mips_send_command ("db tty0\r", 0);
 
-  sleep(1);
+  sleep (1);
   SERIAL_WRITE (mips_desc, "\r", sizeof "\r" - 1);
 
   /* We don't need to absorb any spurious characters here, since the
@@ -1360,7 +1366,7 @@ mips_enter_debug ()
      being displayed to the user. */
   if (mips_monitor != MON_IDT)
     mips_expect ("\r");
-  
+
   {
     char buff[DATA_MAXLEN + 1];
     if (mips_receive_packet (buff, 1, 3) < 0)
@@ -1382,14 +1388,14 @@ mips_exit_debug ()
       /* The DDB (NEC) and MiniRISC (LSI) versions of PMON exit immediately,
          so we do not get a reply to this command: */
       mips_request ('x', (unsigned int) 0, (unsigned int) 0, NULL,
-               mips_receive_wait, NULL);
+                   mips_receive_wait, NULL);
       mips_need_reply = 0;
       if (!mips_expect (" break!"))
-        return -1;
+       return -1;
     }
   else
     mips_request ('x', (unsigned int) 0, (unsigned int) 0, &err,
-                  mips_receive_wait, NULL);
+                 mips_receive_wait, NULL);
 
   if (!mips_expect (mips_monitor_prompt))
     return -1;
@@ -1428,65 +1434,65 @@ mips_initialize ()
   /* Force the system into the monitor.  After this we *should* be at
      the mips_monitor_prompt.  */
   if (mips_monitor != MON_IDT)
-    j = 0; /* start by checking if we are already at the prompt */
+    j = 0;                     /* start by checking if we are already at the prompt */
   else
-    j = 1; /* start by sending a break */
+    j = 1;                     /* start by sending a break */
   for (; j <= 4; j++)
     {
       switch (j)
        {
-        case 0:                 /* First, try sending a CR */
-          SERIAL_FLUSH_INPUT (mips_desc);
+       case 0:         /* First, try sending a CR */
+         SERIAL_FLUSH_INPUT (mips_desc);
          SERIAL_WRITE (mips_desc, "\r", 1);
-          break;
-       case 1:                 /* First, try sending a break */
+         break;
+       case 1:         /* First, try sending a break */
          SERIAL_SEND_BREAK (mips_desc);
          break;
-       case 2:                 /* Then, try a ^C */
+       case 2:         /* Then, try a ^C */
          SERIAL_WRITE (mips_desc, "\003", 1);
          break;
-       case 3:                 /* Then, try escaping from download */
+       case 3:         /* Then, try escaping from download */
          {
-            if (mips_monitor != MON_IDT)
-              {
-                char tbuff[7];
-
-                /* We shouldn't need to send multiple termination
-                   sequences, since the target performs line (or
-                   block) reads, and then processes those
-                   packets. In-case we were downloading a large packet
-                   we flush the output buffer before inserting a
-                   termination sequence. */
-                SERIAL_FLUSH_OUTPUT (mips_desc);
-                sprintf (tbuff, "\r/E/E\r");
-                SERIAL_WRITE (mips_desc, tbuff, 6);
-              }
-            else
-              {
-                char srec[10];
-                int i;
-
-                /* We are possibly in binary download mode, having
-                   aborted in the middle of an S-record.  ^C won't
-                   work because of binary mode.  The only reliable way
-                   out is to send enough termination packets (8 bytes)
-                   to fill up and then overflow the largest size
-                   S-record (255 bytes in this case).  This amounts to
-                   256/8 + 1 packets.
-                   */
-
-                mips_make_srec (srec, '7', 0, NULL, 0);
-
-                for (i = 1; i <= 33; i++)
-                  {
-                    SERIAL_WRITE (mips_desc, srec, 8);
-
-                    if (SERIAL_READCHAR (mips_desc, 0) >= 0)
-                      break;   /* Break immediatly if we get something from
+           if (mips_monitor != MON_IDT)
+             {
+               char tbuff[7];
+
+               /* We shouldn't need to send multiple termination
+                  sequences, since the target performs line (or
+                  block) reads, and then processes those
+                  packets. In-case we were downloading a large packet
+                  we flush the output buffer before inserting a
+                  termination sequence. */
+               SERIAL_FLUSH_OUTPUT (mips_desc);
+               sprintf (tbuff, "\r/E/E\r");
+               SERIAL_WRITE (mips_desc, tbuff, 6);
+             }
+           else
+             {
+               char srec[10];
+               int i;
+
+               /* We are possibly in binary download mode, having
+                  aborted in the middle of an S-record.  ^C won't
+                  work because of binary mode.  The only reliable way
+                  out is to send enough termination packets (8 bytes)
+                  to fill up and then overflow the largest size
+                  S-record (255 bytes in this case).  This amounts to
+                  256/8 + 1 packets.
+                */
+
+               mips_make_srec (srec, '7', 0, NULL, 0);
+
+               for (i = 1; i <= 33; i++)
+                 {
+                   SERIAL_WRITE (mips_desc, srec, 8);
+
+                   if (SERIAL_READCHAR (mips_desc, 0) >= 0)
+                     break;    /* Break immediatly if we get something from
                                   the board. */
-                  }
-              }
-          }
+                 }
+             }
+         }
          break;
        case 4:
          mips_error ("Failed to initialize.");
@@ -1500,7 +1506,7 @@ mips_initialize ()
     {
       /* Sometimes PMON ignores the first few characters in the first
          command sent after a load.  Sending a blank command gets
-        around that.  */
+         around that.  */
       mips_send_command ("\r", -1);
 
       /* Ensure the correct target state: */
@@ -1552,26 +1558,26 @@ common_open (ops, name, from_tty, new_monitor, new_monitor_prompt)
 
   if (name == 0)
     error (
-"To open a MIPS remote debugging connection, you need to specify what serial\n\
+           "To open a MIPS remote debugging connection, you need to specify what serial\n\
 device is attached to the target board (e.g., /dev/ttya).\n"
-"If you want to use TFTP to download to the board, specify the name of a\n"
-"temporary file to be used by GDB for downloads as the second argument.\n"
-"This filename must be in the form host:filename, where host is the name\n"
-"of the host running the TFTP server, and the file must be readable by the\n"
-"world.  If the local name of the temporary file differs from the name as\n"
-"seen from the board via TFTP, specify that name as the third parameter.\n");
+           "If you want to use TFTP to download to the board, specify the name of a\n"
+           "temporary file to be used by GDB for downloads as the second argument.\n"
+           "This filename must be in the form host:filename, where host is the name\n"
+           "of the host running the TFTP server, and the file must be readable by the\n"
+           "world.  If the local name of the temporary file differs from the name as\n"
+           "seen from the board via TFTP, specify that name as the third parameter.\n");
 
   /* Parse the serial port name, the optional TFTP name, and the
      optional local TFTP name.  */
   if ((argv = buildargv (name)) == NULL)
-    nomem(0);
+    nomem (0);
   make_cleanup_freeargv (argv);
 
   serial_port_name = strsave (argv[0]);
-  if (argv[1])                         /* remote TFTP name specified? */
+  if (argv[1])                 /* remote TFTP name specified? */
     {
       remote_name = argv[1];
-      if (argv[2])                     /* local TFTP filename specified? */
+      if (argv[2])             /* local TFTP filename specified? */
        local_name = argv[2];
     }
 
@@ -1588,10 +1594,10 @@ device is attached to the target board (e.g., /dev/ttya).\n"
   if (baud_rate != -1)
     {
       if (SERIAL_SETBAUDRATE (mips_desc, baud_rate))
-        {
-          SERIAL_CLOSE (mips_desc);
-          perror_with_name (serial_port_name);
-        }
+       {
+         SERIAL_CLOSE (mips_desc);
+         perror_with_name (serial_port_name);
+       }
     }
 
   SERIAL_RAW (mips_desc);
@@ -1619,8 +1625,8 @@ device is attached to the target board (e.g., /dev/ttya).\n"
          if (tftp_localname)
            free (tftp_localname);
          if (local_name == NULL)
-             if ((local_name = strchr (remote_name, ':')) != NULL)
-               local_name++;           /* skip over the colon */
+           if ((local_name = strchr (remote_name, ':')) != NULL)
+             local_name++;     /* skip over the colon */
          if (local_name == NULL)
            local_name = remote_name;   /* local name same as remote name */
          tftp_name = strsave (remote_name);
@@ -1700,7 +1706,7 @@ lsi_open (name, from_tty)
   /* Clear the LSI breakpoint table.  */
   for (i = 0; i < MAX_LSI_BREAKPOINTS; i++)
     lsi_breakpoints[i].type = BREAK_UNUSED;
-  
+
   common_open (&lsi_ops, name, from_tty, MON_LSI, "PMON> ");
 }
 
@@ -1798,7 +1804,7 @@ mips_wait (pid, status)
   /* If we have not sent a single step or continue command, then the
      board is waiting for us to do something.  Return a status
      indicating that it is stopped.  */
-  if (! mips_need_reply)
+  if (!mips_need_reply)
     {
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
@@ -1839,7 +1845,7 @@ mips_wait (pid, status)
       supply_register (PC_REGNUM, buf);
 
       store_unsigned_integer (buf, REGISTER_RAW_SIZE (PC_REGNUM), rfp);
-      supply_register (30, buf); /* This register they are avoiding and so it is unnamed */
+      supply_register (30, buf);       /* This register they are avoiding and so it is unnamed */
 
       store_unsigned_integer (buf, REGISTER_RAW_SIZE (SP_REGNUM), rsp);
       supply_register (SP_REGNUM, buf);
@@ -1863,13 +1869,13 @@ mips_wait (pid, status)
     {
 #if 0
       /* If this is an LSI PMON target, see if we just hit a hardrdware watchpoint.
-        Right now, PMON doesn't give us enough information to determine which
-        breakpoint we hit.  So we have to look up the PC in our own table
-        of breakpoints, and if found, assume it's just a normal instruction
-        fetch breakpoint, not a data watchpoint.  FIXME when PMON
-        provides some way to tell us what type of breakpoint it is.  */
+         Right now, PMON doesn't give us enough information to determine which
+         breakpoint we hit.  So we have to look up the PC in our own table
+         of breakpoints, and if found, assume it's just a normal instruction
+         fetch breakpoint, not a data watchpoint.  FIXME when PMON
+         provides some way to tell us what type of breakpoint it is.  */
       int i;
-      CORE_ADDR pc = read_pc();
+      CORE_ADDR pc = read_pc ();
 
       hit_watchpoint = 1;
       for (i = 0; i < MAX_LSI_BREAKPOINTS; i++)
@@ -1883,22 +1889,22 @@ mips_wait (pid, status)
        }
 #else
       /* If a data breakpoint was hit, PMON returns the following packet:
-            0x1 c 0x0 0x57f 0x1
-        The return packet from an ordinary breakpoint doesn't have the
-        extra 0x01 field tacked onto the end.  */
+         0x1 c 0x0 0x57f 0x1
+         The return packet from an ordinary breakpoint doesn't have the
+         extra 0x01 field tacked onto the end.  */
       if (nfields == 1 && rpc == 1)
        hit_watchpoint = 1;
 #endif
     }
 
   /* NOTE: The following (sig) numbers are defined by PMON:
-       SPP_SIGTRAP     5       breakpoint
-        SPP_SIGINT      2
-        SPP_SIGSEGV     11
-        SPP_SIGBUS      10
-        SPP_SIGILL      4
-        SPP_SIGFPE      8
-        SPP_SIGTERM     15 */
+     SPP_SIGTRAP     5       breakpoint
+     SPP_SIGINT      2
+     SPP_SIGSEGV     11
+     SPP_SIGBUS      10
+     SPP_SIGILL      4
+     SPP_SIGFPE      8
+     SPP_SIGTERM     15 */
 
   /* Translate a MIPS waitstatus.  We use constants here rather than WTERMSIG
      and so on, because the constants we want here are determined by the
@@ -1915,12 +1921,12 @@ mips_wait (pid, status)
 
       /* If the stop PC is in the _exit function, assume
          we hit the 'break 0x3ff' instruction in _exit, so this
-        is not a normal breakpoint.  */
+         is not a normal breakpoint.  */
       if (strcmp (target_shortname, "lsi") == 0)
        {
          char *func_name;
          CORE_ADDR func_start;
-         CORE_ADDR pc = read_pc();
+         CORE_ADDR pc = read_pc ();
 
          find_pc_partial_function (pc, &func_name, &func_start, NULL);
          if (func_name != NULL && strcmp (func_name, "_exit") == 0
@@ -2004,11 +2010,11 @@ mips_fetch_registers (regno)
             compiled without the 64bit register access commands. This
             means we cannot get hold of the full register width. */
          if (mips_monitor == MON_DDB)
-           val = (unsigned)mips_request ('t', (unsigned int) pmon_reg,
-                               (unsigned int) 0, &err, mips_receive_wait, NULL);
+           val = (unsigned) mips_request ('t', (unsigned int) pmon_reg,
+                          (unsigned int) 0, &err, mips_receive_wait, NULL);
          else
            val = mips_request ('r', (unsigned int) pmon_reg,
-                               (unsigned int) 0, &err, mips_receive_wait, NULL);
+                          (unsigned int) 0, &err, mips_receive_wait, NULL);
          if (err)
            mips_error ("Can't read register %d: %s", regno,
                        safe_strerror (errno));
@@ -2057,7 +2063,7 @@ mips_store_registers (regno)
 
 /* Fetch a word from the target board.  */
 
-static unsigned int 
+static unsigned int
 mips_fetch_word (addr)
      CORE_ADDR addr;
 {
@@ -2074,8 +2080,8 @@ mips_fetch_word (addr)
       val = mips_request ('i', addr, (unsigned int) 0, &err,
                          mips_receive_wait, NULL);
       if (err)
-        mips_error ("Can't read address 0x%s: %s",
-             paddr_nz (addr), safe_strerror (errno));
+       mips_error ("Can't read address 0x%s: %s",
+                   paddr_nz (addr), safe_strerror (errno));
     }
   return val;
 }
@@ -2128,7 +2134,7 @@ mips_xfer_memory (memaddr, myaddr, len, write, ignore)
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr &3;
+  register CORE_ADDR addr = memaddr & ~3;
   /* Round ending address up; get number of longwords that makes.  */
   register int count = (((memaddr + len) - addr) + 3) / 4;
   /* Allocate buffer of that many longwords.  */
@@ -2162,10 +2168,10 @@ mips_xfer_memory (memaddr, myaddr, len, write, ignore)
       for (i = 0; i < count; i++, addr += 4)
        {
          status = mips_store_word (addr,
-                                   extract_unsigned_integer (&buffer[i*4], 4),
+                              extract_unsigned_integer (&buffer[i * 4], 4),
                                    NULL);
          /* Report each kilobyte (we download 32-bit words at a time) */
-         if (i % 256 == 255) 
+         if (i % 256 == 255)
            {
              printf_unfiltered ("*");
              gdb_flush (gdb_stdout);
@@ -2185,7 +2191,7 @@ mips_xfer_memory (memaddr, myaddr, len, write, ignore)
       /* Read all the longwords */
       for (i = 0; i < count; i++, addr += 4)
        {
-         store_unsigned_integer (&buffer[i*4], 4, mips_fetch_word (addr));
+         store_unsigned_integer (&buffer[i * 4], 4, mips_fetch_word (addr));
          QUIT;
        }
 
@@ -2230,7 +2236,7 @@ Give up (and stop debugging it)? "))
             board (it almost surely won't work since we weren't able to talk to
             it).  */
          mips_wait_flag = 0;
-         close_ports();
+         close_ports ();
 
          printf_unfiltered ("Ending remote MIPS debugging.\n");
          target_mourn_inferior ();
@@ -2333,14 +2339,14 @@ mips_remove_breakpoint (addr, contents_cache)
     return memory_remove_breakpoint (addr, contents_cache);
 }
 
-#if 0 /* currently not used */
+#if 0                          /* currently not used */
 /* PMON does not currently provide support for the debug mode 'b'
    commands to manipulate breakpoints. However, if we wanted to use
    the monitor breakpoints (rather than the GDB BREAK_INSN version)
    then this code performs the work needed to leave debug mode,
    set/clear the breakpoint, and then return to debug mode. */
 
-#define PMON_MAX_BP (33) /* 32 SW, 1 HW */
+#define PMON_MAX_BP (33)       /* 32 SW, 1 HW */
 static CORE_ADDR mips_pmon_bp_info[PMON_MAX_BP];
 /* NOTE: The code relies on this vector being zero-initialised by the system */
 
@@ -2353,13 +2359,13 @@ pmon_insert_breakpoint (addr, contents_cache)
 
   if (monitor_supports_breakpoints)
     {
-      char tbuff[12]; /* space for breakpoint command */
+      char tbuff[12];          /* space for breakpoint command */
       int bpnum;
       CORE_ADDR bpaddr;
 
       /* PMON does not support debug level breakpoint set/remove: */
       if (mips_exit_debug ())
-        mips_error ("Failed to exit debug mode");
+       mips_error ("Failed to exit debug mode");
 
       sprintf (tbuff, "b %08x\r", addr);
       mips_send_command (tbuff, 0);
@@ -2367,14 +2373,14 @@ pmon_insert_breakpoint (addr, contents_cache)
       mips_expect ("Bpt ");
 
       if (!mips_getstring (tbuff, 2))
-        return 1;
-      tbuff[2] = '\0'; /* terminate the string */
+       return 1;
+      tbuff[2] = '\0';         /* terminate the string */
       if (sscanf (tbuff, "%d", &bpnum) != 1)
-        {
-          fprintf_unfiltered (gdb_stderr,
-                             "Invalid decimal breakpoint number from target: %s\n", tbuff);
-          return 1;
-        }
+       {
+         fprintf_unfiltered (gdb_stderr,
+             "Invalid decimal breakpoint number from target: %s\n", tbuff);
+         return 1;
+       }
 
       mips_expect (" = ");
 
@@ -2385,26 +2391,26 @@ pmon_insert_breakpoint (addr, contents_cache)
       /* FIXME!! only 8 bytes!  need to expand for Bfd64; 
          which targets return 64-bit addresses?  PMON returns only 32! */
       if (!mips_getstring (&tbuff[2], 8))
-        return 1;
-      tbuff[10] = '\0'; /* terminate the string */
+       return 1;
+      tbuff[10] = '\0';                /* terminate the string */
 
       if (sscanf (tbuff, "0x%08x", &bpaddr) != 1)
-        {
-          fprintf_unfiltered (gdb_stderr,
-                             "Invalid hex address from target: %s\n", tbuff);
-          return 1;
-        }
+       {
+         fprintf_unfiltered (gdb_stderr,
+                           "Invalid hex address from target: %s\n", tbuff);
+         return 1;
+       }
 
       if (bpnum >= PMON_MAX_BP)
-        {
-          fprintf_unfiltered (gdb_stderr,
+       {
+         fprintf_unfiltered (gdb_stderr,
                              "Error: Returned breakpoint number %d outside acceptable range (0..%d)\n",
-                              bpnum, PMON_MAX_BP - 1);
-          return 1;
-        }
+                             bpnum, PMON_MAX_BP - 1);
+         return 1;
+       }
 
       if (bpaddr != addr)
-        fprintf_unfiltered (gdb_stderr, "Warning: Breakpoint addresses do not match: 0x%x != 0x%x\n", addr, bpaddr);
+       fprintf_unfiltered (gdb_stderr, "Warning: Breakpoint addresses do not match: 0x%x != 0x%x\n", addr, bpaddr);
 
       mips_pmon_bp_info[bpnum] = bpaddr;
 
@@ -2427,22 +2433,22 @@ pmon_remove_breakpoint (addr, contents_cache)
   if (monitor_supports_breakpoints)
     {
       int bpnum;
-      char tbuff[7]; /* enough for delete breakpoint command */
+      char tbuff[7];           /* enough for delete breakpoint command */
 
       for (bpnum = 0; bpnum < PMON_MAX_BP; bpnum++)
-        if (mips_pmon_bp_info[bpnum] == addr)
-          break;
+       if (mips_pmon_bp_info[bpnum] == addr)
+         break;
 
       if (bpnum >= PMON_MAX_BP)
-        {
-          fprintf_unfiltered (gdb_stderr,
-           "pmon_remove_breakpoint: Failed to find breakpoint at address 0x%s\n",
-           paddr_nz (addr));
-          return 1;
-        }
+       {
+         fprintf_unfiltered (gdb_stderr,
+                             "pmon_remove_breakpoint: Failed to find breakpoint at address 0x%s\n",
+                             paddr_nz (addr));
+         return 1;
+       }
 
       if (mips_exit_debug ())
-        mips_error ("Failed to exit debug mode");
+       mips_error ("Failed to exit debug mode");
 
       sprintf (tbuff, "db %02d\r", bpnum);
 
@@ -2468,7 +2474,7 @@ int
 remote_mips_can_use_hardware_watchpoint (cnt)
      int cnt;
 {
-    return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
+  return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
 }
 
 
@@ -2615,14 +2621,14 @@ check_lsi_error (addr, rerrflg)
                {
                  found = 1;
                  fprintf_unfiltered (gdb_stderr,
-                                     "common_breakpoint (0x%s): Warning: %s\n",
+                                 "common_breakpoint (0x%s): Warning: %s\n",
                                      saddr,
                                      err->string);
                }
            }
          if (!found)
            fprintf_unfiltered (gdb_stderr,
-                               "common_breakpoint (0x%s): Unknown warning: 0x%x\n",
+                       "common_breakpoint (0x%s): Unknown warning: 0x%x\n",
                                saddr,
                                rerrflg);
        }
@@ -2655,10 +2661,10 @@ check_lsi_error (addr, rerrflg)
    <ADDR> is the address of the breakpoint.
    <LEN> the length of the region to break on.
    <TYPE> is the type of breakpoint:
-     0 = write                 (BREAK_WRITE)
-     1 = read                  (BREAK_READ)
-     2 = read/write            (BREAK_ACCESS)
-     3 = instruction fetch     (BREAK_FETCH)
+   0 = write                    (BREAK_WRITE)
+   1 = read                     (BREAK_READ)
+   2 = read/write               (BREAK_ACCESS)
+   3 = instruction fetch        (BREAK_FETCH)
 
    Return 0 if successful; otherwise 1.  */
 
@@ -2678,12 +2684,12 @@ common_breakpoint (set, addr, len, type)
 
   if (mips_monitor == MON_LSI)
     {
-      if (set == 0)    /* clear breakpoint */
+      if (set == 0)            /* clear breakpoint */
        {
          /* The LSI PMON "clear breakpoint" has this form:
-              <pid> 'b' <bptn> 0x0
-              reply:
-              <pid> 'b' 0x0 <code>
+            <pid> 'b' <bptn> 0x0
+            reply:
+            <pid> 'b' 0x0 <code>
 
             <bptn> is a breakpoint number returned by an earlier 'B' command.
             Possible return codes: OK, E_BPT.  */
@@ -2718,42 +2724,44 @@ common_breakpoint (set, addr, len, type)
 
          return (check_lsi_error (addr, rerrflg));
        }
-      else     /* set a breakpoint */
+      else
+       /* set a breakpoint */
        {
          /* The LSI PMON "set breakpoint" command has this form:
-              <pid> 'B' <addr> 0x0
-              reply:
-              <pid> 'B' <bptn> <code>
+            <pid> 'B' <addr> 0x0
+            reply:
+            <pid> 'B' <bptn> <code>
 
             The "set data breakpoint" command has this form:
 
-               <pid> 'A' <addr1> <type> [<addr2>  [<value>]]
+            <pid> 'A' <addr1> <type> [<addr2>  [<value>]]
 
-               where: type= "0x1" = read
-                    "0x2" = write
-                    "0x3" = access (read or write)
+            where: type= "0x1" = read
+            "0x2" = write
+            "0x3" = access (read or write)
 
             The reply returns two values:
-                    bptn - a breakpoint number, which is a small integer with
-                           possible values of zero through 255.
-                    code - an error return code, a value of zero indicates a
-                           succesful completion, other values indicate various
-                           errors and warnings.
-             
+            bptn - a breakpoint number, which is a small integer with
+            possible values of zero through 255.
+            code - an error return code, a value of zero indicates a
+            succesful completion, other values indicate various
+            errors and warnings.
+
             Possible return codes: OK, W_QAL, E_QAL, E_OUT, E_NON.  
 
-         */
+          */
 
          if (type == BREAK_FETCH)      /* instruction breakpoint */
            {
              cmd = 'B';
              sprintf (buf, "0x0 B 0x%s 0x0", paddr_nz (addr));
            }
-         else                          /* watchpoint */
+         else
+           /* watchpoint */
            {
              cmd = 'A';
              sprintf (buf, "0x0 A 0x%s 0x%x 0x%s", paddr_nz (addr),
-                      type == BREAK_READ ? 1 : (type == BREAK_WRITE ? 2 : 3),
+                    type == BREAK_READ ? 1 : (type == BREAK_WRITE ? 2 : 3),
                       paddr_nz (addr + len - 1));
            }
          mips_send_packet (buf, 1);
@@ -2774,7 +2782,7 @@ common_breakpoint (set, addr, len, type)
             information for this breakpoint so we can clear it later.  */
          lsi_breakpoints[rresponse].type = type;
          lsi_breakpoints[rresponse].addr = addr;
-         lsi_breakpoints[rresponse].len =  len;
+         lsi_breakpoints[rresponse].len = len;
 
          return 0;
        }
@@ -2782,30 +2790,30 @@ common_breakpoint (set, addr, len, type)
   else
     {
       /* On non-LSI targets, the breakpoint command has this form:
-          0x0 <CMD> <ADDR> <MASK> <FLAGS>
-        <MASK> is a don't care mask for addresses.
-        <FLAGS> is any combination of `r', `w', or `f' for read/write/fetch.
+         0x0 <CMD> <ADDR> <MASK> <FLAGS>
+         <MASK> is a don't care mask for addresses.
+         <FLAGS> is any combination of `r', `w', or `f' for read/write/fetch.
        */
       unsigned long mask;
 
       mask = calculate_mask (addr, len);
       addr &= ~mask;
 
-      if (set)         /* set a breakpoint */
-        {
+      if (set)                 /* set a breakpoint */
+       {
          char *flags;
          switch (type)
            {
-           case BREAK_WRITE:           /* write */
+           case BREAK_WRITE:   /* write */
              flags = "w";
              break;
-           case BREAK_READ:            /* read */
+           case BREAK_READ:    /* read */
              flags = "r";
              break;
-           case BREAK_ACCESS:          /* read/write */
+           case BREAK_ACCESS:  /* read/write */
              flags = "rw";
              break;
-           case BREAK_FETCH:           /* fetch */
+           case BREAK_FETCH:   /* fetch */
              flags = "f";
              break;
            default:
@@ -2840,9 +2848,9 @@ common_breakpoint (set, addr, len, type)
             Cogent returns "0x0 b 0xffffffff 0x16\000": */
          if (mips_monitor == MON_DDB)
            rresponse = rerrflg;
-         if (rresponse != 22) /* invalid argument */
+         if (rresponse != 22)  /* invalid argument */
            fprintf_unfiltered (gdb_stderr,
-                               "common_breakpoint (0x%s):  Got error: 0x%x\n",
+                            "common_breakpoint (0x%s):  Got error: 0x%x\n",
                                paddr_nz (addr), rresponse);
          return 1;
        }
@@ -2938,14 +2946,14 @@ mips_load_srec (args)
                  gdb_flush (gdb_stdout);
                }
 
-           } /* Per-packet (or S-record) loop */
-         
+           }                   /* Per-packet (or S-record) loop */
+
          putchar_unfiltered ('\n');
-       } /* Loadable sections */
+       }                       /* Loadable sections */
     }
-  if (hashmark) 
+  if (hashmark)
     putchar_unfiltered ('\n');
-  
+
   /* Write a type 7 terminator record. no data for a type 7, and there
      is no data, so len is 0.  */
 
@@ -2958,19 +2966,19 @@ mips_load_srec (args)
 
 /*
  * mips_make_srec -- make an srecord. This writes each line, one at a
- *     time, each with it's own header and trailer line.
- *     An srecord looks like this:
+ *      time, each with it's own header and trailer line.
+ *      An srecord looks like this:
  *
  * byte count-+     address
  * start ---+ |        |       data        +- checksum
- *         | |        |                   |
- *       S01000006F6B692D746573742E73726563E4
- *       S315000448600000000000000000FC00005900000000E9
- *       S31A0004000023C1400037DE00F023604000377B009020825000348D
- *       S30B0004485A0000000000004E
- *       S70500040000F6
+ *          | |        |                   |
+ *        S01000006F6B692D746573742E73726563E4
+ *        S315000448600000000000000000FC00005900000000E9
+ *        S31A0004000023C1400037DE00F023604000377B009020825000348D
+ *        S30B0004485A0000000000004E
+ *        S70500040000F6
  *
- *     S<type><length><address><data><checksum>
+ *      S<type><length><address><data><checksum>
  *
  *      Where
  *      - length
@@ -2993,7 +3001,7 @@ mips_load_srec (args)
  *      - data
  *        is the data.
  *      - checksum
- *       is the sum of all the raw byte data in the record, from the length
+ *        is the sum of all the raw byte data in the record, from the length
  *        upwards, modulo 256 and subtracted from 255.
  *
  * This routine returns the length of the S-record.
@@ -3049,13 +3057,13 @@ mips_make_srec (buf, type, memaddr, myaddr, len)
    3byte data packets (encoded as 4 printable ASCII characters), and
    escape sequences (preceded by a '/'):
 
-       'K'     clear checksum
-       'C'     compare checksum (12bit value, not included in checksum calculation)
-       'S'     define symbol name (for addr) terminated with "," and padded to 4char boundary
-       'Z'     zero fill multiple of 3bytes
-       'B'     byte (12bit encoded value, of 8bit data)
-       'A'     address (36bit encoded value)
-       'E'     define entry as original address, and exit load
+   'K'     clear checksum
+   'C'     compare checksum (12bit value, not included in checksum calculation)
+   'S'     define symbol name (for addr) terminated with "," and padded to 4char boundary
+   'Z'     zero fill multiple of 3bytes
+   'B'     byte (12bit encoded value, of 8bit data)
+   'A'     address (36bit encoded value)
+   'E'     define entry as original address, and exit load
 
    The packets are processed in 4 character chunks, so the escape
    sequences that do not have any data (or variable length data)
@@ -3081,32 +3089,41 @@ pmon_makeb64 (v, p, n, chksum)
 {
   int count = (n / 6);
 
-  if ((n % 12) != 0) {
-    fprintf_unfiltered(gdb_stderr,
-                      "Fast encoding bitcount must be a multiple of 12bits: %dbit%s\n",n,(n == 1)?"":"s");
-    return(0);
-  }
-  if (n > 36) {
-    fprintf_unfiltered(gdb_stderr,
-                      "Fast encoding cannot process more than 36bits at the moment: %dbits\n",n);
-    return(0);
-  }
+  if ((n % 12) != 0)
+    {
+      fprintf_unfiltered (gdb_stderr,
+                         "Fast encoding bitcount must be a multiple of 12bits: %dbit%s\n", n, (n == 1) ? "" : "s");
+      return (0);
+    }
+  if (n > 36)
+    {
+      fprintf_unfiltered (gdb_stderr,
+                         "Fast encoding cannot process more than 36bits at the moment: %dbits\n", n);
+      return (0);
+    }
 
   /* Deal with the checksum: */
-  if (chksum != NULL) {
-    switch (n) {
-     case 36: *chksum += ((v >> 24) & 0xFFF);
-     case 24: *chksum += ((v >> 12) & 0xFFF);
-     case 12: *chksum += ((v >>  0) & 0xFFF);
+  if (chksum != NULL)
+    {
+      switch (n)
+       {
+       case 36:
+         *chksum += ((v >> 24) & 0xFFF);
+       case 24:
+         *chksum += ((v >> 12) & 0xFFF);
+       case 12:
+         *chksum += ((v >> 0) & 0xFFF);
+       }
     }
-  }
 
-  do {
-    n -= 6;
-    *p++ = encoding[(v >> n) & 0x3F];
-  } while (n > 0);
+  do
+    {
+      n -= 6;
+      *p++ = encoding[(v >> n) & 0x3F];
+    }
+  while (n > 0);
 
-  return(count);
+  return (count);
 }
 
 /* Shorthand function (that could be in-lined) to output the zero-fill
@@ -3120,11 +3137,11 @@ pmon_zeroset (recsize, buff, amount, chksum)
 {
   int count;
 
-  sprintf(*buff,"/Z");
+  sprintf (*buff, "/Z");
   count = pmon_makeb64 (*amount, (*buff + 2), 12, chksum);
   *buff += (count + 2);
   *amount = 0;
-  return(recsize + count + 2);
+  return (recsize + count + 2);
 }
 
 static int
@@ -3140,10 +3157,10 @@ pmon_checkset (recsize, buff, value)
   count = pmon_makeb64 (*value, (*buff + 2), 12, NULL);
   *buff += (count + 2);
   sprintf (*buff, "\n");
-  *buff += 2; /* include zero terminator */
+  *buff += 2;                  /* include zero terminator */
   /* Forcing a checksum validation clears the sum: */
   *value = 0;
-  return(recsize + count + 3);
+  return (recsize + count + 3);
 }
 
 /* Amount of padding we leave after at the end of the output buffer,
@@ -3177,46 +3194,53 @@ pmon_make_fastrec (outbuf, inbuf, inptr, inamount, recsize, csum, zerofill)
      the maximum allowable record size. Each record output is 4bytes
      in length. We must allow space for a pending zero fill command,
      the record, and a checksum record. */
-  while ((*recsize < (MAXRECSIZE - CHECKSIZE)) && ((inamount - *inptr) > 0)) {
-    /* Process the binary data: */
-    if ((inamount - *inptr) < 3) {
-      if (*zerofill != 0)
-       *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
-      sprintf (p, "/B");
-      count = pmon_makeb64 (inbuf[*inptr], &p[2], 12, csum);
-      p += (2 + count);
-      *recsize += (2 + count);
-      (*inptr)++;
-    } else {
-      unsigned int value = ((inbuf[*inptr + 0] << 16) | (inbuf[*inptr + 1] << 8) | inbuf[*inptr + 2]);
-      /* Simple check for zero data. TODO: A better check would be
-         to check the last, and then the middle byte for being zero
-         (if the first byte is not). We could then check for
-         following runs of zeros, and if above a certain size it is
-         worth the 4 or 8 character hit of the byte insertions used
-         to pad to the start of the zeroes. NOTE: This also depends
-         on the alignment at the end of the zero run. */
-      if (value == 0x00000000) {
-        (*zerofill)++;
-        if (*zerofill == 0xFFF) /* 12bit counter */
-         *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
-      }else {
-        if (*zerofill != 0)
-         *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
-        count = pmon_makeb64 (value, p, 24, csum);
-        p += count;
-        *recsize += count;
-      }
-      *inptr += 3;
+  while ((*recsize < (MAXRECSIZE - CHECKSIZE)) && ((inamount - *inptr) > 0))
+    {
+      /* Process the binary data: */
+      if ((inamount - *inptr) < 3)
+       {
+         if (*zerofill != 0)
+           *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
+         sprintf (p, "/B");
+         count = pmon_makeb64 (inbuf[*inptr], &p[2], 12, csum);
+         p += (2 + count);
+         *recsize += (2 + count);
+         (*inptr)++;
+       }
+      else
+       {
+         unsigned int value = ((inbuf[*inptr + 0] << 16) | (inbuf[*inptr + 1] << 8) | inbuf[*inptr + 2]);
+         /* Simple check for zero data. TODO: A better check would be
+            to check the last, and then the middle byte for being zero
+            (if the first byte is not). We could then check for
+            following runs of zeros, and if above a certain size it is
+            worth the 4 or 8 character hit of the byte insertions used
+            to pad to the start of the zeroes. NOTE: This also depends
+            on the alignment at the end of the zero run. */
+         if (value == 0x00000000)
+           {
+             (*zerofill)++;
+             if (*zerofill == 0xFFF)   /* 12bit counter */
+               *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
+           }
+         else
+           {
+             if (*zerofill != 0)
+               *recsize = pmon_zeroset (*recsize, &p, zerofill, csum);
+             count = pmon_makeb64 (value, p, 24, csum);
+             p += count;
+             *recsize += count;
+           }
+         *inptr += 3;
+       }
     }
-  }
 
   *outbuf = p;
   return;
 }
 
 static int
-pmon_check_ack(mesg)
+pmon_check_ack (mesg)
      char *mesg;
 {
 #if defined(DOETXACK)
@@ -3229,11 +3253,11 @@ pmon_check_ack(mesg)
        {
          fprintf_unfiltered (gdb_stderr,
                              "Failed to receive valid ACK for %s\n", mesg);
-         return(-1); /* terminate the download */
+         return (-1);          /* terminate the download */
        }
     }
 #endif /* DOETXACK */
-  return(0);
+  return (0);
 }
 
 /* pmon_download - Send a sequence of characters to the PMON download port,
@@ -3276,7 +3300,7 @@ pmon_end_download (final, bintotal)
      int final;
      int bintotal;
 {
-  char hexnumber[9]; /* includes '\0' space */
+  char hexnumber[9];           /* includes '\0' space */
 
   if (tftp_in_use)
     {
@@ -3321,13 +3345,13 @@ pmon_end_download (final, bintotal)
   else
     mips_expect_timeout ("Entry Address  = ", tftp_in_use ? 15 : 2);
 
-  sprintf (hexnumber,"%x",final);
+  sprintf (hexnumber, "%x", final);
   mips_expect (hexnumber);
   mips_expect ("\r\n");
   if (mips_monitor != MON_LSI)
     pmon_check_ack ("termination");
   mips_expect ("\r\ntotal = 0x");
-  sprintf (hexnumber,"%x",bintotal);
+  sprintf (hexnumber, "%x", bintotal);
   mips_expect (hexnumber);
   if (!mips_expect_download (" bytes\r\n"))
     return;
@@ -3362,21 +3386,21 @@ pmon_load_fast (file)
   int final = 0;
   int finished = 0;
 
-  buffer = (char *)xmalloc(MAXRECSIZE + 1);
-  binbuf = (unsigned char *)xmalloc(BINCHUNK);
+  buffer = (char *) xmalloc (MAXRECSIZE + 1);
+  binbuf = (unsigned char *) xmalloc (BINCHUNK);
 
-  abfd = bfd_openr(file,0);
+  abfd = bfd_openr (file, 0);
   if (!abfd)
-   {
-     printf_filtered ("Unable to open file %s\n",file);
-     return;
-   }
+    {
+      printf_filtered ("Unable to open file %s\n", file);
+      return;
+    }
 
-  if (bfd_check_format(abfd,bfd_object) == 0)
-   {
-     printf_filtered("File is not an object file\n");
-     return;
-   }
+  if (bfd_check_format (abfd, bfd_object) == 0)
+    {
+      printf_filtered ("File is not an object file\n");
+      return;
+    }
 
   /* Setup the required download state: */
   mips_send_command ("set dlproto etxack\r", -1);
@@ -3385,101 +3409,110 @@ pmon_load_fast (file)
      already defined to have the argument we give. The code doesn't
      care, since it just scans to the next prompt anyway. */
   /* Start the download: */
-  pmon_start_download();
-  
+  pmon_start_download ();
+
   /* Zero the checksum */
-  sprintf(buffer,"/Kxx\n");
-  reclen = strlen(buffer);
+  sprintf (buffer, "/Kxx\n");
+  reclen = strlen (buffer);
   pmon_download (buffer, reclen);
-  finished = pmon_check_ack("/Kxx");
+  finished = pmon_check_ack ("/Kxx");
 
   for (s = abfd->sections; s && !finished; s = s->next)
-   if (s->flags & SEC_LOAD) /* only deal with loadable sections */
-    {
-      bintotal += s->_raw_size;
-      final = (s->vma + s->_raw_size);
-
-      printf_filtered ("%s\t: 0x%4x .. 0x%4x  ", s->name, (unsigned int)s->vma,
-                       (unsigned int)(s->vma + s->_raw_size));
-      gdb_flush (gdb_stdout);
-
-      /* Output the starting address */
-      sprintf(buffer,"/A");
-      reclen = pmon_makeb64(s->vma,&buffer[2],36,&csum);
-      buffer[2 + reclen] = '\n';
-      buffer[3 + reclen] = '\0';
-      reclen += 3; /* for the initial escape code and carriage return */
-      pmon_download (buffer, reclen);
-      finished = pmon_check_ack("/A");
-
-      if (!finished)
-       {
-         unsigned int binamount;
-         unsigned int zerofill = 0;
-         char *bp = buffer;
-         unsigned int i;
-
-         reclen = 0;
-
-         for (i = 0; ((i < s->_raw_size) && !finished); i += binamount) {
-           int binptr = 0;
-
-           binamount = min (BINCHUNK, s->_raw_size - i);
-
-           bfd_get_section_contents (abfd, s, binbuf, i, binamount);
-
-           /* This keeps a rolling checksum, until we decide to output
-              the line: */
-           for (; ((binamount - binptr) > 0);) {
-             pmon_make_fastrec (&bp, binbuf, &binptr, binamount, &reclen, &csum, &zerofill);
-             if (reclen >= (MAXRECSIZE - CHECKSIZE)) {
-               reclen = pmon_checkset (reclen, &bp, &csum);
-               pmon_download (buffer, reclen);
-               finished = pmon_check_ack("data record");
-               if (finished) {
-                 zerofill = 0; /* do not transmit pending zerofills */
-                 break;
-               }
-
-               if (hashmark) {
-                 putchar_unfiltered ('#');
-                 gdb_flush (gdb_stdout);
-               }
-
-               bp = buffer;
-               reclen = 0; /* buffer processed */
-             }
-           }
-         }
-
-         /* Ensure no out-standing zerofill requests: */
-         if (zerofill != 0)
-          reclen = pmon_zeroset (reclen, &bp, &zerofill, &csum);
-
-         /* and then flush the line: */
-         if (reclen > 0) {
-           reclen = pmon_checkset (reclen, &bp, &csum);
-           /* Currently pmon_checkset outputs the line terminator by
-              default, so we write out the buffer so far: */
-           pmon_download (buffer, reclen);
-           finished = pmon_check_ack("record remnant");
-         }
-       }
-
-      putchar_unfiltered ('\n');
-    }
+    if (s->flags & SEC_LOAD)   /* only deal with loadable sections */
+      {
+       bintotal += s->_raw_size;
+       final = (s->vma + s->_raw_size);
+
+       printf_filtered ("%s\t: 0x%4x .. 0x%4x  ", s->name, (unsigned int) s->vma,
+                        (unsigned int) (s->vma + s->_raw_size));
+       gdb_flush (gdb_stdout);
+
+       /* Output the starting address */
+       sprintf (buffer, "/A");
+       reclen = pmon_makeb64 (s->vma, &buffer[2], 36, &csum);
+       buffer[2 + reclen] = '\n';
+       buffer[3 + reclen] = '\0';
+       reclen += 3;            /* for the initial escape code and carriage return */
+       pmon_download (buffer, reclen);
+       finished = pmon_check_ack ("/A");
+
+       if (!finished)
+         {
+           unsigned int binamount;
+           unsigned int zerofill = 0;
+           char *bp = buffer;
+           unsigned int i;
+
+           reclen = 0;
+
+           for (i = 0; ((i < s->_raw_size) && !finished); i += binamount)
+             {
+               int binptr = 0;
+
+               binamount = min (BINCHUNK, s->_raw_size - i);
+
+               bfd_get_section_contents (abfd, s, binbuf, i, binamount);
+
+               /* This keeps a rolling checksum, until we decide to output
+                  the line: */
+               for (; ((binamount - binptr) > 0);)
+                 {
+                   pmon_make_fastrec (&bp, binbuf, &binptr, binamount, &reclen, &csum, &zerofill);
+                   if (reclen >= (MAXRECSIZE - CHECKSIZE))
+                     {
+                       reclen = pmon_checkset (reclen, &bp, &csum);
+                       pmon_download (buffer, reclen);
+                       finished = pmon_check_ack ("data record");
+                       if (finished)
+                         {
+                           zerofill = 0;       /* do not transmit pending zerofills */
+                           break;
+                         }
+
+                       if (hashmark)
+                         {
+                           putchar_unfiltered ('#');
+                           gdb_flush (gdb_stdout);
+                         }
+
+                       bp = buffer;
+                       reclen = 0;     /* buffer processed */
+                     }
+                 }
+             }
+
+           /* Ensure no out-standing zerofill requests: */
+           if (zerofill != 0)
+             reclen = pmon_zeroset (reclen, &bp, &zerofill, &csum);
+
+           /* and then flush the line: */
+           if (reclen > 0)
+             {
+               reclen = pmon_checkset (reclen, &bp, &csum);
+               /* Currently pmon_checkset outputs the line terminator by
+                  default, so we write out the buffer so far: */
+               pmon_download (buffer, reclen);
+               finished = pmon_check_ack ("record remnant");
+             }
+         }
+
+       putchar_unfiltered ('\n');
+      }
 
   /* Terminate the transfer. We know that we have an empty output
      buffer at this point. */
-  sprintf (buffer, "/E/E\n"); /* include dummy padding characters */
+  sprintf (buffer, "/E/E\n");  /* include dummy padding characters */
   reclen = strlen (buffer);
   pmon_download (buffer, reclen);
 
-  if (finished) { /* Ignore the termination message: */
-    SERIAL_FLUSH_INPUT (udp_in_use ? udp_desc : mips_desc);
-  } else { /* Deal with termination message: */
-    pmon_end_download (final, bintotal);
-  }
+  if (finished)
+    {                          /* Ignore the termination message: */
+      SERIAL_FLUSH_INPUT (udp_in_use ? udp_desc : mips_desc);
+    }
+  else
+    {                          /* Deal with termination message: */
+      pmon_end_download (final, bintotal);
+    }
 
   return;
 }
@@ -3488,17 +3521,17 @@ pmon_load_fast (file)
 
 static void
 mips_load (file, from_tty)
-    char *file;
-    int  from_tty;
+     char *file;
+     int from_tty;
 {
   /* Get the board out of remote debugging mode.  */
   if (mips_exit_debug ())
     error ("mips_load:  Couldn't get into monitor mode.");
 
   if (mips_monitor != MON_IDT)
-   pmon_load_fast (file);
+    pmon_load_fast (file);
   else
-   mips_load_srec (file);
+    mips_load_srec (file);
 
   mips_initialize ();
 
@@ -3506,8 +3539,8 @@ mips_load (file, from_tty)
   if (mips_monitor != MON_IDT)
     {
       /* Work around problem where PMON monitor updates the PC after a load
-        to a different value than GDB thinks it has. The following ensures
-        that the write_pc() WILL update the PC value: */
+         to a different value than GDB thinks it has. The following ensures
+         that the write_pc() WILL update the PC value: */
       register_valid[PC_REGNUM] = 0;
     }
   if (exec_bfd)
@@ -3584,7 +3617,7 @@ HOST:PORT to access a board over a network";
   mips_ops.to_wait = mips_wait;
 
   pmon_ops.to_shortname = "pmon";
-  pmon_ops.to_doc =   "\
+  pmon_ops.to_doc = "\
 Debug a board using the PMON MIPS remote debugging protocol over a serial\n\
 line. The argument is the device it is connected to or, if it contains a\n\
 colon, HOST:PORT to access a board over a network";
@@ -3614,29 +3647,29 @@ of the TFTP temporary file, if it differs from the filename seen by the board.";
   add_target (&lsi_ops);
 
   add_show_from_set (
-    add_set_cmd ("timeout", no_class, var_zinteger,
-                (char *) &mips_receive_wait,
-                "Set timeout in seconds for remote MIPS serial I/O.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("timeout", no_class, var_zinteger,
+                                  (char *) &mips_receive_wait,
+                      "Set timeout in seconds for remote MIPS serial I/O.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("retransmit-timeout", no_class, var_zinteger,
-                (char *) &mips_retransmit_wait,
-        "Set retransmit timeout in seconds for remote MIPS serial I/O.\n\
+                 add_set_cmd ("retransmit-timeout", no_class, var_zinteger,
+                              (char *) &mips_retransmit_wait,
+                              "Set retransmit timeout in seconds for remote MIPS serial I/O.\n\
 This is the number of seconds to wait for an acknowledgement to a packet\n\
 before resending the packet.", &setlist),
-       &showlist);
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("syn-garbage-limit", no_class, var_zinteger,
-                (char *) &mips_syn_garbage,
-"Set the maximum number of characters to ignore when scanning for a SYN.\n\
+                  add_set_cmd ("syn-garbage-limit", no_class, var_zinteger,
+                               (char *) &mips_syn_garbage,
+                               "Set the maximum number of characters to ignore when scanning for a SYN.\n\
 This is the maximum number of characters GDB will ignore when trying to\n\
 synchronize with the remote system.  A value of -1 means that there is no limit\n\
 (Note that these characters are printed out even though they are ignored.)",
-                &setlist),
-                    &showlist);
+                               &setlist),
+                     &showlist);
 
   add_show_from_set
     (add_set_cmd ("monitor-prompt", class_obscure, var_string,
@@ -3646,14 +3679,14 @@ synchronize with the remote system.  A value of -1 means that there is no limit\
      &showlist);
 
   add_show_from_set (
-    add_set_cmd ("monitor-warnings", class_obscure, var_zinteger,
-                (char *)&monitor_warnings,
-                "Set printing of monitor warnings.\n"
-                "When enabled, monitor warnings about hardware breakpoints "
-                "will be displayed.",
-                &setlist),
-                    &showlist);
+              add_set_cmd ("monitor-warnings", class_obscure, var_zinteger,
+                           (char *) &monitor_warnings,
+                           "Set printing of monitor warnings.\n"
+               "When enabled, monitor warnings about hardware breakpoints "
+                           "will be displayed.",
+                           &setlist),
+                     &showlist);
 
   add_com ("pmon <command>", class_obscure, pmon_command,
-          "Send a packet to PMON (must be in debug mode)."); 
+          "Send a packet to PMON (must be in debug mode).");
 }
index 19455b4fc057eaff7938f1fcd4eea923e10831c2..1f25640a30ea9411c190e8439304729cfb63df08 100644 (file)
@@ -2,33 +2,34 @@
    Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Originally written by Daniel Mann at AMD.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is like remote.c but ecpects MiniMON to be running on the Am29000 
    target hardware.
- - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
-       file to gdb 3.95.  I was unable to get this working on sun3os4
-       with termio, only with sgtty.  Because we are only attempting to
-       use this module to debug our kernel, which is already loaded when
-       gdb is started up, I did not code up the file downloading facilities.  
-       As a result this module has only the stubs to download files. 
-       You should get tagged at compile time if you need to make any 
-       changes/additions.  */
  - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
+   file to gdb 3.95.  I was unable to get this working on sun3os4
+   with termio, only with sgtty.  Because we are only attempting to
+   use this module to debug our kernel, which is already loaded when
+   gdb is started up, I did not code up the file downloading facilities.  
+   As a result this module has only the stubs to download files. 
+   You should get tagged at compile time if you need to make any 
+   changes/additions.  */
+
 #include "defs.h"
 #include "inferior.h"
 #include "wait.h"
@@ -47,20 +48,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define DRAIN_INPUT()  (msg_recv_serial((union msg_t*)0))
 
-extern int stop_soon_quietly;           /* for wait_for_inferior */
+extern int stop_soon_quietly;  /* for wait_for_inferior */
 
-static void mm_resume();
+static void mm_resume ();
 static void mm_fetch_registers ();
 static int fetch_register ();
 static void mm_store_registers ();
 static int store_register ();
-static int regnum_to_srnum();
-static void  mm_close ();
-static char* msg_str();
-static char* error_msg_str();
-static int expect_msg();
-static void init_target_mm();
-static int mm_memory_space();
+static int regnum_to_srnum ();
+static void mm_close ();
+static char *msg_str ();
+static char *error_msg_str ();
+static int expect_msg ();
+static void init_target_mm ();
+static int mm_memory_space ();
 
 #define FREEZE_MODE     (read_register(CPS_REGNUM) && 0x400)
 #define USE_SHADOW_PC  ((processor_type == a29k_freeze_mode) && FREEZE_MODE)
@@ -75,13 +76,13 @@ FILE *log_file;
  * Size of message buffers.  I couldn't get memory reads to work when
  * the byte_count was larger than 512 (it may be a baud rate problem).
  */
-#define BUFER_SIZE  512                
+#define BUFER_SIZE  512
 /* 
  * Size of data area in message buffer on the TARGET (remote system).
  */
 #define MAXDATA_T  (target_config.max_msg_size - \
                        offsetof(struct write_r_msg_t,data[0]))
-/*              
+/*               
  * Size of data area in message buffer on the HOST (gdb). 
  */
 #define MAXDATA_H  (BUFER_SIZE - offsetof(struct write_r_msg_t,data[0]))
@@ -91,16 +92,16 @@ FILE *log_file;
 #define MAXDATA           (MAXDATA_H < MAXDATA_T ? MAXDATA_H : MAXDATA_T)
 
 static char out_buf[BUFER_SIZE];
-static char  in_buf[BUFER_SIZE];
+static char in_buf[BUFER_SIZE];
 
-int msg_recv_serial();
-int msg_send_serial();
+int msg_recv_serial ();
+int msg_send_serial ();
 
 #define MAX_RETRIES 5000
-extern struct target_ops mm_ops;             /* Forward declaration */
-struct config_msg_t  target_config;    /* HIF needs this */
-union msg_t  *out_msg_buf = (union msg_t*)out_buf;
-union msg_t  *in_msg_buf  = (union msg_t*)in_buf;
+extern struct target_ops mm_ops;       /* Forward declaration */
+struct config_msg_t target_config;     /* HIF needs this */
+union msg_t *out_msg_buf = (union msg_t *) out_buf;
+union msg_t *in_msg_buf = (union msg_t *) in_buf;
 
 static int timeout = 5;
 
@@ -117,8 +118,9 @@ FILE *mm_stream;
 #ifndef HAVE_TERMIO
 
 #ifndef __STDC__
-# ifndef volatile
-#  define volatile /**/
+#ifndef volatile
+#define volatile
+/**/
 # endif
 #endif
 volatile int n_alarms;
@@ -153,10 +155,10 @@ mm_create_inferior (execfile, args, env)
 {
 #define MAX_TOKENS 25
 #define BUFFER_SIZE 256
-   int token_count;
-   int result;
-   char        *token[MAX_TOKENS];
-   char        cmd_line[BUFFER_SIZE];
+  int token_count;
+  int result;
+  char *token[MAX_TOKENS];
+  char cmd_line[BUFFER_SIZE];
 
   if (args && *args)
     error ("Can't pass arguments to remote mm process (yet).");
@@ -164,15 +166,16 @@ mm_create_inferior (execfile, args, env)
   if (execfile == 0 /* || exec_bfd == 0 */ )
     error ("No executable file specified");
 
-  if (!mm_stream) {
-        printf("Minimon not open yet.\n");
-       return;
-  }
+  if (!mm_stream)
+    {
+      printf ("Minimon not open yet.\n");
+      return;
+    }
 
   /* On ultra3 (NYU) we assume the kernel is already running so there is
      no file to download.
      FIXME: Fixed required here -> load your program, possibly with mm_load().
-     */
+   */
   printf_filtered ("\n\
 Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n");
 
@@ -185,10 +188,10 @@ Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n");
 }
 /**************************************************** REMOTE_MOURN_INFERIOR */
 static void
-mm_mourn()
+mm_mourn ()
 {
-        pop_target ();                /* Pop back to no-child state */
-        generic_mourn_inferior ();
+  pop_target ();               /* Pop back to no-child state */
+  generic_mourn_inferior ();
 }
 
 /********************************************************************** damn_b
@@ -203,34 +206,92 @@ mm_mourn()
 #define B38400 EXTB
 #endif
 
-static struct {int rate, damn_b;} baudtab[] = {
-       {0, B0},
-       {50, B50},
-       {75, B75},
-       {110, B110},
-       {134, B134},
-       {150, B150},
-       {200, B200},
-       {300, B300},
-       {600, B600},
-       {1200, B1200},
-       {1800, B1800},
-       {2400, B2400},
-       {4800, B4800},
-       {9600, B9600},
-       {19200, B19200},
-       {38400, B38400},
-       {-1, -1},
+static struct
+{
+  int rate, damn_b;
+}
+baudtab[] =
+{
+  {
+    0, B0
+  }
+  ,
+  {
+    50, B50
+  }
+  ,
+  {
+    75, B75
+  }
+  ,
+  {
+    110, B110
+  }
+  ,
+  {
+    134, B134
+  }
+  ,
+  {
+    150, B150
+  }
+  ,
+  {
+    200, B200
+  }
+  ,
+  {
+    300, B300
+  }
+  ,
+  {
+    600, B600
+  }
+  ,
+  {
+    1200, B1200
+  }
+  ,
+  {
+    1800, B1800
+  }
+  ,
+  {
+    2400, B2400
+  }
+  ,
+  {
+    4800, B4800
+  }
+  ,
+  {
+    9600, B9600
+  }
+  ,
+  {
+    19200, B19200
+  }
+  ,
+  {
+    38400, B38400
+  }
+  ,
+  {
+    -1, -1
+  }
+  ,
 };
 
-static int damn_b (rate)
+static int
+damn_b (rate)
      int rate;
 {
   int i;
 
   for (i = 0; baudtab[i].rate != -1; i++)
-    if (rate == baudtab[i].rate) return baudtab[i].damn_b;
-  return B38400;       /* Random */
+    if (rate == baudtab[i].rate)
+      return baudtab[i].damn_b;
+  return B38400;               /* Random */
 }
 
 
@@ -258,25 +319,25 @@ mm_open (name, from_tty)
        p && *p && !isspace (*p); p++)
     ;
   if (p == 0 || *p == '\0')
-erroid:
+  erroid:
     error ("Usage : <command> <serial-device> <baud-rate> [progname]");
-  dev_name = (char*)xmalloc (p - name + 1);
+  dev_name = (char *) xmalloc (p - name + 1);
   strncpy (dev_name, name, p - name);
   dev_name[p - name] = '\0';
 
   /* Skip over the whitespace after dev_name */
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (1 != sscanf (p, "%d ", &baudrate))
     goto erroid;
 
   /* Skip the number and then the spaces */
   for (; isdigit (*p); p++)
-    /*EMPTY*/;
+    /*EMPTY */ ;
   for (; isspace (*p); p++)
-    /*EMPTY*/;
-  
+    /*EMPTY */ ;
+
   if (prog_name != NULL)
     free (prog_name);
   prog_name = savestring (p, strlen (p));
@@ -326,58 +387,60 @@ erroid:
   if (log_file == NULL)
     perror_with_name (LOG_FILE);
 #endif
-   /*
-   ** Initialize target configuration structure (global)
+  /*
+     ** Initialize target configuration structure (global)
    */
-   DRAIN_INPUT();
-   out_msg_buf->config_req_msg.code = CONFIG_REQ;
-   out_msg_buf->config_req_msg.length = 4*0;
-   msg_send_serial(out_msg_buf); /* send config request message */
+  DRAIN_INPUT ();
+  out_msg_buf->config_req_msg.code = CONFIG_REQ;
+  out_msg_buf->config_req_msg.length = 4 * 0;
+  msg_send_serial (out_msg_buf);       /* send config request message */
 
-   expect_msg(CONFIG,in_msg_buf,1);
+  expect_msg (CONFIG, in_msg_buf, 1);
 
   a29k_get_processor_type ();
 
   /* Print out some stuff, letting the user now what's going on */
-  printf_filtered("Connected to MiniMon via %s.\n", dev_name);
-    /* FIXME: can this restriction be removed? */
-  printf_filtered("Remote debugging using virtual addresses works only\n");
-  printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n")
-;
-  if (processor_type != a29k_freeze_mode) {
-        fprintf_filtered(gdb_stderr,
-        "Freeze-mode debugging not available, and can only be done on an A29050.\n");
-  }
+  printf_filtered ("Connected to MiniMon via %s.\n", dev_name);
+  /* FIXME: can this restriction be removed? */
+  printf_filtered ("Remote debugging using virtual addresses works only\n");
+  printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n")
+    ;
+  if (processor_type != a29k_freeze_mode)
+    {
+      fprintf_filtered (gdb_stderr,
+                       "Freeze-mode debugging not available, and can only be done on an A29050.\n");
+    }
 
-   target_config.code = CONFIG;
-   target_config.length = 0;
-   target_config.processor_id = in_msg_buf->config_msg.processor_id;
-   target_config.version = in_msg_buf->config_msg.version;
-   target_config.I_mem_start = in_msg_buf->config_msg.I_mem_start;
-   target_config.I_mem_size = in_msg_buf->config_msg.I_mem_size;
-   target_config.D_mem_start = in_msg_buf->config_msg.D_mem_start;
-   target_config.D_mem_size = in_msg_buf->config_msg.D_mem_size;
-   target_config.ROM_start = in_msg_buf->config_msg.ROM_start;
-   target_config.ROM_size =  in_msg_buf->config_msg.ROM_size;
-   target_config.max_msg_size = in_msg_buf->config_msg.max_msg_size;
-   target_config.max_bkpts = in_msg_buf->config_msg.max_bkpts;
-   target_config.coprocessor = in_msg_buf->config_msg.coprocessor;
-   target_config.reserved = in_msg_buf->config_msg.reserved;
-   if (from_tty) {
-       printf("Connected to MiniMON :\n");
-       printf("    Debugcore version            %d.%d\n",
-               0x0f & (target_config.version >> 4),
-               0x0f & (target_config.version ) );
-       printf("    Configuration version        %d.%d\n",
-               0x0f & (target_config.version >> 12),
-               0x0f & (target_config.version >>  8) );
-       printf("    Message system version       %d.%d\n",
-               0x0f & (target_config.version >> 20),
-               0x0f & (target_config.version >> 16) );
-       printf("    Communication driver version %d.%d\n",
-               0x0f & (target_config.version >> 28),
-               0x0f & (target_config.version >> 24) );
-   }
+  target_config.code = CONFIG;
+  target_config.length = 0;
+  target_config.processor_id = in_msg_buf->config_msg.processor_id;
+  target_config.version = in_msg_buf->config_msg.version;
+  target_config.I_mem_start = in_msg_buf->config_msg.I_mem_start;
+  target_config.I_mem_size = in_msg_buf->config_msg.I_mem_size;
+  target_config.D_mem_start = in_msg_buf->config_msg.D_mem_start;
+  target_config.D_mem_size = in_msg_buf->config_msg.D_mem_size;
+  target_config.ROM_start = in_msg_buf->config_msg.ROM_start;
+  target_config.ROM_size = in_msg_buf->config_msg.ROM_size;
+  target_config.max_msg_size = in_msg_buf->config_msg.max_msg_size;
+  target_config.max_bkpts = in_msg_buf->config_msg.max_bkpts;
+  target_config.coprocessor = in_msg_buf->config_msg.coprocessor;
+  target_config.reserved = in_msg_buf->config_msg.reserved;
+  if (from_tty)
+    {
+      printf ("Connected to MiniMON :\n");
+      printf ("    Debugcore version            %d.%d\n",
+             0x0f & (target_config.version >> 4),
+             0x0f & (target_config.version));
+      printf ("    Configuration version        %d.%d\n",
+             0x0f & (target_config.version >> 12),
+             0x0f & (target_config.version >> 8));
+      printf ("    Message system version       %d.%d\n",
+             0x0f & (target_config.version >> 20),
+             0x0f & (target_config.version >> 16));
+      printf ("    Communication driver version %d.%d\n",
+             0x0f & (target_config.version >> 28),
+             0x0f & (target_config.version >> 24));
+    }
 
   /* Leave the target running... 
    * The above message stopped the target in the dbg core (MiniMon),  
@@ -385,7 +448,7 @@ erroid:
    */
   out_msg_buf->go_msg.code = GO;
   out_msg_buf->go_msg.length = 0;
-  msg_send_serial(out_msg_buf);
+  msg_send_serial (out_msg_buf);
   /* No message to expect after a GO */
 }
 
@@ -394,7 +457,7 @@ erroid:
    Use this when you want to detach and do something else
    with your gdb.  */
 static void
-mm_close (quitting)    /*FIXME: how is quitting used */
+mm_close (quitting)            /*FIXME: how is quitting used */
      int quitting;
 {
   if (mm_desc < 0)
@@ -406,8 +469,8 @@ mm_close (quitting) /*FIXME: how is quitting used */
      Due to a bug in Unix, fclose closes not only the stdio stream,
      but also the file descriptor.  So we don't actually close
      mm_desc.  */
-  DRAIN_INPUT();
-  fclose (mm_stream);  
+  DRAIN_INPUT ();
+  fclose (mm_stream);
   /* close (mm_desc); */
 
   /* Do not try to close mm_desc again, later in the program.  */
@@ -422,7 +485,7 @@ mm_close (quitting) /*FIXME: how is quitting used */
 #endif
 
   printf ("Ending remote debugging\n");
-} 
+}
 
 /************************************************************* REMOTE_ATACH */
 /* Attach to a program that is already loaded and running 
@@ -435,39 +498,39 @@ mm_attach (args, from_tty)
 {
 
   if (!mm_stream)
-      error ("MiniMon not opened yet, use the 'target minimon' command.\n");
-       
+    error ("MiniMon not opened yet, use the 'target minimon' command.\n");
+
   if (from_tty)
-      printf ("Attaching to remote program %s...\n", prog_name);
+    printf ("Attaching to remote program %s...\n", prog_name);
 
   /* Make sure the target is currently running, it is supposed to be. */
   /* FIXME: is it ok to send MiniMon a BREAK if it is already stopped in 
-   *   the dbg core.  If so, we don't need to send this GO.
+   *  the dbg core.  If so, we don't need to send this GO.
    */
   out_msg_buf->go_msg.code = GO;
   out_msg_buf->go_msg.length = 0;
-  msg_send_serial(out_msg_buf);
-  sleep(2);    /* At the worst it will stop, receive a message, continue */
-  /* Send the mm a break. */ 
+  msg_send_serial (out_msg_buf);
+  sleep (2);                   /* At the worst it will stop, receive a message, continue */
+
+  /* Send the mm a break. */
   out_msg_buf->break_msg.code = BREAK;
   out_msg_buf->break_msg.length = 0;
-  msg_send_serial(out_msg_buf);
+  msg_send_serial (out_msg_buf);
 }
 /********************************************************** REMOTE_DETACH */
 /* Terminate the open connection to the remote debugger.
    Use this when you want to detach and do something else
    with your gdb.  Leave remote process running (with no breakpoints set). */
 static void
-mm_detach (args,from_tty)
+mm_detach (args, from_tty)
      char *args;
      int from_tty;
 {
-  remove_breakpoints();                /* Just in case there were any left in */
+  remove_breakpoints ();       /* Just in case there were any left in */
   out_msg_buf->go_msg.code = GO;
   out_msg_buf->go_msg.length = 0;
-  msg_send_serial(out_msg_buf);
-  pop_target();                /* calls mm_close to do the real work */
+  msg_send_serial (out_msg_buf);
+  pop_target ();               /* calls mm_close to do the real work */
 }
 
 
@@ -482,16 +545,19 @@ mm_resume (pid, step, sig)
   if (sig != TARGET_SIGNAL_0)
     warning ("Can't send signals to a remote MiniMon system.");
 
-  if (step) {
-      out_msg_buf->step_msg.code= STEP;
-      out_msg_buf->step_msg.length = 1*4;
-      out_msg_buf->step_msg.count = 1;         /* step 1 instruction */
-      msg_send_serial(out_msg_buf);
-  } else {
-      out_msg_buf->go_msg.code= GO;
+  if (step)
+    {
+      out_msg_buf->step_msg.code = STEP;
+      out_msg_buf->step_msg.length = 1 * 4;
+      out_msg_buf->step_msg.count = 1; /* step 1 instruction */
+      msg_send_serial (out_msg_buf);
+    }
+  else
+    {
+      out_msg_buf->go_msg.code = GO;
       out_msg_buf->go_msg.length = 0;
-      msg_send_serial(out_msg_buf);
-  }
+      msg_send_serial (out_msg_buf);
+    }
 }
 
 /***************************************************************** REMOTE_WAIT
@@ -510,124 +576,133 @@ mm_wait (status)
   status->value.integer = 0;
 
 /* wait for message to arrive. It should be:
-       - A HIF service request.
-       - A HIF exit service request.
-       - A CHANNEL0_ACK.
-       - A CHANNEL1 request.
-       - a debugcore HALT message.
-  HIF services must be responded too, and while-looping continued.
-  If the target stops executing, mm_wait() should return.
-*/
-  timeout = 0; /* Wait indefinetly for a message */
-  immediate_quit = 1;   /* Helps ability to QUIT */
-  while(1)
-  {
-    while(msg_recv_serial(in_msg_buf)) {
-       QUIT;   /* Let user quit if they want */
-    }
-    switch (in_msg_buf->halt_msg.code)
+   - A HIF service request.
+   - A HIF exit service request.
+   - A CHANNEL0_ACK.
+   - A CHANNEL1 request.
+   - a debugcore HALT message.
+   HIF services must be responded too, and while-looping continued.
+   If the target stops executing, mm_wait() should return.
+ */
+  timeout = 0;                 /* Wait indefinetly for a message */
+  immediate_quit = 1;          /* Helps ability to QUIT */
+  while (1)
     {
-    case HIF_CALL:
-       i = in_msg_buf->hif_call_rtn_msg.service_number;
-       result=service_HIF(in_msg_buf);
-       if(i == 1) /* EXIT */
+      while (msg_recv_serial (in_msg_buf))
+       {
+         QUIT;                 /* Let user quit if they want */
+       }
+      switch (in_msg_buf->halt_msg.code)
+       {
+       case HIF_CALL:
+         i = in_msg_buf->hif_call_rtn_msg.service_number;
+         result = service_HIF (in_msg_buf);
+         if (i == 1)           /* EXIT */
            goto exit;
-       if(result)
-           printf("Warning: failure during HIF service %d\n", i);
-       break;
-    case CHANNEL0_ACK:
-       service_HIF(in_msg_buf);
-       break;
-    case CHANNEL1:
-        i=in_msg_buf->channel1_msg.length;
-        in_msg_buf->channel1_msg.data[i] = '\0';
-        printf("%s", in_msg_buf->channel1_msg.data);
-       gdb_flush(gdb_stdout);
-        /* Send CHANNEL1_ACK message */
-        out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK;
-        out_msg_buf->channel1_ack_msg.length = 0;
-        result = msg_send_serial(out_msg_buf);
-       break;
-    case HALT:
-       goto halted;
-    default:
-       goto halted;
+         if (result)
+           printf ("Warning: failure during HIF service %d\n", i);
+         break;
+       case CHANNEL0_ACK:
+         service_HIF (in_msg_buf);
+         break;
+       case CHANNEL1:
+         i = in_msg_buf->channel1_msg.length;
+         in_msg_buf->channel1_msg.data[i] = '\0';
+         printf ("%s", in_msg_buf->channel1_msg.data);
+         gdb_flush (gdb_stdout);
+         /* Send CHANNEL1_ACK message */
+         out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK;
+         out_msg_buf->channel1_ack_msg.length = 0;
+         result = msg_send_serial (out_msg_buf);
+         break;
+       case HALT:
+         goto halted;
+       default:
+         goto halted;
+       }
     }
-  }
 halted:
   /* FIXME, these printfs should not be here.  This is a source level 
      debugger, guys!  */
-  if (in_msg_buf->halt_msg.trap_number== 0)
-  { printf("Am290*0 received vector number %d (break point)\n",
-       in_msg_buf->halt_msg.trap_number);
-    status->kind = TARGET_WAITKIND_STOPPED;
-    status->value.sig = TARGET_SIGNAL_TRAP;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 1)
+  if (in_msg_buf->halt_msg.trap_number == 0)
     {
-      printf("Am290*0 received vector number %d\n",
-            in_msg_buf->halt_msg.trap_number);
+      printf ("Am290*0 received vector number %d (break point)\n",
+             in_msg_buf->halt_msg.trap_number);
+      status->kind = TARGET_WAITKIND_STOPPED;
+      status->value.sig = TARGET_SIGNAL_TRAP;
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 1)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_BUS;
     }
-  else if (in_msg_buf->halt_msg.trap_number== 3
-        || in_msg_buf->halt_msg.trap_number== 4)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+  else if (in_msg_buf->halt_msg.trap_number == 3
+          || in_msg_buf->halt_msg.trap_number == 4)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_FPE;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 5)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 5)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_ILL;
-  }
+    }
   else if (in_msg_buf->halt_msg.trap_number >= 6
-        && in_msg_buf->halt_msg.trap_number <= 11)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+          && in_msg_buf->halt_msg.trap_number <= 11)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_SEGV;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 12
-        || in_msg_buf->halt_msg.trap_number== 13)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 12
+          || in_msg_buf->halt_msg.trap_number == 13)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_ILL;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 14)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 14)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_ALRM;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 15)
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 15)
     {
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
     }
   else if (in_msg_buf->halt_msg.trap_number >= 16
-        && in_msg_buf->halt_msg.trap_number <= 21)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+          && in_msg_buf->halt_msg.trap_number <= 21)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_INT;
-  }
-  else if (in_msg_buf->halt_msg.trap_number== 22)
-  { printf("Am290*0 received vector number %d\n",
-       in_msg_buf->halt_msg.trap_number);
+    }
+  else if (in_msg_buf->halt_msg.trap_number == 22)
+    {
+      printf ("Am290*0 received vector number %d\n",
+             in_msg_buf->halt_msg.trap_number);
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_ILL;
-  } /* BREAK message was sent */
-  else if (in_msg_buf->halt_msg.trap_number== 75)
+    }                          /* BREAK message was sent */
+  else if (in_msg_buf->halt_msg.trap_number == 75)
     {
       status->kind = TARGET_WAITKIND_STOPPED;
       status->value.sig = TARGET_SIGNAL_TRAP;
     }
   else
-exit:
+  exit:
     {
       status->kind = TARGET_WAITKIND_EXITED;
       status->value.integer = 0;
@@ -642,96 +717,103 @@ exit:
  * Read a remote register 'regno'. 
  * If regno==-1 then read all the registers.
  */
-static void 
+static void
 mm_fetch_registers (regno)
-int    regno;
+     int regno;
 {
   INT32 *data_p;
 
-  if (regno >= 0)  {
-       fetch_register(regno);
-       return;
-  }
+  if (regno >= 0)
+    {
+      fetch_register (regno);
+      return;
+    }
 
 /* Gr1/rsp */
-  out_msg_buf->read_req_msg.byte_count = 4*1;
+  out_msg_buf->read_req_msg.byte_count = 4 * 1;
   out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
   out_msg_buf->read_req_msg.address = 1;
-  msg_send_serial(out_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-  supply_register (GR1_REGNUM , data_p);
+  supply_register (GR1_REGNUM, data_p);
 
 #if defined(GR64_REGNUM)       /* Read gr64-127 */
-/* Global Registers gr64-gr95 */ 
-  out_msg_buf->read_req_msg.code= READ_REQ;
-  out_msg_buf->read_req_msg.length = 4*3;
-  out_msg_buf->read_req_msg.byte_count = 4*32;
+/* Global Registers gr64-gr95 */
+  out_msg_buf->read_req_msg.code = READ_REQ;
+  out_msg_buf->read_req_msg.length = 4 * 3;
+  out_msg_buf->read_req_msg.byte_count = 4 * 32;
   out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
   out_msg_buf->read_req_msg.address = 64;
-  msg_send_serial(out_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
 
-  for (regno=GR64_REGNUM; regno<GR64_REGNUM+32; regno++) {
+  for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++)
+    {
       supply_register (regno, data_p++);
-  }
-#endif /*  GR64_REGNUM */
+    }
+#endif /*  GR64_REGNUM */
 
-/* Global Registers gr96-gr127 */ 
-  out_msg_buf->read_req_msg.code= READ_REQ;
-  out_msg_buf->read_req_msg.length = 4*3;
+/* Global Registers gr96-gr127 */
+  out_msg_buf->read_req_msg.code = READ_REQ;
+  out_msg_buf->read_req_msg.length = 4 * 3;
   out_msg_buf->read_req_msg.byte_count = 4 * 32;
   out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
   out_msg_buf->read_req_msg.address = 96;
-  msg_send_serial(out_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
 
-  for (regno=GR96_REGNUM; regno<GR96_REGNUM+32; regno++) {
+  for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++)
+    {
       supply_register (regno, data_p++);
-  }
+    }
 
-/* Local Registers */ 
+/* Local Registers */
   out_msg_buf->read_req_msg.byte_count = 4 * (128);
   out_msg_buf->read_req_msg.memory_space = LOCAL_REG;
   out_msg_buf->read_req_msg.address = 0;
-  msg_send_serial(out_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
 
-  for (regno=LR0_REGNUM; regno<LR0_REGNUM+128; regno++) {
+  for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++)
+    {
       supply_register (regno, data_p++);
-  }
+    }
 
-/* Protected Special Registers */ 
-  out_msg_buf->read_req_msg.byte_count = 4*15;
+/* Protected Special Registers */
+  out_msg_buf->read_req_msg.byte_count = 4 * 15;
   out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
   out_msg_buf->read_req_msg.address = 0;
-  msg_send_serialout_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
 
-  for (regno=0; regno<=14; regno++) {
-      supply_register (SR_REGNUM(regno), data_p++);
-  }
-  if (USE_SHADOW_PC) { /* Let regno_to_srnum() handle the register number */
-       fetch_register(NPC_REGNUM);
-       fetch_register(PC_REGNUM);
-       fetch_register(PC2_REGNUM);
-  }
+  for (regno = 0; regno <= 14; regno++)
+    {
+      supply_register (SR_REGNUM (regno), data_p++);
+    }
+  if (USE_SHADOW_PC)
+    {                          /* Let regno_to_srnum() handle the register number */
+      fetch_register (NPC_REGNUM);
+      fetch_register (PC_REGNUM);
+      fetch_register (PC2_REGNUM);
+    }
 
-/* Unprotected Special Registers */ 
-  out_msg_buf->read_req_msg.byte_count = 4*8;
+/* Unprotected Special Registers */
+  out_msg_buf->read_req_msg.byte_count = 4 * 8;
   out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
   out_msg_buf->read_req_msg.address = 128;
-  msg_send_serialout_msg_buf);
-  expect_msg(READ_ACK,in_msg_buf,1);
+  msg_send_serial (out_msg_buf);
+  expect_msg (READ_ACK, in_msg_buf, 1);
   data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
 
-  for (regno=128; regno<=135; regno++) {
-      supply_register (SR_REGNUM(regno), data_p++);
-  }
+  for (regno = 128; regno <= 135; regno++)
+    {
+      supply_register (SR_REGNUM (regno), data_p++);
+    }
 
   /* There doesn't seem to be any way to get these.  */
   {
@@ -752,124 +834,133 @@ int     regno;
 
 static void
 mm_store_registers (regno)
-int regno;
+     int regno;
 {
   int result;
-  
-  if (regno >= 0) {
-    store_register(regno);
-    return;
-  }
+
+  if (regno >= 0)
+    {
+      store_register (regno);
+      return;
+    }
 
   result = 0;
 
-  out_msg_buf->write_r_msg.code= WRITE_REQ;
+  out_msg_buf->write_r_msg.code = WRITE_REQ;
 
 /* Gr1/rsp */
-  out_msg_buf->write_r_msg.byte_count = 4*1;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * 1;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.memory_space = GLOBAL_REG;
   out_msg_buf->write_r_msg.address = 1;
   out_msg_buf->write_r_msg.data[0] = read_register (GR1_REGNUM);
 
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
 
 #if defined(GR64_REGNUM)
 /* Global registers gr64-gr95 */
-  out_msg_buf->write_r_msg.byte_count = 4* (32);
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * (32);
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 64;
 
-  for (regno=GR64_REGNUM ; regno<GR64_REGNUM+32 ; regno++)
+  for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++)
     {
-      out_msg_buf->write_r_msg.data[regno-GR64_REGNUM] = read_register (regno);
+      out_msg_buf->write_r_msg.data[regno - GR64_REGNUM] = read_register (regno);
     }
-  msg_send_serial(out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
-#endif /* GR64_REGNUM */
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
+#endif /* GR64_REGNUM */
 
 /* Global registers gr96-gr127 */
-  out_msg_buf->write_r_msg.byte_count = 4* (32);
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * (32);
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 96;
-  for (regno=GR96_REGNUM ; regno<GR96_REGNUM+32 ; regno++)
+  for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++)
     {
-      out_msg_buf->write_r_msg.data[regno-GR96_REGNUM] = read_register (regno);
+      out_msg_buf->write_r_msg.data[regno - GR96_REGNUM] = read_register (regno);
+    }
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
     }
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
 
 /* Local Registers */
   out_msg_buf->write_r_msg.memory_space = LOCAL_REG;
-  out_msg_buf->write_r_msg.byte_count = 4*128;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * 128;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 0;
 
-  for (regno = LR0_REGNUM ; regno < LR0_REGNUM+128 ; regno++)
+  for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++)
     {
-      out_msg_buf->write_r_msg.data[regno-LR0_REGNUM] = read_register (regno);
+      out_msg_buf->write_r_msg.data[regno - LR0_REGNUM] = read_register (regno);
+    }
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
     }
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
 
-/* Protected Special Registers */ 
+/* Protected Special Registers */
   /* VAB through TMR */
   out_msg_buf->write_r_msg.memory_space = SPECIAL_REG;
-  out_msg_buf->write_r_msg.byte_count = 4* 10;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * 10;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 0;
-  for (regno = 0 ; regno<=9 ; regno++) /* VAB through TMR */
-    out_msg_buf->write_r_msg.data[regno] = read_register (SR_REGNUM(regno));
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
+  for (regno = 0; regno <= 9; regno++) /* VAB through TMR */
+    out_msg_buf->write_r_msg.data[regno] = read_register (SR_REGNUM (regno));
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
 
   /* PC0, PC1, PC2 possibly as shadow registers */
-  out_msg_buf->write_r_msg.byte_count = 4* 3;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
-  for (regno=10 ; regno<=12 ; regno++) /* LRU and MMU */
-    out_msg_buf->write_r_msg.data[regno-10] = read_register (SR_REGNUM(regno));
-  if (USE_SHADOW_PC) 
+  out_msg_buf->write_r_msg.byte_count = 4 * 3;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
+  for (regno = 10; regno <= 12; regno++)       /* LRU and MMU */
+    out_msg_buf->write_r_msg.data[regno - 10] = read_register (SR_REGNUM (regno));
+  if (USE_SHADOW_PC)
     out_msg_buf->write_r_msg.address = 20;     /* SPC0 */
-  else 
+  else
     out_msg_buf->write_r_msg.address = 10;     /* PC0 */
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
 
   /* LRU and MMU */
-  out_msg_buf->write_r_msg.byte_count = 4* 2;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+  out_msg_buf->write_r_msg.byte_count = 4 * 2;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 13;
-  for (regno=13 ; regno<=14 ; regno++) /* LRU and MMU */
-    out_msg_buf->write_r_msg.data[regno-13] = read_register (SR_REGNUM(regno));
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
+  for (regno = 13; regno <= 14; regno++)       /* LRU and MMU */
+    out_msg_buf->write_r_msg.data[regno - 13] = read_register (SR_REGNUM (regno));
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
 
-/* Unprotected Special Registers */ 
-  out_msg_buf->write_r_msg.byte_count = 4*8;
-  out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
+/* Unprotected Special Registers */
+  out_msg_buf->write_r_msg.byte_count = 4 * 8;
+  out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count;
   out_msg_buf->write_r_msg.address = 128;
-  for (regno = 128 ; regno<=135 ; regno++)
-    out_msg_buf->write_r_msg.data[regno-128] = read_register(SR_REGNUM(regno));
-  msg_send_serial( out_msg_buf);
-  if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = -1;
-  }
+  for (regno = 128; regno <= 135; regno++)
+    out_msg_buf->write_r_msg.data[regno - 128] = read_register (SR_REGNUM (regno));
+  msg_send_serial (out_msg_buf);
+  if (!expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = -1;
+    }
+
   registers_changed ();
 }
 
@@ -888,22 +979,25 @@ mm_prepare_to_store ()
 
 /******************************************************* REMOTE_XFER_MEMORY */
 static CORE_ADDR
-translate_addr(addr)
-CORE_ADDR addr;
+translate_addr (addr)
+     CORE_ADDR addr;
 {
 #if defined(KERNEL_DEBUGGING)
-        /* Check for a virtual address in the kernel */
-        /* Assume physical address of ublock is in  paddr_u register */
-       /* FIXME: doesn't work for user virtual addresses */
-        if (addr >= UVADDR) {
-                /* PADDR_U register holds the physical address of the ublock */
-                CORE_ADDR i = (CORE_ADDR)read_register(PADDR_U_REGNUM);
-                return(i + addr - (CORE_ADDR)UVADDR);
-        } else {
-               return(addr);
-        }
+  /* Check for a virtual address in the kernel */
+  /* Assume physical address of ublock is in  paddr_u register */
+  /* FIXME: doesn't work for user virtual addresses */
+  if (addr >= UVADDR)
+    {
+      /* PADDR_U register holds the physical address of the ublock */
+      CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM);
+      return (i + addr - (CORE_ADDR) UVADDR);
+    }
+  else
+    {
+      return (addr);
+    }
 #else
-        return(addr);
+  return (addr);
 #endif
 }
 
@@ -912,7 +1006,7 @@ static void
 mm_files_info ()
 {
   printf ("\tAttached to %s at %d baud and running program %s.\n",
-          dev_name, baudrate, prog_name);
+         dev_name, baudrate, prog_name);
 }
 
 /************************************************* REMOTE_INSERT_BREAKPOINT */
@@ -922,17 +1016,20 @@ mm_insert_breakpoint (addr, contents_cache)
      char *contents_cache;
 {
   out_msg_buf->bkpt_set_msg.code = BKPT_SET;
-  out_msg_buf->bkpt_set_msg.length = 4*4;
+  out_msg_buf->bkpt_set_msg.length = 4 * 4;
   out_msg_buf->bkpt_set_msg.memory_space = I_MEM;
   out_msg_buf->bkpt_set_msg.bkpt_addr = (ADDR32) addr;
   out_msg_buf->bkpt_set_msg.pass_count = 1;
   out_msg_buf->bkpt_set_msg.bkpt_type = -1;    /* use illop for 29000 */
-  msg_send_serial( out_msg_buf);
-  if (expect_msg(BKPT_SET_ACK,in_msg_buf,1)) {
-       return 0;               /* Success */
-  } else {
-       return 1;               /* Failure */
-  }
+  msg_send_serial (out_msg_buf);
+  if (expect_msg (BKPT_SET_ACK, in_msg_buf, 1))
+    {
+      return 0;                        /* Success */
+    }
+  else
+    {
+      return 1;                        /* Failure */
+    }
 }
 
 /************************************************* REMOTE_DELETE_BREAKPOINT */
@@ -942,49 +1039,55 @@ mm_remove_breakpoint (addr, contents_cache)
      char *contents_cache;
 {
   out_msg_buf->bkpt_rm_msg.code = BKPT_RM;
-  out_msg_buf->bkpt_rm_msg.length = 4*3;
+  out_msg_buf->bkpt_rm_msg.length = 4 * 3;
   out_msg_buf->bkpt_rm_msg.memory_space = I_MEM;
   out_msg_buf->bkpt_rm_msg.bkpt_addr = (ADDR32) addr;
-  msg_send_serial( out_msg_buf);
-  if (expect_msg(BKPT_RM_ACK,in_msg_buf,1)) {
-       return 0;               /* Success */
-  } else {
-       return 1;               /* Failure */
-  }
+  msg_send_serial (out_msg_buf);
+  if (expect_msg (BKPT_RM_ACK, in_msg_buf, 1))
+    {
+      return 0;                        /* Success */
+    }
+  else
+    {
+      return 1;                        /* Failure */
+    }
 }
 
 
 /******************************************************* REMOTE_KILL */
 static void
-mm_kill(arg,from_tty)
-char    *arg;
-int     from_tty;
+mm_kill (arg, from_tty)
+     char *arg;
+     int from_tty;
 {
-       char    buf[4];
+  char buf[4];
 
 #if defined(KERNEL_DEBUGGING)
-       /* We don't ever kill the kernel */
-       if (from_tty) {
-               printf("Kernel not killed, but left in current state.\n");
-               printf("Use detach to leave kernel running.\n");
-       }
+  /* We don't ever kill the kernel */
+  if (from_tty)
+    {
+      printf ("Kernel not killed, but left in current state.\n");
+      printf ("Use detach to leave kernel running.\n");
+    }
 #else
-       out_msg_buf->break_msg.code = BREAK;
-       out_msg_buf->bkpt_set_msg.length = 4*0;
-       expect_msg(HALT,in_msg_buf,from_tty);
-       if (from_tty) {
-               printf("Target has been stopped.");
-               printf("Would you like to do a hardware reset (y/n) [n] ");
-               fgets(buf,3,stdin);     
-               if (buf[0] == 'y') {
-                       out_msg_buf->reset_msg.code = RESET;
-                       out_msg_buf->bkpt_set_msg.length = 4*0;
-                       expect_msg(RESET_ACK,in_msg_buf,from_tty);
-                       printf("Target has been reset.");
-               }
+  out_msg_buf->break_msg.code = BREAK;
+  out_msg_buf->bkpt_set_msg.length = 4 * 0;
+  expect_msg (HALT, in_msg_buf, from_tty);
+  if (from_tty)
+    {
+      printf ("Target has been stopped.");
+      printf ("Would you like to do a hardware reset (y/n) [n] ");
+      fgets (buf, 3, stdin);
+      if (buf[0] == 'y')
+       {
+         out_msg_buf->reset_msg.code = RESET;
+         out_msg_buf->bkpt_set_msg.length = 4 * 0;
+         expect_msg (RESET_ACK, in_msg_buf, from_tty);
+         printf ("Target has been reset.");
        }
-       pop_target();
-#endif 
+    }
+  pop_target ();
+#endif
 }
 
 
@@ -994,14 +1097,14 @@ int     from_tty;
  * Load a program into the target.
  */
 static void
-mm_load(arg_string,from_tty)
-char   *arg_string;
-int    from_tty;
+mm_load (arg_string, from_tty)
+     char *arg_string;
+     int from_tty;
 {
   dont_repeat ();
 
 #if defined(KERNEL_DEBUGGING)
-  printf("The kernel had better be loaded already!  Loading not done.\n");
+  printf ("The kernel had better be loaded already!  Loading not done.\n");
 #else
   if (arg_string == 0)
     error ("The load command takes a file name");
@@ -1010,7 +1113,7 @@ int       from_tty;
   make_cleanup (free, arg_string);
   QUIT;
   immediate_quit++;
-  error("File loading is not yet supported for MiniMon.");
+  error ("File loading is not yet supported for MiniMon.");
   /* FIXME, code to load your file here... */
   /* You may need to do an init_target_mm() */
   /* init_target_mm(?,?,?,?,?,?,?,?); */
@@ -1029,63 +1132,73 @@ mm_write_inferior_memory (memaddr, myaddr, len)
      char *myaddr;
      int len;
 {
-  int i,nwritten;
-
-  out_msg_buf->write_req_msg.code= WRITE_REQ;
-  out_msg_buf->write_req_msg.memory_space = mm_memory_space(memaddr);  
-
-  nwritten=0;
-  while (nwritten < len) {
-       int num_to_write = len - nwritten;
-       if (num_to_write > MAXDATA) num_to_write = MAXDATA;
-       for (i=0 ; i < num_to_write ; i++)
-               out_msg_buf->write_req_msg.data[i] = myaddr[i+nwritten];
-       out_msg_buf->write_req_msg.byte_count = num_to_write;
-       out_msg_buf->write_req_msg.length = 3*4 + num_to_write; 
-       out_msg_buf->write_req_msg.address = memaddr + nwritten;
-       msg_send_serial(out_msg_buf);
-
-       if (expect_msg(WRITE_ACK,in_msg_buf,1)) {
-               nwritten += in_msg_buf->write_ack_msg.byte_count;
-       } else {
-               break;  
-       }
-  }
-  return(nwritten);
+  int i, nwritten;
+
+  out_msg_buf->write_req_msg.code = WRITE_REQ;
+  out_msg_buf->write_req_msg.memory_space = mm_memory_space (memaddr);
+
+  nwritten = 0;
+  while (nwritten < len)
+    {
+      int num_to_write = len - nwritten;
+      if (num_to_write > MAXDATA)
+       num_to_write = MAXDATA;
+      for (i = 0; i < num_to_write; i++)
+       out_msg_buf->write_req_msg.data[i] = myaddr[i + nwritten];
+      out_msg_buf->write_req_msg.byte_count = num_to_write;
+      out_msg_buf->write_req_msg.length = 3 * 4 + num_to_write;
+      out_msg_buf->write_req_msg.address = memaddr + nwritten;
+      msg_send_serial (out_msg_buf);
+
+      if (expect_msg (WRITE_ACK, in_msg_buf, 1))
+       {
+         nwritten += in_msg_buf->write_ack_msg.byte_count;
+       }
+      else
+       {
+         break;
+       }
+    }
+  return (nwritten);
 }
 
 /************************************************* REMOTE_READ_INFERIOR_MEMORY
 ** Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns number of bytes read.  */
 static int
-mm_read_inferior_memory(memaddr, myaddr, len)
+mm_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
 {
-  int i,nread;
-
-  out_msg_buf->read_req_msg.code= READ_REQ;
-  out_msg_buf->read_req_msg.memory_space = mm_memory_space(memaddr);
-
-  nread=0;
-  while (nread < len) {
-       int num_to_read = (len - nread);
-       if (num_to_read > MAXDATA) num_to_read = MAXDATA;
-       out_msg_buf->read_req_msg.byte_count = num_to_read; 
-       out_msg_buf->read_req_msg.length = 3*4 + num_to_read; 
-       out_msg_buf->read_req_msg.address = memaddr + nread;
-       msg_send_serial(out_msg_buf);
-
-       if (expect_msg(READ_ACK,in_msg_buf,1)) {
-               for (i=0 ; i<in_msg_buf->read_ack_msg.byte_count ; i++)
-                       myaddr[i+nread] = in_msg_buf->read_ack_msg.data[i];
-               nread += in_msg_buf->read_ack_msg.byte_count;
-       } else {
-               break;  
-       }
-  }
-  return(nread);
+  int i, nread;
+
+  out_msg_buf->read_req_msg.code = READ_REQ;
+  out_msg_buf->read_req_msg.memory_space = mm_memory_space (memaddr);
+
+  nread = 0;
+  while (nread < len)
+    {
+      int num_to_read = (len - nread);
+      if (num_to_read > MAXDATA)
+       num_to_read = MAXDATA;
+      out_msg_buf->read_req_msg.byte_count = num_to_read;
+      out_msg_buf->read_req_msg.length = 3 * 4 + num_to_read;
+      out_msg_buf->read_req_msg.address = memaddr + nread;
+      msg_send_serial (out_msg_buf);
+
+      if (expect_msg (READ_ACK, in_msg_buf, 1))
+       {
+         for (i = 0; i < in_msg_buf->read_ack_msg.byte_count; i++)
+           myaddr[i + nread] = in_msg_buf->read_ack_msg.data[i];
+         nread += in_msg_buf->read_ack_msg.byte_count;
+       }
+      else
+       {
+         break;
+       }
+    }
+  return (nread);
 }
 
 /* FIXME!  Merge these two.  */
@@ -1097,7 +1210,7 @@ mm_xfer_inferior_memory (memaddr, myaddr, len, write)
      int write;
 {
 
-  memaddr = translate_addr(memaddr);
+  memaddr = translate_addr (memaddr);
 
   if (write)
     return mm_write_inferior_memory (memaddr, myaddr, len);
@@ -1119,27 +1232,30 @@ mm_xfer_inferior_memory (memaddr, myaddr, len, write)
 */
 
 int
-msg_send_serial(msg_ptr)
-   union  msg_t  *msg_ptr;
+msg_send_serial (msg_ptr)
+     union msg_t *msg_ptr;
 {
-   INT32  message_size;
-   int    byte_count;
-   int    result;
-   char   c;
-
-   /* Send message header */
-   byte_count = 0;
-   message_size = msg_ptr->generic_msg.length + (2 * sizeof(INT32));
-   do {
-      c = *((char *)msg_ptr+byte_count);
-      result = write(mm_desc, &c, 1);
-      if (result == 1) {
-         byte_count = byte_count + 1;
-      }
-   } while ((byte_count < message_size) );
-
-   return(0);
-}  /* end msg_send_serial() */
+  INT32 message_size;
+  int byte_count;
+  int result;
+  char c;
+
+  /* Send message header */
+  byte_count = 0;
+  message_size = msg_ptr->generic_msg.length + (2 * sizeof (INT32));
+  do
+    {
+      c = *((char *) msg_ptr + byte_count);
+      result = write (mm_desc, &c, 1);
+      if (result == 1)
+       {
+         byte_count = byte_count + 1;
+       }
+    }
+  while ((byte_count < message_size));
+
+  return (0);
+}                              /* end msg_send_serial() */
 
 /********************************************************** MSG_RECV_SERIAL
 ** This function is used to receive a message over a
@@ -1153,59 +1269,67 @@ msg_send_serial(msg_ptr)
 */
 
 int
-msg_recv_serial(msg_ptr)
-union  msg_t  *msg_ptr;
+msg_recv_serial (msg_ptr)
+     union msg_t *msg_ptr;
 {
-   static INT32  length=0;
-   static INT32  byte_count=0;
-   int    result;
-   char   c;
-  if(msg_ptr == 0)             /* re-sync request */
-  {  length=0;
-     byte_count=0;
+  static INT32 length = 0;
+  static INT32 byte_count = 0;
+  int result;
+  char c;
+  if (msg_ptr == 0)            /* re-sync request */
+    {
+      length = 0;
+      byte_count = 0;
 #ifdef HAVE_TERMIO
-     /* The timeout here is the prevailing timeout set with VTIME */
-     ->"timeout==0 semantics not supported"
-     read(mm_desc, in_buf, BUFER_SIZE);
+      /* The timeout here is the prevailing timeout set with VTIME */
+      ->"timeout==0 semantics not supported"
+       read (mm_desc, in_buf, BUFER_SIZE);
 #else
-     alarm (1);
-     read(mm_desc, in_buf, BUFER_SIZE);
-     alarm (0);
+      alarm (1);
+      read (mm_desc, in_buf, BUFER_SIZE);
+      alarm (0);
 #endif
-     return(0);
-  }
-   /* Receive message */
+      return (0);
+    }
+  /* Receive message */
 #ifdef HAVE_TERMIO
 /* Timeout==0, help support the mm_wait() routine */
-   ->"timeout==0 semantics not supported (and its nice if they are)"
-   result = read(mm_desc, &c, 1);
+  ->"timeout==0 semantics not supported (and its nice if they are)"
+    result = read (mm_desc, &c, 1);
 #else
-  alarm(timeout);
-  result = read(mm_desc, &c, 1);
+  alarm (timeout);
+  result = read (mm_desc, &c, 1);
   alarm (0);
 #endif
-  if ( result < 0) {
-      if (errno == EINTR) {
-       error ("Timeout reading from remote system.");
-      } else
+  if (result < 0)
+    {
+      if (errno == EINTR)
+       {
+         error ("Timeout reading from remote system.");
+       }
+      else
        perror_with_name ("remote");
-  } else if (result == 1) {
-      *((char *)msg_ptr+byte_count) = c;
+    }
+  else if (result == 1)
+    {
+      *((char *) msg_ptr + byte_count) = c;
       byte_count = byte_count + 1;
-  }
+    }
 
-   /* Message header received.  Save message length. */
-  if (byte_count == (2 * sizeof(INT32)))
-      length = msg_ptr->generic_msg.length;
+  /* Message header received.  Save message length. */
+  if (byte_count == (2 * sizeof (INT32)))
+    length = msg_ptr->generic_msg.length;
 
-  if (byte_count >= (length + (2 * sizeof(INT32)))) {
+  if (byte_count >= (length + (2 * sizeof (INT32))))
+    {
       /* Message received */
       byte_count = 0;
-      return(0);
-  } else
-      return (-1);
+      return (0);
+    }
+  else
+    return (-1);
 
-}  /* end msg_recv_serial() */
+}                              /* end msg_recv_serial() */
 
 /********************************************************************* KBD_RAW
 ** This function is used to put the keyboard in "raw"
@@ -1215,53 +1339,54 @@ union  msg_t  *msg_ptr;
 TERMINAL kbd_tbuf;
 
 int
-kbd_raw() {
-   int    result;
-   TERMINAL tbuf;
+kbd_raw ()
+{
+  int result;
+  TERMINAL tbuf;
 
-   /* Get keyboard termio (to save to restore original modes) */
+  /* Get keyboard termio (to save to restore original modes) */
 #ifdef HAVE_TERMIO
-   result = ioctl(0, TCGETA, &kbd_tbuf);
+  result = ioctl (0, TCGETA, &kbd_tbuf);
 #else
-   result = ioctl(0, TIOCGETP, &kbd_tbuf);
+  result = ioctl (0, TIOCGETP, &kbd_tbuf);
 #endif
-   if (result == -1)
-      return (errno);
+  if (result == -1)
+    return (errno);
 
-   /* Get keyboard TERMINAL (for modification) */
+  /* Get keyboard TERMINAL (for modification) */
 #ifdef HAVE_TERMIO
-   result = ioctl(0, TCGETA, &tbuf);
+  result = ioctl (0, TCGETA, &tbuf);
 #else
-   result = ioctl(0, TIOCGETP, &tbuf);
+  result = ioctl (0, TIOCGETP, &tbuf);
 #endif
-   if (result == -1)
-      return (errno);
+  if (result == -1)
+    return (errno);
 
-   /* Set up new parameters */
+  /* Set up new parameters */
 #ifdef HAVE_TERMIO
-   tbuf.c_iflag = tbuf.c_iflag &
-      ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT);
-   tbuf.c_lflag = tbuf.c_lflag & ~(ICANON | ISIG | ECHO);
-   tbuf.c_cc[4] = 0;  /* MIN */
-   tbuf.c_cc[5] = 0;  /* TIME */
+  tbuf.c_iflag = tbuf.c_iflag &
+    ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT);
+  tbuf.c_lflag = tbuf.c_lflag & ~(ICANON | ISIG | ECHO);
+  tbuf.c_cc[4] = 0;            /* MIN */
+  tbuf.c_cc[5] = 0;            /* TIME */
 #else
-   /* FIXME: not sure if this is correct (matches HAVE_TERMIO). */
-   tbuf.sg_flags |= RAW;
-   tbuf.sg_flags |= ANYP;
-   tbuf.sg_flags &= ~ECHO;
+  /* FIXME: not sure if this is correct (matches HAVE_TERMIO). */
+  tbuf.sg_flags |= RAW;
+  tbuf.sg_flags |= ANYP;
+  tbuf.sg_flags &= ~ECHO;
 #endif
 
-   /* Set keyboard termio to new mode (RAW) */
+  /* Set keyboard termio to new mode (RAW) */
 #ifdef HAVE_TERMIO
-   result = ioctl(0, TCSETAF, &tbuf);
+  result = ioctl (0, TCSETAF, &tbuf);
 #else
-   result = ioctl(0, TIOCSETP, &tbuf);
-#endif 
-   if (result == -1)
-      return (errno);
+  result = ioctl (0, TIOCSETP, &tbuf);
+#endif
+  if (result == -1)
+    return (errno);
 
-   return (0);
-}  /* end kbd_raw() */
+  return (0);
+}                              /* end kbd_raw() */
 
 
 
@@ -1273,24 +1398,25 @@ kbd_raw() {
 */
 
 int
-kbd_restore() {
-   int result;
+kbd_restore ()
+{
+  int result;
 
-   /* Set keyboard termio to original mode */
+  /* Set keyboard termio to original mode */
 #ifdef HAVE_TERMIO
-   result = ioctl(0, TCSETAF, &kbd_tbuf);
+  result = ioctl (0, TCSETAF, &kbd_tbuf);
 #else
-   result = ioctl(0, TIOCGETP, &kbd_tbuf);
+  result = ioctl (0, TIOCGETP, &kbd_tbuf);
 #endif
 
-   if (result == -1)
-      return (errno);
+  if (result == -1)
+    return (errno);
 
-   return(0);
-}  /* end kbd_cooked() */
+  return (0);
+}                              /* end kbd_cooked() */
 
 
-/*****************************************************************************/ 
+/*****************************************************************************/
 /* Fetch a single register indicatated by 'regno'. 
  * Returns 0/-1 on success/failure.  
  */
@@ -1298,50 +1424,59 @@ static int
 fetch_register (regno)
      int regno;
 {
-     int  result;
-  out_msg_buf->read_req_msg.code= READ_REQ;
-  out_msg_buf->read_req_msg.length = 4*3;
+  int result;
+  out_msg_buf->read_req_msg.code = READ_REQ;
+  out_msg_buf->read_req_msg.length = 4 * 3;
   out_msg_buf->read_req_msg.byte_count = 4;
 
   if (regno == GR1_REGNUM)
-  { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->read_req_msg.address = 1;
-  }
+    {
+      out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->read_req_msg.address = 1;
+    }
   else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
-  { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->read_req_msg.address = (regno - GR96_REGNUM) + 96;
-  }
+    {
+      out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->read_req_msg.address = (regno - GR96_REGNUM) + 96;
+    }
 #if defined(GR64_REGNUM)
-  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
-  { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->read_req_msg.address = (regno - GR64_REGNUM) + 64;
-  }
-#endif /* GR64_REGNUM */
+  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32)
+    {
+      out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->read_req_msg.address = (regno - GR64_REGNUM) + 64;
+    }
+#endif /* GR64_REGNUM */
   else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
-  { out_msg_buf->read_req_msg.memory_space = LOCAL_REG;
-    out_msg_buf->read_req_msg.address = (regno - LR0_REGNUM);
-  }
-  else if (regno>=FPE_REGNUM && regno<=EXO_REGNUM)  
-  { int val = -1;
-    supply_register(160 + (regno - FPE_REGNUM),&val);
-    return 0;          /* Pretend Success */
-  }
-  else 
-  { out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
-    out_msg_buf->read_req_msg.address = regnum_to_srnum(regno); 
-  } 
-
-  msg_send_serial(out_msg_buf);
-
-  if (expect_msg(READ_ACK,in_msg_buf,1)) {
-       supply_register (regno, &(in_msg_buf->read_r_ack_msg.data[0]));
-       result = 0;
-  } else {
-       result = -1;
-  }
+    {
+      out_msg_buf->read_req_msg.memory_space = LOCAL_REG;
+      out_msg_buf->read_req_msg.address = (regno - LR0_REGNUM);
+    }
+  else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM)
+    {
+      int val = -1;
+      supply_register (160 + (regno - FPE_REGNUM), &val);
+      return 0;                        /* Pretend Success */
+    }
+  else
+    {
+      out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
+      out_msg_buf->read_req_msg.address = regnum_to_srnum (regno);
+    }
+
+  msg_send_serial (out_msg_buf);
+
+  if (expect_msg (READ_ACK, in_msg_buf, 1))
+    {
+      supply_register (regno, &(in_msg_buf->read_r_ack_msg.data[0]));
+      result = 0;
+    }
+  else
+    {
+      result = -1;
+    }
   return result;
 }
-/*****************************************************************************/ 
+/*****************************************************************************/
 /* Store a single register indicated by 'regno'. 
  * Returns 0/-1 on success/failure.  
  */
@@ -1349,54 +1484,63 @@ static int
 store_register (regno)
      int regno;
 {
-     int  result;
+  int result;
 
-  out_msg_buf->write_req_msg.code= WRITE_REQ;
-  out_msg_buf->write_req_msg.length = 4*4;
+  out_msg_buf->write_req_msg.code = WRITE_REQ;
+  out_msg_buf->write_req_msg.length = 4 * 4;
   out_msg_buf->write_req_msg.byte_count = 4;
   out_msg_buf->write_r_msg.data[0] = read_register (regno);
 
   if (regno == GR1_REGNUM)
-  { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->write_req_msg.address = 1;
-    /* Setting GR1 changes the numbers of all the locals, so invalidate the 
-     * register cache.  Do this *after* calling read_register, because we want 
-     * read_register to return the value that write_register has just stuffed 
-     * into the registers array, not the value of the register fetched from 
-     * the inferior.  
-     */
-    registers_changed ();
-  }
+    {
+      out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->write_req_msg.address = 1;
+      /* Setting GR1 changes the numbers of all the locals, so invalidate the 
+       * register cache.  Do this *after* calling read_register, because we want 
+       * read_register to return the value that write_register has just stuffed 
+       * into the registers array, not the value of the register fetched from 
+       * the inferior.  
+       */
+      registers_changed ();
+    }
 #if defined(GR64_REGNUM)
-  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
-  { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->write_req_msg.address = (regno - GR64_REGNUM) + 64;
-  }
-#endif /* GR64_REGNUM */
+  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32)
+    {
+      out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->write_req_msg.address = (regno - GR64_REGNUM) + 64;
+    }
+#endif /* GR64_REGNUM */
   else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
-  { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
-    out_msg_buf->write_req_msg.address = (regno - GR96_REGNUM) + 96;
-  }
+    {
+      out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
+      out_msg_buf->write_req_msg.address = (regno - GR96_REGNUM) + 96;
+    }
   else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
-  { out_msg_buf->write_req_msg.memory_space = LOCAL_REG;
-    out_msg_buf->write_req_msg.address = (regno - LR0_REGNUM);
-  }
-  else if (regno>=FPE_REGNUM && regno<=EXO_REGNUM)  
-  { 
-    return 0;          /* Pretend Success */
-  }
-  else         /* An unprotected or protected special register */
-  { out_msg_buf->write_req_msg.memory_space = SPECIAL_REG;
-    out_msg_buf->write_req_msg.address = regnum_to_srnum(regno); 
-  } 
+    {
+      out_msg_buf->write_req_msg.memory_space = LOCAL_REG;
+      out_msg_buf->write_req_msg.address = (regno - LR0_REGNUM);
+    }
+  else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM)
+    {
+      return 0;                        /* Pretend Success */
+    }
+  else
+    /* An unprotected or protected special register */
+    {
+      out_msg_buf->write_req_msg.memory_space = SPECIAL_REG;
+      out_msg_buf->write_req_msg.address = regnum_to_srnum (regno);
+    }
 
-  msg_send_serial(out_msg_buf);
+  msg_send_serial (out_msg_buf);
 
-  if (expect_msg(WRITE_ACK,in_msg_buf,1)) {
-       result = 0;
-  } else {
-       result = -1;
-  }
+  if (expect_msg (WRITE_ACK, in_msg_buf, 1))
+    {
+      result = 0;
+    }
+  else
+    {
+      result = -1;
+    }
   return result;
 }
 /****************************************************************************/
@@ -1404,63 +1548,91 @@ store_register (regno)
  * Convert a gdb special register number to a 29000 special register number.
  */
 static int
-regnum_to_srnum(regno)
-int    regno;
+regnum_to_srnum (regno)
+     int regno;
 {
-       switch(regno) {
-               case VAB_REGNUM: return(0); 
-               case OPS_REGNUM: return(1); 
-               case CPS_REGNUM: return(2); 
-               case CFG_REGNUM: return(3); 
-               case CHA_REGNUM: return(4); 
-               case CHD_REGNUM: return(5); 
-               case CHC_REGNUM: return(6); 
-               case RBP_REGNUM: return(7); 
-               case TMC_REGNUM: return(8); 
-               case TMR_REGNUM: return(9); 
-               case NPC_REGNUM: return(USE_SHADOW_PC ? (20) : (10));
-               case PC_REGNUM:  return(USE_SHADOW_PC ? (21) : (11));
-               case PC2_REGNUM: return(USE_SHADOW_PC ? (22) : (12));
-               case MMU_REGNUM: return(13); 
-               case LRU_REGNUM: return(14); 
-               case IPC_REGNUM: return(128); 
-               case IPA_REGNUM: return(129); 
-               case IPB_REGNUM: return(130); 
-               case Q_REGNUM:   return(131); 
-               case ALU_REGNUM: return(132); 
-               case BP_REGNUM:  return(133); 
-               case FC_REGNUM:  return(134); 
-               case CR_REGNUM:  return(135); 
-               case FPE_REGNUM: return(160); 
-               case INTE_REGNUM: return(161); 
-               case FPS_REGNUM: return(162); 
-               case EXO_REGNUM:return(164); 
-               default:
-                       return(255);    /* Failure ? */
-       }
+  switch (regno)
+    {
+    case VAB_REGNUM:
+      return (0);
+    case OPS_REGNUM:
+      return (1);
+    case CPS_REGNUM:
+      return (2);
+    case CFG_REGNUM:
+      return (3);
+    case CHA_REGNUM:
+      return (4);
+    case CHD_REGNUM:
+      return (5);
+    case CHC_REGNUM:
+      return (6);
+    case RBP_REGNUM:
+      return (7);
+    case TMC_REGNUM:
+      return (8);
+    case TMR_REGNUM:
+      return (9);
+    case NPC_REGNUM:
+      return (USE_SHADOW_PC ? (20) : (10));
+    case PC_REGNUM:
+      return (USE_SHADOW_PC ? (21) : (11));
+    case PC2_REGNUM:
+      return (USE_SHADOW_PC ? (22) : (12));
+    case MMU_REGNUM:
+      return (13);
+    case LRU_REGNUM:
+      return (14);
+    case IPC_REGNUM:
+      return (128);
+    case IPA_REGNUM:
+      return (129);
+    case IPB_REGNUM:
+      return (130);
+    case Q_REGNUM:
+      return (131);
+    case ALU_REGNUM:
+      return (132);
+    case BP_REGNUM:
+      return (133);
+    case FC_REGNUM:
+      return (134);
+    case CR_REGNUM:
+      return (135);
+    case FPE_REGNUM:
+      return (160);
+    case INTE_REGNUM:
+      return (161);
+    case FPS_REGNUM:
+      return (162);
+    case EXO_REGNUM:
+      return (164);
+    default:
+      return (255);            /* Failure ? */
+    }
 }
 /****************************************************************************/
 /* 
  * Initialize the target debugger (minimon only).
  */
 static void
-init_target_mm(tstart,tend,dstart,dend,entry,ms_size,rs_size,arg_start)
-ADDR32 tstart,tend,dstart,dend,entry;
-INT32  ms_size,rs_size;
-ADDR32 arg_start;
+init_target_mm (tstart, tend, dstart, dend, entry, ms_size, rs_size, arg_start)
+     ADDR32 tstart, tend, dstart, dend, entry;
+     INT32 ms_size, rs_size;
+     ADDR32 arg_start;
 {
-       out_msg_buf->init_msg.code = INIT;
-       out_msg_buf->init_msg.length= sizeof(struct init_msg_t)-2*sizeof(INT32);
-       out_msg_buf->init_msg.text_start = tstart;
-       out_msg_buf->init_msg.text_end = tend;
-       out_msg_buf->init_msg.data_start = dstart;
-       out_msg_buf->init_msg.data_end = dend;
-       out_msg_buf->init_msg.entry_point = entry;
-       out_msg_buf->init_msg.mem_stack_size = ms_size;
-       out_msg_buf->init_msg.reg_stack_size = rs_size;
-       out_msg_buf->init_msg.arg_start = arg_start;
-       msg_send_serial(out_msg_buf);
-       expect_msg(INIT_ACK,in_msg_buf,1);
+  out_msg_buf->init_msg.code = INIT;
+  out_msg_buf->init_msg.length = sizeof (struct init_msg_t) - 2 * sizeof (INT32);
+  out_msg_buf->init_msg.text_start = tstart;
+  out_msg_buf->init_msg.text_end = tend;
+  out_msg_buf->init_msg.data_start = dstart;
+  out_msg_buf->init_msg.data_end = dend;
+  out_msg_buf->init_msg.entry_point = entry;
+  out_msg_buf->init_msg.mem_stack_size = ms_size;
+  out_msg_buf->init_msg.reg_stack_size = rs_size;
+  out_msg_buf->init_msg.arg_start = arg_start;
+  msg_send_serial (out_msg_buf);
+  expect_msg (INIT_ACK, in_msg_buf, 1);
 }
 /****************************************************************************/
 /* 
@@ -1468,62 +1640,105 @@ ADDR32 arg_start;
  * Not all messages are represented here, only the ones that we expect
  * to be called with.
  */
-static char*
-msg_str(code)
-INT32  code;
+static char *
+msg_str (code)
+     INT32 code;
 {
-       static char cbuf[32];
-
-       switch (code) {
-       case BKPT_SET_ACK: sprintf(cbuf,"%s (%d)","BKPT_SET_ACK",code); break; 
-       case BKPT_RM_ACK: sprintf(cbuf,"%s (%d)","BKPT_RM_ACK",code); break; 
-       case INIT_ACK:    sprintf(cbuf,"%s (%d)","INIT_ACK",code); break; 
-       case READ_ACK:    sprintf(cbuf,"%s (%d)","READ_ACK",code); break; 
-       case WRITE_ACK:   sprintf(cbuf,"%s (%d)","WRITE_ACK",code); break; 
-       case ERROR:       sprintf(cbuf,"%s (%d)","ERROR",code); break; 
-       case HALT:      sprintf(cbuf,"%s (%d)","HALT",code); break; 
-       default:        sprintf(cbuf,"UNKNOWN (%d)",code); break; 
-       }
-       return(cbuf);
+  static char cbuf[32];
+
+  switch (code)
+    {
+    case BKPT_SET_ACK:
+      sprintf (cbuf, "%s (%d)", "BKPT_SET_ACK", code);
+      break;
+    case BKPT_RM_ACK:
+      sprintf (cbuf, "%s (%d)", "BKPT_RM_ACK", code);
+      break;
+    case INIT_ACK:
+      sprintf (cbuf, "%s (%d)", "INIT_ACK", code);
+      break;
+    case READ_ACK:
+      sprintf (cbuf, "%s (%d)", "READ_ACK", code);
+      break;
+    case WRITE_ACK:
+      sprintf (cbuf, "%s (%d)", "WRITE_ACK", code);
+      break;
+    case ERROR:
+      sprintf (cbuf, "%s (%d)", "ERROR", code);
+      break;
+    case HALT:
+      sprintf (cbuf, "%s (%d)", "HALT", code);
+      break;
+    default:
+      sprintf (cbuf, "UNKNOWN (%d)", code);
+      break;
+    }
+  return (cbuf);
 }
 /****************************************************************************/
 /*
  * Selected (not all of them) error codes that we might get.
  */
-static char
-error_msg_str(code)
-INT32  code;
+static char *
+error_msg_str (code)
+     INT32 code;
 {
-       static char cbuf[50];
-
-       switch (code) {
-       case EMFAIL:    return("EMFAIL: unrecoverable error"); 
-       case EMBADADDR: return("EMBADADDR: Illegal address"); 
-       case EMBADREG:  return("EMBADREG: Illegal register "); 
-       case EMACCESS:  return("EMACCESS: Could not access memory");
-       case EMBADMSG:  return("EMBADMSG: Unknown message type"); 
-       case EMMSG2BIG: return("EMMSG2BIG: Message to large"); 
-       case EMNOSEND:  return("EMNOSEND: Could not send message"); 
-       case EMNORECV:  return("EMNORECV: Could not recv message"); 
-       case EMRESET:   return("EMRESET: Could not RESET target"); 
-       case EMCONFIG:  return("EMCONFIG: Could not get target CONFIG"); 
-       case EMSTATUS:  return("EMSTATUS: Could not get target STATUS"); 
-       case EMREAD:    return("EMREAD: Could not READ target memory"); 
-       case EMWRITE:   return("EMWRITE: Could not WRITE target memory"); 
-       case EMBKPTSET: return("EMBKPTSET: Could not set breakpoint"); 
-       case EMBKPTRM:  return("EMBKPTRM: Could not remove breakpoint"); 
-       case EMBKPTSTAT:return("EMBKPTSTAT: Could not get breakpoint status"); 
-       case EMBKPTNONE:return("EMBKPTNONE: All breakpoints in use"); 
-       case EMBKPTUSED:return("EMBKPTUSED: Breakpoints already in use"); 
-       case EMINIT:    return("EMINIT: Could not init target memory"); 
-       case EMGO:      return("EMGO: Could not start execution"); 
-       case EMSTEP:    return("EMSTEP: Could not single step"); 
-       case EMBREAK:   return("EMBREAK: Could not BREAK"); 
-       case EMCOMMERR: return("EMCOMMERR: Communication error"); 
-       default:        sprintf(cbuf,"error number %d",code); break;
-       } /* end switch */
-
-       return (cbuf);
+  static char cbuf[50];
+
+  switch (code)
+    {
+    case EMFAIL:
+      return ("EMFAIL: unrecoverable error");
+    case EMBADADDR:
+      return ("EMBADADDR: Illegal address");
+    case EMBADREG:
+      return ("EMBADREG: Illegal register ");
+    case EMACCESS:
+      return ("EMACCESS: Could not access memory");
+    case EMBADMSG:
+      return ("EMBADMSG: Unknown message type");
+    case EMMSG2BIG:
+      return ("EMMSG2BIG: Message to large");
+    case EMNOSEND:
+      return ("EMNOSEND: Could not send message");
+    case EMNORECV:
+      return ("EMNORECV: Could not recv message");
+    case EMRESET:
+      return ("EMRESET: Could not RESET target");
+    case EMCONFIG:
+      return ("EMCONFIG: Could not get target CONFIG");
+    case EMSTATUS:
+      return ("EMSTATUS: Could not get target STATUS");
+    case EMREAD:
+      return ("EMREAD: Could not READ target memory");
+    case EMWRITE:
+      return ("EMWRITE: Could not WRITE target memory");
+    case EMBKPTSET:
+      return ("EMBKPTSET: Could not set breakpoint");
+    case EMBKPTRM:
+      return ("EMBKPTRM: Could not remove breakpoint");
+    case EMBKPTSTAT:
+      return ("EMBKPTSTAT: Could not get breakpoint status");
+    case EMBKPTNONE:
+      return ("EMBKPTNONE: All breakpoints in use");
+    case EMBKPTUSED:
+      return ("EMBKPTUSED: Breakpoints already in use");
+    case EMINIT:
+      return ("EMINIT: Could not init target memory");
+    case EMGO:
+      return ("EMGO: Could not start execution");
+    case EMSTEP:
+      return ("EMSTEP: Could not single step");
+    case EMBREAK:
+      return ("EMBREAK: Could not BREAK");
+    case EMCOMMERR:
+      return ("EMCOMMERR: Communication error");
+    default:
+      sprintf (cbuf, "error number %d", code);
+      break;
+    }                          /* end switch */
+
+  return (cbuf);
 }
 /****************************************************************************/
 /* 
@@ -1531,30 +1746,33 @@ INT32   code;
  *  Returns 0/1 on failure/success.
  */
 static int
-expect_msg(msgcode,msg_buf,from_tty)
-INT32  msgcode;                /* Msg code we expect */
-union msg_t *msg_buf;          /* Where to put  the message received */
-int    from_tty;               /* Print message on error if non-zero */
+expect_msg (msgcode, msg_buf, from_tty)
+     INT32 msgcode;            /* Msg code we expect */
+     union msg_t *msg_buf;     /* Where to put  the message received */
+     int from_tty;             /* Print message on error if non-zero */
 {
-  int  retries=0;
-  while(msg_recv_serial(msg_buf) && (retries++<MAX_RETRIES)); 
-  if (retries >= MAX_RETRIES) {
-       printf("Expected msg %s, ",msg_str(msgcode));
-       printf("no message received!\n");
-        return(0);             /* Failure */
-  }
+  int retries = 0;
+  while (msg_recv_serial (msg_buf) && (retries++ < MAX_RETRIES));
+  if (retries >= MAX_RETRIES)
+    {
+      printf ("Expected msg %s, ", msg_str (msgcode));
+      printf ("no message received!\n");
+      return (0);              /* Failure */
+    }
 
-  if (msg_buf->generic_msg.code != msgcode) {
-     if (from_tty) {
-       printf("Expected msg %s, ",msg_str(msgcode));
-       printf("got msg %s\n",msg_str(msg_buf->generic_msg.code));
-        if (msg_buf->generic_msg.code == ERROR) 
-               printf("%s\n",error_msg_str(msg_buf->error_msg.error_code));
-     }
-     return(0);                        /* Failure */
-  }
-  return(1);                   /* Success */
-}      
+  if (msg_buf->generic_msg.code != msgcode)
+    {
+      if (from_tty)
+       {
+         printf ("Expected msg %s, ", msg_str (msgcode));
+         printf ("got msg %s\n", msg_str (msg_buf->generic_msg.code));
+         if (msg_buf->generic_msg.code == ERROR)
+           printf ("%s\n", error_msg_str (msg_buf->error_msg.error_code));
+       }
+      return (0);              /* Failure */
+    }
+  return (1);                  /* Success */
+}
 /****************************************************************************/
 /*
  * Determine the MiniMon memory space qualifier based on the addr. 
@@ -1562,65 +1780,71 @@ int     from_tty;               /* Print message on error if non-zero */
  * FIXME: Doesn't know anything about I_CACHE/D_CACHE.
  */
 static int
-mm_memory_space(addr)
-CORE_ADDR      *addr;
+mm_memory_space (addr)
+     CORE_ADDR *addr;
 {
-       ADDR32 tstart = target_config.I_mem_start;
-       ADDR32 tend   = tstart + target_config.I_mem_size;  
-       ADDR32 dstart = target_config.D_mem_start;
-       ADDR32 dend   = tstart + target_config.D_mem_size;  
-       ADDR32 rstart = target_config.ROM_start;
-       ADDR32 rend   = tstart + target_config.ROM_size;  
-
-       if (((ADDR32)addr >= tstart) && ((ADDR32)addr < tend)) { 
-               return I_MEM;
-       } else if (((ADDR32)addr >= dstart) && ((ADDR32)addr < dend)) { 
-               return D_MEM;
-       } else if (((ADDR32)addr >= rstart) && ((ADDR32)addr < rend)) {
-               /* FIXME: how do we determine between D_ROM and I_ROM */
-               return D_ROM;
-       } else  /* FIXME: what do me do now? */
-               return D_MEM;   /* Hmmm! */
+  ADDR32 tstart = target_config.I_mem_start;
+  ADDR32 tend = tstart + target_config.I_mem_size;
+  ADDR32 dstart = target_config.D_mem_start;
+  ADDR32 dend = tstart + target_config.D_mem_size;
+  ADDR32 rstart = target_config.ROM_start;
+  ADDR32 rend = tstart + target_config.ROM_size;
+
+  if (((ADDR32) addr >= tstart) && ((ADDR32) addr < tend))
+    {
+      return I_MEM;
+    }
+  else if (((ADDR32) addr >= dstart) && ((ADDR32) addr < dend))
+    {
+      return D_MEM;
+    }
+  else if (((ADDR32) addr >= rstart) && ((ADDR32) addr < rend))
+    {
+      /* FIXME: how do we determine between D_ROM and I_ROM */
+      return D_ROM;
+    }
+  else                         /* FIXME: what do me do now? */
+    return D_MEM;              /* Hmmm! */
 }
 
 /****************************************************************************/
 /* 
  *  Define the target subroutine names
  */
-struct target_ops mm_ops ;
+struct target_ops mm_ops;
 
-static void 
-init_mm_ops(void)
+static void
+init_mm_ops (void)
 {
-  mm_ops.to_shortname =   "minimon";
-  mm_ops.to_longname =   "Remote AMD/Minimon target";
-  mm_ops.to_doc =   "Remote debug an AMD 290*0 using the MiniMon dbg core on the target";
-  mm_ops.to_open =   mm_open;
-  mm_ops.to_close =   mm_close;
-  mm_ops.to_attach =   mm_attach;
+  mm_ops.to_shortname = "minimon";
+  mm_ops.to_longname = "Remote AMD/Minimon target";
+  mm_ops.to_doc = "Remote debug an AMD 290*0 using the MiniMon dbg core on the target";
+  mm_ops.to_open = mm_open;
+  mm_ops.to_close = mm_close;
+  mm_ops.to_attach = mm_attach;
   mm_ops.to_post_attach = NULL;
   mm_ops.to_require_attach = NULL;
-  mm_ops.to_detach =   mm_detach;
+  mm_ops.to_detach = mm_detach;
   mm_ops.to_require_detach = NULL;
-  mm_ops.to_resume =   mm_resume;
-  mm_ops.to_wait  =   mm_wait;
+  mm_ops.to_resume = mm_resume;
+  mm_ops.to_wait = mm_wait;
   mm_ops.to_post_wait = NULL;
-  mm_ops.to_fetch_registers  =   mm_fetch_registers;
-  mm_ops.to_store_registers  =   mm_store_registers;
-  mm_ops.to_prepare_to_store =   mm_prepare_to_store;
-  mm_ops.to_xfer_memory  =   mm_xfer_inferior_memory;
-  mm_ops.to_files_info  =   mm_files_info;
-  mm_ops.to_insert_breakpoint =   mm_insert_breakpoint;
-  mm_ops.to_remove_breakpoint =   mm_remove_breakpoint;
-  mm_ops.to_terminal_init  =   0;
-  mm_ops.to_terminal_inferior =   0;
-  mm_ops.to_terminal_ours_for_output =   0;
-  mm_ops.to_terminal_ours  =   0;
-  mm_ops.to_terminal_info  =   0;        
-  mm_ops.to_kill  =   mm_kill;           
-  mm_ops.to_load  =   mm_load;
-  mm_ops.to_lookup_symbol =   0;           
-  mm_ops.to_create_inferior =   mm_create_inferior;
+  mm_ops.to_fetch_registers = mm_fetch_registers;
+  mm_ops.to_store_registers = mm_store_registers;
+  mm_ops.to_prepare_to_store = mm_prepare_to_store;
+  mm_ops.to_xfer_memory = mm_xfer_inferior_memory;
+  mm_ops.to_files_info = mm_files_info;
+  mm_ops.to_insert_breakpoint = mm_insert_breakpoint;
+  mm_ops.to_remove_breakpoint = mm_remove_breakpoint;
+  mm_ops.to_terminal_init = 0;
+  mm_ops.to_terminal_inferior = 0;
+  mm_ops.to_terminal_ours_for_output = 0;
+  mm_ops.to_terminal_ours = 0;
+  mm_ops.to_terminal_info = 0;
+  mm_ops.to_kill = mm_kill;
+  mm_ops.to_load = mm_load;
+  mm_ops.to_lookup_symbol = 0;
+  mm_ops.to_create_inferior = mm_create_inferior;
   mm_ops.to_post_startup_inferior = NULL;
   mm_ops.to_acknowledge_created_inferior = NULL;
   mm_ops.to_clone_and_follow_inferior = NULL;
@@ -1632,42 +1856,42 @@ init_mm_ops(void)
   mm_ops.to_has_forked = NULL;
   mm_ops.to_has_vforked = NULL;
   mm_ops.to_can_follow_vfork_prior_to_exec = NULL;
-  mm_ops.to_post_follow_vfork = NULL; 
+  mm_ops.to_post_follow_vfork = NULL;
   mm_ops.to_insert_exec_catchpoint = NULL;
   mm_ops.to_remove_exec_catchpoint = NULL;
   mm_ops.to_has_execd = NULL;
   mm_ops.to_reported_exec_events_per_exec_call = NULL;
   mm_ops.to_has_exited = NULL;
-  mm_ops.to_mourn_inferior =   mm_mourn; 
-  mm_ops.to_can_run  =   0;    
-  mm_ops.to_notice_signals =   0;
-  mm_ops.to_thread_alive  =   0;
-  mm_ops.to_stop  =   0;               
+  mm_ops.to_mourn_inferior = mm_mourn;
+  mm_ops.to_can_run = 0;
+  mm_ops.to_notice_signals = 0;
+  mm_ops.to_thread_alive = 0;
+  mm_ops.to_stop = 0;
   mm_ops.to_pid_to_exec_file = NULL;
   mm_ops.to_core_file_to_sym_file = NULL;
-  mm_ops.to_stratum =   process_stratum;
-  mm_ops.DONT_USE =   0; 
-  mm_ops.to_has_all_memory =   1;
-  mm_ops.to_has_memory =   1;
-  mm_ops.to_has_stack =   1;
-  mm_ops.to_has_registers =   1;
-  mm_ops.to_has_execution =   1; 
-  mm_ops.to_sections =   0;
-  mm_ops.to_sections_end =   0;        
-  mm_ops.to_magic =   OPS_MAGIC;    
+  mm_ops.to_stratum = process_stratum;
+  mm_ops.DONT_USE = 0;
+  mm_ops.to_has_all_memory = 1;
+  mm_ops.to_has_memory = 1;
+  mm_ops.to_has_stack = 1;
+  mm_ops.to_has_registers = 1;
+  mm_ops.to_has_execution = 1;
+  mm_ops.to_sections = 0;
+  mm_ops.to_sections_end = 0;
+  mm_ops.to_magic = OPS_MAGIC;
 };
 
 void
-_initialize_remote_mm()
+_initialize_remote_mm ()
 {
-  init_mm_ops() ;
+  init_mm_ops ();
   add_target (&mm_ops);
 }
 
 #ifdef NO_HIF_SUPPORT
-service_HIF(msg)
-union msg_t    *msg;
+service_HIF (msg)
+     union msg_t *msg;
 {
-       return(0);      /* Emulate a failure */
+  return (0);                  /* Emulate a failure */
 }
 #endif
index 58e89b86859de1721557a7092a7e193191d41551..9a25986773effa8e7bfe46c4df4de55ae4d87f65 100644 (file)
@@ -2,29 +2,29 @@
    Copyright 1990, 1991, 1992, 1993 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!
-*/
+   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.
-*/
+   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.
+ */
 
 /*****************************************************************************
  *
@@ -121,9 +121,9 @@ NINDY ROM monitor at the other end of the line.
 
 static DCACHE *nindy_dcache;
 
-extern int unlink();
-extern char *getenv();
-extern char *mktemp();
+extern int unlink ();
+extern char *getenv ();
+extern char *mktemp ();
 
 extern void generic_mourn_inferior ();
 
@@ -134,12 +134,12 @@ 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 */
+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 DLE    '\020'          /* Character NINDY sends to indicate user program has
+                                  * halted.  */
 #define TRUE   1
 #define FALSE  0
 
@@ -149,7 +149,7 @@ extern serial_t 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();
+extern char *exists ();
 
 static void
 nindy_fetch_registers PARAMS ((int));
@@ -178,8 +178,8 @@ nindy_close (quitting)
    and initial_brk).  */
 void
 nindy_open (name, from_tty)
-    char *name;                /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
-    int from_tty;
+     char *name;               /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
+     int from_tty;
 {
   char baudrate[1024];
 
@@ -191,7 +191,7 @@ nindy_open (name, from_tty)
   nindy_close (0);
 
   have_regs = regs_changed = 0;
-  nindy_dcache = dcache_init(ninMemGet, ninMemPut);
+  nindy_dcache = dcache_init (ninMemGet, ninMemPut);
 
   /* Allow user to interrupt the following -- we could hang if there's
      no NINDY at the other end of the remote tty.  */
@@ -199,9 +199,9 @@ nindy_open (name, from_tty)
   /* 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);
+  sprintf (baudrate, "%d", baud_rate);
+  ninConnect (name, baudrate,
+             nindy_initial_brk, !from_tty, nindy_old_protocol);
   immediate_quit--;
 
   if (nindy_serial == NULL)
@@ -212,7 +212,7 @@ nindy_open (name, from_tty)
   savename = savestring (name, strlen (name));
   push_target (&nindy_ops);
 
-  target_fetch_registers(-1);
+  target_fetch_registers (-1);
 
   init_thread_list ();
   init_wait_for_inferior ();
@@ -236,10 +236,10 @@ static void
 nindy_files_info ()
 {
   /* 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": "");
+  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" : "");
 }
 \f
 /* Return the number of characters in the buffer before
@@ -247,17 +247,19 @@ nindy_files_info ()
 
 static
 int
-non_dle( buf, n )
-    char *buf;         /* Character buffer; NOT '\0'-terminated */
-    int n;             /* Number of characters in buffer */
+non_dle (buf, n)
+     char *buf;                        /* Character buffer; NOT '\0'-terminated */
+     int n;                    /* Number of characters in buffer */
 {
   int i;
 
-  for ( i = 0; i < n; i++ ){
-    if ( buf[i] == DLE ){
-      break;
+  for (i = 0; i < n; i++)
+    {
+      if (buf[i] == DLE)
+       {
+         break;
+       }
     }
-  }
   return i;
 }
 \f
@@ -271,14 +273,14 @@ nindy_resume (pid, step, siggnal)
   if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
     warning ("Can't send signals to remote NINDY targets.");
 
-  dcache_flush(nindy_dcache);
-  if ( regs_changed )
+  dcache_flush (nindy_dcache);
+  if (regs_changed)
     {
       nindy_store_registers (-1);
       regs_changed = 0;
     }
   have_regs = 0;
-  ninGo( step );
+  ninGo (step);
 }
 \f
 /* FIXME, we can probably use the normal terminal_inferior stuff here.
@@ -286,11 +288,12 @@ nindy_resume (pid, step, siggnal)
    settings initially.  Thereafter, terminal_ours and terminal_inferior
    will automatically swap the settings around for us.  */
 
-struct clean_up_tty_args {
+struct clean_up_tty_args
+{
   serial_ttystate state;
   serial_t serial;
 };
-static  struct clean_up_tty_args tty_args;
+static struct clean_up_tty_args tty_args;
 
 static void
 clean_up_tty (ptrarg)
@@ -303,22 +306,22 @@ clean_up_tty (ptrarg)
 }
 
 /* Recover from ^Z or ^C while remote process is running */
-static void (*old_ctrlc)();  
+static void (*old_ctrlc) ();
 #ifdef SIGTSTP
-static void (*old_ctrlz)();
+static void (*old_ctrlz) ();
 #endif
 
 static void
-clean_up_int()
+clean_up_int ()
 {
   SERIAL_SET_TTY_STATE (tty_args.serial, tty_args.state);
   free (tty_args.state);
 
-  signal(SIGINT, old_ctrlc);
+  signal (SIGINT, old_ctrlc);
 #ifdef SIGTSTP
-  signal(SIGTSTP, old_ctrlz);
+  signal (SIGTSTP, old_ctrlz);
 #endif
-  error("\n\nYou may need to reset the 80960 and/or reload your program.\n");
+  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
@@ -329,9 +332,9 @@ clean_up_int()
  */
 
 static int
-nindy_wait( pid, status )
-    int pid;
-    struct target_waitstatus *status;
+nindy_wait (pid, status)
+     int pid;
+     struct target_waitstatus *status;
 {
   fd_set fds;
   int c;
@@ -350,9 +353,9 @@ nindy_wait( pid, status )
   /* 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 );
+  old_ctrlc = signal (SIGINT, clean_up_int);
 #ifdef SIGTSTP
-  old_ctrlz = signal( SIGTSTP, clean_up_int );
+  old_ctrlz = signal (SIGTSTP, clean_up_int);
 #endif
 
   old_cleanups = make_cleanup (clean_up_tty, &tty_args);
@@ -371,36 +374,36 @@ nindy_wait( pid, status )
        {
          error ("Cannot read from serial line");
        }
-      else if (c == 0x1b) /* ESC */
+      else if (c == 0x1b)      /* ESC */
        {
          c = SERIAL_READCHAR (nindy_serial, -1);
          c &= ~0x40;
-       } 
-      else if (c != 0x10) /* DLE */
+       }
+      else if (c != 0x10)      /* DLE */
        /* Write out any characters preceding DLE */
        {
-         buf[0] = (char)c;
+         buf[0] = (char) c;
          write (1, buf, 1);
        }
       else
        {
-         stop_exit = ninStopWhy(&stop_code,
-                                &ip_value, &fp_value, &sp_value);
+         stop_exit = ninStopWhy (&stop_code,
+                                 &ip_value, &fp_value, &sp_value);
          if (!stop_exit && (stop_code == STOP_SRQ))
            {
              immediate_quit++;
-             ninSrq();
+             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);
+             supply_register (IP_REGNUM,
+                              (char *) &ip_value);
+             supply_register (FP_REGNUM,
+                              (char *) &fp_value);
+             supply_register (SP_REGNUM,
+                              (char *) &sp_value);
              break;
            }
        }
@@ -429,59 +432,60 @@ nindy_wait( pid, status )
 /* 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];
+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(regno)
+nindy_fetch_registers (regno)
      int regno;
 {
   struct nindy_regs nindy_regs;
   int regnum;
 
   immediate_quit++;
-  ninRegsGet( (char *) &nindy_regs );
+  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 (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()
+nindy_prepare_to_store ()
 {
   /* Fetch all regs if they aren't already here.  */
   read_register_bytes (0, NULL, REGISTER_BYTES);
 }
 
 static void
-nindy_store_registers(regno)
+nindy_store_registers (regno)
      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);
+  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 );
+  ninRegsPut ((char *) &nindy_regs);
   immediate_quit--;
 }
 
@@ -492,7 +496,7 @@ int
 nindy_fetch_word (addr)
      CORE_ADDR addr;
 {
-       return dcache_fetch (nindy_dcache, addr);
+  return dcache_fetch (nindy_dcache, addr);
 }
 
 /* Write a word WORD into remote address ADDR.
@@ -503,7 +507,7 @@ nindy_store_word (addr, word)
      CORE_ADDR addr;
      int word;
 {
-       dcache_poke (nindy_dcache, addr, word);
+  dcache_poke (nindy_dcache, addr, word);
 }
 
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
@@ -515,19 +519,19 @@ nindy_store_word (addr, word)
    FIXME, rewrite this to not use the word-oriented routines.  */
 
 int
-nindy_xfer_inferior_memory(memaddr, myaddr, len, should_write, target)
+nindy_xfer_inferior_memory (memaddr, myaddr, len, should_write, target)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & - sizeof (int);
+  register CORE_ADDR addr = memaddr & -sizeof (int);
   /* Round ending address up; get number of longwords that makes.  */
   register int count
-    = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+  = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
   /* Allocate buffer of that many longwords.  */
   register int *buffer = (int *) alloca (count * sizeof (int));
 
@@ -535,10 +539,11 @@ nindy_xfer_inferior_memory(memaddr, myaddr, len, should_write, target)
     {
       /* Fill start and end extra bytes of buffer with existing memory data.  */
 
-      if (addr != memaddr || len < (int)sizeof (int)) {
-       /* Need part of initial word -- fetch it.  */
-        buffer[0] = nindy_fetch_word (addr);
-      }
+      if (addr != memaddr || len < (int) sizeof (int))
+       {
+         /* Need part of initial word -- fetch it.  */
+         buffer[0] = nindy_fetch_word (addr);
+       }
 
       if (count > 1)           /* FIXME, avoid if even boundary */
        {
@@ -616,19 +621,19 @@ nindy_create_inferior (execfile, args, env)
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
   /* Let 'er rip... */
-  proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 static void
-reset_command(args, from_tty)
+reset_command (args, from_tty)
      char *args;
      int from_tty;
 {
   if (nindy_serial == NULL)
     {
-      error"No target system to reset -- use 'target nindy' command.");
+      error ("No target system to reset -- use 'target nindy' command.");
     }
-  if ( query("Really reset the target system?",0,0) )
+  if (query ("Really reset the target system?", 0, 0))
     {
       SERIAL_SEND_BREAK (nindy_serial);
       tty_flush (nindy_serial);
@@ -640,7 +645,7 @@ nindy_kill (args, from_tty)
      char *args;
      int from_tty;
 {
-  return;              /* Ignore attempts to kill target system */
+  return;                      /* Ignore attempts to kill target system */
 }
 
 /* Clean up when a program exits.
@@ -667,43 +672,43 @@ nindy_open_stub (arg)
 }
 
 static void
-nindy_load( filename, from_tty )
-    char *filename;
-    int from_tty;
+nindy_load (filename, from_tty)
+     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);
+  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);
-      free(buffer);
+      perror_with_name (filename);
+      return;
     }
-  }
-  bfd_close(file);
+
+  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);
+         free (buffer);
+       }
+    }
+  bfd_close (file);
 }
 
 static int
@@ -728,82 +733,88 @@ nindy_before_main_loop ()
   char ttyname[100];
   char *p, *p2;
 
-  while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */
+  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 );
+      if (instream == stdin)
+       {
+         printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit:  ");
+         gdb_flush (gdb_stdout);
        }
-       fgets( ttyname, sizeof(ttyname)-1, stdin );
+      fgets (ttyname, sizeof (ttyname) - 1, stdin);
 
-       /* Strip leading and trailing whitespace */
-       for ( p = ttyname; isspace(*p); p++ ){
-               ;
+      /* Strip leading and trailing whitespace */
+      for (p = ttyname; isspace (*p); p++)
+       {
+         ;
        }
-       if ( *p == '\0' ){
-               return;         /* User just hit spaces or return, wants out */
+      if (*p == '\0')
+       {
+         return;               /* User just hit spaces or return, wants out */
        }
-       for ( p2= p; !isspace(*p2) && (*p2 != '\0'); p2++ ){
-               ;
+      for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++)
+       {
+         ;
        }
-       *p2= '\0';
-       if ( STREQ("quit",p) ){
-               exit(1);
+      *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);
-             }
-         }
-      }
+      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);
+           }
+       }
+    }
 }
 \f
 /* Define the target subroutine names */
 
-struct target_ops nindy_ops ;
+struct target_ops nindy_ops;
 
-static void 
-init_nindy_ops(void)
+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\
+  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;
+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_detach = nindy_detach;
   nindy_ops.to_require_detach = NULL;
-  nindy_ops.to_resume =   nindy_resume;
-  nindy_ops.to_wait  =   nindy_wait;
+  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_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;
@@ -821,29 +832,29 @@ specified when you started GDB." ;
   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_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_core_file_to_sym_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 */
+  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 ()
 {
-  init_nindy_ops() ;
+  init_nindy_ops ();
   add_target (&nindy_ops);
   add_com ("reset", class_obscure, reset_command,
           "Send a 'break' to the remote target system.\n\
index 4999a68b8e0098528972b0fd98f30976f311398c..ccd2f0de97bd9fbf4785a5013ade11109c635d53 100644 (file)
@@ -1,30 +1,31 @@
 /* Remote debugging with the XLNT Designs, Inc (XDI) NetROM.
    Copyright 1990, 1991, 1992, 1995 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
+   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 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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcmd.h"
@@ -149,11 +150,11 @@ nrom_load (args, fromtty)
     {
       make_cleanup (bfd_close, pbfd);
 
-      if (!bfd_check_format (pbfd, bfd_object)) 
+      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) 
+      for (section = pbfd->sections; section; section = section->next)
        {
          if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC)
            {
@@ -179,7 +180,7 @@ nrom_load (args, fromtty)
                    {
                      char buffer[1024];
                      int count;
-                     
+
                      count = min (section_size, 1024);
 
                      bfd_get_section_contents (pbfd, section, buffer, fptr,
@@ -191,7 +192,8 @@ nrom_load (args, fromtty)
                      section_size -= count;
                    }
                }
-             else                      /* BSS and such */
+             else
+               /* BSS and such */
                {
                  printf_filtered ("[section %s: not loading]\n",
                                   section_name);
@@ -216,7 +218,7 @@ nrom_open (name, from_tty)
 
   if (!name || strchr (name, '/') || strchr (name, ':'))
     error (
-"To open a NetROM connection, you must specify the hostname\n\
+           "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);
@@ -260,48 +262,48 @@ nrom_passthru (args, fromtty)
 }
 
 static void
-nrom_mourn() 
-{ 
+nrom_mourn ()
+{
   unpush_target (&nrom_ops);
   generic_mourn_inferior ();
 }
 
 /* Define the target vector. */
 
-struct target_ops nrom_ops ;
+struct target_ops nrom_ops;
 
-static void 
-init_nrom_ops(void)
+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_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_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;
@@ -313,46 +315,46 @@ init_nrom_ops(void)
   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_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_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_core_file_to_sym_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 ;            
+  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 ()
 {
-  init_nrom_ops() ;
+  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_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_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",
index 2abfa8376831e638678d87662c4c8c9c86475ab9..9bb927ef5018f00cf720bbb1342e75d257cdf43b 100644 (file)
@@ -1,27 +1,28 @@
 /* Remote debugging interface for boot monitors, for GDB.
    Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* 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--
+   "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
@@ -31,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    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.  */
@@ -58,20 +59,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdb-stabs.h"
 
 struct cmd_list_element *showlist;
-extern struct target_ops rombug_ops;           /* Forward declaration */
-extern struct monitor_ops rombug_cmds;         /* Forward declaration */
+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();
+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" */
+static int sr_get_debug ();    /* flag set by "set remotedebug" */
 #endif
-static int hashmark;                           /* flag set by "set hash" */
+static int hashmark;           /* flag set by "set hash" */
 static int rombug_is_open = 0;
 
 /* FIXME: Replace with sr_get_debug ().  */
@@ -83,7 +84,7 @@ 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*/
+/* Descriptor for I/O to remote machine.  Initialize it to NULL */
 static serial_t monitor_desc = NULL;
 
 static CORE_ADDR bufaddr = 0;
@@ -93,9 +94,9 @@ static char readbuf[16];
 /* Send data to monitor.  Works just like printf. */
 static void
 #ifdef ANSI_PROTOTYPES
-printf_monitor(char *pattern, ...)
+printf_monitor (char *pattern,...)
 #else
-printf_monitor(va_alist)
+printf_monitor (va_alist)
      va_dcl
 #endif
 {
@@ -107,31 +108,31 @@ printf_monitor(va_alist)
   va_start (args, pattern);
 #else
   char *pattern;
-  va_start(args);
-  pattern = va_arg(args, char *);
+  va_start (args);
+  pattern = va_arg (args, char *);
 #endif
 
-  vsprintf(buf, pattern, args);
-  va_end(args);
+  vsprintf (buf, pattern, args);
+  va_end (args);
 
-  if (SERIAL_WRITE(monitor_desc, buf, strlen(buf)))
-    fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
+  if (SERIAL_WRITE (monitor_desc, buf, strlen (buf)))
+    fprintf (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));
 }
 
-/* Read a character from the remote system, doing all the fancy timeout stuff*/
+/* Read a character from the remote system, doing all the fancy timeout stuff */
 static int
-readchar(timeout)
+readchar (timeout)
      int timeout;
 {
   int c;
 
-  c = SERIAL_READCHAR(monitor_desc, timeout);
+  c = SERIAL_READCHAR (monitor_desc, timeout);
 
-  if (sr_get_debug())
-    putchar(c & 0x7f);
+  if (sr_get_debug ())
+    putchar (c & 0x7f);
 
-  if (monitor_log && isascii(c))
-    putc(c & 0x7f, log_file);
+  if (monitor_log && isascii (c))
+    putc (c & 0x7f, log_file);
 
   if (c >= 0)
     return c & 0x7f;
@@ -141,30 +142,30 @@ readchar(timeout)
       if (timeout == 0)
        return c;               /* Polls shouldn't generate timeout errors */
 
-      error("Timeout reading from remote system.");
+      error ("Timeout reading from remote system.");
     }
 
-  perror_with_name("remote-monitor");
+  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(string, discard)
+expect (string, discard)
      char *string;
      int discard;
 {
   char *p = string;
   int c;
 
-  if (sr_get_debug())
+  if (sr_get_debug ())
     printf ("Expecting \"%s\"\n", string);
 
   immediate_quit = 1;
   while (1)
     {
-      c = readchar(timeout);
+      c = readchar (timeout);
       if (!isascii (c))
        continue;
       if (c == *p++)
@@ -172,7 +173,7 @@ expect(string, discard)
          if (*p == '\0')
            {
              immediate_quit = 0;
-             if (sr_get_debug())
+             if (sr_get_debug ())
                printf ("\nMatched\n");
              return;
            }
@@ -181,9 +182,9 @@ expect(string, discard)
        {
          if (!discard)
            {
-             fwrite(string, 1, (p - 1) - string, stdout);
-             putchar((char)c);
-             fflush(stdout);
+             fwrite (string, 1, (p - 1) - string, stdout);
+             putchar ((char) c);
+             fflush (stdout);
            }
          p = string;
        }
@@ -205,31 +206,34 @@ expect(string, discard)
    necessary to prevent getting into states from which we can't
    recover.  */
 static void
-expect_prompt(discard)
+expect_prompt (discard)
      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);
-  }
+    /* 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(ignore_space)
+get_hex_digit (ignore_space)
      int ignore_space;
 {
   int ch;
   while (1)
     {
-      ch = readchar(timeout);
+      ch = readchar (timeout);
       if (ch >= '0' && ch <= '9')
        return ch - '0';
       else if (ch >= 'A' && ch <= 'F')
@@ -240,8 +244,8 @@ get_hex_digit(ignore_space)
        ;
       else
        {
-         expect_prompt(1);
-         error("Invalid hex digit from remote system.");
+         expect_prompt (1);
+         error ("Invalid hex digit from remote system.");
        }
     }
 }
@@ -273,7 +277,7 @@ get_hex_regs (n, regno)
   for (i = 0; i < n; i++)
     {
       int j;
-      
+
       val = 0;
       for (j = 0; j < 4; j++)
        {
@@ -281,7 +285,7 @@ get_hex_regs (n, regno)
          if (TARGET_BYTE_ORDER == BIG_ENDIAN)
            val = (val << 8) + b;
          else
-           val = val + (b << (j*8));
+           val = val + (b << (j * 8));
        }
       supply_register (regno++, (char *) &val);
     }
@@ -298,10 +302,10 @@ rombug_create_inferior (execfile, args, env)
   int entry_pt;
 
   if (args && *args)
-    error("Can't pass arguments to remote ROMBUG process");
+    error ("Can't pass arguments to remote ROMBUG process");
 
   if (execfile == 0 || exec_bfd == 0)
-    error("No executable file specified");
+    error ("No executable file specified");
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
@@ -313,7 +317,7 @@ rombug_create_inferior (execfile, args, env)
    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);
+  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* Open a connection to a remote debugger.
@@ -322,7 +326,7 @@ rombug_create_inferior (execfile, args, env)
 static char dev_name[100];
 
 static void
-rombug_open(args, from_tty)
+rombug_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -330,31 +334,37 @@ rombug_open(args, from_tty)
     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);
+  target_preopen (from_tty);
 
   if (rombug_is_open)
-    unpush_target(&rombug_ops);
+    unpush_target (&rombug_ops);
 
-  strcpy(dev_name, args);
-  monitor_desc = SERIAL_OPEN(dev_name);
+  strcpy (dev_name, args);
+  monitor_desc = SERIAL_OPEN (dev_name);
   if (monitor_desc == NULL)
-    perror_with_name(dev_name);
+    perror_with_name (dev_name);
 
   /* if baud rate is set by 'set remotebaud' */
-  if (SERIAL_SETBAUDRATE (monitor_desc, sr_get_baud_rate()))
+  if (SERIAL_SETBAUDRATE (monitor_desc, sr_get_baud_rate ()))
     {
       SERIAL_CLOSE (monitor_desc);
       perror_with_name ("RomBug");
     }
-  SERIAL_RAW(monitor_desc);
+  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);
+      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;
@@ -364,19 +374,19 @@ rombug_open(args, from_tty)
     perror_with_name (LOG_FILE);
 
   push_monitor (&rombug_cmds);
-  printf_monitor("\r");        /* CR wakes up monitor */
-  expect_prompt(1);
+  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);
+    printf ("Remote %s connected to %s\n", target_shortname,
+           dev_name);
 
-  rombug_fetch_registers();
+  rombug_fetch_registers ();
 
   printf_monitor ("ov e \r");
-  expect_prompt(1);
+  expect_prompt (1);
   bufaddr = 0;
   buflen = 0;
 }
@@ -389,23 +399,25 @@ static void
 rombug_close (quitting)
      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(stderr, "Error writing log file.\n");
-    if (fclose(log_file) != 0)
-      fprintf(stderr, "Error closing log file.\n");
-    log_file = 0;
-  }
+  if (rombug_is_open)
+    {
+      SERIAL_CLOSE (monitor_desc);
+      monitor_desc = NULL;
+      rombug_is_open = 0;
+    }
+
+  if (log_file)
+    {
+      if (ferror (log_file))
+       fprintf (stderr, "Error writing log file.\n");
+      if (fclose (log_file) != 0)
+       fprintf (stderr, "Error closing log file.\n");
+      log_file = 0;
+    }
 }
 
 int
-rombug_link(mod_name, text_reloc)
+rombug_link (mod_name, text_reloc)
      char *mod_name;
      CORE_ADDR *text_reloc;
 {
@@ -413,20 +425,20 @@ rombug_link(mod_name, text_reloc)
   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++)
+  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;
+       {
+         get_hex_byte (&b);
+         val = (val << 8) + b;
        }
     }
-  expect_prompt(1);
+  expect_prompt (1);
   *text_reloc = val;
   return 1;
 }
@@ -438,15 +450,16 @@ static void
 rombug_detach (from_tty)
      int from_tty;
 {
-  if (attach_flag) {
-    printf_monitor (GO_CMD);
-    attach_flag = 0;
-  }
-  pop_target();                /* calls rombug_close to do the real work */
+  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.
  */
@@ -463,18 +476,18 @@ rombug_resume (pid, step, sig)
       is_trace_mode = 1;
       printf_monitor (STEP_CMD);
       /* wait for the echo.  **
-      expect (STEP_CMD, 1);
-      */
+         expect (STEP_CMD, 1);
+       */
     }
   else
     {
       printf_monitor (GO_CMD);
       /* swallow the echo.  **
-      expect (GO_CMD, 1);
-      */
+         expect (GO_CMD, 1);
+       */
     }
   bufaddr = 0;
-  buflen= 0;
+  buflen = 0;
 }
 
 /*
@@ -498,33 +511,33 @@ rombug_wait (pid, status)
   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 */
+  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();
+  rombug_fetch_registers ();
   bufaddr = 0;
   buflen = 0;
-  pc = read_register(PC_REGNUM);
-  addr = read_register(DATABASE_REG);
+  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);
+       new_symfile_objfile (obj_sec->objfile, 1, 0);
       offs = ((struct section_offsets *)
-        alloca (sizeof (struct section_offsets)
-        + (symfile_objfile->num_sections * sizeof (offs->offsets))));
+             alloca (sizeof (struct section_offsets)
+              + (symfile_objfile->num_sections * sizeof (offs->offsets))));
       memcpy (offs, symfile_objfile->section_offsets,
-         (sizeof (struct section_offsets) + 
-        (symfile_objfile->num_sections * sizeof (offs->offsets))));
+             (sizeof (struct section_offsets) +
+                (symfile_objfile->num_sections * sizeof (offs->offsets))));
       ANOFFSET (offs, SECT_OFF_DATA) = addr;
       ANOFFSET (offs, SECT_OFF_BSS) = addr;
 
-      objfile_relocate(symfile_objfile, offs);
+      objfile_relocate (symfile_objfile, offs);
     }
 
   return 0;
@@ -547,15 +560,15 @@ get_reg_name (regno)
   if (regno < 0)
     return ("");
 /*
-  for (p = REGISTER_NAME (regno); *p; p++)
-    *b++ = toupper(*p);
-  *b = '\000';
-*/
-  p = (char *)REGISTER_NAME (regno);
+   for (p = REGISTER_NAME (regno); *p; p++)
+   *b++ = toupper(*p);
+   *b = '\000';
+ */
+  p = (char *) REGISTER_NAME (regno);
   return p;
 /*
-  return buf;
-*/
+   return buf;
+ */
 }
 
 /* read the remote registers into the block regs.  */
@@ -568,48 +581,51 @@ rombug_fetch_registers ()
   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);
+  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);
+      expect (REG_DELIM, 1);
       if (regno >= 8 && regno <= 13)
        {
          val = 0;
          for (j = 0; j < 2; j++)
-            {
-              get_hex_byte (&b);
+           {
+             get_hex_byte (&b);
              if (TARGET_BYTE_ORDER == BIG_ENDIAN)
                val = (val << 8) + b;
              else
-               val = val + (b << (j*8));
-            }
+               val = val + (b << (j * 8));
+           }
 
-         if (regno == 8) i = 10;
-         if (regno >=  9 && regno <= 12) i = regno + 3;
-         if (regno == 13) i = 11;
+         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);
+         get_hex_regs (1, PC_REGNUM);
        }
       else if (regno == 15)
        {
-         get_hex_regs(1, 9);
+         get_hex_regs (1, 9);
        }
       else
        {
          val = 0;
-         supply_register(regno, (char *) &val);
+         supply_register (regno, (char *) &val);
        }
     }
   is_trace_mode = 0;
@@ -625,10 +641,11 @@ rombug_fetch_register (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 (monitor_log)
+    {
+      fprintf (log_file, "\nIn Fetch Register (reg=%s)\n", get_reg_name (regno));
+      fflush (log_file);
+    }
 
   if (regno < 0)
     {
@@ -642,17 +659,17 @@ rombug_fetch_register (regno)
        {
          expect ("\n", 1);
          expect ("\n", 1);
-          expect (name, 1);
-          expect (REG_DELIM, 1);
+         expect (name, 1);
+         expect (REG_DELIM, 1);
          val = 0;
          for (j = 0; j < 2; j++)
-            {
-              get_hex_byte (&b);
+           {
+             get_hex_byte (&b);
              if (TARGET_BYTE_ORDER == BIG_ENDIAN)
                val = (val << 8) + b;
              else
-               val = val + (b << (j*8));
-            }
+               val = val + (b << (j * 8));
+           }
          supply_register (regno, (char *) &val);
        }
       else if (regno == 8 || regno == 9)
@@ -660,23 +677,23 @@ rombug_fetch_register (regno)
          expect ("\n", 1);
          expect ("\n", 1);
          expect ("\n", 1);
-          expect (name, 1);
-          expect (REG_DELIM, 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 (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);
     }
@@ -691,7 +708,7 @@ rombug_store_registers ()
   int regno;
 
   for (regno = 0; regno <= PC_REGNUM; regno++)
-    rombug_store_register(regno);
+    rombug_store_register (regno);
 
   registers_changed ();
 }
@@ -702,7 +719,7 @@ static void
 rombug_store_register (regno)
      int regno;
 {
-char *name;
+  char *name;
 
   if (monitor_log)
     fprintf (log_file, "\nIn Store_register (regno=%d)\n", regno);
@@ -711,11 +728,12 @@ char *name;
     rombug_store_registers ();
   else
     {
-      if (sr_get_debug())
+      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;
+      name = get_reg_name (regno);
+      if (name == 0)
+       return;
       printf_monitor (SET_REG, name, read_register (regno));
 
       is_trace_mode = 0;
@@ -739,7 +757,7 @@ static void
 rombug_files_info ()
 {
   printf ("\tAttached to %s at %d baud.\n",
-         dev_name, sr_get_baud_rate());
+         dev_name, sr_get_baud_rate ());
 }
 
 /* Copy LEN bytes of data from debugger memory at MYADDR
@@ -761,7 +779,7 @@ rombug_write_inferior_memory (memaddr, myaddr, len)
     {
       expect (CMD_DELIM, 1);
       printf_monitor ("%x \r", myaddr[i]);
-      if (sr_get_debug())
+      if (sr_get_debug ())
        printf ("\nSet 0x%x to 0x%x\n", memaddr + i, myaddr[i]);
     }
   expect (CMD_DELIM, 1);
@@ -778,7 +796,7 @@ rombug_write_inferior_memory (memaddr, myaddr, 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(memaddr, myaddr, len)
+rombug_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
@@ -806,16 +824,17 @@ rombug_read_inferior_memory(memaddr, myaddr, len)
      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))
+  if (((memaddr - 1) + len) < memaddr)
+    {
+      errno = EIO;
+      return 0;
+    }
+  if (bufaddr <= memaddr && (memaddr + len) <= (bufaddr + buflen))
     {
-      memcpy(myaddr, &readbuf[memaddr-bufaddr], len);
+      memcpy (myaddr, &readbuf[memaddr - bufaddr], len);
       return len;
     }
-  
+
   startaddr = memaddr;
   count = 0;
   while (count < len)
@@ -825,7 +844,7 @@ rombug_read_inferior_memory(memaddr, myaddr, len)
        len_this_pass -= startaddr % 16;
       if (len_this_pass > (len - count))
        len_this_pass = (len - count);
-      if (sr_get_debug())
+      if (sr_get_debug ())
        printf ("\nDisplay %d bytes at %x\n", len_this_pass, startaddr);
 
       printf_monitor (MEM_DIS_CMD, startaddr, 8);
@@ -836,13 +855,13 @@ rombug_read_inferior_memory(memaddr, myaddr, len)
        }
       bufaddr = startaddr;
       buflen = 16;
-      memcpy(&myaddr[count], readbuf, len_this_pass); 
+      memcpy (&myaddr[count], readbuf, len_this_pass);
       count += len_this_pass;
       startaddr += len_this_pass;
-      expect(CMD_DELIM, 1);
+      expect (CMD_DELIM, 1);
     }
-  if (CMD_END) 
-      printf_monitor (CMD_END);
+  if (CMD_END)
+    printf_monitor (CMD_END);
   is_trace_mode = 0;
   expect_prompt (1);
 
@@ -856,7 +875,7 @@ rombug_xfer_inferior_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   if (write)
     return rombug_write_inferior_memory (memaddr, myaddr, len);
@@ -869,7 +888,7 @@ rombug_kill (args, from_tty)
      char *args;
      int from_tty;
 {
-  return;              /* ignore attempts to kill target system */
+  return;                      /* ignore attempts to kill target system */
 }
 
 /* Clean up when a program exits.
@@ -886,7 +905,8 @@ rombug_mourn_inferior ()
 
 #define MAX_MONITOR_BREAKPOINTS 16
 
-static CORE_ADDR breakaddr[MAX_MONITOR_BREAKPOINTS] = {0};
+static CORE_ADDR breakaddr[MAX_MONITOR_BREAKPOINTS] =
+{0};
 
 static int
 rombug_insert_breakpoint (addr, shadow)
@@ -905,16 +925,16 @@ rombug_insert_breakpoint (addr, shadow)
     if (breakaddr[i] == 0)
       {
        breakaddr[i] = addr;
-       if (sr_get_debug())
+       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);
+       printf_monitor (SET_BREAK_CMD, addr);
        is_trace_mode = 0;
-       expect_prompt(1);
+       expect_prompt (1);
        return 0;
       }
 
-  fprintf(stderr, "Too many breakpoints (> 16) for monitor\n");
+  fprintf (stderr, "Too many breakpoints (> 16) for monitor\n");
   return 1;
 }
 
@@ -935,13 +955,13 @@ rombug_remove_breakpoint (addr, shadow)
     if (breakaddr[i] == addr)
       {
        breakaddr[i] = 0;
-       printf_monitor(CLR_BREAK_CMD, addr);
+       printf_monitor (CLR_BREAK_CMD, addr);
        is_trace_mode = 0;
-       expect_prompt(1);
+       expect_prompt (1);
        return 0;
       }
 
-  fprintf(stderr, "Can't find breakpoint associated with 0x%x\n", addr);
+  fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
   return 1;
 }
 
@@ -951,7 +971,7 @@ rombug_remove_breakpoint (addr, shadow)
 #define DOWNLOAD_LINE_SIZE 100
 static void
 rombug_load (arg)
-    char       *arg;
+     char *arg;
 {
 /* this part comment out for os9* */
 #if 0
@@ -959,15 +979,15 @@ rombug_load (arg)
   char buf[DOWNLOAD_LINE_SIZE];
   int i, bytes_read;
 
-  if (sr_get_debug())
+  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;
-  }
+      error (sprintf (buf, "%s Does not exist", arg));
+      return;
+    }
 
   printf_monitor (LOAD_CMD);
 /*  expect ("Waiting for S-records from host... ", 1); */
@@ -981,12 +1001,15 @@ rombug_load (arg)
          fflush (stdout);
        }
 
-      if (SERIAL_WRITE(monitor_desc, buf, bytes_read)) {
-       fprintf(stderr, "SERIAL_WRITE failed: (while downloading) %s\n", safe_strerror(errno));
-       break;
-      }
+      if (SERIAL_WRITE (monitor_desc, buf, bytes_read))
+       {
+         fprintf (stderr, "SERIAL_WRITE failed: (while downloading) %s\n", safe_strerror (errno));
+         break;
+       }
       i = 0;
-      while (i++ <=200000) {} ;                        /* Ugly HACK, probably needs flow control */
+      while (i++ <= 200000)
+       {
+       };                      /* Ugly HACK, probably needs flow control */
       if (bytes_read < DOWNLOAD_LINE_SIZE)
        {
          if (!feof (download))
@@ -1002,7 +1025,7 @@ rombug_load (arg)
   if (!feof (download))
     error ("Never got EOF while downloading");
   fclose (download);
-#endif 0
+#endif /* 0 */
 }
 
 /* Put a command string, in args, out to MONITOR.  
@@ -1011,20 +1034,20 @@ rombug_load (arg)
 
 static void
 rombug_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   if (monitor_desc == NULL)
-    error("monitor target not open.");
-  
+    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);
+    error ("Missing command.");
+
+  printf_monitor ("%s\r", args);
+  expect_prompt (0);
 }
 
 #if 0
@@ -1034,57 +1057,58 @@ rombug_command (args, fromtty)
 static struct ttystate ttystate;
 
 static void
-cleanup_tty()
-{  printf("\r\n[Exiting connect mode]\r\n");
-  /*SERIAL_RESTORE(0, &ttystate);*/
+cleanup_tty ()
+{
+  printf ("\r\n[Exiting connect mode]\r\n");
+  /*SERIAL_RESTORE(0, &ttystate); */
 }
 
 static void
 connect_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   fd_set readfds;
   int numfds;
   int c;
   char cur_esc = 0;
 
-  dont_repeat();
+  dont_repeat ();
 
   if (monitor_desc == NULL)
-    error("monitor target not open.");
-  
+    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");
+    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);
+  serial_raw (0, &ttystate);
 
-  make_cleanup(cleanup_tty, 0);
+  make_cleanup (cleanup_tty, 0);
 
-  FD_ZERO(&readfds);
+  FD_ZERO (&readfds);
 
   while (1)
     {
       do
        {
-         FD_SET(0, &readfds);
-         FD_SET(monitor_desc, &readfds);
-         numfds = select(sizeof(readfds)*8, &readfds, 0, 0, 0);
+         FD_SET (0, &readfds);
+         FD_SET (monitor_desc, &readfds);
+         numfds = select (sizeof (readfds) * 8, &readfds, 0, 0, 0);
        }
       while (numfds == 0);
 
       if (numfds < 0)
-       perror_with_name("select");
+       perror_with_name ("select");
 
-      if (FD_ISSET(0, &readfds))
+      if (FD_ISSET (0, &readfds))
        {                       /* tty input, send to monitor */
-         c = getchar();
+         c = getchar ();
          if (c < 0)
-           perror_with_name("connect");
+           perror_with_name ("connect");
 
-         printf_monitor("%c", c);
+         printf_monitor ("%c", c);
          switch (cur_esc)
            {
            case 0:
@@ -1105,16 +1129,16 @@ connect_command (args, fromtty)
            }
        }
 
-      if (FD_ISSET(monitor_desc, &readfds))
+      if (FD_ISSET (monitor_desc, &readfds))
        {
          while (1)
            {
-             c = readchar(0);
+             c = readchar (0);
              if (c < 0)
                break;
-             putchar(c);
+             putchar (c);
            }
-         fflush(stdout);
+         fflush (stdout);
        }
     }
 }
@@ -1126,59 +1150,60 @@ connect_command (args, fromtty)
  * 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 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 ;
+struct target_ops rombug_ops;
 
-static void 
-init_rombug_ops(void)
+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\
+  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_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_detach = rombug_detach;
   rombug_ops.to_require_detach = NULL;
-  rombug_ops.to_resume =   rombug_resume;
-  rombug_ops.to_wait  =   rombug_wait;
+  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_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;
@@ -1196,69 +1221,69 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
   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_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_core_file_to_sym_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 */
-} 
+  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 ()
 {
-  init_rombug_ops() ;
+  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_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_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_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_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_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."); 
+          "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.");
+          "Connect the terminal directly up to a serial based command monitor.\nUse <CR>~. or <CR>~^D to break out.");
 #endif
 }
index dba920e36f24284c3be476b2096f08821a8e9ac4..7a6b9a9d59d498d4d1a08f471cc8d555e14c13f1 100644 (file)
@@ -1,21 +1,22 @@
 /* GDB interface to ARM RDI library.
    Copyright 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -46,18 +47,18 @@ extern int isascii PARAMS ((int));
 
 /* Prototypes for local functions */
 
-static void arm_rdi_files_info PARAMS ((struct target_ops *ignore));
+static void arm_rdi_files_info PARAMS ((struct target_ops * ignore));
 
 static int arm_rdi_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
-                                      int len, int should_write,
-                                      struct target_ops *target));
+                                       int len, int should_write,
+                                       struct target_ops * target));
 
 static void arm_rdi_prepare_to_store PARAMS ((void));
 
 static void arm_rdi_fetch_registers PARAMS ((int regno));
 
 static void arm_rdi_resume PARAMS ((int pid, int step,
-                                  enum target_signal siggnal));
+                                   enum target_signal siggnal));
 
 static int arm_rdi_start_remote PARAMS ((char *dummy));
 
@@ -74,7 +75,7 @@ static void arm_rdi_mourn PARAMS ((void));
 
 static void arm_rdi_send PARAMS ((char *buf));
 
-static int arm_rdi_wait PARAMS ((int pid, struct target_waitstatus *status));
+static int arm_rdi_wait PARAMS ((int pid, struct target_waitstatus * status));
 
 static void arm_rdi_kill PARAMS ((void));
 
@@ -108,13 +109,15 @@ static int execute_status;
 
 /* A little list of breakpoints that have been set.  */
 
-static struct local_bp_list_entry {
-  CORE_ADDR addr;
-  PointHandle point;
-  struct local_bp_list_entry *next;
-} *local_bp_list;
-
+static struct local_bp_list_entry
+  {
+    CORE_ADDR addr;
+    PointHandle point;
+    struct local_bp_list_entry *next;
+  }
+ *local_bp_list;
 \f
+
 /* Stub for catch_errors.  */
 
 static int
@@ -162,13 +165,13 @@ mywrite (arg, buffer, len)
 
   e = (char *) buffer;
   for (i = 0; i < len; i++)
-{
+    {
       if (isascii ((int) *e))
-        {
-          fputc_unfiltered ((int) *e, gdb_stdout);
-          e++;
-        }
-}
+       {
+         fputc_unfiltered ((int) *e, gdb_stdout);
+         e++;
+       }
+    }
 
   return len;
 }
@@ -185,7 +188,7 @@ mypause (arg)
 static int
 myreadc (arg)
      PTR arg;
-{ 
+{
   return fgetc (stdin);
 }
 
@@ -195,7 +198,7 @@ mygets (arg, buffer, len)
      char *buffer;
      int len;
 {
-  return fgets(buffer, len, stdin);
+  return fgets (buffer, len, stdin);
 }
 
 /* Prevent multiple calls to angel_RDI_close().  */
@@ -241,7 +244,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
 
   rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL);
   if (rslt == RDIError_BigEndian || rslt == RDIError_LittleEndian)
-    ;  /* do nothing, this is the expected return */
+    ;                          /* do nothing, this is the expected return */
   else if (rslt)
     {
       printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
@@ -340,15 +343,15 @@ arm_rdi_create_inferior (exec_file, args, env)
   CORE_ADDR entry_point;
 
   if (exec_file == 0 || exec_bfd == 0)
-   error ("No executable file specified.");
+    error ("No executable file specified.");
 
   entry_point = (CORE_ADDR) bfd_get_start_address (exec_bfd);
 
-  arm_rdi_kill ();      
+  arm_rdi_kill ();
   remove_breakpoints ();
   init_wait_for_inferior ();
 
-  len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop*/ 10;
+  len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10;
   arg_buf = (char *) alloca (len);
   arg_buf[0] = '\0';
   strcat (arg_buf, exec_file);
@@ -356,7 +359,7 @@ arm_rdi_create_inferior (exec_file, args, env)
   strcat (arg_buf, args);
 
   inferior_pid = 42;
-  insert_breakpoints ();  /* Needed to get correct instruction in cache */
+  insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   if (env != NULL)
     {
@@ -372,7 +375,7 @@ arm_rdi_create_inferior (exec_file, args, env)
                                       &end_of_num, 0);
              printf_filtered ("Setting top-of-memory to 0x%x\n",
                               top_of_memory);
-         
+
              rslt = angel_RDI_info (RDIInfo_SetTopMem, &top_of_memory, &arg2);
              if (rslt)
                {
@@ -384,7 +387,7 @@ arm_rdi_create_inferior (exec_file, args, env)
     }
 
   arg1 = (unsigned long) arg_buf;
-  rslt = angel_RDI_info (RDISet_Cmdline, /* &arg1 */ (unsigned long *)arg_buf, &arg2);
+  rslt = angel_RDI_info (RDISet_Cmdline, /* &arg1 */ (unsigned long *) arg_buf, &arg2);
   if (rslt)
     {
       printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
@@ -414,7 +417,7 @@ arm_rdi_close (quitting)
 {
   int rslt;
 
-  if (! closed_already)
+  if (!closed_already)
     {
       rslt = angel_RDI_close ();
       if (rslt)
@@ -436,7 +439,7 @@ arm_rdi_resume (pid, step, siggnal)
   int rslt;
   PointHandle point;
 
-  if (0 /* turn on when hardware supports single-stepping */)
+  if (0 /* turn on when hardware supports single-stepping */ )
     {
       rslt = angel_RDI_step (1, &point);
       if (rslt)
@@ -478,7 +481,7 @@ arm_rdi_interrupt (signo)
 {
 }
 
-static void (*ofunc)();
+static void (*ofunc) ();
 
 /* The user typed ^C twice.  */
 static void
@@ -504,7 +507,7 @@ arm_rdi_wait (pid, status)
      struct target_waitstatus *status;
 {
   status->kind = (execute_status == RDIError_NoError ?
-    TARGET_WAITKIND_EXITED : TARGET_WAITKIND_STOPPED);
+                 TARGET_WAITKIND_EXITED : TARGET_WAITKIND_STOPPED);
 
   /* convert stopped code from target into right signal */
   status->value.sig = rdi_error_signal (execute_status);
@@ -523,7 +526,7 @@ arm_rdi_fetch_registers (regno)
   unsigned long rawreg, rawregs[32];
   char cookedreg[4];
 
-  if (regno == -1) 
+  if (regno == -1)
     {
       rslt = angel_RDI_CPUread (255, 0x27fff, rawregs);
       if (rslt)
@@ -565,7 +568,7 @@ arm_rdi_fetch_registers (regno)
     }
 }
 
-static void 
+static void
 arm_rdi_prepare_to_store ()
 {
   /* Nothing to do.  */
@@ -583,7 +586,7 @@ arm_rdi_store_registers (regno)
   /* These need to be able to take 'floating point register' contents */
   unsigned long rawreg[3], rawerreg[3];
 
-  if (regno  == -1) 
+  if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
        arm_rdi_store_registers (regno);
@@ -618,12 +621,12 @@ arm_rdi_store_registers (regno)
 
 /* ARGSUSED */
 static int
-arm_rdi_xfer_memory(memaddr, myaddr, len, should_write, target)
+arm_rdi_xfer_memory (memaddr, myaddr, len, should_write, target)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   int rslt, i;
 
@@ -635,7 +638,7 @@ arm_rdi_xfer_memory(memaddr, myaddr, len, should_write, target)
          printf_filtered ("RDI_write: %s\n", rdi_error_message (rslt));
        }
     }
-  else 
+  else
     {
       rslt = angel_RDI_read (memaddr, myaddr, &len);
       if (rslt)
@@ -668,7 +671,7 @@ arm_rdi_files_info (ignore)
     printf_filtered ("Target can do profiling.\n");
   if (arg1 & (1 << 4))
     printf_filtered ("Target is real hardware.\n");
-  
+
   rslt = angel_RDI_info (RDIInfo_Step, &arg1, &arg2);
   if (rslt)
     {
@@ -779,7 +782,7 @@ rdi_error_message (err)
 {
   switch (err)
     {
-    case RDIError_NoError: 
+    case RDIError_NoError:
       return "no error";
     case RDIError_Reset:
       return "debuggee reset";
@@ -858,7 +861,7 @@ rdi_error_message (err)
     case RDIError_UndefinedMessage:
       return "internal error, undefined message";
     default:
-      return "undefined error message, should reset target"; 
+      return "undefined error message, should reset target";
     }
 }
 
@@ -873,7 +876,7 @@ rdi_error_signal (err)
     case RDIError_NoError:
       return 0;
     case RDIError_Reset:
-      return TARGET_SIGNAL_TERM; /* ??? */
+      return TARGET_SIGNAL_TERM;       /* ??? */
     case RDIError_UndefinedInstruction:
       return TARGET_SIGNAL_ILL;
     case RDIError_SoftwareInterrupt:
@@ -923,7 +926,7 @@ rdi_error_signal (err)
     case RDIError_UnimplementedMessage:
     case RDIError_UndefinedMessage:
     default:
-      return TARGET_SIGNAL_UNKNOWN; 
+      return TARGET_SIGNAL_UNKNOWN;
     }
 }
 \f
@@ -932,42 +935,46 @@ rdi_error_signal (err)
 static void
 init_rdi_ops ()
 {
-  arm_rdi_ops.to_shortname = "rdi";    
+  arm_rdi_ops.to_shortname = "rdi";
   arm_rdi_ops.to_longname = "ARM RDI";
   arm_rdi_ops.to_doc = "Use a remote ARM-based computer; via the RDI library.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya)." ; 
-  arm_rdi_ops.to_open = arm_rdi_open;          
-  arm_rdi_ops.to_close = arm_rdi_close;        
-  arm_rdi_ops.to_detach = arm_rdi_detach;      
-  arm_rdi_ops.to_resume = arm_rdi_resume;      
-  arm_rdi_ops.to_wait = arm_rdi_wait;  
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  arm_rdi_ops.to_open = arm_rdi_open;
+  arm_rdi_ops.to_close = arm_rdi_close;
+  arm_rdi_ops.to_detach = arm_rdi_detach;
+  arm_rdi_ops.to_resume = arm_rdi_resume;
+  arm_rdi_ops.to_wait = arm_rdi_wait;
   arm_rdi_ops.to_fetch_registers = arm_rdi_fetch_registers;
   arm_rdi_ops.to_store_registers = arm_rdi_store_registers;
   arm_rdi_ops.to_prepare_to_store = arm_rdi_prepare_to_store;
   arm_rdi_ops.to_xfer_memory = arm_rdi_xfer_memory;
   arm_rdi_ops.to_files_info = arm_rdi_files_info;
   arm_rdi_ops.to_insert_breakpoint = arm_rdi_insert_breakpoint;
-  arm_rdi_ops.to_remove_breakpoint = arm_rdi_remove_breakpoint;        
-  arm_rdi_ops.to_kill = arm_rdi_kill;          
-  arm_rdi_ops.to_load = generic_load;          
+  arm_rdi_ops.to_remove_breakpoint = arm_rdi_remove_breakpoint;
+  arm_rdi_ops.to_kill = arm_rdi_kill;
+  arm_rdi_ops.to_load = generic_load;
   arm_rdi_ops.to_create_inferior = arm_rdi_create_inferior;
   arm_rdi_ops.to_mourn_inferior = arm_rdi_mourn_inferior;
   arm_rdi_ops.to_stratum = process_stratum;
-  arm_rdi_ops.to_has_all_memory = 1;   
-  arm_rdi_ops.to_has_memory = 1;       
-  arm_rdi_ops.to_has_stack = 1;        
-  arm_rdi_ops.to_has_registers = 1;    
-  arm_rdi_ops.to_has_execution = 1;    
-  arm_rdi_ops.to_magic = OPS_MAGIC;    
+  arm_rdi_ops.to_has_all_memory = 1;
+  arm_rdi_ops.to_has_memory = 1;
+  arm_rdi_ops.to_has_stack = 1;
+  arm_rdi_ops.to_has_registers = 1;
+  arm_rdi_ops.to_has_execution = 1;
+  arm_rdi_ops.to_magic = OPS_MAGIC;
 }
 
 void
 _initialize_remote_rdi ()
 {
-  init_rdi_ops () ;
+  init_rdi_ops ();
   add_target (&arm_rdi_ops);
 }
 
 /* A little dummy to make linking with the library succeed. */
 
-int Fail() { return 0; }
+int
+Fail ()
+{
+  return 0;
+}
index 7b979d2fb6b7f0988e9a3bdcdec88836d9fd115a..9b6584d874a178227791880e2948cf0e9c644c52 100644 (file)
@@ -15,7 +15,8 @@
 
    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.  
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  
 
 
  */
@@ -168,7 +169,7 @@ ds;
 
 static int timeout = 2;
 
-static char * commandline = NULL;
+static char *commandline = NULL;
 
 static int
 remote_rdp_xfer_inferior_memory PARAMS ((CORE_ADDR memaddr,
@@ -278,9 +279,9 @@ rdp_init (cold, tty)
        printf_unfiltered ("Trying to connect at %d baud.\n", baudtry);
 
       /*
-      ** It seems necessary to reset an EmbeddedICE to get it going.
-      ** This has the side benefit of displaying the startup banner.
-      */
+         ** It seems necessary to reset an EmbeddedICE to get it going.
+         ** This has the side benefit of displaying the startup banner.
+       */
       if (cold)
        {
          put_byte (RDP_RESET);
@@ -308,7 +309,7 @@ rdp_init (cold, tty)
 
       put_byte (RDP_OPEN);
 
-      put_byte (type | RDP_OPEN_TYPE_RETURN_SEX );
+      put_byte (type | RDP_OPEN_TYPE_RETURN_SEX);
       put_word (0);
 
       while (!sync && (restype = SERIAL_READCHAR (io, 1)) > 0)
@@ -723,14 +724,14 @@ rdp_execute_start ()
 
 static void
 rdp_set_command_line (command, args)
-     char * command;
-     char * args;
+     char *command;
+     char *args;
 {
   /*
-  ** We could use RDP_INFO_SET_CMDLINE to send this, but EmbeddedICE systems
-  ** don't implement that, and get all confused at the unexpected text.
-  ** Instead, just keep a copy, and send it when the target does a SWI_GetEnv
-  */
+     ** We could use RDP_INFO_SET_CMDLINE to send this, but EmbeddedICE systems
+     ** don't implement that, and get all confused at the unexpected text.
+     ** Instead, just keep a copy, and send it when the target does a SWI_GetEnv
+   */
 
   if (commandline != NULL)
     free (commandline);
@@ -748,22 +749,22 @@ static void
 rdp_catch_vectors ()
 {
   /*
-  ** We want the target monitor to intercept the abort vectors
-  ** i.e. stop the program if any of these are used.
-  */
+     ** We want the target monitor to intercept the abort vectors
+     ** i.e. stop the program if any of these are used.
+   */
   send_rdp ("bww-SZ", RDP_INFO, RDP_INFO_VECTOR_CATCH,
-           /*
-           ** Specify a bitmask including
-           **  the reset vector
-           **  the undefined instruction vector
-           **  the prefetch abort vector
-           **  the data abort vector
-           **  the address exception vector
-           */
-           (1<<0)|(1<<1)|(1<<3)|(1<<4)|(1<<5)
-           );
+  /*
+     ** Specify a bitmask including
+     **  the reset vector
+     **  the undefined instruction vector
+     **  the prefetch abort vector
+     **  the data abort vector
+     **  the address exception vector
+   */
+           (1 << 0) | (1 << 1) | (1 << 3) | (1 << 4) | (1 << 5)
+    );
 }
-  
+
 
 
 #define a_byte 1
@@ -817,18 +818,18 @@ argsin;
 
 static int translate_open_mode[] =
 {
-  O_RDONLY,                          /* "r"   */
-  O_RDONLY+O_BINARY,                 /* "rb"  */
-  O_RDWR,                            /* "r+"  */
-  O_RDWR  +O_BINARY,                 /* "r+b" */
-  O_WRONLY         +O_CREAT+O_TRUNC, /* "w"   */
-  O_WRONLY+O_BINARY+O_CREAT+O_TRUNC, /* "wb"  */
-  O_RDWR           +O_CREAT+O_TRUNC, /* "w+"  */
-  O_RDWR  +O_BINARY+O_CREAT+O_TRUNC, /* "w+b" */
-  O_WRONLY         +O_APPEND+O_CREAT,/* "a"   */
-  O_WRONLY+O_BINARY+O_APPEND+O_CREAT,/* "ab"  */
-  O_RDWR           +O_APPEND+O_CREAT,/* "a+"  */
-  O_RDWR  +O_BINARY+O_APPEND+O_CREAT /* "a+b" */
+  O_RDONLY,                    /* "r"   */
+  O_RDONLY + O_BINARY,         /* "rb"  */
+  O_RDWR,                      /* "r+"  */
+  O_RDWR + O_BINARY,           /* "r+b" */
+  O_WRONLY + O_CREAT + O_TRUNC,        /* "w"   */
+  O_WRONLY + O_BINARY + O_CREAT + O_TRUNC,     /* "wb"  */
+  O_RDWR + O_CREAT + O_TRUNC,  /* "w+"  */
+  O_RDWR + O_BINARY + O_CREAT + O_TRUNC,       /* "w+b" */
+  O_WRONLY + O_APPEND + O_CREAT,       /* "a"   */
+  O_WRONLY + O_BINARY + O_APPEND + O_CREAT,    /* "ab"  */
+  O_RDWR + O_APPEND + O_CREAT, /* "a+"  */
+  O_RDWR + O_BINARY + O_APPEND + O_CREAT       /* "a+b" */
 };
 
 static int
@@ -861,18 +862,18 @@ exec_swi (swi, args)
       args->n = callback->time (callback, NULL);
       return 1;
 
-    case SWI_Clock :
-       /* return number of centi-seconds... */
-       args->n = 
+    case SWI_Clock:
+      /* return number of centi-seconds... */
+      args->n =
 #ifdef CLOCKS_PER_SEC
-          (CLOCKS_PER_SEC >= 100)
-             ? (clock() / (CLOCKS_PER_SEC / 100))
-             : ((clock() * 100) / CLOCKS_PER_SEC) ;
+       (CLOCKS_PER_SEC >= 100)
+       ? (clock () / (CLOCKS_PER_SEC / 100))
+       : ((clock () * 100) / CLOCKS_PER_SEC);
 #else
-     /* presume unix... clock() returns microseconds */
-          clock() / 10000 ;
+      /* presume unix... clock() returns microseconds */
+       clock () / 10000;
 #endif
-       return 1 ;
+      return 1;
 
     case SWI_Remove:
       args->n = callback->unlink (callback, args->s);
@@ -882,19 +883,19 @@ exec_swi (swi, args)
       return 1;
 
     case SWI_Open:
-       /* Now we need to decode the Demon open mode */
-       i = translate_open_mode[args[1].n];
-
-       /* Filename ":tt" is special: it denotes stdin/out */
-       if (strcmp(args->s,":tt")==0)
-         {
-           if (i == O_RDONLY ) /* opening tty "r" */
-             args->n = 0 /* stdin */ ;
-           else 
-             args->n = 1 /* stdout */ ;
-         }
-       else
-         args->n = callback->open (callback, args->s, i);
+      /* Now we need to decode the Demon open mode */
+      i = translate_open_mode[args[1].n];
+
+      /* Filename ":tt" is special: it denotes stdin/out */
+      if (strcmp (args->s, ":tt") == 0)
+       {
+         if (i == O_RDONLY)    /* opening tty "r" */
+           args->n = 0 /* stdin */ ;
+         else
+           args->n = 1 /* stdout */ ;
+       }
+      else
+       args->n = callback->open (callback, args->s, i);
       return 1;
 
     case SWI_Close:
@@ -913,7 +914,7 @@ exec_swi (swi, args)
        int done = callback->read (callback, args[0].n, copy, args[2].n);
        if (done > 0)
          remote_rdp_xfer_inferior_memory (args[1].n, copy, done, 1, 0);
-       args->n = args[2].n-done;
+       args->n = args[2].n - done;
        return 1;
       }
 
@@ -941,15 +942,15 @@ exec_swi (swi, args)
          if (len > 255)
            {
              len = 255;
-             commandline [255]='\0';
+             commandline[255] = '\0';
            }
          remote_rdp_xfer_inferior_memory (args[0].n,
-                                          commandline, len+1, 1, 0);
+                                          commandline, len + 1, 1, 0);
        }
       else
        remote_rdp_xfer_inferior_memory (args[0].n, "", 1, 1, 0);
       return 1;
-      
+
     default:
       return 0;
     }
@@ -1177,32 +1178,32 @@ remote_rdp_open (args, from_tty)
   rdp_info ();
 
   /* Need to set up the vector interception state */
-  rdp_catch_vectors();
+  rdp_catch_vectors ();
 
   /*
-  ** If it's an EmbeddedICE, we need to set the processor config.
-  ** Assume we can always have ARM7TDI...
-  */
-  send_rdp ("bw-SB", RDP_INFO, RDP_INFO_ICEBREAKER, & not_icebreaker);
+     ** If it's an EmbeddedICE, we need to set the processor config.
+     ** Assume we can always have ARM7TDI...
+   */
+  send_rdp ("bw-SB", RDP_INFO, RDP_INFO_ICEBREAKER, &not_icebreaker);
   if (!not_icebreaker)
     {
-      const char * CPU = "ARM7TDI";
+      const char *CPU = "ARM7TDI";
       int ICEversion;
       int len = strlen (CPU);
-      
+
       send_rdp ("bbbbw-p-SWZ",
                RDP_SELECT_CONFIG,
                RDI_ConfigCPU,  /* Aspect: set the CPU */
                len,            /* The number of bytes in the name */
                RDI_MatchAny,   /* We'll take whatever we get */
                0,              /* We'll take whatever version's there */
-               CPU,len,
-               & ICEversion);
+               CPU, len,
+               &ICEversion);
     }
 
-  /* command line initialised on 'run'*/
+  /* command line initialised on 'run' */
 
-  push_target (& remote_rdp_ops);
+  push_target (&remote_rdp_ops);
 
   callback->init (callback);
   flush_cached_frames ();
@@ -1386,18 +1387,18 @@ remote_rdp_files_info (target)
 
 static void
 remote_rdp_create_inferior (exec_file, allargs, env)
-     char *  exec_file;
-     char *  allargs;
-     char ** env;
+     char *exec_file;
+     char *allargs;
+     char **env;
 {
   CORE_ADDR entry_point;
 
   if (exec_file == 0 || exec_bfd == 0)
-   error ("No executable file specified.");
+    error ("No executable file specified.");
 
   entry_point = (CORE_ADDR) bfd_get_start_address (exec_bfd);
 
-  remote_rdp_kill ();   
+  remote_rdp_kill ();
   remove_breakpoints ();
   init_wait_for_inferior ();
 
@@ -1405,12 +1406,12 @@ remote_rdp_create_inferior (exec_file, allargs, env)
   rdp_set_command_line (exec_file, allargs);
 
   inferior_pid = 42;
-  insert_breakpoints ();  /* Needed to get correct instruction in cache */
+  insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   /*
-  ** RDP targets don't provide any facility to set the top of memory,
-  ** so we don't bother to look for MEMSIZE in the environment.
-  */
+     ** RDP targets don't provide any facility to set the top of memory,
+     ** so we don't bother to look for MEMSIZE in the environment.
+   */
 
   /* Let's go! */
   proceed (entry_point, TARGET_SIGNAL_DEFAULT, 0);
@@ -1418,56 +1419,56 @@ remote_rdp_create_inferior (exec_file, allargs, env)
 
 /* Accept any stray run/attach commands */
 static int
-remote_rdp_can_run()
+remote_rdp_can_run ()
 {
   return 1;
 }
 
 /* Attach doesn't need to do anything */
 static void
-remote_rdp_attach(args, from_tty)
-     char * args;
+remote_rdp_attach (args, from_tty)
+     char *args;
      int from_tty;
 {
   return;
 }
-  
+
 /* Define the target subroutine names */
 
-struct target_ops remote_rdp_ops ;
+struct target_ops remote_rdp_ops;
 
-static void 
-init_remote_rdp_ops(void)
+static void
+init_remote_rdp_ops (void)
 {
-  remote_rdp_ops.to_shortname =   "rdp";
-  remote_rdp_ops.to_longname =   "Remote Target using the RDProtocol";
-  remote_rdp_ops.to_doc =   "Use a remote ARM system which uses the ARM Remote Debugging Protocol";
-  remote_rdp_ops.to_open =   remote_rdp_open;  
-  remote_rdp_ops.to_close =   remote_rdp_close;        
-  remote_rdp_ops.to_attach =   remote_rdp_attach;
+  remote_rdp_ops.to_shortname = "rdp";
+  remote_rdp_ops.to_longname = "Remote Target using the RDProtocol";
+  remote_rdp_ops.to_doc = "Use a remote ARM system which uses the ARM Remote Debugging Protocol";
+  remote_rdp_ops.to_open = remote_rdp_open;
+  remote_rdp_ops.to_close = remote_rdp_close;
+  remote_rdp_ops.to_attach = remote_rdp_attach;
   remote_rdp_ops.to_post_attach = NULL;
   remote_rdp_ops.to_require_attach = NULL;
-  remote_rdp_ops.to_detach =   NULL;
-  remote_rdp_ops.to_require_detach = NULL;             
-  remote_rdp_ops.to_resume =   remote_rdp_resume;
-  remote_rdp_ops.to_wait  =   remote_rdp_wait;
-  remote_rdp_ops.to_post_wait = NULL;  
-  remote_rdp_ops.to_fetch_registers  =   remote_rdp_fetch_register;
-  remote_rdp_ops.to_store_registers  =   remote_rdp_store_register;
-  remote_rdp_ops.to_prepare_to_store =   remote_rdp_prepare_to_store;
-  remote_rdp_ops.to_xfer_memory  =   remote_rdp_xfer_inferior_memory;
-  remote_rdp_ops.to_files_info  =   remote_rdp_files_info;
-  remote_rdp_ops.to_insert_breakpoint =   remote_rdp_insert_breakpoint;
-  remote_rdp_ops.to_remove_breakpoint =   remote_rdp_remove_breakpoint;
-  remote_rdp_ops.to_terminal_init  =   NULL;           
-  remote_rdp_ops.to_terminal_inferior =   NULL;                
-  remote_rdp_ops.to_terminal_ours_for_output =   NULL;
-  remote_rdp_ops.to_terminal_ours  =   NULL;   
-  remote_rdp_ops.to_terminal_info  =   NULL;   
-  remote_rdp_ops.to_kill  =   remote_rdp_kill; 
-  remote_rdp_ops.to_load  =   generic_load;    
-  remote_rdp_ops.to_lookup_symbol =   NULL;                            
-  remote_rdp_ops.to_create_inferior =   remote_rdp_create_inferior;
+  remote_rdp_ops.to_detach = NULL;
+  remote_rdp_ops.to_require_detach = NULL;
+  remote_rdp_ops.to_resume = remote_rdp_resume;
+  remote_rdp_ops.to_wait = remote_rdp_wait;
+  remote_rdp_ops.to_post_wait = NULL;
+  remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register;
+  remote_rdp_ops.to_store_registers = remote_rdp_store_register;
+  remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store;
+  remote_rdp_ops.to_xfer_memory = remote_rdp_xfer_inferior_memory;
+  remote_rdp_ops.to_files_info = remote_rdp_files_info;
+  remote_rdp_ops.to_insert_breakpoint = remote_rdp_insert_breakpoint;
+  remote_rdp_ops.to_remove_breakpoint = remote_rdp_remove_breakpoint;
+  remote_rdp_ops.to_terminal_init = NULL;
+  remote_rdp_ops.to_terminal_inferior = NULL;
+  remote_rdp_ops.to_terminal_ours_for_output = NULL;
+  remote_rdp_ops.to_terminal_ours = NULL;
+  remote_rdp_ops.to_terminal_info = NULL;
+  remote_rdp_ops.to_kill = remote_rdp_kill;
+  remote_rdp_ops.to_load = generic_load;
+  remote_rdp_ops.to_lookup_symbol = NULL;
+  remote_rdp_ops.to_create_inferior = remote_rdp_create_inferior;
   remote_rdp_ops.to_post_startup_inferior = NULL;
   remote_rdp_ops.to_acknowledge_created_inferior = NULL;
   remote_rdp_ops.to_clone_and_follow_inferior = NULL;
@@ -1485,28 +1486,28 @@ init_remote_rdp_ops(void)
   remote_rdp_ops.to_has_execd = NULL;
   remote_rdp_ops.to_reported_exec_events_per_exec_call = NULL;
   remote_rdp_ops.to_has_exited = NULL;
-  remote_rdp_ops.to_mourn_inferior =   generic_mourn_inferior;
-  remote_rdp_ops.to_can_run  =   remote_rdp_can_run;
-  remote_rdp_ops.to_notice_signals =   0;      
-  remote_rdp_ops.to_thread_alive  =   0;       
-  remote_rdp_ops.to_stop  =   0;
+  remote_rdp_ops.to_mourn_inferior = generic_mourn_inferior;
+  remote_rdp_ops.to_can_run = remote_rdp_can_run;
+  remote_rdp_ops.to_notice_signals = 0;
+  remote_rdp_ops.to_thread_alive = 0;
+  remote_rdp_ops.to_stop = 0;
   remote_rdp_ops.to_pid_to_exec_file = NULL;
-  remote_rdp_ops.to_core_file_to_sym_file = NULL;              
-  remote_rdp_ops.to_stratum =   process_stratum;
-  remote_rdp_ops.DONT_USE =   NULL;            
-  remote_rdp_ops.to_has_all_memory =   1;      
-  remote_rdp_ops.to_has_memory =   1;          
-  remote_rdp_ops.to_has_stack =   1;           
-  remote_rdp_ops.to_has_registers =   1;       
-  remote_rdp_ops.to_has_execution =   1;       
-  remote_rdp_ops.to_sections =   NULL;         
-  remote_rdp_ops.to_sections_end =   NULL;
-  remote_rdp_ops.to_magic =   OPS_MAGIC;
+  remote_rdp_ops.to_core_file_to_sym_file = NULL;
+  remote_rdp_ops.to_stratum = process_stratum;
+  remote_rdp_ops.DONT_USE = NULL;
+  remote_rdp_ops.to_has_all_memory = 1;
+  remote_rdp_ops.to_has_memory = 1;
+  remote_rdp_ops.to_has_stack = 1;
+  remote_rdp_ops.to_has_registers = 1;
+  remote_rdp_ops.to_has_execution = 1;
+  remote_rdp_ops.to_sections = NULL;
+  remote_rdp_ops.to_sections_end = NULL;
+  remote_rdp_ops.to_magic = OPS_MAGIC;
 }
 
 void
 _initialize_remote_rdp ()
 {
-  init_remote_rdp_ops() ;
+  init_remote_rdp_ops ();
   add_target (&remote_rdp_ops);
 }
index 013b06baf46f20b55e4b1f249e65fdbe8354c845..ca665ece2babdbcea95361cbe875867a6b698f01 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote target communications for serial-line targets using SDS' protocol.
    Copyright 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This interface was written by studying the behavior of the SDS
    monitor on an ADS 821/860 board, and by consulting the
@@ -53,7 +54,7 @@ static int sds_write_bytes PARAMS ((CORE_ADDR, char *, int));
 
 static int sds_read_bytes PARAMS ((CORE_ADDR, char *, int));
 
-static void sds_files_info PARAMS ((struct target_ops *ignore));
+static void sds_files_info PARAMS ((struct target_ops * ignore));
 
 static int sds_xfer_memory PARAMS ((CORE_ADDR, char *,
                                    int, int, struct target_ops *));
@@ -142,8 +143,8 @@ static int next_msg_id;
 static int just_started;
 
 static int message_pending;
-
 \f
+
 /* Clean up connection to a remote debugger.  */
 
 /* ARGSUSED */
@@ -242,7 +243,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it (we'd be
      in an inconsistent state otherwise).  */
-  if (!catch_errors (sds_start_remote, NULL, 
+  if (!catch_errors (sds_start_remote, NULL,
                     "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     pop_target ();
@@ -284,7 +285,7 @@ fromhex (a)
     return a - '0';
   else if (a >= 'a' && a <= 'f')
     return a - 'a' + 10;
-  else 
+  else
     error ("Reply contains invalid hex digit %d", a);
 }
 
@@ -295,9 +296,9 @@ tohex (nib)
      int nib;
 {
   if (nib < 10)
-    return '0'+nib;
+    return '0' + nib;
   else
-    return 'a'+nib-10;
+    return 'a' + nib - 10;
 }
 
 static int
@@ -317,13 +318,13 @@ tob64 (inbuf, outbuf, len)
     {
       /* Collect the next three bytes into a number.  */
       sum = ((long) *inbuf++) << 16;
-      sum |= ((long) *inbuf++) <<  8;
+      sum |= ((long) *inbuf++) << 8;
       sum |= ((long) *inbuf++);
 
       /* Spit out 4 6-bit encodings.  */
       *p++ = ((sum >> 18) & 0x3f) + '0';
       *p++ = ((sum >> 12) & 0x3f) + '0';
-      *p++ = ((sum >>  6) & 0x3f) + '0';
+      *p++ = ((sum >> 6) & 0x3f) + '0';
       *p++ = (sum & 0x3f) + '0';
     }
   return (p - outbuf);
@@ -342,22 +343,22 @@ fromb64 (inbuf, outbuf, len)
   for (i = 0; i < len; i += 4)
     {
       /* Collect 4 6-bit digits.  */
-      sum  = (*inbuf++ - '0') << 18;
+      sum = (*inbuf++ - '0') << 18;
       sum |= (*inbuf++ - '0') << 12;
-      sum |= (*inbuf++ - '0') <<  6;
+      sum |= (*inbuf++ - '0') << 6;
       sum |= (*inbuf++ - '0');
 
       /* Now take the resulting 24-bit number and get three bytes out
          of it.  */
       *outbuf++ = (sum >> 16) & 0xff;
-      *outbuf++ = (sum >>  8) & 0xff;
+      *outbuf++ = (sum >> 8) & 0xff;
       *outbuf++ = sum & 0xff;
     }
 
   return (len / 4) * 3;
 }
-
 \f
+
 /* Tell the remote machine to resume.  */
 
 static enum target_signal last_sent_signal = TARGET_SIGNAL_0;
@@ -376,7 +377,7 @@ sds_resume (pid, step, siggnal)
   last_sent_step = step;
 
   buf[0] = (step ? 21 : 20);
-  buf[1] = 0;  /* (should be signal?) */
+  buf[1] = 0;                  /* (should be signal?) */
 
   sds_send (buf, 2);
 }
@@ -392,7 +393,7 @@ sds_interrupt (signo)
 
   /* If this doesn't work, try more severe steps.  */
   signal (signo, sds_interrupt_twice);
-  
+
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "sds_interrupt called\n");
 
@@ -400,7 +401,7 @@ sds_interrupt (signo)
   sds_send (buf, 1);
 }
 
-static void (*ofunc)();
+static void (*ofunc) ();
 
 /* The user typed ^C twice.  */
 
@@ -409,7 +410,7 @@ sds_interrupt_twice (signo)
      int signo;
 {
   signal (signo, ofunc);
-  
+
   interrupt_query ();
 
   signal (signo, sds_interrupt);
@@ -481,7 +482,7 @@ sds_wait (pid, status)
          goto got_status;
        }
     }
- got_status:
+got_status:
   return inferior_pid;
 }
 
@@ -524,17 +525,17 @@ sds_fetch_registers (regno)
   /* (should warn about reply too short) */
 
   for (i = 0; i < NUM_REGS; i++)
-    supply_register (i, &regs[REGISTER_BYTE(i)]);
+    supply_register (i, &regs[REGISTER_BYTE (i)]);
 }
 
 /* Prepare to store registers.  Since we may send them all, we have to
    read out the ones we don't want to change first.  */
 
-static void 
+static void
 sds_prepare_to_store ()
 {
   /* Make sure the entire registers array is valid.  */
-  read_register_bytes (0, (char *)NULL, REGISTER_BYTES);
+  read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
 }
 
 /* Store register REGNO, or all registers if REGNO == -1, from the contents
@@ -607,8 +608,8 @@ sds_write_bytes (memaddr, myaddr, len)
       buf[1] = 0;
       buf[2] = (int) (memaddr >> 24) & 0xff;
       buf[3] = (int) (memaddr >> 16) & 0xff;
-      buf[4] = (int) (memaddr >>  8) & 0xff;
-      buf[5] = (int) (memaddr      ) & 0xff;
+      buf[4] = (int) (memaddr >> 8) & 0xff;
+      buf[5] = (int) (memaddr) & 0xff;
       buf[6] = 1;
       buf[7] = 0;
 
@@ -658,10 +659,10 @@ sds_read_bytes (memaddr, myaddr, len)
       buf[1] = 0;
       buf[2] = (int) (memaddr >> 24) & 0xff;
       buf[3] = (int) (memaddr >> 16) & 0xff;
-      buf[4] = (int) (memaddr >>  8) & 0xff;
-      buf[5] = (int) (memaddr      ) & 0xff;
+      buf[4] = (int) (memaddr >> 8) & 0xff;
+      buf[5] = (int) (memaddr) & 0xff;
       buf[6] = (int) (todo >> 8) & 0xff;
-      buf[7] = (int) (todo     ) & 0xff;
+      buf[7] = (int) (todo) & 0xff;
       buf[8] = 1;
 
       retlen = sds_send (buf, 9);
@@ -691,17 +692,17 @@ sds_read_bytes (memaddr, myaddr, len)
 
 /* ARGSUSED */
 static int
-sds_xfer_memory(memaddr, myaddr, len, should_write, target)
+sds_xfer_memory (memaddr, myaddr, len, should_write, target)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   return dcache_xfer_memory (sds_dcache, memaddr, myaddr, len, should_write);
 }
-
 \f
+
 static void
 sds_files_info (ignore)
      struct target_ops *ignore;
@@ -787,7 +788,7 @@ putmessage (buf, len)
      and giving it a checksum.  */
 
   if (len > 170)               /* Prosanity check */
-    abort();
+    abort ();
 
   if (remote_debug)
     {
@@ -803,7 +804,7 @@ putmessage (buf, len)
   if (len % 3 != 0)
     {
       buf[len] = '\0';
-      buf[len+1] = '\0';
+      buf[len + 1] = '\0';
     }
 
   header[1] = next_msg_id;
@@ -938,12 +939,12 @@ getmessage (buf, forever)
   for (tries = 1; tries <= MAX_TRIES; tries++)
     {
       /* This can loop forever if the remote side sends us characters
-        continuously, but if it pauses, we'll get a zero from readchar
-        because of timeout.  Then we'll count that as a retry.  */
+         continuously, but if it pauses, we'll get a zero from readchar
+         because of timeout.  Then we'll count that as a retry.  */
 
       /* Note that we will only wait forever prior to the start of a packet.
-        After that, we expect characters to arrive at a brisk pace.  They
-        should show up within sds_timeout intervals.  */
+         After that, we expect characters to arrive at a brisk pace.  They
+         should show up within sds_timeout intervals.  */
 
       do
        {
@@ -964,7 +965,7 @@ getmessage (buf, forever)
       while (c != '$' && c != '{');
 
       /* We might have seen a "trigraph", a sequence of three characters
-        that indicate various sorts of communication state.  */
+         that indicate various sorts of communication state.  */
 
       if (c == '{')
        {
@@ -977,7 +978,7 @@ getmessage (buf, forever)
          if (c3 == '+')
            {
              message_pending = 1;
-             return 0; /*????*/
+             return 0;         /*???? */
            }
          continue;
        }
@@ -998,7 +999,7 @@ getmessage (buf, forever)
 
          if (csum != header[0])
            fprintf_unfiltered (gdb_stderr,
-                               "Checksum mismatch: computed %d, received %d\n",
+                           "Checksum mismatch: computed %d, received %d\n",
                                csum, header[0]);
 
          if (header[2] == 0xff)
@@ -1007,7 +1008,7 @@ getmessage (buf, forever)
          if (remote_debug)
            {
              fprintf_unfiltered (gdb_stdlog,
-                                 "... (Got checksum %d, id %d, length %d)\n",
+                               "... (Got checksum %d, id %d, length %d)\n",
                                  header[0], header[1], header[2]);
              fprintf_unfiltered (gdb_stdlog, "Message received: \"");
              for (i = 0; i < len; ++i)
@@ -1062,8 +1063,8 @@ sds_create_inferior (exec_file, args, env)
 
 static void
 sds_load (filename, from_tty)
-    char *filename;
-    int from_tty;
+     char *filename;
+     int from_tty;
 {
   generic_load (filename, from_tty);
 
@@ -1087,9 +1088,9 @@ sds_insert_breakpoint (addr, contents_cache)
   *p++ = 0;
   *p++ = (int) (addr >> 24) & 0xff;
   *p++ = (int) (addr >> 16) & 0xff;
-  *p++ = (int) (addr >>  8) & 0xff;
-  *p++ = (int) (addr      ) & 0xff;
-  
+  *p++ = (int) (addr >> 8) & 0xff;
+  *p++ = (int) (addr) & 0xff;
+
   retlen = sds_send (buf, p - buf);
 
   for (i = 0; i < 4; ++i)
@@ -1111,8 +1112,8 @@ sds_remove_breakpoint (addr, contents_cache)
   *p++ = 0;
   *p++ = (int) (addr >> 24) & 0xff;
   *p++ = (int) (addr >> 16) & 0xff;
-  *p++ = (int) (addr >>  8) & 0xff;
-  *p++ = (int) (addr      ) & 0xff;
+  *p++ = (int) (addr >> 8) & 0xff;
+  *p++ = (int) (addr) & 0xff;
   for (i = 0; i < 4; ++i)
     *p++ = contents_cache[i];
 
@@ -1121,7 +1122,7 @@ sds_remove_breakpoint (addr, contents_cache)
   return 0;
 }
 \f
-static void 
+static void
 init_sds_ops ()
 {
   sds_ops.to_shortname = "sds";
@@ -1182,7 +1183,7 @@ sds_command (args, from_tty)
   for (i = 0; i < retlen; ++i)
     {
       printf_filtered ("%02x", buf[i]);
-    }  
+    }
   printf_filtered ("\n");
 }
 
@@ -1193,10 +1194,10 @@ _initialize_remote_sds ()
   add_target (&sds_ops);
 
   add_show_from_set (add_set_cmd ("sdstimeout", no_class,
-                                 var_integer, (char *)&sds_timeout,
-                                 "Set timeout value for sds read.\n", &setlist),
+                                 var_integer, (char *) &sds_timeout,
+                            "Set timeout value for sds read.\n", &setlist),
                     &showlist);
 
   add_com ("sds", class_obscure, sds_command,
-          "Send a command to the SDS monitor."); 
+          "Send a command to the SDS monitor.");
 }
index 8923aec658d2502eae284c6de05d79acef0718c0..5364066ef19cd65333ef63280caa9afd329c1bb2 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by Cygnus Support.
    Steve Chamberlain (sac@cygnus.com).
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -60,13 +61,13 @@ static void gdb_os_flush_stderr PARAMS ((host_callback *));
 static int gdb_os_poll_quit PARAMS ((host_callback *));
 
 /* printf_filtered is depreciated */
-static void gdb_os_printf_filtered PARAMS ((host_callback *, const char *, ...));
+static void gdb_os_printf_filtered PARAMS ((host_callback *, const char *,...));
 
 static void gdb_os_vprintf_filtered PARAMS ((host_callback *, const char *, va_list));
 
 static void gdb_os_evprintf_filtered PARAMS ((host_callback *, const char *, va_list));
 
-static void gdb_os_error PARAMS ((host_callback *, const char *, ...));
+static void gdb_os_error PARAMS ((host_callback *, const char *,...));
 
 static void gdbsim_fetch_register PARAMS ((int regno));
 
@@ -86,16 +87,16 @@ static void gdbsim_detach PARAMS ((char *args, int from_tty));
 
 static void gdbsim_resume PARAMS ((int pid, int step, enum target_signal siggnal));
 
-static int gdbsim_wait PARAMS ((int pid, struct target_waitstatus *status));
+static int gdbsim_wait PARAMS ((int pid, struct target_waitstatus * status));
 
 static void gdbsim_prepare_to_store PARAMS ((void));
 
 static int gdbsim_xfer_inferior_memory PARAMS ((CORE_ADDR memaddr,
                                                char *myaddr, int len,
                                                int write,
-                                               struct target_ops *target));
+                                               struct target_ops * target));
 
-static void gdbsim_files_info PARAMS ((struct target_ops *target));
+static void gdbsim_files_info PARAMS ((struct target_ops * target));
 
 static void gdbsim_mourn_inferior PARAMS ((void));
 
@@ -152,7 +153,7 @@ static int callbacks_initialized = 0;
 static void
 init_callbacks ()
 {
-  if (! callbacks_initialized)
+  if (!callbacks_initialized)
     {
       gdb_callback = default_callback;
       gdb_callback.init (&gdb_callback);
@@ -184,7 +185,7 @@ end_callbacks ()
 
 /* GDB version of os_write_stdout callback.  */
 
-static int 
+static int
 gdb_os_write_stdout (p, buf, len)
      host_callback *p;
      const char *buf;
@@ -193,7 +194,7 @@ gdb_os_write_stdout (p, buf, len)
   int i;
   char b[2];
 
-  for (i = 0; i < len; i++) 
+  for (i = 0; i < len; i++)
     {
       b[0] = buf[i];
       b[1] = 0;
@@ -213,7 +214,7 @@ gdb_os_flush_stdout (p)
 
 /* GDB version of os_write_stderr callback.  */
 
-static int 
+static int
 gdb_os_write_stderr (p, buf, len)
      host_callback *p;
      const char *buf;
@@ -222,7 +223,7 @@ gdb_os_write_stderr (p, buf, len)
   int i;
   char b[2];
 
-  for (i = 0; i < len; i++) 
+  for (i = 0; i < len; i++)
     {
       b[0] = buf[i];
       b[1] = 0;
@@ -245,7 +246,7 @@ gdb_os_flush_stderr (p)
 /* VARARGS */
 static void
 #ifdef ANSI_PROTOTYPES
-gdb_os_printf_filtered (host_callback *p, const char *format, ...)
+gdb_os_printf_filtered (host_callback * p, const char *format,...)
 #else
 gdb_os_printf_filtered (p, va_alist)
      host_callback *p;
@@ -272,7 +273,7 @@ gdb_os_printf_filtered (p, va_alist)
 /* VARARGS */
 static void
 #ifdef ANSI_PROTOTYPES
-gdb_os_vprintf_filtered (host_callback *p, const char *format, va_list ap)
+gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
 #else
 gdb_os_vprintf_filtered (p, format, ap)
      host_callback *p;
@@ -288,7 +289,7 @@ gdb_os_vprintf_filtered (p, format, ap)
 /* VARARGS */
 static void
 #ifdef ANSI_PROTOTYPES
-gdb_os_evprintf_filtered (host_callback *p, const char *format, va_list ap)
+gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
 #else
 gdb_os_evprintf_filtered (p, format, ap)
      host_callback *p;
@@ -304,7 +305,7 @@ gdb_os_evprintf_filtered (p, format, ap)
 /* VARARGS */
 static void
 #ifdef ANSI_PROTOTYPES
-gdb_os_error (host_callback *p, const char *format, ...)
+gdb_os_error (host_callback * p, const char *format,...)
 #else
 gdb_os_error (p, va_alist)
      host_callback *p;
@@ -313,7 +314,7 @@ gdb_os_error (p, va_alist)
 {
   if (error_hook)
     (*error_hook) ();
-  else 
+  else
     {
       va_list args;
 #ifdef ANSI_PROTOTYPES
@@ -338,7 +339,7 @@ gdbsim_fetch_register (regno)
      int regno;
 {
   static int warn_user = 1;
-  if (regno == -1) 
+  if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
        gdbsim_fetch_register (regno);
@@ -373,7 +374,7 @@ static void
 gdbsim_store_register (regno)
      int regno;
 {
-  if (regno  == -1) 
+  if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
        gdbsim_store_register (regno);
@@ -451,25 +452,25 @@ gdbsim_create_inferior (exec_file, args, env)
      char **env;
 {
   int len;
-  char *arg_buf,**argv;
+  char *arg_buf, **argv;
 
   if (exec_file == 0 || exec_bfd == 0)
     warning ("No executable file specified.");
-  if (! program_loaded)
+  if (!program_loaded)
     warning ("No program loaded.");
 
   if (sr_get_debug ())
     printf_filtered ("gdbsim_create_inferior: exec_file \"%s\", args \"%s\"\n",
-                    (exec_file ? exec_file: "(NULL)"),
+                    (exec_file ? exec_file : "(NULL)"),
                     args);
 
-  gdbsim_kill ();       
+  gdbsim_kill ();
   remove_breakpoints ();
   init_wait_for_inferior ();
 
   if (exec_file != NULL)
     {
-      len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop*/ 10;
+      len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10;
       arg_buf = (char *) alloca (len);
       arg_buf[0] = '\0';
       strcat (arg_buf, exec_file);
@@ -483,12 +484,12 @@ gdbsim_create_inferior (exec_file, args, env)
   sim_create_inferior (gdbsim_desc, exec_bfd, argv, env);
 
   inferior_pid = 42;
-  insert_breakpoints (); /* Needed to get correct instruction in cache */
+  insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   clear_proceed_status ();
 
   /* NB: Entry point already set by sim_create_inferior. */
-  proceed ((CORE_ADDR)-1, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* The open routine takes the rest of the parameters from the command,
@@ -517,13 +518,13 @@ gdbsim_open (args, from_tty)
   if (gdbsim_desc != NULL)
     unpush_target (&gdbsim_ops);
 
-  len = (7 + 1 /* gdbsim */
+  len = (7 + 1                 /* gdbsim */
         + strlen (" -E little")
         + strlen (" --architecture=xxxxxxxxxx")
         + (args ? strlen (args) : 0)
-        + 50) /* slack */;
+        + 50) /* slack */ ;
   arg_buf = (char *) alloca (len);
-  strcpy (arg_buf, "gdbsim"); /* 7 */
+  strcpy (arg_buf, "gdbsim");  /* 7 */
   /* Specify the byte order for the target when it is both selectable
      and explicitly specified by the user (not auto detected). */
   if (TARGET_BYTE_ORDER_SELECTABLE_P
@@ -551,7 +552,7 @@ gdbsim_open (args, from_tty)
   /* finally, any explicit args */
   if (args)
     {
-      strcat (arg_buf, " "); /* 1 */
+      strcat (arg_buf, " ");   /* 1 */
       strcat (arg_buf, args);
     }
   argv = buildargv (arg_buf);
@@ -607,7 +608,7 @@ gdbsim_close (quitting)
    Use this when you want to detach and do something else with your gdb.  */
 
 static void
-gdbsim_detach (args,from_tty)
+gdbsim_detach (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -618,7 +619,7 @@ gdbsim_detach (args,from_tty)
   if (from_tty)
     printf_filtered ("Ending simulator %s debugging\n", target_shortname);
 }
+
 /* Resume execution of the target process.  STEP says whether to single-step
    or to run free; SIGGNAL is the signal value (e.g. SIGINT) to be given
    to the target, or zero for no signal.  */
@@ -642,7 +643,7 @@ gdbsim_resume (pid, step, siggnal)
 }
 
 /* Notify the simulator of an asynchronous request to stop.
-   
+
    The simulator shall ensure that the stop request is eventually
    delivered to the simulator.  If the call is made while the
    simulator is not running then the stop request is processed when
@@ -653,7 +654,7 @@ gdbsim_resume (pid, step, siggnal)
 static void
 gdbsim_stop ()
 {
-  if (! sim_stop (gdbsim_desc))
+  if (!sim_stop (gdbsim_desc))
     {
       quit ();
     }
@@ -670,9 +671,9 @@ gdb_os_poll_quit (p)
     ui_loop_hook (0);
 
   notice_quit ();
-  if (quit_flag) /* gdb's idea of quit */
+  if (quit_flag)               /* gdb's idea of quit */
     {
-      quit_flag = 0; /* we've stolen it */
+      quit_flag = 0;           /* we've stolen it */
       return 1;
     }
   else if (immediate_quit)
@@ -749,7 +750,7 @@ gdbsim_wait (pid, status)
     case sim_signalled:
       status->kind = TARGET_WAITKIND_SIGNALLED;
       /* The signal in sigrc is a host signal.  That probably
-        should be fixed.  */
+         should be fixed.  */
       status->value.sig = target_signal_from_host (sigrc);
       break;
     case sim_running:
@@ -779,9 +780,9 @@ gdbsim_xfer_inferior_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
-  if (! program_loaded)
+  if (!program_loaded)
     error ("No program loaded.");
 
   if (sr_get_debug ())
@@ -789,19 +790,19 @@ gdbsim_xfer_inferior_memory (memaddr, myaddr, len, write, target)
       printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x%x, memaddr 0x%x, len %d, write %d\n",
                       myaddr, memaddr, len, write);
       if (sr_get_debug () && write)
-       dump_mem(myaddr, len);
+       dump_mem (myaddr, len);
     }
 
   if (write)
     {
       len = sim_write (gdbsim_desc, memaddr, myaddr, len);
     }
-  else 
+  else
     {
       len = sim_read (gdbsim_desc, memaddr, myaddr, len);
       if (sr_get_debug () && len > 0)
-       dump_mem(myaddr, len);
-    } 
+       dump_mem (myaddr, len);
+    }
   return len;
 }
 
@@ -828,8 +829,8 @@ gdbsim_files_info (target)
 /* Clear the simulator's notion of what the break points are.  */
 
 static void
-gdbsim_mourn_inferior () 
-{ 
+gdbsim_mourn_inferior ()
+{
   if (sr_get_debug ())
     printf_filtered ("gdbsim_mourn_inferior:\n");
 
@@ -914,45 +915,45 @@ simulator_command (args, from_tty)
 
   /* Invalidate the register cache, in case the simulator command does
      something funny. */
-  registers_changed (); 
+  registers_changed ();
 }
 
 /* Define the target subroutine names */
 
-struct target_ops gdbsim_ops ;
-
-static void 
-init_gdbsim_ops(void)
-{
-  gdbsim_ops.to_shortname =   "sim";           
-  gdbsim_ops.to_longname =   "simulator";              
-  gdbsim_ops.to_doc =   "Use the compiled-in simulator.";  
-  gdbsim_ops.to_open =   gdbsim_open;          
-  gdbsim_ops.to_close =   gdbsim_close;                
-  gdbsim_ops.to_attach =   NULL;
-  gdbsim_ops.to_post_attach = NULL;  
-  gdbsim_ops.to_require_attach = NULL; 
-  gdbsim_ops.to_detach =   gdbsim_detach;
-  gdbsim_ops.to_require_detach = NULL; 
-  gdbsim_ops.to_resume =   gdbsim_resume;      
-  gdbsim_ops.to_wait  =   gdbsim_wait;
-  gdbsim_ops.to_post_wait = NULL;              
-  gdbsim_ops.to_fetch_registers  =   gdbsim_fetch_register;
-  gdbsim_ops.to_store_registers  =   gdbsim_store_register;
-  gdbsim_ops.to_prepare_to_store =   gdbsim_prepare_to_store;
-  gdbsim_ops.to_xfer_memory  =   gdbsim_xfer_inferior_memory;
-  gdbsim_ops.to_files_info  =   gdbsim_files_info;     
-  gdbsim_ops.to_insert_breakpoint =   gdbsim_insert_breakpoint;
-  gdbsim_ops.to_remove_breakpoint =   gdbsim_remove_breakpoint;
-  gdbsim_ops.to_terminal_init  =   NULL;               
-  gdbsim_ops.to_terminal_inferior =   NULL;            
-  gdbsim_ops.to_terminal_ours_for_output =   NULL;
-  gdbsim_ops.to_terminal_ours  =   NULL;
-  gdbsim_ops.to_terminal_info  =   NULL;
-  gdbsim_ops.to_kill  =   gdbsim_kill; 
-  gdbsim_ops.to_load  =   gdbsim_load; 
-  gdbsim_ops.to_lookup_symbol =   NULL;        
-  gdbsim_ops.to_create_inferior =   gdbsim_create_inferior;
+struct target_ops gdbsim_ops;
+
+static void
+init_gdbsim_ops (void)
+{
+  gdbsim_ops.to_shortname = "sim";
+  gdbsim_ops.to_longname = "simulator";
+  gdbsim_ops.to_doc = "Use the compiled-in simulator.";
+  gdbsim_ops.to_open = gdbsim_open;
+  gdbsim_ops.to_close = gdbsim_close;
+  gdbsim_ops.to_attach = NULL;
+  gdbsim_ops.to_post_attach = NULL;
+  gdbsim_ops.to_require_attach = NULL;
+  gdbsim_ops.to_detach = gdbsim_detach;
+  gdbsim_ops.to_require_detach = NULL;
+  gdbsim_ops.to_resume = gdbsim_resume;
+  gdbsim_ops.to_wait = gdbsim_wait;
+  gdbsim_ops.to_post_wait = NULL;
+  gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
+  gdbsim_ops.to_store_registers = gdbsim_store_register;
+  gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
+  gdbsim_ops.to_xfer_memory = gdbsim_xfer_inferior_memory;
+  gdbsim_ops.to_files_info = gdbsim_files_info;
+  gdbsim_ops.to_insert_breakpoint = gdbsim_insert_breakpoint;
+  gdbsim_ops.to_remove_breakpoint = gdbsim_remove_breakpoint;
+  gdbsim_ops.to_terminal_init = NULL;
+  gdbsim_ops.to_terminal_inferior = NULL;
+  gdbsim_ops.to_terminal_ours_for_output = NULL;
+  gdbsim_ops.to_terminal_ours = NULL;
+  gdbsim_ops.to_terminal_info = NULL;
+  gdbsim_ops.to_kill = gdbsim_kill;
+  gdbsim_ops.to_load = gdbsim_load;
+  gdbsim_ops.to_lookup_symbol = NULL;
+  gdbsim_ops.to_create_inferior = gdbsim_create_inferior;
   gdbsim_ops.to_post_startup_inferior = NULL;
   gdbsim_ops.to_acknowledge_created_inferior = NULL;
   gdbsim_ops.to_clone_and_follow_inferior = NULL;
@@ -970,23 +971,23 @@ init_gdbsim_ops(void)
   gdbsim_ops.to_has_execd = NULL;
   gdbsim_ops.to_reported_exec_events_per_exec_call = NULL;
   gdbsim_ops.to_has_exited = NULL;
-  gdbsim_ops.to_mourn_inferior =   gdbsim_mourn_inferior;
-  gdbsim_ops.to_can_run  =   0;                        
-  gdbsim_ops.to_notice_signals =   0;          
-  gdbsim_ops.to_thread_alive  =   0;           
-  gdbsim_ops.to_stop  =   gdbsim_stop;
-  gdbsim_ops.to_pid_to_exec_file = NULL;       
-  gdbsim_ops.to_core_file_to_sym_file = NULL;  
-  gdbsim_ops.to_stratum =   process_stratum;   
-  gdbsim_ops.DONT_USE =   NULL;                
-  gdbsim_ops.to_has_all_memory =   1;  
-  gdbsim_ops.to_has_memory =   1;      
-  gdbsim_ops.to_has_stack =   1;       
-  gdbsim_ops.to_has_registers =   1;   
-  gdbsim_ops.to_has_execution =   1;   
-  gdbsim_ops.to_sections =   NULL;     
-  gdbsim_ops.to_sections_end =   NULL; 
-  gdbsim_ops.to_magic =   OPS_MAGIC;   
+  gdbsim_ops.to_mourn_inferior = gdbsim_mourn_inferior;
+  gdbsim_ops.to_can_run = 0;
+  gdbsim_ops.to_notice_signals = 0;
+  gdbsim_ops.to_thread_alive = 0;
+  gdbsim_ops.to_stop = gdbsim_stop;
+  gdbsim_ops.to_pid_to_exec_file = NULL;
+  gdbsim_ops.to_core_file_to_sym_file = NULL;
+  gdbsim_ops.to_stratum = process_stratum;
+  gdbsim_ops.DONT_USE = NULL;
+  gdbsim_ops.to_has_all_memory = 1;
+  gdbsim_ops.to_has_memory = 1;
+  gdbsim_ops.to_has_stack = 1;
+  gdbsim_ops.to_has_registers = 1;
+  gdbsim_ops.to_has_execution = 1;
+  gdbsim_ops.to_sections = NULL;
+  gdbsim_ops.to_sections_end = NULL;
+  gdbsim_ops.to_magic = OPS_MAGIC;
 
 #ifdef TARGET_REDEFINE_DEFAULT_OPS
   TARGET_REDEFINE_DEFAULT_OPS (&gdbsim_ops);
@@ -996,9 +997,9 @@ init_gdbsim_ops(void)
 void
 _initialize_remote_sim ()
 {
-  init_gdbsim_ops() ;
+  init_gdbsim_ops ();
   add_target (&gdbsim_ops);
 
   add_com ("sim <command>", class_obscure, simulator_command,
-          "Send a command to the simulator."); 
+          "Send a command to the simulator.");
 }
index 1efdbfac0276eaf641fdd2a0e43e9f05fe37bc7b..79c6b425f329cc0c796a1bb31251f4d760b95254 100644 (file)
@@ -2,27 +2,28 @@
    Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by Jim Kingdon for Cygnus.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* 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 an esoteric situation--
+   "This is like remote.c but is for an esoteric situation--
    having an a29k board in a PC hooked up to a unix machine with
    a serial line, and running ctty com1 on the PC, through which
    the unix machine can run ebmon.  Not to mention that the PC
@@ -48,11 +49,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/types.h>
 #include "serial.h"
 
-extern struct target_ops st2000_ops;           /* Forward declaration */
+extern struct target_ops st2000_ops;   /* Forward declaration */
 
-static void st2000_close();
-static void st2000_fetch_register();
-static void st2000_store_register();
+static void st2000_close ();
+static void st2000_fetch_register ();
+static void st2000_store_register ();
 
 #define LOG_FILE "st2000.log"
 #if defined (LOG_FILE)
@@ -71,9 +72,9 @@ static serial_t st2000_desc;
 
 static void
 #ifdef ANSI_PROTOTYPES
-printf_stdebug(char *pattern, ...)
+printf_stdebug (char *pattern,...)
 #else
-printf_stdebug(va_alist)
+printf_stdebug (va_alist)
      va_dcl
 #endif
 {
@@ -81,33 +82,33 @@ printf_stdebug(va_alist)
   char buf[200];
 
 #ifdef ANSI_PROTOTYPES
-  va_start(args, pattern);
+  va_start (args, pattern);
 #else
   char *pattern;
-  va_start(args);
-  pattern = va_arg(args, char *);
+  va_start (args);
+  pattern = va_arg (args, char *);
 #endif
 
-  vsprintf(buf, pattern, args);
-  va_end(args);
+  vsprintf (buf, pattern, args);
+  va_end (args);
 
-  if (SERIAL_WRITE(st2000_desc, buf, strlen(buf)))
-    fprintf(stderr, "SERIAL_WRITE failed: %s\n", safe_strerror(errno));
+  if (SERIAL_WRITE (st2000_desc, buf, strlen (buf)))
+    fprintf (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(timeout)
+readchar (timeout)
      int timeout;
 {
   int c;
 
-  c = SERIAL_READCHAR(st2000_desc, timeout);
+  c = SERIAL_READCHAR (st2000_desc, timeout);
 
 #ifdef LOG_FILE
-  putc(c & 0x7f, log_file);
+  putc (c & 0x7f, log_file);
 #endif
 
   if (c >= 0)
@@ -118,17 +119,17 @@ readchar(timeout)
       if (timeout == 0)
        return c;               /* Polls shouldn't generate timeout errors */
 
-      error("Timeout reading from remote system.");
+      error ("Timeout reading from remote system.");
     }
 
-  perror_with_name("remote-st2000");
+  perror_with_name ("remote-st2000");
 }
 
 /* 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(string, discard)
+expect (string, discard)
      char *string;
      int discard;
 {
@@ -138,7 +139,7 @@ expect(string, discard)
   immediate_quit = 1;
   while (1)
     {
-      c = readchar(timeout);
+      c = readchar (timeout);
       if (c == *p++)
        {
          if (*p == '\0')
@@ -151,9 +152,9 @@ expect(string, discard)
        {
          if (!discard)
            {
-             fwrite(string, 1, (p - 1) - string, stdout);
-             putchar((char)c);
-             fflush(stdout);
+             fwrite (string, 1, (p - 1) - string, stdout);
+             putchar ((char) c);
+             fflush (stdout);
            }
          p = string;
        }
@@ -175,13 +176,13 @@ expect(string, discard)
    necessary to prevent getting into states from which we can't
    recover.  */
 static void
-expect_prompt(discard)
+expect_prompt (discard)
      int discard;
 {
 #if defined (LOG_FILE)
   /* 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);
+  fflush (log_file);
 #endif
   expect ("dbug> ", discard);
 }
@@ -189,13 +190,13 @@ 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(ignore_space)
+get_hex_digit (ignore_space)
      int ignore_space;
 {
   int ch;
   while (1)
     {
-      ch = readchar(timeout);
+      ch = readchar (timeout);
       if (ch >= '0' && ch <= '9')
        return ch - '0';
       else if (ch >= 'A' && ch <= 'F')
@@ -206,8 +207,8 @@ get_hex_digit(ignore_space)
        ;
       else
        {
-         expect_prompt(1);
-         error("Invalid hex digit from remote system.");
+         expect_prompt (1);
+         error ("Invalid hex digit from remote system.");
        }
     }
 }
@@ -238,7 +239,7 @@ get_hex_regs (n, regno)
   for (i = 0; i < n; i++)
     {
       int j;
-      
+
       val = 0;
       for (j = 0; j < 8; j++)
        val = (val << 4) + get_hex_digit (j == 0);
@@ -257,10 +258,10 @@ st2000_create_inferior (execfile, args, env)
   int entry_pt;
 
   if (args && *args)
-    error("Can't pass arguments to remote STDEBUG process");
+    error ("Can't pass arguments to remote STDEBUG process");
 
   if (execfile == 0 || exec_bfd == 0)
-    error("No executable file specified");
+    error ("No executable file specified");
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
@@ -281,7 +282,7 @@ st2000_create_inferior (execfile, args, env)
 
   /* insert_step_breakpoint ();  FIXME, do we need this?  */
   /* Let 'er rip... */
-  proceed ((CORE_ADDR)entry_pt, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* Open a connection to a remote debugger.
@@ -291,33 +292,33 @@ static int baudrate = 9600;
 static char dev_name[100];
 
 static void
-st2000_open(args, from_tty)
+st2000_open (args, from_tty)
      char *args;
      int from_tty;
 {
   int n;
   char junk[100];
 
-  target_preopen(from_tty);
-  
-  n = sscanf(args, " %s %d %s", dev_name, &baudrate, junk);
+  target_preopen (from_tty);
+
+  n = sscanf (args, " %s %d %s", dev_name, &baudrate, junk);
 
   if (n != 2)
-    error("Bad arguments.  Usage: target st2000 <device> <speed>\n\
+    error ("Bad arguments.  Usage: target st2000 <device> <speed>\n\
 or target st2000 <host> <port>\n");
 
-  st2000_close(0);
+  st2000_close (0);
 
-  st2000_desc = SERIAL_OPEN(dev_name);
+  st2000_desc = SERIAL_OPEN (dev_name);
 
   if (!st2000_desc)
-    perror_with_name(dev_name);
+    perror_with_name (dev_name);
 
-  SERIAL_SETBAUDRATE(st2000_desc, baudrate);
+  SERIAL_SETBAUDRATE (st2000_desc, baudrate);
 
-  SERIAL_RAW(st2000_desc);
+  SERIAL_RAW (st2000_desc);
 
-  push_target(&st2000_ops);
+  push_target (&st2000_ops);
 
 #if defined (LOG_FILE)
   log_file = fopen (LOG_FILE, "w");
@@ -326,13 +327,13 @@ or target st2000 <host> <port>\n");
 #endif
 
   /* Hello?  Are you there?  */
-  printf_stdebug("\003");      /* ^C wakes up dbug */
-  
-  expect_prompt(1);
+  printf_stdebug ("\003");     /* ^C wakes up dbug */
+
+  expect_prompt (1);
 
   if (from_tty)
-    printf("Remote %s connected to %s\n", target_shortname,
-          dev_name);
+    printf ("Remote %s connected to %s\n", target_shortname,
+           dev_name);
 }
 
 /* Close out all files and local state before this target loses control. */
@@ -341,15 +342,16 @@ static void
 st2000_close (quitting)
      int quitting;
 {
-  SERIAL_CLOSE(st2000_desc);
+  SERIAL_CLOSE (st2000_desc);
 
 #if defined (LOG_FILE)
-  if (log_file) {
-    if (ferror(log_file))
-      fprintf(stderr, "Error writing log file.\n");
-    if (fclose(log_file) != 0)
-      fprintf(stderr, "Error closing log file.\n");
-  }
+  if (log_file)
+    {
+      if (ferror (log_file))
+       fprintf (stderr, "Error writing log file.\n");
+      if (fclose (log_file) != 0)
+       fprintf (stderr, "Error closing log file.\n");
+    }
 #endif
 }
 
@@ -360,11 +362,11 @@ static void
 st2000_detach (from_tty)
      int from_tty;
 {
-  pop_target();                /* calls st2000_close to do the real work */
+  pop_target ();               /* calls st2000_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
@@ -398,9 +400,9 @@ st2000_wait (status)
   status->kind = TARGET_WAITKIND_EXITED;
   status->value.integer = 0;
 
-  timeout = 0;         /* Don't time out -- user program is running. */
+  timeout = 0;                 /* Don't time out -- user program is running. */
 
-  expect_prompt(0);    /* Wait for prompt, outputting extraneous text */
+  expect_prompt (0);           /* Wait for prompt, outputting extraneous text */
 
   status->kind = TARGET_WAITKIND_STOPPED;
   status->value.sig = TARGET_SIGNAL_TRAP;
@@ -425,7 +427,7 @@ get_reg_name (regno)
   b = buf;
 
   for (p = REGISTER_NAME (regno); *p; p++)
-    *b++ = toupper(*p);
+    *b++ = toupper (*p);
   *b = '\000';
 
   return buf;
@@ -442,7 +444,7 @@ st2000_fetch_registers ()
      very often...  I'll clean it up later.  */
 
   for (regno = 0; regno <= PC_REGNUM; regno++)
-    st2000_fetch_register(regno);
+    st2000_fetch_register (regno);
 }
 
 /* Fetch register REGNO, or all registers if REGNO is -1.
@@ -473,7 +475,7 @@ st2000_store_registers ()
   int regno;
 
   for (regno = 0; regno <= PC_REGNUM; regno++)
-    st2000_store_register(regno);
+    st2000_store_register (regno);
 
   registers_changed ();
 }
@@ -535,7 +537,7 @@ st2000_write_inferior_memory (memaddr, myaddr, len)
 /* Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns length moved.  */
 static int
-st2000_read_inferior_memory(memaddr, myaddr, len)
+st2000_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
@@ -560,11 +562,12 @@ st2000_read_inferior_memory(memaddr, myaddr, len)
      st2000_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 (((memaddr - 1) + len) < memaddr)
+    {
+      errno = EIO;
+      return 0;
+    }
+
   startaddr = memaddr;
   count = 0;
   while (count < len)
@@ -595,7 +598,7 @@ st2000_xfer_inferior_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   if (write)
     return st2000_write_inferior_memory (memaddr, myaddr, len);
@@ -608,7 +611,7 @@ st2000_kill (args, from_tty)
      char *args;
      int from_tty;
 {
-  return;              /* Ignore attempts to kill target system */
+  return;                      /* Ignore attempts to kill target system */
 }
 
 /* Clean up when a program exits.
@@ -627,7 +630,8 @@ st2000_mourn_inferior ()
 
 #define MAX_STDEBUG_BREAKPOINTS 16
 
-static CORE_ADDR breakaddr[MAX_STDEBUG_BREAKPOINTS] = {0};
+static CORE_ADDR breakaddr[MAX_STDEBUG_BREAKPOINTS] =
+{0};
 
 static int
 st2000_insert_breakpoint (addr, shadow)
@@ -646,12 +650,12 @@ st2000_insert_breakpoint (addr, shadow)
        breakaddr[i] = addr;
 
        st2000_read_inferior_memory (bp_addr, shadow, bp_size);
-       printf_stdebug("BR %x H\r", addr);
-       expect_prompt(1);
+       printf_stdebug ("BR %x H\r", addr);
+       expect_prompt (1);
        return 0;
       }
 
-  fprintf(stderr, "Too many breakpoints (> 16) for STDBUG\n");
+  fprintf (stderr, "Too many breakpoints (> 16) for STDBUG\n");
   return 1;
 }
 
@@ -667,12 +671,12 @@ st2000_remove_breakpoint (addr, shadow)
       {
        breakaddr[i] = 0;
 
-       printf_stdebug("CB %d\r", i);
-       expect_prompt(1);
+       printf_stdebug ("CB %d\r", i);
+       expect_prompt (1);
        return 0;
       }
 
-  fprintf(stderr, "Can't find breakpoint associated with 0x%x\n", addr);
+  fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
   return 1;
 }
 
@@ -682,29 +686,29 @@ st2000_remove_breakpoint (addr, shadow)
 
 static void
 st2000_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   if (!st2000_desc)
-    error("st2000 target not open.");
-  
+    error ("st2000 target not open.");
+
   if (!args)
-    error("Missing command.");
-       
-  printf_stdebug("%s\r", args);
-  expect_prompt(0);
+    error ("Missing command.");
+
+  printf_stdebug ("%s\r", args);
+  expect_prompt (0);
 }
 
 /* Connect the user directly to STDBUG.  This command acts just like the
    'cu' or 'tip' command.  Use <CR>~. or <CR>~^D to break out.  */
 
-/*static struct ttystate ttystate;*/
+/*static struct ttystate ttystate; */
 
 static void
-cleanup_tty()
+cleanup_tty ()
 {
-  printf("\r\n[Exiting connect mode]\r\n");
-/*  SERIAL_RESTORE(0, &ttystate);*/
+  printf ("\r\n[Exiting connect mode]\r\n");
+/*  SERIAL_RESTORE(0, &ttystate); */
 }
 
 #if 0
@@ -712,50 +716,50 @@ cleanup_tty()
 
 static void
 connect_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   fd_set readfds;
   int numfds;
   int c;
   char cur_esc = 0;
 
-  dont_repeat();
+  dont_repeat ();
 
   if (st2000_desc < 0)
-    error("st2000 target not open.");
-  
+    error ("st2000 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");
+    fprintf ("This command takes no args.  They have been ignored.\n");
 
-  serial_raw(0, &ttystate);
+  printf ("[Entering connect mode.  Use ~. or ~^D to escape]\n");
 
-  make_cleanup(cleanup_tty, 0);
+  serial_raw (0, &ttystate);
 
-  FD_ZERO(&readfds);
+  make_cleanup (cleanup_tty, 0);
+
+  FD_ZERO (&readfds);
 
   while (1)
     {
       do
        {
-         FD_SET(0, &readfds);
-         FD_SET(st2000_desc, &readfds);
-         numfds = select(sizeof(readfds)*8, &readfds, 0, 0, 0);
+         FD_SET (0, &readfds);
+         FD_SET (st2000_desc, &readfds);
+         numfds = select (sizeof (readfds) * 8, &readfds, 0, 0, 0);
        }
       while (numfds == 0);
 
       if (numfds < 0)
-       perror_with_name("select");
+       perror_with_name ("select");
 
-      if (FD_ISSET(0, &readfds))
+      if (FD_ISSET (0, &readfds))
        {                       /* tty input, send to stdebug */
-         c = getchar();
+         c = getchar ();
          if (c < 0)
-           perror_with_name("connect");
+           perror_with_name ("connect");
 
-         printf_stdebug("%c", c);
+         printf_stdebug ("%c", c);
          switch (cur_esc)
            {
            case 0:
@@ -776,16 +780,16 @@ connect_command (args, fromtty)
            }
        }
 
-      if (FD_ISSET(st2000_desc, &readfds))
+      if (FD_ISSET (st2000_desc, &readfds))
        {
          while (1)
            {
-             c = readchar(0);
+             c = readchar (0);
              if (c < 0)
                break;
-             putchar(c);
+             putchar (c);
            }
-         fflush(stdout);
+         fflush (stdout);
        }
     }
 }
@@ -793,43 +797,43 @@ connect_command (args, fromtty)
 
 /* Define the target subroutine names */
 
-struct target_ops st2000_ops ;
+struct target_ops st2000_ops;
 
-static void 
-init_st2000_ops(void)
+static void
+init_st2000_ops (void)
 {
-  st2000_ops.to_shortname =   "st2000";
-  st2000_ops.to_longname =   "Remote serial Tandem ST2000 target";
-  st2000_ops.to_doc =   "Use a remote computer running STDEBUG connected by a serial line;\n\
+  st2000_ops.to_shortname = "st2000";
+  st2000_ops.to_longname = "Remote serial Tandem ST2000 target";
+  st2000_ops.to_doc = "Use a remote computer running STDEBUG connected by a serial line;\n\
 or a network connection.\n\
 Arguments are the name of the device for the serial line,\n\
-the speed to connect at in bits per second." ;
-  st2000_ops.to_open =   st2000_open;
-  st2000_ops.to_close =   st2000_close;
-  st2000_ops.to_attach =   0;
+the speed to connect at in bits per second.";
+  st2000_ops.to_open = st2000_open;
+  st2000_ops.to_close = st2000_close;
+  st2000_ops.to_attach = 0;
   st2000_run_ops.to_post_attach = NULL;
   st2000_ops.to_require_attach = NULL;
-  st2000_ops.to_detach =   st2000_detach;
+  st2000_ops.to_detach = st2000_detach;
   st2000_ops.to_require_detach = NULL;
-  st2000_ops.to_resume =   st2000_resume;
-  st2000_ops.to_wait  =   st2000_wait;
+  st2000_ops.to_resume = st2000_resume;
+  st2000_ops.to_wait = st2000_wait;
   st2000_ops.to_post_wait = NULL;
-  st2000_ops.to_fetch_registers  =   st2000_fetch_register;
-  st2000_ops.to_store_registers  =   st2000_store_register;
-  st2000_ops.to_prepare_to_store =   st2000_prepare_to_store;
-  st2000_ops.to_xfer_memory  =   st2000_xfer_inferior_memory;
-  st2000_ops.to_files_info  =   st2000_files_info;
-  st2000_ops.to_insert_breakpoint =   st2000_insert_breakpoint;
-  st2000_ops.to_remove_breakpoint =   st2000_remove_breakpoint;        /* Breakpoints */
-  st2000_ops.to_terminal_init  =   0;
-  st2000_ops.to_terminal_inferior =   0;
-  st2000_ops.to_terminal_ours_for_output =   0;
-  st2000_ops.to_terminal_ours  =   0;
-  st2000_ops.to_terminal_info  =   0;                          /* Terminal handling */
-  st2000_ops.to_kill  =   st2000_kill;
-  st2000_ops.to_load  =   0;                           /* load */
-  st2000_ops.to_lookup_symbol =   0;                           /* lookup_symbol */
-  st2000_ops.to_create_inferior =   st2000_create_inferior;
+  st2000_ops.to_fetch_registers = st2000_fetch_register;
+  st2000_ops.to_store_registers = st2000_store_register;
+  st2000_ops.to_prepare_to_store = st2000_prepare_to_store;
+  st2000_ops.to_xfer_memory = st2000_xfer_inferior_memory;
+  st2000_ops.to_files_info = st2000_files_info;
+  st2000_ops.to_insert_breakpoint = st2000_insert_breakpoint;
+  st2000_ops.to_remove_breakpoint = st2000_remove_breakpoint;  /* Breakpoints */
+  st2000_ops.to_terminal_init = 0;
+  st2000_ops.to_terminal_inferior = 0;
+  st2000_ops.to_terminal_ours_for_output = 0;
+  st2000_ops.to_terminal_ours = 0;
+  st2000_ops.to_terminal_info = 0;     /* Terminal handling */
+  st2000_ops.to_kill = st2000_kill;
+  st2000_ops.to_load = 0;      /* load */
+  st2000_ops.to_lookup_symbol = 0;     /* lookup_symbol */
+  st2000_ops.to_create_inferior = st2000_create_inferior;
   st2000_ops.to_post_startup_inferior = NULL;
   st2000_ops.to_acknowledge_created_inferior = NULL;
   st2000_ops.to_clone_and_follow_inferior = NULL;
@@ -847,29 +851,29 @@ the speed to connect at in bits per second." ;
   st2000_run_ops.to_has_execd = NULL;
   st2000_run_ops.to_reported_exec_events_per_exec_call = NULL;
   st2000_run_ops.to_has_exited = NULL;
-  st2000_ops.to_mourn_inferior =   st2000_mourn_inferior;
-  st2000_ops.to_can_run  =   0;                                /* can_run */
-  st2000_ops.to_notice_signals =   0;                          /* notice_signals */
-  st2000_ops.to_thread_alive  =   0;                            /* thread alive */
-  st2000_ops.to_stop  =   0;                           /* to_stop */
+  st2000_ops.to_mourn_inferior = st2000_mourn_inferior;
+  st2000_ops.to_can_run = 0;   /* can_run */
+  st2000_ops.to_notice_signals = 0;    /* notice_signals */
+  st2000_ops.to_thread_alive = 0;      /* thread alive */
+  st2000_ops.to_stop = 0;      /* to_stop */
   st2000_ops.to_pid_to_exec_file = NULL;
   st2000_run_ops.to_core_file_to_sym_file = NULL;
-  st2000_ops.to_stratum =   process_stratum;
-  st2000_ops.DONT_USE =   0;                           /* next */
-  st2000_ops.to_has_all_memory =   1;
-  st2000_ops.to_has_memory =   1;
-  st2000_ops.to_has_stack =   1;
-  st2000_ops.to_has_registers =   1;
-  st2000_ops.to_has_execution =   1;                           /* all mem, mem, stack, regs, exec */
-  st2000_ops.to_sections =   0;
-  st2000_ops.to_sections_end =   0;                            /* Section pointers */
-  st2000_ops.to_magic =   OPS_MAGIC;                   /* Always the last thing */
-} ;
+  st2000_ops.to_stratum = process_stratum;
+  st2000_ops.DONT_USE = 0;     /* next */
+  st2000_ops.to_has_all_memory = 1;
+  st2000_ops.to_has_memory = 1;
+  st2000_ops.to_has_stack = 1;
+  st2000_ops.to_has_registers = 1;
+  st2000_ops.to_has_execution = 1;     /* all mem, mem, stack, regs, exec */
+  st2000_ops.to_sections = 0;
+  st2000_ops.to_sections_end = 0;      /* Section pointers */
+  st2000_ops.to_magic = OPS_MAGIC;     /* Always the last thing */
+};
 
 void
 _initialize_remote_st2000 ()
 {
-  init_st2000_ops() ;
+  init_st2000_ops ();
   add_target (&st2000_ops);
   add_com ("st2000 <command>", class_obscure, st2000_command,
           "Send a command to the STDBUG monitor.");
index 30bbfb9b3386874afcbb8d4467a67513dfad2b08..eef0e1c681a7d819d25bd584a6120e281b99a589 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 1992, 1995 Free Software Foundation, Inc.
    Written by Daniel Mann.  Contributed by AMD.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This is like remote.c but uses the Universal Debug Interface (UDI) to 
    talk to the target hardware (or simulator).  UDI is a TCP/IP based
@@ -24,13 +25,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    daemon talks UDI on one side, and talks to the hardware (typically
    over a serial port) on the other side.
 
- - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6.
- - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
-       file to gdb 3.95.  I was unable to get this working on sun3os4
-       with termio, only with sgtty.
- - Daniel Mann at AMD took the 3.95 adaptions above and replaced
-       MiniMON interface with UDI-p interface.   */
  - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6.
  - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
+   file to gdb 3.95.  I was unable to get this working on sun3os4
+   with termio, only with sgtty.
  - Daniel Mann at AMD took the 3.95 adaptions above and replaced
+   MiniMON interface with UDI-p interface.        */
+
 #include "defs.h"
 #include "frame.h"
 #include "inferior.h"
@@ -46,13 +47,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "29k-share/udi/udiproc.h"
 #include "gdbcmd.h"
 #include "bfd.h"
-#include "gdbcore.h" /* For download function */
+#include "gdbcore.h"           /* For download function */
 
 /* access the register store directly, without going through
    the normal handler functions. This avoids an extra data copy.  */
 
-extern int stop_soon_quietly;           /* for wait_for_inferior */
-extern struct value *call_function_by_hand();
+extern int stop_soon_quietly;  /* for wait_for_inferior */
+extern struct value *call_function_by_hand ();
 static void udi_resume PARAMS ((int pid, int step, enum target_signal sig));
 static void udi_fetch_registers PARAMS ((int regno));
 static void udi_load PARAMS ((char *args, int from_tty));
@@ -67,19 +68,19 @@ static int udi_write_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
 static int udi_read_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
                                             int len));
 static void download PARAMS ((char *load_arg_string, int from_tty));
-char   CoffFileName[100] = "";
+char CoffFileName[100] = "";
 
 #define FREEZE_MODE     (read_register(CPS_REGNUM) & 0x400)
 #define USE_SHADOW_PC  ((processor_type == a29k_freeze_mode) && FREEZE_MODE)
 
 static int timeout = 5;
-extern struct target_ops udi_ops;             /* Forward declaration */
+extern struct target_ops udi_ops;      /* Forward declaration */
 
 /* Special register enumeration.
-*/
+ */
 
 /******************************************************************* UDI DATA*/
-#define        MAXDATA         2*1024          /* max UDI[read/write] byte size */
+#define        MAXDATA         2*1024  /* max UDI[read/write] byte size */
 /* Descriptor for I/O to remote machine.  Initialize it to -1 so that
    udi_open knows that we don't have a file open when the program
    starts.  */
@@ -96,23 +97,25 @@ CPUSizeT RMemSize = 0;
 UDIUInt32 CPUPRL;
 UDIUInt32 CoProcPRL;
 
-UDIMemoryRange address_ranges[2]; /* Text and data */
-UDIResource entry = {0, 0};    /* Entry point */
+UDIMemoryRange address_ranges[2];      /* Text and data */
+UDIResource entry =
+{0, 0};                                /* Entry point */
 CPUSizeT stack_sizes[2];       /* Regular and memory stacks */
 
 #define        SBUF_MAX        1024    /* maximum size of string handling buffer */
 char sbuf[SBUF_MAX];
 
-typedef        struct  bkpt_entry_str
-{
-    UDIResource         Addr;
-    UDIUInt32   PassCount;
+typedef struct bkpt_entry_str
+  {
+    UDIResource Addr;
+    UDIUInt32 PassCount;
     UDIBreakType Type;
     unsigned int BreakId;
-} bkpt_entry_t;
+  }
+bkpt_entry_t;
 #define                BKPT_TABLE_SIZE 40
-static bkpt_entry_t    bkpt_table[BKPT_TABLE_SIZE];
-extern char    dfe_errmsg[];           /* error string */
+static bkpt_entry_t bkpt_table[BKPT_TABLE_SIZE];
+extern char dfe_errmsg[];      /* error string */
 
 /* malloc'd name of the program on the remote system.  */
 static char *prog_name = NULL;
@@ -143,7 +146,7 @@ udi_create_inferior (execfile, args, env)
     {
       /* If the TIP is not open, open it.  */
       if (UDIConnect (udi_config_id, &udi_session_id))
-       error("UDIConnect() failed: %s\n", dfe_errmsg);
+       error ("UDIConnect() failed: %s\n", dfe_errmsg);
       /* We will need to download the program.  */
       entry.Offset = 0;
     }
@@ -151,9 +154,9 @@ udi_create_inferior (execfile, args, env)
   inferior_pid = 40000;
 
   if (!entry.Offset)
-    download(execfile, 0);
+    download (execfile, 0);
 
-  args1 = alloca (strlen(execfile) + strlen(args) + 2);
+  args1 = alloca (strlen (execfile) + strlen (args) + 2);
 
   if (execfile[0] == '\0')
 
@@ -172,11 +175,11 @@ udi_create_inferior (execfile, args, env)
   strcat (args1, args);
 
   UDIInitializeProcess (address_ranges,                /* ProcessMemory[] */
-                       (UDIInt)2,              /* NumberOfRanges */
-                       entry,                  /* EntryPoint */
-                       stack_sizes,            /* *StackSizes */
-                       (UDIInt)2,              /* NumberOfStacks */
-                       args1);                 /* ArgString */
+                       (UDIInt) 2,     /* NumberOfRanges */
+                       entry,  /* EntryPoint */
+                       stack_sizes,    /* *StackSizes */
+                       (UDIInt) 2,     /* NumberOfStacks */
+                       args1); /* ArgString */
 
   init_wait_for_inferior ();
   clear_proceed_status ();
@@ -184,14 +187,14 @@ udi_create_inferior (execfile, args, env)
 }
 
 static void
-udi_mourn()
+udi_mourn ()
 {
 #if 0
   /* Requiring "target udi" each time you run is a major pain.  I suspect
      this was just blindy copied from remote.c, in which "target" and
      "run" are combined.  Having a udi target without an inferior seems
      to work between "target udi" and "run", so why not now?  */
-  pop_target ();                /* Pop back to no-child state */
+  pop_target ();               /* Pop back to no-child state */
 #endif
   /* But if we're going to want to run it again, we better remove the
      breakpoints...  */
@@ -223,7 +226,7 @@ udi_open (name, from_tty)
   UDIPId PId;
   UDIUInt32 TIPId, TargetId, DFEId, DFE, TIP, DFEIPCId, TIPIPCId;
 
-  target_preopen(from_tty);
+  target_preopen (from_tty);
 
   entry.Offset = 0;
 
@@ -234,30 +237,30 @@ udi_open (name, from_tty)
     free (udi_config_id);
 
   if (!name)
-    error("Usage: target udi config_id, where config_id appears in udi_soc file");
+    error ("Usage: target udi config_id, where config_id appears in udi_soc file");
 
   udi_config_id = strdup (strtok (name, " \t"));
 
   if (UDIConnect (udi_config_id, &udi_session_id))
     /* FIXME: Should set udi_session_id to -1 here.  */
-    error("UDIConnect() failed: %s\n", dfe_errmsg);
+    error ("UDIConnect() failed: %s\n", dfe_errmsg);
 
   push_target (&udi_ops);
 
   /*
-  ** Initialize target configuration structure (global)
-  */
+     ** Initialize target configuration structure (global)
+   */
   if (UDIGetTargetConfig (KnownMemory, &NumberOfRanges,
                          ChipVersions, &NumberOfChips))
     error ("UDIGetTargetConfig() failed");
   if (NumberOfChips > 2)
-    fprintf_unfiltered(gdb_stderr,"Target has more than one processor\n");
-  for (cnt=0; cnt < NumberOfRanges; cnt++)
+    fprintf_unfiltered (gdb_stderr, "Target has more than one processor\n");
+  for (cnt = 0; cnt < NumberOfRanges; cnt++)
     {
-      switch(KnownMemory[cnt].Space)
+      switch (KnownMemory[cnt].Space)
        {
        default:
-         fprintf_unfiltered(gdb_stderr, "UDIGetTargetConfig() unknown memory space\n");
+         fprintf_unfiltered (gdb_stderr, "UDIGetTargetConfig() unknown memory space\n");
          break;
        case UDI29KCP_S:
          break;
@@ -279,7 +282,7 @@ udi_open (name, from_tty)
   a29k_get_processor_type ();
 
   if (UDICreateProcess (&PId))
-     fprintf_unfiltered(gdb_stderr, "UDICreateProcess() failed\n");
+    fprintf_unfiltered (gdb_stderr, "UDICreateProcess() failed\n");
 
   /* Print out some stuff, letting the user now what's going on */
   if (UDICapabilities (&TIPId, &TargetId, DFEId, DFE, &TIP, &DFEIPCId,
@@ -289,9 +292,9 @@ udi_open (name, from_tty)
     {
       printf_filtered ("Connected via UDI socket,\n\
  DFE-IPC version %x.%x.%x  TIP-IPC version %x.%x.%x  TIP version %x.%x.%x\n %s\n",
-                      (DFEIPCId>>8)&0xf, (DFEIPCId>>4)&0xf, DFEIPCId&0xf,
-                      (TIPIPCId>>8)&0xf, (TIPIPCId>>4)&0xf, TIPIPCId&0xf,
-                      (TargetId>>8)&0xf, (TargetId>>4)&0xf, TargetId&0xf,
+              (DFEIPCId >> 8) & 0xf, (DFEIPCId >> 4) & 0xf, DFEIPCId & 0xf,
+              (TIPIPCId >> 8) & 0xf, (TIPIPCId >> 4) & 0xf, TIPIPCId & 0xf,
+              (TargetId >> 8) & 0xf, (TargetId >> 4) & 0xf, TargetId & 0xf,
                       sbuf);
     }
 }
@@ -301,7 +304,7 @@ udi_open (name, from_tty)
    Use this when you want to detach and do something else
    with your gdb.  */
 static void
-udi_close (quitting)   /*FIXME: how is quitting used */
+udi_close (quitting)           /*FIXME: how is quitting used */
      int quitting;
 {
   if (udi_session_id < 0)
@@ -323,7 +326,7 @@ udi_close (quitting)        /*FIXME: how is quitting used */
   inferior_pid = 0;
 
   printf_filtered ("  Ending remote debugging\n");
-} 
+}
 
 /**************************************************************** UDI_ATACH */
 /* Attach to a program that is already loaded and running 
@@ -334,27 +337,27 @@ udi_attach (args, from_tty)
      char *args;
      int from_tty;
 {
-  UDIResource  From;
-  UDIInt32     PC_adds;
-  UDICount     Count = 1;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
-  UDIError     err;
+  UDIResource From;
+  UDIInt32 PC_adds;
+  UDICount Count = 1;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
+  UDIError err;
 
   if (args == NULL)
     error_no_arg ("program to attach");
 
   if (udi_session_id < 0)
-      error ("UDI connection not opened yet, use the 'target udi' command.\n");
-       
+    error ("UDI connection not opened yet, use the 'target udi' command.\n");
+
   if (from_tty)
-      printf_unfiltered ("Attaching to remote program %s...\n", prog_name);
+    printf_unfiltered ("Attaching to remote program %s...\n", prog_name);
 
-  UDIStop();
+  UDIStop ();
   From.Space = UDI29KSpecialRegs;
   From.Offset = 11;
-  if (err = UDIRead(From, &PC_adds, Count, Size, &CountDone, HostEndian))
+  if (err = UDIRead (From, &PC_adds, Count, Size, &CountDone, HostEndian))
     error ("UDIRead failed in udi_attach");
   printf_unfiltered ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
 }
@@ -363,12 +366,12 @@ udi_attach (args, from_tty)
    Use this when you want to detach and do something else
    with your gdb.  Leave remote process running (with no breakpoints set). */
 static void
-udi_detach (args,from_tty)
+udi_detach (args, from_tty)
      char *args;
      int from_tty;
 {
 
-  remove_breakpoints();                /* Just in case there were any left in */
+  remove_breakpoints ();       /* Just in case there were any left in */
 
   if (UDIDisconnect (udi_session_id, UDIContinueSession))
     error ("UDIDisconnect() failed in udi_detach");
@@ -378,7 +381,7 @@ udi_detach (args,from_tty)
   udi_session_id = -1;
   inferior_pid = 0;
 
-  pop_target();
+  pop_target ();
 
   if (from_tty)
     printf_unfiltered ("Detaching from TIP\n");
@@ -398,17 +401,17 @@ udi_resume (pid, step, sig)
   UDIStepType StepType = UDIStepNatural;
   UDIRange Range;
 
-  if (step)                    /* step 1 instruction */
+  if (step)                    /* step 1 instruction */
     {
       tip_error = UDIStep (Steps, StepType, Range);
       if (!tip_error)
        return;
 
-      fprintf_unfiltered (gdb_stderr,  "UDIStep() error = %d\n", tip_error);
+      fprintf_unfiltered (gdb_stderr, "UDIStep() error = %d\n", tip_error);
       error ("failed in udi_resume");
     }
 
-  if (UDIExecute())
+  if (UDIExecute ())
     error ("UDIExecute() failed in udi_resume");
 }
 
@@ -421,46 +424,46 @@ udi_wait (pid, status)
      int pid;
      struct target_waitstatus *status;
 {
-  UDIInt32     MaxTime;
-  UDIPId       PId;
-  UDIInt32     StopReason;
-  UDISizeT     CountDone;
-  int          old_timeout = timeout;
-  int          old_immediate_quit = immediate_quit;
-  int          i;
+  UDIInt32 MaxTime;
+  UDIPId PId;
+  UDIInt32 StopReason;
+  UDISizeT CountDone;
+  int old_timeout = timeout;
+  int old_immediate_quit = immediate_quit;
+  int i;
 
   status->kind = TARGET_WAITKIND_EXITED;
   status->value.integer = 0;
 
 /* wait for message to arrive. It should be:
-  If the target stops executing, udi_wait() should return.
-*/
+   If the target stops executing, udi_wait() should return.
+ */
   timeout = 0;                 /* Wait indefinetly for a message */
-  immediate_quit = 1;          /* Helps ability to QUIT */
+  immediate_quit = 1;          /* Helps ability to QUIT */
 
-  while(1)
+  while (1)
     {
       i = 0;
       MaxTime = UDIWaitForever;
-      UDIWait(MaxTime, &PId, &StopReason);
+      UDIWait (MaxTime, &PId, &StopReason);
       QUIT;                    /* Let user quit if they want */
 
       switch (StopReason & UDIGrossState)
        {
        case UDIStdoutReady:
-         if (UDIGetStdout (sbuf, (UDISizeT)SBUF_MAX, &CountDone))
+         if (UDIGetStdout (sbuf, (UDISizeT) SBUF_MAX, &CountDone))
            /* This is said to happen if the program tries to output
               a whole bunch of output (more than SBUF_MAX, I would
               guess).  It doesn't seem to happen with the simulator.  */
            warning ("UDIGetStdout() failed in udi_wait");
          fwrite (sbuf, 1, CountDone, stdout);
-         gdb_flush(gdb_stdout);
+         gdb_flush (gdb_stdout);
          continue;
 
        case UDIStderrReady:
-         UDIGetStderr (sbuf, (UDISizeT)SBUF_MAX, &CountDone);
+         UDIGetStderr (sbuf, (UDISizeT) SBUF_MAX, &CountDone);
          fwrite (sbuf, 1, CountDone, stderr);
-         gdb_flush(gdb_stderr);
+         gdb_flush (gdb_stderr);
          continue;
 
        case UDIStdinNeeded:
@@ -473,8 +476,9 @@ udi_wait (pid, status)
                if (ch == EOF)
                  break;
                sbuf[i++] = ch;
-             } while (i < SBUF_MAX && ch != '\n');
-           UDIPutStdin (sbuf, (UDISizeT)i, &CountDone);
+             }
+           while (i < SBUF_MAX && ch != '\n');
+           UDIPutStdin (sbuf, (UDISizeT) i, &CountDone);
            continue;
          }
 
@@ -492,16 +496,16 @@ udi_wait (pid, status)
   switch (StopReason & UDIGrossState)
     {
     case UDITrapped:
-      printf_unfiltered("Am290*0 received vector number %d\n", StopReason >> 24);
-         
-      switch ((StopReason >> 8 ) & 0xff)
+      printf_unfiltered ("Am290*0 received vector number %d\n", StopReason >> 24);
+
+      switch ((StopReason >> 8) & 0xff)
        {
-       case 0:                 /* Illegal opcode */
-         printf_unfiltered("   (break point)\n");
+       case 0:         /* Illegal opcode */
+         printf_unfiltered ("  (break point)\n");
          status->kind = TARGET_WAITKIND_STOPPED;
          status->value.sig = TARGET_SIGNAL_TRAP;
          break;
-       case 1:                 /* Unaligned Access */
+       case 1:         /* Unaligned Access */
          status->kind = TARGET_WAITKIND_STOPPED;
          status->value.sig = TARGET_SIGNAL_BUS;
          break;
@@ -510,15 +514,15 @@ udi_wait (pid, status)
          status->kind = TARGET_WAITKIND_STOPPED;
          status->value.sig = TARGET_SIGNAL_FPE;
          break;
-       case 5:                 /* Protection Violation */
+       case 5:         /* Protection Violation */
          status->kind = TARGET_WAITKIND_STOPPED;
          /* Why not SEGV?  What is a Protection Violation?  */
          status->value.sig = TARGET_SIGNAL_ILL;
          break;
        case 6:
        case 7:
-       case 8:                 /* User Instruction Mapping Miss */
-       case 9:                 /* User Data Mapping Miss */
+       case 8:         /* User Instruction Mapping Miss */
+       case 9:         /* User Data Mapping Miss */
        case 10:                /* Supervisor Instruction Mapping Miss */
        case 11:                /* Supervisor Data Mapping Miss */
          status->kind = TARGET_WAITKIND_STOPPED;
@@ -598,48 +602,48 @@ udi_wait (pid, status)
 
 #if 0
 /* Handy for debugging */
-udi_pc()
+udi_pc ()
 {
-  UDIResource  From;
-  UDIUInt32    *To;
-  UDICount     Count;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
-  UDIError     err;
+  UDIResource From;
+  UDIUInt32 *To;
+  UDICount Count;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
+  UDIError err;
   int pc[2];
   unsigned long myregs[256];
   int i;
 
   From.Space = UDI29KPC;
   From.Offset = 0;
-  To = (UDIUInt32 *)pc;
+  To = (UDIUInt32 *) pc;
   Count = 2;
 
-  err = UDIRead(From, To, Count, Size, &CountDone, HostEndian);
+  err = UDIRead (From, To, Count, Size, &CountDone, HostEndian);
 
   printf_unfiltered ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n",
-         err, CountDone, pc[0], pc[1]);
+                    err, CountDone, pc[0], pc[1]);
 
-  udi_fetch_registers(-1);
+  udi_fetch_registers (-1);
 
-  printf_unfiltered("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *)&registers[4 * PC_REGNUM],
-         *(int *)&registers[4 * NPC_REGNUM]);
+  printf_unfiltered ("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *) &registers[4 * PC_REGNUM],
+                    *(int *) &registers[4 * NPC_REGNUM]);
 
   /* Now, read all the registers globally */
 
   From.Space = UDI29KGlobalRegs;
   From.Offset = 0;
-  err = UDIRead(From, myregs, 256, 4, &CountDone, HostEndian);
+  err = UDIRead (From, myregs, 256, 4, &CountDone, HostEndian);
 
   printf ("err = %d, CountDone = %d\n", err, CountDone);
 
-  printf("\n");
+  printf ("\n");
 
   for (i = 0; i < 256; i += 2)
-    printf("%d:\t%#10x\t%11d\t%#10x\t%11d\n", i, myregs[i], myregs[i],
-          myregs[i+1], myregs[i+1]);
-  printf("\n");
+    printf ("%d:\t%#10x\t%11d\t%#10x\t%11d\n", i, myregs[i], myregs[i],
+           myregs[i + 1], myregs[i + 1]);
+  printf ("\n");
 
   return pc[0];
 }
@@ -649,59 +653,60 @@ udi_pc()
  * Read a remote register 'regno'. 
  * If regno==-1 then read all the registers.
  */
-static void 
+static void
 udi_fetch_registers (regno)
-int    regno;
+     int regno;
 {
-  UDIResource  From;
-  UDIUInt32    *To;
-  UDICount     Count;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
-  UDIError     err;
-  int          i;
-
-  if (regno >= 0)  {
-    fetch_register(regno);
-    return;
-  }
+  UDIResource From;
+  UDIUInt32 *To;
+  UDICount Count;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
+  UDIError err;
+  int i;
+
+  if (regno >= 0)
+    {
+      fetch_register (regno);
+      return;
+    }
 
 /* Gr1/rsp */
 
   From.Space = UDI29KGlobalRegs;
   From.Offset = 1;
-  To = (UDIUInt32 *)&registers[4 * GR1_REGNUM];
+  To = (UDIUInt32 *) & registers[4 * GR1_REGNUM];
   Count = 1;
-  if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
   register_valid[GR1_REGNUM] = 1;
 
 #if defined(GR64_REGNUM)       /* Read gr64-127 */
 
-/* Global Registers gr64-gr95 */ 
+/* Global Registers gr64-gr95 */
 
   From.Space = UDI29KGlobalRegs;
   From.Offset = 64;
-  To = (UDIUInt32 *)&registers[4 * GR64_REGNUM];
+  To = (UDIUInt32 *) & registers[4 * GR64_REGNUM];
   Count = 32;
-  if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
   for (i = GR64_REGNUM; i < GR64_REGNUM + 32; i++)
     register_valid[i] = 1;
 
-#endif /*  GR64_REGNUM */
+#endif /*  GR64_REGNUM */
 
-/* Global Registers gr96-gr127 */ 
+/* Global Registers gr96-gr127 */
 
   From.Space = UDI29KGlobalRegs;
   From.Offset = 96;
-  To = (UDIUInt32 *)&registers[4 * GR96_REGNUM];
+  To = (UDIUInt32 *) & registers[4 * GR96_REGNUM];
   Count = 32;
-  if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
   for (i = GR96_REGNUM; i < GR96_REGNUM + 32; i++)
     register_valid[i] = 1;
@@ -710,10 +715,10 @@ int       regno;
 
   From.Space = UDI29KLocalRegs;
   From.Offset = 0;
-  To = (UDIUInt32 *)&registers[4 * LR0_REGNUM];
+  To = (UDIUInt32 *) & registers[4 * LR0_REGNUM];
   Count = 128;
-  if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
   for (i = LR0_REGNUM; i < LR0_REGNUM + 128; i++)
     register_valid[i] = 1;
@@ -722,31 +727,32 @@ int       regno;
 
   From.Space = UDI29KSpecialRegs;
   From.Offset = 0;
-  To = (UDIUInt32 *)&registers[4 * SR_REGNUM(0)];
+  To = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)];
   Count = 15;
-  if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
-  for (i = SR_REGNUM(0); i < SR_REGNUM(0) + 15; i++)
+  for (i = SR_REGNUM (0); i < SR_REGNUM (0) + 15; i++)
     register_valid[i] = 1;
 
-  if (USE_SHADOW_PC) { /* Let regno_to_srnum() handle the register number */
-    fetch_register(NPC_REGNUM);
-    fetch_register(PC_REGNUM);
-    fetch_register(PC2_REGNUM);
+  if (USE_SHADOW_PC)
+    {                          /* Let regno_to_srnum() handle the register number */
+      fetch_register (NPC_REGNUM);
+      fetch_register (PC_REGNUM);
+      fetch_register (PC2_REGNUM);
 
 /* Unprotected Special Registers sr128-sr135 */
 
-    From.Space = UDI29KSpecialRegs;
-    From.Offset = 128;
-    To = (UDIUInt32 *)&registers[4 * SR_REGNUM(128)];
-    Count = 135-128 + 1;
-    if (err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-      error("UDIRead() failed in udi_fetch_registers");
-
-    for (i = SR_REGNUM(128); i < SR_REGNUM(128) + 135-128+1; i++)
-      register_valid[i] = 1;
-  }
+      From.Space = UDI29KSpecialRegs;
+      From.Offset = 128;
+      To = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)];
+      Count = 135 - 128 + 1;
+      if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+       error ("UDIRead() failed in udi_fetch_registers");
+
+      for (i = SR_REGNUM (128); i < SR_REGNUM (128) + 135 - 128 + 1; i++)
+       register_valid[i] = 1;
+    }
 
   if (remote_debug)
     {
@@ -776,18 +782,18 @@ int       regno;
 
 static void
 udi_store_registers (regno)
-int regno;
+     int regno;
 {
-  UDIUInt32    *From;
-  UDIResource  To;
-  UDICount     Count;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
-  
+  UDIUInt32 *From;
+  UDIResource To;
+  UDICount Count;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
+
   if (regno >= 0)
     {
-      store_register(regno);
+      store_register (regno);
       return;
     }
 
@@ -803,92 +809,92 @@ int regno;
 
 /* Gr1/rsp */
 
-  From = (UDIUInt32 *)&registers[4 * GR1_REGNUM];
+  From = (UDIUInt32 *) & registers[4 * GR1_REGNUM];
   To.Space = UDI29KGlobalRegs;
   To.Offset = 1;
   Count = 1;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
 #if defined(GR64_REGNUM)
 
 /* Global registers gr64-gr95 */
 
-  From = (UDIUInt32 *)&registers[4 * GR64_REGNUM];
+  From = (UDIUInt32 *) & registers[4 * GR64_REGNUM];
   To.Space = UDI29KGlobalRegs;
   To.Offset = 64;
   Count = 32;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
-#endif /* GR64_REGNUM */
+#endif /* GR64_REGNUM */
 
 /* Global registers gr96-gr127 */
 
-  From = (UDIUInt32 *)&registers[4 * GR96_REGNUM];
+  From = (UDIUInt32 *) & registers[4 * GR96_REGNUM];
   To.Space = UDI29KGlobalRegs;
   To.Offset = 96;
   Count = 32;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
 /* Local Registers */
 
-  From = (UDIUInt32 *)&registers[4 * LR0_REGNUM];
+  From = (UDIUInt32 *) & registers[4 * LR0_REGNUM];
   To.Space = UDI29KLocalRegs;
   To.Offset = 0;
   Count = 128;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
 
-/* Protected Special Registers */ /* VAB through TMR */
+  /* Protected Special Registers *//* VAB through TMR */
 
-  From = (UDIUInt32 *)&registers[4 * SR_REGNUM(0)];
+  From = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)];
   To.Space = UDI29KSpecialRegs;
   To.Offset = 0;
   Count = 10;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
 /* PC0, PC1, PC2 possibly as shadow registers */
 
-  From = (UDIUInt32 *)&registers[4 * SR_REGNUM(10)];
+  From = (UDIUInt32 *) & registers[4 * SR_REGNUM (10)];
   To.Space = UDI29KSpecialRegs;
   Count = 3;
-  if (USE_SHADOW_PC) 
-    To.Offset = 20;                            /* SPC0 */
-  else 
-    To.Offset = 10;                            /* PC0 */
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (USE_SHADOW_PC)
+    To.Offset = 20;            /* SPC0 */
+  else
+    To.Offset = 10;            /* PC0 */
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
 /* PC1 via UDI29KPC */
 
-  From = (UDIUInt32 *)&registers[4 * PC_REGNUM];
+  From = (UDIUInt32 *) & registers[4 * PC_REGNUM];
   To.Space = UDI29KPC;
-  To.Offset = 0;                               /* PC1 */
+  To.Offset = 0;               /* PC1 */
   Count = 1;
   if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
     error ("UDIWrite() failed in udi_store_regisetrs");
 
   /* LRU and MMU */
 
-  From = (UDIUInt32 *)&registers[4 * SR_REGNUM(13)];
+  From = (UDIUInt32 *) & registers[4 * SR_REGNUM (13)];
   To.Space = UDI29KSpecialRegs;
   To.Offset = 13;
   Count = 2;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
-/* Unprotected Special Registers */ 
+/* Unprotected Special Registers */
 
-  From = (UDIUInt32 *)&registers[4 * SR_REGNUM(128)];
+  From = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)];
   To.Space = UDI29KSpecialRegs;
   To.Offset = 128;
-  Count = 135-128 +1;
-  if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-    error("UDIWrite() failed in udi_store_regisetrs");
+  Count = 135 - 128 + 1;
+  if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+    error ("UDIWrite() failed in udi_store_regisetrs");
 
   registers_changed ();
 }
@@ -908,22 +914,25 @@ udi_prepare_to_store ()
 
 /********************************************************** TRANSLATE_ADDR */
 static CORE_ADDR
-translate_addr(addr)
-CORE_ADDR addr;
+translate_addr (addr)
+     CORE_ADDR addr;
 {
 #if defined(ULTRA3) && defined(KERNEL_DEBUGGING)
-        /* Check for a virtual address in the kernel */
-        /* Assume physical address of ublock is in  paddr_u register */
-       /* FIXME: doesn't work for user virtual addresses */
-        if (addr >= UVADDR) {
-                /* PADDR_U register holds the physical address of the ublock */
-                CORE_ADDR i = (CORE_ADDR)read_register(PADDR_U_REGNUM);
-                return(i + addr - (CORE_ADDR)UVADDR);
-        } else {
-               return(addr);
-        }
+  /* Check for a virtual address in the kernel */
+  /* Assume physical address of ublock is in  paddr_u register */
+  /* FIXME: doesn't work for user virtual addresses */
+  if (addr >= UVADDR)
+    {
+      /* PADDR_U register holds the physical address of the ublock */
+      CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM);
+      return (i + addr - (CORE_ADDR) UVADDR);
+    }
+  else
+    {
+      return (addr);
+    }
 #else
-        return(addr);
+  return (addr);
 #endif
 }
 /************************************************* UDI_XFER_INFERIOR_MEMORY */
@@ -936,7 +945,7 @@ udi_xfer_inferior_memory (memaddr, myaddr, len, write)
      int write;
 {
 
-  memaddr = translate_addr(memaddr);
+  memaddr = translate_addr (memaddr);
 
   if (write)
     return udi_write_inferior_memory (memaddr, myaddr, len);
@@ -964,26 +973,27 @@ udi_insert_breakpoint (addr, contents_cache)
   UDIError err;
 
   for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++)
-    if (bkpt_table[cnt].Type == 0) /* Find first free slot */
+    if (bkpt_table[cnt].Type == 0)     /* Find first free slot */
       break;
 
-  if(cnt >= BKPT_TABLE_SIZE)
-    error("Too many breakpoints set");
+  if (cnt >= BKPT_TABLE_SIZE)
+    error ("Too many breakpoints set");
 
   bkpt_table[cnt].Addr.Offset = addr;
-  bkpt_table[cnt].Addr.Space  = UDI29KIRAMSpace;
+  bkpt_table[cnt].Addr.Space = UDI29KIRAMSpace;
   bkpt_table[cnt].PassCount = 1;
   bkpt_table[cnt].Type = UDIBreakFlagExecute;
-  
-  err = UDISetBreakpoint(bkpt_table[cnt].Addr,
-                        bkpt_table[cnt].PassCount,
-                        bkpt_table[cnt].Type,
-                        &bkpt_table[cnt].BreakId);
 
-  if (err == 0) return 0;              /* Success */
+  err = UDISetBreakpoint (bkpt_table[cnt].Addr,
+                         bkpt_table[cnt].PassCount,
+                         bkpt_table[cnt].Type,
+                         &bkpt_table[cnt].BreakId);
+
+  if (err == 0)
+    return 0;                  /* Success */
 
   bkpt_table[cnt].Type = 0;
-  error("UDISetBreakpoint returned error code %d\n", err);
+  error ("UDISetBreakpoint returned error code %d\n", err);
 }
 
 /**************************************************** UDI_REMOVE_BREAKPOINT */
@@ -996,43 +1006,44 @@ udi_remove_breakpoint (addr, contents_cache)
   UDIError err;
 
   for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++)
-    if (bkpt_table[cnt].Addr.Offset == addr) /* Find matching breakpoint */
+    if (bkpt_table[cnt].Addr.Offset == addr)   /* Find matching breakpoint */
       break;
 
-  if(cnt >= BKPT_TABLE_SIZE)
-    error("Can't find breakpoint in table");
+  if (cnt >= BKPT_TABLE_SIZE)
+    error ("Can't find breakpoint in table");
 
   bkpt_table[cnt].Type = 0;
 
-  err = UDIClearBreakpoint(bkpt_table[cnt].BreakId);
-  if (err == 0) return 0;      /* Success */
+  err = UDIClearBreakpoint (bkpt_table[cnt].BreakId);
+  if (err == 0)
+    return 0;                  /* Success */
 
-  error("UDIClearBreakpoint returned error code %d\n", err);
+  error ("UDIClearBreakpoint returned error code %d\n", err);
 }
 
 static void
-udi_kill(arg,from_tty)
+udi_kill (arg, from_tty)
      char *arg;
      int from_tty;
 {
 
 #if 0
 /*
-UDIStop does not really work as advertised.  It causes the TIP to close it's
-connection, which usually results in GDB dying with a SIGPIPE.  For now, we
-just invoke udi_close, which seems to get things right.
-*/
-  UDIStop();
+   UDIStop does not really work as advertised.  It causes the TIP to close it's
+   connection, which usually results in GDB dying with a SIGPIPE.  For now, we
+   just invoke udi_close, which seems to get things right.
+ */
+  UDIStop ();
 
   udi_session_id = -1;
   inferior_pid = 0;
 
   if (from_tty)
-    printf_unfiltered("Target has been stopped.");
+    printf_unfiltered ("Target has been stopped.");
 #endif /* 0 */
 #if 0
-  udi_close(0);
-  pop_target();
+  udi_close (0);
+  pop_target ();
 #endif /* 0 */
 
   /* Keep the target around, e.g. so "run" can do the right thing when
@@ -1054,18 +1065,18 @@ just invoke udi_close, which seems to get things right.
    loaded code as arguments.  (You need to use the `run' command to do that.)
 
    The options are:
-               -ms %d  Set mem stack size to %d
-               -rs %d  Set regular stack size to %d
-               -i      send init info (default)
-               -noi    don't send init info
-               -[tT]   Load Text section
-               -[dD]   Load Data section
-               -[bB]   Load BSS section
-               -[lL]   Load Lit section
 */
+   -ms %d       Set mem stack size to %d
+   -rs %d       Set regular stack size to %d
+   -i   send init info (default)
+   -noi don't send init info
+   -[tT]        Load Text section
+   -[dD]        Load Data section
+   -[bB]        Load BSS section
+   -[lL]        Load Lit section
+ */
 
 static void
-download(load_arg_string, from_tty)
+download (load_arg_string, from_tty)
      char *load_arg_string;
      int from_tty;
 {
@@ -1092,7 +1103,7 @@ download(load_arg_string, from_tty)
 
   dont_repeat ();
 
-  filename = strtok(load_arg_string, " \t");
+  filename = strtok (load_arg_string, " \t");
   if (!filename)
     error ("Must specify at least a file name with the load command");
 
@@ -1134,7 +1145,7 @@ download(load_arg_string, from_tty)
                      load_lit = 1;
                      break;
                    default:
-                     error ("Unknown UDI load option -%s", token-1);
+                     error ("Unknown UDI load option -%s", token - 1);
                    }
                }
            }
@@ -1143,11 +1154,11 @@ download(load_arg_string, from_tty)
 
   pbfd = bfd_openr (filename, gnutarget);
 
-  if (!pbfd) 
+  if (!pbfd)
     /* FIXME: should be using bfd_errmsg, not assuming it was
        bfd_error_system_call.  */
     perror_with_name (filename);
-  
+
   /* FIXME: should be checking for errors from bfd_close (for one thing,
      on error it does not free all the storage associated with the
      bfd).  */
@@ -1156,10 +1167,10 @@ download(load_arg_string, from_tty)
   QUIT;
   immediate_quit++;
 
-  if (!bfd_check_format (pbfd, bfd_object)) 
+  if (!bfd_check_format (pbfd, bfd_object))
     error ("It doesn't seem to be an object file");
-  
-  for (section = pbfd->sections; section; section = section->next) 
+
+  for (section = pbfd->sections; section; section = section->next)
     {
       if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC)
        {
@@ -1187,10 +1198,10 @@ download(load_arg_string, from_tty)
               below starts writing before it even checks the size.  */
            continue;
 
-         printf_unfiltered("[Loading section %s at %x (%d bytes)]\n",
-                section_name,
-                To.Offset,
-                section_size);
+         printf_unfiltered ("[Loading section %s at %x (%d bytes)]\n",
+                            section_name,
+                            To.Offset,
+                            section_size);
 
          if (bfd_get_section_flags (pbfd, section) & SEC_CODE)
            {
@@ -1213,7 +1224,7 @@ download(load_arg_string, from_tty)
                                            - address_ranges[1].Offset);
            }
 
-         if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) /* Text, data or lit */
+         if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)         /* Text, data or lit */
            {
              file_ptr fptr;
 
@@ -1228,12 +1239,12 @@ download(load_arg_string, from_tty)
                  bfd_get_section_contents (pbfd, section, buffer, fptr,
                                            Count);
 
-                 err = UDIWrite ((UDIHostMemPtr)buffer, /* From */
-                                 To,                   /* To */
-                                 Count,                /* Count */
-                                 (UDISizeT)1,          /* Size */
-                                 &Count,               /* CountDone */
-                                 (UDIBool)0);          /* HostEndian */
+                 err = UDIWrite ((UDIHostMemPtr) buffer,       /* From */
+                                 To,   /* To */
+                                 Count,        /* Count */
+                                 (UDISizeT) 1,         /* Size */
+                                 &Count,       /* CountDone */
+                                 (UDIBool) 0);         /* HostEndian */
                  if (err)
                    error ("UDIWrite failed, error = %d", err);
 
@@ -1242,39 +1253,40 @@ download(load_arg_string, from_tty)
                  section_size -= Count;
                }
            }
-         else                  /* BSS */
+         else
+           /* BSS */
            {
              UDIResource From;
              unsigned long zero = 0;
 
              /* Write a zero byte at the vma */
              /* FIXME: Broken for sections of 1-3 bytes (we test for
-                zero above).  */
-             err = UDIWrite ((UDIHostMemPtr)&zero,     /* From */
-                             To,                       /* To */
-                             (UDICount)1,              /* Count */
-                             (UDISizeT)4,              /* Size */
-                             &Count,                   /* CountDone */
-                             (UDIBool)0);              /* HostEndian */
+                zero above).  */
+             err = UDIWrite ((UDIHostMemPtr) & zero,   /* From */
+                             To,       /* To */
+                             (UDICount) 1,     /* Count */
+                             (UDISizeT) 4,     /* Size */
+                             &Count,   /* CountDone */
+                             (UDIBool) 0);     /* HostEndian */
              if (err)
                error ("UDIWrite failed, error = %d", err);
 
              From = To;
-             To.Offset+=4;
+             To.Offset += 4;
 
              /* Now, duplicate it for the length of the BSS */
-             err = UDICopy (From,                      /* From */
-                            To,                        /* To */
-                            (UDICount)(section_size/4 - 1), /* Count */
-                            (UDISizeT)4,               /* Size */
-                            &Count,                    /* CountDone */
-                            (UDIBool)1);               /* Direction */
+             err = UDICopy (From,      /* From */
+                            To,        /* To */
+                            (UDICount) (section_size / 4 - 1),         /* Count */
+                            (UDISizeT) 4,      /* Size */
+                            &Count,    /* CountDone */
+                            (UDIBool) 1);      /* Direction */
              if (err)
                {
                  char message[100];
                  int xerr;
 
-                 xerr = UDIGetErrorMsg(err, 100, message, &Count);
+                 xerr = UDIGetErrorMsg (err, 100, message, &Count);
                  if (!xerr)
                    fprintf_unfiltered (gdb_stderr, "Error is %s\n", message);
                  else
@@ -1288,7 +1300,7 @@ download(load_arg_string, from_tty)
 
   entry.Space = UDI29KIRAMSpace;
   entry.Offset = bfd_get_start_address (pbfd);
-  
+
   immediate_quit--;
 }
 
@@ -1320,80 +1332,88 @@ udi_write_inferior_memory (memaddr, myaddr, len)
      char *myaddr;
      int len;
 {
-  int          nwritten = 0;
-  UDIUInt32    *From;
-  UDIResource  To;
-  UDICount     Count;
-  UDISizeT     Size = 1;
-  UDICount     CountDone = 0;
-  UDIBool      HostEndian = 0;
-  
-  To.Space = udi_memory_space(memaddr);
-  From = (UDIUInt32*)myaddr;
+  int nwritten = 0;
+  UDIUInt32 *From;
+  UDIResource To;
+  UDICount Count;
+  UDISizeT Size = 1;
+  UDICount CountDone = 0;
+  UDIBool HostEndian = 0;
+
+  To.Space = udi_memory_space (memaddr);
+  From = (UDIUInt32 *) myaddr;
 
   while (nwritten < len)
-  {    Count = len - nwritten;
-       if (Count > MAXDATA) Count = MAXDATA;
-       To.Offset = memaddr + nwritten;
-        if(UDIWrite(From, To, Count, Size, &CountDone, HostEndian))
-       {  error("UDIWrite() failed in udi_write_inferior_memory");
-          break;       
+    {
+      Count = len - nwritten;
+      if (Count > MAXDATA)
+       Count = MAXDATA;
+      To.Offset = memaddr + nwritten;
+      if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian))
+       {
+         error ("UDIWrite() failed in udi_write_inferior_memory");
+         break;
        }
-       else
-       {  nwritten += CountDone;
-          From += CountDone;
+      else
+       {
+         nwritten += CountDone;
+         From += CountDone;
        }
-  }
-  return(nwritten);
+    }
+  return (nwritten);
 }
 
 /**************************************************** UDI_READ_INFERIOR_MEMORY
 ** Read LEN bytes from inferior memory at MEMADDR.  Put the result
    at debugger address MYADDR.  Returns number of bytes read.  */
 static int
-udi_read_inferior_memory(memaddr, myaddr, len)
+udi_read_inferior_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
      char *myaddr;
      int len;
 {
-  int          nread = 0;
-  UDIResource  From;
-  UDIUInt32    *To;
-  UDICount     Count;
-  UDISizeT     Size = 1;
-  UDICount     CountDone = 0;
-  UDIBool      HostEndian = 0;
-  UDIError     err;
-  
-  From.Space = udi_memory_space(memaddr);      
-  To = (UDIUInt32*)myaddr;
+  int nread = 0;
+  UDIResource From;
+  UDIUInt32 *To;
+  UDICount Count;
+  UDISizeT Size = 1;
+  UDICount CountDone = 0;
+  UDIBool HostEndian = 0;
+  UDIError err;
+
+  From.Space = udi_memory_space (memaddr);
+  To = (UDIUInt32 *) myaddr;
 
   while (nread < len)
-  {    Count = len - nread;
-       if (Count > MAXDATA) Count = MAXDATA;
-       From.Offset = memaddr + nread;
-        if(err = UDIRead(From, To, Count, Size, &CountDone, HostEndian))
-       {  error("UDIRead() failed in udi_read_inferior_memory");
-          break;       
+    {
+      Count = len - nread;
+      if (Count > MAXDATA)
+       Count = MAXDATA;
+      From.Offset = memaddr + nread;
+      if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian))
+       {
+         error ("UDIRead() failed in udi_read_inferior_memory");
+         break;
        }
-       else
-       {  nread += CountDone;
-          To += CountDone;
+      else
+       {
+         nread += CountDone;
+         To += CountDone;
        }
-  }
-  return(nread);
+    }
+  return (nread);
 }
 
 /********************************************************************* WARNING
 */
-udi_warning(num)
-int    num;
+udi_warning (num)
+     int num;
 {
-    error ("ERROR while loading program into remote TIP: $d\n", num);
+  error ("ERROR while loading program into remote TIP: $d\n", num);
 }
 
 
-/*****************************************************************************/ 
+/*****************************************************************************/
 /* Fetch a single register indicatated by 'regno'. 
  * Returns 0/-1 on success/failure.  
  */
@@ -1401,14 +1421,14 @@ static void
 fetch_register (regno)
      int regno;
 {
-  UDIResource  From;
-  UDIUInt32    To;
-  UDICount     Count = 1;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
-  UDIError     err;
-  int                  result;
+  UDIResource From;
+  UDIUInt32 To;
+  UDICount Count = 1;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
+  UDIError err;
+  int result;
 
   if (regno == GR1_REGNUM)
     {
@@ -1423,42 +1443,42 @@ fetch_register (regno)
 
 #if defined(GR64_REGNUM)
 
-  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
+  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32)
     {
       From.Space = UDI29KGlobalRegs;
       From.Offset = (regno - GR64_REGNUM) + 64;
     }
 
-#endif /* GR64_REGNUM */
+#endif /* GR64_REGNUM */
 
   else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
     {
       From.Space = UDI29KLocalRegs;
       From.Offset = (regno - LR0_REGNUM);
     }
-  else if (regno>=FPE_REGNUM && regno<=EXO_REGNUM)  
+  else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM)
     {
       int val = -1;
-      /*supply_register(160 + (regno - FPE_REGNUM),(char *) &val);*/
-      supply_register(regno, (char *) &val);
-      return;          /* Pretend Success */
+      /*supply_register(160 + (regno - FPE_REGNUM),(char *) &val); */
+      supply_register (regno, (char *) &val);
+      return;                  /* Pretend Success */
     }
-  else 
+  else
     {
       From.Space = UDI29KSpecialRegs;
-      From.Offset = regnum_to_srnum(regno); 
+      From.Offset = regnum_to_srnum (regno);
     }
 
-  if (err = UDIRead(From, &To, Count, Size, &CountDone, HostEndian))
-    error("UDIRead() failed in udi_fetch_registers");
+  if (err = UDIRead (From, &To, Count, Size, &CountDone, HostEndian))
+    error ("UDIRead() failed in udi_fetch_registers");
 
-  supply_register(regno, (char *) &To);
+  supply_register (regno, (char *) &To);
 
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "Fetching register %s = 0x%x\n",
                        REGISTER_NAME (regno), To);
 }
-/*****************************************************************************/ 
+/*****************************************************************************/
 /* Store a single register indicated by 'regno'. 
  * Returns 0/-1 on success/failure.  
  */
@@ -1466,15 +1486,15 @@ static int
 store_register (regno)
      int regno;
 {
-  int                  result;
-  UDIUInt32    From;
-  UDIResource  To;
-  UDICount     Count = 1;
-  UDISizeT     Size = 4;
-  UDICount     CountDone;
-  UDIBool      HostEndian = 0;
+  int result;
+  UDIUInt32 From;
+  UDIResource To;
+  UDICount Count = 1;
+  UDISizeT Size = 4;
+  UDICount CountDone;
+  UDIBool HostEndian = 0;
 
-  From =  read_register (regno);       /* get data value */
+  From = read_register (regno);        /* get data value */
 
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "Storing register %s = 0x%x\n",
@@ -1484,7 +1504,7 @@ store_register (regno)
     {
       To.Space = UDI29KGlobalRegs;
       To.Offset = 1;
-      result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
+      result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian);
       /* Setting GR1 changes the numbers of all the locals, so invalidate the 
        * register cache.  Do this *after* calling read_register, because we want 
        * read_register to return the value that write_register has just stuffed 
@@ -1494,29 +1514,29 @@ store_register (regno)
       registers_changed ();
     }
 #if defined(GR64_REGNUM)
-  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
+  else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32)
     {
       To.Space = UDI29KGlobalRegs;
       To.Offset = (regno - GR64_REGNUM) + 64;
-      result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
+      result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian);
     }
-#endif /* GR64_REGNUM */
+#endif /* GR64_REGNUM */
   else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
     {
       To.Space = UDI29KGlobalRegs;
       To.Offset = (regno - GR96_REGNUM) + 96;
-      result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
+      result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian);
     }
   else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
     {
       To.Space = UDI29KLocalRegs;
       To.Offset = (regno - LR0_REGNUM);
-      result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
+      result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian);
     }
-  else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM)  
-    return 0;          /* Pretend Success */
+  else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM)
+    return 0;                  /* Pretend Success */
   else if (regno == PC_REGNUM)
-    {    
+    {
       /* PC1 via UDI29KPC */
 
       To.Space = UDI29KPC;
@@ -1525,18 +1545,19 @@ store_register (regno)
 
       /* Writing to this loc actually changes the values of pc0 & pc1 */
 
-      register_valid[PC_REGNUM] = 0; /* pc1 */
-      register_valid[NPC_REGNUM] = 0; /* pc0 */
+      register_valid[PC_REGNUM] = 0;   /* pc1 */
+      register_valid[NPC_REGNUM] = 0;  /* pc0 */
     }
-  else         /* An unprotected or protected special register */
+  else
+    /* An unprotected or protected special register */
     {
       To.Space = UDI29KSpecialRegs;
-      To.Offset = regnum_to_srnum(regno); 
-      result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
+      To.Offset = regnum_to_srnum (regno);
+      result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian);
     }
 
   if (result != 0)
-    error("UDIWrite() failed in store_registers");
+    error ("UDIWrite() failed in store_registers");
 
   return 0;
 }
@@ -1545,40 +1566,68 @@ store_register (regno)
  * Convert a gdb special register number to a 29000 special register number.
  */
 static int
-regnum_to_srnum(regno)
-int    regno;
+regnum_to_srnum (regno)
+     int regno;
 {
-       switch(regno) {
-               case VAB_REGNUM: return(0); 
-               case OPS_REGNUM: return(1); 
-               case CPS_REGNUM: return(2); 
-               case CFG_REGNUM: return(3); 
-               case CHA_REGNUM: return(4); 
-               case CHD_REGNUM: return(5); 
-               case CHC_REGNUM: return(6); 
-               case RBP_REGNUM: return(7); 
-               case TMC_REGNUM: return(8); 
-               case TMR_REGNUM: return(9); 
-               case NPC_REGNUM: return(USE_SHADOW_PC ? (20) : (10));
-               case PC_REGNUM:  return(USE_SHADOW_PC ? (21) : (11));
-               case PC2_REGNUM: return(USE_SHADOW_PC ? (22) : (12));
-               case MMU_REGNUM: return(13); 
-               case LRU_REGNUM: return(14); 
-               case IPC_REGNUM: return(128); 
-               case IPA_REGNUM: return(129); 
-               case IPB_REGNUM: return(130); 
-               case Q_REGNUM:   return(131); 
-               case ALU_REGNUM: return(132); 
-               case BP_REGNUM:  return(133); 
-               case FC_REGNUM:  return(134); 
-               case CR_REGNUM:  return(135); 
-               case FPE_REGNUM: return(160); 
-               case INTE_REGNUM: return(161); 
-               case FPS_REGNUM: return(162); 
-               case EXO_REGNUM:return(164); 
-               default:
-                       return(255);    /* Failure ? */
-       }
+  switch (regno)
+    {
+    case VAB_REGNUM:
+      return (0);
+    case OPS_REGNUM:
+      return (1);
+    case CPS_REGNUM:
+      return (2);
+    case CFG_REGNUM:
+      return (3);
+    case CHA_REGNUM:
+      return (4);
+    case CHD_REGNUM:
+      return (5);
+    case CHC_REGNUM:
+      return (6);
+    case RBP_REGNUM:
+      return (7);
+    case TMC_REGNUM:
+      return (8);
+    case TMR_REGNUM:
+      return (9);
+    case NPC_REGNUM:
+      return (USE_SHADOW_PC ? (20) : (10));
+    case PC_REGNUM:
+      return (USE_SHADOW_PC ? (21) : (11));
+    case PC2_REGNUM:
+      return (USE_SHADOW_PC ? (22) : (12));
+    case MMU_REGNUM:
+      return (13);
+    case LRU_REGNUM:
+      return (14);
+    case IPC_REGNUM:
+      return (128);
+    case IPA_REGNUM:
+      return (129);
+    case IPB_REGNUM:
+      return (130);
+    case Q_REGNUM:
+      return (131);
+    case ALU_REGNUM:
+      return (132);
+    case BP_REGNUM:
+      return (133);
+    case FC_REGNUM:
+      return (134);
+    case CR_REGNUM:
+      return (135);
+    case FPE_REGNUM:
+      return (160);
+    case INTE_REGNUM:
+      return (161);
+    case FPS_REGNUM:
+      return (162);
+    case EXO_REGNUM:
+      return (164);
+    default:
+      return (255);            /* Failure ? */
+    }
 }
 /****************************************************************************/
 /*
@@ -1587,39 +1636,51 @@ int     regno;
  * FIXME: Doesn't know anything about I_CACHE/D_CACHE.
  */
 static CPUSpace
-udi_memory_space(addr)
-CORE_ADDR      addr;
+udi_memory_space (addr)
+     CORE_ADDR addr;
 {
-       UDIUInt32 tstart = IMemStart;
-       UDIUInt32 tend   = tstart + IMemSize;  
-       UDIUInt32 dstart = DMemStart;
-       UDIUInt32 dend   = tstart + DMemSize;  
-       UDIUInt32 rstart = RMemStart;
-       UDIUInt32 rend   = tstart + RMemSize;  
-
-       if (((UDIUInt32)addr >= tstart) && ((UDIUInt32)addr < tend)) { 
-               return UDI29KIRAMSpace;
-       } else if (((UDIUInt32)addr >= dstart) && ((UDIUInt32)addr < dend)) { 
-               return UDI29KDRAMSpace;
-       } else if (((UDIUInt32)addr >= rstart) && ((UDIUInt32)addr < rend)) {
-               /* FIXME: how do we determine between D_ROM and I_ROM */
-               return UDI29KIROMSpace;
-       } else  /* FIXME: what do me do now? */
-               return UDI29KDRAMSpace; /* Hmmm! */
+  UDIUInt32 tstart = IMemStart;
+  UDIUInt32 tend = tstart + IMemSize;
+  UDIUInt32 dstart = DMemStart;
+  UDIUInt32 dend = tstart + DMemSize;
+  UDIUInt32 rstart = RMemStart;
+  UDIUInt32 rend = tstart + RMemSize;
+
+  if (((UDIUInt32) addr >= tstart) && ((UDIUInt32) addr < tend))
+    {
+      return UDI29KIRAMSpace;
+    }
+  else if (((UDIUInt32) addr >= dstart) && ((UDIUInt32) addr < dend))
+    {
+      return UDI29KDRAMSpace;
+    }
+  else if (((UDIUInt32) addr >= rstart) && ((UDIUInt32) addr < rend))
+    {
+      /* FIXME: how do we determine between D_ROM and I_ROM */
+      return UDI29KIROMSpace;
+    }
+  else                         /* FIXME: what do me do now? */
+    return UDI29KDRAMSpace;    /* Hmmm! */
 }
 /*********************************************************************** STUBS
 */
 
-void  convert16() {;}
-void  convert32() {;}
-GDB_FILE * EchoFile = 0;               /* used for debugging */
-int   QuietMode = 0;           /* used for debugging */
+void
+convert16 ()
+{;
+}
+void
+convert32 ()
+{;
+}
+GDB_FILE *EchoFile = 0;                /* used for debugging */
+int QuietMode = 0;             /* used for debugging */
 \f
 #ifdef NO_HIF_SUPPORT
-service_HIF(msg)
+service_HIF (msg)
      union msg_t *msg;
 {
-  return(0);                   /* Emulate a failure */
+  return (0);                  /* Emulate a failure */
 }
 #endif
 \f
@@ -1630,12 +1691,12 @@ service_HIF(msg)
 
 struct target_ops udi_ops;
 
-static void 
-init_udi_ops(void)
+static void
+init_udi_ops (void)
 {
-  udi_ops.to_shortname =         "udi";
-  udi_ops.to_longname =        "Remote UDI connected TIP";
-  udi_ops.to_doc =     "Remote debug an AMD 29k using UDI socket connection to TIP process.\n\
+  udi_ops.to_shortname = "udi";
+  udi_ops.to_longname = "Remote UDI connected TIP";
+  udi_ops.to_doc = "Remote debug an AMD 29k using UDI socket connection to TIP process.\n\
 Arguments are\n\
 `configuration-id AF_INET hostname port-number'\n\
 To connect via the network, where hostname and port-number specify the\n\
@@ -1653,49 +1714,49 @@ To connect using a local connection to the \"tip.exe\" program which is\n\
 `configuration-id'\n\
     Look up the configuration in ./udi_soc or /etc/udi_soc, which\n\
     are files containing lines in the above formats.  configuration-id is\n\
-    used to pick which line of the file to use." ;
-  udi_ops.to_open =         udi_open;
-  udi_ops.to_close =   udi_close;
-  udi_ops.to_attach =         udi_attach;
-  udi_ops.to_detach =  udi_detach;
-  udi_ops.to_resume =  udi_resume;
-  udi_ops.to_wait  =   udi_wait;
-  udi_ops.to_fetch_registers  =         udi_fetch_registers;
-  udi_ops.to_store_registers  =        udi_store_registers;
-  udi_ops.to_prepare_to_store =         udi_prepare_to_store;
-  udi_ops.to_xfer_memory  =         udi_xfer_inferior_memory;
-  udi_ops.to_files_info  =         udi_files_info;
-  udi_ops.to_insert_breakpoint =         udi_insert_breakpoint;
-  udi_ops.to_remove_breakpoint =       udi_remove_breakpoint;
-  udi_ops.to_terminal_init  =         0;               
-  udi_ops.to_terminal_inferior =       0;              
-  udi_ops.to_terminal_ours_for_output =        0;
-  udi_ops.to_terminal_ours  =  0;      
-  udi_ops.to_terminal_info  =  0;      
-  udi_ops.to_kill  =         udi_kill;  
-  udi_ops.to_load  =         udi_load; 
-  udi_ops.to_lookup_symbol =         0; 
-  udi_ops.to_create_inferior =         udi_create_inferior;
-  udi_ops.to_mourn_inferior =         udi_mourn;
-  udi_ops.to_can_run  =        0;      
-  udi_ops.to_notice_signals =  0;      
-  udi_ops.to_thread_alive  =   0;      
-  udi_ops.to_stop  =         0;
-  udi_ops.to_stratum =         process_stratum;
-  udi_ops.DONT_USE =   0;              
-  udi_ops.to_has_all_memory =         1;
-  udi_ops.to_has_memory =      1;      
-  udi_ops.to_has_stack =       1;      
-  udi_ops.to_has_registers =   1;      
-  udi_ops.to_has_execution =   1;      
-  udi_ops.to_sections =        0;      
-  udi_ops.to_sections_end =    0;      
-  udi_ops.to_magic =   OPS_MAGIC;
+    used to pick which line of the file to use.";
+  udi_ops.to_open = udi_open;
+  udi_ops.to_close = udi_close;
+  udi_ops.to_attach = udi_attach;
+  udi_ops.to_detach = udi_detach;
+  udi_ops.to_resume = udi_resume;
+  udi_ops.to_wait = udi_wait;
+  udi_ops.to_fetch_registers = udi_fetch_registers;
+  udi_ops.to_store_registers = udi_store_registers;
+  udi_ops.to_prepare_to_store = udi_prepare_to_store;
+  udi_ops.to_xfer_memory = udi_xfer_inferior_memory;
+  udi_ops.to_files_info = udi_files_info;
+  udi_ops.to_insert_breakpoint = udi_insert_breakpoint;
+  udi_ops.to_remove_breakpoint = udi_remove_breakpoint;
+  udi_ops.to_terminal_init = 0;
+  udi_ops.to_terminal_inferior = 0;
+  udi_ops.to_terminal_ours_for_output = 0;
+  udi_ops.to_terminal_ours = 0;
+  udi_ops.to_terminal_info = 0;
+  udi_ops.to_kill = udi_kill;
+  udi_ops.to_load = udi_load;
+  udi_ops.to_lookup_symbol = 0;
+  udi_ops.to_create_inferior = udi_create_inferior;
+  udi_ops.to_mourn_inferior = udi_mourn;
+  udi_ops.to_can_run = 0;
+  udi_ops.to_notice_signals = 0;
+  udi_ops.to_thread_alive = 0;
+  udi_ops.to_stop = 0;
+  udi_ops.to_stratum = process_stratum;
+  udi_ops.DONT_USE = 0;
+  udi_ops.to_has_all_memory = 1;
+  udi_ops.to_has_memory = 1;
+  udi_ops.to_has_stack = 1;
+  udi_ops.to_has_registers = 1;
+  udi_ops.to_has_execution = 1;
+  udi_ops.to_sections = 0;
+  udi_ops.to_sections_end = 0;
+  udi_ops.to_magic = OPS_MAGIC;
 };
 
 void
 _initialize_remote_udi ()
 {
-  init_udi_ops() ;
+  init_udi_ops ();
   add_target (&udi_ops);
 }
index 7219255bb6a867a115705ac463c34f92095b6236..1b9ae39970eb1c8e1e01647f1fb65b99abe71fbe 100644 (file)
@@ -2,42 +2,43 @@
 
    Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*  This file actually contains two distinct logical "packages".  They
-    are packaged together in this one file because they are typically
-    used together.
+   are packaged together in this one file because they are typically
+   used together.
 
-    The first package is an addition to the serial package.  The
-    addition provides reading and writing with debugging output and
-    timeouts based on user settable variables.  These routines are
-    intended to support serial port based remote backends.  These
-    functions are prefixed with sr_.
+   The first package is an addition to the serial package.  The
+   addition provides reading and writing with debugging output and
+   timeouts based on user settable variables.  These routines are
+   intended to support serial port based remote backends.  These
+   functions are prefixed with sr_.
 
-    The second package is a collection of more or less generic
-    functions for use by remote backends.  They support user settable
-    variables for debugging, retries, and the like.  
+   The second package is a collection of more or less generic
+   functions for use by remote backends.  They support user settable
+   variables for debugging, retries, and the like.  
 
    Todo:
 
    * a pass through mode a la kermit or telnet.
    * autobaud.
    * ask remote to change his baud rate.
  */
+ */
 
 #include <ctype.h>
 
@@ -46,28 +47,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcmd.h"
 #include "target.h"
 #include "serial.h"
-#include "gdbcore.h" /* for exec_bfd */
-#include "inferior.h" /* for generic_mourn_inferior */
+#include "gdbcore.h"           /* for exec_bfd */
+#include "inferior.h"          /* for generic_mourn_inferior */
 #include "remote-utils.h"
 
 
 void _initialize_sr_support PARAMS ((void));
 
-struct _sr_settings sr_settings = {
-  4, /* timeout:
-       remote-hms.c had 2
-       remote-bug.c had "with a timeout of 2, we time out waiting for
-       the prompt after an s-record dump."
-
-       remote.c had (2): This was 5 seconds, which is a long time to
-       sit and wait. Unless this is going though some terminal server
-       or multiplexer or other form of hairy serial connection, I
-       would think 2 seconds would be plenty.
-*/
-
-  10, /* retries */
-  NULL,        /* device */
-  NULL,        /* descriptor */
+struct _sr_settings sr_settings =
+{
+  4,                           /* timeout:
+                                  remote-hms.c had 2
+                                  remote-bug.c had "with a timeout of 2, we time out waiting for
+                                  the prompt after an s-record dump."
+
+                                  remote.c had (2): This was 5 seconds, which is a long time to
+                                  sit and wait. Unless this is going though some terminal server
+                                  or multiplexer or other form of hairy serial connection, I
+                                  would think 2 seconds would be plenty.
+                                */
+
+  10,                          /* retries */
+  NULL,                                /* device */
+  NULL,                                /* descriptor */
 };
 
 struct gr_settings *gr_settings = NULL;
@@ -76,12 +78,12 @@ static void usage PARAMS ((char *, char *));
 static void sr_com PARAMS ((char *, int));
 
 static void
-usage(proto, junk)
+usage (proto, junk)
      char *proto;
      char *junk;
 {
   if (junk != NULL)
-    fprintf_unfiltered(gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
+    fprintf_unfiltered (gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
 
   error ("Usage: target %s [DEVICE [SPEED [DEBUG]]]\n\
 where DEVICE is the name of a device or HOST:PORT", proto, proto);
@@ -101,7 +103,7 @@ where DEVICE is the name of a device or HOST:PORT", proto, proto);
 }
 
 void
-sr_scan_args(proto, args)
+sr_scan_args (proto, args)
      char *proto;
      char *args;
 {
@@ -113,61 +115,61 @@ sr_scan_args(proto, args)
     return;
 
   /* scan off white space.  */
-  for (p = args; isspace(*p); ++p) ;;
+  for (p = args; isspace (*p); ++p);;
 
   /* find end of device name.  */
-  for (q = p; *q != '\0' && !isspace(*q); ++q) ;;
+  for (q = p; *q != '\0' && !isspace (*q); ++q);;
 
   /* check for missing or empty device name.  */
-  CHECKDONE(p, q);
-  sr_set_device(savestring(p, q - p));
+  CHECKDONE (p, q);
+  sr_set_device (savestring (p, q - p));
 
   /* look for baud rate.  */
-  n = strtol(q, &p, 10);
+  n = strtol (q, &p, 10);
 
   /* check for missing or empty baud rate.  */
-  CHECKDONE(p, q);
+  CHECKDONE (p, q);
   baud_rate = n;
 
   /* look for debug value.  */
-  n = strtol(p, &q, 10);
+  n = strtol (p, &q, 10);
 
   /* check for missing or empty debug value.  */
-  CHECKDONE(p, q);
-  sr_set_debug(n);
+  CHECKDONE (p, q);
+  sr_set_debug (n);
 
   /* scan off remaining white space.  */
-  for (p = q; isspace(*p); ++p) ;;
+  for (p = q; isspace (*p); ++p);;
 
   /* if not end of string, then there's unrecognized junk. */
   if (*p != '\0')
-    usage(proto, p);
+    usage (proto, p);
 
   return;
 }
 
 void
-gr_generic_checkin()
+gr_generic_checkin ()
 {
-  sr_write_cr("");
-  gr_expect_prompt();
+  sr_write_cr ("");
+  gr_expect_prompt ();
 }
 
 void
-gr_open(args, from_tty, gr)
+gr_open (args, from_tty, gr)
      char *args;
      int from_tty;
      struct gr_settings *gr;
 {
-  target_preopen(from_tty);
-  sr_scan_args(gr->ops->to_shortname, args);
-  unpush_target(gr->ops);
+  target_preopen (from_tty);
+  sr_scan_args (gr->ops->to_shortname, args);
+  unpush_target (gr->ops);
 
   gr_settings = gr;
 
-  gr_set_dcache(dcache_init(gr->readfunc, gr->writefunc));
+  gr_set_dcache (dcache_init (gr->readfunc, gr->writefunc));
 
-  if (sr_get_desc() != NULL)
+  if (sr_get_desc () != NULL)
     gr_close (0);
 
   /* If no args are specified, then we use the device specified by a
@@ -177,28 +179,28 @@ gr_open(args, from_tty, gr)
   if (sr_get_device () == NULL)
     usage (gr->ops->to_shortname, NULL);
 
-  sr_set_desc(SERIAL_OPEN (sr_get_device()));
-  if (!sr_get_desc())
-    perror_with_name((char *) sr_get_device());
+  sr_set_desc (SERIAL_OPEN (sr_get_device ()));
+  if (!sr_get_desc ())
+    perror_with_name ((char *) sr_get_device ());
 
   if (baud_rate != -1)
     {
-      if (SERIAL_SETBAUDRATE(sr_get_desc(), baud_rate) != 0)
+      if (SERIAL_SETBAUDRATE (sr_get_desc (), baud_rate) != 0)
        {
-         SERIAL_CLOSE(sr_get_desc());
-         perror_with_name(sr_get_device());
+         SERIAL_CLOSE (sr_get_desc ());
+         perror_with_name (sr_get_device ());
        }
     }
 
-  SERIAL_RAW (sr_get_desc());
+  SERIAL_RAW (sr_get_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 (sr_get_desc ());
 
   /* default retries */
-  if (sr_get_retries() == 0)
-    sr_set_retries(1);
+  if (sr_get_retries () == 0)
+    sr_set_retries (1);
 
   /* default clear breakpoint function */
   if (gr_settings->clear_all_breakpoints == NULL)
@@ -213,8 +215,8 @@ gr_open(args, from_tty, gr)
       printf_filtered ("\n");
     }
 
-  push_target(gr->ops);
-  gr_checkin();
+  push_target (gr->ops);
+  gr_checkin ();
   gr_clear_all_breakpoints ();
   return;
 }
@@ -227,31 +229,31 @@ sr_readchar ()
 {
   int buf;
 
-  buf = SERIAL_READCHAR (sr_get_desc(), sr_get_timeout());
+  buf = SERIAL_READCHAR (sr_get_desc (), sr_get_timeout ());
 
   if (buf == SERIAL_TIMEOUT)
     error ("Timeout reading from remote system.");
 
-  if (sr_get_debug() > 0)
+  if (sr_get_debug () > 0)
     printf_unfiltered ("%c", buf);
 
   return buf & 0x7f;
 }
 
 int
-sr_pollchar()
+sr_pollchar ()
 {
   int buf;
 
-  buf = SERIAL_READCHAR (sr_get_desc(), 0);
+  buf = SERIAL_READCHAR (sr_get_desc (), 0);
   if (buf == SERIAL_TIMEOUT)
     buf = 0;
-  if (sr_get_debug() > 0)
+  if (sr_get_debug () > 0)
     {
       if (buf)
-        printf_unfiltered ("%c", buf);
+       printf_unfiltered ("%c", buf);
       else
-        printf_unfiltered ("<empty character poll>");
+       printf_unfiltered ("<empty character poll>");
     }
 
   return buf & 0x7f;
@@ -289,10 +291,10 @@ sr_write (a, l)
 {
   int i;
 
-  if (SERIAL_WRITE (sr_get_desc(), a, l) != 0)
+  if (SERIAL_WRITE (sr_get_desc (), a, l) != 0)
     perror_with_name ("sr_write: Error writing to remote");
 
-  if (sr_get_debug() > 0)
+  if (sr_get_debug () > 0)
     for (i = 0; i < l; i++)
       printf_unfiltered ("%c", a[i]);
 
@@ -407,15 +409,15 @@ sr_com (args, fromtty)
 }
 
 void
-gr_close(quitting)
+gr_close (quitting)
      int quitting;
 {
-  gr_clear_all_breakpoints();
+  gr_clear_all_breakpoints ();
 
-  if (sr_is_open())
+  if (sr_is_open ())
     {
-      SERIAL_CLOSE (sr_get_desc());
-      sr_set_desc(NULL);
+      SERIAL_CLOSE (sr_get_desc ());
+      sr_set_desc (NULL);
     }
 
   return;
@@ -430,14 +432,14 @@ gr_close(quitting)
    with your gdb.  */
 
 void
-gr_detach(args, from_tty)
+gr_detach (args, from_tty)
      char *args;
      int from_tty;
 {
   if (args)
     error ("Argument given to \"detach\" when remotely debugging.");
-  
-  if (sr_is_open())
+
+  if (sr_is_open ())
     gr_clear_all_breakpoints ();
 
   pop_target ();
@@ -445,7 +447,7 @@ gr_detach(args, from_tty)
     puts_filtered ("Ending remote debugging.\n");
 
   return;
-}  
+}
 
 void
 gr_files_info (ops)
@@ -454,7 +456,7 @@ gr_files_info (ops)
 #ifdef __GO32__
   printf_filtered ("\tAttached to DOS asynctsr\n");
 #else
-  printf_filtered ("\tAttached to %s", sr_get_device());
+  printf_filtered ("\tAttached to %s", sr_get_device ());
   if (baud_rate != -1)
     printf_filtered ("at %d baud", baud_rate);
   printf_filtered ("\n");
@@ -472,7 +474,7 @@ void
 gr_mourn ()
 {
   gr_clear_all_breakpoints ();
-  unpush_target (gr_get_ops());
+  unpush_target (gr_get_ops ());
   generic_mourn_inferior ();
 }
 
@@ -505,7 +507,7 @@ gr_create_inferior (execfile, args, env)
   gr_clear_all_breakpoints ();
 
   init_wait_for_inferior ();
-  gr_checkin();
+  gr_checkin ();
 
   insert_breakpoints ();       /* Needed to get correct instruction in cache */
   proceed (entry_pt, -1, 0);
@@ -523,8 +525,8 @@ gr_multi_scan (list, passthrough)
      char *list[];
      int passthrough;
 {
-  char *swallowed = NULL; /* holding area */
-  char *swallowed_p = swallowed; /* Current position in swallowed.  */
+  char *swallowed = NULL;      /* holding area */
+  char *swallowed_p = swallowed;       /* Current position in swallowed.  */
   int ch;
   int ch_handled;
   int i;
@@ -539,7 +541,7 @@ gr_multi_scan (list, passthrough)
        list[i] != NULL;
        ++i, ++string_count)
     {
-      int length = strlen(list[i]);
+      int length = strlen (list[i]);
 
       if (length > max_length)
        max_length = length;
@@ -547,22 +549,22 @@ gr_multi_scan (list, passthrough)
 
   /* if we have no strings, then something is wrong. */
   if (string_count == 0)
-    return(-1);
+    return (-1);
 
   /* otherwise, we will need a holding area big enough to hold almost two
      copies of our largest string.  */
-  swallowed_p = swallowed = alloca(max_length << 1);
+  swallowed_p = swallowed = alloca (max_length << 1);
 
   /* and a list of pointers to current scan points. */
-  plist = (char **) alloca (string_count * sizeof(*plist));
+  plist = (char **) alloca (string_count * sizeof (*plist));
 
   /* and initialize */
   for (i = 0; i < string_count; ++i)
     plist[i] = list[i];
 
-  for (ch = sr_readchar(); /* loop forever */ ; ch = sr_readchar())
+  for (ch = sr_readchar (); /* loop forever */ ; ch = sr_readchar ())
     {
-      QUIT; /* Let user quit and leave process running */
+      QUIT;                    /* Let user quit and leave process running */
       ch_handled = 0;
 
       for (i = 0; i < string_count; ++i)
@@ -571,7 +573,7 @@ gr_multi_scan (list, passthrough)
            {
              ++plist[i];
              if (*plist[i] == '\0')
-               return(i);
+               return (i);
 
              if (!ch_handled)
                *swallowed_p++ = ch;
@@ -600,7 +602,7 @@ gr_multi_scan (list, passthrough)
     }
 #if 0
   /* Never reached.  */
-  return(-1);
+  return (-1);
 #endif
 }
 
@@ -623,7 +625,7 @@ int
 gr_fetch_word (addr)
      CORE_ADDR addr;
 {
-  return dcache_fetch (gr_get_dcache(), addr);
+  return dcache_fetch (gr_get_dcache (), addr);
 }
 
 /* Write a word WORD into remote address ADDR.
@@ -634,7 +636,7 @@ gr_store_word (addr, word)
      CORE_ADDR addr;
      int word;
 {
-  dcache_poke (gr_get_dcache(), addr, word);
+  dcache_poke (gr_get_dcache (), addr, word);
 }
 
 void
@@ -642,7 +644,7 @@ _initialize_sr_support ()
 {
 /* FIXME-now: if target is open... */
   add_show_from_set (add_set_cmd ("remotedevice", no_class,
-                                 var_filename, (char *)&sr_settings.device,
+                                 var_filename, (char *) &sr_settings.device,
                                  "Set device for remote serial I/O.\n\
 This device is used as the serial port when debugging using remote\n\
 targets.", &setlist),
index d4fcd0eded333427f19797f916b2cf4e97d97200..a0fd261f72e14f9e1d8ed3848c691606d5338ad5 100644 (file)
@@ -2,21 +2,22 @@
 
    Copyright 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef REMOTE_UTILS_H
 #define REMOTE_UTILS_H
@@ -28,15 +29,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Stuff that should be shared (and handled consistently) among the various
    remote targets.  */
 
-struct _sr_settings {
-  unsigned int timeout;
+struct _sr_settings
+  {
+    unsigned int timeout;
 
-  int retries;
+    int retries;
 
-  char *device;
-  serial_t desc;
+    char *device;
+    serial_t desc;
 
-};
+  };
 
 extern struct _sr_settings sr_settings;
 
@@ -69,16 +71,17 @@ extern struct _sr_settings sr_settings;
 #define sr_check_open()        { if (!sr_is_open()) \
                                    error ("Remote device not open"); }
 
-struct gr_settings {
-  /* This is our data cache. */
-  DCACHE *dcache;
-  char *prompt;
-  struct target_ops *ops;
-  int (*clear_all_breakpoints)PARAMS((void));
-  memxferfunc readfunc;
-  memxferfunc writefunc;
-  void (*checkin)PARAMS((void));
-};
+struct gr_settings
+  {
+    /* This is our data cache. */
+    DCACHE *dcache;
+    char *prompt;
+    struct target_ops *ops;
+    int (*clear_all_breakpoints) PARAMS ((void));
+    memxferfunc readfunc;
+    memxferfunc writefunc;
+    void (*checkin) PARAMS ((void));
+  };
 
 extern struct gr_settings *gr_settings;
 
@@ -114,29 +117,29 @@ extern struct gr_settings *gr_settings;
 
 #define gr_expect_prompt()     sr_expect(gr_get_prompt())
 
-int gr_fetch_word PARAMS((CORE_ADDR addr));
-int gr_multi_scan PARAMS((char *list[], int passthrough));
-int sr_get_hex_digit PARAMS((int ignore_space));
-int sr_pollchar PARAMS((void));
-int sr_readchar PARAMS((void));
-int sr_timed_read PARAMS((char *buf, int n));
-long sr_get_hex_word PARAMS((void));
-void gr_close PARAMS((int quitting));
-void gr_create_inferior PARAMS((char *execfile, char *args, char **env));
-void gr_detach PARAMS((char *args, int from_tty));
-void gr_files_info PARAMS((struct target_ops *ops));
-void gr_generic_checkin PARAMS((void));
-void gr_kill PARAMS((void));
-void gr_mourn PARAMS((void));
-void gr_prepare_to_store PARAMS((void));
-void gr_store_word PARAMS((CORE_ADDR addr, int word));
-void sr_expect PARAMS((char *string));
-void sr_get_hex_byte PARAMS((char *byt));
-void sr_scan_args PARAMS((char *proto, char *args));
-void sr_write PARAMS((char *a, int l));
-void sr_write_cr PARAMS((char *s));
-
-void gr_open PARAMS((char *args, int from_tty,
-                    struct gr_settings *gr_settings)); 
-void gr_load_image PARAMS((char*, int from_tty));
+int gr_fetch_word PARAMS ((CORE_ADDR addr));
+int gr_multi_scan PARAMS ((char *list[], int passthrough));
+int sr_get_hex_digit PARAMS ((int ignore_space));
+int sr_pollchar PARAMS ((void));
+int sr_readchar PARAMS ((void));
+int sr_timed_read PARAMS ((char *buf, int n));
+long sr_get_hex_word PARAMS ((void));
+void gr_close PARAMS ((int quitting));
+void gr_create_inferior PARAMS ((char *execfile, char *args, char **env));
+void gr_detach PARAMS ((char *args, int from_tty));
+void gr_files_info PARAMS ((struct target_ops * ops));
+void gr_generic_checkin PARAMS ((void));
+void gr_kill PARAMS ((void));
+void gr_mourn PARAMS ((void));
+void gr_prepare_to_store PARAMS ((void));
+void gr_store_word PARAMS ((CORE_ADDR addr, int word));
+void sr_expect PARAMS ((char *string));
+void sr_get_hex_byte PARAMS ((char *byt));
+void sr_scan_args PARAMS ((char *proto, char *args));
+void sr_write PARAMS ((char *a, int l));
+void sr_write_cr PARAMS ((char *s));
+
+void gr_open PARAMS ((char *args, int from_tty,
+                     struct gr_settings * gr_settings));
+void gr_load_image PARAMS ((char *, int from_tty));
 #endif /* REMOTE_UTILS_H */
index 9ad86d4562e939113305181e673e7701f25113bf..787bd3924a422203c56e9ff56ac319e6bbf9fb5c 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1990-95, 1997-98, 1999 Free Software Foundation, Inc.
    Contributed by Wind River Systems and Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -28,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "symtab.h"
 #include "complaints.h"
 #include "gdbcmd.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
+#include "bfd.h"               /* Required by objfiles.h.  */
+#include "symfile.h"           /* Required by objfiles.h.  */
 #include "objfiles.h"
 #include "gdb-stabs.h"
 
@@ -63,11 +64,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern void vx_read_register ();
 extern void vx_write_register ();
 extern void symbol_file_command ();
-extern int stop_soon_quietly;          /* for wait_for_inferior */
+extern int stop_soon_quietly;  /* for wait_for_inferior */
 
 static int net_step ();
 static int net_ptrace_clnt_call ();    /* Forward decl */
-static enum clnt_stat net_clnt_call ();        /* Forward decl */
+static enum clnt_stat net_clnt_call ();                /* Forward decl */
 
 /* Target ops structure for accessing memory and such over the net */
 
@@ -81,7 +82,7 @@ static struct target_ops vx_run_ops;
    Both malloc'd.  */
 
 static char *vx_host;
-static char *vx_running;               /* Called function */
+static char *vx_running;       /* Called function */
 
 /* Nonzero means target that is being debugged remotely has a floating
    point processor.  */
@@ -92,17 +93,18 @@ int target_has_fp;
 
 static const char rpcerr[] = "network target debugging:  rpc error";
 
-CLIENT *pClient;         /* client used in net debugging */
+CLIENT *pClient;               /* client used in net debugging */
 static int ptraceSock = RPC_ANYSOCK;
 
-enum clnt_stat net_clnt_call();
+enum clnt_stat net_clnt_call ();
 static void parse_args ();
 
-static struct timeval rpcTimeout = { 10, 0 };
+static struct timeval rpcTimeout =
+{10, 0};
 
 static char *skip_white_space ();
 static char *find_white_space ();
+
 /* Tell the VxWorks target system to download a file.
    The load addresses of the text, data, and bss segments are
    stored in *pTextAddr, *pDataAddr, and *pBssAddr (respectively).
@@ -130,9 +132,9 @@ net_load (filename, pTextAddr, pDataAddr, pBssAddr)
      Do not change the tv_sec value without checking -- select() imposes
      a limit of 10**8 on it for no good reason that I can see...  */
 
-  load_timeout.tv_sec = 99999999;   /* A large number, effectively inf. */
+  load_timeout.tv_sec = 99999999;      /* A large number, effectively inf. */
   load_timeout.tv_usec = 0;
+
   status = clnt_call (pClient, VX_LOAD, xdr_wrapstring, &filename, xdr_ldfile,
                      &ldstruct, load_timeout);
 
@@ -158,8 +160,8 @@ net_break (addr, procnum)
 {
   enum clnt_stat status;
   int break_status;
-  Rptrace ptrace_in;  /* XXX This is stupid.  It doesn't need to be a ptrace
-                        structure.  How about something smaller? */
+  Rptrace ptrace_in;           /* XXX This is stupid.  It doesn't need to be a ptrace
+                                  structure.  How about something smaller? */
 
   memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
   break_status = 0;
@@ -171,11 +173,11 @@ net_break (addr, procnum)
                          &break_status);
 
   if (status != RPC_SUCCESS)
-      return errno;
+    return errno;
 
   if (break_status == -1)
     return ENOMEM;
-  return break_status; /* probably (FIXME) zero */
+  return break_status;         /* probably (FIXME) zero */
 }
 
 /* returns 0 if successful, errno otherwise */
@@ -202,7 +204,7 @@ vx_remove_breakpoint (addr)
    ENV is the environment vector to pass.
    Returns process id.  Errors reported with error().
    On VxWorks, we ignore exec_file.  */
+
 static void
 vx_create_inferior (exec_file, args, env)
      char *exec_file;
@@ -267,9 +269,9 @@ parse_args (arg_string, arg_struct)
   register int arg_count = 0;  /* number of arguments */
   register int arg_index = 0;
   register char *p0;
+
   memset ((char *) arg_struct, '\0', sizeof (arg_array));
+
   /* first count how many arguments there are */
 
   p0 = arg_string;
@@ -309,7 +311,7 @@ skip_white_space (p)
     p++;
   return p;
 }
-    
+
 /* Search for the first unquoted whitespace character in a string.
    Returns a pointer to the character, or to the null terminator
    if no whitespace is found.  */
@@ -336,33 +338,33 @@ find_white_space (p)
     }
   return p;
 }
-    
+
 /* Poll the VxWorks target system for an event related
    to the debugged task.
    Returns -1 if remote wait failed, task status otherwise.  */
 
 static int
 net_wait (pEvent)
-    RDB_EVENT *pEvent;
+     RDB_EVENT *pEvent;
 {
-    int pid;
-    enum clnt_stat status;
+  int pid;
+  enum clnt_stat status;
 
-    memset ((char *) pEvent, '\0', sizeof (RDB_EVENT));
+  memset ((char *) pEvent, '\0', sizeof (RDB_EVENT));
 
-    pid = inferior_pid;
-    status = net_clnt_call (PROCESS_WAIT, xdr_int, &pid, xdr_RDB_EVENT,
-                           pEvent);
-
-    /* return (status == RPC_SUCCESS)? pEvent->status: -1; */
-    if (status == RPC_SUCCESS)
-      return ((pEvent->status) ? 1 : 0);
-    else if (status == RPC_TIMEDOUT)
-      return (1);
-    else
-      return (-1);
+  pid = inferior_pid;
+  status = net_clnt_call (PROCESS_WAIT, xdr_int, &pid, xdr_RDB_EVENT,
+                         pEvent);
+
+  /* return (status == RPC_SUCCESS)? pEvent->status: -1; */
+  if (status == RPC_SUCCESS)
+    return ((pEvent->status) ? 1 : 0);
+  else if (status == RPC_TIMEDOUT)
+    return (1);
+  else
+    return (-1);
 }
-    
+
 /* Suspend the remote task.
    Returns -1 if suspend fails on target system, 0 otherwise.  */
 
@@ -383,7 +385,7 @@ net_quit ()
   status = net_clnt_call (VX_TASK_SUSPEND, xdr_int, &pid, xdr_int,
                          &quit_status);
 
-  return (status == RPC_SUCCESS)? quit_status: -1;
+  return (status == RPC_SUCCESS) ? quit_status : -1;
 }
 
 /* Read a register or registers from the remote system.  */
@@ -412,7 +414,7 @@ net_read_registers (reg_buf, len, procnum)
 
   out_data.bytes = reg_buf;
   out_data.len = len;
-  ptrace_out.info.more_data = (caddr_t) &out_data;
+  ptrace_out.info.more_data = (caddr_t) & out_data;
 
   /* Call RPC; take an error exit if appropriate.  */
 
@@ -423,8 +425,8 @@ net_read_registers (reg_buf, len, procnum)
     {
       errno = ptrace_out.errno_num;
       sprintf (message, "reading %s registers", (procnum == PTRACE_GETREGS)
-                                                ? "general-purpose"
-                                                : "floating-point");
+              ? "general-purpose"
+              : "floating-point");
       perror_with_name (message);
     }
 }
@@ -458,7 +460,7 @@ net_write_registers (reg_buf, len, procnum)
 
   ptrace_in.pid = inferior_pid;
   ptrace_in.info.ttype = DATA;
-  ptrace_in.info.more_data = (caddr_t) &in_data;
+  ptrace_in.info.more_data = (caddr_t) & in_data;
 
   /* Call RPC; take an error exit if appropriate.  */
 
@@ -469,8 +471,8 @@ net_write_registers (reg_buf, len, procnum)
     {
       errno = ptrace_out.errno_num;
       sprintf (message, "writing %s registers", (procnum == PTRACE_SETREGS)
-                                                ? "general-purpose"
-                                                : "floating-point");
+              ? "general-purpose"
+              : "floating-point");
       perror_with_name (message);
     }
 }
@@ -499,7 +501,7 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   int status;
   Rptrace ptrace_in;
@@ -511,22 +513,22 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
   memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
   memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
 
-  ptrace_in.pid = inferior_pid;                /* XXX pid unnecessary for READDATA */
+  ptrace_in.pid = inferior_pid;        /* XXX pid unnecessary for READDATA */
   ptrace_in.addr = (int) memaddr;      /* Where from */
-  ptrace_in.data = len;                        /* How many bytes */
+  ptrace_in.data = len;                /* How many bytes */
 
   if (write)
     {
-      ptrace_in.info.ttype     = DATA;
-      ptrace_in.info.more_data = (caddr_t) &data;
+      ptrace_in.info.ttype = DATA;
+      ptrace_in.info.more_data = (caddr_t) & data;
 
       data.bytes = (caddr_t) myaddr;   /* Where from */
-      data.len   = len;                        /* How many bytes (again, for XDR) */
+      data.len = len;          /* How many bytes (again, for XDR) */
       request = PTRACE_WRITEDATA;
     }
   else
     {
-      ptrace_out.info.more_data = (caddr_t) &data;
+      ptrace_out.info.more_data = (caddr_t) & data;
       request = PTRACE_READDATA;
     }
   /* Loop until the entire request has been satisfied, transferring
@@ -549,23 +551,23 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
          report an error and return to debugger command level.  */
 
       if (net_ptrace_clnt_call (request, &ptrace_in, &ptrace_out))
-        error (rpcerr);
+       error (rpcerr);
 
       status = ptrace_out.status;
       if (status == 0)
-        {
-          memaddr += nxfer;
-          myaddr += nxfer;
-          nleft -= nxfer;
-        }
+       {
+         memaddr += nxfer;
+         myaddr += nxfer;
+         nleft -= nxfer;
+       }
       else
-        {
-          /* A target-side error has ocurred.  Set errno to the error
-             code chosen by the target so that a later perror () will
-             say something meaningful.  */
+       {
+         /* A target-side error has ocurred.  Set errno to the error
+            code chosen by the target so that a later perror () will
+            say something meaningful.  */
 
-          errno = ptrace_out.errno_num;
-        }
+         errno = ptrace_out.errno_num;
+       }
     }
 
   /* Return the number of bytes transferred.  */
@@ -577,19 +579,19 @@ static void
 vx_files_info ()
 {
   printf_unfiltered ("\tAttached to host `%s'", vx_host);
-  printf_unfiltered (", which has %sfloating point", target_has_fp? "": "no ");
+  printf_unfiltered (", which has %sfloating point", target_has_fp ? "" : "no ");
   printf_unfiltered (".\n");
 }
 
 static void
 vx_run_files_info ()
 {
-  printf_unfiltered ("\tRunning %s VxWorks process %s", 
+  printf_unfiltered ("\tRunning %s VxWorks process %s",
                     vx_running ? "child" : "attached",
                     local_hex_string (inferior_pid));
   if (vx_running)
     printf_unfiltered (", function `%s'", vx_running);
-  printf_unfiltered(".\n");
+  printf_unfiltered (".\n");
 }
 
 static void
@@ -625,10 +627,10 @@ vx_resume (pid, step, siggnal)
   memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
 
   ptrace_in.pid = pid;
-  ptrace_in.addr = cont_addr; /* Target side insists on this, or it panics.  */
+  ptrace_in.addr = cont_addr;  /* Target side insists on this, or it panics.  */
 
   if (step)
-    status = net_step();
+    status = net_step ();
   else
     status = net_ptrace_clnt_call (PTRACE_CONT, &ptrace_in, &ptrace_out);
 
@@ -647,16 +649,17 @@ vx_mourn_inferior ()
   pop_target ();               /* Pop back to no-child state */
   generic_mourn_inferior ();
 }
-
 \f
+
 static void vx_add_symbols PARAMS ((char *, int, CORE_ADDR, CORE_ADDR,
                                    CORE_ADDR));
 
-struct find_sect_args {
-  CORE_ADDR text_start;
-  CORE_ADDR data_start;
-  CORE_ADDR bss_start;
-};
+struct find_sect_args
+  {
+    CORE_ADDR text_start;
+    CORE_ADDR data_start;
+    CORE_ADDR bss_start;
+  };
 
 static void find_sect PARAMS ((bfd *, asection *, void *));
 
@@ -666,7 +669,7 @@ find_sect (abfd, sect, obj)
      asection *sect;
      PTR obj;
 {
-  struct find_sect_args *args = (struct find_sect_args *)obj;
+  struct find_sect_args *args = (struct find_sect_args *) obj;
 
   if (bfd_get_section_flags (abfd, sect) & (SEC_CODE & SEC_READONLY))
     args->text_start = bfd_get_section_vma (abfd, sect);
@@ -750,9 +753,9 @@ vx_load_command (arg_string, from_tty)
     {
       if (query ("You may not load a module while the target task is running.\n\
 Kill the target task? "))
-        target_kill ();
+       target_kill ();
       else
-        error ("Load cancelled.");
+       error ("Load cancelled.");
     }
 
   QUIT;
@@ -797,7 +800,7 @@ net_step ()
 
   if (status == RPC_SUCCESS)
     return step_status;
-  else 
+  else
     error (rpcerr);
 }
 
@@ -806,9 +809,9 @@ net_step ()
 
 static int
 net_ptrace_clnt_call (request, pPtraceIn, pPtraceOut)
-    enum ptracereq request;
-    Rptrace *pPtraceIn;
-    Ptrace_return *pPtraceOut;
+     enum ptracereq request;
+     Rptrace *pPtraceIn;
+     Ptrace_return *pPtraceOut;
 {
   enum clnt_stat status;
 
@@ -816,7 +819,7 @@ net_ptrace_clnt_call (request, pPtraceIn, pPtraceOut)
                          pPtraceOut);
 
   if (status != RPC_SUCCESS)
-      return -1;
+    return -1;
 
   return 0;
 }
@@ -845,7 +848,7 @@ net_get_boot_file (pBootFile)
 
 static int
 net_get_symbols (pLoadTable)
-     ldtabl *pLoadTable;               /* return pointer to ldtabl here */
+     ldtabl *pLoadTable;       /* return pointer to ldtabl here */
 {
   enum clnt_stat status;
 
@@ -860,7 +863,7 @@ net_get_symbols (pLoadTable)
    Returns -1 and complain()s if rpc fails.  */
 
 struct complaint cant_contact_target =
-  {"Lost contact with VxWorks target", 0, 0};
+{"Lost contact with VxWorks target", 0, 0};
 
 static int
 vx_lookup_symbol (name, pAddr)
@@ -893,13 +896,13 @@ static int
 net_check_for_fp ()
 {
   enum clnt_stat status;
-  bool_t fp = 0;       /* true if fp processor is present on target board */
+  bool_t fp = 0;               /* true if fp processor is present on target board */
 
   status = net_clnt_call (VX_FP_INQUIRE, xdr_void, 0, xdr_bool, &fp);
   if (status != RPC_SUCCESS)
     error (rpcerr);
 
-   return (int) fp;
+  return (int) fp;
 }
 
 /* Establish an RPC connection with the VxWorks target system.
@@ -925,15 +928,15 @@ net_connect (host)
           For example if the user types "target vxworks vx960 " it should
           say "Invalid host `vx960 '." not just "Invalid hostname".  */
        error ("Invalid hostname.  Couldn't find remote host address.");
-      addr = * (unsigned long *) destHost->h_addr;
+      addr = *(unsigned long *) destHost->h_addr;
     }
 
   memset (&destAddr, '\0', sizeof (destAddr));
 
   destAddr.sin_addr.s_addr = addr;
-  destAddr.sin_family      = AF_INET;
-  destAddr.sin_port        = 0;        /* set to actual port that remote
-                                  ptrace is listening on.  */
+  destAddr.sin_family = AF_INET;
+  destAddr.sin_port = 0;       /* set to actual port that remote
+                                  ptrace is listening on.  */
 
   /* Create a tcp client transport on which to issue
      calls to the remote ptrace server.  */
@@ -985,7 +988,7 @@ vx_wait (pid_to_wait_for, status)
   do
     {
       /* If CTRL-C is hit during this loop,
-        suspend the inferior process.  */
+         suspend the inferior process.  */
 
       quit_failed = 0;
       if (quit_flag)
@@ -995,19 +998,19 @@ vx_wait (pid_to_wait_for, status)
        }
 
       /* If a net_quit () or net_wait () call has failed,
-        allow the user to break the connection with the target.
-        We can't simply error () out of this loop, since the 
-        data structures representing the state of the inferior
-        are in an inconsistent state.  */
+         allow the user to break the connection with the target.
+         We can't simply error () out of this loop, since the 
+         data structures representing the state of the inferior
+         are in an inconsistent state.  */
 
       if (quit_failed || net_wait (&rdbEvent) == -1)
        {
          terminal_ours ();
          if (query ("Can't %s.  Disconnect from target system? ",
                     (quit_failed) ? "suspend remote task"
-                                  : "get status of remote task"))
+                    : "get status of remote task"))
            {
-             target_mourn_inferior();
+             target_mourn_inferior ();
              error ("Use the \"target\" command to reconnect.");
            }
          else
@@ -1016,7 +1019,7 @@ vx_wait (pid_to_wait_for, status)
              continue;
            }
        }
-      
+
       pid = rdbEvent.taskId;
       if (pid == 0)
        {
@@ -1024,8 +1027,9 @@ vx_wait (pid_to_wait_for, status)
        }
       else if (pid != inferior_pid)
        fatal ("Bad pid for debugged task: %s\n",
-              local_hex_string((unsigned long) pid));
-    } while (pid == 0);
+              local_hex_string ((unsigned long) pid));
+    }
+  while (pid == 0);
 
   /* The mostly likely kind.  */
   status->kind = TARGET_WAITKIND_STOPPED;
@@ -1035,7 +1039,7 @@ vx_wait (pid_to_wait_for, status)
     case EVENT_EXIT:
       status->kind = TARGET_WAITKIND_EXITED;
       /* FIXME is it possible to distinguish between a
-        normal vs abnormal exit in VxWorks? */
+         normal vs abnormal exit in VxWorks? */
       status->value.integer = 0;
       break;
 
@@ -1053,11 +1057,11 @@ vx_wait (pid_to_wait_for, status)
       status->value.sig = TARGET_SIGNAL_TRAP;
       break;
 
-    case EVENT_SUSPEND:                /* Task was suspended, probably by ^C. */
+    case EVENT_SUSPEND:        /* Task was suspended, probably by ^C. */
       status->value.sig = TARGET_SIGNAL_INT;
       break;
 
-    case EVENT_BUS_ERR:                /* Task made evil nasty reference. */
+    case EVENT_BUS_ERR:        /* Task made evil nasty reference. */
       status->value.sig = TARGET_SIGNAL_BUS;
       break;
 
@@ -1070,14 +1074,14 @@ vx_wait (pid_to_wait_for, status)
       status->value.sig = i960_fault_to_signal (rdbEvent.sigType);
 #else
       /* Back in the old days, before enum target_signal, this code used
-        to add NSIG to the signal number and claim that PRINT_RANDOM_SIGNAL
-        would take care of it.  But PRINT_RANDOM_SIGNAL has never been
-        defined except on the i960, so I don't really know what we are
-        supposed to do on other architectures.  */
+         to add NSIG to the signal number and claim that PRINT_RANDOM_SIGNAL
+         would take care of it.  But PRINT_RANDOM_SIGNAL has never been
+         defined except on the i960, so I don't really know what we are
+         supposed to do on other architectures.  */
       status->value.sig = TARGET_SIGNAL_UNKNOWN;
 #endif
       break;
-    } /* switch */
+    }                          /* switch */
   return pid;
 }
 \f
@@ -1093,9 +1097,9 @@ static int
 add_symbol_stub (arg)
      char *arg;
 {
-  struct ldfile *pLoadFile = (struct ldfile *)arg;
+  struct ldfile *pLoadFile = (struct ldfile *) arg;
 
-  printf_unfiltered("\t%s: ", pLoadFile->name);
+  printf_unfiltered ("\t%s: ", pLoadFile->name);
   vx_add_symbols (pLoadFile->name, 0, pLoadFile->txt_addr,
                  pLoadFile->data_addr, pLoadFile->bss_addr);
   printf_unfiltered ("ok\n");
@@ -1125,7 +1129,7 @@ vx_open (args, from_tty)
     error_no_arg ("target machine name");
 
   target_preopen (from_tty);
-  
+
   unpush_target (&vx_ops);
   printf_unfiltered ("Attaching remote machine across net...\n");
   gdb_flush (gdb_stdout);
@@ -1178,31 +1182,31 @@ vx_open (args, from_tty)
   if (net_get_symbols (&loadTable) != 0)
     error ("Can't read loaded modules from target machine");
 
-  i = 0-1;
+  i = 0 - 1;
   while (++i < loadTable.tbl_size)
     {
-      QUIT;    /* FIXME, avoids clnt_freeres below:  mem leak */
-      pLoadFile = &loadTable.tbl_ent [i];
+      QUIT;                    /* FIXME, avoids clnt_freeres below:  mem leak */
+      pLoadFile = &loadTable.tbl_ent[i];
 #ifdef WRS_ORIG
-  {
-    register int desc;
-    struct cleanup *old_chain;
-    char *fullname = NULL;
-
-    desc = openp (source_path, 0, pLoadFile->name, O_RDONLY, 0, &fullname);
-    if (desc < 0)
-       perror_with_name (pLoadFile->name);
-    old_chain = make_cleanup (close, desc);
-    add_file_at_addr (fullname, desc, pLoadFile->txt_addr, pLoadFile->data_addr,
-                     pLoadFile->bss_addr);
-    do_cleanups (old_chain);
-  }
+      {
+       register int desc;
+       struct cleanup *old_chain;
+       char *fullname = NULL;
+
+       desc = openp (source_path, 0, pLoadFile->name, O_RDONLY, 0, &fullname);
+       if (desc < 0)
+         perror_with_name (pLoadFile->name);
+       old_chain = make_cleanup (close, desc);
+       add_file_at_addr (fullname, desc, pLoadFile->txt_addr, pLoadFile->data_addr,
+                         pLoadFile->bss_addr);
+       do_cleanups (old_chain);
+      }
 #else
       /* FIXME: Is there something better to search than the PATH? (probably
-        not the source path, since source might be in different directories
-        than objects.  */
+         not the source path, since source might be in different directories
+         than objects.  */
 
-      if (catch_errors (add_symbol_stub, (char *)pLoadFile, (char *)0,
+      if (catch_errors (add_symbol_stub, (char *) pLoadFile, (char *) 0,
                        RETURN_MASK_ALL))
        symbols_added = 1;
 #endif
@@ -1240,10 +1244,10 @@ vx_attach (args, from_tty)
 
   if (from_tty)
     printf_unfiltered ("Attaching pid %s.\n",
-                      local_hex_string((unsigned long) pid));
+                      local_hex_string ((unsigned long) pid));
 
-  memset ((char *)&ptrace_in,  '\0', sizeof (ptrace_in));
-  memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out));
+  memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
+  memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
   ptrace_in.pid = pid;
 
   status = net_ptrace_clnt_call (PTRACE_ATTACH, &ptrace_in, &ptrace_out);
@@ -1288,14 +1292,14 @@ vx_detach (args, from_tty)
     error ("Argument given to VxWorks \"detach\".");
 
   if (from_tty)
-      printf_unfiltered ("Detaching pid %s.\n",
-             local_hex_string((unsigned long) inferior_pid));
+    printf_unfiltered ("Detaching pid %s.\n",
+                      local_hex_string ((unsigned long) inferior_pid));
 
-  if (args)            /* FIXME, should be possible to leave suspended */
+  if (args)                    /* FIXME, should be possible to leave suspended */
     signal = atoi (args);
-  
-  memset ((char *)&ptrace_in,  '\0', sizeof (ptrace_in));
-  memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out));
+
+  memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
+  memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
   ptrace_in.pid = inferior_pid;
 
   status = net_ptrace_clnt_call (PTRACE_DETACH, &ptrace_in, &ptrace_out);
@@ -1308,7 +1312,7 @@ vx_detach (args, from_tty)
     }
 
   inferior_pid = 0;
-  pop_target ();       /* go back to non-executing VxWorks connection */
+  pop_target ();               /* go back to non-executing VxWorks connection */
 }
 
 /* vx_kill -- takes a running task and wipes it out.  */
@@ -1320,10 +1324,10 @@ vx_kill ()
   Ptrace_return ptrace_out;
   int status;
 
-  printf_unfiltered ("Killing pid %s.\n", local_hex_string((unsigned long) inferior_pid));
+  printf_unfiltered ("Killing pid %s.\n", local_hex_string ((unsigned long) inferior_pid));
 
-  memset ((char *)&ptrace_in,  '\0', sizeof (ptrace_in));
-  memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out));
+  memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in));
+  memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out));
   ptrace_in.pid = inferior_pid;
 
   status = net_ptrace_clnt_call (PTRACE_KILL, &ptrace_in, &ptrace_out);
@@ -1338,7 +1342,7 @@ vx_kill ()
   /* If it gives good status, the process is *gone*, no events remain.
      If the kill failed, assume the process is gone anyhow.  */
   inferior_pid = 0;
-  pop_target ();       /* go back to non-executing VxWorks connection */
+  pop_target ();               /* go back to non-executing VxWorks connection */
 }
 
 /* Clean up from the VxWorks process target as it goes away.  */
@@ -1358,18 +1362,18 @@ vx_proc_close (quitting)
 
 static enum clnt_stat
 net_clnt_call (procNum, inProc, in, outProc, out)
-    enum ptracereq procNum;
-    xdrproc_t inProc;
-    char *in;
-    xdrproc_t outProc;
-    char *out;
+     enum ptracereq procNum;
+     xdrproc_t inProc;
+     char *in;
+     xdrproc_t outProc;
+     char *out;
 {
   enum clnt_stat status;
-  
+
   status = clnt_call (pClient, procNum, inProc, in, outProc, out, rpcTimeout);
 
   if (status != RPC_SUCCESS)
-      clnt_perrno (status);
+    clnt_perrno (status);
 
   return status;
 }
@@ -1390,7 +1394,7 @@ vx_close (quitting)
 }
 
 /* A vxprocess target should be started via "run" not "target".  */
-/*ARGSUSED*/
+/*ARGSUSED */
 static void
 vx_proc_open (name, from_tty)
      char *name;
@@ -1417,7 +1421,7 @@ Specify the name of the machine to connect to.";
   vx_ops.to_stratum = core_stratum;
   vx_ops.to_has_all_memory = 1;
   vx_ops.to_has_memory = 1;
-  vx_ops.to_magic = OPS_MAGIC;         /* Always the last thing */
+  vx_ops.to_magic = OPS_MAGIC; /* Always the last thing */
 };
 
 static void
@@ -1441,13 +1445,13 @@ init_vx_run_ops ()
   vx_run_ops.to_kill = vx_kill;
   vx_run_ops.to_load = vx_load_command;
   vx_run_ops.to_lookup_symbol = vx_lookup_symbol;
-  vx_run_ops.to_mourn_inferior = vx_mourn_inferior ;
+  vx_run_ops.to_mourn_inferior = vx_mourn_inferior;
   vx_run_ops.to_stratum = process_stratum;
   vx_run_ops.to_has_memory = 1;
   vx_run_ops.to_has_stack = 1;
   vx_run_ops.to_has_registers = 1;
-  vx_run_ops.to_has_execution = 1;     
-  vx_run_ops.to_magic = OPS_MAGIC;     
+  vx_run_ops.to_has_execution = 1;
+  vx_run_ops.to_magic = OPS_MAGIC;
 }
 \f
 void
index e6fc2c79495ddc73e286ba219bb428ce94f3647f..06cc0482fcd3c1374e09876a45514d3464375156 100644 (file)
@@ -1,28 +1,29 @@
 /* Am29k-dependent portions of the RPC protocol
    used with a VxWorks target 
 
-Contributed by Wind River Systems.
+   Contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "defs.h"
 
-#include "vx-share/regPacket.h"  
+#include "vx-share/regPacket.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/time.h>
 #include <sys/socket.h>
 
-#ifdef _AIX                     /* IBM claims "void *malloc()" not char * */
+#ifdef _AIX                    /* IBM claims "void *malloc()" not char * */
 #define malloc bogon_malloc
 #endif
 
@@ -107,7 +108,7 @@ vx_read_register (regno)
   if (target_has_fp)
     {
       net_read_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
-                          PTRACE_GETFPREGS);
+                         PTRACE_GETFPREGS);
       registers[REGISTER_BYTE (FPE_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPE];
       registers[REGISTER_BYTE (FPS_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPS];
 
@@ -116,7 +117,7 @@ vx_read_register (regno)
       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);
 
@@ -163,7 +164,7 @@ vx_write_register (regno)
       am29k_fpreg_packet[AM29K_R_FPS] = registers[REGISTER_BYTE (FPS_REGNUM)];
 
       net_write_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
-                           PTRACE_SETFPREGS);
+                          PTRACE_SETFPREGS);
     }
 }
 
@@ -172,17 +173,16 @@ vx_write_register (regno)
    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. */
+   and store it into the frame_info struct rather than reading its
+   contents when FRAME_CHAIN_VALID is invoked. */
 
 int
 vx29k_frame_chain_valid (chain, thisframe)
      CORE_ADDR chain;
-     struct frame_info *thisframe;      /* not used here */
+     struct frame_info *thisframe;     /* not used here */
 {
-   int fp_contents;
+  int fp_contents;
 
-   read_memory ((CORE_ADDR)(chain + 4), (char *) &fp_contents, 4);
-   return (fp_contents != 0);
+  read_memory ((CORE_ADDR) (chain + 4), (char *) &fp_contents, 4);
+  return (fp_contents != 0);
 }
-
index c6ceda18e0534d64fa1a1ef85e79adae43a0a782..e9c0fb535f09d8bd08e8115d910a58c7146c477c 100644 (file)
@@ -1,28 +1,29 @@
 /* 68k-dependent portions of the RPC protocol
    used with a VxWorks target 
 
-Contributed by Wind River Systems.
+   Contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "defs.h"
 
-#include "vx-share/regPacket.h"  
+#include "vx-share/regPacket.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
index bb4fbee616732fc6b29266398a01aa02b8d10a65..012d1c022299676c8f20c54811adf2b7d0d6dcd1 100644 (file)
@@ -1,28 +1,29 @@
 /* i80960-dependent portions of the RPC protocol
    used with a VxWorks target 
 
-Contributed by Wind River Systems.
+   Contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "defs.h"
 
-#include "vx-share/regPacket.h"  
+#include "vx-share/regPacket.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/time.h>
 #include <sys/socket.h>
 
-#ifdef _AIX                     /* IBM claims "void *malloc()" not char * */
+#ifdef _AIX                    /* IBM claims "void *malloc()" not char * */
 #define malloc bogon_malloc
 #endif
 
@@ -106,14 +107,14 @@ vx_read_register (regno)
   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);
+                         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);
+          REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
 
   /* Mark the register cache valid.  */
 
@@ -152,12 +153,11 @@ vx_write_register (regno)
 
   if (target_has_fp)
     {
-      bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], 
+      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);
+                          PTRACE_SETFPREGS);
     }
 }
-
index c65ac015ead74f3c0d10261d40ca81364ab73caa..c59a12c22106aa277db068fe0d189d8d30300c83 100644 (file)
@@ -1,28 +1,29 @@
 /* MIPS-dependent portions of the RPC protocol
    used with a VxWorks target 
 
-Contributed by Wind River Systems.
+   Contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "defs.h"
 
-#include "vx-share/regPacket.h"  
+#include "vx-share/regPacket.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -78,50 +79,50 @@ vx_read_register (regno)
 
   /* this code copies the registers obtained by RPC 
      stored in a structure(s) like this :
-     
-       Register(s)             Offset(s)
-       gp 0-31                 0x00
-       hi                      0x80
-       lo                      0x84
-       sr                      0x88
-       pc                      0x8c
-    
+
+     Register(s)                Offset(s)
+     gp 0-31                    0x00
+     hi                 0x80
+     lo                 0x84
+     sr                 0x88
+     pc                 0x8c
+
      into a stucture like this:
-       
-       0x00    GP 0-31
-       0x80    SR
-       0x84    LO
-       0x88    HI
-       0x8C    BAD             --- Not available currently
-       0x90    CAUSE           --- Not available currently
-       0x94    PC
-       0x98    FP 0-31
-       0x118   FCSR
-       0x11C   FIR             --- Not available currently
-       0x120   FP              --- Not available currently
-   
+
+     0x00       GP 0-31
+     0x80       SR
+     0x84       LO
+     0x88       HI
+     0x8C       BAD             --- Not available currently
+     0x90       CAUSE           --- Not available currently
+     0x94       PC
+     0x98       FP 0-31
+     0x118      FCSR
+     0x11C      FIR             --- Not available currently
+     0x120      FP              --- Not available currently
+
      structure is 0x124 (292) bytes in length */
-   
+
   /* Copy the general registers.  */
-  
+
   bcopy (&mips_greg_packet[MIPS_R_GP0], &registers[0], 32 * MIPS_GREG_SIZE);
-  
+
   /* Copy SR, LO, HI, and PC.  */
-  
+
   bcopy (&mips_greg_packet[MIPS_R_SR],
-         &registers[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
+        &registers[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
   bcopy (&mips_greg_packet[MIPS_R_LO],
-         &registers[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
+        &registers[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
   bcopy (&mips_greg_packet[MIPS_R_HI],
-         &registers[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
+        &registers[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
   bcopy (&mips_greg_packet[MIPS_R_PC],
-         &registers[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE);
-  
+        &registers[REGISTER_BYTE (PC_REGNUM)], MIPS_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 (mips_fpreg_packet, MIPS_FPREG_PLEN,
@@ -129,23 +130,23 @@ vx_read_register (regno)
 
       /* Copy the floating point registers.  */
 
-      bcopy (&mips_fpreg_packet[MIPS_R_FP0], 
+      bcopy (&mips_fpreg_packet[MIPS_R_FP0],
             &registers[REGISTER_BYTE (FP0_REGNUM)],
             REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
 
       /* Copy the floating point control/status register (fpcsr).  */
 
-      bcopy (&mips_fpreg_packet[MIPS_R_FPCSR], 
+      bcopy (&mips_fpreg_packet[MIPS_R_FPCSR],
             &registers[REGISTER_BYTE (FCRCS_REGNUM)],
             REGISTER_RAW_SIZE (FCRCS_REGNUM));
-    }  
+    }
   else
-    {  
+    {
       bzero ((char *) &registers[REGISTER_BYTE (FP0_REGNUM)],
             REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
       bzero ((char *) &registers[REGISTER_BYTE (FCRCS_REGNUM)],
             REGISTER_RAW_SIZE (FCRCS_REGNUM));
-    }          
+    }
 
   /* Mark the register cache valid.  */
 
@@ -165,18 +166,18 @@ vx_write_register (regno)
   /* Store general registers.  */
 
   bcopy (&registers[0], &mips_greg_packet[MIPS_R_GP0], 32 * MIPS_GREG_SIZE);
-  
+
   /* Copy SR, LO, HI, and PC.  */
-  
+
   bcopy (&registers[REGISTER_BYTE (PS_REGNUM)],
-         &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE);
+        &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE);
   bcopy (&registers[REGISTER_BYTE (LO_REGNUM)],
-         &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE);
+        &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE);
   bcopy (&registers[REGISTER_BYTE (HI_REGNUM)],
-         &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE);
+        &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE);
   bcopy (&registers[REGISTER_BYTE (PC_REGNUM)],
-         &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE);
-  
+        &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE);
+
   net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS);
 
   /* Store floating point registers if the target has them.  */
@@ -186,13 +187,13 @@ vx_write_register (regno)
       /* Copy the floating point data registers.  */
 
       bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
-            &mips_fpreg_packet[MIPS_R_FP0], 
+            &mips_fpreg_packet[MIPS_R_FP0],
             REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
 
       /* Copy the floating point control/status register (fpcsr).  */
 
       bcopy (&registers[REGISTER_BYTE (FCRCS_REGNUM)],
-            &mips_fpreg_packet[MIPS_R_FPCSR], 
+            &mips_fpreg_packet[MIPS_R_FPCSR],
             REGISTER_RAW_SIZE (FCRCS_REGNUM));
 
       net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,
index 068254240fab9aa7415f5774f3fa29fe89988023..ee080aad6061deca701fd9aed76a1c9bf8ce11e7 100644 (file)
@@ -1,28 +1,29 @@
 /* sparc-dependent portions of the RPC protocol
    used with a VxWorks target 
 
-Contributed by Wind River Systems.
+   Contributed by Wind River Systems.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "defs.h"
 
-#include "vx-share/regPacket.h"  
+#include "vx-share/regPacket.h"
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
@@ -40,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/time.h>
 #include <sys/socket.h>
 
-#ifdef _AIX                     /* IBM claims "void *malloc()" not char * */
+#ifdef _AIX                    /* IBM claims "void *malloc()" not char * */
 #define malloc bogon_malloc
 #endif
 
@@ -102,8 +103,8 @@ vx_read_register (regno)
      active frame automatically; it greatly simplifies debugging
      (FRAME_FIND_SAVED_REGS, in particular, depends on this).  */
 
-  sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)], 
-       REGISTER_RAW_SIZE (CORE_ADDR));
+  sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
+                       REGISTER_RAW_SIZE (CORE_ADDR));
   write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
                16 * REGISTER_RAW_SIZE (L0_REGNUM));
 
@@ -115,14 +116,14 @@ vx_read_register (regno)
   if (target_has_fp)
     {
       net_read_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
-                          PTRACE_GETFPREGS);
-      bcopy (&sparc_fpreg_packet[SPARC_R_FP0], 
-             &registers[REGISTER_BYTE (FP0_REGNUM)], 32 * SPARC_FPREG_SIZE);
+                         PTRACE_GETFPREGS);
+      bcopy (&sparc_fpreg_packet[SPARC_R_FP0],
+            &registers[REGISTER_BYTE (FP0_REGNUM)], 32 * SPARC_FPREG_SIZE);
       bcopy (&sparc_fpreg_packet[SPARC_R_FSR],
             &registers[REGISTER_BYTE (FPS_REGNUM)], 1 * SPARC_FPREG_SIZE);
     }
   else
-    { 
+    {
       bzero (&registers[REGISTER_BYTE (FP0_REGNUM)], 32 * SPARC_FPREG_SIZE);
       bzero (&registers[REGISTER_BYTE (FPS_REGNUM)], 1 * SPARC_FPREG_SIZE);
     }
@@ -155,7 +156,7 @@ vx_write_register (regno)
   if (regno >= 0)
     {
       if ((G0_REGNUM <= regno && regno <= I7_REGNUM)
-          || (Y_REGNUM <= regno && regno <= NPC_REGNUM))
+         || (Y_REGNUM <= regno && regno <= NPC_REGNUM))
        in_fp_regs = 0;
       else
        in_gp_regs = 0;
@@ -173,9 +174,9 @@ vx_write_register (regno)
          registers, update the register window spill area.  */
 
       if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM))
-        {
-         sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)], 
-               REGISTER_RAW_SIZE (CORE_ADDR));
+       {
+         sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
+                               REGISTER_RAW_SIZE (CORE_ADDR));
          write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
                        16 * REGISTER_RAW_SIZE (L0_REGNUM));
        }
@@ -185,12 +186,12 @@ vx_write_register (regno)
 
   if (in_fp_regs && target_has_fp)
     {
-      bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], 
+      bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
             &sparc_fpreg_packet[SPARC_R_FP0], 32 * SPARC_FPREG_SIZE);
-      bcopy (&registers[REGISTER_BYTE (FPS_REGNUM)], 
+      bcopy (&registers[REGISTER_BYTE (FPS_REGNUM)],
             &sparc_fpreg_packet[SPARC_R_FSR], 1 * SPARC_FPREG_SIZE);
 
       net_write_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
-                           PTRACE_SETFPREGS);
+                          PTRACE_SETFPREGS);
     }
 }
index fd9e90269ffb0d16dfdfdd53bccccaa0c52579c7..c431670b66b3ec401fa7e41ed4a0ed96e15dc997 100644 (file)
@@ -2,22 +2,22 @@
    Copyright 1988, 91, 92, 93, 94, 95, 96, 97, 98, 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.  */
-
+   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.  */
 /* *INDENT-OFF* */
 /* Remote communication protocol.
 
@@ -198,6 +198,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
        "0* " means the same as "0000".  */
 /* *INDENT-ON* */
 
+
+
+
 #include "defs.h"
 #include "gdb_string.h"
 #include <ctype.h>
@@ -208,7 +211,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "symfile.h"
 #include "target.h"
 #include "wait.h"
-/*#include "terminal.h"*/
+/*#include "terminal.h" */
 #include "gdbcmd.h"
 #include "objfiles.h"
 #include "gdb-stabs.h"
@@ -244,9 +247,9 @@ static int remote_write_bytes PARAMS ((CORE_ADDR memaddr,
 static int remote_read_bytes PARAMS ((CORE_ADDR memaddr,
                                      char *myaddr, int len));
 
-static void remote_files_info PARAMS ((struct target_ops *ignore));
+static void remote_files_info PARAMS ((struct target_ops * ignore));
 
-static int remote_xfer_memory PARAMS ((CORE_ADDR memaddr, char * myaddr,
+static int remote_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
                                       int len, int should_write,
                                       struct target_ops * target));
 
@@ -257,7 +260,7 @@ static void remote_fetch_registers PARAMS ((int regno));
 static void remote_resume PARAMS ((int pid, int step,
                                   enum target_signal siggnal));
 static void remote_async_resume PARAMS ((int pid, int step,
-                                  enum target_signal siggnal));
+                                        enum target_signal siggnal));
 
 static int remote_start_remote PARAMS ((PTR));
 
@@ -270,7 +273,7 @@ static void extended_remote_async_open PARAMS ((char *name, int from_tty));
 static void remote_open_1 PARAMS ((char *, int, struct target_ops *,
                                   int extended_p));
 static void remote_async_open_1 PARAMS ((char *, int, struct target_ops *,
-                                  int extended_p));
+                                        int extended_p));
 
 static void remote_close PARAMS ((int quitting));
 
@@ -336,7 +339,7 @@ static int ishex PARAMS ((int ch, int *val));
 
 static int stubhex PARAMS ((int ch));
 
-static int remote_query PARAMS ((int/*char*/, char *, char *, int *));
+static int remote_query PARAMS ((int /*char */ , char *, char *, int *));
 
 static int hexnumstr PARAMS ((char *, ULONGEST));
 
@@ -422,7 +425,7 @@ static int cisco_kernel_mode = 0;
    in cases when the packet is supported in the stub, but the connection
    does not allow it (i.e., 7-bit serial connection only). */
 static int remote_binary_download = 1;
+
 /* Have we already checked whether binary downloads work? */
 static int remote_binary_checked;
 
@@ -481,9 +484,9 @@ PTR sigint_remote_token;
 
 void (*target_resume_hook) PARAMS ((void));
 void (*target_wait_loop_hook) PARAMS ((void));
-
 \f
 
+
 /* These are the threads which we last sent to the remote system.
    -1 for all or -2 for not sent yet.  */
 static int general_thread;
@@ -537,7 +540,7 @@ set_thread (th, gen)
   putpkt (buf);
   getpkt (buf, 0);
   if (gen)
-    general_thread  = th;
+    general_thread = th;
   else
     continue_thread = th;
 }
@@ -575,33 +578,33 @@ typedef unsigned char threadref[OPAQUETHREADBYTES];
 
 /* Right now, the internal structure is int. We want it to be bigger.
    Plan to fix this.
  */
+ */
 
-typedef int gdb_threadref; /* internal GDB thread reference */
+typedef int gdb_threadref;     /* internal GDB thread reference */
 
 /*  gdb_ext_thread_info is an internal GDB data structure which is
    equivalint to the reply of the remote threadinfo packet */
 
 struct gdb_ext_thread_info
-{
-  threadref threadid;    /* External form of thread reference */
-  int active;            /* Has state interesting to GDB? , regs, stack */
-  char display[256];     /* Brief state display, name, blocked/syspended */
-  char shortname[32];    /* To be used to name threads */
-  char more_display[256]; /* Long info, statistics, queue depth, whatever */
-};
+  {
+    threadref threadid;                /* External form of thread reference */
+    int active;                        /* Has state interesting to GDB? , regs, stack */
+    char display[256];         /* Brief state display, name, blocked/syspended */
+    char shortname[32];                /* To be used to name threads */
+    char more_display[256];    /* Long info, statistics, queue depth, whatever */
+  };
 
 /* The volume of remote transfers can be limited by submitting
    a mask containing bits specifying the desired information.
    Use a union of these values as the 'selection' parameter to
    get_thread_info. FIXME: Make these TAG names more thread specific.
  */
+ */
 
 #define TAG_THREADID 1
 #define TAG_EXISTS 2
 #define TAG_DISPLAY 4
 #define TAG_THREADNAME 8
-#define TAG_MOREDISPLAY 16 
+#define TAG_MOREDISPLAY 16
 
 #define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES*2)
 
@@ -611,7 +614,7 @@ static char *unpack_nibble PARAMS ((char *buf, int *val));
 
 static char *pack_nibble PARAMS ((char *buf, int nibble));
 
-static char *pack_hex_byte PARAMS ((char *pkt, int/*unsigned char*/ byte));
+static char *pack_hex_byte PARAMS ((char *pkt, int /*unsigned char */ byte));
 
 static char *unpack_byte PARAMS ((char *buf, int *value));
 
@@ -621,57 +624,57 @@ static char *unpack_int PARAMS ((char *buf, int *value));
 
 static char *unpack_string PARAMS ((char *src, char *dest, int length));
 
-static char *pack_threadid PARAMS ((char *pkt, threadref *id));
+static char *pack_threadid PARAMS ((char *pkt, threadref * id));
 
-static char *unpack_threadid PARAMS ((char *inbuf, threadref *id));
+static char *unpack_threadid PARAMS ((char *inbuf, threadref * id));
 
-void int_to_threadref PARAMS ((threadref *id, int value));
+void int_to_threadref PARAMS ((threadref * id, int value));
 
-static int threadref_to_int PARAMS ((threadref *ref));
+static int threadref_to_int PARAMS ((threadref * ref));
 
-static void copy_threadref PARAMS ((threadref *dest, threadref *src));
+static void copy_threadref PARAMS ((threadref * dest, threadref * src));
 
-static int threadmatch PARAMS ((threadref *dest, threadref *src));
+static int threadmatch PARAMS ((threadref * dest, threadref * src));
 
 static char *pack_threadinfo_request PARAMS ((char *pkt, int mode,
-                                             threadref *id));
+                                             threadref * id));
 
 static int remote_unpack_thread_info_response PARAMS ((char *pkt,
-                                                      threadref *expectedref,
-                                                      struct gdb_ext_thread_info *info));
+                                                   threadref * expectedref,
+                                       struct gdb_ext_thread_info * info));
 
 
-static int remote_get_threadinfo PARAMS ((threadref *threadid,
-                                         int fieldset, /*TAG mask */
-                                         struct gdb_ext_thread_info *info));
+static int remote_get_threadinfo PARAMS ((threadref * threadid,
+                                         int fieldset,         /*TAG mask */
+                                       struct gdb_ext_thread_info * info));
 
-static int adapt_remote_get_threadinfo PARAMS ((gdb_threadref *ref,
+static int adapt_remote_get_threadinfo PARAMS ((gdb_threadref * ref,
                                                int selection,
-                                               struct gdb_ext_thread_info *info));
+                                       struct gdb_ext_thread_info * info));
 
 static char *pack_threadlist_request PARAMS ((char *pkt, int startflag,
                                              int threadcount,
-                                             threadref *nextthread));
+                                             threadref * nextthread));
 
 static int parse_threadlist_response PARAMS ((char *pkt,
                                              int result_limit,
-                                             threadref *original_echo,
-                                             threadref *resultlist,
+                                             threadref * original_echo,
+                                             threadref * resultlist,
                                              int *doneflag));
 
 static int remote_get_threadlist PARAMS ((int startflag,
-                                         threadref *nextthread,
+                                         threadref * nextthread,
                                          int result_limit,
                                          int *done,
                                          int *result_count,
-                                         threadref *threadlist));
+                                         threadref * threadlist));
 
-typedef int (*rmt_thread_action) (threadref *ref, void *context);
+typedef int (*rmt_thread_action) (threadref * ref, void *context);
 
 static int remote_threadlist_iterator PARAMS ((rmt_thread_action stepfunction,
-                                              void *context, int looplimit));
+                                            void *context, int looplimit));
 
-static int remote_newthread_step PARAMS ((threadref *ref, void *context));
+static int remote_newthread_step PARAMS ((threadref * ref, void *context));
 
 /* encode 64 bits in 16 chars of hex */
 
@@ -808,7 +811,7 @@ unpack_int (buf, value)
   return buf + 8;
 }
 
-#if 0 /* currently unused, uncomment when needed */
+#if 0                          /* currently unused, uncomment when needed */
 static char *pack_string PARAMS ((char *pkt, char *string));
 
 static char *
@@ -957,12 +960,12 @@ threadmatch (dest, src)
 }
 
 /*
-  threadid:1,        # always request threadid
-  context_exists:2,
-  display:4,
-  unique_name:8,
-  more_display:16
-*/
+   threadid:1,        # always request threadid
+   context_exists:2,
+   display:4,
+   unique_name:8,
+   more_display:16
+ */
 
 /* Encoding:  'Q':8,'P':8,mask:32,threadid:64 */
 
@@ -984,13 +987,13 @@ pack_threadinfo_request (pkt, mode, id)
 /* Tagging the fields allows us to request specific fields and to
    add more fields as time goes by */
 
-#define TAG_THREADID 1      /* Echo the thread identifier */
-#define TAG_EXISTS 2        /* Is this process defined enough to
-                              fetch registers and its stack */
-#define TAG_DISPLAY 4       /* A short thing maybe to put on a window */
-#define TAG_THREADNAME 8    /* string, maps 1-to-1 with a thread is */
-#define TAG_MOREDISPLAY 16  /* Whatever the kernel wants to say about 
-                              the process*/
+#define TAG_THREADID 1         /* Echo the thread identifier */
+#define TAG_EXISTS 2           /* Is this process defined enough to
+                                  fetch registers and its stack */
+#define TAG_DISPLAY 4          /* A short thing maybe to put on a window */
+#define TAG_THREADNAME 8       /* string, maps 1-to-1 with a thread is */
+#define TAG_MOREDISPLAY 16     /* Whatever the kernel wants to say about 
+                                  the process */
 
 static int
 remote_unpack_thread_info_response (pkt, expectedref, info)
@@ -1001,7 +1004,7 @@ remote_unpack_thread_info_response (pkt, expectedref, info)
   int mask, length;
   unsigned int tag;
   threadref ref;
-  char *limit = pkt + PBUFSIZ;  /* plausable parsing limit */
+  char *limit = pkt + PBUFSIZ; /* plausable parsing limit */
   int retval = 1;
 
   /* info->threadid = 0; FIXME: implement zero_threadref */
@@ -1025,7 +1028,7 @@ remote_unpack_thread_info_response (pkt, expectedref, info)
 
   /* Loop on tagged fields , try to bail if somthing goes wrong */
 
-  while ((pkt < limit) && mask && *pkt)        /* packets are terminated with nulls */
+  while ((pkt < limit) && mask && *pkt)                /* packets are terminated with nulls */
     {
       pkt = unpack_int (pkt, &tag);    /* tag */
       pkt = unpack_byte (pkt, &length);                /* length */
@@ -1150,7 +1153,7 @@ parse_threadlist_response (pkt, result_limit, original_echo, resultlist,
 
   resultcount = 0;
   /* Assume the 'q' and 'M chars have been stripped.  */
-  limit = pkt + (PBUFSIZ - BUF_THREAD_ID_SIZE);        /* done parse past here */
+  limit = pkt + (PBUFSIZ - BUF_THREAD_ID_SIZE);                /* done parse past here */
   pkt = unpack_byte (pkt, &count);     /* count field */
   pkt = unpack_nibble (pkt, &done);
   /* The first threadid is the argument threadid.  */
@@ -1314,8 +1317,8 @@ remote_current_thread (oldpid)
 static void
 remote_find_new_threads ()
 {
-  remote_threadlist_iterator (remote_newthread_step, 0, 
-                                   CRAZY_MAX_THREADS);
+  remote_threadlist_iterator (remote_newthread_step, 0,
+                             CRAZY_MAX_THREADS);
   if (inferior_pid == MAGIC_NULL_PID)  /* ack ack ack */
     inferior_pid = remote_current_thread (inferior_pid);
 }
@@ -1338,19 +1341,21 @@ remote_threads_info (void)
       return;
     }
   else                         /* try new 'q' method */
-    while (*bufp++ == 'm')             /* reply contains one or more TID */
+    while (*bufp++ == 'm')     /* reply contains one or more TID */
       {
-       do {
-         tid = strtol(bufp, &bufp, 16);
-         if (tid != 0 && !in_thread_list (tid))
-           add_thread (tid);
-       } while (*bufp++ == ',');               /* comma-separated list */
+       do
+         {
+           tid = strtol (bufp, &bufp, 16);
+           if (tid != 0 && !in_thread_list (tid))
+             add_thread (tid);
+         }
+       while (*bufp++ == ','); /* comma-separated list */
        putpkt ("qsThreadInfo");
        getpkt (bufp = buf, 0);
       }
 }
-
 \f
+
 /*  Restart the remote side; this is an extended protocol operation.  */
 
 static void
@@ -1449,8 +1454,8 @@ get_offsets ()
     return;
 
   offs = alloca (sizeof (struct section_offsets)
-                                           + symfile_objfile->num_sections
-                                           * sizeof (offs->offsets));
+                + symfile_objfile->num_sections
+                * sizeof (offs->offsets));
   memcpy (offs, symfile_objfile->section_offsets,
          sizeof (struct section_offsets)
          + symfile_objfile->num_sections
@@ -1483,66 +1488,66 @@ get_offsets ()
  * Returns:  zero for success, non-zero for failure 
  */
 
-static int 
-remote_cisco_section_offsets (text_addr, data_addr, bss_addr, 
+static int
+remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
                              text_offs, data_offs, bss_offs)
      bfd_vma text_addr;
      bfd_vma data_addr;
      bfd_vma bss_addr;
-     bfd_signed_vma * text_offs;
-     bfd_signed_vma * data_offs;
-     bfd_signed_vma * bss_offs;
+     bfd_signed_vma *text_offs;
+     bfd_signed_vma *data_offs;
+     bfd_signed_vma *bss_offs;
 {
   bfd_vma text_base, data_base, bss_base;
   struct minimal_symbol *start;
   asection *sect;
-  bfd * abfd;
+  bfd *abfd;
   int len;
   char *p;
 
   if (symfile_objfile == NULL)
-    return -1;         /* no can do nothin' */
+    return -1;                 /* no can do nothin' */
 
   start = lookup_minimal_symbol ("_start", NULL, NULL);
   if (start == NULL)
-    return -1;         /* Can't find "_start" symbol */
+    return -1;                 /* Can't find "_start" symbol */
 
   data_base = bss_base = 0;
   text_base = SYMBOL_VALUE_ADDRESS (start);
 
   abfd = symfile_objfile->obfd;
-    for (sect = abfd->sections; 
+  for (sect = abfd->sections;
        sect != 0;
        sect = sect->next)
     {
-      p   = (unsigned char *) bfd_get_section_name (abfd, sect);
+      p = (unsigned char *) bfd_get_section_name (abfd, sect);
       len = strlen (p);
       if (strcmp (p + len - 4, "data") == 0)   /* ends in "data" */
        if (data_base == 0 ||
            data_base > bfd_get_section_vma (abfd, sect))
          data_base = bfd_get_section_vma (abfd, sect);
       if (strcmp (p + len - 3, "bss") == 0)    /* ends in "bss" */
-       if (bss_base == 0 || 
+       if (bss_base == 0 ||
            bss_base > bfd_get_section_vma (abfd, sect))
          bss_base = bfd_get_section_vma (abfd, sect);
     }
   *text_offs = text_addr - text_base;
   *data_offs = data_addr - data_base;
-  *bss_offs  = bss_addr  - bss_base;
+  *bss_offs = bss_addr - bss_base;
   if (remote_debug)
     {
       char tmp[128];
 
       sprintf (tmp, "VMA:          text = 0x");
       sprintf_vma (tmp + strlen (tmp), text_addr);
-      sprintf     (tmp + strlen (tmp), " data = 0x");
+      sprintf (tmp + strlen (tmp), " data = 0x");
       sprintf_vma (tmp + strlen (tmp), data_addr);
-      sprintf     (tmp + strlen (tmp), " bss = 0x");
+      sprintf (tmp + strlen (tmp), " bss = 0x");
       sprintf_vma (tmp + strlen (tmp), bss_addr);
       fprintf_filtered (gdb_stdlog, tmp);
       fprintf_filtered (gdb_stdlog,
                        "Reloc offset: text = 0x%x data = 0x%x bss = 0x%x\n",
-                      (long) *text_offs, (long) *data_offs, (long) *bss_offs);
+                   (long) *text_offs, (long) *data_offs, (long) *bss_offs);
     }
 
   return 0;
@@ -1562,11 +1567,11 @@ remote_cisco_objfile_relocate (text_off, data_off, bss_off)
 {
   struct section_offsets *offs;
 
-  if (text_off != 0 || data_off != 0 || bss_off  != 0)
+  if (text_off != 0 || data_off != 0 || bss_off != 0)
     {
       /* FIXME: This code assumes gdb-stabs.h is being used; it's
-        broken for xcoff, dwarf, sdb-coff, etc.  But there is no
-        simple canonical representation for this stuff.  */
+         broken for xcoff, dwarf, sdb-coff, etc.  But there is no
+         simple canonical representation for this stuff.  */
 
       offs = ((struct section_offsets *)
              alloca (sizeof (struct section_offsets)
@@ -1580,14 +1585,14 @@ remote_cisco_objfile_relocate (text_off, data_off, bss_off)
 
       ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
       ANOFFSET (offs, SECT_OFF_DATA) = data_off;
-      ANOFFSET (offs, SECT_OFF_BSS)  = bss_off;
+      ANOFFSET (offs, SECT_OFF_BSS) = bss_off;
 
       /* First call the standard objfile_relocate.  */
       objfile_relocate (symfile_objfile, offs);
 
       /* Now we need to fix up the section entries already attached to
-        the exec target.  These entries will control memory transfers
-        from the exec file.  */
+         the exec target.  These entries will control memory transfers
+         from the exec file.  */
 
       exec_set_section_offsets (text_off, data_off, bss_off);
     }
@@ -1653,7 +1658,7 @@ extended_remote_open (name, from_tty)
      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 */ );
 }
 
 /* Just like extended_remote_open, but with asynchronous support. */
@@ -1662,7 +1667,7 @@ extended_remote_async_open (name, from_tty)
      char *name;
      int from_tty;
 {
-  remote_async_open_1 (name, from_tty, &extended_async_remote_ops, 1/*extended_p*/);
+  remote_async_open_1 (name, from_tty, &extended_async_remote_ops, 1 /*extended_p */ );
 }
 
 /* Generic code for opening a connection to a remote target.  */
@@ -1711,7 +1716,7 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
       puts_filtered (name);
       puts_filtered ("\n");
     }
-  push_target (target);        /* Switch to using remote target now */
+  push_target (target);                /* Switch to using remote target now */
 
   /* Start out by trying the 'P' request to set registers.  We set
      this each time that we open a new target so that if the user
@@ -1719,7 +1724,7 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
      closed and reopened) cope.  */
   stub_supports_P = 1;
 
-  general_thread  = -2;
+  general_thread = -2;
   continue_thread = -2;
 
   /* Force remote_write_bytes to check whether target supports
@@ -1737,8 +1742,8 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it
      (we'd be in an inconsistent state otherwise).  */
-  if (!catch_errors (remote_start_remote, NULL, 
-                    "Couldn't establish connection to remote target\n", 
+  if (!catch_errors (remote_start_remote, NULL,
+                    "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     {
       pop_target ();
@@ -1805,7 +1810,7 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
   if (async_p)
     add_file_handler (remote_desc->fd, (file_handler_func *) fetch_inferior_event, 0);
 
-  push_target (target);        /* Switch to using remote target now */
+  push_target (target);                /* Switch to using remote target now */
 
   /* Start out by trying the 'P' request to set registers.  We set
      this each time that we open a new target so that if the user
@@ -1813,7 +1818,7 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
      closed and reopened) cope.  */
   stub_supports_P = 1;
 
-  general_thread  = -2;
+  general_thread = -2;
   continue_thread = -2;
 
   /* Force remote_write_bytes to check whether target supports
@@ -1837,8 +1842,8 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
   /* Start the remote connection; if error (0), discard this target.
      In particular, if the user quits, be sure to discard it
      (we'd be in an inconsistent state otherwise).  */
-  if (!catch_errors (remote_start_remote, NULL, 
-                    "Couldn't establish connection to remote target\n", 
+  if (!catch_errors (remote_start_remote, NULL,
+                    "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     {
       /* Unregister the file descriptor from the event loop. */
@@ -1850,21 +1855,21 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
 
   if (!async_p)
     {
-    if (extended_p)
-      {
-       /* tell the remote that we're using the extended protocol.  */
-       char *buf = alloca (PBUFSIZ);
-       putpkt ("!");
-       getpkt (buf, 0);
-      }
+      if (extended_p)
+       {
+         /* tell the remote that we're using the extended protocol.  */
+         char *buf = alloca (PBUFSIZ);
+         putpkt ("!");
+         getpkt (buf, 0);
+       }
     }
 }
 
 /* This will be called by fetch_inferior_event, via the
    cmd_continuation pointer, only after the target has stopped. */
-static void 
+static void
 set_extended_protocol (arg)
-     struct continuation_arg * arg;
+     struct continuation_arg *arg;
 {
   /* tell the remote that we're using the extended protocol.  */
   char *buf = alloca (PBUFSIZ);
@@ -1932,7 +1937,7 @@ fromhex (a)
     return a - 'a' + 10;
   else if (a >= 'A' && a <= 'F')
     return a - 'A' + 10;
-  else 
+  else
     error ("Reply contains invalid hex digit %d", a);
 }
 
@@ -1943,9 +1948,9 @@ tohex (nib)
      int nib;
 {
   if (nib < 10)
-    return '0'+nib;
+    return '0' + nib;
   else
-    return 'a'+nib-10;
+    return 'a' + nib - 10;
 }
 \f
 /* Tell the remote machine to resume.  */
@@ -1979,12 +1984,12 @@ remote_resume (pid, step, siggnal)
   if (siggnal != TARGET_SIGNAL_0)
     {
       buf[0] = step ? 'S' : 'C';
-      buf[1] = tohex (((int)siggnal >> 4) & 0xf);
-      buf[2] = tohex ((int)siggnal & 0xf);
+      buf[1] = tohex (((int) siggnal >> 4) & 0xf);
+      buf[2] = tohex ((int) siggnal & 0xf);
       buf[3] = '\0';
     }
   else
-    strcpy (buf, step ? "s": "c");
+    strcpy (buf, step ? "s" : "c");
 
   putpkt (buf);
 }
@@ -2035,12 +2040,12 @@ remote_async_resume (pid, step, siggnal)
   if (siggnal != TARGET_SIGNAL_0)
     {
       buf[0] = step ? 'S' : 'C';
-      buf[1] = tohex (((int)siggnal >> 4) & 0xf);
-      buf[2] = tohex ((int)siggnal & 0xf);
+      buf[1] = tohex (((int) siggnal >> 4) & 0xf);
+      buf[2] = tohex ((int) siggnal & 0xf);
       buf[3] = '\0';
     }
   else
-    strcpy (buf, step ? "s": "c");
+    strcpy (buf, step ? "s" : "c");
 
   putpkt (buf);
 }
@@ -2051,7 +2056,7 @@ remote_async_resume (pid, step, siggnal)
 static void
 initialize_sigint_signal_handler ()
 {
-  sigint_remote_token = 
+  sigint_remote_token =
     create_async_signal_handler (async_remote_interrupt, NULL);
   signal (SIGINT, handle_remote_sigint);
 }
@@ -2062,7 +2067,7 @@ handle_remote_sigint (sig)
      int sig;
 {
   signal (sig, handle_remote_sigint_twice);
-  sigint_remote_twice_token = 
+  sigint_remote_twice_token =
     create_async_signal_handler (async_remote_interrupt_twice, NULL);
   mark_async_signal_handler_wrapper (sigint_remote_token);
 }
@@ -2075,14 +2080,14 @@ handle_remote_sigint_twice (sig)
      int sig;
 {
   signal (sig, handle_sigint);
-  sigint_remote_twice_token = 
+  sigint_remote_twice_token =
     create_async_signal_handler (async_remote_interrupt, NULL);
   mark_async_signal_handler_wrapper (sigint_remote_twice_token);
 }
 
 /* Perform the real interruption of hte target execution, in response
    to a ^C. */
-static void 
+static void
 async_remote_interrupt (arg)
      gdb_client_data arg;
 {
@@ -2094,7 +2099,7 @@ async_remote_interrupt (arg)
 
 /* Perform interrupt, if the first attempt did not succeed. Just give
    up on the target alltogether. */
-static void 
+static void
 async_remote_interrupt_twice (arg)
      gdb_client_data arg;
 {
@@ -2109,9 +2114,9 @@ cleanup_sigint_signal_handler ()
 {
   signal (SIGINT, handle_sigint);
   if (sigint_remote_twice_token)
-    delete_async_signal_handler ((async_signal_handler**) &sigint_remote_twice_token);
+    delete_async_signal_handler ((async_signal_handler **) & sigint_remote_twice_token);
   if (sigint_remote_token)
-    delete_async_signal_handler ((async_signal_handler**) &sigint_remote_token);
+    delete_async_signal_handler ((async_signal_handler **) & sigint_remote_token);
 }
 
 /* Send ^C to target to halt it.  Target will respond, and send us a
@@ -2190,7 +2195,7 @@ remote_console_output (msg)
 {
   char *p;
 
-  for (p = msg; p[0] && p[1]; p +=2) 
+  for (p = msg; p[0] && p[1]; p += 2)
     {
       char tb[2];
       char c = fromhex (p[0]) * 16 + fromhex (p[1]);
@@ -2225,7 +2230,7 @@ remote_wait (pid, status)
       signal (SIGINT, ofunc);
 
       /* This is a hook for when we need to do something (perhaps the
-        collection of trace data) every time the target stops.  */
+         collection of trace data) every time the target stops.  */
       if (target_wait_loop_hook)
        (*target_wait_loop_hook) ();
 
@@ -2242,10 +2247,10 @@ remote_wait (pid, status)
 
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
-               ss = signal number
-               n... = register number
-               r... = register contents
-               */
+              ss = signal number
+              n... = register number
+              r... = register contents
+            */
            p = &buf[3];        /* after Txx */
 
            while (*p)
@@ -2255,9 +2260,9 @@ remote_wait (pid, status)
 
                /* Read the register number */
                regno = strtol ((const char *) p, &p_temp, 16);
-               p1 = (unsigned char *)p_temp;
+               p1 = (unsigned char *) p_temp;
 
-               if (p1 == p) /* No register number present here */
+               if (p1 == p)    /* No register number present here */
                  {
                    p1 = (unsigned char *) strchr ((const char *) p, ':');
                    if (p1 == NULL)
@@ -2298,7 +2303,7 @@ Packet: '%s'\n",
                if (*p++ != ';')
                  {
                    warning ("Remote register badly formatted: %s", buf);
-                   warning ("            here: %s",p);
+                   warning ("            here: %s", p);
                  }
              }
          }
@@ -2311,10 +2316,10 @@ Packet: '%s'\n",
          if (buf[3] == 'p')
            {
              /* Export Cisco kernel mode as a convenience variable
-                (so that it can be used in the GDB prompt if desired). */
+                (so that it can be used in the GDB prompt if desired). */
 
              if (cisco_kernel_mode == 1)
-               set_internalvar (lookup_internalvar ("cisco_kernel_mode"), 
+               set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
                                 value_from_string ("PDEBUG-"));
              cisco_kernel_mode = 0;
              thread_num = strtol ((const char *) &buf[4], NULL, 16);
@@ -2323,10 +2328,10 @@ Packet: '%s'\n",
          else if (buf[3] == 'k')
            {
              /* Export Cisco kernel mode as a convenience variable
-                (so that it can be used in the GDB prompt if desired). */
+                (so that it can be used in the GDB prompt if desired). */
 
              if (cisco_kernel_mode == 1)
-               set_internalvar (lookup_internalvar ("cisco_kernel_mode"), 
+               set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
                                 value_from_string ("KDEBUG-"));
              cisco_kernel_mode = 1;
            }
@@ -2341,7 +2346,7 @@ Packet: '%s'\n",
            status->value.sig = (enum target_signal)
              (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
 
-           if (symfile_objfile == NULL) 
+           if (symfile_objfile == NULL)
              {
                warning ("Relocation packet recieved with no symbol file.  \
 Packet Dropped");
@@ -2363,13 +2368,13 @@ Packet Dropped");
              warning ("Malformed relocation packet: Packet '%s'", buf);
            p = p1 + 1;
            bss_addr = strtoul (p, (char **) &p1, 16);
-           if (p1 == p) 
+           if (p1 == p)
              warning ("Malformed relocation packet: Packet '%s'", buf);
 
            if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
                                              &text_off, &data_off, &bss_off)
                == 0)
-             if (text_off != 0 || data_off != 0 || bss_off  != 0) 
+             if (text_off != 0 || data_off != 0 || bss_off != 0)
                remote_cisco_objfile_relocate (text_off, data_off, bss_off);
 
            goto got_status;
@@ -2395,7 +2400,7 @@ Packet Dropped");
          if (last_sent_signal != TARGET_SIGNAL_0)
            {
              /* Zero length reply means that we tried 'S' or 'C' and
-                the remote system doesn't support it.  */
+                the remote system doesn't support it.  */
              target_terminal_ours_for_output ();
              printf_filtered
                ("Can't send signals to this remote system.  %s not sent.\n",
@@ -2413,7 +2418,7 @@ Packet Dropped");
          continue;
        }
     }
- got_status:
+got_status:
   if (thread_num != -1)
     {
       return thread_num;
@@ -2436,7 +2441,7 @@ remote_async_wait (pid, status)
   while (1)
     {
       unsigned char *p;
-      
+
       if (!async_p)
        ofunc = signal (SIGINT, remote_interrupt);
       getpkt ((char *) buf, 1);
@@ -2444,7 +2449,7 @@ remote_async_wait (pid, status)
        signal (SIGINT, ofunc);
 
       /* This is a hook for when we need to do something (perhaps the
-        collection of trace data) every time the target stops.  */
+         collection of trace data) every time the target stops.  */
       if (target_wait_loop_hook)
        (*target_wait_loop_hook) ();
 
@@ -2461,10 +2466,10 @@ remote_async_wait (pid, status)
 
            /* Expedited reply, containing Signal, {regno, reg} repeat */
            /*  format is:  'Tssn...:r...;n...:r...;n...:r...;#cc', where
-               ss = signal number
-               n... = register number
-               r... = register contents
-               */
+              ss = signal number
+              n... = register number
+              r... = register contents
+            */
            p = &buf[3];        /* after Txx */
 
            while (*p)
@@ -2474,9 +2479,9 @@ remote_async_wait (pid, status)
 
                /* Read the register number */
                regno = strtol ((const char *) p, &p_temp, 16);
-               p1 = (unsigned char *)p_temp;
+               p1 = (unsigned char *) p_temp;
 
-               if (p1 == p) /* No register number present here */
+               if (p1 == p)    /* No register number present here */
                  {
                    p1 = (unsigned char *) strchr ((const char *) p, ':');
                    if (p1 == NULL)
@@ -2517,7 +2522,7 @@ Packet: '%s'\n",
                if (*p++ != ';')
                  {
                    warning ("Remote register badly formatted: %s", buf);
-                   warning ("            here: %s",p);
+                   warning ("            here: %s", p);
                  }
              }
          }
@@ -2530,10 +2535,10 @@ Packet: '%s'\n",
          if (buf[3] == 'p')
            {
              /* Export Cisco kernel mode as a convenience variable
-                (so that it can be used in the GDB prompt if desired). */
+                (so that it can be used in the GDB prompt if desired). */
 
              if (cisco_kernel_mode == 1)
-               set_internalvar (lookup_internalvar ("cisco_kernel_mode"), 
+               set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
                                 value_from_string ("PDEBUG-"));
              cisco_kernel_mode = 0;
              thread_num = strtol ((const char *) &buf[4], NULL, 16);
@@ -2542,10 +2547,10 @@ Packet: '%s'\n",
          else if (buf[3] == 'k')
            {
              /* Export Cisco kernel mode as a convenience variable
-                (so that it can be used in the GDB prompt if desired). */
+                (so that it can be used in the GDB prompt if desired). */
 
              if (cisco_kernel_mode == 1)
-               set_internalvar (lookup_internalvar ("cisco_kernel_mode"), 
+               set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
                                 value_from_string ("KDEBUG-"));
              cisco_kernel_mode = 1;
            }
@@ -2560,7 +2565,7 @@ Packet: '%s'\n",
            status->value.sig = (enum target_signal)
              (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
 
-           if (symfile_objfile == NULL) 
+           if (symfile_objfile == NULL)
              {
                warning ("Relocation packet recieved with no symbol file.  \
 Packet Dropped");
@@ -2582,13 +2587,13 @@ Packet Dropped");
              warning ("Malformed relocation packet: Packet '%s'", buf);
            p = p1 + 1;
            bss_addr = strtoul (p, (char **) &p1, 16);
-           if (p1 == p) 
+           if (p1 == p)
              warning ("Malformed relocation packet: Packet '%s'", buf);
 
            if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
                                              &text_off, &data_off, &bss_off)
                == 0)
-             if (text_off != 0 || data_off != 0 || bss_off  != 0) 
+             if (text_off != 0 || data_off != 0 || bss_off != 0)
                remote_cisco_objfile_relocate (text_off, data_off, bss_off);
 
            goto got_status;
@@ -2614,7 +2619,7 @@ Packet Dropped");
          if (last_sent_signal != TARGET_SIGNAL_0)
            {
              /* Zero length reply means that we tried 'S' or 'C' and
-                the remote system doesn't support it.  */
+                the remote system doesn't support it.  */
              target_terminal_ours_for_output ();
              printf_filtered
                ("Can't send signals to this remote system.  %s not sent.\n",
@@ -2632,7 +2637,7 @@ Packet Dropped");
          continue;
        }
     }
- got_status:
+got_status:
   if (thread_num != -1)
     {
       return thread_num;
@@ -2698,7 +2703,7 @@ remote_fetch_registers (regno)
          goto supply_them;
        }
       if (p[0] == 'x' && p[1] == 'x')
-       regs[i] = 0;    /* 'x' */
+       regs[i] = 0;            /* 'x' */
       else
        regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
       p += 2;
@@ -2712,25 +2717,25 @@ remote_fetch_registers (regno)
        warning ("Remote reply is too short: %s", buf);
 #endif
     }
-  
-  supply_them:
+
+supply_them:
   for (i = 0; i < NUM_REGS; i++)
-  {
-    supply_register (i, &regs[REGISTER_BYTE(i)]);
-    if (buf[REGISTER_BYTE(i) * 2] == 'x')
-      register_valid[i] = -1;  /* register value not available */
-  }
+    {
+      supply_register (i, &regs[REGISTER_BYTE (i)]);
+      if (buf[REGISTER_BYTE (i) * 2] == 'x')
+       register_valid[i] = -1; /* register value not available */
+    }
 }
 
 /* Prepare to store registers.  Since we may send them all (using a
    'G' request), we have to read out the ones we don't want to change
    first.  */
 
-static void 
+static void
 remote_prepare_to_store ()
 {
   /* Make sure the entire registers array is valid.  */
-  read_register_bytes (0, (char *)NULL, REGISTER_BYTES);
+  read_register_bytes (0, (char *) NULL, REGISTER_BYTES);
 }
 
 /* Store register REGNO, or all registers if REGNO == -1, from the contents
@@ -2768,8 +2773,8 @@ remote_store_registers (regno)
        }
 
       /* The stub does not support the 'P' request.  Use 'G' instead,
-        and don't try using 'P' in the future (it will just waste our
-        time).  */
+         and don't try using 'P' in the future (it will just waste our
+         time).  */
       stub_supports_P = 0;
     }
 
@@ -2804,7 +2809,7 @@ remote_store_registers (regno)
 /* Read a word from remote address ADDR and return it.
    This goes through the data cache.  */
 
-#if 0  /* unused? */
+#if 0                          /* unused? */
 static int
 remote_fetch_word (addr)
      CORE_ADDR addr;
@@ -2822,10 +2827,10 @@ remote_store_word (addr, word)
 {
   dcache_poke (remote_dcache, addr, word);
 }
-#endif /* 0 (unused?) */
-
+#endif /* 0 (unused?) */
 \f
 
+
 /* Return the number of hex digits in num.  */
 
 static int
@@ -2854,7 +2859,7 @@ hexnumstr (buf, num)
 
   for (i = len - 1; i >= 0; i--)
     {
-      buf[i] = "0123456789abcdef" [(num & 0xf)];
+      buf[i] = "0123456789abcdef"[(num & 0xf)];
       num >>= 4;
     }
 
@@ -2972,7 +2977,7 @@ remote_write_bytes (memaddr, myaddr, len)
       else
        {
          *p++ = 'M';
-         todo = min (len, max_buf_size / 2); /* num bytes that will fit */
+         todo = min (len, max_buf_size / 2);   /* num bytes that will fit */
        }
 
       p += hexnumstr (p, (ULONGEST) memaddr);
@@ -2984,43 +2989,43 @@ remote_write_bytes (memaddr, myaddr, len)
       *p = '\0';
 
       /* We send target system values byte by byte, in increasing byte
-        addresses, each byte encoded as two hex characters (or one
-        binary character).  */
+         addresses, each byte encoded as two hex characters (or one
+         binary character).  */
       if (remote_binary_download)
        {
          int escaped = 0;
-          for (i = 0;
+         for (i = 0;
               (i < todo) && (i + escaped) < (max_buf_size - 2);
               i++)
-            {
-              switch (myaddr[i] & 0xff)
-                {
-                case '$':
-                case '#':
-                case 0x7d:
-                  /* These must be escaped */
-                  escaped++;
-                  *p++ = 0x7d;
-                  *p++ = (myaddr[i] & 0xff) ^ 0x20;
-                  break;
-                default:
-                  *p++ = myaddr[i] & 0xff;
-                  break;
-                }
-            }
-
-          if (i < todo)
-            {
-              /* Escape chars have filled up the buffer prematurely, 
-                 and we have actually sent fewer bytes than planned.
-                 Fix-up the length field of the packet.  */
+           {
+             switch (myaddr[i] & 0xff)
+               {
+               case '$':
+               case '#':
+               case 0x7d:
+                 /* These must be escaped */
+                 escaped++;
+                 *p++ = 0x7d;
+                 *p++ = (myaddr[i] & 0xff) ^ 0x20;
+                 break;
+               default:
+                 *p++ = myaddr[i] & 0xff;
+                 break;
+               }
+           }
+
+         if (i < todo)
+           {
+             /* Escape chars have filled up the buffer prematurely, 
+                and we have actually sent fewer bytes than planned.
+                Fix-up the length field of the packet.  */
 
              /* FIXME: will fail if new len is a shorter string than 
-                old len.  */
+                old len.  */
 
-              plen += hexnumstr (plen, (ULONGEST) i);
-              *plen++ = ':';
-            }
+             plen += hexnumstr (plen, (ULONGEST) i);
+             *plen++ = ':';
+           }
        }
       else
        {
@@ -3046,10 +3051,10 @@ remote_write_bytes (memaddr, myaddr, len)
        }
 
       /* Increment by i, not by todo, in case escape chars 
-        caused us to send fewer bytes than we'd planned.  */
-      myaddr  += i;
+         caused us to send fewer bytes than we'd planned.  */
+      myaddr += i;
       memaddr += i;
-      len     -= i;
+      len -= i;
     }
   return origlen;
 }
@@ -3085,7 +3090,7 @@ remote_read_bytes (memaddr, myaddr, len)
       int todo;
       int i;
 
-      todo = min (len, max_buf_size / 2); /* num bytes that will fit */
+      todo = min (len, max_buf_size / 2);      /* num bytes that will fit */
 
       /* construct "m"<memaddr>","<len>" */
       /* sprintf (buf, "m%lx,%x", (unsigned long) memaddr, todo); */
@@ -3110,8 +3115,8 @@ remote_read_bytes (memaddr, myaddr, len)
          return 0;
        }
 
-  /* Reply describes memory byte by byte,
-     each byte encoded as two hex characters.  */
+      /* Reply describes memory byte by byte,
+         each byte encoded as two hex characters.  */
 
       p = buf;
       for (i = 0; i < todo; i++)
@@ -3147,7 +3152,7 @@ remote_xfer_memory (mem_addr, buffer, mem_len, should_write, target)
      char *buffer;
      int mem_len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   CORE_ADDR targ_addr;
   int targ_len;
@@ -3159,7 +3164,7 @@ remote_xfer_memory (mem_addr, buffer, mem_len, should_write, target)
                             targ_len, should_write);
 }
 
-   
+
 #if 0
 /* Enable after 4.12.  */
 
@@ -3358,7 +3363,7 @@ putpkt_binary (buf, cnt)
        {
          ch = readchar (remote_timeout);
 
-         if (remote_debug)
+         if (remote_debug)
            {
              switch (ch)
                {
@@ -3380,16 +3385,16 @@ putpkt_binary (buf, cnt)
                fprintf_unfiltered (gdb_stdlog, "Ack\n");
              return 1;
            case SERIAL_TIMEOUT:
-             tcount ++;
+             tcount++;
              if (tcount > 3)
                return 0;
              break;            /* Retransmit buffer */
            case '$':
              {
-             /* It's probably an old response, and we're out of sync.
-                Just gobble up the packet and ignore it.  */
+               /* It's probably an old response, and we're out of sync.
+                  Just gobble up the packet and ignore it.  */
                getpkt (junkbuf, 0);
-               continue;               /* Now, go look for + */
+               continue;       /* Now, go look for + */
              }
            default:
              if (remote_debug)
@@ -3408,10 +3413,10 @@ putpkt_binary (buf, cnt)
 
 #if 0
       /* This is wrong.  If doing a long backtrace, the user should be
-        able to get out next time we call QUIT, without anything as
-        violent as interrupt_query.  If we want to provide a way out of
-        here without getting to the next QUIT, it should be based on
-        hitting ^C twice as in remote_wait.  */
+         able to get out next time we call QUIT, without anything as
+         violent as interrupt_query.  If we want to provide a way out of
+         here without getting to the next QUIT, it should be based on
+         hitting ^C twice as in remote_wait.  */
       if (quit_flag)
        {
          quit_flag = 0;
@@ -3423,28 +3428,31 @@ putpkt_binary (buf, cnt)
 
 static int remote_cisco_mode;
 
-static void remote_cisco_expand (src, dest)
+static void
+remote_cisco_expand (src, dest)
      char *src;
      char *dest;
 {
   int i;
   int repeat;
 
-  do {
-    if (*src == '*') 
-      {
-       repeat = (fromhex (src[1]) << 4) + fromhex (src[2]);
-       for (i = 0; i < repeat; i++) 
-         {
-           *dest++ = *(src-1);
-         }
-       src += 2;
-      }
-    else 
-      {
-       *dest++ = *src;
-      }
-  } while (*src++);
+  do
+    {
+      if (*src == '*')
+       {
+         repeat = (fromhex (src[1]) << 4) + fromhex (src[2]);
+         for (i = 0; i < repeat; i++)
+           {
+             *dest++ = *(src - 1);
+           }
+         src += 2;
+       }
+      else
+       {
+         *dest++ = *src;
+       }
+    }
+  while (*src++);
 }
 
 /* Come here after finding the start of the frame.  Collect the rest
@@ -3498,10 +3506,10 @@ read_frame (buf)
                return 1;
              }
 
-           if (remote_debug) 
+           if (remote_debug)
              {
                fprintf_filtered (gdb_stdlog,
-                                 "Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
+                             "Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
                                  pktcsum, csum);
                fputs_filtered (buf, gdb_stdlog);
                fputs_filtered ("\n", gdb_stdlog);
@@ -3563,7 +3571,7 @@ getpkt (buf, forever)
   int timeout;
   int val;
 
-  strcpy (buf,"timeout");
+  strcpy (buf, "timeout");
 
   if (forever)
     {
@@ -3578,12 +3586,12 @@ getpkt (buf, forever)
   for (tries = 1; tries <= MAX_TRIES; tries++)
     {
       /* This can loop forever if the remote side sends us characters
-        continuously, but if it pauses, we'll get a zero from readchar
-        because of timeout.  Then we'll count that as a retry.  */
+         continuously, but if it pauses, we'll get a zero from readchar
+         because of timeout.  Then we'll count that as a retry.  */
 
       /* Note that we will only wait forever prior to the start of a packet.
-        After that, we expect characters to arrive at a brisk pace.  They
-        should show up within remote_timeout intervals.  */
+         After that, we expect characters to arrive at a brisk pace.  They
+         should show up within remote_timeout intervals.  */
 
       do
        {
@@ -3640,7 +3648,7 @@ remote_kill ()
 
   /* Use catch_errors so the user can quit from gdb even when we aren't on
      speaking terms with the remote system.  */
-  catch_errors ((catch_errors_ftype*) putpkt, "k", "", RETURN_MASK_ERROR);
+  catch_errors ((catch_errors_ftype *) putpkt, "k", "", RETURN_MASK_ERROR);
 
   /* Don't wait for it to die.  I'm not really sure it matters whether
      we do or not.  For the existing stubs, kill is a noop.  */
@@ -3666,7 +3674,7 @@ remote_async_kill ()
 
   /* Use catch_errors so the user can quit from gdb even when we aren't on
      speaking terms with the remote system.  */
-  catch_errors ((catch_errors_ftype*) putpkt, "k", "", RETURN_MASK_ERROR);
+  catch_errors ((catch_errors_ftype *) putpkt, "k", "", RETURN_MASK_ERROR);
 
   /* Don't wait for it to die.  I'm not really sure it matters whether
      we do or not.  For the existing stubs, kill is a noop.  */
@@ -3761,8 +3769,8 @@ extended_remote_async_create_inferior (exec_file, args, env)
   /* Let the remote process run.  */
   proceed (-1, TARGET_SIGNAL_0, 0);
 }
-
 \f
+
 /* On some machines, e.g. 68k, we may use a different breakpoint instruction
    than other targets; in those use REMOTE_BREAKPOINT instead of just
    BREAKPOINT.  Also, bi-endian targets may define LITTLE_REMOTE_BREAKPOINT
@@ -3873,7 +3881,8 @@ open_remote_target (name, from_tty, target, extended_p)
 
 /* Table used by the crc32 function to calcuate the checksum. */
 
-static unsigned long crc32_table[256] = {0, 0};
+static unsigned long crc32_table[256] =
+{0, 0};
 
 static unsigned long
 crc32 (buf, len, crc)
@@ -3881,18 +3890,18 @@ crc32 (buf, len, crc)
      int len;
      unsigned int crc;
 {
-  if (! crc32_table[1])
+  if (!crc32_table[1])
     {
       /* Initialize the CRC table and the decoding table. */
       int i, j;
       unsigned int c;
 
       for (i = 0; i < 256; i++)
-        {
-          for (c = i << 24, j = 8; j > 0; --j)
-            c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1);
-          crc32_table[i] = c;
-        }
+       {
+         for (c = i << 24, j = 8; j > 0; --j)
+           c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1);
+         crc32_table[i] = c;
+       }
     }
 
   while (len--)
@@ -3934,20 +3943,20 @@ compare_sections_command (args, from_tty)
       strcmp (current_target.to_shortname, "remote") != 0)
     error ("command can only be used with remote target");
 
-  for (s = exec_bfd->sections; s; s = s->next) 
+  for (s = exec_bfd->sections; s; s = s->next)
     {
       if (!(s->flags & SEC_LOAD))
-       continue;       /* skip non-loadable section */
+       continue;               /* skip non-loadable section */
 
       size = bfd_get_section_size_before_reloc (s);
       if (size == 0)
-       continue;       /* skip zero-length section */
+       continue;               /* skip zero-length section */
 
       sectname = (char *) bfd_get_section_name (exec_bfd, s);
       if (args && strcmp (args, sectname) != 0)
-       continue;       /* not the section selected by user */
+       continue;               /* not the section selected by user */
 
-      matched = 1;     /* do this section */
+      matched = 1;             /* do this section */
       lma = s->lma;
       /* FIXME: assumes lma can fit into long */
       sprintf (buf, "qCRC:%lx,%lx", (long) lma, (long) size);
@@ -3974,10 +3983,10 @@ compare_sections_command (args, from_tty)
       if (host_crc == target_crc)
        printf_filtered ("matched.\n");
       else
-       {
-        printf_filtered ("MIS-MATCHED!\n");
-        mismatched++;
-       }
+       {
+         printf_filtered ("MIS-MATCHED!\n");
+         mismatched++;
+       }
 
       do_cleanups (old_chain);
     }
@@ -4000,30 +4009,30 @@ remote_query (query_type, buf, outbuf, bufsiz)
   char *p2 = &buf2[0];
   char *p = buf;
 
-  if (! bufsiz)
+  if (!bufsiz)
     error ("null pointer to remote bufer size specified");
 
   /* minimum outbuf size is PBUFSIZ - if bufsiz is not large enough let 
      the caller know and return what the minimum size is   */
   /* Note: a zero bufsiz can be used to query the minimum buffer size */
-  if ( *bufsiz < PBUFSIZ )
+  if (*bufsiz < PBUFSIZ)
     {
       *bufsiz = PBUFSIZ;
       return -1;
     }
 
   /* except for querying the minimum buffer size, target must be open */
-  if (! remote_desc)
+  if (!remote_desc)
     error ("remote query is only available after target open");
 
   /* we only take uppercase letters as query types, at least for now */
-  if ( (query_type < 'A') || (query_type > 'Z') )
+  if ((query_type < 'A') || (query_type > 'Z'))
     error ("invalid remote query type");
 
-  if (! buf)
+  if (!buf)
     error ("null remote query specified");
 
-  if (! outbuf)
+  if (!outbuf)
     error ("remote query requires a buffer to receive data");
 
   outbuf[0] = '\0';
@@ -4036,22 +4045,23 @@ remote_query (query_type, buf, outbuf, bufsiz)
      plus one extra in case we are debugging (remote_debug),
      we have PBUFZIZ - 7 left to pack the query string */
   i = 0;
-  while ( buf[i] && (i < (PBUFSIZ - 8)) )
+  while (buf[i] && (i < (PBUFSIZ - 8)))
     {
       /* bad caller may have sent forbidden characters */
-      if ( (!isprint(buf[i])) || (buf[i] == '$') || (buf[i] == '#') )
-        error ("illegal characters in query string");
+      if ((!isprint (buf[i])) || (buf[i] == '$') || (buf[i] == '#'))
+       error ("illegal characters in query string");
 
       *p2++ = buf[i];
       i++;
     }
   *p2 = buf[i];
 
-  if ( buf[i] )
+  if (buf[i])
     error ("query larger than available buffer");
 
   i = putpkt (buf2);
-  if ( i < 0 ) return i;
+  if (i < 0)
+    return i;
 
   getpkt (outbuf, 0);
 
@@ -4065,10 +4075,10 @@ packet_command (args, from_tty)
 {
   char *buf = alloca (PBUFSIZ);
 
-  if (! remote_desc)
+  if (!remote_desc)
     error ("command can only be used with remote target");
 
-  if (! args)
+  if (!args)
     error ("remote-packet command requires packet text as argument");
 
   puts_filtered ("sending: ");
@@ -4085,7 +4095,7 @@ packet_command (args, from_tty)
 #if 0
 /* --------- UNIT_TEST for THREAD oriented PACKETS ------------------------- */
 
-static void display_thread_info PARAMS ((struct gdb_ext_thread_info *info));
+static void display_thread_info PARAMS ((struct gdb_ext_thread_info * info));
 
 static void threadset_test_cmd PARAMS ((char *cmd, int tty));
 
@@ -4093,17 +4103,17 @@ static void threadalive_test PARAMS ((char *cmd, int tty));
 
 static void threadlist_test_cmd PARAMS ((char *cmd, int tty));
 
-int get_and_display_threadinfo PARAMS ((threadref *ref));
+int get_and_display_threadinfo PARAMS ((threadref * ref));
 
 static void threadinfo_test_cmd PARAMS ((char *cmd, int tty));
 
-static int thread_display_step PARAMS ((threadref *ref, void *context));
+static int thread_display_step PARAMS ((threadref * ref, void *context));
 
 static void threadlist_update_test_cmd PARAMS ((char *cmd, int tty));
 
 static void init_remote_threadtests PARAMS ((void));
 
-#define SAMPLE_THREAD  0x05060708  /* Truncated 64 bit threadid */
+#define SAMPLE_THREAD  0x05060708      /* Truncated 64 bit threadid */
 
 static void
 threadset_test_cmd (cmd, tty)
@@ -4246,38 +4256,38 @@ init_remote_threadtests (void)
 static void
 init_remote_ops ()
 {
-  remote_ops.to_shortname = "remote";          
+  remote_ops.to_shortname = "remote";
   remote_ops.to_longname = "Remote serial target in gdb-specific protocol";
-  remote_ops.to_doc = 
+  remote_ops.to_doc =
     "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya).";  
-  remote_ops.to_open = remote_open;            
-  remote_ops.to_close = remote_close;          
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  remote_ops.to_open = remote_open;
+  remote_ops.to_close = remote_close;
   remote_ops.to_detach = remote_detach;
-  remote_ops.to_resume = remote_resume;        
+  remote_ops.to_resume = remote_resume;
   remote_ops.to_wait = remote_wait;
   remote_ops.to_fetch_registers = remote_fetch_registers;
   remote_ops.to_store_registers = remote_store_registers;
   remote_ops.to_prepare_to_store = remote_prepare_to_store;
-  remote_ops.to_xfer_memory = remote_xfer_memory;      
-  remote_ops.to_files_info = remote_files_info;        
+  remote_ops.to_xfer_memory = remote_xfer_memory;
+  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_kill = remote_kill;            
-  remote_ops.to_load = generic_load;           
+  remote_ops.to_kill = remote_kill;
+  remote_ops.to_load = generic_load;
   remote_ops.to_mourn_inferior = remote_mourn;
   remote_ops.to_thread_alive = remote_thread_alive;
   remote_ops.to_find_new_threads = remote_threads_info;
   remote_ops.to_stop = remote_stop;
   remote_ops.to_query = remote_query;
   remote_ops.to_stratum = process_stratum;
-  remote_ops.to_has_all_memory = 1;    
-  remote_ops.to_has_memory = 1;        
-  remote_ops.to_has_stack = 1; 
-  remote_ops.to_has_registers = 1;     
-  remote_ops.to_has_execution = 1;     
-  remote_ops.to_has_thread_control = tc_schedlock; /* can lock scheduler */
-  remote_ops.to_magic = OPS_MAGIC;     
+  remote_ops.to_has_all_memory = 1;
+  remote_ops.to_has_memory = 1;
+  remote_ops.to_has_stack = 1;
+  remote_ops.to_has_registers = 1;
+  remote_ops.to_has_execution = 1;
+  remote_ops.to_has_thread_control = tc_schedlock;     /* can lock scheduler */
+  remote_ops.to_magic = OPS_MAGIC;
 }
 
 /* Set up the extended remote vector by making a copy of the standard
@@ -4289,12 +4299,12 @@ init_extended_remote_ops ()
   extended_remote_ops = remote_ops;
 
   extended_remote_ops.to_shortname = "extended-remote";
-  extended_remote_ops.to_longname = 
+  extended_remote_ops.to_longname =
     "Extended remote serial target in gdb-specific protocol";
-  extended_remote_ops.to_doc = 
+  extended_remote_ops.to_doc =
     "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).",
-  extended_remote_ops.to_open = extended_remote_open;
+    extended_remote_ops.to_open = extended_remote_open;
   extended_remote_ops.to_create_inferior = extended_remote_create_inferior;
   extended_remote_ops.to_mourn_inferior = extended_remote_mourn;
 }
@@ -4327,12 +4337,12 @@ remote_info_process (args, from_tty)
   putpkt ("qfProcessInfo");
   getpkt (buf, 0);
   if (buf[0] == 0)
-    return;             /* Silently: target does not support this feature. */
+    return;                    /* Silently: target does not support this feature. */
 
   if (buf[0] == 'E')
     error ("info proc: target error.");
 
-  while (buf[0] == 'O') /* Capitol-O packet */
+  while (buf[0] == 'O')                /* Capitol-O packet */
     {
       remote_console_output (&buf[1]);
       putpkt ("qsProcessInfo");
@@ -4351,7 +4361,7 @@ remote_cisco_open (name, from_tty)
 {
   if (name == 0)
     error (
-"To open a remote debug connection, you need to specify what \n\
+           "To open a remote debug connection, you need to specify what \n\
 device is attached to the remote system (e.g. host:port).");
 
   target_preopen (from_tty);
@@ -4371,7 +4381,7 @@ device is attached to the remote system (e.g. host:port).");
    */
 
   baud_rate = (baud_rate > 0) ? baud_rate : 9600;
-  if (SERIAL_SETBAUDRATE (remote_desc, baud_rate)) 
+  if (SERIAL_SETBAUDRATE (remote_desc, baud_rate))
     {
       SERIAL_CLOSE (remote_desc);
       perror_with_name (name);
@@ -4399,7 +4409,7 @@ device is attached to the remote system (e.g. host:port).");
      stub to another, we can (if the target is closed and reopened) cope.  */
   stub_supports_P = 1;
 
-  general_thread  = -2;
+  general_thread = -2;
   continue_thread = -2;
 
   /* Force remote_write_bytes to check whether target supports
@@ -4416,8 +4426,8 @@ device is attached to the remote system (e.g. host:port).");
 
   /* Start the remote connection; if error (0), discard this target. */
 
-  if (!catch_errors (remote_start_remote_dummy, (char *) 0, 
-                    "Couldn't establish connection to remote target\n", 
+  if (!catch_errors (remote_start_remote_dummy, (char *) 0,
+                    "Couldn't establish connection to remote target\n",
                     RETURN_MASK_ALL))
     {
       pop_target ();
@@ -4433,18 +4443,21 @@ remote_cisco_close (quitting)
   remote_close (quitting);
 }
 
-static void 
-remote_cisco_mourn PARAMS ((void))
+static void
+  remote_cisco_mourn
+PARAMS ((void))
 {
   remote_mourn_1 (&remote_cisco_ops);
 }
 
-enum {
-  READ_MORE, 
-  FATAL_ERROR, 
-  ENTER_DEBUG, 
+enum
+{
+  READ_MORE,
+  FATAL_ERROR,
+  ENTER_DEBUG,
   DISCONNECT_TELNET
-} minitelnet_return;
+}
+minitelnet_return;
 
 /* shared between readsocket() and readtty()  */
 static char *tty_input;
@@ -4460,63 +4473,64 @@ readsocket ()
 
   /* Loop until the socket doesn't have any more data */
 
-  while ((data = readchar (0)) >= 0) 
+  while ((data = readchar (0)) >= 0)
     {
       /* Check for the escape sequence */
-      if (data == '|') 
+      if (data == '|')
        {
          /* If this is the fourth escape, get out */
-         if (++escape_count == 4) 
+         if (++escape_count == 4)
            {
              return ENTER_DEBUG;
            }
-         else 
-           { /* This is a '|', but not the fourth in a row. 
-                Continue without echoing it.  If it isn't actually 
-                one of four in a row, it'll be echoed later.  */
+         else
+           {                   /* This is a '|', but not the fourth in a row. 
+                                  Continue without echoing it.  If it isn't actually 
+                                  one of four in a row, it'll be echoed later.  */
              continue;
            }
        }
-      else /* Not a '|' */
-       { 
+      else
+       /* Not a '|' */
+       {
          /* Ensure any pending '|'s are flushed.  */
 
-         for ( ; escape_count > 0; escape_count--)
-           putchar('|');
+         for (; escape_count > 0; escape_count--)
+           putchar ('|');
        }
-               
-      if (data == '\r')                        /* If this is a return character, */
-       continue;                       /*  - just supress it. */
 
-      if (echo_check != -1)            /* Check for echo of user input.  */
+      if (data == '\r')                /* If this is a return character, */
+       continue;               /*  - just supress it. */
+
+      if (echo_check != -1)    /* Check for echo of user input.  */
        {
          if (tty_input[echo_check] == data)
            {
-             echo_check++;             /* Character matched user input: */
-             continue;                 /* Continue without echoing it.  */
+             echo_check++;     /* Character matched user input: */
+             continue;         /* Continue without echoing it.  */
            }
-         else if ((data == '\n') && (tty_input[echo_check] == '\r')) 
-           { /* End of the line (and of echo checking).  */
-             echo_check = -1;          /* No more echo supression */
-             continue;                 /* Continue without echoing.  */
+         else if ((data == '\n') && (tty_input[echo_check] == '\r'))
+           {                   /* End of the line (and of echo checking).  */
+             echo_check = -1;  /* No more echo supression */
+             continue;         /* Continue without echoing.  */
            }
          else
-           { /* Failed check for echo of user input.
-                We now have some suppressed output to flush!  */
+           {                   /* Failed check for echo of user input.
+                                  We now have some suppressed output to flush!  */
              int j;
 
-             for (j = 0; j < echo_check; j++) 
+             for (j = 0; j < echo_check; j++)
                putchar (tty_input[j]);
              echo_check = -1;
            }
        }
-      putchar (data);                  /* Default case: output the char.  */
+      putchar (data);          /* Default case: output the char.  */
     }
 
-  if (data == SERIAL_TIMEOUT)          /* Timeout returned from readchar.  */
-    return READ_MORE;                  /* Try to read some more */
-  else 
-    return FATAL_ERROR;                        /* Trouble, bail out */
+  if (data == SERIAL_TIMEOUT)  /* Timeout returned from readchar.  */
+    return READ_MORE;          /* Try to read some more */
+  else
+    return FATAL_ERROR;                /* Trouble, bail out */
 }
 
 static int
@@ -4527,7 +4541,7 @@ readtty ()
 
   /* First, read a buffer full from the terminal */
   tty_bytecount = read (fileno (stdin), tty_input, sizeof (tty_input) - 1);
-  if (tty_bytecount == -1) 
+  if (tty_bytecount == -1)
     {
       perror ("readtty: read failed");
       return FATAL_ERROR;
@@ -4537,13 +4551,13 @@ readtty ()
   if (tty_input[tty_bytecount - 1] == '\n' &&
       tty_input[tty_bytecount - 2] == '\\')    /* line ending in backslash */
     {
-      tty_input[--tty_bytecount] = 0;          /* remove newline */
-      tty_input[--tty_bytecount] = 0;          /* remove backslash */
+      tty_input[--tty_bytecount] = 0;  /* remove newline */
+      tty_input[--tty_bytecount] = 0;  /* remove backslash */
     }
 
   /* Turn trailing newlines into returns */
   if (tty_input[tty_bytecount - 1] == '\n')
-    tty_input[tty_bytecount - 1]   =  '\r';
+    tty_input[tty_bytecount - 1] = '\r';
 
   /* If the line consists of a ~, enter debugging mode.  */
   if ((tty_input[0] == '~') && (tty_bytecount == 2))
@@ -4551,7 +4565,7 @@ readtty ()
 
   /* Make this a zero terminated string and write it out */
   tty_input[tty_bytecount] = 0;
-  if (SERIAL_WRITE (remote_desc, tty_input, tty_bytecount)) 
+  if (SERIAL_WRITE (remote_desc, tty_input, tty_bytecount))
     {
       perror_with_name ("readtty: write failed");
       return FATAL_ERROR;
@@ -4564,50 +4578,50 @@ static int
 minitelnet ()
 {
   fd_set input;                        /* file descriptors for select */
-  int    tablesize;            /* max number of FDs for select */
-  int    status;
-  int    quit_count = 0;
+  int tablesize;               /* max number of FDs for select */
+  int status;
+  int quit_count = 0;
 
   extern int escape_count;     /* global shared by readsocket */
   extern int echo_check;       /* ditto */
 
   escape_count = 0;
-  echo_check   = -1;
+  echo_check = -1;
 
   tablesize = 8 * sizeof (input);
 
-  for (;;) 
+  for (;;)
     {
       /* Check for anything from our socket - doesn't block. Note that
-        this must be done *before* the select as there may be
-        buffered I/O waiting to be processed.  */
+         this must be done *before* the select as there may be
+         buffered I/O waiting to be processed.  */
 
-      if ((status = readsocket ()) == FATAL_ERROR) 
+      if ((status = readsocket ()) == FATAL_ERROR)
        {
          error ("Debugging terminated by communications error");
        }
-      else if (status != READ_MORE) 
+      else if (status != READ_MORE)
        {
          return (status);
        }
 
-      fflush(stdout);                  /* Flush output before blocking */
+      fflush (stdout);         /* Flush output before blocking */
 
       /* Now block on more socket input or TTY input */
-    
+
       FD_ZERO (&input);
-      FD_SET (fileno(stdin), &input);
+      FD_SET (fileno (stdin), &input);
       FD_SET (remote_desc->fd, &input);
 
       status = select (tablesize, &input, 0, 0, 0);
-      if ((status == -1) && (errno != EINTR)) 
+      if ((status == -1) && (errno != EINTR))
        {
          error ("Communications error on select %d", errno);
        }
 
       /* Handle Control-C typed */
 
-      if (quit_flag) 
+      if (quit_flag)
        {
          if ((++quit_count) == 2)
            {
@@ -4630,7 +4644,7 @@ minitelnet ()
 
       /* Handle console input */
 
-      if (FD_ISSET (fileno (stdin), &input)) 
+      if (FD_ISSET (fileno (stdin), &input))
        {
          quit_count = 0;
          echo_check = 0;
@@ -4648,7 +4662,7 @@ remote_cisco_wait (pid, status)
      int pid;
      struct target_waitstatus *status;
 {
-  if (minitelnet() != ENTER_DEBUG) 
+  if (minitelnet () != ENTER_DEBUG)
     {
       error ("Debugging session terminated by protocol error");
     }
@@ -4660,34 +4674,34 @@ static void
 init_remote_cisco_ops ()
 {
   remote_cisco_ops.to_shortname = "cisco";
-  remote_cisco_ops.to_longname  = "Remote serial target in cisco-specific protocol";
-  remote_cisco_ops.to_doc       = 
+  remote_cisco_ops.to_longname = "Remote serial target in cisco-specific protocol";
+  remote_cisco_ops.to_doc =
     "Use a remote machine via TCP, using a cisco-specific protocol.\n\
 Specify the serial device it is connected to (e.g. host:2020).";
-  remote_cisco_ops.to_open              = remote_cisco_open;
-  remote_cisco_ops.to_close             = remote_cisco_close;
-  remote_cisco_ops.to_detach            = remote_detach;
-  remote_cisco_ops.to_resume            = remote_resume;
-  remote_cisco_ops.to_wait              = remote_cisco_wait;
-  remote_cisco_ops.to_fetch_registers   = remote_fetch_registers;
-  remote_cisco_ops.to_store_registers   = remote_store_registers;
-  remote_cisco_ops.to_prepare_to_store  = remote_prepare_to_store;
-  remote_cisco_ops.to_xfer_memory       = remote_xfer_memory;
-  remote_cisco_ops.to_files_info        = remote_files_info;
+  remote_cisco_ops.to_open = remote_cisco_open;
+  remote_cisco_ops.to_close = remote_cisco_close;
+  remote_cisco_ops.to_detach = remote_detach;
+  remote_cisco_ops.to_resume = remote_resume;
+  remote_cisco_ops.to_wait = remote_cisco_wait;
+  remote_cisco_ops.to_fetch_registers = remote_fetch_registers;
+  remote_cisco_ops.to_store_registers = remote_store_registers;
+  remote_cisco_ops.to_prepare_to_store = remote_prepare_to_store;
+  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_kill              = remote_kill;
-  remote_cisco_ops.to_load              = generic_load;
-  remote_cisco_ops.to_mourn_inferior    = remote_cisco_mourn;
-  remote_cisco_ops.to_thread_alive      = remote_thread_alive;
-  remote_cisco_ops.to_find_new_threads  = remote_threads_info;
-  remote_cisco_ops.to_stratum           = process_stratum;
-  remote_cisco_ops.to_has_all_memory    = 1;
-  remote_cisco_ops.to_has_memory        = 1;
-  remote_cisco_ops.to_has_stack         = 1;
-  remote_cisco_ops.to_has_registers     = 1;
-  remote_cisco_ops.to_has_execution     = 1;
-  remote_cisco_ops.to_magic             = OPS_MAGIC;
+  remote_cisco_ops.to_kill = remote_kill;
+  remote_cisco_ops.to_load = generic_load;
+  remote_cisco_ops.to_mourn_inferior = remote_cisco_mourn;
+  remote_cisco_ops.to_thread_alive = remote_thread_alive;
+  remote_cisco_ops.to_find_new_threads = remote_threads_info;
+  remote_cisco_ops.to_stratum = process_stratum;
+  remote_cisco_ops.to_has_all_memory = 1;
+  remote_cisco_ops.to_has_memory = 1;
+  remote_cisco_ops.to_has_stack = 1;
+  remote_cisco_ops.to_has_registers = 1;
+  remote_cisco_ops.to_has_execution = 1;
+  remote_cisco_ops.to_magic = OPS_MAGIC;
 }
 
 /* Target async and target extended-async.
@@ -4700,38 +4714,38 @@ static void
 init_remote_async_ops ()
 {
   remote_async_ops.to_shortname = "async";
-  remote_async_ops.to_longname  = "Remote serial target in async version of the gdb-specific protocol";
-  remote_async_ops.to_doc       = 
+  remote_async_ops.to_longname = "Remote serial target in async version of the gdb-specific protocol";
+  remote_async_ops.to_doc =
     "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).";
-  remote_async_ops.to_open              = remote_async_open;
-  remote_async_ops.to_close             = remote_close;
-  remote_async_ops.to_detach            = remote_async_detach;
-  remote_async_ops.to_resume            = remote_async_resume;
-  remote_async_ops.to_wait              = remote_async_wait;
-  remote_async_ops.to_fetch_registers   = remote_fetch_registers;
-  remote_async_ops.to_store_registers   = remote_store_registers;
-  remote_async_ops.to_prepare_to_store  = remote_prepare_to_store;
-  remote_async_ops.to_xfer_memory       = remote_xfer_memory;
-  remote_async_ops.to_files_info        = remote_files_info;
+  remote_async_ops.to_open = remote_async_open;
+  remote_async_ops.to_close = remote_close;
+  remote_async_ops.to_detach = remote_async_detach;
+  remote_async_ops.to_resume = remote_async_resume;
+  remote_async_ops.to_wait = remote_async_wait;
+  remote_async_ops.to_fetch_registers = remote_fetch_registers;
+  remote_async_ops.to_store_registers = remote_store_registers;
+  remote_async_ops.to_prepare_to_store = remote_prepare_to_store;
+  remote_async_ops.to_xfer_memory = remote_xfer_memory;
+  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_kill              = remote_async_kill;
-  remote_async_ops.to_load              = generic_load;
-  remote_async_ops.to_mourn_inferior    = remote_mourn;
-  remote_async_ops.to_thread_alive      = remote_thread_alive;
-  remote_async_ops.to_find_new_threads  = remote_threads_info;
+  remote_async_ops.to_kill = remote_async_kill;
+  remote_async_ops.to_load = generic_load;
+  remote_async_ops.to_mourn_inferior = remote_mourn;
+  remote_async_ops.to_thread_alive = remote_thread_alive;
+  remote_async_ops.to_find_new_threads = remote_threads_info;
   remote_async_ops.to_stop = remote_stop;
   remote_async_ops.to_query = remote_query;
-  remote_async_ops.to_stratum           = process_stratum;
-  remote_async_ops.to_has_all_memory    = 1;
-  remote_async_ops.to_has_memory        = 1;
-  remote_async_ops.to_has_stack         = 1;
-  remote_async_ops.to_has_registers     = 1;
-  remote_async_ops.to_has_execution     = 1;
-  remote_async_ops.to_has_thread_control = tc_schedlock; /* can lock scheduler */
-  remote_async_ops.to_has_async_exec    = 1;
-  remote_async_ops.to_magic             = OPS_MAGIC;
+  remote_async_ops.to_stratum = process_stratum;
+  remote_async_ops.to_has_all_memory = 1;
+  remote_async_ops.to_has_memory = 1;
+  remote_async_ops.to_has_stack = 1;
+  remote_async_ops.to_has_registers = 1;
+  remote_async_ops.to_has_execution = 1;
+  remote_async_ops.to_has_thread_control = tc_schedlock;       /* can lock scheduler */
+  remote_async_ops.to_has_async_exec = 1;
+  remote_async_ops.to_magic = OPS_MAGIC;
 }
 
 /* Set up the async extended remote vector by making a copy of the standard
@@ -4743,12 +4757,12 @@ init_extended_async_remote_ops ()
   extended_async_remote_ops = remote_async_ops;
 
   extended_async_remote_ops.to_shortname = "extended-async";
-  extended_async_remote_ops.to_longname = 
+  extended_async_remote_ops.to_longname =
     "Extended remote serial target in async gdb-specific protocol";
-  extended_async_remote_ops.to_doc = 
+  extended_async_remote_ops.to_doc =
     "Use a remote computer via a serial line, using an async gdb-specific protocol.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).",
-  extended_async_remote_ops.to_open = extended_remote_async_open;
+    extended_async_remote_ops.to_open = extended_remote_async_open;
   extended_async_remote_ops.to_create_inferior = extended_remote_async_create_inferior;
   extended_async_remote_ops.to_mourn_inferior = extended_remote_mourn;
 }
@@ -4790,9 +4804,9 @@ _initialize_remote ()
   init_remote_threadtests ();
 #endif
 
-  add_cmd ("compare-sections", class_obscure, compare_sections_command, 
+  add_cmd ("compare-sections", class_obscure, compare_sections_command,
           "Compare section data on target to the exec file.\n\
-Argument is a single section name (default: all loaded sections).", 
+Argument is a single section name (default: all loaded sections).",
           &cmdlist);
 
   add_cmd ("packet", class_maintenance, packet_command,
@@ -4804,37 +4818,37 @@ response packet.  GDB supplies the initial `$' character, and the\n\
 terminating `#' character and checksum.",
           &maintenancelist);
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remotetimeout", no_class,
-                 var_integer, (char *)&remote_timeout,
+                 var_integer, (char *) &remote_timeout,
                  "Set timeout value for remote read.\n",
                  &setlist),
      &showlist);
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remotebreak", no_class,
-                 var_integer, (char *)&remote_break,
+                 var_integer, (char *) &remote_break,
                  "Set whether to send break if interrupted.\n",
                  &setlist),
      &showlist);
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remotewritesize", no_class,
-                 var_integer, (char *)&remote_write_size,
-                 "Set the maximum number of bytes per memory write packet.\n",
+                 var_integer, (char *) &remote_write_size,
+              "Set the maximum number of bytes per memory write packet.\n",
                  &setlist),
      &showlist);
 
   remote_address_size = TARGET_PTR_BIT;
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remoteaddresssize", class_obscure,
-                 var_integer, (char *)&remote_address_size,
+                 var_integer, (char *) &remote_address_size,
                  "Set the maximum size of the address (in bits) \
 in a memory packet.\n",
                  &setlist),
-     &showlist);  
+     &showlist);
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remotebinarydownload", no_class,
                  var_boolean, (char *) &remote_binary_download,
                  "Set binary downloads.\n", &setlist),
index 4fe6bad79d995a984cb81087f01a2a2e5dfb0f75..8b938b5139c9bc67f29ad0673aed890bca020f8d 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote target glue for the ROM68K ROM monitor.
    Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -80,10 +81,11 @@ rom68k_supply_register (regname, regnamelen, val, 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 char *rom68k_regnames[NUM_REGS] =
+{
   "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
   "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
-  "SR", "PC" };
+  "SR", "PC"};
 
 /* Define the monitor command strings. Since these are passed directly
    through to a printf style function, we may include formatting
@@ -91,59 +93,60 @@ static char *rom68k_regnames[NUM_REGS] = {
 
 static struct target_ops rom68k_ops;
 
-static char *rom68k_inits[] = {".\r\r", NULL}; /* Exits pm/pr & download cmds */
+static char *rom68k_inits[] =
+{".\r\r", NULL};               /* Exits pm/pr & download cmds */
 
-static struct monitor_ops rom68k_cmds ;
+static struct monitor_ops rom68k_cmds;
 
-static void 
+static void
 init_rom68k_cmds (void)
 {
-  rom68k_cmds.flags =   0;
-  rom68k_cmds.init =   rom68k_inits; /* monitor init string */
-  rom68k_cmds.cont =   "go\r";
-  rom68k_cmds.step =   "st\r";
-  rom68k_cmds.stop =   NULL;
-  rom68k_cmds.set_break =   "db %x\r";
-  rom68k_cmds.clr_break =   "cb %x\r";
-  rom68k_cmds.clr_all_break =   "cb *\r";
-  rom68k_cmds.fill =   "fm %x %x %x\r";
-  rom68k_cmds.setmem.cmdb =     "pm %x %x\r";
-  rom68k_cmds.setmem.cmdw =     "pm.w %x %x\r";
-  rom68k_cmds.setmem.cmdl =     "pm.l %x %x\r";
-  rom68k_cmds.setmem.cmdll =     NULL;
-  rom68k_cmds.setmem.resp_delim =     NULL;
-  rom68k_cmds.setmem.term =     NULL;
-  rom68k_cmds.setmem.term_cmd =     NULL;
-  rom68k_cmds.getmem.cmdb =     "dm %x %x\r";
-  rom68k_cmds.getmem.cmdw =     "dm.w %x %x\r";
-  rom68k_cmds.getmem.cmdl =     "dm.l %x %x\r";
-  rom68k_cmds.getmem.cmdll =     NULL;
-  rom68k_cmds.getmem.resp_delim =     "  ";
-  rom68k_cmds.getmem.term =     NULL;
-  rom68k_cmds.getmem.term_cmd =     NULL;
-  rom68k_cmds.setreg.cmd =     "pr %s %x\r";
-  rom68k_cmds.setreg.resp_delim =     NULL;
-  rom68k_cmds.setreg.term =     NULL;
-  rom68k_cmds.setreg.term_cmd =     NULL;
-  rom68k_cmds.getreg.cmd =     "pr %s\r";
-  rom68k_cmds.getreg.resp_delim =     ":  ";
-  rom68k_cmds.getreg.term =     "= ";
-  rom68k_cmds.getreg.term_cmd =     ".\r";
-  rom68k_cmds.dump_registers =   "dr\r";
+  rom68k_cmds.flags = 0;
+  rom68k_cmds.init = rom68k_inits;     /* monitor init string */
+  rom68k_cmds.cont = "go\r";
+  rom68k_cmds.step = "st\r";
+  rom68k_cmds.stop = NULL;
+  rom68k_cmds.set_break = "db %x\r";
+  rom68k_cmds.clr_break = "cb %x\r";
+  rom68k_cmds.clr_all_break = "cb *\r";
+  rom68k_cmds.fill = "fm %x %x %x\r";
+  rom68k_cmds.setmem.cmdb = "pm %x %x\r";
+  rom68k_cmds.setmem.cmdw = "pm.w %x %x\r";
+  rom68k_cmds.setmem.cmdl = "pm.l %x %x\r";
+  rom68k_cmds.setmem.cmdll = NULL;
+  rom68k_cmds.setmem.resp_delim = NULL;
+  rom68k_cmds.setmem.term = NULL;
+  rom68k_cmds.setmem.term_cmd = NULL;
+  rom68k_cmds.getmem.cmdb = "dm %x %x\r";
+  rom68k_cmds.getmem.cmdw = "dm.w %x %x\r";
+  rom68k_cmds.getmem.cmdl = "dm.l %x %x\r";
+  rom68k_cmds.getmem.cmdll = NULL;
+  rom68k_cmds.getmem.resp_delim = "  ";
+  rom68k_cmds.getmem.term = NULL;
+  rom68k_cmds.getmem.term_cmd = NULL;
+  rom68k_cmds.setreg.cmd = "pr %s %x\r";
+  rom68k_cmds.setreg.resp_delim = NULL;
+  rom68k_cmds.setreg.term = NULL;
+  rom68k_cmds.setreg.term_cmd = NULL;
+  rom68k_cmds.getreg.cmd = "pr %s\r";
+  rom68k_cmds.getreg.resp_delim = ":  ";
+  rom68k_cmds.getreg.term = "= ";
+  rom68k_cmds.getreg.term_cmd = ".\r";
+  rom68k_cmds.dump_registers = "dr\r";
   rom68k_cmds.register_pattern =
     "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)";
-  rom68k_cmds.supply_register =   rom68k_supply_register;
-  rom68k_cmds.load_routine =   NULL;
-  rom68k_cmds.load =   "dc\r";
-  rom68k_cmds.loadresp =   "Waiting for S-records from host... ";
-  rom68k_cmds.prompt =   "ROM68K :-> ";
-  rom68k_cmds.line_term =   "\r";
-  rom68k_cmds.cmd_end =   ".\r";
-  rom68k_cmds.target =   &rom68k_ops;
-  rom68k_cmds.stopbits =   SERIAL_1_STOPBITS;
-  rom68k_cmds.regnames =   rom68k_regnames;
-  rom68k_cmds.magic =   MONITOR_OPS_MAGIC;
-} /* init_rom68k_cmds */
+  rom68k_cmds.supply_register = rom68k_supply_register;
+  rom68k_cmds.load_routine = NULL;
+  rom68k_cmds.load = "dc\r";
+  rom68k_cmds.loadresp = "Waiting for S-records from host... ";
+  rom68k_cmds.prompt = "ROM68K :-> ";
+  rom68k_cmds.line_term = "\r";
+  rom68k_cmds.cmd_end = ".\r";
+  rom68k_cmds.target = &rom68k_ops;
+  rom68k_cmds.stopbits = SERIAL_1_STOPBITS;
+  rom68k_cmds.regnames = rom68k_regnames;
+  rom68k_cmds.magic = MONITOR_OPS_MAGIC;
+}                              /* init_rom68k_cmds */
 
 static void
 rom68k_open (args, from_tty)
@@ -156,7 +159,7 @@ rom68k_open (args, from_tty)
 void
 _initialize_rom68k ()
 {
-  init_rom68k_cmds() ;
+  init_rom68k_cmds ();
   init_monitor_ops (&rom68k_ops);
 
   rom68k_ops.to_shortname = "rom68k";
index 78f5a6beb47d90f79e7de81d2e5a781df54ffc82..b0a0021d5dee3a940d8f61f018c127f1e2cf9bf8 100644 (file)
@@ -1,22 +1,23 @@
 /* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
    Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996, 1997, 1998
-            Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -25,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "xcoffsolib.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "libbfd.h"  /* For bfd_cache_lookup (FIXME) */
+#include "libbfd.h"            /* For bfd_cache_lookup (FIXME) */
 #include "bfd.h"
 #include "gdb-stabs.h"
 
@@ -47,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 extern int errno;
 
-extern struct vmap * map_vmap PARAMS ((bfd *bf, bfd *arch));
+extern struct vmap *map_vmap PARAMS ((bfd * bf, bfd * arch));
 
 extern struct target_ops exec_ops;
 
@@ -58,7 +59,7 @@ static void
 vmap_ldinfo PARAMS ((struct ld_info *));
 
 static struct vmap *
-add_vmap PARAMS ((struct ld_info *));
+  add_vmap PARAMS ((struct ld_info *));
 
 static int
 objfile_symbol_add PARAMS ((char *));
@@ -77,70 +78,75 @@ fixup_breakpoints PARAMS ((CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta));
 
 /* Conversion from gdb-to-system special purpose register numbers.. */
 
-static int special_regs[] = {
-  IAR,                         /* PC_REGNUM    */
-  MSR,                         /* PS_REGNUM    */
-  CR,                          /* CR_REGNUM    */
-  LR,                          /* LR_REGNUM    */
-  CTR,                         /* CTR_REGNUM   */
+static int special_regs[] =
+{
+  IAR,                         /* PC_REGNUM    */
+  MSR,                         /* PS_REGNUM    */
+  CR,                          /* CR_REGNUM    */
+  LR,                          /* LR_REGNUM    */
+  CTR,                         /* CTR_REGNUM   */
   XER,                         /* XER_REGNUM   */
-  MQ                           /* MQ_REGNUM    */
+  MQ                           /* MQ_REGNUM    */
 };
 
 void
 fetch_inferior_registers (regno)
-  int regno;
+     int regno;
 {
   int ii;
 
-  if (regno < 0) {                     /* for all registers */
+  if (regno < 0)
+    {                          /* for all registers */
 
-    /* read 32 general purpose registers. */
+      /* read 32 general purpose registers. */
 
-    for (ii=0; ii < 32; ++ii)
-      *(int*)&registers[REGISTER_BYTE (ii)] = 
-       ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii, 0, 0);
+      for (ii = 0; ii < 32; ++ii)
+       *(int *) &registers[REGISTER_BYTE (ii)] =
+         ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii, 0, 0);
 
-    /* read general purpose floating point registers. */
+      /* read general purpose floating point registers. */
 
-    for (ii=0; ii < 32; ++ii)
-      ptrace (PT_READ_FPR, inferior_pid, 
-             (PTRACE_ARG3_TYPE) &registers [REGISTER_BYTE (FP0_REGNUM+ii)],
-             FPR0+ii, 0);
+      for (ii = 0; ii < 32; ++ii)
+       ptrace (PT_READ_FPR, inferior_pid,
+           (PTRACE_ARG3_TYPE) & registers[REGISTER_BYTE (FP0_REGNUM + ii)],
+               FPR0 + ii, 0);
 
-    /* read special registers. */
-    for (ii=0; ii <= LAST_UISA_SP_REGNUM-FIRST_UISA_SP_REGNUM; ++ii)
-      *(int*)&registers[REGISTER_BYTE (FIRST_UISA_SP_REGNUM+ii)] = 
-       ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) special_regs[ii],
-               0, 0);
+      /* read special registers. */
+      for (ii = 0; ii <= LAST_UISA_SP_REGNUM - FIRST_UISA_SP_REGNUM; ++ii)
+       *(int *) &registers[REGISTER_BYTE (FIRST_UISA_SP_REGNUM + ii)] =
+         ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) special_regs[ii],
+                 0, 0);
 
-    registers_fetched ();
-    return;
-  }
+      registers_fetched ();
+      return;
+    }
 
   /* else an individual register is addressed. */
 
-  else if (regno < FP0_REGNUM) {               /* a GPR */
-    *(int*)&registers[REGISTER_BYTE (regno)] =
+  else if (regno < FP0_REGNUM)
+    {                          /* a GPR */
+      *(int *) &registers[REGISTER_BYTE (regno)] =
        ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0, 0);
-  }
-  else if (regno <= FPLAST_REGNUM) {           /* a FPR */
-    ptrace (PT_READ_FPR, inferior_pid,
-           (PTRACE_ARG3_TYPE) &registers [REGISTER_BYTE (regno)],
-           (regno-FP0_REGNUM+FPR0), 0);
-  }
-  else if (regno <= LAST_UISA_SP_REGNUM) { /* a special register */
-    *(int*)&registers[REGISTER_BYTE (regno)] =
+    }
+  else if (regno <= FPLAST_REGNUM)
+    {                          /* a FPR */
+      ptrace (PT_READ_FPR, inferior_pid,
+             (PTRACE_ARG3_TYPE) & registers[REGISTER_BYTE (regno)],
+             (regno - FP0_REGNUM + FPR0), 0);
+    }
+  else if (regno <= LAST_UISA_SP_REGNUM)
+    {                          /* a special register */
+      *(int *) &registers[REGISTER_BYTE (regno)] =
        ptrace (PT_READ_GPR, inferior_pid,
-               (PTRACE_ARG3_TYPE) special_regs[regno-FIRST_UISA_SP_REGNUM],
+             (PTRACE_ARG3_TYPE) special_regs[regno - FIRST_UISA_SP_REGNUM],
                0, 0);
-  }
+    }
   else
-    fprintf_unfiltered (gdb_stderr, 
+    fprintf_unfiltered (gdb_stderr,
                        "gdb error: register no %d not implemented.\n",
                        regno);
 
-  register_valid [regno] = 1;
+  register_valid[regno] = 1;
 }
 
 /* Store our register values back into the inferior.
@@ -155,34 +161,34 @@ store_inferior_registers (regno)
   errno = 0;
 
   if (regno == -1)
-    {                  /* for all registers..  */
+    {                          /* for all registers..  */
       int ii;
 
-       /* execute one dummy instruction (which is a breakpoint) in inferior
-          process. So give kernel a chance to do internal house keeping.
-         Otherwise the following ptrace(2) calls will mess up user stack
-         since kernel will get confused about the bottom of the stack (%sp) */
+      /* execute one dummy instruction (which is a breakpoint) in inferior
+         process. So give kernel a chance to do internal house keeping.
+         Otherwise the following ptrace(2) calls will mess up user stack
+         since kernel will get confused about the bottom of the stack (%sp) */
 
-       exec_one_dummy_insn ();
+      exec_one_dummy_insn ();
 
       /* write general purpose registers first! */
-      for ( ii=GPR0; ii<=GPR31; ++ii)
+      for (ii = GPR0; ii <= GPR31; ++ii)
        {
          ptrace (PT_WRITE_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii,
-                 *(int*)&registers[REGISTER_BYTE (ii)], 0);
+                 *(int *) &registers[REGISTER_BYTE (ii)], 0);
          if (errno)
-           { 
+           {
              perror ("ptrace write_gpr");
              errno = 0;
            }
        }
 
       /* write floating point registers now. */
-      for ( ii=0; ii < 32; ++ii)
+      for (ii = 0; ii < 32; ++ii)
        {
-         ptrace (PT_WRITE_FPR, inferior_pid, 
-                 (PTRACE_ARG3_TYPE) &registers[REGISTER_BYTE (FP0_REGNUM+ii)],
-                 FPR0+ii, 0);
+         ptrace (PT_WRITE_FPR, inferior_pid,
+           (PTRACE_ARG3_TYPE) & registers[REGISTER_BYTE (FP0_REGNUM + ii)],
+                 FPR0 + ii, 0);
          if (errno)
            {
              perror ("ptrace write_fpr");
@@ -191,11 +197,11 @@ store_inferior_registers (regno)
        }
 
       /* write special registers. */
-      for (ii=0; ii <= LAST_UISA_SP_REGNUM-FIRST_UISA_SP_REGNUM; ++ii)
+      for (ii = 0; ii <= LAST_UISA_SP_REGNUM - FIRST_UISA_SP_REGNUM; ++ii)
        {
          ptrace (PT_WRITE_GPR, inferior_pid,
                  (PTRACE_ARG3_TYPE) special_regs[ii],
-                 *(int*)&registers[REGISTER_BYTE (FIRST_UISA_SP_REGNUM+ii)],
+            *(int *) &registers[REGISTER_BYTE (FIRST_UISA_SP_REGNUM + ii)],
                  0);
          if (errno)
            {
@@ -207,24 +213,24 @@ store_inferior_registers (regno)
 
   /* else, a specific register number is given... */
 
-  else if (regno < FP0_REGNUM)                 /* a GPR */
+  else if (regno < FP0_REGNUM) /* a GPR */
     {
       ptrace (PT_WRITE_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno,
-             *(int*)&registers[REGISTER_BYTE (regno)], 0);
+             *(int *) &registers[REGISTER_BYTE (regno)], 0);
     }
 
-  else if (regno <= FPLAST_REGNUM)             /* a FPR */
+  else if (regno <= FPLAST_REGNUM)     /* a FPR */
     {
-      ptrace (PT_WRITE_FPR, inferior_pid, 
-             (PTRACE_ARG3_TYPE) &registers[REGISTER_BYTE (regno)],
+      ptrace (PT_WRITE_FPR, inferior_pid,
+             (PTRACE_ARG3_TYPE) & registers[REGISTER_BYTE (regno)],
              regno - FP0_REGNUM + FPR0, 0);
     }
 
-  else if (regno <= LAST_UISA_SP_REGNUM) /* a special register */
+  else if (regno <= LAST_UISA_SP_REGNUM)       /* a special register */
     {
       ptrace (PT_WRITE_GPR, inferior_pid,
-             (PTRACE_ARG3_TYPE) special_regs [regno-FIRST_UISA_SP_REGNUM],
-             *(int*)&registers[REGISTER_BYTE (regno)], 0);
+             (PTRACE_ARG3_TYPE) special_regs[regno - FIRST_UISA_SP_REGNUM],
+             *(int *) &registers[REGISTER_BYTE (regno)], 0);
     }
 
   else
@@ -248,7 +254,7 @@ exec_one_dummy_insn ()
 {
 #define        DUMMY_INSN_ADDR (TEXT_SEGMENT_BASE)+0x200
 
-  char shadow_contents[BREAKPOINT_MAX];        /* Stash old bkpt addr contents */
+  char shadow_contents[BREAKPOINT_MAX];                /* Stash old bkpt addr contents */
   int status, pid;
   CORE_ADDR prev_pc;
 
@@ -267,15 +273,17 @@ exec_one_dummy_insn ()
      powerpc-ibm-aix4.1.3 works correctly).  */
   prev_pc = read_pc ();
   write_pc (DUMMY_INSN_ADDR);
-  ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE)1, 0, 0);
+  ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE) 1, 0, 0);
 
   if (errno)
     perror ("pt_continue");
 
-  do {
-    pid = wait (&status);
-  } while (pid != inferior_pid);
-    
+  do
+    {
+      pid = wait (&status);
+    }
+  while (pid != inferior_pid);
+
   write_pc (prev_pc);
   target_remove_breakpoint (DUMMY_INSN_ADDR, shadow_contents);
 }
@@ -295,22 +303,22 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
       memcpy (registers, core_reg_sect, 32 * 4);
 
       /* gdb's internal register template and bfd's register section layout
-        should share a common include file. FIXMEmgo */
+         should share a common include file. FIXMEmgo */
       /* then comes special registes. They are supposed to be in the same
-        order in gdb template and bfd `.reg' section. */
+         order in gdb template and bfd `.reg' section. */
       core_reg_sect += (32 * 4);
-      memcpy (&registers [REGISTER_BYTE (FIRST_UISA_SP_REGNUM)], 
-             core_reg_sect, 
+      memcpy (&registers[REGISTER_BYTE (FIRST_UISA_SP_REGNUM)],
+             core_reg_sect,
              (LAST_UISA_SP_REGNUM - FIRST_UISA_SP_REGNUM + 1) * 4);
     }
 
   /* fetch floating point registers from register section 2 in core bfd. */
   else if (which == 2)
-    memcpy (&registers [REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 32 * 8);
+    memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 32 * 8);
 
   else
-    fprintf_unfiltered 
-      (gdb_stderr, 
+    fprintf_unfiltered
+      (gdb_stderr,
        "Gdb error: unknown parameter to fetch_core_registers().\n");
 }
 \f
@@ -323,13 +331,13 @@ vmap_symtab (vp)
   register struct objfile *objfile;
   struct section_offsets *new_offsets;
   int i;
-  
+
   objfile = vp->objfile;
   if (objfile == NULL)
     {
       /* OK, it's not an objfile we opened ourselves.
-        Currently, that can only happen with the exec file, so
-        relocate the symbols for the symfile.  */
+         Currently, that can only happen with the exec file, so
+         relocate the symbols for the symfile.  */
       if (symfile_objfile == NULL)
        return;
       objfile = symfile_objfile;
@@ -341,7 +349,7 @@ vmap_symtab (vp)
 
   for (i = 0; i < objfile->num_sections; ++i)
     ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i);
-  
+
   /* The symbols in the object file are linked to the VMA of the section,
      relocate them VMA relative.  */
   ANOFFSET (new_offsets, SECT_OFF_TEXT) = vp->tstart - vp->tvma;
@@ -373,7 +381,7 @@ objfile_symbol_add (arg)
 
 static struct vmap *
 add_vmap (ldi)
-     register struct ld_info *ldi; 
+     register struct ld_info *ldi;
 {
   bfd *abfd, *last;
   register char *mem, *objname;
@@ -419,9 +427,9 @@ add_vmap (ldi)
          return 0;
        }
 
-      if (!bfd_check_format(last, bfd_object))
+      if (!bfd_check_format (last, bfd_object))
        {
-         bfd_close (last);     /* XXX???       */
+         bfd_close (last);     /* XXX???       */
          goto obj_err;
        }
 
@@ -433,13 +441,13 @@ add_vmap (ldi)
       bfd_close (abfd);
       error ("\"%s\": not in executable format: %s.",
             objname, bfd_errmsg (bfd_get_error ()));
-      /*NOTREACHED*/
+      /*NOTREACHED */
     }
   obj = allocate_objfile (vp->bfd, 0, 0, 0);
   vp->objfile = obj;
 
 #ifndef SOLIB_SYMBOLS_MANUAL
-  if (catch_errors (objfile_symbol_add, (char *)obj,
+  if (catch_errors (objfile_symbol_add, (char *) obj,
                    "Error while reading shared library symbols:\n",
                    RETURN_MASK_ALL))
     {
@@ -467,91 +475,93 @@ vmap_ldinfo (ldi)
      If so, update the mapping, and symbol table.
      If not, add an entry and symbol table.  */
 
-  do {
-    char *name = ldi->ldinfo_filename;
-    char *memb = name + strlen(name) + 1;
-
-    retried = 0;
-
-    if (fstat (ldi->ldinfo_fd, &ii) < 0)
-      {
-       /* The kernel sets ld_info to -1, if the process is still using the
-          object, and the object is removed. Keep the symbol info for the
-          removed object and issue a warning.  */
-       warning ("%s (fd=%d) has disappeared, keeping its symbols",
-                name, ldi->ldinfo_fd);
-        continue;
-      }
-  retry:
-    for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
-      {
-       struct objfile *objfile;
-
-       /* First try to find a `vp', which is the same as in ldinfo.
-          If not the same, just continue and grep the next `vp'. If same,
-          relocate its tstart, tend, dstart, dend values. If no such `vp'
-          found, get out of this for loop, add this ldi entry as a new vmap
-          (add_vmap) and come back, find its `vp' and so on... */
-
-       /* The filenames are not always sufficient to match on. */
-
-       if ((name[0] == '/' && !STREQ(name, vp->name))
-           || (memb[0] && !STREQ(memb, vp->member)))
+  do
+    {
+      char *name = ldi->ldinfo_filename;
+      char *memb = name + strlen (name) + 1;
+
+      retried = 0;
+
+      if (fstat (ldi->ldinfo_fd, &ii) < 0)
+       {
+         /* The kernel sets ld_info to -1, if the process is still using the
+            object, and the object is removed. Keep the symbol info for the
+            removed object and issue a warning.  */
+         warning ("%s (fd=%d) has disappeared, keeping its symbols",
+                  name, ldi->ldinfo_fd);
          continue;
+       }
+    retry:
+      for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
+       {
+         struct objfile *objfile;
 
-       /* See if we are referring to the same file.
-          We have to check objfile->obfd, symfile.c:reread_symbols might
-          have updated the obfd after a change.  */
-       objfile = vp->objfile == NULL ? symfile_objfile : vp->objfile;
-       if (objfile == NULL
-           || objfile->obfd == NULL
-           || bfd_stat (objfile->obfd, &vi) < 0)
-         {
-           warning ("Unable to stat %s, keeping its symbols", name);
+         /* First try to find a `vp', which is the same as in ldinfo.
+            If not the same, just continue and grep the next `vp'. If same,
+            relocate its tstart, tend, dstart, dend values. If no such `vp'
+            found, get out of this for loop, add this ldi entry as a new vmap
+            (add_vmap) and come back, find its `vp' and so on... */
+
+         /* The filenames are not always sufficient to match on. */
+
+         if ((name[0] == '/' && !STREQ (name, vp->name))
+             || (memb[0] && !STREQ (memb, vp->member)))
            continue;
-         }
 
-       if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
-         continue;
+         /* See if we are referring to the same file.
+            We have to check objfile->obfd, symfile.c:reread_symbols might
+            have updated the obfd after a change.  */
+         objfile = vp->objfile == NULL ? symfile_objfile : vp->objfile;
+         if (objfile == NULL
+             || objfile->obfd == NULL
+             || bfd_stat (objfile->obfd, &vi) < 0)
+           {
+             warning ("Unable to stat %s, keeping its symbols", name);
+             continue;
+           }
 
-       if (!retried)
-         close (ldi->ldinfo_fd);
+         if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
+           continue;
 
-       ++got_one;
+         if (!retried)
+           close (ldi->ldinfo_fd);
 
-       /* Found a corresponding VMAP.  Remap!  */
+         ++got_one;
 
-       /* We can assume pointer == CORE_ADDR, this code is native only.  */
-       vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg;
-       vp->tend   = vp->tstart + ldi->ldinfo_textsize;
-       vp->dstart = (CORE_ADDR) ldi->ldinfo_dataorg;
-       vp->dend   = vp->dstart + ldi->ldinfo_datasize;
+         /* Found a corresponding VMAP.  Remap!  */
 
-       /* The run time loader maps the file header in addition to the text
-          section and returns a pointer to the header in ldinfo_textorg.
-          Adjust the text start address to point to the real start address
-          of the text section.  */
-       vp->tstart += vp->toffs;
+         /* We can assume pointer == CORE_ADDR, this code is native only.  */
+         vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg;
+         vp->tend = vp->tstart + ldi->ldinfo_textsize;
+         vp->dstart = (CORE_ADDR) ldi->ldinfo_dataorg;
+         vp->dend = vp->dstart + ldi->ldinfo_datasize;
 
-       /* The objfile is only NULL for the exec file.  */
-       if (vp->objfile == NULL)
-         got_exec_file = 1;
+         /* The run time loader maps the file header in addition to the text
+            section and returns a pointer to the header in ldinfo_textorg.
+            Adjust the text start address to point to the real start address
+            of the text section.  */
+         vp->tstart += vp->toffs;
 
-       /* relocate symbol table(s). */
-       vmap_symtab (vp);
+         /* The objfile is only NULL for the exec file.  */
+         if (vp->objfile == NULL)
+           got_exec_file = 1;
 
-       /* There may be more, so we don't break out of the loop.  */
-      }
+         /* relocate symbol table(s). */
+         vmap_symtab (vp);
 
-    /* if there was no matching *vp, we must perforce create the sucker(s) */
-    if (!got_one && !retried)
-      {
-       add_vmap (ldi);
-       ++retried;
-       goto retry;
-      }
-  } while (ldi->ldinfo_next
-          && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
+         /* There may be more, so we don't break out of the loop.  */
+       }
+
+      /* if there was no matching *vp, we must perforce create the sucker(s) */
+      if (!got_one && !retried)
+       {
+         add_vmap (ldi);
+         ++retried;
+         goto retry;
+       }
+    }
+  while (ldi->ldinfo_next
+        && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
 
   /* If we don't find the symfile_objfile anywhere in the ldinfo, it
      is unlikely that the symbol file is relocated to the proper
@@ -581,7 +591,7 @@ symbols to the proper address).\n", gdb_stderr);
 
    `exec_sections' need to be relocated only once, as long as the exec
    file remains unchanged.
-*/
+ */
 
 static void
 vmap_exec ()
@@ -597,19 +607,19 @@ vmap_exec ()
   if (!vmap || !exec_ops.to_sections)
     error ("vmap_exec: vmap or exec_ops.to_sections == 0\n");
 
-  for (i=0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
+  for (i = 0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
     {
-      if (STREQ(".text", exec_ops.to_sections[i].the_bfd_section->name))
+      if (STREQ (".text", exec_ops.to_sections[i].the_bfd_section->name))
        {
          exec_ops.to_sections[i].addr += vmap->tstart - vmap->tvma;
          exec_ops.to_sections[i].endaddr += vmap->tstart - vmap->tvma;
        }
-      else if (STREQ(".data", exec_ops.to_sections[i].the_bfd_section->name))
+      else if (STREQ (".data", exec_ops.to_sections[i].the_bfd_section->name))
        {
          exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
          exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
        }
-      else if (STREQ(".bss", exec_ops.to_sections[i].the_bfd_section->name))
+      else if (STREQ (".bss", exec_ops.to_sections[i].the_bfd_section->name))
        {
          exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
          exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
@@ -617,18 +627,18 @@ vmap_exec ()
     }
 }
 \f
-/* xcoff_relocate_symtab -     hook for symbol table relocation.
+/* xcoff_relocate_symtab -      hook for symbol table relocation.
    also reads shared libraries.. */
 
 void
 xcoff_relocate_symtab (pid)
      unsigned int pid;
 {
-#define        MAX_LOAD_SEGS 64                /* maximum number of load segments */
+#define        MAX_LOAD_SEGS 64        /* maximum number of load segments */
 
   struct ld_info *ldi;
 
-  ldi = (void *) alloca(MAX_LOAD_SEGS * sizeof (*ldi));
+  ldi = (void *) alloca (MAX_LOAD_SEGS * sizeof (*ldi));
 
   /* According to my humble theory, AIX has some timing problems and
      when the user stack grows, kernel doesn't update stack info in time
@@ -639,7 +649,7 @@ xcoff_relocate_symtab (pid)
 
   errno = 0;
   ptrace (PT_LDINFO, pid, (PTRACE_ARG3_TYPE) ldi,
-         MAX_LOAD_SEGS * sizeof(*ldi), (int *) ldi);
+         MAX_LOAD_SEGS * sizeof (*ldi), (int *) ldi);
   if (errno)
     perror_with_name ("ptrace ldinfo");
 
@@ -675,13 +685,13 @@ xcoff_relocate_core (target)
   int buffer_size = LDINFO_SIZE;
   char *buffer = xmalloc (buffer_size);
   struct cleanup *old = make_cleanup (free_current_contents, &buffer);
-    
+
   /* FIXME, this restriction should not exist.  For now, though I'll
      avoid coredumps with error() pending a real fix.  */
   if (vmap == NULL)
     error
       ("Can't debug a core file without an executable file (on the RS/6000)");
-  
+
   ldinfo_sec = bfd_get_section_by_name (core_bfd, ".ldinfo");
   if (ldinfo_sec == NULL)
     {
@@ -715,13 +725,14 @@ xcoff_relocate_core (target)
            goto bfd_err;
          if (buffer[i++] == '\0')
            ++names_found;
-       } while (names_found < 2);
+       }
+      while (names_found < 2);
 
       ldip = (struct ld_info *) buffer;
 
       /* Can't use a file descriptor from the core file; need to open it.  */
       ldip->ldinfo_fd = -1;
-      
+
       /* The first ldinfo is for the exec file, allocated elsewhere.  */
       if (offset == 0)
        vp = vmap;
@@ -737,13 +748,13 @@ xcoff_relocate_core (target)
       vp->dend = vp->dstart + ldip->ldinfo_datasize;
 
       /* The run time loader maps the file header in addition to the text
-        section and returns a pointer to the header in ldinfo_textorg.
-        Adjust the text start address to point to the real start address
-        of the text section.  */
+         section and returns a pointer to the header in ldinfo_textorg.
+         Adjust the text start address to point to the real start address
+         of the text section.  */
       vp->tstart += vp->toffs;
 
       /* Unless this is the exec file,
-        add our sections to the section table for the core target.  */
+         add our sections to the section table for the core target.  */
       if (vp != vmap)
        {
          int count;
@@ -753,7 +764,7 @@ xcoff_relocate_core (target)
          /* We must update the to_sections field in the core_ops structure
             now to avoid dangling pointer dereferences.  */
          update_coreops = core_ops.to_sections == target->to_sections;
-         
+
          count = target->to_sections_end - target->to_sections;
          count += 2;
          target->to_sections = (struct section_table *)
@@ -775,7 +786,7 @@ xcoff_relocate_core (target)
          stp->addr = vp->tstart;
          stp->endaddr = vp->tend;
          stp++;
-         
+
          stp->bfd = vp->bfd;
          stp->the_bfd_section = bfd_get_section_by_name (stp->bfd, ".data");
          stp->addr = vp->dstart;
@@ -783,7 +794,8 @@ xcoff_relocate_core (target)
        }
 
       vmap_symtab (vp);
-    } while (ldip->ldinfo_next != 0);
+    }
+  while (ldip->ldinfo_next != 0);
   vmap_exec ();
   breakpoint_re_set ();
   do_cleanups (old);
index b5554d72c33bf4014d98c093fc06a4629ccaa9bd..812e9a8eedcfc77a221ac4b24392ec42fdaa496c 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -33,12 +34,14 @@ extern int errno;
 
 /* Breakpoint shadows for the single step instructions will be kept here. */
 
-static struct sstep_breaks {
-  /* Address, or 0 if this is not in use.  */
-  CORE_ADDR address;
-  /* Shadow contents.  */
-  char data[4];
-} stepBreaks[2];
+static struct sstep_breaks
+  {
+    /* Address, or 0 if this is not in use.  */
+    CORE_ADDR address;
+    /* Shadow contents.  */
+    char data[4];
+  }
+stepBreaks[2];
 
 /* Hook for determining the TOC address when calling functions in the
    inferior under AIX. The initialization code in rs6000-nat.c sets
@@ -48,15 +51,15 @@ CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR)) = NULL;
 
 /* Static function prototypes */
 
-static CORE_ADDR branch_dest PARAMS ((int opcode, int instr, CORE_ADDR pc,
-                                     CORE_ADDR safety));
+     static CORE_ADDR branch_dest PARAMS ((int opcode, int instr, CORE_ADDR pc,
+                                          CORE_ADDR safety));
 
-static void frame_get_saved_regs PARAMS ((struct frame_info *fi,
-                                         struct rs6000_framedata *fdatap));
+     static void frame_get_saved_regs PARAMS ((struct frame_info * fi,
+                                        struct rs6000_framedata * fdatap));
 
-static void pop_dummy_frame PARAMS ((void));
+     static void pop_dummy_frame PARAMS ((void));
 
-static CORE_ADDR frame_initial_stack_address PARAMS ((struct frame_info *));
+     static CORE_ADDR frame_initial_stack_address PARAMS ((struct frame_info *));
 
 CORE_ADDR
 rs6000_skip_prologue (pc)
@@ -77,7 +80,7 @@ struct frame_extra_info
      r31 by gcc) in such cases. If a compiler emits traceback table,
      then we should use the alloca register specified in traceback
      table. FIXME. */
-  CORE_ADDR initial_sp;                        /* initial stack pointer. */
+  CORE_ADDR initial_sp;                /* initial stack pointer. */
 };
 
 void
@@ -85,7 +88,7 @@ rs6000_init_extra_frame_info (fromleaf, fi)
      int fromleaf;
      struct frame_info *fi;
 {
-  fi->extra_info = (struct frame_extra_info*)
+  fi->extra_info = (struct frame_extra_info *)
     frame_obstack_alloc (sizeof (struct frame_extra_info));
   fi->extra_info->initial_sp = 0;
   if (fi->next != (CORE_ADDR) 0
@@ -132,60 +135,63 @@ branch_dest (opcode, instr, pc, safety)
 
   absolute = (int) ((instr >> 1) & 1);
 
-  switch (opcode) {
-     case 18   :
-       immediate = ((instr & ~3) << 6) >> 6;   /* br unconditional */
-       if (absolute)
-         dest = immediate;     
-       else
-         dest = pc + immediate;
-       break;
-
-     case 16   :  
-        immediate = ((instr & ~3) << 16) >> 16;        /* br conditional */
-       if (absolute)
-         dest = immediate;     
-       else
-         dest = pc + immediate;
-       break;
-
-      case 19  :
-       ext_op = (instr>>1) & 0x3ff;
-
-       if (ext_op == 16)                       /* br conditional register */
-         {
+  switch (opcode)
+    {
+    case 18:
+      immediate = ((instr & ~3) << 6) >> 6;    /* br unconditional */
+      if (absolute)
+       dest = immediate;
+      else
+       dest = pc + immediate;
+      break;
+
+    case 16:
+      immediate = ((instr & ~3) << 16) >> 16;  /* br conditional */
+      if (absolute)
+       dest = immediate;
+      else
+       dest = pc + immediate;
+      break;
+
+    case 19:
+      ext_op = (instr >> 1) & 0x3ff;
+
+      if (ext_op == 16)                /* br conditional register */
+       {
+         dest = read_register (LR_REGNUM) & ~3;
+
+         /* If we are about to return from a signal handler, dest is
+            something like 0x3c90.  The current frame is a signal handler
+            caller frame, upon completion of the sigreturn system call
+            execution will return to the saved PC in the frame.  */
+         if (dest < TEXT_SEGMENT_BASE)
+           {
+             struct frame_info *fi;
+
+             fi = get_current_frame ();
+             if (fi != NULL)
+               dest = read_memory_integer (fi->frame + SIG_FRAME_PC_OFFSET,
+                                           4);
+           }
+       }
+
+      else if (ext_op == 528)  /* br cond to count reg */
+       {
+         dest = read_register (CTR_REGNUM) & ~3;
+
+         /* If we are about to execute a system call, dest is something
+            like 0x22fc or 0x3b00.  Upon completion the system call
+            will return to the address in the link register.  */
+         if (dest < TEXT_SEGMENT_BASE)
            dest = read_register (LR_REGNUM) & ~3;
+       }
+      else
+       return -1;
+      break;
 
-           /* If we are about to return from a signal handler, dest is
-              something like 0x3c90.  The current frame is a signal handler
-              caller frame, upon completion of the sigreturn system call
-              execution will return to the saved PC in the frame.  */
-           if (dest < TEXT_SEGMENT_BASE)
-             {
-               struct frame_info *fi;
-
-               fi = get_current_frame ();
-               if (fi != NULL)
-                 dest = read_memory_integer (fi->frame + SIG_FRAME_PC_OFFSET,
-                                             4);
-             }
-         }
-
-       else if (ext_op == 528)                 /* br cond to count reg */
-         {
-           dest = read_register (CTR_REGNUM) & ~3;
-
-           /* If we are about to execute a system call, dest is something
-              like 0x22fc or 0x3b00.  Upon completion the system call
-              will return to the address in the link register.  */
-           if (dest < TEXT_SEGMENT_BASE)
-             dest = read_register (LR_REGNUM) & ~3;
-         }
-       else return -1; 
-       break;
-       
-       default: return -1;
-  }
+    default:
+      return -1;
+    }
   return (dest < TEXT_SEGMENT_BASE) ? safety : dest;
 }
 
@@ -227,45 +233,49 @@ rs6000_software_single_step (signal, insert_breakpoints_p)
   CORE_ADDR breaks[2];
   int opcode;
 
-  if (insert_breakpoints_p) {
+  if (insert_breakpoints_p)
+    {
 
-    loc = read_pc ();
+      loc = read_pc ();
 
-    insn = read_memory_integer (loc, 4);
+      insn = read_memory_integer (loc, 4);
 
-    breaks[0] = loc + INSNLEN(insn);
-    opcode = insn >> 26;
-    breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
+      breaks[0] = loc + INSNLEN (insn);
+      opcode = insn >> 26;
+      breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
 
-    /* Don't put two breakpoints on the same address. */
-    if (breaks[1] == breaks[0])
-      breaks[1] = -1;
+      /* Don't put two breakpoints on the same address. */
+      if (breaks[1] == breaks[0])
+       breaks[1] = -1;
 
-    stepBreaks[1].address = 0;
+      stepBreaks[1].address = 0;
 
-    for (ii=0; ii < 2; ++ii) {
+      for (ii = 0; ii < 2; ++ii)
+       {
 
-      /* ignore invalid breakpoint. */
-      if ( breaks[ii] == -1)
-        continue;
+         /* ignore invalid breakpoint. */
+         if (breaks[ii] == -1)
+           continue;
 
-      read_memory (breaks[ii], stepBreaks[ii].data, 4);
+         read_memory (breaks[ii], stepBreaks[ii].data, 4);
 
-      write_memory (breaks[ii], breakp, 4);
-      stepBreaks[ii].address = breaks[ii];
-    }  
+         write_memory (breaks[ii], breakp, 4);
+         stepBreaks[ii].address = breaks[ii];
+       }
 
-  } else {
+    }
+  else
+    {
 
-    /* remove step breakpoints. */
-    for (ii=0; ii < 2; ++ii)
-      if (stepBreaks[ii].address != 0)
-        write_memory 
-           (stepBreaks[ii].address, stepBreaks[ii].data, 4);
+      /* remove step breakpoints. */
+      for (ii = 0; ii < 2; ++ii)
+       if (stepBreaks[ii].address != 0)
+         write_memory
+           (stepBreaks[ii].address, stepBreaks[ii].data, 4);
 
-  }
+    }
   errno = 0;                   /* FIXME, don't ignore errors! */
-                       /* What errors?  {read,write}_memory call error().  */
+  /* What errors?  {read,write}_memory call error().  */
 }
 
 
@@ -273,19 +283,19 @@ rs6000_software_single_step (signal, insert_breakpoints_p)
    information about a function frame.
 
    in struct rs6000_framedata fdata:
-    - frameless is TRUE, if function does not have a frame.
-    - nosavedpc is TRUE, if function does not save %pc value in its frame.
-    - offset is the initial size of this stack frame --- the amount by
-      which we decrement the sp to allocate the frame.
-    - saved_gpr is the number of the first saved gpr.
-    - saved_fpr is the number of the first saved fpr.
-    - 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.
-    - lr_offset is the offset of the saved lr
-    - cr_offset is the offset of the saved cr
-*/
+   - frameless is TRUE, if function does not have a frame.
+   - nosavedpc is TRUE, if function does not save %pc value in its frame.
+   - offset is the initial size of this stack frame --- the amount by
+   which we decrement the sp to allocate the frame.
+   - saved_gpr is the number of the first saved gpr.
+   - saved_fpr is the number of the first saved fpr.
+   - 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.
+   - lr_offset is the offset of the saved lr
+   - cr_offset is the offset of the saved cr
+ */
 
 #define SIGNED_SHORT(x)                                                \
   ((sizeof (short) == 2)                                               \
@@ -297,7 +307,7 @@ rs6000_software_single_step (signal, insert_breakpoints_p)
 CORE_ADDR
 skip_prologue (pc, fdata)
      CORE_ADDR pc;
-     struct rs6000_framedata *fdata; 
+     struct rs6000_framedata *fdata;
 {
   CORE_ADDR orig_pc = pc;
   char buf[4];
@@ -327,148 +337,191 @@ skip_prologue (pc, fdata)
       pc += 4;
       op = read_memory_integer (pc, 4);
 
-      if ((op & 0xfc1fffff) == 0x7c0802a6) {           /* mflr Rx */
-       lr_reg = (op & 0x03e00000) | 0x90010000;
-       continue;
+      if ((op & 0xfc1fffff) == 0x7c0802a6)
+       {                       /* mflr Rx */
+         lr_reg = (op & 0x03e00000) | 0x90010000;
+         continue;
 
-      } else if ((op & 0xfc1fffff) == 0x7c000026) {    /* mfcr Rx */
-       cr_reg = (op & 0x03e00000) | 0x90010000;
-       continue;
+       }
+      else if ((op & 0xfc1fffff) == 0x7c000026)
+       {                       /* mfcr Rx */
+         cr_reg = (op & 0x03e00000) | 0x90010000;
+         continue;
 
-      } else if ((op & 0xfc1f0000) == 0xd8010000) {    /* stfd Rx,NUM(r1) */
-       reg = GET_SRC_REG (op);
-       if (fdata->saved_fpr == -1 || fdata->saved_fpr > reg) {
-         fdata->saved_fpr = reg;
-         fdata->fpr_offset = SIGNED_SHORT (op) + offset;
        }
-       continue;
+      else if ((op & 0xfc1f0000) == 0xd8010000)
+       {                       /* stfd Rx,NUM(r1) */
+         reg = GET_SRC_REG (op);
+         if (fdata->saved_fpr == -1 || fdata->saved_fpr > reg)
+           {
+             fdata->saved_fpr = reg;
+             fdata->fpr_offset = SIGNED_SHORT (op) + offset;
+           }
+         continue;
 
-      } else if (((op & 0xfc1f0000) == 0xbc010000) ||  /* stm Rx, NUM(r1) */
-                ((op & 0xfc1f0000) == 0x90010000 &&    /* st rx,NUM(r1), 
+       }
+      else if (((op & 0xfc1f0000) == 0xbc010000) ||    /* stm Rx, NUM(r1) */
+              ((op & 0xfc1f0000) == 0x90010000 &&      /* st rx,NUM(r1), 
                                                           rx >= r13 */
-                 (op & 0x03e00000) >= 0x01a00000)) {
+               (op & 0x03e00000) >= 0x01a00000))
+       {
+
+         reg = GET_SRC_REG (op);
+         if (fdata->saved_gpr == -1 || fdata->saved_gpr > reg)
+           {
+             fdata->saved_gpr = reg;
+             fdata->gpr_offset = SIGNED_SHORT (op) + offset;
+           }
+         continue;
 
-       reg = GET_SRC_REG (op);
-       if (fdata->saved_gpr == -1 || fdata->saved_gpr > reg) {
-         fdata->saved_gpr = reg;
-         fdata->gpr_offset = SIGNED_SHORT (op) + offset;
        }
-       continue;
-
-      } else if ((op & 0xffff0000) == 0x3c000000) {    /* addis 0,0,NUM, used
-                                                          for >= 32k frames */
-       fdata->offset = (op & 0x0000ffff) << 16;
-       fdata->frameless = 0;
-       continue;
-
-      } else if ((op & 0xffff0000) == 0x60000000) {    /* ori 0,0,NUM, 2nd ha
-                                                          lf of >= 32k frames */
-       fdata->offset |= (op & 0x0000ffff);
-       fdata->frameless = 0;
-       continue;
-
-      } else if ((op & 0xffff0000) == lr_reg) {                /* st Rx,NUM(r1) 
-                                                          where Rx == lr */
-       fdata->lr_offset = SIGNED_SHORT (op) + offset;
-       fdata->nosavedpc = 0;
-       lr_reg = 0;
-       continue;
-
-      } else if ((op & 0xffff0000) == cr_reg) {                /* st Rx,NUM(r1) 
-                                                          where Rx == cr */
-       fdata->cr_offset = SIGNED_SHORT (op) + offset;
-       cr_reg = 0;
-       continue;
-
-      } else if (op == 0x48000005) {                   /* bl .+4 used in 
-                                                          -mrelocatable */
-       continue;
-
-      } else if (op == 0x48000004) {                   /* b .+4 (xlc) */
-       break;
-
-      } else if (((op & 0xffff0000) == 0x801e0000 ||   /* lwz 0,NUM(r30), used
-                                                          in V.4 -mrelocatable */
-                 op == 0x7fc0f214) &&                  /* add r30,r0,r30, used
+      else if ((op & 0xffff0000) == 0x3c000000)
+       {                       /* addis 0,0,NUM, used
+                                  for >= 32k frames */
+         fdata->offset = (op & 0x0000ffff) << 16;
+         fdata->frameless = 0;
+         continue;
+
+       }
+      else if ((op & 0xffff0000) == 0x60000000)
+       {                       /* ori 0,0,NUM, 2nd ha
+                                  lf of >= 32k frames */
+         fdata->offset |= (op & 0x0000ffff);
+         fdata->frameless = 0;
+         continue;
+
+       }
+      else if ((op & 0xffff0000) == lr_reg)
+       {                       /* st Rx,NUM(r1) 
+                                  where Rx == lr */
+         fdata->lr_offset = SIGNED_SHORT (op) + offset;
+         fdata->nosavedpc = 0;
+         lr_reg = 0;
+         continue;
+
+       }
+      else if ((op & 0xffff0000) == cr_reg)
+       {                       /* st Rx,NUM(r1) 
+                                  where Rx == cr */
+         fdata->cr_offset = SIGNED_SHORT (op) + offset;
+         cr_reg = 0;
+         continue;
+
+       }
+      else if (op == 0x48000005)
+       {                       /* bl .+4 used in 
+                                  -mrelocatable */
+         continue;
+
+       }
+      else if (op == 0x48000004)
+       {                       /* b .+4 (xlc) */
+         break;
+
+       }
+      else if (((op & 0xffff0000) == 0x801e0000 ||     /* lwz 0,NUM(r30), used
                                                           in V.4 -mrelocatable */
-                lr_reg == 0x901e0000) {
-       continue;
+               op == 0x7fc0f214) &&    /* add r30,r0,r30, used
+                                          in V.4 -mrelocatable */
+              lr_reg == 0x901e0000)
+       {
+         continue;
 
-      } else if ((op & 0xffff0000) == 0x3fc00000 ||    /* addis 30,0,foo@ha, used
+       }
+      else if ((op & 0xffff0000) == 0x3fc00000 ||      /* addis 30,0,foo@ha, used
                                                           in V.4 -mminimal-toc */
-                (op & 0xffff0000) == 0x3bde0000) {     /* addi 30,30,foo@l */
-       continue;
+              (op & 0xffff0000) == 0x3bde0000)
+       {                       /* addi 30,30,foo@l */
+         continue;
 
-      } else if ((op & 0xfc000001) == 0x48000001) {    /* bl foo, 
-                                                          to save fprs??? */
+       }
+      else if ((op & 0xfc000001) == 0x48000001)
+       {                       /* bl foo, 
+                                  to save fprs??? */
 
-       fdata->frameless = 0;
-       /* Don't skip over the subroutine call if it is not within the first
-          three instructions of the prologue.  */
-       if ((pc - orig_pc) > 8)
-         break;
+         fdata->frameless = 0;
+         /* Don't skip over the subroutine call if it is not within the first
+            three instructions of the prologue.  */
+         if ((pc - orig_pc) > 8)
+           break;
 
-       op = read_memory_integer (pc+4, 4);
-
-       /* At this point, make sure this is not a trampoline function
-          (a function that simply calls another functions, and nothing else).
-          If the next is not a nop, this branch was part of the function
-          prologue. */
-
-       if (op == 0x4def7b82 || op == 0)                /* crorc 15, 15, 15 */
-         break;                                        /* don't skip over 
-                                                          this branch */
-       continue;
-
-      /* update stack pointer */
-      } else if ((op & 0xffff0000) == 0x94210000) {    /* stu r1,NUM(r1) */
-       fdata->frameless = 0;
-       fdata->offset = SIGNED_SHORT (op);
-       offset = fdata->offset;
-       continue;
-
-      } else if (op == 0x7c21016e) {                   /* stwux 1,1,0 */
-       fdata->frameless = 0;
-       offset = fdata->offset;
-       continue;
-
-      /* Load up minimal toc pointer */
-      } else if ((op >> 22) == 0x20f
-                && ! minimal_toc_loaded) {     /* l r31,... or l r30,... */
-       minimal_toc_loaded = 1;
-       continue;
-
-      /* store parameters in stack */
-      } else if ((op & 0xfc1f0000) == 0x90010000 ||    /* st rx,NUM(r1) */
-                (op & 0xfc1f0000) == 0xd8010000 ||     /* stfd Rx,NUM(r1) */
-                (op & 0xfc1f0000) == 0xfc010000) {     /* frsp, fp?,NUM(r1) */
-       continue;
-
-      /* store parameters in stack via frame pointer */
-      } else if (framep &&
-                ((op & 0xfc1f0000) == 0x901f0000 ||    /* st rx,NUM(r1) */
-                (op & 0xfc1f0000) == 0xd81f0000 ||     /* stfd Rx,NUM(r1) */
-                (op & 0xfc1f0000) == 0xfc1f0000)) {    /* frsp, fp?,NUM(r1) */
-       continue;
-
-      /* Set up frame pointer */
-      } else if (op == 0x603f0000                      /* oril r31, r1, 0x0 */
-                || op == 0x7c3f0b78) {                 /* mr r31, r1 */
-       fdata->frameless = 0;
-       framep = 1;
-       fdata->alloca_reg = 31;
-       continue;
-
-      /* Another way to set up the frame pointer.  */
-      } else if ((op & 0xfc1fffff) == 0x38010000) {    /* addi rX, r1, 0x0 */
-       fdata->frameless = 0;
-       framep = 1;
-       fdata->alloca_reg = (op & ~0x38010000) >> 21;
-       continue;
-
-      } else {
-       break;
-      }
+         op = read_memory_integer (pc + 4, 4);
+
+         /* At this point, make sure this is not a trampoline function
+            (a function that simply calls another functions, and nothing else).
+            If the next is not a nop, this branch was part of the function
+            prologue. */
+
+         if (op == 0x4def7b82 || op == 0)      /* crorc 15, 15, 15 */
+           break;              /* don't skip over 
+                                  this branch */
+         continue;
+
+         /* update stack pointer */
+       }
+      else if ((op & 0xffff0000) == 0x94210000)
+       {                       /* stu r1,NUM(r1) */
+         fdata->frameless = 0;
+         fdata->offset = SIGNED_SHORT (op);
+         offset = fdata->offset;
+         continue;
+
+       }
+      else if (op == 0x7c21016e)
+       {                       /* stwux 1,1,0 */
+         fdata->frameless = 0;
+         offset = fdata->offset;
+         continue;
+
+         /* Load up minimal toc pointer */
+       }
+      else if ((op >> 22) == 0x20f
+              && !minimal_toc_loaded)
+       {                       /* l r31,... or l r30,... */
+         minimal_toc_loaded = 1;
+         continue;
+
+         /* store parameters in stack */
+       }
+      else if ((op & 0xfc1f0000) == 0x90010000 ||      /* st rx,NUM(r1) */
+              (op & 0xfc1f0000) == 0xd8010000 ||       /* stfd Rx,NUM(r1) */
+              (op & 0xfc1f0000) == 0xfc010000)
+       {                       /* frsp, fp?,NUM(r1) */
+         continue;
+
+         /* store parameters in stack via frame pointer */
+       }
+      else if (framep &&
+              ((op & 0xfc1f0000) == 0x901f0000 ||      /* st rx,NUM(r1) */
+               (op & 0xfc1f0000) == 0xd81f0000 ||      /* stfd Rx,NUM(r1) */
+               (op & 0xfc1f0000) == 0xfc1f0000))
+       {                       /* frsp, fp?,NUM(r1) */
+         continue;
+
+         /* Set up frame pointer */
+       }
+      else if (op == 0x603f0000        /* oril r31, r1, 0x0 */
+              || op == 0x7c3f0b78)
+       {                       /* mr r31, r1 */
+         fdata->frameless = 0;
+         framep = 1;
+         fdata->alloca_reg = 31;
+         continue;
+
+         /* Another way to set up the frame pointer.  */
+       }
+      else if ((op & 0xfc1fffff) == 0x38010000)
+       {                       /* addi rX, r1, 0x0 */
+         fdata->frameless = 0;
+         framep = 1;
+         fdata->alloca_reg = (op & ~0x38010000) >> 21;
+         continue;
+
+       }
+      else
+       {
+         break;
+       }
     }
 
 #if 0
@@ -481,24 +534,26 @@ skip_prologue (pc, fdata)
      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. */
-     
 
-  if ((op & 0xfc000001) == 0x48000001) { /* bl foo, an initializer function? */
-    op = read_memory_integer (pc+4, 4);
 
-    if (op == 0x4def7b82) {            /* cror 0xf, 0xf, 0xf (nop) */
+  if ((op & 0xfc000001) == 0x48000001)
+    {                          /* bl foo, an initializer function? */
+      op = read_memory_integer (pc + 4, 4);
 
-      /* check and see if we are in main. If so, skip over this initializer
-         function as well. */
+      if (op == 0x4def7b82)
+       {                       /* cror 0xf, 0xf, 0xf (nop) */
 
-      tmp = find_pc_misc_function (pc);
-      if (tmp >= 0 && STREQ (misc_function_vector [tmp].name, "main"))
-        return pc + 8;
+         /* 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"))
+           return pc + 8;
+       }
     }
-  }
 #endif /* 0 */
-  fdata->offset = - fdata->offset;
+
+  fdata->offset = -fdata->offset;
   return pc;
 }
 
@@ -510,12 +565,12 @@ skip_prologue (pc, fdata)
 
 /* The total size of dummy frame is 436, which is;
 
-       32 gpr's        - 128 bytes
-       32 fpr's        - 256   "
-       7  the rest     - 28    "
-       and 24 extra bytes for the callee's link area. The last 24 bytes
-       for the link area might not be necessary, since it will be taken
-       care of by push_arguments(). */
+   32 gpr's     - 128 bytes
+   32 fpr's     - 256   "
+   7  the rest  - 28    "
+   and 24 extra bytes for the callee's link area. The last 24 bytes
+   for the link area might not be necessary, since it will be taken
+   care of by push_arguments(). */
 
 #define DUMMY_FRAME_SIZE 436
 
@@ -532,7 +587,7 @@ extern int stop_stack_dummy;
 
 /* push a dummy frame into stack, save all register. Currently we are saving
    only gpr's and fpr's, which is not good enough! FIXMEmgo */
-   
+
 void
 push_dummy_frame ()
 {
@@ -545,7 +600,7 @@ push_dummy_frame ()
   CORE_ADDR pc;
   /* Same thing, target byte order.  */
   char pc_targ[4];
-  
+
   /* Needed to figure out where to save the dummy link area.
      FIXME: There should be an easier way to do this, no?  tiemann 9/9/95.  */
   struct rs6000_framedata fdata;
@@ -554,23 +609,24 @@ push_dummy_frame ()
 
   target_fetch_registers (-1);
 
-  if (dummy_frame_count >= dummy_frame_size) {
-    dummy_frame_size += DUMMY_FRAME_ADDR_SIZE;
-    if (dummy_frame_addr)
-      dummy_frame_addr = (CORE_ADDR*) xrealloc 
-        (dummy_frame_addr, sizeof(CORE_ADDR) * (dummy_frame_size));
-    else
-      dummy_frame_addr = (CORE_ADDR*) 
-       xmalloc (sizeof(CORE_ADDR) * (dummy_frame_size));
-  }
-  
-  sp = read_register(SP_REGNUM);
-  pc = read_register(PC_REGNUM);
+  if (dummy_frame_count >= dummy_frame_size)
+    {
+      dummy_frame_size += DUMMY_FRAME_ADDR_SIZE;
+      if (dummy_frame_addr)
+       dummy_frame_addr = (CORE_ADDR *) xrealloc
+         (dummy_frame_addr, sizeof (CORE_ADDR) * (dummy_frame_size));
+      else
+       dummy_frame_addr = (CORE_ADDR *)
+         xmalloc (sizeof (CORE_ADDR) * (dummy_frame_size));
+    }
+
+  sp = read_register (SP_REGNUM);
+  pc = read_register (PC_REGNUM);
   store_address (pc_targ, 4, pc);
 
   skip_prologue (get_pc_function_start (pc), &fdata);
 
-  dummy_frame_addr [dummy_frame_count++] = sp;
+  dummy_frame_addr[dummy_frame_count++] = sp;
 
   /* Be careful! If the stack pointer is not decremented first, then kernel 
      thinks he is free to use the space underneath it. And kernel actually 
@@ -582,7 +638,7 @@ push_dummy_frame ()
      This is a problem on the ppc simulator (which only grants one page
      (4096 bytes) by default.  */
 
-  write_register (SP_REGNUM, sp-DUMMY_FRAME_SIZE);
+  write_register (SP_REGNUM, sp - DUMMY_FRAME_SIZE);
 
   /* gdb relies on the state of current_frame. We'd better update it,
      otherwise things like do_registers_info() wouldn't work properly! */
@@ -591,33 +647,34 @@ push_dummy_frame ()
 
   /* save program counter in link register's space. */
   write_memory (sp + (fdata.lr_offset ? fdata.lr_offset : DEFAULT_LR_SAVE),
-               pc_targ, 4);
+               pc_targ, 4);
 
   /* save all floating point and general purpose registers here. */
 
   /* fpr's, f0..f31 */
   for (ii = 0; ii < 32; ++ii)
-    write_memory (sp-8-(ii*8), &registers[REGISTER_BYTE (31-ii+FP0_REGNUM)], 8);
+    write_memory (sp - 8 - (ii * 8), &registers[REGISTER_BYTE (31 - ii + FP0_REGNUM)], 8);
 
   /* gpr's r0..r31 */
-  for (ii=1; ii <=32; ++ii)
-    write_memory (sp-256-(ii*4), &registers[REGISTER_BYTE (32-ii)], 4);
+  for (ii = 1; ii <= 32; ++ii)
+    write_memory (sp - 256 - (ii * 4), &registers[REGISTER_BYTE (32 - ii)], 4);
 
   /* so far, 32*2 + 32 words = 384 bytes have been written. 
      7 extra registers in our register set: pc, ps, cnd, lr, cnt, xer, mq */
 
-  for (ii=1; ii <= (LAST_UISA_SP_REGNUM-FIRST_UISA_SP_REGNUM+1); ++ii) {
-    write_memory (sp-384-(ii*4), 
-                 &registers[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4);
-  }
+  for (ii = 1; ii <= (LAST_UISA_SP_REGNUM - FIRST_UISA_SP_REGNUM + 1); ++ii)
+    {
+      write_memory (sp - 384 - (ii * 4),
+                   &registers[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4);
+    }
 
   /* Save sp or so called back chain right here. */
   store_address (sp_targ, 4, sp);
-  write_memory (sp-DUMMY_FRAME_SIZE, sp_targ, 4);
+  write_memory (sp - DUMMY_FRAME_SIZE, sp_targ, 4);
   sp -= DUMMY_FRAME_SIZE;
 
   /* And finally, this is the back chain. */
-  write_memory (sp+8, pc_targ, 4);
+  write_memory (sp + 8, pc_targ, 4);
 }
 
 
@@ -634,42 +691,43 @@ push_dummy_frame ()
    detect that was a dummy frame, we pop it back to its parent by using
    dummy frame stack (`dummy_frame_addr' array). 
 
-FIXME:  This whole concept is broken.  You should be able to detect
-a dummy stack frame *on the user's stack itself*.  When you do,
-then you know the format of that stack frame -- including its
-saved SP register!  There should *not* be a separate stack in the
-GDB process that keeps track of these dummy frames!  -- gnu@cygnus.com Aug92
+   FIXME:  This whole concept is broken.  You should be able to detect
+   a dummy stack frame *on the user's stack itself*.  When you do,
+   then you know the format of that stack frame -- including its
+   saved SP register!  There should *not* be a separate stack in the
+   GDB process that keeps track of these dummy frames!  -- gnu@cygnus.com Aug92
  */
-   
+
 static void
 pop_dummy_frame ()
 {
   CORE_ADDR sp, pc;
   int ii;
-  sp = dummy_frame_addr [--dummy_frame_count];
+  sp = dummy_frame_addr[--dummy_frame_count];
 
   /* restore all fpr's. */
   for (ii = 1; ii <= 32; ++ii)
-    read_memory (sp-(ii*8), &registers[REGISTER_BYTE (32-ii+FP0_REGNUM)], 8);
+    read_memory (sp - (ii * 8), &registers[REGISTER_BYTE (32 - ii + FP0_REGNUM)], 8);
 
   /* restore all gpr's */
-  for (ii=1; ii <= 32; ++ii) {
-    read_memory (sp-256-(ii*4), &registers[REGISTER_BYTE (32-ii)], 4);
-  }
+  for (ii = 1; ii <= 32; ++ii)
+    {
+      read_memory (sp - 256 - (ii * 4), &registers[REGISTER_BYTE (32 - ii)], 4);
+    }
 
   /* restore the rest of the registers. */
-  for (ii=1; ii <=(LAST_UISA_SP_REGNUM-FIRST_UISA_SP_REGNUM+1); ++ii)
-    read_memory (sp-384-(ii*4),
-               &registers[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4);
+  for (ii = 1; ii <= (LAST_UISA_SP_REGNUM - FIRST_UISA_SP_REGNUM + 1); ++ii)
+    read_memory (sp - 384 - (ii * 4),
+                &registers[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4);
 
-  read_memory (sp-(DUMMY_FRAME_SIZE-8), 
-              &registers [REGISTER_BYTE(PC_REGNUM)], 4);
+  read_memory (sp - (DUMMY_FRAME_SIZE - 8),
+              &registers[REGISTER_BYTE (PC_REGNUM)], 4);
 
   /* when a dummy frame was being pushed, we had to decrement %sp first, in 
      order to secure astack space. Thus, saved %sp (or %r1) value, is not the
      one we should restore. Change it with the one we need. */
 
-  memcpy (&registers [REGISTER_BYTE(FP_REGNUM)], (char *) &sp, sizeof (int));
+  memcpy (&registers[REGISTER_BYTE (FP_REGNUM)], (char *) &sp, sizeof (int));
 
   /* Now we can restore all registers. */
 
@@ -684,7 +742,7 @@ pop_dummy_frame ()
 void
 pop_frame ()
 {
-  CORE_ADDR pc, lr, sp, prev_sp;               /* %pc, %lr, %sp */
+  CORE_ADDR pc, lr, sp, prev_sp;       /* %pc, %lr, %sp */
   struct rs6000_framedata fdata;
   struct frame_info *frame = get_current_frame ();
   int addr, ii;
@@ -702,7 +760,7 @@ pop_frame ()
        }
       else
        {
-         if (dummy_frame_count) 
+         if (dummy_frame_count)
            pop_dummy_frame ();
          return;
        }
@@ -735,19 +793,21 @@ pop_frame ()
   if (fdata.saved_gpr != -1)
     {
       addr = prev_sp + fdata.gpr_offset;
-      for (ii = fdata.saved_gpr; ii <= 31; ++ii) {
-       read_memory (addr, &registers [REGISTER_BYTE (ii)], 4);
-       addr += 4;
-      }
+      for (ii = fdata.saved_gpr; ii <= 31; ++ii)
+       {
+         read_memory (addr, &registers[REGISTER_BYTE (ii)], 4);
+         addr += 4;
+       }
     }
 
   if (fdata.saved_fpr != -1)
     {
       addr = prev_sp + fdata.fpr_offset;
-      for (ii = fdata.saved_fpr; ii <= 31; ++ii) {
-       read_memory (addr, &registers [REGISTER_BYTE (ii+FP0_REGNUM)], 8);
-       addr += 8;
-      }
+      for (ii = fdata.saved_fpr; ii <= 31; ++ii)
+       {
+         read_memory (addr, &registers[REGISTER_BYTE (ii + FP0_REGNUM)], 8);
+         addr += 8;
+       }
     }
 
   write_register (SP_REGNUM, prev_sp);
@@ -779,23 +839,23 @@ rs6000_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
       CORE_ADDR tocvalue;
 
       tocvalue = (*find_toc_address_hook) (fun);
-      ii  = *(int*)((char*)dummyname + TOC_ADDR_OFFSET);
+      ii = *(int *) ((char *) dummyname + TOC_ADDR_OFFSET);
       ii = (ii & 0xffff0000) | (tocvalue >> 16);
-      *(int*)((char*)dummyname + TOC_ADDR_OFFSET) = ii;
+      *(int *) ((char *) dummyname + TOC_ADDR_OFFSET) = ii;
 
-      ii  = *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4);
+      ii = *(int *) ((char *) dummyname + TOC_ADDR_OFFSET + 4);
       ii = (ii & 0xffff0000) | (tocvalue & 0x0000ffff);
-      *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4) = ii;
+      *(int *) ((char *) dummyname + TOC_ADDR_OFFSET + 4) = ii;
     }
 
   target_addr = fun;
-  ii  = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET);
+  ii = *(int *) ((char *) dummyname + TARGET_ADDR_OFFSET);
   ii = (ii & 0xffff0000) | (target_addr >> 16);
-  *(int*)((char*)dummyname + TARGET_ADDR_OFFSET) = ii;
+  *(int *) ((char *) dummyname + TARGET_ADDR_OFFSET) = ii;
 
-  ii  = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4);
+  ii = *(int *) ((char *) dummyname + TARGET_ADDR_OFFSET + 4);
   ii = (ii & 0xffff0000) | (target_addr & 0x0000ffff);
-  *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4) = ii;
+  *(int *) ((char *) dummyname + TARGET_ADDR_OFFSET + 4) = ii;
 }
 
 /* Pass the arguments in either registers, or in the stack. In RS6000,
@@ -821,10 +881,10 @@ rs6000_push_arguments (nargs, args, sp, struct_return, struct_addr)
 {
   int ii;
   int len = 0;
-  int argno;                                   /* current argument number */
-  int argbytes;                                        /* current argument byte */
-  char tmp_buffer [50];
-  int f_argno = 0;                             /* current floating point argno */
+  int argno;                   /* current argument number */
+  int argbytes;                        /* current argument byte */
+  char tmp_buffer[50];
+  int f_argno = 0;             /* current floating point argno */
 
   value_ptr arg = 0;
   struct type *type;
@@ -845,71 +905,76 @@ rs6000_push_arguments (nargs, args, sp, struct_return, struct_addr)
      case we should advance one word and start from r4 register to copy 
      parameters. */
 
-  ii =  struct_return ? 1 : 0;
+  ii = struct_return ? 1 : 0;
 
 /* 
-effectively indirect call... gcc does...
-
-return_val example( float, int);
-
-eabi: 
-    float in fp0, int in r3
-    offset of stack on overflow 8/16
-    for varargs, must go by type.
-power open:
-    float in r3&r4, int in r5
-    offset of stack on overflow different 
-both: 
-    return in r3 or f0.  If no float, must study how gcc emulates floats;
-    pay attention to arg promotion.  
-    User may have to cast\args to handle promotion correctly 
-    since gdb won't know if prototype supplied or not.
-*/
-
-  for (argno=0, argbytes=0; argno < nargs && ii<8; ++ii) {
-
-    arg = args[argno];
-    type = check_typedef (VALUE_TYPE (arg));
-    len = TYPE_LENGTH (type);
-
-    if (TYPE_CODE (type) == TYPE_CODE_FLT) {
-
-      /* 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. */
-
-      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 + 1 + f_argno)], 
-             VALUE_CONTENTS (arg), 
-             len);
-      ++f_argno;
-    }
+   effectively indirect call... gcc does...
+
+   return_val example( float, int);
+
+   eabi: 
+   float in fp0, int in r3
+   offset of stack on overflow 8/16
+   for varargs, must go by type.
+   power open:
+   float in r3&r4, int in r5
+   offset of stack on overflow different 
+   both: 
+   return in r3 or f0.  If no float, must study how gcc emulates floats;
+   pay attention to arg promotion.  
+   User may have to cast\args to handle promotion correctly 
+   since gdb won't know if prototype supplied or not.
+ */
 
-    if (len > 4) {
+  for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
+    {
 
-      /* Argument takes more than one register. */
-      while (argbytes < len) {
-       memset (&registers[REGISTER_BYTE(ii+3)], 0, sizeof(int));
-       memcpy (&registers[REGISTER_BYTE(ii+3)], 
-               ((char*)VALUE_CONTENTS (arg))+argbytes, 
-               (len - argbytes) > 4 ? 4 : len - argbytes);
-       ++ii, argbytes += 4;
+      arg = args[argno];
+      type = check_typedef (VALUE_TYPE (arg));
+      len = TYPE_LENGTH (type);
 
-       if (ii >= 8)
-         goto ran_out_of_registers_for_arguments;
-      }
-      argbytes = 0;
-      --ii;
-    }
-    else {        /* Argument can fit in one register. No problem. */
-      memset (&registers[REGISTER_BYTE(ii+3)], 0, sizeof(int));
-      memcpy (&registers[REGISTER_BYTE(ii+3)], VALUE_CONTENTS (arg), len);
+      if (TYPE_CODE (type) == TYPE_CODE_FLT)
+       {
+
+         /* 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. */
+
+         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 + 1 + f_argno)],
+                 VALUE_CONTENTS (arg),
+                 len);
+         ++f_argno;
+       }
+
+      if (len > 4)
+       {
+
+         /* Argument takes more than one register. */
+         while (argbytes < len)
+           {
+             memset (&registers[REGISTER_BYTE (ii + 3)], 0, sizeof (int));
+             memcpy (&registers[REGISTER_BYTE (ii + 3)],
+                     ((char *) VALUE_CONTENTS (arg)) + argbytes,
+                     (len - argbytes) > 4 ? 4 : len - argbytes);
+             ++ii, argbytes += 4;
+
+             if (ii >= 8)
+               goto ran_out_of_registers_for_arguments;
+           }
+         argbytes = 0;
+         --ii;
+       }
+      else
+       {                       /* Argument can fit in one register. No problem. */
+         memset (&registers[REGISTER_BYTE (ii + 3)], 0, sizeof (int));
+         memcpy (&registers[REGISTER_BYTE (ii + 3)], VALUE_CONTENTS (arg), len);
+       }
+      ++argno;
     }
-    ++argno;
-  }
 
 ran_out_of_registers_for_arguments:
 
@@ -929,68 +994,74 @@ ran_out_of_registers_for_arguments:
   /* if there are more arguments, allocate space for them in 
      the stack, then push them starting from the ninth one. */
 
-  if ((argno < nargs) || argbytes) {
-    int space = 0, jj;
+  if ((argno < nargs) || argbytes)
+    {
+      int space = 0, jj;
 
-    if (argbytes) {
-      space += ((len - argbytes + 3) & -4);
-      jj = argno + 1;
-    }
-    else
-      jj = argno;
+      if (argbytes)
+       {
+         space += ((len - argbytes + 3) & -4);
+         jj = argno + 1;
+       }
+      else
+       jj = argno;
 
-    for (; jj < nargs; ++jj) {
-      value_ptr val = args[jj];
-      space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4;
-    }
+      for (; jj < nargs; ++jj)
+       {
+         value_ptr val = args[jj];
+         space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4;
+       }
 
-    /* add location required for the rest of the parameters */
-    space = (space + 7) & -8;
-    sp -= space;
+      /* add location required for the rest of the parameters */
+      space = (space + 7) & -8;
+      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);
+      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) {
-      write_memory (sp+24+(ii*4), 
-                   ((char*)VALUE_CONTENTS (arg))+argbytes, 
-                   len - argbytes);
-      ++argno;
-      ii += ((len - argbytes + 3) & -4) / 4;
-    }
+      if (argbytes)
+       {
+         write_memory (sp + 24 + (ii * 4),
+                       ((char *) VALUE_CONTENTS (arg)) + argbytes,
+                       len - argbytes);
+         ++argno;
+         ii += ((len - argbytes + 3) & -4) / 4;
+       }
 
-    /* push the rest of the arguments into stack. */
-    for (; argno < nargs; ++argno) {
+      /* push the rest of the arguments into stack. */
+      for (; argno < nargs; ++argno)
+       {
 
-      arg = args[argno];
-      type = check_typedef (VALUE_TYPE (arg));
-      len = TYPE_LENGTH (type);
+         arg = args[argno];
+         type = check_typedef (VALUE_TYPE (arg));
+         len = TYPE_LENGTH (type);
 
 
-      /* float types should be passed in fpr's, as well as in the stack. */
-      if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13) {
+         /* float types should be passed in fpr's, as well as in the stack. */
+         if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
+           {
 
-        if (len > 8)
-          printf_unfiltered (
-"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
+             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 + 1 + f_argno)], 
-               VALUE_CONTENTS (arg), 
-               len);
-        ++f_argno;
-      }
+             memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+                     VALUE_CONTENTS (arg),
+                     len);
+             ++f_argno;
+           }
 
-      write_memory (sp+24+(ii*4), (char *) VALUE_CONTENTS (arg), len);
-      ii += ((len + 3) & -4) / 4;
+         write_memory (sp + 24 + (ii * 4), (char *) VALUE_CONTENTS (arg), len);
+         ii += ((len + 3) & -4) / 4;
+       }
     }
-  }
   else
     /* Secure stack areas first, before doing anything else. */
     write_register (SP_REGNUM, sp);
@@ -998,9 +1069,9 @@ ran_out_of_registers_for_arguments:
   if (!USE_GENERIC_DUMMY_FRAMES)
     {
       /* we want to copy 24 bytes of target's frame to dummy's frame,
-        then set back chain to point to new frame. */
-      
-      saved_sp = dummy_frame_addr [dummy_frame_count - 1];
+         then set back chain to point to new frame. */
+
+      saved_sp = dummy_frame_addr[dummy_frame_count - 1];
       read_memory (saved_sp, tmp_buffer, 24);
       write_memory (sp, tmp_buffer, 24);
     }
@@ -1017,7 +1088,7 @@ ran_out_of_registers_for_arguments:
 /* Function: ppc_push_return_address (pc, sp)
    Set up the return address for the inferior function call. */
 
-CORE_ADDR                                      
+CORE_ADDR
 ppc_push_return_address (pc, sp)
      CORE_ADDR pc;
      CORE_ADDR sp;
@@ -1039,33 +1110,37 @@ extract_return_value (valtype, regbuf, valbuf)
 {
   int offset = 0;
 
-  if (TYPE_CODE (valtype) == TYPE_CODE_FLT) {
+  if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
+    {
+
+      double dd;
+      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. */
 
-    double dd; 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. */
+      if (TYPE_LENGTH (valtype) > 4)   /* this is a double */
+       memcpy (valbuf,
+               &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)],
+               TYPE_LENGTH (valtype));
+      else
+       {                       /* float */
+         memcpy (&dd, &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)], 8);
+         ff = (float) dd;
+         memcpy (valbuf, &ff, sizeof (float));
+       }
+    }
+  else
+    {
+      /* return value is copied starting from r3. */
+      if (TARGET_BYTE_ORDER == BIG_ENDIAN
+         && TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (3))
+       offset = REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype);
 
-    if (TYPE_LENGTH (valtype) > 4)             /* this is a double */
-      memcpy (valbuf, 
-             &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)],
+      memcpy (valbuf,
+             regbuf + REGISTER_BYTE (3) + offset,
              TYPE_LENGTH (valtype));
-    else {             /* float */
-      memcpy (&dd, &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)], 8);
-      ff = (float)dd;
-      memcpy (valbuf, &ff, sizeof(float));
     }
-  }
-  else {
-    /* return value is copied starting from r3. */
-    if (TARGET_BYTE_ORDER == BIG_ENDIAN
-       && TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (3))
-      offset = REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype);
-
-    memcpy (valbuf, 
-           regbuf + REGISTER_BYTE (3) + offset,
-           TYPE_LENGTH (valtype));
-  }
 }
 
 
@@ -1092,15 +1167,16 @@ skip_trampoline_code (pc)
   register unsigned int ii, op;
   CORE_ADDR solib_target_pc;
 
-  static unsigned trampoline_code[] = {
-       0x800b0000,                     /*     l   r0,0x0(r11)  */
-       0x90410014,                     /*    st   r2,0x14(r1)  */
-       0x7c0903a6,                     /* mtctr   r0           */
-       0x804b0004,                     /*     l   r2,0x4(r11)  */
-       0x816b0008,                     /*     l  r11,0x8(r11)  */
-       0x4e800420,                     /*  bctr                */
-       0x4e800020,                     /*    br                */
-       0
+  static unsigned trampoline_code[] =
+  {
+    0x800b0000,                        /*     l   r0,0x0(r11)  */
+    0x90410014,                        /*    st   r2,0x14(r1)  */
+    0x7c0903a6,                        /* mtctr   r0           */
+    0x804b0004,                        /*     l   r2,0x4(r11)  */
+    0x816b0008,                        /*     l  r11,0x8(r11)  */
+    0x4e800420,                        /*  bctr                */
+    0x4e800020,                        /*    br                */
+    0
   };
 
   /* If pc is in a shared library trampoline, return its target.  */
@@ -1108,13 +1184,14 @@ skip_trampoline_code (pc)
   if (solib_target_pc)
     return solib_target_pc;
 
-  for (ii=0; trampoline_code[ii]; ++ii) {
-    op  = read_memory_integer (pc + (ii*4), 4);
-    if (op != trampoline_code [ii])
-      return 0;
-  }
-  ii = read_register (11);             /* r11 holds destination addr   */
-  pc = read_memory_integer (ii, 4);    /* (r11) value                  */
+  for (ii = 0; trampoline_code[ii]; ++ii)
+    {
+      op = read_memory_integer (pc + (ii * 4), 4);
+      if (op != trampoline_code[ii])
+       return 0;
+    }
+  ii = read_register (11);     /* r11 holds destination addr   */
+  pc = read_memory_integer (ii, 4);    /* (r11) value                  */
   return pc;
 }
 
@@ -1131,7 +1208,7 @@ frameless_function_invocation (fi)
      or if the function was interrupted by a signal.  */
   if (fi->next != NULL && !fi->next->signal_handler_caller)
     return 0;
-  
+
   func_start = get_pc_function_start (fi->pc);
 
   /* If we failed to find the start of the function, it is a mistake
@@ -1140,9 +1217,9 @@ frameless_function_invocation (fi)
   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
-        of setting up a stack frame.  */
+         function pointer, normally causing an immediate core dump of the
+         inferior. Mark function as frameless, as the inferior has no chance
+         of setting up a stack frame.  */
       if (fi->pc == 0)
        return 1;
       else
@@ -1168,7 +1245,7 @@ frame_saved_pc (fi)
   if (USE_GENERIC_DUMMY_FRAMES)
     {
       if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
-       return generic_read_register_dummy(fi->pc, fi->frame, PC_REGNUM);
+       return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
     }
 
   func_start = get_pc_function_start (fi->pc);
@@ -1205,12 +1282,12 @@ frame_get_saved_regs (fi, fdatap)
      struct rs6000_framedata *fdatap;
 {
   int ii;
-  CORE_ADDR frame_addr; 
+  CORE_ADDR frame_addr;
   struct rs6000_framedata work_fdata;
 
   if (fi->saved_regs)
     return;
-  
+
   if (fdatap == NULL)
     {
       fdatap = &work_fdata;
@@ -1231,7 +1308,7 @@ frame_get_saved_regs (fi, fdatap)
     frame_addr = fi->prev->frame;
   else
     frame_addr = read_memory_integer (fi->frame, 4);
-  
+
   /* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr.
      All fpr's from saved_fpr to fp31 are saved.  */
 
@@ -1241,7 +1318,7 @@ frame_get_saved_regs (fi, fdatap)
       int fpr_offset = frame_addr + fdatap->fpr_offset;
       for (i = fdatap->saved_fpr; i < 32; i++)
        {
-         fi->saved_regs [FP0_REGNUM + i] = fpr_offset;
+         fi->saved_regs[FP0_REGNUM + i] = fpr_offset;
          fpr_offset += 8;
        }
     }
@@ -1255,7 +1332,7 @@ frame_get_saved_regs (fi, fdatap)
       int gpr_offset = frame_addr + fdatap->gpr_offset;
       for (i = fdatap->saved_gpr; i < 32; i++)
        {
-         fi->saved_regs [i] = gpr_offset;
+         fi->saved_regs[i] = gpr_offset;
          gpr_offset += 4;
        }
     }
@@ -1263,12 +1340,12 @@ frame_get_saved_regs (fi, fdatap)
   /* If != 0, fdatap->cr_offset is the offset from the frame that holds
      the CR.  */
   if (fdatap->cr_offset != 0)
-    fi->saved_regs [CR_REGNUM] = frame_addr + fdatap->cr_offset;
+    fi->saved_regs[CR_REGNUM] = frame_addr + fdatap->cr_offset;
 
   /* If != 0, fdatap->lr_offset is the offset from the frame that holds
      the LR.  */
   if (fdatap->lr_offset != 0)
-    fi->saved_regs [LR_REGNUM] = frame_addr + fdatap->lr_offset;
+    fi->saved_regs[LR_REGNUM] = frame_addr + fdatap->lr_offset;
 }
 
 /* Return the address of a frame. This is the inital %sp value when the frame
@@ -1311,29 +1388,31 @@ frame_initial_stack_address (fi)
      (with the lowest address), the value in alloca register is good. */
 
   if (!fi->next)
-    return fi->extra_info->initial_sp = read_register (fdata.alloca_reg);     
+    return fi->extra_info->initial_sp = read_register (fdata.alloca_reg);
 
   /* Otherwise, this is a caller frame. Callee has usually already saved
      registers, but there are exceptions (such as when the callee
      has no parameters). Find the address in which caller's alloca
      register is saved. */
 
-  for (callee_fi = fi->next; callee_fi; callee_fi = callee_fi->next) {
+  for (callee_fi = fi->next; callee_fi; callee_fi = callee_fi->next)
+    {
 
-    if (!callee_fi->saved_regs)
-      frame_get_saved_regs (callee_fi, NULL);
+      if (!callee_fi->saved_regs)
+       frame_get_saved_regs (callee_fi, NULL);
 
-    /* this is the address in which alloca register is saved. */
+      /* this is the address in which alloca register is saved. */
 
-    tmpaddr = callee_fi->saved_regs [fdata.alloca_reg];
-    if (tmpaddr) {
-      fi->extra_info->initial_sp = read_memory_integer (tmpaddr, 4); 
-      return fi->extra_info->initial_sp;
-    }
+      tmpaddr = callee_fi->saved_regs[fdata.alloca_reg];
+      if (tmpaddr)
+       {
+         fi->extra_info->initial_sp = read_memory_integer (tmpaddr, 4);
+         return fi->extra_info->initial_sp;
+       }
 
-    /* Go look into deeper levels of the frame chain to see if any one of
-       the callees has saved alloca register. */
-  }
+      /* Go look into deeper levels of the frame chain to see if any one of
+         the callees has saved alloca register. */
+    }
 
   /* If alloca register was not saved, by the callee (or any of its callees)
      then the value in the register is still good. */
@@ -1354,7 +1433,7 @@ rs6000_frame_chain (thisframe)
        return thisframe->frame;        /* dummy frame same as caller's frame */
     }
 
-  if (inside_entry_file (thisframe->pc) || 
+  if (inside_entry_file (thisframe->pc) ||
       thisframe->pc == entry_point_address ())
     return 0;
 
@@ -1411,8 +1490,8 @@ gdb_print_insn_powerpc (memaddr, info)
     return print_insn_little_powerpc (memaddr, info);
 }
 #endif
-
 \f
+
 /* Handling the various PowerPC/RS6000 variants.  */
 
 
@@ -1429,8 +1508,8 @@ gdb_print_insn_powerpc (memaddr, info)
    For the 505 and 860 family: eie eid nri
 
    For the 403 and 403GC: icdbdr esr dear evpr cdbcr tsr tcr pit tbhi
-       tblo srr2 srr3 dbsr dbcr iac1 iac2 dac1 dac2 dccr iccr pbl1
-       pbu1 pbl2 pbu2
+   tblo srr2 srr3 dbsr dbcr iac1 iac2 dac1 dac2 dccr iccr pbl1
+   pbu1 pbl2 pbu2
 
    Most of these register groups aren't anything formal.  I arrived at
    them by looking at the registers that occurred in more than one
@@ -1485,30 +1564,30 @@ char *register_names_uisa[] =
 };
 
 char *register_names_403[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "icdbdr", "esr", "dear", "evpr", "cdbcr", "tsr", "tcr", "pit", 
-  /* 127 */ "tbhi", "tblo", "srr2", "srr3", "dbsr", "dbcr", "iac1", "iac2", 
+  /* 119 */ "icdbdr", "esr", "dear", "evpr", "cdbcr", "tsr", "tcr", "pit",
+  /* 127 */ "tbhi", "tblo", "srr2", "srr3", "dbsr", "dbcr", "iac1", "iac2",
   /* 135 */ "dac1", "dac2", "dccr", "iccr", "pbl1", "pbu1", "pbl2", "pbu2"
 };
 
 char *register_names_403GC[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "icdbdr", "esr", "dear", "evpr", "cdbcr", "tsr", "tcr", "pit", 
-  /* 127 */ "tbhi", "tblo", "srr2", "srr3", "dbsr", "dbcr", "iac1", "iac2", 
-  /* 135 */ "dac1", "dac2", "dccr", "iccr", "pbl1", "pbu1", "pbl2", "pbu2", 
+  /* 119 */ "icdbdr", "esr", "dear", "evpr", "cdbcr", "tsr", "tcr", "pit",
+  /* 127 */ "tbhi", "tblo", "srr2", "srr3", "dbsr", "dbcr", "iac1", "iac2",
+  /* 135 */ "dac1", "dac2", "dccr", "iccr", "pbl1", "pbu1", "pbl2", "pbu2",
   /* 143 */ "zpr", "pid", "sgr", "dcwr", "tbhu", "tblu"
 };
 
 char *register_names_505[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
@@ -1517,18 +1596,18 @@ char *register_names_505[] =
 };
 
 char *register_names_860[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "eie", "eid", "nri", "cmpa", "cmpb", "cmpc", "cmpd", "icr", 
-  /* 127 */ "der", "counta", "countb", "cmpe", "cmpf", "cmpg", "cmph", 
-  /* 134 */ "lctrl1", "lctrl2", "ictrl", "bar", "ic_cst", "ic_adr", "ic_dat", 
-  /* 141 */ "dc_cst", "dc_adr", "dc_dat", "dpdr", "dpir", "immr", "mi_ctr", 
-  /* 148 */ "mi_ap", "mi_epn", "mi_twc", "mi_rpn", "md_ctr", "m_casid", 
-  /* 154 */ "md_ap", "md_epn", "md_twb", "md_twc", "md_rpn", "m_tw", 
-  /* 160 */ "mi_dbcam", "mi_dbram0", "mi_dbram1", "md_dbcam", "md_dbram0", 
+  /* 119 */ "eie", "eid", "nri", "cmpa", "cmpb", "cmpc", "cmpd", "icr",
+  /* 127 */ "der", "counta", "countb", "cmpe", "cmpf", "cmpg", "cmph",
+  /* 134 */ "lctrl1", "lctrl2", "ictrl", "bar", "ic_cst", "ic_adr", "ic_dat",
+  /* 141 */ "dc_cst", "dc_adr", "dc_dat", "dpdr", "dpir", "immr", "mi_ctr",
+  /* 148 */ "mi_ap", "mi_epn", "mi_twc", "mi_rpn", "md_ctr", "m_casid",
+  /* 154 */ "md_ap", "md_epn", "md_twb", "md_twc", "md_rpn", "m_tw",
+  /* 160 */ "mi_dbcam", "mi_dbram0", "mi_dbram1", "md_dbcam", "md_dbram0",
   /* 165 */ "md_dbram1"
 };
 
@@ -1536,72 +1615,72 @@ char *register_names_860[] =
    writing RTCU and RTCL.  However, how one reads and writes a
    register is the stub's problem.  */
 char *register_names_601[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "hid0", "hid1", "iabr", "dabr", "pir", "mq", "rtcu", 
+  /* 119 */ "hid0", "hid1", "iabr", "dabr", "pir", "mq", "rtcu",
   /* 126 */ "rtcl"
 };
 
 char *register_names_602[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "hid0", "hid1", "iabr", "", "", "tcr", "ibr", "esassr", "sebr", 
+  /* 119 */ "hid0", "hid1", "iabr", "", "", "tcr", "ibr", "esassr", "sebr",
   /* 128 */ "ser", "sp", "lt"
 };
 
 char *register_names_603[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "hid0", "hid1", "iabr", "", "", "dmiss", "dcmp", "hash1", 
+  /* 119 */ "hid0", "hid1", "iabr", "", "", "dmiss", "dcmp", "hash1",
   /* 127 */ "hash2", "imiss", "icmp", "rpa"
 };
 
 char *register_names_604[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "hid0", "hid1", "iabr", "dabr", "pir", "mmcr0", "pmc1", "pmc2", 
+  /* 119 */ "hid0", "hid1", "iabr", "dabr", "pir", "mmcr0", "pmc1", "pmc2",
   /* 127 */ "sia", "sda"
 };
 
 char *register_names_750[] =
-{ 
+{
   COMMON_UISA_REG_NAMES,
   PPC_UISA_SPR_NAMES,
   PPC_SEGMENT_REG_NAMES,
   PPC_32_OEA_SPR_NAMES,
-  /* 119 */ "hid0", "hid1", "iabr", "dabr", "", "ummcr0", "upmc1", "upmc2", 
-  /* 127 */ "usia", "ummcr1", "upmc3", "upmc4", "mmcr0", "pmc1", "pmc2", 
-  /* 134 */ "sia", "mmcr1", "pmc3", "pmc4", "l2cr", "ictc", "thrm1", "thrm2", 
+  /* 119 */ "hid0", "hid1", "iabr", "dabr", "", "ummcr0", "upmc1", "upmc2",
+  /* 127 */ "usia", "ummcr1", "upmc3", "upmc4", "mmcr0", "pmc1", "pmc2",
+  /* 134 */ "sia", "mmcr1", "pmc3", "pmc4", "l2cr", "ictc", "thrm1", "thrm2",
   /* 142 */ "thrm3"
 };
 
 
 /* Information about a particular processor variant.  */
 struct variant
-{
-  /* Name of this variant.  */
-  char *name;
+  {
+    /* Name of this variant.  */
+    char *name;
 
-  /* English description of the variant.  */
-  char *description;
+    /* English description of the variant.  */
+    char *description;
 
-  /* Table of register names; registers[R] is the name of the register
-     number R.  */
-  int num_registers;
-  char **registers;
-};
+    /* Table of register names; registers[R] is the name of the register
+       number R.  */
+    int num_registers;
+    char **registers;
+  };
 
 #define num_registers(list) (sizeof (list) / sizeof((list)[0]))
 
@@ -1617,31 +1696,31 @@ struct variant
    value as an argument to the --with-cpu flag, in configure.in.  */
 
 static struct variant
-variants[] =
+  variants[] =
 {
-  { "ppc-uisa", "PowerPC UISA - a PPC processor as viewed by user-level code",
-    num_registers (register_names_uisa),   register_names_uisa },
-  { "rs6000", "IBM RS6000 (\"POWER\") architecture, user-level view",
-    num_registers (register_names_rs6000), register_names_rs6000 },
-  { "403", "IBM PowerPC 403",
-    num_registers (register_names_403),   register_names_403 },
-  { "403GC", "IBM PowerPC 403GC",
-    num_registers (register_names_403GC), register_names_403GC },
-  { "505", "Motorola PowerPC 505",
-    num_registers (register_names_505),   register_names_505 },
-  { "860", "Motorola PowerPC 860 or 850",
-    num_registers (register_names_860),   register_names_860 },
-  { "601", "Motorola PowerPC 601",
-    num_registers (register_names_601),   register_names_601 },
-  { "602", "Motorola PowerPC 602",
-    num_registers (register_names_602),   register_names_602 },
-  { "603", "Motorola/IBM PowerPC 603 or 603e",
-    num_registers (register_names_603),   register_names_603 },
-  { "604", "Motorola PowerPC 604 or 604e",
-    num_registers (register_names_604),   register_names_604 },
-  { "750", "Motorola/IBM PowerPC 750 or 740",
-    num_registers (register_names_750),   register_names_750 },
-  { 0, 0, 0, 0 }
+  {"ppc-uisa", "PowerPC UISA - a PPC processor as viewed by user-level code",
+   num_registers (register_names_uisa), register_names_uisa},
+  {"rs6000", "IBM RS6000 (\"POWER\") architecture, user-level view",
+   num_registers (register_names_rs6000), register_names_rs6000},
+  {"403", "IBM PowerPC 403",
+   num_registers (register_names_403), register_names_403},
+  {"403GC", "IBM PowerPC 403GC",
+   num_registers (register_names_403GC), register_names_403GC},
+  {"505", "Motorola PowerPC 505",
+   num_registers (register_names_505), register_names_505},
+  {"860", "Motorola PowerPC 860 or 850",
+   num_registers (register_names_860), register_names_860},
+  {"601", "Motorola PowerPC 601",
+   num_registers (register_names_601), register_names_601},
+  {"602", "Motorola PowerPC 602",
+   num_registers (register_names_602), register_names_602},
+  {"603", "Motorola/IBM PowerPC 603 or 603e",
+   num_registers (register_names_603), register_names_603},
+  {"604", "Motorola PowerPC 604 or 604e",
+   num_registers (register_names_604), register_names_604},
+  {"750", "Motorola/IBM PowerPC 750 or 740",
+   num_registers (register_names_750), register_names_750},
+  {0, 0, 0, 0}
 };
 
 
@@ -1672,9 +1751,9 @@ static struct variant *
 find_variant_by_name (char *name)
 {
   int i;
-  
+
   for (i = 0; variants[i].name; i++)
-    if (! strcmp (name, variants[i].name))
+    if (!strcmp (name, variants[i].name))
       return &variants[i];
 
   return 0;
@@ -1729,7 +1808,7 @@ set_processor (char *arg, int from_tty)
 {
   int i;
 
-  if (! arg || arg[0] == '\0')
+  if (!arg || arg[0] == '\0')
     {
       list_variants ();
       return;
@@ -1739,7 +1818,7 @@ set_processor (char *arg, int from_tty)
     {
       error_begin ();
       fprintf_filtered (gdb_stderr,
-                       "`%s' is not a recognized PowerPC / RS6000 variant name.\n\n", arg);
+       "`%s' is not a recognized PowerPC / RS6000 variant name.\n\n", arg);
       list_variants ();
       return_to_top_level (RETURN_ERROR);
     }
@@ -1752,9 +1831,9 @@ show_processor (char *arg, int from_tty)
 {
   show_current_variant ();
 }
+\f
 
 
-\f
 /* Initialization code.  */
 
 void
index 63995639dcf326bae854ee8837dba0c379e19254..bacc29a8541b3829733657fb0d65a31894272f32 100644 (file)
@@ -1,21 +1,22 @@
 /* Scheme/Guile language support routines for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -38,7 +39,7 @@ static LONGEST scm_istr2int PARAMS ((char *, int, int));
 static void scm_lreadr PARAMS ((int));
 
 static LONGEST
-scm_istr2int(str, len, radix)
+scm_istr2int (str, len, radix)
      char *str;
      int len;
      int radix;
@@ -48,42 +49,65 @@ scm_istr2int(str, len, radix)
   int c;
   int sign = 0;
 
-  if (0 >= len) return SCM_BOOL_F;     /* zero scm_length */
+  if (0 >= len)
+    return SCM_BOOL_F;         /* zero scm_length */
   switch (str[0])
-    {          /* leading sign */
+    {                          /* leading sign */
     case '-':
     case '+':
       sign = str[0];
-      if (++i==len)
-       return SCM_BOOL_F; /* bad if lone `+' or `-' */
+      if (++i == len)
+       return SCM_BOOL_F;      /* bad if lone `+' or `-' */
     }
-  do {
-    switch (c = str[i++]) {
-    case '0': case '1': case '2': case '3': case '4':
-    case '5': case '6': case '7': case '8': case '9':
-      c = c - '0';
-      goto accumulate;
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-      c = c-'A'+10;
-      goto accumulate;
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-      c = c-'a'+10;
-    accumulate:
-      if (c >= radix) return SCM_BOOL_F; /* bad digit for radix */
-      inum *= radix;
-      inum += c;
-      break;
-    default:
-      return SCM_BOOL_F;               /* not a digit */
+  do
+    {
+      switch (c = str[i++])
+       {
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         c = c - '0';
+         goto accumulate;
+       case 'A':
+       case 'B':
+       case 'C':
+       case 'D':
+       case 'E':
+       case 'F':
+         c = c - 'A' + 10;
+         goto accumulate;
+       case 'a':
+       case 'b':
+       case 'c':
+       case 'd':
+       case 'e':
+       case 'f':
+         c = c - 'a' + 10;
+       accumulate:
+         if (c >= radix)
+           return SCM_BOOL_F;  /* bad digit for radix */
+         inum *= radix;
+         inum += c;
+         break;
+       default:
+         return SCM_BOOL_F;    /* not a digit */
+       }
     }
-  while (i < len);
+  while (i < len);
   if (sign == '-')
     inum = -inum;
   return SCM_MAKINUM (inum);
 }
 
 static LONGEST
-scm_istring2number(str, len, radix)
+scm_istring2number (str, len, radix)
      char *str;
      int len;
      int radix;
@@ -94,33 +118,68 @@ scm_istring2number(str, len, radix)
 #if 0
   SCM res;
 #endif
-  if (len==1)
-    if (*str=='+' || *str=='-') /* Catches lone `+' and `-' for speed */
+  if (len == 1)
+    if (*str == '+' || *str == '-')    /* Catches lone `+' and `-' for speed */
       return SCM_BOOL_F;
 
-  while ((len-i) >= 2  &&  str[i]=='#' && ++i)
-    switch (str[i++]) {
-    case 'b': case 'B':  if (rx_p++) return SCM_BOOL_F; radix = 2;  break;
-    case 'o': case 'O':  if (rx_p++) return SCM_BOOL_F; radix = 8;  break;
-    case 'd': case 'D':  if (rx_p++) return SCM_BOOL_F; radix = 10; break;
-    case 'x': case 'X':  if (rx_p++) return SCM_BOOL_F; radix = 16; break;
-    case 'i': case 'I':  if (ex_p++) return SCM_BOOL_F; ex = 2;     break;
-    case 'e': case 'E':  if (ex_p++) return SCM_BOOL_F; ex = 1;     break;
-    default:  return SCM_BOOL_F;
-    }
+  while ((len - i) >= 2 && str[i] == '#' && ++i)
+    switch (str[i++])
+      {
+      case 'b':
+      case 'B':
+       if (rx_p++)
+         return SCM_BOOL_F;
+       radix = 2;
+       break;
+      case 'o':
+      case 'O':
+       if (rx_p++)
+         return SCM_BOOL_F;
+       radix = 8;
+       break;
+      case 'd':
+      case 'D':
+       if (rx_p++)
+         return SCM_BOOL_F;
+       radix = 10;
+       break;
+      case 'x':
+      case 'X':
+       if (rx_p++)
+         return SCM_BOOL_F;
+       radix = 16;
+       break;
+      case 'i':
+      case 'I':
+       if (ex_p++)
+         return SCM_BOOL_F;
+       ex = 2;
+       break;
+      case 'e':
+      case 'E':
+       if (ex_p++)
+         return SCM_BOOL_F;
+       ex = 1;
+       break;
+      default:
+       return SCM_BOOL_F;
+      }
 
-  switch (ex) {
-  case 1:
-    return scm_istr2int(&str[i], len-i, radix);
-  case 0:
-    return scm_istr2int(&str[i], len-i, radix);
+  switch (ex)
+    {
+    case 1:
+      return scm_istr2int (&str[i], len - i, radix);
+    case 0:
+      return scm_istr2int (&str[i], len - i, radix);
 #if 0
-    if NFALSEP(res) return res;
+      if NFALSEP
+       (res) return res;
 #ifdef FLOATS
-  case 2: return scm_istr2flo(&str[i], len-i, radix);
+    case 2:
+      return scm_istr2flo (&str[i], len - i, radix);
 #endif
 #endif
-  }
+    }
   return SCM_BOOL_F;
 }
 
@@ -140,11 +199,14 @@ scm_read_token (c, weird)
        case ')':
        case '\"':
        case ';':
-       case ' ':  case '\t':  case '\r':  case '\f':
+       case ' ':
+       case '\t':
+       case '\r':
+       case '\f':
        case '\n':
          if (weird)
            goto default_case;
-       case '\0':  /* End of line */
+       case '\0':              /* End of line */
        eof_case:
          --lexptr;
          return;
@@ -180,7 +242,7 @@ scm_read_token (c, weird)
     }
 }
 
-static int 
+static int
 scm_skip_ws ()
 {
   register int c;
@@ -201,7 +263,11 @@ scm_skip_ws ()
          case '\n':
            break;
          }
-      case ' ':  case '\t':  case '\r':  case '\f':  case '\n':
+      case ' ':
+      case '\t':
+      case '\r':
+      case '\f':
+      case '\n':
        break;
       default:
        return c;
@@ -231,7 +297,7 @@ scm_lreadr (skipping)
   int c, j;
   struct stoken str;
   LONGEST svalue = 0;
- tryagain:
+tryagain:
   c = *lexptr++;
   switch (c)
     {
@@ -274,28 +340,36 @@ scm_lreadr (skipping)
        case '(':
          scm_lreadparen (skipping);
          return;
-       case 't':  case 'T':
+       case 't':
+       case 'T':
          svalue = SCM_BOOL_T;
          goto handle_immediate;
-       case 'f':  case 'F':
+       case 'f':
+       case 'F':
          svalue = SCM_BOOL_F;
          goto handle_immediate;
-       case 'b':  case 'B':
-       case 'o':  case 'O':
-       case 'd':  case 'D':
-       case 'x':  case 'X':
-       case 'i':  case 'I':
-       case 'e':  case 'E':
+       case 'b':
+       case 'B':
+       case 'o':
+       case 'O':
+       case 'd':
+       case 'D':
+       case 'x':
+       case 'X':
+       case 'i':
+       case 'I':
+       case 'e':
+       case 'E':
          lexptr--;
          c = '#';
          goto num;
-       case '*': /* bitvector */
+       case '*':               /* bitvector */
          scm_read_token (c, 0);
          return;
        case '{':
          scm_read_token (c, 1);
          return;
-       case '\\': /* character */
+       case '\\':              /* character */
          c = *lexptr++;
          scm_read_token (c, 0);
          return;
@@ -352,14 +426,22 @@ scm_lreadr (skipping)
              }
        }
       return;
-    case '0': case '1': case '2': case '3': case '4':
-    case '5': case '6': case '7': case '8': case '9':
+    case '0':
+    case '1':
+    case '2':
+    case '3':
+    case '4':
+    case '5':
+    case '6':
+    case '7':
+    case '8':
+    case '9':
     case '.':
     case '-':
     case '+':
     num:
       {
-       str.ptr = lexptr-1;
+       str.ptr = lexptr - 1;
        scm_read_token (c, 0);
        if (!skipping)
          {
@@ -377,7 +459,7 @@ scm_lreadr (skipping)
     do_symbol:
 #endif
     default:
-      str.ptr = lexptr-1;
+      str.ptr = lexptr - 1;
       scm_read_token (c, 0);
     tok:
       if (!skipping)
@@ -394,7 +476,7 @@ scm_lreadr (skipping)
        }
       return;
     }
- handle_immediate:
+handle_immediate:
   if (!skipping)
     {
       write_exp_elt_opcode (OP_LONG);
@@ -407,7 +489,7 @@ scm_lreadr (skipping)
 int
 scm_parse ()
 {
-  charstart;
+  char *start;
   while (*lexptr == ' ')
     lexptr++;
   start = lexptr;
index e72a88b010b29357c280b48b11bea66f2d482236..a424891a4614fdfc4f6d0837192b79d4c15029fa 100644 (file)
@@ -1,21 +1,22 @@
 /* Scheme/Guile language support routines for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -35,9 +36,9 @@ static value_ptr evaluate_subexp_scm PARAMS ((struct type *, struct expression *
                                              int *, enum noside));
 static value_ptr scm_lookup_name PARAMS ((char *));
 static int in_eval_c PARAMS ((void));
-static void scm_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+static void scm_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
 
-extern struct type ** CONST_PTR (c_builtin_types[]);
+extern struct type **CONST_PTR (c_builtin_types[]);
 
 struct type *builtin_type_scm;
 
@@ -108,10 +109,11 @@ scm_unpack (type, valaddr, context)
        }
       switch (7 & (int) svalue)
        {
-       case 2:  case 6: /* fixnum */
+       case 2:
+       case 6:         /* fixnum */
          return svalue >> 2;
-       case 4: /* other immediate value */
-         if (SCM_ICHRP (svalue)) /* character */
+       case 4:         /* other immediate value */
+         if (SCM_ICHRP (svalue))       /* character */
            return SCM_ICHR (svalue);
          else if (SCM_IFLAGP (svalue))
            {
@@ -192,7 +194,8 @@ scm_lookup_name (str)
 
 value_ptr
 scm_evaluate_string (str, len)
-     char *str; int len;
+     char *str;
+     int len;
 {
   value_ptr func;
   value_ptr addr = value_allocate_space_in_inferior (len + 1);
@@ -212,7 +215,8 @@ evaluate_subexp_scm (expect_type, exp, pos, noside)
      enum noside noside;
 {
   enum exp_opcode op = exp->elts[*pos].opcode;
-  int len, pc;  char *str;
+  int len, pc;
+  char *str;
   switch (op)
     {
     case OP_NAME:
@@ -231,14 +235,15 @@ evaluate_subexp_scm (expect_type, exp, pos, noside)
        goto nosideret;
       str = &exp->elts[pc + 2].string;
       return scm_evaluate_string (str, len);
-    default: ;
+    default:;
     }
   return evaluate_subexp_standard (expect_type, exp, pos, noside);
- nosideret:
+nosideret:
   return value_from_longest (builtin_type_long, (LONGEST) 1);
 }
 
-const struct language_defn scm_language_defn = {
+const struct language_defn scm_language_defn =
+{
   "scheme",                    /* Language name */
   language_scm,
   c_builtin_types,
@@ -254,14 +259,14 @@ const struct language_defn scm_language_defn = {
   c_print_type,                        /* Print a type using appropriate syntax */
   scm_val_print,               /* Print a value using appropriate syntax */
   scm_value_print,             /* Print a top-level value */
-  {"",     "",    "",  ""},    /* Binary format info */
-  {"#o%lo",  "#o",   "o", ""}, /* Octal format info */
-  {"%ld",   "",    "d", ""},   /* Decimal format info */
-  {"#x%lX", "#X",  "X", ""},   /* Hex format info */
+  {"", "", "", ""},            /* Binary format info */
+  {"#o%lo", "#o", "o", ""},    /* Octal format info */
+  {"%ld", "", "d", ""},                /* Decimal format info */
+  {"#x%lX", "#X", "X", ""},    /* Hex format info */
   NULL,                                /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  &builtin_type_char,          /* Type of string elements */ 
+  &builtin_type_char,          /* Type of string elements */
   LANG_MAGIC
 };
 
index 878a2ab20eab0a7973a4bce67260e836501ab340..6056bcfc7f9c47ea86f03ff855ff4da38f1db929 100644 (file)
 #define SCM_CODE(x) SCM_CAR(SCM_CLOSCAR (x))
 #define SCM_MAKINUM(x) (((x)<<2)+2L)
 
-#ifdef __STDC__                /* Forward decls for prototypes */
+#ifdef __STDC__                        /* Forward decls for prototypes */
 struct value;
 #endif
 
-extern int scm_value_print PARAMS ((struct value *, GDB_FILE*,
+extern int scm_value_print PARAMS ((struct value *, GDB_FILE *,
                                    int, enum val_prettyprint));
 
-extern int scm_val_print PARAMS ((struct type*, char*, int, CORE_ADDR, GDB_FILE*,
-                                int, int, int, enum val_prettyprint));
+extern int scm_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
+                                 int, int, int, enum val_prettyprint));
 
 extern LONGEST scm_get_field PARAMS ((LONGEST, int));
 
 extern void scm_scmval_print PARAMS ((LONGEST, GDB_FILE *,
-                                    int, int, int, enum val_prettyprint));
+                                     int, int, int, enum val_prettyprint));
 
-extern int is_scmvalue_type PARAMS ((struct type*));
+extern int is_scmvalue_type PARAMS ((struct type *));
 
-extern void scm_printchar PARAMS ((int, GDB_FILE*));
+extern void scm_printchar PARAMS ((int, GDB_FILE *));
 
-extern struct value * scm_evaluate_string PARAMS ((char*, int));
+extern struct value *scm_evaluate_string PARAMS ((char *, int));
 
 extern struct type *builtin_type_scm;
 
index fbe45cc1890752a2eece178c05167473aee5847b..ded49f8c41d90c0019b73eab56317879b457041c 100644 (file)
@@ -3,8 +3,8 @@
 
 #ifndef TAGSH
 #define TAGSH
-/*     Copyright (C) 1995 Free Software Foundation, Inc.
- * 
+/*      Copyright (C) 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, or (at your option)
 /** This file defines the format of SCM values and cons pairs.  
  ** It is here that tag bits are assigned for various purposes.
  **/
-
 \f
+
 /* Three Bit Tags
- *
+
  * 000 -- a non-immediate value.  Points into the pair heap.  
  *
  * 001 -- a gloc (i.e., a resolved global variable in a CAR in a code graph)
- *       or the CAR of an object handle (i.e., the tagged pointer to the
- *       vtable part of a user-defined object).
+ *        or the CAR of an object handle (i.e., the tagged pointer to the
+ *        vtable part of a user-defined object).
  *
  *        If X has this tag, the value at CDAR(X - 1) distinguishes
- *       glocs from object handles.  The distinction only needs
- *       to be made in a few places.  Only a few parts of the code know
- *       about glocs.  In most cases, when a value in the CAR of a pair
- *       has the tag 001, it means that the pair is an object handle.
+ *        glocs from object handles.  The distinction only needs
+ *        to be made in a few places.  Only a few parts of the code know
+ *        about glocs.  In most cases, when a value in the CAR of a pair
+ *        has the tag 001, it means that the pair is an object handle.
  *
  * 010 -- the tag for immediate, exact integers. 
  *
  * 011 -- in the CAR of a pair, this tag indicates that the pair is a closure.
- *       The remaining bits of the CAR are a pointer into the pair heap
- *       to the code graph for the closure.
+ *        The remaining bits of the CAR are a pointer into the pair heap
+ *        to the code graph for the closure.
  *
  * 1xy -- an extension tag which means that there is a five or six bit
- *       tag to the left of the low three bits.  See the nice diagrams
- *       in ../doc/code.doc if you want to know what the bits mean.
+ *        tag to the left of the low three bits.  See the nice diagrams
+ *        in ../doc/code.doc if you want to know what the bits mean.
  */
-
 \f
 
 
 
+
 #define scm_tc3_cons           0
 #define scm_tc3_cons_gloc      1
 #define scm_tc3_closure                3
 #define scm_tcs_symbols scm_tc7_ssymbol:case scm_tc7_msymbol
 
 #define scm_tcs_bignums tc16_bigpos:case tc16_bigneg
-
 \f
 
+
 /* References to objects are of type SCM.  Values may be non-immediate
  * (pointers) or immediate (encoded, immutable, scalar values that fit
  * in an SCM variable).
@@ -191,34 +191,34 @@ typedef long SCM;
  * to scm_vector elts, functions, &c are not munged.
  */
 #ifdef _UNICOS
-# define SCM2PTR(x) ((int)(x) >> 3)
-# define PTR2SCM(x) (((SCM)(x)) << 3)
-# define SCM_POINTERS_MUNGED
+#define SCM2PTR(x) ((int)(x) >> 3)
+#define PTR2SCM(x) (((SCM)(x)) << 3)
+#define SCM_POINTERS_MUNGED
 #else
-# define SCM2PTR(x) (x)
-# define PTR2SCM(x) ((SCM)(x))
+#define SCM2PTR(x) (x)
+#define PTR2SCM(x) ((SCM)(x))
 #endif /* def _UNICOS */
-
 \f
 
+
 /* Immediate? Predicates 
  */
 #define SCM_IMP(x)     (6 & (int)(x))
 #define SCM_NIMP(x)    (!SCM_IMP(x))
-
 \f
 
+
 enum scm_tags
-{
-  scm_tc8_char = 0xf4
-};
+  {
+    scm_tc8_char = 0xf4
+  };
 
 #define SCM_ITAG8(X)           ((int)(X) & 0xff)
 #define SCM_MAKE_ITAG8(X, TAG) (((X)<<8) + TAG)
 #define SCM_ITAG8_DATA(X)      ((X)>>8)
+\f
 
 
-\f
 /* Local Environment Structure
  */
 #define SCM_ILOCP(n)           ((0xff & (int)(n))==0xfc)
@@ -230,8 +230,8 @@ enum scm_tags
 #define SCM_IFRAME(n)          ((int)((SCM_ICDR-SCM_IFRINC)>>8) & ((int)(n)>>8))
 #define SCM_IDIST(n)           (((unsigned long)(n))>>20)
 #define SCM_ICDRP(n)           (SCM_ICDR & (n))
-
 \f
+
 /* Immediate Symbols, Special Symbols, Flags (various constants).
  */
 
@@ -287,22 +287,22 @@ enum scm_tags
 #endif
 
 #define SCM_UNSPECIFIED                SCM_MAKIFLAG(SCM_NUM_ISYMS+5)
-
 \f
 
+
 /* Heap Pairs and the Empty List Predicates
  */
 #define SCM_NULLP(x)   (SCM_EOL == (x))
 #define SCM_NNULLP(x)  (SCM_EOL != (x))
 #define SCM_CELLP(x)   (!SCM_NCELLP(x))
 #define SCM_NCELLP(x)  ((sizeof(scm_cell)-1) & (int)(x))
+\f
 
 
-\f
 #define SCM_UNBNDP(x)  (SCM_UNDEFINED==(x))
-
 \f
 
+
 /* Testing and Changing GC Marks in Various Standard Positions
  */
 #define SCM_GCMARKP(x)                 (1 & (int)SCM_CDR(x))
@@ -311,8 +311,8 @@ enum scm_tags
 #define SCM_CLRGCMARK(x)       (SCM_CDR(x) &= ~1L)
 #define SCM_SETGC8MARK(x)      (SCM_CAR(x) |= 0x80)
 #define SCM_CLRGC8MARK(x)      (SCM_CAR(x) &= ~0x80L)
-
 \f
+
 /* Extracting Tag Bits, With or Without GC Safety and Optional Bits
  */
 #define SCM_TYP3(x)            (7 & (int)SCM_CAR(x))
@@ -321,27 +321,27 @@ enum scm_tags
 #define SCM_TYP16(x)           (0xffff & (int)SCM_CAR(x))
 #define SCM_TYP16S(x)          (0xfeff & (int)SCM_CAR(x))
 #define SCM_GCTYP16(x)                 (0xff7f & (int)SCM_CAR(x))
-
 \f
+
 /* Two slightly extensible types: smobs and ptobs.
- *
+
  */
 #define SCM_SMOBNUM(x) (0x0ff & (CAR(x)>>8));
 #define SCM_PTOBNUM(x) (0x0ff & (CAR(x)>>8));
+\f
 
 
-\f
 
 #define SCM_DIRP(x) (SCM_NIMP(x) && (TYP16(x)==(scm_tc16_dir)))
 #define SCM_OPDIRP(x) (SCM_NIMP(x) && (CAR(x)==(scm_tc16_dir | OPN)))
-
 \f
 
+
 /* Lvectors 
  */
 #define SCM_LVECTORP(x) (TYP7(x)==tc7_lvector)
-
 \f
+
 #if 0
 \f
 /* Sockets 
@@ -349,14 +349,14 @@ enum scm_tags
 #define tc_socket (tc7_port | OPN)
 #define SCM_SOCKP(x) (((0x7f | OPN | RDNG | WRTNG) & CAR(x))==(tc_socket))
 #define SCM_SOCKTYP(x) (CAR(x)>>24)
-
 \f
 
+
 extern int scm_tc16_key_vector;
 #define SCM_KEYVECP(X)   (scm_tc16_key_vector == TYP16 (X))
 #define SCM_KEYVECLEN(OBJ) (((unsigned long)CAR (obj)) >> 16)
-
 \f
+
 #define SCM_MALLOCDATA(obj) ((char *)CDR(obj))
 #define SCM_MALLOCLEN(obj) (((unsigned long)CAR (obj)) >> 16)
 #define SCM_WORDDATA(obj)  (CDR (obj))
@@ -368,12 +368,12 @@ extern int scm_tc16_key_vector;
 #define SCM_BYTECODE_NAME(X) (VELTS(X)[3])
 #define SCM_BYTECODE_BCODE(X) (VELTS(X)[4])
 #define SCM_BYTECODE_ELTS 5
-
 \f
+
 #define SCM_FREEP(x) (CAR(x)==tc_free_cell)
 #define SCM_NFREEP(x) (!FREEP(x))
 \f
-#endif /* 0*/
+#endif /* 0 */
 \f
 #ifdef __STDC__
 
@@ -382,4 +382,4 @@ extern int scm_tc16_key_vector;
 #endif /* STDC */
 
 
-#endif  /* TAGSH */
+#endif /* TAGSH */
index 71acc69d35153017d7d26b39ae48efabed74ef9e..d29a96c70960d4e43f74ac84dcc983a3284fbbe1 100644 (file)
@@ -1,21 +1,22 @@
 /* Scheme/Guile language support routines for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -35,7 +36,7 @@ c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int
 
 static void scm_ipruk PARAMS ((char *, LONGEST, GDB_FILE *));
 static void scm_scmlist_print PARAMS ((LONGEST, GDB_FILE *, int, int,
-                                     int, enum val_prettyprint));
+                                      int, enum val_prettyprint));
 static int scm_inferior_print PARAMS ((LONGEST, GDB_FILE *, int, int,
                                       int, enum val_prettyprint));
 
@@ -156,7 +157,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
      int recurse;
      enum val_prettyprint pretty;
 {
- taloop:
+taloop:
   switch (7 & (int) svalue)
     {
     case 2:
@@ -210,10 +211,10 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
 #if 1
              fputs_filtered ("???", stream);
 #else
-             name = ((SCM n*)(STRUCT_TYPE( exp)))[struct_i_name];
+             name = ((SCM n *) (STRUCT_TYPE (exp)))[struct_i_name];
              scm_lfwrite (CHARS (name),
                           (sizet) sizeof (char),
-                          (sizet) LENGTH (name),
+                            (sizet) LENGTH (name),
                           port);
 #endif
              fprintf_filtered (stream, " #X%lX>", svalue);
@@ -248,7 +249,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
              {
                buf_size = min (len - done, 64);
                read_memory (addr + done, buffer, buf_size);
-               
+
                for (i = 0; i < buf_size; ++i)
                  switch (buffer[i])
                    {
@@ -267,7 +268,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
          {
            int len = SCM_LENGTH (svalue);
 
-           char * str = (char*) alloca (len);
+           char *str = (char *) alloca (len);
            read_memory (SCM_CDR (svalue), str, len + 1);
            /* Should handle weird characters FIXME */
            str[len] = '\0';
@@ -278,7 +279,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
          {
            int len = SCM_LENGTH (svalue);
            int i;
-           LONGEST elements = SCM_CDR(svalue);
+           LONGEST elements = SCM_CDR (svalue);
            fputs_filtered ("#(", stream);
            for (i = 0; i < len; ++i)
              {
@@ -299,15 +300,15 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
            if (hook == BOOL_F)
              {
                scm_puts ("#<locked-vector ", port);
-               scm_intprint(CDR(exp), 16, port);
+               scm_intprint (CDR (exp), 16, port);
                scm_puts (">", port);
              }
            else
              {
                result
                  = scm_apply (hook,
-                              scm_listify (exp, port, (writing ? BOOL_T : BOOL_F),
-                                           SCM_UNDEFINED),
+                       scm_listify (exp, port, (writing ? BOOL_T : BOOL_F),
+                                    SCM_UNDEFINED),
                               EOL);
                if (result == BOOL_F)
                  goto punk;
@@ -331,7 +332,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
            char str[20];
            sprintf (str, "#%d", index);
 #else
-           char *str = index ? SCM_CHARS (scm_heap_org+index) : "";
+           char *str = index ? SCM_CHARS (scm_heap_org + index) : "";
 #define SCM_CHARS(x) ((char *)(SCM_CDR(x)))
            char *str = CHARS (SNAME (exp));
 #endif
@@ -376,7 +377,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
 
 int
 scm_val_print (type, valaddr, embedded_offset, address,
-               stream, format, deref_ref, recurse, pretty)
+              stream, format, deref_ref, recurse, pretty)
      struct type *type;
      char *valaddr;
      int embedded_offset;
@@ -397,7 +398,7 @@ scm_val_print (type, valaddr, embedded_offset, address,
       else
        {
          scm_scmval_print (svalue, stream, format,
-                             deref_ref, recurse, pretty);
+                           deref_ref, recurse, pretty);
        }
 
       gdb_flush (stream);
index fae08594c0660250055dfc9122214af5fcc4013f..5f35baedf0ec9d35a3b161fa55a7bc3f98050e58 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote serial interface using Hitachi E7000 PC ISA card in a PC
    Copyright 1994, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if defined __GO32__ || defined _WIN32
 #include "defs.h"
@@ -57,26 +58,26 @@ static int e7000pc_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
 #define OFF_READY      0x300c
 #define OFF_PON        0x300e
 
-#define IDLE       0x0000           
-#define CMD_CI     0x4349           
-#define CMD_CO     0x434f           
-#define CMD_LO     0x4c4f           
-#define CMD_LS     0x4c53           
-#define CMD_SV     0x5356           
-#define CMD_SS     0x5353           
-#define CMD_OK     0x4f4b           
-#define CMD_ER     0x4552           
-#define CMD_NF     0x4e46           
-#define CMD_AB     0x4142           
-#define CMD_ED     0x4544           
-#define CMD_CE     0x4345           
+#define IDLE       0x0000
+#define CMD_CI     0x4349
+#define CMD_CO     0x434f
+#define CMD_LO     0x4c4f
+#define CMD_LS     0x4c53
+#define CMD_SV     0x5356
+#define CMD_SS     0x5353
+#define CMD_OK     0x4f4b
+#define CMD_ER     0x4552
+#define CMD_NF     0x4e46
+#define CMD_AB     0x4142
+#define CMD_ED     0x4544
+#define CMD_CE     0x4345
 
 static unsigned long fa;
 static unsigned long irqtod;
 static unsigned long ready;
 static unsigned long fb;
-static unsigned long cpd ;
-static unsigned long cdp ;
+static unsigned long cpd;
+static unsigned long cdp;
 static unsigned long ready;
 static unsigned long pon;
 static unsigned long irqtop;
@@ -101,16 +102,31 @@ static unsigned short sb;
 #define dosmemput(FROM, LEN, TO) memcpy ((void *)(TO), (void *)(FROM), (LEN))
 #endif
 
-static struct sw 
+static struct sw
+  {
+    int sw;
+    int addr;
+  }
+sigs[] =
 {
-  int sw;
-  int addr;
-} sigs[] = {
-  {0x14, 0xd0000},
-  {0x15, 0xd4000},
-  {0x16, 0xd8000},
-  {0x17, 0xdc000},
-  0};
+  {
+    0x14, 0xd0000
+  }
+  ,
+  {
+    0x15, 0xd4000
+  }
+  ,
+  {
+    0x16, 0xd8000
+  }
+  ,
+  {
+    0x17, 0xdc000
+  }
+  ,
+    0
+};
 
 #ifdef _MSC_VER
 /* Get the base of the data segment.  This is needed to calculate the offset
@@ -126,29 +142,29 @@ get_ds_base (void)
   unsigned long dsbase;
 
   __asm
-    {
-      mov dsval,ds
-    }
+  {
+    mov dsval, ds
+  }
 
   dsbase = 0;
 
-  GetThreadSelectorEntry (GetCurrentThread(), dsval, &ldt);
+  GetThreadSelectorEntry (GetCurrentThread (), dsval, &ldt);
 
   dsbase = ldt.HighWord.Bits.BaseHi << 24 | ldt.HighWord.Bits.BaseMid << 16
-            | ldt.BaseLow;
+    | ldt.BaseLow;
 
   return dsbase;
 }
 #else /* !_MSC_VER */
 #define get_ds_base() 0
-#endif /* _MSC_VER */ 
+#endif /* _MSC_VER */
 
 static int
 e7000pc_init ()
 {
   int try;
   unsigned long dsbase;
-  
+
   dsbase = get_ds_base ();
 
   /* Look around in memory for the board's signature */
@@ -161,25 +177,25 @@ e7000pc_init ()
       fb = board_at + OFF_FB;
       cpd = board_at + OFF_CPD;
       cdp = board_at + OFF_CDP;
-      ready =board_at + OFF_READY;
-      pon = board_at + OFF_PON;              
+      ready = board_at + OFF_READY;
+      pon = board_at + OFF_PON;
       irqtop = board_at + OFF_IRQTOP;
       irqtod = board_at + OFF_IRQTOD;
-      
+
       val = GET_WORD (ready);
 
-      if (val == (0xaaa0  | sigs[try].sw))
+      if (val == (0xaaa0 | sigs[try].sw))
        {
          if (GET_WORD (pon) & 0xf)
            {
              SET_WORD (fa, 0);
              SET_WORD (fb, 0);
 
-             SET_WORD (irqtop, 1); /* Disable interrupts from e7000 */
+             SET_WORD (irqtop, 1);     /* Disable interrupts from e7000 */
              SET_WORD (ready, 1);
-             printf_filtered ("\nConnected to the E7000PC at address 0x%x\n", 
+             printf_filtered ("\nConnected to the E7000PC at address 0x%x\n",
                               sigs[try].addr);
-             return 1;       
+             return 1;
            }
          error ("The E7000 PC board is working, but the E7000 is turned off.\n");
          return 0;
@@ -200,14 +216,14 @@ static int pbuf_index;
 
 /* Return next byte from cdp.  If no more, then return -1.  */
 
-static int 
+static int
 e7000_get (void)
 {
   static char pbuf[1000];
   char tmp[1000];
   int x;
 
-  if (pbuf_index < pbuf_size) 
+  if (pbuf_index < pbuf_size)
     {
       x = pbuf[pbuf_index++];
     }
@@ -219,17 +235,17 @@ e7000_get (void)
       dosmemget (cdp + 8, pbuf_size + 1, tmp);
 
       /* Tell the E7000 we've eaten */
-      SET_WORD (fb, 0);        
+      SET_WORD (fb, 0);
       /* Swap it around */
-      for (i = 0; i < pbuf_size; i++) 
+      for (i = 0; i < pbuf_size; i++)
        {
-         pbuf[i] = tmp[i^1];
+         pbuf[i] = tmp[i ^ 1];
        }
       pbuf_index = 0;
-      x =  pbuf[pbuf_index++];
+      x = pbuf[pbuf_index++];
     }
-  else 
-    { 
+  else
+    {
       x = -1;
     }
   return x;
@@ -255,16 +271,16 @@ dosasync_read (fd, buf, len, timeout)
   then = now + timeout;
   while (i < len)
     {
-      int ch = e7000_get();
-      
+      int ch = e7000_get ();
+
       /* While there's room in the buffer, and we've already
-        read the stuff in, suck it over */
-      if (ch != -1) 
+         read the stuff in, suck it over */
+      if (ch != -1)
        {
          buf[i++] = ch;
-         while (i < len && pbuf_index < pbuf_size )
+         while (i < len && pbuf_index < pbuf_size)
            {
-             ch = e7000_get();
+             ch = e7000_get ();
              if (ch == -1)
                break;
              buf[i++] = ch;
@@ -291,26 +307,26 @@ dosasync_write (fd, buf, len)
      int len;
 {
   int i;
-  char dummy[1000];  
-  
+  char dummy[1000];
+
   /* Construct copy locally */
-  ((short *)dummy)[0] = CMD_CI;
-  ((short *)dummy)[1] = len;
-  ((short *)dummy)[2] = 0;
-  ((short *)dummy)[3] = 0;
-  for (i = 0; i < len ; i++) 
+  ((short *) dummy)[0] = CMD_CI;
+  ((short *) dummy)[1] = len;
+  ((short *) dummy)[2] = 0;
+  ((short *) dummy)[3] = 0;
+  for (i = 0; i < len; i++)
     {
       dummy[(8 + i) ^ 1] = buf[i];
     }
 
   /* Wait for the card to get ready */
-  while (GET_WORD (fa) & 1) ;
+  while (GET_WORD (fa) & 1);
 
   /* Blast onto the ISA card */
-  dosmemput (dummy, 8 + len + 1,  cpd);
+  dosmemput (dummy, 8 + len + 1, cpd);
 
   SET_WORD (fa, 1);
-  SET_WORD (irqtod, 1); /* Interrupt the E7000 */
+  SET_WORD (irqtod, 1);                /* Interrupt the E7000 */
 
   return len;
 }
@@ -355,18 +371,20 @@ e7000pc_readchar (scb, timeout)
 {
   char buf;
 
- top:
+top:
 
   if (dosasync_read (scb->fd, &buf, 1, timeout))
     {
-      if (buf == 0) goto top;
+      if (buf == 0)
+       goto top;
       return buf;
     }
   else
     return SERIAL_TIMEOUT;
 }
 
-struct e7000pc_ttystate {
+struct e7000pc_ttystate
+{
   int dummy;
 };
 
index 17684884437512e2f8508f851501891be09e66ef..89db6f85c05fb9da5ceebb705184ee3153670d83 100644 (file)
@@ -20,7 +20,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcmd.h"
@@ -153,21 +154,22 @@ extern long rawclock (void);
 #define CNT_ORUN       19
 #define NCNT           20
 
-static int     intrcnt;
-static int     cnts[NCNT];
-static char    *cntnames[NCNT] = {
+static int intrcnt;
+static int cnts[NCNT];
+static char *cntnames[NCNT] =
+{
   /* h/w interrupt counts. */
-  "mlsc",      "nopend",       "txrdy",        "?3",
-  "rxrdy",     "?5",           "rls",          "?7", 
-  "?8",        "?9",           "?a",           "?b", 
-  "rxtout",    "?d",           "?e",           "?f", 
+  "mlsc", "nopend", "txrdy", "?3",
+  "rxrdy", "?5", "rls", "?7",
+  "?8", "?9", "?a", "?b",
+  "rxtout", "?d", "?e", "?f",
   /* s/w counts. */
-  "rxcnt",     "txcnt",        "stray",        "swoflo"
+  "rxcnt", "txcnt", "stray", "swoflo"
 };
 
 #define COUNT(x) cnts[x]++
 #else
-#define COUNT(x) 
+#define COUNT(x)
 #endif
 
 /* Main interrupt controller port addresses. */
@@ -176,45 +178,59 @@ static char       *cntnames[NCNT] = {
 #define ICU_MASK       (ICU_BASE + 1)
 
 /* Original interrupt controller mask register. */
-unsigned char  icu_oldmask;
+unsigned char icu_oldmask;
 
 /* Maximum of 8 interrupts (we don't handle the slave icu yet). */
 #define NINTR  8
 
 static struct intrupt
-{  
-  char                 inuse;
-  struct dos_ttystate  *port;
-  _go32_dpmi_seginfo   old_rmhandler;
-  _go32_dpmi_seginfo   old_pmhandler;
-  _go32_dpmi_seginfo   new_rmhandler;
-  _go32_dpmi_seginfo   new_pmhandler;
-  _go32_dpmi_registers regs;
-} intrupts[NINTR];
+  {
+    char inuse;
+    struct dos_ttystate *port;
+    _go32_dpmi_seginfo old_rmhandler;
+    _go32_dpmi_seginfo old_pmhandler;
+    _go32_dpmi_seginfo new_rmhandler;
+    _go32_dpmi_seginfo new_pmhandler;
+    _go32_dpmi_registers regs;
+  }
+intrupts[NINTR];
 
 
 static struct dos_ttystate
+  {
+    int base;
+    int irq;
+    int refcnt;
+    struct intrupt *intrupt;
+    int fifo;
+    int baudrate;
+    unsigned char cbuf[CBSIZE];
+    unsigned int first;
+    unsigned int count;
+    int txbusy;
+    unsigned char old_mcr;
+    int ferr;
+    int perr;
+    int oflo;
+    int msr;
+  }
+ports[4] =
 {
-  int          base;
-  int          irq;
-  int          refcnt;
-  struct intrupt *intrupt;
-  int          fifo;
-  int          baudrate;
-  unsigned char        cbuf[CBSIZE];
-  unsigned int first;
-  unsigned int count;
-  int          txbusy;
-  unsigned char        old_mcr;
-  int          ferr;
-  int          perr;
-  int          oflo;
-  int          msr;
-} ports[4] = {
-  {COM1ADDR, 4}, 
-  {COM2ADDR, 3}, 
-  {COM3ADDR, 4}, 
-  {COM4ADDR, 3}
+  {
+    COM1ADDR, 4
+  }
+  ,
+  {
+    COM2ADDR, 3
+  }
+  ,
+  {
+    COM3ADDR, 4
+  }
+  ,
+  {
+    COM4ADDR, 3
+  }
 };
 
 static int dos_open PARAMS ((serial_t scb, const char *name));
@@ -237,34 +253,34 @@ static int
 dos_getc (port)
      volatile struct dos_ttystate *port;
 {
-    int c;
+  int c;
 
-    if (port->count == 0)
-      return -1;
+  if (port->count == 0)
+    return -1;
 
-    c = port->cbuf[port->first];
-    disable ();
-    port->first = (port->first + 1) & (CBSIZE - 1);
-    port->count--;
-    enable ();
-    return c;
+  c = port->cbuf[port->first];
+  disable ();
+  port->first = (port->first + 1) & (CBSIZE - 1);
+  port->count--;
+  enable ();
+  return c;
 }
-    
 
-static int 
+
+static int
 dos_putc (c, port)
      int c;
      struct dos_ttystate *port;
 {
-    if (port->count >= CBSIZE - 1)
-       return -1;
-    port->cbuf[(port->first + port->count) & (CBSIZE - 1)] = c;
-    port->count++;
-    return 0;
+  if (port->count >= CBSIZE - 1)
+    return -1;
+  port->cbuf[(port->first + port->count) & (CBSIZE - 1)] = c;
+  port->count++;
+  return 0;
 }
-
 \f
 
+
 static void
 dos_comisr (irq)
      int irq;
@@ -279,28 +295,28 @@ dos_comisr (irq)
 #endif
 
   port = intrupts[irq].port;
-  if (!port) 
+  if (!port)
     {
       COUNT (CNT_STRAY);
-      return;          /* not open */
+      return;                  /* not open */
     }
 
   while (1)
     {
       iir = inb (port, com_iir) & IIR_IMASK;
-      switch (iir) 
+      switch (iir)
        {
-         
+
        case IIR_RLS:
          lsr = inb (port, com_lsr);
          goto rx;
-         
+
        case IIR_RXTOUT:
        case IIR_RXRDY:
          lsr = 0;
-         
-      rx:
-         do 
+
+       rx:
+         do
            {
              c = inb (port, com_data);
              if (lsr & (LSR_BI | LSR_FE | LSR_PE | LSR_OE))
@@ -324,12 +340,12 @@ dos_comisr (irq)
            }
          while ((lsr = inb (port, com_lsr)) & LSR_RXRDY);
          break;
-         
+
        case IIR_MLSC:
          /* could be used to flowcontrol Tx */
          port->msr = inb (port, com_msr);
          break;
-         
+
        case IIR_TXRDY:
          port->txbusy = 0;
          break;
@@ -343,7 +359,7 @@ dos_comisr (irq)
          break;
        }
       COUNT (iir);
-    } 
+    }
 }
 
 #ifdef __STDC__
@@ -353,20 +369,21 @@ dos_comisr (irq)
 #endif
 #define ISR(x) static void ISRNAME(x)() {dos_comisr(x);}
 
-ISR(0) ISR(1) ISR(2) ISR(3)
-ISR(4) ISR(5) ISR(6) ISR(7)
+ISR (0) ISR (1) ISR (2) ISR (3)
+ISR (4) ISR (5) ISR (6) ISR (7)
 
-typedef void (*isr_t)();
+     typedef void (*isr_t) ();
 
-static isr_t isrs[NINTR] = {
-  ISRNAME(0), ISRNAME(1), ISRNAME(2), ISRNAME(3),
-  ISRNAME(4), ISRNAME(5), ISRNAME(6), ISRNAME(7)
+     static isr_t isrs[NINTR] =
+     {
+       ISRNAME (0), ISRNAME (1), ISRNAME (2), ISRNAME (3),
+       ISRNAME (4), ISRNAME (5), ISRNAME (6), ISRNAME (7)
 };
-
 \f
 
-static struct intrupt *
-dos_hookirq (irq)
+
+     static struct intrupt *
+       dos_hookirq (irq)
      unsigned int irq;
 {
   struct intrupt *intr;
@@ -379,15 +396,15 @@ dos_hookirq (irq)
   intr = &intrupts[irq];
   if (intr->inuse)
     return 0;
-  
+
   vec = 0x08 + irq;
   isr = isrs[irq];
 
   /* setup real mode handler */
   _go32_dpmi_get_real_mode_interrupt_vector (vec, &intr->old_rmhandler);
 
-  intr->new_rmhandler.pm_selector = _go32_my_cs();
-  intr->new_rmhandler.pm_offset = (u_long)isr;
+  intr->new_rmhandler.pm_selector = _go32_my_cs ();
+  intr->new_rmhandler.pm_offset = (u_long) isr;
   if (_go32_dpmi_allocate_real_mode_callback_iret (&intr->new_rmhandler,
                                                   &intr->regs))
     {
@@ -398,15 +415,15 @@ dos_hookirq (irq)
     {
       return 0;
     }
-      
+
   /* setup protected mode handler */
-  _go32_dpmi_get_protected_mode_interrupt_vector(vec, &intr->old_pmhandler);
+  _go32_dpmi_get_protected_mode_interrupt_vector (vec, &intr->old_pmhandler);
 
-  intr->new_pmhandler.pm_selector = _go32_my_cs();
-  intr->new_pmhandler.pm_offset = (u_long)isr;
+  intr->new_pmhandler.pm_selector = _go32_my_cs ();
+  intr->new_pmhandler.pm_offset = (u_long) isr;
   _go32_dpmi_allocate_iret_wrapper (&intr->new_pmhandler);
 
-  if (_go32_dpmi_set_protected_mode_interrupt_vector(vec, &intr->new_pmhandler))
+  if (_go32_dpmi_set_protected_mode_interrupt_vector (vec, &intr->new_pmhandler))
     {
       return 0;
     }
@@ -440,15 +457,15 @@ dos_unhookirq (intr)
   /* remove real mode handler */
   _go32_dpmi_set_real_mode_interrupt_vector (vec, &intr->old_rmhandler);
   _go32_dpmi_free_real_mode_callback (&intr->new_rmhandler);
-      
+
   /* remove protected mode handler */
   _go32_dpmi_set_protected_mode_interrupt_vector (vec, &intr->old_pmhandler);
   _go32_dpmi_free_iret_wrapper (&intr->new_pmhandler);
   intr->inuse = 0;
 }
-
 \f
 
+
 static int
 dos_open (scb, name)
      serial_t scb;
@@ -484,38 +501,39 @@ dos_open (scb, name)
     }
 
   /* force access to ID reg */
-  outb(port, com_cfcr, 0);
-  outb(port, com_iir, 0);
-  for (i = 0; i < 17; i++) {
-    if ((inb(port, com_iir) & 0x38) == 0)
-      goto ok;
-    (void) inb(port, com_data); /* clear recv */
-  }
+  outb (port, com_cfcr, 0);
+  outb (port, com_iir, 0);
+  for (i = 0; i < 17; i++)
+    {
+      if ((inb (port, com_iir) & 0x38) == 0)
+       goto ok;
+      (void) inb (port, com_data);     /* clear recv */
+    }
   errno = ENODEV;
   return -1;
 
 ok:
   /* disable all interrupts in chip */
-  outb(port, com_ier, 0);
+  outb (port, com_ier, 0);
 
   /* tentatively enable 16550 fifo, and see if it responds */
-  outb(port, com_fifo, FIFO_ENABLE|FIFO_RCV_RST|FIFO_XMT_RST|FIFO_TRIGGER);
-  sleep(1);
-  port->fifo = ((inb(port, com_iir) & IIR_FIFO_MASK) == IIR_FIFO_MASK);
+  outb (port, com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER);
+  sleep (1);
+  port->fifo = ((inb (port, com_iir) & IIR_FIFO_MASK) == IIR_FIFO_MASK);
 
   /* clear pending status reports. */
-  (void) inb(port, com_lsr);
-  (void) inb(port, com_msr);
+  (void) inb (port, com_lsr);
+  (void) inb (port, com_msr);
 
   /* enable external interrupt gate (to avoid floating IRQ) */
-  outb(port, com_mcr, MCR_IENABLE);
+  outb (port, com_mcr, MCR_IENABLE);
 
   /* hook up interrupt handler and initialise icu */
   port->intrupt = dos_hookirq (port->irq);
   if (!port->intrupt)
     {
-      outb(port, com_mcr, 0);
-      outb(port, com_fifo, 0);
+      outb (port, com_mcr, 0);
+      outb (port, com_fifo, 0);
       errno = ENODEV;
       return -1;
     }
@@ -523,7 +541,7 @@ ok:
   disable ();
 
   /* record port */
-  port->intrupt->port = port; 
+  port->intrupt->port = port;
   scb->fd = fd;
 
   /* clear rx buffer, tx busy flag and overflow count */
@@ -533,16 +551,16 @@ ok:
 
   /* set default baud rate and mode: 9600,8,n,1 */
   i = dos_baudconv (port->baudrate = 9600);
-  outb(port, com_cfcr, CFCR_DLAB);
-  outb(port, com_dlbl, i & 0xff);
-  outb(port, com_dlbh, i >> 8);
-  outb(port, com_cfcr, CFCR_8BITS);
+  outb (port, com_cfcr, CFCR_DLAB);
+  outb (port, com_dlbl, i & 0xff);
+  outb (port, com_dlbh, i >> 8);
+  outb (port, com_cfcr, CFCR_8BITS);
 
   /* enable all interrupts */
-  outb(port, com_ier, IER_ETXRDY | IER_ERXRDY | IER_ERLS | IER_EMSC);
+  outb (port, com_ier, IER_ETXRDY | IER_ERXRDY | IER_ERLS | IER_EMSC);
 
   /* enable DTR & RTS */
-  outb(port, com_mcr, MCR_DTR | MCR_RTS | MCR_IENABLE);
+  outb (port, com_mcr, MCR_DTR | MCR_RTS | MCR_IENABLE);
 
   enable ();
 
@@ -554,45 +572,45 @@ static void
 dos_close (scb)
      serial_t scb;
 {
-    struct dos_ttystate *port;
-    struct intrupt *intrupt;
+  struct dos_ttystate *port;
+  struct intrupt *intrupt;
 
-    if (!scb)
-      return;
-
-    port = &ports[scb->fd];
-
-    if (port->refcnt-- > 1)
-      return;
-
-    if (!(intrupt = port->intrupt))
-      return;
-
-    /* disable interrupts, fifo, flow control */
-    disable ();
-    port->intrupt = 0;
-    intrupt->port = 0;
-    outb(port, com_fifo, 0);
-    outb(port, com_ier, 0);
-    enable ();
-
-    /* unhook handler, and disable interrupt gate */
-    dos_unhookirq (intrupt);
-    outb(port, com_mcr, 0);
-
-    /* Check for overflow errors */
-    if (port->oflo)
-      {
-       fprintf_unfiltered (gdb_stderr,
-                           "Serial input overruns occurred.\n");
-       fprintf_unfiltered (gdb_stderr, "This system %s handle %d baud.\n",
-                           port->fifo ? "cannot" : "needs a 16550 to",
-                           port->baudrate);
-      }
-}
+  if (!scb)
+    return;
+
+  port = &ports[scb->fd];
+
+  if (port->refcnt-- > 1)
+    return;
 
+  if (!(intrupt = port->intrupt))
+    return;
+
+  /* disable interrupts, fifo, flow control */
+  disable ();
+  port->intrupt = 0;
+  intrupt->port = 0;
+  outb (port, com_fifo, 0);
+  outb (port, com_ier, 0);
+  enable ();
+
+  /* unhook handler, and disable interrupt gate */
+  dos_unhookirq (intrupt);
+  outb (port, com_mcr, 0);
+
+  /* Check for overflow errors */
+  if (port->oflo)
+    {
+      fprintf_unfiltered (gdb_stderr,
+                         "Serial input overruns occurred.\n");
+      fprintf_unfiltered (gdb_stderr, "This system %s handle %d baud.\n",
+                         port->fifo ? "cannot" : "needs a 16550 to",
+                         port->baudrate);
+    }
+}
 \f
 
+
 static int
 dos_noop (scb)
      serial_t scb;
@@ -616,7 +634,7 @@ dos_readchar (scb, timeout)
   long then;
   int c;
 
-  then = rawclock() + (timeout * RAWHZ);
+  then = rawclock () + (timeout * RAWHZ);
   while ((c = dos_getc (port)) < 0)
     {
       if (timeout >= 0 && (rawclock () - then) >= 0)
@@ -670,11 +688,11 @@ dos_flush_input (scb)
      serial_t scb;
 {
   struct dos_ttystate *port = &ports[scb->fd];
-  disable();
+  disable ();
   port->first = port->count = 0;
   if (port->fifo)
-    outb(port, com_fifo, FIFO_ENABLE|FIFO_RCV_RST|FIFO_TRIGGER);
-  enable();
+    outb (port, com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_TRIGGER);
+  enable ();
 }
 
 static void
@@ -691,16 +709,16 @@ dos_baudconv (rate)
      int rate;
 {
   long x, err;
-  
-  if (rate <= 0) 
+
+  if (rate <= 0)
     return -1;
 
-#define divrnd(n, q)   (((n) * 2 / (q) + 1) / 2) /* divide and round off */
-  x = divrnd(COMTICK, rate);
+#define divrnd(n, q)   (((n) * 2 / (q) + 1) / 2)       /* divide and round off */
+  x = divrnd (COMTICK, rate);
   if (x <= 0)
     return -1;
-  
-  err = divrnd(1000 * COMTICK, x * rate) - 1000;
+
+  err = divrnd (1000 * COMTICK, x * rate) - 1000;
   if (err < 0)
     err = -err;
   if (err > SPEED_TOLERANCE)
@@ -715,33 +733,33 @@ dos_setbaudrate (scb, rate)
      serial_t scb;
      int rate;
 {
-    struct dos_ttystate *port = &ports[scb->fd];
-
-    if (port->baudrate != rate) 
-      {
-       int x;
-       unsigned char cfcr;
-
-       x = dos_baudconv (rate);
-       if (x <= 0)
-         {
-           fprintf_unfiltered (gdb_stderr, "%d: impossible baudrate\n", rate);
-           errno = EINVAL;
-           return -1;
-         }
-
-       disable ();
-       cfcr = inb (port, com_cfcr);
-
-       outb(port, com_cfcr, CFCR_DLAB);
-       outb(port, com_dlbl, x & 0xff);
-       outb(port, com_dlbh, x >> 8);
-       outb(port, com_cfcr, cfcr);
-       port->baudrate = rate;
-       enable ();
-      }
+  struct dos_ttystate *port = &ports[scb->fd];
 
-    return 0;
+  if (port->baudrate != rate)
+    {
+      int x;
+      unsigned char cfcr;
+
+      x = dos_baudconv (rate);
+      if (x <= 0)
+       {
+         fprintf_unfiltered (gdb_stderr, "%d: impossible baudrate\n", rate);
+         errno = EINVAL;
+         return -1;
+       }
+
+      disable ();
+      cfcr = inb (port, com_cfcr);
+
+      outb (port, com_cfcr, CFCR_DLAB);
+      outb (port, com_dlbl, x & 0xff);
+      outb (port, com_dlbh, x >> 8);
+      outb (port, com_cfcr, cfcr);
+      port->baudrate = rate;
+      enable ();
+    }
+
+  return 0;
 }
 
 static int
@@ -749,28 +767,28 @@ dos_setstopbits (scb, num)
      serial_t scb;
      int num;
 {
-    struct dos_ttystate *port = &ports[scb->fd];
-    unsigned char cfcr;
-
-    disable ();
-    cfcr = inb (port, com_cfcr);
-
-    switch (num)
-      {
-      case SERIAL_1_STOPBITS:
-       outb (port, com_cfcr, cfcr & ~CFCR_STOPB);
-       break;
-      case SERIAL_1_AND_A_HALF_STOPBITS:
-      case SERIAL_2_STOPBITS:
-       outb (port, com_cfcr, cfcr | CFCR_STOPB);
-       break;
-      default:
-       enable ();
-       return 1;
-      }
-    enable ();
+  struct dos_ttystate *port = &ports[scb->fd];
+  unsigned char cfcr;
 
-    return 0;
+  disable ();
+  cfcr = inb (port, com_cfcr);
+
+  switch (num)
+    {
+    case SERIAL_1_STOPBITS:
+      outb (port, com_cfcr, cfcr & ~CFCR_STOPB);
+      break;
+    case SERIAL_1_AND_A_HALF_STOPBITS:
+    case SERIAL_2_STOPBITS:
+      outb (port, com_cfcr, cfcr | CFCR_STOPB);
+      break;
+    default:
+      enable ();
+      return 1;
+    }
+  enable ();
+
+  return 0;
 }
 
 static int
@@ -784,27 +802,27 @@ dos_write (scb, str, len)
   long then;
   int cnt;
 
-   while (len > 0) 
-     {
-       /* send the data, fifosize bytes at a time */
-       cnt = fifosize > len ? len : fifosize;
-       port->txbusy = 1;
-       outportsb (port->base + com_data, str, cnt);
-       str += cnt;
-       len -= cnt;
+  while (len > 0)
+    {
+      /* send the data, fifosize bytes at a time */
+      cnt = fifosize > len ? len : fifosize;
+      port->txbusy = 1;
+      outportsb (port->base + com_data, str, cnt);
+      str += cnt;
+      len -= cnt;
 #ifdef DOS_STATS
-       cnts[CNT_TX] += cnt;
+      cnts[CNT_TX] += cnt;
 #endif
-       /* wait for transmission to complete (max 1 sec) */
-       then = rawclock() + RAWHZ;
-       while (port->txbusy)
-         {
-           if ((rawclock () - then) >= 0)
-             {
-                 errno = EIO;
-                 return SERIAL_ERROR;
-             }
-         }
+      /* wait for transmission to complete (max 1 sec) */
+      then = rawclock () + RAWHZ;
+      while (port->txbusy)
+       {
+         if ((rawclock () - then) >= 0)
+           {
+             errno = EIO;
+             return SERIAL_ERROR;
+           }
+       }
     }
   return 0;
 }
@@ -818,15 +836,15 @@ dos_sendbreak (scb)
   unsigned char cfcr;
   long then;
 
-  cfcr = inb(port, com_cfcr);
-  outb(port, com_cfcr, cfcr | CFCR_SBREAK);
+  cfcr = inb (port, com_cfcr);
+  outb (port, com_cfcr, cfcr | CFCR_SBREAK);
 
   /* 0.25 sec delay */
   then = rawclock () + RAWHZ / 4;
   while ((rawclock () - then) < 0)
     continue;
 
-  outb(port, com_cfcr, cfcr);
+  outb (port, com_cfcr, cfcr);
   return 0;
 }
 
@@ -861,7 +879,7 @@ dos_info (arg, from_tty)
   struct dos_ttystate *port;
   int i;
 
-  for (port = ports; port < &ports[4]; port++) 
+  for (port = ports; port < &ports[4]; port++)
     {
       if (port->baudrate == 0)
        continue;
@@ -870,7 +888,7 @@ dos_info (arg, from_tty)
       printf_filtered ("Addr:\t0x%03x (irq %d)\n", port->base, port->irq);
       printf_filtered ("16550:\t%s\n", port->fifo ? "yes" : "no");
       printf_filtered ("Speed:\t%d baud\n", port->baudrate);
-      printf_filtered ("Errs:\tframing %d parity %d overflow %d\n\n", 
+      printf_filtered ("Errs:\tframing %d parity %d overflow %d\n\n",
                       port->ferr, port->perr, port->oflo);
     }
 
@@ -896,63 +914,63 @@ _initialize_ser_dos ()
   /* Mark fixed motherboard irqs as inuse. */
   intrupts[0].inuse =          /* timer tick */
     intrupts[1].inuse =                /* keyboard */
-      intrupts[2].inuse = 1;   /* slave icu */
-    
+    intrupts[2].inuse = 1;     /* slave icu */
+
   add_show_from_set (
-    add_set_cmd ("com1base", class_obscure, var_zinteger,
-                (char *) &ports[0].base,
-                "Set COM1 base i/o port address.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com1base", class_obscure, var_zinteger,
+                                  (char *) &ports[0].base,
+                                  "Set COM1 base i/o port address.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com1irq", class_obscure, var_zinteger,
-                (char *) &ports[0].irq,
-                "Set COM1 interrupt request.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com1irq", class_obscure, var_zinteger,
+                                  (char *) &ports[0].irq,
+                                  "Set COM1 interrupt request.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com2base", class_obscure, var_zinteger,
-                (char *) &ports[1].base,
-                "Set COM2 base i/o port address.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com2base", class_obscure, var_zinteger,
+                                  (char *) &ports[1].base,
+                                  "Set COM2 base i/o port address.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com2irq", class_obscure, var_zinteger,
-                (char *) &ports[1].irq,
-                "Set COM2 interrupt request.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com2irq", class_obscure, var_zinteger,
+                                  (char *) &ports[1].irq,
+                                  "Set COM2 interrupt request.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com3base", class_obscure, var_zinteger,
-                (char *) &ports[2].base,
-                "Set COM3 base i/o port address.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com3base", class_obscure, var_zinteger,
+                                  (char *) &ports[2].base,
+                                  "Set COM3 base i/o port address.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com3irq", class_obscure, var_zinteger,
-                (char *) &ports[2].irq,
-                "Set COM3 interrupt request.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com3irq", class_obscure, var_zinteger,
+                                  (char *) &ports[2].irq,
+                                  "Set COM3 interrupt request.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com4base", class_obscure, var_zinteger,
-                (char *) &ports[3].base,
-                "Set COM4 base i/o port address.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com4base", class_obscure, var_zinteger,
+                                  (char *) &ports[3].base,
+                                  "Set COM4 base i/o port address.",
+                                  &setlist),
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("com4irq", class_obscure, var_zinteger,
-                (char *) &ports[3].irq,
-                "Set COM4 interrupt request.",
-                &setlist),
-       &showlist);
+                     add_set_cmd ("com4irq", class_obscure, var_zinteger,
+                                  (char *) &ports[3].irq,
+                                  "Set COM4 interrupt request.",
+                                  &setlist),
+                     &showlist);
 
   add_info ("serial", dos_info,
            "Print DOS serial port status.");
index df0040edbf20aa23d0f79c61167eba97aa18f87a..7bab8ad76fd56ec5df43a644c4f71fad8b361767 100644 (file)
@@ -16,7 +16,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -100,11 +101,11 @@ mac_open (scb, name)
       return (-1);
     }
   /* We got something open. */
-  if (1 /* using custom buffer */)
+  if (1 /* using custom buffer */ )
     SerSetBuf (input_refnum, mac_input_buffer, 4096);
   /* Set to a GDB-preferred state. */
-  SerReset (input_refnum,  stop10|noParity|data8|baud9600);
-  SerReset (output_refnum, stop10|noParity|data8|baud9600);
+  SerReset (input_refnum, stop10 | noParity | data8 | baud9600);
+  SerReset (output_refnum, stop10 | noParity | data8 | baud9600);
   {
     CntrlParam cb;
     struct SerShk *handshake;
@@ -120,7 +121,7 @@ mac_open (scb, name)
     handshake->evts = 0;
     handshake->fInX = 0;
     handshake->fDTR = 0;
-    err = PBControl ((ParmBlkPtr) &cb, 0);
+    err = PBControl ((ParmBlkPtr) & cb, 0);
     if (err < 0)
       return (-1);
   }
@@ -168,7 +169,7 @@ mac_readchar (scb, timeout)
     {
       cb.ioCRefNum = input_refnum;
       cb.csCode = 2;
-      err = PBStatus ((ParmBlkPtr) &cb, 0);
+      err = PBStatus ((ParmBlkPtr) & cb, 0);
       if (err < 0)
        return SERIAL_ERROR;
       n = *((long *) &cb.csParam[0]);
@@ -177,7 +178,7 @@ mac_readchar (scb, timeout)
          pb.ioRefNum = input_refnum;
          pb.ioBuffer = (Ptr) (scb->buf);
          pb.ioReqCount = (n > 64 ? 64 : n);
-         err = PBRead ((ParmBlkPtr) &pb, 0);
+         err = PBRead ((ParmBlkPtr) & pb, 0);
          if (err < 0)
            return SERIAL_ERROR;
          scb->bufcnt = pb.ioReqCount;
@@ -243,23 +244,64 @@ mac_print_tty_state (scb, ttystate)
    to what the serial driver wants, we should use it.  Until
    we get one, this table will have to do.  */
 
-static struct {
+static struct
+{
   int real_rate;
   int bits;
-} mac_baud_rate_table[] = {
-  { 57600, baud57600 },
-  { 38400, 1 },
-  { 19200, baud19200 },
-  { 9600, baud9600 },
-  { 7200, baud7200 },
-  { 4800, baud4800 },
-  { 3600, baud3600 },
-  { 2400, baud2400 },
-  { 1800, baud1800 },
-  { 1200, baud1200 },
-  { 600, baud600 },
-  { 300, baud300 },
-  { 0, 0 }
+}
+mac_baud_rate_table[] =
+{
+  {
+    57600, baud57600
+  }
+  ,
+  {
+    38400, 1
+  }
+  ,
+  {
+    19200, baud19200
+  }
+  ,
+  {
+    9600, baud9600
+  }
+  ,
+  {
+    7200, baud7200
+  }
+  ,
+  {
+    4800, baud4800
+  }
+  ,
+  {
+    3600, baud3600
+  }
+  ,
+  {
+    2400, baud2400
+  }
+  ,
+  {
+    1800, baud1800
+  }
+  ,
+  {
+    1200, baud1200
+  }
+  ,
+  {
+    600, baud600
+  }
+  ,
+  {
+    300, baud300
+  }
+  ,
+  {
+    0, 0
+  }
 };
 
 static int
@@ -277,8 +319,8 @@ mac_set_baud_rate (scb, rate)
          break;
        }
     }
-  SerReset (input_refnum,  stop10|noParity|data8|bits);
-  SerReset (output_refnum, stop10|noParity|data8|bits);
+  SerReset (input_refnum, stop10 | noParity | data8 | bits);
+  SerReset (output_refnum, stop10 | noParity | data8 | bits);
 }
 
 static int
@@ -307,7 +349,7 @@ mac_write (scb, str, len)
   pb.ioRefNum = output_refnum;
   pb.ioBuffer = (Ptr) str;
   pb.ioReqCount = len;
-  err = PBWrite ((ParmBlkPtr) &pb, 0);
+  err = PBWrite ((ParmBlkPtr) & pb, 0);
   if (err < 0)
     {
       return 1;
@@ -320,14 +362,14 @@ mac_close (serial_t scb)
 {
   if (input_refnum)
     {
-      if (1 /* custom buffer */)
+      if (1 /* custom buffer */ )
        SerSetBuf (input_refnum, mac_input_buffer, 0);
       CloseDriver (input_refnum);
       input_refnum = 0;
     }
   if (output_refnum)
     {
-      if (0 /* custom buffer */)
+      if (0 /* custom buffer */ )
        SerSetBuf (input_refnum, mac_output_buffer, 0);
       CloseDriver (output_refnum);
       output_refnum = 0;
index 971f84e049c451e69e3b276714795125a7cebb0d..646985ff78c4d999a98e4950f8fedeb1eacd6240 100644 (file)
@@ -1,5 +1,5 @@
 /* Remote serial interface for Macraigor Systems implementation of
-       On-Chip Debugging using serial target box or serial wiggler
+   On-Chip Debugging using serial target box or serial wiggler
 
    Copyright 1994, 1997 Free Software Foundation, Inc.
 
@@ -17,7 +17,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -57,7 +58,7 @@ ocd_open (scb, name)
       if (handle == NULL)
        error ("Can't load Wigglers.dll");
 
-      dll_do_command = ((int (*) PARAMS ((const char *, char *)))
+      dll_do_command = ((int (*)PARAMS ((const char *, char *)))
                        GetProcAddress (handle, "do_command"));
       if (dll_do_command == NULL)
        error ("Can't find do_command function in Wigglers.dll");
@@ -91,7 +92,7 @@ ocd_readremote ()
 /* We need a buffer to store responses from the Wigglers.dll */
 #define WIGGLER_BUFF_SIZE 512
 unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE];
-unsigned char * wiggler_buffer_ptr;    /* curr spot in buffer */
+unsigned char *wiggler_buffer_ptr;     /* curr spot in buffer */
 
 static int
 ocd_readchar (scb, timeout)
@@ -100,13 +101,14 @@ ocd_readchar (scb, timeout)
 {
   /* Catch attempts at reading past the end of the buffer */
   if (wiggler_buffer_ptr >
-              (from_wiggler_buffer + (sizeof (char *) * WIGGLER_BUFF_SIZE)))
-    error ("ocd_readchar asked to read past the end of the buffer!");
+      (from_wiggler_buffer + (sizeof (char *) * WIGGLER_BUFF_SIZE)))
+      error ("ocd_readchar asked to read past the end of the buffer!");
 
-  return (int) *wiggler_buffer_ptr++; /* return curr char and increment ptr */
+  return (int) *wiggler_buffer_ptr++;  /* return curr char and increment ptr */
 }
 
-struct ocd_ttystate {
+struct ocd_ttystate
+{
   int dummy;
 };
 
@@ -166,9 +168,9 @@ ocd_write (scb, str, len)
 {
   char c;
 
-#ifdef _WIN32 
+#ifdef _WIN32
   /* send packet to Wigglers.dll and store response so we can give it to
-       remote-wiggler.c when get_packet is run */
+     remote-wiggler.c when get_packet is run */
   dll_do_command (str, from_wiggler_buffer);
   wiggler_buffer_ptr = from_wiggler_buffer;
 #endif
@@ -190,16 +192,16 @@ static struct serial_ops ocd_ops =
   ocd_close,
   ocd_readchar,
   ocd_write,
-  ocd_noop,            /* flush output */
-  ocd_noop,            /* flush input */
-  ocd_noop,            /* send break -- currently used only for nindy */
+  ocd_noop,                    /* flush output */
+  ocd_noop,                    /* flush input */
+  ocd_noop,                    /* send break -- currently used only for nindy */
   ocd_raw,
   ocd_get_tty_state,
   ocd_set_tty_state,
   ocd_print_tty_state,
   ocd_noflush_set_tty_state,
   ocd_setbaudrate,
-  ocd_noop,            /* wait for output to drain */
+  ocd_noop,                    /* wait for output to drain */
 };
 
 void
index e6443a08f5c82cc795f5c892ab3df3a279c5a053..83a84fc7ac319d2a5b8c222a6219dc3a54e33d46 100644 (file)
@@ -1,21 +1,22 @@
 /* Serial interface for raw TCP connections on Un*x like systems
    Copyright 1992, 1993, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -39,9 +40,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 extern int (*ui_loop_hook) PARAMS ((int));
 
 struct tcp_ttystate
-{
-  int bogus;
-};
+  {
+    int bogus;
+  };
 
 static int tcp_open PARAMS ((serial_t scb, const char *name));
 static void tcp_raw PARAMS ((serial_t scb));
@@ -64,7 +65,7 @@ void _initialize_ser_tcp PARAMS ((void));
 /* Open up a raw tcp socket */
 
 static int
-tcp_open(scb, name)
+tcp_open (scb, name)
      serial_t scb;
      const char *name;
 {
@@ -80,10 +81,10 @@ tcp_open(scb, name)
   port_str = strchr (name, ':');
 
   if (!port_str)
-    error ("tcp_open: No colon in host name!"); /* Shouldn't ever happen */
+    error ("tcp_open: No colon in host name!");                /* Shouldn't ever happen */
 
   tmp = min (port_str - name, (int) sizeof hostname - 1);
-  strncpy (hostname, name, tmp); /* Don't want colon */
+  strncpy (hostname, name, tmp);       /* Don't want colon */
   hostname[tmp] = '\000';      /* Tie off host name */
   port = atoi (port_str + 1);
 
@@ -104,18 +105,18 @@ tcp_open(scb, name)
 
       /* Allow rapid reuse of this port. */
       tmp = 1;
-      setsockopt (scb->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&tmp, sizeof(tmp));
+      setsockopt (scb->fd, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, sizeof (tmp));
 
       /* Enable TCP keep alive process. */
       tmp = 1;
-      setsockopt (scb->fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&tmp, sizeof(tmp));
+      setsockopt (scb->fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
 
       sockaddr.sin_family = PF_INET;
-      sockaddr.sin_port = htons(port);
+      sockaddr.sin_port = htons (port);
       memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr,
              sizeof (struct in_addr));
 
-      if (!connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr)))
+      if (!connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)))
        break;
 
       close (scb->fd);
@@ -136,34 +137,34 @@ tcp_open(scb, name)
 
   tmp = 1;
   if (setsockopt (scb->fd, protoent->p_proto, TCP_NODELAY,
-                 (char *)&tmp, sizeof(tmp)))
+                 (char *) &tmp, sizeof (tmp)))
     return -1;
 
-  signal(SIGPIPE, SIG_IGN);    /* If we don't do this, then GDB simply exits
+  signal (SIGPIPE, SIG_IGN);   /* If we don't do this, then GDB simply exits
                                   when the remote side dies.  */
 
   return 0;
 }
 
 static serial_ttystate
-tcp_get_tty_state(scb)
+tcp_get_tty_state (scb)
      serial_t scb;
 {
   struct tcp_ttystate *state;
 
-  state = (struct tcp_ttystate *)xmalloc(sizeof *state);
+  state = (struct tcp_ttystate *) xmalloc (sizeof *state);
 
-  return (serial_ttystate)state;
+  return (serial_ttystate) state;
 }
 
 static int
-tcp_set_tty_state(scb, ttystate)
+tcp_set_tty_state (scb, ttystate)
      serial_t scb;
      serial_ttystate ttystate;
 {
   struct tcp_ttystate *state;
 
-  state = (struct tcp_ttystate *)ttystate;
+  state = (struct tcp_ttystate *) ttystate;
 
   return 0;
 }
@@ -176,7 +177,7 @@ tcp_return_0 (scb)
 }
 
 static void
-tcp_raw(scb)
+tcp_raw (scb)
      serial_t scb;
 {
   return;                      /* Always in raw mode */
@@ -204,25 +205,25 @@ wait_for (scb, timeout)
   tv.tv_sec = timeout;
   tv.tv_usec = 0;
 
-  FD_SET(scb->fd, &readfds);
-  FD_SET(scb->fd, &exceptfds);
+  FD_SET (scb->fd, &readfds);
+  FD_SET (scb->fd, &exceptfds);
 
   while (1)
     {
       if (timeout >= 0)
-       numfds = select(scb->fd+1, &readfds, 0, &exceptfds, &tv);
+       numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, &tv);
       else
-       numfds = select(scb->fd+1, &readfds, 0, &exceptfds, 0);
+       numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, 0);
 
       if (numfds <= 0)
-        {
+       {
          if (numfds == 0)
            return SERIAL_TIMEOUT;
          else if (errno == EINTR)
            continue;
          else
            return SERIAL_ERROR;        /* Got an error from select or poll */
-        }
+       }
 
       return 0;
     }
@@ -250,16 +251,16 @@ tcp_readchar (scb, timeout)
 
      Also, timeout = 0 means to poll, so we just set the delta to 0, so we
      will only go through the loop once. */
-   
+
   delta = (timeout == 0 ? 0 : 1);
   while (1)
     {
 
       /* N.B. The UI may destroy our world (for instance by calling
-        remote_stop,) in which case we want to get out of here as
-        quickly as possible.  It is not safe to touch scb, since
-        someone else might have freed it.  The ui_loop_hook signals that 
-        we should exit by returning 1. */
+         remote_stop,) in which case we want to get out of here as
+         quickly as possible.  It is not safe to touch scb, since
+         someone else might have freed it.  The ui_loop_hook signals that 
+         we should exit by returning 1. */
 
       if (ui_loop_hook)
        {
@@ -272,15 +273,15 @@ tcp_readchar (scb, timeout)
 
       /* If we got a character or an error back from wait_for, then we can 
          break from the loop before the timeout is completed. */
-      
+
       if (status != SERIAL_TIMEOUT)
        {
          break;
        }
 
       /* If we have exhausted the original timeout, then generate
-        a SERIAL_TIMEOUT, and pass it out of the loop. */
-      
+         a SERIAL_TIMEOUT, and pass it out of the loop. */
+
       else if (timeout == 0)
        {
          status == SERIAL_TIMEOUT;
@@ -293,7 +294,7 @@ tcp_readchar (scb, timeout)
 
   while (1)
     {
-      scb->bufcnt = read(scb->fd, scb->buf, BUFSIZ);
+      scb->bufcnt = read (scb->fd, scb->buf, BUFSIZ);
       if (scb->bufcnt != -1 || errno != EINTR)
        break;
     }
@@ -301,11 +302,11 @@ tcp_readchar (scb, timeout)
   if (scb->bufcnt <= 0)
     {
       if (scb->bufcnt == 0)
-        return SERIAL_TIMEOUT; /* 0 chars means timeout [may need to
-                                    distinguish between EOF & timeouts
-                                    someday] */
+       return SERIAL_TIMEOUT;  /* 0 chars means timeout [may need to
+                                  distinguish between EOF & timeouts
+                                  someday] */
       else
-        return SERIAL_ERROR;   /* Got an error from read */
+       return SERIAL_ERROR;    /* Got an error from read */
     }
 
   scb->bufcnt--;
@@ -332,7 +333,7 @@ tcp_print_tty_state (scb, ttystate)
 }
 
 static int
-tcp_setbaudrate(scb, rate)
+tcp_setbaudrate (scb, rate)
      serial_t scb;
      int rate;
 {
@@ -340,7 +341,7 @@ tcp_setbaudrate(scb, rate)
 }
 
 static int
-tcp_setstopbits(scb, num)
+tcp_setstopbits (scb, num)
      serial_t scb;
      int num;
 {
@@ -348,7 +349,7 @@ tcp_setstopbits(scb, num)
 }
 
 static int
-tcp_write(scb, str, len)
+tcp_write (scb, str, len)
      serial_t scb;
      const char *str;
      int len;
@@ -357,7 +358,7 @@ tcp_write(scb, str, len)
 
   while (len > 0)
     {
-      cc = write(scb->fd, str, len);
+      cc = write (scb->fd, str, len);
 
       if (cc < 0)
        return 1;
@@ -368,13 +369,13 @@ tcp_write(scb, str, len)
 }
 
 static void
-tcp_close(scb)
+tcp_close (scb)
      serial_t scb;
 {
   if (scb->fd < 0)
     return;
 
-  close(scb->fd);
+  close (scb->fd);
   scb->fd = -1;
 }
 
@@ -386,9 +387,9 @@ static struct serial_ops tcp_ops =
   tcp_close,
   tcp_readchar,
   tcp_write,
-  tcp_return_0, /* flush output */
-  tcp_return_0, /* flush input */
-  tcp_return_0, /* send break */
+  tcp_return_0,                        /* flush output */
+  tcp_return_0,                        /* flush input */
+  tcp_return_0,                        /* send break */
   tcp_raw,
   tcp_get_tty_state,
   tcp_set_tty_state,
@@ -396,7 +397,7 @@ static struct serial_ops tcp_ops =
   tcp_noflush_set_tty_state,
   tcp_setbaudrate,
   tcp_setstopbits,
-  tcp_return_0,        /* wait for output to drain */
+  tcp_return_0,                        /* wait for output to drain */
 };
 
 void
index dc5236fbe662330acde9f9b80359176fc06bdf11..c92567bd0338786fe1db812ef4af44e29100b4a9 100644 (file)
@@ -1,21 +1,22 @@
 /* Serial interface for local (hardwired) serial ports on Un*x like systems
    Copyright 1992, 1993, 1994, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -29,9 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifdef HAVE_TERMIOS
 
 struct hardwire_ttystate
-{
-  struct termios termios;
-};
+  {
+    struct termios termios;
+  };
 #endif /* termios */
 
 #ifdef HAVE_TERMIO
@@ -42,9 +43,9 @@ struct hardwire_ttystate
    bewildering.  So we don't attempt it.  */
 
 struct hardwire_ttystate
-{
-  struct termio termio;
-};
+  {
+    struct termio termio;
+  };
 #endif /* termio */
 
 #ifdef HAVE_SGTTY
@@ -53,13 +54,13 @@ struct hardwire_ttystate
 #include <sys/time.h>
 
 struct hardwire_ttystate
-{
-  struct sgttyb sgttyb;
-  struct tchars tc;
-  struct ltchars ltc;
-  /* Line discipline flags.  */
-  int lmode;
-};
+  {
+    struct sgttyb sgttyb;
+    struct tchars tc;
+    struct ltchars ltc;
+    /* Line discipline flags.  */
+    int lmode;
+  };
 #endif /* sgtty */
 
 static int hardwire_open PARAMS ((serial_t scb, const char *name));
@@ -70,8 +71,8 @@ static int rate_to_code PARAMS ((int rate));
 static int hardwire_setbaudrate PARAMS ((serial_t scb, int rate));
 static int hardwire_write PARAMS ((serial_t scb, const char *str, int len));
 static void hardwire_close PARAMS ((serial_t scb));
-static int get_tty_state PARAMS ((serial_t scb, struct hardwire_ttystate *state));
-static int set_tty_state PARAMS ((serial_t scb, struct hardwire_ttystate *state));
+static int get_tty_state PARAMS ((serial_t scb, struct hardwire_ttystate * state));
+static int set_tty_state PARAMS ((serial_t scb, struct hardwire_ttystate * state));
 static serial_ttystate hardwire_get_tty_state PARAMS ((serial_t scb));
 static int hardwire_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
 static int hardwire_noflush_set_tty_state PARAMS ((serial_t, serial_ttystate,
@@ -90,7 +91,7 @@ extern int (*ui_loop_hook) PARAMS ((int));
 /* Open up a real live device for serial I/O */
 
 static int
-hardwire_open(scb, name)
+hardwire_open (scb, name)
      serial_t scb;
      const char *name;
 {
@@ -107,7 +108,7 @@ get_tty_state (scb, state)
      struct hardwire_ttystate *state;
 {
 #ifdef HAVE_TERMIOS
-  if (tcgetattr(scb->fd, &state->termios) < 0)
+  if (tcgetattr (scb->fd, &state->termios) < 0)
     return -1;
 
   return 0;
@@ -134,12 +135,12 @@ get_tty_state (scb, state)
 }
 
 static int
-set_tty_state(scb, state)
+set_tty_state (scb, state)
      serial_t scb;
      struct hardwire_ttystate *state;
 {
 #ifdef HAVE_TERMIOS
-  if (tcsetattr(scb->fd, TCSANOW, &state->termios) < 0)
+  if (tcsetattr (scb->fd, TCSANOW, &state->termios) < 0)
     return -1;
 
   return 0;
@@ -166,29 +167,29 @@ set_tty_state(scb, state)
 }
 
 static serial_ttystate
-hardwire_get_tty_state(scb)
+hardwire_get_tty_state (scb)
      serial_t scb;
 {
   struct hardwire_ttystate *state;
 
-  state = (struct hardwire_ttystate *)xmalloc(sizeof *state);
+  state = (struct hardwire_ttystate *) xmalloc (sizeof *state);
 
-  if (get_tty_state(scb, state))
+  if (get_tty_state (scb, state))
     return NULL;
 
-  return (serial_ttystate)state;
+  return (serial_ttystate) state;
 }
 
 static int
-hardwire_set_tty_state(scb, ttystate)
+hardwire_set_tty_state (scb, ttystate)
      serial_t scb;
      serial_ttystate ttystate;
 {
   struct hardwire_ttystate *state;
 
-  state = (struct hardwire_ttystate *)ttystate;
+  state = (struct hardwire_ttystate *) ttystate;
 
-  return set_tty_state(scb, state);
+  return set_tty_state (scb, state);
 }
 
 static int
@@ -202,7 +203,7 @@ hardwire_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
   struct hardwire_ttystate *state = (struct hardwire_ttystate *) old_ttystate;
 #endif
 
-  new_state = *(struct hardwire_ttystate *)new_ttystate;
+  new_state = *(struct hardwire_ttystate *) new_ttystate;
 
   /* Don't change in or out of raw mode; we don't want to flush input.
      termio and termios have no such restriction; for them flushing input
@@ -265,13 +266,13 @@ hardwire_print_tty_state (scb, ttystate)
   printf_filtered ("sgttyb.sg_flags = 0x%x.\n", state->sgttyb.sg_flags);
 
   printf_filtered ("tchars: ");
-  for (i = 0; i < (int)sizeof (struct tchars); i++)
-    printf_filtered ("0x%x ", ((unsigned char *)&state->tc)[i]);
+  for (i = 0; i < (int) sizeof (struct tchars); i++)
+    printf_filtered ("0x%x ", ((unsigned char *) &state->tc)[i]);
   printf_filtered ("\n");
 
   printf_filtered ("ltchars: ");
-  for (i = 0; i < (int)sizeof (struct ltchars); i++)
-    printf_filtered ("0x%x ", ((unsigned char *)&state->ltc)[i]);
+  for (i = 0; i < (int) sizeof (struct ltchars); i++)
+    printf_filtered ("0x%x ", ((unsigned char *) &state->ltc)[i]);
   printf_filtered ("\n");
 
   printf_filtered ("lmode:  0x%x\n", state->lmode);
@@ -307,7 +308,7 @@ hardwire_drain_output (scb)
        return (ioctl (scb->fd, TIOCSETP, &state.sgttyb));
       }
   }
-#endif  
+#endif
 }
 
 static int
@@ -325,7 +326,7 @@ hardwire_flush_output (scb)
 #ifdef HAVE_SGTTY
   /* This flushes both input and output, but we can't do better.  */
   return ioctl (scb->fd, TIOCFLUSH, 0);
-#endif  
+#endif
 }
 
 static int
@@ -346,7 +347,7 @@ hardwire_flush_input (scb)
 #ifdef HAVE_SGTTY
   /* This flushes both input and output, but we can't do better.  */
   return ioctl (scb->fd, TIOCFLUSH, 0);
-#endif  
+#endif
 }
 
 static int
@@ -377,23 +378,23 @@ hardwire_send_break (scb)
     status = ioctl (scb->fd, TIOCCBRK, 0);
     return status;
   }
-#endif  
+#endif
 }
 
 static void
-hardwire_raw(scb)
+hardwire_raw (scb)
      serial_t scb;
 {
   struct hardwire_ttystate state;
 
-  if (get_tty_state(scb, &state))
-    fprintf_unfiltered(gdb_stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
+  if (get_tty_state (scb, &state))
+    fprintf_unfiltered (gdb_stderr, "get_tty_state failed: %s\n", safe_strerror (errno));
 
 #ifdef HAVE_TERMIOS
   state.termios.c_iflag = 0;
   state.termios.c_oflag = 0;
   state.termios.c_lflag = 0;
-  state.termios.c_cflag &= ~(CSIZE|PARENB);
+  state.termios.c_cflag &= ~(CSIZE | PARENB);
   state.termios.c_cflag |= CLOCAL | CS8;
   state.termios.c_cc[VMIN] = 0;
   state.termios.c_cc[VTIME] = 0;
@@ -403,7 +404,7 @@ hardwire_raw(scb)
   state.termio.c_iflag = 0;
   state.termio.c_oflag = 0;
   state.termio.c_lflag = 0;
-  state.termio.c_cflag &= ~(CSIZE|PARENB);
+  state.termio.c_cflag &= ~(CSIZE | PARENB);
   state.termio.c_cflag |= CLOCAL | CS8;
   state.termio.c_cc[VMIN] = 0;
   state.termio.c_cc[VTIME] = 0;
@@ -417,7 +418,7 @@ hardwire_raw(scb)
   scb->current_timeout = 0;
 
   if (set_tty_state (scb, &state))
-    fprintf_unfiltered(gdb_stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
+    fprintf_unfiltered (gdb_stderr, "set_tty_state failed: %s\n", safe_strerror (errno));
 }
 
 /* Wait for input on scb, with timeout seconds.  Returns 0 on success,
@@ -428,7 +429,7 @@ hardwire_raw(scb)
  */
 
 static int
-wait_for(scb, timeout)
+wait_for (scb, timeout)
      serial_t scb;
      int timeout;
 {
@@ -442,16 +443,16 @@ wait_for(scb, timeout)
     tv.tv_sec = timeout;
     tv.tv_usec = 0;
 
-    FD_SET(scb->fd, &readfds);
+    FD_SET (scb->fd, &readfds);
 
     while (1)
       {
        int numfds;
 
        if (timeout >= 0)
-         numfds = select(scb->fd+1, &readfds, 0, 0, &tv);
+         numfds = select (scb->fd + 1, &readfds, 0, 0, &tv);
        else
-         numfds = select(scb->fd+1, &readfds, 0, 0, 0);
+         numfds = select (scb->fd + 1, &readfds, 0, 0, 0);
 
        if (numfds <= 0)
          if (numfds == 0)
@@ -464,7 +465,7 @@ wait_for(scb, timeout)
        return 0;
       }
   }
-#endif /* HAVE_SGTTY */
+#endif /* HAVE_SGTTY */
 
 #if defined HAVE_TERMIO || defined HAVE_TERMIOS
   if (timeout == scb->current_timeout)
@@ -475,8 +476,8 @@ wait_for(scb, timeout)
   {
     struct hardwire_ttystate state;
 
-    if (get_tty_state(scb, &state))
-      fprintf_unfiltered(gdb_stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
+    if (get_tty_state (scb, &state))
+      fprintf_unfiltered (gdb_stderr, "get_tty_state failed: %s\n", safe_strerror (errno));
 
 #ifdef HAVE_TERMIOS
     if (timeout < 0)
@@ -528,11 +529,11 @@ wait_for(scb, timeout)
 #endif
 
     if (set_tty_state (scb, &state))
-      fprintf_unfiltered(gdb_stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
+      fprintf_unfiltered (gdb_stderr, "set_tty_state failed: %s\n", safe_strerror (errno));
 
     return 0;
   }
-#endif /* HAVE_TERMIO || HAVE_TERMIOS */
+#endif /* HAVE_TERMIO || HAVE_TERMIOS */
 }
 
 /* Read a character with user-specified timeout.  TIMEOUT is number of seconds
@@ -558,7 +559,7 @@ hardwire_readchar (scb, timeout)
      each time through the loop.
      Also, timeout = 0 means to poll, so we just set the delta to 0, so we
      will only go through the loop once. */
-   
+
   delta = (timeout == 0 ? 0 : 1);
   while (1)
     {
@@ -570,7 +571,7 @@ hardwire_readchar (scb, timeout)
          we should exit by returning 1. */
 
       if (ui_loop_hook)
-        detach = ui_loop_hook (0);
+       detach = ui_loop_hook (0);
 
       if (detach)
        return SERIAL_TIMEOUT;
@@ -588,14 +589,14 @@ hardwire_readchar (scb, timeout)
          if (scb->bufcnt == 0)
            {
              /* Zero characters means timeout (it could also be EOF, but
-                we don't (yet at least) distinguish).  */
+                we don't (yet at least) distinguish).  */
              if (scb->timeout_remaining > 0)
                {
                  timeout = scb->timeout_remaining;
                  continue;
                }
-          else if (scb->timeout_remaining < 0)
-            continue;
+             else if (scb->timeout_remaining < 0)
+               continue;
              else
                return SERIAL_TIMEOUT;
            }
@@ -629,57 +630,117 @@ static struct
 }
 baudtab[] =
 {
-  {50, B50},
-  {75, B75},
-  {110, B110},
-  {134, B134},
-  {150, B150},
-  {200, B200},
-  {300, B300},
-  {600, B600},
-  {1200, B1200},
-  {1800, B1800},
-  {2400, B2400},
-  {4800, B4800},
-  {9600, B9600},
-  {19200, B19200},
-  {38400, B38400},
+  {
+    50, B50
+  }
+  ,
+  {
+    75, B75
+  }
+  ,
+  {
+    110, B110
+  }
+  ,
+  {
+    134, B134
+  }
+  ,
+  {
+    150, B150
+  }
+  ,
+  {
+    200, B200
+  }
+  ,
+  {
+    300, B300
+  }
+  ,
+  {
+    600, B600
+  }
+  ,
+  {
+    1200, B1200
+  }
+  ,
+  {
+    1800, B1800
+  }
+  ,
+  {
+    2400, B2400
+  }
+  ,
+  {
+    4800, B4800
+  }
+  ,
+  {
+    9600, B9600
+  }
+  ,
+  {
+    19200, B19200
+  }
+  ,
+  {
+    38400, B38400
+  }
+  ,
 #ifdef B57600
-  {57600, B57600},
+  {
+    57600, B57600
+  }
+  ,
 #endif
 #ifdef B115200
-  {115200, B115200},
+  {
+    115200, B115200
+  }
+  ,
 #endif
 #ifdef B230400
-  {230400, B230400},
+  {
+    230400, B230400
+  }
+  ,
 #endif
 #ifdef B460800
-  {460800, B460800},
+  {
+    460800, B460800
+  }
+  ,
 #endif
-  {-1, -1},
+  {
+    -1, -1
+  }
+  ,
 };
 
-static int 
-rate_to_code(rate)
+static int
+rate_to_code (rate)
      int rate;
 {
   int i;
 
   for (i = 0; baudtab[i].rate != -1; i++)
-    if (rate == baudtab[i].rate)  
+    if (rate == baudtab[i].rate)
       return baudtab[i].code;
 
   return -1;
 }
 
 static int
-hardwire_setbaudrate(scb, rate)
+hardwire_setbaudrate (scb, rate)
      serial_t scb;
      int rate;
 {
   struct hardwire_ttystate state;
 
-  if (get_tty_state(scb, &state))
+  if (get_tty_state (scb, &state))
     return -1;
 
 #ifdef HAVE_TERMIOS
@@ -705,14 +766,14 @@ hardwire_setbaudrate(scb, rate)
 }
 
 static int
-hardwire_setstopbits(scb, num)
+hardwire_setstopbits (scb, num)
      serial_t scb;
      int num;
 {
   struct hardwire_ttystate state;
   int newbit;
 
-  if (get_tty_state(scb, &state))
+  if (get_tty_state (scb, &state))
     return -1;
 
   switch (num)
@@ -732,14 +793,14 @@ hardwire_setstopbits(scb, num)
   if (!newbit)
     state.termios.c_cflag &= ~CSTOPB;
   else
-    state.termios.c_cflag |= CSTOPB; /* two bits */
+    state.termios.c_cflag |= CSTOPB;   /* two bits */
 #endif
 
 #ifdef HAVE_TERMIO
   if (!newbit)
     state.termio.c_cflag &= ~CSTOPB;
   else
-    state.termio.c_cflag |= CSTOPB; /* two bits */
+    state.termio.c_cflag |= CSTOPB;    /* two bits */
 #endif
 
 #ifdef HAVE_SGTTY
@@ -750,7 +811,7 @@ hardwire_setstopbits(scb, num)
 }
 
 static int
-hardwire_write(scb, str, len)
+hardwire_write (scb, str, len)
      serial_t scb;
      const char *str;
      int len;
@@ -759,7 +820,7 @@ hardwire_write(scb, str, len)
 
   while (len > 0)
     {
-      cc = write(scb->fd, str, len);
+      cc = write (scb->fd, str, len);
 
       if (cc < 0)
        return 1;
@@ -770,13 +831,13 @@ hardwire_write(scb, str, len)
 }
 
 static void
-hardwire_close(scb)
+hardwire_close (scb)
      serial_t scb;
 {
   if (scb->fd < 0)
     return;
 
-  close(scb->fd);
+  close (scb->fd);
   scb->fd = -1;
 }
 
index 75a221cbc7ad7cf6c800cb92fbcd3f9c75d7a485..6cb203098b4cbb3be89f16dd2e499bbb60061c71 100644 (file)
@@ -1,21 +1,22 @@
 /* Generic serial interface routines
    Copyright 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <ctype.h>
@@ -48,10 +49,11 @@ static void serial_logchar PARAMS ((int, int, int));
 static char logbase_hex[] = "hex";
 static char logbase_octal[] = "octal";
 static char logbase_ascii[] = "ascii";
-static char *logbase_enums[] = {logbase_hex, logbase_octal, logbase_ascii, NULL};
+static char *logbase_enums[] =
+{logbase_hex, logbase_octal, logbase_ascii, NULL};
 static char *serial_logbase = logbase_ascii;
-
 \f
+
 static int serial_current_type = 0;
 
 /* Log char CH of type CHTYPE, with TIMEOUT */
@@ -97,14 +99,30 @@ serial_logchar (ch_type, ch, timeout)
       else
        switch (ch)
          {
-         case '\\':    fputs_unfiltered ("\\\\", serial_logfp); break; 
-         case '\b':    fputs_unfiltered ("\\b", serial_logfp); break;  
-         case '\f':    fputs_unfiltered ("\\f", serial_logfp); break;  
-         case '\n':    fputs_unfiltered ("\\n", serial_logfp); break;  
-         case '\r':    fputs_unfiltered ("\\r", serial_logfp); break;  
-         case '\t':    fputs_unfiltered ("\\t", serial_logfp); break;  
-         case '\v':    fputs_unfiltered ("\\v", serial_logfp); break;  
-         default:      fprintf_unfiltered (serial_logfp, isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF); break;
+         case '\\':
+           fputs_unfiltered ("\\\\", serial_logfp);
+           break;
+         case '\b':
+           fputs_unfiltered ("\\b", serial_logfp);
+           break;
+         case '\f':
+           fputs_unfiltered ("\\f", serial_logfp);
+           break;
+         case '\n':
+           fputs_unfiltered ("\\n", serial_logfp);
+           break;
+         case '\r':
+           fputs_unfiltered ("\\r", serial_logfp);
+           break;
+         case '\t':
+           fputs_unfiltered ("\\t", serial_logfp);
+           break;
+         case '\v':
+           fputs_unfiltered ("\\v", serial_logfp);
+           break;
+         default:
+           fprintf_unfiltered (serial_logfp, isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF);
+           break;
          }
     }
 }
@@ -140,11 +158,11 @@ serial_write (scb, str, len)
        serial_logchar ('w', str[count] & 0xff, 0);
 
       /* Make sure that the log file is as up-to-date as possible,
-        in case we are getting ready to dump core or something. */
+         in case we are getting ready to dump core or something. */
       gdb_flush (serial_logfp);
     }
 
-  return (scb -> ops -> write (scb, str, len));
+  return (scb->ops->write (scb, str, len));
 }
 
 int
@@ -154,13 +172,13 @@ serial_readchar (scb, timeout)
 {
   int ch;
 
-  ch = scb -> ops -> readchar (scb, timeout);
+  ch = scb->ops->readchar (scb, timeout);
   if (serial_logfp != NULL)
     {
       serial_logchar ('r', ch, timeout);
 
       /* Make sure that the log file is as up-to-date as possible,
-        in case we are getting ready to dump core or something. */
+         in case we are getting ready to dump core or something. */
       gdb_flush (serial_logfp);
     }
 
@@ -174,7 +192,7 @@ serial_send_break (scb)
   if (serial_logfp != NULL)
     serial_logchar ('w', SERIAL_BREAK, 0);
 
-  return (scb -> ops -> send_break (scb));
+  return (scb->ops->send_break (scb));
 }
 
 static struct serial_ops *
@@ -191,7 +209,7 @@ serial_interface_lookup (name)
 }
 
 void
-serial_add_interface(optable)
+serial_add_interface (optable)
      struct serial_ops *optable;
 {
   optable->next = serial_ops_list;
@@ -228,14 +246,14 @@ serial_open (name)
   if (!ops)
     return NULL;
 
-  scb = (serial_t)xmalloc (sizeof (struct _serial_t));
+  scb = (serial_t) xmalloc (sizeof (struct _serial_t));
 
   scb->ops = ops;
 
   scb->bufcnt = 0;
   scb->bufp = scb->buf;
 
-  if (scb->ops->open(scb, name))
+  if (scb->ops->open (scb, name))
     {
       free (scb);
       return NULL;
@@ -277,7 +295,7 @@ serial_fdopen (fd)
   if (!ops)
     return NULL;
 
-  scb = (serial_t)xmalloc (sizeof (struct _serial_t));
+  scb = (serial_t) xmalloc (sizeof (struct _serial_t));
 
   scb->ops = ops;
 
@@ -311,7 +329,7 @@ serial_close (scb, really_close)
       serial_current_type = 0;
 
       /* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
-      gdb_fclose (&serial_logfp); 
+      gdb_fclose (&serial_logfp);
       serial_logfp = NULL;
     }
 
@@ -343,33 +361,33 @@ serial_close (scb, really_close)
        break;
       }
 
-  free(scb);
+  free (scb);
 }
 
 #if 0
 /*
-The connect command is #if 0 because I hadn't thought of an elegant
-way to wait for I/O on two serial_t's simultaneously.  Two solutions
-came to mind:
+   The connect command is #if 0 because I hadn't thought of an elegant
+   way to wait for I/O on two serial_t's simultaneously.  Two solutions
+   came to mind:
 
-       1) Fork, and have have one fork handle the to user direction,
-          and have the other hand the to target direction.  This
-          obviously won't cut it for MSDOS.
+   1) Fork, and have have one fork handle the to user direction,
+   and have the other hand the to target direction.  This
+   obviously won't cut it for MSDOS.
 
-       2) Use something like select.  This assumes that stdin and
-          the target side can both be waited on via the same
-          mechanism.  This may not be true for DOS, if GDB is
-          talking to the target via a TCP socket.
--grossman, 8 Jun 93
-*/
+   2) Use something like select.  This assumes that stdin and
+   the target side can both be waited on via the same
+   mechanism.  This may not be true for DOS, if GDB is
+   talking to the target via a TCP socket.
+   -grossman, 8 Jun 93
+ */
 
 /* Connect the user directly to the remote system.  This command acts just like
    the 'cu' or 'tip' command.  Use <CR>~. or <CR>~^D to break out.  */
 
-static serial_t tty_desc;              /* Controlling terminal */
+static serial_t tty_desc;      /* Controlling terminal */
 
 static void
-cleanup_tty(ttystate)
+cleanup_tty (ttystate)
      serial_ttystate ttystate;
 {
   printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
@@ -380,20 +398,20 @@ cleanup_tty(ttystate)
 
 static void
 connect_command (args, fromtty)
-     char      *args;
-     int       fromtty;
+     char *args;
+     int fromtty;
 {
   int c;
   char cur_esc = 0;
   serial_ttystate ttystate;
   serial_t port_desc;          /* TTY port */
 
-  dont_repeat();
+  dont_repeat ();
 
   if (args)
-    fprintf_unfiltered(gdb_stderr, "This command takes no args.  They have been ignored.\n");
-       
-  printf_unfiltered("[Entering connect mode.  Use ~. or ~^D to escape]\n");
+    fprintf_unfiltered (gdb_stderr, "This command takes no args.  They have been ignored.\n");
+
+  printf_unfiltered ("[Entering connect mode.  Use ~. or ~^D to escape]\n");
 
   tty_desc = SERIAL_FDOPEN (0);
   port_desc = last_serial_opened;
@@ -417,16 +435,16 @@ connect_command (args, fromtty)
 
          while (1)
            {
-             c = SERIAL_READCHAR(tty_desc, 0);
+             c = SERIAL_READCHAR (tty_desc, 0);
 
              if (c == SERIAL_TIMEOUT)
-                 break;
+               break;
 
              if (c < 0)
-               perror_with_name("connect");
+               perror_with_name ("connect");
 
              cx = c;
-             SERIAL_WRITE(port_desc, &cx, 1);
+             SERIAL_WRITE (port_desc, &cx, 1);
 
              switch (cur_esc)
                {
@@ -455,17 +473,17 @@ connect_command (args, fromtty)
 
          while (1)
            {
-             c = SERIAL_READCHAR(port_desc, 0);
+             c = SERIAL_READCHAR (port_desc, 0);
 
              if (c == SERIAL_TIMEOUT)
-                 break;
+               break;
 
              if (c < 0)
-               perror_with_name("connect");
+               perror_with_name ("connect");
 
              cx = c;
 
-             SERIAL_WRITE(tty_desc, &cx, 1);
+             SERIAL_WRITE (tty_desc, &cx, 1);
            }
        }
     }
@@ -475,7 +493,7 @@ connect_command (args, fromtty)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-serial_printf (serial_t desc, const char *format, ...)
+serial_printf (serial_t desc, const char *format,...)
 #else
 serial_printf (va_alist)
      va_dcl
@@ -510,16 +528,16 @@ _initialize_serial ()
 Use <CR>~. or <CR>~^D to break out.");
 #endif /* 0 */
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_cmd ("remotelogfile", no_class,
                  var_filename, (char *) &serial_logfile,
                  "Set filename for remote session recording.\n\
 This file is used to record the remote session for future playback\n\
-by gdbserver.", 
+by gdbserver.",
                  &setlist),
      &showlist);
 
-  add_show_from_set 
+  add_show_from_set
     (add_set_enum_cmd ("remotelogbase", no_class,
                       logbase_enums, (char *) &serial_logbase,
                       "Set numerical base for remote session logging",
index 04332bcb11fc9c5cad42e5d86945b64bf76f75c8..fa37cab9de8139b855b2f604e6f0b038d363eccd 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote serial support interface definitions for GDB, the GNU Debugger.
    Copyright 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef SERIAL_H
 #define SERIAL_H
@@ -25,51 +26,52 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 typedef PTR serial_ttystate;
 
 struct _serial_t
-{
-  int fd;                      /* File descriptor */
-  struct serial_ops *ops;      /* Function vector */
-  serial_ttystate ttystate;    /* Not used (yet) */
-  int bufcnt;                  /* Amount of data in receive buffer */
-  unsigned char *bufp;         /* Current byte */
-  unsigned char buf[BUFSIZ];   /* Da buffer itself */
-  int current_timeout;         /* (termio{s} only), last value of VTIME */
-  /* ser-unix.c termio{,s} only, we still need to wait for this many more
-     seconds.  */
-  int timeout_remaining;
-  char *name;                  /* The name of the device or host */
-  struct _serial_t *next;      /* Pointer to the next serial_t */
-  int refcnt;                  /* Number of pointers to this block */
-};
+  {
+    int fd;                    /* File descriptor */
+    struct serial_ops *ops;    /* Function vector */
+    serial_ttystate ttystate;  /* Not used (yet) */
+    int bufcnt;                        /* Amount of data in receive buffer */
+    unsigned char *bufp;       /* Current byte */
+    unsigned char buf[BUFSIZ]; /* Da buffer itself */
+    int current_timeout;       /* (termio{s} only), last value of VTIME */
+    /* ser-unix.c termio{,s} only, we still need to wait for this many more
+       seconds.  */
+    int timeout_remaining;
+    char *name;                        /* The name of the device or host */
+    struct _serial_t *next;    /* Pointer to the next serial_t */
+    int refcnt;                        /* Number of pointers to this block */
+  };
 
 typedef struct _serial_t *serial_t;
 
-struct serial_ops {
-  char *name;
-  struct serial_ops *next;
-  int (*open) PARAMS ((serial_t, const char *name));
-  void (*close) PARAMS ((serial_t));
-  int (*readchar) PARAMS ((serial_t, int timeout));
-  int (*write) PARAMS ((serial_t, const char *str, int len));
-  /* Discard pending output */
-  int (*flush_output) PARAMS ((serial_t));
-  /* Discard pending input */
-  int (*flush_input) PARAMS ((serial_t));
-  int (*send_break) PARAMS ((serial_t));
-  void (*go_raw) PARAMS ((serial_t));
-  serial_ttystate (*get_tty_state) PARAMS ((serial_t));
-  int (*set_tty_state) PARAMS ((serial_t, serial_ttystate));
-  void (*print_tty_state) PARAMS ((serial_t, serial_ttystate));
-  int (*noflush_set_tty_state)
-    PARAMS ((serial_t, serial_ttystate, serial_ttystate));
-  int (*setbaudrate) PARAMS ((serial_t, int rate));
-  int (*setstopbits) PARAMS ((serial_t, int num));
-  /* Wait for output to drain */
-  int (*drain_output) PARAMS ((serial_t));
-};
+struct serial_ops
+  {
+    char *name;
+    struct serial_ops *next;
+    int (*open) PARAMS ((serial_t, const char *name));
+    void (*close) PARAMS ((serial_t));
+    int (*readchar) PARAMS ((serial_t, int timeout));
+    int (*write) PARAMS ((serial_t, const char *str, int len));
+    /* Discard pending output */
+    int (*flush_output) PARAMS ((serial_t));
+    /* Discard pending input */
+    int (*flush_input) PARAMS ((serial_t));
+    int (*send_break) PARAMS ((serial_t));
+    void (*go_raw) PARAMS ((serial_t));
+      serial_ttystate (*get_tty_state) PARAMS ((serial_t));
+    int (*set_tty_state) PARAMS ((serial_t, serial_ttystate));
+    void (*print_tty_state) PARAMS ((serial_t, serial_ttystate));
+    int (*noflush_set_tty_state)
+      PARAMS ((serial_t, serial_ttystate, serial_ttystate));
+    int (*setbaudrate) PARAMS ((serial_t, int rate));
+    int (*setstopbits) PARAMS ((serial_t, int num));
+    /* Wait for output to drain */
+    int (*drain_output) PARAMS ((serial_t));
+  };
 
 /* Add a new serial interface to the interface list */
 
-void serial_add_interface PARAMS ((struct serial_ops *optable));
+void serial_add_interface PARAMS ((struct serial_ops * optable));
 
 serial_t serial_open PARAMS ((const char *name));
 
@@ -91,7 +93,7 @@ serial_t serial_fdopen PARAMS ((const int fd));
 
 #define SERIAL_DRAIN_OUTPUT(SERIAL_T) \
   ((SERIAL_T)->ops->drain_output((SERIAL_T)))
-  
+
 /* Flush (discard) pending output.  Might also flush input (if this system can't flush
    only output).  */
 
@@ -159,7 +161,7 @@ extern int serial_readchar PARAMS ((serial_t scb, int timeout));
    -1 for failure.  */
 
 #define SERIAL_1_STOPBITS 1
-#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
+#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
 #define SERIAL_2_STOPBITS 3
 
 #define SERIAL_SETSTOPBITS(SERIAL_T, NUM) ((SERIAL_T)->ops->setstopbits((SERIAL_T), NUM))
@@ -181,11 +183,12 @@ extern void serial_close PARAMS ((serial_t, int));
 
 #define SERIAL_UN_FDOPEN(SERIAL_T) serial_close(SERIAL_T, 0)
 
-extern void serial_printf PARAMS ((serial_t desc, const char *, ...))
-     ATTR_FORMAT(printf, 2, 3);
+extern void serial_printf
+PARAMS ((serial_t desc, const char *,...))
+ATTR_FORMAT (printf, 2, 3);
 
 /* File in which to record the remote debugging session */
 
-extern void serial_log_command PARAMS ((const char *));
+     extern void serial_log_command PARAMS ((const char *));
 
 #endif /* SERIAL_H */
index 49df334a76613b10deb0c7efa78bf5ed8a7a7e1d..72c6cbd2b9dc4f931a2969f91921726f2dd08d8f 100644 (file)
@@ -1,25 +1,26 @@
 /* Target-dependent code for Hitachi Super-H, for GDB.
    Copyright 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
- Contributed by Steve Chamberlain
-                sac@cygnus.com
  Contributed by Steve Chamberlain
+   sac@cygnus.com
  */
 
 #include "defs.h"
@@ -37,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* A set of original names, to be used when restoring back to generic
    registers from a specific set.  */
-
 /* *INDENT-OFF* */
 static char *sh_generic_reg_names[] = {
   "r0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
@@ -88,25 +88,44 @@ static char *sh3e_reg_names[] = {
 };
 /* *INDENT-ON* */
 
+
+
 char **sh_register_names = sh_generic_reg_names;
 
-struct {
-  char **regnames;
-  int mach;
-} sh_processor_type_table[] = {
-  { sh_reg_names, bfd_mach_sh },
-  { sh3_reg_names, bfd_mach_sh3 },
-  { sh3e_reg_names, bfd_mach_sh3e },
-  { sh3e_reg_names, bfd_mach_sh4 },
-  { NULL, 0 }
+struct
+  {
+    char **regnames;
+    int mach;
+  }
+sh_processor_type_table[] =
+{
+  {
+    sh_reg_names, bfd_mach_sh
+  }
+  ,
+  {
+    sh3_reg_names, bfd_mach_sh3
+  }
+  ,
+  {
+    sh3e_reg_names, bfd_mach_sh3e
+  }
+  ,
+  {
+    sh3e_reg_names, bfd_mach_sh4
+  }
+  ,
+  {
+    NULL, 0
+  }
 };
 
 /* Prologue looks like
-   [mov.l      <regs>,@-r15]...
-   [sts.l      pr,@-r15]
-   [mov.l      r14,@-r15]
-   [mov                r15,r14]
-*/
+   [mov.l       <regs>,@-r15]...
+   [sts.l       pr,@-r15]
+   [mov.l       r14,@-r15]
+   [mov         r15,r14]
+ */
 
 #define IS_STS(x)              ((x) == 0x4f22)
 #define IS_PUSH(x)             (((x) & 0xff0f) == 0x2f06)
@@ -203,14 +222,14 @@ sh_find_callers_reg (fi, regnum)
   for (; fi; fi = fi->next)
     if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
       /* When the caller requests PR from the dummy frame, we return PC because
-        that's where the previous routine appears to have done a call from. */
+         that's where the previous routine appears to have done a call from. */
       return generic_read_register_dummy (fi->pc, fi->frame, regnum);
-    else 
+    else
       {
-       FRAME_FIND_SAVED_REGS(fi, fsr);
+       FRAME_FIND_SAVED_REGS (fi, fsr);
        if (fsr.regs[regnum] != 0)
-         return read_memory_integer (fsr.regs[regnum], 
-                                     REGISTER_RAW_SIZE(regnum));
+         return read_memory_integer (fsr.regs[regnum],
+                                     REGISTER_RAW_SIZE (regnum));
       }
   return read_register (regnum);
 }
@@ -234,14 +253,14 @@ sh_frame_find_saved_regs (fi, fsr)
   int opc;
   int insn;
   int r3_val = 0;
-  char * dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+  char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
 
   if (dummy_regs)
     {
       /* DANGER!  This is ONLY going to work if the char buffer format of
-        the saved registers is byte-for-byte identical to the 
-        CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
-      memcpy (&fsr->regs, dummy_regs, sizeof(fsr));
+         the saved registers is byte-for-byte identical to the 
+         CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
+      memcpy (&fsr->regs, dummy_regs, sizeof (fsr));
       return;
     }
 
@@ -368,10 +387,10 @@ sh_init_extra_frame_info (fromleaf, fi)
   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->return_pc = generic_read_register_dummy (fi->pc, fi->frame, 
+         by assuming it's always FP.  */
+      fi->frame = generic_read_register_dummy (fi->pc, fi->frame,
+                                              SP_REGNUM);
+      fi->return_pc = generic_read_register_dummy (fi->pc, fi->frame,
                                                   PC_REGNUM);
       fi->f_offset = -(CALL_DUMMY_LENGTH + 4);
       fi->leaf_function = 0;
@@ -398,18 +417,18 @@ sh_pop_frame ()
   if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     generic_pop_dummy_frame ();
   else
-  {
-    fp = FRAME_FP (frame);
-    get_frame_saved_regs (frame, &fsr);
+    {
+      fp = FRAME_FP (frame);
+      get_frame_saved_regs (frame, &fsr);
 
-    /* Copy regs from where they were saved in the frame */
-    for (regnum = 0; regnum < NUM_REGS; regnum++)
-      if (fsr.regs[regnum])
-       write_register (regnum, read_memory_integer (fsr.regs[regnum], 4));
+      /* Copy regs from where they were saved in the frame */
+      for (regnum = 0; regnum < NUM_REGS; regnum++)
+       if (fsr.regs[regnum])
+         write_register (regnum, read_memory_integer (fsr.regs[regnum], 4));
 
-    write_register (PC_REGNUM, frame->return_pc);
-    write_register (SP_REGNUM, fp + 4);
-  }
+      write_register (PC_REGNUM, frame->return_pc);
+      write_register (SP_REGNUM, fp + 4);
+    }
   flush_cached_frames ();
 }
 
@@ -446,7 +465,7 @@ sh_pop_frame ()
    bug.  Arguments of these odd sizes are left-justified within the 
    word (as opposed to arguments smaller than 4 bytes, which are 
    right-justified).
+
 
    If the function is to return an aggregate type such as a struct, it 
    is either returned in the normal return value register R0 (if its 
@@ -481,13 +500,13 @@ sh_push_arguments (nargs, args, sp, struct_return, struct_addr)
   /* The "struct return pointer" pseudo-argument has its own dedicated 
      register */
   if (struct_return)
-      write_register (STRUCT_RETURN_REGNUM, struct_addr);
+    write_register (STRUCT_RETURN_REGNUM, struct_addr);
 
   /* Now make sure there's space on the stack */
   for (argnum = 0, stack_alloc = 0;
        argnum < nargs; argnum++)
-    stack_alloc += ((TYPE_LENGTH(VALUE_TYPE(args[argnum])) + 3) & ~3);
-  sp -= stack_alloc;    /* make room on stack for args */
+    stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
+  sp -= stack_alloc;           /* make room on stack for args */
 
 
   /* Now load as many as possible of the first arguments into
@@ -498,25 +517,25 @@ sh_push_arguments (nargs, args, sp, struct_return, struct_addr)
   for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
     {
       type = VALUE_TYPE (args[argnum]);
-      len  = TYPE_LENGTH (type);
-      memset(valbuf, 0, sizeof(valbuf));
+      len = TYPE_LENGTH (type);
+      memset (valbuf, 0, sizeof (valbuf));
       if (len < 4)
-        { /* value gets right-justified in the register or stack word */
-          memcpy(valbuf + (4 - len), 
-                (char *) VALUE_CONTENTS (args[argnum]), len);
-          val = valbuf;
-        }
+       {                       /* value gets right-justified in the register or stack word */
+         memcpy (valbuf + (4 - len),
+                 (char *) VALUE_CONTENTS (args[argnum]), len);
+         val = valbuf;
+       }
       else
-        val = (char *) VALUE_CONTENTS (args[argnum]);
+       val = (char *) VALUE_CONTENTS (args[argnum]);
 
       if (len > 4 && (len & 3) != 0)
-       odd_sized_struct = 1;           /* such structs go entirely on stack */
-      else 
+       odd_sized_struct = 1;   /* such structs go entirely on stack */
+      else
        odd_sized_struct = 0;
       while (len > 0)
        {
          if (argreg > ARGLAST_REGNUM || odd_sized_struct)
-           {                           /* must go on the stack */
+           {                   /* must go on the stack */
              write_memory (sp + stack_offset, val, 4);
              stack_offset += 4;
            }
@@ -524,15 +543,15 @@ sh_push_arguments (nargs, args, sp, struct_return, struct_addr)
             That's because some *&^%$ things get passed on the stack
             AND in the registers!   */
          if (argreg <= ARGLAST_REGNUM)
-           {                           /* there's room in a register */
-             regval = extract_address (val, REGISTER_RAW_SIZE(argreg));
+           {                   /* there's room in a register */
+             regval = extract_address (val, REGISTER_RAW_SIZE (argreg));
              write_register (argreg++, regval);
            }
          /* Store the value 4 bytes at a time.  This means that things
             larger than 4 bytes may go partly in registers and partly
             on the stack.  */
-         len -= REGISTER_RAW_SIZE(argreg);
-         val += REGISTER_RAW_SIZE(argreg);
+         len -= REGISTER_RAW_SIZE (argreg);
+         val += REGISTER_RAW_SIZE (argreg);
        }
     }
   return sp;
@@ -558,12 +577,12 @@ sh_push_return_address (pc, sp)
    it into a register using PC-relative addressing.  This function
    expects the CALL_DUMMY to look like this:
 
-        mov.w @(2,PC), R8
-        jsr   @R8
-        nop
-        trap
-        <destination>
 */
+   mov.w @(2,PC), R8
+   jsr   @R8
+   nop
+   trap
+   <destination>
+ */
 
 #if 0
 void
@@ -629,19 +648,19 @@ sh_show_regs (args, from_tty)
                   read_register (MACL_REGNUM));
 
   printf_filtered ("GBR=%08x VBR=%08x",
-                   read_register (GBR_REGNUM),
-                   read_register (VBR_REGNUM));
+                  read_register (GBR_REGNUM),
+                  read_register (VBR_REGNUM));
   if (cpu == bfd_mach_sh3 || cpu == bfd_mach_sh3e)
     {
       printf_filtered (" SSR=%08x SPC=%08x",
-                       read_register (SSR_REGNUM),
-                       read_register (SPC_REGNUM));
+                      read_register (SSR_REGNUM),
+                      read_register (SPC_REGNUM));
       if (cpu == bfd_mach_sh3e)
-        {
-          printf_filtered (" FPUL=%08x FPSCR=%08x",
-                           read_register (FPUL_REGNUM),
-                           read_register (FPSCR_REGNUM));
-        }
+       {
+         printf_filtered (" FPUL=%08x FPSCR=%08x",
+                          read_register (FPUL_REGNUM),
+                          read_register (FPSCR_REGNUM));
+       }
     }
 
   printf_filtered ("\nR0-R7  %08x %08x %08x %08x %08x %08x %08x %08x\n",
@@ -665,23 +684,23 @@ sh_show_regs (args, from_tty)
   if (cpu == bfd_mach_sh3e)
     {
       printf_filtered ("FP0-FP7  %08x %08x %08x %08x %08x %08x %08x %08x\n",
-                       read_register (FP0_REGNUM + 0),
-                       read_register (FP0_REGNUM + 1),
-                       read_register (FP0_REGNUM + 2),
-                       read_register (FP0_REGNUM + 3),
-                       read_register (FP0_REGNUM + 4),
-                       read_register (FP0_REGNUM + 5),
-                       read_register (FP0_REGNUM + 6),
-                       read_register (FP0_REGNUM + 7));
+                      read_register (FP0_REGNUM + 0),
+                      read_register (FP0_REGNUM + 1),
+                      read_register (FP0_REGNUM + 2),
+                      read_register (FP0_REGNUM + 3),
+                      read_register (FP0_REGNUM + 4),
+                      read_register (FP0_REGNUM + 5),
+                      read_register (FP0_REGNUM + 6),
+                      read_register (FP0_REGNUM + 7));
       printf_filtered ("FP8-FP15 %08x %08x %08x %08x %08x %08x %08x %08x\n",
-                       read_register (FP0_REGNUM + 8),
-                       read_register (FP0_REGNUM + 9),
-                       read_register (FP0_REGNUM + 10),
-                       read_register (FP0_REGNUM + 11),
-                       read_register (FP0_REGNUM + 12),
-                       read_register (FP0_REGNUM + 13),
-                       read_register (FP0_REGNUM + 14),
-                       read_register (FP0_REGNUM + 15));
+                      read_register (FP0_REGNUM + 8),
+                      read_register (FP0_REGNUM + 9),
+                      read_register (FP0_REGNUM + 10),
+                      read_register (FP0_REGNUM + 11),
+                      read_register (FP0_REGNUM + 12),
+                      read_register (FP0_REGNUM + 13),
+                      read_register (FP0_REGNUM + 14),
+                      read_register (FP0_REGNUM + 15));
     }
 }
 
@@ -695,7 +714,7 @@ sh_extract_return_value (type, regbuf, valbuf)
      void *regbuf;
      void *valbuf;
 {
-  int len = TYPE_LENGTH(type);
+  int len = TYPE_LENGTH (type);
 
   if (len <= 4)
     memcpy (valbuf, ((char *) regbuf) + 4 - len, len);
index a4675a607d290f1d460489a05fc4bced8fd7d812..3fd1e68bb07484e1bead295804c9b5f96ce595dc 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote target glue for the Hitachi SH-3 ROM monitor.
    Copyright 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -104,7 +105,7 @@ sh3_supply_register (regname, regnamelen, val, vallen)
   else if (regnamelen == 5)
     {
       if (regname[1] == '8' && regname[2] == '-' && regname[3] == '1'
-         && regname[4] =='5')
+         && regname[4] == '5')
        {
          regno = R0_REGNUM + 8;
          numregs = 8;
@@ -125,23 +126,23 @@ sh3_load (desc, file, hashmark)
      char *file;
      int hashmark;
 {
-  if (parallel_in_use) 
+  if (parallel_in_use)
     {
-      monitor_printf("pl;s\r");
+      monitor_printf ("pl;s\r");
       load_srec (parallel, file, 0, 80, SREC_ALL, hashmark, NULL);
       monitor_expect_prompt (NULL, 0);
     }
-  else 
+  else
     {
       monitor_printf ("il;s:x\r");
-      monitor_expect ("\005", NULL, 0); /* Look for ENQ */
-      SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
-      monitor_expect ("LO x\r", NULL, 0); /* Look for filename */
+      monitor_expect ("\005", NULL, 0);                /* Look for ENQ */
+      SERIAL_WRITE (desc, "\006", 1);  /* Send ACK */
+      monitor_expect ("LO x\r", NULL, 0);      /* Look for filename */
 
       load_srec (desc, file, 0, 80, SREC_ALL, hashmark, NULL);
 
-      monitor_expect ("\005", NULL, 0); /* Look for ENQ */
-      SERIAL_WRITE (desc, "\006", 1); /* Send ACK */
+      monitor_expect ("\005", NULL, 0);                /* Look for ENQ */
+      SERIAL_WRITE (desc, "\006", 1);  /* Send ACK */
       monitor_expect_prompt (NULL, 0);
     }
 }
@@ -151,10 +152,11 @@ sh3_load (desc, file, hashmark)
    than does GDB, and don't necessarily support all the registers
    either. So, typing "info reg sp" becomes a "r30".  */
 
-static char *sh3_regnames[NUM_REGS] = {
-  "R0", "R1", "R2",  "R3", "R4",  "R5",   "R6",  "R7",
-  "R8", "R9", "R10", "R11","R12", "R13",  "R14", "R15",
-  "PC", "PR", "GBR", "VBR","MACH","MACL", "SR",
+static char *sh3_regnames[NUM_REGS] =
+{
+  "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
+  "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15",
+  "PC", "PR", "GBR", "VBR", "MACH", "MACL", "SR",
   NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -165,14 +167,15 @@ static char *sh3_regnames[NUM_REGS] = {
   "R4_BANK1", "R5_BANK1", "R6_BANK1", "R7_BANK1"
 };
 
-static char *sh3e_regnames[NUM_REGS] = {
-  "R0", "R1", "R2",  "R3", "R4",  "R5",   "R6",  "R7",
-  "R8", "R9", "R10", "R11","R12", "R13",  "R14", "R15",
-  "PC", "PR", "GBR", "VBR","MACH","MACL", "SR",
+static char *sh3e_regnames[NUM_REGS] =
+{
+  "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
+  "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15",
+  "PC", "PR", "GBR", "VBR", "MACH", "MACL", "SR",
   "FPUL", "FPSCR",
   "FR0", "FR1", "FR2", "FR3", "FR4", "FR5", "FR6", "FR7",
   "FR8", "FR9", "FR10", "FR11", "FR12", "FR13", "FR14", "FR15",
-  "SSR","SPC",
+  "SSR", "SPC",
   "R0_BANK0", "R1_BANK0", "R2_BANK0", "R3_BANK0",
   "R4_BANK0", "R5_BANK0", "R6_BANK0", "R7_BANK0",
   "R0_BANK1", "R1_BANK1", "R2_BANK1", "R3_BANK1",
@@ -185,58 +188,59 @@ static char *sh3e_regnames[NUM_REGS] = {
 
 static struct target_ops sh3_ops, sh3e_ops;
 
-static char *sh3_inits[] = {"\003", NULL}; /* Exits sub-command mode & download cmds */
+static char *sh3_inits[] =
+{"\003", NULL};                        /* Exits sub-command mode & download cmds */
 
-static struct monitor_ops sh3_cmds ;
+static struct monitor_ops sh3_cmds;
 
-static void 
-init_sh3_cmds(void)
+static void
+init_sh3_cmds (void)
 {
-  sh3_cmds.flags =   MO_CLR_BREAK_USES_ADDR | MO_GETMEM_READ_SINGLE ;  /* flags */
-  sh3_cmds.init =   sh3_inits;         /* monitor init string */
-  sh3_cmds.cont =   "g\r";             /* continue command */
-  sh3_cmds.step =   "s\r";             /* single step */
-  sh3_cmds.stop =   "\003";            /* Interrupt program */
-  sh3_cmds.set_break =   "b %x\r";     /* set a breakpoint */
-  sh3_cmds.clr_break =   "b -%x\r";    /* clear a breakpoint */
-  sh3_cmds.clr_all_break =   "b -\r";  /* clear all breakpoints */
-  sh3_cmds.fill =   "f %x @%x %x\r";           /* fill (start len val) */
-  sh3_cmds.setmem.cmdb =     "m %x %x\r";      /* setmem.cmdb (addr, value) */
-  sh3_cmds.setmem.cmdw =     "m %x %x;w\r";    /* setmem.cmdw (addr, value) */
-  sh3_cmds.setmem.cmdl =     "m %x %x;l\r";    /* setmem.cmdl (addr, value) */
-  sh3_cmds.setmem.cmdll =     NULL;            /* setmem.cmdll (addr, value) */
-  sh3_cmds.setmem.resp_delim =     NULL;       /* setreg.resp_delim */
-  sh3_cmds.setmem.term =     NULL;             /* setreg.term */
-  sh3_cmds.setmem.term_cmd =     NULL;         /* setreg.term_cmd */
-  sh3_cmds.getmem.cmdb =     "m %x\r";         /* getmem.cmdb (addr, len) */
-  sh3_cmds.getmem.cmdw =     "m %x;w\r";       /* getmem.cmdw (addr, len) */
-  sh3_cmds.getmem.cmdl =     "m %x;l\r";       /* getmem.cmdl (addr, len) */
-  sh3_cmds.getmem.cmdll =     NULL;            /* getmem.cmdll (addr, len) */
-  sh3_cmds.getmem.resp_delim =     "^ [0-9A-F]+ "; /* getmem.resp_delim */
-  sh3_cmds.getmem.term =     "? ";             /* getmem.term */
-  sh3_cmds.getmem.term_cmd =     ".\r";                /* getmem.term_cmd */
-  sh3_cmds.setreg.cmd =     ".%s %x\r";                /* setreg.cmd (name, value) */
-  sh3_cmds.setreg.resp_delim =     NULL;       /* setreg.resp_delim */
-  sh3_cmds.setreg.term =     NULL;             /* setreg.term */
-  sh3_cmds.setreg.term_cmd =     NULL;         /* setreg.term_cmd */
-  sh3_cmds.getreg.cmd =     ".%s\r";           /* getreg.cmd (name) */
-  sh3_cmds.getreg.resp_delim =     "=";                /* getreg.resp_delim */
-  sh3_cmds.getreg.term =     "? ";             /* getreg.term */
-  sh3_cmds.getreg.term_cmd =     ".\r" ;       /* getreg.term_cmd */
-  sh3_cmds.dump_registers =   "r\r";           /* dump_registers */
-  sh3_cmds.register_pattern =  "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)";
-  sh3_cmds.supply_register =  sh3_supply_register ;    /* supply_register */
-  sh3_cmds.load_routine =   sh3_load;          /* load_routine */
-  sh3_cmds.load =   NULL;                      /* download command */
-  sh3_cmds.loadresp =   NULL;                  /* Load response */
-  sh3_cmds.prompt =   "\n:";                   /* monitor command prompt */
-  sh3_cmds.line_term =   "\r";                 /* end-of-line terminator */
-  sh3_cmds.cmd_end =   ".\r";                  /* optional command terminator */
-  sh3_cmds.target =   &sh3_ops;                        /* target operations */
-  sh3_cmds.stopbits =   SERIAL_1_STOPBITS;     /* number of stop bits */
-  sh3_cmds.regnames =   sh3_regnames;          /* registers names */
-  sh3_cmds.magic =   MONITOR_OPS_MAGIC ;       /* magic */
-} /* init_sh3_cmds */
+  sh3_cmds.flags = MO_CLR_BREAK_USES_ADDR | MO_GETMEM_READ_SINGLE;     /* flags */
+  sh3_cmds.init = sh3_inits;   /* monitor init string */
+  sh3_cmds.cont = "g\r";       /* continue command */
+  sh3_cmds.step = "s\r";       /* single step */
+  sh3_cmds.stop = "\003";      /* Interrupt program */
+  sh3_cmds.set_break = "b %x\r";       /* set a breakpoint */
+  sh3_cmds.clr_break = "b -%x\r";      /* clear a breakpoint */
+  sh3_cmds.clr_all_break = "b -\r";    /* clear all breakpoints */
+  sh3_cmds.fill = "f %x @%x %x\r";     /* fill (start len val) */
+  sh3_cmds.setmem.cmdb = "m %x %x\r";  /* setmem.cmdb (addr, value) */
+  sh3_cmds.setmem.cmdw = "m %x %x;w\r";                /* setmem.cmdw (addr, value) */
+  sh3_cmds.setmem.cmdl = "m %x %x;l\r";                /* setmem.cmdl (addr, value) */
+  sh3_cmds.setmem.cmdll = NULL;        /* setmem.cmdll (addr, value) */
+  sh3_cmds.setmem.resp_delim = NULL;   /* setreg.resp_delim */
+  sh3_cmds.setmem.term = NULL; /* setreg.term */
+  sh3_cmds.setmem.term_cmd = NULL;     /* setreg.term_cmd */
+  sh3_cmds.getmem.cmdb = "m %x\r";     /* getmem.cmdb (addr, len) */
+  sh3_cmds.getmem.cmdw = "m %x;w\r";   /* getmem.cmdw (addr, len) */
+  sh3_cmds.getmem.cmdl = "m %x;l\r";   /* getmem.cmdl (addr, len) */
+  sh3_cmds.getmem.cmdll = NULL;        /* getmem.cmdll (addr, len) */
+  sh3_cmds.getmem.resp_delim = "^ [0-9A-F]+ "; /* getmem.resp_delim */
+  sh3_cmds.getmem.term = "? "; /* getmem.term */
+  sh3_cmds.getmem.term_cmd = ".\r";    /* getmem.term_cmd */
+  sh3_cmds.setreg.cmd = ".%s %x\r";    /* setreg.cmd (name, value) */
+  sh3_cmds.setreg.resp_delim = NULL;   /* setreg.resp_delim */
+  sh3_cmds.setreg.term = NULL; /* setreg.term */
+  sh3_cmds.setreg.term_cmd = NULL;     /* setreg.term_cmd */
+  sh3_cmds.getreg.cmd = ".%s\r";       /* getreg.cmd (name) */
+  sh3_cmds.getreg.resp_delim = "=";    /* getreg.resp_delim */
+  sh3_cmds.getreg.term = "? "; /* getreg.term */
+  sh3_cmds.getreg.term_cmd = ".\r";    /* getreg.term_cmd */
+  sh3_cmds.dump_registers = "r\r";     /* dump_registers */
+  sh3_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)";
+  sh3_cmds.supply_register = sh3_supply_register;      /* supply_register */
+  sh3_cmds.load_routine = sh3_load;    /* load_routine */
+  sh3_cmds.load = NULL;                /* download command */
+  sh3_cmds.loadresp = NULL;    /* Load response */
+  sh3_cmds.prompt = "\n:";     /* monitor command prompt */
+  sh3_cmds.line_term = "\r";   /* end-of-line terminator */
+  sh3_cmds.cmd_end = ".\r";    /* optional command terminator */
+  sh3_cmds.target = &sh3_ops;  /* target operations */
+  sh3_cmds.stopbits = SERIAL_1_STOPBITS;       /* number of stop bits */
+  sh3_cmds.regnames = sh3_regnames;    /* registers names */
+  sh3_cmds.magic = MONITOR_OPS_MAGIC;  /* magic */
+}                              /* init_sh3_cmds */
 
 /* This monitor structure is identical except for a couple slots, so
    we will fill it in from the base structure when needed.  */
@@ -251,12 +255,12 @@ sh3_open (args, from_tty)
   char *serial_port_name = args;
   char *parallel_port_name = 0;
 
-  if (args) 
+  if (args)
     {
       char *cursor = serial_port_name = strsave (args);
 
       while (*cursor && *cursor != ' ')
-       cursor++;
+       cursor++;
 
       if (*cursor)
        *cursor++ = 0;
@@ -293,12 +297,12 @@ sh3e_open (args, from_tty)
   char *serial_port_name = args;
   char *parallel_port_name = 0;
 
-  if (args) 
+  if (args)
     {
       char *cursor = serial_port_name = strsave (args);
 
       while (*cursor && *cursor != ' ')
-       cursor++;
+       cursor++;
 
       if (*cursor)
        *cursor++ = 0;
@@ -338,22 +342,23 @@ sh3_close (quitting)
      int quitting;
 {
   monitor_close (quitting);
-  if (parallel_in_use) {
-    SERIAL_CLOSE (parallel);
-    parallel_in_use = 0;
-  }
+  if (parallel_in_use)
+    {
+      SERIAL_CLOSE (parallel);
+      parallel_in_use = 0;
+    }
 }
 
 void
 _initialize_sh3_rom ()
 {
-  init_sh3_cmds() ;
+  init_sh3_cmds ();
   init_monitor_ops (&sh3_ops);
 
   sh3_ops.to_shortname = "sh3";
   sh3_ops.to_longname = "Hitachi SH-3 rom monitor";
 
-  sh3_ops.to_doc = 
+  sh3_ops.to_doc =
 #ifdef _WINDOWS
   /* On windows we can talk through the parallel port too. */
     "Debug on a Hitachi eval board running the SH-3 rom monitor.\n"
@@ -377,7 +382,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   sh3e_ops.to_shortname = "sh3e";
   sh3e_ops.to_longname = "Hitachi SH-3E rom monitor";
 
-  sh3e_ops.to_doc = 
+  sh3e_ops.to_doc =
 #ifdef _WINDOWS
   /* On windows we can talk through the parallel port too. */
     "Debug on a Hitachi eval board running the SH-3E rom monitor.\n"
index a1348b637330577f43bead8592ae126651cf3bf9..85b4909df47688401c3237a4e66ce662bf9690c4 100644 (file)
@@ -1,27 +1,28 @@
 /* Signal handler definitions for GDB, the GNU Debugger.
    Copyright (C) 1986, 1989 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 /*  This file is almost the same as including <signal.h> except that it
-    eliminates certain signal names when job control is not supported,
-    (or, on some systems, when job control is there but doesn't work
-    the way GDB expects it to work).  */
+   eliminates certain signal names when job control is not supported,
+   (or, on some systems, when job control is there but doesn't work
+   the way GDB expects it to work).  */
 /* This has been superceded by the job_control variable in serial.h.  */
 
 #include <signal.h>
index afc8d0c2eed990d216caa5500e5a4ff9d3bec315..a613549002883ac7af10af750f2c791471e8e2c5 100644 (file)
@@ -1,21 +1,22 @@
 /* Low level interface for debugging Solaris threads for GDB, the GNU debugger.
    Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This module implements a sort of half target that sits between the
    machine-independent parts of GDB and the /proc interface (procfs.c) to
@@ -58,8 +59,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <dlfcn.h>
 #include "gdbcmd.h"
 
-extern struct target_ops sol_thread_ops; /* Forward declaration */
-extern struct target_ops sol_core_ops; /* Forward declaration */
+extern struct target_ops sol_thread_ops;       /* Forward declaration */
+extern struct target_ops sol_core_ops; /* Forward declaration */
 
 /* place to store core_ops before we overwrite it */
 static struct target_ops orig_core_ops;
@@ -68,8 +69,8 @@ struct target_ops sol_thread_ops;
 struct target_ops sol_core_ops;
 
 extern int procfs_suppress_run;
-extern struct target_ops procfs_ops; /* target vector for procfs.c */
-extern struct target_ops core_ops; /* target vector for corelow.c */
+extern struct target_ops procfs_ops;   /* target vector for procfs.c */
+extern struct target_ops core_ops;     /* target vector for corelow.c */
 extern char *procfs_pid_to_str PARAMS ((int pid));
 
 /* Note that these prototypes differ slightly from those used in procfs.c
@@ -91,25 +92,25 @@ extern void fill_fpregset PARAMS ((prfpregset_t *, int));
    for memory accesses.  */
 
 struct ps_prochandle
-{
-  pid_t pid;
-};
+  {
+    pid_t pid;
+  };
 
 struct string_map
-{
-  int num;
-  char *str;
-};
+  {
+    int num;
+    char *str;
+  };
 
 static struct ps_prochandle main_ph;
 static td_thragent_t *main_ta;
 static int sol_thread_active = 0;
 
-static struct cleanup * save_inferior_pid PARAMS ((void));
+static struct cleanup *save_inferior_pid PARAMS ((void));
 static void restore_inferior_pid PARAMS ((void *pid));
 static char *td_err_string PARAMS ((td_err_e errcode));
 static char *td_state_string PARAMS ((td_thr_state_e statecode));
-static int  thread_to_lwp PARAMS ((int thread_id, int default_lwp));
+static int thread_to_lwp PARAMS ((int thread_id, int default_lwp));
 static void sol_thread_resume PARAMS ((int pid, int step,
                                       enum target_signal signo));
 static int lwp_to_thread PARAMS ((int lwp));
@@ -132,65 +133,65 @@ static void init_sol_core_ops PARAMS ((void));
 static void
   (*p_td_log) (const int on_off);
 static td_err_e
-  (*p_td_ta_new) (const struct ps_prochandle *ph_p, td_thragent_t **ta_pp);
+  (*p_td_ta_new) (const struct ps_prochandle * ph_p, td_thragent_t ** ta_pp);
 static td_err_e
-  (*p_td_ta_delete) (td_thragent_t *ta_p);
+  (*p_td_ta_delete) (td_thragent_t * ta_p);
 static td_err_e
   (*p_td_init) (void);
 static td_err_e
-  (*p_td_ta_get_ph) (const td_thragent_t *ta_p, struct ps_prochandle **ph_pp);
+  (*p_td_ta_get_ph) (const td_thragent_t * ta_p, struct ps_prochandle ** ph_pp);
 static td_err_e
-  (*p_td_ta_get_nthreads) (const td_thragent_t *ta_p, int *nthread_p);
+  (*p_td_ta_get_nthreads) (const td_thragent_t * ta_p, int *nthread_p);
 static td_err_e
-  (*p_td_ta_tsd_iter) (const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p);
+  (*p_td_ta_tsd_iter) (const td_thragent_t * ta_p, td_key_iter_f * cb, void *cbdata_p);
 static td_err_e
-  (*p_td_ta_thr_iter) (const td_thragent_t *ta_p, td_thr_iter_f *cb, void *cbdata_p, td_thr_state_e state,
-                      int ti_pri, sigset_t *ti_sigmask_p, unsigned ti_user_flags);
+  (*p_td_ta_thr_iter) (const td_thragent_t * ta_p, td_thr_iter_f * cb, void *cbdata_p, td_thr_state_e state,
+              int ti_pri, sigset_t * ti_sigmask_p, unsigned ti_user_flags);
 static td_err_e
-  (*p_td_thr_validate) (const td_thrhandle_t *th_p);
+  (*p_td_thr_validate) (const td_thrhandle_t * th_p);
 static td_err_e
-  (*p_td_thr_tsd) (const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp);
+  (*p_td_thr_tsd) (const td_thrhandle_t * th_p, const thread_key_t key, void **data_pp);
 static td_err_e
-  (*p_td_thr_get_info) (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p);
+  (*p_td_thr_get_info) (const td_thrhandle_t * th_p, td_thrinfo_t * ti_p);
 static td_err_e
-  (*p_td_thr_getfpregs) (const td_thrhandle_t *th_p, prfpregset_t *fpregset);
+  (*p_td_thr_getfpregs) (const td_thrhandle_t * th_p, prfpregset_t * fpregset);
 static td_err_e
-  (*p_td_thr_getxregsize) (const td_thrhandle_t *th_p, int *xregsize);
+  (*p_td_thr_getxregsize) (const td_thrhandle_t * th_p, int *xregsize);
 static td_err_e
-  (*p_td_thr_getxregs) (const td_thrhandle_t *th_p, const caddr_t xregset);
+  (*p_td_thr_getxregs) (const td_thrhandle_t * th_p, const caddr_t xregset);
 static td_err_e
-  (*p_td_thr_sigsetmask) (const td_thrhandle_t *th_p, const sigset_t ti_sigmask);
+  (*p_td_thr_sigsetmask) (const td_thrhandle_t * th_p, const sigset_t ti_sigmask);
 static td_err_e
-  (*p_td_thr_setprio) (const td_thrhandle_t *th_p, const int ti_pri);
+  (*p_td_thr_setprio) (const td_thrhandle_t * th_p, const int ti_pri);
 static td_err_e
-  (*p_td_thr_setsigpending) (const td_thrhandle_t *th_p, const uchar_t ti_pending_flag, const sigset_t ti_pending);
+  (*p_td_thr_setsigpending) (const td_thrhandle_t * th_p, const uchar_t ti_pending_flag, const sigset_t ti_pending);
 static td_err_e
-  (*p_td_thr_setfpregs) (const td_thrhandle_t *th_p, const prfpregset_t *fpregset);
+  (*p_td_thr_setfpregs) (const td_thrhandle_t * th_p, const prfpregset_t * fpregset);
 static td_err_e
-  (*p_td_thr_setxregs) (const td_thrhandle_t *th_p, const caddr_t xregset);
+  (*p_td_thr_setxregs) (const td_thrhandle_t * th_p, const caddr_t xregset);
 static td_err_e
-  (*p_td_ta_map_id2thr) (const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p);
+  (*p_td_ta_map_id2thr) (const td_thragent_t * ta_p, thread_t tid, td_thrhandle_t * th_p);
 static td_err_e
-  (*p_td_ta_map_lwp2thr) (const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p);
+  (*p_td_ta_map_lwp2thr) (const td_thragent_t * ta_p, lwpid_t lwpid, td_thrhandle_t * th_p);
 static td_err_e
-  (*p_td_thr_getgregs) (const td_thrhandle_t *th_p, prgregset_t regset);
+  (*p_td_thr_getgregs) (const td_thrhandle_t * th_p, prgregset_t regset);
 static td_err_e
-  (*p_td_thr_setgregs) (const td_thrhandle_t *th_p, const prgregset_t regset);
+  (*p_td_thr_setgregs) (const td_thrhandle_t * th_p, const prgregset_t regset);
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       td_err_string - Convert a thread_db error code to a string
+   td_err_string - Convert a thread_db error code to a string
 
-SYNOPSIS
+   SYNOPSIS
 
-       char * td_err_string (errcode)
+   char * td_err_string (errcode)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Return the thread_db error string associated with errcode.  If errcode
-       is unknown, then return a message.
+   Return the thread_db error string associated with errcode.  If errcode
+   is unknown, then return a message.
 
  */
 
@@ -199,29 +200,30 @@ td_err_string (errcode)
      td_err_e errcode;
 {
   static struct string_map
-    td_err_table[] = {
-      {TD_OK,          "generic \"call succeeded\""},
-      {TD_ERR,         "generic error."},
-      {TD_NOTHR,       "no thread can be found to satisfy query"},
-      {TD_NOSV,                "no synch. variable can be found to satisfy query"},
-      {TD_NOLWP,       "no lwp can be found to satisfy query"},
-      {TD_BADPH,       "invalid process handle"},
-      {TD_BADTH,       "invalid thread handle"},
-      {TD_BADSH,       "invalid synchronization handle"},
-      {TD_BADTA,       "invalid thread agent"},
-      {TD_BADKEY,      "invalid key"},
-      {TD_NOMSG,       "td_thr_event_getmsg() called when there was no message"},
-      {TD_NOFPREGS,    "FPU register set not available for given thread"},
-      {TD_NOLIBTHREAD, "application not linked with libthread"},
-      {TD_NOEVENT,     "requested event is not supported"},
-      {TD_NOCAPAB,     "capability not available"},
-      {TD_DBERR,       "Debugger service failed"},
-      {TD_NOAPLIC,     "Operation not applicable to"},
-      {TD_NOTSD,       "No thread specific data for this thread"},
-      {TD_MALLOC,      "Malloc failed"},
-      {TD_PARTIALREG,  "Only part of register set was writen/read"},
-      {TD_NOXREGS,     "X register set not available for given thread"}
-    };
+    td_err_table[] =
+  {
+    {TD_OK, "generic \"call succeeded\""},
+    {TD_ERR, "generic error."},
+    {TD_NOTHR, "no thread can be found to satisfy query"},
+    {TD_NOSV, "no synch. variable can be found to satisfy query"},
+    {TD_NOLWP, "no lwp can be found to satisfy query"},
+    {TD_BADPH, "invalid process handle"},
+    {TD_BADTH, "invalid thread handle"},
+    {TD_BADSH, "invalid synchronization handle"},
+    {TD_BADTA, "invalid thread agent"},
+    {TD_BADKEY, "invalid key"},
+    {TD_NOMSG, "td_thr_event_getmsg() called when there was no message"},
+    {TD_NOFPREGS, "FPU register set not available for given thread"},
+    {TD_NOLIBTHREAD, "application not linked with libthread"},
+    {TD_NOEVENT, "requested event is not supported"},
+    {TD_NOCAPAB, "capability not available"},
+    {TD_DBERR, "Debugger service failed"},
+    {TD_NOAPLIC, "Operation not applicable to"},
+    {TD_NOTSD, "No thread specific data for this thread"},
+    {TD_MALLOC, "Malloc failed"},
+    {TD_PARTIALREG, "Only part of register set was writen/read"},
+    {TD_NOXREGS, "X register set not available for given thread"}
+  };
   const int td_err_size = sizeof td_err_table / sizeof (struct string_map);
   int i;
   static char buf[50];
@@ -229,7 +231,7 @@ td_err_string (errcode)
   for (i = 0; i < td_err_size; i++)
     if (td_err_table[i].num == errcode)
       return td_err_table[i].str;
-                 
+
   sprintf (buf, "Unknown thread_db error code: %d", errcode);
 
   return buf;
@@ -237,18 +239,18 @@ td_err_string (errcode)
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       td_state_string - Convert a thread_db state code to a string
+   td_state_string - Convert a thread_db state code to a string
 
-SYNOPSIS
+   SYNOPSIS
 
-       char * td_state_string (statecode)
+   char * td_state_string (statecode)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Return the thread_db state string associated with statecode.  If
-       statecode is unknown, then return a message.
+   Return the thread_db state string associated with statecode.  If
+   statecode is unknown, then return a message.
 
  */
 
@@ -257,16 +259,17 @@ td_state_string (statecode)
      td_thr_state_e statecode;
 {
   static struct string_map
-    td_thr_state_table[] = {
-      {TD_THR_ANY_STATE, "any state"},
-      {TD_THR_UNKNOWN, "unknown"},
-      {TD_THR_STOPPED, "stopped"},
-      {TD_THR_RUN,     "run"},
-      {TD_THR_ACTIVE,  "active"},
-      {TD_THR_ZOMBIE,  "zombie"},
-      {TD_THR_SLEEP,   "sleep"},
-      {TD_THR_STOPPED_ASLEEP, "stopped asleep"}
-    };
+    td_thr_state_table[] =
+  {
+    {TD_THR_ANY_STATE, "any state"},
+    {TD_THR_UNKNOWN, "unknown"},
+    {TD_THR_STOPPED, "stopped"},
+    {TD_THR_RUN, "run"},
+    {TD_THR_ACTIVE, "active"},
+    {TD_THR_ZOMBIE, "zombie"},
+    {TD_THR_SLEEP, "sleep"},
+    {TD_THR_STOPPED_ASLEEP, "stopped asleep"}
+  };
   const int td_thr_state_table_size = sizeof td_thr_state_table / sizeof (struct string_map);
   int i;
   static char buf[50];
@@ -274,7 +277,7 @@ td_state_string (statecode)
   for (i = 0; i < td_thr_state_table_size; i++)
     if (td_thr_state_table[i].num == statecode)
       return td_thr_state_table[i].str;
-                 
+
   sprintf (buf, "Unknown thread_db state code: %d", statecode);
 
   return buf;
@@ -282,23 +285,23 @@ td_state_string (statecode)
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       thread_to_lwp - Convert a Posix or Solaris thread id to a LWP id.
+   thread_to_lwp - Convert a Posix or Solaris thread id to a LWP id.
 
-SYNOPSIS
+   SYNOPSIS
 
-       int thread_to_lwp (thread_id, default_lwp)
+   int thread_to_lwp (thread_id, default_lwp)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function converts a Posix or Solaris thread id to a lightweight
-       process id.  If thread_id is non-existent, that's an error.  If it's
-       an inactive thread, then we return default_lwp.
+   This function converts a Posix or Solaris thread id to a lightweight
+   process id.  If thread_id is non-existent, that's an error.  If it's
+   an inactive thread, then we return default_lwp.
 
-NOTES
+   NOTES
 
-       This function probably shouldn't call error()...
+   This function probably shouldn't call error()...
 
  */
 
@@ -312,19 +315,19 @@ thread_to_lwp (thread_id, default_lwp)
   td_err_e val;
 
   if (is_lwp (thread_id))
-    return thread_id;                  /* It's already an LWP id */
+    return thread_id;          /* It's already an LWP id */
 
   /* It's a thread.  Convert to lwp */
 
   val = p_td_ta_map_id2thr (main_ta, GET_THREAD (thread_id), &th);
   if (val == TD_NOTHR)
-    return -1;         /* thread must have terminated */
+    return -1;                 /* thread must have terminated */
   else if (val != TD_OK)
     error ("thread_to_lwp: td_ta_map_id2thr %s", td_err_string (val));
 
   val = p_td_thr_get_info (&th, &ti);
   if (val == TD_NOTHR)
-    return -1;         /* thread must have terminated */
+    return -1;                 /* thread must have terminated */
   else if (val != TD_OK)
     error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val));
 
@@ -341,22 +344,22 @@ thread_to_lwp (thread_id, default_lwp)
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       lwp_to_thread - Convert a LWP id to a Posix or Solaris thread id.
+   lwp_to_thread - Convert a LWP id to a Posix or Solaris thread id.
 
-SYNOPSIS
+   SYNOPSIS
 
-       int lwp_to_thread (lwp_id)
+   int lwp_to_thread (lwp_id)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function converts a lightweight process id to a Posix or Solaris
-       thread id.  If thread_id is non-existent, that's an error.
+   This function converts a lightweight process id to a Posix or Solaris
+   thread id.  If thread_id is non-existent, that's an error.
 
-NOTES
+   NOTES
 
-       This function probably shouldn't call error()...
+   This function probably shouldn't call error()...
 
  */
 
@@ -378,7 +381,7 @@ lwp_to_thread (lwp)
 
   val = p_td_ta_map_lwp2thr (main_ta, GET_LWP (lwp), &th);
   if (val == TD_NOTHR)
-    return -1;         /* thread must have terminated */
+    return -1;                 /* thread must have terminated */
   else if (val != TD_OK)
     error ("lwp_to_thread: td_ta_map_lwp2thr: %s.", td_err_string (val));
 
@@ -390,7 +393,7 @@ lwp_to_thread (lwp)
 
   val = p_td_thr_get_info (&th, &ti);
   if (val == TD_NOTHR)
-    return -1;         /* thread must have terminated */
+    return -1;                 /* thread must have terminated */
   else if (val != TD_OK)
     error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
 
@@ -399,28 +402,28 @@ lwp_to_thread (lwp)
 \f
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       save_inferior_pid - Save inferior_pid on the cleanup list
-       restore_inferior_pid - Restore inferior_pid from the cleanup list
+   save_inferior_pid - Save inferior_pid on the cleanup list
+   restore_inferior_pid - Restore inferior_pid from the cleanup list
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct cleanup *save_inferior_pid ()
-       void restore_inferior_pid (int pid)
+   struct cleanup *save_inferior_pid ()
+   void restore_inferior_pid (int pid)
 
-DESCRIPTION
+   DESCRIPTION
 
-       These two functions act in unison to restore inferior_pid in
-       case of an error.
+   These two functions act in unison to restore inferior_pid in
+   case of an error.
 
-NOTES
+   NOTES
 
-       inferior_pid is a global variable that needs to be changed by many of
-       these routines before calling functions in procfs.c.  In order to
-       guarantee that inferior_pid gets restored (in case of errors), you
-       need to call save_inferior_pid before changing it.  At the end of the
-       function, you should invoke do_cleanups to restore it.
+   inferior_pid is a global variable that needs to be changed by many of
+   these routines before calling functions in procfs.c.  In order to
+   guarantee that inferior_pid gets restored (in case of errors), you
+   need to call save_inferior_pid before changing it.  At the end of the
+   function, you should invoke do_cleanups to restore it.
 
  */
 
@@ -428,7 +431,7 @@ NOTES
 static struct cleanup *
 save_inferior_pid ()
 {
-  return make_cleanup (restore_inferior_pid, (void*) inferior_pid);
+  return make_cleanup (restore_inferior_pid, (void *) inferior_pid);
 }
 
 static void
@@ -462,11 +465,11 @@ sol_thread_attach (args, from_tty)
 {
   procfs_ops.to_attach (args, from_tty);
   /* Must get symbols from solibs before libthread_db can run! */
-  SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
+  SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0);
   if (sol_thread_active)
     {
       printf_filtered ("sol-thread active.\n");
-      main_ph.pid = inferior_pid; /* Save for xfer_memory */
+      main_ph.pid = inferior_pid;      /* Save for xfer_memory */
       push_target (&sol_thread_ops);
       inferior_pid = lwp_to_thread (inferior_pid);
       if (inferior_pid == -1)
@@ -521,7 +524,7 @@ sol_thread_resume (pid, step, signo)
       if (pid == -2)           /* Inactive thread */
        error ("This version of Solaris can't start inactive threads.");
       if (info_verbose && pid == -1)
-       warning ("Specified thread %d seems to have terminated", 
+       warning ("Specified thread %d seems to have terminated",
                 GET_THREAD (save_pid));
     }
 
@@ -557,7 +560,7 @@ sol_thread_wait (pid, ourstatus)
       if (pid == -2)           /* Inactive thread */
        error ("This version of Solaris can't start inactive threads.");
       if (info_verbose && pid == -1)
-       warning ("Specified thread %d seems to have terminated", 
+       warning ("Specified thread %d seems to have terminated",
                 GET_THREAD (save_pid));
     }
 
@@ -604,7 +607,7 @@ sol_thread_fetch_registers (regno)
 #endif
 
   if (!is_thread (inferior_pid))
-    { /* LWP: pass the request on to procfs.c */
+    {                          /* LWP: pass the request on to procfs.c */
       if (target_has_execution)
        procfs_ops.to_fetch_registers (regno);
       else
@@ -683,7 +686,7 @@ sol_thread_store_registers (regno)
 #endif
 
   if (!is_thread (inferior_pid))
-    { /* LWP: pass the request on to procfs.c */
+    {                          /* LWP: pass the request on to procfs.c */
       procfs_ops.to_store_registers (regno);
       return;
     }
@@ -701,7 +704,7 @@ sol_thread_store_registers (regno)
     {                          /* Not writing all the regs */
       /* save new register value */
       char old_value[REGISTER_SIZE];
-      memcpy(old_value, & registers[REGISTER_BYTE(regno)], REGISTER_SIZE);
+      memcpy (old_value, &registers[REGISTER_BYTE (regno)], REGISTER_SIZE);
 
       val = p_td_thr_getgregs (&thandle, regset);
       if (val != TD_OK)
@@ -713,7 +716,7 @@ sol_thread_store_registers (regno)
               td_err_string (val));
 
       /* restore new register value */
-      memcpy(& registers[REGISTER_BYTE(regno)], old_value, REGISTER_SIZE);
+      memcpy (&registers[REGISTER_BYTE (regno)], old_value, REGISTER_SIZE);
 
 #if 0
 /* thread_db doesn't seem to handle this right */
@@ -775,14 +778,14 @@ sol_thread_xfer_memory (memaddr, myaddr, len, dowrite, target)
      char *myaddr;
      int len;
      int dowrite;
-     struct target_ops *target; /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   int retval;
   struct cleanup *old_chain;
 
   old_chain = save_inferior_pid ();
 
-  if (is_thread (inferior_pid) ||              /* A thread */
+  if (is_thread (inferior_pid) ||      /* A thread */
       !target_thread_alive (inferior_pid))     /* An lwp, but not alive */
     inferior_pid = procfs_first_available ();  /* Find any live lwp.  */
   /* Note: don't need to call switch_to_thread; we're just reading memory.  */
@@ -832,7 +835,7 @@ sol_thread_create_inferior (exec_file, allargs, env)
 
   if (sol_thread_active && inferior_pid != 0)
     {
-      main_ph.pid = inferior_pid; /* Save for xfer_memory */
+      main_ph.pid = inferior_pid;      /* Save for xfer_memory */
 
       push_target (&sol_thread_ops);
 
@@ -903,17 +906,17 @@ sol_thread_can_run ()
 
 /* 
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       sol_thread_alive     - test thread for "aliveness"
+   sol_thread_alive     - test thread for "aliveness"
 
-SYNOPSIS
+   SYNOPSIS
 
-       static bool sol_thread_alive (int pid);
+   static bool sol_thread_alive (int pid);
 
-DESCRIPTION
+   DESCRIPTION
 
-       returns true if thread still active in inferior.
+   returns true if thread still active in inferior.
 
  */
 
@@ -928,12 +931,13 @@ sol_thread_alive (pid)
 
       pid = GET_THREAD (pid);
       if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK)
-       return 0;       /* thread not found */
+       return 0;               /* thread not found */
       if ((val = p_td_thr_validate (&th)) != TD_OK)
-       return 0;       /* thread not valid */
-      return 1;                /* known thread: return true */
+       return 0;               /* thread not valid */
+      return 1;                        /* known thread: return true */
     }
-  else                 /* kernel thread (LWP): let procfs test it */
+  else
+    /* kernel thread (LWP): let procfs test it */
     {
       if (target_has_execution)
        return procfs_ops.to_thread_alive (pid);
@@ -954,11 +958,11 @@ sol_thread_stop ()
 /* Various versions of <proc_service.h> have slightly
    different function prototypes.  In particular, we have
 
-      NEWER                    OLDER
-      struct ps_prochandle *   const struct ps_prochandle *
-      void*                    char*
-      const void*              char*
-      int                      size_t
+   NEWER                        OLDER
+   struct ps_prochandle *       const struct ps_prochandle *
+   void*                        char*
+   const void*          char*
+   int                  size_t
 
    Which one you have depends on solaris version and what
    patches you've applied.  On the theory that there are
@@ -967,14 +971,14 @@ sol_thread_stop ()
    appropriate typedefs here. */
 
 #ifdef PROC_SERVICE_IS_OLD
-typedef const struct ps_prochandle * gdb_ps_prochandle_t;
-typedef char * gdb_ps_read_buf_t;
-typedef char * gdb_ps_write_buf_t;
+typedef const struct ps_prochandle *gdb_ps_prochandle_t;
+typedef char *gdb_ps_read_buf_t;
+typedef char *gdb_ps_write_buf_t;
 typedef int gdb_ps_size_t;
 #else
-typedef struct ps_prochandle * gdb_ps_prochandle_t;
-typedef void * gdb_ps_read_buf_t;
-typedef const void * gdb_ps_write_buf_t;
+typedef struct ps_prochandle *gdb_ps_prochandle_t;
+typedef void *gdb_ps_read_buf_t;
+typedef const void *gdb_ps_write_buf_t;
 typedef size_t gdb_ps_size_t;
 #endif
 
@@ -1010,7 +1014,7 @@ ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
 
 ps_err_e
 ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
-                  const char *ld_symbol_name, paddr_t *ld_symbol_addr)
+                  const char *ld_symbol_name, paddr_t * ld_symbol_addr)
 {
   struct minimal_symbol *ms;
 
@@ -1034,7 +1038,7 @@ rw_common (int dowrite, const struct ps_prochandle *ph, paddr_t addr,
 
   old_chain = save_inferior_pid ();
 
-  if (is_thread (inferior_pid) ||              /* A thread */
+  if (is_thread (inferior_pid) ||      /* A thread */
       !target_thread_alive (inferior_pid))     /* An lwp, but not alive */
     inferior_pid = procfs_first_available ();  /* Find any live lwp.  */
   /* Note: don't need to call switch_to_thread; we're just reading memory.  */
@@ -1079,7 +1083,7 @@ ps_err_e
 ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
            gdb_ps_write_buf_t buf, gdb_ps_size_t size)
 {
-  return rw_common (1, ph, addr, (char*) buf, size);
+  return rw_common (1, ph, addr, (char *) buf, size);
 }
 
 ps_err_e
@@ -1093,7 +1097,7 @@ ps_err_e
 ps_ptwrite (gdb_ps_prochandle_t ph, paddr_t addr,
            gdb_ps_write_buf_t buf, gdb_ps_size_t size)
 {
-  return rw_common (1, ph, addr, (char*) buf, size);
+  return rw_common (1, ph, addr, (char *) buf, size);
 }
 
 /* Get integer regs */
@@ -1107,7 +1111,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   old_chain = save_inferior_pid ();
 
   inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-  
+
   if (target_has_execution)
     procfs_ops.to_fetch_registers (-1);
   else
@@ -1130,7 +1134,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   old_chain = save_inferior_pid ();
 
   inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-  
+
   supply_gregset (gregset);
   if (target_has_execution)
     procfs_ops.to_store_registers (-1);
@@ -1143,7 +1147,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 }
 
 void
-ps_plog (const char *fmt, ...)
+ps_plog (const char *fmt,...)
 {
   va_list args;
 
@@ -1230,7 +1234,7 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
 
 ps_err_e
 ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
-              prfpregset_t *fpregset)
+              prfpregset_t * fpregset)
 {
   struct cleanup *old_chain;
 
@@ -1253,14 +1257,14 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 
 ps_err_e
 ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
-              const prfpregset_t *fpregset)
+              const prfpregset_t * fpregset)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_pid ();
 
   inferior_pid = BUILD_LWP (lwpid, PIDGET (inferior_pid));
-  
+
   supply_fpregset (fpregset);
   if (target_has_execution)
     procfs_ops.to_store_registers (-1);
@@ -1327,7 +1331,7 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 
   /* LDT not found.  */
   return PS_ERR;
-}        
+}
 #endif /* TM_I386SOL2_H */
 \f
 /* Convert a pid to printable form. */
@@ -1369,7 +1373,7 @@ solaris_pid_to_str (pid)
    kernel) thread. */
 
 static int
-sol_find_new_threads_callback(th, ignored)
+sol_find_new_threads_callback (th, ignored)
      const td_thrhandle_t *th;
      void *ignored;
 {
@@ -1377,13 +1381,13 @@ sol_find_new_threads_callback(th, ignored)
   td_thrinfo_t ti;
   int pid;
 
-  if ((retval = p_td_thr_get_info(th, &ti)) != TD_OK)
+  if ((retval = p_td_thr_get_info (th, &ti)) != TD_OK)
     {
       return -1;
     }
-  pid = BUILD_THREAD(ti.ti_tid, PIDGET(inferior_pid));
-  if (!in_thread_list(pid))
-    add_thread(pid);
+  pid = BUILD_THREAD (ti.ti_tid, PIDGET (inferior_pid));
+  if (!in_thread_list (pid))
+    add_thread (pid);
 
   return 0;
 }
@@ -1397,10 +1401,10 @@ sol_find_new_threads ()
 
   if (inferior_pid == -1)
     {
-      printf_filtered("No process.\n");
+      printf_filtered ("No process.\n");
       return;
     }
-  p_td_ta_thr_iter (main_ta, sol_find_new_threads_callback, (void *)0,
+  p_td_ta_thr_iter (main_ta, sol_find_new_threads_callback, (void *) 0,
                    TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
                    TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
 }
@@ -1440,7 +1444,7 @@ sol_core_files_info (t)
    gets called once for each Solaris thread (ie. not kernel thread) in the 
    inferior.  Print anything interesting that we can think of.  */
 
-static int 
+static int
 info_cb (th, s)
      const td_thrhandle_t *th;
      void *s;
@@ -1451,20 +1455,34 @@ info_cb (th, s)
 
   if ((ret = p_td_thr_get_info (th, &ti)) == TD_OK)
     {
-      printf_filtered ("%s thread #%d, lwp %d, ", 
-                      ti.ti_type == TD_THR_SYSTEM ? "system" : "user  ", 
+      printf_filtered ("%s thread #%d, lwp %d, ",
+                      ti.ti_type == TD_THR_SYSTEM ? "system" : "user  ",
                       ti.ti_tid, ti.ti_lid);
-      switch (ti.ti_state) {
+      switch (ti.ti_state)
+       {
        default:
-       case TD_THR_UNKNOWN: printf_filtered ("<unknown state>");       break;
-       case TD_THR_STOPPED: printf_filtered ("(stopped)");     break;
-       case TD_THR_RUN:     printf_filtered ("(run)    ");     break;
-       case TD_THR_ACTIVE:  printf_filtered ("(active) ");     break;
-       case TD_THR_ZOMBIE:  printf_filtered ("(zombie) ");     break;
-       case TD_THR_SLEEP:   printf_filtered ("(asleep) ");     break;
-       case TD_THR_STOPPED_ASLEEP: 
-         printf_filtered ("(stopped asleep)");                 break;
-      }
+       case TD_THR_UNKNOWN:
+         printf_filtered ("<unknown state>");
+         break;
+       case TD_THR_STOPPED:
+         printf_filtered ("(stopped)");
+         break;
+       case TD_THR_RUN:
+         printf_filtered ("(run)    ");
+         break;
+       case TD_THR_ACTIVE:
+         printf_filtered ("(active) ");
+         break;
+       case TD_THR_ZOMBIE:
+         printf_filtered ("(zombie) ");
+         break;
+       case TD_THR_SLEEP:
+         printf_filtered ("(asleep) ");
+         break;
+       case TD_THR_STOPPED_ASLEEP:
+         printf_filtered ("(stopped asleep)");
+         break;
+       }
       /* Print thr_create start function: */
       if (ti.ti_startfunc != 0)
        if (msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc))
@@ -1486,7 +1504,7 @@ info_cb (th, s)
   else
     warning ("info sol-thread: failed to get info for thread.");
 
-  return 0;    
+  return 0;
 }
 
 /* List some state about each Solaris user thread in the inferior.  */
@@ -1496,7 +1514,7 @@ info_solthreads (args, from_tty)
      char *args;
      int from_tty;
 {
-  p_td_ta_thr_iter (main_ta, info_cb, args, 
+  p_td_ta_thr_iter (main_ta, info_cb, args,
                    TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
                    TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
 }
@@ -1560,22 +1578,22 @@ init_sol_thread_ops ()
 static void
 init_sol_core_ops ()
 {
-  sol_core_ops.to_shortname  = "solaris-core";
-  sol_core_ops.to_longname  = "Solaris core threads and pthread.";
-  sol_core_ops.to_doc  = "Solaris threads and pthread support for core files.";
-  sol_core_ops.to_open  = sol_core_open;
-  sol_core_ops.to_close  = sol_core_close;
-  sol_core_ops.to_attach  = sol_thread_attach;
-  sol_core_ops.to_detach  = sol_core_detach;
+  sol_core_ops.to_shortname = "solaris-core";
+  sol_core_ops.to_longname = "Solaris core threads and pthread.";
+  sol_core_ops.to_doc = "Solaris threads and pthread support for core files.";
+  sol_core_ops.to_open = sol_core_open;
+  sol_core_ops.to_close = sol_core_close;
+  sol_core_ops.to_attach = sol_thread_attach;
+  sol_core_ops.to_detach = sol_core_detach;
   /* sol_core_ops.to_resume  = 0; */
-  /* sol_core_ops.to_wait  = 0;         */
-  sol_core_ops.to_fetch_registers  = sol_thread_fetch_registers;
+  /* sol_core_ops.to_wait  = 0;  */
+  sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
   /* sol_core_ops.to_store_registers  = 0; */
   /* sol_core_ops.to_prepare_to_store  = 0; */
-  sol_core_ops.to_xfer_memory  = sol_thread_xfer_memory;
-  sol_core_ops.to_files_info  = sol_core_files_info;
-  sol_core_ops.to_insert_breakpoint  = ignore;
-  sol_core_ops.to_remove_breakpoint  = ignore;
+  sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
+  sol_core_ops.to_files_info = sol_core_files_info;
+  sol_core_ops.to_insert_breakpoint = ignore;
+  sol_core_ops.to_remove_breakpoint = ignore;
   /* sol_core_ops.to_terminal_init  = 0; */
   /* sol_core_ops.to_terminal_inferior  = 0; */
   /* sol_core_ops.to_terminal_ours_for_output  = 0; */
@@ -1584,17 +1602,17 @@ init_sol_core_ops ()
   /* sol_core_ops.to_kill  = 0; */
   /* sol_core_ops.to_load  = 0; */
   /* sol_core_ops.to_lookup_symbol  = 0; */
-  sol_core_ops.to_create_inferior  = sol_thread_create_inferior;
-  sol_core_ops.to_stratum  = core_stratum;
-  sol_core_ops.to_has_all_memory  = 0;
-  sol_core_ops.to_has_memory  = 1;
-  sol_core_ops.to_has_stack  = 1;
-  sol_core_ops.to_has_registers  = 1;
-  sol_core_ops.to_has_execution  = 0;
-  sol_core_ops.to_has_thread_control  = tc_none;
-  sol_core_ops.to_sections  = 0;
-  sol_core_ops.to_sections_end  = 0;
-  sol_core_ops.to_magic  = OPS_MAGIC;
+  sol_core_ops.to_create_inferior = sol_thread_create_inferior;
+  sol_core_ops.to_stratum = core_stratum;
+  sol_core_ops.to_has_all_memory = 0;
+  sol_core_ops.to_has_memory = 1;
+  sol_core_ops.to_has_stack = 1;
+  sol_core_ops.to_has_registers = 1;
+  sol_core_ops.to_has_execution = 0;
+  sol_core_ops.to_has_thread_control = tc_none;
+  sol_core_ops.to_sections = 0;
+  sol_core_ops.to_sections_end = 0;
+  sol_core_ops.to_magic = OPS_MAGIC;
 }
 
 /* we suppress the call to add_target of core_ops in corelow because
@@ -1647,16 +1665,16 @@ _initialize_sol_thread ()
 
   procfs_suppress_run = 1;
 
-  add_cmd ("sol-threads", class_maintenance, info_solthreads, 
-           "Show info on Solaris user threads.\n", &maintenanceinfolist);
+  add_cmd ("sol-threads", class_maintenance, info_solthreads,
+          "Show info on Solaris user threads.\n", &maintenanceinfolist);
 
-  memcpy(&orig_core_ops, &core_ops, sizeof (struct target_ops));
-  memcpy(&core_ops, &sol_core_ops, sizeof (struct target_ops));
+  memcpy (&orig_core_ops, &core_ops, sizeof (struct target_ops));
+  memcpy (&core_ops, &sol_core_ops, sizeof (struct target_ops));
   add_target (&core_ops);
 
   return;
 
- die:
+die:
 
   fprintf_unfiltered (gdb_stderr, "[GDB will not be able to debug user-mode threads: %s]\n", dlerror ());
 
@@ -1664,7 +1682,7 @@ _initialize_sol_thread ()
     dlclose (dlhandle);
 
   /* allow the user to debug non-threaded core files */
-  add_target(&core_ops);
+  add_target (&core_ops);
 
   return;
 }
index 2bd8a2ec79412e844162f94b2908f0b463497397..65b35e74fc09ee7cc4004cdb94b0e730472053bf 100644 (file)
@@ -1,22 +1,23 @@
 /* Handle SunOS and SVR4 shared libraries for GDB, the GNU Debugger.
    Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 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 file is part of GDB.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is free software; you can 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.
 
-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 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"
@@ -34,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef SVR4_SHARED_LIBS
  /* SunOS shared libs need the nlist structure.  */
-#include <a.out.h> 
+#include <a.out.h>
 #else
 #include "elf/external.h"
 #endif
@@ -55,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "language.h"
 #include "gdbcmd.h"
 
-#define MAX_PATH_SIZE 512              /* FIXME: Should be dynamic */
+#define MAX_PATH_SIZE 512      /* FIXME: Should be dynamic */
 
 /* On SVR4 systems, a list of symbols in the dynamic linker where
    GDB can try to place a breakpoint to monitor shared library
@@ -66,7 +67,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    mapping complete" breakpoint address.  */
 
 #ifdef SVR4_SHARED_LIBS
-static char *solib_break_names[] = {
+static char *solib_break_names[] =
+{
   "r_debug_state",
   "_r_debug_state",
   "_dl_debug_state",
@@ -78,7 +80,8 @@ static char *solib_break_names[] = {
 #define BKPT_AT_SYMBOL 1
 
 #if defined (BKPT_AT_SYMBOL) && defined (SVR4_SHARED_LIBS)
-static char *bkpt_names[] = {
+static char *bkpt_names[] =
+{
 #ifdef SOLIB_BKPT_NAME
   SOLIB_BKPT_NAME,             /* Prefer configured name if it exists. */
 #endif
@@ -91,14 +94,16 @@ static char *bkpt_names[] = {
 /* Symbols which are used to locate the base of the link map structures. */
 
 #ifndef SVR4_SHARED_LIBS
-static char *debug_base_symbols[] = {
+static char *debug_base_symbols[] =
+{
   "_DYNAMIC",
   "_DYNAMIC__MGC",
   NULL
 };
 #endif
 
-static char *main_name_list[] = {
+static char *main_name_list[] =
+{
   "main_$main",
   NULL
 };
@@ -118,7 +123,7 @@ static struct ld_debug debug_copy;
 static CORE_ADDR debug_addr;
 static CORE_ADDR flag_addr;
 
-#else  /* SVR4_SHARED_LIBS */
+#else /* SVR4_SHARED_LIBS */
 
 #define LM_ADDR(so) ((so) -> lm.l_addr)
 #define LM_NEXT(so) ((so) -> lm.l_next)
@@ -128,31 +133,32 @@ static CORE_ADDR flag_addr;
 static struct r_debug debug_copy;
 char shadow_contents[BREAKPOINT_MAX];  /* Stash old bkpt addr contents */
 
-#endif /* !SVR4_SHARED_LIBS */
-
-struct so_list {
-  struct so_list *next;                        /* next structure in linked list */
-  struct link_map lm;                  /* copy of link map from inferior */
-  struct link_map *lmaddr;             /* addr in inferior lm was read from */
-  CORE_ADDR lmend;                     /* upper addr bound of mapped object */
-  char so_name[MAX_PATH_SIZE];         /* shared object lib name (FIXME) */
-  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;
-};
+#endif /* !SVR4_SHARED_LIBS */
+
+struct so_list
+  {
+    struct so_list *next;      /* next structure in linked list */
+    struct link_map lm;                /* copy of link map from inferior */
+    struct link_map *lmaddr;   /* addr in inferior lm was read from */
+    CORE_ADDR lmend;           /* upper addr bound of mapped object */
+    char so_name[MAX_PATH_SIZE];       /* shared object lib name (FIXME) */
+    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 debug_base;   /* Base of dynamic linker structures */
 static CORE_ADDR breakpoint_addr;      /* Address where end bkpt is set */
 
-static int solib_cleanup_queued = 0;    /* make_run_cleanup called */
+static int solib_cleanup_queued = 0;   /* make_run_cleanup called */
 
 extern int
-fdmatch PARAMS ((int, int));           /* In libiberty */
+fdmatch PARAMS ((int, int));   /* In libiberty */
 
 /* Local function prototypes */
 
@@ -177,20 +183,20 @@ info_sharedlibrary_command PARAMS ((char *, int));
 static int symbol_add_stub PARAMS ((PTR));
 
 static struct so_list *
-find_solib PARAMS ((struct so_list *));
+  find_solib PARAMS ((struct so_list *));
 
 static struct link_map *
-first_link_map_member PARAMS ((void));
+  first_link_map_member PARAMS ((void));
 
 static CORE_ADDR
-locate_base PARAMS ((void));
+  locate_base PARAMS ((void));
 
 static int solib_map_sections PARAMS ((PTR));
 
 #ifdef SVR4_SHARED_LIBS
 
 static CORE_ADDR
-elf_locate_base PARAMS ((void));
+  elf_locate_base PARAMS ((void));
 
 #else
 
@@ -218,29 +224,29 @@ static char *solib_search_path = NULL;
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       solib_map_sections -- open bfd and build sections for shared lib
+   solib_map_sections -- open bfd and build sections for shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int solib_map_sections (struct so_list *so)
+   static int solib_map_sections (struct so_list *so)
 
-DESCRIPTION
+   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.
+   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
+   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?).
+   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
@@ -254,9 +260,9 @@ solib_map_sections (arg)
   struct section_table *p;
   struct cleanup *old_chain;
   bfd *abfd;
-  
-  filename = tilde_expand (so -> so_name);
-  
+
+  filename = tilde_expand (so->so_name);
+
   if (solib_absolute_prefix && ROOTED_P (filename))
     /* Prefix shared libraries with absolute filenames with
        SOLIB_ABSOLUTE_PREFIX.  */
@@ -286,12 +292,12 @@ solib_map_sections (arg)
     scratch_chan = openp (solib_search_path,
                          1, filename, O_RDONLY, 0, &scratch_pathname);
   if (scratch_chan < 0)
-    scratch_chan = openp (get_in_environ (inferior_environ, "PATH"), 
+    scratch_chan = openp (get_in_environ (inferior_environ, "PATH"),
                          1, filename, O_RDONLY, 0, &scratch_pathname);
   if (scratch_chan < 0)
     {
-      scratch_chan = openp (get_in_environ 
-                           (inferior_environ, "LD_LIBRARY_PATH"), 
+      scratch_chan = openp (get_in_environ
+                           (inferior_environ, "LD_LIBRARY_PATH"),
                            1, filename, O_RDONLY, 0, &scratch_pathname);
     }
   if (scratch_chan < 0)
@@ -308,8 +314,8 @@ solib_map_sections (arg)
             scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
   /* Leave bfd open, core_xfer_memory and "info files" need it.  */
-  so -> abfd = abfd;
-  abfd -> cacheable = true;
+  so->abfd = abfd;
+  abfd->cacheable = true;
 
   /* copy full path name into so_name, so that later symbol_file_add can find
      it */
@@ -322,23 +328,23 @@ solib_map_sections (arg)
       error ("\"%s\": not in executable format: %s.",
             scratch_pathname, bfd_errmsg (bfd_get_error ()));
     }
-  if (build_section_table (abfd, &so -> sections, &so -> sections_end))
+  if (build_section_table (abfd, &so->sections, &so->sections_end))
     {
-      error ("Can't find the file sections in `%s': %s", 
+      error ("Can't find the file sections in `%s': %s",
             bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
     }
 
-  for (p = so -> sections; p < so -> sections_end; p++)
+  for (p = so->sections; p < so->sections_end; p++)
     {
       /* Relocate the section binding addresses as recorded in the shared
-        object's file by the base address to which the object was actually
-        mapped. */
-      p -> addr += (CORE_ADDR) LM_ADDR (so);
-      p -> endaddr += (CORE_ADDR) LM_ADDR (so);
-      so -> lmend = (CORE_ADDR) max (p -> endaddr, so -> lmend);
-      if (STREQ (p -> the_bfd_section -> name, ".text"))
+         object's file by the base address to which the object was actually
+         mapped. */
+      p->addr += (CORE_ADDR) LM_ADDR (so);
+      p->endaddr += (CORE_ADDR) LM_ADDR (so);
+      so->lmend = (CORE_ADDR) max (p->endaddr, so->lmend);
+      if (STREQ (p->the_bfd_section->name, ".text"))
        {
-         so -> textsection = p;
+         so->textsection = p;
        }
     }
 
@@ -360,28 +366,28 @@ allocate_rt_common_objfile ()
 
   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,
+  objfile->md = NULL;
+  obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
                              xmalloc, free);
-  obstack_specify_allocation (&objfile -> psymbol_obstack, 0, 0, xmalloc,
+  obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
                              free);
-  obstack_specify_allocation (&objfile -> symbol_obstack, 0, 0, xmalloc,
+  obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
                              free);
-  obstack_specify_allocation (&objfile -> type_obstack, 0, 0, xmalloc,
+  obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
                              free);
-  objfile -> name = mstrsave (objfile -> md, "rt_common");
+  objfile->name = mstrsave (objfile->md, "rt_common");
 
   /* Add this file onto the tail of the linked list of other such files. */
 
-  objfile -> next = NULL;
+  objfile->next = NULL;
   if (object_files == NULL)
     object_files = objfile;
   else
     {
       for (last_one = object_files;
-          last_one -> next;
-          last_one = last_one -> next);
-      last_one -> next = objfile;
+          last_one->next;
+          last_one = last_one->next);
+      last_one->next = objfile;
     }
 
   rt_common_objfile = objfile;
@@ -393,7 +399,7 @@ allocate_rt_common_objfile ()
 
 static void
 solib_add_common_symbols (rtc_symp)
-    struct rtc_symb *rtc_symp;
+     struct rtc_symb *rtc_symp;
 {
   struct rtc_symb inferior_rtc_symb;
   struct nlist inferior_rtc_nlist;
@@ -402,13 +408,13 @@ solib_add_common_symbols (rtc_symp)
 
   /* Remove any runtime common symbols from previous runs.  */
 
-  if (rt_common_objfile != NULL && rt_common_objfile -> minimal_symbol_count)
+  if (rt_common_objfile != NULL && rt_common_objfile->minimal_symbol_count)
     {
-      obstack_free (&rt_common_objfile -> symbol_obstack, 0);
-      obstack_specify_allocation (&rt_common_objfile -> symbol_obstack, 0, 0,
+      obstack_free (&rt_common_objfile->symbol_obstack, 0);
+      obstack_specify_allocation (&rt_common_objfile->symbol_obstack, 0, 0,
                                  xmalloc, free);
-      rt_common_objfile -> minimal_symbol_count = 0;
-      rt_common_objfile -> msymbols = NULL;
+      rt_common_objfile->minimal_symbol_count = 0;
+      rt_common_objfile->msymbols = NULL;
     }
 
   init_minimal_symbol_collection ();
@@ -421,7 +427,7 @@ solib_add_common_symbols (rtc_symp)
                   sizeof (inferior_rtc_symb));
       read_memory ((CORE_ADDR) inferior_rtc_symb.rtc_sp,
                   (char *) &inferior_rtc_nlist,
-                  sizeof(inferior_rtc_nlist));
+                  sizeof (inferior_rtc_nlist));
       if (inferior_rtc_nlist.n_type == N_COMM)
        {
          /* FIXME: The length of the symbol name is not available, but in the
@@ -449,34 +455,34 @@ solib_add_common_symbols (rtc_symp)
   install_minimal_symbols (rt_common_objfile);
 }
 
-#endif /* SVR4_SHARED_LIBS */
+#endif /* SVR4_SHARED_LIBS */
 
 
 #ifdef SVR4_SHARED_LIBS
 
 static CORE_ADDR
-bfd_lookup_symbol PARAMS ((bfd *, char *));
+  bfd_lookup_symbol PARAMS ((bfd *, char *));
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       bfd_lookup_symbol -- lookup the value for a specific symbol
+   bfd_lookup_symbol -- lookup the value for a specific symbol
 
-SYNOPSIS
+   SYNOPSIS
 
-       CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname)
+   CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname)
 
-DESCRIPTION
+   DESCRIPTION
 
-       An expensive way to lookup the value of a single symbol for
-       bfd's that are only temporary anyway.  This is used by the
-       shared library support to find the address of the debugger
-       interface structures in the shared library.
+   An expensive way to lookup the value of a single symbol for
+   bfd's that are only temporary anyway.  This is used by the
+   shared library support to find the address of the debugger
+   interface structures in the shared library.
 
-       Note that 0 is specifically allowed as an error return (no
-       such symbol).
-*/
+   Note that 0 is specifically allowed as an error return (no
+   such symbol).
+ */
 
 static CORE_ADDR
 bfd_lookup_symbol (abfd, symname)
@@ -490,22 +496,22 @@ bfd_lookup_symbol (abfd, symname)
   unsigned int i;
   struct cleanup *back_to;
   CORE_ADDR symaddr = 0;
-  
+
   storage_needed = bfd_get_symtab_upper_bound (abfd);
 
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, (PTR)symbol_table);
-      number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); 
-  
+      back_to = make_cleanup (free, (PTR) 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 (STREQ (sym->name, symname))
            {
              /* Bfd symbols are section relative. */
-             symaddr = sym -> value + sym -> section -> vma;
+             symaddr = sym->value + sym->section->vma;
              break;
            }
        }
@@ -517,25 +523,26 @@ bfd_lookup_symbol (abfd, symname)
 #ifdef HANDLE_SVR4_EXEC_EMULATORS
 
 /*
-       Solaris BCP (the part of Solaris which allows it to run SunOS4
-       a.out files) throws in another wrinkle. Solaris does not fill
-       in the usual a.out link map structures when running BCP programs,
-       the only way to get at them is via groping around in the dynamic
-       linker.
-       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.
-
-       Note that we can assume nothing about the process state at the time
-       we need to find these structures.  We may be stopped on the first
-       instruction 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 char *debug_base_symbols[] = {
-  "r_debug",   /* Solaris 2.3 */
-  "_r_debug",  /* Solaris 2.1, 2.2 */
+   Solaris BCP (the part of Solaris which allows it to run SunOS4
+   a.out files) throws in another wrinkle. Solaris does not fill
+   in the usual a.out link map structures when running BCP programs,
+   the only way to get at them is via groping around in the dynamic
+   linker.
+   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.
+
+   Note that we can assume nothing about the process state at the time
+   we need to find these structures.  We may be stopped on the first
+   instruction 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 char *debug_base_symbols[] =
+{
+  "r_debug",                   /* Solaris 2.3 */
+  "_r_debug",                  /* Solaris 2.1, 2.2 */
   NULL
 };
 
@@ -544,28 +551,28 @@ look_for_base PARAMS ((int, CORE_ADDR));
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       look_for_base -- examine file for each mapped address segment
+   look_for_base -- examine file for each mapped address segment
 
-SYNOPSYS
+   SYNOPSYS
 
-       static int look_for_base (int fd, CORE_ADDR baseaddr)
+   static int look_for_base (int fd, CORE_ADDR baseaddr)
 
-DESCRIPTION
+   DESCRIPTION
 
-       This function is passed to proc_iterate_over_mappings, which
-       causes it to get called once for each mapped address space, with
-       an open file descriptor for the file mapped to that space, and the
-       base address of that mapped space.
+   This function is passed to proc_iterate_over_mappings, which
+   causes it to get called once for each mapped address space, with
+   an open file descriptor for the file mapped to that space, and the
+   base address of that mapped space.
 
-       Our job is to find the debug base symbol in the file that this
-       fd is open on, if it exists, and if so, initialize the dynamic
-       linker structure base address debug_base.
+   Our job is to find the debug base symbol in the file that this
+   fd is open on, if it exists, and if so, initialize the dynamic
+   linker structure base address debug_base.
 
-       Note that this is a computationally expensive proposition, since
-       we basically have to open a bfd on every call, so we specifically
-       avoid opening the exec file.
+   Note that this is a computationally expensive proposition, since
+   we basically have to open a bfd on every call, so we specifically
+   avoid opening the exec file.
  */
 
 static int
@@ -583,7 +590,7 @@ look_for_base (fd, baseaddr)
 
   if (fd == -1
       || (exec_bfd != NULL
-         && fdmatch (fileno ((FILE *)(exec_bfd -> iostream)), fd)))
+         && fdmatch (fileno ((FILE *) (exec_bfd->iostream)), fd)))
     {
       return (0);
     }
@@ -599,7 +606,7 @@ look_for_base (fd, baseaddr)
   if (!bfd_check_format (interp_bfd, bfd_object))
     {
       /* FIXME-leak: on failure, might not free all memory associated with
-        interp_bfd.  */
+         interp_bfd.  */
       bfd_close (interp_bfd);
       return (0);
     }
@@ -618,7 +625,7 @@ look_for_base (fd, baseaddr)
   if (address == 0)
     {
       /* FIXME-leak: on failure, might not free all memory associated with
-        interp_bfd.  */
+         interp_bfd.  */
       bfd_close (interp_bfd);
       return (0);
     }
@@ -645,25 +652,25 @@ look_for_base (fd, baseaddr)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       elf_locate_base -- locate the base address of dynamic linker structs
-       for SVR4 elf targets.
+   elf_locate_base -- locate the base address of dynamic linker structs
+   for SVR4 elf targets.
 
-SYNOPSIS
+   SYNOPSIS
 
-       CORE_ADDR elf_locate_base (void)
+   CORE_ADDR elf_locate_base (void)
 
-DESCRIPTION
+   DESCRIPTION
 
-       For SVR4 elf targets the address of the dynamic linker's runtime
-       structure is contained within the dynamic info section in the
-       executable file.  The dynamic section is also mapped into the
-       inferior address space.  Because the runtime loader fills in the
-       real address before starting the inferior, we have to read in the
-       dynamic info section from the inferior address space.
-       If there are any errors while trying to find the address, we
-       silently return 0, otherwise the found address is returned.
+   For SVR4 elf targets the address of the dynamic linker's runtime
+   structure is contained within the dynamic info section in the
+   executable file.  The dynamic section is also mapped into the
+   inferior address space.  Because the runtime loader fills in the
+   real address before starting the inferior, we have to read in the
+   dynamic info section from the inferior address space.
+   If there are any errors while trying to find the address, we
+   silently return 0, otherwise the found address is returned.
 
  */
 
@@ -696,7 +703,7 @@ elf_locate_base ()
        buf < bufend;
        buf += sizeof (Elf32_External_Dyn))
     {
-      Elf32_External_Dyn *x_dynp = (Elf32_External_Dyn *)buf;
+      Elf32_External_Dyn *x_dynp = (Elf32_External_Dyn *) buf;
       long dyn_tag;
       CORE_ADDR dyn_ptr;
 
@@ -727,7 +734,7 @@ elf_locate_base ()
        buf < bufend;
        buf += sizeof (Elf64_External_Dyn))
     {
-      Elf64_External_Dyn *x_dynp = (Elf64_External_Dyn *)buf;
+      Elf64_External_Dyn *x_dynp = (Elf64_External_Dyn *) buf;
       long dyn_tag;
       CORE_ADDR dyn_ptr;
 
@@ -746,42 +753,42 @@ elf_locate_base ()
   return 0;
 }
 
-#endif /* SVR4_SHARED_LIBS */
+#endif /* SVR4_SHARED_LIBS */
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       locate_base -- locate the base address of dynamic linker structs
+   locate_base -- locate the base address of dynamic linker structs
 
-SYNOPSIS
+   SYNOPSIS
 
-       CORE_ADDR locate_base (void)
+   CORE_ADDR locate_base (void)
 
-DESCRIPTION
+   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 debug base symbol.  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 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 debug base symbol.  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.
+   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 a bit more complicated because the address
-       is contained somewhere in the dynamic info section.  We have to go
-       to a lot more work to discover the address of the debug base symbol.
-       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.
+   The SVR4 version is a bit more complicated because the address
+   is contained somewhere in the dynamic info section.  We have to go
+   to a lot more work to discover the address of the debug base symbol.
+   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.
 
  */
 
@@ -810,7 +817,7 @@ locate_base ()
     }
   return (0);
 
-#else  /* SVR4_SHARED_LIBS */
+#else /* SVR4_SHARED_LIBS */
 
   /* Check to see if we have a currently valid address, and if so, avoid
      doing all this work again and just return the cached address.  If
@@ -830,26 +837,26 @@ locate_base ()
     }
   return (debug_base);
 
-#endif /* !SVR4_SHARED_LIBS */
+#endif /* !SVR4_SHARED_LIBS */
 
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       first_link_map_member -- locate first member in dynamic linker's map
+   first_link_map_member -- locate first member in dynamic linker's map
 
-SYNOPSIS
+   SYNOPSIS
 
-       static struct link_map *first_link_map_member (void)
+   static struct link_map *first_link_map_member (void)
 
-DESCRIPTION
+   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 copy in our address space.
-*/
+   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 copy in our address space.
+ */
 
 static struct link_map *
 first_link_map_member ()
@@ -862,13 +869,13 @@ first_link_map_member ()
   if (dynamic_copy.ld_version >= 2)
     {
       /* It is a version that we can deal with, so read in the secondary
-        structure and find the address of the link map list from it. */
+         structure and find the address of the link map list from it. */
       read_memory ((CORE_ADDR) dynamic_copy.ld_un.ld_2, (char *) &ld_2_copy,
                   sizeof (struct link_dynamic_2));
       lm = ld_2_copy.ld_loaded;
     }
 
-#else  /* SVR4_SHARED_LIBS */
+#else /* SVR4_SHARED_LIBS */
 
   read_memory (debug_base, (char *) &debug_copy, sizeof (struct r_debug));
   /* FIXME:  Perhaps we should validate the info somehow, perhaps by
@@ -876,32 +883,32 @@ first_link_map_member ()
      RT_CONSISTENT. */
   lm = debug_copy.r_map;
 
-#endif /* !SVR4_SHARED_LIBS */
+#endif /* !SVR4_SHARED_LIBS */
 
   return (lm);
 }
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       find_solib -- step through list of shared objects
+   find_solib -- step through list of shared objects
 
-SYNOPSIS
+   SYNOPSIS
 
-       struct so_list *find_solib (struct so_list *so_list_ptr)
+   struct so_list *find_solib (struct so_list *so_list_ptr)
 
-DESCRIPTION
+   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.
+   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.
 
-       The arg and return value are "struct link_map" pointers, as defined
-       in <link.h>.
+   The arg and return value are "struct link_map" pointers, as defined
+   in <link.h>.
  */
 
 static struct so_list *
@@ -911,7 +918,7 @@ find_solib (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. */
@@ -923,7 +930,7 @@ find_solib (so_list_ptr)
          if (debug_base != 0)
            {
              /* Read the base structure in and find the address of the first
-                link map list member. */
+                link map list member. */
              lm = first_link_map_member ();
            }
        }
@@ -931,13 +938,13 @@ find_solib (so_list_ptr)
   else
     {
       /* We have been called before, and are in the process of walking
-        the shared library list.  Advance to the next shared object. */
+         the shared library list.  Advance to the next shared object. */
       if ((lm = LM_NEXT (so_list_ptr)) == NULL)
        {
          /* 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 = target_read_memory ((CORE_ADDR) so_list_ptr -> lmaddr,
-                                          (char *) &(so_list_ptr -> lm),
+         int status = target_read_memory ((CORE_ADDR) so_list_ptr->lmaddr,
+                                          (char *) &(so_list_ptr->lm),
                                           sizeof (struct link_map));
          if (status == 0)
            {
@@ -948,41 +955,41 @@ find_solib (so_list_ptr)
              lm = NULL;
            }
        }
-      so_list_next = so_list_ptr -> next;
+      so_list_next = so_list_ptr->next;
     }
   if ((so_list_next == NULL) && (lm != NULL))
     {
       /* Get next link map structure from inferior image and build a local
-        abbreviated load_map structure */
+         abbreviated load_map structure */
       new = (struct so_list *) xmalloc (sizeof (struct so_list));
       memset ((char *) new, 0, sizeof (struct so_list));
-      new -> lmaddr = lm;
+      new->lmaddr = lm;
       /* Add the new node as the next node in the list, or as the root
-        node if this is the first one. */
+         node if this is the first one. */
       if (so_list_ptr != NULL)
        {
-         so_list_ptr -> next = new;
+         so_list_ptr->next = new;
        }
       else
        {
          so_list_head = new;
 
-         if (! solib_cleanup_queued)
+         if (!solib_cleanup_queued)
            {
              make_run_cleanup (do_clear_solib, NULL);
              solib_cleanup_queued = 1;
            }
-         
-       }      
+
+       }
       so_list_next = new;
-      read_memory ((CORE_ADDR) lm, (char *) &(new -> lm),
+      read_memory ((CORE_ADDR) lm, (char *) &(new->lm),
                   sizeof (struct link_map));
       /* For SVR4 versions, the first entry in the link map is for the
-        inferior executable, so we must ignore it.  For some versions of
-        SVR4, it has no name.  For others (Solaris 2.3 for example), it
-        does have a name, so we can no longer use a missing name to
-        decide when to ignore it. */
-      if (!IGNORE_FIRST_LINK_MAP_ENTRY (new -> lm))
+         inferior executable, so we must ignore it.  For some versions of
+         SVR4, it has no name.  For others (Solaris 2.3 for example), it
+         does have a name, so we can no longer use a missing name to
+         decide when to ignore it. */
+      if (!IGNORE_FIRST_LINK_MAP_ENTRY (new->lm))
        {
          int errcode;
          char *buffer;
@@ -994,13 +1001,13 @@ find_solib (so_list_ptr)
                       safe_strerror (errcode));
              return (so_list_next);
            }
-         strncpy (new -> so_name, buffer, MAX_PATH_SIZE - 1);
-         new -> so_name[MAX_PATH_SIZE - 1] = '\0';
+         strncpy (new->so_name, buffer, MAX_PATH_SIZE - 1);
+         new->so_name[MAX_PATH_SIZE - 1] = '\0';
          free (buffer);
          catch_errors (solib_map_sections, new,
                        "Error while mapping shared library sections:\n",
                        RETURN_MASK_ALL);
-       }      
+       }
     }
   return (so_list_next);
 }
@@ -1011,34 +1018,34 @@ static int
 symbol_add_stub (arg)
      PTR arg;
 {
-  register struct so_list *so = (struct so_list *) arg;        /* catch_errs bogon */
+  register struct so_list *so = (struct so_list *) arg;                /* catch_errs bogon */
   CORE_ADDR text_addr = 0;
 
-  if (so -> textsection)
-    text_addr = so -> textsection -> addr;
-  else if (so -> abfd != NULL)
+  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.  */
+         text_addr so that the relocation in symbol_file_add does no harm.  */
 
-      lowest_sect = bfd_get_section_by_name (so -> abfd, ".text");
+      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);
+       bfd_map_over_sections (so->abfd, find_lowest_section,
+                              (PTR) & lowest_sect);
       if (lowest_sect)
-       text_addr = bfd_section_vma (so -> abfd, lowest_sect)
-                   + (CORE_ADDR) LM_ADDR (so);
-    }
-  
-  ALL_OBJFILES (so -> objfile)
-    {
-      if (strcmp (so -> objfile -> name, so -> so_name) == 0)
-       return 1;
+       text_addr = bfd_section_vma (so->abfd, lowest_sect)
+         + (CORE_ADDR) LM_ADDR (so);
     }
-  so -> objfile =
-    symbol_file_add (so -> so_name, so -> from_tty,
+
+  ALL_OBJFILES (so->objfile)
+  {
+    if (strcmp (so->objfile->name, so->so_name) == 0)
+      return 1;
+  }
+  so->objfile =
+    symbol_file_add (so->so_name, so->from_tty,
                     text_addr,
                     0, 0, 0, 0, 1);
   return (1);
@@ -1047,8 +1054,9 @@ symbol_add_stub (arg)
 /* This function will check the so name to see if matches the main list.
    In some system the main object is in the list, which we want to exclude */
 
-static int match_main (soname)
-    char *soname;
+static int
+match_main (soname)
+     char *soname;
 {
   char **mainp;
 
@@ -1063,26 +1071,26 @@ static int match_main (soname)
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_add -- add a shared library file to the symtab and section list
+   solib_add -- add a shared library file to the symtab and section list
 
-SYNOPSIS
+   SYNOPSIS
 
-       void solib_add (char *arg_string, int from_tty,
-                       struct target_ops *target)
+   void solib_add (char *arg_string, int from_tty,
+   struct target_ops *target)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 void
 solib_add (arg_string, from_tty, target)
      char *arg_string;
      int from_tty;
      struct target_ops *target;
-{      
-  register struct so_list *so = NULL;          /* link map state variable */
+{
+  register struct so_list *so = NULL;  /* link map state variable */
 
   /* Last shared library that we read.  */
   struct so_list *so_last = NULL;
@@ -1090,12 +1098,12 @@ solib_add (arg_string, from_tty, target)
   char *re_err;
   int count;
   int old;
-  
+
   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)
@@ -1105,12 +1113,12 @@ solib_add (arg_string, from_tty, target)
       count = 0;
       while ((so = find_solib (so)) != NULL)
        {
-         if (so -> so_name[0] && !match_main (so -> so_name))
+         if (so->so_name[0] && !match_main (so->so_name))
            {
-             count += so -> sections_end - so -> sections;
+             count += so->sections_end - so->sections;
            }
        }
-      
+
       if (count)
        {
          int update_coreops;
@@ -1119,23 +1127,23 @@ solib_add (arg_string, from_tty, target)
             here, otherwise we dereference a potential dangling pointer
             for each call to target_read/write_memory within this routine.  */
          update_coreops = core_ops.to_sections == target->to_sections;
-                    
+
          /* Reallocate the target's section table including the new size.  */
-         if (target -> to_sections)
+         if (target->to_sections)
            {
-             old = target -> to_sections_end - target -> to_sections;
-             target -> to_sections = (struct section_table *)
-               xrealloc ((char *)target -> to_sections,
-                        (sizeof (struct section_table)) * (count + old));
+             old = target->to_sections_end - target->to_sections;
+             target->to_sections = (struct section_table *)
+               xrealloc ((char *) target->to_sections,
+                         (sizeof (struct section_table)) * (count + old));
            }
          else
            {
              old = 0;
-             target -> to_sections = (struct section_table *)
+             target->to_sections = (struct section_table *)
                xmalloc ((sizeof (struct section_table)) * count);
            }
-         target -> to_sections_end = target -> to_sections + (count + old);
-         
+         target->to_sections_end = target->to_sections + (count + old);
+
          /* Update the to_sections field in the core_ops structure
             if needed.  */
          if (update_coreops)
@@ -1147,30 +1155,30 @@ solib_add (arg_string, from_tty, target)
          /* Add these section table entries to the target's table.  */
          while ((so = find_solib (so)) != NULL)
            {
-             if (so -> so_name[0])
+             if (so->so_name[0])
                {
-                 count = so -> sections_end - so -> sections;
-                 memcpy ((char *) (target -> to_sections + old),
-                         so -> sections, 
+                 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) && 
-      !match_main (so -> so_name))
+      if (so->so_name[0] && re_exec (so->so_name) &&
+         !match_main (so->so_name))
        {
-         so -> from_tty = from_tty;
-         if (so -> symbols_loaded)
+         so->from_tty = from_tty;
+         if (so->symbols_loaded)
            {
              if (from_tty)
                {
-                 printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name);
+                 printf_unfiltered ("Symbols already loaded for %s\n", so->so_name);
                }
            }
          else if (catch_errors
@@ -1179,7 +1187,7 @@ solib_add (arg_string, from_tty, target)
                    RETURN_MASK_ALL))
            {
              so_last = so;
-             so -> symbols_loaded = 1;
+             so->symbols_loaded = 1;
            }
        }
     }
@@ -1195,26 +1203,26 @@ solib_add (arg_string, from_tty, target)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       info_sharedlibrary_command -- code for "info sharedlibrary"
+   info_sharedlibrary_command -- code for "info sharedlibrary"
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void info_sharedlibrary_command ()
+   static void info_sharedlibrary_command ()
 
-DESCRIPTION
+   DESCRIPTION
 
-       Walk through the shared library list and print information
-       about each attached library.
-*/
+   Walk through the shared library list and print information
+   about each attached library.
+ */
 
 static void
 info_sharedlibrary_command (ignore, from_tty)
      char *ignore;
      int from_tty;
 {
-  register struct so_list *so = NULL;          /* link map state variable */
+  register struct so_list *so = NULL;  /* link map state variable */
   int header_done = 0;
   int addr_width;
   char *addr_fmt;
@@ -1226,77 +1234,77 @@ info_sharedlibrary_command (ignore, from_tty)
     }
 
 #ifndef TARGET_ELF64
-  addr_width = 8+4;
+  addr_width = 8 + 4;
   addr_fmt = "08l";
 #else
-  addr_width = 16+4;
+  addr_width = 16 + 4;
   addr_fmt = "016l";
 #endif
 
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0])
+      if (so->so_name[0])
        {
          if (!header_done)
            {
-             printf_unfiltered("%-*s%-*s%-12s%s\n", addr_width, "From",
-                               addr_width, "To", "Syms Read",
-                               "Shared Object Library");
+             printf_unfiltered ("%-*s%-*s%-12s%s\n", addr_width, "From",
+                                addr_width, "To", "Syms Read",
+                                "Shared Object Library");
              header_done++;
            }
 
          printf_unfiltered ("%-*s", addr_width,
-                 local_hex_string_custom ((unsigned long) LM_ADDR (so),
-                                          addr_fmt));
+                     local_hex_string_custom ((unsigned long) LM_ADDR (so),
+                                              addr_fmt));
          printf_unfiltered ("%-*s", addr_width,
-                 local_hex_string_custom ((unsigned long) so -> lmend,
-                                          addr_fmt));
-         printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No");
-         printf_unfiltered ("%s\n",  so -> so_name);
+                        local_hex_string_custom ((unsigned long) so->lmend,
+                                                 addr_fmt));
+         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");        
+      printf_unfiltered ("No shared libraries loaded at this time.\n");
     }
 }
 
 /*
 
-GLOBAL FUNCTION
+   GLOBAL FUNCTION
 
-       solib_address -- check to see if an address is in a shared lib
+   solib_address -- check to see if an address is in a shared lib
 
-SYNOPSIS
+   SYNOPSIS
 
-       char * solib_address (CORE_ADDR address)
+   char * solib_address (CORE_ADDR address)
 
-DESCRIPTION
+   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.
+   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.
+   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 (address)
      CORE_ADDR address;
 {
-  register struct so_list *so = 0;     /* link map state variable */
-  
+  register struct so_list *so = 0;     /* link map state variable */
+
   while ((so = find_solib (so)) != NULL)
     {
-      if (so -> so_name[0])
+      if (so->so_name[0])
        {
          if ((address >= (CORE_ADDR) LM_ADDR (so)) &&
-             (address < (CORE_ADDR) so -> lmend))
+             (address < (CORE_ADDR) so->lmend))
            return (so->so_name);
        }
     }
@@ -1305,7 +1313,7 @@ solib_address (address)
 
 /* Called by free_all_symtabs */
 
-void 
+void
 clear_solib ()
 {
   struct so_list *next;
@@ -1337,14 +1345,14 @@ clear_solib ()
 
   while (so_list_head)
     {
-      if (so_list_head -> sections)
+      if (so_list_head->sections)
        {
-         free ((PTR)so_list_head -> sections);
+         free ((PTR) so_list_head->sections);
        }
-      if (so_list_head -> abfd)
+      if (so_list_head->abfd)
        {
-         bfd_filename = bfd_get_filename (so_list_head -> abfd);
-         if (!bfd_close (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 ()));
        }
@@ -1352,10 +1360,10 @@ clear_solib ()
        /* This happens for the executable on SVR4.  */
        bfd_filename = NULL;
 
-      next = so_list_head -> next;
+      next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR)bfd_filename);
-      free ((PTR)so_list_head);
+       free ((PTR) bfd_filename);
+      free ((PTR) so_list_head);
       so_list_head = next;
     }
   debug_base = 0;
@@ -1391,20 +1399,20 @@ in_svr4_dynsym_resolve_code (pc)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       disable_break -- remove the "mapping changed" breakpoint
+   disable_break -- remove the "mapping changed" breakpoint
 
-SYNOPSIS
+   SYNOPSIS
 
-       static int disable_break ()
+   static int disable_break ()
 
-DESCRIPTION
+   DESCRIPTION
 
-       Removes the breakpoint that gets hit when the dynamic linker
-       completes a mapping change.
+   Removes the breakpoint that gets hit when the dynamic linker
+   completes a mapping change.
 
-*/
+ */
 
 #ifndef SVR4_SHARED_LIBS
 
@@ -1416,7 +1424,7 @@ disable_break ()
 #ifndef SVR4_SHARED_LIBS
 
   int in_debugger = 0;
-  
+
   /* Read the debugger structure from the inferior to retrieve the
      address of the breakpoint and the original contents of the
      breakpoint address.  Remove the breakpoint by writing the original
@@ -1432,7 +1440,7 @@ disable_break ()
   write_memory (breakpoint_addr, (char *) &debug_copy.ldd_bp_inst,
                sizeof (debug_copy.ldd_bp_inst));
 
-#else  /* SVR4_SHARED_LIBS */
+#else /* SVR4_SHARED_LIBS */
 
   /* Note that breakpoint address and original contents are in our address
      space, so we just need to write the original contents back. */
@@ -1442,7 +1450,7 @@ disable_break ()
       status = 0;
     }
 
-#endif /* !SVR4_SHARED_LIBS */
+#endif /* !SVR4_SHARED_LIBS */
 
   /* 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.
@@ -1456,50 +1464,50 @@ disable_break ()
   return (status);
 }
 
-#endif /* #ifdef SVR4_SHARED_LIBS */
+#endif /* #ifdef SVR4_SHARED_LIBS */
 
 /*
 
-LOCAL FUNCTION
-
-       enable_break -- arrange for dynamic linker to hit breakpoint
-
-SYNOPSIS
-
-       int enable_break (void)
-
-DESCRIPTION
-
-       Both the SunOS and the SVR4 dynamic linkers have, as part of their
-       debugger interface, support for arranging for the inferior to hit
-       a breakpoint after mapping in the shared libraries.  This function
-       enables that breakpoint.
-
-       For SunOS, there is a special flag location (in_debugger) which we
-       set to 1.  When the dynamic linker sees this flag set, it will set
-       a breakpoint at a location known only to itself, after saving the
-       original contents of that place and the breakpoint address itself,
-       in it's own internal structures.  When we resume the inferior, it
-       will eventually take a SIGTRAP when it runs into the breakpoint.
-       We handle this (in a different place) by restoring the contents of
-       the breakpointed location (which is only known after it stops),
-       chasing around to locate the shared libraries that have been
-       loaded, then resuming.
-
-       For SVR4, the debugger interface structure contains a member (r_brk)
-       which is statically initialized at the time the shared library is
-       built, to the offset of a function (_r_debug_state) which is guaran-
-       teed to be called once before mapping in a library, and again when
-       the mapping is complete.  At the time we are examining this member,
-       it contains only the unrelocated offset of the function, so we have
-       to do our own relocation.  Later, when the dynamic linker actually
-       runs, it relocates r_brk to be the actual address of _r_debug_state().
-
-       The debugger interface structure also contains an enumeration which
-       is set to either RT_ADD or RT_DELETE prior to changing the mapping,
-       depending upon whether or not the library is being mapped or unmapped,
-       and then set to RT_CONSISTENT after the library is mapped/unmapped.
-*/
+   LOCAL FUNCTION
+
+   enable_break -- arrange for dynamic linker to hit breakpoint
+
+   SYNOPSIS
+
+   int enable_break (void)
+
+   DESCRIPTION
+
+   Both the SunOS and the SVR4 dynamic linkers have, as part of their
+   debugger interface, support for arranging for the inferior to hit
+   a breakpoint after mapping in the shared libraries.  This function
+   enables that breakpoint.
+
+   For SunOS, there is a special flag location (in_debugger) which we
+   set to 1.  When the dynamic linker sees this flag set, it will set
+   a breakpoint at a location known only to itself, after saving the
+   original contents of that place and the breakpoint address itself,
+   in it's own internal structures.  When we resume the inferior, it
+   will eventually take a SIGTRAP when it runs into the breakpoint.
+   We handle this (in a different place) by restoring the contents of
+   the breakpointed location (which is only known after it stops),
+   chasing around to locate the shared libraries that have been
+   loaded, then resuming.
+
+   For SVR4, the debugger interface structure contains a member (r_brk)
+   which is statically initialized at the time the shared library is
+   built, to the offset of a function (_r_debug_state) which is guaran-
+   teed to be called once before mapping in a library, and again when
+   the mapping is complete.  At the time we are examining this member,
+   it contains only the unrelocated offset of the function, so we have
+   to do our own relocation.  Later, when the dynamic linker actually
+   runs, it relocates r_brk to be the actual address of _r_debug_state().
+
+   The debugger interface structure also contains an enumeration which
+   is set to either RT_ADD or RT_DELETE prior to changing the mapping,
+   depending upon whether or not the library is being mapped or unmapped,
+   and then set to RT_CONSISTENT after the library is mapped/unmapped.
+ */
 
 static int
 enable_break ()
@@ -1536,7 +1544,7 @@ enable_break ()
   write_memory (flag_addr, (char *) &in_debugger, sizeof (in_debugger));
   success = 1;
 
-#else  /* SVR4_SHARED_LIBS */
+#else /* SVR4_SHARED_LIBS */
 
 #ifdef BKPT_AT_SYMBOL
 
@@ -1564,20 +1572,20 @@ enable_break ()
       CORE_ADDR sym_addr = 0;
 
       /* Read the contents of the .interp section into a local buffer;
-        the contents specify the dynamic linker this program uses.  */
+         the contents specify the dynamic linker this program uses.  */
       interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
       buf = alloca (interp_sect_size);
       bfd_get_section_contents (exec_bfd, interp_sect,
                                buf, 0, interp_sect_size);
 
       /* Now we need to figure out where the dynamic linker was
-        loaded so that we can load its symbols and place a breakpoint
-        in the dynamic linker itself.
+         loaded so that we can load its symbols and place a breakpoint
+         in the dynamic linker itself.
 
-        This address is stored on the stack.  However, I've been unable
-        to find any magic formula to find it for Solaris (appears to
-        be trivial on GNU/Linux).  Therefore, we have to try an alternate
-        mechanism to find the dynamic linker's base address.  */
+         This address is stored on the stack.  However, I've been unable
+         to find any magic formula to find it for Solaris (appears to
+         be trivial on GNU/Linux).  Therefore, we have to try an alternate
+         mechanism to find the dynamic linker's base address.  */
       tmp_bfd = bfd_openr (buf, gnutarget);
       if (tmp_bfd == NULL)
        goto bkpt_at_symbol;
@@ -1591,12 +1599,12 @@ enable_break ()
        }
 
       /* We find the dynamic linker's base address by examining the
-        current pc (which point at the entry point for the dynamic
-        linker) and subtracting the offset of the entry point.  */
+         current pc (which point at the entry point for the dynamic
+         linker) and subtracting the offset of the entry point.  */
       load_addr = read_pc () - tmp_bfd->start_address;
 
       /* Record the relocated start and end address of the dynamic linker
-        text and plt section for in_svr4_dynsym_resolve_code.  */
+         text and plt section for in_svr4_dynsym_resolve_code.  */
       interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
       if (interp_sect)
        {
@@ -1632,8 +1640,8 @@ enable_break ()
        }
 
       /* For whatever reason we couldn't set a breakpoint in the dynamic
-        linker.  Warn and drop into the old code.  */
-bkpt_at_symbol:
+         linker.  Warn and drop into the old code.  */
+    bkpt_at_symbol:
       warning ("Unable to find dynamic linker breakpoint function.\nGDB will be unable to debug shared library initializers\nand track explicitly loaded dynamic code.");
     }
 #endif
@@ -1655,67 +1663,67 @@ bkpt_at_symbol:
   /* Nothing good happened.  */
   success = 0;
 
-#endif /* BKPT_AT_SYMBOL */
+#endif /* BKPT_AT_SYMBOL */
 
-#endif /* !SVR4_SHARED_LIBS */
+#endif /* !SVR4_SHARED_LIBS */
 
   return (success);
 }
-  
+
 /*
-  
-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()
+
+   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 ()
 {
   /* If we are using the BKPT_AT_SYMBOL code, then we don't need the base
      yet.  In fact, in the case of a SunOS4 executable being run on
@@ -1781,30 +1789,30 @@ solib_create_inferior_hook()
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       special_symbol_handling -- additional shared library symbol handling
+   special_symbol_handling -- additional shared library symbol handling
 
-SYNOPSIS
+   SYNOPSIS
 
-       void special_symbol_handling (struct so_list *so)
+   void special_symbol_handling (struct so_list *so)
 
-DESCRIPTION
+   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.
+   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 consists 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.
+   For SunOS4, this consists 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.
 
-*/
+ */
 
 static void
 special_symbol_handling (so)
-struct so_list *so;
+     struct so_list *so;
 {
 #ifndef SVR4_SHARED_LIBS
   int j;
@@ -1823,7 +1831,7 @@ struct so_list *so;
 
       /* Calc address of debugger interface structure */
       /* FIXME, this needs work for cross-debugging of core files
-        (byteorder, size, alignment, etc).  */
+         (byteorder, size, alignment, etc).  */
 
       debug_addr = (CORE_ADDR) dynamic_copy.ldd;
     }
@@ -1834,7 +1842,7 @@ struct so_list *so;
   j = target_read_memory (debug_addr, (char *) &debug_copy,
                          sizeof (debug_copy));
   if (j)
-    return;            /* unreadable */
+    return;                    /* unreadable */
 
   /* Get common symbol definitions for the loaded object. */
 
@@ -1843,28 +1851,28 @@ struct so_list *so;
       solib_add_common_symbols (debug_copy.ldd_cp);
     }
 
-#endif /* !SVR4_SHARED_LIBS */
+#endif /* !SVR4_SHARED_LIBS */
 }
 
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       sharedlibrary_command -- handle command to explicitly add library
+   sharedlibrary_command -- handle command to explicitly add library
 
-SYNOPSIS
+   SYNOPSIS
 
-       static void sharedlibrary_command (char *args, int from_tty)
+   static void sharedlibrary_command (char *args, int from_tty)
 
-DESCRIPTION
+   DESCRIPTION
 
-*/
+ */
 
 static void
 sharedlibrary_command (args, from_tty)
-char *args;
-int from_tty;
+     char *args;
+     int from_tty;
 {
   dont_repeat ();
   solib_add (args, from_tty, (struct target_ops *) 0);
@@ -1873,13 +1881,13 @@ int from_tty;
 #endif /* HAVE_LINK_H */
 
 void
-_initialize_solib()
+_initialize_solib ()
 {
 #ifdef HAVE_LINK_H
 
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           "Load shared object library symbols for files matching REGEXP.");
-  add_info ("sharedlibrary", info_sharedlibrary_command, 
+  add_info ("sharedlibrary", info_sharedlibrary_command,
            "Status of loaded shared object libraries.");
 
   add_show_from_set
index eafef48b2b9a4e87244f1464f8111b467aaca370..9268b67089cba4ce2065db36c063e0701728cc0d 100644 (file)
@@ -1,23 +1,24 @@
 /* Shared library declarations for GDB, the GNU Debugger.
    Copyright (C) 1992, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decl's for prototypes */
+#ifdef __STDC__                        /* Forward decl's for prototypes */
 struct target_ops;
 #endif
 
@@ -50,18 +51,18 @@ solib_add PARAMS ((char *, int, struct target_ops *));
    the debugger, as CLEAR_SOLIB does.)
 
    This functionality is presently not implemented for this target.
  */
+ */
 #define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0)
 
 extern void
-solib_create_inferior_hook PARAMS((void));     /* solib.c */
+solib_create_inferior_hook PARAMS ((void));    /* solib.c */
 
 /* This function is called by the "catch load" command.  It allows
    the debugger to be notified by the dynamic linker when a specified
    library file (or any library file, if filename is NULL) is loaded.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string) \
    error("catch of library loads/unloads not yet implemented on this platform")
 
@@ -70,7 +71,7 @@ solib_create_inferior_hook PARAMS((void));    /* solib.c */
    library file (or any library file, if filename is NULL) is unloaded.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename,cond_string) \
    error("catch of library loads/unloads not yet implemented on this platform")
 
@@ -81,12 +82,12 @@ solib_create_inferior_hook PARAMS((void));  /* solib.c */
    the dynamic linker hook, or undefined results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 
 /*
-#define SOLIB_HAVE_LOAD_EVENT(pid) \
-    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+   #define SOLIB_HAVE_LOAD_EVENT(pid) \
+   error("catch of library loads/unloads not yet implemented on this platform")
+ */
 
 #define SOLIB_HAVE_LOAD_EVENT(pid) \
 (0)
@@ -103,12 +104,12 @@ solib_create_inferior_hook PARAMS((void));        /* solib.c */
    string if they wish to continue the inferior and then access the string.
 
    Presently, this functionality is not implemented.
  */
+ */
 
 /*
-#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
+   #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
 (0)
@@ -120,11 +121,11 @@ solib_create_inferior_hook PARAMS((void));        /* solib.c */
    the dynamic linker hook, or undefined results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 /*
-#define SOLIB_HAVE_UNLOAD_EVENT(pid) \
+   #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
 (0)
@@ -141,11 +142,11 @@ solib_create_inferior_hook PARAMS((void));        /* solib.c */
    string if they wish to continue the inferior and then access the string.
 
    Presently, this functionality is not implemented.
  */
+ */
 /*
-#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
+   #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
 (0)
@@ -159,12 +160,12 @@ solib_create_inferior_hook PARAMS((void));        /* solib.c */
    results are guaranteed.
 
    Presently, this functionality is not implemented.
  */
+ */
 
 /*
-#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
+   #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
    error("catch of library loads/unloads not yet implemented on this platform")
-*/
+ */
 
 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
 (0)
@@ -174,7 +175,7 @@ solib_create_inferior_hook PARAMS((void));  /* solib.c */
    any symbol tables.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_RESTART() \
   (0)
 
@@ -184,7 +185,7 @@ solib_create_inferior_hook PARAMS((void));  /* solib.c */
 #define DISABLE_UNSETTABLE_BREAK(addr) (solib_address(addr) != NULL)
 
 extern char *
-solib_address PARAMS ((CORE_ADDR));            /* solib.c */
+  solib_address PARAMS ((CORE_ADDR));  /* solib.c */
 
 /* If ADDR lies in a shared library, return its name.  */
 
index 259835ff8e74bd5ea010650ea7ce1f37fcde7dd6..bbbaa98a7c03521da092f288708ac3938fbf9105 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
@@ -52,7 +53,7 @@ som_symtab_read PARAMS ((bfd *, struct objfile *,
                         struct section_offsets *));
 
 static struct section_offsets *
-som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
+  som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
 
 /* FIXME: These should really be in a common header somewhere */
 
@@ -70,22 +71,22 @@ do_pxdb PARAMS ((bfd *));
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       som_symtab_read -- read the symbol table of a SOM file
+   som_symtab_read -- read the symbol table of a SOM file
 
-SYNOPSIS
+   SYNOPSIS
 
-       void som_symtab_read (bfd *abfd, struct objfile *objfile,
-                             struct section_offsets *section_offsets)
+   void som_symtab_read (bfd *abfd, struct objfile *objfile,
+   struct section_offsets *section_offsets)
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given an open bfd, a base address to relocate symbols to, and a
-       flag that specifies whether or not this bfd is for an executable
-       or not (may be shared library for example), add all the global
-       function and data symbols to the minimal symbol table.
-*/
+   Given an open bfd, a base address to relocate symbols to, and a
+   flag that specifies whether or not this bfd is for an executable
+   or not (may be shared library for example), add all the global
+   function and data symbols to the minimal symbol table.
+ */
 
 static void
 som_symtab_read (abfd, objfile, section_offsets)
@@ -172,8 +173,8 @@ som_symtab_read (abfd, objfile, section_offsets)
            case ST_ENTRY:
              symname = bufp->name.n_strx + stringtab;
              /* For a dynamic executable, ST_ENTRY symbols are
-                the stubs, while the ST_CODE symbol is the real
-                function.  */
+                the stubs, while the ST_CODE symbol is the real
+                function.  */
              if (dynamic)
                ms_type = mst_solib_trampoline;
              else
@@ -224,21 +225,21 @@ som_symtab_read (abfd, objfile, section_offsets)
 
            check_strange_names:
              /* Utah GCC 2.5, FSF GCC 2.6 and later generate correct local
-                label prefixes for stabs, constant data, etc.  So we need
-                only filter out L$ symbols which are left in due to
-                limitations in how GAS generates SOM relocations.
-
-                When linking in the HPUX C-library the HP linker has
-                the nasty habit of placing section symbols from the literal
-                subspaces in the middle of the program's text.  Filter
-                those out as best we can.  Check for first and last character
-                being '$'. 
-
-                And finally, the newer HP compilers emit crud like $PIC_foo$N
-                in some circumstance (PIC code I guess).  It's also claimed
-                that they emit D$ symbols too.  What stupidity.  */
+                label prefixes for stabs, constant data, etc.  So we need
+                only filter out L$ symbols which are left in due to
+                limitations in how GAS generates SOM relocations.
+
+                When linking in the HPUX C-library the HP linker has
+                the nasty habit of placing section symbols from the literal
+                subspaces in the middle of the program's text.  Filter
+                those out as best we can.  Check for first and last character
+                being '$'. 
+
+                And finally, the newer HP compilers emit crud like $PIC_foo$N
+                in some circumstance (PIC code I guess).  It's also claimed
+                that they emit D$ symbols too.  What stupidity.  */
              if ((symname[0] == 'L' && symname[1] == '$')
-                 || (symname[0] == '$' && symname[strlen(symname) - 1] == '$')
+             || (symname[0] == '$' && symname[strlen (symname) - 1] == '$')
                  || (symname[0] == 'D' && symname[1] == '$')
                  || (strncmp (symname, "$PIC", 4) == 0))
                continue;
@@ -258,8 +259,8 @@ som_symtab_read (abfd, objfile, section_offsets)
            case ST_ENTRY:
              symname = bufp->name.n_strx + stringtab;
              /* For a dynamic executable, ST_ENTRY symbols are
-                the stubs, while the ST_CODE symbol is the real
-                function.  */
+                the stubs, while the ST_CODE symbol is the real
+                function.  */
              if (dynamic)
                ms_type = mst_solib_trampoline;
              else
@@ -291,24 +292,24 @@ som_symtab_read (abfd, objfile, section_offsets)
            }
          break;
 
-       /* This can happen for common symbols when -E is passed to the
-          final link.  No idea _why_ that would make the linker force
-          common symbols to have an SS_UNSAT scope, but it does.
+         /* This can happen for common symbols when -E is passed to the
+            final link.  No idea _why_ that would make the linker force
+            common symbols to have an SS_UNSAT scope, but it does.
 
-          This also happens for weak symbols, but their type is
-          ST_DATA.  */
+            This also happens for weak symbols, but their type is
+            ST_DATA.  */
        case SS_UNSAT:
          switch (bufp->symbol_type)
            {
-             case ST_STORAGE:
-             case ST_DATA:
-               symname = bufp->name.n_strx + stringtab;
-               bufp->symbol_value += data_offset;
-               ms_type = mst_data;
-               break;
-
-             default:
-               continue;
+           case ST_STORAGE:
+           case ST_DATA:
+             symname = bufp->name.n_strx + stringtab;
+             bufp->symbol_value += data_offset;
+             ms_type = mst_data;
+             break;
+
+           default:
+             continue;
            }
          break;
 
@@ -320,7 +321,7 @@ som_symtab_read (abfd, objfile, section_offsets)
        error ("Invalid symbol data; bad HP string table offset: %d",
               bufp->name.n_strx);
 
-      prim_record_minimal_symbol (symname, bufp->symbol_value, ms_type, 
+      prim_record_minimal_symbol (symname, bufp->symbol_value, ms_type,
                                  objfile);
     }
 }
@@ -373,7 +374,7 @@ som_symfile_read (objfile, section_offsets, mainline)
      hp-symtab-read.c to handle static vars declared in other
      shared libraries. */
   init_import_symbols (objfile);
-#if 0   /* Export symbols not used today 1997-08-05 */ 
+#if 0                          /* Export symbols not used today 1997-08-05 */
   init_export_symbols (objfile);
 #else
   objfile->export_list = NULL;
@@ -384,13 +385,13 @@ som_symfile_read (objfile, section_offsets, mainline)
      This reads in the DNTT and string table, but doesn't
      actually scan the DNTT. It does scan the linker symbol
      table and thus build up a "minimal symbol table". */
+
   som_symtab_read (abfd, objfile, section_offsets);
 
   /* Now read information from the stabs debug sections.
      This is a no-op for SOM.
      Perhaps it is intended for some kind of mixed STABS/SOM
-     situation? */    
+     situation? */
   stabsect_build_psymtabs (objfile, section_offsets, mainline,
                           "$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
 
@@ -435,9 +436,9 @@ static void
 som_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (objfile -> sym_stab_info != NULL)
+  if (objfile->sym_stab_info != NULL)
     {
-      mfree (objfile -> md, objfile -> sym_stab_info);
+      mfree (objfile->md, objfile->sym_stab_info);
     }
   hpread_symfile_finish (objfile);
 }
@@ -469,7 +470,7 @@ som_symfile_offsets (objfile, addr)
 
   objfile->num_sections = SECT_OFF_MAX;
   section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile -> psymbol_obstack, SIZEOF_SECTION_OFFSETS);
+    obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
 
   /* First see if we're a shared library.  If so, get the section
      offsets from the library, else get them from addr.  */
@@ -489,11 +490,12 @@ som_symfile_offsets (objfile, addr)
    1 => true, 0 => false
    This is used in hp_symtab_read.c to deal with static variables
    that are defined in a different shared library than the one
-   whose symbols are being processed. */ 
+   whose symbols are being processed. */
 
-int is_in_import_list (name, objfile)
-  char * name;
-  struct objfile * objfile;
+int
+is_in_import_list (name, objfile)
+     char *name;
+     struct objfile *objfile;
 {
   register int i;
 
@@ -502,9 +504,9 @@ int is_in_import_list (name, objfile)
       !*name)
     return 0;
 
-  for (i=0; i < objfile->import_list_size; i++)
+  for (i = 0; i < objfile->import_list_size; i++)
     if (objfile->import_list[i] && STREQ (name, objfile->import_list[i]))
-        return 1;
+      return 1;
   return 0;
 }
 
@@ -517,110 +519,112 @@ int is_in_import_list (name, objfile)
    Return value = number of import symbols read in. */
 int
 init_import_symbols (objfile)
-  struct objfile * objfile;
+     struct objfile *objfile;
 {
   unsigned int import_list;
   unsigned int import_list_size;
   unsigned int string_table;
   unsigned int string_table_size;
-  char * string_buffer;
+  char *string_buffer;
   register int i;
   register int j;
   register int k;
-  asection * text_section;      /* section handle */ 
-  unsigned int dl_header[12];   /* SOM executable header */ 
+  asection *text_section;      /* section handle */
+  unsigned int dl_header[12];  /* SOM executable header */
 
   /* A struct for an entry in the SOM import list */
-  typedef struct {
-    int name;              /* index into the string table */ 
-    short dont_care1;      /* we don't use this */ 
-    unsigned char type;    /* 0 = NULL, 2 = Data, 3 = Code, 7 = Storage, 13 = Plabel */ 
-    unsigned int reserved2 : 8; /* not used */ 
-  } SomImportEntry;
-
-  /* We read 100 entries in at a time from the disk file. */ 
-# define SOM_READ_IMPORTS_NUM         100
-# define SOM_READ_IMPORTS_CHUNK_SIZE  (sizeof (SomImportEntry) * SOM_READ_IMPORTS_NUM)
+  typedef struct
+    {
+      int name;                        /* index into the string table */
+      short dont_care1;                /* we don't use this */
+      unsigned char type;      /* 0 = NULL, 2 = Data, 3 = Code, 7 = Storage, 13 = Plabel */
+      unsigned int reserved2:8;        /* not used */
+    }
+  SomImportEntry;
+
+  /* We read 100 entries in at a time from the disk file. */
+#define SOM_READ_IMPORTS_NUM         100
+#define SOM_READ_IMPORTS_CHUNK_SIZE  (sizeof (SomImportEntry) * SOM_READ_IMPORTS_NUM)
   SomImportEntry buffer[SOM_READ_IMPORTS_NUM];
-  
+
   /* Initialize in case we error out */
   objfile->import_list = NULL;
   objfile->import_list_size = 0;
 
   /* It doesn't work, for some reason, to read in space $TEXT$;
-     the subspace $SHLIB_INFO$ has to be used.  Some BFD quirk? pai/1997-08-05 */ 
+     the subspace $SHLIB_INFO$ has to be used.  Some BFD quirk? pai/1997-08-05 */
   text_section = bfd_get_section_by_name (objfile->obfd, "$SHLIB_INFO$");
   if (!text_section)
     return 0;
-  /* Get the SOM executable header */ 
+  /* Get the SOM executable header */
   bfd_get_section_contents (objfile->obfd, text_section, dl_header, 0, 12 * sizeof (int));
 
   /* Check header version number for 10.x HP-UX */
   /* Currently we deal only with 10.x systems; on 9.x the version # is 89060912.
-     FIXME: Change for future HP-UX releases and mods to the SOM executable format */ 
+     FIXME: Change for future HP-UX releases and mods to the SOM executable format */
   if (dl_header[0] != 93092112)
     return 0;
-  
-  import_list = dl_header[4];     
+
+  import_list = dl_header[4];
   import_list_size = dl_header[5];
   if (!import_list_size)
     return 0;
-  string_table = dl_header[10];     
+  string_table = dl_header[10];
   string_table_size = dl_header[11];
   if (!string_table_size)
     return 0;
 
-  /* Suck in SOM string table */ 
+  /* Suck in SOM string table */
   string_buffer = (char *) xmalloc (string_table_size);
   bfd_get_section_contents (objfile->obfd, text_section, string_buffer,
-                            string_table, string_table_size);
+                           string_table, string_table_size);
 
   /* Allocate import list in the psymbol obstack; this has nothing
      to do with psymbols, just a matter of convenience.  We want the
-     import list to be freed when the objfile is deallocated */ 
+     import list to be freed when the objfile is deallocated */
   objfile->import_list
     = (ImportEntry *) obstack_alloc (&objfile->psymbol_obstack,
-                                      import_list_size * sizeof (ImportEntry));
+                                  import_list_size * sizeof (ImportEntry));
 
-  /* Read in the import entries, a bunch at a time */ 
-  for (j=0, k=0;
+  /* Read in the import entries, a bunch at a time */
+  for (j = 0, k = 0;
        j < (import_list_size / SOM_READ_IMPORTS_NUM);
        j++)
     {
       bfd_get_section_contents (objfile->obfd, text_section, buffer,
-                                import_list + j * SOM_READ_IMPORTS_CHUNK_SIZE,
-                                SOM_READ_IMPORTS_CHUNK_SIZE);
-      for (i=0; i < SOM_READ_IMPORTS_NUM; i++, k++)
-        {
-          if (buffer[i].type != (unsigned char) 0) 
-            {
-              objfile->import_list[k]
-                = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
-              strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
-              /* Some day we might want to record the type and other information too */ 
-            }
-          else /* null type */ 
-            objfile->import_list[k] = NULL;
-          
-        }
+                             import_list + j * SOM_READ_IMPORTS_CHUNK_SIZE,
+                               SOM_READ_IMPORTS_CHUNK_SIZE);
+      for (i = 0; i < SOM_READ_IMPORTS_NUM; i++, k++)
+       {
+         if (buffer[i].type != (unsigned char) 0)
+           {
+             objfile->import_list[k]
+               = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+             strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
+             /* Some day we might want to record the type and other information too */
+           }
+         else                  /* null type */
+           objfile->import_list[k] = NULL;
+
+       }
     }
 
-  /* Get the leftovers */ 
+  /* Get the leftovers */
   if (k < import_list_size)
     bfd_get_section_contents (objfile->obfd, text_section, buffer,
-                              import_list + k * sizeof (SomImportEntry),
-                              (import_list_size - k) * sizeof (SomImportEntry));
-  for (i=0; k < import_list_size; i++, k++)
+                             import_list + k * sizeof (SomImportEntry),
+                         (import_list_size - k) * sizeof (SomImportEntry));
+  for (i = 0; k < import_list_size; i++, k++)
     {
       if (buffer[i].type != (unsigned char) 0)
-        {
-          objfile->import_list[k]
-            = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
-          strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
-          /* Some day we might want to record the type and other information too */ 
-        }
+       {
+         objfile->import_list[k]
+           = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+         strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
+         /* Some day we might want to record the type and other information too */
+       }
       else
-        objfile->import_list[k] = NULL;
+       objfile->import_list[k] = NULL;
     }
 
   objfile->import_list_size = import_list_size;
@@ -636,33 +640,35 @@ init_import_symbols (objfile)
    Return value = number of import symbols read in. */
 int
 init_export_symbols (objfile)
-  struct objfile * objfile;
+     struct objfile *objfile;
 {
   unsigned int export_list;
   unsigned int export_list_size;
   unsigned int string_table;
   unsigned int string_table_size;
-  char * string_buffer;
+  char *string_buffer;
   register int i;
   register int j;
   register int k;
-  asection * text_section;    /* section handle */  
-  unsigned int dl_header[12]; /* SOM executable header */ 
+  asection *text_section;      /* section handle */
+  unsigned int dl_header[12];  /* SOM executable header */
 
   /* A struct for an entry in the SOM export list */
-  typedef struct {
-    int next;    /* for hash table use -- we don't use this */ 
-    int name;    /* index into string table */ 
-    int value;   /* offset or plabel */
-    int dont_care1;     /* not used */ 
-    unsigned char type; /* 0 = NULL, 2 = Data, 3 = Code, 7 = Storage, 13 = Plabel */ 
-    char dont_care2;    /* not used */ 
-    short dont_care3;   /* not used */ 
-  } SomExportEntry;
-
-  /* We read 100 entries in at a time from the disk file. */ 
-# define SOM_READ_EXPORTS_NUM         100  
-# define SOM_READ_EXPORTS_CHUNK_SIZE  (sizeof (SomExportEntry) * SOM_READ_EXPORTS_NUM)
+  typedef struct
+    {
+      int next;                        /* for hash table use -- we don't use this */
+      int name;                        /* index into string table */
+      int value;               /* offset or plabel */
+      int dont_care1;          /* not used */
+      unsigned char type;      /* 0 = NULL, 2 = Data, 3 = Code, 7 = Storage, 13 = Plabel */
+      char dont_care2;         /* not used */
+      short dont_care3;                /* not used */
+    }
+  SomExportEntry;
+
+  /* We read 100 entries in at a time from the disk file. */
+#define SOM_READ_EXPORTS_NUM         100
+#define SOM_READ_EXPORTS_CHUNK_SIZE  (sizeof (SomExportEntry) * SOM_READ_EXPORTS_NUM)
   SomExportEntry buffer[SOM_READ_EXPORTS_NUM];
 
   /* Initialize in case we error out */
@@ -670,106 +676,107 @@ init_export_symbols (objfile)
   objfile->export_list_size = 0;
 
   /* It doesn't work, for some reason, to read in space $TEXT$;
-     the subspace $SHLIB_INFO$ has to be used.  Some BFD quirk? pai/1997-08-05 */ 
+     the subspace $SHLIB_INFO$ has to be used.  Some BFD quirk? pai/1997-08-05 */
   text_section = bfd_get_section_by_name (objfile->obfd, "$SHLIB_INFO$");
   if (!text_section)
     return 0;
-  /* Get the SOM executable header */ 
+  /* Get the SOM executable header */
   bfd_get_section_contents (objfile->obfd, text_section, dl_header, 0, 12 * sizeof (int));
 
   /* Check header version number for 10.x HP-UX */
   /* Currently we deal only with 10.x systems; on 9.x the version # is 89060912.
-     FIXME: Change for future HP-UX releases and mods to the SOM executable format */ 
+     FIXME: Change for future HP-UX releases and mods to the SOM executable format */
   if (dl_header[0] != 93092112)
     return 0;
-  
-  export_list = dl_header[8];      
-  export_list_size = dl_header[9]; 
+
+  export_list = dl_header[8];
+  export_list_size = dl_header[9];
   if (!export_list_size)
     return 0;
-  string_table = dl_header[10];     
+  string_table = dl_header[10];
   string_table_size = dl_header[11];
   if (!string_table_size)
     return 0;
 
-  /* Suck in SOM string table */ 
+  /* Suck in SOM string table */
   string_buffer = (char *) xmalloc (string_table_size);
   bfd_get_section_contents (objfile->obfd, text_section, string_buffer,
-                            string_table, string_table_size);
+                           string_table, string_table_size);
 
   /* Allocate export list in the psymbol obstack; this has nothing
      to do with psymbols, just a matter of convenience.  We want the
-     export list to be freed when the objfile is deallocated */ 
+     export list to be freed when the objfile is deallocated */
   objfile->export_list
-    = (ExportEntry *)  obstack_alloc (&objfile->psymbol_obstack,
-                                      export_list_size * sizeof (ExportEntry));
+    = (ExportEntry *) obstack_alloc (&objfile->psymbol_obstack,
+                                  export_list_size * sizeof (ExportEntry));
 
-  /* Read in the export entries, a bunch at a time */ 
-  for (j=0, k=0;
+  /* Read in the export entries, a bunch at a time */
+  for (j = 0, k = 0;
        j < (export_list_size / SOM_READ_EXPORTS_NUM);
        j++)
     {
       bfd_get_section_contents (objfile->obfd, text_section, buffer,
-                                export_list + j * SOM_READ_EXPORTS_CHUNK_SIZE,
-                                SOM_READ_EXPORTS_CHUNK_SIZE);
-      for (i=0; i < SOM_READ_EXPORTS_NUM; i++, k++)
-        {
-          if (buffer[i].type != (unsigned char) 0)
-            {
-              objfile->export_list[k].name
-                = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
-              strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
-              objfile->export_list[k].address = buffer[i].value;
-              /* Some day we might want to record the type and other information too */ 
-            }
-          else /* null type */ 
-            { 
-              objfile->export_list[k].name = NULL;
-              objfile->export_list[k].address = 0;
-            }
-        }
+                             export_list + j * SOM_READ_EXPORTS_CHUNK_SIZE,
+                               SOM_READ_EXPORTS_CHUNK_SIZE);
+      for (i = 0; i < SOM_READ_EXPORTS_NUM; i++, k++)
+       {
+         if (buffer[i].type != (unsigned char) 0)
+           {
+             objfile->export_list[k].name
+               = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+             strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
+             objfile->export_list[k].address = buffer[i].value;
+             /* Some day we might want to record the type and other information too */
+           }
+         else
+           /* null type */
+           {
+             objfile->export_list[k].name = NULL;
+             objfile->export_list[k].address = 0;
+           }
+       }
     }
 
-  /* Get the leftovers */ 
+  /* Get the leftovers */
   if (k < export_list_size)
     bfd_get_section_contents (objfile->obfd, text_section, buffer,
-                              export_list + k * sizeof (SomExportEntry),
-                              (export_list_size - k) * sizeof (SomExportEntry));
-  for (i=0; k < export_list_size; i++, k++)
+                             export_list + k * sizeof (SomExportEntry),
+                         (export_list_size - k) * sizeof (SomExportEntry));
+  for (i = 0; k < export_list_size; i++, k++)
     {
       if (buffer[i].type != (unsigned char) 0)
-        {
-          objfile->export_list[k].name
-            = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
-          strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
-          /* Some day we might want to record the type and other information too */ 
-          objfile->export_list[k].address = buffer[i].value;
-        }
+       {
+         objfile->export_list[k].name
+           = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+         strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
+         /* Some day we might want to record the type and other information too */
+         objfile->export_list[k].address = buffer[i].value;
+       }
       else
-        {
-          objfile->export_list[k].name = NULL;
-          objfile->export_list[k].address = 0;
-        }
+       {
+         objfile->export_list[k].name = NULL;
+         objfile->export_list[k].address = 0;
+       }
     }
 
   objfile->export_list_size = export_list_size;
   free (string_buffer);
   return export_list_size;
 }
+\f
 
 
-\f
 /* Register that we are able to handle SOM object file formats.  */
 
 static struct sym_fns som_sym_fns =
 {
   bfd_target_som_flavour,
-  som_new_init,                /* sym_new_init: init anything gbl to entire symtab */
-  som_symfile_init,    /* sym_init: read initial info, setup for sym_read() */
-  som_symfile_read,    /* sym_read: read a symbol file into symtab */
-  som_symfile_finish,  /* sym_finish: finished with file, cleanup */
-  som_symfile_offsets, /* sym_offsets:  Translate ext. to int. relocation */
-  NULL                 /* next: pointer to next struct sym_fns */
+  som_new_init,                        /* sym_new_init: init anything gbl to entire symtab */
+  som_symfile_init,            /* sym_init: read initial info, setup for sym_read() */
+  som_symfile_read,            /* sym_read: read a symbol file into symtab */
+  som_symfile_finish,          /* sym_finish: finished with file, cleanup */
+  som_symfile_offsets,         /* sym_offsets:  Translate ext. to int. relocation */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
index 870177cd33ece7ff4df8ce5e54bac79d4e783c1e..924fa5252c3e0969df90fb0654384be045e5bc64 100644 (file)
@@ -1,24 +1,25 @@
 /* Handle HP SOM shared libraries for GDB, the GNU Debugger.
    Copyright 1993, 1996, 1999 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
-Written by the Center for Software Science at the Univerity of Utah
-and by Cygnus Support.  */
+   Written by the Center for Software Science at the Univerity of Utah
+   and by Cygnus Support.  */
 
 
 #include "defs.h"
@@ -50,7 +51,7 @@ and by Cygnus Support.  */
 
 /* #define SOLIB_DEBUG
  */
+
 /* Defined in exec.c; used to prevent dangling pointer bug.
  */
 extern struct target_ops exec_ops;
@@ -62,7 +63,7 @@ extern struct unwind_table_entry *find_unwind_entry PARAMS ((CORE_ADDR pc));
    define the meaning of the various bits in the distinguished __dld_flags
    variable that is declared in every debuggable a.out on HP-UX, and that
    is shared between the debugger and the dynamic linker.
  */
+ */
 #define DLD_FLAGS_MAPPRIVATE    0x1
 #define DLD_FLAGS_HOOKVALID     0x2
 #define DLD_FLAGS_LISTVALID     0x4
@@ -80,76 +81,76 @@ extern struct unwind_table_entry *find_unwind_entry PARAMS ((CORE_ADDR pc));
    any HPUX include file.  */
 
 struct som_solib_mapped_entry
-{
-  /* The name of the library.  */
-  char *name;
+  {
+    /* The name of the library.  */
+    char *name;
 
-  /* Version of this structure (it is expected to change again in hpux10).  */
-  unsigned char struct_version;
+    /* Version of this structure (it is expected to change again in hpux10).  */
+    unsigned char struct_version;
 
-  /* Binding mode for this library.  */
-  unsigned char bind_mode;
+    /* Binding mode for this library.  */
+    unsigned char bind_mode;
 
-  /* Version of this library.  */
-  short library_version;
+    /* Version of this library.  */
+    short library_version;
 
-  /* Start of text address,
-   * link-time text location (length of text area),
-   * end of text address.  */
-  CORE_ADDR text_addr;
-  CORE_ADDR text_link_addr;
-  CORE_ADDR text_end;
+    /* Start of text address,
+     * link-time text location (length of text area),
+     * end of text address.  */
+    CORE_ADDR text_addr;
+    CORE_ADDR text_link_addr;
+    CORE_ADDR text_end;
 
-  /* Start of data, start of bss and end of data.  */
-  CORE_ADDR data_start;
-  CORE_ADDR bss_start;
-  CORE_ADDR data_end;
+    /* Start of data, start of bss and end of data.  */
+    CORE_ADDR data_start;
+    CORE_ADDR bss_start;
+    CORE_ADDR data_end;
 
-  /* Value of linkage pointer (%r19).  */
-  CORE_ADDR got_value;
+    /* Value of linkage pointer (%r19).  */
+    CORE_ADDR got_value;
 
-  /* Next entry.  */
-  struct som_solib_mapped_entry *next;
+    /* Next entry.  */
+    struct som_solib_mapped_entry *next;
 
-  /* There are other fields, but I don't have information as to what is
-     contained in them.  */
+    /* There are other fields, but I don't have information as to what is
+       contained in them.  */
 
-  /* For versions from HPUX-10.30 and up */
+    /* For versions from HPUX-10.30 and up */
 
-  /* Address in target of offset from thread-local register of
-   * start of this thread's data.  I.e., the first thread-local
-   * variable in this shared library starts at *(tsd_start_addr)
-   * from that area pointed to by cr27 (mpsfu_hi).
-   *
-   * We do the indirection as soon as we read it, so from then
-   * on it's the offset itself.
-   */
-  CORE_ADDR tsd_start_addr;
+    /* Address in target of offset from thread-local register of
+     * start of this thread's data.  I.e., the first thread-local
+     * variable in this shared library starts at *(tsd_start_addr)
+     * from that area pointed to by cr27 (mpsfu_hi).
+     *
+     * We do the indirection as soon as we read it, so from then
+     * on it's the offset itself.
+     */
+    CORE_ADDR tsd_start_addr;
 
-  /* Following this are longwords holding:
-   *
-   * ?, ?, ?, ptr to -1, ptr to-1, ptr to lib name (leaf name),
-   * ptr to __data_start, ptr to __data_end
-   */
+    /* Following this are longwords holding:
+
+     * ?, ?, ?, ptr to -1, ptr to-1, ptr to lib name (leaf name),
+     * ptr to __data_start, ptr to __data_end
+     */
 
-  
-};
+
+  };
 
 /* A structure to keep track of all the known shared objects.  */
 struct so_list
-{
-  struct som_solib_mapped_entry som_solib;
-  struct objfile *objfile;
-  bfd *abfd;
-  struct section_table *sections;
-  struct section_table *sections_end;
+  {
+    struct som_solib_mapped_entry som_solib;
+    struct objfile *objfile;
+    bfd *abfd;
+    struct section_table *sections;
+    struct section_table *sections_end;
 /* elz: added this field to store the address in target space (in the
    library) of the library descriptor (handle) which we read into
-   som_solib_mapped_entry structure*/
-  CORE_ADDR solib_addr;
-  struct so_list *next;
-  
-};
+   som_solib_mapped_entry structure */
+    CORE_ADDR solib_addr;
+    struct so_list *next;
+
+  };
 
 static struct so_list *so_list_head;
 
@@ -162,8 +163,8 @@ static struct so_list *so_list_head;
    (in megabytes).  If adding symbols for the new shlib would cause
    the total size to exceed the threshold, then the new shlib's symbols
    are not loaded.
  */
-static LONGEST  som_solib_total_st_size;
+ */
+static LONGEST som_solib_total_st_size;
 
 /* When the threshold is reached for any shlib, we refuse to add
    symbols for subsequent shlibs, even if those shlibs' symbols would
@@ -173,28 +174,32 @@ static LONGEST  som_solib_total_st_size;
    message.  The alternative, to issue a message for each shlib whose
    symbols aren't loaded, could be a big annoyance where the threshold
    is exceeded due to a very large number of shlibs.)
  */
-static int  som_solib_st_size_threshold_exceeded;
+ */
+static int som_solib_st_size_threshold_exceeded;
 
 /* These addresses should be filled in by som_solib_create_inferior_hook.
    They are also used elsewhere in this module.
-   */
-typedef struct {
-  CORE_ADDR  address;
-  struct unwind_table_entry *  unwind;
-} addr_and_unwind_t;
+ */
+typedef struct
+  {
+    CORE_ADDR address;
+    struct unwind_table_entry *unwind;
+  }
+addr_and_unwind_t;
 
 /* When adding fields, be sure to clear them in _initialize_som_solib. */
-static struct {
-  boolean  is_valid;
-  addr_and_unwind_t  hook;
-  addr_and_unwind_t  hook_stub;
-  addr_and_unwind_t  load;
-  addr_and_unwind_t  load_stub;
-  addr_and_unwind_t  unload;
-  addr_and_unwind_t  unload2;
-  addr_and_unwind_t  unload_stub;
-} dld_cache;
+static struct
+  {
+    boolean is_valid;
+    addr_and_unwind_t hook;
+    addr_and_unwind_t hook_stub;
+    addr_and_unwind_t load;
+    addr_and_unwind_t load_stub;
+    addr_and_unwind_t unload;
+    addr_and_unwind_t unload2;
+    addr_and_unwind_t unload_stub;
+  }
+dld_cache;
 
 
 
@@ -204,17 +209,17 @@ static void som_solib_sharedlibrary_command PARAMS ((char *, int));
 
 static LONGEST
 som_solib_sizeof_symbol_table (filename)
-  char *  filename;
+     char *filename;
 {
-  bfd *  abfd;
-  int  desc;
-  char *  absolute_name;
-  LONGEST  st_size = (LONGEST) 0;
-  asection *  sect;
+  bfd *abfd;
+  int desc;
+  char *absolute_name;
+  LONGEST st_size = (LONGEST) 0;
+  asection *sect;
 
   /* We believe that filename was handed to us by the dynamic linker, and
      is therefore always an absolute path.
-     */
+   */
   desc = openp (getenv ("PATH"), 1, filename, O_RDONLY | O_BINARY, 0, &absolute_name);
   if (desc < 0)
     {
@@ -223,17 +228,17 @@ som_solib_sizeof_symbol_table (filename)
   filename = absolute_name;
 
   abfd = bfd_fdopenr (filename, gnutarget, desc);
-  if (! abfd)
+  if (!abfd)
     {
       close (desc);
       make_cleanup (free, filename);
       error ("\"%s\": can't open to read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
     }
-  
-  if (!bfd_check_format (abfd, bfd_object))   /* Reads in section info */
+
+  if (!bfd_check_format (abfd, bfd_object))    /* Reads in section info */
     {
-      bfd_close (abfd);        /* This also closes desc */
+      bfd_close (abfd);                /* This also closes desc */
       make_cleanup (free, filename);
       error ("\"%s\": can't read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
@@ -251,7 +256,7 @@ som_solib_sizeof_symbol_table (filename)
   if (sect)
     st_size += (LONGEST) bfd_section_size (abfd, sect);
 
-  bfd_close (abfd);    /* This also closes desc */
+  bfd_close (abfd);            /* This also closes desc */
   free (filename);
 
   /* Unfortunately, just summing the sizes of various debug info
@@ -269,20 +274,20 @@ som_solib_sizeof_symbol_table (filename)
      factor to the debug info sections' size-sum.  No, this doesn't
      account for minimal symbols in non-debuggable shlibs.  But it
      all roughly washes out in the end.
-     */
+   */
   return st_size * (LONGEST) 10;
 }
 
 
 static void
 som_solib_add_solib_objfile (so, name, from_tty, text_addr)
-  struct so_list *  so;
-  char *  name;
-  int  from_tty;
-  CORE_ADDR  text_addr;
+     struct so_list *so;
+     char *name;
+     int from_tty;
+     CORE_ADDR text_addr;
 {
   obj_private_data_t *obj_private;
-  
+
   so->objfile = symbol_file_add (name, from_tty, text_addr, 0, 0, 0, 0, 1);
   so->abfd = so->objfile->obfd;
 
@@ -290,15 +295,15 @@ som_solib_add_solib_objfile (so, name, from_tty, text_addr)
    */
   so->objfile->flags |= OBJF_SHARED;
 
-  if( so->objfile->obj_private == NULL )
+  if (so->objfile->obj_private == NULL)
     {
       obj_private = (obj_private_data_t *)
-                        obstack_alloc( &so->objfile->psymbol_obstack,
-                                       sizeof( obj_private_data_t ));
+       obstack_alloc (&so->objfile->psymbol_obstack,
+                      sizeof (obj_private_data_t));
       obj_private->unwind_info = NULL;
-      obj_private->so_info     = NULL;
+      obj_private->so_info = NULL;
       so->objfile->obj_private = (PTR) obj_private;
-   }
+    }
 
   obj_private = (obj_private_data_t *) so->objfile->obj_private;
   obj_private->so_info = so;
@@ -306,26 +311,26 @@ som_solib_add_solib_objfile (so, name, from_tty, text_addr)
   if (!bfd_check_format (so->abfd, bfd_object))
     {
       error ("\"%s\": not in executable format: %s.",
-             name, bfd_errmsg (bfd_get_error ()));
+            name, bfd_errmsg (bfd_get_error ()));
     }
 }
 
 
 static void
 som_solib_load_symbols (so, name, from_tty, text_addr, target)
-  struct so_list *  so;
-  char *  name;
-  int  from_tty;
-  CORE_ADDR  text_addr;
-  struct target_ops *  target;
+     struct so_list *so;
+     char *name;
+     int from_tty;
+     CORE_ADDR text_addr;
+     struct target_ops *target;
 {
-  struct section_table *  p;
-  int  status;
-  char  buf[4];
-  CORE_ADDR  presumed_data_start;
+  struct section_table *p;
+  int status;
+  char buf[4];
+  CORE_ADDR presumed_data_start;
 
 #ifdef SOLIB_DEBUG
-  printf( "--Adding symbols for shared library \"%s\"\n", name );
+  printf ("--Adding symbols for shared library \"%s\"\n", name);
 #endif
 
   som_solib_add_solib_objfile (so, name, from_tty, text_addr);
@@ -334,8 +339,8 @@ som_solib_load_symbols (so, name, from_tty, text_addr, target)
      we might be debugging a core file from a dynamically linked
      executable in which the libraries were not privately mapped.  */
   if (build_section_table (so->abfd,
-                           &so->sections,
-                           &so->sections_end))
+                          &so->sections,
+                          &so->sections_end))
     {
       error ("Unable to build section table for shared library\n.");
       return;
@@ -345,15 +350,15 @@ som_solib_load_symbols (so, name, from_tty, text_addr, target)
   for (p = so->sections; p < so->sections_end; p++)
     {
       if (p->the_bfd_section->flags & SEC_CODE)
-        {
-          p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
-          p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
-        }
+       {
+         p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
+         p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT);
+       }
       else if (p->the_bfd_section->flags & SEC_DATA)
-        {
-          p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
-          p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
-        }
+       {
+         p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
+         p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA);
+       }
     }
 
   /* Now see if we need to map in the text and data for this shared
@@ -385,38 +390,38 @@ som_solib_load_symbols (so, name, from_tty, text_addr, target)
       new = so->sections_end - so->sections;
       /* Add sections from the shared library to the core target.  */
       if (target->to_sections)
-        {
-          old = target->to_sections_end - target->to_sections;
-          target->to_sections = (struct section_table *)
-            xrealloc ((char *)target->to_sections,
-                      ((sizeof (struct section_table)) * (old + new)));
-        }
+       {
+         old = target->to_sections_end - target->to_sections;
+         target->to_sections = (struct section_table *)
+           xrealloc ((char *) target->to_sections,
+                     ((sizeof (struct section_table)) * (old + new)));
+       }
       else
-        {
-          old = 0;
-          target->to_sections = (struct section_table *)
-            xmalloc ((sizeof (struct section_table)) * new);
-        }
+       {
+         old = 0;
+         target->to_sections = (struct section_table *)
+           xmalloc ((sizeof (struct section_table)) * new);
+       }
       target->to_sections_end = (target->to_sections + old + new);
 
       /* Update the to_sections field in the core_ops structure
          if needed, ditto exec_ops.  */
       if (update_coreops)
-        {
-          core_ops.to_sections = target->to_sections;
-          core_ops.to_sections_end = target->to_sections_end;
-        }
+       {
+         core_ops.to_sections = target->to_sections;
+         core_ops.to_sections_end = target->to_sections_end;
+       }
 
       if (update_execops)
-        {
-          exec_ops.to_sections = target->to_sections;
-          exec_ops.to_sections_end = target->to_sections_end;
-        }
+       {
+         exec_ops.to_sections = target->to_sections;
+         exec_ops.to_sections_end = target->to_sections_end;
+       }
 
       /* Copy over the old data before it gets clobbered.  */
-      memcpy ((char *)(target->to_sections + old),
-              so->sections,
-              ((sizeof (struct section_table)) * new));
+      memcpy ((char *) (target->to_sections + old),
+             so->sections,
+             ((sizeof (struct section_table)) * new));
     }
 }
 
@@ -438,7 +443,7 @@ som_solib_add (arg_string, from_tty, target)
   int status;
   unsigned int dld_flags;
   char buf[4], *re_err;
-  int  threshold_warning_given = 0;
+  int threshold_warning_given = 0;
 
   /* First validate our arguments.  */
   if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
@@ -487,11 +492,11 @@ som_solib_add (arg_string, from_tty, target)
 
   /* __dld_list may not be valid.  If not, then we punt, warning the user if
      we were called as a result of the add-symfile command.
-     */
+   */
   if ((dld_flags & DLD_FLAGS_LISTVALID) == 0)
     {
       if (from_tty)
-        error ("__dld_list is not valid according to __dld_flags.\n");
+       error ("__dld_list is not valid according to __dld_flags.\n");
       return;
     }
 
@@ -503,7 +508,7 @@ som_solib_add (arg_string, from_tty, target)
   if (!msymbol)
     {
       /* Older crt0.o files (hpux8) don't have __dld_list as a symbol,
-        but the data is still available if you know where to look.  */
+         but the data is still available if you know where to look.  */
       msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
       if (!msymbol)
        {
@@ -554,7 +559,7 @@ som_solib_add (arg_string, from_tty, target)
     so_list_tail = so_list_tail->next;
 
 #ifdef SOLIB_DEBUG
-  printf( "--About to read shared library list data\n" );
+  printf ("--About to read shared library list data\n");
 #endif
 
   /* "addr" will always point to the base of the
@@ -569,8 +574,8 @@ som_solib_add (arg_string, from_tty, target)
       struct so_list *new_so;
       struct so_list *so_list = so_list_head;
       struct stat statbuf;
-      LONGEST  st_size;
-      int  is_main_program;
+      LONGEST st_size;
+      int is_main_program;
 
       if (addr == 0)
        break;
@@ -606,7 +611,7 @@ som_solib_add (arg_string, from_tty, target)
        }
 
       /* See if the file exists.  If not, give a warning, but don't
-        die.  */
+         die.  */
       status = stat (name, &statbuf);
       if (status == -1)
        {
@@ -616,7 +621,7 @@ som_solib_add (arg_string, from_tty, target)
          if (status != 0)
            goto err;
 
-         addr = (CORE_ADDR) extract_unsigned_integer (buf, 4);          
+         addr = (CORE_ADDR) extract_unsigned_integer (buf, 4);
          continue;
        }
 
@@ -624,32 +629,32 @@ som_solib_add (arg_string, from_tty, target)
       is_main_program = (strcmp (name, symfile_objfile->name) == 0);
       if (so_list || is_main_program)
        {
-          /* This is the "next" pointer in the strcuture.
-           */
+         /* This is the "next" pointer in the strcuture.
+          */
          status = target_read_memory (addr + 36, buf, 4);
          if (status != 0)
            goto err;
 
          addr = (CORE_ADDR) extract_unsigned_integer (buf, 4);
 
-          /* Record the main program's symbol table size. */
-          if (is_main_program && !so_list)
-            {
-              st_size = som_solib_sizeof_symbol_table (name);
-              som_solib_total_st_size += st_size;
-            }
-
-          /* Was this a shlib that we noted but didn't load the symbols for?
-             If so, were we invoked this time from the command-line, via
-             a 'sharedlibrary' or 'add-symbol-file' command?  If yes to
-             both, we'd better load the symbols this time.
-             */
-          if (from_tty && so_list && !is_main_program && (so_list->objfile == NULL))
-            som_solib_load_symbols (so_list,
-                                    name,
-                                    from_tty,
-                                    so_list->som_solib.text_addr,
-                                    target);
+         /* Record the main program's symbol table size. */
+         if (is_main_program && !so_list)
+           {
+             st_size = som_solib_sizeof_symbol_table (name);
+             som_solib_total_st_size += st_size;
+           }
+
+         /* Was this a shlib that we noted but didn't load the symbols for?
+            If so, were we invoked this time from the command-line, via
+            a 'sharedlibrary' or 'add-symbol-file' command?  If yes to
+            both, we'd better load the symbols this time.
+          */
+         if (from_tty && so_list && !is_main_program && (so_list->objfile == NULL))
+           som_solib_load_symbols (so_list,
+                                   name,
+                                   from_tty,
+                                   so_list->som_solib.text_addr,
+                                   target);
 
          continue;
        }
@@ -664,7 +669,7 @@ som_solib_add (arg_string, from_tty, target)
       text_addr = extract_unsigned_integer (buf, 4);
 
       new_so = (struct so_list *) xmalloc (sizeof (struct so_list));
-      memset ((char *)new_so, 0, sizeof (struct so_list));
+      memset ((char *) new_so, 0, sizeof (struct so_list));
       if (so_list_head == NULL)
        {
          so_list_head = new_so;
@@ -678,7 +683,7 @@ som_solib_add (arg_string, from_tty, target)
 
       /* Fill in all the entries in GDB's shared library list.
        */
-       
+
       new_so->solib_addr = addr;
       new_so->som_solib.name = name;
       status = target_read_memory (addr + 4, buf, 4);
@@ -687,15 +692,15 @@ som_solib_add (arg_string, from_tty, target)
 
       new_so->som_solib.struct_version = extract_unsigned_integer (buf + 3, 1);
       new_so->som_solib.bind_mode = extract_unsigned_integer (buf + 2, 1);
-        /* Following is "high water mark", highest version number
-         * seen, rather than plain version number.
-         */
+      /* Following is "high water mark", highest version number
+       * seen, rather than plain version number.
+       */
       new_so->som_solib.library_version = extract_unsigned_integer (buf, 2);
       new_so->som_solib.text_addr = text_addr;
 
-        /* Q: What about longword at "addr + 8"?
-         * A: It's read above, out of order, into "text_addr".
-         */
+      /* Q: What about longword at "addr + 8"?
+       * A: It's read above, out of order, into "text_addr".
+       */
 
       status = target_read_memory (addr + 12, buf, 4);
       if (status != 0)
@@ -737,7 +742,7 @@ som_solib_add (arg_string, from_tty, target)
       if (status != 0)
        goto err;
 
-      new_so->som_solib.next = (void *)extract_unsigned_integer (buf, 4);
+      new_so->som_solib.next = (void *) extract_unsigned_integer (buf, 4);
 
       /* Note that we don't re-set "addr" to the next pointer
        * until after we've read the trailing data.
@@ -746,33 +751,33 @@ som_solib_add (arg_string, from_tty, target)
       status = target_read_memory (addr + 40, buf, 4);
       new_so->som_solib.tsd_start_addr = extract_unsigned_integer (buf, 4);
       if (status != 0)
-        goto err;
+       goto err;
 
       /* Now indirect via that value!
        */
       status = target_read_memory (new_so->som_solib.tsd_start_addr, buf, 4);
       new_so->som_solib.tsd_start_addr = extract_unsigned_integer (buf, 4);
       if (status != 0)
-        goto err;
+       goto err;
 #ifdef SOLIB_DEBUG
-      printf( "\n+ library \"%s\" is described at 0x%x\n", name, addr );
-      printf( "  'version' is %d\n",          new_so->som_solib.struct_version );
-      printf( "  'bind_mode' is %d\n",        new_so->som_solib.bind_mode );
-      printf( "  'library_version' is %d\n",  new_so->som_solib.library_version );
-      printf( "  'text_addr' is 0x%x\n",      new_so->som_solib.text_addr );
-      printf( "  'text_link_addr' is 0x%x\n", new_so->som_solib.text_link_addr );
-      printf( "  'text_end' is 0x%x\n",       new_so->som_solib.text_end );
-      printf( "  'data_start' is 0x%x\n",     new_so->som_solib.data_start );
-      printf( "  'bss_start' is 0x%x\n",      new_so->som_solib.bss_start );
-      printf( "  'data_end' is 0x%x\n",       new_so->som_solib.data_end );
-      printf( "  'got_value' is %x\n",        new_so->som_solib.got_value );
-      printf( "  'next' is 0x%x\n",           new_so->som_solib.next );
-      printf( "  'tsd_start_addr' is 0x%x\n", new_so->som_solib.tsd_start_addr );
+      printf ("\n+ library \"%s\" is described at 0x%x\n", name, addr);
+      printf ("  'version' is %d\n", new_so->som_solib.struct_version);
+      printf ("  'bind_mode' is %d\n", new_so->som_solib.bind_mode);
+      printf ("  'library_version' is %d\n", new_so->som_solib.library_version);
+      printf ("  'text_addr' is 0x%x\n", new_so->som_solib.text_addr);
+      printf ("  'text_link_addr' is 0x%x\n", new_so->som_solib.text_link_addr);
+      printf ("  'text_end' is 0x%x\n", new_so->som_solib.text_end);
+      printf ("  'data_start' is 0x%x\n", new_so->som_solib.data_start);
+      printf ("  'bss_start' is 0x%x\n", new_so->som_solib.bss_start);
+      printf ("  'data_end' is 0x%x\n", new_so->som_solib.data_end);
+      printf ("  'got_value' is %x\n", new_so->som_solib.got_value);
+      printf ("  'next' is 0x%x\n", new_so->som_solib.next);
+      printf ("  'tsd_start_addr' is 0x%x\n", new_so->som_solib.tsd_start_addr);
 #endif
 
       /* Go on to the next shared library descriptor.
        */
-      addr = (CORE_ADDR)new_so->som_solib.next;
+      addr = (CORE_ADDR) new_so->som_solib.next;
 
 
 
@@ -790,32 +795,32 @@ som_solib_add (arg_string, from_tty, target)
          actually load its symbols.  (This is more useful than it might
          sound, for it allows us to e.g., still load and use the shlibs'
          unwind information for stack tracebacks.)
-         */
+       */
 
       /* Note that we DON'T want to preclude the user from using the
          add-symbol-file command!  Thus, we only worry about the threshold
          when we're invoked for other reasons.
-         */
+       */
       st_size = som_solib_sizeof_symbol_table (name);
       som_solib_st_size_threshold_exceeded =
-        !from_tty &&
-        ((st_size + som_solib_total_st_size) > (auto_solib_add * (LONGEST)1000000));
+       !from_tty &&
+       ((st_size + som_solib_total_st_size) > (auto_solib_add * (LONGEST) 1000000));
 
       if (som_solib_st_size_threshold_exceeded)
-        {
-          if (! threshold_warning_given)
-            warning ("Symbols for some libraries have not been loaded, because\ndoing so would exceed the size threshold specified by auto-solib-add.\nTo manually load symbols, use the 'sharedlibrary' command.\nTo raise the threshold, set auto-solib-add to a larger value and rerun\nthe program.\n");
-          threshold_warning_given = 1;
-
-          /* We'll still make note of this shlib, even if we don't
-             read its symbols.  This allows us to use its unwind
-             information well enough to know how to e.g., correctly
-             do a traceback from a PC within the shlib, even if we
-             can't symbolize those PCs...
-             */
-          som_solib_add_solib_objfile (new_so, name, from_tty, text_addr);
-          continue;
-        }
+       {
+         if (!threshold_warning_given)
+           warning ("Symbols for some libraries have not been loaded, because\ndoing so would exceed the size threshold specified by auto-solib-add.\nTo manually load symbols, use the 'sharedlibrary' command.\nTo raise the threshold, set auto-solib-add to a larger value and rerun\nthe program.\n");
+         threshold_warning_given = 1;
+
+         /* We'll still make note of this shlib, even if we don't
+            read its symbols.  This allows us to use its unwind
+            information well enough to know how to e.g., correctly
+            do a traceback from a PC within the shlib, even if we
+            can't symbolize those PCs...
+          */
+         som_solib_add_solib_objfile (new_so, name, from_tty, text_addr);
+         continue;
+       }
 
       som_solib_total_st_size += st_size;
 
@@ -824,7 +829,7 @@ som_solib_add (arg_string, from_tty, target)
     }
 
 #ifdef SOLIB_DEBUG
-    printf( "--Done reading shared library data\n" );
+  printf ("--Done reading shared library data\n");
 #endif
 
   /* Getting new symbols may change our opinion about what is
@@ -856,14 +861,14 @@ err:
    bit 0 when set indicates that private copies of the libraries are needed
    bit 1 when set indicates that the callback hook routine is valid
    bit 2 when set indicates that the dynamic linker should maintain the
-         __dld_list structure when loading/unloading libraries.
+   __dld_list structure when loading/unloading libraries.
 
    Note that shared libraries are not mapped in at this time, so we have
    run the inferior until the libraries are mapped in.  Typically this
    means running until the "_start" is called.  */
 
 void
-som_solib_create_inferior_hook()
+som_solib_create_inferior_hook ()
 {
   struct minimal_symbol *msymbol;
   unsigned int dld_flags, status, have_endo;
@@ -877,7 +882,7 @@ som_solib_create_inferior_hook()
   remove_solib_event_breakpoints ();
 
   if (symfile_objfile == NULL)
-    return; 
+    return;
 
   /* First see if the objfile was dynamically linked.  */
   shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$");
@@ -918,10 +923,10 @@ som_solib_create_inferior_hook()
      the dld provides an export stub named "__d_trap" as well as the
      function named "__d_trap" itself, but doesn't provide "_DLD_HOOK".
      We'll look first for the old flavor and then the new.
-     */
+   */
   msymbol = lookup_minimal_symbol ("_DLD_HOOK", NULL, symfile_objfile);
   if (msymbol == NULL)
-      msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
+    msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
   if (msymbol == NULL)
     {
       warning ("Unable to find _DLD_HOOK symbol in object file.");
@@ -935,31 +940,31 @@ som_solib_create_inferior_hook()
   /* Grrr, this might not be an export symbol!  We have to find the
      export stub.  */
   ALL_OBJFILES (objfile)
-    {
-      struct unwind_table_entry *u;
-      struct minimal_symbol *msymbol2;
-
-      /* What a crock.  */
-      msymbol2 = lookup_minimal_symbol_solib_trampoline (SYMBOL_NAME (msymbol),
-                                                        NULL, objfile);
-      /* Found a symbol with the right name.  */
-      if (msymbol2)
-       {
-         struct unwind_table_entry *u;
-         /* It must be a shared library trampoline.  */
-         if (SYMBOL_TYPE (msymbol2) != mst_solib_trampoline)
-           continue;
-
-         /* It must also be an export stub.  */
-         u = find_unwind_entry (SYMBOL_VALUE (msymbol2));
-         if (!u || u->stub_unwind.stub_type != EXPORT)
-           continue;
-
-         /* OK.  Looks like the correct import stub.  */
-         anaddr = SYMBOL_VALUE (msymbol2);
-          dld_cache.hook_stub.address = anaddr;
-       }
-    }
+  {
+    struct unwind_table_entry *u;
+    struct minimal_symbol *msymbol2;
+
+    /* What a crock.  */
+    msymbol2 = lookup_minimal_symbol_solib_trampoline (SYMBOL_NAME (msymbol),
+                                                      NULL, objfile);
+    /* Found a symbol with the right name.  */
+    if (msymbol2)
+      {
+       struct unwind_table_entry *u;
+       /* It must be a shared library trampoline.  */
+       if (SYMBOL_TYPE (msymbol2) != mst_solib_trampoline)
+         continue;
+
+       /* It must also be an export stub.  */
+       u = find_unwind_entry (SYMBOL_VALUE (msymbol2));
+       if (!u || u->stub_unwind.stub_type != EXPORT)
+         continue;
+
+       /* OK.  Looks like the correct import stub.  */
+       anaddr = SYMBOL_VALUE (msymbol2);
+       dld_cache.hook_stub.address = anaddr;
+      }
+  }
   store_unsigned_integer (buf, 4, anaddr);
 
   msymbol = lookup_minimal_symbol ("__dld_hook", NULL, symfile_objfile);
@@ -972,7 +977,7 @@ som_solib_create_inferior_hook()
     }
   anaddr = SYMBOL_VALUE_ADDRESS (msymbol);
   status = target_write_memory (anaddr, buf, 4);
-  
+
   /* Now set a shlib_event breakpoint at __d_trap so we can track
      significant shared library events.  */
   msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
@@ -1023,12 +1028,12 @@ keep_going:
   /* Now find the address of _start and set a breakpoint there. 
      We still need this code for two reasons:
 
-       * Not all sites have /opt/langtools/lib/end.o, so it's not always
-       possible to track the dynamic linker's events.
+     * Not all sites have /opt/langtools/lib/end.o, so it's not always
+     possible to track the dynamic linker's events.
+
+     * At this time no events are triggered for shared libraries
+     loaded at startup time (what a crock).  */
 
-       * At this time no events are triggered for shared libraries
-       loaded at startup time (what a crock).  */
-       
   msymbol = lookup_minimal_symbol ("_start", NULL, symfile_objfile);
   if (msymbol == NULL)
     {
@@ -1056,7 +1061,7 @@ keep_going:
 
 static void
 reset_inferior_pid (saved_inferior_pid)
-  int  saved_inferior_pid;
+     int saved_inferior_pid;
 {
   inferior_pid = saved_inferior_pid;
 }
@@ -1071,18 +1076,18 @@ reset_inferior_pid (saved_inferior_pid)
 
    This operation does not remove any knowledge of shared libraries which
    GDB may already have been notified of.
  */
+ */
 void
 som_solib_remove_inferior_hook (pid)
-  int  pid;
+     int pid;
 {
-  CORE_ADDR  addr;
-  struct minimal_symbol *  msymbol;
-  int  status;
-  char  dld_flags_buffer [TARGET_INT_BIT/TARGET_CHAR_BIT];
-  unsigned int  dld_flags_value;
-  int  saved_inferior_pid = inferior_pid;
-  struct cleanup *  old_cleanups = make_cleanup (reset_inferior_pid, saved_inferior_pid);
+  CORE_ADDR addr;
+  struct minimal_symbol *msymbol;
+  int status;
+  char dld_flags_buffer[TARGET_INT_BIT / TARGET_CHAR_BIT];
+  unsigned int dld_flags_value;
+  int saved_inferior_pid = inferior_pid;
+  struct cleanup *old_cleanups = make_cleanup (reset_inferior_pid, saved_inferior_pid);
 
   /* Ensure that we're really operating on the specified process. */
   inferior_pid = pid;
@@ -1093,20 +1098,20 @@ som_solib_remove_inferior_hook (pid)
      and thus we're not supposed to remove it.
 
      Rather, we'll merely clear the dld_flags bit that enables callbacks.
-     */
+   */
   msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
 
   addr = SYMBOL_VALUE_ADDRESS (msymbol);
-  status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT/TARGET_CHAR_BIT);
+  status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
 
   dld_flags_value = extract_unsigned_integer (dld_flags_buffer,
-                                              sizeof (dld_flags_value));
+                                             sizeof (dld_flags_value));
 
   dld_flags_value &= ~DLD_FLAGS_HOOKVALID;
   store_unsigned_integer (dld_flags_buffer,
-                          sizeof (dld_flags_value),
-                          dld_flags_value);
-  status = target_write_memory (addr, dld_flags_buffer, TARGET_INT_BIT/TARGET_CHAR_BIT);
+                         sizeof (dld_flags_value),
+                         dld_flags_value);
+  status = target_write_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
 
   do_cleanups (old_cleanups);
 }
@@ -1122,13 +1127,13 @@ som_solib_remove_inferior_hook (pid)
 
    Undefined behaviour is guaranteed if this function is called before
    som_solib_create_inferior_hook.
  */
+ */
 void
 som_solib_create_catch_load_hook (pid, tempflag, filename, cond_string)
-  int  pid;
-  int  tempflag;
-  char *  filename;
-  char *  cond_string;
+     int pid;
+     int tempflag;
+     char *filename;
+     char *cond_string;
 {
   create_solib_load_event_breakpoint ("__d_trap", tempflag, filename, cond_string);
 }
@@ -1143,22 +1148,22 @@ som_solib_create_catch_load_hook (pid, tempflag, filename, cond_string)
 
    Undefined behaviour is guaranteed if this function is called before
    som_solib_create_inferior_hook.
  */
+ */
 void
 som_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string)
-  int  pid;
-  int  tempflag;
-  char *  filename;
-  char *  cond_string;
+     int pid;
+     int tempflag;
+     char *filename;
+     char *cond_string;
 {
   create_solib_unload_event_breakpoint ("__d_trap", tempflag, filename, cond_string);
 }
 
 int
 som_solib_have_load_event (pid)
-  int  pid;
+     int pid;
 {
-  CORE_ADDR  event_kind;
+  CORE_ADDR event_kind;
 
   event_kind = read_register (ARG0_REGNUM);
   return (event_kind == SHL_LOAD);
@@ -1166,9 +1171,9 @@ som_solib_have_load_event (pid)
 
 int
 som_solib_have_unload_event (pid)
-  int  pid;
+     int pid;
 {
-  CORE_ADDR  event_kind;
+  CORE_ADDR event_kind;
 
   event_kind = read_register (ARG0_REGNUM);
   return (event_kind == SHL_UNLOAD);
@@ -1176,13 +1181,13 @@ som_solib_have_unload_event (pid)
 
 static char *
 som_solib_library_pathname (pid)
-  int  pid;
+     int pid;
 {
-  CORE_ADDR  dll_handle_address;
-  CORE_ADDR  dll_pathname_address;
-  struct som_solib_mapped_entry  dll_descriptor;
-  char *  p;
-  static char  dll_pathname [1024];
+  CORE_ADDR dll_handle_address;
+  CORE_ADDR dll_pathname_address;
+  struct som_solib_mapped_entry dll_descriptor;
+  char *p;
+  static char dll_pathname[1024];
 
   /* Read the descriptor of this newly-loaded library. */
   dll_handle_address = read_register (ARG1_REGNUM);
@@ -1190,16 +1195,16 @@ som_solib_library_pathname (pid)
 
   /* We can find a pointer to the dll's pathname within the descriptor. */
   dll_pathname_address = (CORE_ADDR) dll_descriptor.name;
-  
+
   /* Read the pathname, one byte at a time. */
   p = dll_pathname;
   for (;;)
     {
-      char  b;
+      char b;
       read_memory (dll_pathname_address++, (char *) &b, 1);
       *p++ = b;
       if (b == '\0')
-        break;
+       break;
     }
 
   return dll_pathname;
@@ -1207,9 +1212,9 @@ som_solib_library_pathname (pid)
 
 char *
 som_solib_loaded_library_pathname (pid)
-  int  pid;
+     int pid;
 {
-  if (! som_solib_have_load_event (pid))
+  if (!som_solib_have_load_event (pid))
     error ("Must have a load event to use this query");
 
   return som_solib_library_pathname (pid);
@@ -1217,9 +1222,9 @@ som_solib_loaded_library_pathname (pid)
 
 char *
 som_solib_unloaded_library_pathname (pid)
-  int  pid;
+     int pid;
 {
-  if (! som_solib_have_unload_event (pid))
+  if (!som_solib_have_unload_event (pid))
     error ("Must have an unload event to use this query");
 
   return som_solib_library_pathname (pid);
@@ -1230,105 +1235,105 @@ som_solib_desire_dynamic_linker_symbols ()
 {
   struct objfile *objfile;
   struct unwind_table_entry *u;
-  struct minimal_symbol *  dld_msymbol;
+  struct minimal_symbol *dld_msymbol;
 
   /* Do we already know the value of these symbols?  If so, then
      we've no work to do.
 
      (If you add clauses to this test, be sure to likewise update the
      test within the loop.)
-     */
+   */
   if (dld_cache.is_valid)
     return;
 
   ALL_OBJFILES (objfile)
-    {
-      dld_msymbol = lookup_minimal_symbol ("shl_load", NULL, objfile);
-      if (dld_msymbol != NULL)
-        {
-          dld_cache.load.address = SYMBOL_VALUE (dld_msymbol);
-          dld_cache.load.unwind = find_unwind_entry (dld_cache.load.address);
-        }
-
-      dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_load",
-                                                            NULL,
-                                                            objfile);
-      if (dld_msymbol != NULL)
-        {
-          if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
-            {
-              u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
-              if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
-                {
-                  dld_cache.load_stub.address = SYMBOL_VALUE (dld_msymbol);
-                  dld_cache.load_stub.unwind = u;
-                }
-            }
-        }
-
-      dld_msymbol = lookup_minimal_symbol ("shl_unload", NULL, objfile);
-      if (dld_msymbol != NULL)
-        {
-          dld_cache.unload.address = SYMBOL_VALUE (dld_msymbol);
-          dld_cache.unload.unwind = find_unwind_entry (dld_cache.unload.address);
-
-          /* ??rehrauer: I'm not sure exactly what this is, but it appears
-             that on some HPUX 10.x versions, there's two unwind regions to
-             cover the body of "shl_unload", the second being 4 bytes past
-             the end of the first.  This is a large hack to handle that
-             case, but since I don't seem to have any legitimate way to
-             look for this thing via the symbol table...
-             */
-          if (dld_cache.unload.unwind != NULL)
-            {
-              u = find_unwind_entry (dld_cache.unload.unwind->region_end + 4);
-              if (u != NULL)
-                {
-                  dld_cache.unload2.address = u->region_start;
-                  dld_cache.unload2.unwind = u;
-                }
-            }
-        }
-
-      dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_unload",
-                                                            NULL,
-                                                            objfile);
-      if (dld_msymbol != NULL)
-        {
-          if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
-            {
-              u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
-              if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
-                {
-                  dld_cache.unload_stub.address = SYMBOL_VALUE (dld_msymbol);
-                  dld_cache.unload_stub.unwind = u;
-                }
-            }
-        }
-
-      /* Did we find everything we were looking for?  If so, stop. */
-      if ((dld_cache.load.address != NULL) && (dld_cache.load_stub.address != NULL)
-          && (dld_cache.unload.address != NULL) && (dld_cache.unload_stub.address != NULL))
-        {
-          dld_cache.is_valid = 1;
-          break;
-        }
-    }
+  {
+    dld_msymbol = lookup_minimal_symbol ("shl_load", NULL, objfile);
+    if (dld_msymbol != NULL)
+      {
+       dld_cache.load.address = SYMBOL_VALUE (dld_msymbol);
+       dld_cache.load.unwind = find_unwind_entry (dld_cache.load.address);
+      }
+
+    dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_load",
+                                                         NULL,
+                                                         objfile);
+    if (dld_msymbol != NULL)
+      {
+       if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+         {
+           u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
+           if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
+             {
+               dld_cache.load_stub.address = SYMBOL_VALUE (dld_msymbol);
+               dld_cache.load_stub.unwind = u;
+             }
+         }
+      }
+
+    dld_msymbol = lookup_minimal_symbol ("shl_unload", NULL, objfile);
+    if (dld_msymbol != NULL)
+      {
+       dld_cache.unload.address = SYMBOL_VALUE (dld_msymbol);
+       dld_cache.unload.unwind = find_unwind_entry (dld_cache.unload.address);
+
+       /* ??rehrauer: I'm not sure exactly what this is, but it appears
+          that on some HPUX 10.x versions, there's two unwind regions to
+          cover the body of "shl_unload", the second being 4 bytes past
+          the end of the first.  This is a large hack to handle that
+          case, but since I don't seem to have any legitimate way to
+          look for this thing via the symbol table...
+        */
+       if (dld_cache.unload.unwind != NULL)
+         {
+           u = find_unwind_entry (dld_cache.unload.unwind->region_end + 4);
+           if (u != NULL)
+             {
+               dld_cache.unload2.address = u->region_start;
+               dld_cache.unload2.unwind = u;
+             }
+         }
+      }
+
+    dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_unload",
+                                                         NULL,
+                                                         objfile);
+    if (dld_msymbol != NULL)
+      {
+       if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+         {
+           u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
+           if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
+             {
+               dld_cache.unload_stub.address = SYMBOL_VALUE (dld_msymbol);
+               dld_cache.unload_stub.unwind = u;
+             }
+         }
+      }
+
+    /* Did we find everything we were looking for?  If so, stop. */
+    if ((dld_cache.load.address != NULL) && (dld_cache.load_stub.address != NULL)
+       && (dld_cache.unload.address != NULL) && (dld_cache.unload_stub.address != NULL))
+      {
+       dld_cache.is_valid = 1;
+       break;
+      }
+  }
 
   dld_cache.hook.unwind = find_unwind_entry (dld_cache.hook.address);
   dld_cache.hook_stub.unwind = find_unwind_entry (dld_cache.hook_stub.address);
 
   /* We're prepared not to find some of these symbols, which is why
      this function is a "desire" operation, and not a "require".
-     */
+   */
 }
 
 int
 som_solib_in_dynamic_linker (pid, pc)
-  int  pid;
-  CORE_ADDR  pc;
+     int pid;
+     CORE_ADDR pc;
 {
-  struct unwind_table_entry *  u_pc;
+  struct unwind_table_entry *u_pc;
 
   /* Are we in the dld itself?
 
@@ -1339,13 +1344,13 @@ som_solib_in_dynamic_linker (pid, pc)
      that case the debugger probably isn't able to set the fundamental
      breakpoint in the dld callback anyways, so this hack should be
      safe.
-     */
+   */
   if ((pc & (CORE_ADDR) 0xc0000000) == (CORE_ADDR) 0xc0000000)
     return 1;
 
   /* Cache the address of some symbols that are part of the dynamic
      linker, if not already known.
-     */
+   */
   som_solib_desire_dynamic_linker_symbols ();
 
   /* Are we in the dld callback?  Or its export stub? */
@@ -1396,7 +1401,7 @@ som_solib_get_got_by_pc (addr)
    Return the address of the handle of the shared library
    in which ADDR belongs.  If
    ADDR isn't in any known shared library, return zero.  */
-/* this function is used in hppa_fix_call_dummy in hppa-tdep.c*/
+/* this function is used in hppa_fix_call_dummy in hppa-tdep.c */
 
 CORE_ADDR
 som_solib_get_solib_by_pc (addr)
@@ -1408,15 +1413,15 @@ som_solib_get_solib_by_pc (addr)
     {
       if (so_list->som_solib.text_addr <= addr
          && so_list->som_solib.text_end > addr)
-        {
+       {
          break;
-        }
+       }
       so_list = so_list->next;
     }
   if (so_list)
-   return so_list->solib_addr;
+    return so_list->solib_addr;
   else
-   return 0;
+    return 0;
 }
 
 
@@ -1430,7 +1435,7 @@ som_solib_section_offsets (objfile, offsets)
   while (so_list)
     {
       /* Oh what a pain!  We need the offsets before so_list->objfile
-        is valid.  The BFDs will never match.  Make a best guess.  */
+         is valid.  The BFDs will never match.  Make a best guess.  */
       if (strstr (objfile->name, so_list->som_solib.name))
        {
          asection *private_section;
@@ -1487,7 +1492,7 @@ som_sharedlibrary_info_command (ignore, from_tty)
 
   printf_unfiltered ("Shared Object Libraries\n");
   printf_unfiltered ("    %-12s%-12s%-12s%-12s%-12s%-12s\n",
-                    "  flags", "  tstart", "   tend", "  dstart", "   dend", "   dlt");
+        "  flags", "  tstart", "   tend", "  dstart", "   dend", "   dlt");
   while (so_list)
     {
       unsigned int flags;
@@ -1497,19 +1502,19 @@ som_sharedlibrary_info_command (ignore, from_tty)
       flags |= so_list->som_solib.library_version;
       printf_unfiltered ("%s", so_list->som_solib.name);
       if (so_list->objfile == NULL)
-        printf_unfiltered ("  (symbols not loaded)");
+       printf_unfiltered ("  (symbols not loaded)");
       printf_unfiltered ("\n");
       printf_unfiltered ("    %-12s", local_hex_string_custom (flags, "08l"));
       printf_unfiltered ("%-12s",
-             local_hex_string_custom (so_list->som_solib.text_addr, "08l"));
+            local_hex_string_custom (so_list->som_solib.text_addr, "08l"));
       printf_unfiltered ("%-12s",
              local_hex_string_custom (so_list->som_solib.text_end, "08l"));
       printf_unfiltered ("%-12s",
-             local_hex_string_custom (so_list->som_solib.data_start, "08l"));
+           local_hex_string_custom (so_list->som_solib.data_start, "08l"));
       printf_unfiltered ("%-12s",
              local_hex_string_custom (so_list->som_solib.data_end, "08l"));
       printf_unfiltered ("%-12s\n",
-             local_hex_string_custom (so_list->som_solib.got_value, "08l"));
+            local_hex_string_custom (so_list->som_solib.got_value, "08l"));
       so_list = so_list->next;
     }
 }
@@ -1527,17 +1532,17 @@ som_solib_sharedlibrary_command (args, from_tty)
 
 char *
 som_solib_address (addr)
-  CORE_ADDR  addr;
+     CORE_ADDR addr;
 {
-  struct so_list *  so = so_list_head;
+  struct so_list *so = so_list_head;
 
   while (so)
     {
       /* Is this address within this shlib's text range?  If so,
          return the shlib's name.
-         */
+       */
       if ((addr >= so->som_solib.text_addr) && (addr <= so->som_solib.text_end))
-        return so->som_solib.name;
+       return so->som_solib.name;
 
       /* Nope, keep looking... */
       so = so->next;
@@ -1551,18 +1556,18 @@ som_solib_address (addr)
 void
 som_solib_restart ()
 {
-  struct so_list *  sl = so_list_head;
+  struct so_list *sl = so_list_head;
 
   /* Before the shlib info vanishes, use it to disable any breakpoints
      that may still be active in those shlibs.
-     */
+   */
   disable_breakpoints_in_shlibs (0);
 
   /* Discard all the shlib descriptors.
-     */
+   */
   while (sl)
     {
-      struct so_list *  next_sl = sl->next;
+      struct so_list *next_sl = sl->next;
       free (sl);
       sl = next_sl;
     }
@@ -1601,7 +1606,7 @@ void
 _initialize_som_solib ()
 {
   add_com ("sharedlibrary", class_files, som_solib_sharedlibrary_command,
-           "Load shared object library symbols for files matching REGEXP.");
+          "Load shared object library symbols for files matching REGEXP.");
   add_info ("sharedlibrary", som_sharedlibrary_info_command,
            "Status of loaded shared object libraries.");
   add_show_from_set
@@ -1624,8 +1629,8 @@ Otherwise, symbols must be loaded manually, using `sharedlibrary'.",
      is only crudely approximated rather than actually measured, and [2]
      50 Mbytes is too small for debugging gdb itself.  Thus, the arbitrary
      100 figure.
-     */
-  auto_solib_add = 100; /* Megabytes */
+   */
+  auto_solib_add = 100;                /* Megabytes */
 
   som_solib_restart ();
 }
@@ -1633,8 +1638,8 @@ Otherwise, symbols must be loaded manually, using `sharedlibrary'.",
 /* Get some HPUX-specific data from a shared lib.
  */
 CORE_ADDR
-so_lib_thread_start_addr( so )
-    struct so_list *so;
+so_lib_thread_start_addr (so)
+     struct so_list *so;
 {
-    return so->som_solib.tsd_start_addr;
+  return so->som_solib.tsd_start_addr;
 }
index b96916921f16455f798d27f77e453b0f840f9070..0784b86d4faddc6fa56c9cf4cf003b655b9d7571 100644 (file)
@@ -1,26 +1,27 @@
 /* HP SOM Shared library declarations for GDB, the GNU Debugger.
    Copyright (C) 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
 
-Written by the Center for Software Science at the Univerity of Utah
-and by Cygnus Support.  */
+   Written by the Center for Software Science at the Univerity of Utah
+   and by Cygnus Support.  */
 
-#ifdef __STDC__                /* Forward decl's for prototypes */
+#ifdef __STDC__                        /* Forward decl's for prototypes */
 struct target_ops;
 struct objfile;
 struct section_offsets;
@@ -35,7 +36,7 @@ extern void
 som_solib_add PARAMS ((char *, int, struct target_ops *));
 
 extern CORE_ADDR
-som_solib_get_got_by_pc PARAMS ((CORE_ADDR));
+  som_solib_get_got_by_pc PARAMS ((CORE_ADDR));
 
 extern int
 som_solib_section_offsets PARAMS ((struct objfile *, struct section_offsets *));
@@ -48,49 +49,49 @@ som_solib_section_offsets PARAMS ((struct objfile *, struct section_offsets *));
 #define SOLIB_CREATE_INFERIOR_HOOK(PID)        som_solib_create_inferior_hook()
 
 extern void
-som_solib_create_inferior_hook PARAMS((void));
+som_solib_create_inferior_hook PARAMS ((void));
 
 /* Function to be called to remove the connection between debugger and
    dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
    (This operation does not remove shared library information from
    the debugger, as CLEAR_SOLIB does.)
  */
+ */
 #define SOLIB_REMOVE_INFERIOR_HOOK(PID) som_solib_remove_inferior_hook(PID)
 
 extern void
-som_solib_remove_inferior_hook PARAMS((int));
+som_solib_remove_inferior_hook PARAMS ((int));
 
 /* This function is called by the "catch load" command.  It allows
    the debugger to be notified by the dynamic linker when a specified
    library file (or any library file, if filename is NULL) is loaded.
  */
+ */
 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \
    som_solib_create_catch_load_hook (pid, tempflag, filename, cond_string)
 
 extern void
-som_solib_create_catch_load_hook PARAMS((int, int, char *, char *));
+som_solib_create_catch_load_hook PARAMS ((int, int, char *, char *));
 
 /* This function is called by the "catch unload" command.  It allows
    the debugger to be notified by the dynamic linker when a specified
    library file (or any library file, if filename is NULL) is unloaded.
  */
+ */
 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \
    som_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string)
 
 extern void
-som_solib_create_catch_unload_hook PARAMS((int, int, char *, char *));
+som_solib_create_catch_unload_hook PARAMS ((int, int, char *, char *));
 
 /* This function returns TRUE if the dynamic linker has just reported
    a load of a library.
 
    This function must be used only when the inferior has stopped in
    the dynamic linker hook, or undefined results are guaranteed.
  */
+ */
 #define SOLIB_HAVE_LOAD_EVENT(pid) \
    som_solib_have_load_event (pid)
 
 extern int
-som_solib_have_load_event PARAMS((int));
+som_solib_have_load_event PARAMS ((int));
 
 /* This function returns a pointer to the string representation of the
    pathname of the dynamically-linked library that has just been loaded.
@@ -102,24 +103,24 @@ som_solib_have_load_event PARAMS((int));
    has stopped in the dynamic linker hook, and becomes invalid as soon
    as the inferior is continued.  Clients should make a copy of this
    string if they wish to continue the inferior and then access the string.
  */
+ */
 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
    som_solib_loaded_library_pathname (pid)
 
 extern char *
-som_solib_loaded_library_pathname PARAMS((int));
+  som_solib_loaded_library_pathname PARAMS ((int));
 
 /* This function returns TRUE if the dynamic linker has just reported
    an unload of a library.
 
    This function must be used only when the inferior has stopped in
    the dynamic linker hook, or undefined results are guaranteed.
  */
+ */
 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
    som_solib_have_unload_event (pid)
 
 extern int
-som_solib_have_unload_event PARAMS((int));
+som_solib_have_unload_event PARAMS ((int));
 
 /* This function returns a pointer to the string representation of the
    pathname of the dynamically-linked library that has just been unloaded.
@@ -131,12 +132,12 @@ som_solib_have_unload_event PARAMS((int));
    has stopped in the dynamic linker hook, and becomes invalid as soon
    as the inferior is continued.  Clients should make a copy of this
    string if they wish to continue the inferior and then access the string.
  */
+ */
 #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
    som_solib_unloaded_library_pathname (pid)
 
 extern char *
-som_solib_unloaded_library_pathname PARAMS((int));
+  som_solib_unloaded_library_pathname PARAMS ((int));
 
 /* 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
@@ -145,24 +146,24 @@ som_solib_unloaded_library_pathname PARAMS((int));
    This function must be used only when a dynamic linker event has been
    caught, and the inferior is being stepped out of the hook, or undefined
    results are guaranteed.
  */
+ */
 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
    som_solib_in_dynamic_linker (pid, pc)
 
 extern int
-som_solib_in_dynamic_linker PARAMS((int, CORE_ADDR));
+som_solib_in_dynamic_linker PARAMS ((int, CORE_ADDR));
 
 /* This function must be called when the inferior is killed, and the program
    restarted.  This is not the same as CLEAR_SOLIB, in that it doesn't discard
    any symbol tables.
 
    Presently, this functionality is not implemented.
  */
+ */
 #define SOLIB_RESTART() \
    som_solib_restart ()
 
 extern void
-som_solib_restart PARAMS((void));
+som_solib_restart PARAMS ((void));
 
 /* If we can't set a breakpoint, and it's in a shared library, just
    disable it.  */
@@ -170,7 +171,7 @@ som_solib_restart PARAMS((void));
 #define DISABLE_UNSETTABLE_BREAK(addr) (som_solib_address(addr) != NULL)
 
 extern char *
-som_solib_address PARAMS ((CORE_ADDR));                /* somsolib.c */
+  som_solib_address PARAMS ((CORE_ADDR));      /* somsolib.c */
 
 /* If ADDR lies in a shared library, return its name.  */
 
index ae5a9d0fbd4005376d4c522a62e7feaa78c0c698..ca1dddae0edb9ba82434343c65401fc78ec99702 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -66,7 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 int open_source_file PARAMS ((struct symtab *));
 
 void find_source_lines PARAMS ((struct symtab *, int));
-  
+
 /* Prototypes for exported functions. */
 
 void _initialize_source PARAMS ((void));
@@ -124,8 +125,8 @@ static int first_line_listed;
 
 static struct symtab *last_source_visited = NULL;
 static int last_source_error = 0;
-
 \f
+
 /* Set the source file default for the "list" command to be S.
 
    If S is NULL, and we don't have a default, find one.  This
@@ -143,7 +144,7 @@ select_source_symtab (s)
   struct partial_symtab *ps;
   struct partial_symtab *cs_pst = 0;
   struct objfile *ofp;
-  
+
   if (s)
     {
       current_source_symtab = s;
@@ -164,20 +165,20 @@ select_source_symtab (s)
       current_source_symtab = sal.symtab;
       current_source_line = max (sal.line - (lines_to_list - 1), 1);
       if (current_source_symtab)
-        return;
+       return;
     }
-  
+
   /* All right; find the last file in the symtab list (ignoring .h's).  */
 
   current_source_line = 1;
 
-  for (ofp = object_files; ofp != NULL; ofp = ofp -> next)
+  for (ofp = object_files; ofp != NULL; ofp = ofp->next)
     {
-      for (s = ofp -> symtabs; s; s = s->next)
+      for (s = ofp->symtabs; s; s = s->next)
        {
-         char *name = s -> filename;
+         char *name = s->filename;
          int len = strlen (name);
-         if (! (len > 2 && (STREQ (&name[len - 2], ".h"))))
+         if (!(len > 2 && (STREQ (&name[len - 2], ".h"))))
            {
              current_source_symtab = s;
            }
@@ -188,13 +189,13 @@ select_source_symtab (s)
 
   /* Howabout the partial symbol tables? */
 
-  for (ofp = object_files; ofp != NULL; ofp = ofp -> next)
+  for (ofp = object_files; ofp != NULL; ofp = ofp->next)
     {
-      for (ps = ofp -> psymtabs; ps != NULL; ps = ps -> next)
+      for (ps = ofp->psymtabs; ps != NULL; ps = ps->next)
        {
-         char *name = ps -> filename;
+         char *name = ps->filename;
          int len = strlen (name);
-         if (! (len > 2 && (STREQ (&name[len - 2], ".h"))))
+         if (!(len > 2 && (STREQ (&name[len - 2], ".h"))))
            {
              cs_pst = ps;
            }
@@ -202,7 +203,7 @@ select_source_symtab (s)
     }
   if (cs_pst)
     {
-      if (cs_pst -> readin)
+      if (cs_pst->readin)
        {
          fatal ("Internal: select_source_symtab: readin pst found and no symtabs.");
        }
@@ -237,19 +238,19 @@ forget_cached_source_info ()
   register struct symtab *s;
   register struct objfile *objfile;
 
-  for (objfile = object_files; objfile != NULL; objfile = objfile -> next)
+  for (objfile = object_files; objfile != NULL; objfile = objfile->next)
     {
-      for (s = objfile -> symtabs; s != NULL; s = s -> next)
+      for (s = objfile->symtabs; s != NULL; s = s->next)
        {
-         if (s -> line_charpos != NULL)
+         if (s->line_charpos != NULL)
            {
-             mfree (objfile -> md, s -> line_charpos);
-             s -> line_charpos = NULL;
+             mfree (objfile->md, s->line_charpos);
+             s->line_charpos = NULL;
            }
-         if (s -> fullname != NULL)
+         if (s->fullname != NULL)
            {
-             mfree (objfile -> md, s -> fullname);
-             s -> fullname = NULL;
+             mfree (objfile->md, s->fullname);
+             s->fullname = NULL;
            }
        }
     }
@@ -266,7 +267,7 @@ init_source_path ()
 }
 
 /* Add zero or more directories to the front of the source path.  */
+
 void
 directory_command (dirname, from_tty)
      char *dirname;
@@ -288,7 +289,7 @@ directory_command (dirname, from_tty)
       last_source_visited = NULL;
     }
   if (from_tty)
-    show_directories ((char *)0, from_tty);
+    show_directories ((char *) 0, from_tty);
   forget_cached_source_info ();
 }
 
@@ -319,7 +320,7 @@ mod_path (dirname, which_path)
        char *space = strchr (name, ' ');
        char *tab = strchr (name, '\t');
 
-       if (separator == 0 && space == 0 && tab ==  0)
+       if (separator == 0 && space == 0 && tab == 0)
          p = dirname = name + strlen (name);
        else
          {
@@ -338,7 +339,7 @@ mod_path (dirname, which_path)
          }
       }
 
-#ifndef _WIN32 
+#ifndef _WIN32
       /* On win32 h:\ is different to h: */
       if (SLASH_P (p[-1]))
        /* Sigh. "foo/" => "foo" */
@@ -376,32 +377,33 @@ mod_path (dirname, which_path)
 
       if (name[0] == '~')
        name = tilde_expand (name);
-      else if (!ROOTED_P (name) && name[0] != '$') 
-         name = concat (current_directory, SLASH_STRING, name, NULL);
+      else if (!ROOTED_P (name) && name[0] != '$')
+       name = concat (current_directory, SLASH_STRING, name, NULL);
       else
        name = savestring (name, p - name);
       make_cleanup (free, name);
 
       /* Unless it's a variable, check existence.  */
-      if (name[0] != '$') {
-       /* These are warnings, not errors, since we don't want a
-          non-existent directory in a .gdbinit file to stop processing
-          of the .gdbinit file.
-
-          Whether they get added to the path is more debatable.  Current
-          answer is yes, in case the user wants to go make the directory
-          or whatever.  If the directory continues to not exist/not be
-          a directory/etc, then having them in the path should be
-          harmless.  */
-       if (stat (name, &st) < 0)
-         {
-           int save_errno = errno;
-           fprintf_unfiltered (gdb_stderr, "Warning: ");
-           print_sys_errmsg (name, save_errno);
-         }
-       else if ((st.st_mode & S_IFMT) != S_IFDIR)
-         warning ("%s is not a directory.", name);
-      }
+      if (name[0] != '$')
+       {
+         /* These are warnings, not errors, since we don't want a
+            non-existent directory in a .gdbinit file to stop processing
+            of the .gdbinit file.
+
+            Whether they get added to the path is more debatable.  Current
+            answer is yes, in case the user wants to go make the directory
+            or whatever.  If the directory continues to not exist/not be
+            a directory/etc, then having them in the path should be
+            harmless.  */
+         if (stat (name, &st) < 0)
+           {
+             int save_errno = errno;
+             fprintf_unfiltered (gdb_stderr, "Warning: ");
+             print_sys_errmsg (name, save_errno);
+           }
+         else if ((st.st_mode & S_IFMT) != S_IFDIR)
+           warning ("%s is not a directory.", name);
+       }
 
     append:
       {
@@ -415,10 +417,10 @@ mod_path (dirname, which_path)
              {
                /* Found it in the search path, remove old copy */
                if (p > *which_path)
-                 p--;                  /* Back over leading separator */
+                 p--;          /* Back over leading separator */
                if (prefix > p - *which_path)
                  goto skip_dup;        /* Same dir twice in one cmd */
-               strcpy (p, &p[len+1]);  /* Copy from next \0 or  : */
+               strcpy (p, &p[len + 1]);        /* Copy from next \0 or  : */
              }
            p = strchr (p, DIRNAME_SEPARATOR);
            if (p != 0)
@@ -433,7 +435,7 @@ mod_path (dirname, which_path)
            tinybuf[0] = DIRNAME_SEPARATOR;
            tinybuf[1] = '\0';
 
-           /* If we have already tacked on a name(s) in this command,                     be sure they stay on the front as we tack on some more.  */
+           /* If we have already tacked on a name(s) in this command,                     be sure they stay on the front as we tack on some more.  */
            if (prefix)
              {
                char *temp, c;
@@ -455,8 +457,9 @@ mod_path (dirname, which_path)
            old = *which_path;
          }
       }
-  skip_dup: ;
-    } while (*dirname != '\0');
+    skip_dup:;
+    }
+  while (*dirname != '\0');
 }
 
 
@@ -469,7 +472,7 @@ source_info (ignore, from_tty)
 
   if (!s)
     {
-      printf_filtered("No current source file.\n");
+      printf_filtered ("No current source file.\n");
       return;
     }
   printf_filtered ("Current source file is %s\n", s->filename);
@@ -484,9 +487,9 @@ source_info (ignore, from_tty)
   printf_filtered ("Source language is %s.\n", language_str (s->language));
   printf_filtered ("Compiled with %s debugging format.\n", s->debugformat);
 }
+\f
 
 
-\f
 /* Open a file named STRING, searching path PATH (dir names sep by some char)
    using mode MODE and protection bits PROT in the calls to open.
 
@@ -506,7 +509,7 @@ source_info (ignore, from_tty)
    Otherwise, return -1, with errno set for the last name we tried to open.  */
 
 /*  >>>> This should only allow files of certain types,
-    >>>>  eg executable, non-directory */
+   >>>>  eg executable, non-directory */
 int
 openp (path, try_cwd_first, string, mode, prot, filename_opened)
      char *path;
@@ -557,36 +560,41 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened)
        len = strlen (p);
 
       if (len == 4 && p[0] == '$' && p[1] == 'c'
-         && p[2] == 'w' && p[3] == 'd') {
-       /* Name is $cwd -- insert current directory name instead.  */
-       int newlen;
-
-       /* First, realloc the filename buffer if too short. */
-       len = strlen (current_directory);
-       newlen = len + strlen (string) + 2;
-       if (newlen > alloclen) {
-         alloclen = newlen;
-         filename = (char *) alloca (alloclen);
+         && p[2] == 'w' && p[3] == 'd')
+       {
+         /* Name is $cwd -- insert current directory name instead.  */
+         int newlen;
+
+         /* First, realloc the filename buffer if too short. */
+         len = strlen (current_directory);
+         newlen = len + strlen (string) + 2;
+         if (newlen > alloclen)
+           {
+             alloclen = newlen;
+             filename = (char *) alloca (alloclen);
+           }
+         strcpy (filename, current_directory);
+       }
+      else
+       {
+         /* Normal file name in path -- just use it.  */
+         strncpy (filename, p, len);
+         filename[len] = 0;
        }
-       strcpy (filename, current_directory);
-      } else {
-       /* Normal file name in path -- just use it.  */
-       strncpy (filename, p, len);
-       filename[len] = 0;
-      }
 
       /* Remove trailing slashes */
-      while (len > 0 && SLASH_P (filename[len-1]))
+      while (len > 0 && SLASH_P (filename[len - 1]))
        filename[--len] = 0;
 
-      strcat (filename+len, SLASH_STRING);
+      strcat (filename + len, SLASH_STRING);
       strcat (filename, string);
 
       fd = open (filename, mode);
-      if (fd >= 0) break;
+      if (fd >= 0)
+       break;
     }
 
- done:
+done:
   if (filename_opened)
     {
       if (fd < 0)
@@ -596,13 +604,13 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened)
       else
        {
          /* Beware the // my son, the Emacs barfs, the botch that catch... */
-         
-         *filename_opened = concat (current_directory, 
+
+         *filename_opened = concat (current_directory,
                                     SLASH_CHAR
-                                    == current_directory[strlen(current_directory)-1] 
-                                    ? "": SLASH_STRING,
+                       == current_directory[strlen (current_directory) - 1]
+                                    ? "" : SLASH_STRING,
                                     filename, NULL);
-        }
+       }
     }
 #ifdef MPW
   /* This is a debugging hack that can go away when all combinations
@@ -612,11 +620,11 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened)
 
     if (debug_openp)
       {
-       printf("openp on %s, path %s mode %d prot %d\n  returned %d",
-              string, path, mode, prot, fd);
+       printf ("openp on %s, path %s mode %d prot %d\n  returned %d",
+               string, path, mode, prot, fd);
        if (*filename_opened)
-         printf(" (filename is %s)", *filename_opened);
-       printf("\n");
+         printf (" (filename is %s)", *filename_opened);
+       printf ("\n");
       }
   }
 #endif /* MPW */
@@ -624,7 +632,7 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened)
   return fd;
 }
 
+
 /* This is essentially a convenience, for clients that want the behaviour
    of openp, using source_path, but that really don't want the file to be
    opened but want instead just to know what the full pathname is (as
@@ -636,13 +644,13 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened)
    set to the fully-qualified pathname.
 
    Else, this functions returns 0, and FULL_PATHNAME is set to NULL.
  */
+ */
 int
 source_full_path_of (filename, full_pathname)
-  char *  filename;
-  char **  full_pathname;
+     char *filename;
+     char **full_pathname;
 {
-  int  fd;
+  int fd;
 
   fd = openp (source_path, 1, filename, O_RDONLY, 0, full_pathname);
   if (fd < 0)
@@ -669,11 +677,11 @@ open_source_file (s)
   char *fullname;
 
   /* Quick way out if we already know its full name */
-  if (s->fullname) 
+  if (s->fullname)
     {
       result = open (s->fullname, OPEN_MODE);
       if (result >= 0)
-        return result;
+       return result;
       /* Didn't work -- free old one, try again. */
       mfree (s->objfile->md, s->fullname);
       s->fullname = NULL;
@@ -684,19 +692,19 @@ open_source_file (s)
       /* Replace a path entry of  $cdir  with the compilation directory name */
 #define        cdir_len        5
       /* We cast strstr's result in case an ANSIhole has made it const,
-        which produces a "required warning" when assigned to a nonconst. */
-      p = (char *)strstr (source_path, "$cdir");
+         which produces a "required warning" when assigned to a nonconst. */
+      p = (char *) strstr (source_path, "$cdir");
       if (p && (p == path || p[-1] == DIRNAME_SEPARATOR)
-           && (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0'))
+         && (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0'))
        {
          int len;
 
          path = (char *)
            alloca (strlen (source_path) + 1 + strlen (s->dirname) + 1);
          len = p - source_path;
-         strncpy (path, source_path, len);             /* Before $cdir */
-         strcpy (path + len, s->dirname);              /* new stuff */
-         strcat (path + len, source_path + len + cdir_len); /* After $cdir */
+         strncpy (path, source_path, len);     /* Before $cdir */
+         strcpy (path + len, s->dirname);      /* new stuff */
+         strcat (path + len, source_path + len + cdir_len);    /* After $cdir */
        }
     }
 
@@ -762,8 +770,8 @@ symtab_to_filename (s)
   close (fd);
   return s->fullname;
 }
-
 \f
+
 /* Create and initialize the table S->line_charpos that records
    the positions of the lines in the source file, which is assumed
    to be open on descriptor DESC.
@@ -782,21 +790,21 @@ find_source_lines (s, desc)
   long mtime = 0;
   int size;
 
-  line_charpos = (int *) xmmalloc (s -> objfile -> md,
+  line_charpos = (int *) xmmalloc (s->objfile->md,
                                   lines_allocated * sizeof (int));
   if (fstat (desc, &st) < 0)
     perror_with_name (s->filename);
 
   if (s && s->objfile && s->objfile->obfd)
-    mtime = bfd_get_mtime(s->objfile->obfd);
+    mtime = bfd_get_mtime (s->objfile->obfd);
   else if (exec_bfd)
-    mtime = bfd_get_mtime(exec_bfd);
+    mtime = bfd_get_mtime (exec_bfd);
 
   if (mtime && mtime < st.st_mtime)
     {
       if (tui_version)
        printf_filtered ("\n");
-      warning("Source file is more recent than executable.\n");
+      warning ("Source file is more recent than executable.\n");
     }
 
 #ifdef LSEEK_NOT_LINEAR
@@ -807,15 +815,15 @@ find_source_lines (s, desc)
 
     line_charpos[0] = lseek (desc, 0, SEEK_CUR);
     nlines = 1;
-    while (myread(desc, &c, 1)>0) 
+    while (myread (desc, &c, 1) > 0)
       {
-       if (c == '\n') 
+       if (c == '\n')
          {
-           if (nlines == lines_allocated) 
+           if (nlines == lines_allocated)
              {
                lines_allocated *= 2;
                line_charpos =
-                 (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos,
+                 (int *) xmrealloc (s->objfile->md, (char *) line_charpos,
                                     sizeof (int) * lines_allocated);
              }
            line_charpos[nlines++] = lseek (desc, 0, SEEK_CUR);
@@ -846,14 +854,14 @@ find_source_lines (s, desc)
     while (p != end)
       {
        if (*p++ == '\n'
-           /* A newline at the end does not start a new line.  */
+       /* A newline at the end does not start a new line.  */
            && p != end)
          {
            if (nlines == lines_allocated)
              {
                lines_allocated *= 2;
                line_charpos =
-                 (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos,
+                 (int *) xmrealloc (s->objfile->md, (char *) line_charpos,
                                     sizeof (int) * lines_allocated);
              }
            line_charpos[nlines++] = p - data;
@@ -864,23 +872,25 @@ find_source_lines (s, desc)
 #endif /* lseek linear.  */
   s->nlines = nlines;
   s->line_charpos =
-   (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos,
-                     nlines * sizeof (int));
+    (int *) xmrealloc (s->objfile->md, (char *) line_charpos,
+                      nlines * sizeof (int));
 
 }
 
 /* Return the character position of a line LINE in symtab S.
    Return 0 if anything is invalid.  */
 
-#if 0  /* Currently unused */
+#if 0                          /* Currently unused */
 
 int
 source_line_charpos (s, line)
      struct symtab *s;
      int line;
 {
-  if (!s) return 0;
-  if (!s->line_charpos || line <= 0) return 0;
+  if (!s)
+    return 0;
+  if (!s->line_charpos || line <= 0)
+    return 0;
   if (line > s->nlines)
     line = s->nlines;
   return s->line_charpos[line - 1];
@@ -890,16 +900,17 @@ source_line_charpos (s, line)
 
 int
 source_charpos_line (s, chr)
-    register struct symtab *s;
-    register int chr;
+     register struct symtab *s;
+     register int chr;
 {
   register int line = 0;
   register int *lnp;
-    
-  if (s == 0 || s->line_charpos == 0) return 0;
+
+  if (s == 0 || s->line_charpos == 0)
+    return 0;
   lnp = s->line_charpos;
   /* Files are usually short, so sequential search is Ok */
-  while (line < s->nlines  && *lnp <= chr)
+  while (line < s->nlines && *lnp <= chr)
     {
       line++;
       lnp++;
@@ -909,9 +920,9 @@ source_charpos_line (s, chr)
   return line;
 }
 
-#endif /* 0 */
-
+#endif /* 0 */
 \f
+
 /* Get full pathname and line number positions for a symtab.
    Return nonzero if line numbers may have changed.
    Set *FULLNAME to actual name of the file as found by `openp',
@@ -923,18 +934,20 @@ get_filename_and_charpos (s, fullname)
      char **fullname;
 {
   register int desc, linenums_changed = 0;
-  
+
   desc = open_source_file (s);
   if (desc < 0)
     {
       if (fullname)
        *fullname = NULL;
       return 0;
-    }  
+    }
   if (fullname)
     *fullname = s->fullname;
-  if (s->line_charpos == 0) linenums_changed = 1;
-  if (linenums_changed) find_source_lines (s, desc);
+  if (s->line_charpos == 0)
+    linenums_changed = 1;
+  if (linenums_changed)
+    find_source_lines (s, desc);
   close (desc);
   return linenums_changed;
 }
@@ -956,7 +969,7 @@ identify_source_line (s, line, mid_statement, pc)
      CORE_ADDR pc;
 {
   if (s->line_charpos == 0)
-    get_filename_and_charpos (s, (char **)NULL);
+    get_filename_and_charpos (s, (char **) NULL);
   if (s->fullname == 0)
     return 0;
   if (line > s->nlines)
@@ -971,12 +984,12 @@ identify_source_line (s, line, mid_statement, pc)
   current_source_symtab = s;
   return 1;
 }
-
 \f
+
 /* Print source lines from the file of symtab S,
    starting with line number LINE and stopping before line number STOPLINE. */
 
-static void print_source_lines_base PARAMS ((struct symtab *s, int line, int stopline, int noerror));
+static void print_source_lines_base PARAMS ((struct symtab * s, int line, int stopline, int noerror));
 static void
 print_source_lines_base (s, line, stopline, noerror)
      struct symtab *s;
@@ -994,24 +1007,24 @@ print_source_lines_base (s, line, stopline, noerror)
   current_source_line = line;
   first_line_listed = line;
 
-  /* Only prints "No such file or directory" once */
-  if ((s != last_source_visited) || (! last_source_error))
-    {
-      last_source_visited = s;
-      desc = open_source_file (s);
-    }
-  else
-    {
-      desc = last_source_error;
-      noerror = 1;
-    }
+      /* Only prints "No such file or directory" once */
+      if ((s != last_source_visited) || (!last_source_error))
+       {
+         last_source_visited = s;
+         desc = open_source_file (s);
+       }
+      else
+       {
+         desc = last_source_error;
+         noerror = 1;
+       }
 
   if (desc < 0)
     {
       last_source_error = desc;
 
-      if (! noerror)
-        {
+      if (!noerror)
+       {
          char *name = alloca (strlen (s->filename) + 100);
          sprintf (name, "%d\t%s", line, s->filename);
          print_sys_errmsg (name, errno);
@@ -1046,7 +1059,8 @@ print_source_lines_base (s, line, stopline, noerror)
   while (nlines-- > 0)
     {
       c = fgetc (stream);
-      if (c == EOF) break;
+      if (c == EOF)
+       break;
       last_line_listed = current_source_line;
       printf_filtered ("%d\t", current_source_line++);
       do
@@ -1063,7 +1077,8 @@ print_source_lines_base (s, line, stopline, noerror)
 #endif
          else
            printf_filtered ("%c", c);
-       } while (c != '\n' && (c = fgetc (stream)) >= 0);
+       }
+      while (c != '\n' && (c = fgetc (stream)) >= 0);
     }
 
   fclose (stream);
@@ -1074,44 +1089,44 @@ print_source_lines_base (s, line, stopline, noerror)
    not the command line version, then the source is shown in the source
    window otherwise it is simply printed */
 
-void 
+void
 print_source_lines (s, line, stopline, noerror)
-    struct symtab *s;
-    int line, stopline, noerror;
+     struct symtab *s;
+     int line, stopline, noerror;
 {
 #if defined(TUI)
-  if (!tui_version || 
-      m_winPtrIsNull(srcWin) || !srcWin->generic.isVisible )
-    print_source_lines_base(s, line, stopline, noerror);
+  if (!tui_version ||
+      m_winPtrIsNull (srcWin) || !srcWin->generic.isVisible)
+    print_source_lines_base (s, line, stopline, noerror);
   else
     {
-      TuiGenWinInfoPtr locator = locatorWinInfoPtr();
+      TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
       extern void tui_vAddWinToLayout PARAMS ((va_list));
       extern void tui_vUpdateSourceWindowsWithLine PARAMS ((va_list));
 
-    /* Regardless of whether we can open the file,
-       set current_source_symtab. */
-    current_source_symtab = s;
-    current_source_line = line;
-    first_line_listed = line;
+      /* Regardless of whether we can open the file,
+         set current_source_symtab. */
+      current_source_symtab = s;
+      current_source_line = line;
+      first_line_listed = line;
 
-    /* make sure that the source window is displayed */
-    tuiDo((TuiOpaqueFuncPtr)tui_vAddWinToLayout, SRC_WIN);
+      /* make sure that the source window is displayed */
+      tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, SRC_WIN);
 
-    tuiDo((TuiOpaqueFuncPtr)tui_vUpdateSourceWindowsWithLine, s, line);
-    tuiDo((TuiOpaqueFuncPtr)tui_vUpdateLocatorFilename, s->filename);
-  }
+      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithLine, s, line);
+      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateLocatorFilename, s->filename);
+    }
 #else
-  print_source_lines_base(s, line, stopline, noerror);
+  print_source_lines_base (s, line, stopline, noerror);
 #endif
 }
 \f
 
 
 /* Print a list of files and line numbers which a user may choose from
-  in order to list a function which was specified ambiguously (as with
-  `list classname::overloadedfuncname', for example).  The vector in
-  SALS provides the filenames and line numbers.  */
+   in order to list a function which was specified ambiguously (as with
+   `list classname::overloadedfuncname', for example).  The vector in
+   SALS provides the filenames and line numbers.  */
 
 static void
 ambiguous_line_spec (sals)
@@ -1120,8 +1135,8 @@ ambiguous_line_spec (sals)
   int i;
 
   for (i = 0; i < sals->nelts; ++i)
-    printf_filtered("file: \"%s\", line number: %d\n",
-                   sals->sals[i].symtab->filename, sals->sals[i].line);
+    printf_filtered ("file: \"%s\", line number: %d\n",
+                    sals->sals[i].symtab->filename, sals->sals[i].line);
 }
 
 static void
@@ -1139,7 +1154,7 @@ list_command (arg, from_tty)
   int linenum_beg = 0;
   char *p;
 
-  if (!have_full_symbols () && !have_partial_symbols())
+  if (!have_full_symbols () && !have_partial_symbols ())
     error ("No symbol table is loaded.  Use the \"file\" command.");
 
   /* Pull in a current source symtab if necessary */
@@ -1182,7 +1197,8 @@ list_command (arg, from_tty)
     {
       sals = decode_line_1 (&arg1, 0, 0, 0, 0);
 
-      if (! sals.nelts) return;  /*  C++  */
+      if (!sals.nelts)
+       return;                 /*  C++  */
       if (sals.nelts > 1)
        {
          ambiguous_line_spec (&sals);
@@ -1215,7 +1231,7 @@ list_command (arg, from_tty)
            sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
          else
            sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
-         if (sals_end.nelts == 0) 
+         if (sals_end.nelts == 0)
            return;
          if (sals_end.nelts > 1)
            {
@@ -1236,7 +1252,7 @@ list_command (arg, from_tty)
     error ("Specified start and end are in different files.");
   if (dummy_beg && dummy_end)
     error ("Two empty args do not say what lines to list.");
+
   /* if line was specified by address,
      first print exactly which line, and which file.
      In this case, sal.symtab == 0 means address is outside
@@ -1246,7 +1262,7 @@ list_command (arg, from_tty)
       if (sal.symtab == 0)
        /* FIXME-32x64--assumes sal.pc fits in long.  */
        error ("No source file for address %s.",
-               local_hex_string((unsigned long) sal.pc));
+              local_hex_string ((unsigned long) sal.pc));
       sym = find_pc_function (sal.pc);
       if (sym)
        {
@@ -1267,7 +1283,7 @@ list_command (arg, from_tty)
      and it does not imply a symtab, it must be an undebuggable symbol
      which means no source code.  */
 
-  if (! linenum_beg && sal.symtab == 0)
+  if (!linenum_beg && sal.symtab == 0)
     error ("No line number known for %s.", arg);
 
   /* If this command is repeated with RET,
@@ -1286,7 +1302,7 @@ list_command (arg, from_tty)
     error ("No default source file yet.  Do \"help list\".");
   else if (no_end)
     {
-      if (lines_to_list % 2 == 0) 
+      if (lines_to_list % 2 == 0)
        print_source_lines (sal.symtab,
                            max (sal.line - (lines_to_list / 2), 1),
                            sal.line + (lines_to_list / 2), 0);
@@ -1298,7 +1314,7 @@ list_command (arg, from_tty)
         */
        print_source_lines (sal.symtab,
                            max (sal.line - (lines_to_list / 2), 1),
-                           sal.line + ((1+lines_to_list) / 2), 0);
+                           sal.line + ((1 + lines_to_list) / 2), 0);
     }
   else
     print_source_lines (sal.symtab, sal.line,
@@ -1320,7 +1336,7 @@ line_info (arg, from_tty)
   CORE_ADDR start_pc, end_pc;
   int i;
 
-  INIT_SAL (&sal);     /* initialize to zeroes */
+  INIT_SAL (&sal);             /* initialize to zeroes */
 
   if (arg == 0)
     {
@@ -1334,7 +1350,7 @@ line_info (arg, from_tty)
   else
     {
       sals = decode_line_spec_1 (arg, 0);
-      
+
       dont_repeat ();
     }
 
@@ -1343,15 +1359,15 @@ line_info (arg, from_tty)
   for (i = 0; i < sals.nelts; i++)
     {
       sal = sals.sals[i];
-      
+
       if (sal.symtab == 0)
        {
          printf_filtered ("No line number information available");
          if (sal.pc != 0)
            {
              /* This is useful for "info line *0x7f34".  If we can't tell the
-                user about a source line, at least let them have the symbolic
-                address.  */
+                user about a source line, at least let them have the symbolic
+                address.  */
              printf_filtered (" for address ");
              wrap_here ("  ");
              print_address (sal.pc, gdb_stdout);
@@ -1423,22 +1439,22 @@ forward_search_command (regex, from_tty)
 
 #if defined(TUI)
   /* 
-  ** If this is the TUI, search from the first line displayed in 
-  ** the source window, otherwise, search from last_line_listed+1 
-  ** in current_source_symtab 
-  */
+     ** If this is the TUI, search from the first line displayed in 
+     ** the source window, otherwise, search from last_line_listed+1 
+     ** in current_source_symtab 
+   */
   if (!tui_version)
     line = last_line_listed;
   else
     {
       if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0)
-        line = ((TuiWinContent)
-            srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
+       line = ((TuiWinContent)
+        srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
       else
-        {
-          printf_filtered("No source displayed.\nExpression not found.\n");
-          return;
-        }
+       {
+         printf_filtered ("No source displayed.\nExpression not found.\n");
+         return;
+       }
     }
   line++;
 #else
@@ -1473,46 +1489,49 @@ forward_search_command (regex, from_tty)
 
   stream = fdopen (desc, FDOPEN_MODE);
   clearerr (stream);
-  while (1) {
-    static char *buf = NULL;
-    register char *p;
-    int cursize, newsize;
-
-    cursize = 256;
-    buf = xmalloc (cursize);
-    p = buf;
-
-    c = getc (stream);
-    if (c == EOF)
-      break;
-    do {
-      *p++ = c;
-      if (p - buf == cursize)
+  while (1)
+    {
+      static char *buf = NULL;
+      register char *p;
+      int cursize, newsize;
+
+      cursize = 256;
+      buf = xmalloc (cursize);
+      p = buf;
+
+      c = getc (stream);
+      if (c == EOF)
+       break;
+      do
        {
-         newsize = cursize + cursize / 2;
-         buf = xrealloc (buf, newsize);
-         p = buf + cursize;
-         cursize = newsize;
+         *p++ = c;
+         if (p - buf == cursize)
+           {
+             newsize = cursize + cursize / 2;
+             buf = xrealloc (buf, newsize);
+             p = buf + cursize;
+             cursize = newsize;
+           }
        }
-    } while (c != '\n' && (c = getc (stream)) >= 0);
+      while (c != '\n' && (c = getc (stream)) >= 0);
 
-    /* we now have a source line in buf, null terminate and match */
-    *p = 0;
-    if (re_exec (buf) > 0)
-      {
-       /* Match! */
-       fclose (stream);
-       if (tui_version)
-          print_source_lines_base (current_source_symtab, line, line+1, 0);
-       print_source_lines (current_source_symtab, line, line+1, 0);
-       set_internalvar (lookup_internalvar ("_"),
-                        value_from_longest (builtin_type_int,
-                                            (LONGEST) line));
-       current_source_line = max (line - lines_to_list / 2, 1);
-       return;
-      }
-    line++;
-  }
+      /* we now have a source line in buf, null terminate and match */
+      *p = 0;
+      if (re_exec (buf) > 0)
+       {
+         /* Match! */
+         fclose (stream);
+         if (tui_version)
+           print_source_lines_base (current_source_symtab, line, line + 1, 0);
+         print_source_lines (current_source_symtab, line, line + 1, 0);
+         set_internalvar (lookup_internalvar ("_"),
+                          value_from_longest (builtin_type_int,
+                                              (LONGEST) line));
+         current_source_line = max (line - lines_to_list / 2, 1);
+         return;
+       }
+      line++;
+    }
 
   printf_filtered ("Expression not found\n");
   fclose (stream);
@@ -1531,22 +1550,22 @@ reverse_search_command (regex, from_tty)
   char *msg;
 #if defined(TUI)
   /*
-  ** If this is the TUI, search from the first line displayed in
-  ** the source window, otherwise, search from last_line_listed-1
-  ** in current_source_symtab
-  */
+     ** If this is the TUI, search from the first line displayed in
+     ** the source window, otherwise, search from last_line_listed-1
+     ** in current_source_symtab
+   */
   if (!tui_version)
     line = last_line_listed;
   else
     {
       if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0)
-        line = ((TuiWinContent)
-            srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
+       line = ((TuiWinContent)
+        srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
       else
-        {
-          printf_filtered("No source displayed.\nExpression not found.\n");
-          return;
-        }
+       {
+         printf_filtered ("No source displayed.\nExpression not found.\n");
+         return;
+       }
     }
   line--;
 #else
@@ -1590,9 +1609,11 @@ reverse_search_command (regex, from_tty)
       c = getc (stream);
       if (c == EOF)
        break;
-      do {
-       *p++ = c;
-      } while (c != '\n' && (c = getc (stream)) >= 0);
+      do
+       {
+         *p++ = c;
+       }
+      while (c != '\n' && (c = getc (stream)) >= 0);
 
       /* We now have a source line in buf; null terminate and match.  */
       *p = 0;
@@ -1600,9 +1621,9 @@ reverse_search_command (regex, from_tty)
        {
          /* Match! */
          fclose (stream);
-          if (tui_version)
-            print_source_lines_base (current_source_symtab, line, line+1, 0);
-         print_source_lines (current_source_symtab, line, line+1, 0);
+         if (tui_version)
+           print_source_lines_base (current_source_symtab, line, line + 1, 0);
+         print_source_lines (current_source_symtab, line, line + 1, 0);
          set_internalvar (lookup_internalvar ("_"),
                           value_from_longest (builtin_type_int,
                                               (LONGEST) line));
@@ -1636,7 +1657,7 @@ _initialize_source ()
   re_set_syntax (RE_SYNTAX_GREP);
 
   c = add_cmd ("directory", class_files, directory_command,
-          "Add directory DIR to beginning of search path for source files.\n\
+              "Add directory DIR to beginning of search path for source files.\n\
 Forget cached info on source file locations and line positions.\n\
 DIR can also be $cwd for the current working directory, or $cdir for the\n\
 directory in which the source file was compiled into object code.\n\
@@ -1644,7 +1665,7 @@ With no argument, reset the search path to $cdir:$cwd, the default.",
               &cmdlist);
 
   if (dbx_commands)
-    add_com_alias("use", "directory", class_files, 0);
+    add_com_alias ("use", "directory", class_files, 0);
 
   c->completer = filename_completer;
 
@@ -1656,12 +1677,12 @@ $cdir in the path means the compilation directory of the source file.",
 
   if (xdb_commands)
     {
-      add_com_alias("D", "directory", class_files, 0);
+      add_com_alias ("D", "directory", class_files, 0);
       add_cmd ("ld", no_class, show_directories,
-          "Current search path for finding source files.\n\
+              "Current search path for finding source files.\n\
 $cwd in the path means the current working directory.\n\
 $cdir in the path means the compilation directory of the source file.",
-          &cmdlist);
+              &cmdlist);
     }
 
   add_info ("source", source_info,
@@ -1691,8 +1712,8 @@ The matching line number is also stored as the value of \"$_\".");
 
   if (xdb_commands)
     {
-      add_com_alias("/", "forward-search", class_files, 0);
-      add_com_alias("?", "reverse-search", class_files, 0);
+      add_com_alias ("/", "forward-search", class_files, 0);
+      add_com_alias ("?", "reverse-search", class_files, 0);
     }
 
   add_com ("list", class_files, list_command,
@@ -1720,8 +1741,8 @@ With two args if one is empty it stands for ten lines away from the other arg.",
 
   add_show_from_set
     (add_set_cmd ("listsize", class_support, var_uinteger,
-                 (char *)&lines_to_list,
-       "Set number of source lines gdb will list by default.",
+                 (char *) &lines_to_list,
+                 "Set number of source lines gdb will list by default.",
                  &setlist),
      &showlist);
 }
index 3f5f8bf748ca1711c0415c6575638b9411ed1d41..be5308bda74073521496a74c2117f7ac013333fd 100644 (file)
@@ -1,21 +1,22 @@
 /* Functions specific to running gdb native on a SPARC running SunOS4.
    Copyright 1989, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -59,7 +60,8 @@ fetch_inferior_registers (regno)
 
   /* We should never be called with deferred stores, because a prerequisite
      for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh.  */
-  if (deferred_stores) abort();
+  if (deferred_stores)
+    abort ();
 
   DO_DEFERRED_STORES;
 
@@ -68,21 +70,21 @@ fetch_inferior_registers (regno)
      and the stack pointer has not yet been fetched,
      we have to do that first, since they're found in memory relative
      to the stack pointer.  */
-  if (regno < O7_REGNUM  /* including -1 */
+  if (regno < O7_REGNUM                /* including -1 */
       || regno >= Y_REGNUM
       || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
     {
       if (0 != ptrace (PTRACE_GETREGS, inferior_pid,
-                      (PTRACE_ARG3_TYPE) &inferior_registers, 0))
-       perror("ptrace_getregs");
-      
+                      (PTRACE_ARG3_TYPE) & inferior_registers, 0))
+       perror ("ptrace_getregs");
+
       registers[REGISTER_BYTE (0)] = 0;
       memcpy (&registers[REGISTER_BYTE (1)], &inferior_registers.r_g1,
              15 * REGISTER_RAW_SIZE (G0_REGNUM));
-      *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; 
-      *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-      *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
-      *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
+      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
+      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
 
       for (i = G0_REGNUM; i <= O7_REGNUM; i++)
        register_valid[i] = 1;
@@ -91,7 +93,7 @@ fetch_inferior_registers (regno)
       register_valid[PC_REGNUM] = 1;
       register_valid[NPC_REGNUM] = 1;
       /* If we don't set these valid, read_register_bytes() rereads
-        all the regs every time it is called!  FIXME.  */
+         all the regs every time it is called!  FIXME.  */
       register_valid[WIM_REGNUM] = 1;  /* Not true yet, FIXME */
       register_valid[TBR_REGNUM] = 1;  /* Not true yet, FIXME */
       register_valid[CPS_REGNUM] = 1;  /* Not true yet, FIXME */
@@ -103,15 +105,15 @@ fetch_inferior_registers (regno)
       (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
     {
       if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid,
-                      (PTRACE_ARG3_TYPE) &inferior_fp_registers,
+                      (PTRACE_ARG3_TYPE) & inferior_fp_registers,
                       0))
-           perror("ptrace_getfpregs");
+       perror ("ptrace_getfpregs");
       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
              sizeof inferior_fp_registers.fpu_fr);
       memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)],
-            &inferior_fp_registers.Fpu_fsr,
-            sizeof (FPU_FSR_TYPE));
-      for (i = FP0_REGNUM; i <= FP0_REGNUM+31; i++)
+             &inferior_fp_registers.Fpu_fsr,
+             sizeof (FPU_FSR_TYPE));
+      for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
        register_valid[i] = 1;
       register_valid[FPS_REGNUM] = 1;
     }
@@ -120,18 +122,18 @@ fetch_inferior_registers (regno)
      all (16 ptrace calls!) if we really need them.  */
   if (regno == -1)
     {
-      target_read_memory (*(CORE_ADDR*)&registers[REGISTER_BYTE (SP_REGNUM)],
-                         &registers[REGISTER_BYTE (L0_REGNUM)],
-                         16*REGISTER_RAW_SIZE (L0_REGNUM));
+      target_read_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)],
+                         &registers[REGISTER_BYTE (L0_REGNUM)],
+                         16 * REGISTER_RAW_SIZE (L0_REGNUM));
       for (i = L0_REGNUM; i <= I7_REGNUM; i++)
        register_valid[i] = 1;
     }
   else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
     {
-      CORE_ADDR sp = *(CORE_ADDR*)&registers[REGISTER_BYTE (SP_REGNUM)];
+      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
       i = REGISTER_BYTE (regno);
       if (register_valid[regno])
-       printf_unfiltered("register %d valid and read\n", regno);
+       printf_unfiltered ("register %d valid and read\n", regno);
       target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
                          &registers[i], REGISTER_RAW_SIZE (regno));
       register_valid[regno] = 1;
@@ -157,7 +159,7 @@ store_inferior_registers (regno)
       {
        wanna_store = FP_REGS;
       }
-    else 
+    else
       {
        if (regno == SP_REGNUM)
          wanna_store = INT_REGS + STACK_REGS;
@@ -191,117 +193,124 @@ store_inferior_registers (regno)
 
   if (wanna_store & STACK_REGS)
     {
-      CORE_ADDR sp = *(CORE_ADDR *)&registers[REGISTER_BYTE (SP_REGNUM)];
+      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
 
       if (regno < 0 || regno == SP_REGNUM)
        {
-         if (!register_valid[L0_REGNUM+5]) abort();
-         target_write_memory (sp, 
+         if (!register_valid[L0_REGNUM + 5])
+           abort ();
+         target_write_memory (sp,
                               &registers[REGISTER_BYTE (L0_REGNUM)],
-                              16*REGISTER_RAW_SIZE (L0_REGNUM));
+                              16 * REGISTER_RAW_SIZE (L0_REGNUM));
        }
       else
        {
-         if (!register_valid[regno]) abort();
+         if (!register_valid[regno])
+           abort ();
          target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
                               &registers[REGISTER_BYTE (regno)],
                               REGISTER_RAW_SIZE (regno));
        }
-       
+
     }
 
   if (wanna_store & INT_REGS)
     {
-      if (!register_valid[G1_REGNUM]) abort();
+      if (!register_valid[G1_REGNUM])
+       abort ();
 
       memcpy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (G1_REGNUM)],
              15 * REGISTER_RAW_SIZE (G1_REGNUM));
 
       inferior_registers.r_ps =
-       *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
+       *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
       inferior_registers.r_pc =
-       *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+       *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
       inferior_registers.r_npc =
-       *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)];
+       *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
       inferior_registers.r_y =
-       *(int *)&registers[REGISTER_BYTE (Y_REGNUM)];
+       *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
 
       if (0 != ptrace (PTRACE_SETREGS, inferior_pid,
-                      (PTRACE_ARG3_TYPE) &inferior_registers, 0))
-       perror("ptrace_setregs");
+                      (PTRACE_ARG3_TYPE) & inferior_registers, 0))
+       perror ("ptrace_setregs");
     }
 
   if (wanna_store & FP_REGS)
     {
-      if (!register_valid[FP0_REGNUM+9]) abort();
+      if (!register_valid[FP0_REGNUM + 9])
+       abort ();
       memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
              sizeof inferior_fp_registers.fpu_fr);
-      memcpy (&inferior_fp_registers.Fpu_fsr, 
+      memcpy (&inferior_fp_registers.Fpu_fsr,
              &registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
       if (0 !=
-        ptrace (PTRACE_SETFPREGS, inferior_pid,
-                (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0))
-        perror("ptrace_setfpregs");
+         ptrace (PTRACE_SETFPREGS, inferior_pid,
+                 (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
+       perror ("ptrace_setfpregs");
     }
 }
 
 
 static void
 fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
-  char *core_reg_sect;
-  unsigned core_reg_size;
-  int which;
-  CORE_ADDR ignore;    /* reg addr, unused in this version */
+     char *core_reg_sect;
+     unsigned core_reg_size;
+     int which;
+     CORE_ADDR ignore;         /* reg addr, unused in this version */
 {
 
-  if (which == 0) {
+  if (which == 0)
+    {
 
-    /* Integer registers */
+      /* Integer registers */
 
 #define gregs ((struct regs *)core_reg_sect)
-    /* G0 *always* holds 0.  */
-    *(int *)&registers[REGISTER_BYTE (0)] = 0;
-
-    /* The globals and output registers.  */
-    memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1, 
-           15 * REGISTER_RAW_SIZE (G1_REGNUM));
-    *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
-    *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
-    *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
-    *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
-
-    /* My best guess at where to get the locals and input
-       registers is exactly where they usually are, right above
-       the stack pointer.  If the core dump was caused by a bus error
-       from blowing away the stack pointer (as is possible) then this
-       won't work, but it's worth the try. */
-    {
-      int sp;
+      /* G0 *always* holds 0.  */
+      *(int *) &registers[REGISTER_BYTE (0)] = 0;
 
-      sp = *(int *)&registers[REGISTER_BYTE (SP_REGNUM)];
-      if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)], 
-                         16 * REGISTER_RAW_SIZE (L0_REGNUM)))
-       {
-         /* fprintf_unfiltered so user can still use gdb */
-         fprintf_unfiltered (gdb_stderr,
-                  "Couldn't read input and local registers from core file\n");
-       }
+      /* The globals and output registers.  */
+      memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
+             15 * REGISTER_RAW_SIZE (G1_REGNUM));
+      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
+      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
+      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
+      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
+
+      /* My best guess at where to get the locals and input
+         registers is exactly where they usually are, right above
+         the stack pointer.  If the core dump was caused by a bus error
+         from blowing away the stack pointer (as is possible) then this
+         won't work, but it's worth the try. */
+      {
+       int sp;
+
+       sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
+       if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
+                                    16 * REGISTER_RAW_SIZE (L0_REGNUM)))
+         {
+           /* fprintf_unfiltered so user can still use gdb */
+           fprintf_unfiltered (gdb_stderr,
+               "Couldn't read input and local registers from core file\n");
+         }
+      }
     }
-  } else if (which == 2) {
+  else if (which == 2)
+    {
 
-    /* Floating point registers */
+      /* Floating point registers */
 
 #define fpuregs  ((struct fpu *) core_reg_sect)
-    if (core_reg_size >= sizeof (struct fpu))
-      {
-       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
-               sizeof (fpuregs->fpu_regs));
-       memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
-               sizeof (FPU_FSR_TYPE));
-      }
-    else
-      fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
-  }
+      if (core_reg_size >= sizeof (struct fpu))
+       {
+         memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
+                 sizeof (fpuregs->fpu_regs));
+         memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
+                 sizeof (FPU_FSR_TYPE));
+       }
+      else
+       fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
+    }
 }
 
 int
@@ -309,8 +318,8 @@ kernel_u_size ()
 {
   return (sizeof (struct user));
 }
-
 \f
+
 /* Register that we are able to handle sparc core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index f31878fc30aa32a15f06362d6e640731b308201f..c3ff95202796f5c4f78be46baf4f9f560c21f852 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* ??? Support for calling functions from gdb in sparc64 is unfinished.  */
 
@@ -125,7 +126,8 @@ typedef enum
 #ifdef GDB_TARGET_IS_SPARC64
   done_retry
 #endif
-} branch_type;
+}
+branch_type;
 
 /* Simulate single-step ptrace call for sun4.  Code written by Gary
    Beihl (beihl@mcc.com).  */
@@ -149,7 +151,7 @@ static branch_type isbranch PARAMS ((long, CORE_ADDR, CORE_ADDR *));
 
 void
 sparc_software_single_step (ignore, insert_breakpoints_p)
-     enum target_signal ignore; /* pid, but we don't need it */
+     enum target_signal ignore;        /* pid, but we don't need it */
      int insert_breakpoints_p;
 {
   branch_type br;
@@ -160,7 +162,7 @@ sparc_software_single_step (ignore, insert_breakpoints_p)
     {
       /* Always set breakpoint for NPC.  */
       next_pc = read_register (NPC_REGNUM);
-      npc4 = next_pc + 4; /* branch not taken */
+      npc4 = next_pc + 4;      /* branch not taken */
 
       target_insert_breakpoint (next_pc, break_mem[0]);
       /* printf_unfiltered ("set break at %x\n",next_pc); */
@@ -233,7 +235,7 @@ sparc_init_extra_frame_info (fromleaf, fi)
       char buf[MAX_REGISTER_RAW_SIZE];
 
       /* Compute ->frame as if not flat.  If it is flat, we'll change
-        it later.  */
+         it later.  */
       if (fi->next->next != NULL
          && (fi->next->next->signal_handler_caller
              || frame_in_dummy (fi->next->next))
@@ -253,7 +255,7 @@ sparc_init_extra_frame_info (fromleaf, fi)
          if (fi->frame & 1)
            fi->frame += 2047;
 #endif
-         
+
        }
     }
 
@@ -264,9 +266,9 @@ sparc_init_extra_frame_info (fromleaf, fi)
   if (find_pc_partial_function (fi->pc, &name, &prologue_start, &prologue_end))
     {
       /* See if the function starts with an add (which will be of a
-        negative number if a flat frame) to the sp.  FIXME: Does not
-        handle large frames which will need more than one instruction
-        to adjust the sp.  */
+         negative number if a flat frame) to the sp.  FIXME: Does not
+         handle large frames which will need more than one instruction
+         to adjust the sp.  */
       insn = fetch_instruction (prologue_start, 4);
       if (X_OP (insn) == 2 && X_RD (insn) == 14 && X_OP3 (insn) == 0
          && X_I (insn) && X_SIMM13 (insn) < 0)
@@ -307,35 +309,35 @@ sparc_init_extra_frame_info (fromleaf, fi)
                fi->pc_addr = fi->frame + fi->sp_offset + X_SIMM13 (insn);
            }
        }
-       else
-         {
-           /* Check if the PC is in the function prologue before a SAVE
-              instruction has been executed yet.  If so, set the frame
-              to the current value of the stack pointer and set
-              the in_prologue flag.  */
-           CORE_ADDR addr;
-           struct symtab_and_line sal;
-
-           sal = find_pc_line (prologue_start, 0);
-           if (sal.line == 0)                  /* no line info, use PC */
-             prologue_end = fi->pc;
-           else if (sal.end < prologue_end)
-             prologue_end = sal.end;
-           if (fi->pc < prologue_end)
-             {
-               for (addr = prologue_start; addr < fi->pc; addr += 4)
-                 {
-                   insn = read_memory_integer (addr, 4);
-                   if (X_OP (insn) == 2 && X_OP3 (insn) == 0x3c)
-                     break;                    /* SAVE seen, stop searching */
-                 }
-               if (addr >= fi->pc)
-                 {
-                   fi->in_prologue = 1;
-                   fi->frame = read_register (SP_REGNUM);
-                 }
-             }
-         }
+      else
+       {
+         /* Check if the PC is in the function prologue before a SAVE
+            instruction has been executed yet.  If so, set the frame
+            to the current value of the stack pointer and set
+            the in_prologue flag.  */
+         CORE_ADDR addr;
+         struct symtab_and_line sal;
+
+         sal = find_pc_line (prologue_start, 0);
+         if (sal.line == 0)    /* no line info, use PC */
+           prologue_end = fi->pc;
+         else if (sal.end < prologue_end)
+           prologue_end = sal.end;
+         if (fi->pc < prologue_end)
+           {
+             for (addr = prologue_start; addr < fi->pc; addr += 4)
+               {
+                 insn = read_memory_integer (addr, 4);
+                 if (X_OP (insn) == 2 && X_OP3 (insn) == 0x3c)
+                   break;      /* SAVE seen, stop searching */
+               }
+             if (addr >= fi->pc)
+               {
+                 fi->in_prologue = 1;
+                 fi->frame = read_register (SP_REGNUM);
+               }
+           }
+       }
     }
   if (fi->next && fi->frame == 0)
     {
@@ -352,7 +354,7 @@ sparc_frame_chain (frame)
   /* Value that will cause FRAME_CHAIN_VALID to not worry about the chain
      value.  If it realy is zero, we detect it later in
      sparc_init_prev_frame.  */
-  return (CORE_ADDR)1;
+  return (CORE_ADDR) 1;
 }
 
 CORE_ADDR
@@ -375,7 +377,7 @@ sparc_frame_saved_pc (frame)
   if (frame->signal_handler_caller)
     {
       /* This is the signal trampoline frame.
-        Get the saved PC from the sigcontext structure.  */
+         Get the saved PC from the sigcontext structure.  */
 
 #ifndef SIGCONTEXT_PC_OFFSET
 #define SIGCONTEXT_PC_OFFSET 12
@@ -387,19 +389,19 @@ sparc_frame_saved_pc (frame)
       char *name = NULL;
 
       /* Solaris2 ucbsigvechandler passes a pointer to a sigcontext
-        as the third parameter.  The offset to the saved pc is 12.  */
+         as the third parameter.  The offset to the saved pc is 12.  */
       find_pc_partial_function (frame->pc, &name,
-                               (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+                               (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
       if (name && STREQ (name, "ucbsigvechandler"))
        saved_pc_offset = 12;
 
       /* The sigcontext address is contained in register O2.  */
-      get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL,
-                         frame, O0_REGNUM + 2, (enum lval_type *)NULL);
+      get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
+                         frame, O0_REGNUM + 2, (enum lval_type *) NULL);
       sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM + 2));
 
       /* Don't cause a memory_error when accessing sigcontext in case the
-        stack layout has changed or the stack is corrupt.  */
+         stack layout has changed or the stack is corrupt.  */
       target_read_memory (sigcontext_addr + saved_pc_offset,
                          scbuf, sizeof (scbuf));
       return extract_address (scbuf, sizeof (scbuf));
@@ -407,13 +409,13 @@ sparc_frame_saved_pc (frame)
   else if (frame->in_prologue ||
           (frame->next != NULL
            && (frame->next->signal_handler_caller
-               || frame_in_dummy (frame->next))
+               || frame_in_dummy (frame->next))
            && frameless_look_for_prologue (frame)))
     {
       /* A frameless function interrupted by a signal did not save
-        the PC, it is still in %o7.  */
-      get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL,
-                         frame, O7_REGNUM, (enum lval_type *)NULL);
+         the PC, it is still in %o7.  */
+      get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
+                         frame, O7_REGNUM, (enum lval_type *) NULL);
       return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
     }
   if (frame->flat)
@@ -453,7 +455,7 @@ setup_arbitrary_frame (argc, argv)
 
   if (!frame)
     fatal ("internal: create_new_frame returned invalid frame");
-  
+
   frame->bottom = argv[1];
   frame->pc = FRAME_SAVED_PC (frame);
   return frame;
@@ -471,7 +473,7 @@ setup_arbitrary_frame (argc, argv)
 static CORE_ADDR examine_prologue PARAMS ((CORE_ADDR, int, struct frame_info *,
                                           struct frame_saved_regs *));
 
-static CORE_ADDR 
+static CORE_ADDR
 examine_prologue (start_pc, frameless_p, fi, saved_regs)
      CORE_ADDR start_pc;
      int frameless_p;
@@ -511,16 +513,16 @@ examine_prologue (start_pc, frameless_p, fi, saved_regs)
   if (X_OP (insn) == 2 && X_OP3 (insn) == 60)
     {
       pc += 4;
-      if (frameless_p)                 /* If the save is all we care about, */
-       return pc;                      /* return before doing more work */
+      if (frameless_p)         /* If the save is all we care about, */
+       return pc;              /* return before doing more work */
       insn = fetch_instruction (pc);
     }
   /* Recognize add to %sp.  */
   else if (X_OP (insn) == 2 && X_RD (insn) == 14 && X_OP3 (insn) == 0)
     {
       pc += 4;
-      if (frameless_p)                 /* If the add is all we care about, */
-       return pc;                      /* return before doing more work */
+      if (frameless_p)         /* If the add is all we care about, */
+       return pc;              /* return before doing more work */
       is_flat = 1;
       insn = fetch_instruction (pc);
       /* Recognize store of frame pointer (i7).  */
@@ -533,7 +535,7 @@ examine_prologue (start_pc, frameless_p, fi, saved_regs)
          insn = fetch_instruction (pc);
 
          /* Recognize sub %sp, <anything>, %i7.  */
-         if (X_OP (insn) ==  2
+         if (X_OP (insn) == 2
              && X_OP3 (insn) == 4
              && X_RS1 (insn) == 14
              && X_RD (insn) == 31)
@@ -554,14 +556,14 @@ examine_prologue (start_pc, frameless_p, fi, saved_regs)
   while (1)
     {
       /* Recognize stores into the frame from the input registers.
-        This recognizes all non alternate stores of input register,
-        into a location offset from the frame pointer.  */
+         This recognizes all non alternate stores of input register,
+         into a location offset from the frame pointer.  */
       if ((X_OP (insn) == 3
-          && (X_OP3 (insn) & 0x3c) == 4 /* Store, non-alternate.  */
-          && (X_RD (insn) & 0x18) == 0x18 /* Input register.  */
-          && X_I (insn)                /* Immediate mode.  */
+          && (X_OP3 (insn) & 0x3c) == 4        /* Store, non-alternate.  */
+          && (X_RD (insn) & 0x18) == 0x18      /* Input register.  */
+          && X_I (insn)        /* Immediate mode.  */
           && X_RS1 (insn) == 30        /* Off of frame pointer.  */
-          /* Into reserved stack space.  */
+      /* Into reserved stack space.  */
           && X_SIMM13 (insn) >= 0x44
           && X_SIMM13 (insn) < 0x5b))
        ;
@@ -569,7 +571,7 @@ examine_prologue (start_pc, frameless_p, fi, saved_regs)
               && X_OP (insn) == 3
               && X_OP3 (insn) == 4
               && X_RS1 (insn) == 14
-              )
+       )
        {
          if (saved_regs && X_I (insn))
            saved_regs->regs[X_RD (insn)] =
@@ -584,7 +586,7 @@ examine_prologue (start_pc, frameless_p, fi, saved_regs)
   return pc;
 }
 
-CORE_ADDR 
+CORE_ADDR
 sparc_skip_prologue (start_pc, frameless_p)
      CORE_ADDR start_pc;
      int frameless_p;
@@ -617,7 +619,7 @@ isbranch (instruction, addr, target)
 #ifndef GDB_TARGET_IS_SPARC64
          || X_OP2 (instruction) == 7
 #endif
-         ))
+      ))
     {
       if (X_COND (instruction) == 8)
        val = X_A (instruction) ? baa : ba;
@@ -697,13 +699,13 @@ sparc_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
     {
       /* error ("No selected frame."); */
       if (!target_has_registers)
-        error ("The program has no registers now.");
-      if (selected_frame == NULL) 
-        error ("No selected frame.");
+       error ("The program has no registers now.");
+      if (selected_frame == NULL)
+       error ("No selected frame.");
       /* Try to use selected frame */
-      frame = get_prev_frame (selected_frame);  
+      frame = get_prev_frame (selected_frame);
       if (frame == 0)
-        error ("Cmd not meaningful in the outermost frame."); 
+       error ("Cmd not meaningful in the outermost frame.");
     }
 
 
@@ -903,25 +905,25 @@ sparc_push_dummy_frame ()
       write_fp (old_sp);
 
       /* Set return address register for the call dummy to the current PC.  */
-      write_register (I7_REGNUM, read_pc() - 8);
+      write_register (I7_REGNUM, read_pc () - 8);
     }
   else
     {
       /* The call dummy will write this value to FP before executing
          the 'save'.  This ensures that register window flushes work
-        correctly in the simulator.  */
-      write_register (G0_REGNUM+1, read_register (FP_REGNUM));
-    
+         correctly in the simulator.  */
+      write_register (G0_REGNUM + 1, read_register (FP_REGNUM));
+
       /* The call dummy will write this value to FP after executing
          the 'save'. */
-      write_register (G0_REGNUM+2, old_sp);
-    
+      write_register (G0_REGNUM + 2, old_sp);
+
       /* The call dummy will write this value to the return address (%i7) after
-        executing the 'save'. */
-      write_register (G0_REGNUM+3, read_pc() - 8);
-    
+         executing the 'save'. */
+      write_register (G0_REGNUM + 3, read_pc () - 8);
+
       /* Set the FP that the call dummy will be using after the 'save'.
-        This makes backtraces from an inferior function call work properly.  */
+         This makes backtraces from an inferior function call work properly.  */
       write_register (FP_REGNUM, old_sp);
     }
 }
@@ -977,44 +979,44 @@ sparc_frame_find_saved_regs (fi, saved_regs_addr)
   memset (saved_regs_addr, 0, sizeof (*saved_regs_addr));
 
   if (fi->pc >= (fi->bottom ? fi->bottom :
-                  read_sp ())
-      && fi->pc <= FRAME_FP(fi))
+                read_sp ())
+      && fi->pc <= FRAME_FP (fi))
     {
       /* Dummy frame.  All but the window regs are in there somewhere. */
-      for (regnum = G1_REGNUM; regnum < G1_REGNUM+7; regnum++)
+      for (regnum = G1_REGNUM; regnum < G1_REGNUM + 7; regnum++)
        saved_regs_addr->regs[regnum] =
          frame_addr + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
-           - DUMMY_STACK_REG_BUF_SIZE + 16 * SPARC_INTREG_SIZE;
-      for (regnum = I0_REGNUM; regnum < I0_REGNUM+8; regnum++)
+         - DUMMY_STACK_REG_BUF_SIZE + 16 * SPARC_INTREG_SIZE;
+      for (regnum = I0_REGNUM; regnum < I0_REGNUM + 8; regnum++)
        saved_regs_addr->regs[regnum] =
          frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
-           - DUMMY_STACK_REG_BUF_SIZE + 8 * SPARC_INTREG_SIZE;
+         - DUMMY_STACK_REG_BUF_SIZE + 8 * SPARC_INTREG_SIZE;
 #ifdef FP0_REGNUM
       for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 32; regnum++)
        saved_regs_addr->regs[regnum] =
          frame_addr + (regnum - FP0_REGNUM) * 4
-           - DUMMY_STACK_REG_BUF_SIZE + 24 * SPARC_INTREG_SIZE;
+         - DUMMY_STACK_REG_BUF_SIZE + 24 * SPARC_INTREG_SIZE;
 #ifdef GDB_TARGET_IS_SPARC64
       for (regnum = FP0_REGNUM + 32; regnum < FP_MAX_REGNUM; regnum++)
        saved_regs_addr->regs[regnum] =
          frame_addr + 32 * 4 + (regnum - FP0_REGNUM - 32) * 4
-           - DUMMY_STACK_REG_BUF_SIZE + 24 * SPARC_INTREG_SIZE;
+         - DUMMY_STACK_REG_BUF_SIZE + 24 * SPARC_INTREG_SIZE;
 #endif
 #endif /* FP0_REGNUM */
 #ifdef GDB_TARGET_IS_SPARC64
       for (regnum = PC_REGNUM; regnum < PC_REGNUM + 7; regnum++)
        {
          saved_regs_addr->regs[regnum] =
-           frame_addr + (regnum - PC_REGNUM) * SPARC_INTREG_SIZE 
-             - DUMMY_STACK_REG_BUF_SIZE;
+           frame_addr + (regnum - PC_REGNUM) * SPARC_INTREG_SIZE
+           - DUMMY_STACK_REG_BUF_SIZE;
        }
-      saved_regs_addr->regs[PSTATE_REGNUM] = 
+      saved_regs_addr->regs[PSTATE_REGNUM] =
        frame_addr + 8 * SPARC_INTREG_SIZE - DUMMY_STACK_REG_BUF_SIZE;
 #else
       for (regnum = Y_REGNUM; regnum < NUM_REGS; regnum++)
        saved_regs_addr->regs[regnum] =
-         frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE 
-           - DUMMY_STACK_REG_BUF_SIZE;
+         frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+         - DUMMY_STACK_REG_BUF_SIZE;
 #endif
       frame_addr = fi->bottom ?
        fi->bottom : read_sp ();
@@ -1034,11 +1036,11 @@ sparc_frame_find_saved_regs (fi, saved_regs_addr)
       /* Normal frame.  Just Local and In registers */
       frame_addr = fi->bottom ?
        fi->bottom : read_sp ();
-      for (regnum = L0_REGNUM; regnum < L0_REGNUM+8; regnum++)
+      for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; regnum++)
        saved_regs_addr->regs[regnum] =
          (frame_addr + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
           + FRAME_SAVED_L0);
-      for (regnum = I0_REGNUM; regnum < I0_REGNUM+8; regnum++)
+      for (regnum = I0_REGNUM; regnum < I0_REGNUM + 8; regnum++)
        saved_regs_addr->regs[regnum] =
          (frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
           + FRAME_SAVED_I0);
@@ -1053,10 +1055,10 @@ sparc_frame_find_saved_regs (fi, saved_regs_addr)
        {
          /* Pull off either the next frame pointer or the stack pointer */
          CORE_ADDR next_next_frame_addr =
-           (fi->next->bottom ?
-            fi->next->bottom :
-            read_sp ());
-         for (regnum = O0_REGNUM; regnum < O0_REGNUM+8; regnum++)
+         (fi->next->bottom ?
+          fi->next->bottom :
+          read_sp ());
+         for (regnum = O0_REGNUM; regnum < O0_REGNUM + 8; regnum++)
            saved_regs_addr->regs[regnum] =
              (next_next_frame_addr
               + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
@@ -1122,7 +1124,7 @@ sparc_pop_frame ()
   if (frame->flat)
     {
       /* Each register might or might not have been saved, need to test
-        individually.  */
+         individually.  */
       for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; ++regnum)
        if (fsr.regs[regnum])
          write_register (regnum, read_memory_integer (fsr.regs[regnum],
@@ -1153,10 +1155,10 @@ sparc_pop_frame ()
       read_memory (fsr.regs[I0_REGNUM], raw_buffer, 8 * SPARC_INTREG_SIZE);
 
       /* Get the ins and locals which we are about to restore.  Just
-        moving the stack pointer is all that is really needed, except
-        store_inferior_registers is then going to write the ins and
-        locals from the registers array, so we need to muck with the
-        registers array.  */
+         moving the stack pointer is all that is really needed, except
+         store_inferior_registers is then going to write the ins and
+         locals from the registers array, so we need to muck with the
+         registers array.  */
       sp = fsr.regs[SP_REGNUM];
 #ifdef GDB_TARGET_IS_SPARC64
       if (sp & 1)
@@ -1165,7 +1167,7 @@ sparc_pop_frame ()
       read_memory (sp, reg_temp, SPARC_INTREG_SIZE * 16);
 
       /* Restore the out registers.
-        Among other things this writes the new stack pointer.  */
+         Among other things this writes the new stack pointer.  */
       write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer,
                            SPARC_INTREG_SIZE * 8);
 
@@ -1182,11 +1184,11 @@ sparc_pop_frame ()
     {
       /* Explicitly specified PC (and maybe NPC) -- just restore them. */
       write_register (PC_REGNUM, read_memory_integer (fsr.regs[PC_REGNUM],
-                                                     REGISTER_RAW_SIZE (PC_REGNUM)));
+                                           REGISTER_RAW_SIZE (PC_REGNUM)));
       if (fsr.regs[NPC_REGNUM])
        write_register (NPC_REGNUM,
                        read_memory_integer (fsr.regs[NPC_REGNUM],
-                                            REGISTER_RAW_SIZE (NPC_REGNUM)));
+                                          REGISTER_RAW_SIZE (NPC_REGNUM)));
     }
   else if (frame->flat)
     {
@@ -1205,7 +1207,7 @@ sparc_pop_frame ()
                          (buf, REGISTER_RAW_SIZE (O7_REGNUM)));
        }
 
-      write_register (PC_REGNUM,  pc);
+      write_register (PC_REGNUM, pc);
       write_register (NPC_REGNUM, pc + 4);
     }
   else if (fsr.regs[I7_REGNUM])
@@ -1213,7 +1215,7 @@ sparc_pop_frame ()
       /* Return address in %i7 -- adjust it, then restore PC and NPC from it */
       pc = PC_ADJUST ((CORE_ADDR) read_memory_integer (fsr.regs[I7_REGNUM],
                                                       SPARC_INTREG_SIZE));
-      write_register (PC_REGNUM,  pc);
+      write_register (PC_REGNUM, pc);
       write_register (NPC_REGNUM, pc + 4);
     }
   flush_cached_frames ();
@@ -1224,7 +1226,7 @@ sparc_pop_frame ()
    a fake insn, step past it.  */
 
 CORE_ADDR
-sparc_pc_adjust(pc)
+sparc_pc_adjust (pc)
      CORE_ADDR pc;
 {
   unsigned long insn;
@@ -1234,17 +1236,17 @@ sparc_pc_adjust(pc)
   err = target_read_memory (pc + 8, buf, 4);
   insn = extract_unsigned_integer (buf, 4);
   if ((err == 0) && (insn & 0xffc00000) == 0)
-    return pc+12;
+    return pc + 12;
   else
-    return pc+8;
+    return pc + 8;
 }
 
 /* If pc is in a shared library trampoline, return its target.
    The SunOs 4.x linker rewrites the jump table entries for PIC
    compiled modules in the main executable to bypass the dynamic linker
    with jumps of the form
-       sethi %hi(addr),%g1
-       jmp %g1+%lo(addr)
+   sethi %hi(addr),%g1
+   jmp %g1+%lo(addr)
    and removes the corresponding jump table relocation entry in the
    dynamic relocations.
    find_solib_trampoline_target relies on the presence of the jump
@@ -1281,8 +1283,7 @@ sunos4_skip_trampoline_code (pc)
   return find_solib_trampoline_target (pc);
 }
 \f
-#ifdef USE_PROC_FS     /* Target dependent support for /proc */
-
+#ifdef USE_PROC_FS             /* Target dependent support for /proc */
 /* *INDENT-OFF* */
 /*  The /proc interface divides the target machine's register set up into
     two different sets, the general register set (gregset) and the floating
@@ -1321,20 +1322,23 @@ sunos4_skip_trampoline_code (pc)
  */
 /* *INDENT-ON* */
 
+
+
 /* 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 (gregsetp)
-prgregset_t *gregsetp;
+     prgregset_t *gregsetp;
 {
   register int regi;
   register prgreg_t *regp = (prgreg_t *) gregsetp;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  {0};
 
   /* GDB register numbers for Gn, On, Ln, In all match /proc reg numbers.  */
-  for (regi = G0_REGNUM ; regi <= I7_REGNUM ; regi++)
+  for (regi = G0_REGNUM; regi <= I7_REGNUM; regi++)
     {
       supply_register (regi, (char *) (regp + regi));
     }
@@ -1342,8 +1346,8 @@ prgregset_t *gregsetp;
   /* These require a bit more care.  */
   supply_register (PS_REGNUM, (char *) (regp + R_PS));
   supply_register (PC_REGNUM, (char *) (regp + R_PC));
-  supply_register (NPC_REGNUM,(char *) (regp + R_nPC));
-  supply_register (Y_REGNUM,  (char *) (regp + R_Y));
+  supply_register (NPC_REGNUM, (char *) (regp + R_nPC));
+  supply_register (Y_REGNUM, (char *) (regp + R_Y));
 
   /* Fill inaccessible registers with zero.  */
   supply_register (WIM_REGNUM, zerobuf);
@@ -1353,13 +1357,13 @@ prgregset_t *gregsetp;
 
 void
 fill_gregset (gregsetp, regno)
-prgregset_t *gregsetp;
-int regno;
+     prgregset_t *gregsetp;
+     int regno;
 {
   int regi;
   register prgreg_t *regp = (prgreg_t *) gregsetp;
 
-  for (regi = 0 ; regi <= R_I7 ; regi++)
+  for (regi = 0; regi <= R_I7; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
@@ -1387,45 +1391,45 @@ int regno;
 #if defined (FP0_REGNUM)
 
 /*  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. */
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
 
-void 
+void
 supply_fpregset (fpregsetp)
-prfpregset_t *fpregsetp;
+     prfpregset_t *fpregsetp;
 {
   register int regi;
   char *from;
-  
-  for (regi = FP0_REGNUM ; regi < FP_MAX_REGNUM ; regi++)
+
+  for (regi = FP0_REGNUM; regi < FP_MAX_REGNUM; regi++)
     {
-      from = (char *) &fpregsetp->pr_fr.pr_regs[regi-FP0_REGNUM];
+      from = (char *) &fpregsetp->pr_fr.pr_regs[regi - FP0_REGNUM];
       supply_register (regi, from);
     }
   supply_register (FPS_REGNUM, (char *) &(fpregsetp->pr_fsr));
 }
 
 /*  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. */
+   (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. */
 /* ??? This will probably need some changes for sparc64.  */
 
 void
 fill_fpregset (fpregsetp, regno)
-prfpregset_t *fpregsetp;
-int regno;
+     prfpregset_t *fpregsetp;
+     int regno;
 {
   int regi;
   char *to;
   char *from;
 
-  for (regi = FP0_REGNUM ; regi < FP_MAX_REGNUM ; regi++)
+  for (regi = FP0_REGNUM; regi < FP_MAX_REGNUM; regi++)
     {
       if ((regno == -1) || (regno == regi))
        {
          from = (char *) &registers[REGISTER_BYTE (regi)];
-         to = (char *) &fpregsetp->pr_fr.pr_regs[regi-FP0_REGNUM];
+         to = (char *) &fpregsetp->pr_fr.pr_regs[regi - FP0_REGNUM];
          memcpy (to, from, REGISTER_RAW_SIZE (regi));
        }
     }
@@ -1435,9 +1439,9 @@ int regno;
     }
 }
 
-#endif /* defined (FP0_REGNUM) */
+#endif /* defined (FP0_REGNUM) */
 
-#endif  /* USE_PROC_FS */
+#endif /* USE_PROC_FS */
 
 
 #ifdef GET_LONGJMP_TARGET
@@ -1480,12 +1484,12 @@ sunpro_static_transform_name (name)
   if (name[0] == '$')
     {
       /* For file-local statics there will be a dollar sign, a bunch
-        of junk (the contents of which match a string given in the
-        N_OPT), a period and the name.  For function-local statics
-        there will be a bunch of junk (which seems to change the
-        second character from 'A' to 'B'), a period, the name of the
-        function, and the name.  So just skip everything before the
-        last period.  */
+         of junk (the contents of which match a string given in the
+         N_OPT), a period and the name.  For function-local statics
+         there will be a bunch of junk (which seems to change the
+         second character from 'A' to 'B'), a period, the name of the
+         function, and the name.  So just skip everything before the
+         last period.  */
       p = strrchr (name, '.');
       if (p != NULL)
        name = p + 1;
@@ -1507,11 +1511,11 @@ dump_ccreg (reg, val)
 {
   /* page 41 */
   printf_unfiltered ("%s:%s,%s,%s,%s", reg,
-         val & 8 ? "N" : "NN",
-         val & 4 ? "Z" : "NZ",
-         val & 2 ? "O" : "NO",
-         val & 1 ? "C" : "NC"
-  );
+                    val & 8 ? "N" : "NN",
+                    val & 4 ? "Z" : "NZ",
+                    val & 2 ? "O" : "NO",
+                    val & 1 ? "C" : "NC"
+    );
 }
 
 static char *
@@ -1521,21 +1525,36 @@ decode_asi (val)
   /* page 72 */
   switch (val)
     {
-    case 4 : return "ASI_NUCLEUS";
-    case 0x0c : return "ASI_NUCLEUS_LITTLE";
-    case 0x10 : return "ASI_AS_IF_USER_PRIMARY";
-    case 0x11 : return "ASI_AS_IF_USER_SECONDARY";
-    case 0x18 : return "ASI_AS_IF_USER_PRIMARY_LITTLE";
-    case 0x19 : return "ASI_AS_IF_USER_SECONDARY_LITTLE";
-    case 0x80 : return "ASI_PRIMARY";
-    case 0x81 : return "ASI_SECONDARY";
-    case 0x82 : return "ASI_PRIMARY_NOFAULT";
-    case 0x83 : return "ASI_SECONDARY_NOFAULT";
-    case 0x88 : return "ASI_PRIMARY_LITTLE";
-    case 0x89 : return "ASI_SECONDARY_LITTLE";
-    case 0x8a : return "ASI_PRIMARY_NOFAULT_LITTLE";
-    case 0x8b : return "ASI_SECONDARY_NOFAULT_LITTLE";
-    default : return NULL;
+    case 4:
+      return "ASI_NUCLEUS";
+    case 0x0c:
+      return "ASI_NUCLEUS_LITTLE";
+    case 0x10:
+      return "ASI_AS_IF_USER_PRIMARY";
+    case 0x11:
+      return "ASI_AS_IF_USER_SECONDARY";
+    case 0x18:
+      return "ASI_AS_IF_USER_PRIMARY_LITTLE";
+    case 0x19:
+      return "ASI_AS_IF_USER_SECONDARY_LITTLE";
+    case 0x80:
+      return "ASI_PRIMARY";
+    case 0x81:
+      return "ASI_SECONDARY";
+    case 0x82:
+      return "ASI_PRIMARY_NOFAULT";
+    case 0x83:
+      return "ASI_SECONDARY_NOFAULT";
+    case 0x88:
+      return "ASI_PRIMARY_LITTLE";
+    case 0x89:
+      return "ASI_SECONDARY_LITTLE";
+    case 0x8a:
+      return "ASI_PRIMARY_NOFAULT_LITTLE";
+    case 0x8b:
+      return "ASI_SECONDARY_NOFAULT_LITTLE";
+    default:
+      return NULL;
     }
 }
 
@@ -1561,7 +1580,7 @@ sparc_print_register_hook (regno)
          printf_unfiltered ("\t");
          print_floating (value, builtin_type_double, gdb_stdout);
        }
-#if 0 /* FIXME: gdb doesn't handle long doubles */
+#if 0                          /* FIXME: gdb doesn't handle long doubles */
       if ((regno & 3) == 0)
        {
          if (!read_relative_register_raw_bytes (regno + 2, value + 8)
@@ -1575,11 +1594,11 @@ sparc_print_register_hook (regno)
       return;
     }
 
-#if 0 /* FIXME: gdb doesn't handle long doubles */
+#if 0                          /* FIXME: gdb doesn't handle long doubles */
   /* Print upper fp regs as long double if appropriate.  */
   if (regno >= FP0_REGNUM + 32 && regno < FP_MAX_REGNUM
-      /* We test for even numbered regs and not a multiple of 4 because
-        the upper fp regs are recorded as doubles.  */
+  /* We test for even numbered regs and not a multiple of 4 because
+     the upper fp regs are recorded as doubles.  */
       && (regno & 1) == 0)
     {
       char value[16];
@@ -1605,20 +1624,22 @@ sparc_print_register_hook (regno)
   switch (regno)
     {
 #ifdef GDB_TARGET_IS_SPARC64
-    case CCR_REGNUM :
-      printf_unfiltered("\t");
+    case CCR_REGNUM:
+      printf_unfiltered ("\t");
       dump_ccreg ("xcc", val >> 4);
-      printf_unfiltered(", ");
+      printf_unfiltered (", ");
       dump_ccreg ("icc", val & 15);
       break;
-    case FPRS_REGNUM :
+    case FPRS_REGNUM:
       printf ("\tfef:%d, du:%d, dl:%d",
              BITS (2, 1), BITS (1, 1), BITS (0, 1));
       break;
-    case FSR_REGNUM :
+    case FSR_REGNUM:
       {
-       static char *fcc[4] = { "=", "<", ">", "?" };
-       static char *rd[4] = { "N", "0", "+", "-" };
+       static char *fcc[4] =
+       {"=", "<", ">", "?"};
+       static char *rd[4] =
+       {"N", "0", "+", "-"};
        /* Long, yes, but I'd rather leave it as is and use a wide screen.  */
        printf ("\t0:%s, 1:%s, 2:%s, 3:%s, rd:%s, tem:%d, ns:%d, ver:%d, ftt:%d, qne:%d, aexc:%d, cexc:%d",
                fcc[BITS (10, 3)], fcc[BITS (32, 3)],
@@ -1627,55 +1648,56 @@ sparc_print_register_hook (regno)
                BITS (14, 7), BITS (13, 1), BITS (5, 31), BITS (0, 31));
        break;
       }
-    case ASI_REGNUM :
+    case ASI_REGNUM:
       {
        char *asi = decode_asi (val);
        if (asi != NULL)
          printf ("\t%s", asi);
        break;
       }
-    case VER_REGNUM :
+    case VER_REGNUM:
       printf ("\tmanuf:%d, impl:%d, mask:%d, maxtl:%d, maxwin:%d",
              BITS (48, 0xffff), BITS (32, 0xffff),
              BITS (24, 0xff), BITS (8, 0xff), BITS (0, 31));
       break;
-    case PSTATE_REGNUM :
+    case PSTATE_REGNUM:
       {
-       static char *mm[4] = { "tso", "pso", "rso", "?" };
+       static char *mm[4] =
+       {"tso", "pso", "rso", "?"};
        printf ("\tcle:%d, tle:%d, mm:%s, red:%d, pef:%d, am:%d, priv:%d, ie:%d, ag:%d",
                BITS (9, 1), BITS (8, 1), mm[BITS (6, 3)], BITS (5, 1),
                BITS (4, 1), BITS (3, 1), BITS (2, 1), BITS (1, 1),
                BITS (0, 1));
        break;
       }
-    case TSTATE_REGNUM :
+    case TSTATE_REGNUM:
       /* FIXME: print all 4? */
       break;
-    case TT_REGNUM :
+    case TT_REGNUM:
       /* FIXME: print all 4? */
       break;
-    case TPC_REGNUM :
+    case TPC_REGNUM:
       /* FIXME: print all 4? */
       break;
-    case TNPC_REGNUM :
+    case TNPC_REGNUM:
       /* FIXME: print all 4? */
       break;
-    case WSTATE_REGNUM :
+    case WSTATE_REGNUM:
       printf ("\tother:%d, normal:%d", BITS (3, 7), BITS (0, 7));
       break;
-    case CWP_REGNUM :
+    case CWP_REGNUM:
       printf ("\t%d", BITS (0, 31));
       break;
-    case CANSAVE_REGNUM :
+    case CANSAVE_REGNUM:
       printf ("\t%-2d before spill", BITS (0, 31));
       break;
-    case CANRESTORE_REGNUM :
+    case CANRESTORE_REGNUM:
       printf ("\t%-2d before fill", BITS (0, 31));
       break;
-    case CLEANWIN_REGNUM :
+    case CLEANWIN_REGNUM:
       printf ("\t%-2d before clean", BITS (0, 31));
       break;
-    case OTHERWIN_REGNUM :
+    case OTHERWIN_REGNUM:
       printf ("\t%d", BITS (0, 31));
       break;
 #else
@@ -1688,8 +1710,10 @@ sparc_print_register_hook (regno)
       break;
     case FPS_REGNUM:
       {
-       static char *fcc[4] = { "=", "<", ">", "?" };
-       static char *rd[4] = { "N", "0", "+", "-" };
+       static char *fcc[4] =
+       {"=", "<", ">", "?"};
+       static char *rd[4] =
+       {"N", "0", "+", "-"};
        /* Long, yes, but I'd rather leave it as is and use a wide screen.  */
        printf ("\trd:%s, tem:%d, ns:%d, ver:%d, ftt:%d, qne:%d, "
                "fcc:%s, aexc:%d, cexc:%d",
@@ -1699,7 +1723,7 @@ sparc_print_register_hook (regno)
        break;
       }
 
-#endif /* GDB_TARGET_IS_SPARC64 */
+#endif /* GDB_TARGET_IS_SPARC64 */
     }
 
 #undef BITS
@@ -1735,7 +1759,7 @@ sparc_push_arguments (nargs, args, sp, struct_return, struct_addr)
       int offset;
     };
   struct sparc_arg *sparc_args =
-      (struct sparc_arg*)alloca (nargs * sizeof (struct sparc_arg));
+  (struct sparc_arg *) alloca (nargs * sizeof (struct sparc_arg));
   struct sparc_arg *m_arg;
 
   /* Promote arguments if necessary, and calculate their stack offsets
@@ -1764,7 +1788,7 @@ sparc_push_arguments (nargs, args, sp, struct_return, struct_addr)
       m_arg->len = TYPE_LENGTH (arg_type);
       m_arg->offset = accumulate_size;
       accumulate_size = (accumulate_size + m_arg->len + 3) & ~3;
-      m_arg->contents = VALUE_CONTENTS(arg);
+      m_arg->contents = VALUE_CONTENTS (arg);
     }
 
   /* Make room for the arguments on the stack.  */
@@ -1772,8 +1796,8 @@ sparc_push_arguments (nargs, args, sp, struct_return, struct_addr)
   sp = ((sp - accumulate_size) & ~7) + CALL_DUMMY_STACK_ADJUST;
 
   /* `Push' arguments on the stack.  */
-  for (i = nargs; m_arg--, --i >= 0; )
-    write_memory(sp + m_arg->offset, m_arg->contents, m_arg->len);
+  for (i = nargs; m_arg--, --i >= 0;)
+    write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len);
 
   return sp;
 }
@@ -1793,13 +1817,13 @@ sparc_extract_return_value (type, regbuf, valbuf)
   int regsize = REGISTER_RAW_SIZE (O0_REGNUM);
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
-    memcpy (valbuf, &regbuf [REGISTER_BYTE (FP0_REGNUM)], typelen);
+    memcpy (valbuf, &regbuf[REGISTER_BYTE (FP0_REGNUM)], typelen);
   else
     memcpy (valbuf,
-           &regbuf [O0_REGNUM * regsize +
-                    (typelen >= regsize
-                     || TARGET_BYTE_ORDER == LITTLE_ENDIAN ? 0
-                        : regsize - typelen)],
+           &regbuf[O0_REGNUM * regsize +
+                   (typelen >= regsize
+                    || TARGET_BYTE_ORDER == LITTLE_ENDIAN ? 0
+                    : regsize - typelen)],
            typelen);
 }
 
@@ -1826,13 +1850,13 @@ sparc_store_return_value (type, valbuf)
     regno = O0_REGNUM;
 
   /* Add leading zeros to the value. */
-  if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE(regno))
+  if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (regno))
     {
-      bzero (buffer, REGISTER_RAW_SIZE(regno));
-      memcpy (buffer + REGISTER_RAW_SIZE(regno) - TYPE_LENGTH (type), valbuf,
+      bzero (buffer, REGISTER_RAW_SIZE (regno));
+      memcpy (buffer + REGISTER_RAW_SIZE (regno) - TYPE_LENGTH (type), valbuf,
              TYPE_LENGTH (type));
-      write_register_bytes (REGISTER_BYTE (regno), buffer, 
-                           REGISTER_RAW_SIZE(regno));
+      write_register_bytes (REGISTER_BYTE (regno), buffer,
+                           REGISTER_RAW_SIZE (regno));
     }
   else
     write_register_bytes (REGISTER_BYTE (regno), valbuf, TYPE_LENGTH (type));
@@ -1863,7 +1887,7 @@ sparc_fix_call_dummy (dummy, pc, fun, value_type, using_gcc)
   store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET, 4,
                          (0x40000000
                           | (((fun - (pc + CALL_DUMMY_CALL_OFFSET)) >> 2)
-                              & 0x3fffffff)));
+                             & 0x3fffffff)));
 
   /* Comply with strange Sun cc calling convention for struct-returning
      functions.  */
@@ -1891,12 +1915,12 @@ sparc_fix_call_dummy (dummy, pc, fun, value_type, using_gcc)
     {
       for (i = 0; i < CALL_DUMMY_LENGTH; i += 4)
        {
-         char tmp = dummy [i];
-         dummy [i] = dummy [i+3];
-         dummy [i+3] = tmp;
-         tmp = dummy [i+1];
-         dummy [i+1] = dummy [i+2];
-         dummy [i+2] = tmp;
+         char tmp = dummy[i];
+         dummy[i] = dummy[i + 3];
+         dummy[i + 3] = tmp;
+         tmp = dummy[i + 1];
+         dummy[i + 1] = dummy[i + 2];
+         dummy[i + 2] = tmp;
        }
     }
 }
@@ -1926,13 +1950,13 @@ sparc_target_architecture_hook (ap)
     bi_endian = 0;
   return 1;
 }
-
 \f
+
 void
 _initialize_sparc_tdep ()
 {
   tm_print_insn = gdb_print_insn_sparc;
-  tm_print_insn_info.mach = TM_PRINT_INSN_MACH;  /* Selects sparc/sparclite */
+  tm_print_insn_info.mach = TM_PRINT_INSN_MACH;                /* Selects sparc/sparclite */
   target_architecture_hook = sparc_target_architecture_hook;
 }
 
@@ -1997,8 +2021,8 @@ sp64_push_arguments (nargs, args, sp, struct_return, struct_retaddr)
   int x;
   int regnum = 0;
   CORE_ADDR tempsp;
-  
-  sp = (sp & ~(((unsigned long)TYPE_LENGTH (builtin_type_long)) - 1UL));
+
+  sp = (sp & ~(((unsigned long) TYPE_LENGTH (builtin_type_long)) - 1UL));
 
   /* Figure out how much space we'll need. */
   for (x = nargs - 1; x >= 0; x--)
@@ -2010,9 +2034,9 @@ sp64_push_arguments (nargs, args, sp, struct_return, struct_retaddr)
       /* This code is, of course, no longer correct. */
       if (copylen < TYPE_LENGTH (builtin_type_long))
        {
-         copyarg = value_cast(builtin_type_long, copyarg);
-          copylen = TYPE_LENGTH (builtin_type_long);
-        }
+         copyarg = value_cast (builtin_type_long, copyarg);
+         copylen = TYPE_LENGTH (builtin_type_long);
+       }
       sp -= copylen;
     }
 
@@ -2031,9 +2055,9 @@ sp64_push_arguments (nargs, args, sp, struct_return, struct_retaddr)
       /* This code is, of course, no longer correct. */
       if (copylen < TYPE_LENGTH (builtin_type_long))
        {
-         copyarg = value_cast(builtin_type_long, copyarg);
-          copylen = TYPE_LENGTH (builtin_type_long);
-        }
+         copyarg = value_cast (builtin_type_long, copyarg);
+         copylen = TYPE_LENGTH (builtin_type_long);
+       }
       write_memory (tempsp, VALUE_CONTENTS (copyarg), copylen);
       tempsp += copylen;
       if (TYPE_CODE (VALUE_TYPE (args[x])) == TYPE_CODE_FLT && regnum < 32)
@@ -2072,7 +2096,7 @@ sparc64_extract_return_value (type, regbuf, valbuf, bitoffset)
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
     {
-      memcpy (valbuf, &regbuf [REGISTER_BYTE (FP0_REGNUM)], typelen);
+      memcpy (valbuf, &regbuf[REGISTER_BYTE (FP0_REGNUM)], typelen);
       return;
     }
 
@@ -2080,7 +2104,7 @@ sparc64_extract_return_value (type, regbuf, valbuf, bitoffset)
       || (TYPE_LENGTH (type) > 32))
     {
       memcpy (valbuf,
-             &regbuf [O0_REGNUM * regsize +
+             &regbuf[O0_REGNUM * regsize +
                      (typelen >= regsize ? 0 : regsize - typelen)],
              typelen);
       return;
@@ -2093,7 +2117,7 @@ sparc64_extract_return_value (type, regbuf, valbuf, bitoffset)
 
       for (x = 0; x < TYPE_NFIELDS (type); x++)
        {
-         struct field *f = &TYPE_FIELDS(type)[x];
+         struct field *f = &TYPE_FIELDS (type)[x];
          /* FIXME: We may need to handle static fields here. */
          int whichreg = (f->loc.bitpos + bitoffset) / 32;
          int remainder = ((f->loc.bitpos + bitoffset) % 32) / 8;
index e39bf306ec9e7d274a8d81eabaf92c4d607084f8..7e5457d81f7efd47c026ba926dcfea5171d2f8fc 100644 (file)
@@ -1,21 +1,22 @@
 /* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger.
    Copyright 1994, 1995, 1996  Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -33,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <netdb.h>
 #endif
 
-extern struct target_ops sparclite_ops;        /* Forward decl */
+extern struct target_ops sparclite_ops;                /* Forward decl */
 extern struct target_ops remote_ops;
 
 static char *remote_target_name = NULL;
@@ -53,20 +54,20 @@ static int send_udp_buf PARAMS ((int fd, unsigned char *buf, int len));
 static void sparclite_open PARAMS ((char *name, int from_tty));
 static void sparclite_close PARAMS ((int quitting));
 static void download PARAMS ((char *target_name, char *args, int from_tty,
-                             void (*write_routine) (bfd *from_bfd,
-                                                    asection *from_sec,
+                             void (*write_routine) (bfd * from_bfd,
+                                                    asection * from_sec,
                                                     file_ptr from_addr,
-                                                    bfd_vma to_addr, int len),
+                                                 bfd_vma to_addr, int len),
                              void (*start_routine) (bfd_vma entry)));
 static void sparclite_serial_start PARAMS ((bfd_vma entry));
-static void sparclite_serial_write PARAMS ((bfd *from_bfd, asection *from_sec,
+static void sparclite_serial_write PARAMS ((bfd * from_bfd, asection * from_sec,
                                            file_ptr from_addr,
                                            bfd_vma to_addr, int len));
 #ifdef HAVE_SOCKETS
 static unsigned short calc_checksum PARAMS ((unsigned char *buffer,
                                             int count));
 static void sparclite_udp_start PARAMS ((bfd_vma entry));
-static void sparclite_udp_write PARAMS ((bfd *from_bfd, asection *from_sec,
+static void sparclite_udp_write PARAMS ((bfd * from_bfd, asection * from_sec,
                                         file_ptr from_addr, bfd_vma to_addr,
                                         int len));
 #endif
@@ -76,14 +77,14 @@ static void sparclite_download PARAMS ((char *filename, int from_tty));
 #define DDA1_SUP_ASI           0xb0000
 
 #define DDA2_ASI_MASK          0xff000000
-#define DDA1_ASI_MASK          0xff0000 
+#define DDA1_ASI_MASK          0xff0000
 #define DIA2_SUP_MODE          0x8000
 #define DIA1_SUP_MODE          0x4000
 #define DDA2_ENABLE            0x100
 #define DDA1_ENABLE            0x80
 #define DIA2_ENABLE            0x40
 #define DIA1_ENABLE            0x20
-#define DSINGLE_STEP           0x10            /* not used */
+#define DSINGLE_STEP           0x10    /* not used */
 #define DDV_TYPE_MASK          0xc
 #define DDV_TYPE_LOAD          0x0
 #define DDV_TYPE_STORE                 0x4
@@ -112,7 +113,7 @@ sparclite_insert_watchpoint (addr, len, type)
          write_register (DDV1_REGNUM, 0);
          write_register (DDV2_REGNUM, 0xffffffff);
          dcr |= (DDV_TYPE_LOAD & (~DDV_COND & ~DDV_MASK));
-       }   
+       }
       else if (type == 0)
        {
          write_register (DDV1_REGNUM, 0);
@@ -156,7 +157,7 @@ sparclite_insert_watchpoint (addr, len, type)
     return -1;
 
   return 0;
-} 
+}
 
 int
 sparclite_remove_watchpoint (addr, len, type)
@@ -188,7 +189,7 @@ sparclite_insert_hw_breakpoint (addr, len)
   CORE_ADDR dcr;
 
   dcr = read_register (DCR_REGNUM);
-  
+
   if (!(dcr & DIA1_ENABLE))
     {
       write_register (DIA1_REGNUM, addr);
@@ -215,7 +216,7 @@ sparclite_remove_hw_breakpoint (addr, shadow)
   dcr = read_register (DCR_REGNUM);
   dia1 = read_register (DIA1_REGNUM);
   dia2 = read_register (DIA2_REGNUM);
-  
+
   if ((dcr & DIA1_ENABLE) && addr == dia1)
     write_register (DCR_REGNUM, (dcr & ~DIA1_ENABLE));
   else if ((dcr & DIA2_ENABLE) && addr == dia2)
@@ -456,7 +457,8 @@ sparclite_open (name, from_tty)
   if (p)
     {
       *p++ = '\000';
-      while ((*p != '\000') && isspace (*p)) p++;
+      while ((*p != '\000') && isspace (*p))
+       p++;
 
       if (strncmp (name, "serial", strlen (name)) == 0)
        serial_flag = 1;
@@ -513,17 +515,17 @@ or: target sparclite udp host");
       old_chain = make_cleanup (close, udp_fd);
 
       sockaddr.sin_family = PF_INET;
-      sockaddr.sin_port = htons(7000);
+      sockaddr.sin_port = htons (7000);
       memcpy (&sockaddr.sin_addr.s_addr, he->h_addr, sizeof (struct in_addr));
 
-      if (connect (udp_fd, &sockaddr, sizeof(sockaddr)))
+      if (connect (udp_fd, &sockaddr, sizeof (sockaddr)))
        perror_with_name ("Connect failed");
 
       buffer[0] = 0x5;
       buffer[1] = 0;
 
-      send_udp_buf (udp_fd, buffer, 2);        /* Request version */
-      cc = recv_udp_buf (udp_fd, buffer, sizeof(buffer), 5); /* Get response */
+      send_udp_buf (udp_fd, buffer, 2);                /* Request version */
+      cc = recv_udp_buf (udp_fd, buffer, sizeof (buffer), 5);  /* Get response */
       if (cc == 0)
        error ("SPARClite isn't responding.");
 
@@ -550,9 +552,8 @@ sparclite_close (quitting)
   if (serial_flag)
     close_tty (0);
 #ifdef HAVE_SOCKETS
-  else
-    if (udp_fd != -1)
-      close (udp_fd);
+  else if (udp_fd != -1)
+    close (udp_fd);
 #endif
 }
 
@@ -563,8 +564,8 @@ download (target_name, args, from_tty, write_routine, start_routine)
      char *target_name;
      char *args;
      int from_tty;
-     void (*write_routine) PARAMS ((bfd *from_bfd, asection *from_sec,
-                                   file_ptr from_addr, bfd_vma to_addr, int len));
+     void (*write_routine) PARAMS ((bfd * from_bfd, asection * from_sec,
+                            file_ptr from_addr, bfd_vma to_addr, int len));
      void (*start_routine) PARAMS ((bfd_vma entry));
 {
   struct cleanup *old_chain;
@@ -585,11 +586,13 @@ download (target_name, args, from_tty, write_routine, start_routine)
     {
       char *arg;
 
-      while (isspace (*args)) args++;
+      while (isspace (*args))
+       args++;
 
       arg = args;
 
-      while ((*args != '\000') && !isspace (*args)) args++;
+      while ((*args != '\000') && !isspace (*args))
+       args++;
 
       if (*args != '\000')
        *args++ = '\000';
@@ -615,20 +618,20 @@ download (target_name, args, from_tty, write_routine, start_routine)
     }
   old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
 
-  if (!bfd_check_format (pbfd, bfd_object)) 
+  if (!bfd_check_format (pbfd, bfd_object))
     error ("\"%s\" is not an object file: %s", filename,
           bfd_errmsg (bfd_get_error ()));
 
-  for (section = pbfd->sections; section; section = section->next) 
+  for (section = pbfd->sections; section; section = section->next)
     {
       if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
        {
-         bfd_vma       section_address;
+         bfd_vma section_address;
          bfd_size_type section_size;
-         file_ptr      fptr;
-         const char   *section_name;
+         file_ptr fptr;
+         const char *section_name;
 
-         section_name = bfd_get_section_name(pbfd, section);
+         section_name = bfd_get_section_name (pbfd, section);
 
          section_address = bfd_get_section_vma (pbfd, section);
 
@@ -644,10 +647,11 @@ download (target_name, args, from_tty, write_routine, start_routine)
                     There should be the string 'DaTa' followed by
                     a word containing the actual section address. */
                  struct data_marker
-                 {
-                   char signature[4];  /* 'DaTa' */
-                   unsigned char sdata[4];     /* &sdata */
-                 } marker;
+                   {
+                     char signature[4];        /* 'DaTa' */
+                     unsigned char sdata[4];   /* &sdata */
+                   }
+                 marker;
                  bfd_get_section_contents (pbfd, section, &marker, 0,
                                            sizeof (marker));
                  if (strncmp (marker.signature, "DaTa", 4) == 0)
@@ -731,12 +735,12 @@ sparclite_serial_write (from_bfd, from_sec, from_addr, to_addr, len)
      bfd_vma to_addr;
      int len;
 {
-  char buffer[4 + 4 + WRITESIZE]; /* addr + len + data */
+  char buffer[4 + 4 + WRITESIZE];      /* addr + len + data */
   unsigned char checksum;
   int i;
 
-  store_unsigned_integer (buffer, 4, to_addr); /* Address */
-  store_unsigned_integer (buffer + 4, 4, len); /* Length */
+  store_unsigned_integer (buffer, 4, to_addr); /* Address */
+  store_unsigned_integer (buffer + 4, 4, len); /* Length */
 
   bfd_get_section_contents (from_bfd, from_sec, buffer + 8, from_addr, len);
 
@@ -789,8 +793,8 @@ sparclite_udp_start (entry)
   buffer[4] = entry >> 8;
   buffer[5] = entry;
 
-  send_udp_buf (udp_fd, buffer, 6); /* Send start addr */
-  i = recv_udp_buf (udp_fd, buffer, sizeof(buffer), -1); /* Get response */
+  send_udp_buf (udp_fd, buffer, 6);    /* Send start addr */
+  i = recv_udp_buf (udp_fd, buffer, sizeof (buffer), -1);      /* Get response */
 
   if (i < 1 || buffer[0] != 0x55)
     error ("Failed to take start address.");
@@ -891,41 +895,41 @@ sparclite_download (filename, from_tty)
 \f
 /* Define the target subroutine names */
 
-static struct target_ops sparclite_ops ;
+static struct target_ops sparclite_ops;
 
-static void 
-init_sparclite_ops(void)
+static void
+init_sparclite_ops (void)
 {
-  sparclite_ops.to_shortname =   "sparclite";          
-  sparclite_ops.to_longname =   "SPARClite remote target";
-  sparclite_ops.to_doc =   "Use a remote SPARClite target board via a serial line; using a gdb-specific protocol.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya).";  
-  sparclite_ops.to_open =   sparclite_open;    
-  sparclite_ops.to_close =   sparclite_close;  
-  sparclite_ops.to_attach =   0;       
+  sparclite_ops.to_shortname = "sparclite";
+  sparclite_ops.to_longname = "SPARClite remote target";
+  sparclite_ops.to_doc = "Use a remote SPARClite target board via a serial line; using a gdb-specific protocol.\n\
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  sparclite_ops.to_open = sparclite_open;
+  sparclite_ops.to_close = sparclite_close;
+  sparclite_ops.to_attach = 0;
   sparclite_ops.to_post_attach = NULL;
   sparclite_ops.to_require_attach = NULL;
-  sparclite_ops.to_detach =   0;
-  sparclite_ops.to_require_detach = NULL;      
-  sparclite_ops.to_resume =   0;       
-  sparclite_ops.to_wait  =   0;
-  sparclite_ops.to_post_wait = NULL;           
-  sparclite_ops.to_fetch_registers  =   0;
-  sparclite_ops.to_store_registers  =   0;
-  sparclite_ops.to_prepare_to_store =   0;
-  sparclite_ops.to_xfer_memory  =   0;         
-  sparclite_ops.to_files_info  =   0;          
-  sparclite_ops.to_insert_breakpoint =   0;    
-  sparclite_ops.to_remove_breakpoint =   0;    
-  sparclite_ops.to_terminal_init  =   0;       
-  sparclite_ops.to_terminal_inferior =   0;    
-  sparclite_ops.to_terminal_ours_for_output =   0;
-  sparclite_ops.to_terminal_ours  =   0;               
-  sparclite_ops.to_terminal_info  =   0;               
-  sparclite_ops.to_kill  =   0;                        
-  sparclite_ops.to_load  =   sparclite_download;
-  sparclite_ops.to_lookup_symbol =   0;                
-  sparclite_ops.to_create_inferior =   0;
+  sparclite_ops.to_detach = 0;
+  sparclite_ops.to_require_detach = NULL;
+  sparclite_ops.to_resume = 0;
+  sparclite_ops.to_wait = 0;
+  sparclite_ops.to_post_wait = NULL;
+  sparclite_ops.to_fetch_registers = 0;
+  sparclite_ops.to_store_registers = 0;
+  sparclite_ops.to_prepare_to_store = 0;
+  sparclite_ops.to_xfer_memory = 0;
+  sparclite_ops.to_files_info = 0;
+  sparclite_ops.to_insert_breakpoint = 0;
+  sparclite_ops.to_remove_breakpoint = 0;
+  sparclite_ops.to_terminal_init = 0;
+  sparclite_ops.to_terminal_inferior = 0;
+  sparclite_ops.to_terminal_ours_for_output = 0;
+  sparclite_ops.to_terminal_ours = 0;
+  sparclite_ops.to_terminal_info = 0;
+  sparclite_ops.to_kill = 0;
+  sparclite_ops.to_load = sparclite_download;
+  sparclite_ops.to_lookup_symbol = 0;
+  sparclite_ops.to_create_inferior = 0;
   sparclite_ops.to_post_startup_inferior = NULL;
   sparclite_ops.to_acknowledge_created_inferior = NULL;
   sparclite_ops.to_clone_and_follow_inferior = NULL;
@@ -937,34 +941,34 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
   sparclite_ops.to_has_forked = NULL;
   sparclite_ops.to_has_vforked = NULL;
   sparclite_ops.to_can_follow_vfork_prior_to_exec = NULL;
-  sparclite_ops.to_post_follow_vfork = NULL;   
+  sparclite_ops.to_post_follow_vfork = NULL;
   sparclite_ops.to_insert_exec_catchpoint = NULL;
   sparclite_ops.to_remove_exec_catchpoint = NULL;
   sparclite_ops.to_has_execd = NULL;
   sparclite_ops.to_reported_exec_events_per_exec_call = NULL;
   sparclite_ops.to_has_exited = NULL;
-  sparclite_ops.to_mourn_inferior =   0;       
-  sparclite_ops.to_can_run  =   0;             
-  sparclite_ops.to_notice_signals =   0;       
-  sparclite_ops.to_thread_alive  =   0;                
-  sparclite_ops.to_stop  =   0;
-  sparclite_ops.to_pid_to_exec_file = NULL;    
-  sparclite_ops.to_core_file_to_sym_file = NULL;               
-  sparclite_ops.to_stratum =   download_stratum;
-  sparclite_ops.DONT_USE =   0;                        
-  sparclite_ops.to_has_all_memory =   0;       
-  sparclite_ops.to_has_memory =   0;           
-  sparclite_ops.to_has_stack =   0;            
-  sparclite_ops.to_has_registers =   0;                
-  sparclite_ops.to_has_execution =   0;                
-  sparclite_ops.to_sections =   0;             
-  sparclite_ops.to_sections_end =   0;         
-  sparclite_ops.to_magic =   OPS_MAGIC ;       
-} /* init_sparclite_ops */
+  sparclite_ops.to_mourn_inferior = 0;
+  sparclite_ops.to_can_run = 0;
+  sparclite_ops.to_notice_signals = 0;
+  sparclite_ops.to_thread_alive = 0;
+  sparclite_ops.to_stop = 0;
+  sparclite_ops.to_pid_to_exec_file = NULL;
+  sparclite_ops.to_core_file_to_sym_file = NULL;
+  sparclite_ops.to_stratum = download_stratum;
+  sparclite_ops.DONT_USE = 0;
+  sparclite_ops.to_has_all_memory = 0;
+  sparclite_ops.to_has_memory = 0;
+  sparclite_ops.to_has_stack = 0;
+  sparclite_ops.to_has_registers = 0;
+  sparclite_ops.to_has_execution = 0;
+  sparclite_ops.to_sections = 0;
+  sparclite_ops.to_sections_end = 0;
+  sparclite_ops.to_magic = OPS_MAGIC;
+}                              /* init_sparclite_ops */
 
 void
 _initialize_sparcl_tdep ()
 {
-  init_sparclite_ops() ;
+  init_sparclite_ops ();
   add_target (&sparclite_ops);
 }
index 992cca1ab51cd8f294a2ac1cd93fd6e49f580219..bb11c97255255163db0294d1da00a593dd4b5f09 100644 (file)
@@ -1,21 +1,22 @@
 /* Remote target glue for the SPARC Sparclet ROM monitor.
    Copyright 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
@@ -25,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "serial.h"
 #include "srec.h"
 #include "symtab.h"
-#include "symfile.h" /* for generic_load */
+#include "symfile.h"           /* for generic_load */
 #include <time.h>
 
 extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t));
@@ -40,22 +41,22 @@ static void sparclet_open PARAMS ((char *args, int from_tty));
    either. So, typing "info reg sp" becomes a "r30".  */
 
 /*PSR 0x00000080  impl ver icc AW LE EE EC EF PIL S PS ET CWP  WIM
-                0x0  0x0 0x0  0  0  0  0  0 0x0 1  0  0 0x00 0x2
-                                                             0000010
-       INS        LOCALS       OUTS      GLOBALS
- 0  0x00000000  0x00000000  0x00000000  0x00000000
- 1  0x00000000  0x00000000  0x00000000  0x00000000
- 2  0x00000000  0x00000000  0x00000000  0x00000000
- 3  0x00000000  0x00000000  0x00000000  0x00000000
- 4  0x00000000  0x00000000  0x00000000  0x00000000
- 5  0x00000000  0x00001000  0x00000000  0x00000000
- 6  0x00000000  0x00000000  0x123f0000  0x00000000
- 7  0x00000000  0x00000000  0x00000000  0x00000000
-pc:  0x12010000 0x00000000    unimp
-npc: 0x12010004 0x00001000    unimp     0x1000
-tbr: 0x00000000
-y:   0x00000000
-*/
+   0x0  0x0 0x0  0  0  0  0  0 0x0 1  0  0 0x00 0x2
+   0000010
+   INS        LOCALS       OUTS      GLOBALS
  0  0x00000000  0x00000000  0x00000000  0x00000000
  1  0x00000000  0x00000000  0x00000000  0x00000000
  2  0x00000000  0x00000000  0x00000000  0x00000000
  3  0x00000000  0x00000000  0x00000000  0x00000000
  4  0x00000000  0x00000000  0x00000000  0x00000000
  5  0x00000000  0x00001000  0x00000000  0x00000000
  6  0x00000000  0x00000000  0x123f0000  0x00000000
  7  0x00000000  0x00000000  0x00000000  0x00000000
+   pc:  0x12010000 0x00000000    unimp
+   npc: 0x12010004 0x00001000    unimp     0x1000
+   tbr: 0x00000000
+   y:   0x00000000
+ */
 /* these correspond to the offsets from tm-* files from config directories */
 
 /* is wim part of psr?? */
@@ -95,8 +96,8 @@ sparclet_load (desc, file, hashmark)
 
   /* enable user to specify address for downloading as 2nd arg to load */
 
-  i = sscanf(file, "%*s 0x%lx", &load_offset);
-  if (i >= 1 ) 
+  i = sscanf (file, "%*s 0x%lx", &load_offset);
+  if (i >= 1)
     {
       char *p;
 
@@ -119,7 +120,7 @@ sparclet_load (desc, file, hashmark)
       printf_filtered ("File is not an object file\n");
       return;
     }
-  
+
   start_time = time (NULL);
 
   for (s = abfd->sections; s; s = s->next)
@@ -175,7 +176,7 @@ sparclet_load (desc, file, hashmark)
 
   end_time = time (NULL);
 
-  if (hashmark) 
+  if (hashmark)
     putchar_unfiltered ('\n');
 
   report_transfer_performance (data_count, start_time, end_time);
@@ -192,70 +193,71 @@ sparclet_load (desc, file, hashmark)
 
 /* need to pause the monitor for timing reasons, so slow it down */
 
-static char *sparclet_inits[] = {"\n\r\r\n", NULL};
+static char *sparclet_inits[] =
+{"\n\r\r\n", NULL};
 
-static struct monitor_ops sparclet_cmds ;
+static struct monitor_ops sparclet_cmds;
 
-static void 
-init_sparclet_cmds(void)
+static void
+init_sparclet_cmds (void)
 {
-  sparclet_cmds.flags =   MO_CLR_BREAK_USES_ADDR |
-    MO_HEX_PREFIX          |
-    MO_NO_ECHO_ON_OPEN     |
-    MO_NO_ECHO_ON_SETMEM   |
-    MO_RUN_FIRST_TIME      |
-    MO_GETMEM_READ_SINGLE ;    /* flags */
-  sparclet_cmds.init =   sparclet_inits;               /* Init strings */
-  sparclet_cmds.cont =   "cont\r";                     /* continue command */
-  sparclet_cmds.step =   "step\r";                     /* single step */
-  sparclet_cmds.stop =   "\r";                         /* break interrupts the program */
-  sparclet_cmds.set_break =   "+bp %x\r";              /* set a breakpoint */
-  sparclet_cmds.clr_break =  "-bp %x\r" ;              /* can't use "br" because only 2 hw bps are supported */
-  sparclet_cmds.clr_all_break =   "-bp %x\r";          /* clear a breakpoint */
-  "-bp\r" ;                    /* clear all breakpoints */
-  sparclet_cmds.fill =   "fill %x -n %x -v %x -b\r";   /* fill (start length val) */
+  sparclet_cmds.flags = MO_CLR_BREAK_USES_ADDR |
+    MO_HEX_PREFIX |
+    MO_NO_ECHO_ON_OPEN |
+    MO_NO_ECHO_ON_SETMEM |
+    MO_RUN_FIRST_TIME |
+    MO_GETMEM_READ_SINGLE    /* flags */
+  sparclet_cmds.init = sparclet_inits; /* Init strings */
+  sparclet_cmds.cont = "cont\r";       /* continue command */
+  sparclet_cmds.step = "step\r";       /* single step */
+  sparclet_cmds.stop = "\r";   /* break interrupts the program */
+  sparclet_cmds.set_break = "+bp %x\r";                /* set a breakpoint */
+  sparclet_cmds.clr_break = "-bp %x\r";                /* can't use "br" because only 2 hw bps are supported */
+  sparclet_cmds.clr_all_break = "-bp %x\r";    /* clear a breakpoint */
+  "-bp\r"                    /* clear all breakpoints */
+  sparclet_cmds.fill = "fill %x -n %x -v %x -b\r";     /* fill (start length val) */
   /* can't use "fi" because it takes words, not bytes */
   /* ex [addr] [-n count] [-b|-s|-l]          default: ex cur -n 1 -b */
-  sparclet_cmds.setmem.cmdb =     "ex %x -b\r%x\rq\r"; /* setmem.cmdb (addr, value) */
-  sparclet_cmds.setmem.cmdw =     "ex %x -s\r%x\rq\r"; /* setmem.cmdw (addr, value) */
-  sparclet_cmds.setmem.cmdl =     "ex %x -l\r%x\rq\r";  /* setmem.cmdl (addr, value) */
-  sparclet_cmds.setmem.cmdll =     NULL;               /* setmem.cmdll (addr, value) */
-  sparclet_cmds.setmem.resp_delim =     NULL; /*": " */        /* setmem.resp_delim */
-  sparclet_cmds.setmem.term =     NULL; /*"? " */      /* setmem.term */
-  sparclet_cmds.setmem.term_cmd =     NULL; /*"q\r" */ /* setmem.term_cmd */
+  sparclet_cmds.setmem.cmdb = "ex %x -b\r%x\rq\r";     /* setmem.cmdb (addr, value) */
+  sparclet_cmds.setmem.cmdw = "ex %x -s\r%x\rq\r";     /* setmem.cmdw (addr, value) */
+  sparclet_cmds.setmem.cmdl = "ex %x -l\r%x\rq\r";     /* setmem.cmdl (addr, value) */
+  sparclet_cmds.setmem.cmdll = NULL;   /* setmem.cmdll (addr, value) */
+  sparclet_cmds.setmem.resp_delim = NULL;      /*": " *//* setmem.resp_delim */
+  sparclet_cmds.setmem.term = NULL;    /*"? " *//* setmem.term */
+  sparclet_cmds.setmem.term_cmd = NULL;                /*"q\r" *//* setmem.term_cmd */
   /* since the parsing of multiple bytes is difficult due to
      interspersed addresses, we'll only read 1 value at a time,
      even tho these can handle a count */
   /* we can use -n to set count to read, but may have to parse? */
-  sparclet_cmds.getmem.cmdb =     "ex %x -n 1 -b\r";   /* getmem.cmdb (addr, #bytes) */
-  sparclet_cmds.getmem.cmdw =     "ex %x -n 1 -s\r";   /* getmem.cmdw (addr, #swords) */
-  sparclet_cmds.getmem.cmdl =     "ex %x -n 1 -l\r";   /* getmem.cmdl (addr, #words) */
-  sparclet_cmds.getmem.cmdll =     NULL;               /* getmem.cmdll (addr, #dwords) */
-  sparclet_cmds.getmem.resp_delim =     ": ";          /* getmem.resp_delim */
-  sparclet_cmds.getmem.term =     NULL;                        /* getmem.term */
-  sparclet_cmds.getmem.term_cmd =     NULL;            /* getmem.term_cmd */
-  sparclet_cmds.setreg.cmd =     "reg %s 0x%x\r";      /* setreg.cmd (name, value) */
-  sparclet_cmds.setreg.resp_delim =     NULL;          /* setreg.resp_delim */
-  sparclet_cmds.setreg.term =     NULL;                        /* setreg.term */
-  sparclet_cmds.setreg.term_cmd =  NULL ;              /* setreg.term_cmd */
-  sparclet_cmds.getreg.cmd =     "reg %s\r";           /* getreg.cmd (name) */
-  sparclet_cmds.getreg.resp_delim =     " ";           /* getreg.resp_delim */
-  sparclet_cmds.getreg.term =     NULL;                        /* getreg.term */
-  sparclet_cmds.getreg.term_cmd =     NULL;            /* getreg.term_cmd */
-  sparclet_cmds.dump_registers =   "reg\r";            /* dump_registers */
-  sparclet_cmds.register_pattern =   "\\(\\w+\\)=\\([0-9a-fA-F]+\\)";  /* register_pattern */
-  sparclet_cmds.supply_register =   sparclet_supply_register;  /* supply_register */
-  sparclet_cmds.load_routine =   sparclet_load;                /* load_routine */
-  sparclet_cmds.load =   NULL;                         /* download command (srecs on console) */
-  sparclet_cmds.loadresp =   NULL;                     /* load response */
-  sparclet_cmds.prompt =   "monitor>";                 /* monitor command prompt */
+  sparclet_cmds.getmem.cmdb = "ex %x -n 1 -b\r";       /* getmem.cmdb (addr, #bytes) */
+  sparclet_cmds.getmem.cmdw = "ex %x -n 1 -s\r";       /* getmem.cmdw (addr, #swords) */
+  sparclet_cmds.getmem.cmdl = "ex %x -n 1 -l\r";       /* getmem.cmdl (addr, #words) */
+  sparclet_cmds.getmem.cmdll = NULL;   /* getmem.cmdll (addr, #dwords) */
+  sparclet_cmds.getmem.resp_delim = ": ";      /* getmem.resp_delim */
+  sparclet_cmds.getmem.term = NULL;    /* getmem.term */
+  sparclet_cmds.getmem.term_cmd = NULL;                /* getmem.term_cmd */
+  sparclet_cmds.setreg.cmd = "reg %s 0x%x\r";  /* setreg.cmd (name, value) */
+  sparclet_cmds.setreg.resp_delim = NULL;      /* setreg.resp_delim */
+  sparclet_cmds.setreg.term = NULL;    /* setreg.term */
+  sparclet_cmds.setreg.term_cmd = NULL;                /* setreg.term_cmd */
+  sparclet_cmds.getreg.cmd = "reg %s\r";       /* getreg.cmd (name) */
+  sparclet_cmds.getreg.resp_delim = " ";       /* getreg.resp_delim */
+  sparclet_cmds.getreg.term = NULL;    /* getreg.term */
+  sparclet_cmds.getreg.term_cmd = NULL;                /* getreg.term_cmd */
+  sparclet_cmds.dump_registers = "reg\r";      /* dump_registers */
+  sparclet_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)";    /* register_pattern */
+  sparclet_cmds.supply_register = sparclet_supply_register;    /* supply_register */
+  sparclet_cmds.load_routine = sparclet_load;  /* load_routine */
+  sparclet_cmds.load = NULL;   /* download command (srecs on console) */
+  sparclet_cmds.loadresp = NULL;       /* load response */
+  sparclet_cmds.prompt = "monitor>";   /* monitor command prompt */
   /* yikes!  gdb core dumps without this delimitor!! */
-  sparclet_cmds.line_term =   "\r";                    /* end-of-command delimitor */
-  sparclet_cmds.cmd_end =   NULL;                      /* optional command terminator */
-  sparclet_cmds.target =   &sparclet_ops;              /* target operations */
-  sparclet_cmds.stopbits =   SERIAL_1_STOPBITS;                /* number of stop bits */
-  sparclet_cmds.regnames =   sparclet_regnames;                /* registers names */
-  sparclet_cmds.magic =   MONITOR_OPS_MAGIC ;  /* magic */
+  sparclet_cmds.line_term = "\r";      /* end-of-command delimitor */
+  sparclet_cmds.cmd_end = NULL;        /* optional command terminator */
+  sparclet_cmds.target = &sparclet_ops;                /* target operations */
+  sparclet_cmds.stopbits = SERIAL_1_STOPBITS;  /* number of stop bits */
+  sparclet_cmds.regnames = sparclet_regnames;  /* registers names */
+  sparclet_cmds.magic = MONITOR_OPS_MAGIC;     /* magic */
 };
 
 static void
@@ -270,27 +272,26 @@ void
 _initialize_sparclet ()
 {
   int i;
-  init_sparclet_cmds() ;
+  init_sparclet_cmds ();
 
   for (i = 0; i < NUM_REGS; i++)
     if (sparclet_regnames[i][0] == 'c' ||
        sparclet_regnames[i][0] == 'a')
-      sparclet_regnames[i] = 0;                /* mon can't report c* or a* regs */
+      sparclet_regnames[i] = 0;        /* mon can't report c* or a* regs */
 
-  sparclet_regnames[0] = 0;            /* mon won't report %G0 */
+  sparclet_regnames[0] = 0;    /* mon won't report %G0 */
 
   init_monitor_ops (&sparclet_ops);
-  sparclet_ops.to_shortname = "sparclet"; /* for the target command */
+  sparclet_ops.to_shortname = "sparclet";      /* for the target command */
   sparclet_ops.to_longname = "SPARC Sparclet monitor";
   /* use SW breaks; target only supports 2 HW breakpoints */
-  sparclet_ops.to_insert_breakpoint = memory_insert_breakpoint; 
-  sparclet_ops.to_remove_breakpoint = memory_remove_breakpoint; 
+  sparclet_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  sparclet_ops.to_remove_breakpoint = memory_remove_breakpoint;
 
-  sparclet_ops.to_doc = 
+  sparclet_ops.to_doc =
     "Use a board running the Sparclet debug monitor.\n\
 Specify the serial device it is connected to (e.g. /dev/ttya).";
 
   sparclet_ops.to_open = sparclet_open;
   add_target (&sparclet_ops);
 }
-
index 8253e03095636401b21e0866b8734111da47b3b6..ac18e9f7ffe6daa0a71cfab3d42a6d8f4bb931bc 100644 (file)
@@ -1,25 +1,26 @@
 /* S-record download support for GDB, the GNU debugger.
    Copyright 1995, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 void load_srec PARAMS ((serial_t desc, const char *file, bfd_vma load_offset,
                        int maxrecsize, int flags, int hashmark,
-                       int (*waitack)(void)));
+                       int (*waitack) (void)));
 
 /* S-record capability flags */
 
@@ -33,4 +34,4 @@ void load_srec PARAMS ((serial_t desc, const char *file, bfd_vma load_offset,
                  | ((SREC_2_BYTE_ADDR | SREC_3_BYTE_ADDR | SREC_4_BYTE_ADDR) \
                     << SREC_TERM_SHIFT))
 
-#define SREC_BINARY    0x00000040 /* Supports binary form of S-records */
+#define SREC_BINARY    0x00000040      /* Supports binary form of S-records */
index d8139aeb25a19077da041e01755a3e758e646238..ec59cf36bd08f22464cf40f6e0d90bb2210c195b 100644 (file)
@@ -1,22 +1,23 @@
 /* Support routines for decoding "stabs" debugging information format.
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Support routines for reading and decoding debugging information in
    the "stabs" format.  This format is used with many systems that use
@@ -45,7 +46,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <ctype.h>
 
 /* Ask stabsread.h to define the vars it normally declares `extern'.  */
-#define        EXTERN  /**/
+#define        EXTERN
+/**/
 #include "stabsread.h"         /* Our own declarations */
 #undef EXTERN
 
@@ -58,34 +60,36 @@ extern void _initialize_stabsread PARAMS ((void));
    expected to eventually go away... (FIXME) */
 
 struct field_info
-{
-  struct nextfield
-    {
-      struct nextfield *next;
+  {
+    struct nextfield
+      {
+       struct nextfield *next;
 
-      /* This is the raw visibility from the stab.  It is not checked
-        for being one of the visibilities we recognize, so code which
-        examines this field better be able to deal.  */
-      int visibility;
+       /* This is the raw visibility from the stab.  It is not checked
+          for being one of the visibilities we recognize, so code which
+          examines this field better be able to deal.  */
+       int visibility;
 
-      struct field field;
-    } *list;
-  struct next_fnfieldlist
-    {
-      struct next_fnfieldlist *next;
-      struct fn_fieldlist fn_fieldlist;
-    } *fnlist;
-};
+       struct field field;
+      }
+     *list;
+    struct next_fnfieldlist
+      {
+       struct next_fnfieldlist *next;
+       struct fn_fieldlist fn_fieldlist;
+      }
+     *fnlist;
+  };
 
 static void
 read_one_struct_field PARAMS ((struct field_info *, char **, char *,
                               struct type *, struct objfile *));
 
-static char * 
-get_substring PARAMS ((char **, int));
+static char *
+  get_substring PARAMS ((char **, int));
 
 static struct type *
-dbx_alloc_type PARAMS ((int [2], struct objfile *));
+  dbx_alloc_type PARAMS ((int[2], struct objfile *));
 
 static long read_huge_number PARAMS ((char **, int, int *));
 
@@ -102,19 +106,19 @@ static int
 read_type_number PARAMS ((char **, int *));
 
 static struct type *
-read_range_type PARAMS ((char **, int [2], struct objfile *));
+  read_range_type PARAMS ((char **, int[2], struct objfile *));
 
 static struct type *
-read_sun_builtin_type PARAMS ((char **, int [2], struct objfile *));
+  read_sun_builtin_type PARAMS ((char **, int[2], struct objfile *));
 
 static struct type *
-read_sun_floating_type PARAMS ((char **, int [2], struct objfile *));
+  read_sun_floating_type PARAMS ((char **, int[2], struct objfile *));
 
 static struct type *
-read_enum_type PARAMS ((char **, struct type *, struct objfile *));
+  read_enum_type PARAMS ((char **, struct type *, struct objfile *));
 
 static struct type *
-rs6000_builtin_type PARAMS ((int));
+  rs6000_builtin_type PARAMS ((int));
 
 static int
 read_member_functions PARAMS ((struct field_info *, char **, struct type *,
@@ -140,13 +144,13 @@ attach_fields_to_type PARAMS ((struct field_info *, struct type *,
                               struct objfile *));
 
 static struct type *
-read_struct_type PARAMS ((char **, struct type *, struct objfile *));
+  read_struct_type PARAMS ((char **, struct type *, struct objfile *));
 
 static struct type *
-read_array_type PARAMS ((char **, struct type *, struct objfile *));
+  read_array_type PARAMS ((char **, struct type *, struct objfile *));
 
 static struct type **
-read_args PARAMS ((char **, int, struct objfile *));
+  read_args PARAMS ((char **, int, struct objfile *));
 
 static int
 read_cpp_abbrev PARAMS ((struct field_info *, char **, struct type *,
@@ -156,26 +160,26 @@ read_cpp_abbrev PARAMS ((struct field_info *, char **, struct type *,
 
 static int
 copy_cfront_struct_fields PARAMS ((struct field_info *, struct type *,
-                                   struct objfile *));
+                                  struct objfile *));
 
 static char *
-get_cfront_method_physname PARAMS ((char *));
+  get_cfront_method_physname PARAMS ((char *));
 
 static int
-read_cfront_baseclasses PARAMS ((struct field_info *, char **, 
+read_cfront_baseclasses PARAMS ((struct field_info *, char **,
                                 struct type *, struct objfile *));
 
 static int
-read_cfront_static_fields PARAMS ((struct field_info *, char**,
+read_cfront_static_fields PARAMS ((struct field_info *, char **,
                                   struct type *, struct objfile *));
 static int
-read_cfront_member_functions PARAMS ((struct field_info *, char **, 
+read_cfront_member_functions PARAMS ((struct field_info *, char **,
                                      struct type *, struct objfile *));
 
 /* end new functions added for cfront support */
 
 static void
-add_live_range PARAMS ((struct objfile *, struct symbol *, 
+add_live_range PARAMS ((struct objfile *, struct symbol *,
                        CORE_ADDR, CORE_ADDR));
 
 static int
@@ -185,13 +189,15 @@ static int
 process_reference PARAMS ((char **string));
 
 static CORE_ADDR
-ref_search_value PARAMS ((int refnum));
+  ref_search_value PARAMS ((int refnum));
 
 static int
 resolve_symbol_reference PARAMS ((struct objfile *, struct symbol *, char *));
 
-static const char vptr_name[] = { '_','v','p','t','r',CPLUS_MARKER,'\0' };
-static const char vb_name[] =   { '_','v','b',CPLUS_MARKER,'\0' };
+static const char vptr_name[] =
+{'_', 'v', 'p', 't', 'r', CPLUS_MARKER, '\0'};
+static const char vb_name[] =
+{'_', 'v', 'b', CPLUS_MARKER, '\0'};
 
 /* Define this as 1 if a pcc declaration of a char or short argument
    gives the correct address.  Otherwise assume pcc gives the
@@ -206,46 +212,46 @@ static const char vb_name[] =   { '_','v','b',CPLUS_MARKER,'\0' };
 #endif
 
 static struct complaint invalid_cpp_abbrev_complaint =
-  {"invalid C++ abbreviation `%s'", 0, 0};
+{"invalid C++ abbreviation `%s'", 0, 0};
 
 static struct complaint invalid_cpp_type_complaint =
-  {"C++ abbreviated type name unknown at symtab pos %d", 0, 0};
+{"C++ abbreviated type name unknown at symtab pos %d", 0, 0};
 
 static struct complaint member_fn_complaint =
-  {"member function type missing, got '%c'", 0, 0};
+{"member function type missing, got '%c'", 0, 0};
 
 static struct complaint const_vol_complaint =
-  {"const/volatile indicator missing, got '%c'", 0, 0};
+{"const/volatile indicator missing, got '%c'", 0, 0};
 
 static struct complaint error_type_complaint =
-  {"debug info mismatch between compiler and debugger", 0, 0};
+{"debug info mismatch between compiler and debugger", 0, 0};
 
 static struct complaint invalid_member_complaint =
-  {"invalid (minimal) member type data format at symtab pos %d.", 0, 0};
+{"invalid (minimal) member type data format at symtab pos %d.", 0, 0};
 
 static struct complaint range_type_base_complaint =
-  {"base type %d of range type is not defined", 0, 0};
+{"base type %d of range type is not defined", 0, 0};
 
 static struct complaint reg_value_complaint =
-  {"register number %d too large (max %d) in symbol %s", 0, 0};
+{"register number %d too large (max %d) in symbol %s", 0, 0};
 
 static struct complaint vtbl_notfound_complaint =
-  {"virtual function table pointer not found when defining class `%s'", 0, 0};
+{"virtual function table pointer not found when defining class `%s'", 0, 0};
 
 static struct complaint unrecognized_cplus_name_complaint =
-  {"Unknown C++ symbol name `%s'", 0, 0};
+{"Unknown C++ symbol name `%s'", 0, 0};
 
 static struct complaint rs6000_builtin_complaint =
-  {"Unknown builtin type %d", 0, 0};
+{"Unknown builtin type %d", 0, 0};
 
 static struct complaint unresolved_sym_chain_complaint =
-  {"%s: common block `%s' from global_sym_chain unresolved", 0, 0};
+{"%s: common block `%s' from global_sym_chain unresolved", 0, 0};
 
 static struct complaint stabs_general_complaint =
-  {"%s", 0, 0};
+{"%s", 0, 0};
 
 static struct complaint lrs_general_complaint =
-  {"%s", 0, 0};
+{"%s", 0, 0};
 
 /* Make a list of forward references which haven't been defined.  */
 
@@ -263,30 +269,31 @@ static struct symbol *current_symbol = NULL;
 \f
 /* 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 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 PARAMS ((struct type **));
 
 static void
-os9k_init_type_vector(tv)
-    struct type **tv;
+os9k_init_type_vector (tv)
+     struct type **tv;
 {
   int i;
-  for (i=0; i<sizeof(os9k_type_vector)/sizeof(struct type **); 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]));
 }
 
@@ -313,9 +320,10 @@ dbx_lookup_type (typenums)
 
   if (filenum < 0 || filenum >= n_this_object_header_files)
     {
-      static struct complaint msg = {"\
+      static struct complaint msg =
+      {"\
 Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
-                               0, 0};
+       0, 0};
       complain (&msg, filenum, index, symnum);
       goto error_return;
     }
@@ -331,12 +339,12 @@ Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
             this will do the right thing.  */
          static struct type *temp_type;
 
-         temp_type = rs6000_builtin_type(index);
+         temp_type = rs6000_builtin_type (index);
          return &temp_type;
        }
 
       /* Type is defined outside of header files.
-        Find it in this object file's type vector.  */
+         Find it in this object file's type vector.  */
       if (index >= type_vector_length)
        {
          old_len = type_vector_length;
@@ -445,33 +453,33 @@ patch_block_stabs (symbols, stabs, objfile)
 
   if (stabs)
     {
-      
+
       /* for all the stab entries, find their corresponding symbols and 
-        patch their types! */
-      
+         patch their types! */
+
       for (ii = 0; ii < stabs->count; ++ii)
        {
          name = stabs->stab[ii];
-         pp = (char*) strchr (name, ':');
+         pp = (char *) strchr (name, ':');
          while (pp[1] == ':')
            {
-              pp += 2;
-              pp = (char *)strchr(pp, ':');
+             pp += 2;
+             pp = (char *) strchr (pp, ':');
            }
-         sym = find_symbol_in_list (symbols, name, pp-name);
+         sym = find_symbol_in_list (symbols, name, pp - name);
          if (!sym)
            {
              /* FIXME-maybe: it would be nice if we noticed whether
-                the variable was defined *anywhere*, not just whether
-                it is defined in this compilation unit.  But neither
-                xlc or GCC seem to need such a definition, and until
-                we do psymtabs (so that the minimal symbols from all
-                compilation units are available now), I'm not sure
-                how to get the information.  */
+                the variable was defined *anywhere*, not just whether
+                it is defined in this compilation unit.  But neither
+                xlc or GCC seem to need such a definition, and until
+                we do psymtabs (so that the minimal symbols from all
+                compilation units are available now), I'm not sure
+                how to get the information.  */
 
              /* On xcoff, if a global is defined and never referenced,
-                ld will remove it from the executable.  There is then
-                a N_GSYM stab for it, but no regular (C_EXT) symbol.  */
+                ld will remove it from the executable.  There is then
+                a N_GSYM stab for it, but no regular (C_EXT) symbol.  */
              sym = (struct symbol *)
                obstack_alloc (&objfile->symbol_obstack,
                               sizeof (struct symbol));
@@ -482,7 +490,7 @@ patch_block_stabs (symbols, stabs, objfile)
              SYMBOL_NAME (sym) =
                obsavestring (name, pp - name, &objfile->symbol_obstack);
              pp += 2;
-             if (*(pp-1) == 'F' || *(pp-1) == 'f')
+             if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
                {
                  /* I don't think the linker does this with functions,
                     so as far as I know this is never executed.
@@ -499,7 +507,7 @@ patch_block_stabs (symbols, stabs, objfile)
          else
            {
              pp += 2;
-             if (*(pp-1) == 'F' || *(pp-1) == 'f')
+             if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
                {
                  SYMBOL_TYPE (sym) =
                    lookup_function_type (read_type (&pp, objfile));
@@ -512,8 +520,8 @@ patch_block_stabs (symbols, stabs, objfile)
        }
     }
 }
-
 \f
+
 /* Read a number by which a type is referred to in dbx data,
    or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
    Just a single number N is equivalent to (0,N).
@@ -532,20 +540,23 @@ read_type_number (pp, typenums)
     {
       (*pp)++;
       typenums[0] = read_huge_number (pp, ',', &nbits);
-      if (nbits != 0) return -1;
+      if (nbits != 0)
+       return -1;
       typenums[1] = read_huge_number (pp, ')', &nbits);
-      if (nbits != 0) return -1;
+      if (nbits != 0)
+       return -1;
     }
   else
     {
       typenums[0] = 0;
       typenums[1] = read_huge_number (pp, 0, &nbits);
-      if (nbits != 0) return -1;
+      if (nbits != 0)
+       return -1;
     }
   return 0;
 }
-
 \f
+
 #if !defined (REG_STRUCT_HAS_ADDR)
 #define REG_STRUCT_HAS_ADDR(gcc_p,type) 0
 #endif
@@ -563,20 +574,20 @@ read_type_number (pp, typenums)
 /* Get substring from string up to char c, advance string pointer past
    suibstring. */
 
-static char * 
+static char *
 get_substring (p, c)
-  char ** p;
-  int c;
+     char **p;
+     int c;
 {
   char *str;
   str = *p;
   *p = strchr (*p, c);
-  if (*p) 
+  if (*p)
     {
       **p = 0;
       (*p)++;
     }
-  else 
+  else
     str = 0;
   return str;
 }
@@ -586,23 +597,23 @@ get_substring (p, c)
    the physname look like that of g++ - take out the initial mangling
    eg: for sname="a" and fname="foo__1aFPFs_i" return "FPFs_i" */
 
-static char * 
+static char *
 get_cfront_method_physname (fname)
-  char *fname;
+     char *fname;
 {
   int len = 0;
   /* FIXME would like to make this generic for g++ too, but 
      that is already handled in read_member_funcctions */
-  char * p = fname;
+  char *p = fname;
 
   /* search ahead to find the start of the mangled suffix */
-  if (*p == '_' && *(p+1)=='_') /* compiler generated; probably a ctor/dtor */
-    p += 2;            
-  while (p && (unsigned) ((p+1) - fname) < strlen (fname) && *(p+1) != '_')
+  if (*p == '_' && *(p + 1) == '_')    /* compiler generated; probably a ctor/dtor */
+    p += 2;
+  while (p && (unsigned) ((p + 1) - fname) < strlen (fname) && *(p + 1) != '_')
     p = strchr (p, '_');
-  if (!(p && *p == '_' && *(p+1) == '_')) 
-    error ("Invalid mangled function name %s",fname);
-  p += 2; /* advance past '__' */
+  if (!(p && *p == '_' && *(p + 1) == '_'))
+    error ("Invalid mangled function name %s", fname);
+  p += 2;                      /* advance past '__' */
 
   /* struct name length and name of type should come next; advance past it */
   while (isdigit (*p))
@@ -617,27 +628,29 @@ get_cfront_method_physname (fname)
 
 /* Read base classes within cfront class definition.
    eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;;
-             ^^^^^^^^^^^^^^^^^^
+   ^^^^^^^^^^^^^^^^^^
 
-       A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
-             ^
  */
+   A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
+   ^
+ */
 
 static int
-read_cfront_baseclasses (fip, pp, type, objfile) 
-  struct field_info *fip;
-  struct objfile *objfile;
-  char ** pp;
-  struct type *type;
+read_cfront_baseclasses (fip, pp, type, objfile)
+     struct field_info *fip;
+     struct objfile *objfile;
+     char **pp;
+     struct type *type;
 {
-  static struct complaint msg_unknown = {"\
+  static struct complaint msg_unknown =
+  {"\
         Unsupported token in stabs string %s.\n",
-                 0, 0};
-  static struct complaint msg_notfound = {"\
+   0, 0};
+  static struct complaint msg_notfound =
+  {"\
                   Unable to find base type for %s.\n",
-                                0, 0};
+   0, 0};
   int bnum = 0;
-  char * p;
+  char *p;
   int i;
   struct nextfield *new;
 
@@ -653,12 +666,12 @@ read_cfront_baseclasses (fip, pp, type, objfile)
       if (*p == ' ')
        bnum++;
     }
-  bnum++;      /* add one more for last one */
+  bnum++;                      /* add one more for last one */
 
   /* now parse the base classes until we get to the start of the methods 
      (code extracted and munged from read_baseclasses) */
   ALLOCATE_CPLUS_STRUCT_TYPE (type);
-  TYPE_N_BASECLASSES(type) = bnum;
+  TYPE_N_BASECLASSES (type) = bnum;
 
   /* allocate space */
   {
@@ -675,87 +688,88 @@ read_cfront_baseclasses (fip, pp, type, objfile)
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
       make_cleanup (free, new);
       memset (new, 0, sizeof (struct nextfield));
-      new -> next = fip -> list;
-      fip -> list = new;
-      FIELD_BITSIZE (new->field) = 0; /* this should be an unpacked field! */
+      new->next = fip->list;
+      fip->list = new;
+      FIELD_BITSIZE (new->field) = 0;  /* this should be an unpacked field! */
 
       STABS_CONTINUE (pp, objfile);
 
       /* virtual?  eg: v2@Bvir */
-      if (**pp=='v')
-        {
-          SET_TYPE_FIELD_VIRTUAL (type, i);
-          ++(*pp);
+      if (**pp == 'v')
+       {
+         SET_TYPE_FIELD_VIRTUAL (type, i);
+         ++(*pp);
        }
 
       /* access?  eg: 2@Bvir */
-       /* Note: protected inheritance not supported in cfront */
+      /* Note: protected inheritance not supported in cfront */
       switch (*(*pp)++)
-        {
-          case CFRONT_VISIBILITY_PRIVATE:
-            new -> visibility = VISIBILITY_PRIVATE;
-            break;
-          case CFRONT_VISIBILITY_PUBLIC:
-            new -> visibility = VISIBILITY_PUBLIC;
-            break;
-          default:
-            /* Bad visibility format.  Complain and treat it as
-               public.  */
-            {
-              static struct complaint msg = {
-                "Unknown visibility `%c' for baseclass", 0, 0};
-              complain (&msg, new -> visibility);
-              new -> visibility = VISIBILITY_PUBLIC;
-            }
-        }
+       {
+       case CFRONT_VISIBILITY_PRIVATE:
+         new->visibility = VISIBILITY_PRIVATE;
+         break;
+       case CFRONT_VISIBILITY_PUBLIC:
+         new->visibility = VISIBILITY_PUBLIC;
+         break;
+       default:
+         /* Bad visibility format.  Complain and treat it as
+            public.  */
+         {
+           static struct complaint msg =
+           {
+             "Unknown visibility `%c' for baseclass", 0, 0};
+           complain (&msg, new->visibility);
+           new->visibility = VISIBILITY_PUBLIC;
+         }
+       }
 
       /* "@" comes next - eg: @Bvir */
-      if (**pp!='@')
-        {
-          complain (&msg_unknown, *pp);
-          return 1;
+      if (**pp != '@')
+       {
+         complain (&msg_unknown, *pp);
+         return 1;
        }
       ++(*pp);
 
 
-        /* Set the bit offset of the portion of the object corresponding 
-          to this baseclass.  Always zero in the absence of
-           multiple inheritance.  */
-       /* Unable to read bit position from stabs;
-          Assuming no multiple inheritance for now FIXME! */
-       /* We may have read this in the structure definition;
-          now we should fixup the members to be the actual base classes */
-        FIELD_BITPOS (new->field) = 0;
+      /* Set the bit offset of the portion of the object corresponding 
+         to this baseclass.  Always zero in the absence of
+         multiple inheritance.  */
+      /* Unable to read bit position from stabs;
+         Assuming no multiple inheritance for now FIXME! */
+      /* We may have read this in the structure definition;
+         now we should fixup the members to be the actual base classes */
+      FIELD_BITPOS (new->field) = 0;
 
-       /* Get the base class name and type */
+      /* Get the base class name and type */
+      {
+       char *bname;            /* base class name */
+       struct symbol *bsym;    /* base class */
+       char *p1, *p2;
+       p1 = strchr (*pp, ' ');
+       p2 = strchr (*pp, ';');
+       if (p1 < p2)
+         bname = get_substring (pp, ' ');
+       else
+         bname = get_substring (pp, ';');
+       if (!bname || !*bname)
          {
-           char * bname;               /* base class name */
-           struct symbol * bsym;       /* base class */
-           char * p1, * p2;
-           p1 = strchr (*pp,' ');
-           p2 = strchr (*pp,';');
-           if (p1<p2)
-              bname = get_substring (pp,' ');
-           else
-              bname = get_substring (pp,';');
-            if (!bname || !*bname)
-             {
-               complain (&msg_unknown, *pp);
-               return 1;
-             }
-           /* FIXME! attach base info to type */
-           bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name*/
-           if (bsym) 
-             {
-               new -> field.type = SYMBOL_TYPE(bsym);
-               new -> field.name = type_name_no_tag (new -> field.type);
-             }
-           else
-             {
-               complain (&msg_notfound, *pp);
-               return 1;
-             }
+           complain (&msg_unknown, *pp);
+           return 1;
+         }
+       /* FIXME! attach base info to type */
+       bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0);        /*demangled_name */
+       if (bsym)
+         {
+           new->field.type = SYMBOL_TYPE (bsym);
+           new->field.name = type_name_no_tag (new->field.type);
          }
+       else
+         {
+           complain (&msg_notfound, *pp);
+           return 1;
+         }
+      }
 
       /* If more base classes to parse, loop again.
          We ate the last ' ' or ';' in get_substring,
@@ -768,10 +782,10 @@ read_cfront_baseclasses (fip, pp, type, objfile)
 /* read cfront member functions.
    pp points to string starting with list of functions
    eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;;
-                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
-       A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
-              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
-*/
+   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
+   A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
+   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
+ */
 
 static int
 read_cfront_member_functions (fip, pp, type, objfile)
@@ -794,171 +808,173 @@ read_cfront_member_functions (fip, pp, type, objfile)
     {
       struct next_fnfield *next;
       struct fn_field fn_field;
-    } *sublist;
+    }
+   *sublist;
   struct type *look_ahead_type;
   struct next_fnfieldlist *new_fnlist;
   struct next_fnfield *new_sublist;
   char *main_fn_name;
-  char * fname;
-  struct symbol * ref_func = 0;
-      
+  char *fname;
+  struct symbol *ref_func = 0;
+
   /* Process each list until we find the end of the member functions.
      eg: p = "__ct__1AFv foo__1AFv ;;;" */
 
-  STABS_CONTINUE (pp, objfile);                /* handle \\ */
+  STABS_CONTINUE (pp, objfile);        /* handle \\ */
 
-  while (**pp != ';' && (fname = get_substring (pp, ' '), fname)) 
+  while (**pp != ';' && (fname = get_substring (pp, ' '), fname))
     {
       int is_static = 0;
       int sublist_count = 0;
-      char * pname;
-      if (fname[0] == '*')      /* static member */
-        {
-          is_static=1;
-          sublist_count++;
-          fname++;
-        }
-      ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */
-      if (!ref_func) 
-        {
-          static struct complaint msg = {"\
+      char *pname;
+      if (fname[0] == '*')     /* static member */
+       {
+         is_static = 1;
+         sublist_count++;
+         fname++;
+       }
+      ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0);                /* demangled name */
+      if (!ref_func)
+       {
+         static struct complaint msg =
+         {"\
                Unable to find function symbol for %s\n",
-                                0, 0};
+          0, 0};
          complain (&msg, fname);
          continue;
        }
       sublist = NULL;
       look_ahead_type = NULL;
       length = 0;
-          
+
       new_fnlist = (struct next_fnfieldlist *)
-      xmalloc (sizeof (struct next_fnfieldlist));
+       xmalloc (sizeof (struct next_fnfieldlist));
       make_cleanup (free, new_fnlist);
       memset (new_fnlist, 0, sizeof (struct next_fnfieldlist));
-          
+
       /* The following is code to work around cfront generated stabs.
          The stabs contains full mangled name for each field.
          We try to demangle the name and extract the field name out of it.  */
       {
-        char *dem, *dem_p, *dem_args;
-        int dem_len;
-        dem = cplus_demangle (fname, DMGL_ANSI | DMGL_PARAMS);
-        if (dem != NULL)
-          {
-            dem_p = strrchr (dem, ':');
-            if (dem_p != 0 && *(dem_p-1) == ':')
-              dem_p++;
+       char *dem, *dem_p, *dem_args;
+       int dem_len;
+       dem = cplus_demangle (fname, DMGL_ANSI | DMGL_PARAMS);
+       if (dem != NULL)
+         {
+           dem_p = strrchr (dem, ':');
+           if (dem_p != 0 && *(dem_p - 1) == ':')
+             dem_p++;
            /* get rid of args */
-            dem_args = strchr (dem_p, '(');
+           dem_args = strchr (dem_p, '(');
            if (dem_args == NULL)
              dem_len = strlen (dem_p);
            else
-             dem_len = dem_args - dem_p;
-            main_fn_name =
-                   obsavestring (dem_p, dem_len, &objfile -> type_obstack);
-          }
-        else
-          {
-            main_fn_name =
-                   obsavestring (fname, strlen (fname), &objfile -> type_obstack);
-          }
-      } /* end of code for cfront work around */
-
-    new_fnlist -> fn_fieldlist.name = main_fn_name;
-      
-    /*-------------------------------------------------*/
-    /* Set up the sublists
-       Sublists are stuff like args, static, visibility, etc.
-       so in ARM, we have to set that info some other way.
-       Multiple sublists happen if overloading
-       eg: foo::26=##1;:;2A.;
-       In g++, we'd loop here thru all the sublists...  */
-
-    new_sublist =
-       (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield));
-    make_cleanup (free, new_sublist);
-    memset (new_sublist, 0, sizeof (struct next_fnfield));
-         
-    /* eat 1; from :;2A.; */
-    new_sublist -> fn_field.type = SYMBOL_TYPE(ref_func); /* normally takes a read_type */
-    /* Make this type look like a method stub for gdb */
-    TYPE_FLAGS (new_sublist -> fn_field.type) |= TYPE_FLAG_STUB;
-    TYPE_CODE (new_sublist -> fn_field.type) = TYPE_CODE_METHOD;
-
-    /* If this is just a stub, then we don't have the real name here. */
-    if (TYPE_FLAGS (new_sublist -> fn_field.type) & TYPE_FLAG_STUB)
-      {
-        if (!TYPE_DOMAIN_TYPE (new_sublist -> fn_field.type))
-        TYPE_DOMAIN_TYPE (new_sublist -> fn_field.type) = type;
-        new_sublist -> fn_field.is_stub = 1;
-      }
+             dem_len = dem_args - dem_p;
+           main_fn_name =
+             obsavestring (dem_p, dem_len, &objfile->type_obstack);
+         }
+       else
+         {
+           main_fn_name =
+             obsavestring (fname, strlen (fname), &objfile->type_obstack);
+         }
+      }                                /* end of code for cfront work around */
+
+      new_fnlist->fn_fieldlist.name = main_fn_name;
+
+/*-------------------------------------------------*/
+      /* Set up the sublists
+         Sublists are stuff like args, static, visibility, etc.
+         so in ARM, we have to set that info some other way.
+         Multiple sublists happen if overloading
+         eg: foo::26=##1;:;2A.;
+         In g++, we'd loop here thru all the sublists...  */
+
+      new_sublist =
+       (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield));
+      make_cleanup (free, new_sublist);
+      memset (new_sublist, 0, sizeof (struct next_fnfield));
+
+      /* eat 1; from :;2A.; */
+      new_sublist->fn_field.type = SYMBOL_TYPE (ref_func);     /* normally takes a read_type */
+      /* Make this type look like a method stub for gdb */
+      TYPE_FLAGS (new_sublist->fn_field.type) |= TYPE_FLAG_STUB;
+      TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD;
+
+      /* If this is just a stub, then we don't have the real name here. */
+      if (TYPE_FLAGS (new_sublist->fn_field.type) & TYPE_FLAG_STUB)
+       {
+         if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type))
+           TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type;
+         new_sublist->fn_field.is_stub = 1;
+       }
 
-    /* physname used later in mangling; eg PFs_i,5 for foo__1aFPFs_i 
-       physname gets strcat'd in order to recreate the onto mangled name */
-    pname = get_cfront_method_physname (fname);
-    new_sublist -> fn_field.physname = savestring (pname, strlen (pname));
-      
+      /* physname used later in mangling; eg PFs_i,5 for foo__1aFPFs_i 
+         physname gets strcat'd in order to recreate the onto mangled name */
+      pname = get_cfront_method_physname (fname);
+      new_sublist->fn_field.physname = savestring (pname, strlen (pname));
 
-    /* Set this member function's visibility fields. 
-       Unable to distinguish access from stabs definition!
+
+      /* Set this member function's visibility fields. 
+         Unable to distinguish access from stabs definition!
          Assuming public for now.  FIXME!
-        (for private, set new_sublist->fn_field.is_private = 1,
-        for public, set new_sublist->fn_field.is_protected = 1) */
-       
-    /* Unable to distinguish const/volatile from stabs definition!
-       Assuming normal for now.  FIXME! */
-
-    new_sublist -> fn_field.is_const = 0;
-    new_sublist -> fn_field.is_volatile = 0;   /* volatile not implemented in cfront */
-         
-    /* Set virtual/static function info
-       How to get vtable offsets ? 
-       Assuming normal for now FIXME!! 
-       For vtables, figure out from whence this virtual function came.
-       It may belong to virtual function table of
-       one of its baseclasses.
-        set:
-          new_sublist -> fn_field.voffset = vtable offset,
-          new_sublist -> fn_field.fcontext = look_ahead_type;
-          where look_ahead_type is type of baseclass */
-    if (is_static)
-      new_sublist -> fn_field.voffset = VOFFSET_STATIC;
-    else                               /* normal member function.  */
-      new_sublist -> fn_field.voffset = 0;
-    new_sublist -> fn_field.fcontext = 0;
-
-    /* Prepare new sublist */
-    new_sublist -> next = sublist;
-    sublist = new_sublist;
-    length++;
-
-    /* In g++, we loop thu sublists - now we set from functions. */
-    new_fnlist -> fn_fieldlist.fn_fields = (struct fn_field *)
-         obstack_alloc (&objfile -> type_obstack, 
-              sizeof (struct fn_field) * length);
-    memset (new_fnlist -> fn_fieldlist.fn_fields, 0,
-           sizeof (struct fn_field) * length);
-    for (i = length; (i--, sublist); sublist = sublist -> next)
-      {
-        new_fnlist -> fn_fieldlist.fn_fields[i] = sublist -> fn_field;
-      }
-      
-    new_fnlist -> fn_fieldlist.length = length;
-    new_fnlist -> next = fip -> fnlist;
-    fip -> fnlist = new_fnlist;
-    nfn_fields++;
-    total_length += length;
-    STABS_CONTINUE (pp, objfile); /* handle \\ */
-  } /* end of loop */
+         (for private, set new_sublist->fn_field.is_private = 1,
+         for public, set new_sublist->fn_field.is_protected = 1) */
+
+      /* Unable to distinguish const/volatile from stabs definition!
+         Assuming normal for now.  FIXME! */
+
+      new_sublist->fn_field.is_const = 0;
+      new_sublist->fn_field.is_volatile = 0;   /* volatile not implemented in cfront */
+
+      /* Set virtual/static function info
+         How to get vtable offsets ? 
+         Assuming normal for now FIXME!! 
+         For vtables, figure out from whence this virtual function came.
+         It may belong to virtual function table of
+         one of its baseclasses.
+         set:
+         new_sublist -> fn_field.voffset = vtable offset,
+         new_sublist -> fn_field.fcontext = look_ahead_type;
+         where look_ahead_type is type of baseclass */
+      if (is_static)
+       new_sublist->fn_field.voffset = VOFFSET_STATIC;
+      else                     /* normal member function.  */
+       new_sublist->fn_field.voffset = 0;
+      new_sublist->fn_field.fcontext = 0;
+
+
+      /* Prepare new sublist */
+      new_sublist->next = sublist;
+      sublist = new_sublist;
+      length++;
+
+      /* In g++, we loop thu sublists - now we set from functions. */
+      new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
+       obstack_alloc (&objfile->type_obstack,
+                      sizeof (struct fn_field) * length);
+      memset (new_fnlist->fn_fieldlist.fn_fields, 0,
+             sizeof (struct fn_field) * length);
+      for (i = length; (i--, sublist); sublist = sublist->next)
+       {
+         new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
+       }
+
+      new_fnlist->fn_fieldlist.length = length;
+      new_fnlist->next = fip->fnlist;
+      fip->fnlist = new_fnlist;
+      nfn_fields++;
+      total_length += length;
+      STABS_CONTINUE (pp, objfile);    /* handle \\ */
+    }                          /* end of loop */
 
   if (nfn_fields)
     {
       /* type should already have space */
       TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
-      TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields);
+       TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields);
       memset (TYPE_FN_FIELDLISTS (type), 0,
-               sizeof (struct fn_fieldlist) * nfn_fields);
+             sizeof (struct fn_fieldlist) * nfn_fields);
       TYPE_NFN_FIELDS (type) = nfn_fields;
       TYPE_NFN_FIELDS_TOTAL (type) = total_length;
     }
@@ -981,12 +997,12 @@ read_cfront_member_functions (fip, pp, type, objfile)
    Examples of "p": "sA;;__ct__1AFv foo__1AFv ;;;" */
 int
 resolve_cfront_continuation (objfile, sym, p)
-  struct objfile * objfile;
-  struct symbol * sym;
-  char * p;
+     struct objfile *objfile;
+     struct symbol *sym;
+     char *p;
 {
-  struct symbol * ref_sym=0;
-  char * sname;
+  struct symbol *ref_sym = 0;
+  char *sname;
   /* snarfed from read_struct_type */
   struct field_info fi;
   struct type *type;
@@ -995,7 +1011,7 @@ resolve_cfront_continuation (objfile, sym, p)
   /* Need to make sure that fi isn't gunna conflict with struct 
      in case struct already had some fnfs */
   fi.list = NULL;
-  fi.fnlist = NULL;       
+  fi.fnlist = NULL;
   back_to = make_cleanup (null_cleanup, 0);
 
   /* We only accept structs, classes and unions at the moment. 
@@ -1003,23 +1019,23 @@ resolve_cfront_continuation (objfile, sym, p)
      We may want to add support for them as well; 
      right now they are handled by duplicating the symbol information 
      into the type information (see define_symbol) */
-  if (*p != 's'       /* structs */
-    && *p != 'c'      /* class */
-    && *p != 'u')     /* union */
-    return 0;  /* only handle C++ types */
-  p++;  
+  if (*p != 's'                        /* structs */
+      && *p != 'c'             /* class */
+      && *p != 'u')            /* union */
+    return 0;                  /* only handle C++ types */
+  p++;
 
   /* Get symbol typs name and validate 
      eg: p = "A;;__ct__1AFv foo__1AFv ;;;" */
   sname = get_substring (&p, ';');
-  if (!sname || strcmp (sname, SYMBOL_NAME(sym)))
+  if (!sname || strcmp (sname, SYMBOL_NAME (sym)))
     error ("Internal error: base symbol type name does not match\n");
 
   /* Find symbol's internal gdb reference using demangled_name.
      This is the real sym that we want; 
      sym was a temp hack to make debugger happy */
-  ref_sym = lookup_symbol (SYMBOL_NAME(sym), 0, STRUCT_NAMESPACE, 0, 0); 
-  type = SYMBOL_TYPE(ref_sym);
+  ref_sym = lookup_symbol (SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0);
+  type = SYMBOL_TYPE (ref_sym);
 
 
   /* Now read the baseclasses, if any, read the regular C struct or C++
@@ -1028,22 +1044,22 @@ resolve_cfront_continuation (objfile, sym, p)
      field (baseclass specifier for the class holding the main vtable). */
 
   if (!read_cfront_baseclasses (&fi, &p, type, objfile)
-      /* g++ does this next, but cfront already did this: 
-           || !read_struct_fields (&fi, &p, type, objfile) */
+  /* g++ does this next, but cfront already did this: 
+     || !read_struct_fields (&fi, &p, type, objfile) */
       || !copy_cfront_struct_fields (&fi, type, objfile)
       || !read_cfront_member_functions (&fi, &p, type, objfile)
       || !read_cfront_static_fields (&fi, &p, type, objfile)
       || !attach_fields_to_type (&fi, type, objfile)
       || !attach_fn_fields_to_type (&fi, type)
-      /* g++ does this next, but cfront doesn't seem to have this: 
-               || !read_tilde_fields (&fi, &p, type, objfile) */
-      )
+  /* g++ does this next, but cfront doesn't seem to have this: 
+     || !read_tilde_fields (&fi, &p, type, objfile) */
+    )
     {
       type = error_type (&p, objfile);
     }
 
   do_cleanups (back_to);
-  return 0;  
+  return 0;
 }
 /* End of code added to support parsing of ARM/Cfront stabs strings */
 
@@ -1053,28 +1069,28 @@ resolve_cfront_continuation (objfile, sym, p)
 
 static int
 resolve_symbol_reference (objfile, sym, p)
-  struct objfile *objfile;
-  struct symbol *sym;
-  char *p;
+     struct objfile *objfile;
+     struct symbol *sym;
+     char *p;
 {
   int refnum;
-  struct symbol *ref_sym=0;
+  struct symbol *ref_sym = 0;
   struct alias_list *alias;
 
   /* If this is not a symbol reference return now.  */
   if (*p != '#')
-    return 0;  
+    return 0;
 
   /* Use "#<num>" as the name; we'll fix the name later.
      We stored the original symbol name as "#<id>=<name>"
      so we can now search for "#<id>" to resolving the reference.
      We'll fix the names later by removing the "#<id>" or "#<id>=" */
 
-  /*---------------------------------------------------------*/
+/*---------------------------------------------------------*/
   /* Get the reference id number, and 
      advance p past the names so we can parse the rest. 
-       eg: id=2 for p : "2=", "2=z:r(0,1)" "2:r(0,1);l(#5,#6),l(#7,#4)" */
-  /*---------------------------------------------------------*/
+     eg: id=2 for p : "2=", "2=z:r(0,1)" "2:r(0,1);l(#5,#6),l(#7,#4)" */
+/*---------------------------------------------------------*/
 
   /* This gets reference name from string.  sym may not have a name. */
 
@@ -1096,26 +1112,26 @@ resolve_symbol_reference (objfile, sym, p)
 
 
   /* If the stab symbol table and string contain:
-         RSYM   0      5      00000000 868    #15=z:r(0,1)
-         LBRAC  0      0      00000000 899    #5=
-         SLINE  0      16     00000003 923    #6=
+     RSYM   0      5      00000000 868    #15=z:r(0,1)
+     LBRAC  0      0      00000000 899    #5=
+     SLINE  0      16     00000003 923    #6=
      Then the same symbols can be later referenced by:
-         RSYM   0      5      00000000 927    #15:r(0,1);l(#5,#6)
+     RSYM   0      5      00000000 927    #15:r(0,1);l(#5,#6)
      This is used in live range splitting to:
      1) specify that a symbol (#15) is actually just a new storage 
-        class for a symbol (#15=z) which was previously defined.
+     class for a symbol (#15=z) which was previously defined.
      2) specify that the beginning and ending ranges for a symbol 
-        (#15) are the values of the beginning (#5) and ending (#6) 
-        symbols. */
-       
-   /* Read number as reference id.
-      eg: p : "=", "=z:r(0,1)" ":r(0,1);l(#5,#6),l(#7,#4)" */
-   /* FIXME! Might I want to use SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
-      in case of "l(0,0)"? */
-
-   /*--------------------------------------------------*/
-   /* Add this symbol to the reference list.           */
-   /*--------------------------------------------------*/
+     (#15) are the values of the beginning (#5) and ending (#6) 
+     symbols. */
+
+  /* Read number as reference id.
+     eg: p : "=", "=z:r(0,1)" ":r(0,1);l(#5,#6),l(#7,#4)" */
+  /* FIXME! Might I want to use SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
+     in case of "l(0,0)"? */
+
+/*--------------------------------------------------*/
+  /* Add this symbol to the reference list.           */
+/*--------------------------------------------------*/
 
   alias = (struct alias_list *) obstack_alloc (&objfile->type_obstack,
                                               sizeof (struct alias_list));
@@ -1144,11 +1160,11 @@ resolve_symbol_reference (objfile, sym, p)
       temp->next = alias;
     }
 
-   /* Want to fix up name so that other functions (eg. valops)
-      will correctly print the name.
-      Don't add_symbol_to_list so that lookup_symbol won't find it.
-      nope... needed for fixups. */
-   SYMBOL_NAME (sym) = SYMBOL_NAME (ref_sym);
+  /* Want to fix up name so that other functions (eg. valops)
+     will correctly print the name.
+     Don't add_symbol_to_list so that lookup_symbol won't find it.
+     nope... needed for fixups. */
+  SYMBOL_NAME (sym) = SYMBOL_NAME (ref_sym);
 
   /* Done!  */
   return 1;
@@ -1168,10 +1184,10 @@ struct ref_map
 #define REF_CHUNK_SIZE (MAX_CHUNK_REFS * sizeof (struct ref_map))
 #define REF_MAP_SIZE(ref_chunk) ((ref_chunk) * REF_CHUNK_SIZE)
 
-static struct ref_map *ref_map;        
+static struct ref_map *ref_map;
 
 /* Ptr to free cell in chunk's linked list. */
-static int ref_count = 0;      
+static int ref_count = 0;
 
 /* Number of chunks malloced. */
 static int ref_chunk = 0;
@@ -1193,7 +1209,7 @@ ref_add (refnum, sym, stabs, value)
     ref_count = refnum + 1;
   if (ref_count > ref_chunk * MAX_CHUNK_REFS)
     {
-      int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS; 
+      int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS;
       int new_chunks = new_slots / MAX_CHUNK_REFS + 1;
       ref_map = (struct ref_map *)
        xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks));
@@ -1225,20 +1241,20 @@ ref_search_value (refnum)
     return 0;
   return ref_map[refnum].value;
 }
-   
+
 /* Parse a reference id in STRING and return the resulting
    reference number.  Move STRING beyond the reference id.  */
 
-static int 
+static int
 process_reference (string)
-    char **string;
+     char **string;
 {
   char *p;
   int refnum = 0;
 
-  if (**string != '#') 
-    return 0;  
-     
+  if (**string != '#')
+    return 0;
+
   /* Advance beyond the initial '#'.  */
   p = *string + 1;
 
@@ -1265,9 +1281,9 @@ symbol_reference_defined (string)
   refnum = process_reference (&p);
 
   /* Defining symbols end in '=' */
-  if (*p == '=') 
+  if (*p == '=')
     {
-      /* Symbol is being defined here. */ 
+      /* Symbol is being defined here. */
       *string = p + 1;
       return refnum;
     }
@@ -1312,40 +1328,40 @@ define_symbol (valu, string, desc, type, objfile)
 
   while (p[1] == ':')
     {
-       p += 2;
-       p = strchr (p, ':');
+      p += 2;
+      p = strchr (p, ':');
     }
 
   /* If a nameless stab entry, all we need is the type, not the symbol.
      e.g. ":t10=*2" or a nameless enum like " :T16=ered:0,green:1,blue:2,;" */
   nameless = (p == string || ((string[0] == ' ') && (string[1] == ':')));
 
-  current_symbol = sym = (struct symbol *) 
-    obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
+  current_symbol = sym = (struct symbol *)
+    obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
   memset (sym, 0, sizeof (struct symbol));
 
   switch (type & N_TYPE)
     {
     case N_TEXT:
-      SYMBOL_SECTION(sym) = SECT_OFF_TEXT;
+      SYMBOL_SECTION (sym) = SECT_OFF_TEXT;
       break;
     case N_DATA:
-      SYMBOL_SECTION(sym) = SECT_OFF_DATA;
+      SYMBOL_SECTION (sym) = SECT_OFF_DATA;
       break;
     case N_BSS:
-      SYMBOL_SECTION(sym) = SECT_OFF_BSS;
+      SYMBOL_SECTION (sym) = SECT_OFF_BSS;
       break;
     }
 
   if (processing_gcc_compilation)
     {
       /* GCC 2.x puts the line number in desc.  SunOS apparently puts in the
-        number of bytes occupied by a type or object, which we ignore.  */
-      SYMBOL_LINE(sym) = desc;
+         number of bytes occupied by a type or object, which we ignore.  */
+      SYMBOL_LINE (sym) = desc;
     }
   else
     {
-      SYMBOL_LINE(sym) = 0;                    /* unknown */
+      SYMBOL_LINE (sym) = 0;   /* unknown */
     }
 
   if (is_cplus_marker (string[0]))
@@ -1353,33 +1369,33 @@ define_symbol (valu, string, desc, type, objfile)
       /* Special GNU C++ names.  */
       switch (string[1])
        {
-         case 't':
-           SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"),
-                                             &objfile -> symbol_obstack);
-           break;
+       case 't':
+         SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"),
+                                           &objfile->symbol_obstack);
+         break;
 
-         case 'v': /* $vtbl_ptr_type */
-           /* Was: SYMBOL_NAME (sym) = "vptr"; */
-           goto normal;
+       case 'v':               /* $vtbl_ptr_type */
+         /* Was: SYMBOL_NAME (sym) = "vptr"; */
+         goto normal;
 
-         case 'e':
-           SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"),
-                                             &objfile -> symbol_obstack);
-           break;
+       case 'e':
+         SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"),
+                                           &objfile->symbol_obstack);
+         break;
 
-         case '_':
-           /* This was an anonymous type that was never fixed up.  */
-           goto normal;
+       case '_':
+         /* This was an anonymous type that was never fixed up.  */
+         goto normal;
 
 #ifdef STATIC_TRANSFORM_NAME
-         case 'X':
-           /* SunPRO (3.0 at least) static variable encoding.  */
-           goto normal;
+       case 'X':
+         /* SunPRO (3.0 at least) static variable encoding.  */
+         goto normal;
 #endif
 
-         default:
-           complain (&unrecognized_cplus_name_complaint, string);
-           goto normal;                /* Do *something* with it */
+       default:
+         complain (&unrecognized_cplus_name_complaint, string);
+         goto normal;          /* Do *something* with it */
        }
     }
   else if (string[0] == '#')
@@ -1389,26 +1405,25 @@ define_symbol (valu, string, desc, type, objfile)
       int refnum, nlen;
 
       /* If STRING defines a new reference id, then add it to the
-        reference map.  Else it must be referring to a previously
-        defined symbol, so add it to the alias list of the previously
-        defined symbol.  */
+         reference map.  Else it must be referring to a previously
+         defined symbol, so add it to the alias list of the previously
+         defined symbol.  */
       s = string;
       refnum = symbol_reference_defined (&s);
       if (refnum >= 0)
-         ref_add (refnum, sym, string, SYMBOL_VALUE (sym));
-      else
-       if (!resolve_symbol_reference (objfile, sym, string))
-         return NULL;
+       ref_add (refnum, sym, string, SYMBOL_VALUE (sym));
+      else if (!resolve_symbol_reference (objfile, sym, string))
+       return NULL;
 
       /* S..P contains the name of the symbol.  We need to store
-        the correct name into SYMBOL_NAME.  */
+         the correct name into SYMBOL_NAME.  */
       nlen = p - s;
       if (refnum >= 0)
        {
          if (nlen > 0)
            {
              SYMBOL_NAME (sym) = (char *)
-               obstack_alloc (&objfile -> symbol_obstack, nlen);
+               obstack_alloc (&objfile->symbol_obstack, nlen);
              strncpy (SYMBOL_NAME (sym), s, nlen);
              SYMBOL_NAME (sym)[nlen] = '\0';
              SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
@@ -1418,8 +1433,8 @@ define_symbol (valu, string, desc, type, objfile)
               Get error if leave name 0.  So give it something. */
            {
              nlen = p - string;
-             SYMBOL_NAME (sym) = (char *)
-               obstack_alloc (&objfile -> symbol_obstack, nlen);
+             SYMBOL_NAME (sym) = (char *)
+               obstack_alloc (&objfile->symbol_obstack, nlen);
              strncpy (SYMBOL_NAME (sym), string, nlen);
              SYMBOL_NAME (sym)[nlen] = '\0';
              SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
@@ -1431,14 +1446,14 @@ define_symbol (valu, string, desc, type, objfile)
   else
     {
     normal:
-      SYMBOL_LANGUAGE (sym) = current_subfile -> language;
-      SYMBOL_NAME (sym)        = (char *)
-       obstack_alloc (&objfile -> symbol_obstack, ((p - string) + 1));
+      SYMBOL_LANGUAGE (sym) = current_subfile->language;
+      SYMBOL_NAME (sym) = (char *)
+       obstack_alloc (&objfile->symbol_obstack, ((p - string) + 1));
       /* Open-coded memcpy--saves function call time.  */
       /* FIXME:  Does it really?  Try replacing with simple strcpy and
-        try it on an executable with a large symbol table. */
+         try it on an executable with a large symbol table. */
       /* FIXME: considering that gcc can open code memcpy anyway, I
-        doubt it.  xoxorich. */
+         doubt it.  xoxorich. */
       {
        register char *p1 = string;
        register char *p2 = SYMBOL_NAME (sym);
@@ -1450,9 +1465,9 @@ define_symbol (valu, string, desc, type, objfile)
       }
 
       /* If this symbol is from a C++ compilation, then attempt to cache the
-        demangled form for future reference.  This is a typical time versus
-        space tradeoff, that was decided in favor of time because it sped up
-        C++ symbol lookups by a factor of about 20. */
+         demangled form for future reference.  This is a typical time versus
+         space tradeoff, that was decided in favor of time because it sped up
+         C++ symbol lookups by a factor of about 20. */
 
       SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
     }
@@ -1479,11 +1494,11 @@ define_symbol (valu, string, desc, type, objfile)
     {
     case 'c':
       /* c is a special case, not followed by a type-number.
-        SYMBOL:c=iVALUE for an integer constant symbol.
-        SYMBOL:c=rVALUE for a floating constant symbol.
-        SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
-        e.g. "b:c=e6,0" for "const b = blob1"
-        (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;").  */
+         SYMBOL:c=iVALUE for an integer constant symbol.
+         SYMBOL:c=rVALUE for a floating constant symbol.
+         SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
+         e.g. "b:c=e6,0" for "const b = blob1"
+         (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;").  */
       if (*p != '=')
        {
          SYMBOL_CLASS (sym) = LOC_CONST;
@@ -1514,7 +1529,7 @@ define_symbol (valu, string, desc, type, objfile)
            SYMBOL_TYPE (sym) = lookup_fundamental_type (objfile,
                                                         FT_DBL_PREC_FLOAT);
            dbl_valu = (char *)
-             obstack_alloc (&objfile -> symbol_obstack,
+             obstack_alloc (&objfile->symbol_obstack,
                             TYPE_LENGTH (SYMBOL_TYPE (sym)));
            store_floating (dbl_valu, TYPE_LENGTH (SYMBOL_TYPE (sym)), d);
            SYMBOL_VALUE_BYTES (sym) = dbl_valu;
@@ -1544,7 +1559,7 @@ define_symbol (valu, string, desc, type, objfile)
                init_type (TYPE_CODE_INT,
                           sizeof (int) * HOST_CHAR_BIT / TARGET_CHAR_BIT, 0,
                           "integer constant",
-                          (struct objfile *)NULL);
+                            (struct objfile *) NULL);
            SYMBOL_TYPE (sym) = int_const_type;
            SYMBOL_VALUE (sym) = atoi (p);
            SYMBOL_CLASS (sym) = LOC_CONST;
@@ -1604,8 +1619,8 @@ define_symbol (valu, string, desc, type, objfile)
 
     process_function_types:
       /* Function result types are described as the result type in stabs.
-        We need to convert this to the function-returning-type-X type
-        in GDB.  E.g. "int" is converted to "function returning int".  */
+         We need to convert this to the function-returning-type-X type
+         in GDB.  E.g. "int" is converted to "function returning int".  */
       if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_FUNC)
        SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
 
@@ -1640,17 +1655,17 @@ define_symbol (valu, string, desc, type, objfile)
              struct type *ptype;
 
              /* A type number of zero indicates the start of varargs.
-                FIXME: GDB currently ignores vararg functions.  */
+                FIXME: GDB currently ignores vararg functions.  */
              if (p[0] == '0' && p[1] == '\0')
                break;
              ptype = read_type (&p, objfile);
 
              /* The Sun compilers mark integer arguments, which should
-                be promoted to the width of the calling conventions, with
-                a type which references itself. This type is turned into
-                a TYPE_CODE_VOID type by read_type, and we have to turn
-                it back into builtin_type_int here.
-                FIXME: Do we need a new builtin_type_promoted_int_arg ?  */
+                be promoted to the width of the calling conventions, with
+                a type which references itself. This type is turned into
+                a TYPE_CODE_VOID type by read_type, and we have to turn
+                it back into builtin_type_int here.
+                FIXME: Do we need a new builtin_type_promoted_int_arg ?  */
              if (TYPE_CODE (ptype) == TYPE_CODE_VOID)
                ptype = builtin_type_int;
              TYPE_FIELD_TYPE (ftype, nparams++) = ptype;
@@ -1670,28 +1685,28 @@ define_symbol (valu, string, desc, type, objfile)
 
     case 'G':
       /* For a class G (global) symbol, it appears that the
-        value is not correct.  It is necessary to search for the
-        corresponding linker definition to find the value.
-        These definitions appear at the end of the namelist.  */
+         value is not correct.  It is necessary to search for the
+         corresponding linker definition to find the value.
+         These definitions appear at the end of the namelist.  */
       SYMBOL_TYPE (sym) = read_type (&p, objfile);
       SYMBOL_CLASS (sym) = LOC_STATIC;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       /* Don't add symbol references to global_sym_chain.
-        Symbol references don't have valid names and wont't match up with
-        minimal symbols when the global_sym_chain is relocated.
-        We'll fixup symbol references when we fixup the defining symbol.  */
+         Symbol references don't have valid names and wont't match up with
+         minimal symbols when the global_sym_chain is relocated.
+         We'll fixup symbol references when we fixup the defining symbol.  */
       if (SYMBOL_NAME (sym) && SYMBOL_NAME (sym)[0] != '#')
        {
-          i = hashname (SYMBOL_NAME (sym));
-          SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
-          global_sym_chain[i] = sym;
+         i = hashname (SYMBOL_NAME (sym));
+         SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
+         global_sym_chain[i] = sym;
        }
       add_symbol_to_list (sym, &global_symbols);
       break;
 
       /* This case is faked by a conditional above,
-        when there is no code letter in the dbx data.
-        Dbx data never actually contains 'l'.  */
+         when there is no code letter in the dbx data.
+         Dbx data never actually contains 'l'.  */
     case 's':
     case 'l':
       SYMBOL_TYPE (sym) = read_type (&p, objfile);
@@ -1710,13 +1725,13 @@ define_symbol (valu, string, desc, type, objfile)
          p++;
          SYMBOL_TYPE (sym)
            = lookup_pointer_type
-             (lookup_function_type (read_type (&p, objfile)));
+           (lookup_function_type (read_type (&p, objfile)));
        }
       else
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
 
       /* Normally this is a parameter, a LOC_ARG.  On the i960, it
-        can also be a LOC_LOCAL_ARG depending on symbol type.  */
+         can also be a LOC_LOCAL_ARG depending on symbol type.  */
 #ifndef DBX_PARM_SYMBOL_CLASS
 #define        DBX_PARM_SYMBOL_CLASS(type)     LOC_ARG
 #endif
@@ -1743,53 +1758,53 @@ define_symbol (valu, string, desc, type, objfile)
          static struct type *pcc_promotion_type;
          /* This is the unsigned type which arguments get promoted to.  */
          static struct type *pcc_unsigned_promotion_type;
-         
+
          /* Call it "int" because this is mainly C lossage.  */
          if (pcc_promotion_type == NULL)
            pcc_promotion_type =
              init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
                         0, "int", NULL);
-         
+
          if (pcc_unsigned_promotion_type == NULL)
            pcc_unsigned_promotion_type =
              init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
                         TYPE_FLAG_UNSIGNED, "unsigned int", NULL);
-         
+
          if (BELIEVE_PCC_PROMOTION_TYPE)
            {
              /* This is defined on machines (e.g. sparc) where we
-                should believe the type of a PCC 'short' argument,
-                but shouldn't believe the address (the address is the
-                address of the corresponding int).
-                
-                My guess is that this correction, as opposed to
-                changing the parameter to an 'int' (as done below,
-                for PCC on most machines), is the right thing to do
-                on all machines, but I don't want to risk breaking
-                something that already works.  On most PCC machines,
-                the sparc problem doesn't come up because the calling
-                function has to zero the top bytes (not knowing
-                whether the called function wants an int or a short),
-                so there is little practical difference between an
-                int and a short (except perhaps what happens when the
-                GDB user types "print short_arg = 0x10000;").
-                
-                Hacked for SunOS 4.1 by gnu@cygnus.com.  In 4.1, the
-                compiler actually produces the correct address (we
-                don't need to fix it up).  I made this code adapt so
-                that it will offset the symbol if it was pointing at
-                an int-aligned location and not otherwise.  This way
-                you can use the same gdb for 4.0.x and 4.1 systems.
-                
-                If the parameter is shorter than an int, and is
-                integral (e.g. char, short, or unsigned equivalent),
-                and is claimed to be passed on an integer boundary,
-                don't believe it!  Offset the parameter's address to
-                the tail-end of that integer.  */
-             
+                should believe the type of a PCC 'short' argument,
+                but shouldn't believe the address (the address is the
+                address of the corresponding int).
+
+                My guess is that this correction, as opposed to
+                changing the parameter to an 'int' (as done below,
+                for PCC on most machines), is the right thing to do
+                on all machines, but I don't want to risk breaking
+                something that already works.  On most PCC machines,
+                the sparc problem doesn't come up because the calling
+                function has to zero the top bytes (not knowing
+                whether the called function wants an int or a short),
+                so there is little practical difference between an
+                int and a short (except perhaps what happens when the
+                GDB user types "print short_arg = 0x10000;").
+
+                Hacked for SunOS 4.1 by gnu@cygnus.com.  In 4.1, the
+                compiler actually produces the correct address (we
+                don't need to fix it up).  I made this code adapt so
+                that it will offset the symbol if it was pointing at
+                an int-aligned location and not otherwise.  This way
+                you can use the same gdb for 4.0.x and 4.1 systems.
+
+                If the parameter is shorter than an int, and is
+                integral (e.g. char, short, or unsigned equivalent),
+                and is claimed to be passed on an integer boundary,
+                don't believe it!  Offset the parameter's address to
+                the tail-end of that integer.  */
+
              if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
                  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT
-                 && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type))
+             && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type))
                {
                  SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type)
                    - TYPE_LENGTH (SYMBOL_TYPE (sym));
@@ -1799,7 +1814,7 @@ define_symbol (valu, string, desc, type, objfile)
          else
            {
              /* If PCC says a parameter is a short or a char,
-                it is really an int.  */
+                it is really an int.  */
              if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
                  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
                {
@@ -1821,7 +1836,7 @@ define_symbol (valu, string, desc, type, objfile)
          SYMBOL_TYPE (sym) = read_type (&p, objfile);
          goto process_prototype_types;
        }
-      /*FALLTHROUGH*/
+      /*FALLTHROUGH */
 
     case 'R':
       /* Parameter which is in a register.  */
@@ -1832,7 +1847,7 @@ define_symbol (valu, string, desc, type, objfile)
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
                    SYMBOL_SOURCE_NAME (sym));
-         SYMBOL_VALUE (sym) = SP_REGNUM;  /* Known safe, though useless */
+         SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       add_symbol_to_list (sym, &local_symbols);
@@ -1847,7 +1862,7 @@ define_symbol (valu, string, desc, type, objfile)
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
                    SYMBOL_SOURCE_NAME (sym));
-         SYMBOL_VALUE (sym) = SP_REGNUM;  /* Known safe, though useless */
+         SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (within_function)
@@ -1865,7 +1880,7 @@ define_symbol (valu, string, desc, type, objfile)
             of saved registers in backtraces, etc.).
 
             Note that this code illegally combines
-              main(argc) struct foo argc; { register struct foo argc; }
+            main(argc) struct foo argc; { register struct foo argc; }
             but this case is considered pathological and causes a warning
             from a decent compiler.  */
 
@@ -1879,13 +1894,13 @@ define_symbol (valu, string, desc, type, objfile)
                  || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_SET
                  || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_BITSTRING)
 #endif
-             )
+           )
            {
              struct symbol *prev_sym;
              prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
              if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
                   || SYMBOL_CLASS (prev_sym) == LOC_ARG)
-                 && STREQ (SYMBOL_NAME (prev_sym), SYMBOL_NAME(sym)))
+                 && STREQ (SYMBOL_NAME (prev_sym), SYMBOL_NAME (sym)))
                {
                  SYMBOL_CLASS (prev_sym) = LOC_REGPARM;
                  /* Use the type from the LOC_REGISTER; that is the type
@@ -1896,10 +1911,10 @@ define_symbol (valu, string, desc, type, objfile)
                  break;
                }
            }
-          add_symbol_to_list (sym, &local_symbols);
+         add_symbol_to_list (sym, &local_symbols);
        }
       else
-        add_symbol_to_list (sym, &file_symbols);
+       add_symbol_to_list (sym, &file_symbols);
       break;
 
     case 'S':
@@ -1909,15 +1924,15 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_VALUE_ADDRESS (sym) = valu;
 #ifdef STATIC_TRANSFORM_NAME
       if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)))
-      {
-       struct minimal_symbol *msym;
-       msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
-       if (msym != NULL)
-         {
-           SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym));
-           SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
-         }
-      }
+       {
+         struct minimal_symbol *msym;
+         msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
+         if (msym != NULL)
+           {
+             SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym));
+             SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
+           }
+       }
 #endif
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       add_symbol_to_list (sym, &file_symbols);
@@ -1927,16 +1942,17 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_TYPE (sym) = read_type (&p, objfile);
 
       /* For a nameless type, we don't want a create a symbol, thus we
-        did not use `sym'. Return without further processing. */
-      if (nameless) return NULL;
+         did not use `sym'. Return without further processing. */
+      if (nameless)
+       return NULL;
 
       SYMBOL_CLASS (sym) = LOC_TYPEDEF;
       SYMBOL_VALUE (sym) = valu;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       /* C++ vagaries: we may have a type which is derived from
-        a base type which did not have its name defined when the
-        derived class was output.  We fill in the derived class's
-        base part member's name here in that case.  */
+         a base type which did not have its name defined when the
+         derived class was output.  We fill in the derived class's
+         base part member's name here in that case.  */
       if (TYPE_NAME (SYMBOL_TYPE (sym)) != NULL)
        if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
             || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)
@@ -1961,23 +1977,23 @@ define_symbol (valu, string, desc, type, objfile)
              || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
            {
              /* If we are giving a name to a type such as "pointer to
-                foo" or "function returning foo", we better not set
-                the TYPE_NAME.  If the program contains "typedef char
-                *caddr_t;", we don't want all variables of type char
-                * to print as caddr_t.  This is not just a
-                consequence of GDB's type management; PCC and GCC (at
-                least through version 2.4) both output variables of
-                either type char * or caddr_t with the type number
-                defined in the 't' symbol for caddr_t.  If a future
-                compiler cleans this up it GDB is not ready for it
-                yet, but if it becomes ready we somehow need to
-                disable this check (without breaking the PCC/GCC2.4
-                case).
-
-                Sigh.
-
-                Fortunately, this check seems not to be necessary
-                for anything except pointers or functions.  */
+                foo" or "function returning foo", we better not set
+                the TYPE_NAME.  If the program contains "typedef char
+                *caddr_t;", we don't want all variables of type char
+                * to print as caddr_t.  This is not just a
+                consequence of GDB's type management; PCC and GCC (at
+                least through version 2.4) both output variables of
+                either type char * or caddr_t with the type number
+                defined in the 't' symbol for caddr_t.  If a future
+                compiler cleans this up it GDB is not ready for it
+                yet, but if it becomes ready we somehow need to
+                disable this check (without breaking the PCC/GCC2.4
+                case).
+
+                Sigh.
+
+                Fortunately, this check seems not to be necessary
+                for anything except pointers or functions.  */
            }
          else
            TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NAME (sym);
@@ -1988,44 +2004,45 @@ define_symbol (valu, string, desc, type, objfile)
 
     case 'T':
       /* Struct, union, or enum tag.  For GNU C++, this can be be followed
-        by 't' which means we are typedef'ing it as well.  */
+         by 't' which means we are typedef'ing it as well.  */
       synonym = *p == 't';
 
       if (synonym)
        p++;
       /* The semantics of C++ state that "struct foo { ... }" also defines 
-        a typedef for "foo".  Unfortunately, cfront never makes the typedef
-        when translating C++ into C.  We make the typedef here so that
-        "ptype foo" works as expected for cfront translated code.  */
+         a typedef for "foo".  Unfortunately, cfront never makes the typedef
+         when translating C++ into C.  We make the typedef here so that
+         "ptype foo" works as expected for cfront translated code.  */
       else if (current_subfile->language == language_cplus)
        synonym = 1;
 
       SYMBOL_TYPE (sym) = read_type (&p, objfile);
 
       /* For a nameless type, we don't want a create a symbol, thus we
-        did not use `sym'. Return without further processing. */
-      if (nameless) return NULL;
+         did not use `sym'. Return without further processing. */
+      if (nameless)
+       return NULL;
 
       SYMBOL_CLASS (sym) = LOC_TYPEDEF;
       SYMBOL_VALUE (sym) = valu;
       SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
       if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
        TYPE_TAG_NAME (SYMBOL_TYPE (sym))
-         = obconcat (&objfile -> type_obstack, "", "", SYMBOL_NAME (sym));
+         = obconcat (&objfile->type_obstack, "", "", SYMBOL_NAME (sym));
       add_symbol_to_list (sym, &file_symbols);
 
       if (synonym)
        {
          /* Clone the sym and then modify it. */
          register struct symbol *typedef_sym = (struct symbol *)
-           obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
+         obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
          *typedef_sym = *sym;
          SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
          SYMBOL_VALUE (typedef_sym) = valu;
          SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
          if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
            TYPE_NAME (SYMBOL_TYPE (sym))
-             = obconcat (&objfile -> type_obstack, "", "", SYMBOL_NAME (sym));
+             = obconcat (&objfile->type_obstack, "", "", SYMBOL_NAME (sym));
          add_symbol_to_list (typedef_sym, &file_symbols);
        }
       break;
@@ -2037,15 +2054,15 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_VALUE_ADDRESS (sym) = valu;
 #ifdef STATIC_TRANSFORM_NAME
       if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)))
-      {
-       struct minimal_symbol *msym;
-       msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
-       if (msym != NULL)
-         {
-           SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym));
-           SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
-         }
-      }
+       {
+         struct minimal_symbol *msym;
+         msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
+         if (msym != NULL)
+           {
+             SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym));
+             SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
+           }
+       }
 #endif
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       if (os9k_stabs)
@@ -2072,7 +2089,7 @@ define_symbol (valu, string, desc, type, objfile)
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym), NUM_REGS,
                    SYMBOL_SOURCE_NAME (sym));
-         SYMBOL_VALUE (sym) = SP_REGNUM;  /* Known safe, though useless */
+         SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       add_symbol_to_list (sym, &local_symbols);
@@ -2080,9 +2097,9 @@ define_symbol (valu, string, desc, type, objfile)
 
     case 'X':
       /* This is used by Sun FORTRAN for "function result value".
-        Sun claims ("dbx and dbxtool interfaces", 2nd ed)
-        that Pascal uses it too, but when I tried it Pascal used
-        "x:3" (local symbol) instead.  */
+         Sun claims ("dbx and dbxtool interfaces", 2nd ed)
+         that Pascal uses it too, but when I tried it Pascal used
+         "x:3" (local symbol) instead.  */
       SYMBOL_TYPE (sym) = read_type (&p, objfile);
       SYMBOL_CLASS (sym) = LOC_LOCAL;
       SYMBOL_VALUE (sym) = valu;
@@ -2090,25 +2107,25 @@ define_symbol (valu, string, desc, type, objfile)
       add_symbol_to_list (sym, &local_symbols);
       break;
 
-    /* New code added to support cfront stabs strings.
-       Note: case 'P' already handled above */
+      /* New code added to support cfront stabs strings.
+         Note: case 'P' already handled above */
     case 'Z':
       /* Cfront type continuation coming up!
-        Find the original definition and add to it.
-        We'll have to do this for the typedef too,
-        since we cloned the symbol to define a type in read_type.
-        Stabs info examples:
-                __1C :Ztl 
-                foo__1CFv :ZtF (first def foo__1CFv:F(0,3);(0,24))
-                C:ZsC;;__ct__1CFv func1__1CFv func2__1CFv ... ;;;
-                where C is the name of the class.
-        Unfortunately, we can't lookup the original symbol yet 'cuz 
-        we haven't finished reading all the symbols.
-        Instead, we save it for processing later */
+         Find the original definition and add to it.
+         We'll have to do this for the typedef too,
+         since we cloned the symbol to define a type in read_type.
+         Stabs info examples:
+         __1C :Ztl 
+         foo__1CFv :ZtF (first def foo__1CFv:F(0,3);(0,24))
+         C:ZsC;;__ct__1CFv func1__1CFv func2__1CFv ... ;;;
+         where C is the name of the class.
+         Unfortunately, we can't lookup the original symbol yet 'cuz 
+         we haven't finished reading all the symbols.
+         Instead, we save it for processing later */
       process_later (sym, p, resolve_cfront_continuation);
-      SYMBOL_TYPE (sym) = error_type (&p, objfile); /* FIXME! change later */ 
-      SYMBOL_CLASS (sym) = LOC_CONST; 
-      SYMBOL_VALUE (sym) = 0; 
+      SYMBOL_TYPE (sym) = error_type (&p, objfile);    /* FIXME! change later */
+      SYMBOL_CLASS (sym) = LOC_CONST;
+      SYMBOL_VALUE (sym) = 0;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       /* Don't add to list - we'll delete it later when 
          we add the continuation to the real sym */
@@ -2128,7 +2145,7 @@ define_symbol (valu, string, desc, type, objfile)
      the address in a register, not the structure itself. */
 
   if (REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
-      && (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
+    && (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
     {
       struct type *symbol_type = check_typedef (SYMBOL_TYPE (sym));
 
@@ -2153,9 +2170,9 @@ define_symbol (valu, string, desc, type, objfile)
     {
       p++;
       if (*p && p[0] == 'l' && p[1] == '(')
-        {
-          /* GNU extensions for live range splitting may be appended to 
-             the end of the stab string.  eg. "l(#1,#2);l(#3,#5)" */
+       {
+         /* GNU extensions for live range splitting may be appended to 
+            the end of the stab string.  eg. "l(#1,#2);l(#3,#5)" */
 
          /* Resolve the live range and add it to SYM's live range list.  */
          if (!resolve_live_range (objfile, sym, p))
@@ -2163,13 +2180,13 @@ define_symbol (valu, string, desc, type, objfile)
 
          /* Find end of live range info. */
          p = strchr (p, ')');
-          if (!*p || *p != ')')
+         if (!*p || *p != ')')
            {
              complain (&lrs_general_complaint, "live range format not recognized");
              return NULL;
            }
-          p++;
-       }
+         p++;
+       }
     }
   return sym;
 }
@@ -2200,7 +2217,7 @@ resolve_live_range (objfile, sym, p)
       return 0;
     }
   p++;
-       
+
   /* Get starting value of range and advance P past the reference id.
 
      ?!? In theory, the process_reference should never fail, but we should
@@ -2264,7 +2281,7 @@ add_live_range (objfile, sym, start, end)
 
   /* Alloc new live range structure. */
   r = (struct range_list *)
-    obstack_alloc (&objfile->type_obstack, 
+    obstack_alloc (&objfile->type_obstack,
                   sizeof (struct range_list));
   r->start = start;
   r->end = end;
@@ -2281,8 +2298,8 @@ add_live_range (objfile, sym, start, end)
       rs->next = r;
     }
 }
-
 \f
+
 /* Skip rest of this symbol and return an error type.
 
    General notes on error recovery:  error_type always skips to the
@@ -2290,7 +2307,7 @@ add_live_range (objfile, sym, start, end)
    Thus code like this:
 
    if (*(*pp)++ != ';')
-     return error_type (pp, objfile);
+   return error_type (pp, objfile);
 
    is wrong because if *pp starts out pointing at '\0' (typically as the
    result of an earlier error), it will be incremented to point to the
@@ -2298,15 +2315,15 @@ add_live_range (objfile, sym, start, end)
    if you run off the end of the string table.  Instead use
 
    if (**pp != ';')
-     return error_type (pp, objfile);
+   return error_type (pp, objfile);
    ++*pp;
 
    or
 
    if (**pp != ';')
-     foo = error_type (pp, objfile);
+   foo = error_type (pp, objfile);
    else
-     ++*pp;
+   ++*pp;
 
    And in case it isn't obvious, the point of all this hair is so the compiler
    can define new types and new syntaxes, and old versions of the
@@ -2338,8 +2355,8 @@ error_type (pp, objfile)
     }
   return (builtin_type_error);
 }
-
 \f
+
 /* Read type information or a type definition; return the type.  Even
    though this routine accepts either type information or a type
    definition, the distinction is relevant--some parts of stabsread.c
@@ -2372,27 +2389,27 @@ read_type (pp, objfile)
     {
       if (read_type_number (pp, typenums) != 0)
        return error_type (pp, objfile);
-      
+
       /* Type is not being defined here.  Either it already exists,
-        or this is a forward reference to it.  dbx_alloc_type handles
-        both cases.  */
+         or this is a forward reference to it.  dbx_alloc_type handles
+         both cases.  */
       if (**pp != '=')
        return dbx_alloc_type (typenums, objfile);
 
       /* Type is being defined here.  */
       /* Skip the '='.
-        Also skip the type descriptor - we get it below with (*pp)[-1].  */
-      (*pp)+=2;
+         Also skip the type descriptor - we get it below with (*pp)[-1].  */
+      (*pp) += 2;
     }
   else
     {
       /* 'typenums=' not present, type is anonymous.  Read and return
-        the definition, but don't put it in the type vector.  */
+         the definition, but don't put it in the type vector.  */
       typenums[0] = typenums[1] = -1;
       (*pp)++;
     }
 
- again:
+again:
   type_descriptor = (*pp)[-1];
   switch (type_descriptor)
     {
@@ -2403,13 +2420,13 @@ read_type (pp, objfile)
        /* Used to index through file_symbols.  */
        struct pending *ppt;
        int i;
-       
+
        /* Name including "struct", etc.  */
        char *type_name;
-       
+
        {
          char *from, *to, *p, *q1, *q2;
-         
+
          /* Set the type code according to the following letter.  */
          switch ((*pp)[0])
            {
@@ -2427,13 +2444,13 @@ read_type (pp, objfile)
                /* Complain and keep going, so compilers can invent new
                   cross-reference types.  */
                static struct complaint msg =
-                 {"Unrecognized cross-reference type `%c'", 0, 0};
+               {"Unrecognized cross-reference type `%c'", 0, 0};
                complain (&msg, (*pp)[0]);
                code = TYPE_CODE_STRUCT;
                break;
              }
            }
-          
+
          q1 = strchr (*pp, '<');
          p = strchr (*pp, ':');
          if (p == NULL)
@@ -2454,15 +2471,15 @@ read_type (pp, objfile)
              if (*p != ':')
                return error_type (pp, objfile);
            }
-         to = type_name = 
-               (char *)obstack_alloc (&objfile->type_obstack, p - *pp + 1);
-       
+         to = type_name =
+           (char *) obstack_alloc (&objfile->type_obstack, p - *pp + 1);
+
          /* Copy the name.  */
          from = *pp + 1;
-         while (from < p) 
+         while (from < p)
            *to++ = *from++;
          *to = '\0';
-         
+
          /* Set the pointer ahead of the name which we just read, and
             the colon.  */
          *pp = from + 1;
@@ -2484,7 +2501,7 @@ read_type (pp, objfile)
                  && (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
                  && STREQ (SYMBOL_NAME (sym), type_name))
                {
-                 obstack_free (&objfile -> type_obstack, type_name);
+                 obstack_free (&objfile->type_obstack, type_name);
                  type = SYMBOL_TYPE (sym);
                  return type;
                }
@@ -2498,14 +2515,14 @@ read_type (pp, objfile)
        type = dbx_alloc_type (typenums, objfile);
        TYPE_CODE (type) = code;
        TYPE_TAG_NAME (type) = type_name;
-       INIT_CPLUS_SPECIFIC(type);
+       INIT_CPLUS_SPECIFIC (type);
        TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
 
        add_undefined_type (type);
        return type;
       }
 
-    case '-':                          /* RS/6000 built-in type */
+    case '-':                  /* RS/6000 built-in type */
     case '0':
     case '1':
     case '2':
@@ -2520,13 +2537,14 @@ read_type (pp, objfile)
       (*pp)--;
 
       /* We deal with something like t(1,2)=(3,4)=... which
-        the Lucid compiler and recent gcc versions (post 2.7.3) use. */
+         the Lucid compiler and recent gcc versions (post 2.7.3) use. */
 
       /* Allocate and enter the typedef type first.
-        This handles recursive types. */
+         This handles recursive types. */
       type = dbx_alloc_type (typenums, objfile);
       TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
-      { struct type *xtype = read_type (pp, objfile);
+      {
+       struct type *xtype = read_type (pp, objfile);
        if (type == xtype)
          {
            /* It's being defined as itself.  That means it is "void".  */
@@ -2547,24 +2565,24 @@ read_type (pp, objfile)
       }
       break;
 
-    /* In the following types, we must be sure to overwrite any existing
-       type that the typenums refer to, rather than allocating a new one
-       and making the typenums point to the new one.  This is because there
-       may already be pointers to the existing type (if it had been
-       forward-referenced), and we must change it to a pointer, function,
-       reference, or whatever, *in-place*.  */
+      /* In the following types, we must be sure to overwrite any existing
+         type that the typenums refer to, rather than allocating a new one
+         and making the typenums point to the new one.  This is because there
+         may already be pointers to the existing type (if it had been
+         forward-referenced), and we must change it to a pointer, function,
+         reference, or whatever, *in-place*.  */
 
     case '*':
       type1 = read_type (pp, objfile);
       type = make_pointer_type (type1, dbx_lookup_type (typenums));
       break;
 
-    case '&':                          /* Reference to another type */
+    case '&':                  /* Reference to another type */
       type1 = read_type (pp, objfile);
       type = make_reference_type (type1, dbx_lookup_type (typenums));
       break;
 
-    case 'f':                          /* Function returning another type */
+    case 'f':                  /* Function returning another type */
       if (os9k_stabs && **pp == '(')
        {
          /* Function prototype; parse it.
@@ -2574,29 +2592,30 @@ read_type (pp, objfile)
          struct type *t;
          ++*pp;
          while (**pp != ')')
-            {
-              t = read_type (pp, objfile);
-              if (**pp == ',') ++*pp;
-            }
+           {
+             t = read_type (pp, objfile);
+             if (**pp == ',')
+               ++ * pp;
+           }
        }
       type1 = read_type (pp, objfile);
       type = make_function_type (type1, dbx_lookup_type (typenums));
       break;
 
-    case 'k':                     /* Const qualifier on some type (Sun) */
-    case 'c':                     /* Const qualifier on some type (OS9000) */
+    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.  */
+         only accept 'c' in the os9k_stabs case.  */
       if (type_descriptor == 'c' && !os9k_stabs)
        return error_type (pp, objfile);
       type = read_type (pp, objfile);
       /* FIXME! For now, we ignore const and volatile qualifiers.  */
       break;
 
-    case 'B':                       /* Volatile qual on some type (Sun) */
-    case 'i':                       /* Volatile qual on some type (OS9000) */
+    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.  */
+         only accept 'i' in the os9k_stabs case.  */
       if (type_descriptor == 'i' && !os9k_stabs)
        return error_type (pp, objfile);
       type = read_type (pp, objfile);
@@ -2604,8 +2623,8 @@ read_type (pp, objfile)
       break;
 
     case '@':
-      if (isdigit (**pp) || **pp ==  '(' || **pp == '-')
-       { /* Member (class & variable) type */
+      if (isdigit (**pp) || **pp == '(' || **pp == '-')
+       {                       /* Member (class & variable) type */
          /* FIXME -- we should be doing smash_to_XXX types here.  */
 
          struct type *domain = read_type (pp, objfile);
@@ -2620,7 +2639,8 @@ read_type (pp, objfile)
          type = dbx_alloc_type (typenums, objfile);
          smash_to_member_type (type, domain, memtype);
        }
-      else /* type attribute */
+      else
+       /* type attribute */
        {
          char *attr = *pp;
          /* Skip to the semicolon.  */
@@ -2629,7 +2649,7 @@ read_type (pp, objfile)
          if (**pp == '\0')
            return error_type (pp, objfile);
          else
-           ++*pp;  /* Skip the semicolon.  */
+           ++ * pp;            /* Skip the semicolon.  */
 
          switch (*attr)
            {
@@ -2645,7 +2665,7 @@ read_type (pp, objfile)
 
            default:
              /* Ignore unrecognized type attributes, so future compilers
-                can invent new ones.  */
+                can invent new ones.  */
              break;
            }
          ++*pp;
@@ -2653,7 +2673,7 @@ read_type (pp, objfile)
        }
       break;
 
-    case '#':                          /* Method (class & fn) type */
+    case '#':                  /* Method (class & fn) type */
       if ((*pp)[0] == '#')
        {
          /* We'll get the parameter types from the name.  */
@@ -2686,7 +2706,7 @@ read_type (pp, objfile)
        }
       break;
 
-    case 'r':                          /* Range type */
+    case 'r':                  /* Range type */
       type = read_range_type (pp, typenums, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
@@ -2705,39 +2725,39 @@ read_type (pp, objfile)
        }
       break;
 
-    case 'R':                          /* Sun ACC builtin float type */
+    case 'R':                  /* Sun ACC builtin float type */
       type = read_sun_floating_type (pp, typenums, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
       break;
-    
-    case 'e':                          /* Enumeration type */
+
+    case 'e':                  /* Enumeration type */
       type = dbx_alloc_type (typenums, objfile);
       type = read_enum_type (pp, type, objfile);
       if (typenums[0] != -1)
        *dbx_lookup_type (typenums) = type;
       break;
 
-    case 's':                          /* Struct type */
-    case 'u':                          /* Union type */
+    case 's':                  /* Struct type */
+    case 'u':                  /* Union type */
       type = dbx_alloc_type (typenums, objfile);
       switch (type_descriptor)
        {
-         case 's':
-           TYPE_CODE (type) = TYPE_CODE_STRUCT;
-           break;
-         case 'u':
-           TYPE_CODE (type) = TYPE_CODE_UNION;
-           break;
+       case 's':
+         TYPE_CODE (type) = TYPE_CODE_STRUCT;
+         break;
+       case 'u':
+         TYPE_CODE (type) = TYPE_CODE_UNION;
+         break;
        }
       type = read_struct_type (pp, type, objfile);
       break;
 
-    case 'a':                          /* Array type */
+    case 'a':                  /* Array type */
       if (**pp != 'r')
        return error_type (pp, objfile);
       ++*pp;
-      
+
       type = dbx_alloc_type (typenums, objfile);
       type = read_array_type (pp, type, objfile);
       if (is_string)
@@ -2746,7 +2766,7 @@ read_type (pp, objfile)
 
     case 'S':
       type1 = read_type (pp, objfile);
-      type = create_set_type ((struct type*) NULL, type1);
+      type = create_set_type ((struct type *) NULL, type1);
       if (is_string)
        TYPE_CODE (type) = TYPE_CODE_BITSTRING;
       if (typenums[0] != -1)
@@ -2755,7 +2775,7 @@ read_type (pp, objfile)
 
     default:
       --*pp;                   /* Go back to the symbol in error */
-                               /* Particularly important if it was \0! */
+      /* Particularly important if it was \0! */
       return error_type (pp, objfile);
     }
 
@@ -2794,7 +2814,7 @@ rs6000_builtin_type (typenum)
     return negative_types[-typenum];
 
 #if TARGET_CHAR_BIT != 8
-  #error This code wrong for TARGET_CHAR_BIT not 8
+#error This code wrong for TARGET_CHAR_BIT not 8
   /* These definitions all assume that TARGET_CHAR_BIT is 8.  I think
      that if that ever becomes not true, the correct fix will be to
      make the size in the struct type to be in bits, not in units of
@@ -2805,10 +2825,10 @@ rs6000_builtin_type (typenum)
     {
     case 1:
       /* The size of this and all the other types are fixed, defined
-        by the debugging format.  If there is a type called "int" which
-        is other than 32 bits, then it should use a new negative type
-        number (or avoid negative type numbers for that case).
-        See stabs.texinfo.  */
+         by the debugging format.  If there is a type called "int" which
+         is other than 32 bits, then it should use a new negative type
+         number (or avoid negative type numbers for that case).
+         See stabs.texinfo.  */
       rettype = init_type (TYPE_CODE_INT, 4, 0, "int", NULL);
       break;
     case 2:
@@ -2855,8 +2875,8 @@ rs6000_builtin_type (typenum)
       break;
     case 14:
       /* This is an IEEE double on the RS/6000, and different machines with
-        different sizes for "long double" should use different negative
-        type numbers.  See stabs.texinfo.  */
+         different sizes for "long double" should use different negative
+         type numbers.  See stabs.texinfo.  */
       rettype = init_type (TYPE_CODE_FLT, 8, 0, "long double", NULL);
       break;
     case 15:
@@ -2939,11 +2959,11 @@ rs6000_builtin_type (typenum)
 /* Read member function stabs info for C++ classes.  The form of each member
    function data is:
 
-       NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
+   NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
 
    An example with two member functions is:
 
-       afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
+   afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
 
    For the case of overloaded operators, the format is op$::*.funcs, where
    $ is the CPLUS_MARKER (usually '$'), `*' holds the place for an operator
@@ -2969,21 +2989,22 @@ read_member_functions (fip, pp, type, objfile)
     {
       struct next_fnfield *next;
       struct fn_field fn_field;
-    } *sublist;
+    }
+   *sublist;
   struct type *look_ahead_type;
   struct next_fnfieldlist *new_fnlist;
   struct next_fnfield *new_sublist;
   char *main_fn_name;
   register char *p;
-      
+
   /* Process each list until we find something that is not a member function
      or find the end of the functions. */
 
   while (**pp != ';')
     {
       /* We should be positioned at the start of the function name.
-        Scan forward to find the first ':' and if it is not the
-        first of a "::" delimiter, then this is not a member function. */
+         Scan forward to find the first ':' and if it is not the
+         first of a "::" delimiter, then this is not a member function. */
       p = *pp;
       while (*p != ':')
        {
@@ -2997,12 +3018,12 @@ read_member_functions (fip, pp, type, objfile)
       sublist = NULL;
       look_ahead_type = NULL;
       length = 0;
-      
+
       new_fnlist = (struct next_fnfieldlist *)
        xmalloc (sizeof (struct next_fnfieldlist));
       make_cleanup (free, new_fnlist);
       memset (new_fnlist, 0, sizeof (struct next_fnfieldlist));
-      
+
       if ((*pp)[0] == 'o' && (*pp)[1] == 'p' && is_cplus_marker ((*pp)[2]))
        {
          /* This is a completely wierd case.  In order to stuff in the
@@ -3014,9 +3035,10 @@ read_member_functions (fip, pp, type, objfile)
          /* This lets the user type "break operator+".
             We could just put in "+" as the name, but that wouldn't
             work for "*".  */
-         static char opname[32] = {'o', 'p', CPLUS_MARKER};
+         static char opname[32] =
+         {'o', 'p', CPLUS_MARKER};
          char *o = opname + 3;
-         
+
          /* Skip past '::'.  */
          *pp = p + 2;
 
@@ -3036,22 +3058,22 @@ read_member_functions (fip, pp, type, objfile)
          /* Skip past '::'.  */
          *pp = p + 2;
        }
-      new_fnlist -> fn_fieldlist.name = main_fn_name;
-      
+      new_fnlist->fn_fieldlist.name = main_fn_name;
+
       do
        {
          new_sublist =
            (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield));
          make_cleanup (free, new_sublist);
          memset (new_sublist, 0, sizeof (struct next_fnfield));
-         
+
          /* Check for and handle cretinous dbx symbol name continuation!  */
          if (look_ahead_type == NULL)
            {
              /* Normal case. */
              STABS_CONTINUE (pp, objfile);
-             
-             new_sublist -> fn_field.type = read_type (pp, objfile);
+
+             new_sublist->fn_field.type = read_type (pp, objfile);
              if (**pp != ':')
                {
                  /* Invalid symtab info for member function.  */
@@ -3061,93 +3083,93 @@ read_member_functions (fip, pp, type, objfile)
          else
            {
              /* g++ version 1 kludge */
-             new_sublist -> fn_field.type = look_ahead_type;
+             new_sublist->fn_field.type = look_ahead_type;
              look_ahead_type = NULL;
            }
-         
+
          (*pp)++;
          p = *pp;
          while (*p != ';')
            {
              p++;
            }
-         
+
          /* If this is just a stub, then we don't have the real name here. */
 
-         if (TYPE_FLAGS (new_sublist -> fn_field.type) & TYPE_FLAG_STUB)
+         if (TYPE_FLAGS (new_sublist->fn_field.type) & TYPE_FLAG_STUB)
            {
-             if (!TYPE_DOMAIN_TYPE (new_sublist -> fn_field.type))
-               TYPE_DOMAIN_TYPE (new_sublist -> fn_field.type) = type;
-             new_sublist -> fn_field.is_stub = 1;
+             if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type))
+               TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type;
+             new_sublist->fn_field.is_stub = 1;
            }
-         new_sublist -> fn_field.physname = savestring (*pp, p - *pp);
+         new_sublist->fn_field.physname = savestring (*pp, p - *pp);
          *pp = p + 1;
-         
+
          /* Set this member function's visibility fields.  */
          switch (*(*pp)++)
            {
-             case VISIBILITY_PRIVATE:
-               new_sublist -> fn_field.is_private = 1;
-               break;
-             case VISIBILITY_PROTECTED:
-               new_sublist -> fn_field.is_protected = 1;
-               break;
+           case VISIBILITY_PRIVATE:
+             new_sublist->fn_field.is_private = 1;
+             break;
+           case VISIBILITY_PROTECTED:
+             new_sublist->fn_field.is_protected = 1;
+             break;
            }
-         
+
          STABS_CONTINUE (pp, objfile);
          switch (**pp)
            {
-             case 'A': /* Normal functions. */
-               new_sublist -> fn_field.is_const = 0;
-               new_sublist -> fn_field.is_volatile = 0;
-               (*pp)++;
-               break;
-             case 'B': /* `const' member functions. */
-               new_sublist -> fn_field.is_const = 1;
-               new_sublist -> fn_field.is_volatile = 0;
-               (*pp)++;
-               break;
-             case 'C': /* `volatile' member function. */
-               new_sublist -> fn_field.is_const = 0;
-               new_sublist -> fn_field.is_volatile = 1;
-               (*pp)++;
-               break;
-             case 'D': /* `const volatile' member function. */
-               new_sublist -> fn_field.is_const = 1;
-               new_sublist -> fn_field.is_volatile = 1;
-               (*pp)++;
-               break;
-             case '*': /* File compiled with g++ version 1 -- no info */
-             case '?':
-             case '.':
-               break;
-             default:
-               complain (&const_vol_complaint, **pp);
-               break;
+           case 'A':           /* Normal functions. */
+             new_sublist->fn_field.is_const = 0;
+             new_sublist->fn_field.is_volatile = 0;
+             (*pp)++;
+             break;
+           case 'B':           /* `const' member functions. */
+             new_sublist->fn_field.is_const = 1;
+             new_sublist->fn_field.is_volatile = 0;
+             (*pp)++;
+             break;
+           case 'C':           /* `volatile' member function. */
+             new_sublist->fn_field.is_const = 0;
+             new_sublist->fn_field.is_volatile = 1;
+             (*pp)++;
+             break;
+           case 'D':           /* `const volatile' member function. */
+             new_sublist->fn_field.is_const = 1;
+             new_sublist->fn_field.is_volatile = 1;
+             (*pp)++;
+             break;
+           case '*':           /* File compiled with g++ version 1 -- no info */
+           case '?':
+           case '.':
+             break;
+           default:
+             complain (&const_vol_complaint, **pp);
+             break;
            }
-         
+
          switch (*(*pp)++)
            {
-             case '*':
+           case '*':
              {
                int nbits;
-               /* virtual member function, followed by index.
+               /* virtual member function, followed by index.
                   The sign bit is set to distinguish pointers-to-methods
                   from virtual function indicies.  Since the array is
                   in words, the quantity must be shifted left by 1
                   on 16 bit machine, and by 2 on 32 bit machine, forcing
                   the sign bit out, and usable as a valid index into
                   the array.  Remove the sign bit here.  */
-               new_sublist -> fn_field.voffset =
+               new_sublist->fn_field.voffset =
                  (0x7fffffff & read_huge_number (pp, ';', &nbits)) + 2;
                if (nbits != 0)
                  return 0;
-             
+
                STABS_CONTINUE (pp, objfile);
                if (**pp == ';' || **pp == '\0')
                  {
                    /* Must be g++ version 1.  */
-                   new_sublist -> fn_field.fcontext = 0;
+                   new_sublist->fn_field.fcontext = 0;
                  }
                else
                  {
@@ -3161,7 +3183,7 @@ read_member_functions (fip, pp, type, objfile)
                      }
                    else
                      {
-                       new_sublist -> fn_field.fcontext = look_ahead_type;
+                       new_sublist->fn_field.fcontext = look_ahead_type;
                        if (**pp != ';')
                          {
                            return 0;
@@ -3175,50 +3197,50 @@ read_member_functions (fip, pp, type, objfile)
                  }
                break;
              }
-             case '?':
-               /* static member function.  */
-               new_sublist -> fn_field.voffset = VOFFSET_STATIC;
-               if (strncmp (new_sublist -> fn_field.physname,
-                            main_fn_name, strlen (main_fn_name)))
-                 {
-                   new_sublist -> fn_field.is_stub = 1;
-                 }
-               break;
-             
-             default:
-               /* error */
-               complain (&member_fn_complaint, (*pp)[-1]);
-               /* Fall through into normal member function.  */
-             
-             case '.':
-               /* normal member function.  */
-               new_sublist -> fn_field.voffset = 0;
-               new_sublist -> fn_field.fcontext = 0;
-               break;
+           case '?':
+             /* static member function.  */
+             new_sublist->fn_field.voffset = VOFFSET_STATIC;
+             if (strncmp (new_sublist->fn_field.physname,
+                          main_fn_name, strlen (main_fn_name)))
+               {
+                 new_sublist->fn_field.is_stub = 1;
+               }
+             break;
+
+           default:
+             /* error */
+             complain (&member_fn_complaint, (*pp)[-1]);
+             /* Fall through into normal member function.  */
+
+           case '.':
+             /* normal member function.  */
+             new_sublist->fn_field.voffset = 0;
+             new_sublist->fn_field.fcontext = 0;
+             break;
            }
-         
-         new_sublist -> next = sublist;
+
+         new_sublist->next = sublist;
          sublist = new_sublist;
          length++;
          STABS_CONTINUE (pp, objfile);
        }
       while (**pp != ';' && **pp != '\0');
-      
+
       (*pp)++;
-      
-      new_fnlist -> fn_fieldlist.fn_fields = (struct fn_field *)
-       obstack_alloc (&objfile -> type_obstack, 
+
+      new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
+       obstack_alloc (&objfile->type_obstack,
                       sizeof (struct fn_field) * length);
-      memset (new_fnlist -> fn_fieldlist.fn_fields, 0,
+      memset (new_fnlist->fn_fieldlist.fn_fields, 0,
              sizeof (struct fn_field) * length);
-      for (i = length; (i--, sublist); sublist = sublist -> next)
+      for (i = length; (i--, sublist); sublist = sublist->next)
        {
-         new_fnlist -> fn_fieldlist.fn_fields[i] = sublist -> fn_field;
+         new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
        }
-      
-      new_fnlist -> fn_fieldlist.length = length;
-      new_fnlist -> next = fip -> fnlist;
-      fip -> fnlist = new_fnlist;
+
+      new_fnlist->fn_fieldlist.length = length;
+      new_fnlist->next = fip->fnlist;
+      fip->fnlist = new_fnlist;
       nfn_fields++;
       total_length += length;
       STABS_CONTINUE (pp, objfile);
@@ -3264,40 +3286,40 @@ read_cpp_abbrev (fip, pp, type, objfile)
       *pp = p + 1;
 
       /* At this point, *pp points to something like "22:23=*22...",
-        where the type number before the ':' is the "context" and
-        everything after is a regular type definition.  Lookup the
-        type, find it's name, and construct the field name. */
+         where the type number before the ':' is the "context" and
+         everything after is a regular type definition.  Lookup the
+         type, find it's name, and construct the field name. */
 
       context = read_type (pp, objfile);
 
       switch (cpp_abbrev)
        {
-         case 'f':             /* $vf -- a virtual function table pointer */
-           fip->list->field.name =
-             obconcat (&objfile->type_obstack, vptr_name, "", "");
-           break;
+       case 'f':               /* $vf -- a virtual function table pointer */
+         fip->list->field.name =
+           obconcat (&objfile->type_obstack, vptr_name, "", "");
+         break;
 
-         case 'b':             /* $vb -- a virtual bsomethingorother */
-           name = type_name_no_tag (context);
-           if (name == NULL)
-             {
-               complain (&invalid_cpp_type_complaint, symnum);
-               name = "FOO";
-             }
-           fip->list->field.name =
-             obconcat (&objfile->type_obstack, vb_name, name, "");
-           break;
+       case 'b':               /* $vb -- a virtual bsomethingorother */
+         name = type_name_no_tag (context);
+         if (name == NULL)
+           {
+             complain (&invalid_cpp_type_complaint, symnum);
+             name = "FOO";
+           }
+         fip->list->field.name =
+           obconcat (&objfile->type_obstack, vb_name, name, "");
+         break;
 
-         default:
-           complain (&invalid_cpp_abbrev_complaint, *pp);
-           fip->list->field.name =
-             obconcat (&objfile->type_obstack,
-                       "INVALID_CPLUSPLUS_ABBREV", "", "");
-           break;
+       default:
+         complain (&invalid_cpp_abbrev_complaint, *pp);
+         fip->list->field.name =
+           obconcat (&objfile->type_obstack,
+                     "INVALID_CPLUSPLUS_ABBREV", "", "");
+         break;
        }
 
       /* At this point, *pp points to the ':'.  Skip it and read the
-        field type. */
+         field type. */
 
       p = ++(*pp);
       if (p[-1] != ':')
@@ -3307,7 +3329,7 @@ read_cpp_abbrev (fip, pp, type, objfile)
        }
       fip->list->field.type = read_type (pp, objfile);
       if (**pp == ',')
-       (*pp)++;                        /* Skip the comma.  */
+       (*pp)++;                /* Skip the comma.  */
       else
        return 0;
 
@@ -3325,8 +3347,8 @@ read_cpp_abbrev (fip, pp, type, objfile)
     {
       complain (&invalid_cpp_abbrev_complaint, *pp);
       /* We have no idea what syntax an unrecognized abbrev would have, so
-        better return 0.  If we returned 1, we would need to at least advance
-        *pp to avoid an infinite loop.  */
+         better return 0.  If we returned 1, we would need to at least advance
+         *pp to avoid an infinite loop.  */
       return 0;
     }
   return 1;
@@ -3343,7 +3365,7 @@ read_one_struct_field (fip, pp, p, type, objfile)
   /* The following is code to work around cfront generated stabs.
      The stabs contains full mangled name for each field.
      We try to demangle the name and extract the field name out of it.
-  */
+   */
   if (ARM_DEMANGLING && current_subfile->language == language_cplus)
     {
       char save_p;
@@ -3352,40 +3374,40 @@ read_one_struct_field (fip, pp, p, type, objfile)
       *p = '\0';
       dem = cplus_demangle (*pp, DMGL_ANSI | DMGL_PARAMS);
       if (dem != NULL)
-        {
-          dem_p = strrchr (dem, ':');
-          if (dem_p != 0 && *(dem_p-1)==':')
-            dem_p++;
-          FIELD_NAME (fip->list->field) =
-            obsavestring (dem_p, strlen (dem_p), &objfile -> type_obstack);
-        }
+       {
+         dem_p = strrchr (dem, ':');
+         if (dem_p != 0 && *(dem_p - 1) == ':')
+           dem_p++;
+         FIELD_NAME (fip->list->field) =
+           obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack);
+       }
       else
-        {
-          FIELD_NAME (fip->list->field) =
-            obsavestring (*pp, p - *pp, &objfile -> type_obstack);
-        }
+       {
+         FIELD_NAME (fip->list->field) =
+           obsavestring (*pp, p - *pp, &objfile->type_obstack);
+       }
       *p = save_p;
     }
   /* end of code for cfront work around */
 
   else
-    fip -> list -> field.name =
-    obsavestring (*pp, p - *pp, &objfile -> type_obstack);
+    fip->list->field.name =
+      obsavestring (*pp, p - *pp, &objfile->type_obstack);
   *pp = p + 1;
 
   /* This means we have a visibility for a field coming. */
   if (**pp == '/')
     {
       (*pp)++;
-      fip -> list -> visibility = *(*pp)++;
+      fip->list->visibility = *(*pp)++;
     }
   else
     {
       /* normal dbx-style format, no explicit visibility */
-      fip -> list -> visibility = VISIBILITY_PUBLIC;
+      fip->list->visibility = VISIBILITY_PUBLIC;
     }
 
-  fip -> list -> field.type = read_type (pp, objfile);
+  fip->list->field.type = read_type (pp, objfile);
   if (**pp == ':')
     {
       p = ++(*pp);
@@ -3393,12 +3415,13 @@ read_one_struct_field (fip, pp, p, type, objfile)
       /* Possible future hook for nested types. */
       if (**pp == '!')
        {
-         fip -> list -> field.bitpos = (long)-2; /* nested type */
+         fip->list->field.bitpos = (long) -2;  /* nested type */
          p = ++(*pp);
        }
-      else ...;
+      else
+       ...;
 #endif
-      while (*p != ';') 
+      while (*p != ';')
        {
          p++;
        }
@@ -3436,28 +3459,28 @@ read_one_struct_field (fip, pp, p, type, objfile)
       && FIELD_BITSIZE (fip->list->field) == 0)
     {
       /* This can happen in two cases: (1) at least for gcc 2.4.5 or so,
-        it is a field which has been optimized out.  The correct stab for
-        this case is to use VISIBILITY_IGNORE, but that is a recent
-        invention.  (2) It is a 0-size array.  For example
-        union { int num; char str[0]; } foo.  Printing "<no value>" for
-        str in "p foo" is OK, since foo.str (and thus foo.str[3])
-        will continue to work, and a 0-size array as a whole doesn't
-        have any contents to print.
-
-        I suspect this probably could also happen with gcc -gstabs (not
-        -gstabs+) for static fields, and perhaps other C++ extensions.
-        Hopefully few people use -gstabs with gdb, since it is intended
-        for dbx compatibility.  */
+         it is a field which has been optimized out.  The correct stab for
+         this case is to use VISIBILITY_IGNORE, but that is a recent
+         invention.  (2) It is a 0-size array.  For example
+         union { int num; char str[0]; } foo.  Printing "<no value>" for
+         str in "p foo" is OK, since foo.str (and thus foo.str[3])
+         will continue to work, and a 0-size array as a whole doesn't
+         have any contents to print.
+
+         I suspect this probably could also happen with gcc -gstabs (not
+         -gstabs+) for static fields, and perhaps other C++ extensions.
+         Hopefully few people use -gstabs with gdb, since it is intended
+         for dbx compatibility.  */
 
       /* Ignore this field.  */
-      fip -> list-> visibility = VISIBILITY_IGNORE;
+      fip->list->visibility = VISIBILITY_IGNORE;
     }
   else
     {
       /* Detect an unpacked field and mark it as such.
-        dbx gives a bit size for all fields.
-        Note that forward refs cannot be packed,
-        and treat enums as if they had the width of ints.  */
+         dbx gives a bit size for all fields.
+         Note that forward refs cannot be packed,
+         and treat enums as if they had the width of ints.  */
 
       struct type *field_type = check_typedef (FIELD_TYPE (fip->list->field));
 
@@ -3468,11 +3491,11 @@ read_one_struct_field (fip, pp, p, type, objfile)
        {
          FIELD_BITSIZE (fip->list->field) = 0;
        }
-      if ((FIELD_BITSIZE (fip->list->field) 
+      if ((FIELD_BITSIZE (fip->list->field)
           == TARGET_CHAR_BIT * TYPE_LENGTH (field_type)
           || (TYPE_CODE (field_type) == TYPE_CODE_ENUM
-              && FIELD_BITSIZE (fip->list->field) == TARGET_INT_BIT )
-          )
+              && FIELD_BITSIZE (fip->list->field) == TARGET_INT_BIT)
+         )
          &&
          FIELD_BITPOS (fip->list->field) % 8 == 0)
        {
@@ -3484,7 +3507,7 @@ read_one_struct_field (fip, pp, p, type, objfile)
 
 /* Read struct or class data fields.  They have the form:
 
-       NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ;
+   NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ;
 
    At the end, we see a semicolon instead of a field.
 
@@ -3493,10 +3516,10 @@ read_one_struct_field (fip, pp, p, type, objfile)
 
    The optional VISIBILITY is one of:
 
-       '/0'    (VISIBILITY_PRIVATE)
-       '/1'    (VISIBILITY_PROTECTED)
-       '/2'    (VISIBILITY_PUBLIC)
-       '/9'    (VISIBILITY_IGNORE)
+   '/0' (VISIBILITY_PRIVATE)
+   '/1' (VISIBILITY_PROTECTED)
+   '/2' (VISIBILITY_PUBLIC)
+   '/9' (VISIBILITY_IGNORE)
 
    or nothing, for C style fields with public visibility.
 
@@ -3522,22 +3545,23 @@ read_struct_fields (fip, pp, type, objfile)
 
   while (**pp != ';')
     {
-      if (os9k_stabs && **pp == ',') break;
+      if (os9k_stabs && **pp == ',')
+       break;
       STABS_CONTINUE (pp, objfile);
       /* Get space to record the next field's data.  */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
       make_cleanup (free, new);
       memset (new, 0, sizeof (struct nextfield));
-      new -> next = fip -> list;
-      fip -> list = new;
+      new->next = fip->list;
+      fip->list = new;
 
       /* Get the field name.  */
       p = *pp;
 
       /* If is starts with CPLUS_MARKER it is a special abbreviation,
-        unless the CPLUS_MARKER is followed by an underscore, in
-        which case it is just the name of an anonymous type, which we
-        should handle like any other type name.  */
+         unless the CPLUS_MARKER is followed by an underscore, in
+         which case it is just the name of an anonymous type, which we
+         should handle like any other type name.  */
 
       if (is_cplus_marker (p[0]) && p[1] != '_')
        {
@@ -3547,11 +3571,11 @@ read_struct_fields (fip, pp, type, objfile)
        }
 
       /* Look for the ':' that separates the field name from the field
-        values.  Data members are delimited by a single ':', while member
-        functions are delimited by a pair of ':'s.  When we hit the member
-        functions (if any), terminate scan loop and return. */
+         values.  Data members are delimited by a single ':', while member
+         functions are delimited by a pair of ':'s.  When we hit the member
+         functions (if any), terminate scan loop and return. */
 
-      while (*p != ':' && *p != '\0') 
+      while (*p != ':' && *p != '\0')
        {
          p++;
        }
@@ -3568,12 +3592,11 @@ read_struct_fields (fip, pp, type, objfile)
   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. */
-      fip -> list = fip -> list -> next;
+         partially constructed entry which we now scrub. */
+      fip->list = fip->list->next;
     }
   return 1;
 }
-
 /* *INDENT-OFF* */
 /* The stabs for C++ derived classes contain baseclass information which
    is marked by a '!' character after the total size.  This function is
@@ -3600,6 +3623,8 @@ read_struct_fields (fip, pp, type, objfile)
   Return 1 for success, 0 for (error-type-inducing) failure.  */
 /* *INDENT-ON* */
 
+
+
 static int
 read_baseclasses (fip, pp, type, objfile)
      struct field_info *fip;
@@ -3650,50 +3675,52 @@ read_baseclasses (fip, pp, type, objfile)
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
       make_cleanup (free, new);
       memset (new, 0, sizeof (struct nextfield));
-      new -> next = fip -> list;
-      fip -> list = new;
+      new->next = fip->list;
+      fip->list = new;
       FIELD_BITSIZE (new->field) = 0;  /* this should be an unpacked field! */
 
       STABS_CONTINUE (pp, objfile);
       switch (**pp)
        {
-         case '0':
-           /* Nothing to do. */
-           break;
-         case '1':
-           SET_TYPE_FIELD_VIRTUAL (type, i);
-           break;
-         default:
-           /* Unknown character.  Complain and treat it as non-virtual.  */
+       case '0':
+         /* Nothing to do. */
+         break;
+       case '1':
+         SET_TYPE_FIELD_VIRTUAL (type, i);
+         break;
+       default:
+         /* Unknown character.  Complain and treat it as non-virtual.  */
+         {
+           static struct complaint msg =
            {
-             static struct complaint msg = {
-               "Unknown virtual character `%c' for baseclass", 0, 0};
-             complain (&msg, **pp);
-           }
+             "Unknown virtual character `%c' for baseclass", 0, 0};
+           complain (&msg, **pp);
+         }
        }
       ++(*pp);
 
-      new -> visibility = *(*pp)++;
-      switch (new -> visibility)
+      new->visibility = *(*pp)++;
+      switch (new->visibility)
        {
-         case VISIBILITY_PRIVATE:
-         case VISIBILITY_PROTECTED:
-         case VISIBILITY_PUBLIC:
-           break;
-         default:
-           /* Bad visibility format.  Complain and treat it as
-              public.  */
+       case VISIBILITY_PRIVATE:
+       case VISIBILITY_PROTECTED:
+       case VISIBILITY_PUBLIC:
+         break;
+       default:
+         /* Bad visibility format.  Complain and treat it as
+            public.  */
+         {
+           static struct complaint msg =
            {
-             static struct complaint msg = {
-               "Unknown visibility `%c' for baseclass", 0, 0};
-             complain (&msg, new -> visibility);
-             new -> visibility = VISIBILITY_PUBLIC;
-           }
+             "Unknown visibility `%c' for baseclass", 0, 0};
+           complain (&msg, new->visibility);
+           new->visibility = VISIBILITY_PUBLIC;
+         }
        }
 
       {
        int nbits;
-       
+
        /* The remaining value is the bit offset of the portion of the object
           corresponding to this baseclass.  Always zero in the absence of
           multiple inheritance.  */
@@ -3704,11 +3731,11 @@ read_baseclasses (fip, pp, type, objfile)
       }
 
       /* The last piece of baseclass information is the type of the
-        base class.  Read it, and remember it's type name as this
-        field's name. */
+         base class.  Read it, and remember it's type name as this
+         field's name. */
 
-      new -> field.type = read_type (pp, objfile);
-      new -> field.name = type_name_no_tag (new -> field.type);
+      new->field.type = read_type (pp, objfile);
+      new->field.name = type_name_no_tag (new->field.type);
 
       /* skip trailing ';' and bump count of number of fields seen */
       if (**pp == ';')
@@ -3778,16 +3805,16 @@ read_tilde_fields (fip, pp, type, objfile)
              /* Premature end of symbol.  */
              return 0;
            }
-         
+
          TYPE_VPTR_BASETYPE (type) = t;
-         if (type == t)                /* Our own class provides vtbl ptr */
+         if (type == t)        /* Our own class provides vtbl ptr */
            {
              for (i = TYPE_NFIELDS (t) - 1;
                   i >= TYPE_N_BASECLASSES (t);
                   --i)
                {
-                 if (! strncmp (TYPE_FIELD_NAME (t, i), vptr_name, 
-                                sizeof (vptr_name) - 1))
+                 if (!strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
+                               sizeof (vptr_name) - 1))
                    {
                      TYPE_VPTR_FIELDNO (type) = i;
                      goto gotit;
@@ -3802,7 +3829,7 @@ read_tilde_fields (fip, pp, type, objfile)
              TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t);
            }
 
-    gotit:
+       gotit:
          *pp = p + 1;
        }
     }
@@ -3817,11 +3844,11 @@ attach_fn_fields_to_type (fip, type)
   register int n;
 
   for (n = TYPE_NFN_FIELDS (type);
-       fip -> fnlist != NULL;
-       fip -> fnlist = fip -> fnlist -> next)
+       fip->fnlist != NULL;
+       fip->fnlist = fip->fnlist->next)
     {
-      --n;                      /* Circumvent Sun3 compiler bug */
-      TYPE_FN_FIELDLISTS (type)[n] = fip -> fnlist -> fn_fieldlist;
+      --n;                     /* Circumvent Sun3 compiler bug */
+      TYPE_FN_FIELDLISTS (type)[n] = fip->fnlist->fn_fieldlist;
     }
   return 1;
 }
@@ -3829,11 +3856,11 @@ attach_fn_fields_to_type (fip, type)
 /* read cfront class static data.
    pp points to string starting with the list of static data
    eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;;
-                                                                  ^^^^^^^^
+   ^^^^^^^^
 
-       A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
-                                                                              ^
  */
+   A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
+   ^
+ */
 
 static int
 read_cfront_static_fields (fip, pp, type, objfile)
@@ -3842,12 +3869,12 @@ read_cfront_static_fields (fip, pp, type, objfile)
      struct type *type;
      struct objfile *objfile;
 {
-  struct nextfield * new;
+  struct nextfield *new;
   struct type *stype;
-  char * sname;
-  struct symbol * ref_static=0;
-      
-  if (**pp==';')               /* no static data; return */
+  char *sname;
+  struct symbol *ref_static = 0;
+
+  if (**pp == ';')             /* no static data; return */
     {
       ++(*pp);
       return 1;
@@ -3856,33 +3883,34 @@ read_cfront_static_fields (fip, pp, type, objfile)
   /* Process each field in the list until we find the terminating ";" */
 
   /* eg: p = "as__1A ;;;" */
-  STABS_CONTINUE (pp, objfile);                /* handle \\ */
-  while (**pp!=';' && (sname = get_substring (pp, ' '), sname)) 
+  STABS_CONTINUE (pp, objfile);        /* handle \\ */
+  while (**pp != ';' && (sname = get_substring (pp, ' '), sname))
     {
-      ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name*/
-      if (!ref_static) 
-        {
-          static struct complaint msg = {"\
+      ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0);      /*demangled_name */
+      if (!ref_static)
+       {
+         static struct complaint msg =
+         {"\
                Unable to find symbol for static data field %s\n",
-                                0, 0};
+          0, 0};
          complain (&msg, sname);
          continue;
        }
-      stype = SYMBOL_TYPE(ref_static);
+      stype = SYMBOL_TYPE (ref_static);
 
       /* allocate a new fip */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
       make_cleanup (free, new);
       memset (new, 0, sizeof (struct nextfield));
-      new -> next = fip -> list;
-      fip -> list = new;
+      new->next = fip->list;
+      fip->list = new;
 
       /* set visibility */
       /* FIXME! no way to tell visibility from stabs??? */
-      new -> visibility = VISIBILITY_PUBLIC;
+      new->visibility = VISIBILITY_PUBLIC;
 
       /* set field info into fip */
-      fip -> list -> field.type = stype; 
+      fip->list->field.type = stype;
 
       /* set bitpos & bitsize */
       SET_FIELD_PHYSNAME (fip->list->field, savestring (sname, strlen (sname)));
@@ -3891,26 +3919,26 @@ read_cfront_static_fields (fip, pp, type, objfile)
       /* The following is code to work around cfront generated stabs.
          The stabs contains full mangled name for each field.
          We try to demangle the name and extract the field name out of it.
-      */
+       */
       if (ARM_DEMANGLING)
-        {
-          char *dem, *dem_p;
-          dem = cplus_demangle (sname, DMGL_ANSI | DMGL_PARAMS);
-          if (dem != NULL)
-            {
-              dem_p = strrchr (dem, ':');
-              if (dem_p != 0 && *(dem_p-1)==':')
-                dem_p++;
-              fip->list->field.name =
-                obsavestring (dem_p, strlen (dem_p), &objfile -> type_obstack);
-            }
-          else
-            {
-              fip->list->field.name =
-                obsavestring (sname, strlen (sname), &objfile -> type_obstack); 
+       {
+         char *dem, *dem_p;
+         dem = cplus_demangle (sname, DMGL_ANSI | DMGL_PARAMS);
+         if (dem != NULL)
+           {
+             dem_p = strrchr (dem, ':');
+             if (dem_p != 0 && *(dem_p - 1) == ':')
+               dem_p++;
+             fip->list->field.name =
+               obsavestring (dem_p, strlen (dem_p), &objfile->type_obstack);
            }
-        } /* end of code for cfront work around */ 
-    } /* loop again for next static field */
+         else
+           {
+             fip->list->field.name =
+               obsavestring (sname, strlen (sname), &objfile->type_obstack);
+           }
+       }                       /* end of code for cfront work around */
+    }                          /* loop again for next static field */
   return 1;
 }
 
@@ -3926,38 +3954,38 @@ copy_cfront_struct_fields (fip, type, objfile)
      struct type *type;
      struct objfile *objfile;
 {
-  int nfields = TYPE_NFIELDS(type);
+  int nfields = TYPE_NFIELDS (type);
   int i;
-  struct nextfield * new;
+  struct nextfield *new;
 
   /* Copy the fields into the list of fips and reset the types 
      to remove the old fields */
 
-  for (i=0; i<nfields; i++)
+  for (i = 0; i < nfields; i++)
     {
       /* allocate a new fip */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
       make_cleanup (free, new);
       memset (new, 0, sizeof (struct nextfield));
-      new -> next = fip -> list;
-      fip -> list = new;
+      new->next = fip->list;
+      fip->list = new;
 
       /* copy field info into fip */
-      new -> field = TYPE_FIELD (type, i);
+      new->field = TYPE_FIELD (type, i);
       /* set visibility */
       if (TYPE_FIELD_PROTECTED (type, i))
-       new -> visibility = VISIBILITY_PROTECTED;
+       new->visibility = VISIBILITY_PROTECTED;
       else if (TYPE_FIELD_PRIVATE (type, i))
-        new -> visibility = VISIBILITY_PRIVATE;
+       new->visibility = VISIBILITY_PRIVATE;
       else
-        new -> visibility = VISIBILITY_PUBLIC;
+       new->visibility = VISIBILITY_PUBLIC;
     }
   /* Now delete the fields from the type since we will be 
      allocing new space once we get the rest of the fields 
      in attach_fields_to_type.
      The pointer TYPE_FIELDS(type) is left dangling but should 
      be freed later by objstack_free */
-  TYPE_FIELDS (type)=0;
+  TYPE_FIELDS (type) = 0;
   TYPE_NFIELDS (type) = 0;
 
   return 1;
@@ -3982,10 +4010,10 @@ attach_fields_to_type (fip, type, objfile)
      allocate and build the private_field_bits and protected_field_bits
      bitfields. */
 
-  for (scan = fip -> list; scan != NULL; scan = scan -> next)
+  for (scan = fip->list; scan != NULL; scan = scan->next)
     {
       nfields++;
-      if (scan -> visibility != VISIBILITY_PUBLIC)
+      if (scan->visibility != VISIBILITY_PUBLIC)
        {
          non_public_fields++;
        }
@@ -4023,34 +4051,35 @@ attach_fields_to_type (fip, type, objfile)
 
   while (nfields-- > 0)
     {
-      TYPE_FIELD (type, nfields) = fip -> list -> field;
-      switch (fip -> list -> visibility)
+      TYPE_FIELD (type, nfields) = fip->list->field;
+      switch (fip->list->visibility)
        {
-         case VISIBILITY_PRIVATE:
-           SET_TYPE_FIELD_PRIVATE (type, nfields);
-           break;
+       case VISIBILITY_PRIVATE:
+         SET_TYPE_FIELD_PRIVATE (type, nfields);
+         break;
 
-         case VISIBILITY_PROTECTED:
-           SET_TYPE_FIELD_PROTECTED (type, nfields);
-           break;
+       case VISIBILITY_PROTECTED:
+         SET_TYPE_FIELD_PROTECTED (type, nfields);
+         break;
 
-         case VISIBILITY_IGNORE:
-           SET_TYPE_FIELD_IGNORE (type, nfields);
-           break;
+       case VISIBILITY_IGNORE:
+         SET_TYPE_FIELD_IGNORE (type, nfields);
+         break;
 
-         case VISIBILITY_PUBLIC:
-           break;
+       case VISIBILITY_PUBLIC:
+         break;
 
-         default:
-           /* Unknown visibility.  Complain and treat it as public.  */
+       default:
+         /* Unknown visibility.  Complain and treat it as public.  */
+         {
+           static struct complaint msg =
            {
-             static struct complaint msg = {
-               "Unknown visibility `%c' for field", 0, 0};
-             complain (&msg, fip -> list -> visibility);
-           }
-           break;
+             "Unknown visibility `%c' for field", 0, 0};
+           complain (&msg, fip->list->visibility);
+         }
+         break;
        }
-      fip -> list = fip -> list -> next;
+      fip->list = fip->list->next;
     }
   return 1;
 }
@@ -4067,7 +4096,7 @@ attach_fields_to_type (fip, type, objfile)
    OBJFILE points to the current objfile from which the stabs information is
    being read.  (Note that it is redundant in that TYPE also contains a pointer
    to this same objfile, so it might be a good idea to eliminate it.  FIXME). 
  */
+ */
 
 static struct type *
 read_struct_type (pp, type, objfile)
@@ -4165,7 +4194,7 @@ read_array_type (pp, type, objfile)
   upper = read_huge_number (pp, ';', &nbits);
   if (nbits != 0)
     return error_type (pp, objfile);
-  
+
   element_type = read_type (pp, objfile);
 
   if (adjustable)
@@ -4218,8 +4247,8 @@ read_enum_type (pp, type, objfile)
   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).  */
+         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);
@@ -4231,7 +4260,7 @@ read_enum_type (pp, type, objfile)
     {
       /* Skip over the type.  */
       while (**pp != ':')
-        (*pp)++;
+       (*pp)++;
 
       /* Skip over the colon.  */
       (*pp)++;
@@ -4244,18 +4273,19 @@ read_enum_type (pp, type, objfile)
     {
       STABS_CONTINUE (pp, objfile);
       p = *pp;
-      while (*p != ':') p++;
-      name = obsavestring (*pp, p - *pp, &objfile -> symbol_obstack);
+      while (*p != ':')
+       p++;
+      name = obsavestring (*pp, p - *pp, &objfile->symbol_obstack);
       *pp = p + 1;
       n = read_huge_number (pp, ',', &nbits);
       if (nbits != 0)
        return error_type (pp, objfile);
 
       sym = (struct symbol *)
-       obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
+       obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
       memset (sym, 0, sizeof (struct symbol));
       SYMBOL_NAME (sym) = name;
-      SYMBOL_LANGUAGE (sym) = current_subfile -> language;
+      SYMBOL_LANGUAGE (sym) = current_subfile->language;
       SYMBOL_CLASS (sym) = LOC_CONST;
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
       SYMBOL_VALUE (sym) = n;
@@ -4310,11 +4340,11 @@ read_enum_type (pp, type, objfile)
 /* Sun's ACC uses a somewhat saner method for specifying the builtin
    typedefs in every file (for int, long, etc):
 
-       type = b <signed> <width> <format type>; <offset>; <nbits>
-       signed = u or s.
-       optional format type = c or b for char or boolean.
-       offset = offset from high order bit to start bit of type.
-       width is # bytes in object of this type, nbits is # bits in type.
+   type = b <signed> <width> <format type>; <offset>; <nbits>
+   signed = u or s.
+   optional format type = c or b for char or boolean.
+   offset = offset from high order bit to start bit of type.
+   width is # bytes in object of this type, nbits is # bits in type.
 
    The width/offset stuff appears to be for small objects stored in
    larger ones (e.g. `shorts' in `int' registers).  We ignore it for now,
@@ -4333,14 +4363,14 @@ read_sun_builtin_type (pp, typenums, objfile)
 
   switch (**pp)
     {
-      case 's':
-        signed_type = 1;
-       break;
-      case 'u':
-       signed_type = 0;
-       break;
-      default:
-       return error_type (pp, objfile);
+    case 's':
+      signed_type = 1;
+      break;
+    case 'u':
+      signed_type = 0;
+      break;
+    default:
+      return error_type (pp, objfile);
     }
   (*pp)++;
 
@@ -4386,12 +4416,12 @@ read_sun_builtin_type (pp, typenums, objfile)
 
   if (type_bits == 0)
     return init_type (TYPE_CODE_VOID, 1,
-                     signed_type ? 0 : TYPE_FLAG_UNSIGNED, (char *)NULL,
+                     signed_type ? 0 : TYPE_FLAG_UNSIGNED, (char *) NULL,
                      objfile);
   else
     return init_type (code,
                      type_bits / TARGET_CHAR_BIT,
-                     signed_type ? 0 : TYPE_FLAG_UNSIGNED, (char *)NULL,
+                     signed_type ? 0 : TYPE_FLAG_UNSIGNED, (char *) NULL,
                      objfile);
 }
 
@@ -4451,7 +4481,7 @@ read_huge_number (pp, end, bits)
   int nbits = 0;
   int c;
   long upper_limit;
-  
+
   if (*p == '-')
     {
       sign = -1;
@@ -4480,9 +4510,9 @@ read_huge_number (pp, end, bits)
        }
       else
        overflow = 1;
-      
+
       /* This depends on large values being output in octal, which is
-        what GCC does. */
+         what GCC does. */
       if (radix == 8)
        {
          if (nbits == 0)
@@ -4524,9 +4554,9 @@ read_huge_number (pp, end, bits)
            *bits = -1;
          return 0;
        }
-      
+
       /* -0x7f is the same as 0x80.  So deal with it by adding one to
-        the number of bits.  */
+         the number of bits.  */
       if (sign == -1)
        ++nbits;
       if (bits)
@@ -4599,8 +4629,8 @@ read_range_type (pp, typenums, objfile)
          nbits = n3bits;
        }
       /* Range from <large number> to <large number>-1 is a large signed
-        integral type.  Take care of the case where <large number> doesn't
-        fit in a long but <large number>-1 does.  */
+         integral type.  Take care of the case where <large number> doesn't
+         fit in a long but <large number>-1 does.  */
       else if ((n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
               || (n2bits != 0 && n3bits == 0
                   && (n2bits == sizeof (long) * HOST_CHAR_BIT)
@@ -4654,7 +4684,7 @@ read_range_type (pp, typenums, objfile)
     {
       /* It is unsigned int or unsigned long.  */
       /* GCC 2.3.3 uses this for long long too, but that is just a GDB 3.5
-        compatibility hack.  */
+         compatibility hack.  */
       return init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
                        TYPE_FLAG_UNSIGNED, NULL, objfile);
     }
@@ -4673,7 +4703,7 @@ read_range_type (pp, typenums, objfile)
     {
       if (n3 < 0)
        /* n3 actually gives the size.  */
-       return init_type (TYPE_CODE_INT, - n3, TYPE_FLAG_UNSIGNED,
+       return init_type (TYPE_CODE_INT, -n3, TYPE_FLAG_UNSIGNED,
                          NULL, objfile);
       if (n3 == 0xff)
        return init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, NULL, objfile);
@@ -4681,17 +4711,17 @@ read_range_type (pp, typenums, objfile)
        return init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, NULL, objfile);
 
       /* -1 is used for the upper bound of (4 byte) "unsigned int" and
-        "unsigned long", and we already checked for that,
-        so don't need to test for it here.  */
+         "unsigned long", and we already checked for that,
+         so don't need to test for it here.  */
     }
   /* I think this is for Convex "long long".  Since I don't know whether
      Convex sets self_subrange, I also accept that particular size regardless
      of self_subrange.  */
   else if (n3 == 0 && n2 < 0
           && (self_subrange
-              || n2 == - TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT))
-    return init_type (TYPE_CODE_INT, - n2, 0, NULL, objfile);
-  else if (n2 == -n3 -1)
+              || n2 == -TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT))
+    return init_type (TYPE_CODE_INT, -n2, 0, NULL, objfile);
+  else if (n2 == -n3 - 1)
     {
       if (n3 == 0x7f)
        return init_type (TYPE_CODE_INT, 1, 0, NULL, objfile);
@@ -4703,7 +4733,7 @@ read_range_type (pp, typenums, objfile)
 
   /* We have a real range type on our hands.  Allocate space and
      return a real pointer.  */
- handle_true_range:
+handle_true_range:
 
   if (self_subrange)
     index_type = builtin_type_int;
@@ -4739,14 +4769,14 @@ read_args (pp, end, objfile)
      struct objfile *objfile;
 {
   /* FIXME!  Remove this arbitrary limit!  */
-  struct type *types[1024], **rval; /* allow for fns of 1023 parameters */
+  struct type *types[1024], **rval;    /* allow for fns of 1023 parameters */
   int n = 0;
 
   while (**pp != end)
     {
       if (**pp != ',')
        /* Invalid argument list: no ','.  */
-       return (struct type **)-1;
+       return (struct type **) -1;
       (*pp)++;
       STABS_CONTINUE (pp, objfile);
       types[n++] = read_type (pp, objfile);
@@ -4757,7 +4787,7 @@ read_args (pp, end, objfile)
     {
       rval = (struct type **) xmalloc (2 * sizeof (struct type *));
     }
-  else if (TYPE_CODE (types[n-1]) != TYPE_CODE_VOID)
+  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 *));
@@ -4796,7 +4826,8 @@ common_block_start (name, objfile)
 {
   if (common_block_name != NULL)
     {
-      static struct complaint msg = {
+      static struct complaint msg =
+      {
        "Invalid symbol data: common block within common block",
        0, 0};
       complain (&msg);
@@ -4804,7 +4835,7 @@ common_block_start (name, objfile)
   common_block = local_symbols;
   common_block_i = local_symbols ? local_symbols->nsyms : 0;
   common_block_name = obsavestring (name, strlen (name),
-                                   &objfile -> symbol_obstack);
+                                   &objfile->symbol_obstack);
 }
 
 /* Process a N_ECOMM symbol.  */
@@ -4826,13 +4857,14 @@ common_block_end (objfile)
 
   if (common_block_name == NULL)
     {
-      static struct complaint msg = {"ECOMM symbol unmatched by BCOMM", 0, 0};
+      static struct complaint msg =
+      {"ECOMM symbol unmatched by BCOMM", 0, 0};
       complain (&msg);
       return;
     }
 
-  sym = (struct symbol *) 
-    obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
+  sym = (struct symbol *)
+    obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
   memset (sym, 0, sizeof (struct symbol));
   /* Note: common_block_name already saved on symbol_obstack */
   SYMBOL_NAME (sym) = common_block_name;
@@ -4874,20 +4906,20 @@ common_block_end (objfile)
 
 static void
 fix_common_block (sym, valu)
-    struct symbol *sym;
-    int valu;
+     struct symbol *sym;
+     int valu;
 {
   struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
-  for ( ; next; next = next->next)
+  for (; next; next = next->next)
     {
       register int j;
       for (j = next->nsyms - 1; j >= 0; j--)
        SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
     }
 }
+\f
 
 
-\f
 /* What about types defined as forward references inside of a small lexical
    scope?  */
 /* Add a type to the list of undefined types to be checked through
@@ -4911,11 +4943,11 @@ add_undefined_type (type)
    up if possible.  We have two kinds of undefined types:
 
    TYPE_CODE_ARRAY:  Array whose target type wasn't defined yet.
-                       Fix:  update array length using the element bounds
-                       and the target type's length.
+   Fix:  update array length using the element bounds
+   and the target type's length.
    TYPE_CODE_STRUCT, TYPE_CODE_UNION:  Structure whose fields were not
-                       yet defined at the time a pointer to it was made.
-                       Fix:  Do a full lookup on the struct/union tag.  */
+   yet defined at the time a pointer to it was made.
+   Fix:  Do a full lookup on the struct/union tag.  */
 void
 cleanup_undefined_types ()
 {
@@ -4926,9 +4958,9 @@ cleanup_undefined_types ()
       switch (TYPE_CODE (*type))
        {
 
-         case TYPE_CODE_STRUCT:
-         case TYPE_CODE_UNION:
-         case TYPE_CODE_ENUM:
+       case TYPE_CODE_STRUCT:
+       case TYPE_CODE_UNION:
+       case TYPE_CODE_ENUM:
          {
            /* Check if it has been defined since.  Need to do this here
               as well as in check_typedef to deal with the (legitimate in
@@ -4943,7 +4975,8 @@ cleanup_undefined_types ()
 
                if (typename == NULL)
                  {
-                   static struct complaint msg = {"need a type name", 0, 0};
+                   static struct complaint msg =
+                   {"need a type name", 0, 0};
                    complain (&msg);
                    break;
                  }
@@ -4952,7 +4985,7 @@ cleanup_undefined_types ()
                    for (i = 0; i < ppt->nsyms; i++)
                      {
                        struct symbol *sym = ppt->symbol[i];
-                       
+
                        if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
                            && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE
                            && (TYPE_CODE (SYMBOL_TYPE (sym)) ==
@@ -4970,7 +5003,8 @@ cleanup_undefined_types ()
 
        default:
          {
-           static struct complaint msg = {"\
+           static struct complaint msg =
+           {"\
 GDB internal error.  cleanup_undefined_types with bad type %d.", 0, 0};
            complain (&msg, TYPE_CODE (*type));
          }
@@ -5007,7 +5041,7 @@ scan_file_globals (objfile)
   while (1)
     {
       /* Avoid expensive loop through all minimal symbols if there are
-        no unresolved symbols.  */
+         no unresolved symbols.  */
       for (hash = 0; hash < HASHSIZE; hash++)
        {
          if (global_sym_chain[hash])
@@ -5016,7 +5050,7 @@ scan_file_globals (objfile)
       if (hash >= HASHSIZE)
        return;
 
-      for (msymbol = resolve_objfile -> msymbols;
+      for (msymbol = resolve_objfile->msymbols;
           msymbol && SYMBOL_NAME (msymbol) != NULL;
           msymbol++)
        {
@@ -5043,7 +5077,7 @@ scan_file_globals (objfile)
          for (sym = global_sym_chain[hash]; sym;)
            {
              if (SYMBOL_NAME (msymbol)[0] == SYMBOL_NAME (sym)[0] &&
-                 STREQ(SYMBOL_NAME (msymbol) + 1, SYMBOL_NAME (sym) + 1))
+                 STREQ (SYMBOL_NAME (msymbol) + 1, SYMBOL_NAME (sym) + 1))
                {
 
                  struct alias_list *aliases;
@@ -5058,7 +5092,7 @@ scan_file_globals (objfile)
                    {
                      global_sym_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
                    }
-                 
+
                  /* Check to see whether we need to fix up a common block.  */
                  /* Note: this code might be executed several times for
                     the same symbol if there are multiple references.  */
@@ -5066,7 +5100,7 @@ scan_file_globals (objfile)
                  /* If symbol has aliases, do minimal symbol fixups for each.
                     These live aliases/references weren't added to 
                     global_sym_chain hash but may also need to be fixed up. */
-                 /* FIXME: Maybe should have added aliases to the global chain,                     resolved symbol name, then treated aliases as normal 
+                 /* FIXME: Maybe should have added aliases to the global chain,                     resolved symbol name, then treated aliases as normal 
                     symbols?  Still, we wouldn't want to add_to_list. */
                  /* Now do the same for each alias of this symbol */
                  rsym = sym;
@@ -5093,7 +5127,7 @@ scan_file_globals (objfile)
                        rsym = NULL;
                    }
 
-                 
+
                  if (prev)
                    {
                      sym = SYMBOL_VALUE_CHAIN (prev);
@@ -5134,7 +5168,7 @@ scan_file_globals (objfile)
            SYMBOL_CLASS (prev) = LOC_UNRESOLVED;
          else
            complain (&unresolved_sym_chain_complaint,
-                     objfile -> name, SYMBOL_NAME (prev));
+                     objfile->name, SYMBOL_NAME (prev));
        }
     }
   memset (global_sym_chain, 0, sizeof (global_sym_chain));
@@ -5163,7 +5197,8 @@ stabsread_new_init ()
 /* Initialize anything that needs initializing at the same time as
    start_symtab() is called. */
 
-void start_stabs ()
+void
+start_stabs ()
 {
   global_stabs = NULL;         /* AIX COFF */
   /* Leave FILENUM of 0 free for builtin types and this file's types.  */
@@ -5179,7 +5214,8 @@ void start_stabs ()
 
 /* Call after end_symtab() */
 
-void end_stabs ()
+void
+end_stabs ()
 {
   if (type_vector)
     {
index 77ea2912b85075681928489df18760f17bc933bf..013a99a7859c5aaed7f78181f62998e2105fb773 100644 (file)
@@ -1,21 +1,22 @@
 /* Include file for stabs debugging format support functions.
    Copyright 1986-1991, 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Definitions, prototypes, etc for stabs debugging format support
    functions.
@@ -51,11 +52,11 @@ extern void common_block_end PARAMS ((struct objfile *));
 /* Kludge for xcoffread.c */
 
 struct pending_stabs
-{
-  int count;
-  int length;
-  char *stab[1];
-};
+  {
+    int count;
+    int length;
+    char *stab[1];
+  };
 
 EXTERN struct pending_stabs *global_stabs;
 
@@ -85,26 +86,26 @@ EXTERN int previous_stab_code;
    used to match header-file references to their corresponding data.  */
 
 struct header_file
-{
+  {
 
-  /* Name of header file */
-  
-  char *name;
+    /* Name of header file */
 
-  /* Numeric code distinguishing instances of one header file that produced
-     different results when included.  It comes from the N_BINCL or N_EXCL. */
+    char *name;
 
-  int instance;
+    /* Numeric code distinguishing instances of one header file that produced
+       different results when included.  It comes from the N_BINCL or N_EXCL. */
 
-  /* Pointer to vector of types */
+    int instance;
 
-  struct type **vector;
+    /* Pointer to vector of types */
 
-  /* Allocated length (# elts) of that vector */
+    struct type **vector;
 
-  int length;
+    /* Allocated length (# elts) of that vector */
 
-};
+    int length;
+
+  };
 
 /* The table of header_files of this OBJFILE. */
 #define HEADER_FILES(OBJFILE) (DBX_SYMFILE_INFO (OBJFILE)->header_files)
@@ -136,13 +137,13 @@ extern struct complaint unknown_symtype_complaint;
 extern struct complaint unknown_symchar_complaint;
 
 extern struct type *
-read_type PARAMS ((char **, struct objfile *));
+  read_type PARAMS ((char **, struct objfile *));
 
 extern void
 cleanup_undefined_types PARAMS ((void));
 
 extern struct type **
-dbx_lookup_type PARAMS ((int [2]));
+  dbx_lookup_type PARAMS ((int[2]));
 
 extern long
 read_number PARAMS ((char **, int));
@@ -151,7 +152,7 @@ extern void
 add_undefined_type PARAMS ((struct type *));
 
 extern struct symbol *
-define_symbol PARAMS ((CORE_ADDR, char *, int, int, struct objfile *));
+  define_symbol PARAMS ((CORE_ADDR, char *, int, int, struct objfile *));
 
 extern void
 stabsread_init PARAMS ((void));
@@ -166,65 +167,65 @@ extern void
 end_stabs PARAMS ((void));
 
 extern void
-finish_global_stabs PARAMS ((struct objfile *objfile));
-
+finish_global_stabs PARAMS ((struct objfile * objfile));
 \f
+
 EXTERN int os9k_stabs;
 \f
 /* COFF files can have multiple .stab sections, if they are linked
    using --split-by-reloc.  This linked list is used to pass the
    information into the functions in dbxread.c.  */
 struct stab_section_list
-{
-  /* Next in list.  */
-  struct stab_section_list *next;
+  {
+    /* Next in list.  */
+    struct stab_section_list *next;
 
-  /* Stab section.  */
-  asection *section;
-};
+    /* Stab section.  */
+    asection *section;
+  };
 \f
 /* Functions exported by dbxread.c.  These are not in stabsread.c because
    they are only used by some stabs readers.  */
 
 extern struct partial_symtab *
-start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
-                      CORE_ADDR, int, struct partial_symbol **,
-                      struct partial_symbol **));
+  start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
+                        CORE_ADDR, int, struct partial_symbol **,
+                        struct partial_symbol **));
 
 extern struct partial_symtab *
-end_psymtab PARAMS ((struct partial_symtab *pst,
-                    char **include_list,
-                    int num_includes,
-                    int capping_symbol_offset,
-                    CORE_ADDR capping_text,
-                    struct partial_symtab **dependency_list,
-                    int number_dependencies,
-                    int textlow_not_set));
+  end_psymtab PARAMS ((struct partial_symtab * pst,
+                      char **include_list,
+                      int num_includes,
+                      int capping_symbol_offset,
+                      CORE_ADDR capping_text,
+                      struct partial_symtab ** dependency_list,
+                      int number_dependencies,
+                      int textlow_not_set));
 
 extern void
 process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
                            struct section_offsets *, struct objfile *));
 
 extern void elfstab_build_psymtabs
-  PARAMS ((struct objfile *objfile,
-          struct section_offsets *section_offsets,
+  PARAMS ((struct objfile * objfile,
+          struct section_offsets * section_offsets,
           int mainline,
           file_ptr staboff, unsigned int stabsize,
           file_ptr stabstroffset,
           unsigned int stabstrsize));
 
 extern void coffstab_build_psymtabs
-  PARAMS ((struct objfile *objfile,
-          struct section_offsets *section_offsets,
+  PARAMS ((struct objfile * objfile,
+          struct section_offsets * section_offsets,
           int mainline,
           CORE_ADDR textaddr, unsigned int textsize,
-          struct stab_section_list *stabs,
+          struct stab_section_list * stabs,
           file_ptr stabstroffset,
           unsigned int stabstrsize));
 
 extern void stabsect_build_psymtabs
-  PARAMS ((struct objfile *objfile,
-          struct section_offsets *section_offsets,
+  PARAMS ((struct objfile * objfile,
+          struct section_offsets * section_offsets,
           int mainline,
           char *stab_name,
           char *stabstr_name,
@@ -233,17 +234,17 @@ extern void stabsect_build_psymtabs
 extern void elfstab_offset_sections PARAMS ((struct objfile *,
                                             struct partial_symtab *));
 
-extern void process_later 
-  PARAMS ((struct symbol *, char *, 
+extern void process_later
+  PARAMS ((struct symbol *, char *,
           int (*f) PARAMS ((struct objfile *, struct symbol *, char *))));
 
 extern int symbol_reference_defined PARAMS ((char **));
 
 extern void ref_add PARAMS ((int, struct symbol *, char *, CORE_ADDR));
 
-extern struct symbol * ref_search PARAMS ((int));
+extern struct symbol *ref_search PARAMS ((int));
 
-extern int resolve_cfront_continuation 
-  PARAMS ((struct objfile * objfile, struct symbol * sym, char * p));
+extern int resolve_cfront_continuation
+  PARAMS ((struct objfile * objfile, struct symbol * sym, char *p));
 
 #undef EXTERN
index bae471192f9fa3a0ff7088ced9f21d3beee4dd9f..30486be7c926541f6a3890ff5881bc96d0043efc 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 98, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
 #include "defs.h"
@@ -92,7 +93,7 @@ static int print_block_frame_locals PARAMS ((struct block *,
                                             GDB_FILE *));
 
 static void print_frame_info_base PARAMS ((struct frame_info *, int, int, int));
-  
+
 static void print_stack_frame_base PARAMS ((struct frame_info *, int, int));
 
 static void backtrace_command PARAMS ((char *, int));
@@ -123,14 +124,15 @@ int selected_frame_level;
    cases and in a slightly different syntax.  */
 
 int annotation_level = 0;
-
 \f
-struct print_stack_frame_args {
-  struct frame_info *fi;
-  int level;
-  int source;
-  int args;
-};
+
+struct print_stack_frame_args
+  {
+    struct frame_info *fi;
+    int level;
+    int source;
+    int args;
+  };
 
 static int print_stack_frame_base_stub PARAMS ((char *));
 
@@ -141,7 +143,7 @@ static int
 show_and_print_stack_frame_stub (args)
      void *args;
 {
-  struct print_stack_frame_args *p = (struct print_stack_frame_args *)args;
+  struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
 
   /* Reversed order of these so tuiDo() doesn't occur
    * in the middle of "Breakpoint 1 ... [location]" printing = RT
@@ -160,7 +162,7 @@ static int
 print_stack_frame_stub (args)
      void *args;
 {
-  struct print_stack_frame_args *p = (struct print_stack_frame_args *)args;
+  struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
 
   if (tui_version)
     print_frame_info (p->fi, p->level, p->source, p->args);
@@ -178,7 +180,7 @@ static int
 print_stack_frame_base_stub (args)
      char *args;
 {
-  struct print_stack_frame_args *p = (struct print_stack_frame_args *)args;
+  struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
 
   print_frame_info_base (p->fi, p->level, p->source, p->args);
   return 0;
@@ -191,7 +193,7 @@ static int
 print_only_stack_frame_stub (args)
      void *args;
 {
-  struct print_stack_frame_args *p = (struct print_stack_frame_args *)args;
+  struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
 
   print_frame_info_base (p->fi, p->level, p->source, p->args);
   return 0;
@@ -273,7 +275,7 @@ print_stack_frame (fi, level, source)
   args.source = source;
   args.args = 1;
 
-  catch_errors (print_stack_frame_stub, (char *)&args, "", RETURN_MASK_ALL);
+  catch_errors (print_stack_frame_stub, (char *) &args, "", RETURN_MASK_ALL);
 }
 
 /* Print a stack frame briefly.  FRAME_INFI should be the frame info
@@ -302,7 +304,8 @@ print_only_stack_frame (fi, level, source)
   catch_errors (print_only_stack_frame_stub, &args, "", RETURN_MASK_ALL);
 }
 
-struct print_args_args {
+struct print_args_args
+{
   struct symbol *func;
   struct frame_info *fi;
   GDB_FILE *stream;
@@ -317,7 +320,7 @@ print_args_stub (args)
      PTR args;
 {
   int numargs;
-  struct print_args_args *p = (struct print_args_args *)args;
+  struct print_args_args *p = (struct print_args_args *) args;
 
   numargs = FRAME_NUM_ARGS (p->fi);
   print_frame_args (p->func, p->fi, numargs, p->stream);
@@ -353,8 +356,8 @@ print_frame_info_base (fi, level, source, args)
   /* On the 68k, this spends too much time in m68k_find_saved_regs.  */
 
   /* Get the value of SP_REGNUM relative to the frame.  */
-  get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL,
-                     FRAME_INFO_ID (fi), SP_REGNUM, (enum lval_type *)NULL);
+  get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
+                   FRAME_INFO_ID (fi), SP_REGNUM, (enum lval_type *) NULL);
   sp = extract_address (buf, REGISTER_RAW_SIZE (SP_REGNUM));
 
   /* This is not a perfect test, because if a function alloca's some
@@ -369,7 +372,7 @@ print_frame_info_base (fi, level, source, args)
       annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
 
       /* Do this regardless of SOURCE because we don't have any source
-        to list for this frame.  */
+         to list for this frame.  */
       if (level >= 0)
        printf_filtered ("#%-2d ", level);
       annotate_function_call ();
@@ -382,7 +385,7 @@ print_frame_info_base (fi, level, source, args)
       annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
 
       /* Do this regardless of SOURCE because we don't have any source
-        to list for this frame.  */
+         to list for this frame.  */
       if (level >= 0)
        printf_filtered ("#%-2d ", level);
       annotate_signal_handler_caller ();
@@ -407,24 +410,24 @@ print_frame_info_base (fi, level, source, args)
   if (func)
     {
       /* In certain pathological cases, the symtabs give the wrong
-        function (when we are in the first function in a file which
-        is compiled without debugging symbols, the previous function
-        is compiled with debugging symbols, and the "foo.o" symbol
-        that is supposed to tell us where the file with debugging symbols
-        ends has been truncated by ar because it is longer than 15
-        characters).  This also occurs if the user uses asm() to create
-        a function but not stabs for it (in a file compiled -g).
-
-        So look in the minimal symbol tables as well, and if it comes
-        up with a larger address for the function use that instead.
-        I don't think this can ever cause any problems; there shouldn't
-        be any minimal symbols in the middle of a function; if this is
-        ever changed many parts of GDB will need to be changed (and we'll
-        create a find_pc_minimal_function or some such).  */
+         function (when we are in the first function in a file which
+         is compiled without debugging symbols, the previous function
+         is compiled with debugging symbols, and the "foo.o" symbol
+         that is supposed to tell us where the file with debugging symbols
+         ends has been truncated by ar because it is longer than 15
+         characters).  This also occurs if the user uses asm() to create
+         a function but not stabs for it (in a file compiled -g).
+
+         So look in the minimal symbol tables as well, and if it comes
+         up with a larger address for the function use that instead.
+         I don't think this can ever cause any problems; there shouldn't
+         be any minimal symbols in the middle of a function; if this is
+         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);
       if (msymbol != NULL
-         && (SYMBOL_VALUE_ADDRESS (msymbol) 
+         && (SYMBOL_VALUE_ADDRESS (msymbol)
              > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
        {
 #if 0
@@ -443,31 +446,32 @@ print_frame_info_base (fi, level, source, args)
        }
       else
        {
-          /* I'd like to use SYMBOL_SOURCE_NAME() here, to display
-           * the demangled name that we already have stored in
-           * the symbol table, but we stored a version with
-           * DMGL_PARAMS turned on, and here we don't want
-           * to display parameters. So call the demangler again,
-           * with DMGL_ANSI only. RT
-           * (Yes, I know that printf_symbol_filtered() will
-           * again try to demangle the name on the fly, but
-           * the issue is that if cplus_demangle() fails here,
-           * it'll fail there too. So we want to catch the failure
-           * ("demangled==NULL" case below) here, while we still
-           * have our hands on the function symbol.)
-           */
-          char * demangled;
+         /* I'd like to use SYMBOL_SOURCE_NAME() here, to display
+          * the demangled name that we already have stored in
+          * the symbol table, but we stored a version with
+          * DMGL_PARAMS turned on, and here we don't want
+          * to display parameters. So call the demangler again,
+          * with DMGL_ANSI only. RT
+          * (Yes, I know that printf_symbol_filtered() will
+          * again try to demangle the name on the fly, but
+          * the issue is that if cplus_demangle() fails here,
+          * it'll fail there too. So we want to catch the failure
+          * ("demangled==NULL" case below) here, while we still
+          * have our hands on the function symbol.)
+          */
+         char *demangled;
          funname = SYMBOL_NAME (func);
          funlang = SYMBOL_LANGUAGE (func);
-          if (funlang == language_cplus) {
-            demangled = cplus_demangle (funname, DMGL_ANSI);
-            if (demangled == NULL)
-              /* If the demangler fails, try the demangled name
-               * from the symbol table. This'll have parameters,
-               * but that's preferable to diplaying a mangled name.
-               */
-             funname = SYMBOL_SOURCE_NAME (func);
-          }
+         if (funlang == language_cplus)
+           {
+             demangled = cplus_demangle (funname, DMGL_ANSI);
+             if (demangled == NULL)
+               /* If the demangler fails, try the demangled name
+                * from the symbol table. This'll have parameters,
+                * but that's preferable to diplaying a mangled name.
+                */
+               funname = SYMBOL_SOURCE_NAME (func);
+           }
        }
     }
   else
@@ -513,7 +517,7 @@ print_frame_info_base (fi, level, source, args)
       if (sal.symtab && sal.symtab->filename)
        {
          annotate_frame_source_begin ();
-          wrap_here ("   ");
+         wrap_here ("   ");
          printf_filtered (" at ");
          annotate_frame_source_file ();
          printf_filtered ("%s", sal.symtab->filename);
@@ -525,9 +529,9 @@ print_frame_info_base (fi, level, source, args)
        }
 
 #ifdef PC_LOAD_SEGMENT
-     /* If we couldn't print out function name but if can figure out what
-        load segment this pc value is from, at least print out some info
-       about its load segment. */
+      /* If we couldn't print out function name but if can figure out what
+         load segment this pc value is from, at least print out some info
+         about its load segment. */
       if (!funname)
        {
          annotate_frame_where ();
@@ -569,7 +573,7 @@ print_frame_info_base (fi, level, source, args)
          else if (!tui_version)
            print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
        }
-      current_source_line = max (sal.line - lines_to_list/2, 1);
+      current_source_line = max (sal.line - lines_to_list / 2, 1);
     }
   if (source != 0)
     set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
@@ -582,9 +586,9 @@ print_frame_info_base (fi, level, source, args)
 
 #if 0
 void
-stack_publish_stopped_with_no_frame()
+stack_publish_stopped_with_no_frame ()
 {
-  TUIDO(((TuiOpaqueFuncPtr)tuiUpdateOnEnd));
+  TUIDO (((TuiOpaqueFuncPtr) tuiUpdateOnEnd));
 
   return;
 }
@@ -593,35 +597,35 @@ stack_publish_stopped_with_no_frame()
 /* Show or print the frame info.  If this is the tui, it will be shown in 
    the source display */
 void
-print_frame_info(fi, level, source, args)
+print_frame_info (fi, level, source, args)
      struct frame_info *fi;
      register int level;
      int source;
      int args;
 {
   if (!tui_version)
-    print_frame_info_base(fi, level, source, args);
+    print_frame_info_base (fi, level, source, args);
   else
-  {
-    if (fi && (frame_in_dummy(fi) || fi->signal_handler_caller))
-      print_frame_info_base(fi, level, source, args);
-    else
-      {
-       TUIDO(((TuiOpaqueFuncPtr)tui_vShowFrameInfo, fi));
-      }
-  }
+    {
+      if (fi && (frame_in_dummy (fi) || fi->signal_handler_caller))
+       print_frame_info_base (fi, level, source, args);
+      else
+       {
+         TUIDO (((TuiOpaqueFuncPtr) tui_vShowFrameInfo, fi));
+       }
+    }
 }
 
 /* Show the frame info.  If this is the tui, it will be shown in 
    the source display otherwise, nothing is done */
 void
-show_stack_frame(fi)
+show_stack_frame (fi)
      struct frame_info *fi;
 {
-  TUIDO(((TuiOpaqueFuncPtr)tui_vShowFrameInfo, fi));
+  TUIDO (((TuiOpaqueFuncPtr) tui_vShowFrameInfo, fi));
 }
-
 \f
+
 /* Read a frame specification in whatever the appropriate format is.
    Call error() if the specification is in any way invalid (i.e.
    this function never returns NULL).  */
@@ -633,22 +637,23 @@ parse_frame_specification (frame_exp)
   int numargs = 0;
 #define        MAXARGS 4
   CORE_ADDR args[MAXARGS];
-  
+
   if (frame_exp)
     {
       char *addr_string, *p;
       struct cleanup *tmp_cleanup;
 
-      while (*frame_exp == ' ') frame_exp++;
+      while (*frame_exp == ' ')
+       frame_exp++;
 
       while (*frame_exp)
        {
          if (numargs > MAXARGS)
            error ("Too many args in frame specification");
          /* Parse an argument.  */
-          for (p = frame_exp; *p && *p != ' '; p++)
+         for (p = frame_exp; *p && *p != ' '; p++)
            ;
-         addr_string = savestring(frame_exp, p - frame_exp);
+         addr_string = savestring (frame_exp, p - frame_exp);
 
          {
            tmp_cleanup = make_cleanup (free, addr_string);
@@ -657,7 +662,8 @@ parse_frame_specification (frame_exp)
          }
 
          /* Skip spaces, move to possible next arg.  */
-         while (*p == ' ') p++;
+         while (*p == ' ')
+           p++;
          frame_exp = p;
        }
     }
@@ -673,7 +679,7 @@ parse_frame_specification (frame_exp)
       {
        int level = args[0];
        struct frame_info *fid =
-         find_relative_frame (get_current_frame (), &level);
+       find_relative_frame (get_current_frame (), &level);
        struct frame_info *tfid;
 
        if (level == 0)
@@ -708,17 +714,17 @@ parse_frame_specification (frame_exp)
          while ((tfid = get_prev_frame (fid)) &&
                 (tfid->frame == args[0]))
            fid = tfid;
-         
+
        /* We couldn't identify the frame as an existing frame, but
           perhaps we can create one with a single argument.  */
       }
 
-     default:
+    default:
 #ifdef SETUP_ARBITRARY_FRAME
       return SETUP_ARBITRARY_FRAME (numargs, args);
 #else
       /* Usual case.  Do it here rather than have everyone supply
-        a SETUP_ARBITRARY_FRAME that does this.  */
+         a SETUP_ARBITRARY_FRAME that does this.  */
       if (numargs == 1)
        return create_new_frame (args[0], 0);
       error ("Too many args in frame specification");
@@ -767,7 +773,7 @@ frame_info (addr_exp, from_tty)
                      && !fi->next->signal_handler_caller
                      && !frame_in_dummy (fi->next));
   func = get_frame_function (fi);
-  s = find_pc_symtab(fi->pc);
+  s = find_pc_symtab (fi->pc);
   if (func)
     {
       /* I'd like to use SYMBOL_SOURCE_NAME() here, to display
@@ -783,19 +789,19 @@ frame_info (addr_exp, from_tty)
        * ("demangled==NULL" case below) here, while we still
        * have our hands on the function symbol.)
        */
-       char * demangled;
-       funname = SYMBOL_NAME (func);
-       funlang = SYMBOL_LANGUAGE (func);
-       if (funlang == language_cplus)
-        {
-          demangled = cplus_demangle (funname, DMGL_ANSI);
-          /* If the demangler fails, try the demangled name
-           * from the symbol table. This'll have parameters,
-           * but that's preferable to diplaying a mangled name.
-           */
-          if (demangled == NULL)
-            funname = SYMBOL_SOURCE_NAME (func);
-        }
+      char *demangled;
+      funname = SYMBOL_NAME (func);
+      funlang = SYMBOL_LANGUAGE (func);
+      if (funlang == language_cplus)
+       {
+         demangled = cplus_demangle (funname, DMGL_ANSI);
+         /* If the demangler fails, try the demangled name
+          * from the symbol table. This'll have parameters,
+          * but that's preferable to diplaying a mangled name.
+          */
+         if (demangled == NULL)
+           funname = SYMBOL_SOURCE_NAME (func);
+       }
     }
   else
     {
@@ -913,7 +919,7 @@ frame_info (addr_exp, from_tty)
   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.  */
+         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");
@@ -937,9 +943,9 @@ frame_info (addr_exp, from_tty)
   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.  */
+         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.  */
       puts_filtered ("\n");
     }
 }
@@ -1014,7 +1020,7 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
              QUIT;
              current = get_prev_frame (current);
            }
-         
+
          /* Will stop when CURRENT reaches the top of the stack.  TRAILING
             will be COUNT below it.  */
          while (current)
@@ -1024,7 +1030,7 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
              current = get_prev_frame (current);
              trailing_level++;
            }
-         
+
          count = -1;
        }
     }
@@ -1034,12 +1040,12 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
   if (info_verbose)
     {
       struct partial_symtab *ps;
-      
+
       /* Read in symbols for all of the frames.  Need to do this in
-        a separate pass so that "Reading in symbols for xxx" messages
-        don't screw up the appearance of the backtrace.  Also
-        if people have strong opinions against reading symbols for
-        backtrace this may have to be an option.  */
+         a separate pass so that "Reading in symbols for xxx" messages
+         don't screw up the appearance of the backtrace.  Also
+         if people have strong opinions against reading symbols for
+         backtrace this may have to be an option.  */
       i = count;
       for (fi = trailing;
           fi != NULL && i--;
@@ -1059,12 +1065,12 @@ backtrace_command_1 (count_exp, show_locals, from_tty)
       QUIT;
 
       /* Don't use print_stack_frame; if an error() occurs it probably
-        means further attempts to backtrace would fail (on the other
-        hand, perhaps the code does or could be fixed to make sure
-        the frame->prev field gets set to NULL in that case).  */
+         means further attempts to backtrace would fail (on the other
+         hand, perhaps the code does or could be fixed to make sure
+         the frame->prev field gets set to NULL in that case).  */
       print_frame_info_base (fi, trailing_level + i, 0, 1);
       if (show_locals)
-       print_frame_local_vars(fi, 1, gdb_stdout);
+       print_frame_local_vars (fi, 1, gdb_stdout);
     }
 
   /* If we've stopped before the end, mention that.  */
@@ -1077,66 +1083,66 @@ backtrace_command (arg, from_tty)
      char *arg;
      int from_tty;
 {
-  struct cleanup    *old_chain = (struct cleanup *)NULL;
-  char              **argv = (char **)NULL;
-  int               argIndicatingFullTrace = (-1), totArgLen = 0, argc = 0;
-  char              *argPtr = arg;
+  struct cleanup *old_chain = (struct cleanup *) NULL;
+  char **argv = (char **) NULL;
+  int argIndicatingFullTrace = (-1), totArgLen = 0, argc = 0;
+  char *argPtr = arg;
 
-  if (arg != (char *)NULL)
+  if (arg != (char *) NULL)
     {
       int i;
 
-      argv = buildargv(arg);
+      argv = buildargv (arg);
       old_chain = make_cleanup_freeargv (argv);
       argc = 0;
-      for (i = 0; (argv[i] != (char *)NULL); i++)
-        {
-          int j;
-
-          for (j = 0; (j < strlen(argv[i])); j++)
-            argv[i][j] = tolower(argv[i][j]);
-
-          if (argIndicatingFullTrace < 0 && subset_compare (argv[i], "full"))
-            argIndicatingFullTrace = argc;
-          else
-            {
-              argc++;
-              totArgLen += strlen(argv[i]);
-            }
-        }
+      for (i = 0; (argv[i] != (char *) NULL); i++)
+       {
+         int j;
+
+         for (j = 0; (j < strlen (argv[i])); j++)
+           argv[i][j] = tolower (argv[i][j]);
+
+         if (argIndicatingFullTrace < 0 && subset_compare (argv[i], "full"))
+           argIndicatingFullTrace = argc;
+         else
+           {
+             argc++;
+             totArgLen += strlen (argv[i]);
+           }
+       }
       totArgLen += argc;
       if (argIndicatingFullTrace >= 0)
-        {
-          if (totArgLen > 0)
-            {
-              argPtr = (char *)xmalloc(totArgLen + 1);
-              if (!argPtr)
-                nomem(0);
-              else
-                {
-                  memset(argPtr, 0, totArgLen + 1);
-                  for (i = 0; (i < (argc + 1)); i++)
-                    {
-                      if (i != argIndicatingFullTrace)
-                        {
-                          strcat(argPtr, argv[i]);
-                          strcat(argPtr, " ");
-                        }
-                    }
-                }
-            }
-          else
-            argPtr = (char *)NULL;
-        }
+       {
+         if (totArgLen > 0)
+           {
+             argPtr = (char *) xmalloc (totArgLen + 1);
+             if (!argPtr)
+               nomem (0);
+             else
+               {
+                 memset (argPtr, 0, totArgLen + 1);
+                 for (i = 0; (i < (argc + 1)); i++)
+                   {
+                     if (i != argIndicatingFullTrace)
+                       {
+                         strcat (argPtr, argv[i]);
+                         strcat (argPtr, " ");
+                       }
+                   }
+               }
+           }
+         else
+           argPtr = (char *) NULL;
+       }
     }
 
   backtrace_command_1 (argPtr, (argIndicatingFullTrace >= 0), from_tty);
 
   if (argIndicatingFullTrace >= 0 && totArgLen > 0)
-    free(argPtr);
+    free (argPtr);
 
   if (old_chain)
-    do_cleanups(old_chain);
+    do_cleanups (old_chain);
 }
 
 static void backtrace_full_command PARAMS ((char *arg, int from_tty));
@@ -1147,8 +1153,8 @@ backtrace_full_command (arg, from_tty)
 {
   backtrace_command_1 (arg, 1, from_tty);
 }
-
 \f
+
 /* Print the local variables of a block B active in FRAME.
    Return 1 if any variables were printed; 0 otherwise.  */
 
@@ -1177,7 +1183,7 @@ print_block_frame_locals (b, fi, num_tabs, stream)
        case LOC_BASEREG:
          values_printed = 1;
          for (j = 0; j < num_tabs; j++)
-           fputs_filtered("\t", stream);
+           fputs_filtered ("\t", stream);
          fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
          fputs_filtered (" = ", stream);
          print_variable_value (sym, fi, stream);
@@ -1256,14 +1262,14 @@ print_frame_local_vars (fi, num_tabs, stream)
       fprintf_filtered (stream, "No symbol table info available.\n");
       return;
     }
-  
+
   while (block != 0)
     {
       if (print_block_frame_locals (block, fi, num_tabs, stream))
        values_printed = 1;
       /* After handling the function's top-level block, stop.
-        Don't continue to its superblock, the block of
-        per-file symbols.  */
+         Don't continue to its superblock, the block of
+         per-file symbols.  */
       if (BLOCK_FUNCTION (block))
        break;
       block = BLOCK_SUPERBLOCK (block);
@@ -1334,8 +1340,8 @@ print_frame_label_vars (fi, this_level_only, stream)
        return;
 
       /* After handling the function's top-level block, stop.
-        Don't continue to its superblock, the block of
-        per-file symbols.  */
+         Don't continue to its superblock, the block of
+         per-file symbols.  */
       if (BLOCK_FUNCTION (block))
        break;
       block = BLOCK_SUPERBLOCK (block);
@@ -1363,9 +1369,9 @@ catch_info (ignore, from_tty)
      char *ignore;
      int from_tty;
 {
-  struct symtab_and_line * sal;
+  struct symtab_and_line *sal;
 
-  /* Check for target support for exception handling */ 
+  /* Check for target support for exception handling */
   sal = target_enable_exception_callback (EX_EVENT_CATCH, 1);
   if (sal)
     {
@@ -1374,16 +1380,16 @@ catch_info (ignore, from_tty)
          system to find the list of active handlers, etc. */
       fprintf_filtered (gdb_stdout, "Info catch not supported with this target/compiler combination.\n");
 #if 0
-  if (!selected_frame)
-    error ("No frame selected.");
+      if (!selected_frame)
+       error ("No frame selected.");
 #endif
     }
   else
     {
-      /* Assume g++ compiled code -- old v 4.16 behaviour */ 
+      /* Assume g++ compiled code -- old v 4.16 behaviour */
       if (!selected_frame)
-        error ("No frame selected.");
-      
+       error ("No frame selected.");
+
       print_frame_label_vars (selected_frame, 0, gdb_stdout);
     }
 }
@@ -1436,7 +1442,7 @@ print_frame_arg_vars (fi, stream)
             are not combined in symbol-reading.  */
 
          sym2 = lookup_symbol (SYMBOL_NAME (sym),
-                       b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
+                  b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
          print_variable_value (sym2, fi, stream);
          fprintf_filtered (stream, "\n");
          break;
@@ -1469,11 +1475,11 @@ args_plus_locals_info (ignore, from_tty)
      char *ignore;
      int from_tty;
 {
-  args_info(ignore, from_tty);
-  locals_info(ignore, from_tty);
+  args_info (ignore, from_tty);
+  locals_info (ignore, from_tty);
 }
-
 \f
+
 /* Select frame FI, and note that its stack level is LEVEL.
    LEVEL may be -1 if an actual level number is not known.  */
 
@@ -1492,42 +1498,43 @@ select_frame (fi, level)
   /* Ensure that symbols for this frame are read in.  Also, determine the
      source language of this frame, and switch to it if desired.  */
   if (fi)
-  {
-    s = find_pc_symtab (fi->pc);
-    if (s 
-       && s->language != current_language->la_language
-       && s->language != language_unknown
-       && language_mode == language_mode_auto) {
-      set_language(s->language);
+    {
+      s = find_pc_symtab (fi->pc);
+      if (s
+         && s->language != current_language->la_language
+         && s->language != language_unknown
+         && language_mode == language_mode_auto)
+       {
+         set_language (s->language);
+       }
+      /* elz: this if here fixes the problem with the pc not being displayed
+         in the tui asm layout, with no debug symbols. The value of s 
+         would be 0 here, and select_source_symtab would abort the
+         command by calling the 'error' function */
+      if (s)
+       {
+         TUIDO (((TuiOpaqueFuncPtr) tui_vSelectSourceSymtab, s));
+       }
     }
-    /* elz: this if here fixes the problem with the pc not being displayed
-       in the tui asm layout, with no debug symbols. The value of s 
-       would be 0 here, and select_source_symtab would abort the
-       command by calling the 'error' function*/
-    if (s)
-      {
-       TUIDO(((TuiOpaqueFuncPtr)tui_vSelectSourceSymtab, s));
-      }
-  }
 }
-
 \f
+
 /* Select frame FI, noting that its stack level is LEVEL.  Also print
    the stack frame and show the source if this is the tui version.  */
 void
-select_and_print_frame(fi, level)
+select_and_print_frame (fi, level)
      struct frame_info *fi;
      int level;
 {
-  select_frame(fi, level);
+  select_frame (fi, level);
   if (fi)
     {
-      print_stack_frame(fi, level, 1);
-      TUIDO(((TuiOpaqueFuncPtr)tui_vCheckDataValues, fi));
+      print_stack_frame (fi, level, 1);
+      TUIDO (((TuiOpaqueFuncPtr) tui_vCheckDataValues, fi));
     }
 }
-
 \f
+
 /* Select frame FI, noting that its stack level is LEVEL.  Be silent if
    not the TUI */
 #if 0
@@ -1537,9 +1544,9 @@ select_and_maybe_print_frame (fi, level)
      int level;
 {
   if (!tui_version)
-    select_frame(fi, level);
+    select_frame (fi, level);
   else
-    select_and_print_frame(fi, level);
+    select_and_print_frame (fi, level);
 }
 #endif
 
@@ -1600,13 +1607,14 @@ find_relative_frame (frame, level_offset_ptr)
   /* Going down is just as simple.  */
   if (*level_offset_ptr < 0)
     {
-      while (*level_offset_ptr < 0) {
-       frame1 = get_next_frame (frame);
-       if (!frame1)
-         break;
-       frame = frame1;
-       (*level_offset_ptr)++;
-      }
+      while (*level_offset_ptr < 0)
+       {
+         frame1 = get_next_frame (frame);
+         if (!frame1)
+           break;
+         frame = frame1;
+         (*level_offset_ptr)++;
+       }
     }
   return frame;
 }
@@ -1634,12 +1642,13 @@ select_frame_command (level_exp, from_tty)
   /* Try to figure out what level this frame is.  But if there is
      no current stack, don't error out -- let the user set one.  */
   frame1 = 0;
-  if (get_current_frame()) {
-    for (frame1 = get_prev_frame (0);
-        frame1 && frame1 != frame;
-        frame1 = get_prev_frame (frame1))
-      level++;
-  }
+  if (get_current_frame ())
+    {
+      for (frame1 = get_prev_frame (0);
+          frame1 && frame1 != frame;
+          frame1 = get_prev_frame (frame1))
+       level++;
+    }
 
   if (!frame1)
     level = 0;
@@ -1668,7 +1677,7 @@ current_frame_command (level_exp, from_tty)
      int from_tty;
 {
   if (target_has_stack == 0 || selected_frame == 0)
-    error ("No stack."); 
+    error ("No stack.");
   print_only_stack_frame (selected_frame, selected_frame_level, 1);
 }
 
@@ -1685,7 +1694,7 @@ up_silently_base (count_exp)
   if (count_exp)
     count = parse_and_eval_address (count_exp);
   count1 = count;
-  
+
   if (target_has_stack == 0 || selected_frame == 0)
     error ("No stack.");
 
@@ -1700,7 +1709,7 @@ up_silently_command (count_exp, from_tty)
      char *count_exp;
      int from_tty;
 {
-  up_silently_base(count_exp);
+  up_silently_base (count_exp);
   if (tui_version)
     print_stack_frame (selected_frame, selected_frame_level, 1);
 }
@@ -1725,9 +1734,9 @@ down_silently_base (count_exp)
   register struct frame_info *frame;
   int count = -1, count1;
   if (count_exp)
-    count = - parse_and_eval_address (count_exp);
+    count = -parse_and_eval_address (count_exp);
   count1 = count;
-  
+
   if (target_has_stack == 0 || selected_frame == 0)
     error ("No stack.");
 
@@ -1736,9 +1745,9 @@ down_silently_base (count_exp)
     {
 
       /* We only do this if count_exp is not specified.  That way "down"
-        means to really go down (and let me know if that is
-        impossible), but "down 9999" can be used to mean go all the way
-        down without getting an error.  */
+         means to really go down (and let me know if that is
+         impossible), but "down 9999" can be used to mean go all the way
+         down without getting an error.  */
 
       error ("Bottom (i.e., innermost) frame selected; you cannot go down.");
     }
@@ -1799,7 +1808,7 @@ return_command (retval_exp, from_tty)
       return_value = value_cast (return_type, return_value);
 
       /* Make sure we have fully evaluated it, since
-        it might live in the stack frame we're about to pop.  */
+         it might live in the stack frame we're about to pop.  */
       if (VALUE_LAZY (return_value))
        value_fetch_lazy (return_value);
     }
@@ -1816,9 +1825,8 @@ return_command (retval_exp, from_tty)
              /* NOTREACHED */
            }
        }
-      else
-       if (!query ("Make selected stack frame return now? "))
-         error ("Not confirmed.");
+      else if (!query ("Make selected stack frame return now? "))
+       error ("Not confirmed.");
     }
 
   /* Do the real work.  Pop until the specified frame is current.  We
@@ -1826,7 +1834,7 @@ return_command (retval_exp, from_tty)
      a POP_FRAME.  The pc comparison makes this work even if the
      selected frame shares its fp with another frame.  */
 
-  while (selected_frame_addr != (frame = get_current_frame())->frame
+  while (selected_frame_addr != (frame = get_current_frame ())->frame
         || selected_frame_pc != frame->pc)
     POP_FRAME;
 
@@ -1918,10 +1926,10 @@ get_frame_language ()
 {
   register struct symtab *s;
   enum language flang;         /* The language of the current frame */
-   
+
   if (selected_frame)
     {
-      s = find_pc_symtab(selected_frame->pc);
+      s = find_pc_symtab (selected_frame->pc);
       if (s)
        flang = s->language;
       else
@@ -1936,7 +1944,7 @@ get_frame_language ()
 void
 _initialize_stack ()
 {
-#if 0  
+#if 0
   backtrace_limit = 30;
 #endif
 
@@ -1974,8 +1982,8 @@ a command file or a user-defined command.");
 
   if (xdb_commands)
     {
-      add_com("L", class_stack, current_frame_command, 
-              "Print the current stack frame.\n");
+      add_com ("L", class_stack, current_frame_command,
+              "Print the current stack frame.\n");
       add_com_alias ("V", "frame", class_stack, 1);
     }
   add_com ("select-frame", class_stack, select_frame_command,
@@ -1992,7 +2000,7 @@ Use of the 'full' qualifier also prints the values of the local variables.\n");
     {
       add_com_alias ("t", "backtrace", class_stack, 0);
       add_com ("T", class_stack, backtrace_full_command,
-          "Print backtrace of all stack frames, or innermost COUNT frames \n\
+              "Print backtrace of all stack frames, or innermost COUNT frames \n\
 and the values of the local variables.\n\
 With a negative argument, print outermost -COUNT frames.\n\
 Usage: T <count>\n");
@@ -2010,21 +2018,21 @@ Usage: T <count>\n");
   add_info ("args", args_info,
            "Argument variables of current stack frame.");
   if (xdb_commands)
-      add_com("l", class_info, args_plus_locals_info, 
-           "Argument and local variables of current stack frame.");
+    add_com ("l", class_info, args_plus_locals_info,
+            "Argument and local variables of current stack frame.");
 
   if (dbx_commands)
-      add_com("func", class_stack, func_command, 
-         "Select the stack frame that contains <func>.\nUsage: func <name>\n");
+    add_com ("func", class_stack, func_command,
+      "Select the stack frame that contains <func>.\nUsage: func <name>\n");
 
   add_info ("catch", catch_info,
            "Exceptions that can be caught in the current stack frame.");
 
 #if 0
-  add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command, 
-          "Specify maximum number of frames for \"backtrace\" to print by default.",
+  add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command,
+  "Specify maximum number of frames for \"backtrace\" to print by default.",
           &setlist);
   add_info ("backtrace-limit", backtrace_limit_info,
-           "The maximum number of frames for \"backtrace\" to print by default.");
+     "The maximum number of frames for \"backtrace\" to print by default.");
 #endif
 }
index 13fc4768b4ede0779879df4fe9fb3a7c48521a91..0b655a1a1d656405c9d5cc1032a3e0beb6617c01 100644 (file)
@@ -1,21 +1,22 @@
 /* Interface to bare machine for GDB running as kernel debugger.
    Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <sys/ioctl.h>
@@ -34,18 +35,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "frame.h"
 #include "inferior.h"
 #include "wait.h"
-
 \f
+
 /* Random system calls, mostly no-ops to prevent link problems  */
 
 ioctl (desc, code, arg)
-{}
+{
+}
 
-int (* signal ()) ()
-{}
+int (*signal ()) ()
+{
+}
 
 kill ()
-{}
+{
+}
 
 getpid ()
 {
@@ -53,10 +57,12 @@ getpid ()
 }
 
 sigsetmask ()
-{}
+{
+}
 
 chdir ()
-{}
+{
+}
 
 char *
 getcwd (buf, len)
@@ -92,7 +98,7 @@ exit ()
    char[]  name of the file, ending with a null.
    padding to multiple of 4 boundary.
    char[]  file contents.  The length can be deduced from what was
-           specified before.  There is no terminating null here.
+   specified before.  There is no terminating null here.
 
    If the int at the front is zero, it means there are no more files.
 
@@ -141,14 +147,14 @@ open (filename, modes)
       return -1;
     }
 
-  for (next = files_start; * (int *) next; next += * (int *) next)
+  for (next = files_start; *(int *) next; next += *(int *) next)
     {
       if (!STRCMP (next + 4, filename))
        {
          sourcebeg = next + 4 + strlen (next + 4) + 1;
          sourcebeg = (char *) (((int) sourcebeg + 3) & (-4));
          sourceptr = sourcebeg;
-         sourcesize = next + * (int *) next - sourceptr;
+         sourcesize = next + *(int *) next - sourceptr;
          sourceleft = sourcesize;
          return sourcedesc;
        }
@@ -324,10 +330,12 @@ fflush (ign)
 /* Entries into core and inflow, needed only to make things link ok.  */
 
 exec_file_command ()
-{}
+{
+}
 
 core_file_command ()
-{}
+{
+}
 
 char *
 get_exec_file (err)
@@ -350,19 +358,24 @@ kill_command ()
 }
 
 terminal_inferior ()
-{}
+{
+}
 
 terminal_ours ()
-{}
+{
+}
 
 terminal_init_inferior ()
-{}
+{
+}
 
 write_inferior_register ()
-{}
+{
+}
 
 read_inferior_register ()
-{}
+{
+}
 
 read_memory (memaddr, myaddr, len)
      CORE_ADDR memaddr;
@@ -417,16 +430,20 @@ vfork ()
    and these definitions are so it will link without errors.  */
 
 ptrace ()
-{}
+{
+}
 
 setpgrp ()
-{}
+{
+}
 
 execle ()
-{}
+{
+}
 
 _exit ()
-{}
+{
+}
 \f
 /* Malloc calls these.  */
 
@@ -564,7 +581,8 @@ wait (w)
 #define HEAP_SIZE 400000
 #endif
 
-char heap[HEAP_SIZE] = {0};
+char heap[HEAP_SIZE] =
+{0};
 
 #ifndef STACK_SIZE
 #define STACK_SIZE 100000
@@ -583,11 +601,12 @@ _initialize_standalone ()
 
   /* Find the end of the data on files.  */
 
-  for (next = files_start; * (int *) next; next += * (int *) next) {}
+  for (next = files_start; *(int *) next; next += *(int *) next)
+    {
+    }
 
   /* That is where free storage starts for sbrk to give out.  */
   next_free = next;
 
   memory_limit = heap + sizeof heap;
 }
-
index 8f22bf9195788463dffcd4cdb4eb246576d890b1..f4470a807fbeed84a484571b9fc62827ffa8654f 100644 (file)
@@ -1,33 +1,34 @@
 /* A client to make GDB return to command level in Mach 3.
    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Authors: Jukka Virtanen <jtv@hut.fi> and Peter Stout <pds@cs.cmu.edu>.
 
    A simple client to make GDB (versions 4.4 and later) on Mach 3 return
    to the command level when it is waiting for the inferior to stop.
-  
+
    Actions: Lookup the send right to the GDB message port from the
-            NetMsgServer.
+   NetMsgServer.
 
-           Send an asynchronous message with msgh_id
-           GDB_MESSAGE_ID_STOP to that port.
  */
+   Send an asynchronous message with msgh_id
+   GDB_MESSAGE_ID_STOP to that port.
+ */
 
 #include <stdio.h>
 
@@ -66,7 +67,7 @@ main (argc, argv)
   else
     host = (char *) "";
 
-  name = malloc (strlen (argv[1]) + sizeof(GDB_NAME_PREFIX));
+  name = malloc (strlen (argv[1]) + sizeof (GDB_NAME_PREFIX));
   if (name == NULL)
     {
       fprintf (stderr, "Unable to allocate memory for name.");
@@ -86,8 +87,8 @@ main (argc, argv)
   if (kr != KERN_SUCCESS)
     {
       fprintf (stderr, "Unable to lookup the GDB service port: %s.\n",
-              mach_error_string(kr));
-      exit(1);
+              mach_error_string (kr));
+      exit (1);
     }
 
   /* Code generated by mig stub generator, with minor cleanups :-)
@@ -96,10 +97,10 @@ main (argc, argv)
 
   msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0);
   msg.msgh_remote_port = gdb_port;
-  msg.msgh_local_port  = MACH_PORT_NULL;
-  msg.msgh_size               = sizeof(msg);
-  msg.msgh_seqno       = 0;
-  msg.msgh_id          = GDB_MESSAGE_ID_STOP;
+  msg.msgh_local_port = MACH_PORT_NULL;
+  msg.msgh_size = sizeof (msg);
+  msg.msgh_seqno = 0;
+  msg.msgh_id = GDB_MESSAGE_ID_STOP;
 
   kr = mach_msg_send (&msg);
   if (kr != KERN_SUCCESS)
index eedbeab999865c16cb9836ab3acae5bbbadd69b0..babd29fae6f3d3f2c0597866ed6aded89cc8ab52 100644 (file)
@@ -1,21 +1,22 @@
 /* Program to stuff files into a specially prepared space in kdb.
    Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Written 13-Mar-86 by David Bridgham. */
 
@@ -38,11 +39,12 @@ main (argc, argv)
   struct stat stat_buf;
   int size, pad;
   char buf[1024];
-  static char zeros[4] = {0};
+  static char zeros[4] =
+  {0};
 
   if (argc < 4)
-    err("Not enough arguments\nUsage: %s -o kdb file1 file2 ...\n",
-       argv[0]);
+    err ("Not enough arguments\nUsage: %s -o kdb file1 file2 ...\n",
+        argv[0]);
 
   outfile = 0;
   for (i = 1; i < argc; i++)
@@ -51,7 +53,7 @@ main (argc, argv)
        outfile = argv[++i];
     }
   if (outfile == 0)
-    err("Output file not specified\n");
+    err ("Output file not specified\n");
 
   offset = get_offset (outfile, "_heap");
 
@@ -111,7 +113,7 @@ get_offset (file, sym_name)
     err ("File %s not an a.out file\n", file);
 
   /* read in symbol table */
-  if ((symbol_table = (struct nlist *)malloc (file_hdr.a_syms)) == 0)
+  if ((symbol_table = (struct nlist *) malloc (file_hdr.a_syms)) == 0)
     err ("Couldn't allocate space for symbol table\n");
   if (lseek (f, N_SYMOFF (file_hdr), 0) == -1)
     err ("lseek error: %s\n", strerror (errno));
@@ -122,7 +124,7 @@ get_offset (file, sym_name)
   /* read in string table */
   if (read (f, &size, 4) == -1)
     err ("reading string table size: %s\n", strerror (errno));
-  if ((strings = (char *)malloc (size)) == 0)
+  if ((strings = (char *) malloc (size)) == 0)
     err ("Couldn't allocate memory for string table\n");
   if (read (f, strings, size - 4) == -1)
     err ("reading string table: %s\n", strerror (errno));
@@ -147,15 +149,17 @@ find_symbol (sym_name, symbol_table, length, strings)
 
   /* Find symbol in question */
   for (sym = symbol_table;
-       sym != (struct nlist *)((char *)symbol_table + length);
+       sym != (struct nlist *) ((char *) symbol_table + length);
        sym++)
-      {
-       if ((sym->n_type & N_TYPE) != N_DATA) continue;
-       if (sym->n_un.n_strx == 0) continue;
-       if (STREQ (sym_name, strings + sym->n_un.n_strx - 4))
-         return sym->n_value;
-      }
-    err ("Data symbol %s not found in %s\n", sym_name, file);
+    {
+      if ((sym->n_type & N_TYPE) != N_DATA)
+       continue;
+      if (sym->n_un.n_strx == 0)
+       continue;
+      if (STREQ (sym_name, strings + sym->n_un.n_strx - 4))
+       return sym->n_value;
+    }
+  err ("Data symbol %s not found in %s\n", sym_name, file);
 }
 
 /* VARARGS */
index 032b9efdd0387a659e8a2335fab4eec0c688ede7..ed70665a253f9cdb92f1d5e348c894cf1262126f 100644 (file)
@@ -1,28 +1,29 @@
 /* Host-dependent code for Sun-3 for GDB, the GNU debugger.
    Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
 #include "gdbcore.h"
 
 #include <sys/ptrace.h>
-#define KERNEL         /* To get floating point reg definitions */
+#define KERNEL                 /* To get floating point reg definitions */
 #include <machine/reg.h>
 
 static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
@@ -37,26 +38,26 @@ fetch_inferior_registers (regno)
 #endif
 
   registers_fetched ();
-  
+
   ptrace (PTRACE_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
 #ifdef FP0_REGNUM
   ptrace (PTRACE_GETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
-#endif 
-  
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
+#endif
+
   memcpy (registers, &inferior_registers, 16 * 4);
 #ifdef FP0_REGNUM
   memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
-        sizeof inferior_fp_registers.fps_regs);
-#endif 
-  *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
-  *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+         sizeof inferior_fp_registers.fps_regs);
+#endif
+  *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+  *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
 #ifdef FP0_REGNUM
   memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
-        &inferior_fp_registers.fps_control,
-        sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif 
+         &inferior_fp_registers.fps_control,
+      sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
+#endif
 }
 
 /* Store our register values back into the inferior.
@@ -75,22 +76,22 @@ store_inferior_registers (regno)
   memcpy (&inferior_registers, registers, 16 * 4);
 #ifdef FP0_REGNUM
   memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
-        sizeof inferior_fp_registers.fps_regs);
+         sizeof inferior_fp_registers.fps_regs);
 #endif
-  inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
-  inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+  inferior_registers.r_ps = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
+  inferior_registers.r_pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
 
 #ifdef FP0_REGNUM
   memcpy (&inferior_fp_registers.fps_control,
-        &registers[REGISTER_BYTE (FPC_REGNUM)],
-        sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
+         &registers[REGISTER_BYTE (FPC_REGNUM)],
+      sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
 #endif
 
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
 #if FP0_REGNUM
   ptrace (PTRACE_SETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 #endif
 }
 
@@ -107,36 +108,39 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 {
   struct regs *regs = (struct regs *) core_reg_sect;
 
-  if (which == 0) {
-    if (core_reg_size < sizeof (struct regs))
-      error ("Can't find registers in core file");
+  if (which == 0)
+    {
+      if (core_reg_size < sizeof (struct regs))
+         error ("Can't find registers in core file");
 
-    memcpy (registers, (char *)regs, 16 * 4);
-    supply_register (PS_REGNUM, (char *)&regs->r_ps);
-    supply_register (PC_REGNUM, (char *)&regs->r_pc);
+      memcpy (registers, (char *) regs, 16 * 4);
+      supply_register (PS_REGNUM, (char *) &regs->r_ps);
+      supply_register (PC_REGNUM, (char *) &regs->r_pc);
 
-  } else if (which == 2) {
+    }
+  else if (which == 2)
+    {
 
 #define fpustruct  ((struct fpu *) core_reg_sect)
 
-    if (core_reg_size >= sizeof (struct fpu))
-      {
+      if (core_reg_size >= sizeof (struct fpu))
+       {
 #ifdef FP0_REGNUM
-       memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
-             fpustruct->f_fpstatus.fps_regs,
-             sizeof fpustruct->f_fpstatus.fps_regs);
-       memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
-             &fpustruct->f_fpstatus.fps_control,
-             sizeof fpustruct->f_fpstatus - 
-               sizeof fpustruct->f_fpstatus.fps_regs);
+         memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
+                 fpustruct->f_fpstatus.fps_regs,
+                 sizeof fpustruct->f_fpstatus.fps_regs);
+         memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
+                 &fpustruct->f_fpstatus.fps_control,
+                 sizeof fpustruct->f_fpstatus -
+                 sizeof fpustruct->f_fpstatus.fps_regs);
 #endif
-      }
-    else
-      fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
-  }
+       }
+      else
+       fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
+    }
 }
-
 \f
+
 /* Register that we are able to handle sun3 core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index b62b6fd8f85d8e2dc9f7c5f4b2185f02366dba43..c37f4c202c518701ed2526ac4df7be40e2c1b170 100644 (file)
@@ -3,21 +3,22 @@
    Changes for sun386i by Jean Daniel Fekete (jdf@litp.univ-p6-7.fr),
    C2V Paris, April 89.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -37,12 +38,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/file.h>
 #include "gdb_stat.h"
 #include <sys/core.h>
-
 \f
+
 /* Machine-dependent code which would otherwise be in corefile.c */
 /* Work with core files, for GDB. */
-
 \f
+
 void
 core_file_command (filename, from_tty)
      char *filename;
@@ -72,7 +73,7 @@ core_file_command (filename, from_tty)
     {
       filename = tilde_expand (filename);
       make_cleanup (free, filename);
-      
+
       if (have_inferior_p ())
        error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
@@ -89,8 +90,8 @@ core_file_command (filename, from_tty)
          error ("\"%s\" does not appear to be a core dump file (magic 0x%x, expected 0x%x)",
                 filename, corestr.c_magic, (int) CORE_MAGIC);
        else if (sizeof (struct core) != corestr.c_len)
-         error ("\"%s\" has an invalid struct core length (%d, expected %d)",
-                filename, corestr.c_len, (int) sizeof (struct core));
+           error ("\"%s\" has an invalid struct core length (%d, expected %d)",
+                  filename, corestr.c_len, (int) sizeof (struct core));
 
        data_start = exec_data_start;
        data_end = data_start + corestr.c_dsize;
@@ -101,24 +102,24 @@ core_file_command (filename, from_tty)
        memcpy (registers, &corestr.c_regs, sizeof corestr.c_regs);
 
        memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
-              corestr.c_fpu.f_fpstatus.f_st,
-              sizeof corestr.c_fpu.f_fpstatus.f_st);
+               corestr.c_fpu.f_fpstatus.f_st,
+               sizeof corestr.c_fpu.f_fpstatus.f_st);
        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);
+               &corestr.c_fpu.f_fpstatus.f_ctrl,
+               sizeof corestr.c_fpu.f_fpstatus -
+               sizeof corestr.c_fpu.f_fpstatus.f_st);
 
        /* the struct aouthdr of sun coff is not the struct exec stored
           in the core file. */
        memcpy (&core_aouthdr, &corestr.c_aouthdr, sizeof (struct exec));
 #ifndef COFF_ENCAPSULATE
        core_aouthdr.magic = corestr.c_aouthdr.a_info;
-       core_aouthdr.vstamp = /*SUNVERSION*/ 31252;
+       core_aouthdr.vstamp = /*SUNVERSION */ 31252;
 #endif
        printf_unfiltered ("Core file is from \"%s\".\n", corestr.c_cmdname);
        if (corestr.c_signo > 0)
          printf_unfiltered ("Program terminated with signal %d, %s.\n",
-                 corestr.c_signo, safe_strsignal (corestr.c_signo));
+                        corestr.c_signo, safe_strsignal (corestr.c_signo));
       }
       if (filename[0] == '/')
        corefile = savestring (filename, strlen (filename));
@@ -142,26 +143,26 @@ i387_to_double (from, to)
 {
   long *lp;
   /* push extended mode on 387 stack, then pop in double mode
-   *
+
    * first, set exception masks so no error is generated -
    * number will be rounded to inf or 0, if necessary 
    */
-  asm ("pushl %eax");          /* grab a stack slot */
+  asm ("pushl %eax");          /* grab a stack slot */
   asm ("fstcw (%esp)");                /* get 387 control word */
   asm ("movl (%esp),%eax");    /* save old value */
-  asm ("orl $0x3f,%eax");              /* mask all exceptions */
+  asm ("orl $0x3f,%eax");      /* mask all exceptions */
   asm ("pushl %eax");
   asm ("fldcw (%esp)");                /* load new value into 387 */
-  
+
   asm ("movl 8(%ebp),%eax");
   asm ("fldt (%eax)");         /* push extended number on 387 stack */
   asm ("fwait");
   asm ("movl 12(%ebp),%eax");
   asm ("fstpl (%eax)");                /* pop double */
   asm ("fwait");
-  
+
   asm ("popl %eax");           /* flush modified control word */
-  asm ("fnclex");                      /* clear exceptions */
+  asm ("fnclex");              /* clear exceptions */
   asm ("fldcw (%esp)");                /* restore original control word */
   asm ("popl %eax");           /* flush saved copy */
 }
@@ -192,17 +193,17 @@ fetch_inferior_registers (regno)
   registers_fetched ();
 
   ptrace (PTRACE_GETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
   ptrace (PTRACE_GETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (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 (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);
+         &inferior_fp_registers.f_ctrl,
+         sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
 }
 
 /* Store our register values back into the inferior.
@@ -219,12 +220,12 @@ store_inferior_registers (regno)
   memcpy (&inferior_registers, registers, 20 * 4);
 
   memcpy (inferior_fp_registers.f_st,
-        &registers[REGISTER_BYTE (FP0_REGNUM)],
-        sizeof 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);
-  
+         &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
@@ -236,8 +237,8 @@ store_inferior_registers (regno)
       int reg = inferior_registers.r_reg[EAX];
       inferior_registers.r_reg[EAX] =
        inferior_registers.r_reg[FP_REGNUM];
-      ptrace (PTRACE_SETREGS, inferior_pid, 
-             (PTRACE_ARG3_TYPE) &inferior_registers);
+      ptrace (PTRACE_SETREGS, inferior_pid,
+             (PTRACE_ARG3_TYPE) & inferior_registers);
       ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack,
              0xc589);
       ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack,
@@ -249,7 +250,7 @@ store_inferior_registers (regno)
     }
 #endif
   ptrace (PTRACE_SETREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_registers);
+         (PTRACE_ARG3_TYPE) & inferior_registers);
   ptrace (PTRACE_SETFPREGS, inferior_pid,
-         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
+         (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 }
index 914315054897796b201910c5d42f7d6b6a335a54..5a9bf6374a5a70935ab72c467337f53b58b0d9ee 100644 (file)
@@ -3,21 +3,22 @@
    Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -33,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "language.h"
 #include "complaints.h"
 #include "demangle.h"
-#include "inferior.h" /* for write_pc */
+#include "inferior.h"          /* for write_pc */
 #include "gdb-stabs.h"
 #include "obstack.h"
 
@@ -70,13 +71,15 @@ void (*pre_add_symbol_hook) PARAMS ((char *));
 void (*post_add_symbol_hook) PARAMS ((void));
 
 /* Global variables owned by this file */
-int readnow_symbol_files;              /* Read full symbols immediately */
+int readnow_symbol_files;      /* Read full symbols immediately */
 
-struct complaint oldsyms_complaint = {
+struct complaint oldsyms_complaint =
+{
   "Replacing old symbols for `%s'", 0, 0
 };
 
-struct complaint empty_symtab_complaint = {
+struct complaint empty_symtab_complaint =
+{
   "Empty symbol table found for `%s'", 0, 0
 };
 
@@ -185,11 +188,11 @@ int symbol_reloading = 0;
    Note that HP-UX interprets this variable to mean, "threshhold size
    in megabytes, where zero means never add".  Other platforms interpret
    this variable to mean, "always add if non-zero, never add if zero."
  */
+ */
 
 int auto_solib_add = 1;
-
 \f
+
 /* Since this function is called from within qsort, in an ANSI environment
    it must conform to the prototype for qsort, which specifies that the
    comparison function takes two "void *" pointers. */
@@ -209,23 +212,23 @@ compare_symbols (s1p, s2p)
 
 /*
 
-LOCAL FUNCTION
+   LOCAL FUNCTION
 
-       compare_psymbols -- compare two partial symbols by name
+   compare_psymbols -- compare two partial symbols by name
 
-DESCRIPTION
+   DESCRIPTION
 
-       Given pointers to pointers to two partial symbol table entries,
-       compare them by name and return -N, 0, or +N (ala strcmp).
-       Typically used by sorting routines like qsort().
+   Given pointers to pointers to two partial symbol table entries,
+   compare them by name and return -N, 0, or +N (ala strcmp).
+   Typically used by sorting routines like qsort().
 
-NOTES
+   NOTES
 
-       Does direct compare of first two characters before punting
-       and passing to strcmp for longer compares.  Note that the
-       original version had a bug whereby two null strings or two
-       identically named one character strings would return the
-       comparison of memory following the null byte.
+   Does direct compare of first two characters before punting
+   and passing to strcmp for longer compares.  Note that the
+   original version had a bug whereby two null strings or two
+   identically named one character strings would return the
+   comparison of memory following the null byte.
 
  */
 
@@ -259,7 +262,7 @@ compare_psymbols (s1p, s2p)
        * and once it is fixed the original line can be put back. RT
        */
       /* return ( STRCMP (st1 + 2, st2 + 2)); */
-      return ( strcmp (st1, st2));
+      return (strcmp (st1, st2));
     }
 }
 
@@ -269,8 +272,8 @@ sort_pst_symbols (pst)
 {
   /* Sort the global list; don't sort the static list */
 
-  qsort (pst -> objfile -> global_psymbols.list + pst -> globals_offset,
-        pst -> n_global_syms, sizeof (struct partial_symbol *),
+  qsort (pst->objfile->global_psymbols.list + pst->globals_offset,
+        pst->n_global_syms, sizeof (struct partial_symbol *),
         compare_psymbols);
 }
 
@@ -376,7 +379,7 @@ psymtab_to_symtab (pst)
 
   /* If it has not yet been read in, read it.  */
   if (!pst->readin)
-    { 
+    {
       struct cleanup *back_to = make_cleanup (decrement_reading_symtab, NULL);
       currently_reading_symtab++;
       (*pst->read_symtab) (pst);
@@ -395,29 +398,29 @@ init_entry_point_info (objfile)
   /* Save startup file's range of PC addresses to help blockframe.c
      decide where the bottom of the stack is.  */
 
-  if (bfd_get_file_flags (objfile -> obfd) & EXEC_P)
+  if (bfd_get_file_flags (objfile->obfd) & EXEC_P)
     {
       /* Executable file -- record its entry point so we'll recognize
-        the startup file because it contains the entry point.  */
-      objfile -> ei.entry_point = bfd_get_start_address (objfile -> obfd);
+         the startup file because it contains the entry point.  */
+      objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);
     }
   else
     {
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */
-      objfile -> ei.entry_point = INVALID_ENTRY_POINT;
+      objfile->ei.entry_point = INVALID_ENTRY_POINT;
     }
-  objfile -> ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
-  objfile -> ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
-  objfile -> ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
-  objfile -> ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
-  objfile -> ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
-  objfile -> ei.main_func_highpc = INVALID_ENTRY_HIGHPC;
+  objfile->ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
+  objfile->ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
+  objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
+  objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
+  objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
+  objfile->ei.main_func_highpc = INVALID_ENTRY_HIGHPC;
 }
 
 /* Get current entry point address.  */
 
 CORE_ADDR
-entry_point_address()
+entry_point_address ()
 {
   return symfile_objfile ? symfile_objfile->ei.entry_point : 0;
 }
@@ -437,7 +440,7 @@ find_lowest_section (abfd, sect, obj)
      asection *sect;
      PTR obj;
 {
-  asection **lowest = (asection **)obj;
+  asection **lowest = (asection **) obj;
 
   if (0 == (bfd_get_section_flags (abfd, sect) & SEC_LOAD))
     return;
@@ -467,11 +470,11 @@ default_symfile_offsets (objfile, addr)
 
   objfile->num_sections = SECT_OFF_MAX;
   section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile -> psymbol_obstack, SIZEOF_SECTION_OFFSETS);
+    obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
 
   for (i = 0; i < SECT_OFF_MAX; i++)
     ANOFFSET (section_offsets, i) = addr;
-  
+
   return section_offsets;
 }
 
@@ -506,10 +509,10 @@ syms_from_objfile (objfile, addr, mainline, verbo)
      if an error occurs during symbol reading.  */
   old_chain = make_cleanup ((make_cleanup_func) free_objfile, objfile);
 
-  if (mainline) 
+  if (mainline)
     {
       /* We will modify the main symbol table, make sure that all its users
-        will be cleaned up if an error occurs during symbol reading.  */
+         will be cleaned up if an error occurs during symbol reading.  */
       make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
 
       /* Since no error yet, throw away the old symbol table.  */
@@ -521,11 +524,11 @@ syms_from_objfile (objfile, addr, mainline, verbo)
        }
 
       /* Currently we keep symbols from the add-symbol-file command.
-        If the user wants to get rid of them, they should do "symbol-file"
-        without arguments first.  Not sure this is the best behavior
-        (PR 2207).  */
+         If the user wants to get rid of them, they should do "symbol-file"
+         without arguments first.  Not sure this is the best behavior
+         (PR 2207).  */
 
-      (*objfile -> sf -> sym_new_init) (objfile);
+      (*objfile->sf->sym_new_init) (objfile);
     }
 
   /* Convert addr into an offset rather than an absolute address.
@@ -535,14 +538,14 @@ syms_from_objfile (objfile, addr, mainline, verbo)
 
   if (mainline)
     {
-      addr = 0;                /* No offset from objfile addresses.  */
+      addr = 0;                        /* No offset from objfile addresses.  */
     }
   else
     {
       lowest_sect = bfd_get_section_by_name (objfile->obfd, ".text");
       if (lowest_sect == NULL)
        bfd_map_over_sections (objfile->obfd, find_lowest_section,
-                              (PTR) &lowest_sect);
+                              (PTR) & lowest_sect);
 
       if (lowest_sect == NULL)
        warning ("no loadable sections found in added symbol-file %s",
@@ -553,7 +556,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
        warning ("Lowest section in %s is %s at 0x%lx",
                 objfile->name,
                 bfd_section_name (objfile->obfd, lowest_sect),
-                (unsigned long) bfd_section_vma (objfile->obfd, lowest_sect));
+             (unsigned long) bfd_section_vma (objfile->obfd, lowest_sect));
 
       if (lowest_sect)
        addr -= bfd_section_vma (objfile->obfd, lowest_sect);
@@ -563,10 +566,10 @@ syms_from_objfile (objfile, addr, mainline, verbo)
      appear for this new file, and record how verbose to be, then do the
      initial symbol reading for this file. */
 
-  (*objfile -> sf -> sym_init) (objfile);
+  (*objfile->sf->sym_init) (objfile);
   clear_complaints (1, verbo);
 
-  section_offsets = (*objfile -> sf -> sym_offsets) (objfile, addr);
+  section_offsets = (*objfile->sf->sym_offsets) (objfile, addr);
   objfile->section_offsets = section_offsets;
 
 #ifndef IBM6000_TARGET
@@ -603,7 +606,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
     }
 #endif /* not IBM6000_TARGET */
 
-  (*objfile -> sf -> sym_read) (objfile, section_offsets, mainline);
+  (*objfile->sf->sym_read) (objfile, section_offsets, mainline);
 
   if (!have_partial_symbols () && !have_full_symbols ())
     {
@@ -623,7 +626,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
   /* Mark the objfile has having had initial symbol read attempted.  Note
      that this does not mean we found any symbols... */
 
-  objfile -> flags |= OBJF_SYMS;
+  objfile->flags |= OBJF_SYMS;
 
   /* Discard cleanups as symbol reading was successful.  */
 
@@ -640,7 +643,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
 /* Perform required actions after either reading in the initial
    symbols for a new objfile, or mapping in the symbols from a reusable
    objfile. */
-   
+
 void
 new_symfile_objfile (objfile, mainline, verbo)
      struct objfile *objfile;
@@ -694,8 +697,8 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow, user_loaded, i
      int mainline;
      int mapped;
      int readnow;
-     int  user_loaded;
-     int  is_solib;
+     int user_loaded;
+     int is_solib;
 {
   struct objfile *objfile;
   struct partial_symtab *psymtab;
@@ -710,19 +713,19 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow, user_loaded, i
       && mainline
       && from_tty
       && !query ("Load new symbol table from \"%s\"? ", name))
-      error ("Not confirmed.");
+    error ("Not confirmed.");
 
   objfile = allocate_objfile (abfd, mapped, user_loaded, is_solib);
 
   /* If the objfile uses a mapped symbol file, and we have a psymtab for
      it, then skip reading any symbols at this time. */
 
-  if ((objfile -> flags & OBJF_MAPPED) && (objfile -> flags & OBJF_SYMS))
+  if ((objfile->flags & OBJF_MAPPED) && (objfile->flags & OBJF_SYMS))
     {
       /* We mapped in an existing symbol table file that already has had
-        initial symbol reading performed, so we can skip that part.  Notify
-        the user that instead of reading the symbols, they have been mapped.
-        */
+         initial symbol reading performed, so we can skip that part.  Notify
+         the user that instead of reading the symbols, they have been mapped.
+       */
       if (from_tty || info_verbose)
        {
          printf_filtered ("Mapped symbols for %s...", name);
@@ -735,8 +738,8 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow, user_loaded, i
   else
     {
       /* We either created a new mapped symbol table, mapped an existing
-        symbol table file which has not had initial symbol reading
-        performed, or need to read an unmapped symbol table. */
+         symbol table file which has not had initial symbol reading
+         performed, or need to read an unmapped symbol table. */
       if (from_tty || info_verbose)
        {
          if (pre_add_symbol_hook)
@@ -765,9 +768,9 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow, user_loaded, i
          gdb_flush (gdb_stdout);
        }
 
-      for (psymtab = objfile -> psymtabs;
+      for (psymtab = objfile->psymtabs;
           psymtab != NULL;
-          psymtab = psymtab -> next)
+          psymtab = psymtab->next)
        {
          psymtab_to_symtab (psymtab);
        }
@@ -776,12 +779,12 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow, user_loaded, i
   if (from_tty || info_verbose)
     {
       if (post_add_symbol_hook)
-        post_add_symbol_hook ();
+       post_add_symbol_hook ();
       else
-        {
-          printf_filtered ("done.\n");
-          gdb_flush (gdb_stdout);
-        }
+       {
+         printf_filtered ("done.\n");
+         gdb_flush (gdb_stdout);
+       }
     }
 
   new_symfile_objfile (objfile, mainline, from_tty);
@@ -808,7 +811,7 @@ symbol_file_command (args, from_tty)
 {
   char **argv;
   char *name = NULL;
-  CORE_ADDR text_relocation = 0;               /* text_relocation */
+  CORE_ADDR text_relocation = 0;       /* text_relocation */
   struct cleanup *cleanups;
   int mapped = 0;
   int readnow = 0;
@@ -820,14 +823,14 @@ symbol_file_command (args, from_tty)
       if ((have_full_symbols () || have_partial_symbols ())
          && from_tty
          && !query ("Discard symbol table from `%s'? ",
-                    symfile_objfile -> name))
+                    symfile_objfile->name))
        error ("Not confirmed.");
       free_all_objfiles ();
 
       /* solib descriptors may have handles to objfiles.  Since their
          storage has just been released, we'd better wipe the solib
          descriptors as well.
-         */
+       */
 #if defined(SOLIB_RESTART)
       SOLIB_RESTART ();
 #endif
@@ -864,37 +867,39 @@ symbol_file_command (args, from_tty)
            }
          else
            {
-            char *p;
+             char *p;
 
-              name = *argv;
+             name = *argv;
 
-              /* this is for rombug remote only, to get the text relocation by
-              using link command */
-              p = strrchr(name, '/');
-              if (p != NULL) p++;
-              else p = name;
+             /* this is for rombug remote only, to get the text relocation by
+                using link command */
+             p = strrchr (name, '/');
+             if (p != NULL)
+               p++;
+             else
+               p = name;
 
-              target_link(p, &text_relocation);
+             target_link (p, &text_relocation);
 
-              if (text_relocation == (CORE_ADDR)0)
-                return;
-              else if (text_relocation == (CORE_ADDR)-1)
-                {
-                  symbol_file_add (name, from_tty, (CORE_ADDR)0, 
-                                   1, mapped, readnow, 1, 0);
+             if (text_relocation == (CORE_ADDR) 0)
+               return;
+             else if (text_relocation == (CORE_ADDR) - 1)
+               {
+                 symbol_file_add (name, from_tty, (CORE_ADDR) 0,
+                                  1, mapped, readnow, 1, 0);
 #ifdef HPUXHPPA
-                  RESET_HP_UX_GLOBALS ();
+                 RESET_HP_UX_GLOBALS ();
 #endif
-                }
-              else
-                symbol_file_add (name, from_tty, (CORE_ADDR)text_relocation,
+               }
+             else
+               symbol_file_add (name, from_tty, (CORE_ADDR) text_relocation,
                                 0, mapped, readnow, 1, 0);
 
              /* Getting new symbols may change our opinion about what is
-                frameless.  */
+                frameless.  */
              reinit_frame_cache ();
 
-              set_initial_language ();
+             set_initial_language ();
            }
          argv++;
        }
@@ -903,7 +908,7 @@ symbol_file_command (args, from_tty)
        {
          error ("no symbol file name was specified");
        }
-      TUIDO(((TuiOpaqueFuncPtr)tuiDisplayMainFunction));
+      TUIDO (((TuiOpaqueFuncPtr) tuiDisplayMainFunction));
       do_cleanups (cleanups);
     }
 }
@@ -922,19 +927,19 @@ static void
 set_initial_language ()
 {
   struct partial_symtab *pst;
-  enum language lang = language_unknown;       
+  enum language lang = language_unknown;
 
   pst = find_main_psymtab ();
   if (pst != NULL)
     {
-      if (pst -> filename != NULL)
+      if (pst->filename != NULL)
        {
-         lang = deduce_language_from_filename (pst -> filename);
-        }
+         lang = deduce_language_from_filename (pst->filename);
+       }
       if (lang == language_unknown)
        {
-           /* Make C the default language */
-           lang = language_c;
+         /* Make C the default language */
+         lang = language_c;
        }
       set_language (lang);
       expected_language = current_language;    /* Don't warn the user */
@@ -966,7 +971,7 @@ symfile_bfd_open (name)
       char *exename = alloca (strlen (name) + 5);
       strcat (strcpy (exename, name), ".exe");
       desc = openp (getenv ("PATH"), 1, exename, O_RDONLY | O_BINARY,
-                    0, &absolute_name);
+                   0, &absolute_name);
     }
 #endif
   if (desc < 0)
@@ -976,7 +981,7 @@ symfile_bfd_open (name)
     }
   free (name);                 /* Free 1st new malloc'd copy */
   name = absolute_name;                /* Keep 2nd malloc'd copy in bfd */
-                               /* It'll be freed in free_objfile(). */
+  /* It'll be freed in free_objfile(). */
 
   sym_bfd = bfd_fdopenr (name, gnutarget, desc);
   if (!sym_bfd)
@@ -991,8 +996,8 @@ symfile_bfd_open (name)
   if (!bfd_check_format (sym_bfd, bfd_object))
     {
       /* FIXME: should be checking for errors from bfd_close (for one thing,
-        on error it does not free all the storage associated with the
-        bfd).  */
+         on error it does not free all the storage associated with the
+         bfd).  */
       bfd_close (sym_bfd);     /* This also closes desc */
       make_cleanup (free, name);
       error ("\"%s\": can't read symbols: %s.", name,
@@ -1025,28 +1030,28 @@ find_sym_fns (objfile)
      struct objfile *objfile;
 {
   struct sym_fns *sf;
-  enum bfd_flavour our_flavour = bfd_get_flavour (objfile -> obfd);
-  char *our_target = bfd_get_target (objfile -> obfd);
+  enum bfd_flavour our_flavour = bfd_get_flavour (objfile->obfd);
+  char *our_target = bfd_get_target (objfile->obfd);
 
   /* Special kludge for RS/6000 and PowerMac.  See xcoffread.c.  */
   if (STREQ (our_target, "aixcoff-rs6000") ||
       STREQ (our_target, "xcoff-powermac"))
-    our_flavour = (enum bfd_flavour)-1;
+    our_flavour = (enum bfd_flavour) -1;
 
   /* Special kludge for apollo.  See dstread.c.  */
   if (STREQN (our_target, "apollo", 6))
-    our_flavour = (enum bfd_flavour)-2;
+    our_flavour = (enum bfd_flavour) -2;
 
-  for (sf = symtab_fns; sf != NULL; sf = sf -> next)
+  for (sf = symtab_fns; sf != NULL; sf = sf->next)
     {
-      if (our_flavour == sf -> sym_flavour)
+      if (our_flavour == sf->sym_flavour)
        {
-         objfile -> sf = sf;
+         objfile->sf = sf;
          return;
        }
     }
   error ("I'm sorry, Dave, I can't do that.  Symbol format `%s' unknown.",
-        bfd_get_target (objfile -> obfd));
+        bfd_get_target (objfile->obfd));
 }
 \f
 /* This function runs the load command of our current target.  */
@@ -1073,24 +1078,24 @@ load_command (arg, from_tty)
 #define VALIDATE_DOWNLOAD 0
 void
 generic_load (filename, from_tty)
-    char *filename;
-    int from_tty;
+     char *filename;
+     int from_tty;
 {
   struct cleanup *old_cleanups;
   asection *s;
   bfd *loadfile_bfd;
   time_t start_time, end_time; /* Start and end times of download */
   unsigned long data_count = 0;        /* Number of bytes transferred to memory */
-  int n; 
-  unsigned long load_offset = 0;       /* offset to add to vma for each section */
-  char buf[GENERIC_LOAD_CHUNK+8];
-#if VALIDATE_DOWNLOAD  
-  char verify_buffer[GENERIC_LOAD_CHUNK+8] ;
-#endif  
+  int n;
+  unsigned long load_offset = 0;       /* offset to add to vma for each section */
+  char buf[GENERIC_LOAD_CHUNK + 8];
+#if VALIDATE_DOWNLOAD
+  char verify_buffer[GENERIC_LOAD_CHUNK + 8];
+#endif
 
   /* enable user to specify address for downloading as 2nd arg to load */
-  n = sscanf(filename, "%s 0x%lx", buf, &load_offset);
-  if (n > 1 ) 
+  n = sscanf (filename, "%s 0x%lx", buf, &load_offset);
+  if (n > 1)
     filename = buf;
   else
     load_offset = 0;
@@ -1106,94 +1111,95 @@ generic_load (filename, from_tty)
      bfd).  */
   old_cleanups = make_cleanup ((make_cleanup_func) bfd_close, loadfile_bfd);
 
-  if (!bfd_check_format (loadfile_bfd, bfd_object)) 
+  if (!bfd_check_format (loadfile_bfd, bfd_object))
     {
       error ("\"%s\" is not an object file: %s", filename,
             bfd_errmsg (bfd_get_error ()));
     }
-  
+
   start_time = time (NULL);
 
-  for (s = loadfile_bfd->sections; s; s = s->next) 
-    {
-      if (s->flags & SEC_LOAD) 
-        {
-          bfd_size_type size;
-
-          size = bfd_get_section_size_before_reloc (s);
-          if (size > 0)
-            {
-              char *buffer;
-              struct cleanup *old_chain;
-              bfd_vma lma;
-              unsigned long l = size ;
-              int err;
-              char *sect;
-              unsigned long sent;
-              unsigned long len;
-             
-             l = l > GENERIC_LOAD_CHUNK ? GENERIC_LOAD_CHUNK : l ;
-
-              buffer = xmalloc (size);
-              old_chain = make_cleanup (free, buffer);
-
-              lma = s->lma;
-              lma += load_offset;
-
-              /* Is this really necessary?  I guess it gives the user something
-                 to look at during a long download.  */
-              printf_filtered ("Loading section %s, size 0x%lx lma ",
-                               bfd_get_section_name (loadfile_bfd, s),
-                               (unsigned long) size);
-              print_address_numeric (lma, 1, gdb_stdout);
-              printf_filtered ("\n");
-
-              bfd_get_section_contents (loadfile_bfd, s, buffer, 0, size);
-
-              sect = (char *) bfd_get_section_name (loadfile_bfd, s);
-              sent = 0;
-              do
-                {            
-                  len = (size - sent) < l ? (size - sent) : l;
-                  sent += len;
-                  err = target_write_memory (lma, buffer, len);
-                  if (ui_load_progress_hook)
-                    if (ui_load_progress_hook (sect, sent))
+  for (s = loadfile_bfd->sections; s; s = s->next)
+    {
+      if (s->flags & SEC_LOAD)
+       {
+         bfd_size_type size;
+
+         size = bfd_get_section_size_before_reloc (s);
+         if (size > 0)
+           {
+             char *buffer;
+             struct cleanup *old_chain;
+             bfd_vma lma;
+             unsigned long l = size;
+             int err;
+             char *sect;
+             unsigned long sent;
+             unsigned long len;
+
+             l = l > GENERIC_LOAD_CHUNK ? GENERIC_LOAD_CHUNK : l;
+
+             buffer = xmalloc (size);
+             old_chain = make_cleanup (free, buffer);
+
+             lma = s->lma;
+             lma += load_offset;
+
+             /* Is this really necessary?  I guess it gives the user something
+                to look at during a long download.  */
+             printf_filtered ("Loading section %s, size 0x%lx lma ",
+                              bfd_get_section_name (loadfile_bfd, s),
+                              (unsigned long) size);
+             print_address_numeric (lma, 1, gdb_stdout);
+             printf_filtered ("\n");
+
+             bfd_get_section_contents (loadfile_bfd, s, buffer, 0, size);
+
+             sect = (char *) bfd_get_section_name (loadfile_bfd, s);
+             sent = 0;
+             do
+               {
+                 len = (size - sent) < l ? (size - sent) : l;
+                 sent += len;
+                 err = target_write_memory (lma, buffer, len);
+                 if (ui_load_progress_hook)
+                   if (ui_load_progress_hook (sect, sent))
                      error ("Canceled the download");
 #if VALIDATE_DOWNLOAD
                  /* Broken memories and broken monitors manifest themselves
                     here when bring new computers to life.
                     This doubles already slow downloads.
-                 */
-                 if (err) break ;
+                  */
+                 if (err)
+                   break;
                  {
-                   target_read_memory(lma,verify_buffer,len) ;
-                   if (0 != bcmp(buffer,verify_buffer,len))
-                     error("Download verify failed at %08x",
-                           (unsigned long)lma) ;
+                   target_read_memory (lma, verify_buffer, len);
+                   if (0 != bcmp (buffer, verify_buffer, len))
+                     error ("Download verify failed at %08x",
+                            (unsigned long) lma);
                  }
 
 #endif
-                 data_count += len ;
-                  lma  += len;
-                  buffer += len;
-                } /* od */
-              while (err == 0 && sent < size);
+                 data_count += len;
+                 lma += len;
+                 buffer += len;
+               }               /* od */
+             while (err == 0 && sent < size);
+
+             if (err != 0)
+               error ("Memory access error while loading section %s.",
+                      bfd_get_section_name (loadfile_bfd, s));
 
-              if (err != 0)
-                error ("Memory access error while loading section %s.", 
-                       bfd_get_section_name (loadfile_bfd, s));
-                
-              do_cleanups (old_chain);
-            }
-        }
+             do_cleanups (old_chain);
+           }
+       }
     }
 
   end_time = time (NULL);
   {
-    unsigned long entry ;
-    entry = bfd_get_start_address(loadfile_bfd) ;
-    printf_filtered ("Start address 0x%lx , load size %d\n", entry,data_count);
+    unsigned long entry;
+    entry = bfd_get_start_address (loadfile_bfd);
+    printf_filtered ("Start address 0x%lx , load size %d\n", entry, data_count);
     /* We were doing this in remote-mips.c, I suspect it is right
        for other targets too.  */
     write_pc (entry);
@@ -1214,8 +1220,8 @@ generic_load (filename, from_tty)
 
 void
 report_transfer_performance (data_count, start_time, end_time)
-unsigned long data_count;
-time_t start_time, end_time;
+     unsigned long data_count;
+     time_t start_time, end_time;
 {
   printf_filtered ("Transfer rate: ");
   if (end_time != start_time)
@@ -1240,7 +1246,7 @@ add_symbol_file_command (args, from_tty)
   char *arg;
   int readnow = 0;
   int mapped = 0;
-  
+
   dont_repeat ();
 
   if (args == NULL)
@@ -1257,9 +1263,15 @@ add_symbol_file_command (args, from_tty)
 
   while ((*args != '\000') && (name == NULL))
     {
-      while (isspace (*args)) {args++;}
+      while (isspace (*args))
+       {
+         args++;
+       }
       arg = args;
-      while ((*args != '\000') && !isspace (*args)) {args++;}
+      while ((*args != '\000') && !isspace (*args))
+       {
+         args++;
+       }
       if (*args != '\000')
        {
          *args++ = '\000';
@@ -1299,20 +1311,20 @@ add_symbol_file_command (args, from_tty)
     }
   else
     {
-      target_link(name, &text_addr);
-      if (text_addr == (CORE_ADDR)-1)
-       error("Don't know how to get text start location for this file");
+      target_link (name, &text_addr);
+      if (text_addr == (CORE_ADDR) - 1)
+       error ("Don't know how to get text start location for this file");
     }
 
   /* FIXME-32x64: Assumes text_addr fits in a long.  */
   if ((from_tty)
       && (!query ("add symbol table from file \"%s\" at text_addr = %s?\n",
-                 name, local_hex_string ((unsigned long)text_addr))))
+                 name, local_hex_string ((unsigned long) text_addr))))
     error ("Not confirmed.");
 
   symbol_file_add (name, from_tty, text_addr, 0, mapped, readnow,
-                   1,  /* user_loaded */
-                   0); /* We'll guess it's ! is_solib */
+                  1,           /* user_loaded */
+                  0);          /* We'll guess it's ! is_solib */
 
   /* Getting new symbols may change our opinion about what is
      frameless.  */
@@ -1320,7 +1332,7 @@ add_symbol_file_command (args, from_tty)
 }
 \f
 static void
-add_shared_symbol_files_command  (args, from_tty)
+add_shared_symbol_files_command (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -1328,7 +1340,7 @@ add_shared_symbol_files_command  (args, from_tty)
   ADD_SHARED_SYMBOL_FILES (args, from_tty);
 #else
   error ("This command is not available in this configuration of GDB.");
-#endif  
+#endif
 }
 \f
 /* Re-read symbols if a symbol-file has changed.  */
@@ -1347,212 +1359,217 @@ reread_symbols ()
      This routine should then walk down each partial symbol table
      and see if the symbol table that it originates from has been changed */
 
-  for (objfile = object_files; objfile; objfile = objfile->next) {
-    if (objfile->obfd) {
+  for (objfile = object_files; objfile; objfile = objfile->next)
+    {
+      if (objfile->obfd)
+       {
 #ifdef IBM6000_TARGET
-     /* If this object is from a shared library, then you should
-        stat on the library name, not member name. */
+         /* If this object is from a shared library, then you should
+            stat on the library name, not member name. */
 
-     if (objfile->obfd->my_archive)
-       res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
-     else
+         if (objfile->obfd->my_archive)
+           res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
+         else
 #endif
-      res = stat (objfile->name, &new_statbuf);
-      if (res != 0) {
-       /* FIXME, should use print_sys_errmsg but it's not filtered. */
-       printf_filtered ("`%s' has disappeared; keeping its symbols.\n",
-                        objfile->name);
-       continue;
-      }
-      new_modtime = new_statbuf.st_mtime;
-      if (new_modtime != objfile->mtime)
-       {
-         struct cleanup *old_cleanups;
-         struct section_offsets *offsets;
-         int num_offsets;
-         int section_offsets_size;
-         char *obfd_filename;
-
-         printf_filtered ("`%s' has changed; re-reading symbols.\n",
-                          objfile->name);
-
-         /* There are various functions like symbol_file_add,
-            symfile_bfd_open, syms_from_objfile, etc., which might
-            appear to do what we want.  But they have various other
-            effects which we *don't* want.  So we just do stuff
-            ourselves.  We don't worry about mapped files (for one thing,
-            any mapped file will be out of date).  */
-
-         /* If we get an error, blow away this objfile (not sure if
-            that is the correct response for things like shared
-            libraries).  */
-         old_cleanups = make_cleanup ((make_cleanup_func) free_objfile, 
-                                       objfile);
-         /* We need to do this whenever any symbols go away.  */
-         make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
-
-         /* Clean up any state BFD has sitting around.  We don't need
-            to close the descriptor but BFD lacks a way of closing the
-            BFD without closing the descriptor.  */
-         obfd_filename = bfd_get_filename (objfile->obfd);
-         if (!bfd_close (objfile->obfd))
-           error ("Can't close BFD for %s: %s", objfile->name,
-                  bfd_errmsg (bfd_get_error ()));
-         objfile->obfd = bfd_openr (obfd_filename, gnutarget);
-         if (objfile->obfd == NULL)
-           error ("Can't open %s to read symbols.", objfile->name);
-         /* bfd_openr sets cacheable to true, which is what we want.  */
-         if (!bfd_check_format (objfile->obfd, bfd_object))
-           error ("Can't read symbols from %s: %s.", objfile->name,
-                  bfd_errmsg (bfd_get_error ()));
-
-         /* Save the offsets, we will nuke them with the rest of the
-            psymbol_obstack.  */
-         num_offsets = objfile->num_sections;
-         section_offsets_size =
-           sizeof (struct section_offsets)
-             + sizeof (objfile->section_offsets->offsets) * num_offsets;
-         offsets = (struct section_offsets *) alloca (section_offsets_size);
-         memcpy (offsets, objfile->section_offsets, section_offsets_size);
-
-         /* Nuke all the state that we will re-read.  Much of the following
-            code which sets things to NULL really is necessary to tell
-            other parts of GDB that there is nothing currently there.  */
-
-         /* FIXME: Do we have to free a whole linked list, or is this
-            enough?  */
-         if (objfile->global_psymbols.list)
-           mfree (objfile->md, objfile->global_psymbols.list);
-         memset (&objfile -> global_psymbols, 0,
-                 sizeof (objfile -> global_psymbols));
-         if (objfile->static_psymbols.list)
-           mfree (objfile->md, objfile->static_psymbols.list);
-         memset (&objfile -> static_psymbols, 0,
-                 sizeof (objfile -> static_psymbols));
-
-         /* Free the obstacks for non-reusable objfiles */
-         obstack_free (&objfile -> psymbol_cache.cache, 0);
-         memset (&objfile -> psymbol_cache, 0,
-                 sizeof (objfile -> psymbol_cache));
-         obstack_free (&objfile -> psymbol_obstack, 0);
-         obstack_free (&objfile -> symbol_obstack, 0);
-         obstack_free (&objfile -> type_obstack, 0);
-         objfile->sections = NULL;
-         objfile->symtabs = NULL;
-         objfile->psymtabs = NULL;
-         objfile->free_psymtabs = NULL;
-         objfile->msymbols = NULL;
-         objfile->minimal_symbol_count= 0;
-         objfile->fundamental_types = NULL;
-         if (objfile -> sf != NULL)
+           res = stat (objfile->name, &new_statbuf);
+         if (res != 0)
            {
-             (*objfile -> sf -> sym_finish) (objfile);
+             /* FIXME, should use print_sys_errmsg but it's not filtered. */
+             printf_filtered ("`%s' has disappeared; keeping its symbols.\n",
+                              objfile->name);
+             continue;
            }
-
-         /* We never make this a mapped file.  */
-         objfile -> md = NULL;
-         /* obstack_specify_allocation also initializes the obstack so
-            it is empty.  */
-         obstack_specify_allocation (&objfile -> psymbol_cache.cache, 0, 0,
-                                     xmalloc, free);
-         obstack_specify_allocation (&objfile -> psymbol_obstack, 0, 0,
-                                     xmalloc, free);
-         obstack_specify_allocation (&objfile -> symbol_obstack, 0, 0,
-                                     xmalloc, free);
-         obstack_specify_allocation (&objfile -> type_obstack, 0, 0,
-                                     xmalloc, free);
-         if (build_objfile_section_table (objfile))
+         new_modtime = new_statbuf.st_mtime;
+         if (new_modtime != objfile->mtime)
            {
-             error ("Can't find the file sections in `%s': %s", 
-                    objfile -> name, bfd_errmsg (bfd_get_error ()));
-           }
-
-         /* We use the same section offsets as from last time.  I'm not
-            sure whether that is always correct for shared libraries.  */
-         objfile->section_offsets = (struct section_offsets *)
-           obstack_alloc (&objfile -> psymbol_obstack, section_offsets_size);
-         memcpy (objfile->section_offsets, offsets, section_offsets_size);
-         objfile->num_sections = num_offsets;
-
-         /* What the hell is sym_new_init for, anyway?  The concept of
-            distinguishing between the main file and additional files
-            in this way seems rather dubious.  */
-         if (objfile == symfile_objfile)
-            {
-              (*objfile->sf->sym_new_init) (objfile);
+             struct cleanup *old_cleanups;
+             struct section_offsets *offsets;
+             int num_offsets;
+             int section_offsets_size;
+             char *obfd_filename;
+
+             printf_filtered ("`%s' has changed; re-reading symbols.\n",
+                              objfile->name);
+
+             /* There are various functions like symbol_file_add,
+                symfile_bfd_open, syms_from_objfile, etc., which might
+                appear to do what we want.  But they have various other
+                effects which we *don't* want.  So we just do stuff
+                ourselves.  We don't worry about mapped files (for one thing,
+                any mapped file will be out of date).  */
+
+             /* If we get an error, blow away this objfile (not sure if
+                that is the correct response for things like shared
+                libraries).  */
+             old_cleanups = make_cleanup ((make_cleanup_func) free_objfile,
+                                          objfile);
+             /* We need to do this whenever any symbols go away.  */
+             make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
+
+             /* Clean up any state BFD has sitting around.  We don't need
+                to close the descriptor but BFD lacks a way of closing the
+                BFD without closing the descriptor.  */
+             obfd_filename = bfd_get_filename (objfile->obfd);
+             if (!bfd_close (objfile->obfd))
+               error ("Can't close BFD for %s: %s", objfile->name,
+                      bfd_errmsg (bfd_get_error ()));
+             objfile->obfd = bfd_openr (obfd_filename, gnutarget);
+             if (objfile->obfd == NULL)
+               error ("Can't open %s to read symbols.", objfile->name);
+             /* bfd_openr sets cacheable to true, which is what we want.  */
+             if (!bfd_check_format (objfile->obfd, bfd_object))
+               error ("Can't read symbols from %s: %s.", objfile->name,
+                      bfd_errmsg (bfd_get_error ()));
+
+             /* Save the offsets, we will nuke them with the rest of the
+                psymbol_obstack.  */
+             num_offsets = objfile->num_sections;
+             section_offsets_size =
+               sizeof (struct section_offsets)
+             + sizeof (objfile->section_offsets->offsets) * num_offsets;
+             offsets = (struct section_offsets *) alloca (section_offsets_size);
+             memcpy (offsets, objfile->section_offsets, section_offsets_size);
+
+             /* Nuke all the state that we will re-read.  Much of the following
+                code which sets things to NULL really is necessary to tell
+                other parts of GDB that there is nothing currently there.  */
+
+             /* FIXME: Do we have to free a whole linked list, or is this
+                enough?  */
+             if (objfile->global_psymbols.list)
+               mfree (objfile->md, objfile->global_psymbols.list);
+             memset (&objfile->global_psymbols, 0,
+                     sizeof (objfile->global_psymbols));
+             if (objfile->static_psymbols.list)
+               mfree (objfile->md, objfile->static_psymbols.list);
+             memset (&objfile->static_psymbols, 0,
+                     sizeof (objfile->static_psymbols));
+
+             /* Free the obstacks for non-reusable objfiles */
+             obstack_free (&objfile->psymbol_cache.cache, 0);
+             memset (&objfile->psymbol_cache, 0,
+                     sizeof (objfile->psymbol_cache));
+             obstack_free (&objfile->psymbol_obstack, 0);
+             obstack_free (&objfile->symbol_obstack, 0);
+             obstack_free (&objfile->type_obstack, 0);
+             objfile->sections = NULL;
+             objfile->symtabs = NULL;
+             objfile->psymtabs = NULL;
+             objfile->free_psymtabs = NULL;
+             objfile->msymbols = NULL;
+             objfile->minimal_symbol_count = 0;
+             objfile->fundamental_types = NULL;
+             if (objfile->sf != NULL)
+               {
+                 (*objfile->sf->sym_finish) (objfile);
+               }
+
+             /* We never make this a mapped file.  */
+             objfile->md = NULL;
+             /* obstack_specify_allocation also initializes the obstack so
+                it is empty.  */
+             obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
+                                         xmalloc, free);
+             obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0,
+                                         xmalloc, free);
+             obstack_specify_allocation (&objfile->symbol_obstack, 0, 0,
+                                         xmalloc, free);
+             obstack_specify_allocation (&objfile->type_obstack, 0, 0,
+                                         xmalloc, free);
+             if (build_objfile_section_table (objfile))
+               {
+                 error ("Can't find the file sections in `%s': %s",
+                        objfile->name, bfd_errmsg (bfd_get_error ()));
+               }
+
+             /* We use the same section offsets as from last time.  I'm not
+                sure whether that is always correct for shared libraries.  */
+             objfile->section_offsets = (struct section_offsets *)
+               obstack_alloc (&objfile->psymbol_obstack, section_offsets_size);
+             memcpy (objfile->section_offsets, offsets, section_offsets_size);
+             objfile->num_sections = num_offsets;
+
+             /* What the hell is sym_new_init for, anyway?  The concept of
+                distinguishing between the main file and additional files
+                in this way seems rather dubious.  */
+             if (objfile == symfile_objfile)
+               {
+                 (*objfile->sf->sym_new_init) (objfile);
 #ifdef HPUXHPPA
-              RESET_HP_UX_GLOBALS ();
+                 RESET_HP_UX_GLOBALS ();
 #endif
-            }
-
-         (*objfile->sf->sym_init) (objfile);
-         clear_complaints (1, 1);
-         /* The "mainline" parameter is a hideous hack; I think leaving it
-            zero is OK since dbxread.c also does what it needs to do if
-            objfile->global_psymbols.size is 0.  */
-         (*objfile->sf->sym_read) (objfile, objfile->section_offsets, 0);
-         if (!have_partial_symbols () && !have_full_symbols ())
-           {
-             wrap_here ("");
-             printf_filtered ("(no debugging symbols found)\n");
-             wrap_here ("");
-           }
-         objfile -> flags |= OBJF_SYMS;
+               }
+
+             (*objfile->sf->sym_init) (objfile);
+             clear_complaints (1, 1);
+             /* The "mainline" parameter is a hideous hack; I think leaving it
+                zero is OK since dbxread.c also does what it needs to do if
+                objfile->global_psymbols.size is 0.  */
+             (*objfile->sf->sym_read) (objfile, objfile->section_offsets, 0);
+             if (!have_partial_symbols () && !have_full_symbols ())
+               {
+                 wrap_here ("");
+                 printf_filtered ("(no debugging symbols found)\n");
+                 wrap_here ("");
+               }
+             objfile->flags |= OBJF_SYMS;
+
+             /* We're done reading the symbol file; finish off complaints.  */
+             clear_complaints (0, 1);
 
-         /* We're done reading the symbol file; finish off complaints.  */
-         clear_complaints (0, 1);
-
-         /* Getting new symbols may change our opinion about what is
-            frameless.  */
+             /* Getting new symbols may change our opinion about what is
+                frameless.  */
 
-         reinit_frame_cache ();
+             reinit_frame_cache ();
 
-         /* Discard cleanups as symbol reading was successful.  */
-         discard_cleanups (old_cleanups);
+             /* Discard cleanups as symbol reading was successful.  */
+             discard_cleanups (old_cleanups);
 
-         /* If the mtime has changed between the time we set new_modtime
-            and now, we *want* this to be out of date, so don't call stat
-            again now.  */
-         objfile->mtime = new_modtime;
-         reread_one = 1;
+             /* If the mtime has changed between the time we set new_modtime
+                and now, we *want* this to be out of date, so don't call stat
+                again now.  */
+             objfile->mtime = new_modtime;
+             reread_one = 1;
 
-         /* Call this after reading in a new symbol table to give target
-            dependant code a crack at the new symbols.  For instance, this
-            could be used to update the values of target-specific symbols GDB
-            needs to keep track of (such as _sigtramp, or whatever).  */
+             /* Call this after reading in a new symbol table to give target
+                dependant code a crack at the new symbols.  For instance, this
+                could be used to update the values of target-specific symbols GDB
+                needs to keep track of (such as _sigtramp, or whatever).  */
 
-         TARGET_SYMFILE_POSTREAD (objfile);
+             TARGET_SYMFILE_POSTREAD (objfile);
+           }
        }
     }
-  }
 
   if (reread_one)
     clear_symtab_users ();
 }
-
 \f
 
-typedef struct {
-  char         *ext;
+
+typedef struct
+{
+  char *ext;
   enum language lang;
-} filename_language;
+}
+filename_language;
 
-static filename_language * filename_language_table;
+static filename_language *filename_language_table;
 static int fl_table_size, fl_table_next;
 
 static void
 add_filename_language (ext, lang)
-     char         *ext;
+     char *ext;
      enum language lang;
 {
   if (fl_table_next >= fl_table_size)
     {
       fl_table_size += 10;
-      filename_language_table = realloc (filename_language_table, 
+      filename_language_table = realloc (filename_language_table,
                                         fl_table_size);
     }
 
-  filename_language_table[fl_table_next].ext  = strsave (ext);
+  filename_language_table[fl_table_next].ext = strsave (ext);
   filename_language_table[fl_table_next].lang = lang;
   fl_table_next++;
 }
@@ -1573,7 +1590,7 @@ set_ext_lang_command (args, from_tty)
     error ("'%s': Filename extension must begin with '.'", ext_args);
 
   /* Find end of first arg.  */
-  while (*cp && !isspace (*cp))        
+  while (*cp && !isspace (*cp))
     cp++;
 
   if (*cp == '\0')
@@ -1581,7 +1598,7 @@ set_ext_lang_command (args, from_tty)
           ext_args);
 
   /* Null-terminate first arg */
-  *cp++ = '\0'; 
+  *cp++ = '\0';
 
   /* Find beginning of second arg, which should be a source language.  */
   while (*cp && isspace (*cp))
@@ -1613,7 +1630,7 @@ set_ext_lang_command (args, from_tty)
       /*          ext_args, language_str (lang));           */
 
       free (filename_language_table[i].ext);
-      filename_language_table[i].ext  = strsave (ext_args);
+      filename_language_table[i].ext = strsave (ext_args);
       filename_language_table[i].lang = lang;
     }
 }
@@ -1621,15 +1638,15 @@ set_ext_lang_command (args, from_tty)
 static void
 info_ext_lang_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
   int i;
 
   printf_filtered ("Filename extensions and the languages they represent:");
   printf_filtered ("\n\n");
   for (i = 0; i < fl_table_next; i++)
-    printf_filtered ("\t%s\t- %s\n", 
-                    filename_language_table[i].ext, 
+    printf_filtered ("\t%s\t- %s\n",
+                    filename_language_table[i].ext,
                     language_str (filename_language_table[i].lang));
 }
 
@@ -1640,24 +1657,24 @@ init_filename_language_table ()
     {
       fl_table_size = 20;
       fl_table_next = 0;
-      filename_language_table = 
+      filename_language_table =
        xmalloc (fl_table_size * sizeof (*filename_language_table));
-      add_filename_language (".c",     language_c);
-      add_filename_language (".C",     language_cplus);
-      add_filename_language (".cc",    language_cplus);
-      add_filename_language (".cp",    language_cplus);
-      add_filename_language (".cpp",   language_cplus);
-      add_filename_language (".cxx",   language_cplus);
-      add_filename_language (".c++",   language_cplus);
-      add_filename_language (".java",  language_java);
+      add_filename_language (".c", language_c);
+      add_filename_language (".C", language_cplus);
+      add_filename_language (".cc", language_cplus);
+      add_filename_language (".cp", language_cplus);
+      add_filename_language (".cpp", language_cplus);
+      add_filename_language (".cxx", language_cplus);
+      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);
-      add_filename_language (".f",     language_fortran);
-      add_filename_language (".F",     language_fortran);
-      add_filename_language (".s",     language_asm);
-      add_filename_language (".S",     language_asm);
+      add_filename_language (".ch", language_chill);
+      add_filename_language (".c186", language_chill);
+      add_filename_language (".c286", language_chill);
+      add_filename_language (".f", language_fortran);
+      add_filename_language (".F", language_fortran);
+      add_filename_language (".s", language_asm);
+      add_filename_language (".S", language_asm);
     }
 }
 
@@ -1683,12 +1700,12 @@ deduce_language_from_filename (filename)
    to it.  error() if no space.
 
    Caller must set these fields:
-       LINETABLE(symtab)
-       symtab->blockvector
-       symtab->dirname
-       symtab->free_code
-       symtab->free_ptr
-       possibly free_named_symtabs (symtab->filename);
+   LINETABLE(symtab)
+   symtab->blockvector
+   symtab->dirname
+   symtab->free_code
+   symtab->free_ptr
+   possibly free_named_symtabs (symtab->filename);
  */
 
 struct symtab *
@@ -1699,20 +1716,20 @@ allocate_symtab (filename, objfile)
   register struct symtab *symtab;
 
   symtab = (struct symtab *)
-    obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symtab));
+    obstack_alloc (&objfile->symbol_obstack, sizeof (struct symtab));
   memset (symtab, 0, sizeof (*symtab));
-  symtab -> filename = obsavestring (filename, strlen (filename),
-                                    &objfile -> symbol_obstack);
-  symtab -> fullname = NULL;
-  symtab -> language = deduce_language_from_filename (filename);
-  symtab -> debugformat = obsavestring ("unknown", 7,
-                                       &objfile -> symbol_obstack);
+  symtab->filename = obsavestring (filename, strlen (filename),
+                                  &objfile->symbol_obstack);
+  symtab->fullname = NULL;
+  symtab->language = deduce_language_from_filename (filename);
+  symtab->debugformat = obsavestring ("unknown", 7,
+                                     &objfile->symbol_obstack);
 
   /* Hook it to the objfile it comes from */
 
-  symtab -> objfile = objfile;
-  symtab -> next = objfile -> symtabs;
-  objfile -> symtabs = symtab;
+  symtab->objfile = objfile;
+  symtab->next = objfile->symtabs;
+  objfile->symtabs = symtab;
 
   /* FIXME: This should go away.  It is only defined for the Z8000,
      and the Z8000 definition of this macro doesn't have anything to
@@ -1732,40 +1749,40 @@ allocate_psymtab (filename, objfile)
 {
   struct partial_symtab *psymtab;
 
-  if (objfile -> free_psymtabs)
+  if (objfile->free_psymtabs)
     {
-      psymtab = objfile -> free_psymtabs;
-      objfile -> free_psymtabs = psymtab -> next;
+      psymtab = objfile->free_psymtabs;
+      objfile->free_psymtabs = psymtab->next;
     }
   else
     psymtab = (struct partial_symtab *)
-      obstack_alloc (&objfile -> psymbol_obstack,
+      obstack_alloc (&objfile->psymbol_obstack,
                     sizeof (struct partial_symtab));
 
   memset (psymtab, 0, sizeof (struct partial_symtab));
-  psymtab -> filename = obsavestring (filename, strlen (filename),
-                                     &objfile -> psymbol_obstack);
-  psymtab -> symtab = NULL;
+  psymtab->filename = obsavestring (filename, strlen (filename),
+                                   &objfile->psymbol_obstack);
+  psymtab->symtab = NULL;
 
   /* Prepend it to the psymtab list for the objfile it belongs to.
      Psymtabs are searched in most recent inserted -> least recent
      inserted order. */
 
-  psymtab -> objfile = objfile;
-  psymtab -> next = objfile -> psymtabs;
-  objfile -> psymtabs = psymtab;
+  psymtab->objfile = objfile;
+  psymtab->next = objfile->psymtabs;
+  objfile->psymtabs = psymtab;
 #if 0
   {
     struct partial_symtab **prev_pst;
-    psymtab -> objfile = objfile;
-    psymtab -> next = NULL;
-    prev_pst = &(objfile -> psymtabs);
+    psymtab->objfile = objfile;
+    psymtab->next = NULL;
+    prev_pst = &(objfile->psymtabs);
     while ((*prev_pst) != NULL)
-      prev_pst = &((*prev_pst) -> next);
+      prev_pst = &((*prev_pst)->next);
     (*prev_pst) = psymtab;
-  }  
+  }
 #endif
-  
+
   return (psymtab);
 }
 
@@ -1794,8 +1811,8 @@ discard_psymtab (pst)
   pst->next = pst->objfile->free_psymtabs;
   pst->objfile->free_psymtabs = pst;
 }
-
 \f
+
 /* Reset all data structures in gdb which may contain references to symbol
    table data.  */
 
@@ -1871,36 +1888,41 @@ cashier_psymtab (pst)
   int i;
 
   /* Find its previous psymtab in the chain */
-  for (ps = pst->objfile->psymtabs; ps; ps = ps->next) {
-    if (ps == pst)
-      break;
-    pprev = ps;
-  }
+  for (ps = pst->objfile->psymtabs; ps; ps = ps->next)
+    {
+      if (ps == pst)
+       break;
+      pprev = ps;
+    }
 
-  if (ps) {
-    /* Unhook it from the chain.  */
-    if (ps == pst->objfile->psymtabs)
-      pst->objfile->psymtabs = ps->next;
-    else
-      pprev->next = ps->next;
-
-    /* FIXME, we can't conveniently deallocate the entries in the
-       partial_symbol lists (global_psymbols/static_psymbols) that
-       this psymtab points to.  These just take up space until all
-       the psymtabs are reclaimed.  Ditto the dependencies list and
-       filename, which are all in the psymbol_obstack.  */
-
-    /* We need to cashier any psymtab that has this one as a dependency... */
-again:
-    for (ps = pst->objfile->psymtabs; ps; ps = ps->next) {
-      for (i = 0; i < ps->number_of_dependencies; i++) {
-       if (ps->dependencies[i] == pst) {
-         cashier_psymtab (ps);
-         goto again;           /* Must restart, chain has been munged. */
+  if (ps)
+    {
+      /* Unhook it from the chain.  */
+      if (ps == pst->objfile->psymtabs)
+       pst->objfile->psymtabs = ps->next;
+      else
+       pprev->next = ps->next;
+
+      /* FIXME, we can't conveniently deallocate the entries in the
+         partial_symbol lists (global_psymbols/static_psymbols) that
+         this psymtab points to.  These just take up space until all
+         the psymtabs are reclaimed.  Ditto the dependencies list and
+         filename, which are all in the psymbol_obstack.  */
+
+      /* We need to cashier any psymtab that has this one as a dependency... */
+    again:
+      for (ps = pst->objfile->psymtabs; ps; ps = ps->next)
+       {
+         for (i = 0; i < ps->number_of_dependencies; i++)
+           {
+             if (ps->dependencies[i] == pst)
+               {
+                 cashier_psymtab (ps);
+                 goto again;   /* Must restart, chain has been munged. */
+               }
+           }
        }
-      }
     }
-  }
 }
 
 /* If a symtab or psymtab for filename NAME is found, free it along
@@ -1947,12 +1969,14 @@ free_named_symtabs (name)
   /* Look for a psymtab with the specified name.  */
 
 again2:
-  for (ps = partial_symtab_list; ps; ps = ps->next) {
-    if (STREQ (name, ps->filename)) {
-      cashier_psymtab (ps);    /* Blow it away...and its little dog, too.  */
-      goto again2;             /* Must restart, chain has been munged */
+  for (ps = partial_symtab_list; ps; ps = ps->next)
+    {
+      if (STREQ (name, ps->filename))
+       {
+         cashier_psymtab (ps); /* Blow it away...and its little dog, too.  */
+         goto again2;          /* Must restart, chain has been munged */
+       }
     }
-  }
 
   /* Look for a symtab with the specified name.  */
 
@@ -1971,14 +1995,14 @@ again2:
        prev->next = s->next;
 
       /* For now, queue a delete for all breakpoints, displays, etc., whether
-        or not they depend on the symtab being freed.  This should be
-        changed so that only those data structures affected are deleted.  */
+         or not they depend on the symtab being freed.  This should be
+         changed so that only those data structures affected are deleted.  */
 
       /* But don't delete anything if the symtab is empty.
-        This test is necessary due to a bug in "dbxread.c" that
-        causes empty symtabs to be created for N_SO symbols that
-        contain the pathname of the object file.  (This problem
-        has been fixed in GDB 3.9x).  */
+         This test is necessary due to a bug in "dbxread.c" that
+         causes empty symtabs to be created for N_SO symbols that
+         contain the pathname of the object file.  (This problem
+         has been fixed in GDB 3.9x).  */
 
       bv = BLOCKVECTOR (s);
       if (BLOCKVECTOR_NBLOCKS (bv) > 2
@@ -1990,7 +2014,9 @@ again2:
          clear_symtab_users_queued++;
          make_cleanup (clear_symtab_users_once, 0);
          blewit = 1;
-       } else {
+       }
+      else
+       {
          complain (&empty_symtab_complaint, name);
        }
 
@@ -1999,11 +2025,11 @@ again2:
   else
     {
       /* It is still possible that some breakpoints will be affected
-        even though no symtab was found, since the file might have
-        been compiled without debugging, and hence not be associated
-        with a symtab.  In order to handle this correctly, we would need
-        to keep a list of text address ranges for undebuggable files.
-        For now, we do nothing, since this is a fairly obscure case.  */
+         even though no symtab was found, since the file might have
+         been compiled without debugging, and hence not be associated
+         with a symtab.  In order to handle this correctly, we would need
+         to keep a list of text address ranges for undebuggable files.
+         For now, we do nothing, since this is a fairly obscure case.  */
       ;
     }
 
@@ -2035,11 +2061,11 @@ start_psymtab_common (objfile, section_offsets,
   struct partial_symtab *psymtab;
 
   psymtab = allocate_psymtab (filename, objfile);
-  psymtab -> section_offsets = section_offsets;
-  psymtab -> textlow = textlow;
-  psymtab -> texthigh = psymtab -> textlow;  /* default */
-  psymtab -> globals_offset = global_syms - objfile -> global_psymbols.list;
-  psymtab -> statics_offset = static_syms - objfile -> static_psymbols.list;
+  psymtab->section_offsets = section_offsets;
+  psymtab->textlow = textlow;
+  psymtab->texthigh = psymtab->textlow;                /* default */
+  psymtab->globals_offset = global_syms - objfile->global_psymbols.list;
+  psymtab->statics_offset = static_syms - objfile->static_psymbols.list;
   return (psymtab);
 }
 \f
@@ -2054,8 +2080,8 @@ add_psymbol_to_list (name, namelength, namespace, class, list, val, coreaddr,
      namespace_enum namespace;
      enum address_class class;
      struct psymbol_allocation_list *list;
-     long val;                                 /* Value as a long */
-     CORE_ADDR coreaddr;                       /* Value as a CORE_ADDR */
+     long val;                 /* Value as a long */
+     CORE_ADDR coreaddr;       /* Value as a CORE_ADDR */
      enum language language;
      struct objfile *objfile;
 {
@@ -2103,7 +2129,7 @@ add_psymbol_to_list (name, namelength, namespace, class, list, val, coreaddr,
 
 void
 add_psymbol_with_dem_name_to_list (name, namelength, dem_name, dem_namelength,
-                                   namespace, class, list, val, coreaddr, language, objfile)
+                  namespace, class, list, val, coreaddr, language, objfile)
      char *name;
      int namelength;
      char *dem_name;
@@ -2111,8 +2137,8 @@ add_psymbol_with_dem_name_to_list (name, namelength, dem_name, dem_namelength,
      namespace_enum namespace;
      enum address_class class;
      struct psymbol_allocation_list *list;
-     long val;                                 /* Value as a long */
-     CORE_ADDR coreaddr;                       /* Value as a CORE_ADDR */
+     long val;                 /* Value as a long */
+     CORE_ADDR coreaddr;       /* Value as a CORE_ADDR */
      enum language language;
      struct objfile *objfile;
 {
@@ -2132,18 +2158,18 @@ add_psymbol_with_dem_name_to_list (name, namelength, dem_name, dem_namelength,
   buf = alloca (dem_namelength + 1);
   memcpy (buf, dem_name, dem_namelength);
   buf[dem_namelength] = '\0';
-  
+
   switch (language)
     {
-      case language_c:
-      case language_cplus:
-        SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
-          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);
-        
+    case language_c:
+    case language_cplus:
+      SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
+       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);
+
       /* FIXME What should be done for the default case? Ignoring for now. */
     }
 
@@ -2182,36 +2208,36 @@ init_psymbol_list (objfile, total_symbols)
      int total_symbols;
 {
   /* Free any previously allocated psymbol lists.  */
-  
-  if (objfile -> global_psymbols.list)
+
+  if (objfile->global_psymbols.list)
     {
-      mfree (objfile -> md, (PTR)objfile -> global_psymbols.list);
+      mfree (objfile->md, (PTR) objfile->global_psymbols.list);
     }
-  if (objfile -> static_psymbols.list)
+  if (objfile->static_psymbols.list)
     {
-      mfree (objfile -> md, (PTR)objfile -> static_psymbols.list);
+      mfree (objfile->md, (PTR) objfile->static_psymbols.list);
     }
-  
+
   /* Current best guess is that approximately a twentieth
      of the total symbols (in a debugging file) are global or static
      oriented symbols */
-  
-  objfile -> global_psymbols.size = total_symbols / 10;
-  objfile -> static_psymbols.size = total_symbols / 10;
 
-  if (objfile -> global_psymbols.size > 0)
+  objfile->global_psymbols.size = total_symbols / 10;
+  objfile->static_psymbols.size = total_symbols / 10;
+
+  if (objfile->global_psymbols.size > 0)
     {
-      objfile -> global_psymbols.next =
-       objfile -> global_psymbols.list = (struct partial_symbol **)
-       xmmalloc (objfile -> md, (objfile -> global_psymbols.size
-                                 * sizeof (struct partial_symbol *)));
+      objfile->global_psymbols.next =
+       objfile->global_psymbols.list = (struct partial_symbol **)
+       xmmalloc (objfile->md, (objfile->global_psymbols.size
+                               * sizeof (struct partial_symbol *)));
     }
-  if (objfile -> static_psymbols.size > 0)
+  if (objfile->static_psymbols.size > 0)
     {
-      objfile -> static_psymbols.next =
-       objfile -> static_psymbols.list = (struct partial_symbol **)
-       xmmalloc (objfile -> md, (objfile -> static_psymbols.size
-                                 * sizeof (struct partial_symbol *)));
+      objfile->static_psymbols.next =
+       objfile->static_psymbols.list = (struct partial_symbol **)
+       xmmalloc (objfile->md, (objfile->static_psymbols.size
+                               * sizeof (struct partial_symbol *)));
     }
 }
 
@@ -2220,14 +2246,14 @@ init_psymbol_list (objfile, total_symbols)
 
    The target model is as follows:
    1) The gnu linker will permit multiple sections to be mapped into the
-      same VMA, each with its own unique LMA (or load address).
+   same VMA, each with its own unique LMA (or load address).
    2) It is assumed that some runtime mechanism exists for mapping the
-      sections, one by one, from the load address into the VMA address.
+   sections, one by one, from the load address into the VMA address.
    3) This code provides a mechanism for gdb to keep track of which 
-      sections should be considered to be mapped from the VMA to the LMA.
-      This information is used for symbol lookup, and memory read/write.
-      For instance, if a section has been mapped then its contents 
-      should be read from the VMA, otherwise from the LMA.
+   sections should be considered to be mapped from the VMA to the LMA.
+   This information is used for symbol lookup, and memory read/write.
+   For instance, if a section has been mapped then its contents 
+   should be read from the VMA, otherwise from the LMA.
 
    Two levels of debugger support for overlays are available.  One is
    "manual", in which the debugger relies on the user to tell it which
@@ -2241,26 +2267,26 @@ init_psymbol_list (objfile, total_symbols)
    (by updating the mapped state information in the obj_section tables).
 
    The interface is as follows:
-     User commands:
-       overlay map <name>      -- tell gdb to consider this section mapped
-       overlay unmap <name>    -- tell gdb to consider this section unmapped
-       overlay list            -- list the sections that GDB thinks are mapped
-       overlay read-target     -- get the target's state of what's mapped
-       overlay off/manual/auto -- set overlay debugging state
-     Functional interface:
-       find_pc_mapped_section(pc):    if the pc is in the range of a mapped
-                                     section, return that section.
-       find_pc_overlay(pc):          find any overlay section that contains 
-                                     the pc, either in its VMA or its LMA
-       overlay_is_mapped(sect):       true if overlay is marked as mapped
-       section_is_overlay(sect):      true if section's VMA != LMA
-       pc_in_mapped_range(pc,sec):    true if pc belongs to section's VMA
-       pc_in_unmapped_range(...):     true if pc belongs to section's LMA
-       overlay_mapped_address(...):   map an address from section's LMA to VMA
-       overlay_unmapped_address(...): map an address from section's VMA to LMA
-       symbol_overlayed_address(...): Return a "current" address for symbol:
-                                     either in VMA or LMA depending on whether
-                                     the symbol's section is currently mapped
+   User commands:
+   overlay map <name>   -- tell gdb to consider this section mapped
+   overlay unmap <name> -- tell gdb to consider this section unmapped
+   overlay list         -- list the sections that GDB thinks are mapped
+   overlay read-target  -- get the target's state of what's mapped
+   overlay off/manual/auto -- set overlay debugging state
+   Functional interface:
+   find_pc_mapped_section(pc):    if the pc is in the range of a mapped
+   section, return that section.
+   find_pc_overlay(pc):       find any overlay section that contains 
+   the pc, either in its VMA or its LMA
+   overlay_is_mapped(sect):       true if overlay is marked as mapped
+   section_is_overlay(sect):      true if section's VMA != LMA
+   pc_in_mapped_range(pc,sec):    true if pc belongs to section's VMA
+   pc_in_unmapped_range(...):     true if pc belongs to section's LMA
+   overlay_mapped_address(...):   map an address from section's LMA to VMA
+   overlay_unmapped_address(...): map an address from section's VMA to LMA
+   symbol_overlayed_address(...): Return a "current" address for symbol:
+   either in VMA or LMA depending on whether
+   the symbol's section is currently mapped
  */
 
 /* Overlay debugging state: */
@@ -2270,8 +2296,8 @@ int overlay_cache_invalid = 0;    /* True if need to refresh mapped state */
 
 /* Target vector for refreshing overlay mapped state */
 static void simple_overlay_update PARAMS ((struct obj_section *));
-void (*target_overlay_update) PARAMS ((struct obj_section *)) 
-     = simple_overlay_update;
+void (*target_overlay_update) PARAMS ((struct obj_section *))
+= simple_overlay_update;
 
 /* Function: section_is_overlay (SECTION)
    Returns true if SECTION has VMA not equal to LMA, ie. 
@@ -2295,12 +2321,12 @@ section_is_overlay (section)
 static void
 overlay_invalidate_all ()
 {
-  struct objfile     *objfile;
+  struct objfile *objfile;
   struct obj_section *sect;
 
   ALL_OBJSECTIONS (objfile, sect)
     if (section_is_overlay (sect->the_bfd_section))
-      sect->ovly_mapped = -1;
+    sect->ovly_mapped = -1;
 }
 
 /* Function: overlay_is_mapped (SECTION)
@@ -2313,20 +2339,21 @@ overlay_invalidate_all ()
    overlay_invalidate_all.  If the mapped state of the particular
    section is stale, then call TARGET_OVERLAY_UPDATE to refresh it.  */
 
-static int 
+static int
 overlay_is_mapped (osect)
      struct obj_section *osect;
 {
   if (osect == 0 || !section_is_overlay (osect->the_bfd_section))
     return 0;
 
-  switch (overlay_debugging) 
+  switch (overlay_debugging)
     {
     default:
-    case 0:    return 0;       /* overlay debugging off */
+    case 0:
+      return 0;                        /* overlay debugging off */
     case -1:                   /* overlay debugging automatic */
       /* Unles there is a target_overlay_update function, 
-        there's really nothing useful to do here (can't really go auto)  */
+         there's really nothing useful to do here (can't really go auto)  */
       if (target_overlay_update)
        {
          if (overlay_cache_invalid)
@@ -2350,14 +2377,14 @@ int
 section_is_mapped (section)
      asection *section;
 {
-  struct objfile     *objfile;
+  struct objfile *objfile;
   struct obj_section *osect;
 
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       ALL_OBJSECTIONS (objfile, osect)
        if (osect->the_bfd_section == section)
-         return overlay_is_mapped (osect);
+       return overlay_is_mapped (osect);
 
   return 0;
 }
@@ -2441,7 +2468,7 @@ overlay_mapped_address (pc, section)
    Return one of two addresses (relative to the VMA or to the LMA),
    depending on whether the section is mapped or not.  */
 
-CORE_ADDR 
+CORE_ADDR
 symbol_overlayed_address (address, section)
      CORE_ADDR address;
      asection *section;
@@ -2476,23 +2503,23 @@ asection *
 find_pc_overlay (pc)
      CORE_ADDR pc;
 {
-  struct objfile     *objfile;
+  struct objfile *objfile;
   struct obj_section *osect, *best_match = NULL;
 
   if (overlay_debugging)
     ALL_OBJSECTIONS (objfile, osect)
       if (section_is_overlay (osect->the_bfd_section))
-       {
-         if (pc_in_mapped_range (pc, osect->the_bfd_section))
-           {
-             if (overlay_is_mapped (osect))
-               return osect->the_bfd_section;
-             else
-               best_match = osect;
-           }
-         else if (pc_in_unmapped_range (pc, osect->the_bfd_section))
-           best_match = osect;
-       }
+      {
+       if (pc_in_mapped_range (pc, osect->the_bfd_section))
+         {
+           if (overlay_is_mapped (osect))
+             return osect->the_bfd_section;
+           else
+             best_match = osect;
+         }
+       else if (pc_in_unmapped_range (pc, osect->the_bfd_section))
+         best_match = osect;
+      }
   return best_match ? best_match->the_bfd_section : NULL;
 }
 
@@ -2504,14 +2531,14 @@ asection *
 find_pc_mapped_section (pc)
      CORE_ADDR pc;
 {
-  struct objfile     *objfile;
+  struct objfile *objfile;
   struct obj_section *osect;
 
   if (overlay_debugging)
     ALL_OBJSECTIONS (objfile, osect)
       if (pc_in_mapped_range (pc, osect->the_bfd_section) &&
          overlay_is_mapped (osect))
-       return osect->the_bfd_section;
+      return osect->the_bfd_section;
 
   return NULL;
 }
@@ -2524,35 +2551,35 @@ list_overlays_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  int                nmapped = 0;
-  struct objfile     *objfile;
+  int nmapped = 0;
+  struct objfile *objfile;
   struct obj_section *osect;
 
   if (overlay_debugging)
     ALL_OBJSECTIONS (objfile, osect)
       if (overlay_is_mapped (osect))
-       {
-         const char *name;
-         bfd_vma     lma, vma;
-         int         size;
-
-         vma  = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
-         lma  = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
-         size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
-         name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
-
-         printf_filtered ("Section %s, loaded at ", name);
-         print_address_numeric (lma, 1, gdb_stdout);
-         puts_filtered (" - ");
-         print_address_numeric (lma + size, 1, gdb_stdout);
-         printf_filtered (", mapped at ");
-         print_address_numeric (vma, 1, gdb_stdout);
-         puts_filtered (" - ");
-         print_address_numeric (vma + size, 1, gdb_stdout);
-         puts_filtered ("\n");
-
-         nmapped ++;
-       }
+      {
+       const char *name;
+       bfd_vma lma, vma;
+       int size;
+
+       vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
+       lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
+       size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+       name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
+
+       printf_filtered ("Section %s, loaded at ", name);
+       print_address_numeric (lma, 1, gdb_stdout);
+       puts_filtered (" - ");
+       print_address_numeric (lma + size, 1, gdb_stdout);
+       printf_filtered (", mapped at ");
+       print_address_numeric (vma, 1, gdb_stdout);
+       puts_filtered (" - ");
+       print_address_numeric (vma + size, 1, gdb_stdout);
+       puts_filtered ("\n");
+
+       nmapped++;
+      }
   if (nmapped == 0)
     printf_filtered ("No sections are mapped.\n");
 }
@@ -2563,11 +2590,11 @@ list_overlays_command (args, from_tty)
 void
 map_overlay_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
-  struct objfile     *objfile, *objfile2;
-  struct obj_section *sec,     *sec2;
-  asection           *bfdsec;
+  struct objfile *objfile, *objfile2;
+  struct obj_section *sec, *sec2;
+  asection *bfdsec;
 
   if (!overlay_debugging)
     error ("Overlay debugging not enabled.  Use the 'OVERLAY ON' command.");
@@ -2578,32 +2605,32 @@ map_overlay_command (args, from_tty)
   /* First, find a section matching the user supplied argument */
   ALL_OBJSECTIONS (objfile, sec)
     if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
-      { 
-       /* Now, check to see if the section is an overlay. */
-       bfdsec = sec->the_bfd_section;
-       if (!section_is_overlay (bfdsec))
-         continue;             /* not an overlay section */
-
-       /* Mark the overlay as "mapped" */
-       sec->ovly_mapped = 1;
-
-       /* Next, make a pass and unmap any sections that are
-          overlapped by this new section: */
-       ALL_OBJSECTIONS (objfile2, sec2)
-         if (sec2->ovly_mapped &&
-             sec != sec2 &&
-             sec->the_bfd_section != sec2->the_bfd_section &&
-             (pc_in_mapped_range (sec2->addr,    sec->the_bfd_section) ||
-              pc_in_mapped_range (sec2->endaddr, sec->the_bfd_section)))
-           {
-             if (info_verbose)
-               printf_filtered ("Note: section %s unmapped by overlap\n",
-                                bfd_section_name (objfile->obfd, 
-                                                  sec2->the_bfd_section));
-             sec2->ovly_mapped = 0;    /* sec2 overlaps sec: unmap sec2 */
-           }
-       return;
-      }
+    {
+      /* Now, check to see if the section is an overlay. */
+      bfdsec = sec->the_bfd_section;
+      if (!section_is_overlay (bfdsec))
+       continue;               /* not an overlay section */
+
+      /* Mark the overlay as "mapped" */
+      sec->ovly_mapped = 1;
+
+      /* Next, make a pass and unmap any sections that are
+         overlapped by this new section: */
+      ALL_OBJSECTIONS (objfile2, sec2)
+       if (sec2->ovly_mapped &&
+           sec != sec2 &&
+           sec->the_bfd_section != sec2->the_bfd_section &&
+           (pc_in_mapped_range (sec2->addr, sec->the_bfd_section) ||
+            pc_in_mapped_range (sec2->endaddr, sec->the_bfd_section)))
+       {
+         if (info_verbose)
+           printf_filtered ("Note: section %s unmapped by overlap\n",
+                            bfd_section_name (objfile->obfd,
+                                              sec2->the_bfd_section));
+         sec2->ovly_mapped = 0;        /* sec2 overlaps sec: unmap sec2 */
+       }
+      return;
+    }
   error ("No overlay section called %s", args);
 }
 
@@ -2614,9 +2641,9 @@ map_overlay_command (args, from_tty)
 void
 unmap_overlay_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
-  struct objfile     *objfile;
+  struct objfile *objfile;
   struct obj_section *sec;
 
   if (!overlay_debugging)
@@ -2628,12 +2655,12 @@ unmap_overlay_command (args, from_tty)
   /* First, find a section matching the user supplied argument */
   ALL_OBJSECTIONS (objfile, sec)
     if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
-      {
-       if (!sec->ovly_mapped)
-         error ("Section %s is not mapped", args);
-       sec->ovly_mapped = 0;
-       return;
-      }
+    {
+      if (!sec->ovly_mapped)
+       error ("Section %s is not mapped", args);
+      sec->ovly_mapped = 0;
+      return;
+    }
   error ("No overlay section called %s", args);
 }
 
@@ -2644,7 +2671,7 @@ unmap_overlay_command (args, from_tty)
 static void
 overlay_auto_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
   overlay_debugging = -1;
   if (info_verbose)
@@ -2658,7 +2685,7 @@ overlay_auto_command (args, from_tty)
 static void
 overlay_manual_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
   overlay_debugging = 1;
   if (info_verbose)
@@ -2672,9 +2699,9 @@ overlay_manual_command (args, from_tty)
 static void
 overlay_off_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
-  overlay_debugging = 0; 
+  overlay_debugging = 0;
   if (info_verbose)
     printf_filtered ("Overlay debugging disabled.");
 }
@@ -2682,7 +2709,7 @@ overlay_off_command (args, from_tty)
 static void
 overlay_load_command (args, from_tty)
      char *args;
-     int   from_tty;
+     int from_tty;
 {
   if (target_overlay_update)
     (*target_overlay_update) (NULL);
@@ -2701,7 +2728,7 @@ overlay_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  printf_unfiltered 
+  printf_unfiltered
     ("\"overlay\" must be followed by the name of an overlay command.\n");
   help_list (overlaylist, "overlay ", -1, gdb_stdout);
 }
@@ -2721,16 +2748,16 @@ overlay_command (args, from_tty)
    this information.
 
    In this simple implementation, the target data structures are as follows:
-       unsigned _novlys;               /# number of overlay sections #/
-       unsigned _ovly_table[_novlys][4] = {
-         {VMA, SIZE, LMA, MAPPED},     /# one entry per overlay section #/
-         {..., ...,  ..., ...},
-       }
-       unsigned _novly_regions;        /# number of overlay regions #/
-       unsigned _ovly_region_table[_novly_regions][3] = {
-         {VMA, SIZE, MAPPED_TO_LMA},   /# one entry per overlay region #/
-         {..., ...,  ...},
-       }
+   unsigned _novlys;            /# number of overlay sections #/
+   unsigned _ovly_table[_novlys][4] = {
+   {VMA, SIZE, LMA, MAPPED},    /# one entry per overlay section #/
+   {..., ...,  ..., ...},
+   }
+   unsigned _novly_regions;     /# number of overlay regions #/
+   unsigned _ovly_region_table[_novly_regions][3] = {
+   {VMA, SIZE, MAPPED_TO_LMA},  /# one entry per overlay region #/
+   {..., ...,  ...},
+   }
    These functions will attempt to update GDB's mappedness state in the
    symbol section table, based on the target's mappedness state.
 
@@ -2742,19 +2769,22 @@ overlay_command (args, from_tty)
  */
 
 /* Cached, dynamically allocated copies of the target data structures: */
-static unsigned  (*cache_ovly_table)[4] = 0;
+static unsigned (*cache_ovly_table)[4] = 0;
 #if 0
-static unsigned  (*cache_ovly_region_table)[3] = 0;
+static unsigned (*cache_ovly_region_table)[3] = 0;
 #endif
-static unsigned  cache_novlys = 0;
+static unsigned cache_novlys = 0;
 #if 0
-static unsigned  cache_novly_regions = 0;
+static unsigned cache_novly_regions = 0;
 #endif
 static CORE_ADDR cache_ovly_table_base = 0;
 #if 0
 static CORE_ADDR cache_ovly_region_table_base = 0;
 #endif
-enum   ovly_index { VMA, SIZE, LMA, MAPPED};
+enum ovly_index
+  {
+    VMA, SIZE, LMA, MAPPED
+  };
 #define TARGET_LONG_BYTES (TARGET_LONG_BIT / TARGET_CHAR_BIT)
 
 /* Throw away the cached copy of _ovly_table */
@@ -2762,8 +2792,8 @@ static void
 simple_free_overlay_table ()
 {
   if (cache_ovly_table)
-    free(cache_ovly_table);
-  cache_novlys     = 0;
+    free (cache_ovly_table);
+  cache_novlys = 0;
   cache_ovly_table = NULL;
   cache_ovly_table_base = 0;
 }
@@ -2774,8 +2804,8 @@ static void
 simple_free_overlay_region_table ()
 {
   if (cache_ovly_region_table)
-    free(cache_ovly_region_table);
-  cache_novly_regions     = 0;
+    free (cache_ovly_region_table);
+  cache_novly_regions = 0;
   cache_ovly_region_table = NULL;
   cache_ovly_region_table_base = 0;
 }
@@ -2785,22 +2815,22 @@ simple_free_overlay_region_table ()
    Convert to host order.  int LEN is number of ints  */
 static void
 read_target_long_array (memaddr, myaddr, len)
-     CORE_ADDR     memaddr;
+     CORE_ADDR memaddr;
      unsigned int *myaddr;
-     int           len;
+     int len;
 {
   char *buf = alloca (len * TARGET_LONG_BYTES);
-  int           i;
+  int i;
 
   read_memory (memaddr, buf, len * TARGET_LONG_BYTES);
   for (i = 0; i < len; i++)
-    myaddr[i] = extract_unsigned_integer (TARGET_LONG_BYTES * i + buf, 
+    myaddr[i] = extract_unsigned_integer (TARGET_LONG_BYTES * i + buf,
                                          TARGET_LONG_BYTES);
 }
 
 /* Find and grab a copy of the target _ovly_table
    (and _novlys, which is needed for the table's size) */
-static int 
+static int
 simple_read_overlay_table ()
 {
   struct minimal_symbol *msym;
@@ -2809,31 +2839,31 @@ simple_read_overlay_table ()
   msym = lookup_minimal_symbol ("_novlys", 0, 0);
   if (msym != NULL)
     cache_novlys = read_memory_integer (SYMBOL_VALUE_ADDRESS (msym), 4);
-  else 
-    return 0;  /* failure */
-  cache_ovly_table = (void *) xmalloc (cache_novlys * sizeof(*cache_ovly_table));
+  else
+    return 0;                  /* failure */
+  cache_ovly_table = (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
   if (cache_ovly_table != NULL)
     {
       msym = lookup_minimal_symbol ("_ovly_table", 0, 0);
       if (msym != NULL)
        {
          cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (msym);
-         read_target_long_array (cache_ovly_table_base, 
-                                 (int *) cache_ovly_table, 
+         read_target_long_array (cache_ovly_table_base,
+                                 (int *) cache_ovly_table,
                                  cache_novlys * 4);
        }
-      else 
-       return 0;       /* failure */
+      else
+       return 0;               /* failure */
     }
-  else 
-    return 0;  /* failure */
-  return 1;    /* SUCCESS */
+  else
+    return 0;                  /* failure */
+  return 1;                    /* SUCCESS */
 }
 
 #if 0
 /* Find and grab a copy of the target _ovly_region_table
    (and _novly_regions, which is needed for the table's size) */
-static int 
+static int
 simple_read_overlay_region_table ()
 {
   struct minimal_symbol *msym;
@@ -2842,8 +2872,8 @@ simple_read_overlay_region_table ()
   msym = lookup_minimal_symbol ("_novly_regions", 0, 0);
   if (msym != NULL)
     cache_novly_regions = read_memory_integer (SYMBOL_VALUE_ADDRESS (msym), 4);
-  else 
-    return 0;  /* failure */
+  else
+    return 0;                  /* failure */
   cache_ovly_region_table = (void *) xmalloc (cache_novly_regions * 12);
   if (cache_ovly_region_table != NULL)
     {
@@ -2851,16 +2881,16 @@ simple_read_overlay_region_table ()
       if (msym != NULL)
        {
          cache_ovly_region_table_base = SYMBOL_VALUE_ADDRESS (msym);
-         read_target_long_array (cache_ovly_region_table_base, 
-                                 (int *) cache_ovly_region_table, 
+         read_target_long_array (cache_ovly_region_table_base,
+                                 (int *) cache_ovly_region_table,
                                  cache_novly_regions * 3);
        }
-      else 
-       return 0;       /* failure */
+      else
+       return 0;               /* failure */
     }
-  else 
-    return 0;  /* failure */
-  return 1;    /* SUCCESS */
+  else
+    return 0;                  /* failure */
+  return 1;                    /* SUCCESS */
 }
 #endif
 
@@ -2880,20 +2910,20 @@ simple_overlay_update_1 (osect)
 
   size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
   for (i = 0; i < cache_novlys; i++)
-    if (cache_ovly_table[i][VMA]  == osect->the_bfd_section->vma &&
-       cache_ovly_table[i][LMA]  == osect->the_bfd_section->lma /* &&
-       cache_ovly_table[i][SIZE] == size */)
+    if (cache_ovly_table[i][VMA] == osect->the_bfd_section->vma &&
+       cache_ovly_table[i][LMA] == osect->the_bfd_section->lma         /* &&
+                                                                          cache_ovly_table[i][SIZE] == size */ )
       {
        read_target_long_array (cache_ovly_table_base + i * TARGET_LONG_BYTES,
                                (int *) cache_ovly_table[i], 4);
-       if (cache_ovly_table[i][VMA]  == osect->the_bfd_section->vma &&
-           cache_ovly_table[i][LMA]  == osect->the_bfd_section->lma /* &&
-           cache_ovly_table[i][SIZE] == size */)
+       if (cache_ovly_table[i][VMA] == osect->the_bfd_section->vma &&
+           cache_ovly_table[i][LMA] == osect->the_bfd_section->lma     /* &&
+                                                                          cache_ovly_table[i][SIZE] == size */ )
          {
            osect->ovly_mapped = cache_ovly_table[i][MAPPED];
            return 1;
          }
-       else    /* Warning!  Warning!  Target's ovly table has changed! */
+       else                    /* Warning!  Warning!  Target's ovly table has changed! */
          return 0;
       }
   return 0;
@@ -2911,14 +2941,14 @@ static void
 simple_overlay_update (osect)
      struct obj_section *osect;
 {
-  struct objfile        *objfile;
+  struct objfile *objfile;
 
   /* Were we given an osect to look up?  NULL means do all of them. */
   if (osect)
     /* Have we got a cached copy of the target's overlay table? */
     if (cache_ovly_table != NULL)
       /* Does its cached location match what's currently in the symtab? */
-      if (cache_ovly_table_base == 
+      if (cache_ovly_table_base ==
          SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", 0, 0)))
        /* Then go ahead and try to look up this single section in the cache */
        if (simple_overlay_update_1 (osect))
@@ -2937,19 +2967,19 @@ simple_overlay_update (osect)
   /* Now may as well update all sections, even if only one was requested. */
   ALL_OBJSECTIONS (objfile, osect)
     if (section_is_overlay (osect->the_bfd_section))
-      {
-       int i, size;
-
-       size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
-       for (i = 0; i < cache_novlys; i++)
-         if (cache_ovly_table[i][VMA]  == osect->the_bfd_section->vma &&
-             cache_ovly_table[i][LMA]  == osect->the_bfd_section->lma /* &&
-             cache_ovly_table[i][SIZE] == size */)
-           { /* obj_section matches i'th entry in ovly_table */
-             osect->ovly_mapped = cache_ovly_table[i][MAPPED];
-             break;    /* finished with inner for loop: break out */
-           }
-      }
+    {
+      int i, size;
+
+      size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+      for (i = 0; i < cache_novlys; i++)
+       if (cache_ovly_table[i][VMA] == osect->the_bfd_section->vma &&
+           cache_ovly_table[i][LMA] == osect->the_bfd_section->lma     /* &&
+                                                                          cache_ovly_table[i][SIZE] == size */ )
+         {                     /* obj_section matches i'th entry in ovly_table */
+           osect->ovly_mapped = cache_ovly_table[i][MAPPED];
+           break;              /* finished with inner for loop: break out */
+         }
+    }
 }
 
 
@@ -2957,15 +2987,15 @@ void
 _initialize_symfile ()
 {
   struct cmd_list_element *c;
-  
+
   c = add_cmd ("symbol-file", class_files, symbol_file_command,
-   "Load symbol table from executable file FILE.\n\
+              "Load symbol table from executable file FILE.\n\
 The `file' command can also load symbol tables, as well as setting the file\n\
 to execute.", &cmdlist);
   c->completer = filename_completer;
 
   c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command,
-   "Usage: add-symbol-file FILE ADDR\n\
+              "Usage: add-symbol-file FILE ADDR\n\
 Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
 ADDR is the starting address of the file's text.",
               &cmdlist);
@@ -2974,56 +3004,56 @@ ADDR is the starting address of the file's text.",
   c = add_cmd ("add-shared-symbol-files", class_files,
               add_shared_symbol_files_command,
    "Load the symbols from shared objects in the dynamic linker's link map.",
-              &cmdlist);
+              &cmdlist);
   c = add_alias_cmd ("assf", "add-shared-symbol-files", class_files, 1,
                     &cmdlist);
 
   c = add_cmd ("load", class_files, load_command,
-   "Dynamically load FILE into the running program, and record its symbols\n\
+              "Dynamically load FILE into the running program, and record its symbols\n\
 for access from GDB.", &cmdlist);
   c->completer = filename_completer;
 
   add_show_from_set
     (add_set_cmd ("symbol-reloading", class_support, var_boolean,
-                 (char *)&symbol_reloading,
-         "Set dynamic symbol table reloading multiple times in one run.",
+                 (char *) &symbol_reloading,
+           "Set dynamic symbol table reloading multiple times in one run.",
                  &setlist),
      &showlist);
 
-  add_prefix_cmd ("overlay", class_support, overlay_command, 
-                 "Commands for debugging overlays.", &overlaylist, 
+  add_prefix_cmd ("overlay", class_support, overlay_command,
+                 "Commands for debugging overlays.", &overlaylist,
                  "overlay ", 0, &cmdlist);
 
   add_com_alias ("ovly", "overlay", class_alias, 1);
   add_com_alias ("ov", "overlay", class_alias, 1);
 
-  add_cmd ("map-overlay", class_support, map_overlay_command, 
+  add_cmd ("map-overlay", class_support, map_overlay_command,
           "Assert that an overlay section is mapped.", &overlaylist);
 
-  add_cmd ("unmap-overlay", class_support, unmap_overlay_command, 
+  add_cmd ("unmap-overlay", class_support, unmap_overlay_command,
           "Assert that an overlay section is unmapped.", &overlaylist);
 
-  add_cmd ("list-overlays", class_support, list_overlays_command, 
+  add_cmd ("list-overlays", class_support, list_overlays_command,
           "List mappings of overlay sections.", &overlaylist);
 
-  add_cmd ("manual", class_support, overlay_manual_command, 
+  add_cmd ("manual", class_support, overlay_manual_command,
           "Enable overlay debugging.", &overlaylist);
-  add_cmd ("off", class_support, overlay_off_command, 
+  add_cmd ("off", class_support, overlay_off_command,
           "Disable overlay debugging.", &overlaylist);
-  add_cmd ("auto", class_support, overlay_auto_command, 
+  add_cmd ("auto", class_support, overlay_auto_command,
           "Enable automatic overlay debugging.", &overlaylist);
-  add_cmd ("load-target", class_support, overlay_load_command, 
+  add_cmd ("load-target", class_support, overlay_load_command,
           "Read the overlay mapping state from the target.", &overlaylist);
 
   /* Filename extension to source language lookup table: */
   init_filename_language_table ();
   c = add_set_cmd ("extension-language", class_files, var_string_noescape,
-                  (char *) &ext_args, 
+                  (char *) &ext_args,
                   "Set mapping between filename extension and source language.\n\
 Usage: set extension-language .foo bar",
-                    &setlist);
+                  &setlist);
   c->function.cfunc = set_ext_lang_command;
 
-  add_info ("extensions", info_ext_lang_command, 
+  add_info ("extensions", info_ext_lang_command,
            "All filename extensions associated with a source language.");
 }
index 0363e1e1d280d95936e1596db4cf8482757dd90e..6390d1ab04f9e4b98d659cec5ddd9b517eaacf14 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (SYMFILE_H)
 #define SYMFILE_H
@@ -31,89 +32,91 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    it allows us to throw away duplicate psymbols and set all pointers
    to the single saved instance. */
 
-struct psymbol_allocation_list {
+struct psymbol_allocation_list
+  {
 
-  /* Pointer to beginning of dynamically allocated array of pointers to
-   partial symbols.  The array is dynamically expanded as necessary to
-   accommodate more pointers. */
+    /* Pointer to beginning of dynamically allocated array of pointers to
+       partial symbols.  The array is dynamically expanded as necessary to
+       accommodate more pointers. */
 
-  struct partial_symbol **list;
+    struct partial_symbol **list;
 
-  /* Pointer to next available slot in which to store a pointer to a partial
-     symbol. */
+    /* Pointer to next available slot in which to store a pointer to a partial
+       symbol. */
 
-  struct partial_symbol **next;
+    struct partial_symbol **next;
 
-  /* Number of allocated pointer slots in current dynamic array (not the
-     number of bytes of storage).  The "next" pointer will always point
-     somewhere between list[0] and list[size], and when at list[size] the
-     array will be expanded on the next attempt to store a pointer. */
+    /* Number of allocated pointer slots in current dynamic array (not the
+       number of bytes of storage).  The "next" pointer will always point
+       somewhere between list[0] and list[size], and when at list[size] the
+       array will be expanded on the next attempt to store a pointer. */
 
-  int size;
-};
+    int size;
+  };
 
 /* Structure to keep track of symbol reading functions for various
    object file types.  */
 
-struct sym_fns {
+struct sym_fns
+  {
 
-  /* BFD flavour that we handle, or (as a special kludge, see xcoffread.c,
-     (enum bfd_flavour)-1 for xcoff).  */
+    /* BFD flavour that we handle, or (as a special kludge, see xcoffread.c,
+       (enum bfd_flavour)-1 for xcoff).  */
 
-  enum bfd_flavour sym_flavour;
+    enum bfd_flavour sym_flavour;
 
-  /* Initializes anything that is global to the entire symbol table.  It is
-     called during symbol_file_add, when we begin debugging an entirely new
-     program. */
+    /* Initializes anything that is global to the entire symbol table.  It is
+       called during symbol_file_add, when we begin debugging an entirely new
+       program. */
 
-  void (*sym_new_init) PARAMS ((struct objfile *));
+    void (*sym_new_init) PARAMS ((struct objfile *));
 
-  /* Reads any initial information from a symbol file, and initializes the
-     struct sym_fns SF in preparation for sym_read().  It is called every
-     time we read a symbol file for any reason. */
+    /* Reads any initial information from a symbol file, and initializes the
+       struct sym_fns SF in preparation for sym_read().  It is called every
+       time we read a symbol file for any reason. */
 
-  void (*sym_init) PARAMS ((struct objfile *));
+    void (*sym_init) PARAMS ((struct objfile *));
 
-  /* sym_read (objfile, addr, mainline)
-     Reads a symbol file into a psymtab (or possibly a symtab).
-     OBJFILE is the objfile struct for the file we are reading.
-     SECTION_OFFSETS
-     are the offset between the file's specified section addresses and
-     their true addresses in memory.
-     MAINLINE is 1 if this is the
-     main symbol table being read, and 0 if a secondary
-     symbol file (e.g. shared library or dynamically loaded file)
-     is being read.  */
+    /* sym_read (objfile, addr, mainline)
+       Reads a symbol file into a psymtab (or possibly a symtab).
+       OBJFILE is the objfile struct for the file we are reading.
+       SECTION_OFFSETS
+       are the offset between the file's specified section addresses and
+       their true addresses in memory.
+       MAINLINE is 1 if this is the
+       main symbol table being read, and 0 if a secondary
+       symbol file (e.g. shared library or dynamically loaded file)
+       is being read.  */
 
-  void (*sym_read) PARAMS ((struct objfile *, struct section_offsets *, int));
+    void (*sym_read) PARAMS ((struct objfile *, struct section_offsets *, int));
 
-  /* Called when we are finished with an objfile.  Should do all cleanup
-     that is specific to the object file format for the particular objfile. */
-  void (*sym_finish) PARAMS ((struct objfile *));
+    /* Called when we are finished with an objfile.  Should do all cleanup
+       that is specific to the object file format for the particular objfile. */
 
-  /* This function produces a file-dependent section_offsets structure,
-     allocated in the objfile's storage, and based on the parameter.
-     The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility
-     with the higher levels of GDB.  It should probably be changed to
-     a string, where NULL means the default, and others are parsed in a file
-     dependent way.  The result of this function is handed in to sym_read.  */
+    void (*sym_finish) PARAMS ((struct objfile *));
 
-  struct section_offsets *(*sym_offsets) PARAMS ((struct objfile *, CORE_ADDR));
+    /* This function produces a file-dependent section_offsets structure,
+       allocated in the objfile's storage, and based on the parameter.
+       The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility
+       with the higher levels of GDB.  It should probably be changed to
+       a string, where NULL means the default, and others are parsed in a file
+       dependent way.  The result of this function is handed in to sym_read.  */
 
-  /* Finds the next struct sym_fns.  They are allocated and initialized
-     in whatever module implements the functions pointed to; an 
-     initializer calls add_symtab_fns to add them to the global chain.  */
+    struct section_offsets *(*sym_offsets) PARAMS ((struct objfile *, CORE_ADDR));
 
-  struct sym_fns *next;
+    /* Finds the next struct sym_fns.  They are allocated and initialized
+       in whatever module implements the functions pointed to; an 
+       initializer calls add_symtab_fns to add them to the global chain.  */
 
-};
+    struct sym_fns *next;
+
+  };
 
 /* The default version of sym_fns.sym_offsets for readers that don't
    do anything special.  */
 
 extern struct section_offsets *
-default_symfile_offsets PARAMS ((struct objfile *objfile, CORE_ADDR addr));
+  default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
 
 
 extern void
@@ -126,15 +129,15 @@ extend_psymbol_list PARAMS ((struct psymbol_allocation_list *,
 
 extern void
 add_psymbol_to_list PARAMS ((char *, int, namespace_enum, enum address_class,
-                            struct psymbol_allocation_list *, long, CORE_ADDR,
+                         struct psymbol_allocation_list *, long, CORE_ADDR,
                             enum language, struct objfile *));
 
 extern void
-add_psymbol_with_dem_name_to_list PARAMS ((char *, int, char *, int, namespace_enum, 
-                                           enum address_class,
-                                           struct psymbol_allocation_list *, 
-                                           long, CORE_ADDR,
-                                           enum language, struct objfile *));
+add_psymbol_with_dem_name_to_list PARAMS ((char *, int, char *, int, namespace_enum,
+                                          enum address_class,
+                                          struct psymbol_allocation_list *,
+                                          long, CORE_ADDR,
+                                          enum language, struct objfile *));
 
 
 extern void init_psymbol_list PARAMS ((struct objfile *, int));
@@ -143,7 +146,7 @@ extern void
 sort_pst_symbols PARAMS ((struct partial_symtab *));
 
 extern struct symtab *
-allocate_symtab PARAMS ((char *, struct objfile *));
+  allocate_symtab PARAMS ((char *, struct objfile *));
 
 extern int
 free_named_symtabs PARAMS ((char *));
@@ -164,10 +167,10 @@ extern void
 new_symfile_objfile PARAMS ((struct objfile *, int, int));
 
 extern struct partial_symtab *
-start_psymtab_common PARAMS ((struct objfile *, struct section_offsets *,
-                             char *, CORE_ADDR,
-                             struct partial_symbol **,
-                             struct partial_symbol **));
+  start_psymtab_common PARAMS ((struct objfile *, struct section_offsets *,
+                               char *, CORE_ADDR,
+                               struct partial_symbol **,
+                               struct partial_symbol **));
 
 /* Sorting your symbols for fast lookup or alphabetical printing.  */
 
@@ -182,14 +185,14 @@ sort_symtab_syms PARAMS ((struct symtab *));
    Returns the address of the copy.  */
 
 extern char *
-obsavestring PARAMS ((char *, int, struct obstack *));
+  obsavestring PARAMS ((char *, int, struct obstack *));
 
 /* Concatenate strings S1, S2 and S3; return the new string.
    Space is found in the symbol_obstack.  */
 
 extern char *
-obconcat PARAMS ((struct obstack *obstackp, const char *, const char *,
-                 const char *));
+  obconcat PARAMS ((struct obstack * obstackp, const char *, const char *,
+                   const char *));
 
                        /*   Variables   */
 
@@ -202,24 +205,24 @@ obconcat PARAMS ((struct obstack *obstackp, const char *, const char *,
    this threshhold, solibs' symbol tables will not be loaded.
 
    On other platforms, > 0 means, "always auto load".
  */
+ */
 
 extern int auto_solib_add;
 
 /* From symfile.c */
 
 extern CORE_ADDR
-entry_point_address PARAMS ((void));
+  entry_point_address PARAMS ((void));
 
 extern struct partial_symtab *
-allocate_psymtab PARAMS ((char *, struct objfile *));
+  allocate_psymtab PARAMS ((char *, struct objfile *));
 
 extern void
 discard_psymtab PARAMS ((struct partial_symtab *));
 
 extern void find_lowest_section PARAMS ((bfd *, asection *, PTR));
 
-extern bfd * symfile_bfd_open PARAMS ((char *));
+extern bfd *symfile_bfd_open PARAMS ((char *));
 
 /* Remote targets may wish to use this as their load function.  */
 extern void generic_load PARAMS ((char *name, int from_tty));
@@ -229,12 +232,12 @@ extern int overlay_debugging;
 extern int overlay_cache_invalid;
 
 /* return the "mapped" overlay section  containing the PC */
-extern asection * 
-find_pc_mapped_section PARAMS ((CORE_ADDR));
+extern asection *
+  find_pc_mapped_section PARAMS ((CORE_ADDR));
 
 /* return any overlay section containing the PC (even in its LMA region) */
 extern asection *
-find_pc_overlay PARAMS ((CORE_ADDR));
+  find_pc_overlay PARAMS ((CORE_ADDR));
 
 /* return true if the section is an overlay */
 extern int
@@ -246,33 +249,33 @@ section_is_mapped PARAMS ((asection *));
 
 /* return true if pc belongs to section's VMA */
 extern CORE_ADDR
-pc_in_mapped_range PARAMS ((CORE_ADDR, asection *));
+  pc_in_mapped_range PARAMS ((CORE_ADDR, asection *));
 
 /* return true if pc belongs to section's LMA */
 extern CORE_ADDR
-pc_in_unmapped_range PARAMS ((CORE_ADDR, asection *));
+  pc_in_unmapped_range PARAMS ((CORE_ADDR, asection *));
 
 /* map an address from a section's LMA to its VMA */
 extern CORE_ADDR
-overlay_mapped_address PARAMS ((CORE_ADDR, asection *));
+  overlay_mapped_address PARAMS ((CORE_ADDR, asection *));
 
 /* map an address from a section's VMA to its LMA */
 extern CORE_ADDR
-overlay_unmapped_address PARAMS ((CORE_ADDR, asection *));
+  overlay_unmapped_address PARAMS ((CORE_ADDR, asection *));
 
 /* convert an address in an overlay section (force into VMA range) */
-extern CORE_ADDR 
-symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR
+  symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
 
 /* From dwarfread.c */
 
 extern void
 dwarf_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int,
-                             file_ptr, unsigned int, file_ptr, unsigned int));
+                          file_ptr, unsigned int, file_ptr, unsigned int));
 
 /* From dwarf2read.c */
 
-extern int dwarf2_has_info PARAMS ((bfd *abfd));
+extern int dwarf2_has_info PARAMS ((bfd * abfd));
 
 extern void dwarf2_build_psymtabs PARAMS ((struct objfile *,
                                           struct section_offsets *,
@@ -281,10 +284,10 @@ extern void dwarf2_build_psymtabs PARAMS ((struct objfile *,
 
 /* Hack to force structures to exist before use in parameter list.  */
 struct ecoff_debug_hack
-{
-  struct ecoff_debug_swap *a;
-  struct ecoff_debug_info *b;
-};
+  {
+    struct ecoff_debug_swap *a;
+    struct ecoff_debug_info *b;
+  };
 extern void
 mdebug_build_psymtabs PARAMS ((struct objfile *,
                               const struct ecoff_debug_swap *,
@@ -297,4 +300,4 @@ elfmdebug_build_psymtabs PARAMS ((struct objfile *,
                                  asection *,
                                  struct section_offsets *));
 
-#endif /* !defined(SYMFILE_H) */
+#endif /* !defined(SYMFILE_H) */
index 56e1c674dc4be24ffa5f1c654d5eb44936987a4b..d1ad8637c06c606c19e5ce11c9046979869d62a9 100644 (file)
@@ -1,21 +1,22 @@
 /* Sequent Symmetry host interface, for GDB when running under Unix.
    Copyright 1986, 1987, 1989, 1991, 1992, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* FIXME, some 387-specific items of use taken from i387-tdep.c -- ought to be
    merged back in. */
@@ -52,8 +53,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcore.h"
 
 void
-store_inferior_registers(regno)
-int regno;
+store_inferior_registers (regno)
+     int regno;
 {
   struct pt_regset regs;
   int i;
@@ -63,32 +64,32 @@ int regno;
      might cause problems when calling functions in the inferior.
      At least fpu_control and fpa_pcr (probably more) should be added 
      to the registers array to solve this properly.  */
-  mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
-
-  regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
-  regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
-  regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
-  regs.pr_edx = *(int *)&registers[REGISTER_BYTE(1)];
-  regs.pr_esi = *(int *)&registers[REGISTER_BYTE(6)];
-  regs.pr_edi = *(int *)&registers[REGISTER_BYTE(7)];
-  regs.pr_esp = *(int *)&registers[REGISTER_BYTE(14)];
-  regs.pr_ebp = *(int *)&registers[REGISTER_BYTE(15)];
-  regs.pr_eip = *(int *)&registers[REGISTER_BYTE(16)];
-  regs.pr_flags = *(int *)&registers[REGISTER_BYTE(17)];
+  mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) & regs, 0);
+
+  regs.pr_eax = *(int *) &registers[REGISTER_BYTE (0)];
+  regs.pr_ebx = *(int *) &registers[REGISTER_BYTE (5)];
+  regs.pr_ecx = *(int *) &registers[REGISTER_BYTE (2)];
+  regs.pr_edx = *(int *) &registers[REGISTER_BYTE (1)];
+  regs.pr_esi = *(int *) &registers[REGISTER_BYTE (6)];
+  regs.pr_edi = *(int *) &registers[REGISTER_BYTE (7)];
+  regs.pr_esp = *(int *) &registers[REGISTER_BYTE (14)];
+  regs.pr_ebp = *(int *) &registers[REGISTER_BYTE (15)];
+  regs.pr_eip = *(int *) &registers[REGISTER_BYTE (16)];
+  regs.pr_flags = *(int *) &registers[REGISTER_BYTE (17)];
   for (i = 0; i < 31; i++)
     {
       regs.pr_fpa.fpa_regs[i] =
-       *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)];
+       *(int *) &registers[REGISTER_BYTE (FP1_REGNUM + i)];
     }
-  memcpy (regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE(ST0_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE(ST1_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE(ST2_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE(ST3_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE(ST4_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE(ST5_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE(ST6_REGNUM)], 10);
-  memcpy (regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE(ST7_REGNUM)], 10);
-  mptrace (XPT_WREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
+  memcpy (regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE (ST0_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE (ST1_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE (ST2_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE (ST3_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE (ST4_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE (ST5_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE (ST6_REGNUM)], 10);
+  memcpy (regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE (ST7_REGNUM)], 10);
+  mptrace (XPT_WREGS, inferior_pid, (PTRACE_ARG3_TYPE) & regs, 0);
 }
 
 void
@@ -100,240 +101,287 @@ fetch_inferior_registers (regno)
 
   registers_fetched ();
 
-  mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
-  *(int *)&registers[REGISTER_BYTE(EAX_REGNUM)] = regs.pr_eax;
-  *(int *)&registers[REGISTER_BYTE(EBX_REGNUM)] = regs.pr_ebx;
-  *(int *)&registers[REGISTER_BYTE(ECX_REGNUM)] = regs.pr_ecx;
-  *(int *)&registers[REGISTER_BYTE(EDX_REGNUM)] = regs.pr_edx;
-  *(int *)&registers[REGISTER_BYTE(ESI_REGNUM)] = regs.pr_esi;
-  *(int *)&registers[REGISTER_BYTE(EDI_REGNUM)] = regs.pr_edi;
-  *(int *)&registers[REGISTER_BYTE(EBP_REGNUM)] = regs.pr_ebp;
-  *(int *)&registers[REGISTER_BYTE(ESP_REGNUM)] = regs.pr_esp;
-  *(int *)&registers[REGISTER_BYTE(EIP_REGNUM)] = regs.pr_eip;
-  *(int *)&registers[REGISTER_BYTE(EFLAGS_REGNUM)] = regs.pr_flags;
+  mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) & regs, 0);
+  *(int *) &registers[REGISTER_BYTE (EAX_REGNUM)] = regs.pr_eax;
+  *(int *) &registers[REGISTER_BYTE (EBX_REGNUM)] = regs.pr_ebx;
+  *(int *) &registers[REGISTER_BYTE (ECX_REGNUM)] = regs.pr_ecx;
+  *(int *) &registers[REGISTER_BYTE (EDX_REGNUM)] = regs.pr_edx;
+  *(int *) &registers[REGISTER_BYTE (ESI_REGNUM)] = regs.pr_esi;
+  *(int *) &registers[REGISTER_BYTE (EDI_REGNUM)] = regs.pr_edi;
+  *(int *) &registers[REGISTER_BYTE (EBP_REGNUM)] = regs.pr_ebp;
+  *(int *) &registers[REGISTER_BYTE (ESP_REGNUM)] = regs.pr_esp;
+  *(int *) &registers[REGISTER_BYTE (EIP_REGNUM)] = regs.pr_eip;
+  *(int *) &registers[REGISTER_BYTE (EFLAGS_REGNUM)] = regs.pr_flags;
   for (i = 0; i < FPA_NREGS; i++)
     {
-      *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)] =
+      *(int *) &registers[REGISTER_BYTE (FP1_REGNUM + i)] =
        regs.pr_fpa.fpa_regs[i];
     }
-  memcpy (&registers[REGISTER_BYTE(ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
-  memcpy (&registers[REGISTER_BYTE(ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
-  memcpy (&registers[REGISTER_BYTE(ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
-  memcpy (&registers[REGISTER_BYTE(ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
-  memcpy (&registers[REGISTER_BYTE(ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
-  memcpy (&registers[REGISTER_BYTE(ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
-  memcpy (&registers[REGISTER_BYTE(ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
-  memcpy (&registers[REGISTER_BYTE(ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
+  memcpy (&registers[REGISTER_BYTE (ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
+  memcpy (&registers[REGISTER_BYTE (ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
+  memcpy (&registers[REGISTER_BYTE (ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
+  memcpy (&registers[REGISTER_BYTE (ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
+  memcpy (&registers[REGISTER_BYTE (ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
+  memcpy (&registers[REGISTER_BYTE (ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
+  memcpy (&registers[REGISTER_BYTE (ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
+  memcpy (&registers[REGISTER_BYTE (ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
 }
 \f
 /* FIXME:  This should be merged with i387-tdep.c as well. */
 static
-print_fpu_status(ep)
-struct pt_regset ep;
+print_fpu_status (ep)
+     struct pt_regset ep;
 {
-    int i;
-    int bothstatus;
-    int top;
-    int fpreg;
-    unsigned char *p;
-    
-    printf_unfiltered("80387:");
-    if (ep.pr_fpu.fpu_ip == 0) {
-       printf_unfiltered(" not in use.\n");
-       return;
-    } else {
-       printf_unfiltered("\n");
+  int i;
+  int bothstatus;
+  int top;
+  int fpreg;
+  unsigned char *p;
+
+  printf_unfiltered ("80387:");
+  if (ep.pr_fpu.fpu_ip == 0)
+    {
+      printf_unfiltered (" not in use.\n");
+      return;
     }
-    if (ep.pr_fpu.fpu_status != 0) {
-       print_387_status_word (ep.pr_fpu.fpu_status);
+  else
+    {
+      printf_unfiltered ("\n");
+    }
+  if (ep.pr_fpu.fpu_status != 0)
+    {
+      print_387_status_word (ep.pr_fpu.fpu_status);
     }
-    print_387_control_word (ep.pr_fpu.fpu_control);
-    printf_unfiltered ("last exception: ");
-    printf_unfiltered ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
-    printf_unfiltered ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
-    printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
-    
-    top = (ep.pr_fpu.fpu_status >> 11) & 7;
-    
-    printf_unfiltered ("regno  tag  msb              lsb  value\n");
-    for (fpreg = 7; fpreg >= 0; fpreg--) 
+  print_387_control_word (ep.pr_fpu.fpu_control);
+  printf_unfiltered ("last exception: ");
+  printf_unfiltered ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
+  printf_unfiltered ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
+  printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
+
+  top = (ep.pr_fpu.fpu_status >> 11) & 7;
+
+  printf_unfiltered ("regno  tag  msb              lsb  value\n");
+  for (fpreg = 7; fpreg >= 0; fpreg--)
+    {
+      double val;
+
+      printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
+
+      switch ((ep.pr_fpu.fpu_tag >> (fpreg * 2)) & 3)
        {
-           double val;
-           
-           printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
-           
-           switch ((ep.pr_fpu.fpu_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.pr_fpu.fpu_stack[fpreg][i]);
-           
-           i387_to_double ((char *)ep.pr_fpu.fpu_stack[fpreg], (char *)&val);
-           printf_unfiltered ("  %g\n", val);
+       case 0:
+         printf_unfiltered ("valid ");
+         break;
+       case 1:
+         printf_unfiltered ("zero  ");
+         break;
+       case 2:
+         printf_unfiltered ("trap  ");
+         break;
+       case 3:
+         printf_unfiltered ("empty ");
+         break;
        }
-    if (ep.pr_fpu.fpu_rsvd1)
-       warning ("rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
-    if (ep.pr_fpu.fpu_rsvd2)
-       warning ("rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
-    if (ep.pr_fpu.fpu_rsvd3)
-       warning ("rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
-    if (ep.pr_fpu.fpu_rsvd5)
-       warning ("rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
+      for (i = 9; i >= 0; i--)
+       printf_unfiltered ("%02x", ep.pr_fpu.fpu_stack[fpreg][i]);
+
+      i387_to_double ((char *) ep.pr_fpu.fpu_stack[fpreg], (char *) &val);
+      printf_unfiltered ("  %g\n", val);
+    }
+  if (ep.pr_fpu.fpu_rsvd1)
+    warning ("rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
+  if (ep.pr_fpu.fpu_rsvd2)
+    warning ("rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
+  if (ep.pr_fpu.fpu_rsvd3)
+    warning ("rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
+  if (ep.pr_fpu.fpu_rsvd5)
+    warning ("rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
 }
 
 
-print_1167_control_word(pcr)
-unsigned int pcr;
+print_1167_control_word (pcr)
+     unsigned int pcr;
 
 {
-    int pcr_tmp;
+  int pcr_tmp;
 
-    pcr_tmp = pcr & FPA_PCR_MODE;
-    printf_unfiltered("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
-    switch (pcr_tmp & 12) {
+  pcr_tmp = pcr & FPA_PCR_MODE;
+  printf_unfiltered ("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
+  switch (pcr_tmp & 12)
+    {
     case 0:
-       printf_unfiltered("RN (Nearest Value)");
-       break;
+      printf_unfiltered ("RN (Nearest Value)");
+      break;
     case 1:
-       printf_unfiltered("RZ (Zero)");
-       break;
+      printf_unfiltered ("RZ (Zero)");
+      break;
     case 2:
-       printf_unfiltered("RP (Positive Infinity)");
-       break;
+      printf_unfiltered ("RP (Positive Infinity)");
+      break;
     case 3:
-       printf_unfiltered("RM (Negative Infinity)");
-       break;
+      printf_unfiltered ("RM (Negative Infinity)");
+      break;
+    }
+  printf_unfiltered ("; IRND= %d ", pcr_tmp & 2);
+  if (0 == pcr_tmp & 2)
+    {
+      printf_unfiltered ("(same as RND)\n");
     }
-    printf_unfiltered("; IRND= %d ", pcr_tmp & 2);
-    if (0 == pcr_tmp & 2) {
-       printf_unfiltered("(same as RND)\n");
-    } else {
-       printf_unfiltered("(toward zero)\n");
+  else
+    {
+      printf_unfiltered ("(toward zero)\n");
     }
-    pcr_tmp = pcr & FPA_PCR_EM;
-    printf_unfiltered("\tEM= %#x", pcr_tmp);
-    if (pcr_tmp & FPA_PCR_EM_DM) printf_unfiltered(" DM");
-    if (pcr_tmp & FPA_PCR_EM_UOM) printf_unfiltered(" UOM");
-    if (pcr_tmp & FPA_PCR_EM_PM) printf_unfiltered(" PM");
-    if (pcr_tmp & FPA_PCR_EM_UM) printf_unfiltered(" UM");
-    if (pcr_tmp & FPA_PCR_EM_OM) printf_unfiltered(" OM");
-    if (pcr_tmp & FPA_PCR_EM_ZM) printf_unfiltered(" ZM");
-    if (pcr_tmp & FPA_PCR_EM_IM) printf_unfiltered(" IM");
-    printf_unfiltered("\n");
-    pcr_tmp = FPA_PCR_CC;
-    printf_unfiltered("\tCC= %#x", pcr_tmp);
-    if (pcr_tmp & FPA_PCR_20MHZ) printf_unfiltered(" 20MHZ");
-    if (pcr_tmp & FPA_PCR_CC_Z) printf_unfiltered(" Z");
-    if (pcr_tmp & FPA_PCR_CC_C2) printf_unfiltered(" C2");
-
-    /* Dynix defines FPA_PCR_CC_C0 to 0x100 and ptx defines
-       FPA_PCR_CC_C1 to 0x100.  Use whichever is defined and assume
-       the OS knows what it is doing.  */
+  pcr_tmp = pcr & FPA_PCR_EM;
+  printf_unfiltered ("\tEM= %#x", pcr_tmp);
+  if (pcr_tmp & FPA_PCR_EM_DM)
+    printf_unfiltered (" DM");
+  if (pcr_tmp & FPA_PCR_EM_UOM)
+    printf_unfiltered (" UOM");
+  if (pcr_tmp & FPA_PCR_EM_PM)
+    printf_unfiltered (" PM");
+  if (pcr_tmp & FPA_PCR_EM_UM)
+    printf_unfiltered (" UM");
+  if (pcr_tmp & FPA_PCR_EM_OM)
+    printf_unfiltered (" OM");
+  if (pcr_tmp & FPA_PCR_EM_ZM)
+    printf_unfiltered (" ZM");
+  if (pcr_tmp & FPA_PCR_EM_IM)
+    printf_unfiltered (" IM");
+  printf_unfiltered ("\n");
+  pcr_tmp = FPA_PCR_CC;
+  printf_unfiltered ("\tCC= %#x", pcr_tmp);
+  if (pcr_tmp & FPA_PCR_20MHZ)
+    printf_unfiltered (" 20MHZ");
+  if (pcr_tmp & FPA_PCR_CC_Z)
+    printf_unfiltered (" Z");
+  if (pcr_tmp & FPA_PCR_CC_C2)
+    printf_unfiltered (" C2");
+
+  /* Dynix defines FPA_PCR_CC_C0 to 0x100 and ptx defines
+     FPA_PCR_CC_C1 to 0x100.  Use whichever is defined and assume
+     the OS knows what it is doing.  */
 #ifdef FPA_PCR_CC_C1
-    if (pcr_tmp & FPA_PCR_CC_C1) printf_unfiltered(" C1");
+  if (pcr_tmp & FPA_PCR_CC_C1)
+    printf_unfiltered (" C1");
 #else
-    if (pcr_tmp & FPA_PCR_CC_C0) printf_unfiltered(" C0");
+  if (pcr_tmp & FPA_PCR_CC_C0)
+    printf_unfiltered (" C0");
 #endif
 
-    switch (pcr_tmp)
-      {
-      case FPA_PCR_CC_Z:
-       printf_unfiltered(" (Equal)");
-       break;
+  switch (pcr_tmp)
+    {
+    case FPA_PCR_CC_Z:
+      printf_unfiltered (" (Equal)");
+      break;
 #ifdef FPA_PCR_CC_C1
-      case FPA_PCR_CC_C1:
+    case FPA_PCR_CC_C1:
 #else
-      case FPA_PCR_CC_C0:
+    case FPA_PCR_CC_C0:
 #endif
-       printf_unfiltered(" (Less than)");
-       break;
-      case 0:
-       printf_unfiltered(" (Greater than)");
-       break;
-      case FPA_PCR_CC_Z | 
+      printf_unfiltered (" (Less than)");
+      break;
+    case 0:
+      printf_unfiltered (" (Greater than)");
+      break;
+      case FPA_PCR_CC_Z |
 #ifdef FPA_PCR_CC_C1
        FPA_PCR_CC_C1
 #else
        FPA_PCR_CC_C0
 #endif
-         | FPA_PCR_CC_C2:
-       printf_unfiltered(" (Unordered)");
-       break;
-      default:
-       printf_unfiltered(" (Undefined)");
-       break;
-      }
-    printf_unfiltered("\n");
-    pcr_tmp = pcr & FPA_PCR_AE;
-    printf_unfiltered("\tAE= %#x", pcr_tmp);
-    if (pcr_tmp & FPA_PCR_AE_DE) printf_unfiltered(" DE");
-    if (pcr_tmp & FPA_PCR_AE_UOE) printf_unfiltered(" UOE");
-    if (pcr_tmp & FPA_PCR_AE_PE) printf_unfiltered(" PE");
-    if (pcr_tmp & FPA_PCR_AE_UE) printf_unfiltered(" UE");
-    if (pcr_tmp & FPA_PCR_AE_OE) printf_unfiltered(" OE");
-    if (pcr_tmp & FPA_PCR_AE_ZE) printf_unfiltered(" ZE");
-    if (pcr_tmp & FPA_PCR_AE_EE) printf_unfiltered(" EE");
-    if (pcr_tmp & FPA_PCR_AE_IE) printf_unfiltered(" IE");
-    printf_unfiltered("\n");
+    | FPA_PCR_CC_C2:
+      printf_unfiltered (" (Unordered)");
+      break;
+    default:
+      printf_unfiltered (" (Undefined)");
+      break;
+    }
+  printf_unfiltered ("\n");
+  pcr_tmp = pcr & FPA_PCR_AE;
+  printf_unfiltered ("\tAE= %#x", pcr_tmp);
+  if (pcr_tmp & FPA_PCR_AE_DE)
+    printf_unfiltered (" DE");
+  if (pcr_tmp & FPA_PCR_AE_UOE)
+    printf_unfiltered (" UOE");
+  if (pcr_tmp & FPA_PCR_AE_PE)
+    printf_unfiltered (" PE");
+  if (pcr_tmp & FPA_PCR_AE_UE)
+    printf_unfiltered (" UE");
+  if (pcr_tmp & FPA_PCR_AE_OE)
+    printf_unfiltered (" OE");
+  if (pcr_tmp & FPA_PCR_AE_ZE)
+    printf_unfiltered (" ZE");
+  if (pcr_tmp & FPA_PCR_AE_EE)
+    printf_unfiltered (" EE");
+  if (pcr_tmp & FPA_PCR_AE_IE)
+    printf_unfiltered (" IE");
+  printf_unfiltered ("\n");
 }
 
-print_1167_regs(regs)
-long regs[FPA_NREGS];
+print_1167_regs (regs)
+     long regs[FPA_NREGS];
 
 {
-    int i;
-
-    union {
-       double  d;
-       long    l[2];
-    } xd;
-    union {
-       float   f;
-       long    l;
-    } xf;
-
-
-    for (i = 0; i < FPA_NREGS; i++) {
-       xf.l = regs[i];
-       printf_unfiltered("%%fp%d: raw= %#x, single= %f", i+1, regs[i], xf.f);
-       if (!(i & 1)) {
-           printf_unfiltered("\n");
-       } else {
-           xd.l[1] = regs[i];
-           xd.l[0] = regs[i+1];
-           printf_unfiltered(", double= %f\n", xd.d);
+  int i;
+
+  union
+    {
+      double d;
+      long l[2];
+    }
+  xd;
+  union
+    {
+      float f;
+      long l;
+    }
+  xf;
+
+
+  for (i = 0; i < FPA_NREGS; i++)
+    {
+      xf.l = regs[i];
+      printf_unfiltered ("%%fp%d: raw= %#x, single= %f", i + 1, regs[i], xf.f);
+      if (!(i & 1))
+       {
+         printf_unfiltered ("\n");
+       }
+      else
+       {
+         xd.l[1] = regs[i];
+         xd.l[0] = regs[i + 1];
+         printf_unfiltered (", double= %f\n", xd.d);
        }
     }
 }
 
-print_fpa_status(ep)
-struct pt_regset ep;
+print_fpa_status (ep)
+     struct pt_regset ep;
 
 {
 
-    printf_unfiltered("WTL 1167:");
-    if (ep.pr_fpa.fpa_pcr !=0) {
-       printf_unfiltered("\n");
-       print_1167_control_word(ep.pr_fpa.fpa_pcr);
-       print_1167_regs(ep.pr_fpa.fpa_regs);
-    } else {
-       printf_unfiltered(" not in use.\n");
+  printf_unfiltered ("WTL 1167:");
+  if (ep.pr_fpa.fpa_pcr != 0)
+    {
+      printf_unfiltered ("\n");
+      print_1167_control_word (ep.pr_fpa.fpa_pcr);
+      print_1167_regs (ep.pr_fpa.fpa_regs);
+    }
+  else
+    {
+      printf_unfiltered (" not in use.\n");
     }
 }
 
-#if 0 /* disabled because it doesn't go through the target vector.  */
+#if 0                          /* disabled because it doesn't go through the target vector.  */
 i386_float_info ()
 {
-  char ubuf[UPAGES*NBPG];
+  char ubuf[UPAGES * NBPG];
   struct pt_regset regset;
 
-  if (have_inferior_p())
+  if (have_inferior_p ())
     {
-      PTRACE_READ_REGS (inferior_pid, (PTRACE_ARG3_TYPE) &regset);
+      PTRACE_READ_REGS (inferior_pid, (PTRACE_ARG3_TYPE) & regset);
     }
   else
     {
@@ -342,7 +390,7 @@ i386_float_info ()
        {
          perror ("seek on core file");
        }
-      if (myread (corechan, ubuf, UPAGES*NBPG) < 0)
+      if (myread (corechan, ubuf, UPAGES * NBPG) < 0)
        {
          perror ("read on core file");
        }
@@ -350,20 +398,20 @@ i386_float_info ()
       regset.pr_fpu = ((struct user *) ubuf)->u_fpusave;
       regset.pr_fpa = ((struct user *) ubuf)->u_fpasave;
     }
-  print_fpu_status(regset);
-  print_fpa_status(regset);
+  print_fpu_status (regset);
+  print_fpa_status (regset);
 }
 #endif
 
 static volatile int got_sigchld;
 
-/*ARGSUSED*/
+/*ARGSUSED */
 /* This will eventually be more interesting. */
 void
-sigchld_handler(signo)
-       int signo;
+sigchld_handler (signo)
+     int signo;
 {
-       got_sigchld++;
+  got_sigchld++;
 }
 
 /*
@@ -384,7 +432,7 @@ sigchld_handler(signo)
  * Thanks to XPT_MPDEBUGGER, we have to mange child_wait().
  */
 int
-child_wait(pid, status)
+child_wait (pid, status)
      int pid;
      struct target_waitstatus *status;
 {
@@ -399,133 +447,145 @@ child_wait(pid, status)
   prstatus_t pstatus;
 #endif
 
-  do {
-    set_sigint_trap(); /* Causes SIGINT to be passed on to the
-                          attached process. */
-    save_errno = errno;
+  do
+    {
+      set_sigint_trap ();      /* Causes SIGINT to be passed on to the
+                                  attached process. */
+      save_errno = errno;
 
-    got_sigchld = 0;
+      got_sigchld = 0;
 
-    sigemptyset(&set);
+      sigemptyset (&set);
 
-    while (got_sigchld == 0) {
-           sigsuspend(&set);
-    }
-    
-    clear_sigint_trap();
+      while (got_sigchld == 0)
+       {
+         sigsuspend (&set);
+       }
 
-    rv = mptrace(XPT_STOPSTAT, 0, (char *)&pt, 0);
-    if (-1 == rv) {
-           printf("XPT_STOPSTAT: errno %d\n", errno); /* DEBUG */
-           continue;
-    }
+      clear_sigint_trap ();
+
+      rv = mptrace (XPT_STOPSTAT, 0, (char *) &pt, 0);
+      if (-1 == rv)
+       {
+         printf ("XPT_STOPSTAT: errno %d\n", errno);   /* DEBUG */
+         continue;
+       }
 
-    pid = pt.ps_pid;
-
-    if (pid != inferior_pid) {
-           /* NOTE: the mystery fork in csh/tcsh needs to be ignored.
-            * We should not return new children for the initial run
-            * of a process until it has done the exec.
-            */
-           /* inferior probably forked; send it on its way */
-           rv = mptrace(XPT_UNDEBUG, pid, 0, 0);
-           if (-1 == rv) {
-                   printf("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
-                          safe_strerror(errno));
+      pid = pt.ps_pid;
+
+      if (pid != inferior_pid)
+       {
+         /* NOTE: the mystery fork in csh/tcsh needs to be ignored.
+          * We should not return new children for the initial run
+          * of a process until it has done the exec.
+          */
+         /* inferior probably forked; send it on its way */
+         rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
+         if (-1 == rv)
+           {
+             printf ("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
+                     safe_strerror (errno));
            }
-           continue;
-    }
-    /* FIXME: Do we deal with fork notification correctly?  */
-    switch (pt.ps_reason) {
-    case PTS_FORK:
-       /* multi proc: treat like PTS_EXEC */
-           /*
-            * Pretend this didn't happen, since gdb isn't set up
-            * to deal with stops on fork.
-            */
-           rv = ptrace(PT_CONTSIG, pid, 1, 0);
-           if (-1 == rv) {
-                   printf("PTS_FORK: PT_CONTSIG: error %d\n", errno);
+         continue;
+       }
+      /* FIXME: Do we deal with fork notification correctly?  */
+      switch (pt.ps_reason)
+       {
+       case PTS_FORK:
+         /* multi proc: treat like PTS_EXEC */
+         /*
+          * Pretend this didn't happen, since gdb isn't set up
+          * to deal with stops on fork.
+          */
+         rv = ptrace (PT_CONTSIG, pid, 1, 0);
+         if (-1 == rv)
+           {
+             printf ("PTS_FORK: PT_CONTSIG: error %d\n", errno);
            }
-           continue;
-    case PTS_EXEC:
-           /*
-            * Pretend this is a SIGTRAP.
-            */
-           status->kind = TARGET_WAITKIND_STOPPED;
-           status->value.sig = TARGET_SIGNAL_TRAP;
-           break;
-    case PTS_EXIT:
-           /*
-            * Note: we stop before the exit actually occurs.  Extract
-            * the exit code from the uarea.  If we're stopped in the
-            * exit() system call, the exit code will be in
-            * u.u_ap[0].  An exit due to an uncaught signal will have
-            * something else in here, see the comment in the default:
-            * case, below.  Finally,let the process exit.
-            */
-           if (death_by_signal)
-             {
-               status->kind = TARGET_WAITKIND_SIGNALED;
-               status->value.sig = target_signal_from_host (death_by_signal);
-               death_by_signal = 0;
-               break;
-             }
-           xvaloff = (unsigned long)&u.u_ap[0] - (unsigned long)&u;
-           errno = 0;
-           rv = ptrace(PT_RUSER, pid, (char *)xvaloff, 0);
-           status->kind = TARGET_WAITKIND_EXITED;
-           status->value.integer = rv;
-           /*
-            * addr & data to mptrace() don't matter here, since
-            * the process is already dead.
-            */
-           rv = mptrace(XPT_UNDEBUG, pid, 0, 0);
-           if (-1 == rv) {
-                   printf("child_wait: PTS_EXIT: XPT_UNDEBUG: pid %d error %d\n", pid,
-                          errno);
+         continue;
+       case PTS_EXEC:
+         /*
+          * Pretend this is a SIGTRAP.
+          */
+         status->kind = TARGET_WAITKIND_STOPPED;
+         status->value.sig = TARGET_SIGNAL_TRAP;
+         break;
+       case PTS_EXIT:
+         /*
+          * Note: we stop before the exit actually occurs.  Extract
+          * the exit code from the uarea.  If we're stopped in the
+          * exit() system call, the exit code will be in
+          * u.u_ap[0].  An exit due to an uncaught signal will have
+          * something else in here, see the comment in the default:
+          * case, below.  Finally,let the process exit.
+          */
+         if (death_by_signal)
+           {
+             status->kind = TARGET_WAITKIND_SIGNALED;
+             status->value.sig = target_signal_from_host (death_by_signal);
+             death_by_signal = 0;
+             break;
            }
-           break;
-    case PTS_WATCHPT_HIT:
-           fatal("PTS_WATCHPT_HIT\n");
-           break;
-    default:
-           /* stopped by signal */
-           status->kind = TARGET_WAITKIND_STOPPED;
-           status->value.sig = target_signal_from_host (pt.ps_reason);
-           death_by_signal = 0;
-
-           if (0 == (SIGNALS_DFL_SAFE & sigmask(pt.ps_reason))) {
-                   break;
+         xvaloff = (unsigned long) &u.u_ap[0] - (unsigned long) &u;
+         errno = 0;
+         rv = ptrace (PT_RUSER, pid, (char *) xvaloff, 0);
+         status->kind = TARGET_WAITKIND_EXITED;
+         status->value.integer = rv;
+         /*
+          * addr & data to mptrace() don't matter here, since
+          * the process is already dead.
+          */
+         rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
+         if (-1 == rv)
+           {
+             printf ("child_wait: PTS_EXIT: XPT_UNDEBUG: pid %d error %d\n", pid,
+                     errno);
+           }
+         break;
+       case PTS_WATCHPT_HIT:
+         fatal ("PTS_WATCHPT_HIT\n");
+         break;
+       default:
+         /* stopped by signal */
+         status->kind = TARGET_WAITKIND_STOPPED;
+         status->value.sig = target_signal_from_host (pt.ps_reason);
+         death_by_signal = 0;
+
+         if (0 == (SIGNALS_DFL_SAFE & sigmask (pt.ps_reason)))
+           {
+             break;
            }
-           /* else default action of signal is to die */
+         /* else default action of signal is to die */
 #ifdef SVR4_SHARED_LIBS
-           rv = ptrace(PT_GET_PRSTATUS, pid, (char *)&pstatus, 0);
-           if (-1 == rv)
-               error("child_wait: signal %d PT_GET_PRSTATUS: %s\n",
-                       pt.ps_reason, safe_strerror(errno));
-           if (pstatus.pr_cursig != pt.ps_reason) {
-               printf("pstatus signal %d, pt signal %d\n",
-                       pstatus.pr_cursig, pt.ps_reason);
+         rv = ptrace (PT_GET_PRSTATUS, pid, (char *) &pstatus, 0);
+         if (-1 == rv)
+           error ("child_wait: signal %d PT_GET_PRSTATUS: %s\n",
+                  pt.ps_reason, safe_strerror (errno));
+         if (pstatus.pr_cursig != pt.ps_reason)
+           {
+             printf ("pstatus signal %d, pt signal %d\n",
+                     pstatus.pr_cursig, pt.ps_reason);
            }
-           sa_hand = (int)pstatus.pr_action.sa_handler;
+         sa_hand = (int) pstatus.pr_action.sa_handler;
 #else
-           saoff = (unsigned long)&u.u_sa[0] - (unsigned long)&u;
-           saoff += sizeof(struct sigaction) * (pt.ps_reason - 1);
-           errno = 0;
-           sa_hand = ptrace(PT_RUSER, pid, (char *)saoff, 0);
-           if (errno)
-                   error("child_wait: signal %d: RUSER: %s\n",
-                          pt.ps_reason, safe_strerror(errno));
+         saoff = (unsigned long) &u.u_sa[0] - (unsigned long) &u;
+         saoff += sizeof (struct sigaction) * (pt.ps_reason - 1);
+         errno = 0;
+         sa_hand = ptrace (PT_RUSER, pid, (char *) saoff, 0);
+         if (errno)
+           error ("child_wait: signal %d: RUSER: %s\n",
+                  pt.ps_reason, safe_strerror (errno));
 #endif
-           if ((int)SIG_DFL == sa_hand) {
-                   /* we will be dying */
-                   death_by_signal = pt.ps_reason;
+         if ((int) SIG_DFL == sa_hand)
+           {
+             /* we will be dying */
+             death_by_signal = pt.ps_reason;
            }
-           break;
-    }
+         break;
+       }
 
-  } while (pid != inferior_pid); /* Some other child died or stopped */
+    }
+  while (pid != inferior_pid); /* Some other child died or stopped */
 
   return pid;
 }
@@ -542,28 +602,30 @@ child_wait (pid, ourstatus)
   int save_errno;
   int status;
 
-  do {
-    pid = wait (&status);
-    save_errno = errno;
+  do
+    {
+      pid = wait (&status);
+      save_errno = errno;
 
-    if (pid == -1)
-      {
-       if (save_errno == EINTR)
-         continue;
-       fprintf (stderr, "Child process unexpectedly missing: %s.\n",
-                safe_strerror (save_errno));
-       ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
-       ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
-        return -1;
-      }
-  } while (pid != inferior_pid); /* Some other child died or stopped */
+      if (pid == -1)
+       {
+         if (save_errno == EINTR)
+           continue;
+         fprintf (stderr, "Child process unexpectedly missing: %s.\n",
+                  safe_strerror (save_errno));
+         ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+         ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+         return -1;
+       }
+    }
+  while (pid != inferior_pid); /* Some other child died or stopped */
   store_waitstatus (ourstatus, status);
   return pid;
 }
 #endif /* ATTACH_DETACH */
+\f
 
 
-\f
 /* This function simply calls ptrace with the given arguments.  
    It exists so that all calls to ptrace are isolated in this 
    machine-dependent file. */
@@ -577,12 +639,12 @@ call_ptrace (request, pid, addr, data)
 }
 
 int
-call_mptrace(request, pid, addr, data)
-       int request, pid;
-       PTRACE_ARG3_TYPE addr;
-       int data;
+call_mptrace (request, pid, addr, data)
+     int request, pid;
+     PTRACE_ARG3_TYPE addr;
+     int data;
 {
-       return mptrace(request, pid, addr, data);
+  return mptrace (request, pid, addr, data);
 }
 
 #if defined (DEBUG_PTRACE)
@@ -604,10 +666,10 @@ kill_inferior ()
 
   kill (inferior_pid, SIGKILL);
 #ifdef ATTACH_DETACH
-  detach(SIGKILL);
+  detach (SIGKILL);
 #else /* ATTACH_DETACH */
-  ptrace(PT_KILL, inferior_pid, 0, 0);
-  wait((int *)NULL);
+  ptrace (PT_KILL, inferior_pid, 0, 0);
+  wait ((int *) NULL);
 #endif /* ATTACH_DETACH */
   target_mourn_inferior ();
 }
@@ -637,7 +699,7 @@ child_resume (pid, step, signal)
      instructions), so we don't have to worry about that here.  */
 
   if (step)
-    ptrace (PT_SSTEP,     pid, (PTRACE_ARG3_TYPE) 1, signal);
+    ptrace (PT_SSTEP, pid, (PTRACE_ARG3_TYPE) 1, signal);
   else
     ptrace (PT_CONTSIG, pid, (PTRACE_ARG3_TYPE) 1, signal);
 
@@ -651,32 +713,35 @@ int
 attach (pid)
      int pid;
 {
-       sigset_t set;
-       int rv;
+  sigset_t set;
+  int rv;
 
-       rv = mptrace(XPT_DEBUG, pid, 0, 0);
-       if (-1 == rv) {
-               error("mptrace(XPT_DEBUG): %s", safe_strerror(errno));
-       }
-       rv = mptrace(XPT_SIGNAL, pid, 0, SIGSTOP);
-       if (-1 == rv) {
-               error("mptrace(XPT_SIGNAL): %s", safe_strerror(errno));
-       }
-       attach_flag = 1;
-       return pid;
+  rv = mptrace (XPT_DEBUG, pid, 0, 0);
+  if (-1 == rv)
+    {
+      error ("mptrace(XPT_DEBUG): %s", safe_strerror (errno));
+    }
+  rv = mptrace (XPT_SIGNAL, pid, 0, SIGSTOP);
+  if (-1 == rv)
+    {
+      error ("mptrace(XPT_SIGNAL): %s", safe_strerror (errno));
+    }
+  attach_flag = 1;
+  return pid;
 }
 
 void
 detach (signo)
      int signo;
 {
-       int rv;
+  int rv;
 
-       rv = mptrace(XPT_UNDEBUG, inferior_pid, 1, signo);
-       if (-1 == rv) {
-               error("mptrace(XPT_UNDEBUG): %s", safe_strerror(errno));
-       }
-       attach_flag = 0;
+  rv = mptrace (XPT_UNDEBUG, inferior_pid, 1, signo);
+  if (-1 == rv)
+    {
+      error ("mptrace(XPT_UNDEBUG): %s", safe_strerror (errno));
+    }
+  attach_flag = 0;
 }
 
 #endif /* ATTACH_DETACH */
@@ -685,8 +750,8 @@ detach (signo)
 #ifndef PTRACE_XFER_TYPE
 #define PTRACE_XFER_TYPE int
 #endif
-
 \f
+
 /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
    in the NEW_SUN_PTRACE case.
    It ought to be straightforward.  But it appears that writing did
@@ -696,7 +761,7 @@ detach (signo)
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
    to debugger memory starting at MYADDR.   Copy to inferior if
    WRITE is nonzero.
-  
+
    Returns the length copied, which is either the LEN argument or zero.
    This xfer function does not do partial moves, since child_ops
    doesn't allow memory operations to cross below us in the target stack
@@ -708,28 +773,29 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
      char *myaddr;
      int len;
      int write;
-     struct target_ops *target;                /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   register int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & - sizeof (PTRACE_XFER_TYPE);
+  register CORE_ADDR addr = memaddr & -sizeof (PTRACE_XFER_TYPE);
   /* Round ending address up; get number of longwords that makes.  */
   register int count
-    = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
-      / sizeof (PTRACE_XFER_TYPE);
+  = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
+  / sizeof (PTRACE_XFER_TYPE);
   /* Allocate buffer of that many longwords.  */
   register PTRACE_XFER_TYPE *buffer
-    = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+  = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
 
   if (write)
     {
       /* Fill start and end extra bytes of buffer with existing memory data.  */
 
-      if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE)) {
-       /* Need part of initial word -- fetch it.  */
-        buffer[0] = ptrace (PT_RTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr,
-                           0);
-      }
+      if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
+       {
+         /* Need part of initial word -- fetch it.  */
+         buffer[0] = ptrace (PT_RTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr,
+                             0);
+       }
 
       if (count > 1)           /* FIXME, avoid if even boundary */
        {
@@ -756,7 +822,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
          if (errno)
            {
              /* Using the appropriate one (I or D) is necessary for
-                Gould NP1, at least.  */
+                Gould NP1, at least.  */
              errno = 0;
              ptrace (PT_WTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr,
                      buffer[i]);
@@ -800,45 +866,49 @@ _initialize_symm_nat ()
  * Note that attach is not implemented in dynix 3, and not in ptx
  * until version 2.1 of the OS.
  */
-       int rv;
-       sigset_t set;
-       struct sigaction sact;
-
-       rv = mptrace(XPT_MPDEBUGGER, 0, 0, 0);
-       if (-1 == rv) {
-               fatal("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
-                     safe_strerror(errno));
-       }
+  int rv;
+  sigset_t set;
+  struct sigaction sact;
 
-       /*
-        * Under MPDEBUGGER, we get SIGCLHD when a traced process does
-        * anything of interest.
-        */
-
-       /*
-        * Block SIGCHLD.  We leave it blocked all the time, and then
-        * call sigsuspend() in child_wait() to wait for the child
-        * to do something.  None of these ought to fail, but check anyway.
-        */
-       sigemptyset(&set);
-       rv = sigaddset(&set, SIGCHLD);
-       if (-1 == rv) {
-               fatal("_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
-                     safe_strerror(errno));
-       }
-       rv = sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
-       if (-1 == rv) {
-               fatal("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
-                     safe_strerror(errno));
-       }
+  rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0);
+  if (-1 == rv)
+    {
+      fatal ("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
+            safe_strerror (errno));
+    }
 
-       sact.sa_handler = sigchld_handler;
-       sigemptyset(&sact.sa_mask);
-       sact.sa_flags = SA_NOCLDWAIT; /* keep the zombies away */
-       rv = sigaction(SIGCHLD, &sact, (struct sigaction *)NULL);
-       if (-1 == rv) {
-               fatal("_initialize_symm_nat(): sigaction(SIGCHLD): %s",
-                     safe_strerror(errno));
-       }
+  /*
+   * Under MPDEBUGGER, we get SIGCLHD when a traced process does
+   * anything of interest.
+   */
+
+  /*
+   * Block SIGCHLD.  We leave it blocked all the time, and then
+   * call sigsuspend() in child_wait() to wait for the child
+   * to do something.  None of these ought to fail, but check anyway.
+   */
+  sigemptyset (&set);
+  rv = sigaddset (&set, SIGCHLD);
+  if (-1 == rv)
+    {
+      fatal ("_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
+            safe_strerror (errno));
+    }
+  rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL);
+  if (-1 == rv)
+    {
+      fatal ("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
+            safe_strerror (errno));
+    }
+
+  sact.sa_handler = sigchld_handler;
+  sigemptyset (&sact.sa_mask);
+  sact.sa_flags = SA_NOCLDWAIT;        /* keep the zombies away */
+  rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL);
+  if (-1 == rv)
+    {
+      fatal ("_initialize_symm_nat(): sigaction(SIGCHLD): %s",
+            safe_strerror (errno));
+    }
 #endif
 }
index aaf73e94a74e64ed6a1447422733d71cbabd28bf..667fd64dcb2a534b642e1923f0b51bc822684eab 100644 (file)
@@ -1,21 +1,22 @@
 /* Sequent Symmetry target interface, for GDB.
    Copyright (C) 1986, 1987, 1989, 1991, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* many 387-specific items of use taken from i386-dep.c */
 
@@ -34,60 +35,70 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <fcntl.h>
 
 void
-symmetry_extract_return_value(type, regbuf, valbuf)
+symmetry_extract_return_value (type, regbuf, valbuf)
      struct type *type;
      char *regbuf;
      char *valbuf;
 {
-  union { 
-    double     d; 
-    int        l[2]; 
-  } xd; 
+  union
+    {
+      double d;
+      int l[2];
+    }
+  xd;
   struct minimal_symbol *msymbol;
   float f;
 
-  if (TYPE_CODE_FLT == TYPE_CODE(type)) { 
-    msymbol = lookup_minimal_symbol ("1167_flt", NULL, NULL);
-    if (msymbol != NULL) {
-      /* found "1167_flt" means 1167, %fp2-%fp3 */ 
-      /* float & double; 19= %fp2, 20= %fp3 */
-      /* no single precision on 1167 */
-      xd.l[1] = *((int *)&regbuf[REGISTER_BYTE(19)]);
-      xd.l[0] = *((int *)&regbuf[REGISTER_BYTE(20)]);
-      switch (TYPE_LENGTH(type)) {
-      case 4:
-       /* FIXME: broken for cross-debugging.  */
-       f = (float) xd.d;
-       memcpy (valbuf, &f, TYPE_LENGTH(type));
-       break;
-      case 8:
-       /* FIXME: broken for cross-debugging.  */
-       memcpy (valbuf, &xd.d, TYPE_LENGTH(type)); 
-       break;
-      default:
-       error("Unknown floating point size");
-       break;
-      }
-    } else { 
-      /* 387 %st(0), gcc uses this */ 
-      i387_to_double(((int *)&regbuf[REGISTER_BYTE(3)]),
-                    &xd.d); 
-      switch (TYPE_LENGTH(type)) {
-      case 4:                  /* float */
-       f = (float) xd.d;
-       /* FIXME: broken for cross-debugging.  */
-       memcpy (valbuf, &f, 4); 
-       break;
-      case 8:                  /* double */
-       /* FIXME: broken for cross-debugging.  */
-       memcpy (valbuf, &xd.d, 8);
-       break;
-      default:
-       error("Unknown floating point size");
-       break;
-      }
+  if (TYPE_CODE_FLT == TYPE_CODE (type))
+    {
+      msymbol = lookup_minimal_symbol ("1167_flt", NULL, NULL);
+      if (msymbol != NULL)
+       {
+         /* found "1167_flt" means 1167, %fp2-%fp3 */
+         /* float & double; 19= %fp2, 20= %fp3 */
+         /* no single precision on 1167 */
+         xd.l[1] = *((int *) &regbuf[REGISTER_BYTE (19)]);
+         xd.l[0] = *((int *) &regbuf[REGISTER_BYTE (20)]);
+         switch (TYPE_LENGTH (type))
+           {
+           case 4:
+             /* FIXME: broken for cross-debugging.  */
+             f = (float) xd.d;
+             memcpy (valbuf, &f, TYPE_LENGTH (type));
+             break;
+           case 8:
+             /* FIXME: broken for cross-debugging.  */
+             memcpy (valbuf, &xd.d, TYPE_LENGTH (type));
+             break;
+           default:
+             error ("Unknown floating point size");
+             break;
+           }
+       }
+      else
+       {
+         /* 387 %st(0), gcc uses this */
+         i387_to_double (((int *) &regbuf[REGISTER_BYTE (3)]),
+                         &xd.d);
+         switch (TYPE_LENGTH (type))
+           {
+           case 4:             /* float */
+             f = (float) xd.d;
+             /* FIXME: broken for cross-debugging.  */
+             memcpy (valbuf, &f, 4);
+             break;
+           case 8:             /* double */
+             /* FIXME: broken for cross-debugging.  */
+             memcpy (valbuf, &xd.d, 8);
+             break;
+           default:
+             error ("Unknown floating point size");
+             break;
+           }
+       }
+    }
+  else
+    {
+      memcpy (valbuf, regbuf, TYPE_LENGTH (type));
     }
-  } else {
-    memcpy (valbuf, regbuf, TYPE_LENGTH (type)); 
-  }
 }
index c615bfcdea27d89f65917f17eacf8b1449f203fa..ca40a69f75a63945aeaa97aef201b0094832075b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -48,11 +49,11 @@ FILE *std_err;
 
 /* Prototypes for local functions */
 
-static void dump_symtab PARAMS ((struct objfile *, struct symtab *, 
-                                 GDB_FILE *));
+static void dump_symtab PARAMS ((struct objfile *, struct symtab *,
+                                GDB_FILE *));
 
-static void dump_psymtab PARAMS ((struct objfile *, struct partial_symtab *, 
-                                  GDB_FILE *));
+static void dump_psymtab PARAMS ((struct objfile *, struct partial_symtab *,
+                                 GDB_FILE *));
 
 static void dump_msymbols PARAMS ((struct objfile *, GDB_FILE *));
 
@@ -60,25 +61,26 @@ static void dump_objfile PARAMS ((struct objfile *));
 
 static int block_depth PARAMS ((struct block *));
 
-static void print_partial_symbols PARAMS ((struct partial_symbol **, int, 
-                                           char *, GDB_FILE *));
+static void print_partial_symbols PARAMS ((struct partial_symbol **, int,
+                                          char *, GDB_FILE *));
 
 static void free_symtab_block PARAMS ((struct objfile *, struct block *));
 
 void _initialize_symmisc PARAMS ((void));
 
-struct print_symbol_args {
-  struct symbol *symbol;
-  int depth;
-  GDB_FILE *outfile;
-};
+struct print_symbol_args
+  {
+    struct symbol *symbol;
+    int depth;
+    GDB_FILE *outfile;
+  };
 
 static int print_symbol PARAMS ((PTR));
 
 static void
 free_symtab_block PARAMS ((struct objfile *, struct block *));
-
 \f
+
 /* Free a struct block <- B and all the symbols defined in that block.  */
 
 static void
@@ -90,10 +92,10 @@ free_symtab_block (objfile, b)
   n = BLOCK_NSYMS (b);
   for (i = 0; i < n; i++)
     {
-      mfree (objfile -> md, SYMBOL_NAME (BLOCK_SYM (b, i)));
-      mfree (objfile -> md, (PTR) BLOCK_SYM (b, i));
+      mfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
+      mfree (objfile->md, (PTR) BLOCK_SYM (b, i));
     }
-  mfree (objfile -> md, (PTR) b);
+  mfree (objfile->md, (PTR) b);
 }
 
 /* Free all the storage associated with the struct symtab <- S.
@@ -115,43 +117,43 @@ free_symtab (s)
     {
     case free_nothing:
       /* All the contents are part of a big block of memory (an obstack),
-        and some other symtab is in charge of freeing that block.
-        Therefore, do nothing.  */
+         and some other symtab is in charge of freeing that block.
+         Therefore, do nothing.  */
       break;
 
     case free_contents:
       /* Here all the contents were malloc'ed structure by structure
-        and must be freed that way.  */
+         and must be freed that way.  */
       /* First free the blocks (and their symbols.  */
       bv = BLOCKVECTOR (s);
       n = BLOCKVECTOR_NBLOCKS (bv);
       for (i = 0; i < n; i++)
-       free_symtab_block (s -> objfile, BLOCKVECTOR_BLOCK (bv, i));
+       free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i));
       /* Free the blockvector itself.  */
-      mfree (s -> objfile -> md, (PTR) bv);
+      mfree (s->objfile->md, (PTR) bv);
       /* Also free the linetable.  */
-      
+
     case free_linetable:
       /* Everything will be freed either by our `free_ptr'
-        or by some other symtab, except for our linetable.
-        Free that now.  */
+         or by some other symtab, except for our linetable.
+         Free that now.  */
       if (LINETABLE (s))
-       mfree (s -> objfile -> md, (PTR) LINETABLE (s));
+       mfree (s->objfile->md, (PTR) LINETABLE (s));
       break;
     }
 
   /* If there is a single block of memory to free, free it.  */
-  if (s -> free_ptr != NULL)
-    mfree (s -> objfile -> md, s -> free_ptr);
+  if (s->free_ptr != NULL)
+    mfree (s->objfile->md, s->free_ptr);
 
   /* Free source-related stuff */
-  if (s -> line_charpos != NULL)
-    mfree (s -> objfile -> md, (PTR) s -> line_charpos);
-  if (s -> fullname != NULL)
-    mfree (s -> objfile -> md, s -> fullname);
-  if (s -> debugformat != NULL)
-    mfree (s -> objfile -> md, s -> debugformat);
-  mfree (s -> objfile -> md, (PTR) s);
+  if (s->line_charpos != NULL)
+    mfree (s->objfile->md, (PTR) s->line_charpos);
+  if (s->fullname != NULL)
+    mfree (s->objfile->md, s->fullname);
+  if (s->debugformat != NULL)
+    mfree (s->objfile->md, s->debugformat);
+  mfree (s->objfile->md, (PTR) s);
 }
 
 void
@@ -161,10 +163,10 @@ print_symbol_bcache_statistics ()
 
   immediate_quit++;
   ALL_OBJFILES (objfile)
-    {
-      printf_filtered ("Byte cache statistics for '%s':\n", objfile -> name);
-      print_bcache_statistics (&objfile -> psymbol_cache, "partial symbol cache");
-    }
+  {
+    printf_filtered ("Byte cache statistics for '%s':\n", objfile->name);
+    print_bcache_statistics (&objfile->psymbol_cache, "partial symbol cache");
+  }
   immediate_quit--;
 }
 
@@ -175,46 +177,46 @@ print_objfile_statistics ()
 
   immediate_quit++;
   ALL_OBJFILES (objfile)
-    {
-      printf_filtered ("Statistics for '%s':\n", objfile -> name);
-      if (OBJSTAT (objfile, n_stabs) > 0)
-       printf_filtered ("  Number of \"stab\" symbols read: %d\n",
-                        OBJSTAT (objfile, n_stabs));
-      if (OBJSTAT (objfile, n_minsyms) > 0)
-       printf_filtered ("  Number of \"minimal\" symbols read: %d\n",
-                        OBJSTAT (objfile, n_minsyms));
-      if (OBJSTAT (objfile, n_psyms) > 0)
-       printf_filtered ("  Number of \"partial\" symbols read: %d\n",
-                        OBJSTAT (objfile, n_psyms));
-      if (OBJSTAT (objfile, n_syms) > 0)
-       printf_filtered ("  Number of \"full\" symbols read: %d\n",
-                        OBJSTAT (objfile, n_syms));
-      if (OBJSTAT (objfile, n_types) > 0)
-       printf_filtered ("  Number of \"types\" defined: %d\n",
-                        OBJSTAT (objfile, n_types));
-      if (OBJSTAT (objfile, sz_strtab) > 0)
-       printf_filtered ("  Space used by a.out string tables: %d\n",
-                        OBJSTAT (objfile, sz_strtab));
-      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));
-      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",
-                      obstack_memory_used (&objfile -> type_obstack));
-    }
+  {
+    printf_filtered ("Statistics for '%s':\n", objfile->name);
+    if (OBJSTAT (objfile, n_stabs) > 0)
+      printf_filtered ("  Number of \"stab\" symbols read: %d\n",
+                      OBJSTAT (objfile, n_stabs));
+    if (OBJSTAT (objfile, n_minsyms) > 0)
+      printf_filtered ("  Number of \"minimal\" symbols read: %d\n",
+                      OBJSTAT (objfile, n_minsyms));
+    if (OBJSTAT (objfile, n_psyms) > 0)
+      printf_filtered ("  Number of \"partial\" symbols read: %d\n",
+                      OBJSTAT (objfile, n_psyms));
+    if (OBJSTAT (objfile, n_syms) > 0)
+      printf_filtered ("  Number of \"full\" symbols read: %d\n",
+                      OBJSTAT (objfile, n_syms));
+    if (OBJSTAT (objfile, n_types) > 0)
+      printf_filtered ("  Number of \"types\" defined: %d\n",
+                      OBJSTAT (objfile, n_types));
+    if (OBJSTAT (objfile, sz_strtab) > 0)
+      printf_filtered ("  Space used by a.out string tables: %d\n",
+                      OBJSTAT (objfile, sz_strtab));
+    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));
+    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",
+                    obstack_memory_used (&objfile->type_obstack));
+  }
   immediate_quit--;
 }
 
-static void 
+static void
 dump_objfile (objfile)
      struct objfile *objfile;
 {
   struct symtab *symtab;
   struct partial_symtab *psymtab;
 
-  printf_filtered ("\nObject file %s:  ", objfile -> name);
+  printf_filtered ("\nObject file %s:  ", objfile->name);
   printf_filtered ("Objfile at ");
   gdb_print_address (objfile, gdb_stdout);
   printf_filtered (", bfd at ");
@@ -222,18 +224,18 @@ dump_objfile (objfile)
   printf_filtered (", %d minsyms\n\n",
                   objfile->minimal_symbol_count);
 
-  if (objfile -> psymtabs)
+  if (objfile->psymtabs)
     {
       printf_filtered ("Psymtabs:\n");
-      for (psymtab = objfile -> psymtabs;
+      for (psymtab = objfile->psymtabs;
           psymtab != NULL;
-          psymtab = psymtab -> next)
+          psymtab = psymtab->next)
        {
          printf_filtered ("%s at ",
-                          psymtab -> filename);
+                          psymtab->filename);
          gdb_print_address (psymtab, gdb_stdout);
          printf_filtered (", ");
-         if (psymtab -> objfile != objfile)
+         if (psymtab->objfile != objfile)
            {
              printf_filtered ("NOT ON CHAIN!  ");
            }
@@ -242,17 +244,17 @@ dump_objfile (objfile)
       printf_filtered ("\n\n");
     }
 
-  if (objfile -> symtabs)
+  if (objfile->symtabs)
     {
       printf_filtered ("Symtabs:\n");
-      for (symtab = objfile -> symtabs;
+      for (symtab = objfile->symtabs;
           symtab != NULL;
           symtab = symtab->next)
        {
-         printf_filtered ("%s at ", symtab -> filename);
+         printf_filtered ("%s at ", symtab->filename);
          gdb_print_address (symtab, gdb_stdout);
          printf_filtered (", ");
-         if (symtab -> objfile != objfile)
+         if (symtab->objfile != objfile)
            {
              printf_filtered ("NOT ON CHAIN!  ");
            }
@@ -263,8 +265,8 @@ dump_objfile (objfile)
 }
 
 /* Print minimal symbols from this objfile.  */
-static void 
+
+static void
 dump_msymbols (objfile, outfile)
      struct objfile *objfile;
      GDB_FILE *outfile;
@@ -272,48 +274,48 @@ dump_msymbols (objfile, outfile)
   struct minimal_symbol *msymbol;
   int index;
   char ms_type;
-  
-  fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile -> name);
-  if (objfile -> minimal_symbol_count == 0)
+
+  fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile->name);
+  if (objfile->minimal_symbol_count == 0)
     {
       fprintf_filtered (outfile, "No minimal symbols found.\n");
       return;
     }
-  for (index = 0, msymbol = objfile -> msymbols;
+  for (index = 0, msymbol = objfile->msymbols;
        SYMBOL_NAME (msymbol) != NULL; msymbol++, index++)
     {
-      switch (msymbol -> type)
+      switch (msymbol->type)
        {
-         case mst_unknown:
-           ms_type = 'u';
-           break;
-         case mst_text:
-           ms_type = 'T';
-           break;
-         case mst_solib_trampoline:
-           ms_type = 'S';
-           break;
-         case mst_data:
-           ms_type = 'D';
-           break;
-         case mst_bss:
-           ms_type = 'B';
-           break;
-         case mst_abs:
-           ms_type = 'A';
-           break;
-         case mst_file_text:
-           ms_type = 't';
-           break;
-         case mst_file_data:
-           ms_type = 'd';
-           break;
-         case mst_file_bss:
-           ms_type = 'b';
-           break;
-         default:
-           ms_type = '?';
-           break;
+       case mst_unknown:
+         ms_type = 'u';
+         break;
+       case mst_text:
+         ms_type = 'T';
+         break;
+       case mst_solib_trampoline:
+         ms_type = 'S';
+         break;
+       case mst_data:
+         ms_type = 'D';
+         break;
+       case mst_bss:
+         ms_type = 'B';
+         break;
+       case mst_abs:
+         ms_type = 'A';
+         break;
+       case mst_file_text:
+         ms_type = 't';
+         break;
+       case mst_file_data:
+         ms_type = 'd';
+         break;
+       case mst_file_bss:
+         ms_type = 'b';
+         break;
+       default:
+         ms_type = '?';
+         break;
        }
       fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
       print_address_numeric (SYMBOL_VALUE_ADDRESS (msymbol), 1, outfile);
@@ -332,10 +334,10 @@ dump_msymbols (objfile, outfile)
 #endif
       fputs_filtered ("\n", outfile);
     }
-  if (objfile -> minimal_symbol_count != index)
+  if (objfile->minimal_symbol_count != index)
     {
       warning ("internal error:  minimal symbol count %d != %d",
-              objfile -> minimal_symbol_count, index);
+              objfile->minimal_symbol_count, index);
     }
   fprintf_filtered (outfile, "\n");
 }
@@ -349,22 +351,22 @@ dump_psymtab (objfile, psymtab, outfile)
   int i;
 
   fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
-                   psymtab -> filename);
+                   psymtab->filename);
   fprintf_filtered (outfile, "(object ");
   gdb_print_address (psymtab, outfile);
   fprintf_filtered (outfile, ")\n\n");
   fprintf_unfiltered (outfile, "  Read from object file %s (",
-                     objfile -> name);
+                     objfile->name);
   gdb_print_address (objfile, outfile);
   fprintf_unfiltered (outfile, ")\n");
 
-  if (psymtab -> readin)
+  if (psymtab->readin)
     {
       fprintf_filtered (outfile,
-               "  Full symtab was read (at ");
+                       "  Full symtab was read (at ");
       gdb_print_address (psymtab->symtab, outfile);
       fprintf_filtered (outfile, " by function at ");
-      gdb_print_address ((PTR)psymtab->read_symtab, outfile);
+      gdb_print_address ((PTR) psymtab->read_symtab, outfile);
       fprintf_filtered (outfile, ")\n");
     }
 
@@ -386,30 +388,30 @@ dump_psymtab (objfile, psymtab, outfile)
   print_address_numeric (psymtab->texthigh, 1, outfile);
   fprintf_filtered (outfile, "\n");
   fprintf_filtered (outfile, "  Depends on %d other partial symtabs.\n",
-                   psymtab -> number_of_dependencies);
-  for (i = 0; i < psymtab -> number_of_dependencies; i++)
+                   psymtab->number_of_dependencies);
+  for (i = 0; i < psymtab->number_of_dependencies; i++)
     {
       fprintf_filtered (outfile, "    %d ", i);
-      gdb_print_address (psymtab -> dependencies[i], outfile);
+      gdb_print_address (psymtab->dependencies[i], outfile);
       fprintf_filtered (outfile, " %s\n",
-                       psymtab -> dependencies[i] -> filename);
+                       psymtab->dependencies[i]->filename);
     }
-  if (psymtab -> n_global_syms > 0)
+  if (psymtab->n_global_syms > 0)
     {
-      print_partial_symbols (objfile -> global_psymbols.list
-                           + psymtab -> globals_offset,
-                           psymtab -> n_global_syms, "Global", outfile);
+      print_partial_symbols (objfile->global_psymbols.list
+                            + psymtab->globals_offset,
+                            psymtab->n_global_syms, "Global", outfile);
     }
-  if (psymtab -> n_static_syms > 0)
+  if (psymtab->n_static_syms > 0)
     {
-      print_partial_symbols (objfile -> static_psymbols.list
-                           + psymtab -> statics_offset,
-                           psymtab -> n_static_syms, "Static", outfile);
+      print_partial_symbols (objfile->static_psymbols.list
+                            + psymtab->statics_offset,
+                            psymtab->n_static_syms, "Static", outfile);
     }
   fprintf_filtered (outfile, "\n");
 }
 
-static void 
+static void
 dump_symtab (objfile, symtab, outfile)
      struct objfile *objfile;
      struct symtab *symtab;
@@ -446,7 +448,7 @@ dump_symtab (objfile, symtab, outfile)
     }
   /* Now print the block info, but only for primary symtabs since we will
      print lots of duplicate info otherwise. */
-  if (symtab -> primary)
+  if (symtab->primary)
     {
       fprintf_filtered (outfile, "\nBlockvector:\n\n");
       bv = BLOCKVECTOR (symtab);
@@ -474,11 +476,11 @@ dump_symtab (objfile, symtab, outfile)
              if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL)
                {
                  fprintf_filtered (outfile, ", %s",
-                                   SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)));
+                               SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)));
                }
            }
-         if (BLOCK_GCC_COMPILED(b))
-           fprintf_filtered (outfile, ", compiled with gcc%d", BLOCK_GCC_COMPILED(b));
+         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 */
          for (j = 0; j < blen; j++)
@@ -537,7 +539,7 @@ Arguments missing: an output file name and an optional symbol file name");
 
   filename = tilde_expand (filename);
   make_cleanup (free, filename);
-  
+
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
     perror_with_name (filename);
@@ -545,8 +547,8 @@ Arguments missing: an output file name and an optional symbol file name");
 
   immediate_quit++;
   ALL_SYMTABS (objfile, s)
-    if (symname == NULL || (STREQ (symname, s -> filename)))
-      dump_symtab (objfile, s, outfile);
+    if (symname == NULL || (STREQ (symname, s->filename)))
+    dump_symtab (objfile, s, outfile);
   immediate_quit--;
   do_cleanups (cleanups);
 }
@@ -560,9 +562,9 @@ static int
 print_symbol (args)
      PTR args;
 {
-  struct symbol *symbol = ((struct print_symbol_args *)args)->symbol;
-  int depth = ((struct print_symbol_args *)args)->depth;
-  GDB_FILE *outfile = ((struct print_symbol_args *)args)->outfile;
+  struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
+  int depth = ((struct print_symbol_args *) args)->depth;
+  GDB_FILE *outfile = ((struct print_symbol_args *) args)->outfile;
 
   print_spaces (depth, outfile);
   if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
@@ -571,8 +573,8 @@ print_symbol (args)
       print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
       if (SYMBOL_BFD_SECTION (symbol))
        fprintf_filtered (outfile, " section %s\n",
-                         bfd_section_name (SYMBOL_BFD_SECTION (symbol)->owner,
-                                           SYMBOL_BFD_SECTION (symbol)));
+                      bfd_section_name (SYMBOL_BFD_SECTION (symbol)->owner,
+                                        SYMBOL_BFD_SECTION (symbol)));
       else
        fprintf_filtered (outfile, "\n");
       return 1;
@@ -586,11 +588,11 @@ print_symbol (args)
       else
        {
          fprintf_filtered (outfile, "%s %s = ",
-              (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
-               ? "enum"
-               : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
-                  ? "struct" : "union")),
-              SYMBOL_NAME (symbol));
+                        (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
+                         ? "enum"
+                    : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
+                       ? "struct" : "union")),
+                           SYMBOL_NAME (symbol));
          LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
        }
       fprintf_filtered (outfile, ";\n");
@@ -627,13 +629,13 @@ print_symbol (args)
                              TYPE_LENGTH (type));
            for (i = 0; i < TYPE_LENGTH (type); i++)
              fprintf_filtered (outfile, " %02x",
-                               (unsigned)SYMBOL_VALUE_BYTES (symbol) [i]);
+                               (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
          }
          break;
 
        case LOC_STATIC:
          fprintf_filtered (outfile, "static at ");
-         print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1,outfile);
+         print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
          if (SYMBOL_BFD_SECTION (symbol))
            fprintf_filtered (outfile, " section %s",
                              bfd_section_name
@@ -643,7 +645,7 @@ print_symbol (args)
 
        case LOC_INDIRECT:
          fprintf_filtered (outfile, "extern global at *(");
-         print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1,outfile);
+         print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
          fprintf_filtered (outfile, "),");
          break;
 
@@ -658,7 +660,7 @@ print_symbol (args)
 
        case LOC_LOCAL_ARG:
          fprintf_filtered (outfile, "arg at offset 0x%lx from fp",
-                  SYMBOL_VALUE (symbol));
+                           SYMBOL_VALUE (symbol));
          break;
 
        case LOC_REF_ARG:
@@ -680,12 +682,12 @@ print_symbol (args)
 
        case LOC_BASEREG:
          fprintf_filtered (outfile, "local at 0x%lx from register %d",
-                  SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
+                           SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
          break;
 
        case LOC_BASEREG_ARG:
          fprintf_filtered (outfile, "arg at 0x%lx from register %d",
-                  SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
+                           SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
          break;
 
        case LOC_TYPEDEF:
@@ -727,7 +729,7 @@ print_symbol (args)
          fprintf_filtered (outfile, "optimized out");
          break;
 
-        default:
+       default:
          fprintf_filtered (outfile, "botched symbol class %x",
                            SYMBOL_CLASS (symbol));
          break;
@@ -743,7 +745,7 @@ maintenance_print_psymbols (args, from_tty)
      int from_tty;
 {
   char **argv;
-  GDB_FILE  *outfile;
+  GDB_FILE *outfile;
   struct cleanup *cleanups;
   char *symname = NULL;
   char *filename = DEV_TTY;
@@ -774,7 +776,7 @@ maintenance_print_psymbols (args, from_tty)
 
   filename = tilde_expand (filename);
   make_cleanup (free, filename);
-  
+
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
     perror_with_name (filename);
@@ -782,8 +784,8 @@ maintenance_print_psymbols (args, from_tty)
 
   immediate_quit++;
   ALL_PSYMTABS (objfile, ps)
-    if (symname == NULL || (STREQ (symname, ps -> filename)))
-      dump_psymtab (objfile, ps, outfile);
+    if (symname == NULL || (STREQ (symname, ps->filename)))
+    dump_psymtab (objfile, ps, outfile);
   immediate_quit--;
   do_cleanups (cleanups);
 }
@@ -798,7 +800,7 @@ print_partial_symbols (p, count, what, outfile)
   fprintf_filtered (outfile, "  %s partial symbols:\n", what);
   while (count-- > 0)
     {
-      fprintf_filtered (outfile, "    `%s'", SYMBOL_NAME(*p));
+      fprintf_filtered (outfile, "    `%s'", SYMBOL_NAME (*p));
       if (SYMBOL_DEMANGLED_NAME (*p) != NULL)
        {
          fprintf_filtered (outfile, "  `%s'", SYMBOL_DEMANGLED_NAME (*p));
@@ -922,7 +924,7 @@ maintenance_print_msymbols (args, from_tty)
 
   filename = tilde_expand (filename);
   make_cleanup (free, filename);
-  
+
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
     perror_with_name (filename);
@@ -930,8 +932,8 @@ maintenance_print_msymbols (args, from_tty)
 
   immediate_quit++;
   ALL_OBJFILES (objfile)
-    if (symname == NULL || (STREQ (symname, objfile -> name)))
-      dump_msymbols (objfile, outfile);
+    if (symname == NULL || (STREQ (symname, objfile->name)))
+    dump_msymbols (objfile, outfile);
   immediate_quit--;
   fprintf_filtered (outfile, "\n\n");
   do_cleanups (cleanups);
@@ -969,76 +971,76 @@ maintenance_check_symtabs (ignore, from_tty)
   int length;
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      s = PSYMTAB_TO_SYMTAB(ps);
-      if (s == NULL)
-       continue;
-      bv = BLOCKVECTOR (s);
-      b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-      psym = ps->objfile->static_psymbols.list + ps->statics_offset;
-      length = ps->n_static_syms;
-      while (length--)
-       {
-         sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
-                                    SYMBOL_NAMESPACE (*psym));
-         if (!sym)
-           {
-             printf_filtered ("Static symbol `");
-             puts_filtered (SYMBOL_NAME (*psym));
-             printf_filtered ("' only found in ");
-             puts_filtered (ps->filename);
-             printf_filtered (" psymtab\n");
-           }
-         psym++;
-       }
-      b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-      psym = ps->objfile->global_psymbols.list + ps->globals_offset;
-      length = ps->n_global_syms;
-      while (length--)
-       {
-         sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
-                                    SYMBOL_NAMESPACE (*psym));
-         if (!sym)
-           {
-             printf_filtered ("Global symbol `");
-             puts_filtered (SYMBOL_NAME (*psym));
-             printf_filtered ("' only found in ");
-             puts_filtered (ps->filename);
-             printf_filtered (" psymtab\n");
-           }
-         psym++;
-       }
-      if (ps->texthigh < ps->textlow)
-       {
-         printf_filtered ("Psymtab ");
-         puts_filtered (ps->filename);
-         printf_filtered (" covers bad range ");
-          print_address_numeric (ps->textlow, 1, gdb_stdout);
-         printf_filtered (" - ");
-          print_address_numeric (ps->texthigh, 1, gdb_stdout);
-         printf_filtered ("\n");
-         continue;
-       }
-      if (ps->texthigh == 0)
+  {
+    s = PSYMTAB_TO_SYMTAB (ps);
+    if (s == NULL)
+      continue;
+    bv = BLOCKVECTOR (s);
+    b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+    psym = ps->objfile->static_psymbols.list + ps->statics_offset;
+    length = ps->n_static_syms;
+    while (length--)
+      {
+       sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
+                                  SYMBOL_NAMESPACE (*psym));
+       if (!sym)
+         {
+           printf_filtered ("Static symbol `");
+           puts_filtered (SYMBOL_NAME (*psym));
+           printf_filtered ("' only found in ");
+           puts_filtered (ps->filename);
+           printf_filtered (" psymtab\n");
+         }
+       psym++;
+      }
+    b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+    psym = ps->objfile->global_psymbols.list + ps->globals_offset;
+    length = ps->n_global_syms;
+    while (length--)
+      {
+       sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
+                                  SYMBOL_NAMESPACE (*psym));
+       if (!sym)
+         {
+           printf_filtered ("Global symbol `");
+           puts_filtered (SYMBOL_NAME (*psym));
+           printf_filtered ("' only found in ");
+           puts_filtered (ps->filename);
+           printf_filtered (" psymtab\n");
+         }
+       psym++;
+      }
+    if (ps->texthigh < ps->textlow)
+      {
+       printf_filtered ("Psymtab ");
+       puts_filtered (ps->filename);
+       printf_filtered (" covers bad range ");
+       print_address_numeric (ps->textlow, 1, gdb_stdout);
+       printf_filtered (" - ");
+       print_address_numeric (ps->texthigh, 1, gdb_stdout);
+       printf_filtered ("\n");
        continue;
-      if (ps->textlow < BLOCK_START (b) || ps->texthigh > BLOCK_END (b))
-       {
-         printf_filtered ("Psymtab ");
-         puts_filtered (ps->filename);
-         printf_filtered (" covers ");
-          print_address_numeric (ps->textlow, 1, gdb_stdout);
-         printf_filtered (" - ");
-          print_address_numeric (ps->texthigh, 1, gdb_stdout);
-         printf_filtered (" but symtab covers only ");
-          print_address_numeric (BLOCK_START (b), 1, gdb_stdout);
-         printf_filtered (" - ");
-          print_address_numeric (BLOCK_END (b), 1, gdb_stdout);
-         printf_filtered ("\n");
-       }
-    }
+      }
+    if (ps->texthigh == 0)
+      continue;
+    if (ps->textlow < BLOCK_START (b) || ps->texthigh > BLOCK_END (b))
+      {
+       printf_filtered ("Psymtab ");
+       puts_filtered (ps->filename);
+       printf_filtered (" covers ");
+       print_address_numeric (ps->textlow, 1, gdb_stdout);
+       printf_filtered (" - ");
+       print_address_numeric (ps->texthigh, 1, gdb_stdout);
+       printf_filtered (" but symtab covers only ");
+       print_address_numeric (BLOCK_START (b), 1, gdb_stdout);
+       printf_filtered (" - ");
+       print_address_numeric (BLOCK_END (b), 1, gdb_stdout);
+       printf_filtered ("\n");
+      }
+  }
 }
-
 \f
+
 /* Return the nexting depth of a block within other blocks in its symtab.  */
 
 static int
@@ -1046,14 +1048,14 @@ block_depth (block)
      struct block *block;
 {
   register int i = 0;
-  while ((block = BLOCK_SUPERBLOCK (block)) != NULL) 
+  while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
     {
       i++;
     }
   return i;
 }
-
 \f
+
 /* Increase the space allocated for LISTP, which is probably
    global_psymbols or static_psymbols. This space will eventually
    be freed in free_objfile().  */
@@ -1068,13 +1070,13 @@ extend_psymbol_list (listp, objfile)
     {
       new_size = 255;
       listp->list = (struct partial_symbol **)
-       xmmalloc (objfile -> md, new_size * sizeof (struct partial_symbol *));
+       xmmalloc (objfile->md, new_size * sizeof (struct partial_symbol *));
     }
   else
     {
       new_size = listp->size * 2;
       listp->list = (struct partial_symbol **)
-       xmrealloc (objfile -> md, (char *) listp->list,
+       xmrealloc (objfile->md, (char *) listp->list,
                   new_size * sizeof (struct partial_symbol *));
     }
   /* Next assumes we only went one over.  Should be good if
@@ -1088,7 +1090,7 @@ extend_psymbol_list (listp, objfile)
 void
 _initialize_symmisc ()
 {
-  std_in  = stdin;
+  std_in = stdin;
   std_out = stdout;
   std_err = stderr;
 }
index 58da78976536b7695e9203da3a520bf2c687d778..b09ccae4ba56c35d5e65674ae5f2a1629d85d40b 100644 (file)
@@ -1,22 +1,23 @@
 /* Symbol table lookup for the GNU debugger, GDB.
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -46,20 +47,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Prototype for one function in parser-defs.h,
    instead of including that entire file. */
 
-extern char * find_template_name_end PARAMS ((char *));
+extern char *find_template_name_end PARAMS ((char *));
 
 /* Prototypes for local functions */
 
 static int find_methods PARAMS ((struct type *, char *, struct symbol **));
 
-static void completion_list_add_name PARAMS ((char *, char *, int, char *, 
-                                              char *));
+static void completion_list_add_name PARAMS ((char *, char *, int, char *,
+                                             char *));
 
-static void build_canonical_line_spec PARAMS ((struct symtab_and_line *, 
-                                               char *, char ***));
+static void build_canonical_line_spec PARAMS ((struct symtab_and_line *,
+                                              char *, char ***));
 
-static struct symtabs_and_lines decode_line_2 PARAMS ((struct symbol *[], 
-                                                       int, int, char ***));
+static struct symtabs_and_lines decode_line_2 PARAMS ((struct symbol *[],
+                                                      int, int, char ***));
 
 static void rbreak_command PARAMS ((char *, int));
 
@@ -77,38 +78,38 @@ char *operator_chars PARAMS ((char *, char **));
 
 static int find_line_common PARAMS ((struct linetable *, int, int *));
 
-static struct partial_symbol *lookup_partial_symbol PARAMS 
-                                  ((struct partial_symtab *, const char *,
-                                   int, namespace_enum));
+static struct partial_symbol *lookup_partial_symbol PARAMS
+  ((struct partial_symtab *, const char *,
+    int, namespace_enum));
 
-static struct partial_symbol *fixup_psymbol_section PARAMS ((struct 
-                                        partial_symbol *, struct objfile *));
+static struct partial_symbol *fixup_psymbol_section PARAMS ((struct
+                                      partial_symbol *, struct objfile *));
 
 static struct symtab *lookup_symtab_1 PARAMS ((char *));
 
 static void cplusplus_hint PARAMS ((char *));
 
-static struct symbol *find_active_alias PARAMS ((struct symbol *sym, 
-                                                 CORE_ADDR addr));
+static struct symbol *find_active_alias PARAMS ((struct symbol * sym,
+                                                CORE_ADDR addr));
 
 /* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c */
 /* Signals the presence of objects compiled by HP compilers */
 int hp_som_som_object_present = 0;
 
-static void fixup_section PARAMS ((struct general_symbol_info *, 
-                                   struct objfile *));
+static void fixup_section PARAMS ((struct general_symbol_info *,
+                                  struct objfile *));
 
 static int file_matches PARAMS ((char *, char **, int));
 
-static void print_symbol_info PARAMS ((namespace_enum, 
-                                       struct symtab *, struct symbol *, 
-                                       int, char *));
+static void print_symbol_info PARAMS ((namespace_enum,
+                                      struct symtab *, struct symbol *,
+                                      int, char *));
 
 static void print_msymbol_info PARAMS ((struct minimal_symbol *));
 
 static void symtab_symbol_info PARAMS ((char *, namespace_enum, int));
 
-static void overload_list_add_symbol PARAMS ((struct symbol *sym,
+static void overload_list_add_symbol PARAMS ((struct symbol * sym,
                                              char *oload_name));
 
 void _initialize_symtab PARAMS ((void));
@@ -153,13 +154,13 @@ lookup_symtab_1 (name)
   register char *slash;
   register struct objfile *objfile;
 
- got_symtab:
+got_symtab:
 
   /* First, search for an exact match */
 
   ALL_SYMTABS (objfile, s)
     if (STREQ (name, s->filename))
-      return s;
+    return s;
 
   slash = strchr (name, '/');
 
@@ -167,16 +168,16 @@ lookup_symtab_1 (name)
 
   if (!slash)
     ALL_SYMTABS (objfile, s)
-      {
-       char *p = s -> filename;
-       char *tail = strrchr (p, '/');
+    {
+      char *p = s->filename;
+      char *tail = strrchr (p, '/');
 
-       if (tail)
-         p = tail + 1;
+      if (tail)
+       p = tail + 1;
 
-       if (STREQ (p, name))
-         return s;
-      }
+      if (STREQ (p, name))
+       return s;
+    }
 
   /* Same search rules as above apply here, but now we look thru the
      psymtabs.  */
@@ -185,9 +186,9 @@ lookup_symtab_1 (name)
   if (!ps)
     return (NULL);
 
-  if (ps -> readin)
+  if (ps->readin)
     error ("Internal: readin %s pst for `%s' found when no symtab found.",
-          ps -> filename, name);
+          ps->filename, name);
 
   s = PSYMTAB_TO_SYMTAB (ps);
 
@@ -218,7 +219,8 @@ lookup_symtab (name)
 #endif
 
   s = lookup_symtab_1 (name);
-  if (s) return s;
+  if (s)
+    return s;
 
 #if 0
   /* This screws c-exp.y:yylex if there is both a type "tree" and a symtab
@@ -233,7 +235,8 @@ lookup_symtab (name)
   strcpy (copy, name);
   strcat (copy, ".c");
   s = lookup_symtab_1 (copy);
-  if (s) return s;
+  if (s)
+    return s;
 #endif /* 0 */
 
   /* We didn't find anything; die.  */
@@ -246,33 +249,33 @@ lookup_symtab (name)
 
 struct partial_symtab *
 lookup_partial_symtab (name)
-char *name;
+     char *name;
 {
   register struct partial_symtab *pst;
   register struct objfile *objfile;
-  
+
   ALL_PSYMTABS (objfile, pst)
-    {
-      if (STREQ (name, pst -> filename))
-       {
-         return (pst);
-       }
-    }
+  {
+    if (STREQ (name, pst->filename))
+      {
+       return (pst);
+      }
+  }
 
   /* Now, search for a matching tail (only if name doesn't have any dirs) */
 
   if (!strchr (name, '/'))
     ALL_PSYMTABS (objfile, pst)
-      {
-       char *p = pst -> filename;
-       char *tail = strrchr (p, '/');
+    {
+      char *p = pst->filename;
+      char *tail = strrchr (p, '/');
 
-       if (tail)
-         p = tail + 1;
+      if (tail)
+       p = tail + 1;
 
-       if (STREQ (p, name))
-         return (pst);
-      }
+      if (STREQ (p, name))
+       return (pst);
+    }
 
   return (NULL);
 }
@@ -307,21 +310,21 @@ gdb_mangle_name (type, method_id, signature_id)
   char buf[20];
   int len = (newname == NULL ? 0 : strlen (newname));
 
-  is_full_physname_constructor = 
-    ((physname[0]=='_' && physname[1]=='_' && 
-      (isdigit(physname[2]) || physname[2]=='Q' || physname[2]=='t'))
-     || (strncmp(physname, "__ct", 4) == 0));
+  is_full_physname_constructor =
+    ((physname[0] == '_' && physname[1] == '_' &&
+      (isdigit (physname[2]) || physname[2] == 'Q' || physname[2] == 't'))
+     || (strncmp (physname, "__ct", 4) == 0));
 
   is_constructor =
-    is_full_physname_constructor || (newname && STREQ(field_name, newname));
+    is_full_physname_constructor || (newname && STREQ (field_name, newname));
 
   if (!is_destructor)
-    is_destructor = (strncmp(physname, "__dt", 4) == 0); 
+    is_destructor = (strncmp (physname, "__dt", 4) == 0);
 
   if (is_destructor || is_full_physname_constructor)
     {
-      mangled_name = (char*) xmalloc(strlen(physname)+1);
-      strcpy(mangled_name, physname);
+      mangled_name = (char *) xmalloc (strlen (physname) + 1);
+      strcpy (mangled_name, physname);
       return mangled_name;
     }
 
@@ -332,7 +335,7 @@ gdb_mangle_name (type, method_id, signature_id)
   else if (physname[0] == 't' || physname[0] == 'Q')
     {
       /* The physname for template and qualified methods already includes
-        the class name.  */
+         the class name.  */
       sprintf (buf, "__%s%s", const_prefix, volatile_prefix);
       newname = NULL;
       len = 0;
@@ -342,9 +345,9 @@ gdb_mangle_name (type, method_id, signature_id)
       sprintf (buf, "__%s%s%d", const_prefix, volatile_prefix, len);
     }
   mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
-                         + strlen (buf) + len
-                         + strlen (physname)
-                         + 1);
+                     + strlen (buf) + len
+                     + strlen (physname)
+                     + 1);
 
   /* Only needed for GNU-mangled names.  ANSI-mangled names
      work with the normal mechanisms.  */
@@ -354,7 +357,7 @@ gdb_mangle_name (type, method_id, signature_id)
       if (opname == NULL)
        error ("No mangling for \"%s\"", field_name);
       mangled_name_len += strlen (opname);
-      mangled_name = (char *)xmalloc (mangled_name_len);
+      mangled_name = (char *) xmalloc (mangled_name_len);
 
       strncpy (mangled_name, field_name, 3);
       mangled_name[3] = '\0';
@@ -362,7 +365,7 @@ gdb_mangle_name (type, method_id, signature_id)
     }
   else
     {
-      mangled_name = (char *)xmalloc (mangled_name_len);
+      mangled_name = (char *) xmalloc (mangled_name_len);
       if (is_constructor)
        mangled_name[0] = '\0';
       else
@@ -371,16 +374,16 @@ gdb_mangle_name (type, method_id, signature_id)
   strcat (mangled_name, buf);
   /* If the class doesn't have a name, i.e. newname NULL, then we just
      mangle it using 0 for the length of the class.  Thus it gets mangled
-     as something starting with `::' rather than `classname::'. */ 
+     as something starting with `::' rather than `classname::'. */
   if (newname != NULL)
     strcat (mangled_name, newname);
 
   strcat (mangled_name, physname);
   return (mangled_name);
 }
-
 \f
 
+
 /* Find which partial symtab on contains PC and SECTION.  Return 0 if none.  */
 
 struct partial_symtab *
@@ -392,48 +395,48 @@ find_pc_sect_psymtab (pc, section)
   register struct objfile *objfile;
 
   ALL_PSYMTABS (objfile, pst)
-    {
+  {
 #if defined(HPUXHPPA)
-      if (pc >= pst->textlow && pc <= pst->texthigh)
+    if (pc >= pst->textlow && pc <= pst->texthigh)
 #else
-      if (pc >= pst->textlow && pc < pst->texthigh)
+    if (pc >= pst->textlow && pc < pst->texthigh)
 #endif
-       {
-         struct minimal_symbol *msymbol;
-         struct partial_symtab *tpst;
-
-         /* An objfile that has its functions reordered might have
-            many partial symbol tables containing the PC, but
-            we want the partial symbol table that contains the
-            function containing the PC.  */
-         if (!(objfile->flags & OBJF_REORDERED) &&
-             section == 0)     /* can't validate section this way */
-           return (pst);
-
-         msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
-         if (msymbol == NULL)
-           return (pst);
-
-         for (tpst = pst; tpst != NULL; tpst = tpst->next)
-           {
+      {
+       struct minimal_symbol *msymbol;
+       struct partial_symtab *tpst;
+
+       /* An objfile that has its functions reordered might have
+          many partial symbol tables containing the PC, but
+          we want the partial symbol table that contains the
+          function containing the PC.  */
+       if (!(objfile->flags & OBJF_REORDERED) &&
+           section == 0)       /* can't validate section this way */
+         return (pst);
+
+       msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
+       if (msymbol == NULL)
+         return (pst);
+
+       for (tpst = pst; tpst != NULL; tpst = tpst->next)
+         {
 #if defined(HPUXHPPA)
-             if (pc >= tpst->textlow && pc <= tpst->texthigh)
+           if (pc >= tpst->textlow && pc <= tpst->texthigh)
 #else
-             if (pc >= tpst->textlow && pc < tpst->texthigh)
+           if (pc >= tpst->textlow && pc < tpst->texthigh)
 #endif
-               {
-                 struct partial_symbol *p;
+             {
+               struct partial_symbol *p;
 
-                 p = find_pc_sect_psymbol (tpst, pc, section);
-                 if (p != NULL
-                     && SYMBOL_VALUE_ADDRESS(p)
-                        == SYMBOL_VALUE_ADDRESS (msymbol))
-                   return (tpst);
-               }
-           }
-         return (pst);
-       }
-    }
+               p = find_pc_sect_psymbol (tpst, pc, section);
+               if (p != NULL
+                   && SYMBOL_VALUE_ADDRESS (p)
+                   == SYMBOL_VALUE_ADDRESS (msymbol))
+                 return (tpst);
+             }
+         }
+       return (pst);
+      }
+  }
   return (NULL);
 }
 
@@ -458,7 +461,7 @@ find_pc_sect_psymbol (psymtab, pc, section)
 {
   struct partial_symbol *best = NULL, *p, **pp;
   CORE_ADDR best_pc;
-  
+
   if (!psymtab)
     psymtab = find_pc_sect_psymtab (pc, section);
   if (!psymtab)
@@ -471,8 +474,8 @@ find_pc_sect_psymbol (psymtab, pc, section)
      find_pc_partial_function doesn't use a minimal symbol and thus
      cache a bad endaddr.  */
   for (pp = psymtab->objfile->global_psymbols.list + psymtab->globals_offset;
-       (pp - (psymtab->objfile->global_psymbols.list + psymtab->globals_offset)
-       < psymtab->n_global_syms);
+    (pp - (psymtab->objfile->global_psymbols.list + psymtab->globals_offset)
+     < psymtab->n_global_syms);
        pp++)
     {
       p = *pp;
@@ -483,7 +486,7 @@ find_pc_sect_psymbol (psymtab, pc, section)
              || (psymtab->textlow == 0
                  && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
        {
-         if (section)  /* match on a specific section */
+         if (section)          /* match on a specific section */
            {
              fixup_psymbol_section (p, psymtab->objfile);
              if (SYMBOL_BFD_SECTION (p) != section)
@@ -495,8 +498,8 @@ find_pc_sect_psymbol (psymtab, pc, section)
     }
 
   for (pp = psymtab->objfile->static_psymbols.list + psymtab->statics_offset;
-       (pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset)
-       < psymtab->n_static_syms);
+    (pp - (psymtab->objfile->static_psymbols.list + psymtab->statics_offset)
+     < psymtab->n_static_syms);
        pp++)
     {
       p = *pp;
@@ -504,10 +507,10 @@ find_pc_sect_psymbol (psymtab, pc, section)
          && SYMBOL_CLASS (p) == LOC_BLOCK
          && pc >= SYMBOL_VALUE_ADDRESS (p)
          && (SYMBOL_VALUE_ADDRESS (p) > best_pc
-             || (psymtab->textlow == 0 
+             || (psymtab->textlow == 0
                  && best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
        {
-         if (section)  /* match on a specific section */
+         if (section)          /* match on a specific section */
            {
              fixup_psymbol_section (p, psymtab->objfile);
              if (SYMBOL_BFD_SECTION (p) != section)
@@ -621,22 +624,22 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
   while (block != 0)
     {
       sym = lookup_block_symbol (block, name, namespace);
-      if (sym) 
+      if (sym)
        {
          block_found = block;
          if (symtab != NULL)
            {
              /* Search the list of symtabs for one which contains the
-                address of the start of this block.  */
+                address of the start of this block.  */
              ALL_SYMTABS (objfile, s)
-               {
-                 bv = BLOCKVECTOR (s);
-                 b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-                 if (BLOCK_START (b) <= BLOCK_START (block)
-                     && BLOCK_END (b) > BLOCK_START (block))
-                   goto found;
-               }
-found:
+             {
+               bv = BLOCKVECTOR (s);
+               b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+               if (BLOCK_START (b) <= BLOCK_START (block)
+                   && BLOCK_END (b) > BLOCK_START (block))
+                 goto found;
+             }
+           found:
              *symtab = s;
            }
 
@@ -667,22 +670,22 @@ found:
       struct block *b;
       /* Find the right symtab.  */
       ALL_SYMTABS (objfile, s)
-       {
-         bv = BLOCKVECTOR (s);
-         b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-         if (BLOCK_START (b) <= BLOCK_START (block)
-             && BLOCK_END (b) > BLOCK_START (block))
-           {
-             sym = lookup_block_symbol (b, name, VAR_NAMESPACE);
-             if (sym)
-               {
-                 block_found = b;
-                 if (symtab != NULL)
-                   *symtab = s;
-                 return fixup_symbol_section (sym, objfile);
-               }
-           }
-       }
+      {
+       bv = BLOCKVECTOR (s);
+       b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+       if (BLOCK_START (b) <= BLOCK_START (block)
+           && BLOCK_END (b) > BLOCK_START (block))
+         {
+           sym = lookup_block_symbol (b, name, VAR_NAMESPACE);
+           if (sym)
+             {
+               block_found = b;
+               if (symtab != NULL)
+                 *symtab = s;
+               return fixup_symbol_section (sym, objfile);
+             }
+         }
+      }
     }
 
 
@@ -691,7 +694,7 @@ found:
   if (is_a_field_of_this)
     {
       struct value *v = value_of_this (0);
-      
+
       *is_a_field_of_this = 0;
       if (v && check_field (v, name))
        {
@@ -706,34 +709,34 @@ found:
      check the psymtab's. If a psymtab indicates the existence
      of the desired name as a global, then do psymtab-to-symtab
      conversion on the fly and return the found symbol. */
-  
+
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-      sym = lookup_block_symbol (block, name, namespace);
-      if (sym) 
-       {
-         block_found = block;
-         if (symtab != NULL)
-           *symtab = s;
-         return fixup_symbol_section (sym, objfile);
-       }
-    }
+  {
+    bv = BLOCKVECTOR (s);
+    block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+    sym = lookup_block_symbol (block, name, namespace);
+    if (sym)
+      {
+       block_found = block;
+       if (symtab != NULL)
+         *symtab = s;
+       return fixup_symbol_section (sym, objfile);
+      }
+  }
 
 #ifndef HPUXHPPA
 
   /* Check for the possibility of the symbol being a function or
      a mangled variable that is stored in one of the minimal symbol tables.
      Eventually, all global symbols might be resolved in this way.  */
-  
+
   if (namespace == VAR_NAMESPACE)
     {
       msymbol = lookup_minimal_symbol (name, NULL, NULL);
       if (msymbol != NULL)
        {
          s = find_pc_sect_symtab (SYMBOL_VALUE_ADDRESS (msymbol),
-                                 SYMBOL_BFD_SECTION (msymbol));
+                                  SYMBOL_BFD_SECTION (msymbol));
          if (s != NULL)
            {
              /* This is a function which has a symtab for its address.  */
@@ -741,26 +744,27 @@ found:
              block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
              sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
                                         namespace);
-              /* We kept static functions in minimal symbol table as well as
-                in static scope. We want to find them in the symbol table. */
-               if (!sym) {
+             /* We kept static functions in minimal symbol table as well as
+                in static scope. We want to find them in the symbol table. */
+             if (!sym)
+               {
                  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
                  sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
                                             namespace);
                }
 
              /* sym == 0 if symbol was found in the minimal symbol table
-                but not in the symtab.
-                Return 0 to use the msymbol definition of "foo_".
+                but not in the symtab.
+                Return 0 to use the msymbol definition of "foo_".
 
-                This happens for Fortran  "foo_" symbols,
-                which are "foo" in the symtab.
+                This happens for Fortran  "foo_" symbols,
+                which are "foo" in the symtab.
 
-                This can also happen if "asm" is used to make a
-                regular symbol but not a debugging symbol, e.g.
-                asm(".globl _main");
-                asm("_main:");
-                */
+                This can also happen if "asm" is used to make a
+                regular symbol but not a debugging symbol, e.g.
+                asm(".globl _main");
+                asm("_main:");
+              */
 
              if (symtab != NULL)
                *symtab = s;
@@ -771,8 +775,8 @@ found:
                   && !STREQ (name, SYMBOL_NAME (msymbol)))
            {
              /* This is a mangled variable, look it up by its
-                mangled name.  */
-             return lookup_symbol (SYMBOL_NAME (msymbol), block, 
+                mangled name.  */
+             return lookup_symbol (SYMBOL_NAME (msymbol), block,
                                    namespace, is_a_field_of_this, symtab);
            }
          /* There are no debug symbols for this file, or we are looking
@@ -780,37 +784,37 @@ found:
             Try to find a matching static symbol below. */
        }
     }
-      
+
 #endif
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      if (!ps->readin && lookup_partial_symbol (ps, name, 1, namespace))
-       {
-         s = PSYMTAB_TO_SYMTAB(ps);
-         bv = BLOCKVECTOR (s);
-         block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-         sym = lookup_block_symbol (block, name, namespace);
-         if (!sym)
-            {
-              /* This shouldn't be necessary, but as a last resort
-               * try looking in the statics even though the psymtab
-               * claimed the symbol was global. It's possible that
-               * the psymtab gets it wrong in some cases.
-               */
-             block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-             sym = lookup_block_symbol (block, name, namespace);
-              if (!sym)
-               error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
+  {
+    if (!ps->readin && lookup_partial_symbol (ps, name, 1, namespace))
+      {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+       sym = lookup_block_symbol (block, name, namespace);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+            * try looking in the statics even though the psymtab
+            * claimed the symbol was global. It's possible that
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+           sym = lookup_block_symbol (block, name, namespace);
+           if (!sym)
+             error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
 %s may be an inlined function, or may be a template function\n\
 (if a template, try specifying an instantiation: %s<type>).",
-                       name, ps->filename, name, name);
-            }
-         if (symtab != NULL)
-           *symtab = s;
-         return fixup_symbol_section (sym, objfile);
-       }
-    }
+                    name, ps->filename, name, name);
+         }
+       if (symtab != NULL)
+         *symtab = s;
+       return fixup_symbol_section (sym, objfile);
+      }
+  }
 
   /* Now search all static file-level symbols.
      Not strictly correct, but more useful than an error.
@@ -820,47 +824,47 @@ found:
      conversion on the fly and return the found symbol. */
 
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-      sym = lookup_block_symbol (block, name, namespace);
-      if (sym) 
-       {
-         block_found = block;
-         if (symtab != NULL)
-           *symtab = s;
-         return fixup_symbol_section (sym, objfile);
-       }
-    }
+  {
+    bv = BLOCKVECTOR (s);
+    block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+    sym = lookup_block_symbol (block, name, namespace);
+    if (sym)
+      {
+       block_found = block;
+       if (symtab != NULL)
+         *symtab = s;
+       return fixup_symbol_section (sym, objfile);
+      }
+  }
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      if (!ps->readin && lookup_partial_symbol (ps, name, 0, namespace))
-       {
-         s = PSYMTAB_TO_SYMTAB(ps);
-         bv = BLOCKVECTOR (s);
-         block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-         sym = lookup_block_symbol (block, name, namespace);
-         if (!sym)
-            {
-              /* This shouldn't be necessary, but as a last resort
-               * try looking in the globals even though the psymtab
-               * claimed the symbol was static. It's possible that
-               * the psymtab gets it wrong in some cases.
-               */
-             block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-             sym = lookup_block_symbol (block, name, namespace);
-              if (!sym)
-                error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
+  {
+    if (!ps->readin && lookup_partial_symbol (ps, name, 0, namespace))
+      {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+       sym = lookup_block_symbol (block, name, namespace);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+            * try looking in the globals even though the psymtab
+            * claimed the symbol was static. It's possible that
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+           sym = lookup_block_symbol (block, name, namespace);
+           if (!sym)
+             error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
 %s may be an inlined function, or may be a template function\n\
 (if a template, try specifying an instantiation: %s<type>).",
-                       name, ps->filename, name, name);
-            }
-         if (symtab != NULL)
-           *symtab = s;
-         return fixup_symbol_section (sym, objfile);
-       }
-    }
+                    name, ps->filename, name, name);
+         }
+       if (symtab != NULL)
+         *symtab = s;
+       return fixup_symbol_section (sym, objfile);
+      }
+  }
 
 #ifdef HPUXHPPA
 
@@ -878,28 +882,28 @@ found:
      though... is it saying we need to do the "minsym" check before
      the static check in this case? 
    */
-  
+
   if (namespace == VAR_NAMESPACE)
     {
       msymbol = lookup_minimal_symbol (name, NULL, NULL);
       if (msymbol != NULL)
        {
-          /* OK, we found a minimal symbol in spite of not
-           * finding any symbol. There are various possible
-           * explanations for this. One possibility is the symbol
-           * exists in code not compiled -g. Another possibility
-           * is that the 'psymtab' isn't doing its job.
-           * A third possibility, related to #2, is that we were confused 
-           * by name-mangling. For instance, maybe the psymtab isn't
-           * doing its job because it only know about demangled
-           * names, but we were given a mangled name...
-           */
-
-          /* We first use the address in the msymbol to try to
-           * locate the appropriate symtab. Note that find_pc_symtab()
-           * has a side-effect of doing psymtab-to-symtab expansion,
-           * for the found symtab.
-           */
+         /* OK, we found a minimal symbol in spite of not
+          * finding any symbol. There are various possible
+          * explanations for this. One possibility is the symbol
+          * exists in code not compiled -g. Another possibility
+          * is that the 'psymtab' isn't doing its job.
+          * A third possibility, related to #2, is that we were confused 
+          * by name-mangling. For instance, maybe the psymtab isn't
+          * doing its job because it only know about demangled
+          * names, but we were given a mangled name...
+          */
+
+         /* We first use the address in the msymbol to try to
+          * locate the appropriate symtab. Note that find_pc_symtab()
+          * has a side-effect of doing psymtab-to-symtab expansion,
+          * for the found symtab.
+          */
          s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol));
          if (s != NULL)
            {
@@ -907,44 +911,45 @@ found:
              block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
              sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
                                         namespace);
-              /* We kept static functions in minimal symbol table as well as
-                in static scope. We want to find them in the symbol table. */
-             if (!sym) 
-                {
+             /* We kept static functions in minimal symbol table as well as
+                in static scope. We want to find them in the symbol table. */
+             if (!sym)
+               {
                  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
                  sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
                                             namespace);
                }
-              /* If we found one, return it */
-              if (sym) {
-               if (symtab != NULL)
-                 *symtab = s;
-               return sym;
-              }
+             /* If we found one, return it */
+             if (sym)
+               {
+                 if (symtab != NULL)
+                   *symtab = s;
+                 return sym;
+               }
 
              /* If we get here with sym == 0, the symbol was 
-                 found in the minimal symbol table
-                but not in the symtab.
-                Fall through and return 0 to use the msymbol 
-                 definition of "foo_".
-                 (Note that outer code generally follows up a call
-                  to this routine with a call to lookup_minimal_symbol(),
-                  so a 0 return means we'll just flow into that other routine).
-
-                This happens for Fortran  "foo_" symbols,
-                which are "foo" in the symtab.
-
-                This can also happen if "asm" is used to make a
-                regular symbol but not a debugging symbol, e.g.
-                asm(".globl _main");
-                asm("_main:");
-                */
+                found in the minimal symbol table
+                but not in the symtab.
+                Fall through and return 0 to use the msymbol 
+                definition of "foo_".
+                (Note that outer code generally follows up a call
+                to this routine with a call to lookup_minimal_symbol(),
+                so a 0 return means we'll just flow into that other routine).
+
+                This happens for Fortran  "foo_" symbols,
+                which are "foo" in the symtab.
+
+                This can also happen if "asm" is used to make a
+                regular symbol but not a debugging symbol, e.g.
+                asm(".globl _main");
+                asm("_main:");
+              */
            }
 
-          /* If the lookup-by-address fails, try repeating the
-           * entire lookup process with the symbol name from
-           * the msymbol (if different from the original symbol name).
-           */
+         /* If the lookup-by-address fails, try repeating the
+          * entire lookup process with the symbol name from
+          * the msymbol (if different from the original symbol name).
+          */
          else if (MSYMBOL_TYPE (msymbol) != mst_text
                   && MSYMBOL_TYPE (msymbol) != mst_file_text
                   && !STREQ (name, SYMBOL_NAME (msymbol)))
@@ -981,19 +986,19 @@ lookup_partial_symbol (pst, name, global, namespace)
     {
       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 (global)          /* This means we can use a binary search. */
+  if (global)                  /* This means we can use a binary search. */
     {
       do_linear_search = 0;
 
       /* Binary search.  This search is guaranteed to end with center
          pointing at the earliest partial symbol with the correct
-        name.  At that point *all* partial symbols with that name
-        will be checked against the correct namespace. */
+         name.  At that point *all* partial symbols with that name
+         will be checked against the correct namespace. */
 
       bottom = start;
       top = start + length - 1;
@@ -1005,7 +1010,7 @@ lookup_partial_symbol (pst, name, global, namespace)
          if (!do_linear_search
              && (SYMBOL_LANGUAGE (*center) == language_cplus
                  || SYMBOL_LANGUAGE (*center) == language_java
-                 ))
+             ))
            {
              do_linear_search = 1;
            }
@@ -1026,7 +1031,7 @@ lookup_partial_symbol (pst, name, global, namespace)
            {
              return (*top);
            }
-         top ++;
+         top++;
        }
     }
 
@@ -1074,45 +1079,45 @@ lookup_transparent_type (name)
      check the psymtab's. If a psymtab indicates the existence
      of the desired name as a global, then do psymtab-to-symtab
      conversion on the fly and return the found symbol.  */
-  
+
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-      sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-      if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
-       {
-         return SYMBOL_TYPE (sym);
-       }
-    }
+  {
+    bv = BLOCKVECTOR (s);
+    block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+    sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+    if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+      {
+       return SYMBOL_TYPE (sym);
+      }
+  }
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_NAMESPACE))
-       {
-         s = PSYMTAB_TO_SYMTAB(ps);
-         bv = BLOCKVECTOR (s);
-         block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-         sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-         if (!sym) 
-            {
-              /* This shouldn't be necessary, but as a last resort
-               * try looking in the statics even though the psymtab
-               * claimed the symbol was global. It's possible that
-               * the psymtab gets it wrong in some cases.
-               */
-             block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-             sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-              if (!sym)
-                error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
+  {
+    if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_NAMESPACE))
+      {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+       sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+            * try looking in the statics even though the psymtab
+            * claimed the symbol was global. It's possible that
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+           sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+           if (!sym)
+             error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
 %s may be an inlined function, or may be a template function\n\
 (if a template, try specifying an instantiation: %s<type>).",
-                       name, ps->filename, name, name);
-            }
-          if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
-            return SYMBOL_TYPE (sym);
-       }
-    }
+                    name, ps->filename, name, name);
+         }
+       if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+         return SYMBOL_TYPE (sym);
+      }
+  }
 
   /* Now search the static file-level symbols.
      Not strictly correct, but more useful than an error.
@@ -1123,43 +1128,43 @@ lookup_transparent_type (name)
    */
 
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-      sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-      if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
-       {
-         return SYMBOL_TYPE (sym);
-       }
-    }
+  {
+    bv = BLOCKVECTOR (s);
+    block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+    sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+    if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+      {
+       return SYMBOL_TYPE (sym);
+      }
+  }
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_NAMESPACE))
-       {
-         s = PSYMTAB_TO_SYMTAB(ps);
-         bv = BLOCKVECTOR (s);
-         block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-         sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-         if (!sym)
-            {
-              /* This shouldn't be necessary, but as a last resort
-               * try looking in the globals even though the psymtab
-               * claimed the symbol was static. It's possible that
-               * the psymtab gets it wrong in some cases.
-               */
-             block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-             sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
-              if (!sym)
-               error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
+  {
+    if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_NAMESPACE))
+      {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+       sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+            * try looking in the globals even though the psymtab
+            * claimed the symbol was static. It's possible that
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+           sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+           if (!sym)
+             error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
 %s may be an inlined function, or may be a template function\n\
 (if a template, try specifying an instantiation: %s<type>).",
-                       name, ps->filename, name, name);
-            }
-          if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
-            return SYMBOL_TYPE (sym);
-       }
-    }
+                    name, ps->filename, name, name);
+         }
+       if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+         return SYMBOL_TYPE (sym);
+      }
+  }
   return (struct type *) 0;
 }
 
@@ -1175,12 +1180,12 @@ find_main_psymtab ()
   register struct objfile *objfile;
 
   ALL_PSYMTABS (objfile, pst)
-    {
-      if (lookup_partial_symbol (pst, "main", 1, VAR_NAMESPACE))
-       {
-         return (pst);
-       }
-    }
+  {
+    if (lookup_partial_symbol (pst, "main", 1, VAR_NAMESPACE))
+      {
+       return (pst);
+      }
+  }
   return (NULL);
 }
 
@@ -1211,10 +1216,10 @@ lookup_block_symbol (block, name, namespace)
   if (BLOCK_SHOULD_SORT (block))
     {
       /* Reset the linear search flag so if the binary search fails, we
-        won't do the linear search once unless we find some reason to
-        do so, such as finding a C++ symbol during the binary search.
-        Note that for C++ modules, ALL the symbols in a block should
-        end up marked as C++ symbols. */
+         won't do the linear search once unless we find some reason to
+         do so, such as finding a C++ symbol during the binary search.
+         Note that for C++ modules, ALL the symbols in a block should
+         end up marked as C++ symbols. */
 
       do_linear_search = 0;
       top = BLOCK_NSYMS (block);
@@ -1235,7 +1240,7 @@ lookup_block_symbol (block, name, namespace)
          if (!do_linear_search
              && (SYMBOL_LANGUAGE (sym) == language_cplus
                  || SYMBOL_LANGUAGE (sym) == language_java
-                 ))
+             ))
            {
              do_linear_search = 1;
            }
@@ -1258,12 +1263,12 @@ lookup_block_symbol (block, name, namespace)
        }
 
       /* Now scan forward until we run out of symbols, find one whose
-        name is greater than NAME, or find one we want.  If there is
-        more than one symbol with the right name and namespace, we
-        return the first one; I believe it is now impossible for us
-        to encounter two symbols with the same name and namespace
-        here, because blocks containing argument symbols are no
-        longer sorted.  */
+         name is greater than NAME, or find one we want.  If there is
+         more than one symbol with the right name and namespace, we
+         return the first one; I believe it is now impossible for us
+         to encounter two symbols with the same name and namespace
+         here, because blocks containing argument symbols are no
+         longer sorted.  */
 
       top = BLOCK_NSYMS (block);
       while (bot < top)
@@ -1310,13 +1315,13 @@ lookup_block_symbol (block, name, namespace)
              SYMBOL_MATCHES_NAME (sym, name))
            {
              /* If SYM has aliases, then use any alias that is active
-                at the current PC.  If no alias is active at the current
-                PC, then use the main symbol.
+                at the current PC.  If no alias is active at the current
+                PC, then use the main symbol.
 
-                ?!? Is checking the current pc correct?  Is this routine
-                ever called to look up a symbol from another context?  */
-              if (SYMBOL_ALIASES (sym))
-                sym = find_active_alias (sym, read_pc ());
+                ?!? Is checking the current pc correct?  Is this routine
+                ever called to look up a symbol from another context?  */
+             if (SYMBOL_ALIASES (sym))
+               sym = find_active_alias (sym, read_pc ());
 
              sym_found = sym;
              if (SYMBOL_CLASS (sym) != LOC_ARG &&
@@ -1343,8 +1348,8 @@ lookup_block_symbol (block, name, namespace)
 
 static struct symbol *
 find_active_alias (sym, addr)
-  struct symbol *sym;
-  CORE_ADDR addr;
+     struct symbol *sym;
+     CORE_ADDR addr;
 {
   struct range_list *r;
   struct alias_list *aliases;
@@ -1355,7 +1360,7 @@ find_active_alias (sym, addr)
   while (aliases)
     {
       if (!SYMBOL_RANGES (aliases->sym))
-        return aliases->sym;
+       return aliases->sym;
       for (r = SYMBOL_RANGES (aliases->sym); r; r = r->next)
        {
          if (r->start <= addr && r->end > addr)
@@ -1367,8 +1372,8 @@ find_active_alias (sym, addr)
   /* Nothing found, return the main symbol.  */
   return sym;
 }
-
 \f
+
 /* Return the symbol for the function which contains a specified
    lexical block, described by a struct block BL.  */
 
@@ -1414,51 +1419,51 @@ find_pc_sect_symtab (pc, section)
      For these, the symtab we are looking for is not necessarily read in.  */
 
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+  {
+    bv = BLOCKVECTOR (s);
+    b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
 
-      if (BLOCK_START (b) <= pc
+    if (BLOCK_START (b) <= pc
 #if defined(HPUXHPPA)
-         && BLOCK_END (b) >= pc
+       && BLOCK_END (b) >= pc
 #else
-         && BLOCK_END (b) > pc
+       && BLOCK_END (b) > pc
 #endif
-         && (distance == 0
-             || BLOCK_END (b) - BLOCK_START (b) < distance))
-       {
-         /* For an objfile that has its functions reordered,
-            find_pc_psymtab will find the proper partial symbol table
-            and we simply return its corresponding symtab.  */
-         /* In order to better support objfiles that contain both
-            stabs and coff debugging info, we continue on if a psymtab
-            can't be found. */
-         if ((objfile->flags & OBJF_REORDERED) && objfile->psymtabs)
-           {
-             ps = find_pc_sect_psymtab (pc, section);
-             if (ps)
-               return PSYMTAB_TO_SYMTAB (ps);
-           }
-         if (section != 0)
-           {
-             int i;
+       && (distance == 0
+           || BLOCK_END (b) - BLOCK_START (b) < distance))
+      {
+       /* For an objfile that has its functions reordered,
+          find_pc_psymtab will find the proper partial symbol table
+          and we simply return its corresponding symtab.  */
+       /* In order to better support objfiles that contain both
+          stabs and coff debugging info, we continue on if a psymtab
+          can't be found. */
+       if ((objfile->flags & OBJF_REORDERED) && objfile->psymtabs)
+         {
+           ps = find_pc_sect_psymtab (pc, section);
+           if (ps)
+             return PSYMTAB_TO_SYMTAB (ps);
+         }
+       if (section != 0)
+         {
+           int i;
 
-             for (i = 0; i < b->nsyms; i++)
-               {
-                 fixup_symbol_section (b->sym[i], objfile);
-                 if (section == SYMBOL_BFD_SECTION (b->sym[i]))
-                   break;
-               }
-             if (i >= b->nsyms)
-               continue;       /* no symbol in this symtab matches section */
-           }
-         distance = BLOCK_END (b) - BLOCK_START (b);
-         best_s = s;
-       }
-    }
+           for (i = 0; i < b->nsyms; i++)
+             {
+               fixup_symbol_section (b->sym[i], objfile);
+               if (section == SYMBOL_BFD_SECTION (b->sym[i]))
+                 break;
+             }
+           if (i >= b->nsyms)
+             continue;         /* no symbol in this symtab matches section */
+         }
+       distance = BLOCK_END (b) - BLOCK_START (b);
+       best_s = s;
+      }
+  }
 
   if (best_s != NULL)
-    return(best_s);
+    return (best_s);
 
   s = NULL;
   ps = find_pc_sect_psymtab (pc, section);
@@ -1471,7 +1476,7 @@ find_pc_sect_symtab (pc, section)
        /* FIXME-32x64: assumes pc fits in a long */
        warning ("\
 (Internal error: pc 0x%lx in read in psymtab, but not in symtab.)\n",
-                (unsigned long) pc);
+                (unsigned long) pc);
       s = PSYMTAB_TO_SYMTAB (ps);
     }
   return (s);
@@ -1486,8 +1491,8 @@ find_pc_symtab (pc)
 {
   return find_pc_sect_symtab (pc, find_pc_mapped_section (pc));
 }
-
 \f
+
 #if 0
 
 /* Find the closest symbol value (of any sort -- function or variable)
@@ -1518,61 +1523,61 @@ find_addr_symbol (addr, symtabp, symaddrp)
 
   /* FIXME -- we should pull in all the psymtabs, too!  */
   ALL_SYMTABS (objfile, symtab)
-    {
-      /* Search the global and static blocks in this symtab for
-        the closest symbol-address to the desired address.  */
+  {
+    /* Search the global and static blocks in this symtab for
+       the closest symbol-address to the desired address.  */
 
-      for (blocknum = GLOBAL_BLOCK; blocknum <= STATIC_BLOCK; blocknum++)
-       {
-         QUIT;
-         block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), blocknum);
-         top = BLOCK_NSYMS (block);
-         for (bot = 0; bot < top; bot++)
-           {
-             sym = BLOCK_SYM (block, bot);
-             switch (SYMBOL_CLASS (sym))
-               {
-               case LOC_STATIC:        
-               case LOC_LABEL: 
-                 sym_addr = SYMBOL_VALUE_ADDRESS (sym);
-                 break;
+    for (blocknum = GLOBAL_BLOCK; blocknum <= STATIC_BLOCK; blocknum++)
+      {
+       QUIT;
+       block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), blocknum);
+       top = BLOCK_NSYMS (block);
+       for (bot = 0; bot < top; bot++)
+         {
+           sym = BLOCK_SYM (block, bot);
+           switch (SYMBOL_CLASS (sym))
+             {
+             case LOC_STATIC:
+             case LOC_LABEL:
+               sym_addr = SYMBOL_VALUE_ADDRESS (sym);
+               break;
+
+             case LOC_INDIRECT:
+               sym_addr = SYMBOL_VALUE_ADDRESS (sym);
+               /* An indirect symbol really lives at *sym_addr,
+                * so an indirection needs to be done.
+                * However, I am leaving this commented out because it's
+                * expensive, and it's possible that symbolization
+                * could be done without an active process (in
+                * case this read_memory will fail). RT
+                sym_addr = read_memory_unsigned_integer
+                (sym_addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+                */
+               break;
 
-                case LOC_INDIRECT:
-                 sym_addr = SYMBOL_VALUE_ADDRESS (sym);
-                  /* An indirect symbol really lives at *sym_addr,
-                   * so an indirection needs to be done.
-                   * However, I am leaving this commented out because it's
-                   * expensive, and it's possible that symbolization
-                   * could be done without an active process (in
-                   * case this read_memory will fail). RT
-                  sym_addr = read_memory_unsigned_integer
-                      (sym_addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-                   */
-                  break;
-
-               case LOC_BLOCK:
-                 sym_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
-                 break;
+             case LOC_BLOCK:
+               sym_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
+               break;
 
-               default:
-                 continue;
-               }
+             default:
+               continue;
+             }
 
-               if (sym_addr <= addr)
-                 if (sym_addr > best_sym_addr)
-                   {
-                     /* Quit if we found an exact match.  */
-                     best_sym = sym;
-                     best_sym_addr = sym_addr;
-                     best_symtab = symtab;
-                     if (sym_addr == addr)
-                       goto done;
-                   }
-           }
-       }
-    }
+           if (sym_addr <= addr)
+             if (sym_addr > best_sym_addr)
+               {
+                 /* Quit if we found an exact match.  */
+                 best_sym = sym;
+                 best_sym_addr = sym_addr;
+                 best_symtab = symtab;
+                 if (sym_addr == addr)
+                   goto done;
+               }
+         }
+      }
+  }
 
- done:
+done:
   if (symtabp)
     *symtabp = best_symtab;
   if (symaddrp)
@@ -1638,19 +1643,19 @@ find_pc_sect_line (pc, section, notcurrent)
      But what we want is the statement containing the instruction.
      Fudge the pc to make sure we get that.  */
 
-  INIT_SAL (&val);     /* initialize to zeroes */
+  INIT_SAL (&val);             /* initialize to zeroes */
 
   if (notcurrent)
     pc -= 1;
 
- /* elz: added this because this function returned the wrong
 /* elz: added this because this function returned the wrong
      information if the pc belongs to a stub (import/export)
      to call a shlib function. This stub would be anywhere between
      two functions in the target, and the line info was erroneously 
      taken to be the one of the line before the pc. 
-  */
+   */
   /* RT: Further explanation:
-   *
+
    * We have stubs (trampolines) inserted between procedures.
    *
    * Example: "shr1" exists in a shared library, and a "shr1" stub also
@@ -1687,31 +1692,31 @@ find_pc_sect_line (pc, section, notcurrent)
    *      check for the address being the same, to avoid an
    *      infinite recursion.
    */
-  msymbol = lookup_minimal_symbol_by_pc(pc);
-  if (msymbol != NULL) 
+  msymbol = lookup_minimal_symbol_by_pc (pc);
+  if (msymbol != NULL)
     if (MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
-    {
-     mfunsym = lookup_minimal_symbol_text (SYMBOL_NAME (msymbol), NULL, NULL);
-     if (mfunsym == NULL) 
-        /* I eliminated this warning since it is coming out
-         * in the following situation:
-         * gdb shmain // test program with shared libraries
-         * (gdb) break shr1  // function in shared lib
-         * Warning: In stub for ...
-         * In the above situation, the shared lib is not loaded yet, 
-         * so of course we can't find the real func/line info,
-         * but the "break" still works, and the warning is annoying.
-         * So I commented out the warning. RT */
-        /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */;
-        /* fall through */
-     else if (SYMBOL_VALUE(mfunsym) == SYMBOL_VALUE(msymbol))
-        /* Avoid infinite recursion */
-        /* See above comment about why warning is commented out */
-        /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */;
-        /* fall through */
-     else
-       return find_pc_line( SYMBOL_VALUE (mfunsym), 0);
-    }
+      {
+       mfunsym = lookup_minimal_symbol_text (SYMBOL_NAME (msymbol), NULL, NULL);
+       if (mfunsym == NULL)
+         /* I eliminated this warning since it is coming out
+          * in the following situation:
+          * gdb shmain // test program with shared libraries
+          * (gdb) break shr1  // function in shared lib
+          * Warning: In stub for ...
+          * In the above situation, the shared lib is not loaded yet, 
+          * so of course we can't find the real func/line info,
+          * but the "break" still works, and the warning is annoying.
+          * So I commented out the warning. RT */
+         /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */ ;
+       /* fall through */
+       else if (SYMBOL_VALUE (mfunsym) == SYMBOL_VALUE (msymbol))
+         /* Avoid infinite recursion */
+         /* See above comment about why warning is commented out */
+         /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */ ;
+       /* fall through */
+       else
+         return find_pc_line (SYMBOL_VALUE (mfunsym), 0);
+      }
 
 
   s = find_pc_sect_symtab (pc, section);
@@ -1735,7 +1740,7 @@ find_pc_sect_line (pc, section, notcurrent)
       /* Find the best line in this symtab.  */
       l = LINETABLE (s);
       if (!l)
-        continue;
+       continue;
       len = l->nitems;
       if (len <= 0)
        {
@@ -1750,7 +1755,7 @@ find_pc_sect_line (pc, section, notcurrent)
       item = l->item;          /* Get first line info */
 
       /* Is this file's first line closer than the first lines of other files?
-        If so, record this file, and its first line, as best alternate.  */
+         If so, record this file, and its first line, as best alternate.  */
       if (item->pc > pc && (!alt || item->pc < alt->pc))
        {
          alt = item;
@@ -1768,12 +1773,12 @@ find_pc_sect_line (pc, section, notcurrent)
        }
 
       /* At this point, prev points at the line whose start addr is <= pc, and
-        item points at the next line.  If we ran off the end of the linetable
-        (pc >= start of the last line), then prev == item.  If pc < start of
-        the first line, prev will not be set.  */
+         item points at the next line.  If we ran off the end of the linetable
+         (pc >= start of the last line), then prev == item.  If pc < start of
+         the first line, prev will not be set.  */
 
       /* Is this file's best line closer than the best in the other files?
-        If so, record this file, and its best line, as best so far.  */
+         If so, record this file, and its best line, as best so far.  */
 
       if (prev && (!best || prev->pc > best->pc))
        {
@@ -1799,7 +1804,8 @@ find_pc_sect_line (pc, section, notcurrent)
          val.line = alt->line - 1;
 
          /* Don't return line 0, that means that we didn't find the line.  */
-         if (val.line == 0) ++val.line;
+         if (val.line == 0)
+           ++val.line;
 
          val.pc = BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
          val.end = alt->pc;
@@ -1828,16 +1834,16 @@ find_pc_line (pc, notcurrent)
      CORE_ADDR pc;
      int notcurrent;
 {
-  asection     *section;
+  asection *section;
 
   section = find_pc_overlay (pc);
   if (pc_in_unmapped_range (pc, section))
     pc = overlay_mapped_address (pc, section);
   return find_pc_sect_line (pc, section, notcurrent);
 }
-
 \f
-static struct symtab* find_line_symtab PARAMS ((struct symtab *, int,
+
+static struct symtab *find_line_symtab PARAMS ((struct symtab *, int,
                                                int *, int *));
 
 /* Find line number LINE in any symtab whose name is the same as
@@ -1850,7 +1856,7 @@ static struct symtab* find_line_symtab PARAMS ((struct symtab *, int,
 
    If not found, return NULL.  */
 
-static struct symtab*
+static struct symtab *
 find_line_symtab (symtab, line, index, exact_match)
      struct symtab *symtab;
      int line;
@@ -1873,15 +1879,15 @@ find_line_symtab (symtab, line, index, exact_match)
   if (best_index < 0 || !exact)
     {
       /* Didn't find an exact match.  So we better keep looking for
-        another symtab with the same name.  In the case of xcoff,
-        multiple csects for one source file (produced by IBM's FORTRAN
-        compiler) produce multiple symtabs (this is unavoidable
-        assuming csects can be at arbitrary places in memory and that
-        the GLOBAL_BLOCK of a symtab has a begin and end address).  */
+         another symtab with the same name.  In the case of xcoff,
+         multiple csects for one source file (produced by IBM's FORTRAN
+         compiler) produce multiple symtabs (this is unavoidable
+         assuming csects can be at arbitrary places in memory and that
+         the GLOBAL_BLOCK of a symtab has a begin and end address).  */
 
       /* BEST is the smallest linenumber > LINE so far seen,
-        or 0 if none has been seen so far.
-        BEST_INDEX and BEST_LINETABLE identify the item for it.  */
+         or 0 if none has been seen so far.
+         BEST_INDEX and BEST_LINETABLE identify the item for it.  */
       int best;
 
       struct objfile *objfile;
@@ -1893,34 +1899,34 @@ find_line_symtab (symtab, line, index, exact_match)
        best = 0;
 
       ALL_SYMTABS (objfile, s)
-       {
-         struct linetable *l;
-         int ind;
+      {
+       struct linetable *l;
+       int ind;
 
-         if (!STREQ (symtab->filename, s->filename))
-           continue;
-         l = LINETABLE (s);
-         ind = find_line_common (l, line, &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 (symtab->filename, s->filename))
+         continue;
+       l = LINETABLE (s);
+       ind = find_line_common (l, line, &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;
+             }
+         }
+      }
     }
- done:
+done:
   if (best_index < 0)
     return NULL;
 
@@ -1975,7 +1981,7 @@ find_line_pc_range (sal, startptr, endptr)
   struct symtab_and_line found_sal;
 
   startaddr = sal.pc;
-  if (startaddr==0 && !find_line_pc (sal.symtab, sal.line, &startaddr))
+  if (startaddr == 0 && !find_line_pc (sal.symtab, sal.line, &startaddr))
     return 0;
 
   /* This whole function is based on address.  For example, if line 10 has
@@ -2070,7 +2076,7 @@ find_pc_line_pc_range (pc, startptr, endptr)
    of real code inside the function.  */
 
 static struct symtab_and_line
-find_function_start_sal PARAMS ((struct symbol *sym, int));
+find_function_start_sal PARAMS ((struct symbol * sym, int));
 
 static struct symtab_and_line
 find_function_start_sal (sym, funfirstline)
@@ -2083,10 +2089,10 @@ find_function_start_sal (sym, funfirstline)
   pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
   fixup_symbol_section (sym, NULL);
   if (funfirstline)
-    { /* skip "first line" of function (which is actually its prologue) */
+    {                          /* skip "first line" of function (which is actually its prologue) */
       asection *section = SYMBOL_BFD_SECTION (sym);
       /* If function is in an unmapped overlay, use its unmapped LMA
-        address, so that SKIP_PROLOGUE has something unique to work on */
+         address, so that SKIP_PROLOGUE has something unique to work on */
       if (section_is_overlay (section) &&
          !section_is_mapped (section))
        pc = overlay_unmapped_address (pc, section);
@@ -2136,7 +2142,7 @@ operator_chars (p, end)
 
   /* Don't get faked out by `operator' being part of a longer
      identifier.  */
-  if (isalpha(*p) || *p == '_' || *p == '$' || *p == '\0')
+  if (isalpha (*p) || *p == '_' || *p == '$' || *p == '\0')
     return *end;
 
   /* Allow some whitespace between `operator' and the operator symbol.  */
@@ -2145,10 +2151,10 @@ operator_chars (p, end)
 
   /* Recognize 'operator TYPENAME'. */
 
-  if (isalpha(*p) || *p == '_' || *p == '$')
+  if (isalpha (*p) || *p == '_' || *p == '$')
     {
-      register char *q = p+1;
-      while (isalnum(*q) || *q == '_' || *q == '$')
+      register char *q = p + 1;
+      while (isalnum (*q) || *q == '_' || *q == '$')
        q++;
       *end = q;
       return p;
@@ -2163,9 +2169,9 @@ operator_chars (p, end)
     case '%':
     case '^':
       if (p[1] == '=')
-       *end = p+2;
+       *end = p + 2;
       else
-       *end = p+1;
+       *end = p + 1;
       return p;
     case '<':
     case '>':
@@ -2174,28 +2180,28 @@ operator_chars (p, end)
     case '&':
     case '|':
       if (p[1] == '=' || p[1] == p[0])
-       *end = p+2;
+       *end = p + 2;
       else
-       *end = p+1;
+       *end = p + 1;
       return p;
     case '~':
     case ',':
-      *end = p+1;
+      *end = p + 1;
       return p;
     case '(':
       if (p[1] != ')')
        error ("`operator ()' must be specified without whitespace in `()'");
-      *end = p+2;
+      *end = p + 2;
       return p;
     case '?':
       if (p[1] != ':')
        error ("`operator ?:' must be specified without whitespace in `?:'");
-      *end = p+2;
+      *end = p + 2;
       return p;
     case '[':
       if (p[1] != ']')
        error ("`operator []' must be specified without whitespace in `[]'");
-      *end = p+2;
+      *end = p + 2;
       return p;
     default:
       error ("`operator %s' not supported", p);
@@ -2210,7 +2216,7 @@ operator_chars (p, end)
    reader because the type of the baseclass might still be stubbed
    when the definition of the derived class is parsed.  */
 
-static int total_number_of_methods PARAMS ((struct type *type));
+static int total_number_of_methods PARAMS ((struct type * type));
 
 static int
 total_number_of_methods (type)
@@ -2253,10 +2259,10 @@ find_methods (t, name, sym_arr)
      the class, then the loop can't do any good.  */
   if (class_name
       && (sym_class = lookup_symbol (class_name,
-                                    (struct block *)NULL,
+                                    (struct block *) NULL,
                                     STRUCT_NAMESPACE,
-                                    (int *)NULL,
-                                    (struct symtab **)NULL)))
+                                    (int *) NULL,
+                                    (struct symtab **) NULL)))
     {
       int method_counter;
 
@@ -2264,8 +2270,8 @@ find_methods (t, name, sym_arr)
       t = SYMBOL_TYPE (sym_class);
 
       /* Loop over each method name.  At this level, all overloads of a name
-        are counted as a single name.  There is an inner loop which loops over
-        each overload.  */
+         are counted as a single name.  There is an inner loop which loops over
+         each overload.  */
 
       for (method_counter = TYPE_NFN_FIELDS (t) - 1;
           method_counter >= 0;
@@ -2275,15 +2281,15 @@ find_methods (t, name, sym_arr)
          char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter);
          char dem_opname[64];
 
-          if (strncmp (method_name, "__", 2) == 0 ||
+         if (strncmp (method_name, "__", 2) == 0 ||
              strncmp (method_name, "op", 2) == 0 ||
              strncmp (method_name, "type", 4) == 0)
-            {
+           {
              if (cplus_demangle_opname (method_name, dem_opname, DMGL_ANSI))
-               method_name = dem_opname;
+               method_name = dem_opname;
              else if (cplus_demangle_opname (method_name, dem_opname, 0))
-               method_name = dem_opname; 
-            }
+               method_name = dem_opname;
+           }
 
          if (STREQ (name, method_name))
            /* Find all the overloaded methods with that name.  */
@@ -2301,8 +2307,8 @@ find_methods (t, name, sym_arr)
                    char *tmp_name;
 
                    tmp_name = gdb_mangle_name (t,
-                                                method_counter,
-                                                field_counter);
+                                               method_counter,
+                                               field_counter);
                    phys_name = alloca (strlen (tmp_name) + 1);
                    strcpy (phys_name, tmp_name);
                    free (tmp_name);
@@ -2329,7 +2335,7 @@ find_methods (t, name, sym_arr)
                       language_cplus,
                       DMGL_PARAMS | DMGL_ANSI);
                       fputs_filtered(" - possibly inlined.)\n", gdb_stdout);
-                      */
+                    */
                  }
              }
        }
@@ -2371,11 +2377,11 @@ build_canonical_line_spec (sal, symname, canonical)
   char *filename;
   struct symtab *s = sal->symtab;
 
-  if (s == (struct symtab *)NULL
-      || s->filename == (char *)NULL
-      || canonical == (char ***)NULL)
+  if (s == (struct symtab *) NULL
+      || s->filename == (char *) NULL
+      || canonical == (char ***) NULL)
     return;
+
   canonical_arr = (char **) xmalloc (sizeof (char *));
   *canonical = canonical_arr;
 
@@ -2402,9 +2408,9 @@ build_canonical_line_spec (sal, symname, canonical)
    LINENUM -- that line number in current file.  PC returned is 0.
    FILE:LINENUM -- that line in that file.  PC returned is 0.
    FUNCTION -- line number of openbrace of that function.
-      PC returned is the start of the function.
+   PC returned is the start of the function.
    VARIABLE -- line number of definition of that variable.
-      PC returned is 0.
+   PC returned is 0.
    FILE:FUNCTION -- likewise, but prefer functions in that file.
    *EXPR -- line in which address EXPR appears.
 
@@ -2470,7 +2476,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
      will have been defined away in defs.h.  */
 #undef volatile
   volatile struct symtab_and_line val;
-#define volatile /*nothing*/
+#define volatile               /*nothing */
 #else
   struct symtab_and_line val;
 #endif
@@ -2492,15 +2498,15 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
   int i1;
   int is_quoted;
   int is_quote_enclosed;
-  int has_parens;  
+  int has_parens;
   int has_if = 0;
   int has_comma = 0;
   struct symbol **sym_arr;
   struct type *t;
   char *saved_arg = *argptr;
   extern char *gdb_completer_quote_characters;
-  
-  INIT_SAL (&val);     /* initialize to zeroes */
+
+  INIT_SAL (&val);             /* initialize to zeroes */
 
   /* Defaults have defaults.  */
 
@@ -2531,20 +2537,21 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
   /* 'has_if' is for the syntax:
    *     (gdb) break foo if (a==b)
    */
-  if ((ii = strstr(*argptr, " if ")) != NULL ||
-      (ii = strstr(*argptr, "\tif ")) != NULL ||
-      (ii = strstr(*argptr, " if\t")) != NULL ||
-      (ii = strstr(*argptr, "\tif\t")) != NULL ||
-      (ii = strstr(*argptr, " if(")) != NULL ||
-      (ii = strstr(*argptr, "\tif( ")) != NULL) 
+  if ((ii = strstr (*argptr, " if ")) != NULL ||
+      (ii = strstr (*argptr, "\tif ")) != NULL ||
+      (ii = strstr (*argptr, " if\t")) != NULL ||
+      (ii = strstr (*argptr, "\tif\t")) != NULL ||
+      (ii = strstr (*argptr, " if(")) != NULL ||
+      (ii = strstr (*argptr, "\tif( ")) != NULL)
     has_if = 1;
   /* Temporarily zap out "if (condition)" to not
    * confuse the parenthesis-checking code below.
    * This is undone below. Do not change ii!!
    */
-  if (has_if) {
-    *ii = '\0';
-  }
+  if (has_if)
+    {
+      *ii = '\0';
+    }
 
   /* Set various flags.
    * 'has_parens' is important for overload checking, where
@@ -2558,7 +2565,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
               && strchr (gdb_completer_quote_characters, **argptr) != NULL);
 
   has_parens = ((pp = strchr (*argptr, '(')) != NULL
-                && (pp = strchr (pp, ')')) != NULL);
+               && (pp = strchr (pp, ')')) != NULL);
 
   /* Now that we're safely past the has_parens check,
    * put back " if (condition)" so outer layers can see it 
@@ -2569,15 +2576,16 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
   /* Maybe we were called with a line range FILENAME:LINENUM,FILENAME:LINENUM
      and we must isolate the first half.  Outer layers will call again later
      for the second half */
-  if ((ii = strchr(*argptr, ',')) != NULL)
+  if ((ii = strchr (*argptr, ',')) != NULL)
     has_comma = 1;
   /* Temporarily zap out second half to not
    * confuse the code below.
    * This is undone below. Do not change ii!!
    */
-  if (has_comma) {
-    *ii = '\0';
-  }
+  if (has_comma)
+    {
+      *ii = '\0';
+    }
 
   /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
   /* May also be CLASS::MEMBER, or NAMESPACE::NAME */
@@ -2591,29 +2599,29 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
       p++;
     }
   else
-      is_quote_enclosed = 0;
-  for ( ; *p; p++)
+    is_quote_enclosed = 0;
+  for (; *p; p++)
     {
-      if (p[0] == '<') 
+      if (p[0] == '<')
        {
-          char * temp_end = find_template_name_end (p);
-          if (!temp_end)
-            error ("malformed template specification in command");
-          p = temp_end;
+         char *temp_end = find_template_name_end (p);
+         if (!temp_end)
+           error ("malformed template specification in command");
+         p = temp_end;
        }
       /* Check for the end of the first half of the linespec.  End of line,
          a tab, a double colon or the last single colon, or a space.  But
          if enclosed in double quotes we do not break on enclosed spaces */
       if (!*p
-          || p[0] == '\t'
-          || ((p[0] == ':')
-              && ((p[1] == ':') || (strchr (p + 1, ':') == NULL)))
-          || ((p[0] == ' ') && ! is_quote_enclosed))
-        break;
-      if (p[0] == '.' && strchr (p, ':') == NULL) /* Java qualified method. */
+         || p[0] == '\t'
+         || ((p[0] == ':')
+             && ((p[1] == ':') || (strchr (p + 1, ':') == NULL)))
+         || ((p[0] == ' ') && !is_quote_enclosed))
+       break;
+      if (p[0] == '.' && strchr (p, ':') == NULL)      /* Java qualified method. */
        {
          /* Find the *last* '.', since the others are package qualifiers. */
-         for (p1 = p;  *p1;  p1++)
+         for (p1 = p; *p1; p1++)
            {
              if (*p1 == '.')
                p = p1;
@@ -2621,10 +2629,11 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
          break;
        }
     }
-  while (p[0] == ' ' || p[0] == '\t') p++;
+  while (p[0] == ' ' || p[0] == '\t')
+    p++;
   /* if the closing double quote was left at the end, remove it */
   if (is_quote_enclosed && ((pp = strchr (p, '"')) != NULL))
-    if (!*(pp+1))
+    if (!*(pp + 1))
       *pp = '\0';
 
   /* Now that we've safely parsed the first half,
@@ -2637,262 +2646,271 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
     {
       /*  C++ */
       /*  ... or Java */
-      if (is_quoted) *argptr = *argptr+1;
-      if (p[0] == '.' || p[1] ==':')
+      if (is_quoted)
+       *argptr = *argptr + 1;
+      if (p[0] == '.' || p[1] == ':')
        {
-          int ix;
-          char * saved_arg2 = *argptr;
-          char * temp_end;
-          /* First check for "global" namespace specification,
-             of the form "::foo". If found, skip over the colons
-             and jump to normal symbol processing */
-          if ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))
-            saved_arg2 += 2;
-
-          /* We have what looks like a class or namespace
-             scope specification (A::B), possibly with many
-             levels of namespaces or classes (A::B::C::D).
-
-             Some versions of the HP ANSI C++ compiler (as also possibly
-             other compilers) generate class/function/member names with
-             embedded double-colons if they are inside namespaces. To
-             handle this, we loop a few times, considering larger and
-             larger prefixes of the string as though they were single
-             symbols.  So, if the initially supplied string is
-             A::B::C::D::foo, we have to look up "A", then "A::B",
-             then "A::B::C", then "A::B::C::D", and finally
-             "A::B::C::D::foo" as single, monolithic symbols, because
-             A, B, C or D may be namespaces.
-
-             Note that namespaces can nest only inside other
-             namespaces, and not inside classes.  So we need only
-             consider *prefixes* of the string; there is no need to look up
-             "B::C" separately as a symbol in the previous example. */
-          
-          p2 = p; /* save for restart */
-          while (1)
-            {
-            /* Extract the class name.  */
-            p1 = p;
-            while (p != *argptr && p[-1] == ' ') --p;
-            copy = (char *) alloca (p - *argptr + 1);
-            memcpy (copy, *argptr, p - *argptr);
-            copy[p - *argptr] = 0;
-
-            /* Discard the class name from the arg.  */
-            p = p1 + (p1[0] == ':' ? 2 : 1);
-            while (*p == ' ' || *p == '\t') p++;
-            *argptr = p;
-
-            sym_class = lookup_symbol (copy, 0, STRUCT_NAMESPACE, 0, 
-                                       (struct symtab **)NULL);
-       
-            if (sym_class &&
-                (t = check_typedef (SYMBOL_TYPE (sym_class)),
-                 (TYPE_CODE (t) == TYPE_CODE_STRUCT
-                  || TYPE_CODE (t) == TYPE_CODE_UNION)))
-              {
-                /* Arg token is not digits => try it as a function name
-                   Find the next token(everything up to end or next blank). */
-                if (**argptr
-                    && strchr (gdb_completer_quote_characters, **argptr) != NULL)
-                  {
-                    p = skip_quoted(*argptr);
-                    *argptr = *argptr + 1;
-                  }
-                else
-                  {
-                    p = *argptr;
-                    while (*p && *p!=' ' && *p!='\t' && *p!=',' && *p!=':') p++;
-                  }
-/*
-             q = operator_chars (*argptr, &q1);
-             if (q1 - q)
+         int ix;
+         char *saved_arg2 = *argptr;
+         char *temp_end;
+         /* First check for "global" namespace specification,
+            of the form "::foo". If found, skip over the colons
+            and jump to normal symbol processing */
+         if ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))
+           saved_arg2 += 2;
+
+         /* We have what looks like a class or namespace
+            scope specification (A::B), possibly with many
+            levels of namespaces or classes (A::B::C::D).
+
+            Some versions of the HP ANSI C++ compiler (as also possibly
+            other compilers) generate class/function/member names with
+            embedded double-colons if they are inside namespaces. To
+            handle this, we loop a few times, considering larger and
+            larger prefixes of the string as though they were single
+            symbols.  So, if the initially supplied string is
+            A::B::C::D::foo, we have to look up "A", then "A::B",
+            then "A::B::C", then "A::B::C::D", and finally
+            "A::B::C::D::foo" as single, monolithic symbols, because
+            A, B, C or D may be namespaces.
+
+            Note that namespaces can nest only inside other
+            namespaces, and not inside classes.  So we need only
+            consider *prefixes* of the string; there is no need to look up
+            "B::C" separately as a symbol in the previous example. */
+
+         p2 = p;               /* save for restart */
+         while (1)
+           {
+             /* Extract the class name.  */
+             p1 = p;
+             while (p != *argptr && p[-1] == ' ')
+               --p;
+             copy = (char *) alloca (p - *argptr + 1);
+             memcpy (copy, *argptr, p - *argptr);
+             copy[p - *argptr] = 0;
+
+             /* Discard the class name from the arg.  */
+             p = p1 + (p1[0] == ':' ? 2 : 1);
+             while (*p == ' ' || *p == '\t')
+               p++;
+             *argptr = p;
+
+             sym_class = lookup_symbol (copy, 0, STRUCT_NAMESPACE, 0,
+                                        (struct symtab **) NULL);
+
+             if (sym_class &&
+                 (t = check_typedef (SYMBOL_TYPE (sym_class)),
+                  (TYPE_CODE (t) == TYPE_CODE_STRUCT
+                   || TYPE_CODE (t) == TYPE_CODE_UNION)))
                {
-                 char *opname;
-                 char *tmp = alloca (q1 - q + 1);
-                 memcpy (tmp, q, q1 - q);
-                 tmp[q1 - q] = '\0';
-                 opname = cplus_mangle_opname (tmp, DMGL_ANSI);
-                 if (opname == NULL)
+                 /* Arg token is not digits => try it as a function name
+                    Find the next token(everything up to end or next blank). */
+                 if (**argptr
+                     && strchr (gdb_completer_quote_characters, **argptr) != NULL)
+                   {
+                     p = skip_quoted (*argptr);
+                     *argptr = *argptr + 1;
+                   }
+                 else
+                   {
+                     p = *argptr;
+                     while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p != ':')
+                       p++;
+                   }
+/*
+   q = operator_chars (*argptr, &q1);
+   if (q1 - q)
+   {
+   char *opname;
+   char *tmp = alloca (q1 - q + 1);
+   memcpy (tmp, q, q1 - q);
+   tmp[q1 - q] = '\0';
+   opname = cplus_mangle_opname (tmp, DMGL_ANSI);
+   if (opname == NULL)
+   {
+   error_begin ();
+   printf_filtered ("no mangling for \"%s\"\n", tmp);
+   cplusplus_hint (saved_arg);
+   return_to_top_level (RETURN_ERROR);
+   }
+   copy = (char*) alloca (3 + strlen(opname));
+   sprintf (copy, "__%s", opname);
+   p = q1;
+   }
+   else
+ */
+                 {
+                   copy = (char *) alloca (p - *argptr + 1);
+                   memcpy (copy, *argptr, p - *argptr);
+                   copy[p - *argptr] = '\0';
+                   if (p != *argptr
+                       && copy[p - *argptr - 1]
+                       && strchr (gdb_completer_quote_characters,
+                                  copy[p - *argptr - 1]) != NULL)
+                     copy[p - *argptr - 1] = '\0';
+                 }
+
+                 /* no line number may be specified */
+                 while (*p == ' ' || *p == '\t')
+                   p++;
+                 *argptr = p;
+
+                 sym = 0;
+                 i1 = 0;       /*  counter for the symbol array */
+                 sym_arr = (struct symbol **) alloca (total_number_of_methods (t)
+                                               * sizeof (struct symbol *));
+
+                 if (destructor_name_p (copy, t))
                    {
+                     /* Destructors are a special case.  */
+                     int m_index, f_index;
+
+                     if (get_destructor_fn_field (t, &m_index, &f_index))
+                       {
+                         struct fn_field *f = TYPE_FN_FIELDLIST1 (t, m_index);
+
+                         sym_arr[i1] =
+                           lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index),
+                                          NULL, VAR_NAMESPACE, (int *) NULL,
+                                          (struct symtab **) NULL);
+                         if (sym_arr[i1])
+                           i1++;
+                       }
+                   }
+                 else
+                   i1 = find_methods (t, copy, sym_arr);
+                 if (i1 == 1)
+                   {
+                     /* There is exactly one field with that name.  */
+                     sym = sym_arr[0];
+
+                     if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
+                       {
+                         values.sals = (struct symtab_and_line *)
+                           xmalloc (sizeof (struct symtab_and_line));
+                         values.nelts = 1;
+                         values.sals[0] = find_function_start_sal (sym,
+                                                             funfirstline);
+                       }
+                     else
+                       {
+                         values.nelts = 0;
+                       }
+                     return values;
+                   }
+                 if (i1 > 0)
+                   {
+                     /* There is more than one field with that name
+                        (overloaded).  Ask the user which one to use.  */
+                     return decode_line_2 (sym_arr, i1, funfirstline, canonical);
+                   }
+                 else
+                   {
+                     char *tmp;
+
+                     if (OPNAME_PREFIX_P (copy))
+                       {
+                         tmp = (char *) alloca (strlen (copy + 3) + 9);
+                         strcpy (tmp, "operator ");
+                         strcat (tmp, copy + 3);
+                       }
+                     else
+                       tmp = copy;
                      error_begin ();
-                     printf_filtered ("no mangling for \"%s\"\n", tmp);
+                     if (tmp[0] == '~')
+                       printf_filtered
+                         ("the class `%s' does not have destructor defined\n",
+                          SYMBOL_SOURCE_NAME (sym_class));
+                     else
+                       printf_filtered
+                         ("the class %s does not have any method named %s\n",
+                          SYMBOL_SOURCE_NAME (sym_class), tmp);
                      cplusplus_hint (saved_arg);
                      return_to_top_level (RETURN_ERROR);
                    }
-                 copy = (char*) alloca (3 + strlen(opname));
-                 sprintf (copy, "__%s", opname);
-                 p = q1;
                }
-             else
-*/
-                  {
-                    copy = (char *) alloca (p - *argptr + 1 );
-                    memcpy (copy, *argptr, p - *argptr);
-                    copy[p - *argptr] = '\0';
-                    if (p != *argptr
-                        && copy[p - *argptr - 1]
-                        && strchr (gdb_completer_quote_characters,
-                                   copy[p - *argptr - 1]) != NULL)
-                      copy[p - *argptr - 1] = '\0';
-                  }
-
-                /* no line number may be specified */
-                while (*p == ' ' || *p == '\t') p++;
-                *argptr = p;
-
-                sym = 0;
-                i1 = 0;                /*  counter for the symbol array */
-                sym_arr = (struct symbol **) alloca(total_number_of_methods (t)
-                                                    * sizeof(struct symbol *));
-
-                if (destructor_name_p (copy, t))
-                  {
-                    /* Destructors are a special case.  */
-                    int m_index, f_index;
-
-                    if (get_destructor_fn_field (t, &m_index, &f_index))
-                      {
-                        struct fn_field *f = TYPE_FN_FIELDLIST1 (t, m_index);
-
-                        sym_arr[i1] =
-                          lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index),
-                                         NULL, VAR_NAMESPACE, (int *) NULL,
-                                         (struct symtab **)NULL);
-                        if (sym_arr[i1])
-                          i1++;
-                      }
-                  }
-                else
-                  i1 = find_methods (t, copy, sym_arr);
-                if (i1 == 1)
-                  {
-                    /* There is exactly one field with that name.  */
-                    sym = sym_arr[0];
-
-                    if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
-                      {
-                        values.sals = (struct symtab_and_line *)
-                          xmalloc (sizeof (struct symtab_and_line));
-                        values.nelts = 1;
-                        values.sals[0] = find_function_start_sal (sym,
-                                                                  funfirstline);
-                      }
-                    else
-                      {
-                        values.nelts = 0;
-                      }
-                    return values;
-                  }
-                if (i1 > 0)
-                  {
-                    /* There is more than one field with that name
-                       (overloaded).  Ask the user which one to use.  */
-                    return decode_line_2 (sym_arr, i1, funfirstline, canonical);
-                  }
-                else
-                  {
-                    char *tmp;
-
-                    if (OPNAME_PREFIX_P (copy))
-                      {
-                        tmp = (char *)alloca (strlen (copy+3) + 9);
-                        strcpy (tmp, "operator ");
-                        strcat (tmp, copy+3);
-                      }
-                    else
-                      tmp = copy;
-                    error_begin ();
-                    if (tmp[0] == '~')
-                      printf_filtered
-                        ("the class `%s' does not have destructor defined\n",
-                         SYMBOL_SOURCE_NAME(sym_class));
-                    else
-                      printf_filtered
-                        ("the class %s does not have any method named %s\n",
-                         SYMBOL_SOURCE_NAME(sym_class), tmp);
-                    cplusplus_hint (saved_arg);
-                    return_to_top_level (RETURN_ERROR);
-                  }
-              }
-
-             /* Move pointer up to next possible class/namespace token */
-              p = p2 + 1; /* restart with old value +1 */
-              /* Move pointer ahead to next double-colon */
-              while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\'')) {
-                if (p[0] == '<') {
-                  temp_end = find_template_name_end (p);
-                  if (!temp_end)
-                    error ("malformed template specification in command");
-                  p = temp_end;
-                }
-                else if ((p[0] == ':') && (p[1] == ':'))
-                  break; /* found double-colon */
-                else
-                  p++;
-              }
-              
-              if (*p != ':')
-                break; /* out of the while (1) */
-
-              p2 = p; /* save restart for next time around */
-              *argptr = saved_arg2; /* restore argptr */
-            } /* while (1) */
-
-          /* Last chance attempt -- check entire name as a symbol */
-          /* Use "copy" in preparation for jumping out of this block,
-             to be consistent with usage following the jump target */
-          copy = (char *) alloca (p - saved_arg2 + 1);
-          memcpy (copy, saved_arg2, p - saved_arg2);
-          /* Note: if is_quoted should be true, we snuff out quote here anyway */
-          copy[p-saved_arg2] = '\000'; 
-          /* Set argptr to skip over the name */
-          *argptr = (*p == '\'') ? p + 1 : p;
-          /* Look up entire name */
-          sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
-          s = (struct symtab *) 0;
-          /* Prepare to jump: restore the " if (condition)" so outer layers see it */
-          /* Symbol was found --> jump to normal symbol processing.
-             Code following "symbol_found" expects "copy" to have the
-             symbol name, "sym" to have the symbol pointer, "s" to be
-             a specified file's symtab, and sym_symtab to be the symbol's
-             symtab. */
-          /* By jumping there we avoid falling through the FILE:LINE and
-             FILE:FUNC processing stuff below */
-          if (sym)
-            goto symbol_found;
-
-          /* Couldn't find any interpretation as classes/namespaces, so give up */
-          error_begin ();
-          /* The quotes are important if copy is empty.  */
-          printf_filtered
-            ("Can't find member of namespace, class, struct, or union named \"%s\"\n", copy);
-          cplusplus_hint (saved_arg);
-          return_to_top_level (RETURN_ERROR);
-        }
+
+             /* Move pointer up to next possible class/namespace token */
+             p = p2 + 1;       /* restart with old value +1 */
+             /* Move pointer ahead to next double-colon */
+             while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\''))
+               {
+                 if (p[0] == '<')
+                   {
+                     temp_end = find_template_name_end (p);
+                     if (!temp_end)
+                       error ("malformed template specification in command");
+                     p = temp_end;
+                   }
+                 else if ((p[0] == ':') && (p[1] == ':'))
+                   break;      /* found double-colon */
+                 else
+                   p++;
+               }
+
+             if (*p != ':')
+               break;          /* out of the while (1) */
+
+             p2 = p;           /* save restart for next time around */
+             *argptr = saved_arg2;     /* restore argptr */
+           }                   /* while (1) */
+
+         /* Last chance attempt -- check entire name as a symbol */
+         /* Use "copy" in preparation for jumping out of this block,
+            to be consistent with usage following the jump target */
+         copy = (char *) alloca (p - saved_arg2 + 1);
+         memcpy (copy, saved_arg2, p - saved_arg2);
+         /* Note: if is_quoted should be true, we snuff out quote here anyway */
+         copy[p - saved_arg2] = '\000';
+         /* Set argptr to skip over the name */
+         *argptr = (*p == '\'') ? p + 1 : p;
+         /* Look up entire name */
+         sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
+         s = (struct symtab *) 0;
+         /* Prepare to jump: restore the " if (condition)" so outer layers see it */
+         /* Symbol was found --> jump to normal symbol processing.
+            Code following "symbol_found" expects "copy" to have the
+            symbol name, "sym" to have the symbol pointer, "s" to be
+            a specified file's symtab, and sym_symtab to be the symbol's
+            symtab. */
+         /* By jumping there we avoid falling through the FILE:LINE and
+            FILE:FUNC processing stuff below */
+         if (sym)
+           goto symbol_found;
+
+         /* Couldn't find any interpretation as classes/namespaces, so give up */
+         error_begin ();
+         /* The quotes are important if copy is empty.  */
+         printf_filtered
+           ("Can't find member of namespace, class, struct, or union named \"%s\"\n", copy);
+         cplusplus_hint (saved_arg);
+         return_to_top_level (RETURN_ERROR);
+       }
       /*  end of C++  */
 
 
       /* Extract the file name.  */
       p1 = p;
-      while (p != *argptr && p[-1] == ' ') --p;
-      if ((*p == '"') && is_quote_enclosed) --p;
+      while (p != *argptr && p[-1] == ' ')
+       --p;
+      if ((*p == '"') && is_quote_enclosed)
+       --p;
       copy = (char *) alloca (p - *argptr + 1);
       if ((**argptr == '"') && is_quote_enclosed)
-        {
-          memcpy (copy, *argptr + 1, p - *argptr - 1);
-          /* It may have the ending quote right after the file name */
-          if (copy[p - *argptr - 2] == '"')
-            copy[p - *argptr - 2] = 0;
-          else
-            copy[p - *argptr - 1] = 0;
-        }
+       {
+         memcpy (copy, *argptr + 1, p - *argptr - 1);
+         /* It may have the ending quote right after the file name */
+         if (copy[p - *argptr - 2] == '"')
+           copy[p - *argptr - 2] = 0;
+         else
+           copy[p - *argptr - 1] = 0;
+       }
       else
-        {
-          memcpy (copy, *argptr, p - *argptr);
-          copy[p - *argptr] = 0;
-        }
+       {
+         memcpy (copy, *argptr, p - *argptr);
+         copy[p - *argptr] = 0;
+       }
 
       /* Find that file's data.  */
       s = lookup_symtab (copy);
@@ -2905,7 +2923,8 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
 
       /* Discard the file name from the arg.  */
       p = p1 + 1;
-      while (*p == ' ' || *p == '\t') p++;
+      while (*p == ' ' || *p == '\t')
+       p++;
       *argptr = p;
     }
 #if 0
@@ -2916,32 +2935,34 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
      example, you are setting a breakpoint at this function),
      you get an error. This did not occur with earlier
      verions, so I am ifdef'ing this out. 3/29/99 */
-  else {
-    /* Check if what we have till now is a symbol name */
-
-    /* We may be looking at a template instantiation such
-       as "foo<int>".  Check here whether we know about it,
-       instead of falling through to the code below which
-       handles ordinary function names, because that code
-       doesn't like seeing '<' and '>' in a name -- the
-       skip_quoted call doesn't go past them.  So see if we
-       can figure it out right now. */ 
-
-    copy = (char *) alloca (p - *argptr + 1);
-    memcpy (copy, *argptr, p - *argptr);
-    copy[p - *argptr] = '\000';
-    sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
-    if (sym) {
-      /* Yes, we have a symbol; jump to symbol processing */
-      /* Code after symbol_found expects S, SYM_SYMTAB, SYM, 
-         and COPY to be set correctly */ 
-      *argptr = (*p == '\'') ? p + 1 : p;
-      s = (struct symtab *) 0;
-      goto symbol_found;
+  else
+    {
+      /* Check if what we have till now is a symbol name */
+
+      /* We may be looking at a template instantiation such
+         as "foo<int>".  Check here whether we know about it,
+         instead of falling through to the code below which
+         handles ordinary function names, because that code
+         doesn't like seeing '<' and '>' in a name -- the
+         skip_quoted call doesn't go past them.  So see if we
+         can figure it out right now. */
+
+      copy = (char *) alloca (p - *argptr + 1);
+      memcpy (copy, *argptr, p - *argptr);
+      copy[p - *argptr] = '\000';
+      sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
+      if (sym)
+       {
+         /* Yes, we have a symbol; jump to symbol processing */
+         /* Code after symbol_found expects S, SYM_SYMTAB, SYM, 
+            and COPY to be set correctly */
+         *argptr = (*p == '\'') ? p + 1 : p;
+         s = (struct symtab *) 0;
+         goto symbol_found;
+       }
+      /* Otherwise fall out from here and go to file/line spec
+         processing, etc. */
     }
-    /* Otherwise fall out from here and go to file/line spec
-       processing, etc. */ 
-  }
 #endif
 
   /* S is specified file's symtab, or 0 if no file specified.
@@ -2950,22 +2971,27 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
   /* Check whether arg is all digits (and sign) */
 
   q = *argptr;
-  if (*q == '-' || *q == '+') q++;
+  if (*q == '-' || *q == '+')
+    q++;
   while (*q >= '0' && *q <= '9')
     q++;
 
   if (q != *argptr && (*q == 0 || *q == ' ' || *q == '\t' || *q == ','))
     {
       /* We found a token consisting of all digits -- at least one digit.  */
-      enum sign {none, plus, minus} sign = none;
+      enum sign
+       {
+         none, plus, minus
+       }
+      sign = none;
 
       /* We might need a canonical line spec if no file was specified.  */
       int need_canonical = (s == 0) ? 1 : 0;
 
       /* This is where we need to make sure that we have good defaults.
-        We must guarantee that this section of code is never executed
-        when we are called with just a function name, since
-        select_source_symtab calls us with such an argument  */
+         We must guarantee that this section of code is never executed
+         when we are called with just a function name, since
+         select_source_symtab calls us with such an argument  */
 
       if (s == 0 && default_symtab == 0)
        {
@@ -2996,21 +3022,22 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
            val.line = 1;
          break;
        case none:
-         break;        /* No need to adjust val.line.  */
+         break;                /* No need to adjust val.line.  */
        }
 
-      while (*q == ' ' || *q == '\t') q++;
+      while (*q == ' ' || *q == '\t')
+       q++;
       *argptr = q;
       if (s == 0)
        s = default_symtab;
 
       /* It is possible that this source file has more than one symtab, 
-        and that the new line number specification has moved us from the
-        default (in s) to a new one.  */
+         and that the new line number specification has moved us from the
+         default (in s) to a new one.  */
       val.symtab = find_line_symtab (s, val.line, NULL, NULL);
       if (val.symtab == 0)
        val.symtab = s;
-     
+
       val.pc = 0;
       values.sals = (struct symtab_and_line *)
        xmalloc (sizeof (struct symtab_and_line));
@@ -3025,20 +3052,20 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
      Find the next token (everything up to end or next whitespace).  */
 
   if (**argptr == '$')         /* May be a convenience variable */
-    p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1));  /* One or two $ chars possible */
+    p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1));       /* One or two $ chars possible */
   else if (is_quoted)
     {
       p = skip_quoted (*argptr);
       if (p[-1] != '\'')
-        error ("Unmatched single quote.");
+       error ("Unmatched single quote.");
     }
   else if (has_parens)
     {
-      p = pp+1;
+      p = pp + 1;
     }
-  else 
+  else
     {
-      p = skip_quoted(*argptr);
+      p = skip_quoted (*argptr);
     }
 
   copy = (char *) alloca (p - *argptr + 1);
@@ -3046,18 +3073,19 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
   copy[p - *argptr] = '\0';
   if (p != *argptr
       && copy[0]
-      && copy[0] == copy [p - *argptr - 1]
+      && copy[0] == copy[p - *argptr - 1]
       && strchr (gdb_completer_quote_characters, copy[0]) != NULL)
     {
-      copy [p - *argptr - 1] = '\0';
+      copy[p - *argptr - 1] = '\0';
       copy++;
     }
-  while (*p == ' ' || *p == '\t') p++;
+  while (*p == ' ' || *p == '\t')
+    p++;
   *argptr = p;
 
   /* If it starts with $: may be a legitimate variable or routine name
      (e.g. HP-UX millicode routines such as $$dyncall), or it may
-     be history value, or it may be a convenience variable */ 
+     be history value, or it may be a convenience variable */
 
   if (*copy == '$')
     {
@@ -3067,51 +3095,51 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
 
       p = (copy[1] == '$') ? copy + 2 : copy + 1;
       while (*p >= '0' && *p <= '9')
-        p++;
-      if (!*p) /* reached end of token without hitting non-digit */
-        {
-          /* We have a value history reference */
-          sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &index);
-          valx = access_value_history ((copy[1] == '$') ? -index : index);
-          if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT)
-            error ("History values used in line specs must have integer values.");
-        }
-      else 
-        {
-          /* Not all digits -- may be user variable/function or a
-              convenience variable */
-          
-          /* Look up entire name as a symbol first */
-          sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab); 
-          s = (struct symtab *) 0;
-          need_canonical = 1;
-          /* Symbol was found --> jump to normal symbol processing.
-             Code following "symbol_found" expects "copy" to have the
-             symbol name, "sym" to have the symbol pointer, "s" to be
-             a specified file's symtab, and sym_symtab to be the symbol's
-             symtab. */
-          if (sym)
-            goto symbol_found;
-
-          /* If symbol was not found, look in minimal symbol tables */ 
-          msymbol = lookup_minimal_symbol (copy, 0, 0);
-          /* Min symbol was found --> jump to minsym processing. */ 
-          if (msymbol)
-            goto minimal_symbol_found;
-          
-          /* Not a user variable or function -- must be convenience variable */
-          need_canonical = (s == 0) ? 1 : 0;
-          valx = value_of_internalvar (lookup_internalvar (copy + 1));
-          if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT)
-            error ("Convenience variables used in line specs must have integer values.");
-        }
-
-      /* Either history value or convenience value from above, in valx */ 
+       p++;
+      if (!*p)                 /* reached end of token without hitting non-digit */
+       {
+         /* We have a value history reference */
+         sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &index);
+         valx = access_value_history ((copy[1] == '$') ? -index : index);
+         if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT)
+           error ("History values used in line specs must have integer values.");
+       }
+      else
+       {
+         /* Not all digits -- may be user variable/function or a
+            convenience variable */
+
+         /* Look up entire name as a symbol first */
+         sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
+         s = (struct symtab *) 0;
+         need_canonical = 1;
+         /* Symbol was found --> jump to normal symbol processing.
+            Code following "symbol_found" expects "copy" to have the
+            symbol name, "sym" to have the symbol pointer, "s" to be
+            a specified file's symtab, and sym_symtab to be the symbol's
+            symtab. */
+         if (sym)
+           goto symbol_found;
+
+         /* If symbol was not found, look in minimal symbol tables */
+         msymbol = lookup_minimal_symbol (copy, 0, 0);
+         /* Min symbol was found --> jump to minsym processing. */
+         if (msymbol)
+           goto minimal_symbol_found;
+
+         /* Not a user variable or function -- must be convenience variable */
+         need_canonical = (s == 0) ? 1 : 0;
+         valx = value_of_internalvar (lookup_internalvar (copy + 1));
+         if (TYPE_CODE (VALUE_TYPE (valx)) != TYPE_CODE_INT)
+           error ("Convenience variables used in line specs must have integer values.");
+       }
+
+      /* Either history value or convenience value from above, in valx */
       val.symtab = s ? s : default_symtab;
       val.line = value_as_long (valx);
       val.pc = 0;
 
-      values.sals = (struct symtab_and_line *)xmalloc (sizeof val);
+      values.sals = (struct symtab_and_line *) xmalloc (sizeof val);
       values.sals[0] = val;
       values.nelts = 1;
 
@@ -3129,9 +3157,9 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
                       (s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
                        : get_selected_block ()),
                       VAR_NAMESPACE, 0, &sym_symtab);
-  
-symbol_found:   /* We also jump here from inside the C++ class/namespace 
-                   code on finding a symbol of the form "A::B::C" */
+
+symbol_found:                  /* We also jump here from inside the C++ class/namespace 
+                                  code on finding a symbol of the form "A::B::C" */
 
   if (sym != NULL)
     {
@@ -3185,15 +3213,15 @@ symbol_found:   /* We also jump here from inside the C++ class/namespace
 
   msymbol = lookup_minimal_symbol (copy, NULL, NULL);
 
-minimal_symbol_found: /* We also jump here from the case for variables
-                         that begin with '$' */
-  
+minimal_symbol_found:          /* We also jump here from the case for variables
+                                  that begin with '$' */
+
   if (msymbol != NULL)
     {
       values.sals = (struct symtab_and_line *)
        xmalloc (sizeof (struct symtab_and_line));
-      values.sals[0] = find_pc_sect_line ( SYMBOL_VALUE_ADDRESS (msymbol), 
-                                          (struct sec *)0,0 );
+      values.sals[0] = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol),
+                                         (struct sec *) 0, 0);
       values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
       if (funfirstline)
        {
@@ -3209,7 +3237,7 @@ minimal_symbol_found: /* We also jump here from the case for variables
     error (no_symtab_msg);
 
   error ("Function \"%s\" not defined.", copy);
-  return values;       /* for lint */
+  return values;               /* for lint */
 }
 
 struct symtabs_and_lines
@@ -3222,7 +3250,7 @@ decode_line_spec (string, funfirstline)
     error ("Empty line specification.");
   sals = decode_line_1 (&string, funfirstline,
                        current_source_symtab, current_source_line,
-                       (char ***)NULL);
+                       (char ***) NULL);
   if (*string)
     error ("Junk at end of line specification: %s", string);
   return sals;
@@ -3246,12 +3274,12 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
   char *prompt;
   char *symname;
   struct cleanup *old_chain;
-  char **canonical_arr = (char **)NULL;
+  char **canonical_arr = (char **) NULL;
 
-  values.sals = (struct symtab_and_line *) 
-    alloca (nelts * sizeof(struct symtab_and_line));
-  return_values.sals = (struct symtab_and_line *) 
-    xmalloc (nelts * sizeof(struct symtab_and_line));
+  values.sals = (struct symtab_and_line *)
+    alloca (nelts * sizeof (struct symtab_and_line));
+  return_values.sals = (struct symtab_and_line *)
+    xmalloc (nelts * sizeof (struct symtab_and_line));
   old_chain = make_cleanup (free, return_values.sals);
 
   if (canonical)
@@ -3263,7 +3291,7 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
     }
 
   i = 0;
-  printf_unfiltered("[0] cancel\n[1] all\n");
+  printf_unfiltered ("[0] cancel\n[1] all\n");
   while (i < nelts)
     {
       INIT_SAL (&return_values.sals[i]);       /* initialize to zeroes */
@@ -3272,7 +3300,7 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
        {
          values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
          printf_unfiltered ("[%d] %s at %s:%d\n",
-                            (i+2),
+                            (i + 2),
                             SYMBOL_SOURCE_NAME (sym_arr[i]),
                             values.sals[i].symtab->filename,
                             values.sals[i].line);
@@ -3281,13 +3309,13 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
        printf_unfiltered ("?HERE\n");
       i++;
     }
-  
+
   if ((prompt = getenv ("PS2")) == NULL)
     {
       prompt = "> ";
     }
   args = command_line_input (prompt, 0, "overload-choice");
-  
+
   if (args == 0 || *args == 0)
     error_no_arg ("one or more choice numbers");
 
@@ -3297,7 +3325,8 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
       int num;
 
       arg1 = args;
-      while (*arg1 >= '0' && *arg1 <= '9') arg1++;
+      while (*arg1 >= '0' && *arg1 <= '9')
+       arg1++;
       if (*arg1 && *arg1 != ' ' && *arg1 != '\t')
        error ("Arguments must be choice numbers.");
 
@@ -3311,15 +3340,15 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
            {
              for (i = 0; i < nelts; i++)
                {
-                 if (canonical_arr[i] == NULL)
+                 if (canonical_arr[i] == NULL)
                    {
                      symname = SYMBOL_NAME (sym_arr[i]);
-                     canonical_arr[i] = savestring (symname, strlen (symname));
+                     canonical_arr[i] = savestring (symname, strlen (symname));
                    }
                }
            }
          memcpy (return_values.sals, values.sals,
-                 (nelts * sizeof(struct symtab_and_line)));
+                 (nelts * sizeof (struct symtab_and_line)));
          return_values.nelts = nelts;
          discard_cleanups (old_chain);
          return return_values;
@@ -3350,14 +3379,15 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
        }
 
       args = arg1;
-      while (*args == ' ' || *args == '\t') args++;
+      while (*args == ' ' || *args == '\t')
+       args++;
     }
   return_values.nelts = i;
   discard_cleanups (old_chain);
   return return_values;
 }
-
 \f
+
 /* Slave routine for sources_info.  Force line breaks at ,'s.
    NAME is the name to print and *FIRST is nonzero if this is the first
    name printed.  Set *FIRST to zero.  */
@@ -3415,7 +3445,7 @@ output_source_filename (name, first)
 
   wrap_here ("");
   fputs_filtered (name, gdb_stdout);
-}  
+}
 
 static void
 sources_info (ignore, from_tty)
@@ -3426,31 +3456,31 @@ sources_info (ignore, from_tty)
   register struct partial_symtab *ps;
   register struct objfile *objfile;
   int first;
-  
+
   if (!have_full_symbols () && !have_partial_symbols ())
     {
       error (no_symtab_msg);
     }
-  
+
   printf_filtered ("Source files for which symbols have been read in:\n\n");
 
   first = 1;
   ALL_SYMTABS (objfile, s)
-    {
-      output_source_filename (s -> filename, &first);
-    }
+  {
+    output_source_filename (s->filename, &first);
+  }
   printf_filtered ("\n\n");
-  
+
   printf_filtered ("Source files for which symbols will be read in on demand:\n\n");
 
   first = 1;
   ALL_PSYMTABS (objfile, ps)
-    {
-      if (!ps->readin)
-       {
-         output_source_filename (ps -> filename, &first);
-       }
-    }
+  {
+    if (!ps->readin)
+      {
+       output_source_filename (ps->filename, &first);
+      }
+  }
   printf_filtered ("\n");
 }
 
@@ -3465,10 +3495,10 @@ file_matches (file, files, nfiles)
   if (file != NULL && nfiles != 0)
     {
       for (i = 0; i < nfiles; i++)
-        {
-          if (strcmp (files[i], basename (file)) == 0)
-            return 1;
-        }
+       {
+         if (strcmp (files[i], basename (file)) == 0)
+           return 1;
+       }
     }
   else if (nfiles == 0)
     return 1;
@@ -3494,14 +3524,14 @@ free_search_symbols (symbols)
    returning the results in *MATCHES.
 
    Only symbols of KIND are searched:
-     FUNCTIONS_NAMESPACE - search all functions
-     TYPES_NAMESPACE     - search all type names
-     METHODS_NAMESPACE   - search all methods NOT IMPLEMENTED
-     VARIABLES_NAMESPACE - search all symbols, excluding functions, type names,
-                         and constants (enums)
+   FUNCTIONS_NAMESPACE - search all functions
+   TYPES_NAMESPACE     - search all type names
+   METHODS_NAMESPACE   - search all methods NOT IMPLEMENTED
+   VARIABLES_NAMESPACE - search all symbols, excluding functions, type names,
+   and constants (enums)
 
    free_search_symbols should be called when *MATCHES is no longer needed.
-*/
+ */
 void
 search_symbols (regexp, kind, nfiles, files, matches)
      char *regexp;
@@ -3509,7 +3539,7 @@ search_symbols (regexp, kind, nfiles, files, matches)
      int nfiles;
      char *files[];
      struct symbol_search **matches;
-     
+
 {
   register struct symtab *s;
   register struct partial_symtab *ps;
@@ -3525,13 +3555,17 @@ search_symbols (regexp, kind, nfiles, files, matches)
   char *val;
   int found_misc = 0;
   static enum minimal_symbol_type types[]
-    = {mst_data, mst_text, mst_abs, mst_unknown};
+  =
+  {mst_data, mst_text, mst_abs, mst_unknown};
   static enum minimal_symbol_type types2[]
-    = {mst_bss,  mst_file_text, mst_abs, mst_unknown};
+  =
+  {mst_bss, mst_file_text, mst_abs, mst_unknown};
   static enum minimal_symbol_type types3[]
-    = {mst_file_data,  mst_solib_trampoline, mst_abs, mst_unknown};
+  =
+  {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown};
   static enum minimal_symbol_type types4[]
-    = {mst_file_bss,   mst_text, mst_abs, mst_unknown};
+  =
+  {mst_file_bss, mst_text, mst_abs, mst_unknown};
   enum minimal_symbol_type ourtype;
   enum minimal_symbol_type ourtype2;
   enum minimal_symbol_type ourtype3;
@@ -3561,31 +3595,31 @@ search_symbols (regexp, kind, nfiles, files, matches)
       char *opend;
       char *opname = operator_chars (regexp, &opend);
       if (*opname)
-        {
-          int fix = -1; /* -1 means ok; otherwise number of spaces needed. */
-          if (isalpha(*opname) || *opname == '_' || *opname == '$')
-            {
-              /* There should 1 space between 'operator' and 'TYPENAME'. */
-              if (opname[-1] != ' ' || opname[-2] == ' ')
-                fix = 1;
-            }
-          else
-            {
-              /* There should 0 spaces between 'operator' and 'OPERATOR'. */
-              if (opname[-1] == ' ')
-                fix = 0;
-            }
-          /* If wrong number of spaces, fix it. */
-          if (fix >= 0)
-            {
-              char *tmp = (char*) alloca(opend-opname+10);
-              sprintf(tmp, "operator%.*s%s", fix, " ", opname);
-              regexp = tmp;
-            }
-        }
-      
+       {
+         int fix = -1;         /* -1 means ok; otherwise number of spaces needed. */
+         if (isalpha (*opname) || *opname == '_' || *opname == '$')
+           {
+             /* There should 1 space between 'operator' and 'TYPENAME'. */
+             if (opname[-1] != ' ' || opname[-2] == ' ')
+               fix = 1;
+           }
+         else
+           {
+             /* There should 0 spaces between 'operator' and 'OPERATOR'. */
+             if (opname[-1] == ' ')
+               fix = 0;
+           }
+         /* If wrong number of spaces, fix it. */
+         if (fix >= 0)
+           {
+             char *tmp = (char *) alloca (opend - opname + 10);
+             sprintf (tmp, "operator%.*s%s", fix, " ", opname);
+             regexp = tmp;
+           }
+       }
+
       if (0 != (val = re_comp (regexp)))
-        error ("Invalid regexp (%s): %s", val, regexp);
+       error ("Invalid regexp (%s): %s", val, regexp);
     }
 
   /* Search through the partial symtabs *first* for all symbols
@@ -3593,53 +3627,54 @@ search_symbols (regexp, kind, nfiles, files, matches)
      the machinery below. */
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      struct partial_symbol **bound, **gbound, **sbound;
-      int keep_going = 1;
-
-      if (ps->readin) continue;
-
-      gbound = objfile->global_psymbols.list + ps->globals_offset + ps->n_global_syms;
-      sbound = objfile->static_psymbols.list + ps->statics_offset + ps->n_static_syms;
-      bound = gbound;
-      
-      /* Go through all of the symbols stored in a partial
-         symtab in one loop. */
-      psym = objfile->global_psymbols.list + ps->globals_offset;
-      while (keep_going)
-        {
-          if (psym >= bound)
-            {
-              if (bound == gbound && ps->n_static_syms != 0)
-                {
-                  psym = objfile->static_psymbols.list + ps->statics_offset;
-                  bound = sbound;
-                }
-              else
-                keep_going = 0;
-              continue;
-            }
-          else
-            {
-              QUIT;
-
-              /* If it would match (logic taken from loop below)
-                 load the file and go on to the next one */
-              if (file_matches (ps->filename, files, nfiles)
-                  && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (*psym))
-                      && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
-                           && SYMBOL_CLASS (*psym) != LOC_BLOCK)
-                          || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)
-                          || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)
-                          || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK))))
-                {
-                  PSYMTAB_TO_SYMTAB(ps);
-                  keep_going = 0;
-                }
-            }
-          psym++;
-        }
-    }
+  {
+    struct partial_symbol **bound, **gbound, **sbound;
+    int keep_going = 1;
+
+    if (ps->readin)
+      continue;
+
+    gbound = objfile->global_psymbols.list + ps->globals_offset + ps->n_global_syms;
+    sbound = objfile->static_psymbols.list + ps->statics_offset + ps->n_static_syms;
+    bound = gbound;
+
+    /* Go through all of the symbols stored in a partial
+       symtab in one loop. */
+    psym = objfile->global_psymbols.list + ps->globals_offset;
+    while (keep_going)
+      {
+       if (psym >= bound)
+         {
+           if (bound == gbound && ps->n_static_syms != 0)
+             {
+               psym = objfile->static_psymbols.list + ps->statics_offset;
+               bound = sbound;
+             }
+           else
+             keep_going = 0;
+           continue;
+         }
+       else
+         {
+           QUIT;
+
+           /* If it would match (logic taken from loop below)
+              load the file and go on to the next one */
+           if (file_matches (ps->filename, files, nfiles)
+               && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (*psym))
+                   && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
+                        && SYMBOL_CLASS (*psym) != LOC_BLOCK)
+                       || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)
+                       || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)
+                       || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK))))
+             {
+               PSYMTAB_TO_SYMTAB (ps);
+               keep_going = 0;
+             }
+         }
+       psym++;
+      }
+  }
 
   /* Here, we search through the minimal symbol tables for functions
      and variables that match, and force their symbols to be read.
@@ -3652,82 +3687,82 @@ search_symbols (regexp, kind, nfiles, files, matches)
      to determine if the variable has debug info.
      If the lookup fails, set found_misc so that we will rescan to print
      any matching symbols without debug info.
-  */
+   */
 
   if (nfiles == 0 && (kind == VARIABLES_NAMESPACE || kind == FUNCTIONS_NAMESPACE))
     {
       ALL_MSYMBOLS (objfile, msymbol)
-        {
-          if (MSYMBOL_TYPE (msymbol) == ourtype ||
-              MSYMBOL_TYPE (msymbol) == ourtype2 ||
-              MSYMBOL_TYPE (msymbol) == ourtype3 ||
-              MSYMBOL_TYPE (msymbol) == ourtype4)
-            {
-              if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
-                {
-                  if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
-                    {
-                      if (kind == FUNCTIONS_NAMESPACE
-                          || lookup_symbol (SYMBOL_NAME (msymbol), 
-                                            (struct block *) NULL,
-                                            VAR_NAMESPACE,
-                                            0, (struct symtab **) NULL) == NULL)
-                        found_misc = 1;
-                    }
-                }
-            }
-        }
+      {
+       if (MSYMBOL_TYPE (msymbol) == ourtype ||
+           MSYMBOL_TYPE (msymbol) == ourtype2 ||
+           MSYMBOL_TYPE (msymbol) == ourtype3 ||
+           MSYMBOL_TYPE (msymbol) == ourtype4)
+         {
+           if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
+             {
+               if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
+                 {
+                   if (kind == FUNCTIONS_NAMESPACE
+                       || lookup_symbol (SYMBOL_NAME (msymbol),
+                                         (struct block *) NULL,
+                                         VAR_NAMESPACE,
+                                       0, (struct symtab **) NULL) == NULL)
+                     found_misc = 1;
+                 }
+             }
+         }
+      }
     }
 
   ALL_SYMTABS (objfile, s)
-    {
-      bv = BLOCKVECTOR (s);
-      /* Often many files share a blockvector.
-         Scan each blockvector only once so that
-         we don't get every symbol many times.
-         It happens that the first symtab in the list
-         for any given blockvector is the main file.  */
-      if (bv != prev_bv)
-        for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
-          {
-            b = BLOCKVECTOR_BLOCK (bv, i);
-            /* Skip the sort if this block is always sorted.  */
-            if (!BLOCK_SHOULD_SORT (b))
-              sort_block_syms (b);
-            for (j = 0; j < BLOCK_NSYMS (b); j++)
-              {
-                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
-                             && SYMBOL_CLASS (sym) != LOC_BLOCK
-                             && SYMBOL_CLASS (sym) != LOC_CONST)
-                            || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK)
-                            || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
-                            || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK))))
-                  {
-                    /* match */
-                    psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
-                    psr->block = i;
-                    psr->symtab = s;
-                    psr->symbol = sym;
-                    psr->msymbol = NULL;
-                    psr->next = NULL;
-                    if (tail == NULL)
-                      {
-                        sr = psr;
-                        old_chain = make_cleanup ((make_cleanup_func) 
-                                                  free_search_symbols, sr);
-                      }
-                    else
-                      tail->next = psr;
-                    tail = psr;
-                  }
-              }
-          }
-      prev_bv = bv;
-    }
+  {
+    bv = BLOCKVECTOR (s);
+    /* Often many files share a blockvector.
+       Scan each blockvector only once so that
+       we don't get every symbol many times.
+       It happens that the first symtab in the list
+       for any given blockvector is the main file.  */
+    if (bv != prev_bv)
+      for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
+       {
+         b = BLOCKVECTOR_BLOCK (bv, i);
+         /* Skip the sort if this block is always sorted.  */
+         if (!BLOCK_SHOULD_SORT (b))
+           sort_block_syms (b);
+         for (j = 0; j < BLOCK_NSYMS (b); j++)
+           {
+             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
+                          && SYMBOL_CLASS (sym) != LOC_BLOCK
+                          && SYMBOL_CLASS (sym) != LOC_CONST)
+                         || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK)
+                         || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+                         || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK))))
+               {
+                 /* match */
+                 psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
+                 psr->block = i;
+                 psr->symtab = s;
+                 psr->symbol = sym;
+                 psr->msymbol = NULL;
+                 psr->next = NULL;
+                 if (tail == NULL)
+                   {
+                     sr = psr;
+                     old_chain = make_cleanup ((make_cleanup_func)
+                                               free_search_symbols, sr);
+                   }
+                 else
+                   tail->next = psr;
+                 tail = psr;
+               }
+           }
+       }
+    prev_bv = bv;
+  }
 
   /* If there are no eyes, avoid all contact.  I mean, if there are
      no debug symbols, then print directly from the msymbol_vector.  */
@@ -3735,44 +3770,44 @@ search_symbols (regexp, kind, nfiles, files, matches)
   if (found_misc || kind != FUNCTIONS_NAMESPACE)
     {
       ALL_MSYMBOLS (objfile, msymbol)
-        {
-          if (MSYMBOL_TYPE (msymbol) == ourtype ||
-              MSYMBOL_TYPE (msymbol) == ourtype2 ||
-              MSYMBOL_TYPE (msymbol) == ourtype3 ||
-              MSYMBOL_TYPE (msymbol) == ourtype4)
-            {
-              if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
-                {
-                  /* Functions:  Look up by address. */
-                  if (kind != FUNCTIONS_NAMESPACE ||
-                      (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
-                    {
-                      /* Variables/Absolutes:  Look up by name */
-                      if (lookup_symbol (SYMBOL_NAME (msymbol), 
-                                         (struct block *) NULL, VAR_NAMESPACE,
-                                         0, (struct symtab **) NULL) == NULL)
-                        {
-                          /* match */
-                          psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
-                          psr->block = i;
-                          psr->msymbol = msymbol;
-                          psr->symtab  = NULL;
-                          psr->symbol  = NULL;
-                          psr->next = NULL;
-                          if (tail == NULL)
-                            {
-                              sr = psr;
-                              old_chain = make_cleanup ((make_cleanup_func) 
-                                                      free_search_symbols, &sr);
-                            }
-                          else
-                            tail->next = psr;
-                          tail = psr;
-                        }
-                    }
-                }
-            }
-        }
+      {
+       if (MSYMBOL_TYPE (msymbol) == ourtype ||
+           MSYMBOL_TYPE (msymbol) == ourtype2 ||
+           MSYMBOL_TYPE (msymbol) == ourtype3 ||
+           MSYMBOL_TYPE (msymbol) == ourtype4)
+         {
+           if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
+             {
+               /* Functions:  Look up by address. */
+               if (kind != FUNCTIONS_NAMESPACE ||
+                   (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
+                 {
+                   /* Variables/Absolutes:  Look up by name */
+                   if (lookup_symbol (SYMBOL_NAME (msymbol),
+                                      (struct block *) NULL, VAR_NAMESPACE,
+                                      0, (struct symtab **) NULL) == NULL)
+                     {
+                       /* match */
+                       psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
+                       psr->block = i;
+                       psr->msymbol = msymbol;
+                       psr->symtab = NULL;
+                       psr->symbol = NULL;
+                       psr->next = NULL;
+                       if (tail == NULL)
+                         {
+                           sr = psr;
+                           old_chain = make_cleanup ((make_cleanup_func)
+                                                 free_search_symbols, &sr);
+                         }
+                       else
+                         tail->next = psr;
+                       tail = psr;
+                     }
+                 }
+             }
+         }
+      }
     }
 
   *matches = sr;
@@ -3783,7 +3818,7 @@ search_symbols (regexp, kind, nfiles, files, matches)
 /* Helper function for symtab_symbol_info, this function uses
    the data returned from search_symbols() to print information
    regarding the match to gdb_stdout.
-*/
+ */
 static void
 print_symbol_info (kind, s, sym, block, last)
      namespace_enum kind;
@@ -3801,74 +3836,75 @@ print_symbol_info (kind, s, sym, block, last)
 
   if (kind != TYPES_NAMESPACE && block == STATIC_BLOCK)
     printf_filtered ("static ");
-           
+
   /* Typedef that is not a C++ class */
   if (kind == TYPES_NAMESPACE
       && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
-    c_typedef_print (SYMBOL_TYPE(sym), sym, gdb_stdout);
+    c_typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
   /* variable, func, or typedef-that-is-c++-class */
-  else if (kind < TYPES_NAMESPACE || 
-           (kind == TYPES_NAMESPACE && 
-            SYMBOL_NAMESPACE(sym) == STRUCT_NAMESPACE))
+  else if (kind < TYPES_NAMESPACE ||
+          (kind == TYPES_NAMESPACE &&
+           SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE))
     {
       type_print (SYMBOL_TYPE (sym),
-                  (SYMBOL_CLASS (sym) == LOC_TYPEDEF
-                   ? "" : SYMBOL_SOURCE_NAME (sym)),
-                  gdb_stdout, 0);
+                 (SYMBOL_CLASS (sym) == LOC_TYPEDEF
+                  ? "" : SYMBOL_SOURCE_NAME (sym)),
+                 gdb_stdout, 0);
 
       printf_filtered (";\n");
     }
   else
     {
-# if 0
+#if 0
       /* Tiemann says: "info methods was never implemented."  */
       char *demangled_name;
-      c_type_print_base (TYPE_FN_FIELD_TYPE(t, block),
-                         gdb_stdout, 0, 0); 
-      c_type_print_varspec_prefix (TYPE_FN_FIELD_TYPE(t, block),
-                                   gdb_stdout, 0); 
+      c_type_print_base (TYPE_FN_FIELD_TYPE (t, block),
+                        gdb_stdout, 0, 0);
+      c_type_print_varspec_prefix (TYPE_FN_FIELD_TYPE (t, block),
+                                  gdb_stdout, 0);
       if (TYPE_FN_FIELD_STUB (t, block))
-        check_stub_method (TYPE_DOMAIN_TYPE (type), j, block);
+       check_stub_method (TYPE_DOMAIN_TYPE (type), j, block);
       demangled_name =
-        cplus_demangle (TYPE_FN_FIELD_PHYSNAME (t, block),
-                        DMGL_ANSI | DMGL_PARAMS);
+       cplus_demangle (TYPE_FN_FIELD_PHYSNAME (t, block),
+                       DMGL_ANSI | DMGL_PARAMS);
       if (demangled_name == NULL)
-        fprintf_filtered (stream, "<badly mangled name %s>",
-                          TYPE_FN_FIELD_PHYSNAME (t, block));
+       fprintf_filtered (stream, "<badly mangled name %s>",
+                         TYPE_FN_FIELD_PHYSNAME (t, block));
       else
-        {
-          fputs_filtered (demangled_name, stream);
-          free (demangled_name);
-        }
-# endif
+       {
+         fputs_filtered (demangled_name, stream);
+         free (demangled_name);
+       }
+#endif
     }
 }
 
 /* This help function for symtab_symbol_info() prints information
    for non-debugging symbols to gdb_stdout.
-*/
+ */
 static void
 print_msymbol_info (msymbol)
      struct minimal_symbol *msymbol;
 {
   printf_filtered ("   %08lx  %s\n",
-                   (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol),
-                   SYMBOL_SOURCE_NAME (msymbol));
+                  (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol),
+                  SYMBOL_SOURCE_NAME (msymbol));
 }
 
 /* This is the guts of the commands "info functions", "info types", and
    "info variables". It calls search_symbols to find all matches and then
    print_[m]symbol_info to print out some useful information about the
    matches.
-*/
+ */
 static void
 symtab_symbol_info (regexp, kind, from_tty)
      char *regexp;
      namespace_enum kind;
-     int   from_tty;
+     int from_tty;
 {
   static char *classnames[]
-    = {"variable", "function", "type", "method"};
+  =
+  {"variable", "function", "type", "method"};
   struct symbol_search *symbols;
   struct symbol_search *p;
   struct cleanup *old_chain;
@@ -3880,32 +3916,32 @@ symtab_symbol_info (regexp, kind, from_tty)
   old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, symbols);
 
   printf_filtered (regexp
-                   ? "All %ss matching regular expression \"%s\":\n"
-                   : "All defined %ss:\n",
-                   classnames[(int) (kind - LABEL_NAMESPACE - 1)], regexp);
+                  ? "All %ss matching regular expression \"%s\":\n"
+                  : "All defined %ss:\n",
+                  classnames[(int) (kind - LABEL_NAMESPACE - 1)], regexp);
 
   for (p = symbols; p != NULL; p = p->next)
     {
       QUIT;
 
       if (p->msymbol != NULL)
-        {
-          if (first)
-            {
-              printf_filtered ("\nNon-debugging symbols:\n");
-              first = 0;
-            }
-          print_msymbol_info (p->msymbol);
-        }
+       {
+         if (first)
+           {
+             printf_filtered ("\nNon-debugging symbols:\n");
+             first = 0;
+           }
+         print_msymbol_info (p->msymbol);
+       }
       else
-        {
-          print_symbol_info (kind,
-                             p->symtab,
-                             p->symbol,
-                             p->block,
-                             last_filename);
-          last_filename = p->symtab->filename;
-        }
+       {
+         print_symbol_info (kind,
+                            p->symtab,
+                            p->symbol,
+                            p->block,
+                            last_filename);
+         last_filename = p->symtab->filename;
+       }
     }
 
   do_cleanups (old_chain);
@@ -3961,33 +3997,33 @@ rbreak_command (regexp, from_tty)
   for (p = ss; p != NULL; p = p->next)
     {
       if (p->msymbol == NULL)
-        {
-          char *string = (char *) alloca (strlen (p->symtab->filename)
-                                          + strlen (SYMBOL_NAME (p->symbol))
-                                          + 4);
-          strcpy (string, p->symtab->filename);
-          strcat (string, ":'");
-          strcat (string, SYMBOL_NAME (p->symbol));
-          strcat (string, "'");
-          break_command (string, from_tty);
-          print_symbol_info (FUNCTIONS_NAMESPACE,
-                             p->symtab,
-                             p->symbol,
-                             p->block,
-                             p->symtab->filename);
-        }
+       {
+         char *string = (char *) alloca (strlen (p->symtab->filename)
+                                         + strlen (SYMBOL_NAME (p->symbol))
+                                         + 4);
+         strcpy (string, p->symtab->filename);
+         strcat (string, ":'");
+         strcat (string, SYMBOL_NAME (p->symbol));
+         strcat (string, "'");
+         break_command (string, from_tty);
+         print_symbol_info (FUNCTIONS_NAMESPACE,
+                            p->symtab,
+                            p->symbol,
+                            p->block,
+                            p->symtab->filename);
+       }
       else
-        {
-          break_command (SYMBOL_NAME (p->msymbol), from_tty);
-          printf_filtered ("<function, no debug info> %s;\n",
-                           SYMBOL_SOURCE_NAME (p->msymbol));
-        }
+       {
+         break_command (SYMBOL_NAME (p->msymbol), from_tty);
+         printf_filtered ("<function, no debug info> %s;\n",
+                          SYMBOL_SOURCE_NAME (p->msymbol));
+       }
     }
 
   do_cleanups (old_chain);
 }
-
 \f
+
 /* Return Nonzero if block a is lexically nested within block b,
    or if a and b have the same pc range.
    Return zero otherwise. */
@@ -3998,10 +4034,10 @@ contained_in (a, b)
   if (!a || !b)
     return 0;
   return BLOCK_START (a) >= BLOCK_START (b)
-      && BLOCK_END (a)   <= BLOCK_END (b);
+    && BLOCK_END (a) <= BLOCK_END (b);
 }
-
 \f
+
 /* Helper routine for make_symbol_completion_list.  */
 
 static int return_val_size;
@@ -4022,8 +4058,8 @@ static char **return_val;
   } while (0)
 
 /*  Test to see if the symbol specified by SYMNAME (which is already
-    demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
-    characters.  If so, add it to the current completion list. */
+   demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
+   characters.  If so, add it to the current completion list. */
 
 static void
 completion_list_add_name (symname, sym_text, sym_text_len, text, word)
@@ -4053,7 +4089,7 @@ completion_list_add_name (symname, sym_text, sym_text_len, text, word)
          return;
        }
     }
-  
+
   /* We have a match for a completion, so add SYMNAME to the current list
      of matches. Note that the name is moved to freshly malloc'd space. */
 
@@ -4145,7 +4181,7 @@ make_symbol_completion_list (text, word)
              quote_found = '\0';
            else if (*p == '\\' && p[1] == quote_found)
              /* A backslash followed by the quote character
-                doesn't end the string.  */
+                doesn't end the string.  */
              ++p;
          }
        else if (*p == '\'' || *p == '"')
@@ -4159,7 +4195,7 @@ make_symbol_completion_list (text, word)
       sym_text = quote_pos + 1;
     else if (quote_found == '"')
       /* A double-quoted string is never a symbol, nor does it make sense
-        to complete it any other way.  */
+         to complete it any other way.  */
       return NULL;
     else
       {
@@ -4187,30 +4223,31 @@ make_symbol_completion_list (text, word)
      by matching SYM_TEXT.  Add each one that you find to the list.  */
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      /* If the psymtab's been read in we'll get it when we search
-        through the blockvector.  */
-      if (ps->readin) continue;
-      
-      for (psym = objfile->global_psymbols.list + ps->globals_offset;
-          psym < (objfile->global_psymbols.list + ps->globals_offset
-                  + ps->n_global_syms);
-          psym++)
-       {
-         /* If interrupted, then quit. */
-         QUIT;
-         COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word);
-       }
-      
-      for (psym = objfile->static_psymbols.list + ps->statics_offset;
-          psym < (objfile->static_psymbols.list + ps->statics_offset
-                  + ps->n_static_syms);
-          psym++)
-       {
-         QUIT;
-         COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word);
-       }
-    }
+  {
+    /* If the psymtab's been read in we'll get it when we search
+       through the blockvector.  */
+    if (ps->readin)
+      continue;
+
+    for (psym = objfile->global_psymbols.list + ps->globals_offset;
+        psym < (objfile->global_psymbols.list + ps->globals_offset
+                + ps->n_global_syms);
+        psym++)
+      {
+       /* If interrupted, then quit. */
+       QUIT;
+       COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word);
+      }
+
+    for (psym = objfile->static_psymbols.list + ps->statics_offset;
+        psym < (objfile->static_psymbols.list + ps->statics_offset
+                + ps->n_static_syms);
+        psym++)
+      {
+       QUIT;
+       COMPLETION_LIST_ADD_SYMBOL (*psym, sym_text, sym_text_len, text, word);
+      }
+  }
 
   /* At this point scan through the misc symbol vectors and add each
      symbol you find to the list.  Eventually we want to ignore
@@ -4218,10 +4255,10 @@ make_symbol_completion_list (text, word)
      handled by the psymtab code above).  */
 
   ALL_MSYMBOLS (objfile, msymbol)
-    {
-      QUIT;
-      COMPLETION_LIST_ADD_SYMBOL (msymbol, sym_text, sym_text_len, text, word);
-    }
+  {
+    QUIT;
+    COMPLETION_LIST_ADD_SYMBOL (msymbol, sym_text, sym_text_len, text, word);
+  }
 
   /* Search upwards from currently selected frame (so that we can
      complete on local vars.  */
@@ -4230,11 +4267,11 @@ make_symbol_completion_list (text, word)
     {
       if (!BLOCK_SUPERBLOCK (b))
        {
-         surrounding_static_block = b;         /* For elmin of dups */
+         surrounding_static_block = b;         /* For elmin of dups */
        }
-      
+
       /* Also catch fields of types defined in this places which match our
-        text string.  Only complete on types visible from current context. */
+         text string.  Only complete on types visible from current context. */
 
       for (i = 0; i < BLOCK_NSYMS (b); i++)
        {
@@ -4252,7 +4289,7 @@ make_symbol_completion_list (text, word)
                      if (TYPE_FIELD_NAME (t, j))
                        {
                          completion_list_add_name (TYPE_FIELD_NAME (t, j),
-                                                     sym_text, sym_text_len, text, word);
+                                       sym_text, sym_text_len, text, word);
                        }
                    }
                }
@@ -4264,28 +4301,29 @@ make_symbol_completion_list (text, word)
      symbols which match.  */
 
   ALL_SYMTABS (objfile, s)
-    {
-      QUIT;
-      b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
-      for (i = 0; i < BLOCK_NSYMS (b); i++)
-       {
-         sym = BLOCK_SYM (b, i);
-         COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
-       }
-    }
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+    for (i = 0; i < BLOCK_NSYMS (b); i++)
+      {
+       sym = BLOCK_SYM (b, i);
+       COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
+      }
+  }
 
   ALL_SYMTABS (objfile, s)
-    {
-      QUIT;
-      b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
-      /* Don't do this block twice.  */
-      if (b == surrounding_static_block) continue;
-      for (i = 0; i < BLOCK_NSYMS (b); i++)
-       {
-         sym = BLOCK_SYM (b, i);
-         COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
-       }
-    }
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+    /* Don't do this block twice.  */
+    if (b == surrounding_static_block)
+      continue;
+    for (i = 0; i < BLOCK_NSYMS (b); i++)
+      {
+       sym = BLOCK_SYM (b, i);
+       COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
+      }
+  }
 
   return (return_val);
 }
@@ -4328,12 +4366,13 @@ in_prologue (pc, func_start)
    likely that the user has stepped into a library function w/o symbols, or
    is doing a stepi/nexti through code without symbols.  */
 
- nosyms:
+nosyms:
 
 /* If func_start is zero (meaning unknown) then we don't know whether pc is
    in the prologue or not.  I.E. it might be. */
 
-  if (!func_start) return 1;
+  if (!func_start)
+    return 1;
 
 /* We need to call the target-specific prologue skipping functions with the
    function's start address because PC may be pointing at an instruction that
@@ -4353,19 +4392,19 @@ static int sym_return_val_index;
 static struct symbol **sym_return_val;
 
 /*  Test to see if the symbol specified by SYMNAME (which is already
-    demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
-    characters.  If so, add it to the current completion list. */
+   demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
+   characters.  If so, add it to the current completion list. */
 
 static void
 overload_list_add_symbol (sym, oload_name)
-  struct symbol * sym;
-  char * oload_name;
+     struct symbol *sym;
+     char *oload_name;
 {
   int newsize;
   int i;
 
   /* Get the demangled name without parameters */
-  char * sym_name = cplus_demangle (SYMBOL_NAME (sym), DMGL_ARM | DMGL_ANSI);
+  char *sym_name = cplus_demangle (SYMBOL_NAME (sym), DMGL_ARM | DMGL_ANSI);
   if (!sym_name)
     {
       sym_name = (char *) xmalloc (strlen (SYMBOL_NAME (sym)) + 1);
@@ -4394,7 +4433,7 @@ overload_list_add_symbol (sym, oload_name)
     }
   sym_return_val[sym_return_val_index++] = sym;
   sym_return_val[sym_return_val_index] = NULL;
-  
+
   free (sym_name);
 }
 
@@ -4406,7 +4445,7 @@ overload_list_add_symbol (sym, oload_name)
 
 struct symbol **
 make_symbol_overload_list (fsym)
-  struct symbol * fsym;
+     struct symbol *fsym;
 {
   register struct symbol *sym;
   register struct symtab *s;
@@ -4451,30 +4490,31 @@ make_symbol_overload_list (fsym)
      by matching OLOAD_NAME.  Add each one that you find to the list.  */
 
   ALL_PSYMTABS (objfile, ps)
-    {
-      /* If the psymtab's been read in we'll get it when we search
-        through the blockvector.  */
-      if (ps->readin) continue;
-      
-      for (psym = objfile->global_psymbols.list + ps->globals_offset;
-          psym < (objfile->global_psymbols.list + ps->globals_offset
-                  + ps->n_global_syms);
-          psym++)
-       {
-         /* If interrupted, then quit. */
-         QUIT;
-         overload_list_add_symbol (*psym, oload_name);
-       }
-      
-      for (psym = objfile->static_psymbols.list + ps->statics_offset;
-          psym < (objfile->static_psymbols.list + ps->statics_offset
-                  + ps->n_static_syms);
-          psym++)
-       {
-         QUIT;
-         overload_list_add_symbol (*psym, oload_name);
-       }
-    }
+  {
+    /* If the psymtab's been read in we'll get it when we search
+       through the blockvector.  */
+    if (ps->readin)
+      continue;
+
+    for (psym = objfile->global_psymbols.list + ps->globals_offset;
+        psym < (objfile->global_psymbols.list + ps->globals_offset
+                + ps->n_global_syms);
+        psym++)
+      {
+       /* If interrupted, then quit. */
+       QUIT;
+       overload_list_add_symbol (*psym, oload_name);
+      }
+
+    for (psym = objfile->static_psymbols.list + ps->statics_offset;
+        psym < (objfile->static_psymbols.list + ps->statics_offset
+                + ps->n_static_syms);
+        psym++)
+      {
+       QUIT;
+       overload_list_add_symbol (*psym, oload_name);
+      }
+  }
 
   /* At this point scan through the misc symbol vectors and add each
      symbol you find to the list.  Eventually we want to ignore
@@ -4482,10 +4522,10 @@ make_symbol_overload_list (fsym)
      handled by the psymtab code above).  */
 
   ALL_MSYMBOLS (objfile, msymbol)
-    {
-      QUIT;
-      overload_list_add_symbol (msymbol, oload_name);
-    }
+  {
+    QUIT;
+    overload_list_add_symbol (msymbol, oload_name);
+  }
 #endif
 
   /* Search upwards from currently selected frame (so that we can
@@ -4495,11 +4535,11 @@ make_symbol_overload_list (fsym)
     {
       if (!BLOCK_SUPERBLOCK (b))
        {
-         surrounding_static_block = b;         /* For elimination of dups */
+         surrounding_static_block = b;         /* For elimination of dups */
        }
-      
+
       /* Also catch fields of types defined in this places which match our
-        text string.  Only complete on types visible from current context. */
+         text string.  Only complete on types visible from current context. */
 
       for (i = 0; i < BLOCK_NSYMS (b); i++)
        {
@@ -4512,28 +4552,29 @@ make_symbol_overload_list (fsym)
      symbols which match.  */
 
   ALL_SYMTABS (objfile, s)
-    {
-      QUIT;
-      b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
-      for (i = 0; i < BLOCK_NSYMS (b); i++)
-       {
-         sym = BLOCK_SYM (b, i);
-         overload_list_add_symbol (sym, oload_name);
-       }
-    }
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+    for (i = 0; i < BLOCK_NSYMS (b); i++)
+      {
+       sym = BLOCK_SYM (b, i);
+       overload_list_add_symbol (sym, oload_name);
+      }
+  }
 
   ALL_SYMTABS (objfile, s)
-    {
-      QUIT;
-      b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
-      /* Don't do this block twice.  */
-      if (b == surrounding_static_block) continue;
-      for (i = 0; i < BLOCK_NSYMS (b); i++)
-       {
-         sym = BLOCK_SYM (b, i);
-         overload_list_add_symbol (sym, oload_name);
-       }
-    }
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+    /* Don't do this block twice.  */
+    if (b == surrounding_static_block)
+      continue;
+    for (i = 0; i < BLOCK_NSYMS (b); i++)
+      {
+       sym = BLOCK_SYM (b, i);
+       overload_list_add_symbol (sym, oload_name);
+      }
+  }
 
   free (oload_name);
 
@@ -4541,16 +4582,16 @@ make_symbol_overload_list (fsym)
 }
 
 /* End of overload resolution functions */
-
 \f
+
 void
 _initialize_symtab ()
 {
   add_info ("variables", variables_info,
-           "All global and static variable names, or those matching REGEXP.");
+        "All global and static variable names, or those matching REGEXP.");
   if (dbx_commands)
-    add_com("whereis", class_info, variables_info, 
-           "All global and static variable names, or those matching REGEXP.");
+    add_com ("whereis", class_info, variables_info,
+        "All global and static variable names, or those matching REGEXP.");
 
   add_info ("functions", functions_info,
            "All function names, or those matching REGEXP.");
@@ -4558,9 +4599,9 @@ _initialize_symtab ()
   /* FIXME:  This command has at least the following problems:
      1.  It prints builtin types (in a very strange and confusing fashion).
      2.  It doesn't print right, e.g. with
-         typedef struct foo *FOO
-        type_print prints "FOO" when we want to make it (in this situation)
-        print "struct foo *".
+     typedef struct foo *FOO
+     type_print prints "FOO" when we want to make it (in this situation)
+     print "struct foo *".
      I also think "ptype" or "whatis" is more likely to be useful (but if
      there is much disagreement "info types" can be fixed).  */
   add_info ("types", types_info,
@@ -4577,13 +4618,13 @@ are listed.");
            "Source files in the program.");
 
   add_com ("rbreak", class_breakpoint, rbreak_command,
-           "Set a breakpoint for all functions matching REGEXP.");
+          "Set a breakpoint for all functions matching REGEXP.");
 
   if (xdb_commands)
     {
       add_com ("lf", class_info, sources_info, "Source files in the program");
       add_com ("lg", class_info, variables_info,
-           "All global and static variable names, or those matching REGEXP.");
+        "All global and static variable names, or those matching REGEXP.");
     }
 
   /* Initialize the one built-in type that isn't language dependent... */
index 4c06d83f61cfb2c96f3d2bfeee8389c6a382b4d0..86a119a115e32c5edc418a502fcf66511f7dcff5 100644 (file)
@@ -1,22 +1,23 @@
 /* Symbol table definitions for GDB.
    Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (SYMTAB_H)
 #define SYMTAB_H 1
@@ -36,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #if 0 && defined(__GNUC__) && !defined(BYTE_BITFIELD)
 #define        BYTE_BITFIELD   :8;
 #else
-#define        BYTE_BITFIELD   /*nothing*/
+#define        BYTE_BITFIELD           /*nothing */
 #endif
 
 /* Define a structure for the information that is common to all symbol types,
@@ -48,75 +49,78 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    have tens or hundreds of thousands of these.  */
 
 struct general_symbol_info
-{
-  /* Name of the symbol.  This is a required field.  Storage for the name is
-     allocated on the psymbol_obstack or symbol_obstack for the associated
-     objfile. */
-
-  char *name;
-
-  /* Value of the symbol.  Which member of this union to use, and what
-     it means, depends on what kind of symbol this is and its
-     SYMBOL_CLASS.  See comments there for more details.  All of these
-     are in host byte order (though what they point to might be in
-     target byte order, e.g. LOC_CONST_BYTES).  */
-
-  union
-    {
-      /* The fact that this is a long not a LONGEST mainly limits the
-        range of a LOC_CONST.  Since LOC_CONST_BYTES exists, I'm not
-        sure that is a big deal.  */
-      long ivalue;
-
-      struct block *block;
-
-      char *bytes;
-
-      CORE_ADDR address;
+  {
+    /* Name of the symbol.  This is a required field.  Storage for the name is
+       allocated on the psymbol_obstack or symbol_obstack for the associated
+       objfile. */
 
-      /* for opaque typedef struct chain */
+    char *name;
 
-      struct symbol *chain;
-    }
-  value;
+    /* Value of the symbol.  Which member of this union to use, and what
+       it means, depends on what kind of symbol this is and its
+       SYMBOL_CLASS.  See comments there for more details.  All of these
+       are in host byte order (though what they point to might be in
+       target byte order, e.g. LOC_CONST_BYTES).  */
 
-  /* Since one and only one language can apply, wrap the language specific
-     information inside a union. */
+    union
+      {
+       /* The fact that this is a long not a LONGEST mainly limits the
+          range of a LOC_CONST.  Since LOC_CONST_BYTES exists, I'm not
+          sure that is a big deal.  */
+       long ivalue;
 
-  union
-    {
-      struct cplus_specific      /* For C++ */
-                               /*  and Java */
-       {
-         char *demangled_name;
-       } cplus_specific;
-      struct chill_specific      /* For Chill */
-       {
-         char *demangled_name;
-       } chill_specific;
-    } language_specific;
+       struct block *block;
 
-  /* Record the source code language that applies to this symbol.
-     This is used to select one of the fields from the language specific
-     union above. */
+       char *bytes;
 
-  enum language language BYTE_BITFIELD;
+       CORE_ADDR address;
 
-  /* Which section is this symbol in?  This is an index into
-     section_offsets for this objfile.  Negative means that the symbol
-     does not get relocated relative to a section.
-     Disclaimer: currently this is just used for xcoff, so don't
-     expect all symbol-reading code to set it correctly (the ELF code
-     also tries to set it correctly).  */
+       /* for opaque typedef struct chain */
 
-  short section;
+       struct symbol *chain;
+      }
+    value;
 
-  /* The bfd section associated with this symbol. */
+    /* Since one and only one language can apply, wrap the language specific
+       information inside a union. */
 
-  asection *bfd_section;
-};
+    union
+      {
+       struct cplus_specific   /* For C++ */
+       /*  and Java */
+         {
+           char *demangled_name;
+         }
+       cplus_specific;
+       struct chill_specific   /* For Chill */
+         {
+           char *demangled_name;
+         }
+       chill_specific;
+      }
+    language_specific;
+
+    /* Record the source code language that applies to this symbol.
+       This is used to select one of the fields from the language specific
+       union above. */
+
+    enum language language BYTE_BITFIELD;
+
+    /* Which section is this symbol in?  This is an index into
+       section_offsets for this objfile.  Negative means that the symbol
+       does not get relocated relative to a section.
+       Disclaimer: currently this is just used for xcoff, so don't
+       expect all symbol-reading code to set it correctly (the ELF code
+       also tries to set it correctly).  */
+
+    short section;
+
+    /* The bfd section associated with this symbol. */
+
+    asection *bfd_section;
+  };
 
-extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
+extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
 
 #define SYMBOL_NAME(symbol)            (symbol)->ginfo.name
 #define SYMBOL_VALUE(symbol)           (symbol)->ginfo.value.ivalue
@@ -270,7 +274,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
   (STREQ (SYMBOL_NAME (symbol), (name))                                        \
    || (SYMBOL_DEMANGLED_NAME (symbol) != NULL                          \
        && strcmp_iw (SYMBOL_DEMANGLED_NAME (symbol), (name)) == 0))
-   
+
 /* Macro that tests a symbol for an re-match against the last compiled regular
    expression.  First test the unencoded name, then look for and test a C++
    encoded name if it exists.
@@ -280,7 +284,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
   (re_exec (SYMBOL_NAME (symbol)) != 0                                 \
    || (SYMBOL_DEMANGLED_NAME (symbol) != NULL                          \
        && re_exec (SYMBOL_DEMANGLED_NAME (symbol)) != 0))
-   
+
 /* Define a simple structure used to hold some very basic information about
    all defined global symbols (text, data, bss, abs, etc).  The only required
    information is the general_symbol_info.
@@ -294,70 +298,71 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
    used to figure out what full symbol table entries need to be read in. */
 
 struct minimal_symbol
-{
+  {
 
-  /* The general symbol info required for all types of symbols.
+    /* The general symbol info required for all types of symbols.
 
-     The SYMBOL_VALUE_ADDRESS contains the address that this symbol
-     corresponds to.  */
+       The SYMBOL_VALUE_ADDRESS contains the address that this symbol
+       corresponds to.  */
 
-  struct general_symbol_info ginfo;
+    struct general_symbol_info ginfo;
 
-  /* The info field is available for caching machine-specific information
-     so it doesn't have to rederive the info constantly (over a serial line).
-     It is initialized to zero and stays that way until target-dependent code
-     sets it.  Storage for any data pointed to by this field should be allo-
-     cated on the symbol_obstack for the associated objfile.  
-     The type would be "void *" except for reasons of compatibility with older
-     compilers.  This field is optional.
+    /* The info field is available for caching machine-specific information
+       so it doesn't have to rederive the info constantly (over a serial line).
+       It is initialized to zero and stays that way until target-dependent code
+       sets it.  Storage for any data pointed to by this field should be allo-
+       cated on the symbol_obstack for the associated objfile.  
+       The type would be "void *" except for reasons of compatibility with older
+       compilers.  This field is optional.
 
-     Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
-     from the instructions in the function header, and the MIPS-16 code uses
-     it to identify 16-bit procedures.  */
+       Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
+       from the instructions in the function header, and the MIPS-16 code uses
+       it to identify 16-bit procedures.  */
 
-  char *info;
+    char *info;
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-  /* Which source file is this symbol in?  Only relevant for mst_file_*.  */
-  char *filename;
+    /* Which source file is this symbol in?  Only relevant for mst_file_*.  */
+    char *filename;
 #endif
 
-  /* Classification types for this symbol.  These should be taken as "advisory
-     only", since if gdb can't easily figure out a classification it simply
-     selects mst_unknown.  It may also have to guess when it can't figure out
-     which is a better match between two types (mst_data versus mst_bss) for
-     example.  Since the minimal symbol info is sometimes derived from the
-     BFD library's view of a file, we need to live with what information bfd
-     supplies. */
-
-  enum minimal_symbol_type
-    {
-      mst_unknown = 0,         /* Unknown type, the default */
-      mst_text,                        /* Generally executable instructions */
-      mst_data,                        /* Generally initialized data */
-      mst_bss,                 /* Generally uninitialized data */
-      mst_abs,                 /* Generally absolute (nonrelocatable) */
-      /* GDB uses mst_solib_trampoline for the start address of a shared
-        library trampoline entry.  Breakpoints for shared library functions
-        are put there if the shared library is not yet loaded.
-        After the shared library is loaded, lookup_minimal_symbol will
-        prefer the minimal symbol from the shared library (usually
-        a mst_text symbol) over the mst_solib_trampoline symbol, and the
-        breakpoints will be moved to their true address in the shared
-        library via breakpoint_re_set.  */
-      mst_solib_trampoline,    /* Shared library trampoline code */
-      /* For the mst_file* types, the names are only guaranteed to be unique
-        within a given .o file.  */
-      mst_file_text,           /* Static version of mst_text */
-      mst_file_data,           /* Static version of mst_data */
-      mst_file_bss             /* Static version of mst_bss */
-    } type BYTE_BITFIELD;
-};
+    /* Classification types for this symbol.  These should be taken as "advisory
+       only", since if gdb can't easily figure out a classification it simply
+       selects mst_unknown.  It may also have to guess when it can't figure out
+       which is a better match between two types (mst_data versus mst_bss) for
+       example.  Since the minimal symbol info is sometimes derived from the
+       BFD library's view of a file, we need to live with what information bfd
+       supplies. */
+
+    enum minimal_symbol_type
+      {
+       mst_unknown = 0,        /* Unknown type, the default */
+       mst_text,               /* Generally executable instructions */
+       mst_data,               /* Generally initialized data */
+       mst_bss,                /* Generally uninitialized data */
+       mst_abs,                /* Generally absolute (nonrelocatable) */
+       /* GDB uses mst_solib_trampoline for the start address of a shared
+          library trampoline entry.  Breakpoints for shared library functions
+          are put there if the shared library is not yet loaded.
+          After the shared library is loaded, lookup_minimal_symbol will
+          prefer the minimal symbol from the shared library (usually
+          a mst_text symbol) over the mst_solib_trampoline symbol, and the
+          breakpoints will be moved to their true address in the shared
+          library via breakpoint_re_set.  */
+       mst_solib_trampoline,   /* Shared library trampoline code */
+       /* For the mst_file* types, the names are only guaranteed to be unique
+          within a given .o file.  */
+       mst_file_text,          /* Static version of mst_text */
+       mst_file_data,          /* Static version of mst_data */
+       mst_file_bss            /* Static version of mst_bss */
+      }
+    type BYTE_BITFIELD;
+  };
 
 #define MSYMBOL_INFO(msymbol)          (msymbol)->info
 #define MSYMBOL_TYPE(msymbol)          (msymbol)->type
-
 \f
+
 /* All of the name-scope contours of the program
    are represented by `struct block' objects.
    All of these objects are pointed to by the blockvector.
@@ -385,12 +390,12 @@ struct minimal_symbol
    the blocks appear in the order of a depth-first tree walk.  */
 
 struct blockvector
-{
-  /* Number of blocks in the list.  */
-  int nblocks;
-  /* The blocks themselves.  */
-  struct block *block[1];
-};
+  {
+    /* Number of blocks in the list.  */
+    int nblocks;
+    /* The blocks themselves.  */
+    struct block *block[1];
+  };
 
 #define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks
 #define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n]
@@ -402,47 +407,47 @@ struct blockvector
 #define        FIRST_LOCAL_BLOCK       2
 
 struct block
-{
+  {
 
-  /* Addresses in the executable code that are in this block.  */
+    /* Addresses in the executable code that are in this block.  */
 
-  CORE_ADDR startaddr;
-  CORE_ADDR endaddr;
+    CORE_ADDR startaddr;
+    CORE_ADDR endaddr;
 
-  /* The symbol that names this block, if the block is the body of a
-     function; otherwise, zero.  */
+    /* The symbol that names this block, if the block is the body of a
+       function; otherwise, zero.  */
 
-  struct symbol *function;
+    struct symbol *function;
 
-  /* The `struct block' for the containing block, or 0 if none.
+    /* The `struct block' for the containing block, or 0 if none.
 
-     The superblock of a top-level local block (i.e. a function in the
-     case of C) is the STATIC_BLOCK.  The superblock of the
-     STATIC_BLOCK is the GLOBAL_BLOCK.  */
+       The superblock of a top-level local block (i.e. a function in the
+       case of C) is the STATIC_BLOCK.  The superblock of the
+       STATIC_BLOCK is the GLOBAL_BLOCK.  */
 
-  struct block *superblock;
+    struct block *superblock;
 
-  /* Version of GCC used to compile the function corresponding
-     to this block, or 0 if not compiled with GCC.  When possible,
-     GCC should be compatible with the native compiler, or if that
-     is not feasible, the differences should be fixed during symbol
-     reading.  As of 16 Apr 93, this flag is never used to distinguish
-     between gcc2 and the native compiler.
+    /* Version of GCC used to compile the function corresponding
+       to this block, or 0 if not compiled with GCC.  When possible,
+       GCC should be compatible with the native compiler, or if that
+       is not feasible, the differences should be fixed during symbol
+       reading.  As of 16 Apr 93, this flag is never used to distinguish
+       between gcc2 and the native compiler.
 
-     If there is no function corresponding to this block, this meaning
-     of this flag is undefined.  */
+       If there is no function corresponding to this block, this meaning
+       of this flag is undefined.  */
 
-  unsigned char gcc_compile_flag;
+    unsigned char gcc_compile_flag;
 
-  /* Number of local symbols.  */
+    /* Number of local symbols.  */
 
-  int nsyms;
+    int nsyms;
 
-  /* The symbols.  If some of them are arguments, then they must be
-     in the order in which we would like to print them.  */
+    /* The symbols.  If some of them are arguments, then they must be
+       in the order in which we would like to print them.  */
 
-  struct symbol *sym[1];
-};
+    struct symbol *sym[1];
+  };
 
 #define BLOCK_START(bl)                (bl)->startaddr
 #define BLOCK_END(bl)          (bl)->endaddr
@@ -458,198 +463,199 @@ struct block
    arguments.  */
 
 #define BLOCK_SHOULD_SORT(bl) ((bl)->nsyms >= 40 && BLOCK_FUNCTION (bl) == NULL)
-
 \f
+
 /* Represent one symbol name; a variable, constant, function or typedef.  */
 
 /* Different name spaces for symbols.  Looking up a symbol specifies a
    namespace and ignores symbol definitions in other name spaces. */
-typedef enum 
-{
-  /* UNDEF_NAMESPACE is used when a namespace has not been discovered or
-     none of the following apply.  This usually indicates an error either
-     in the symbol information or in gdb's handling of symbols. */
 
-  UNDEF_NAMESPACE,
+typedef enum
+  {
+    /* UNDEF_NAMESPACE is used when a namespace has not been discovered or
+       none of the following apply.  This usually indicates an error either
+       in the symbol information or in gdb's handling of symbols. */
+
+    UNDEF_NAMESPACE,
 
-  /* VAR_NAMESPACE is the usual namespace.  In C, this contains variables,
-     function names, typedef names and enum type values. */
+    /* VAR_NAMESPACE is the usual namespace.  In C, this contains variables,
+       function names, typedef names and enum type values. */
 
-  VAR_NAMESPACE,
+    VAR_NAMESPACE,
 
-  /* STRUCT_NAMESPACE is used in C to hold struct, union and enum type names.
-     Thus, if `struct foo' is used in a C program, it produces a symbol named
-     `foo' in the STRUCT_NAMESPACE. */
+    /* STRUCT_NAMESPACE is used in C to hold struct, union and enum type names.
+       Thus, if `struct foo' is used in a C program, it produces a symbol named
+       `foo' in the STRUCT_NAMESPACE. */
 
-  STRUCT_NAMESPACE,
+    STRUCT_NAMESPACE,
 
-  /* LABEL_NAMESPACE may be used for names of labels (for gotos);
-     currently it is not used and labels are not recorded at all.  */
+    /* LABEL_NAMESPACE may be used for names of labels (for gotos);
+       currently it is not used and labels are not recorded at all.  */
 
-  LABEL_NAMESPACE,
+    LABEL_NAMESPACE,
 
-  /* Searching namespaces. These overlap with VAR_NAMESPACE, providing
-     some granularity with the search_symbols function. */
+    /* Searching namespaces. These overlap with VAR_NAMESPACE, providing
+       some granularity with the search_symbols function. */
 
-  /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
-     METHODS_NAMESPACE */
-  VARIABLES_NAMESPACE,
+    /* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
+       METHODS_NAMESPACE */
+    VARIABLES_NAMESPACE,
 
-  /* All functions -- for some reason not methods, though. */
-  FUNCTIONS_NAMESPACE,
+    /* All functions -- for some reason not methods, though. */
+    FUNCTIONS_NAMESPACE,
 
-  /* All defined types */
-  TYPES_NAMESPACE,
+    /* All defined types */
+    TYPES_NAMESPACE,
 
-  /* All class methods -- why is this separated out? */
-  METHODS_NAMESPACE
+    /* All class methods -- why is this separated out? */
+    METHODS_NAMESPACE
 
-} namespace_enum;
+  }
+namespace_enum;
 
 /* An address-class says where to find the value of a symbol.  */
 
 enum address_class
-{
-  /* Not used; catches errors */
+  {
+    /* Not used; catches errors */
+
+    LOC_UNDEF,
 
-  LOC_UNDEF,
+    /* Value is constant int SYMBOL_VALUE, host byteorder */
 
-  /* Value is constant int SYMBOL_VALUE, host byteorder */
+    LOC_CONST,
 
-  LOC_CONST,
+    /* Value is at fixed address SYMBOL_VALUE_ADDRESS */
 
-  /* Value is at fixed address SYMBOL_VALUE_ADDRESS */
+    LOC_STATIC,
 
-  LOC_STATIC,
+    /* Value is in register.  SYMBOL_VALUE is the register number.  */
 
-  /* Value is in register.  SYMBOL_VALUE is the register number.  */
+    LOC_REGISTER,
 
-  LOC_REGISTER,
+    /* It's an argument; the value is at SYMBOL_VALUE offset in arglist.  */
 
-  /* It's an argument; the value is at SYMBOL_VALUE offset in arglist.  */
+    LOC_ARG,
 
-  LOC_ARG,
+    /* Value address is at SYMBOL_VALUE offset in arglist.  */
 
-  /* Value address is at SYMBOL_VALUE offset in arglist.  */
+    LOC_REF_ARG,
 
-  LOC_REF_ARG,
+    /* Value is in register number SYMBOL_VALUE.  Just like LOC_REGISTER
+       except this is an argument.  Probably the cleaner way to handle
+       this would be to separate address_class (which would include
+       separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
+       FRAME_LOCALS_ADDRESS), and an is_argument flag.
 
-  /* Value is in register number SYMBOL_VALUE.  Just like LOC_REGISTER
-     except this is an argument.  Probably the cleaner way to handle
-     this would be to separate address_class (which would include
-     separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
-     FRAME_LOCALS_ADDRESS), and an is_argument flag.
+       For some symbol formats (stabs, for some compilers at least),
+       the compiler generates two symbols, an argument and a register.
+       In some cases we combine them to a single LOC_REGPARM in symbol
+       reading, but currently not for all cases (e.g. it's passed on the
+       stack and then loaded into a register).  */
 
-     For some symbol formats (stabs, for some compilers at least),
-     the compiler generates two symbols, an argument and a register.
-     In some cases we combine them to a single LOC_REGPARM in symbol
-     reading, but currently not for all cases (e.g. it's passed on the
-     stack and then loaded into a register).  */
+    LOC_REGPARM,
 
-  LOC_REGPARM,
+    /* Value is in specified register.  Just like LOC_REGPARM except the
+       register holds the address of the argument instead of the argument
+       itself. This is currently used for the passing of structs and unions
+       on sparc and hppa.  It is also used for call by reference where the
+       address is in a register, at least by mipsread.c.  */
 
-  /* Value is in specified register.  Just like LOC_REGPARM except the
-     register holds the address of the argument instead of the argument
-     itself. This is currently used for the passing of structs and unions
-     on sparc and hppa.  It is also used for call by reference where the
-     address is in a register, at least by mipsread.c.  */
+    LOC_REGPARM_ADDR,
 
-  LOC_REGPARM_ADDR,
+    /* Value is a local variable at SYMBOL_VALUE offset in stack frame.  */
 
-  /* Value is a local variable at SYMBOL_VALUE offset in stack frame.  */
+    LOC_LOCAL,
 
-  LOC_LOCAL,
+    /* Value not used; definition in SYMBOL_TYPE.  Symbols in the namespace
+       STRUCT_NAMESPACE all have this class.  */
 
-  /* Value not used; definition in SYMBOL_TYPE.  Symbols in the namespace
-     STRUCT_NAMESPACE all have this class.  */
+    LOC_TYPEDEF,
 
-  LOC_TYPEDEF,
+    /* Value is address SYMBOL_VALUE_ADDRESS in the code */
 
-  /* Value is address SYMBOL_VALUE_ADDRESS in the code */
+    LOC_LABEL,
 
-  LOC_LABEL,
+    /* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
+       In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
+       of the block.  Function names have this class. */
 
-  /* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
-     In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
-     of the block.  Function names have this class. */
+    LOC_BLOCK,
 
-  LOC_BLOCK,
+    /* Value is a constant byte-sequence pointed to by SYMBOL_VALUE_BYTES, in
+       target byte order.  */
 
-  /* Value is a constant byte-sequence pointed to by SYMBOL_VALUE_BYTES, in
-     target byte order.  */
+    LOC_CONST_BYTES,
 
-  LOC_CONST_BYTES,
+    /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
+       LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
+       that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
+       arglist (FRAME_ARGS_ADDRESS).  Added for i960, which passes args
+       in regs then copies to frame.  */
 
-  /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
-     LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
-     that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
-     arglist (FRAME_ARGS_ADDRESS).  Added for i960, which passes args
-     in regs then copies to frame.  */
+    LOC_LOCAL_ARG,
 
-  LOC_LOCAL_ARG,
+    /* Value is at SYMBOL_VALUE offset from the current value of
+       register number SYMBOL_BASEREG.  This exists mainly for the same
+       things that LOC_LOCAL and LOC_ARG do; but we need to do this
+       instead because on 88k DWARF gives us the offset from the
+       frame/stack pointer, rather than the offset from the "canonical
+       frame address" used by COFF, stabs, etc., and we don't know how
+       to convert between these until we start examining prologues.
 
-  /* Value is at SYMBOL_VALUE offset from the current value of
-     register number SYMBOL_BASEREG.  This exists mainly for the same
-     things that LOC_LOCAL and LOC_ARG do; but we need to do this
-     instead because on 88k DWARF gives us the offset from the
-     frame/stack pointer, rather than the offset from the "canonical
-     frame address" used by COFF, stabs, etc., and we don't know how
-     to convert between these until we start examining prologues.
+       Note that LOC_BASEREG is much less general than a DWARF expression.
+       We don't need the generality (at least not yet), and storing a general
+       DWARF expression would presumably take up more space than the existing
+       scheme.  */
 
-     Note that LOC_BASEREG is much less general than a DWARF expression.
-     We don't need the generality (at least not yet), and storing a general
-     DWARF expression would presumably take up more space than the existing
-     scheme.  */
+    LOC_BASEREG,
 
-  LOC_BASEREG,
+    /* Same as LOC_BASEREG but it is an argument.  */
 
-  /* Same as LOC_BASEREG but it is an argument.  */
+    LOC_BASEREG_ARG,
 
-  LOC_BASEREG_ARG,
+    /* Value is at fixed address, but the address of the variable has
+       to be determined from the minimal symbol table whenever the
+       variable is referenced.
+       This happens if debugging information for a global symbol is
+       emitted and the corresponding minimal symbol is defined
+       in another object file or runtime common storage.
+       The linker might even remove the minimal symbol if the global
+       symbol is never referenced, in which case the symbol remains
+       unresolved.  */
 
-  /* Value is at fixed address, but the address of the variable has
-     to be determined from the minimal symbol table whenever the
-     variable is referenced.
-     This happens if debugging information for a global symbol is
-     emitted and the corresponding minimal symbol is defined
-     in another object file or runtime common storage.
-     The linker might even remove the minimal symbol if the global
-     symbol is never referenced, in which case the symbol remains
-     unresolved.  */
+    LOC_UNRESOLVED,
 
-  LOC_UNRESOLVED,
+    /* Value is at a thread-specific location calculated by a
+       target-specific method. */
 
-  /* Value is at a thread-specific location calculated by a
-     target-specific method. */
-     
-  LOC_THREAD_LOCAL_STATIC,
-     
-  /* The variable does not actually exist in the program.
-     The value is ignored.  */
+    LOC_THREAD_LOCAL_STATIC,
 
-  LOC_OPTIMIZED_OUT,
+    /* The variable does not actually exist in the program.
+       The value is ignored.  */
 
-  /* The variable is static, but actually lives at * (address).
-   * I.e. do an extra indirection to get to it.
-   * This is used on HP-UX to get at globals that are allocated
-   * in shared libraries, where references from images other
-   * than the one where the global was allocated are done
-   * with a level of indirection.
-   */
+    LOC_OPTIMIZED_OUT,
 
-  LOC_INDIRECT
+    /* The variable is static, but actually lives at * (address).
+     * I.e. do an extra indirection to get to it.
+     * This is used on HP-UX to get at globals that are allocated
+     * in shared libraries, where references from images other
+     * than the one where the global was allocated are done
+     * with a level of indirection.
+     */
 
-};
+    LOC_INDIRECT
+
+  };
 
 /* Linked list of symbol's live ranges. */
 
-struct range_list              
-{
-  CORE_ADDR start;
-  CORE_ADDR end;
-  struct range_list *next;     
-};
+struct range_list
+  {
+    CORE_ADDR start;
+    CORE_ADDR end;
+    struct range_list *next;
+  };
 
 /* Linked list of aliases for a particular main/primary symbol.  */
 struct alias_list
@@ -659,54 +665,54 @@ struct alias_list
   };
 
 struct symbol
-{
+  {
 
-  /* The general symbol info required for all types of symbols. */
+    /* The general symbol info required for all types of symbols. */
 
-  struct general_symbol_info ginfo;
+    struct general_symbol_info ginfo;
 
-  /* Data type of value */
+    /* Data type of value */
 
-  struct type *type;
+    struct type *type;
 
-  /* Name space code.  */
+    /* Name space code.  */
 
 #ifdef __MFC4__
-  /* FIXME: don't conflict with C++'s namespace */
-  /* would be safer to do a global change for all namespace identifiers. */
-  #define namespace _namespace
+    /* FIXME: don't conflict with C++'s namespace */
+    /* would be safer to do a global change for all namespace identifiers. */
+#define namespace _namespace
 #endif
-  namespace_enum namespace BYTE_BITFIELD;
+    namespace_enum namespace BYTE_BITFIELD;
 
-  /* Address class */
+    /* Address class */
 
-  enum address_class aclass BYTE_BITFIELD;
+    enum address_class aclass BYTE_BITFIELD;
 
-  /* Line number of definition.  FIXME:  Should we really make the assumption
-     that nobody will try to debug files longer than 64K lines?  What about
-     machine generated programs? */
+    /* Line number of definition.  FIXME:  Should we really make the assumption
+       that nobody will try to debug files longer than 64K lines?  What about
+       machine generated programs? */
 
-  unsigned short line;
-  
-  /* Some symbols require an additional value to be recorded on a per-
-     symbol basis.  Stash those values here. */
+    unsigned short line;
 
-  union
-    {
-      /* Used by LOC_BASEREG and LOC_BASEREG_ARG.  */
-      short basereg;
-    }
-  aux_value;
+    /* Some symbols require an additional value to be recorded on a per-
+       symbol basis.  Stash those values here. */
+
+    union
+      {
+       /* Used by LOC_BASEREG and LOC_BASEREG_ARG.  */
+       short basereg;
+      }
+    aux_value;
 
 
-  /* Link to a list of aliases for this symbol.
-     Only a "primary/main symbol may have aliases.  */
-  struct alias_list *aliases;
+    /* Link to a list of aliases for this symbol.
+       Only a "primary/main symbol may have aliases.  */
+    struct alias_list *aliases;
 
-  /* List of ranges where this symbol is active.  This is only
-     used by alias symbols at the current time.  */
-  struct range_list *ranges;
-};
+    /* List of ranges where this symbol is active.  This is only
+       used by alias symbols at the current time.  */
+    struct range_list *ranges;
+  };
 
 
 #define SYMBOL_NAMESPACE(symbol)       (symbol)->namespace
@@ -725,34 +731,34 @@ struct symbol
    normal symtab once the partial_symtab has been referenced.  */
 
 struct partial_symbol
-{
+  {
 
-  /* The general symbol info required for all types of symbols. */
+    /* The general symbol info required for all types of symbols. */
 
-  struct general_symbol_info ginfo;
+    struct general_symbol_info ginfo;
 
-  /* Name space code.  */
+    /* Name space code.  */
 
-  namespace_enum namespace BYTE_BITFIELD;
+    namespace_enum namespace BYTE_BITFIELD;
 
-  /* Address class (for info_symbols) */
+    /* Address class (for info_symbols) */
 
-  enum address_class aclass BYTE_BITFIELD;
+    enum address_class aclass BYTE_BITFIELD;
 
-};
+  };
 
 #define PSYMBOL_NAMESPACE(psymbol)     (psymbol)->namespace
 #define PSYMBOL_CLASS(psymbol)         (psymbol)->aclass
-
 \f
+
 /* Source-file information.  This describes the relation between source files,
    ine numbers and addresses in the program text.  */
 
 struct sourcevector
-{
-  int length;                  /* Number of source files described */
-  struct source *source[1];    /* Descriptions of the files */
-};
+  {
+    int length;                        /* Number of source files described */
+    struct source *source[1];  /* Descriptions of the files */
+  };
 
 /* Each item represents a line-->pc (or the reverse) mapping.  This is
    somewhat more wasteful of space than one might wish, but since only
@@ -760,10 +766,10 @@ struct sourcevector
    waste much space.  */
 
 struct linetable_entry
-{
-  int line;
-  CORE_ADDR pc;
-};
+  {
+    int line;
+    CORE_ADDR pc;
+  };
 
 /* The order of entries in the linetable is significant.  They should
    be sorted by increasing values of the pc field.  If there is more than
@@ -772,30 +778,30 @@ struct linetable_entry
 
    Example: a C for statement generally looks like this
 
-       10      0x100   - for the init/test part of a for stmt.
-       20      0x200
-       30      0x300
-       10      0x400   - for the increment part of a for stmt.
+   10   0x100   - for the init/test part of a for stmt.
+   20   0x200
+   30   0x300
+   10   0x400   - for the increment part of a for stmt.
 
  */
+ */
 
 struct linetable
-{
-  int nitems;
+  {
+    int nitems;
 
-  /* Actually NITEMS elements.  If you don't like this use of the
-     `struct hack', you can shove it up your ANSI (seriously, if the
-     committee tells us how to do it, we can probably go along).  */
-  struct linetable_entry item[1];
-};
+    /* Actually NITEMS elements.  If you don't like this use of the
+       `struct hack', you can shove it up your ANSI (seriously, if the
+       committee tells us how to do it, we can probably go along).  */
+    struct linetable_entry item[1];
+  };
 
 /* All the information on one source file.  */
 
 struct source
-{
-  char *name;                  /* Name of file */
-  struct linetable contents;
-};
+  {
+    char *name;                        /* Name of file */
+    struct linetable contents;
+  };
 
 /* How to relocate the symbols from each section in a symbol file.
    Each struct contains an array of offsets.
@@ -809,13 +815,13 @@ struct source
 
 struct section_offsets
   {
-    CORE_ADDR offsets[1];              /* As many as needed. */
+    CORE_ADDR offsets[1];      /* As many as needed. */
   };
 
 #define        ANOFFSET(secoff, whichone)      (secoff->offsets[whichone])
 
 /* The maximum possible size of a section_offsets table.  */
+
 #define SIZEOF_SECTION_OFFSETS \
   (sizeof (struct section_offsets) \
    + sizeof (((struct section_offsets *) 0)->offsets) * (SECT_OFF_MAX-1))
@@ -864,19 +870,19 @@ struct symtab
     /* This component says how to free the data we point to:
        free_contents => do a tree walk and free each object.
        free_nothing => do nothing; some other symtab will free
-         the data this one uses.
-      free_linetable => free just the linetable.  FIXME: Is this redundant
-      with the primary field?  */
+       the data this one uses.
+       free_linetable => free just the linetable.  FIXME: Is this redundant
+       with the primary field?  */
 
     enum free_code
       {
        free_nothing, free_contents, free_linetable
-       }
+      }
     free_code;
 
     /* Pointer to one block of storage to be freed, if nonzero.  */
     /* This is IN ADDITION to the action indicated by free_code.  */
-    
+
     char *free_ptr;
 
     /* Total number of lines found in source file.  */
@@ -917,8 +923,8 @@ struct symtab
 
 #define BLOCKVECTOR(symtab)    (symtab)->blockvector
 #define LINETABLE(symtab)      (symtab)->linetable
-
 \f
+
 /* Each source file that has not been fully read in is represented by
    a partial_symtab.  This contains the information on where in the
    executable the debugging symbols for a specific file are, and a
@@ -931,90 +937,90 @@ struct symtab
    style execution of a bunch of .o's.  */
 
 struct partial_symtab
-{
+  {
 
-  /* Chain of all existing partial symtabs.  */
+    /* Chain of all existing partial symtabs.  */
 
-  struct partial_symtab *next;
+    struct partial_symtab *next;
 
-  /* Name of the source file which this partial_symtab defines */
+    /* Name of the source file which this partial_symtab defines */
 
-  char *filename;
+    char *filename;
 
-  /* Information about the object file from which symbols should be read.  */
+    /* Information about the object file from which symbols should be read.  */
 
-  struct objfile *objfile;
+    struct objfile *objfile;
 
-  /* Set of relocation offsets to apply to each section.  */ 
+    /* Set of relocation offsets to apply to each section.  */
 
-  struct section_offsets *section_offsets;
+    struct section_offsets *section_offsets;
 
-  /* Range of text addresses covered by this file; texthigh is the
-     beginning of the next section. */
+    /* Range of text addresses covered by this file; texthigh is the
+       beginning of the next section. */
 
-  CORE_ADDR textlow;
-  CORE_ADDR texthigh;
+    CORE_ADDR textlow;
+    CORE_ADDR texthigh;
 
-  /* Array of pointers to all of the partial_symtab's which this one
-     depends on.  Since this array can only be set to previous or
-     the current (?) psymtab, this dependency tree is guaranteed not
-     to have any loops.  "depends on" means that symbols must be read
-     for the dependencies before being read for this psymtab; this is
-     for type references in stabs, where if foo.c includes foo.h, declarations
-     in foo.h may use type numbers defined in foo.c.  For other debugging
-     formats there may be no need to use dependencies.  */
+    /* Array of pointers to all of the partial_symtab's which this one
+       depends on.  Since this array can only be set to previous or
+       the current (?) psymtab, this dependency tree is guaranteed not
+       to have any loops.  "depends on" means that symbols must be read
+       for the dependencies before being read for this psymtab; this is
+       for type references in stabs, where if foo.c includes foo.h, declarations
+       in foo.h may use type numbers defined in foo.c.  For other debugging
+       formats there may be no need to use dependencies.  */
 
-  struct partial_symtab **dependencies;
+    struct partial_symtab **dependencies;
 
-  int number_of_dependencies;
+    int number_of_dependencies;
 
-  /* Global symbol list.  This list will be sorted after readin to
-     improve access.  Binary search will be the usual method of
-     finding a symbol within it. globals_offset is an integer offset
-     within global_psymbols[].  */
+    /* Global symbol list.  This list will be sorted after readin to
+       improve access.  Binary search will be the usual method of
+       finding a symbol within it. globals_offset is an integer offset
+       within global_psymbols[].  */
 
-  int globals_offset;
-  int n_global_syms;
+    int globals_offset;
+    int n_global_syms;
 
-  /* Static symbol list.  This list will *not* be sorted after readin;
-     to find a symbol in it, exhaustive search must be used.  This is
-     reasonable because searches through this list will eventually
-     lead to either the read in of a files symbols for real (assumed
-     to take a *lot* of time; check) or an error (and we don't care
-     how long errors take).  This is an offset and size within
-     static_psymbols[].  */
+    /* Static symbol list.  This list will *not* be sorted after readin;
+       to find a symbol in it, exhaustive search must be used.  This is
+       reasonable because searches through this list will eventually
+       lead to either the read in of a files symbols for real (assumed
+       to take a *lot* of time; check) or an error (and we don't care
+       how long errors take).  This is an offset and size within
+       static_psymbols[].  */
 
-  int statics_offset;
-  int n_static_syms;
+    int statics_offset;
+    int n_static_syms;
 
-  /* Pointer to symtab eventually allocated for this source file, 0 if
-     !readin or if we haven't looked for the symtab after it was readin.  */
+    /* Pointer to symtab eventually allocated for this source file, 0 if
+       !readin or if we haven't looked for the symtab after it was readin.  */
 
-  struct symtab *symtab;
+    struct symtab *symtab;
 
-  /* Pointer to function which will read in the symtab corresponding to
-     this psymtab.  */
+    /* Pointer to function which will read in the symtab corresponding to
+       this psymtab.  */
 
-  void (*read_symtab) PARAMS ((struct partial_symtab *));
+    void (*read_symtab) PARAMS ((struct partial_symtab *));
 
-  /* Information that lets read_symtab() locate the part of the symbol table
-     that this psymtab corresponds to.  This information is private to the
-     format-dependent symbol reading routines.  For further detail examine
-     the various symbol reading modules.  Should really be (void *) but is
-     (char *) as with other such gdb variables.  (FIXME) */
+    /* Information that lets read_symtab() locate the part of the symbol table
+       that this psymtab corresponds to.  This information is private to the
+       format-dependent symbol reading routines.  For further detail examine
+       the various symbol reading modules.  Should really be (void *) but is
+       (char *) as with other such gdb variables.  (FIXME) */
 
-  char *read_symtab_private;
+    char *read_symtab_private;
 
-  /* Non-zero if the symtab corresponding to this psymtab has been readin */
+    /* Non-zero if the symtab corresponding to this psymtab has been readin */
 
-  unsigned char readin;
-};
+    unsigned char readin;
+  };
 
 /* A fast way to get from a psymtab to its symtab (after the first time).  */
 #define        PSYMTAB_TO_SYMTAB(pst)  \
     ((pst) -> symtab != NULL ? (pst) -> symtab : psymtab_to_symtab (pst))
-
 \f
+
 /* The virtual function table is now an array of structures which have the
    form { int16 offset, delta; void *pfn; }. 
 
@@ -1025,7 +1031,7 @@ struct partial_symtab
    PFN is a pointer to the virtual function.
 
    Note that this macro is g++ specific (FIXME). */
-  
+
 #define VTBL_FNADDR_OFFSET 2
 
 /* Macro that yields non-zero value iff NAME is the prefix for C++ operator
@@ -1053,8 +1059,8 @@ struct partial_symtab
 
 #define DESTRUCTOR_PREFIX_P(NAME) \
   ((NAME)[0] == '_' && is_cplus_marker ((NAME)[1]) && (NAME)[2] == '_')
-
 \f
+
 /* External variables and functions for the objects described above. */
 
 /* This symtab variable specifies the current file for printing source lines */
@@ -1082,97 +1088,97 @@ extern int asm_demangle;
 /* lookup a symbol table by source file name */
 
 extern struct symtab *
-lookup_symtab PARAMS ((char *));
+  lookup_symtab PARAMS ((char *));
 
 /* lookup a symbol by name (optional block, optional symtab) */
 
 extern struct symbol *
-lookup_symbol PARAMS ((const char *, const struct block *,
-                      const namespace_enum, int *, struct symtab **));
+  lookup_symbol PARAMS ((const char *, const struct block *,
+                        const namespace_enum, int *, struct symtab **));
 
 /* lookup a symbol by name, within a specified block */
-  
+
 extern struct symbol *
-lookup_block_symbol PARAMS ((const struct block *, const char *,
-                            const namespace_enum));
+  lookup_block_symbol PARAMS ((const struct block *, const char *,
+                              const namespace_enum));
 
 /* lookup a [struct, union, enum] by name, within a specified block */
 
 extern struct type *
-lookup_struct PARAMS ((char *, struct block *));
+  lookup_struct PARAMS ((char *, struct block *));
 
 extern struct type *
-lookup_union PARAMS ((char *, struct block *));
+  lookup_union PARAMS ((char *, struct block *));
 
 extern struct type *
-lookup_enum PARAMS ((char *, struct block *));
+  lookup_enum PARAMS ((char *, struct block *));
 
 /* lookup the function corresponding to the block */
 
 extern struct symbol *
-block_function PARAMS ((struct block *));
+  block_function PARAMS ((struct block *));
 
 /* from blockframe.c: */
 
 /* lookup the function symbol corresponding to the address */
 
 extern struct symbol *
-find_pc_function PARAMS ((CORE_ADDR));
+  find_pc_function PARAMS ((CORE_ADDR));
 
 /* lookup the function corresponding to the address and section */
 
 extern struct symbol *
-find_pc_sect_function PARAMS ((CORE_ADDR, asection *));
-  
+  find_pc_sect_function PARAMS ((CORE_ADDR, asection *));
+
 /* lookup function from address, return name, start addr and end addr */
 
-extern int 
+extern int
 find_pc_partial_function PARAMS ((CORE_ADDR, char **,
-                                            CORE_ADDR *, CORE_ADDR *));
+                                 CORE_ADDR *, CORE_ADDR *));
 
 extern void
 clear_pc_function_cache PARAMS ((void));
 
-extern int 
-find_pc_sect_partial_function PARAMS ((CORE_ADDR, asection *, 
-                                       char **, CORE_ADDR *, CORE_ADDR *));
+extern int
+find_pc_sect_partial_function PARAMS ((CORE_ADDR, asection *,
+                                      char **, CORE_ADDR *, CORE_ADDR *));
 
 /* from symtab.c: */
 
 /* lookup partial symbol table by filename */
 
 extern struct partial_symtab *
-lookup_partial_symtab PARAMS ((char *));
+  lookup_partial_symtab PARAMS ((char *));
 
 /* lookup partial symbol table by address */
 
 extern struct partial_symtab *
-find_pc_psymtab PARAMS ((CORE_ADDR));
+  find_pc_psymtab PARAMS ((CORE_ADDR));
 
 /* lookup partial symbol table by address and section */
 
 extern struct partial_symtab *
-find_pc_sect_psymtab PARAMS ((CORE_ADDR, asection *));
+  find_pc_sect_psymtab PARAMS ((CORE_ADDR, asection *));
 
 /* lookup full symbol table by address */
 
 extern struct symtab *
-find_pc_symtab PARAMS ((CORE_ADDR));
+  find_pc_symtab PARAMS ((CORE_ADDR));
 
 /* lookup full symbol table by address and section */
 
 extern struct symtab *
-find_pc_sect_symtab PARAMS ((CORE_ADDR, asection *));
+  find_pc_sect_symtab PARAMS ((CORE_ADDR, asection *));
 
 /* lookup partial symbol by address */
 
 extern struct partial_symbol *
-find_pc_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR));
+  find_pc_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR));
 
 /* lookup partial symbol by address and section */
 
 extern struct partial_symbol *
-find_pc_sect_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR, asection *));
+  find_pc_sect_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR, asection *));
 
 extern int
 find_pc_line_pc_range PARAMS ((CORE_ADDR, CORE_ADDR *, CORE_ADDR *));
@@ -1184,7 +1190,7 @@ extern void
 reread_symbols PARAMS ((void));
 
 extern struct type *
-lookup_transparent_type PARAMS ((const char *));
+  lookup_transparent_type PARAMS ((const char *));
 
 
 /* Macro for name of symbol to indicate a file compiled with gcc. */
@@ -1208,7 +1214,7 @@ extern struct minimal_symbol *prim_record_minimal_symbol_and_info
   PARAMS ((const char *, CORE_ADDR,
           enum minimal_symbol_type,
           char *info, int section,
-          asection *bfd_section,
+          asection * bfd_section,
           struct objfile *));
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -1218,27 +1224,27 @@ extern CORE_ADDR find_stab_function_addr PARAMS ((char *,
 #endif
 
 extern struct minimal_symbol *
-lookup_minimal_symbol PARAMS ((const char *, const char *, struct objfile *));
+  lookup_minimal_symbol PARAMS ((const char *, const char *, struct objfile *));
 
 extern struct minimal_symbol *
-lookup_minimal_symbol_text PARAMS ((const char *, const char *, struct objfile *));
+  lookup_minimal_symbol_text PARAMS ((const char *, const char *, struct objfile *));
 
 struct minimal_symbol *
-lookup_minimal_symbol_solib_trampoline PARAMS ((const char *,
-                                               const char *,
-                                               struct objfile *));
+  lookup_minimal_symbol_solib_trampoline PARAMS ((const char *,
+                                                 const char *,
+                                                 struct objfile *));
 
 extern struct minimal_symbol *
-lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR));
+  lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR));
 
 extern struct minimal_symbol *
-lookup_minimal_symbol_by_pc_section PARAMS ((CORE_ADDR, asection *));
+  lookup_minimal_symbol_by_pc_section PARAMS ((CORE_ADDR, asection *));
 
 extern struct minimal_symbol *
-lookup_solib_trampoline_symbol_by_pc PARAMS ((CORE_ADDR));
+  lookup_solib_trampoline_symbol_by_pc PARAMS ((CORE_ADDR));
 
 extern CORE_ADDR
-find_solib_trampoline_target PARAMS ((CORE_ADDR));
+  find_solib_trampoline_target PARAMS ((CORE_ADDR));
 
 extern void
 init_minimal_symbol_collection PARAMS ((void));
@@ -1251,20 +1257,20 @@ install_minimal_symbols PARAMS ((struct objfile *));
 
 /* Sort all the minimal symbols in OBJFILE.  */
 
-extern void msymbols_sort PARAMS ((struct objfile *objfile));
+extern void msymbols_sort PARAMS ((struct objfile * objfile));
 
 struct symtab_and_line
-{
-  struct symtab *symtab;
-  asection      *section;
-  /* Line number.  Line numbers start at 1 and proceed through symtab->nlines.
-     0 is never a valid line number; it is used to indicate that line number
-     information is not available.  */
-  int line;
-
-  CORE_ADDR pc;
-  CORE_ADDR end;
-};
+  {
+    struct symtab *symtab;
+    asection *section;
+    /* Line number.  Line numbers start at 1 and proceed through symtab->nlines.
+       0 is never a valid line number; it is used to indicate that line number
+       information is not available.  */
+    int line;
+
+    CORE_ADDR pc;
+    CORE_ADDR end;
+  };
 
 #define INIT_SAL(sal) { \
   (sal)->symtab  = 0;   \
@@ -1275,34 +1281,36 @@ struct symtab_and_line
 }
 
 struct symtabs_and_lines
-{
-  struct symtab_and_line *sals;
-  int nelts;
-};
+  {
+    struct symtab_and_line *sals;
+    int nelts;
+  };
+\f
 
 
-\f
 /* Some types and macros needed for exception catchpoints.
    Can't put these in target.h because symtab_and_line isn't
    known there. This file will be included by breakpoint.c,
    hppa-tdep.c, etc. */
 
 /* Enums for exception-handling support */
-enum exception_event_kind {
-  EX_EVENT_THROW,
-  EX_EVENT_CATCH
-};
+enum exception_event_kind
+  {
+    EX_EVENT_THROW,
+    EX_EVENT_CATCH
+  };
 
 /* Type for returning info about an exception */
-struct exception_event_record {
-  enum exception_event_kind   kind;
-  struct symtab_and_line      throw_sal;
-  struct symtab_and_line      catch_sal;
-  /* This may need to be extended in the future, if
-     some platforms allow reporting more information,
-     such as point of rethrow, type of exception object,
-     type expected by catch clause, etc. */ 
-};
+struct exception_event_record
+  {
+    enum exception_event_kind kind;
+    struct symtab_and_line throw_sal;
+    struct symtab_and_line catch_sal;
+    /* This may need to be extended in the future, if
+       some platforms allow reporting more information,
+       such as point of rethrow, type of exception object,
+       type expected by catch clause, etc. */
+  };
 
 #define CURRENT_EXCEPTION_KIND       (current_exception_event->kind)
 #define CURRENT_EXCEPTION_CATCH_SAL  (current_exception_event->catch_sal)
@@ -1331,14 +1339,14 @@ find_pc_sect_line PARAMS ((CORE_ADDR, asection *, int));
    address in inferior memory of the symbol through 3rd arg.  */
 
 extern struct symbol *
-find_addr_symbol PARAMS ((CORE_ADDR, struct symtab **, CORE_ADDR *));
+  find_addr_symbol PARAMS ((CORE_ADDR, struct symtab **, CORE_ADDR *));
 
 /* Given a symtab and line number, return the pc there.  */
 
 extern int
 find_line_pc PARAMS ((struct symtab *, int, CORE_ADDR *));
 
-extern int 
+extern int
 find_line_pc_range PARAMS ((struct symtab_and_line,
                            CORE_ADDR *, CORE_ADDR *));
 
@@ -1385,13 +1393,13 @@ free_symtab PARAMS ((struct symtab *));
 /* Symbol-reading stuff in symfile.c and solib.c.  */
 
 extern struct symtab *
-psymtab_to_symtab PARAMS ((struct partial_symtab *));
+  psymtab_to_symtab PARAMS ((struct partial_symtab *));
 
 extern void
 clear_solib PARAMS ((void));
 
 extern struct objfile *
-symbol_file_add PARAMS ((char *, int, CORE_ADDR, int, int, int, int, int));
+  symbol_file_add PARAMS ((char *, int, CORE_ADDR, int, int, int, int, int));
 
 /* source.c */
 
@@ -1410,21 +1418,21 @@ select_source_symtab PARAMS ((struct symtab *));
 extern char **make_symbol_completion_list PARAMS ((char *, char *));
 
 extern struct symbol **
-make_symbol_overload_list PARAMS ((struct symbol *));
+  make_symbol_overload_list PARAMS ((struct symbol *));
 
 /* symtab.c */
 
 extern struct partial_symtab *
-find_main_psymtab PARAMS ((void));
+  find_main_psymtab PARAMS ((void));
 
 /* blockframe.c */
 
 extern struct blockvector *
-blockvector_for_pc PARAMS ((CORE_ADDR, int *));
+  blockvector_for_pc PARAMS ((CORE_ADDR, int *));
 
 extern struct blockvector *
-blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *, 
-                                struct symtab *));
+  blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *,
+                                  struct symtab *));
 
 /* symfile.c */
 
@@ -1440,32 +1448,32 @@ extern int
 in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start));
 
 extern struct symbol *
-fixup_symbol_section PARAMS ((struct symbol  *, struct objfile *));
+  fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
 
 /* Symbol searching */
 
 /* When using search_symbols, a list of the following structs is returned.
    Callers must free the search list using free_symbol_search! */
 struct symbol_search
-{
-  /* The block in which the match was found. Could be, for example,
-     STATIC_BLOCK or GLOBAL_BLOCK. */
-  int block;
+  {
+    /* The block in which the match was found. Could be, for example,
+       STATIC_BLOCK or GLOBAL_BLOCK. */
+    int block;
 
-  /* Information describing what was found.
+    /* Information describing what was found.
 
-     If symtab abd symbol are NOT NULL, then information was found
-     for this match. */
-  struct symtab *symtab;
-  struct symbol *symbol;
+       If symtab abd symbol are NOT NULL, then information was found
+       for this match. */
+    struct symtab *symtab;
+    struct symbol *symbol;
 
-  /* If msymbol is non-null, then a match was made on something for
-     which only minimal_symbols exist. */
-  struct minimal_symbol *msymbol;
+    /* If msymbol is non-null, then a match was made on something for
+       which only minimal_symbols exist. */
+    struct minimal_symbol *msymbol;
 
-  /* A link to the next match, or NULL for the end. */
-  struct symbol_search *next;
-};
+    /* A link to the next match, or NULL for the end. */
+    struct symbol_search *next;
+  };
 
 extern void search_symbols PARAMS ((char *, namespace_enum, int, char **, struct symbol_search **));
 extern void free_search_symbols PARAMS ((struct symbol_search *));
index 8bf851d0f4b46f280666975f976a6bf7c6c5afb2..bbbb7b5a41e1db82d99ab0629be27cfbb27d090b 100644 (file)
@@ -3,21 +3,22 @@
    Contributed by the State University of New York at Buffalo, by the
    Distributed Computer Systems Lab, Department of Computer Science, 1991.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -40,24 +41,24 @@ tahoe_skip_prologue (pc)
 {
   register int op = (unsigned char) read_memory_integer (pc, 1);
   if (op == 0x11)
-    pc += 2;  /* skip brb */
+    pc += 2;                   /* skip brb */
   if (op == 0x13)
-    pc += 3;  /* skip brw */
+    pc += 3;                   /* skip brw */
   if (op == 0x2c
-      && ((unsigned char) read_memory_integer (pc+2, 1)) == 0x5e)
-    pc += 3;  /* skip subl2 */
+      && ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5e)
+    pc += 3;                   /* skip subl2 */
   if (op == 0xe9
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xae
-      && ((unsigned char) read_memory_integer(pc+3, 1)) == 0x5e)
-    pc += 4;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xae
+      && ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5e)
+    pc += 4;                   /* skip movab */
   if (op == 0xe9
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xce
-      && ((unsigned char) read_memory_integer(pc+4, 1)) == 0x5e)
-    pc += 5;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xce
+      && ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5e)
+    pc += 5;                   /* skip movab */
   if (op == 0xe9
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xee
-      && ((unsigned char) read_memory_integer(pc+6, 1)) == 0x5e)
-    pc += 7;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xee
+      && ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5e)
+    pc += 7;                   /* skip movab */
   return pc;
 }
 
@@ -68,7 +69,7 @@ int
 tahoe_frame_num_args (fi)
      struct frame_info *fi;
 {
-  return (((0xffff & read_memory_integer(((fi)->frame-4),4)) - 4) >> 2);
+  return (((0xffff & read_memory_integer (((fi)->frame - 4), 4)) - 4) >> 2);
 }
 
 /* Print the Tahoe instruction at address MEMADDR in debugged memory,
@@ -88,7 +89,7 @@ tahoe_print_insn (memaddr, stream)
 
   for (i = 0; i < NOPCODES; i++)
     if (votstrs[i].detail.code == buffer[0]
-       || votstrs[i].detail.code == *(unsigned short *)buffer)
+       || votstrs[i].detail.code == *(unsigned short *) buffer)
       break;
 
   /* Handle undefined instructions.  */
@@ -152,7 +153,7 @@ print_insn_arg (d, p, addr, stream)
       case 3:                  /* Literal (short immediate byte) mode */
        if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
          {
-           *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
+           *(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
            fprintf_unfiltered (stream, "$%f", floatlitbuf);
          }
        else
@@ -174,13 +175,13 @@ print_insn_arg (d, p, addr, stream)
        fprintf_unfiltered (stream, "(%s)", REGISTER_NAME (regnum));
        break;
 
-      case 9:                  /* Absolute Address & Autoincrement deferred */
+      case 9:                  /* Absolute Address & Autoincrement deferred */
        fputc_unfiltered ('*', stream);
        if (regnum == PC_REGNUM)
          {
            temp1 = *p;
            temp1 <<= 8;
-           temp1 |= *(p +1);
+           temp1 |= *(p + 1);
 
            fputc_unfiltered ('$', stream);
            print_address (temp1, stream);
@@ -188,38 +189,38 @@ print_insn_arg (d, p, addr, stream)
            break;
          }
       case 8:                  /*Immediate & Autoincrement SP */
-        if (regnum == 8)         /*88 is Immediate Byte Mode*/
+       if (regnum == 8)        /*88 is Immediate Byte Mode */
          fprintf_unfiltered (stream, "$%d", *p++);
 
-       else if (regnum == 9)        /*89 is Immediate Word Mode*/
+       else if (regnum == 9)   /*89 is Immediate Word Mode */
          {
            temp1 = *p;
-           temp1 <<= 8; 
-           temp1 |= *(p +1);
+           temp1 <<= 8;
+           temp1 |= *(p + 1);
            fprintf_unfiltered (stream, "$%d", temp1);
            p += 2;
-         }  
+         }
 
-       else if (regnum == PC_REGNUM)    /*8F is Immediate Long Mode*/
+       else if (regnum == PC_REGNUM)   /*8F is Immediate Long Mode */
          {
            temp1 = *p;
-           temp1 <<=8;
-           temp1 |= *(p +1);
-           temp1 <<=8;
-           temp1 |= *(p +2);
            temp1 <<= 8;
-           temp1 |= *(p +3);
+           temp1 |= *(p + 1);
+           temp1 <<= 8;
+           temp1 |= *(p + 2);
+           temp1 <<= 8;
+           temp1 |= *(p + 3);
            fprintf_unfiltered (stream, "$%d", temp1);
            p += 4;
          }
 
-       else                            /*8E is Autoincrement SP Mode*/
-             fprintf_unfiltered (stream, "(%s)+", REGISTER_NAME (regnum));
+       else                    /*8E is Autoincrement SP Mode */
+         fprintf_unfiltered (stream, "(%s)+", REGISTER_NAME (regnum));
        break;
 
-      case 11:                 /* Register + Byte Displacement Deferred Mode*/
+      case 11:                 /* Register + Byte Displacement Deferred Mode */
        fputc_unfiltered ('*', stream);
-      case 10:                 /* Register + Byte Displacement Mode*/
+      case 10:                 /* Register + Byte Displacement Mode */
        if (regnum == PC_REGNUM)
          print_address (addr + *p + 2, stream);
        else
@@ -227,12 +228,12 @@ print_insn_arg (d, p, addr, stream)
        p += 1;
        break;
 
-      case 13:                 /* Register + Word Displacement Deferred Mode*/
+      case 13:                 /* Register + Word Displacement Deferred Mode */
        fputc_unfiltered ('*', stream);
-      case 12:                 /* Register + Word Displacement Mode*/
+      case 12:                 /* Register + Word Displacement Mode */
        temp1 = *p;
        temp1 <<= 8;
-       temp1 |= *(p +1);
+       temp1 |= *(p + 1);
        if (regnum == PC_REGNUM)
          print_address (addr + temp1 + 3, stream);
        else
@@ -240,16 +241,16 @@ print_insn_arg (d, p, addr, stream)
        p += 2;
        break;
 
-      case 15:                 /* Register + Long Displacement Deferred Mode*/
+      case 15:                 /* Register + Long Displacement Deferred Mode */
        fputc_unfiltered ('*', stream);
-      case 14:                 /* Register + Long Displacement Mode*/
+      case 14:                 /* Register + Long Displacement Mode */
        temp1 = *p;
        temp1 <<= 8;
-       temp1 |= *(p +1);
+       temp1 |= *(p + 1);
        temp1 <<= 8;
-       temp1 |= *(p +2);
+       temp1 |= *(p + 2);
        temp1 <<= 8;
-       temp1 |= *(p +3);
+       temp1 |= *(p + 3);
        if (regnum == PC_REGNUM)
          print_address (addr + temp1 + 5, stream);
        else
@@ -259,16 +260,3 @@ print_insn_arg (d, p, addr, stream)
 
   return (unsigned char *) p;
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
index 1c033bd057d5e41a0a8a04fea86bcd1c2d21bd86..9ba43fdfd6ccb39c13bf1fe92a2c8db35ffd3596 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 1992-1995, 1998, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <errno.h>
@@ -77,7 +78,7 @@ static void
 target_command PARAMS ((char *, int));
 
 static struct target_ops *
-find_default_run_target PARAMS ((char *));
+  find_default_run_target PARAMS ((char *));
 
 static void
 update_current_target PARAMS ((void));
@@ -93,7 +94,7 @@ static void normal_target_post_startup_inferior PARAMS ((int pid));
 
 static int
 target_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
-                           int write, asection *bfd_section));
+                           int write, asection * bfd_section));
 
 static void init_dummy_target PARAMS ((void));
 
@@ -178,7 +179,7 @@ debug_to_thread_alive PARAMS ((int));
 static void
 debug_to_stop PARAMS ((void));
 
-static int debug_to_query PARAMS ((int/*char*/, char *, char *, int *));
+static int debug_to_query PARAMS ((int /*char */ , char *, char *, int *));
 
 /* Pointer to array of target architecture structures; the size of the
    array; the current index into the array; the allocated size of the 
@@ -246,11 +247,11 @@ add_target (t)
     {
       target_struct_allocsize *= 2;
       target_structs = (struct target_ops **)
-         xrealloc ((char *) target_structs, 
-                   target_struct_allocsize * sizeof (*target_structs));
+       xrealloc ((char *) target_structs,
+                 target_struct_allocsize * sizeof (*target_structs));
     }
   target_structs[target_struct_size++] = t;
-/*  cleanup_target (t);*/
+/*  cleanup_target (t); */
 
   if (targetlist == NULL)
     add_prefix_cmd ("target", class_run, target_command,
@@ -279,8 +280,8 @@ nomemory (memaddr, myaddr, len, write, t)
      int write;
      struct target_ops *t;
 {
-  errno = EIO;         /* Can't read/write this location */
-  return 0;            /* No bytes handled */
+  errno = EIO;                 /* Can't read/write this location */
+  return 0;                    /* No bytes handled */
 }
 
 static void
@@ -302,7 +303,7 @@ nosymbol (name, addrp)
      char *name;
      CORE_ADDR *addrp;
 {
-  return 1;            /* Symbol does not exist in target env */
+  return 1;                    /* Symbol does not exist in target env */
 }
 
 /* ARGSUSED */
@@ -322,7 +323,7 @@ default_terminal_info (args, from_tty)
      char *args;
      int from_tty;
 {
-  printf_unfiltered("No saved terminal information.\n");
+  printf_unfiltered ("No saved terminal information.\n");
 }
 
 /* This is the default target_create_inferior and target_attach function.
@@ -338,16 +339,19 @@ kill_or_be_killed (from_tty)
     {
       printf_unfiltered ("You are already running a program:\n");
       target_files_info ();
-      if (query ("Kill it? ")) {
-       target_kill ();
-       if (target_has_execution)
-         error ("Killing the program did not help.");
-       return;
-      } else {
-       error ("Program not killed.");
-      }
+      if (query ("Kill it? "))
+       {
+         target_kill ();
+         if (target_has_execution)
+           error ("Killing the program did not help.");
+         return;
+       }
+      else
+       {
+         error ("Program not killed.");
+       }
     }
-  tcomplain();
+  tcomplain ();
 }
 
 static void
@@ -371,8 +375,8 @@ maybe_kill_then_create_inferior (exec, args, env)
 
 static void
 default_clone_and_follow_inferior (child_pid, followed_child)
-  int  child_pid;
-  int  *followed_child;
+     int child_pid;
+     int *followed_child;
 {
   target_clone_and_follow_inferior (child_pid, followed_child);
 }
@@ -388,63 +392,63 @@ cleanup_target (t)
 #define de_fault(field, value) \
   if (!t->field)       t->field = value
 
-  /*        FIELD                      DEFAULT VALUE        */
-
-  de_fault (to_open,                   (void (*) PARAMS((char *, int))) tcomplain);
-  de_fault (to_close,                  (void (*) PARAMS((int))) target_ignore);
-  de_fault (to_attach,                         maybe_kill_then_attach);
-  de_fault (to_post_attach,             (void (*) PARAMS ((int))) target_ignore);
-  de_fault (to_require_attach,          maybe_kill_then_attach);
-  de_fault (to_detach,                         (void (*) PARAMS((char *, int))) target_ignore);
-  de_fault (to_require_detach,          (void (*) PARAMS((int, char *, int))) target_ignore);
-  de_fault (to_resume,                         (void (*) PARAMS((int, int, enum target_signal))) noprocess);
-  de_fault (to_wait,                   (int (*) PARAMS((int, struct target_waitstatus *))) noprocess);
-  de_fault (to_post_wait,               (void (*) PARAMS ((int, int))) target_ignore);
-  de_fault (to_fetch_registers,        (void (*) PARAMS((int))) target_ignore);
-  de_fault (to_store_registers,                (void (*) PARAMS((int))) noprocess);
-  de_fault (to_prepare_to_store,       (void (*) PARAMS((void))) noprocess);
-  de_fault (to_xfer_memory,            (int (*) PARAMS((CORE_ADDR, char *, int, int, struct target_ops *))) nomemory);
-  de_fault (to_files_info,             (void (*) PARAMS((struct target_ops *))) target_ignore);
-  de_fault (to_insert_breakpoint,      memory_insert_breakpoint);
-  de_fault (to_remove_breakpoint,      memory_remove_breakpoint);
-  de_fault (to_terminal_init,          (void (*) PARAMS((void))) target_ignore);
-  de_fault (to_terminal_inferior,      (void (*) PARAMS ((void))) target_ignore);
-  de_fault (to_terminal_ours_for_output,(void (*) PARAMS ((void))) target_ignore);
-  de_fault (to_terminal_ours,          (void (*) PARAMS ((void))) target_ignore);
-  de_fault (to_terminal_info,          default_terminal_info);
-  de_fault (to_kill,                   (void (*) PARAMS((void))) noprocess);
-  de_fault (to_load,                   (void (*) PARAMS((char *, int))) tcomplain);
-  de_fault (to_lookup_symbol,          (int (*) PARAMS ((char *, CORE_ADDR *))) nosymbol);
-  de_fault (to_create_inferior,                maybe_kill_then_create_inferior);
-  de_fault (to_post_startup_inferior,   (void (*) PARAMS ((int))) target_ignore);
-  de_fault (to_acknowledge_created_inferior,            (void (*) PARAMS((int))) target_ignore);
-  de_fault (to_clone_and_follow_inferior,               default_clone_and_follow_inferior);
-  de_fault (to_post_follow_inferior_by_clone,           (void (*) PARAMS ((void))) target_ignore);
-  de_fault (to_insert_fork_catchpoint,  (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_remove_fork_catchpoint,  (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_insert_vfork_catchpoint, (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_remove_vfork_catchpoint, (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_has_forked,              (int (*) PARAMS ((int, int *))) return_zero);
-  de_fault (to_has_vforked,             (int (*) PARAMS ((int, int *))) return_zero);
-  de_fault (to_can_follow_vfork_prior_to_exec, (int (*) PARAMS ((void ))) return_zero);
-  de_fault (to_post_follow_vfork,       (void (*) PARAMS ((int, int, int, int))) target_ignore);
-  de_fault (to_insert_exec_catchpoint,  (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_remove_exec_catchpoint,  (int (*) PARAMS ((int))) tcomplain);
-  de_fault (to_has_execd,               (int (*) PARAMS ((int, char **))) return_zero);
-  de_fault (to_reported_exec_events_per_exec_call, (int (*) PARAMS ((void))) return_one);
-  de_fault (to_has_syscall_event,       (int (*) PARAMS ((int, enum target_waitkind *, int *))) return_zero);
-  de_fault (to_has_exited,              (int (*) PARAMS ((int, int, int *))) return_zero);
-  de_fault (to_mourn_inferior,         (void (*) PARAMS ((void))) noprocess);
-  de_fault (to_can_run,                        return_zero);
-  de_fault (to_notice_signals,         (void (*) PARAMS((int))) target_ignore);
-  de_fault (to_thread_alive,           (int (*) PARAMS((int))) target_ignore);
-  de_fault (to_stop,                   (void (*) PARAMS((void))) target_ignore);
-  de_fault (to_query,                  (int (*) PARAMS((int/*char*/, char*, char *, int *))) target_ignore);
-  de_fault (to_enable_exception_callback,      (struct symtab_and_line * (*) PARAMS((enum exception_event_kind, int))) nosupport_runtime);
-  de_fault (to_get_current_exception_event,    (struct exception_event_record * (*) PARAMS((void))) nosupport_runtime);
-
-  de_fault (to_pid_to_exec_file,        (char* (*) PARAMS((int))) return_zero);
-  de_fault (to_core_file_to_sym_file,   (char* (*) PARAMS ((char *))) return_zero);
+  /*        FIELD                       DEFAULT VALUE        */
+
+  de_fault (to_open, (void (*)PARAMS ((char *, int))) tcomplain);
+  de_fault (to_close, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_attach, maybe_kill_then_attach);
+  de_fault (to_post_attach, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_require_attach, maybe_kill_then_attach);
+  de_fault (to_detach, (void (*)PARAMS ((char *, int))) target_ignore);
+  de_fault (to_require_detach, (void (*)PARAMS ((int, char *, int))) target_ignore);
+  de_fault (to_resume, (void (*)PARAMS ((int, int, enum target_signal))) noprocess);
+  de_fault (to_wait, (int (*)PARAMS ((int, struct target_waitstatus *))) noprocess);
+  de_fault (to_post_wait, (void (*)PARAMS ((int, int))) target_ignore);
+  de_fault (to_fetch_registers, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_store_registers, (void (*)PARAMS ((int))) noprocess);
+  de_fault (to_prepare_to_store, (void (*)PARAMS ((void))) noprocess);
+  de_fault (to_xfer_memory, (int (*)PARAMS ((CORE_ADDR, char *, int, int, struct target_ops *))) nomemory);
+  de_fault (to_files_info, (void (*)PARAMS ((struct target_ops *))) target_ignore);
+  de_fault (to_insert_breakpoint, memory_insert_breakpoint);
+  de_fault (to_remove_breakpoint, memory_remove_breakpoint);
+  de_fault (to_terminal_init, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_terminal_inferior, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_terminal_ours_for_output, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_terminal_ours, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_terminal_info, default_terminal_info);
+  de_fault (to_kill, (void (*)PARAMS ((void))) noprocess);
+  de_fault (to_load, (void (*)PARAMS ((char *, int))) tcomplain);
+  de_fault (to_lookup_symbol, (int (*)PARAMS ((char *, CORE_ADDR *))) nosymbol);
+  de_fault (to_create_inferior, maybe_kill_then_create_inferior);
+  de_fault (to_post_startup_inferior, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_acknowledge_created_inferior, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_clone_and_follow_inferior, default_clone_and_follow_inferior);
+  de_fault (to_post_follow_inferior_by_clone, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_insert_fork_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_remove_fork_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_insert_vfork_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_remove_vfork_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_has_forked, (int (*)PARAMS ((int, int *))) return_zero);
+  de_fault (to_has_vforked, (int (*)PARAMS ((int, int *))) return_zero);
+  de_fault (to_can_follow_vfork_prior_to_exec, (int (*)PARAMS ((void))) return_zero);
+  de_fault (to_post_follow_vfork, (void (*)PARAMS ((int, int, int, int))) target_ignore);
+  de_fault (to_insert_exec_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_remove_exec_catchpoint, (int (*)PARAMS ((int))) tcomplain);
+  de_fault (to_has_execd, (int (*)PARAMS ((int, char **))) return_zero);
+  de_fault (to_reported_exec_events_per_exec_call, (int (*)PARAMS ((void))) return_one);
+  de_fault (to_has_syscall_event, (int (*)PARAMS ((int, enum target_waitkind *, int *))) return_zero);
+  de_fault (to_has_exited, (int (*)PARAMS ((int, int, int *))) return_zero);
+  de_fault (to_mourn_inferior, (void (*)PARAMS ((void))) noprocess);
+  de_fault (to_can_run, return_zero);
+  de_fault (to_notice_signals, (void (*)PARAMS ((int))) target_ignore);
+  de_fault (to_thread_alive, (int (*)PARAMS ((int))) target_ignore);
+  de_fault (to_stop, (void (*)PARAMS ((void))) target_ignore);
+  de_fault (to_query, (int (*)PARAMS ((int /*char */ , char *, char *, int *))) target_ignore);
+  de_fault (to_enable_exception_callback, (struct symtab_and_line * (*)PARAMS ((enum exception_event_kind, int))) nosupport_runtime);
+  de_fault (to_get_current_exception_event, (struct exception_event_record * (*)PARAMS ((void))) nosupport_runtime);
+
+  de_fault (to_pid_to_exec_file, (char *(*)PARAMS ((int))) return_zero);
+  de_fault (to_core_file_to_sym_file, (char *(*)PARAMS ((char *))) return_zero);
 #undef de_fault
 }
 
@@ -564,17 +568,17 @@ push_target (t)
      the struct definition, but not all the places that initialize one.  */
   if (t->to_magic != OPS_MAGIC)
     {
-      fprintf_unfiltered(gdb_stderr,
-                        "Magic number of %s target struct wrong\n", 
-                        t->to_shortname);
-      abort();
+      fprintf_unfiltered (gdb_stderr,
+                         "Magic number of %s target struct wrong\n",
+                         t->to_shortname);
+      abort ();
     }
 
   /* Find the proper stratum to install this target in. */
 
   for (prev = NULL, cur = target_stack; cur; prev = cur, cur = cur->next)
     {
-      if ((int)(t->to_stratum) >= (int)(cur->target_ops->to_stratum))
+      if ((int) (t->to_stratum) >= (int) (cur->target_ops->to_stratum))
        break;
     }
 
@@ -587,9 +591,9 @@ push_target (t)
        if (cur->target_ops->to_close)
          (cur->target_ops->to_close) (0);
        if (prev)
-         prev->next = cur->next; /* Unchain old target_ops */
+         prev->next = cur->next;       /* Unchain old target_ops */
        else
-         target_stack = cur->next; /* Unchain first on list */
+         target_stack = cur->next;     /* Unchain first on list */
        tmp = cur->next;
        free (cur);
        cur = tmp;
@@ -609,7 +613,7 @@ push_target (t)
 
   update_current_target ();
 
-  cleanup_target (&current_target); /* Fill in the gaps */
+  cleanup_target (&current_target);    /* Fill in the gaps */
 
   if (targetdebug)
     setup_target_debug ();
@@ -657,14 +661,14 @@ unpush_target (t)
 void
 pop_target ()
 {
-  (current_target.to_close)(0);        /* Let it clean up */
+  (current_target.to_close) (0);       /* Let it clean up */
   if (unpush_target (target_stack->target_ops) == 1)
     return;
 
-  fprintf_unfiltered(gdb_stderr,
-                    "pop_target couldn't find target %s\n", 
-                    current_target.to_shortname);
-  abort();
+  fprintf_unfiltered (gdb_stderr,
+                     "pop_target couldn't find target %s\n",
+                     current_target.to_shortname);
+  abort ();
 }
 
 #undef MIN
@@ -739,7 +743,7 @@ target_read_string (memaddr, string, len, errnop)
       len -= tlen;
       nbytes_read += tlen;
     }
- done:
+done:
   if (errnop != NULL)
     *errnop = errcode;
   if (string != NULL)
@@ -788,8 +792,8 @@ target_read_memory_partial (memaddr, myaddr, len, errnoptr)
      int len;
      int *errnoptr;
 {
-  int nread;   /* Number of bytes actually read. */
-  int errcode; /* Error from last read. */
+  int nread;                   /* Number of bytes actually read. */
+  int errcode;                 /* Error from last read. */
 
   /* First try a complete read. */
   errcode = target_xfer_memory (memaddr, myaddr, len, 0, NULL);
@@ -826,7 +830,7 @@ target_write_memory (memaddr, myaddr, len)
 {
   return target_xfer_memory (memaddr, myaddr, len, 1, NULL);
 }
+
 /* This variable is used to pass section information down to targets.  This
    *should* be done by adding an argument to the target_xfer_memory function
    of all the targets, but I didn't feel like changing 50+ files.  */
@@ -868,7 +872,7 @@ target_xfer_memory (memaddr, myaddr, len, write, bfd_section)
 
   /* The quick case is that the top target does it all.  */
   res = current_target.to_xfer_memory
-                       (memaddr, myaddr, len, write, &current_target);
+    (memaddr, myaddr, len, write, &current_target);
   if (res == len)
     return 0;
 
@@ -903,10 +907,10 @@ target_xfer_memory (memaddr, myaddr, len, write, bfd_section)
          else
            return errno;
        }
-bump:
+    bump:
       memaddr += res;
-      myaddr  += res;
-      len     -= res;
+      myaddr += res;
+      len -= res;
     }
   return 0;                    /* We managed to cover it all somehow. */
 }
@@ -921,7 +925,7 @@ target_info (args, from_tty)
   struct target_ops *t;
   struct target_stack_item *item;
   int has_all_mem = 0;
-  
+
   if (symfile_objfile != NULL)
     printf_unfiltered ("Symbols from \"%s\".\n", symfile_objfile->name);
 
@@ -937,12 +941,12 @@ target_info (args, from_tty)
       if (!t->to_has_memory)
        continue;
 
-      if ((int)(t->to_stratum) <= (int)dummy_stratum)
+      if ((int) (t->to_stratum) <= (int) dummy_stratum)
        continue;
       if (has_all_mem)
-       printf_unfiltered("\tWhile running this, GDB does not access memory from...\n");
-      printf_unfiltered("%s:\n", t->to_longname);
-      (t->to_files_info)(t);
+       printf_unfiltered ("\tWhile running this, GDB does not access memory from...\n");
+      printf_unfiltered ("%s:\n", t->to_longname);
+      (t->to_files_info) (t);
       has_all_mem = t->to_has_all_memory;
     }
 }
@@ -954,14 +958,14 @@ void
 target_preopen (from_tty)
      int from_tty;
 {
-  dont_repeat();
+  dont_repeat ();
 
   if (target_has_execution)
-    {   
+    {
       if (query ("A program is being debugged already.  Kill it? "))
-        target_kill ();
+       target_kill ();
       else
-        error ("Program not killed.");
+       error ("Program not killed.");
     }
 
   /* Calling target_kill may remove the target from the stack.  But if
@@ -990,14 +994,14 @@ target_link (modname, t_reloc)
      char *modname;
      CORE_ADDR *t_reloc;
 {
-  if (STREQ(current_target.to_shortname, "rombug"))
+  if (STREQ (current_target.to_shortname, "rombug"))
     {
       (current_target.to_lookup_symbol) (modname, t_reloc);
       if (*t_reloc == 0)
-      error("Unable to link to %s and get relocation in rombug", modname);
+       error ("Unable to link to %s and get relocation in rombug", modname);
     }
   else
-    *t_reloc = (CORE_ADDR)-1;
+    *t_reloc = (CORE_ADDR) - 1;
 }
 
 /* Look through the list of possible targets for a target that can
@@ -1019,7 +1023,7 @@ find_default_run_target (do_mesg)
   for (t = target_structs; t < target_structs + target_struct_size;
        ++t)
     {
-      if ((*t)->to_can_run && target_can_run(*t))
+      if ((*t)->to_can_run && target_can_run (*t))
        {
          runable = *t;
          ++count;
@@ -1039,7 +1043,7 @@ find_default_attach (args, from_tty)
 {
   struct target_ops *t;
 
-  t = find_default_run_target("attach");
+  t = find_default_run_target ("attach");
   (t->to_attach) (args, from_tty);
   return;
 }
@@ -1051,20 +1055,20 @@ find_default_require_attach (args, from_tty)
 {
   struct target_ops *t;
 
-  t = find_default_run_target("require_attach");
+  t = find_default_run_target ("require_attach");
   (t->to_require_attach) (args, from_tty);
   return;
 }
 
 void
 find_default_require_detach (pid, args, from_tty)
-  int  pid;
-  char *  args;
-  int  from_tty;
+     int pid;
+     char *args;
+     int from_tty;
 {
   struct target_ops *t;
 
-  t = find_default_run_target("require_detach");
+  t = find_default_run_target ("require_detach");
   (t->to_require_detach) (pid, args, from_tty);
   return;
 }
@@ -1077,19 +1081,19 @@ find_default_create_inferior (exec_file, allargs, env)
 {
   struct target_ops *t;
 
-  t = find_default_run_target("run");
+  t = find_default_run_target ("run");
   (t->to_create_inferior) (exec_file, allargs, env);
   return;
 }
 
 void
 find_default_clone_and_follow_inferior (child_pid, followed_child)
-  int  child_pid;
-  int  *followed_child;
+     int child_pid;
+     int *followed_child;
 {
   struct target_ops *t;
 
-  t = find_default_run_target("run");
+  t = find_default_run_target ("run");
   (t->to_clone_and_follow_inferior) (child_pid, followed_child);
   return;
 }
@@ -1115,18 +1119,18 @@ find_run_target ()
   struct target_ops **t;
   struct target_ops *runable = NULL;
   int count;
-  
+
   count = 0;
-  
+
   for (t = target_structs; t < target_structs + target_struct_size; ++t)
     {
-      if ((*t)->to_can_run && target_can_run(*t))
+      if ((*t)->to_can_run && target_can_run (*t))
        {
          runable = *t;
          ++count;
        }
     }
-  
+
   return (count == 1 ? runable : NULL);
 }
 
@@ -1136,9 +1140,9 @@ find_core_target ()
   struct target_ops **t;
   struct target_ops *runable = NULL;
   int count;
-  
+
   count = 0;
-  
+
   for (t = target_structs; t < target_structs + target_struct_size;
        ++t)
     {
@@ -1148,8 +1152,8 @@ find_core_target ()
          ++count;
        }
     }
-  
-  return(count == 1 ? runable : NULL);
+
+  return (count == 1 ? runable : NULL);
 }
 \f
 /* The inferior process has died.  Long live the inferior!  */
@@ -1285,6 +1289,8 @@ static struct {
 };
 /* *INDENT-ON* */
 
+
+
 /* Return the string for a signal.  */
 char *
 target_signal_to_string (sig)
@@ -1323,7 +1329,7 @@ target_signal_from_name (name)
   /* This ugly cast brought to you by the native VAX compiler.  */
   for (sig = TARGET_SIGNAL_HUP;
        signals[sig].name != NULL;
-       sig = (enum target_signal)((int)sig + 1))
+       sig = (enum target_signal) ((int) sig + 1))
     if (STREQ (name, signals[sig].name))
       return sig;
   return TARGET_SIGNAL_UNKNOWN;
@@ -1341,169 +1347,223 @@ target_signal_from_host (hostsig)
   /* A switch statement would make sense but would require special kludges
      to deal with the cases where more than one signal has the same number.  */
 
-  if (hostsig == 0) return TARGET_SIGNAL_0;
+  if (hostsig == 0)
+    return TARGET_SIGNAL_0;
 
 #if defined (SIGHUP)
-  if (hostsig == SIGHUP) return TARGET_SIGNAL_HUP;
+  if (hostsig == SIGHUP)
+    return TARGET_SIGNAL_HUP;
 #endif
 #if defined (SIGINT)
-  if (hostsig == SIGINT) return TARGET_SIGNAL_INT;
+  if (hostsig == SIGINT)
+    return TARGET_SIGNAL_INT;
 #endif
 #if defined (SIGQUIT)
-  if (hostsig == SIGQUIT) return TARGET_SIGNAL_QUIT;
+  if (hostsig == SIGQUIT)
+    return TARGET_SIGNAL_QUIT;
 #endif
 #if defined (SIGILL)
-  if (hostsig == SIGILL) return TARGET_SIGNAL_ILL;
+  if (hostsig == SIGILL)
+    return TARGET_SIGNAL_ILL;
 #endif
 #if defined (SIGTRAP)
-  if (hostsig == SIGTRAP) return TARGET_SIGNAL_TRAP;
+  if (hostsig == SIGTRAP)
+    return TARGET_SIGNAL_TRAP;
 #endif
 #if defined (SIGABRT)
-  if (hostsig == SIGABRT) return TARGET_SIGNAL_ABRT;
+  if (hostsig == SIGABRT)
+    return TARGET_SIGNAL_ABRT;
 #endif
 #if defined (SIGEMT)
-  if (hostsig == SIGEMT) return TARGET_SIGNAL_EMT;
+  if (hostsig == SIGEMT)
+    return TARGET_SIGNAL_EMT;
 #endif
 #if defined (SIGFPE)
-  if (hostsig == SIGFPE) return TARGET_SIGNAL_FPE;
+  if (hostsig == SIGFPE)
+    return TARGET_SIGNAL_FPE;
 #endif
 #if defined (SIGKILL)
-  if (hostsig == SIGKILL) return TARGET_SIGNAL_KILL;
+  if (hostsig == SIGKILL)
+    return TARGET_SIGNAL_KILL;
 #endif
 #if defined (SIGBUS)
-  if (hostsig == SIGBUS) return TARGET_SIGNAL_BUS;
+  if (hostsig == SIGBUS)
+    return TARGET_SIGNAL_BUS;
 #endif
 #if defined (SIGSEGV)
-  if (hostsig == SIGSEGV) return TARGET_SIGNAL_SEGV;
+  if (hostsig == SIGSEGV)
+    return TARGET_SIGNAL_SEGV;
 #endif
 #if defined (SIGSYS)
-  if (hostsig == SIGSYS) return TARGET_SIGNAL_SYS;
+  if (hostsig == SIGSYS)
+    return TARGET_SIGNAL_SYS;
 #endif
 #if defined (SIGPIPE)
-  if (hostsig == SIGPIPE) return TARGET_SIGNAL_PIPE;
+  if (hostsig == SIGPIPE)
+    return TARGET_SIGNAL_PIPE;
 #endif
 #if defined (SIGALRM)
-  if (hostsig == SIGALRM) return TARGET_SIGNAL_ALRM;
+  if (hostsig == SIGALRM)
+    return TARGET_SIGNAL_ALRM;
 #endif
 #if defined (SIGTERM)
-  if (hostsig == SIGTERM) return TARGET_SIGNAL_TERM;
+  if (hostsig == SIGTERM)
+    return TARGET_SIGNAL_TERM;
 #endif
 #if defined (SIGUSR1)
-  if (hostsig == SIGUSR1) return TARGET_SIGNAL_USR1;
+  if (hostsig == SIGUSR1)
+    return TARGET_SIGNAL_USR1;
 #endif
 #if defined (SIGUSR2)
-  if (hostsig == SIGUSR2) return TARGET_SIGNAL_USR2;
+  if (hostsig == SIGUSR2)
+    return TARGET_SIGNAL_USR2;
 #endif
 #if defined (SIGCLD)
-  if (hostsig == SIGCLD) return TARGET_SIGNAL_CHLD;
+  if (hostsig == SIGCLD)
+    return TARGET_SIGNAL_CHLD;
 #endif
 #if defined (SIGCHLD)
-  if (hostsig == SIGCHLD) return TARGET_SIGNAL_CHLD;
+  if (hostsig == SIGCHLD)
+    return TARGET_SIGNAL_CHLD;
 #endif
 #if defined (SIGPWR)
-  if (hostsig == SIGPWR) return TARGET_SIGNAL_PWR;
+  if (hostsig == SIGPWR)
+    return TARGET_SIGNAL_PWR;
 #endif
 #if defined (SIGWINCH)
-  if (hostsig == SIGWINCH) return TARGET_SIGNAL_WINCH;
+  if (hostsig == SIGWINCH)
+    return TARGET_SIGNAL_WINCH;
 #endif
 #if defined (SIGURG)
-  if (hostsig == SIGURG) return TARGET_SIGNAL_URG;
+  if (hostsig == SIGURG)
+    return TARGET_SIGNAL_URG;
 #endif
 #if defined (SIGIO)
-  if (hostsig == SIGIO) return TARGET_SIGNAL_IO;
+  if (hostsig == SIGIO)
+    return TARGET_SIGNAL_IO;
 #endif
 #if defined (SIGPOLL)
-  if (hostsig == SIGPOLL) return TARGET_SIGNAL_POLL;
+  if (hostsig == SIGPOLL)
+    return TARGET_SIGNAL_POLL;
 #endif
 #if defined (SIGSTOP)
-  if (hostsig == SIGSTOP) return TARGET_SIGNAL_STOP;
+  if (hostsig == SIGSTOP)
+    return TARGET_SIGNAL_STOP;
 #endif
 #if defined (SIGTSTP)
-  if (hostsig == SIGTSTP) return TARGET_SIGNAL_TSTP;
+  if (hostsig == SIGTSTP)
+    return TARGET_SIGNAL_TSTP;
 #endif
 #if defined (SIGCONT)
-  if (hostsig == SIGCONT) return TARGET_SIGNAL_CONT;
+  if (hostsig == SIGCONT)
+    return TARGET_SIGNAL_CONT;
 #endif
 #if defined (SIGTTIN)
-  if (hostsig == SIGTTIN) return TARGET_SIGNAL_TTIN;
+  if (hostsig == SIGTTIN)
+    return TARGET_SIGNAL_TTIN;
 #endif
 #if defined (SIGTTOU)
-  if (hostsig == SIGTTOU) return TARGET_SIGNAL_TTOU;
+  if (hostsig == SIGTTOU)
+    return TARGET_SIGNAL_TTOU;
 #endif
 #if defined (SIGVTALRM)
-  if (hostsig == SIGVTALRM) return TARGET_SIGNAL_VTALRM;
+  if (hostsig == SIGVTALRM)
+    return TARGET_SIGNAL_VTALRM;
 #endif
 #if defined (SIGPROF)
-  if (hostsig == SIGPROF) return TARGET_SIGNAL_PROF;
+  if (hostsig == SIGPROF)
+    return TARGET_SIGNAL_PROF;
 #endif
 #if defined (SIGXCPU)
-  if (hostsig == SIGXCPU) return TARGET_SIGNAL_XCPU;
+  if (hostsig == SIGXCPU)
+    return TARGET_SIGNAL_XCPU;
 #endif
 #if defined (SIGXFSZ)
-  if (hostsig == SIGXFSZ) return TARGET_SIGNAL_XFSZ;
+  if (hostsig == SIGXFSZ)
+    return TARGET_SIGNAL_XFSZ;
 #endif
 #if defined (SIGWIND)
-  if (hostsig == SIGWIND) return TARGET_SIGNAL_WIND;
+  if (hostsig == SIGWIND)
+    return TARGET_SIGNAL_WIND;
 #endif
 #if defined (SIGPHONE)
-  if (hostsig == SIGPHONE) return TARGET_SIGNAL_PHONE;
+  if (hostsig == SIGPHONE)
+    return TARGET_SIGNAL_PHONE;
 #endif
 #if defined (SIGLOST)
-  if (hostsig == SIGLOST) return TARGET_SIGNAL_LOST;
+  if (hostsig == SIGLOST)
+    return TARGET_SIGNAL_LOST;
 #endif
 #if defined (SIGWAITING)
-  if (hostsig == SIGWAITING) return TARGET_SIGNAL_WAITING;
+  if (hostsig == SIGWAITING)
+    return TARGET_SIGNAL_WAITING;
 #endif
 #if defined (SIGCANCEL)
-  if (hostsig == SIGCANCEL) return TARGET_SIGNAL_CANCEL;
+  if (hostsig == SIGCANCEL)
+    return TARGET_SIGNAL_CANCEL;
 #endif
 #if defined (SIGLWP)
-  if (hostsig == SIGLWP) return TARGET_SIGNAL_LWP;
+  if (hostsig == SIGLWP)
+    return TARGET_SIGNAL_LWP;
 #endif
 #if defined (SIGDANGER)
-  if (hostsig == SIGDANGER) return TARGET_SIGNAL_DANGER;
+  if (hostsig == SIGDANGER)
+    return TARGET_SIGNAL_DANGER;
 #endif
 #if defined (SIGGRANT)
-  if (hostsig == SIGGRANT) return TARGET_SIGNAL_GRANT;
+  if (hostsig == SIGGRANT)
+    return TARGET_SIGNAL_GRANT;
 #endif
 #if defined (SIGRETRACT)
-  if (hostsig == SIGRETRACT) return TARGET_SIGNAL_RETRACT;
+  if (hostsig == SIGRETRACT)
+    return TARGET_SIGNAL_RETRACT;
 #endif
 #if defined (SIGMSG)
-  if (hostsig == SIGMSG) return TARGET_SIGNAL_MSG;
+  if (hostsig == SIGMSG)
+    return TARGET_SIGNAL_MSG;
 #endif
 #if defined (SIGSOUND)
-  if (hostsig == SIGSOUND) return TARGET_SIGNAL_SOUND;
+  if (hostsig == SIGSOUND)
+    return TARGET_SIGNAL_SOUND;
 #endif
 #if defined (SIGSAK)
-  if (hostsig == SIGSAK) return TARGET_SIGNAL_SAK;
+  if (hostsig == SIGSAK)
+    return TARGET_SIGNAL_SAK;
 #endif
 #if defined (SIGPRIO)
-  if (hostsig == SIGPRIO) return TARGET_SIGNAL_PRIO;
+  if (hostsig == SIGPRIO)
+    return TARGET_SIGNAL_PRIO;
 #endif
 
   /* Mach exceptions.  Assumes that the values for EXC_ are positive! */
 #if defined (EXC_BAD_ACCESS) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_BAD_ACCESS) return TARGET_EXC_BAD_ACCESS;
+  if (hostsig == _NSIG + EXC_BAD_ACCESS)
+    return TARGET_EXC_BAD_ACCESS;
 #endif
 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_BAD_INSTRUCTION) return TARGET_EXC_BAD_INSTRUCTION;
+  if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
+    return TARGET_EXC_BAD_INSTRUCTION;
 #endif
 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_ARITHMETIC) return TARGET_EXC_ARITHMETIC;
+  if (hostsig == _NSIG + EXC_ARITHMETIC)
+    return TARGET_EXC_ARITHMETIC;
 #endif
 #if defined (EXC_EMULATION) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_EMULATION) return TARGET_EXC_EMULATION;
+  if (hostsig == _NSIG + EXC_EMULATION)
+    return TARGET_EXC_EMULATION;
 #endif
 #if defined (EXC_SOFTWARE) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_SOFTWARE) return TARGET_EXC_SOFTWARE;
+  if (hostsig == _NSIG + EXC_SOFTWARE)
+    return TARGET_EXC_SOFTWARE;
 #endif
 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
-  if (hostsig == _NSIG + EXC_BREAKPOINT) return TARGET_EXC_BREAKPOINT;
+  if (hostsig == _NSIG + EXC_BREAKPOINT)
+    return TARGET_EXC_BREAKPOINT;
 #endif
 
 #if defined (SIGINFO)
-  if (hostsig == SIGINFO) return TARGET_SIGNAL_INFO;
+  if (hostsig == SIGINFO)
+    return TARGET_SIGNAL_INFO;
 #endif
 
 #if defined (REALTIME_LO)
@@ -1520,61 +1580,79 @@ target_signal_to_host (oursig)
 {
   switch (oursig)
     {
-    case TARGET_SIGNAL_0: return 0;
+    case TARGET_SIGNAL_0:
+      return 0;
 
 #if defined (SIGHUP)
-    case TARGET_SIGNAL_HUP: return SIGHUP;
+    case TARGET_SIGNAL_HUP:
+      return SIGHUP;
 #endif
 #if defined (SIGINT)
-    case TARGET_SIGNAL_INT: return SIGINT;
+    case TARGET_SIGNAL_INT:
+      return SIGINT;
 #endif
 #if defined (SIGQUIT)
-    case TARGET_SIGNAL_QUIT: return SIGQUIT;
+    case TARGET_SIGNAL_QUIT:
+      return SIGQUIT;
 #endif
 #if defined (SIGILL)
-    case TARGET_SIGNAL_ILL: return SIGILL;
+    case TARGET_SIGNAL_ILL:
+      return SIGILL;
 #endif
 #if defined (SIGTRAP)
-    case TARGET_SIGNAL_TRAP: return SIGTRAP;
+    case TARGET_SIGNAL_TRAP:
+      return SIGTRAP;
 #endif
 #if defined (SIGABRT)
-    case TARGET_SIGNAL_ABRT: return SIGABRT;
+    case TARGET_SIGNAL_ABRT:
+      return SIGABRT;
 #endif
 #if defined (SIGEMT)
-    case TARGET_SIGNAL_EMT: return SIGEMT;
+    case TARGET_SIGNAL_EMT:
+      return SIGEMT;
 #endif
 #if defined (SIGFPE)
-    case TARGET_SIGNAL_FPE: return SIGFPE;
+    case TARGET_SIGNAL_FPE:
+      return SIGFPE;
 #endif
 #if defined (SIGKILL)
-    case TARGET_SIGNAL_KILL: return SIGKILL;
+    case TARGET_SIGNAL_KILL:
+      return SIGKILL;
 #endif
 #if defined (SIGBUS)
-    case TARGET_SIGNAL_BUS: return SIGBUS;
+    case TARGET_SIGNAL_BUS:
+      return SIGBUS;
 #endif
 #if defined (SIGSEGV)
-    case TARGET_SIGNAL_SEGV: return SIGSEGV;
+    case TARGET_SIGNAL_SEGV:
+      return SIGSEGV;
 #endif
 #if defined (SIGSYS)
-    case TARGET_SIGNAL_SYS: return SIGSYS;
+    case TARGET_SIGNAL_SYS:
+      return SIGSYS;
 #endif
 #if defined (SIGPIPE)
-    case TARGET_SIGNAL_PIPE: return SIGPIPE;
+    case TARGET_SIGNAL_PIPE:
+      return SIGPIPE;
 #endif
 #if defined (SIGALRM)
-    case TARGET_SIGNAL_ALRM: return SIGALRM;
+    case TARGET_SIGNAL_ALRM:
+      return SIGALRM;
 #endif
 #if defined (SIGTERM)
-    case TARGET_SIGNAL_TERM: return SIGTERM;
+    case TARGET_SIGNAL_TERM:
+      return SIGTERM;
 #endif
 #if defined (SIGUSR1)
-    case TARGET_SIGNAL_USR1: return SIGUSR1;
+    case TARGET_SIGNAL_USR1:
+      return SIGUSR1;
 #endif
 #if defined (SIGUSR2)
-    case TARGET_SIGNAL_USR2: return SIGUSR2;
+    case TARGET_SIGNAL_USR2:
+      return SIGUSR2;
 #endif
 #if defined (SIGCHLD) || defined (SIGCLD)
-    case TARGET_SIGNAL_CHLD: 
+    case TARGET_SIGNAL_CHLD:
 #if defined (SIGCHLD)
       return SIGCHLD;
 #else
@@ -1582,109 +1660,143 @@ target_signal_to_host (oursig)
 #endif
 #endif /* SIGCLD or SIGCHLD */
 #if defined (SIGPWR)
-    case TARGET_SIGNAL_PWR: return SIGPWR;
+    case TARGET_SIGNAL_PWR:
+      return SIGPWR;
 #endif
 #if defined (SIGWINCH)
-    case TARGET_SIGNAL_WINCH: return SIGWINCH;
+    case TARGET_SIGNAL_WINCH:
+      return SIGWINCH;
 #endif
 #if defined (SIGURG)
-    case TARGET_SIGNAL_URG: return SIGURG;
+    case TARGET_SIGNAL_URG:
+      return SIGURG;
 #endif
 #if defined (SIGIO)
-    case TARGET_SIGNAL_IO: return SIGIO;
+    case TARGET_SIGNAL_IO:
+      return SIGIO;
 #endif
 #if defined (SIGPOLL)
-    case TARGET_SIGNAL_POLL: return SIGPOLL;
+    case TARGET_SIGNAL_POLL:
+      return SIGPOLL;
 #endif
 #if defined (SIGSTOP)
-    case TARGET_SIGNAL_STOP: return SIGSTOP;
+    case TARGET_SIGNAL_STOP:
+      return SIGSTOP;
 #endif
 #if defined (SIGTSTP)
-    case TARGET_SIGNAL_TSTP: return SIGTSTP;
+    case TARGET_SIGNAL_TSTP:
+      return SIGTSTP;
 #endif
 #if defined (SIGCONT)
-    case TARGET_SIGNAL_CONT: return SIGCONT;
+    case TARGET_SIGNAL_CONT:
+      return SIGCONT;
 #endif
 #if defined (SIGTTIN)
-    case TARGET_SIGNAL_TTIN: return SIGTTIN;
+    case TARGET_SIGNAL_TTIN:
+      return SIGTTIN;
 #endif
 #if defined (SIGTTOU)
-    case TARGET_SIGNAL_TTOU: return SIGTTOU;
+    case TARGET_SIGNAL_TTOU:
+      return SIGTTOU;
 #endif
 #if defined (SIGVTALRM)
-    case TARGET_SIGNAL_VTALRM: return SIGVTALRM;
+    case TARGET_SIGNAL_VTALRM:
+      return SIGVTALRM;
 #endif
 #if defined (SIGPROF)
-    case TARGET_SIGNAL_PROF: return SIGPROF;
+    case TARGET_SIGNAL_PROF:
+      return SIGPROF;
 #endif
 #if defined (SIGXCPU)
-    case TARGET_SIGNAL_XCPU: return SIGXCPU;
+    case TARGET_SIGNAL_XCPU:
+      return SIGXCPU;
 #endif
 #if defined (SIGXFSZ)
-    case TARGET_SIGNAL_XFSZ: return SIGXFSZ;
+    case TARGET_SIGNAL_XFSZ:
+      return SIGXFSZ;
 #endif
 #if defined (SIGWIND)
-    case TARGET_SIGNAL_WIND: return SIGWIND;
+    case TARGET_SIGNAL_WIND:
+      return SIGWIND;
 #endif
 #if defined (SIGPHONE)
-    case TARGET_SIGNAL_PHONE: return SIGPHONE;
+    case TARGET_SIGNAL_PHONE:
+      return SIGPHONE;
 #endif
 #if defined (SIGLOST)
-    case TARGET_SIGNAL_LOST: return SIGLOST;
+    case TARGET_SIGNAL_LOST:
+      return SIGLOST;
 #endif
 #if defined (SIGWAITING)
-    case TARGET_SIGNAL_WAITING: return SIGWAITING;
+    case TARGET_SIGNAL_WAITING:
+      return SIGWAITING;
 #endif
 #if defined (SIGCANCEL)
-    case TARGET_SIGNAL_CANCEL: return SIGCANCEL;
+    case TARGET_SIGNAL_CANCEL:
+      return SIGCANCEL;
 #endif
 #if defined (SIGLWP)
-    case TARGET_SIGNAL_LWP: return SIGLWP;
+    case TARGET_SIGNAL_LWP:
+      return SIGLWP;
 #endif
 #if defined (SIGDANGER)
-    case TARGET_SIGNAL_DANGER: return SIGDANGER;
+    case TARGET_SIGNAL_DANGER:
+      return SIGDANGER;
 #endif
 #if defined (SIGGRANT)
-    case TARGET_SIGNAL_GRANT: return SIGGRANT;
+    case TARGET_SIGNAL_GRANT:
+      return SIGGRANT;
 #endif
 #if defined (SIGRETRACT)
-    case TARGET_SIGNAL_RETRACT: return SIGRETRACT;
+    case TARGET_SIGNAL_RETRACT:
+      return SIGRETRACT;
 #endif
 #if defined (SIGMSG)
-    case TARGET_SIGNAL_MSG: return SIGMSG;
+    case TARGET_SIGNAL_MSG:
+      return SIGMSG;
 #endif
 #if defined (SIGSOUND)
-    case TARGET_SIGNAL_SOUND: return SIGSOUND;
+    case TARGET_SIGNAL_SOUND:
+      return SIGSOUND;
 #endif
 #if defined (SIGSAK)
-    case TARGET_SIGNAL_SAK: return SIGSAK;
+    case TARGET_SIGNAL_SAK:
+      return SIGSAK;
 #endif
 #if defined (SIGPRIO)
-    case TARGET_SIGNAL_PRIO: return SIGPRIO;
+    case TARGET_SIGNAL_PRIO:
+      return SIGPRIO;
 #endif
 
       /* Mach exceptions.  Assumes that the values for EXC_ are positive! */
 #if defined (EXC_BAD_ACCESS) && defined (_NSIG)
-    case TARGET_EXC_BAD_ACCESS: return _NSIG + EXC_BAD_ACCESS;
+    case TARGET_EXC_BAD_ACCESS:
+      return _NSIG + EXC_BAD_ACCESS;
 #endif
 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
-    case TARGET_EXC_BAD_INSTRUCTION: return _NSIG + EXC_BAD_INSTRUCTION;
+    case TARGET_EXC_BAD_INSTRUCTION:
+      return _NSIG + EXC_BAD_INSTRUCTION;
 #endif
 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
-    case TARGET_EXC_ARITHMETIC: return _NSIG + EXC_ARITHMETIC;
+    case TARGET_EXC_ARITHMETIC:
+      return _NSIG + EXC_ARITHMETIC;
 #endif
 #if defined (EXC_EMULATION) && defined (_NSIG)
-    case TARGET_EXC_EMULATION: return _NSIG + EXC_EMULATION;
+    case TARGET_EXC_EMULATION:
+      return _NSIG + EXC_EMULATION;
 #endif
 #if defined (EXC_SOFTWARE) && defined (_NSIG)
-    case TARGET_EXC_SOFTWARE: return _NSIG + EXC_SOFTWARE;
+    case TARGET_EXC_SOFTWARE:
+      return _NSIG + EXC_SOFTWARE;
 #endif
 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
-    case TARGET_EXC_BREAKPOINT: return _NSIG + EXC_BREAKPOINT;
+    case TARGET_EXC_BREAKPOINT:
+      return _NSIG + EXC_BREAKPOINT;
 #endif
 
 #if defined (SIGINFO)
-    case TARGET_SIGNAL_INFO: return SIGINFO;
+    case TARGET_SIGNAL_INFO:
+      return SIGINFO;
 #endif
 
     default:
@@ -1693,13 +1805,13 @@ target_signal_to_host (oursig)
          && oursig <= TARGET_SIGNAL_REALTIME_63)
        {
          int retsig =
-           (int)oursig - (int)TARGET_SIGNAL_REALTIME_33 + REALTIME_LO;
+         (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + REALTIME_LO;
          if (retsig < REALTIME_HI)
            return retsig;
        }
 #endif
       /* The user might be trying to do "signal SIGSAK" where this system
-        doesn't have SIGSAK.  */
+         doesn't have SIGSAK.  */
       warning ("Signal %s does not exist on this system.\n",
               target_signal_to_name (oursig));
       return 0;
@@ -1751,7 +1863,7 @@ target_signal_from_command (num)
      int num;
 {
   if (num >= 1 && num <= 15)
-    return (enum target_signal)num;
+    return (enum target_signal) num;
   error ("Only signals 1-15 are valid as numeric signals.\n\
 Use \"info signals\" for a list of symbolic signals.");
 }
@@ -1784,14 +1896,14 @@ normal_pid_to_str (pid)
    if the shell init file has commands in it, the shell will fork and
    exec for each of those commands, and we will see each such fork
    event.  Very bad.)
-   
+
    This function is used by all targets that allow us to request
    notification of forks, etc at inferior creation time; e.g., in
    target_acknowledge_forked_child.
  */
+ */
 static void
 normal_target_post_startup_inferior (pid)
-  int  pid;
+     int pid;
 {
   /* This space intentionally left blank. */
 }
@@ -1813,8 +1925,8 @@ init_dummy_target ()
   dummy_target.to_stratum = dummy_stratum;
   dummy_target.to_magic = OPS_MAGIC;
 }
-
 \f
+
 static struct target_ops debug_target;
 
 static void
@@ -1849,7 +1961,7 @@ debug_to_attach (args, from_tty)
 
 static void
 debug_to_post_attach (pid)
-  int  pid;
+     int pid;
 {
   debug_target.to_post_attach (pid);
 
@@ -1879,14 +1991,14 @@ debug_to_detach (args, from_tty)
 
 static void
 debug_to_require_detach (pid, args, from_tty)
-  int  pid;
-  char *  args;
-  int  from_tty;
+     int pid;
+     char *args;
+     int from_tty;
 {
   debug_target.to_require_detach (pid, args, from_tty);
 
   fprintf_unfiltered (gdb_stderr,
-                     "target_require_detach (%d, %s, %d)\n", pid, args, from_tty);
+              "target_require_detach (%d, %s, %d)\n", pid, args, from_tty);
 }
 
 static void
@@ -1953,8 +2065,8 @@ debug_to_wait (pid, status)
 
 static void
 debug_to_post_wait (pid, status)
-  int  pid;
-  int  status;
+     int pid;
+     int status;
 {
   debug_target.to_post_wait (pid, status);
 
@@ -2014,10 +2126,10 @@ debug_to_xfer_memory (memaddr, myaddr, len, write, target)
 
   fprintf_unfiltered (gdb_stderr,
                      "target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d",
-                     (unsigned int) memaddr, /* possable truncate long long */
+                     (unsigned int) memaddr,   /* possable truncate long long */
                      len, write ? "write" : "read", retval);
 
-  
+
 
   if (retval > 0)
     {
@@ -2072,7 +2184,7 @@ debug_to_remove_breakpoint (addr, save)
 
   fprintf_unfiltered (gdb_stderr,
                      "target_remove_breakpoint (0x%x, xxx) = %d\n",
-                     (unsigned long)addr, retval);
+                     (unsigned long) addr, retval);
   return retval;
 }
 
@@ -2165,7 +2277,7 @@ debug_to_create_inferior (exec_file, args, env)
 
 static void
 debug_to_post_startup_inferior (pid)
-  int  pid;
+     int pid;
 {
   debug_target.to_post_startup_inferior (pid);
 
@@ -2175,7 +2287,7 @@ debug_to_post_startup_inferior (pid)
 
 static void
 debug_to_acknowledge_created_inferior (pid)
-  int  pid;
+     int pid;
 {
   debug_target.to_acknowledge_created_inferior (pid);
 
@@ -2185,8 +2297,8 @@ debug_to_acknowledge_created_inferior (pid)
 
 static void
 debug_to_clone_and_follow_inferior (child_pid, followed_child)
-  int  child_pid;
-  int  *followed_child;
+     int child_pid;
+     int *followed_child;
 {
   debug_target.to_clone_and_follow_inferior (child_pid, followed_child);
 
@@ -2205,86 +2317,86 @@ debug_to_post_follow_inferior_by_clone ()
 
 static int
 debug_to_insert_fork_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_insert_fork_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_insert_fork_catchpoint (%d) = %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_remove_fork_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_remove_fork_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_remove_fork_catchpoint (%d) = %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_insert_vfork_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_insert_vfork_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_insert_vfork_catchpoint (%d)= %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_remove_vfork_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_remove_vfork_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_remove_vfork_catchpoint (%d) = %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_has_forked (pid, child_pid)
-  int  pid;
-  int *  child_pid;
+     int pid;
+     int *child_pid;
 {
-  int  has_forked;
+  int has_forked;
 
   has_forked = debug_target.to_has_forked (pid, child_pid);
 
   fprintf_unfiltered (gdb_stderr, "target_has_forked (%d, %d) = %d\n",
-                      pid, *child_pid, has_forked);
+                     pid, *child_pid, has_forked);
 
   return has_forked;
 }
 
 static int
 debug_to_has_vforked (pid, child_pid)
-  int  pid;
-  int *  child_pid;
+     int pid;
+     int *child_pid;
 {
-  int  has_vforked;
+  int has_vforked;
 
   has_vforked = debug_target.to_has_vforked (pid, child_pid);
 
   fprintf_unfiltered (gdb_stderr, "target_has_vforked (%d, %d) = %d\n",
-                      pid, *child_pid, has_vforked);
+                     pid, *child_pid, has_vforked);
 
   return has_vforked;
 }
@@ -2292,69 +2404,69 @@ debug_to_has_vforked (pid, child_pid)
 static int
 debug_to_can_follow_vfork_prior_to_exec ()
 {
-  int  can_immediately_follow_vfork;
+  int can_immediately_follow_vfork;
 
   can_immediately_follow_vfork = debug_target.to_can_follow_vfork_prior_to_exec ();
 
   fprintf_unfiltered (gdb_stderr, "target_can_follow_vfork_prior_to_exec () = %d\n",
-                      can_immediately_follow_vfork);
+                     can_immediately_follow_vfork);
 
   return can_immediately_follow_vfork;
 }
 
 static void
 debug_to_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
-  int  parent_pid;
-  int  followed_parent;
-  int  child_pid;
-  int  followed_child;
+     int parent_pid;
+     int followed_parent;
+     int child_pid;
+     int followed_child;
 {
   debug_target.to_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child);
 
   fprintf_unfiltered (gdb_stderr,
                      "target_post_follow_vfork (%d, %d, %d, %d)\n",
-                      parent_pid, followed_parent, child_pid, followed_child);
+                   parent_pid, followed_parent, child_pid, followed_child);
 }
 
 static int
 debug_to_insert_exec_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_insert_exec_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_insert_exec_catchpoint (%d) = %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_remove_exec_catchpoint (pid)
-  int  pid;
+     int pid;
 {
-  int  retval;
+  int retval;
 
   retval = debug_target.to_remove_exec_catchpoint (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_remove_exec_catchpoint (%d) = %d\n",
-                      pid, retval);
+                     pid, retval);
 
   return retval;
 }
 
 static int
 debug_to_has_execd (pid, execd_pathname)
-  int  pid;
-  char **  execd_pathname;
+     int pid;
+     char **execd_pathname;
 {
-  int  has_execd;
+  int has_execd;
 
   has_execd = debug_target.to_has_execd (pid, execd_pathname);
 
   fprintf_unfiltered (gdb_stderr, "target_has_execd (%d, %s) = %d\n",
-                      pid, (*execd_pathname ? *execd_pathname : "<NULL>"),
+                     pid, (*execd_pathname ? *execd_pathname : "<NULL>"),
                      has_execd);
 
   return has_execd;
@@ -2363,61 +2475,61 @@ debug_to_has_execd (pid, execd_pathname)
 static int
 debug_to_reported_exec_events_per_exec_call ()
 {
-  int  reported_exec_events;
+  int reported_exec_events;
 
   reported_exec_events = debug_target.to_reported_exec_events_per_exec_call ();
 
   fprintf_unfiltered (gdb_stderr,
                      "target_reported_exec_events_per_exec_call () = %d\n",
-                      reported_exec_events);
+                     reported_exec_events);
 
   return reported_exec_events;
 }
 
 static int
 debug_to_has_syscall_event (pid, kind, syscall_id)
-  int  pid;
-  enum target_waitkind *  kind;
-  int *  syscall_id;
+     int pid;
+     enum target_waitkind *kind;
+     int *syscall_id;
 {
-  int  has_syscall_event;
-  char *  kind_spelling = "??";
+  int has_syscall_event;
+  char *kind_spelling = "??";
 
   has_syscall_event = debug_target.to_has_syscall_event (pid, kind, syscall_id);
   if (has_syscall_event)
     {
       switch (*kind)
-        {
-          case TARGET_WAITKIND_SYSCALL_ENTRY:
-            kind_spelling = "SYSCALL_ENTRY";
-            break;
-          case TARGET_WAITKIND_SYSCALL_RETURN:
-            kind_spelling = "SYSCALL_RETURN";
-            break;
-          default:
-            break;
-        }
+       {
+       case TARGET_WAITKIND_SYSCALL_ENTRY:
+         kind_spelling = "SYSCALL_ENTRY";
+         break;
+       case TARGET_WAITKIND_SYSCALL_RETURN:
+         kind_spelling = "SYSCALL_RETURN";
+         break;
+       default:
+         break;
+       }
     }
 
   fprintf_unfiltered (gdb_stderr,
                      "target_has_syscall_event (%d, %s, %d) = %d\n",
-                      pid, kind_spelling, *syscall_id, has_syscall_event);
+                     pid, kind_spelling, *syscall_id, has_syscall_event);
 
   return has_syscall_event;
 }
 
 static int
 debug_to_has_exited (pid, wait_status, exit_status)
-  int  pid;
-  int  wait_status;
-  int *  exit_status;
+     int pid;
+     int wait_status;
+     int *exit_status;
 {
-  int  has_exited;
+  int has_exited;
 
   has_exited = debug_target.to_has_exited (pid, wait_status, exit_status);
 
   fprintf_unfiltered (gdb_stderr, "target_has_exited (%d, %d, %d) = %d\n",
-                      pid, wait_status, *exit_status, has_exited);
+                     pid, wait_status, *exit_status, has_exited);
 
   return has_exited;
 }
@@ -2475,10 +2587,10 @@ debug_to_stop ()
 
 static int
 debug_to_query (type, req, resp, siz)
-  int type;
-  char *req;
-  char *resp;
-  int *siz;
+     int type;
+     char *req;
+     char *resp;
+     int *siz;
 {
   int retval;
 
@@ -2491,8 +2603,8 @@ debug_to_query (type, req, resp, siz)
 
 static struct symtab_and_line *
 debug_to_enable_exception_callback (kind, enable)
-  enum exception_event_kind kind;
-  int enable;
+     enum exception_event_kind kind;
+     int enable;
 {
   struct symtab_and_line *result;
   result = debug_target.to_enable_exception_callback (kind, enable);
@@ -2506,35 +2618,35 @@ static struct exception_event_record *
 debug_to_get_current_exception_event ()
 {
   struct exception_event_record *result;
-  result = debug_target.to_get_current_exception_event();
+  result = debug_target.to_get_current_exception_event ();
   fprintf_unfiltered (gdb_stderr, "target get_current_exception_event ()\n");
   return result;
 }
 
 static char *
 debug_to_pid_to_exec_file (pid)
-  int  pid;
+     int pid;
 {
-  char *  exec_file;
+  char *exec_file;
 
   exec_file = debug_target.to_pid_to_exec_file (pid);
 
   fprintf_unfiltered (gdb_stderr, "target_pid_to_exec_file (%d) = %s\n",
-                      pid, exec_file);
+                     pid, exec_file);
 
   return exec_file;
 }
 
 static char *
 debug_to_core_file_to_sym_file (core)
-  char *  core;
+     char *core;
 {
-  char *  sym_file;
+  char *sym_file;
 
   sym_file = debug_target.to_core_file_to_sym_file (core);
 
   fprintf_unfiltered (gdb_stderr, "target_core_file_to_sym_file (%s) = %s\n",
-                      core, sym_file);
+                     core, sym_file);
 
   return sym_file;
 }
@@ -2600,10 +2712,10 @@ setup_target_debug ()
   current_target.to_core_file_to_sym_file = debug_to_core_file_to_sym_file;
 
 }
-
 \f
-static char targ_desc[] = 
-    "Names of targets and files being debugged.\n\
+
+static char targ_desc[] =
+"Names of targets and files being debugged.\n\
 Shows the entire stack of targets currently in use (including the exec-file,\n\
 core-file, and process, if any), as well as the symbol file name.";
 
@@ -2617,11 +2729,11 @@ initialize_targets ()
   add_info ("files", target_info, targ_desc);
 
   add_show_from_set (
-     add_set_cmd ("targetdebug", class_maintenance, var_zinteger,
-                 (char *)&targetdebug,
-                "Set target debugging.\n\
+               add_set_cmd ("targetdebug", class_maintenance, var_zinteger,
+                            (char *) &targetdebug,
+                            "Set target debugging.\n\
 When non-zero, target debugging is enabled.", &setlist),
-                    &showlist);
+                     &showlist);
 
   if (!STREQ (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC"))
     abort ();
index 16b2517aeaa453457d3de45f0068b75c3c2a060c..f7e0a94984dcce875a50d62acadd0eda530ce99b 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1990, 91, 92, 93, 94, 1999 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by John Gilmore.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (TARGET_H)
 #define TARGET_H
@@ -43,63 +44,66 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "bfd.h"
 #include "symtab.h"
 
-enum strata {
-       dummy_stratum,          /* The lowest of the low */
-       file_stratum,           /* Executable files, etc */
-       core_stratum,           /* Core dump files */
-       download_stratum,       /* Downloading of remote targets */
-       process_stratum         /* Executing processes */
-};
+enum strata
+  {
+    dummy_stratum,             /* The lowest of the low */
+    file_stratum,              /* Executable files, etc */
+    core_stratum,              /* Core dump files */
+    download_stratum,          /* Downloading of remote targets */
+    process_stratum            /* Executing processes */
+  };
 
-enum thread_control_capabilities {
-       tc_none = 0,            /* Default: can't control thread execution. */
-       tc_schedlock = 1,       /* Can lock the thread scheduler. */
-       tc_switch = 2           /* Can switch the running thread on demand. */
-};
+enum thread_control_capabilities
+  {
+    tc_none = 0,               /* Default: can't control thread execution. */
+    tc_schedlock = 1,          /* Can lock the thread scheduler. */
+    tc_switch = 2              /* Can switch the running thread on demand. */
+  };
 
 /* Stuff for target_wait.  */
 
 /* Generally, what has the program done?  */
-enum target_waitkind {
-  /* The program has exited.  The exit status is in value.integer.  */
-  TARGET_WAITKIND_EXITED,
+enum target_waitkind
+  {
+    /* The program has exited.  The exit status is in value.integer.  */
+    TARGET_WAITKIND_EXITED,
 
-  /* The program has stopped with a signal.  Which signal is in value.sig.  */
-  TARGET_WAITKIND_STOPPED,
+    /* The program has stopped with a signal.  Which signal is in value.sig.  */
+    TARGET_WAITKIND_STOPPED,
 
-  /* The program has terminated with a signal.  Which signal is in
-     value.sig.  */
-  TARGET_WAITKIND_SIGNALLED,
+    /* The program has terminated with a signal.  Which signal is in
+       value.sig.  */
+    TARGET_WAITKIND_SIGNALLED,
 
-  /* The program is letting us know that it dynamically loaded something
-     (e.g. it called load(2) on AIX).  */
-  TARGET_WAITKIND_LOADED,
+    /* The program is letting us know that it dynamically loaded something
+       (e.g. it called load(2) on AIX).  */
+    TARGET_WAITKIND_LOADED,
 
-  /* The program has forked.  A "related" process' ID is in value.related_pid.
-     I.e., if the child forks, value.related_pid is the parent's ID.
+    /* The program has forked.  A "related" process' ID is in value.related_pid.
+       I.e., if the child forks, value.related_pid is the parent's ID.
      */
-  TARGET_WAITKIND_FORKED,
+    TARGET_WAITKIND_FORKED,
 
-  /* The program has vforked.  A "related" process's ID is in value.related_pid.
+    /* The program has vforked.  A "related" process's ID is in value.related_pid.
      */
-  TARGET_WAITKIND_VFORKED,
+    TARGET_WAITKIND_VFORKED,
 
-  /* The program has exec'ed a new executable file.  The new file's pathname
-     is pointed to by value.execd_pathname.
+    /* The program has exec'ed a new executable file.  The new file's pathname
+       is pointed to by value.execd_pathname.
      */
-  TARGET_WAITKIND_EXECD,
+    TARGET_WAITKIND_EXECD,
 
-  /* The program has entered or returned from a system call.  On HP-UX, this
-     is used in the hardware watchpoint implementation.  The syscall's unique
-     integer ID number is in value.syscall_id;
+    /* The program has entered or returned from a system call.  On HP-UX, this
+       is used in the hardware watchpoint implementation.  The syscall's unique
+       integer ID number is in value.syscall_id;
      */
-  TARGET_WAITKIND_SYSCALL_ENTRY,
-  TARGET_WAITKIND_SYSCALL_RETURN,
+    TARGET_WAITKIND_SYSCALL_ENTRY,
+    TARGET_WAITKIND_SYSCALL_RETURN,
 
-  /* Nothing happened, but we stopped anyway.  This perhaps should be handled
-     within target_wait, but I'm not sure target_wait should be resuming the
-     inferior.  */
-  TARGET_WAITKIND_SPURIOUS
+    /* Nothing happened, but we stopped anyway.  This perhaps should be handled
+       within target_wait, but I'm not sure target_wait should be resuming the
+       inferior.  */
+    TARGET_WAITKIND_SPURIOUS
   };
 
 /* The numbering of these signals is chosen to match traditional unix
@@ -129,125 +133,129 @@ enum target_waitkind {
 /* For an explanation of what each signal means, see
    target_signal_to_string.  */
 
-enum target_signal {
-  /* Used some places (e.g. stop_signal) to record the concept that
-     there is no signal.  */
-  TARGET_SIGNAL_0 = 0,
-  TARGET_SIGNAL_FIRST = 0,
-  TARGET_SIGNAL_HUP = 1,
-  TARGET_SIGNAL_INT = 2,
-  TARGET_SIGNAL_QUIT = 3,
-  TARGET_SIGNAL_ILL = 4,
-  TARGET_SIGNAL_TRAP = 5,
-  TARGET_SIGNAL_ABRT = 6,
-  TARGET_SIGNAL_EMT = 7,
-  TARGET_SIGNAL_FPE = 8,
-  TARGET_SIGNAL_KILL = 9,
-  TARGET_SIGNAL_BUS = 10,
-  TARGET_SIGNAL_SEGV = 11,
-  TARGET_SIGNAL_SYS = 12,
-  TARGET_SIGNAL_PIPE = 13,
-  TARGET_SIGNAL_ALRM = 14,
-  TARGET_SIGNAL_TERM = 15,
-  TARGET_SIGNAL_URG = 16,
-  TARGET_SIGNAL_STOP = 17,
-  TARGET_SIGNAL_TSTP = 18,
-  TARGET_SIGNAL_CONT = 19,
-  TARGET_SIGNAL_CHLD = 20,
-  TARGET_SIGNAL_TTIN = 21,
-  TARGET_SIGNAL_TTOU = 22,
-  TARGET_SIGNAL_IO = 23,
-  TARGET_SIGNAL_XCPU = 24,
-  TARGET_SIGNAL_XFSZ = 25,
-  TARGET_SIGNAL_VTALRM = 26,
-  TARGET_SIGNAL_PROF = 27,
-  TARGET_SIGNAL_WINCH = 28,
-  TARGET_SIGNAL_LOST = 29,
-  TARGET_SIGNAL_USR1 = 30,
-  TARGET_SIGNAL_USR2 = 31,
-  TARGET_SIGNAL_PWR = 32,
-  /* Similar to SIGIO.  Perhaps they should have the same number.  */
-  TARGET_SIGNAL_POLL = 33,
-  TARGET_SIGNAL_WIND = 34,
-  TARGET_SIGNAL_PHONE = 35,
-  TARGET_SIGNAL_WAITING = 36,
-  TARGET_SIGNAL_LWP = 37,
-  TARGET_SIGNAL_DANGER = 38,
-  TARGET_SIGNAL_GRANT = 39,
-  TARGET_SIGNAL_RETRACT = 40,
-  TARGET_SIGNAL_MSG = 41,
-  TARGET_SIGNAL_SOUND = 42,
-  TARGET_SIGNAL_SAK = 43,
-  TARGET_SIGNAL_PRIO = 44,
-  TARGET_SIGNAL_REALTIME_33 = 45,
-  TARGET_SIGNAL_REALTIME_34 = 46,
-  TARGET_SIGNAL_REALTIME_35 = 47,
-  TARGET_SIGNAL_REALTIME_36 = 48,
-  TARGET_SIGNAL_REALTIME_37 = 49,
-  TARGET_SIGNAL_REALTIME_38 = 50,
-  TARGET_SIGNAL_REALTIME_39 = 51,
-  TARGET_SIGNAL_REALTIME_40 = 52,
-  TARGET_SIGNAL_REALTIME_41 = 53,
-  TARGET_SIGNAL_REALTIME_42 = 54,
-  TARGET_SIGNAL_REALTIME_43 = 55,
-  TARGET_SIGNAL_REALTIME_44 = 56,
-  TARGET_SIGNAL_REALTIME_45 = 57,
-  TARGET_SIGNAL_REALTIME_46 = 58,
-  TARGET_SIGNAL_REALTIME_47 = 59,
-  TARGET_SIGNAL_REALTIME_48 = 60,
-  TARGET_SIGNAL_REALTIME_49 = 61,
-  TARGET_SIGNAL_REALTIME_50 = 62,
-  TARGET_SIGNAL_REALTIME_51 = 63,
-  TARGET_SIGNAL_REALTIME_52 = 64,
-  TARGET_SIGNAL_REALTIME_53 = 65,
-  TARGET_SIGNAL_REALTIME_54 = 66,
-  TARGET_SIGNAL_REALTIME_55 = 67,
-  TARGET_SIGNAL_REALTIME_56 = 68,
-  TARGET_SIGNAL_REALTIME_57 = 69,
-  TARGET_SIGNAL_REALTIME_58 = 70,
-  TARGET_SIGNAL_REALTIME_59 = 71,
-  TARGET_SIGNAL_REALTIME_60 = 72,
-  TARGET_SIGNAL_REALTIME_61 = 73,
-  TARGET_SIGNAL_REALTIME_62 = 74,
-  TARGET_SIGNAL_REALTIME_63 = 75,
-
-  /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
-  TARGET_SIGNAL_CANCEL = 76,
+enum target_signal
+  {
+    /* Used some places (e.g. stop_signal) to record the concept that
+       there is no signal.  */
+    TARGET_SIGNAL_0 = 0,
+    TARGET_SIGNAL_FIRST = 0,
+    TARGET_SIGNAL_HUP = 1,
+    TARGET_SIGNAL_INT = 2,
+    TARGET_SIGNAL_QUIT = 3,
+    TARGET_SIGNAL_ILL = 4,
+    TARGET_SIGNAL_TRAP = 5,
+    TARGET_SIGNAL_ABRT = 6,
+    TARGET_SIGNAL_EMT = 7,
+    TARGET_SIGNAL_FPE = 8,
+    TARGET_SIGNAL_KILL = 9,
+    TARGET_SIGNAL_BUS = 10,
+    TARGET_SIGNAL_SEGV = 11,
+    TARGET_SIGNAL_SYS = 12,
+    TARGET_SIGNAL_PIPE = 13,
+    TARGET_SIGNAL_ALRM = 14,
+    TARGET_SIGNAL_TERM = 15,
+    TARGET_SIGNAL_URG = 16,
+    TARGET_SIGNAL_STOP = 17,
+    TARGET_SIGNAL_TSTP = 18,
+    TARGET_SIGNAL_CONT = 19,
+    TARGET_SIGNAL_CHLD = 20,
+    TARGET_SIGNAL_TTIN = 21,
+    TARGET_SIGNAL_TTOU = 22,
+    TARGET_SIGNAL_IO = 23,
+    TARGET_SIGNAL_XCPU = 24,
+    TARGET_SIGNAL_XFSZ = 25,
+    TARGET_SIGNAL_VTALRM = 26,
+    TARGET_SIGNAL_PROF = 27,
+    TARGET_SIGNAL_WINCH = 28,
+    TARGET_SIGNAL_LOST = 29,
+    TARGET_SIGNAL_USR1 = 30,
+    TARGET_SIGNAL_USR2 = 31,
+    TARGET_SIGNAL_PWR = 32,
+    /* Similar to SIGIO.  Perhaps they should have the same number.  */
+    TARGET_SIGNAL_POLL = 33,
+    TARGET_SIGNAL_WIND = 34,
+    TARGET_SIGNAL_PHONE = 35,
+    TARGET_SIGNAL_WAITING = 36,
+    TARGET_SIGNAL_LWP = 37,
+    TARGET_SIGNAL_DANGER = 38,
+    TARGET_SIGNAL_GRANT = 39,
+    TARGET_SIGNAL_RETRACT = 40,
+    TARGET_SIGNAL_MSG = 41,
+    TARGET_SIGNAL_SOUND = 42,
+    TARGET_SIGNAL_SAK = 43,
+    TARGET_SIGNAL_PRIO = 44,
+    TARGET_SIGNAL_REALTIME_33 = 45,
+    TARGET_SIGNAL_REALTIME_34 = 46,
+    TARGET_SIGNAL_REALTIME_35 = 47,
+    TARGET_SIGNAL_REALTIME_36 = 48,
+    TARGET_SIGNAL_REALTIME_37 = 49,
+    TARGET_SIGNAL_REALTIME_38 = 50,
+    TARGET_SIGNAL_REALTIME_39 = 51,
+    TARGET_SIGNAL_REALTIME_40 = 52,
+    TARGET_SIGNAL_REALTIME_41 = 53,
+    TARGET_SIGNAL_REALTIME_42 = 54,
+    TARGET_SIGNAL_REALTIME_43 = 55,
+    TARGET_SIGNAL_REALTIME_44 = 56,
+    TARGET_SIGNAL_REALTIME_45 = 57,
+    TARGET_SIGNAL_REALTIME_46 = 58,
+    TARGET_SIGNAL_REALTIME_47 = 59,
+    TARGET_SIGNAL_REALTIME_48 = 60,
+    TARGET_SIGNAL_REALTIME_49 = 61,
+    TARGET_SIGNAL_REALTIME_50 = 62,
+    TARGET_SIGNAL_REALTIME_51 = 63,
+    TARGET_SIGNAL_REALTIME_52 = 64,
+    TARGET_SIGNAL_REALTIME_53 = 65,
+    TARGET_SIGNAL_REALTIME_54 = 66,
+    TARGET_SIGNAL_REALTIME_55 = 67,
+    TARGET_SIGNAL_REALTIME_56 = 68,
+    TARGET_SIGNAL_REALTIME_57 = 69,
+    TARGET_SIGNAL_REALTIME_58 = 70,
+    TARGET_SIGNAL_REALTIME_59 = 71,
+    TARGET_SIGNAL_REALTIME_60 = 72,
+    TARGET_SIGNAL_REALTIME_61 = 73,
+    TARGET_SIGNAL_REALTIME_62 = 74,
+    TARGET_SIGNAL_REALTIME_63 = 75,
+
+    /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
+    TARGET_SIGNAL_CANCEL = 76,
 
 #if defined(MACH) || defined(__MACH__)
-  /* Mach exceptions */
-  TARGET_EXC_BAD_ACCESS,
-  TARGET_EXC_BAD_INSTRUCTION,
-  TARGET_EXC_ARITHMETIC,
-  TARGET_EXC_EMULATION,
-  TARGET_EXC_SOFTWARE,
-  TARGET_EXC_BREAKPOINT,
+    /* Mach exceptions */
+    TARGET_EXC_BAD_ACCESS,
+    TARGET_EXC_BAD_INSTRUCTION,
+    TARGET_EXC_ARITHMETIC,
+    TARGET_EXC_EMULATION,
+    TARGET_EXC_SOFTWARE,
+    TARGET_EXC_BREAKPOINT,
 #endif
-  TARGET_SIGNAL_INFO,
-
-  /* Some signal we don't know about.  */
-  TARGET_SIGNAL_UNKNOWN,
+    TARGET_SIGNAL_INFO,
 
-  /* Use whatever signal we use when one is not specifically specified
-     (for passing to proceed and so on).  */
-  TARGET_SIGNAL_DEFAULT,
+    /* Some signal we don't know about.  */
+    TARGET_SIGNAL_UNKNOWN,
 
-  /* Last and unused enum value, for sizing arrays, etc.  */
-  TARGET_SIGNAL_LAST
-};
+    /* Use whatever signal we use when one is not specifically specified
+       (for passing to proceed and so on).  */
+    TARGET_SIGNAL_DEFAULT,
 
-struct target_waitstatus {
-  enum target_waitkind kind;
+    /* Last and unused enum value, for sizing arrays, etc.  */
+    TARGET_SIGNAL_LAST
+  };
 
-  /* Forked child pid, execd pathname, exit status or signal number.  */
-  union {
-    int integer;
-    enum target_signal sig;
-    int  related_pid;
-    char *  execd_pathname;
-    int  syscall_id;
-  } value;
-};
+struct target_waitstatus
+  {
+    enum target_waitkind kind;
+
+    /* Forked child pid, execd pathname, exit status or signal number.  */
+    union
+      {
+       int integer;
+       enum target_signal sig;
+       int related_pid;
+       char *execd_pathname;
+       int syscall_id;
+      }
+    value;
+  };
 
 /* Return the string for a signal.  */
 extern char *target_signal_to_string PARAMS ((enum target_signal));
@@ -257,8 +265,8 @@ extern char *target_signal_to_name PARAMS ((enum target_signal));
 
 /* Given a name (SIGHUP, etc.), return its signal.  */
 enum target_signal target_signal_from_name PARAMS ((char *));
-
 \f
+
 /* If certain kinds of activity happen, target_wait should perform
    callbacks.  */
 /* Right now we just call (*TARGET_ACTIVITY_FUNCTION) if I/O is possible
@@ -268,127 +276,127 @@ extern int target_activity_fd;
 extern int (*target_activity_function) PARAMS ((void));
 \f
 struct target_ops
-{
-  char        *to_shortname;   /* Name this target type */
-  char        *to_longname;    /* Name for printing */
-  char                *to_doc;         /* Documentation.  Does not include trailing
+  {
+    char *to_shortname;                /* Name this target type */
+    char *to_longname;         /* Name for printing */
+    char *to_doc;              /* Documentation.  Does not include trailing
                                   newline, and starts with a one-line descrip-
                                   tion (probably similar to to_longname). */
-  void               (*to_open) PARAMS ((char *, int));
-  void               (*to_close) PARAMS ((int));
-  void               (*to_attach) PARAMS ((char *, int));
-  void        (*to_post_attach) PARAMS ((int));
-  void               (*to_require_attach) PARAMS ((char *, int));
-  void               (*to_detach) PARAMS ((char *, int));
-  void               (*to_require_detach) PARAMS ((int, char *, int));
-  void               (*to_resume) PARAMS ((int, int, enum target_signal));
-  int                (*to_wait) PARAMS ((int, struct target_waitstatus *));
-  void        (*to_post_wait) PARAMS ((int, int));
-  void               (*to_fetch_registers) PARAMS ((int));
-  void               (*to_store_registers) PARAMS ((int));
-  void               (*to_prepare_to_store) PARAMS ((void));
-
-  /* Transfer LEN bytes of memory between GDB address MYADDR and
-     target address MEMADDR.  If WRITE, transfer them to the target, else
-     transfer them from the target.  TARGET is the target from which we
-     get this function.
-
-     Return value, N, is one of the following:
-
-     0 means that we can't handle this.  If errno has been set, it is the
-     error which prevented us from doing it (FIXME: What about bfd_error?).
-
-     positive (call it N) means that we have transferred N bytes
-     starting at MEMADDR.  We might be able to handle more bytes
-     beyond this length, but no promises.
-
-     negative (call its absolute value N) means that we cannot
-     transfer right at MEMADDR, but we could transfer at least
-     something at MEMADDR + N.  */
-
-  int                (*to_xfer_memory) PARAMS ((CORE_ADDR memaddr, char *myaddr,
-                                        int len, int write,
-                                        struct target_ops * target));
+    void (*to_open) PARAMS ((char *, int));
+    void (*to_close) PARAMS ((int));
+    void (*to_attach) PARAMS ((char *, int));
+    void (*to_post_attach) PARAMS ((int));
+    void (*to_require_attach) PARAMS ((char *, int));
+    void (*to_detach) PARAMS ((char *, int));
+    void (*to_require_detach) PARAMS ((int, char *, int));
+    void (*to_resume) PARAMS ((int, int, enum target_signal));
+    int (*to_wait) PARAMS ((int, struct target_waitstatus *));
+    void (*to_post_wait) PARAMS ((int, int));
+    void (*to_fetch_registers) PARAMS ((int));
+    void (*to_store_registers) PARAMS ((int));
+    void (*to_prepare_to_store) PARAMS ((void));
+
+    /* Transfer LEN bytes of memory between GDB address MYADDR and
+       target address MEMADDR.  If WRITE, transfer them to the target, else
+       transfer them from the target.  TARGET is the target from which we
+       get this function.
+
+       Return value, N, is one of the following:
+
+       0 means that we can't handle this.  If errno has been set, it is the
+       error which prevented us from doing it (FIXME: What about bfd_error?).
+
+       positive (call it N) means that we have transferred N bytes
+       starting at MEMADDR.  We might be able to handle more bytes
+       beyond this length, but no promises.
+
+       negative (call its absolute value N) means that we cannot
+       transfer right at MEMADDR, but we could transfer at least
+       something at MEMADDR + N.  */
+
+    int (*to_xfer_memory) PARAMS ((CORE_ADDR memaddr, char *myaddr,
+                                  int len, int write,
+                                  struct target_ops * target));
 
 #if 0
-  /* Enable this after 4.12.  */
+    /* Enable this after 4.12.  */
 
-  /* Search target memory.  Start at STARTADDR and take LEN bytes of
-     target memory, and them with MASK, and compare to DATA.  If they
-     match, set *ADDR_FOUND to the address we found it at, store the data
-     we found at LEN bytes starting at DATA_FOUND, and return.  If
-     not, add INCREMENT to the search address and keep trying until
-     the search address is outside of the range [LORANGE,HIRANGE).
+    /* Search target memory.  Start at STARTADDR and take LEN bytes of
+       target memory, and them with MASK, and compare to DATA.  If they
+       match, set *ADDR_FOUND to the address we found it at, store the data
+       we found at LEN bytes starting at DATA_FOUND, and return.  If
+       not, add INCREMENT to the search address and keep trying until
+       the search address is outside of the range [LORANGE,HIRANGE).
 
-     If we don't find anything, set *ADDR_FOUND to (CORE_ADDR)0 and return.  */
-  void (*to_search) PARAMS ((int len, char *data, char *mask,
-                            CORE_ADDR startaddr, int increment,
-                            CORE_ADDR lorange, CORE_ADDR hirange,
-                            CORE_ADDR *addr_found, char *data_found));
+       If we don't find anything, set *ADDR_FOUND to (CORE_ADDR)0 and return.  */
+    void (*to_search) PARAMS ((int len, char *data, char *mask,
+                              CORE_ADDR startaddr, int increment,
+                              CORE_ADDR lorange, CORE_ADDR hirange,
+                              CORE_ADDR * addr_found, char *data_found));
 
 #define        target_search(len, data, mask, startaddr, increment, lorange, hirange, addr_found, data_found)  \
   (*current_target.to_search) (len, data, mask, startaddr, increment, \
                                lorange, hirange, addr_found, data_found)
-#endif /* 0 */
-
-  void               (*to_files_info) PARAMS ((struct target_ops *));
-  int                (*to_insert_breakpoint) PARAMS ((CORE_ADDR, char *));
-  int        (*to_remove_breakpoint) PARAMS ((CORE_ADDR, char *));
-  void               (*to_terminal_init) PARAMS ((void));
-  void               (*to_terminal_inferior) PARAMS ((void));
-  void               (*to_terminal_ours_for_output) PARAMS ((void));
-  void               (*to_terminal_ours) PARAMS ((void));
-  void               (*to_terminal_info) PARAMS ((char *, int));
-  void               (*to_kill) PARAMS ((void));
-  void               (*to_load) PARAMS ((char *, int));
-  int        (*to_lookup_symbol) PARAMS ((char *, CORE_ADDR *));
-  void               (*to_create_inferior) PARAMS ((char *, char *, char **));
-  void        (*to_post_startup_inferior) PARAMS ((int));
-  void        (*to_acknowledge_created_inferior) PARAMS ((int));
-  void        (*to_clone_and_follow_inferior) PARAMS ((int, int *));
-  void        (*to_post_follow_inferior_by_clone) PARAMS ((void));
-  int         (*to_insert_fork_catchpoint) PARAMS ((int));
-  int         (*to_remove_fork_catchpoint) PARAMS ((int));
-  int         (*to_insert_vfork_catchpoint) PARAMS ((int));
-  int         (*to_remove_vfork_catchpoint) PARAMS ((int));
-  int         (*to_has_forked) PARAMS ((int, int *));
-  int         (*to_has_vforked) PARAMS ((int, int *));
-  int         (*to_can_follow_vfork_prior_to_exec) PARAMS ((void));
-  void        (*to_post_follow_vfork) PARAMS ((int, int, int, int));
-  int         (*to_insert_exec_catchpoint) PARAMS ((int));
-  int         (*to_remove_exec_catchpoint) PARAMS ((int));
-  int         (*to_has_execd) PARAMS ((int, char **));
-  int         (*to_reported_exec_events_per_exec_call) PARAMS ((void));
-  int         (*to_has_syscall_event) PARAMS ((int, enum target_waitkind *, int *));
-  int         (*to_has_exited) PARAMS ((int, int, int *));
-  void               (*to_mourn_inferior) PARAMS ((void));
-  int        (*to_can_run) PARAMS ((void));
-  void       (*to_notice_signals) PARAMS ((int pid));
-  int        (*to_thread_alive) PARAMS ((int pid));
-  void        (*to_find_new_threads) PARAMS ((void));
-  void       (*to_stop) PARAMS ((void));
-  int        (*to_query) PARAMS ((int/*char*/, char *, char *, int *));
-  struct symtab_and_line * (*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
-  struct exception_event_record * (*to_get_current_exception_event) PARAMS ((void));
-  char *      (*to_pid_to_exec_file) PARAMS ((int pid));
-  char *      (*to_core_file_to_sym_file) PARAMS ((char *));
-  enum strata   to_stratum;
-  struct target_ops
-               *DONT_USE;      /* formerly to_next */
-  int          to_has_all_memory;
-  int          to_has_memory;
-  int          to_has_stack;
-  int          to_has_registers;
-  int          to_has_execution;
-  int          to_has_thread_control;  /* control thread execution */
-  int           to_has_async_exec;
-  struct section_table
-              *to_sections;
-  struct section_table
-              *to_sections_end;
-  int          to_magic;
-  /* Need sub-structure for target machine related rather than comm related? */
-};
+#endif                         /* 0 */
+
+    void (*to_files_info) PARAMS ((struct target_ops *));
+    int (*to_insert_breakpoint) PARAMS ((CORE_ADDR, char *));
+    int (*to_remove_breakpoint) PARAMS ((CORE_ADDR, char *));
+    void (*to_terminal_init) PARAMS ((void));
+    void (*to_terminal_inferior) PARAMS ((void));
+    void (*to_terminal_ours_for_output) PARAMS ((void));
+    void (*to_terminal_ours) PARAMS ((void));
+    void (*to_terminal_info) PARAMS ((char *, int));
+    void (*to_kill) PARAMS ((void));
+    void (*to_load) PARAMS ((char *, int));
+    int (*to_lookup_symbol) PARAMS ((char *, CORE_ADDR *));
+    void (*to_create_inferior) PARAMS ((char *, char *, char **));
+    void (*to_post_startup_inferior) PARAMS ((int));
+    void (*to_acknowledge_created_inferior) PARAMS ((int));
+    void (*to_clone_and_follow_inferior) PARAMS ((int, int *));
+    void (*to_post_follow_inferior_by_clone) PARAMS ((void));
+    int (*to_insert_fork_catchpoint) PARAMS ((int));
+    int (*to_remove_fork_catchpoint) PARAMS ((int));
+    int (*to_insert_vfork_catchpoint) PARAMS ((int));
+    int (*to_remove_vfork_catchpoint) PARAMS ((int));
+    int (*to_has_forked) PARAMS ((int, int *));
+    int (*to_has_vforked) PARAMS ((int, int *));
+    int (*to_can_follow_vfork_prior_to_exec) PARAMS ((void));
+    void (*to_post_follow_vfork) PARAMS ((int, int, int, int));
+    int (*to_insert_exec_catchpoint) PARAMS ((int));
+    int (*to_remove_exec_catchpoint) PARAMS ((int));
+    int (*to_has_execd) PARAMS ((int, char **));
+    int (*to_reported_exec_events_per_exec_call) PARAMS ((void));
+    int (*to_has_syscall_event) PARAMS ((int, enum target_waitkind *, int *));
+    int (*to_has_exited) PARAMS ((int, int, int *));
+    void (*to_mourn_inferior) PARAMS ((void));
+    int (*to_can_run) PARAMS ((void));
+    void (*to_notice_signals) PARAMS ((int pid));
+    int (*to_thread_alive) PARAMS ((int pid));
+    void (*to_find_new_threads) PARAMS ((void));
+    void (*to_stop) PARAMS ((void));
+    int (*to_query) PARAMS ((int /*char */ , char *, char *, int *));
+    struct symtab_and_line *(*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
+    struct exception_event_record *(*to_get_current_exception_event) PARAMS ((void));
+    char *(*to_pid_to_exec_file) PARAMS ((int pid));
+    char *(*to_core_file_to_sym_file) PARAMS ((char *));
+    enum strata to_stratum;
+    struct target_ops
+     *DONT_USE;                        /* formerly to_next */
+    int to_has_all_memory;
+    int to_has_memory;
+    int to_has_stack;
+    int to_has_registers;
+    int to_has_execution;
+    int to_has_thread_control; /* control thread execution */
+    int to_has_async_exec;
+    struct section_table
+     *to_sections;
+    struct section_table
+     *to_sections_end;
+    int to_magic;
+    /* Need sub-structure for target machine related rather than comm related? */
+  };
 
 /* Magic number for checking ops size.  If a struct doesn't end with this
    number, somebody changed the declaration but didn't change all the
@@ -399,15 +407,15 @@ struct target_ops
 /* The ops structure for our "current" target process.  This should
    never be NULL.  If there is no target, it points to the dummy_target.  */
 
-extern struct target_ops       current_target;
+extern struct target_ops current_target;
 
 /* An item on the target stack.  */
 
 struct target_stack_item
-{
-  struct target_stack_item *next;
-  struct target_ops *target_ops;
-};
+  {
+    struct target_stack_item *next;
+    struct target_ops *target_ops;
+  };
 
 /* The target stack.  */
 
@@ -451,7 +459,7 @@ extern struct target_stack_item *target_stack;
 
    This operation provides a target-specific hook that allows the
    necessary bookkeeping to be performed after an attach completes.
  */
+ */
 #define target_post_attach(pid) \
         (*current_target.to_post_attach) (pid)
 
@@ -519,7 +527,7 @@ target_detach PARAMS ((char *, int));
 
    This operation provides a target-specific hook that allows the
    necessary bookkeeping to be performed to track such sequences.
  */
+ */
 
 #define target_post_wait(pid, status) \
         (*current_target.to_post_wait) (pid, status)
@@ -552,7 +560,7 @@ target_read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
 
 extern int
 target_read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
-                                   asection *bfd_section));
+                                   asection * bfd_section));
 
 extern int
 target_read_memory_partial PARAMS ((CORE_ADDR, char *, int, int *));
@@ -567,10 +575,10 @@ extern int
 child_xfer_memory PARAMS ((CORE_ADDR, char *, int, int, struct target_ops *));
 
 extern char *
-child_pid_to_exec_file PARAMS ((int));
+  child_pid_to_exec_file PARAMS ((int));
 
 extern char *
-child_core_file_to_sym_file PARAMS ((char *));
+  child_core_file_to_sym_file PARAMS ((char *));
 
 #if defined(CHILD_POST_ATTACH)
 extern void
@@ -731,7 +739,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    ALLARGS is a string containing the arguments to the program.
    ENV is the environment vector to pass.  Errors reported with error().
    On VxWorks and various standalone systems, we ignore exec_file.  */
+
 #define        target_create_inferior(exec_file, args, env)    \
        (*current_target.to_create_inferior) (exec_file, args, env)
 
@@ -743,15 +751,15 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    if the shell init file has commands in it, the shell will fork and
    exec for each of those commands, and we will see each such fork
    event.  Very bad.)
-   
+
    Such targets will supply an appropriate definition for this function.
  */
+ */
 #define target_post_startup_inferior(pid) \
         (*current_target.to_post_startup_inferior) (pid)
 
 /* On some targets, the sequence of starting up an inferior requires
    some synchronization between gdb and the new inferior process, PID.
  */
+ */
 #define target_acknowledge_created_inferior(pid) \
         (*current_target.to_acknowledge_created_inferior) (pid)
 
@@ -765,7 +773,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 
    (This is not a terribly useful feature without a GUI to prevent
    the two debuggers from competing for shell input.)
  */
+ */
 #define target_clone_and_follow_inferior(child_pid,followed_child) \
         (*current_target.to_clone_and_follow_inferior) (child_pid, followed_child)
 
@@ -778,14 +786,14 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 
    On some targets, this requires a bit of cleanup to make it work
    correctly.
  */
+ */
 #define target_post_follow_inferior_by_clone() \
         (*current_target.to_post_follow_inferior_by_clone) ()
 
 /* On some targets, we can catch an inferior fork or vfork event when it
    occurs.  These functions insert/remove an already-created catchpoint for
    such events.
  */
+ */
 #define target_insert_fork_catchpoint(pid) \
         (*current_target.to_insert_fork_catchpoint) (pid)
 
@@ -801,14 +809,14 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 /* Returns TRUE if PID has invoked the fork() system call.  And,
    also sets CHILD_PID to the process id of the other ("child")
    inferior process that was created by that call.
  */
+ */
 #define target_has_forked(pid,child_pid) \
         (*current_target.to_has_forked) (pid,child_pid)
 
 /* Returns TRUE if PID has invoked the vfork() system call.  And,
    also sets CHILD_PID to the process id of the other ("child")
    inferior process that was created by that call.
  */
+ */
 #define target_has_vforked(pid,child_pid) \
         (*current_target.to_has_vforked) (pid,child_pid)
 
@@ -820,7 +828,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    This function should be defined to return 1 by those targets
    which can allow the debugger to immediately follow a vforked
    child, and 0 if they cannot.
  */
+ */
 #define target_can_follow_vfork_prior_to_exec() \
         (*current_target.to_can_follow_vfork_prior_to_exec) ()
 
@@ -831,44 +839,44 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    If so, this function should be defined by those targets that
    require the debugger to perform cleanup or initialization after
    the vfork follow.
  */
+ */
 #define target_post_follow_vfork(parent_pid,followed_parent,child_pid,followed_child) \
         (*current_target.to_post_follow_vfork) (parent_pid,followed_parent,child_pid,followed_child)
 
 /* On some targets, we can catch an inferior exec event when it
    occurs.  These functions insert/remove an already-created catchpoint
    for such events.
  */
+ */
 #define target_insert_exec_catchpoint(pid) \
         (*current_target.to_insert_exec_catchpoint) (pid)
+
 #define target_remove_exec_catchpoint(pid) \
         (*current_target.to_remove_exec_catchpoint) (pid)
 
 /* Returns TRUE if PID has invoked a flavor of the exec() system call.
    And, also sets EXECD_PATHNAME to the pathname of the executable file
    that was passed to exec(), and is now being executed.
  */
+ */
 #define target_has_execd(pid,execd_pathname) \
         (*current_target.to_has_execd) (pid,execd_pathname)
 
 /* Returns the number of exec events that are reported when a process
    invokes a flavor of the exec() system call on this target, if exec
    events are being reported.
  */
+ */
 #define target_reported_exec_events_per_exec_call() \
         (*current_target.to_reported_exec_events_per_exec_call) ()
 
 /* Returns TRUE if PID has reported a syscall event.  And, also sets
    KIND to the appropriate TARGET_WAITKIND_, and sets SYSCALL_ID to
    the unique integer ID of the syscall.
  */
+ */
 #define target_has_syscall_event(pid,kind,syscall_id) \
   (*current_target.to_has_syscall_event) (pid,kind,syscall_id)
 
 /* Returns TRUE if PID has exited.  And, also sets EXIT_STATUS to the
    exit code of PID, if any.
  */
+ */
 #define target_has_exited(pid,wait_status,exit_status) \
         (*current_target.to_has_exited) (pid,wait_status,exit_status)
 
@@ -876,7 +884,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    some process event that must be processed.  This function should
    be defined by those targets that require the debugger to perform
    cleanup or internal state changes in response to the process event.
  */
+ */
 
 /* The inferior process has died.  Do what is right.  */
 
@@ -918,7 +926,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
    information is desired and the third is a buffer that carries back the 
    response from the target side. The fourth parameter is the size of the
    output buffer supplied. */
+
 #define        target_query(query_type, query, resp_buffer, bufffer_size)      \
        (*current_target.to_query) (query_type, query, resp_buffer, bufffer_size)
 
@@ -933,7 +941,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
         (*current_target.to_enable_exception_callback) (kind, enable)
 
 /* Get the current exception event kind -- throw or catch, etc. */
-   
+
 #define target_get_current_exception_event() \
         (*current_target.to_get_current_exception_event) ()
 
@@ -956,7 +964,7 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
 
 /* Does the target have a stack?  (Exec files don't, VxWorks doesn't, until
    we start a process.)  */
-   
+
 #define        target_has_stack        \
        (current_target.to_has_stack)
 
@@ -1006,7 +1014,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
         normal_pid_to_str (PID)
 extern char *normal_pid_to_str PARAMS ((int pid));
 #endif
+
 
 #ifndef target_new_objfile
 #define target_new_objfile(OBJFILE)
@@ -1021,14 +1029,14 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    that was run to create a specified process.
 
    The process PID must be stopped when this operation is used.
-   
+
    If the executable file cannot be determined, NULL is returned.
 
    Else, a pointer to a character string containing the pathname
    is returned.  This string should be copied into a buffer by
    the client if the string will not be immediately used, or if
    it must persist.
  */
+ */
 
 #define target_pid_to_exec_file(pid) \
        (current_target.to_pid_to_exec_file) (pid)
@@ -1058,7 +1066,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
 /* HP-UX supplies these operations, which respectively disable and enable
    the memory page-protections that are used to implement hardware watchpoints
    on that platform.  See wait_for_inferior's use of these.
  */
+ */
 #if !defined(TARGET_DISABLE_HW_WATCHPOINTS)
 #define TARGET_DISABLE_HW_WATCHPOINTS(pid)
 #endif
@@ -1089,7 +1097,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    severe performance penalties, such that we might as well use regular
    watchpoints, and save (possibly precious) hardware watchpoints for other
    locations.
  */
+ */
 #if !defined(TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT)
 #define TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT(pid,start,len) 0
 #endif
@@ -1124,7 +1132,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    from a minimal symbol, but the value really means, essentially,
    "This is an index into a table which is populated when the inferior
    is run.  Therefore, do not attempt to use this as a PC."
  */
+ */
 #if !defined(PC_REQUIRES_RUN_BEFORE_USE)
 #define PC_REQUIRES_RUN_BEFORE_USE(pc) (0)
 #endif
@@ -1136,7 +1144,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    child process after it has exec'd, causes the parent process to resume as
    well.  To prevent the parent from running spontaneously, such targets should
    define this to a function that prevents that from happening.
  */
+ */
 #if !defined(ENSURE_VFORKING_PARENT_REMAINS_STOPPED)
 #define ENSURE_VFORKING_PARENT_REMAINS_STOPPED(PID) (0)
 #endif
@@ -1147,7 +1155,7 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    On some targets (such as HP-UX 10.20 and earlier), a newly vforked child
    process must be resumed when it delivers its exec event, before the parent
    vfork event will be delivered to us.
  */
+ */
 #if !defined(RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK)
 #define RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK() (0)
 #endif
@@ -1157,15 +1165,15 @@ extern char *normal_pid_to_str PARAMS ((int pid));
    add_target:   Add a target to the list of all possible targets.
 
    push_target:  Make this target the top of the stack of currently used
-                targets, within its particular stratum of the stack.  Result
-                is 0 if now atop the stack, nonzero if not on top (maybe
-                should warn user).
+   targets, within its particular stratum of the stack.  Result
+   is 0 if now atop the stack, nonzero if not on top (maybe
+   should warn user).
 
    unpush_target: Remove this from the stack of currently used targets,
-                no matter where it is on the list.  Returns 0 if no
-                change, 1 if removed from stack.
+   no matter where it is on the list.  Returns 0 if no
+   change, 1 if removed from stack.
 
-   pop_target:  Remove the top thing on the stack of current targets.  */
+   pop_target:   Remove the top thing on the stack of current targets.  */
 
 extern void
 add_target PARAMS ((struct target_ops *));
@@ -1186,14 +1194,15 @@ pop_target PARAMS ((void));
    mostly used with BFD files, but can be used without (e.g. for handling
    raw disks, or files not in formats handled by BFD).  */
 
-struct section_table {
-  CORE_ADDR addr;              /* Lowest address in section */
-  CORE_ADDR endaddr;           /* 1+highest address in section */
+struct section_table
+  {
+    CORE_ADDR addr;            /* Lowest address in section */
+    CORE_ADDR endaddr;         /* 1+highest address in section */
 
-  sec_ptr the_bfd_section;
+    sec_ptr the_bfd_section;
 
-  bfd     *bfd;                /* BFD file pointer */
-};
+    bfd *bfd;                  /* BFD file pointer */
+  };
 
 /* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR.
    Returns 0 if OK, 1 on error.  */
@@ -1240,7 +1249,7 @@ find_default_clone_and_follow_inferior PARAMS ((int, int *));
 extern struct target_ops *find_run_target PARAMS ((void));
 
 extern struct target_ops *
-find_core_target PARAMS ((void));
+  find_core_target PARAMS ((void));
 \f
 /* Stuff that should be shared among the various remote targets.  */
 
@@ -1288,4 +1297,4 @@ void target_ignore PARAMS ((void));
    do { *(REGP) = FP_REGNUM; *(OFFP) =  0; } while (0)
 #endif /* TARGET_VIRTUAL_FRAME_POINTER */
 
-#endif /* !defined (TARGET_H) */
+#endif /* !defined (TARGET_H) */
index e7fb2cb4cde789e8b057b168049dc7613c070d1d..72d38f7f81ebaac61c0c655c2b5a5502d19d84fa 100644 (file)
@@ -1,21 +1,22 @@
 /* Terminal interface definitions for GDB, the GNU Debugger.
    Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (TERMINAL_H)
 #define TERMINAL_H 1
@@ -89,4 +90,4 @@ extern int job_control;
    we lack job control.  */
 extern int gdb_setpgid PARAMS ((void));
 
-#endif /* !defined (TERMINAL_H) */
+#endif /* !defined (TERMINAL_H) */
index 516bca3beb8f16902d5f2deb6da2af4aa0f8cdbe..4be1a74c28d91f7e02e47e01d2f201cd2c7003d5 100644 (file)
@@ -4,21 +4,22 @@
    Contributed by Lynx Real-Time Systems, Inc.  Los Gatos, CA.
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -35,43 +36,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/types.h>
 #include <signal.h>
 
-/*#include "lynxos-core.h"*/
+/*#include "lynxos-core.h" */
 
 struct thread_info
-{
-  struct thread_info *next;
-  int pid;                     /* Actual process id */
-  int num;                     /* Convenient handle */
-  CORE_ADDR prev_pc;           /* State from wait_for_inferior */
-  CORE_ADDR prev_func_start;
-  char *prev_func_name;
-  struct breakpoint *step_resume_breakpoint;
-  struct breakpoint *through_sigtramp_breakpoint;
-  CORE_ADDR step_range_start;
-  CORE_ADDR step_range_end;
-  CORE_ADDR step_frame_address;
-  int trap_expected;
-  int handling_longjmp;
-  int another_trap;
-
-  /* This is set TRUE when a catchpoint of a shared library event
-     triggers.  Since we don't wish to leave the inferior in the
-     solib hook when we report the event, we step the inferior
-     back to user code before stopping and reporting the event.
+  {
+    struct thread_info *next;
+    int pid;                   /* Actual process id */
+    int num;                   /* Convenient handle */
+    CORE_ADDR prev_pc;         /* State from wait_for_inferior */
+    CORE_ADDR prev_func_start;
+    char *prev_func_name;
+    struct breakpoint *step_resume_breakpoint;
+    struct breakpoint *through_sigtramp_breakpoint;
+    CORE_ADDR step_range_start;
+    CORE_ADDR step_range_end;
+    CORE_ADDR step_frame_address;
+    int trap_expected;
+    int handling_longjmp;
+    int another_trap;
+
+    /* This is set TRUE when a catchpoint of a shared library event
+       triggers.  Since we don't wish to leave the inferior in the
+       solib hook when we report the event, we step the inferior
+       back to user code before stopping and reporting the event.
      */
-  int  stepping_through_solib_after_catch;
+    int stepping_through_solib_after_catch;
 
-  /* When stepping_through_solib_after_catch is TRUE, this is a
-     list of the catchpoints that should be reported as triggering
-     when we finally do stop stepping.
+    /* When stepping_through_solib_after_catch is TRUE, this is a
+       list of the catchpoints that should be reported as triggering
+       when we finally do stop stepping.
      */
-  bpstat  stepping_through_solib_catchpoints;
+    bpstat stepping_through_solib_catchpoints;
 
-  /* This is set to TRUE when this thread is in a signal handler
-     trampoline and we're single-stepping through it */
-  int stepping_through_sigtramp;
+    /* This is set to TRUE when this thread is in a signal handler
+       trampoline and we're single-stepping through it */
+    int stepping_through_sigtramp;
 
-};
+  };
 
 /* Prototypes for exported functions. */
 
@@ -82,11 +83,11 @@ void _initialize_thread PARAMS ((void));
 static struct thread_info *thread_list = NULL;
 static int highest_thread_num;
 
-static struct thread_info * find_thread_id PARAMS ((int num));
+static struct thread_info *find_thread_id PARAMS ((int num));
 
-static void thread_command PARAMS ((char * tidstr, int from_tty));
+static void thread_command PARAMS ((char *tidstr, int from_tty));
 static void thread_apply_all_command PARAMS ((char *, int));
-static int  thread_alive PARAMS ((struct thread_info *));
+static int thread_alive PARAMS ((struct thread_info *));
 static void info_threads_command PARAMS ((char *, int));
 static void thread_apply_command PARAMS ((char *, int));
 static void restore_current_thread PARAMS ((int));
@@ -126,7 +127,7 @@ add_thread (pid)
   tp->prev_func_name = NULL;
   tp->step_range_start = 0;
   tp->step_range_end = 0;
-  tp->step_frame_address =0;
+  tp->step_frame_address = 0;
   tp->step_resume_breakpoint = 0;
   tp->through_sigtramp_breakpoint = 0;
   tp->handling_longjmp = 0;
@@ -166,7 +167,7 @@ delete_thread (pid)
 
 static struct thread_info *
 find_thread_id (num)
-    int num;
+     int num;
 {
   struct thread_info *tp;
 
@@ -179,7 +180,7 @@ find_thread_id (num)
 
 int
 valid_thread_id (num)
-    int num;
+     int num;
 {
   struct thread_info *tp;
 
@@ -192,7 +193,7 @@ valid_thread_id (num)
 
 int
 pid_to_thread_id (pid)
-    int pid;
+     int pid;
 {
   struct thread_info *tp;
 
@@ -205,7 +206,7 @@ pid_to_thread_id (pid)
 
 int
 thread_id_to_pid (num)
-    int num;
+     int num;
 {
   struct thread_info *thread = find_thread_id (num);
   if (thread)
@@ -216,7 +217,7 @@ thread_id_to_pid (num)
 
 int
 in_thread_list (pid)
-    int pid;
+     int pid;
 {
   struct thread_info *tp;
 
@@ -229,14 +230,15 @@ in_thread_list (pid)
 
 /* Load infrun state for the thread PID.  */
 
-void load_infrun_state (pid, 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,
-                       handling_longjmp, another_trap,
-                       stepping_through_solib_after_catch,
-                       stepping_through_solib_catchpoints,
-                       stepping_through_sigtramp)
+void
+load_infrun_state (pid, 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,
+                  handling_longjmp, another_trap,
+                  stepping_through_solib_after_catch,
+                  stepping_through_solib_catchpoints,
+                  stepping_through_sigtramp)
      int pid;
      CORE_ADDR *prev_pc;
      CORE_ADDR *prev_func_start;
@@ -249,9 +251,9 @@ void load_infrun_state (pid, prev_pc, prev_func_start, prev_func_name,
      CORE_ADDR *step_frame_address;
      int *handling_longjmp;
      int *another_trap;
-     int *  stepping_through_solib_after_catch;
-     bpstat *  stepping_through_solib_catchpoints;
-     int *  stepping_through_sigtramp;
+     int *stepping_through_solib_after_catch;
+     bpstat *stepping_through_solib_catchpoints;
+     int *stepping_through_sigtramp;
 {
   struct thread_info *tp;
 
@@ -279,14 +281,15 @@ void load_infrun_state (pid, prev_pc, prev_func_start, prev_func_name,
 
 /* Save infrun state for the thread PID.  */
 
-void save_infrun_state (pid, 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,
-                       handling_longjmp, another_trap,
-                       stepping_through_solib_after_catch,
-                       stepping_through_solib_catchpoints,
-                       stepping_through_sigtramp)
+void
+save_infrun_state (pid, 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,
+                  handling_longjmp, another_trap,
+                  stepping_through_solib_after_catch,
+                  stepping_through_solib_catchpoints,
+                  stepping_through_sigtramp)
      int pid;
      CORE_ADDR prev_pc;
      CORE_ADDR prev_func_start;
@@ -299,9 +302,9 @@ void save_infrun_state (pid, prev_pc, prev_func_start, prev_func_name,
      CORE_ADDR step_frame_address;
      int handling_longjmp;
      int another_trap;
-     int  stepping_through_solib_after_catch;
-     bpstat  stepping_through_solib_catchpoints;
-     int  stepping_through_sigtramp;
+     int stepping_through_solib_after_catch;
+     bpstat stepping_through_solib_catchpoints;
+     int stepping_through_sigtramp;
 {
   struct thread_info *tp;
 
@@ -334,9 +337,9 @@ thread_alive (tp)
 {
   if (tp->pid == -1)
     return 0;
-  if (! target_thread_alive (tp->pid))
+  if (!target_thread_alive (tp->pid))
     {
-      tp->pid = -1;    /* Mark it as dead */
+      tp->pid = -1;            /* Mark it as dead */
       return 0;
     }
   return 1;
@@ -356,7 +359,7 @@ prune_threads ()
          if (tpprev)
            tpprev->next = next;
          else
-           thread_list  = next;
+           thread_list = next;
          free (tp);
        }
       else
@@ -365,7 +368,7 @@ prune_threads ()
 }
 
 /* Print information about currently known threads 
- *
+
  * Note: this has the drawback that it _really_ switches
  *       threads, which frees the frame cache.  A no-side
  *       effects info-threads command would be nicer.
@@ -377,14 +380,15 @@ info_threads_command (arg, from_tty)
      int from_tty;
 {
   struct thread_info *tp;
-  int                current_pid;
-  struct frame_info  *cur_frame;
-  int                saved_frame_level = selected_frame_level;
-  int                counter;
+  int current_pid;
+  struct frame_info *cur_frame;
+  int saved_frame_level = selected_frame_level;
+  int counter;
 
   /* Avoid coredumps which would happen if we tried to access a NULL
      selected_frame.  */
-  if (!target_has_stack) error ("No stack.");
+  if (!target_has_stack)
+    error ("No stack.");
 
   prune_threads ();
   target_find_new_threads ();
@@ -416,8 +420,8 @@ info_threads_command (arg, from_tty)
    * back to the current thread.  That switch has put us at the top
    * of the stack (leaf frame).
    */
-  counter   = saved_frame_level;
-  cur_frame = find_relative_frame(selected_frame, &counter);
+  counter = saved_frame_level;
+  cur_frame = find_relative_frame (selected_frame, &counter);
   if (counter != 0)
     {
       /* Ooops, can't restore, tell user where we are. */
@@ -426,11 +430,11 @@ info_threads_command (arg, from_tty)
     }
   else
     {
-      select_frame(cur_frame, saved_frame_level);
+      select_frame (cur_frame, saved_frame_level);
     }
 
   /* re-show current frame. */
-  show_stack_frame(cur_frame);
+  show_stack_frame (cur_frame);
 }
 
 /* Switch from one thread to another. */
@@ -445,7 +449,7 @@ switch_to_thread (pid)
   inferior_pid = pid;
   flush_cached_frames ();
   registers_changed ();
-  stop_pc = read_pc();
+  stop_pc = read_pc ();
   select_frame (get_current_frame (), 0);
 }
 
@@ -453,10 +457,10 @@ static void
 restore_current_thread (pid)
      int pid;
 {
-  if (pid != inferior_pid) 
+  if (pid != inferior_pid)
     {
       switch_to_thread (pid);
-      print_stack_frame( get_current_frame(), 0, -1);
+      print_stack_frame (get_current_frame (), 0, -1);
     }
 }
 
@@ -464,10 +468,10 @@ restore_current_thread (pid)
    seperated list of numbers, or ranges, or the keyword `all'.  Ranges consist
    of two numbers seperated by a hyphen.  Examples:
 
-       thread apply 1 2 7 4 backtrace  Apply backtrace cmd to threads 1,2,7,4
-       thread apply 2-7 9 p foo(1)     Apply p foo(1) cmd to threads 2->7 & 9
-       thread apply all p x/i $pc      Apply x/i $pc cmd to all threads
-*/
+   thread apply 1 2 7 4 backtrace       Apply backtrace cmd to threads 1,2,7,4
+   thread apply 2-7 9 p foo(1)  Apply p foo(1) cmd to threads 2->7 & 9
+   thread apply all p x/i $pc   Apply x/i $pc cmd to all threads
+ */
 
 static void
 thread_apply_all_command (cmd, from_tty)
@@ -480,7 +484,7 @@ thread_apply_all_command (cmd, from_tty)
   if (cmd == NULL || *cmd == '\000')
     error ("Please specify a command following the thread ID list");
 
-  old_chain = make_cleanup ((make_cleanup_func) restore_current_thread, 
+  old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
                            (void *) inferior_pid);
 
   for (tp = thread_list; tp; tp = tp->next)
@@ -511,12 +515,12 @@ thread_apply_command (tidlist, from_tty)
   if (tidlist == NULL || *tidlist == '\000')
     error ("Please specify a thread ID list");
 
-  for (cmd = tidlist; *cmd != '\000' && !isalpha(*cmd); cmd++);
+  for (cmd = tidlist; *cmd != '\000' && !isalpha (*cmd); cmd++);
 
   if (*cmd == '\000')
     error ("Please specify a command following the thread ID list");
 
-  old_chain = make_cleanup ((make_cleanup_func) restore_current_thread, 
+  old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
                            (void *) inferior_pid);
 
   while (tidlist < cmd)
@@ -534,7 +538,7 @@ thread_apply_command (tidlist, from_tty)
 
       if (*tidlist == '-')     /* Got a range of IDs? */
        {
-         tidlist++;    /* Skip the - */
+         tidlist++;            /* Skip the - */
          end = strtol (tidlist, &p, 10);
          if (p == tidlist)
            error ("Error parsing %s", tidlist);
@@ -586,13 +590,13 @@ thread_command (tidstr, from_tty)
       /* Don't generate an error, just say which thread is current. */
       if (target_has_stack)
        printf_filtered ("[Current thread is %d (%s)]\n",
-                        pid_to_thread_id(inferior_pid),
+                        pid_to_thread_id (inferior_pid),
 #if defined(HPUXHPPA)
-                        target_tid_to_str(inferior_pid)
+                        target_tid_to_str (inferior_pid)
 #else
-                        target_pid_to_str(inferior_pid)
+                        target_pid_to_str (inferior_pid)
 #endif
-                        );
+         );
       else
        error ("No stack.");
       return;
@@ -620,7 +624,7 @@ see the IDs of currently known threads.", num);
 #else
                   target_pid_to_str (inferior_pid)
 #endif
-                  );
+    );
   print_stack_frame (selected_frame, selected_frame_level, 1);
 }
 
index 0abbb80dc1a683e7ac14c3027a7d6e8b2c6b7c16..2fddc6d52e0c481166ba8f53d884dbf1e3fb577e 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the TI TMS320C80 (MVP) for GDB, the GNU debugger.
    Copyright 1996, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "value.h"
@@ -33,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    Doesn't really work for dummy frames, but it does pass back
    an empty frame_saved_regs, so I guess that's better than total failure */
 
-void 
+void
 tic80_frame_find_saved_regs (fi, regaddr)
      struct frame_info *fi;
      struct frame_saved_regs *regaddr;
@@ -72,10 +73,10 @@ tic80_skip_prologue (pc)
 
 /* Function: tic80_scan_prologue
    This function decodes the target function prologue to determine:
-     1) the size of the stack frame
-     2) which registers are saved on it
-     3) the offsets of saved regs
-     4) the frame size
+   1) the size of the stack frame
+   2) which registers are saved on it
+   3) the offsets of saved regs
+   4) the frame size
    This information is stored in the "extra" fields of the frame_info.  */
 
 static void
@@ -97,18 +98,18 @@ tic80_scan_prologue (fi)
     {
       sal = find_pc_line (prologue_start, 0);
 
-      if (sal.line == 0)               /* no line info, use current PC */
+      if (sal.line == 0)       /* no line info, use current PC */
        if (prologue_start != entry_point_address ())
          prologue_end = fi->pc;
        else
-         return;                       /* _start has no frame or prologue */
+         return;               /* _start has no frame or prologue */
       else if (sal.end < prologue_end) /* next line begins after fn end */
-       prologue_end = sal.end;         /* (probably means no prologue)  */
+       prologue_end = sal.end; /* (probably means no prologue)  */
     }
   else
 /* FIXME */
-    prologue_end = prologue_start + 40; /* We're in the boondocks: allow for */
-                                       /* 16 pushes, an add, and "mv fp,sp" */
+    prologue_end = prologue_start + 40;                /* We're in the boondocks: allow for */
+  /* 16 pushes, an add, and "mv fp,sp" */
 
   prologue_end = min (prologue_end, fi->pc);
 
@@ -128,8 +129,8 @@ tic80_scan_prologue (fi)
        current_pc += 4;
       else
        {
-         offset = insn & 0x7fff;               /* extract 15-bit offset */
-         if (offset & 0x4000)                  /* if negative, sign-extend */
+         offset = insn & 0x7fff;       /* extract 15-bit offset */
+         if (offset & 0x4000)  /* if negative, sign-extend */
            offset = -(0x8000 - offset);
        }
 
@@ -137,26 +138,26 @@ tic80_scan_prologue (fi)
        {
          regno = ((insn >> 27) & 0x1f);
          fi->fsr.regs[regno] = offset;
-         if (insn & 0x8000)                    /* 64-bit store (st.d)? */
-           fi->fsr.regs[regno+1] = offset+4;
+         if (insn & 0x8000)    /* 64-bit store (st.d)? */
+           fi->fsr.regs[regno + 1] = offset + 4;
        }
-      else if ((insn & 0xffff8000) == 0x086c8000)   /* addu xx, r1, r1 */
+      else if ((insn & 0xffff8000) == 0x086c8000)      /* addu xx, r1, r1 */
        fi->framesize = -offset;
-      else if ((insn & 0xffff8000) == 0xf06c8000)  /* addu xx, r1, r30 */
+      else if ((insn & 0xffff8000) == 0xf06c8000)      /* addu xx, r1, r30 */
        {
-         fi->framereg = FP_REGNUM;             /* fp is now valid */
+         fi->framereg = FP_REGNUM;     /* fp is now valid */
          fi->frameoffset = offset;
-         break;                                /* end of stack adjustments */
+         break;                /* end of stack adjustments */
        }
-      else if (insn == 0xf03b2001)             /* addu r1, r0, r30 */
+      else if (insn == 0xf03b2001)     /* addu r1, r0, r30 */
        {
-         fi->framereg = FP_REGNUM;             /* fp is now valid */
+         fi->framereg = FP_REGNUM;     /* fp is now valid */
          fi->frameoffset = 0;
-         break;                                /* end of stack adjustments */
+         break;                /* end of stack adjustments */
        }
       else
 /* FIXME - handle long immediate instructions */
-       break;                          /* anything else isn't prologue */
+       break;                  /* anything else isn't prologue */
     }
 }
 
@@ -184,31 +185,31 @@ tic80_init_extra_frame_info (fi)
   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.  */
+         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;
     }
-  else 
+  else
     {
       tic80_scan_prologue (fi);
 
-      if (!fi->next)                   /* this is the innermost frame? */
+      if (!fi->next)           /* this is the innermost frame? */
        fi->frame = read_register (fi->framereg);
-      else                             /* not the innermost frame */
+      else
+       /* not the innermost frame */
        /* If this function uses FP as the frame register, and the function
-          it called saved the FP, get the saved FP.  */
-       if (fi->framereg == FP_REGNUM &&
-           fi->next->fsr.regs[FP_REGNUM] != (unsigned) -1)
-         fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
+          it called saved the FP, get the saved FP.  */ if (fi->framereg == FP_REGNUM &&
+                            fi->next->fsr.regs[FP_REGNUM] != (unsigned) -1)
+       fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
 
       /* Convert SP-relative offsets of saved registers to real addresses.  */
       for (reg = 0; reg < NUM_REGS; reg++)
        if (fi->fsr.regs[reg] == (unsigned) -1)
-           fi->fsr.regs[reg] = 0;      /* unused entry */
-         else
-           fi->fsr.regs[reg] += fi->frame - fi->frameoffset;
+         fi->fsr.regs[reg] = 0;        /* unused entry */
+       else
+         fi->fsr.regs[reg] += fi->frame - fi->frameoffset;
     }
 }
 
@@ -228,8 +229,8 @@ tic80_find_callers_reg (fi, regnum)
     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_integer (fi->fsr.regs[regnum], 
-                                 REGISTER_RAW_SIZE(regnum));
+      return read_memory_integer (fi->fsr.regs[regnum],
+                                 REGISTER_RAW_SIZE (regnum));
   return read_register (regnum);
 }
 
@@ -246,18 +247,18 @@ tic80_frame_chain (fi)
   CORE_ADDR fn_start, callers_pc, fp;
 
   /* is this a dummy frame? */
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
-    return fi->frame;  /* dummy frame same as caller's frame */
+  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: */
+  callers_pc = FRAME_SAVED_PC (fi);    /* find out who called us: */
   fp = tic80_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 (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 */
+      return 0;                        /* in _start fn, don't chain further */
 
   if (fi->framereg == FP_REGNUM)
     return tic80_find_callers_reg (fi, FP_REGNUM);
@@ -281,7 +282,7 @@ tic80_pop_frame (frame)
     {
       for (regnum = 0; regnum < NUM_REGS; regnum++)
        if (frame->fsr.regs[regnum] != 0)
-         write_register (regnum, 
+         write_register (regnum,
                          read_memory_integer (frame->fsr.regs[regnum], 4));
 
       write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
@@ -305,7 +306,7 @@ CORE_ADDR
 tic80_frame_saved_pc (fi)
      struct frame_info *fi;
 {
-  if (PC_IN_CALL_DUMMY(fi->pc, fi->frame, fi->frame))
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
     return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
   else
     return tic80_find_callers_reg (fi, LR_REGNUM);
@@ -338,7 +339,7 @@ tic80_push_return_address (pc, sp)
    register or a whole 32-bit word on the stack, and will be
    right-justified in the register or the stack word.  This includes
    chars, shorts, and small aggregate types.
+
    Arguments that are four bytes or less in size are placed in the
    even-numbered register of a register pair, and the odd-numbered
    register is not used.
@@ -385,73 +386,73 @@ tic80_push_arguments (nargs, args, sp, struct_return, struct_addr)
   /* first force sp to a 4-byte alignment */
   sp = sp & ~3;
 
-  argreg = ARG0_REGNUM;  
+  argreg = ARG0_REGNUM;
   /* The "struct return pointer" pseudo-argument goes in R0 */
   if (struct_return)
-      write_register (argreg++, struct_addr);
+    write_register (argreg++, struct_addr);
+
   /* Now make sure there's space on the stack */
   for (argnum = 0, stack_alloc = 0;
        argnum < nargs; argnum++)
-    stack_alloc += ((TYPE_LENGTH(VALUE_TYPE(args[argnum])) + 3) & ~3);
-  sp -= stack_alloc;    /* make room on stack for args */
+    stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
+  sp -= stack_alloc;           /* make room on stack for args */
+
+
   /* Now load as many as possible of the first arguments into
      registers, and push the rest onto the stack.  There are 16 bytes
      in four registers available.  Loop thru args from first to last.  */
+
   argreg = ARG0_REGNUM;
   for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
     {
       type = VALUE_TYPE (args[argnum]);
-      len  = TYPE_LENGTH (type);
+      len = TYPE_LENGTH (type);
       memset (valbuf, 0, sizeof (valbuf));
       val = (char *) VALUE_CONTENTS (args[argnum]);
+
 /* FIXME -- tic80 can take doubleword arguments in register pairs */
       is_struct = (type->code == TYPE_CODE_STRUCT);
       odd_sized_struct = 0;
 
-      if (! is_struct)
+      if (!is_struct)
        {
          if (len < 4)
-           { /* value gets right-justified in the register or stack word */
+           {                   /* value gets right-justified in the register or stack word */
              memcpy (valbuf + (4 - len), val, len);
              val = valbuf;
            }
          if (len > 4 && (len & 3) != 0)
-           odd_sized_struct = 1;     /* such structs go entirely on stack */
+           odd_sized_struct = 1;       /* such structs go entirely on stack */
        }
       else
        {
          /* Structs are always passed by reference. */
          write_register (argreg, sp + stack_offset);
-         argreg ++;
+         argreg++;
        }
 
       while (len > 0)
-        {
-          if (is_struct || argreg > ARGLAST_REGNUM || odd_sized_struct)
-            {                          /* must go on the stack */
-              write_memory (sp + stack_offset, val, 4);
-              stack_offset += 4;
-            }
-          /* NOTE WELL!!!!!  This is not an "else if" clause!!!
-             That's because some things get passed on the stack
-             AND in the registers!   */
-          if (!is_struct && argreg <= ARGLAST_REGNUM)
-            {                          /* there's room in a register */
-              regval = extract_address (val, REGISTER_RAW_SIZE(argreg));
-              write_register (argreg, regval);
+       {
+         if (is_struct || argreg > ARGLAST_REGNUM || odd_sized_struct)
+           {                   /* must go on the stack */
+             write_memory (sp + stack_offset, val, 4);
+             stack_offset += 4;
+           }
+         /* NOTE WELL!!!!!  This is not an "else if" clause!!!
+            That's because some things get passed on the stack
+            AND in the registers!   */
+         if (!is_struct && argreg <= ARGLAST_REGNUM)
+           {                   /* there's room in a register */
+             regval = extract_address (val, REGISTER_RAW_SIZE (argreg));
+             write_register (argreg, regval);
              argreg += 2;      /* FIXME -- what about doubleword args? */
-            }
-          /* Store the value 4 bytes at a time.  This means that things
-             larger than 4 bytes may go partly in registers and partly
-             on the stack.  */
-          len -= REGISTER_RAW_SIZE(argreg);
-          val += REGISTER_RAW_SIZE(argreg);
-        }
+           }
+         /* Store the value 4 bytes at a time.  This means that things
+            larger than 4 bytes may go partly in registers and partly
+            on the stack.  */
+         len -= REGISTER_RAW_SIZE (argreg);
+         val += REGISTER_RAW_SIZE (argreg);
+       }
     }
   return sp;
 }
@@ -467,7 +468,7 @@ tic80_write_sp (val)
 #if 0
   unsigned long psw = read_register (PSW_REGNUM);
 
-  if (psw & 0x80)      /* stack mode: user or interrupt */
+  if (psw & 0x80)              /* stack mode: user or interrupt */
     write_register (SPU_REGNUM, val);
   else
     write_register (SPI_REGNUM, val);
@@ -480,4 +481,3 @@ _initialize_tic80_tdep ()
 {
   tm_print_insn = print_insn_tic80;
 }
-
index 12b63754b8b3d90e1e0b23b7f60e77635fceb998..525e0a3fe3701987a8f1fbf5a9660d277a35afa9 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcmd.h"
@@ -30,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "expression.h"
 #include "value.h"
 #include "language.h"
-#include "terminal.h" /* For job_control.  */
+#include "terminal.h"          /* For job_control.  */
 #include "annotate.h"
 #include "top.h"
 
@@ -65,9 +66,9 @@ static void init_signals PARAMS ((void));
 static void stop_sig PARAMS ((int));
 #endif
 
-static char * line_completion_function PARAMS ((char *, int, char *, int));
+static char *line_completion_function PARAMS ((char *, int, char *, int));
 
-static char * readline_line_completion_function PARAMS ((char *, int));
+static char *readline_line_completion_function PARAMS ((char *, int));
 
 /* NOTE 1999-04-29: this function will be static again, after we make the
    event loop be the default command loop for gdb, and we merge
@@ -79,10 +80,10 @@ static void while_command PARAMS ((char *, int));
 static void if_command PARAMS ((char *, int));
 
 static struct command_line *
-build_command_line PARAMS ((enum command_control_type, char *));
+  build_command_line PARAMS ((enum command_control_type, char *));
 
 static struct command_line *
-get_command_line PARAMS ((enum command_control_type, char *));
+  get_command_line PARAMS ((enum command_control_type, char *));
 
 static void realloc_body_list PARAMS ((struct command_line *, int));
 
@@ -91,11 +92,11 @@ static enum misc_command_type read_next_line PARAMS ((struct command_line **));
 static enum command_control_type
 recurse_read_control_structure PARAMS ((struct command_line *));
 
-static struct cleanup * setup_user_args PARAMS ((char *));
+static struct cleanup *setup_user_args PARAMS ((char *));
 
-static char * locate_arg PARAMS ((char *));
+static char *locate_arg PARAMS ((char *));
 
-static char * insert_args PARAMS ((char *));
+static char *insert_args PARAMS ((char *));
 
 static void arg_cleanup PARAMS ((void));
 
@@ -187,7 +188,7 @@ extern char lang_frame_mismatch_warn[];             /* language.c */
 
 /* Flag for whether we want all the "from_tty" gubbish printed.  */
 
-int caution = 1;                       /* Default is yes, sigh. */
+int caution = 1;               /* Default is yes, sigh. */
 
 /* Define all cmd_list_elements.  */
 
@@ -290,8 +291,8 @@ int epoch_interface;
 int xgdb_verbose;
 
 /* gdb prints this when reading a command interactively */
-static char *gdb_prompt_string;                /* the global prompt string */
-extern char *get_prompt PARAMS((void));        /* access function for prompt string */
+static char *gdb_prompt_string;        /* the global prompt string */
+extern char *get_prompt PARAMS ((void));       /* access function for prompt string */
 
 /* Buffer used for reading command lines, and the size
    allocated for it so far.  */
@@ -334,15 +335,17 @@ static int control_level;
 /* Structure for arguments to user defined functions.  */
 #define MAXUSERARGS 10
 struct user_args
-{
-  struct user_args *next;
-  struct
-    {
-      char *arg;
-      int len;
-    } a[MAXUSERARGS];
-  int count;
-} *user_args;
+  {
+    struct user_args *next;
+    struct
+      {
+       char *arg;
+       int len;
+      }
+    a[MAXUSERARGS];
+    int count;
+  }
+ *user_args;
 
 /* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT.  */
 
@@ -387,11 +390,11 @@ void (*command_loop_hook) PARAMS ((void));
 
 /* Called instead of fputs for all output.  */
 
-void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer, GDB_FILE *stream));
+void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer, GDB_FILE * stream));
 
 /* Called from print_frame_info to list the line we stopped in.  */
 
-void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s, int line,
+void (*print_frame_info_listing_hook) PARAMS ((struct symtab * s, int line,
                                               int stopline, int noerror));
 /* Replaces most of query.  */
 
@@ -403,7 +406,7 @@ void (*warning_hook) PARAMS ((const char *, va_list));
 
 /* Called from gdb_flush to flush output.  */
 
-void (*flush_hook) PARAMS ((GDB_FILE *stream));
+void (*flush_hook) PARAMS ((GDB_FILE * stream));
 
 /* These three functions support getting lines of text from the user.  They
    are used in sequence.  First readline_begin_hook is called with a text
@@ -416,16 +419,16 @@ void (*flush_hook) PARAMS ((GDB_FILE *stream));
    to notify the GUI that we are done with the interaction window and it
    can close it. */
 
-void (*readline_begin_hook) PARAMS ((char *, ...));
-char * (*readline_hook) PARAMS ((char *));
+void (*readline_begin_hook) PARAMS ((char *,...));
+char *(*readline_hook) PARAMS ((char *));
 void (*readline_end_hook) PARAMS ((void));
 
 /* Called as appropriate to notify the interface of the specified breakpoint
    conditions.  */
 
-void (*create_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
-void (*delete_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
-void (*modify_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
+void (*create_breakpoint_hook) PARAMS ((struct breakpoint * bpt));
+void (*delete_breakpoint_hook) PARAMS ((struct breakpoint * bpt));
+void (*modify_breakpoint_hook) PARAMS ((struct breakpoint * bpt));
 
 /* Called during long calculations to allow GUI to repair window damage, and to
    check for stop buttons, etc... */
@@ -439,7 +442,7 @@ void (*registers_changed_hook) PARAMS ((void));
 
 /* Tell the GUI someone changed the register REGNO. -1 means
    that the caller does not know which register changed or
-   that several registers have changed (see value_assign).*/
+   that several registers have changed (see value_assign). */
 void (*register_changed_hook) PARAMS ((int regno));
 
 /* Tell the GUI someone changed LEN bytes of memory at ADDR */
@@ -448,12 +451,12 @@ void (*memory_changed_hook) PARAMS ((CORE_ADDR addr, int len));
 /* Called when going to wait for the target.  Usually allows the GUI to run
    while waiting for target events.  */
 
-int (*target_wait_hook) PARAMS ((int pid, struct target_waitstatus *status));
+int (*target_wait_hook) PARAMS ((int pid, struct target_waitstatus * status));
 
 /* Used by UI as a wrapper around command execution.  May do various things
    like enabling/disabling buttons, etc...  */
 
-void (*call_command_hook) PARAMS ((struct cmd_list_element *c, char *cmd,
+void (*call_command_hook) PARAMS ((struct cmd_list_element * c, char *cmd,
                                   int from_tty));
 
 /* Called when the current thread changes.  Argument is thread id.  */
@@ -463,19 +466,20 @@ void (*context_hook) PARAMS ((int id));
 /* Takes control from error ().  Typically used to prevent longjmps out of the
    middle of the GUI.  Usually used in conjunction with a catch routine.  */
 
-NORETURN void (*error_hook) PARAMS ((void)) ATTR_NORETURN;
-
+NORETURN void (*error_hook)
+PARAMS ((void)) ATTR_NORETURN;
 \f
+
 /* Where to go for return_to_top_level (RETURN_ERROR).  */
-SIGJMP_BUF error_return;
+     SIGJMP_BUF error_return;
 /* Where to go for return_to_top_level (RETURN_QUIT).  */
-SIGJMP_BUF quit_return;
+     SIGJMP_BUF quit_return;
 
 /* Return for reason REASON.  This generally gets back to the command
    loop, but can be caught via catch_errors.  */
 
-NORETURN void
-return_to_top_level (reason)
+     NORETURN void
+       return_to_top_level (reason)
      enum return_reason reason;
 {
   quit_flag = 0;
@@ -483,7 +487,7 @@ return_to_top_level (reason)
 
   /* Perhaps it would be cleaner to do this via the cleanup chain (not sure
      I can think of a reason why that is vital, though).  */
-  bpstat_clear_actions(stop_bpstat);   /* Clear queued breakpoint commands */
+  bpstat_clear_actions (stop_bpstat);  /* Clear queued breakpoint commands */
 
   disable_current_display ();
   do_cleanups (ALL_CLEANUPS);
@@ -545,7 +549,7 @@ catch_errors (func, args, errstring, mask)
 
   if (mask & RETURN_MASK_ERROR)
     {
-      memcpy ((char *)saved_error, (char *)error_return, sizeof (SIGJMP_BUF));
+      memcpy ((char *) saved_error, (char *) error_return, sizeof (SIGJMP_BUF));
       error_pre_print = errstring;
     }
   if (mask & RETURN_MASK_QUIT)
@@ -585,10 +589,10 @@ catch_errors (func, args, errstring, mask)
 #ifdef SIGHUP
 static void
 disconnect (signo)
-int signo;
+     int signo;
 {
   catch_errors (quit_cover, NULL,
-               "Could not kill the program being debugged", RETURN_MASK_ALL);
+             "Could not kill the program being debugged", RETURN_MASK_ALL);
   signal (SIGHUP, SIG_DFL);
   kill (getpid (), SIGHUP);
 }
@@ -602,9 +606,9 @@ int signo;
 quit_cover (s)
      PTR s;
 {
-  caution = 0;         /* Throw caution to the wind -- we're exiting.
-                          This prevents asking the user dumb questions.  */
-  quit_command((char *)0, 0);
+  caution = 0;                 /* Throw caution to the wind -- we're exiting.
+                                  This prevents asking the user dumb questions.  */
+  quit_command ((char *) 0, 0);
   return 0;
 }
 #endif /* defined SIGHUP */
@@ -656,7 +660,7 @@ read_command_file (stream)
 
   cleanups = make_cleanup ((make_cleanup_func) source_cleanup, instream);
   instream = stream;
-  command_loop (); 
+  command_loop ();
   do_cleanups (cleanups);
 }
 \f
@@ -676,11 +680,11 @@ gdb_init (argv0)
   getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
   current_directory = gdb_dirbuf;
 
-  init_cmd_lists ();   /* This needs to be done first */
-  initialize_targets (); /* Setup target_terminal macros for utils.c */
-  initialize_utils (); /* Make errors and warnings possible */
+  init_cmd_lists ();           /* This needs to be done first */
+  initialize_targets ();       /* Setup target_terminal macros for utils.c */
+  initialize_utils ();         /* Make errors and warnings possible */
   initialize_all_files ();
-  init_main ();                /* But that omits this file!  Do it now */
+  init_main ();                        /* But that omits this file!  Do it now */
 
   /* The signal handling mechanism is different depending whether or
      not the async version is run. NOTE: in the future we plan to make
@@ -689,13 +693,13 @@ gdb_init (argv0)
   if (async_p)
     async_init_signals ();
   else
-    init_signals (); 
+    init_signals ();
 
   /* We need a default language for parsing expressions, so simple things like
      "set width 0" won't fail if no language is explicitly set in a config file
      or implicitly set by reading an executable during startup. */
   set_language (language_c);
-  expected_language = current_language;        /* don't warn about the change.  */
+  expected_language = current_language;                /* don't warn about the change.  */
 
   /* All the interpreters should have had a look at things by now.
      Initialize the selected interpreter. */
@@ -716,14 +720,14 @@ build_command_line (type, args)
   if (args == NULL)
     error ("if/while commands require arguments.\n");
 
-  cmd = (struct command_line *)xmalloc (sizeof (struct command_line));
+  cmd = (struct command_line *) xmalloc (sizeof (struct command_line));
   cmd->next = NULL;
   cmd->control_type = type;
 
   cmd->body_count = 1;
   cmd->body_list
-    = (struct command_line **)xmalloc (sizeof (struct command_line *)
-                                      * cmd->body_count);
+    = (struct command_line **) xmalloc (sizeof (struct command_line *)
+                                       * cmd->body_count);
   memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count);
   cmd->line = savestring (args, strlen (args));
   return cmd;
@@ -821,15 +825,15 @@ print_command_line (cmd, depth, stream)
 
       /* Show the false arm if it exists.  */
       if (cmd->body_count == 2)
-         {
-           if (depth)
-             {
-               for (i = 0; i < depth; i++)
-                 fputs_filtered ("  ", stream);
-             }
-           fputs_filtered ("else\n", stream);
-           print_command_line (cmd->body_list[1], depth + 1, stream);
-         }
+       {
+         if (depth)
+           {
+             for (i = 0; i < depth; i++)
+               fputs_filtered ("  ", stream);
+           }
+         fputs_filtered ("else\n", stream);
+         print_command_line (cmd->body_list[1], depth + 1, stream);
+       }
       if (depth)
        {
          for (i = 0; i < depth; i++)
@@ -861,8 +865,8 @@ execute_control_command (cmd)
       new_line = insert_args (cmd->line);
       if (!new_line)
        return invalid_control;
-      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                &new_line);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                               &new_line);
       execute_command (new_line, 0);
       ret = cmd->control_type;
       break;
@@ -870,7 +874,7 @@ execute_control_command (cmd)
     case continue_control:
     case break_control:
       /* Return for "continue", and "break" so we can either
-        continue the loop at the top, or break out.  */
+         continue the loop at the top, or break out.  */
       ret = cmd->control_type;
       break;
 
@@ -880,11 +884,11 @@ execute_control_command (cmd)
        new_line = insert_args (cmd->line);
        if (!new_line)
          return invalid_control;
-       old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                  &new_line);
+       old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                                 &new_line);
        expr = parse_expression (new_line);
        make_cleanup ((make_cleanup_func) free_current_contents, &expr);
-       
+
        ret = simple_control;
        loop = 1;
 
@@ -923,9 +927,9 @@ execute_control_command (cmd)
                   at this point.  */
                if (ret == continue_control)
                  break;
-               
+
                /* Get the next statement.  */
-               current = current->next; 
+               current = current->next;
              }
          }
 
@@ -941,8 +945,8 @@ execute_control_command (cmd)
        new_line = insert_args (cmd->line);
        if (!new_line)
          return invalid_control;
-       old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                  &new_line);
+       old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                                 &new_line);
        /* Parse the conditional for the if statement.  */
        expr = parse_expression (new_line);
        make_cleanup ((make_cleanup_func) free_current_contents, &expr);
@@ -1052,7 +1056,7 @@ setup_user_args (p)
   struct cleanup *old_chain;
   unsigned int arg_count = 0;
 
-  args = (struct user_args *)xmalloc (sizeof (struct user_args));
+  args = (struct user_args *) xmalloc (sizeof (struct user_args));
   memset (args, 0, sizeof (struct user_args));
 
   args->next = user_args;
@@ -1157,7 +1161,7 @@ insert_args (line)
     {
       len += p - line;
       i = p[4] - '0';
-      
+
       if (i >= user_args->count)
        {
          error ("Missing argument %d in user function.\n", i);
@@ -1171,7 +1175,7 @@ insert_args (line)
   len += strlen (line);
 
   /* Allocate space for the new line and fill it in.  */
-  new_line = (char *)xmalloc (len + 1);
+  new_line = (char *) xmalloc (len + 1);
   if (new_line == NULL)
     return NULL;
 
@@ -1259,11 +1263,12 @@ execute_command (p, from_tty)
 
   /* This can happen when command_line_input hits end of file.  */
   if (p == NULL)
-      return;
+    return;
 
   serial_log_command (p);
 
-  while (*p == ' ' || *p == '\t') p++;
+  while (*p == ' ' || *p == '\t')
+    p++;
   if (*p)
     {
       char *arg;
@@ -1293,7 +1298,7 @@ execute_command (p, from_tty)
 
       /* If this command has been hooked, run the hook first. */
       if (c->hook)
-       execute_user_command (c->hook, (char *)0);
+       execute_user_command (c->hook, (char *) 0);
 
       if (c->class == class_user)
        execute_user_command (c, arg);
@@ -1305,16 +1310,17 @@ execute_command (p, from_tty)
        call_command_hook (c, arg, from_tty & caution);
       else
        (*c->function.cfunc) (arg, from_tty & caution);
-   }
+    }
 
   /* Tell the user if the language has changed (except first time).  */
   if (current_language != expected_language)
-  {
-    if (language_mode == language_mode_auto) {
-      language_info (1);       /* Print what changed.  */
+    {
+      if (language_mode == language_mode_auto)
+       {
+         language_info (1);    /* Print what changed.  */
+       }
+      warned = 0;
     }
-    warned = 0;
-  }
 
   /* Warn the user if the working language does not match the
      language of the current frame.  Only warn the user if we are
@@ -1384,7 +1390,7 @@ command_loop ()
       insert_mode = 0;
 #endif
       /* Get a command-line. This calls the readline package. */
-      command = command_line_input (instream == stdin ? 
+      command = command_line_input (instream == stdin ?
                                    get_prompt () : (char *) NULL,
                                    instream == stdin, "prompt");
 #if defined(TUI)
@@ -1470,12 +1476,12 @@ gdb_readline (prompt_arg)
   if (prompt_arg)
     {
       /* Don't use a _filtered function here.  It causes the assumed
-        character position to be off, since the newline we read from
-        the user is not accounted for.  */
+         character position to be off, since the newline we read from
+         the user is not accounted for.  */
       fputs_unfiltered (prompt_arg, gdb_stdout);
 #ifdef MPW
       /* Move to a new line so the entered line doesn't have a prompt
-        on the front of it. */
+         on the front of it. */
       fputs_unfiltered ("\n", gdb_stdout);
 #endif /* MPW */
       gdb_flush (gdb_stdout);
@@ -1486,7 +1492,7 @@ gdb_readline (prompt_arg)
   while (1)
     {
       /* Read from stdin if we are executing a user defined command.
-        This is the right thing for prompt_for_continue, at least.  */
+         This is the right thing for prompt_for_continue, at least.  */
       c = fgetc (instream ? instream : stdin);
 
       if (c == EOF)
@@ -1548,7 +1554,7 @@ static char *history_filename;
 
 /* Variables which are necessary for fancy command line editing.  */
 char *gdb_completer_word_break_characters =
-  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
+" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
 
 /* When completing on command names, we remove '-' from the list of
    word break characters, since we use it in command names.  If the
@@ -1556,13 +1562,13 @@ char *gdb_completer_word_break_characters =
    it thinks that the string needs to be quoted and automatically supplies
    a leading quote. */
 char *gdb_completer_command_word_break_characters =
-  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
+" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
 
 /* Characters that can be used to quote completion strings.  Note that we
    can't include '"' because the gdb C parser treats such quoted sequences
    as strings. */
 char *gdb_completer_quote_characters =
-  "'";
+"'";
 
 /* Functions that are used as part of the fancy command line editing.  */
 
@@ -1613,7 +1619,7 @@ filename_completer (text, word)
          break;
        }
       /* Like emacs, don't complete on old versions.  Especially useful
-        in the "source" command.  */
+         in the "source" command.  */
       if (p[strlen (p) - 1] == '~')
        continue;
 
@@ -1674,7 +1680,7 @@ filename_completer (text, word)
    "p b-" ambiguous (all symbols)
    "file Make" "file" (word break hard to screw up here)
    "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
  */
+ */
 
 /* Generate completions one by one for the completer.  Each time we are
    called return another potential completion to the caller.
@@ -1704,8 +1710,8 @@ line_completion_function (text, matches, line_buffer, point)
      char *line_buffer;
      int point;
 {
-  static char **list = (char **)NULL;          /* Cache of completions */
-  static int index;                            /* Next cached completion */
+  static char **list = (char **) NULL; /* Cache of completions */
+  static int index;            /* Next cached completion */
   char *output = NULL;
   char *tmp_command, *p;
   /* Pointer within tmp_command which corresponds to text.  */
@@ -1715,27 +1721,27 @@ line_completion_function (text, matches, line_buffer, point)
   if (matches == 0)
     {
       /* The caller is beginning to accumulate a new set of completions, so
-        we need to find all of them now, and cache them for returning one at
-        a time on future calls. */
+         we need to find all of them now, and cache them for returning one at
+         a time on future calls. */
 
       if (list)
        {
          /* Free the storage used by LIST, but not by the strings inside.
             This is because rl_complete_internal () frees the strings. */
-         free ((PTR)list);
+         free ((PTR) list);
        }
       list = 0;
       index = 0;
 
       /* Choose the default set of word break characters to break completions.
-        If we later find out that we are doing completions on command strings
-        (as opposed to strings supplied by the individual command completer
-        functions, which can be any string) then we will switch to the
-        special word break set for command strings, which leaves out the
-        '-' character used in some commands.  */
+         If we later find out that we are doing completions on command strings
+         (as opposed to strings supplied by the individual command completer
+         functions, which can be any string) then we will switch to the
+         special word break set for command strings, which leaves out the
+         '-' character used in some commands.  */
 
       rl_completer_word_break_characters =
-         gdb_completer_word_break_characters;
+       gdb_completer_word_break_characters;
 
       /* Decide whether to complete on a list of gdb commands or on symbols. */
       tmp_command = (char *) alloca (point + 1);
@@ -1744,8 +1750,8 @@ line_completion_function (text, matches, line_buffer, point)
       strncpy (tmp_command, line_buffer, point);
       tmp_command[point] = '\0';
       /* Since text always contains some number of characters leading up
-        to point, we can find the equivalent position in tmp_command
-        by subtracting that many characters from the end of tmp_command.  */
+         to point, we can find the equivalent position in tmp_command
+         by subtracting that many characters from the end of tmp_command.  */
       word = tmp_command + point - strlen (text);
 
       if (point == 0)
@@ -1784,16 +1790,16 @@ line_completion_function (text, matches, line_buffer, point)
          if (q != tmp_command + point)
            {
              /* There is something beyond the ambiguous
-                command, so there are no possible completions.  For
-                example, "info t " or "info t foo" does not complete
-                to anything, because "info t" can be "info target" or
-                "info terminal".  */
+                command, so there are no possible completions.  For
+                example, "info t " or "info t foo" does not complete
+                to anything, because "info t" can be "info target" or
+                "info terminal".  */
              list = NULL;
            }
          else
            {
              /* We're trying to complete on the command which was ambiguous.
-                This we can deal with.  */
+                This we can deal with.  */
              if (result_list)
                {
                  list = complete_on_cmdlist (*result_list->prefixlist, p,
@@ -1804,7 +1810,7 @@ line_completion_function (text, matches, line_buffer, point)
                  list = complete_on_cmdlist (cmdlist, p, word);
                }
              /* Insure that readline does the right thing with respect to
-                inserting quotes.  */
+                inserting quotes.  */
              rl_completer_word_break_characters =
                gdb_completer_command_word_break_characters;
            }
@@ -1824,11 +1830,11 @@ line_completion_function (text, matches, line_buffer, point)
                  if (c->prefixlist)
                    {
                      /* It is a prefix command; what comes after it is
-                        a subcommand (e.g. "info ").  */
+                        a subcommand (e.g. "info ").  */
                      list = complete_on_cmdlist (*c->prefixlist, p, word);
 
                      /* Insure that readline does the right thing
-                        with respect to inserting quotes.  */
+                        with respect to inserting quotes.  */
                      rl_completer_word_break_characters =
                        gdb_completer_command_word_break_characters;
                    }
@@ -1841,7 +1847,7 @@ line_completion_function (text, matches, line_buffer, point)
                  else
                    {
                      /* It is a normal command; what comes after it is
-                        completed by the command's completer function.  */
+                        completed by the command's completer function.  */
                      list = (*c->completer) (p, word);
                    }
                }
@@ -1967,12 +1973,12 @@ skip_quoted (str)
     }
   return (scan);
 }
-
 \f
+
 #ifdef STOP_SIGNAL
 static void
 stop_sig (signo)
-int signo;
+     int signo;
 {
 #if STOP_SIGNAL == SIGTSTP
   signal (SIGTSTP, SIG_DFL);
@@ -1993,7 +1999,7 @@ int signo;
 /* Initialize signal handlers. */
 static void
 do_nothing (signo)
-int signo;
+     int signo;
 {
   /* Under System V the default disposition of a signal is reinstated after
      the signal is caught and delivered to an application process.  On such
@@ -2106,7 +2112,7 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
   while (1)
     {
       /* Make sure that all output has been output.  Some machines may let
-        you get away with leaving out some of the gdb_flush, but not all.  */
+         you get away with leaving out some of the gdb_flush, but not all.  */
       wrap_here ("");
       gdb_flush (gdb_stdout);
       gdb_flush (gdb_stderr);
@@ -2155,9 +2161,9 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
          got_eof = 1;
          break;
        }
-      if (strlen(rl) + 1 + (p - linebuffer) > linelength)
+      if (strlen (rl) + 1 + (p - linebuffer) > linelength)
        {
-         linelength = strlen(rl) + 1 + (p - linebuffer);
+         linelength = strlen (rl) + 1 + (p - linebuffer);
          nline = (char *) xrealloc (linebuffer, linelength);
          p += nline - linebuffer;
          linebuffer = nline;
@@ -2168,14 +2174,14 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
       while (*p1)
        *p++ = *p1++;
 
-      free (rl);                       /* Allocated in readline.  */
+      free (rl);               /* Allocated in readline.  */
 
       if (p == linebuffer || *(p - 1) != '\\')
        break;
 
       p--;                     /* Put on top of '\'.  */
       local_prompt = (char *) 0;
-  }
+    }
 
 #ifdef STOP_SIGNAL
   if (job_control)
@@ -2189,12 +2195,12 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
 #define SERVER_COMMAND_LENGTH 7
   server_command =
     (p - linebuffer > SERVER_COMMAND_LENGTH)
-      && STREQN (linebuffer, "server ", SERVER_COMMAND_LENGTH);
+    && STREQN (linebuffer, "server ", SERVER_COMMAND_LENGTH);
   if (server_command)
     {
       /* Note that we don't set `line'.  Between this and the check in
-        dont_repeat, this insures that repeating will still do the
-        right thing.  */
+         dont_repeat, this insures that repeating will still do the
+         right thing.  */
       *p = '\0';
       return linebuffer + SERVER_COMMAND_LENGTH;
     }
@@ -2225,7 +2231,7 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
              linebuffer = (char *) xrealloc (linebuffer, linelength);
            }
          strcpy (linebuffer, history_value);
-         p = linebuffer + strlen(linebuffer);
+         p = linebuffer + strlen (linebuffer);
          free (history_value);
        }
     }
@@ -2235,7 +2241,7 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
      global buffer.  */
   if (repeat && p == linebuffer)
     return line;
-  for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++) ;
+  for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++);
   if (repeat && !*p1)
     return line;
 
@@ -2253,7 +2259,7 @@ command_line_input (prompt_arg, repeat, annotation_suffix)
      and remove the '#'.  The kill ring is probably better, but some
      people are in the habit of commenting things out.  */
   if (*p1 == '#')
-    *p1 = '\0';  /* Found a comment. */
+    *p1 = '\0';                        /* Found a comment. */
 
   /* Save into global buffer if appropriate.  */
   if (repeat)
@@ -2318,8 +2324,8 @@ read_next_line (command)
       for (i = 0; i < control_level; i++)
        control_prompt[i] = ' ';
       control_prompt[i] = '>';
-      control_prompt[i+1] = '\0';
-      prompt_ptr = (char *)&control_prompt[0];
+      control_prompt[i + 1] = '\0';
+      prompt_ptr = (char *) &control_prompt[0];
     }
   else
     prompt_ptr = NULL;
@@ -2343,7 +2349,7 @@ read_next_line (command)
      executed.  */
   if (p1 == p || p[0] == '#')
     return nop_command;
-      
+
   /* Is this the end of a simple, while, or if control structure?  */
   if (p1 - p == 3 && !strncmp (p, "end", 3))
     return end_command;
@@ -2388,7 +2394,7 @@ read_next_line (command)
       (*command)->control_type = simple_control;
       (*command)->body_count = 0;
       (*command)->body_list = NULL;
-  }
+    }
 
   /* Nothing special.  */
   return ok_command;
@@ -2452,7 +2458,7 @@ recurse_read_control_structure (current_cmd)
              break;
            }
        }
-      
+
       /* Not the end of a control structure.  */
       if (val == else_command)
        {
@@ -2488,7 +2494,7 @@ recurse_read_control_structure (current_cmd)
       child_tail = next;
 
       /* If the latest line is another control structure, then recurse
-        on it.  */
+         on it.  */
       if (next->control_type == while_control
          || next->control_type == if_control)
        {
@@ -2523,7 +2529,7 @@ read_command_lines (prompt_arg, from_tty)
   enum command_control_type ret;
   enum misc_command_type val;
 
-  control_level = 0; 
+  control_level = 0;
   if (readline_begin_hook)
     {
       /* Note - intentional to merge messages with no newline */
@@ -2568,7 +2574,7 @@ read_command_lines (prompt_arg, from_tty)
          if (ret == invalid_control)
            break;
        }
-      
+
       if (tail)
        {
          tail->next = next;
@@ -2576,8 +2582,8 @@ read_command_lines (prompt_arg, from_tty)
       else
        {
          head = next;
-         old_chain = make_cleanup ((make_cleanup_func) free_command_lines, 
-                                    &head);
+         old_chain = make_cleanup ((make_cleanup_func) free_command_lines,
+                                   &head);
        }
       tail = next;
     }
@@ -2605,7 +2611,7 @@ read_command_lines (prompt_arg, from_tty)
 
 void
 free_command_lines (lptr)
-      struct command_line **lptr;
+     struct command_line **lptr;
 {
   register struct command_line *l = *lptr;
   register struct command_line *next;
@@ -2622,7 +2628,7 @@ free_command_lines (lptr)
        }
       next = l->next;
       free (l->line);
-      free ((PTR)l);
+      free ((PTR) l);
       l = next;
     }
 }
@@ -2735,7 +2741,7 @@ error_no_arg (why)
 static void
 help_command (command, from_tty)
      char *command;
-     int from_tty; /* Ignored */
+     int from_tty;             /* Ignored */
 {
   help_cmd (command, gdb_stdout);
 }
@@ -2752,7 +2758,7 @@ validate_comname (comname)
   p = comname;
   while (*p)
     {
-      if (!isalnum(*p) && *p != '-' && *p != '_')
+      if (!isalnum (*p) && *p != '-' && *p != '_')
        error ("Junk in argument list: \"%s\"", p);
       p++;
     }
@@ -2802,9 +2808,9 @@ define_command (comname, from_tty)
   if (!strncmp (comname, HOOK_STRING, HOOK_LEN))
     {
       /* Look up cmd it hooks, and verify that we got an exact match.  */
-      tem = comname+HOOK_LEN;
+      tem = comname + HOOK_LEN;
       hookc = lookup_cmd (&tem, cmdlist, "", -1, 0);
-      if (hookc && !STREQ (comname+HOOK_LEN, hookc->name))
+      if (hookc && !STREQ (comname + HOOK_LEN, hookc->name))
        hookc = 0;
       if (!hookc)
        {
@@ -2820,7 +2826,8 @@ define_command (comname, from_tty)
   /* If the rest of the commands will be case insensitive, this one
      should behave in the same manner. */
   for (tem = comname; *tem; tem++)
-    if (isupper(*tem)) *tem = tolower(*tem);
+    if (isupper (*tem))
+      *tem = tolower (*tem);
 
   sprintf (tmpbuf, "Type commands for definition of \"%s\".", comname);
   cmds = read_command_lines (tmpbuf, from_tty);
@@ -2829,8 +2836,8 @@ define_command (comname, from_tty)
     free_command_lines (&c->user_commands);
 
   newc = add_cmd (comname, class_user, user_defined_command,
-          (c && c->class == class_user)
-          ? c->doc : savestring ("User-defined.", 13), &cmdlist);
+                 (c && c->class == class_user)
+                 ? c->doc : savestring ("User-defined.", 13), &cmdlist);
   newc->user_commands = cmds;
 
   /* If this new command is a hook, then mark both commands as being
@@ -2862,7 +2869,8 @@ document_command (comname, from_tty)
   sprintf (tmpbuf, "Type documentation for \"%s\".", comname);
   doclines = read_command_lines (tmpbuf, from_tty);
 
-  if (c->doc) free (c->doc);
+  if (c->doc)
+    free (c->doc);
 
   {
     register struct command_line *cl1;
@@ -2888,7 +2896,7 @@ document_command (comname, from_tty)
 /* Print the GDB banner. */
 void
 print_gdb_version (stream)
-  GDB_FILE *stream;
+     GDB_FILE *stream;
 {
   /* From GNU coding standards, first line is meant to be easy for a
      program to parse, and is just canonical program name and version
@@ -2949,7 +2957,7 @@ show_version (args, from_tty)
  *
  * Returns: 1 for success (use formatted prompt)
  *          0 for failure (use gdb_prompt_string).
- */ 
+ */
 
 static int gdb_prompt_escape;
 
@@ -2967,21 +2975,22 @@ get_prompt_1 (formatted_prompt)
 
   if (gdb_prompt_escape == 0)
     {
-      return 0;                /* do no formatting */
+      return 0;                        /* do no formatting */
     }
-  else /* formatted prompt */
+  else
+    /* formatted prompt */
     {
-      char   fmt[40], *promptp, *outp, *tmp;
+      char fmt[40], *promptp, *outp, *tmp;
       value_ptr arg_val;
-      DOUBLEST  doubleval;
-      LONGEST   longval;
+      DOUBLEST doubleval;
+      LONGEST longval;
       CORE_ADDR addrval;
 
       int i, len;
       struct type *arg_type, *elt_type;
 
       promptp = local_prompt;
-      outp    = formatted_prompt;
+      outp = formatted_prompt;
 
       while (*promptp != '\0')
        {
@@ -2989,21 +2998,21 @@ get_prompt_1 (formatted_prompt)
 
          if (*promptp != gdb_prompt_escape)
            {
-             if (available >= 1)                       /* overflow protect */
+             if (available >= 1)       /* overflow protect */
                *outp++ = *promptp++;
            }
          else
            {
              /* GDB prompt string contains escape char.  Parse for arg.
-                Two consecutive escape chars followed by arg followed by
-                a comma means to insert the arg using a default format.
-                Otherwise a printf format string may be included between
-                the two escape chars.  eg:
-                  %%foo,       insert foo using default format
-                  %2.2f%foo,   insert foo using "%2.2f" format
-                A mismatch between the format string and the data type
-                of "foo" is an error (which we don't know how to protect
-                against).  */
+                Two consecutive escape chars followed by arg followed by
+                a comma means to insert the arg using a default format.
+                Otherwise a printf format string may be included between
+                the two escape chars.  eg:
+                %%foo, insert foo using default format
+                %2.2f%foo,     insert foo using "%2.2f" format
+                A mismatch between the format string and the data type
+                of "foo" is an error (which we don't know how to protect
+                against).  */
 
              fmt[0] = '\0';    /* assume null format string */
              if (promptp[1] == gdb_prompt_escape)      /* double esc char */
@@ -3014,11 +3023,13 @@ get_prompt_1 (formatted_prompt)
                {
                  /* extract format string from between two esc chars */
                  i = 0;
-                 do {
-                   fmt[i++] = *promptp++;      /* copy format string */
-                 } while (i < sizeof (fmt) - 1 && 
-                          *promptp != gdb_prompt_escape &&
-                          *promptp != '\0');
+                 do
+                   {
+                     fmt[i++] = *promptp++;    /* copy format string */
+                   }
+                 while (i < sizeof (fmt) - 1 &&
+                        *promptp != gdb_prompt_escape &&
+                        *promptp != '\0');
 
                  if (*promptp != gdb_prompt_escape)
                    error ("Syntax error at prompt position %d",
@@ -3032,13 +3043,13 @@ get_prompt_1 (formatted_prompt)
 
              arg_val = parse_to_comma_and_eval (&promptp);
              if (*promptp == ',')
-               promptp++;              /* skip past the comma */
+               promptp++;      /* skip past the comma */
              arg_type = check_typedef (VALUE_TYPE (arg_val));
-             switch (TYPE_CODE (arg_type)) 
+             switch (TYPE_CODE (arg_type))
                {
                case TYPE_CODE_ARRAY:
                  elt_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
-                 if (TYPE_LENGTH (arg_type) > 0  &&
+                 if (TYPE_LENGTH (arg_type) > 0 &&
                      TYPE_LENGTH (elt_type) == 1 &&
                      TYPE_CODE (elt_type) == TYPE_CODE_INT)
                    {
@@ -3049,10 +3060,10 @@ get_prompt_1 (formatted_prompt)
                      tmp = VALUE_CONTENTS (arg_val);
 
                      if (len > available)
-                       len = available;                /* overflow protect */
+                       len = available;        /* overflow protect */
 
                      /* FIXME: how to protect GDB from crashing
-                        from bad user-supplied format string? */
+                        from bad user-supplied format string? */
                      if (fmt[0] != 0)
                        sprintf (outp, fmt, tmp);
                      else
@@ -3065,7 +3076,7 @@ get_prompt_1 (formatted_prompt)
                  addrval = value_as_pointer (arg_val);
 
                  if (TYPE_LENGTH (elt_type) == 1 &&
-                     TYPE_CODE   (elt_type) == TYPE_CODE_INT &&
+                     TYPE_CODE (elt_type) == TYPE_CODE_INT &&
                      addrval != 0)
                    {
                      /* display it as a string */
@@ -3074,18 +3085,18 @@ get_prompt_1 (formatted_prompt)
                      int err = 0;
 
                      /* Limiting the number of bytes that the following call
-                        will read protects us from sprintf overflow later. */
-                     i = target_read_string (addrval,               /* src */
-                                             &tmp,                  /* dest */
-                                             available,             /* len */
+                        will read protects us from sprintf overflow later. */
+                     i = target_read_string (addrval,  /* src */
+                                             &tmp,     /* dest */
+                                             available,        /* len */
                                              &err);
                      if (err)  /* read failed */
                        error ("%s on target_read", safe_strerror (err));
 
                      tmp[i] = '\0';    /* force-terminate string */
                      /* FIXME: how to protect GDB from crashing
-                        from bad user-supplied format string? */
-                     sprintf (outp, fmt[0] == 0 ? default_fmt : fmt, 
+                        from bad user-supplied format string? */
+                     sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
                               tmp);
                      free (tmp);
                    }
@@ -3095,8 +3106,8 @@ get_prompt_1 (formatted_prompt)
                      char *default_fmt = "0x%x";
 
                      /* FIXME: how to protect GDB from crashing
-                        from bad user-supplied format string? */
-                     if (available >= 16 /*?*/)        /* overflow protect */
+                        from bad user-supplied format string? */
+                     if (available >= 16 /*? */ )      /* overflow protect */
                        sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
                                 (long) addrval);
                    }
@@ -3108,7 +3119,7 @@ get_prompt_1 (formatted_prompt)
                    doubleval = value_as_double (arg_val);
                    /* FIXME: how to protect GDB from crashing
                       from bad user-supplied format string? */
-                   if (available >= 16 /*?*/)          /* overflow protect */
+                   if (available >= 16 /*? */ )        /* overflow protect */
                      sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
                               (double) doubleval);
                    break;
@@ -3120,7 +3131,7 @@ get_prompt_1 (formatted_prompt)
                    longval = value_as_long (arg_val);
                    /* FIXME: how to protect GDB from crashing
                       from bad user-supplied format string? */
-                   if (available >= 16 /*?*/)          /* overflow protect */
+                   if (available >= 16 /*? */ )        /* overflow protect */
                      sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
                               (long) longval);
                    break;
@@ -3129,7 +3140,7 @@ get_prompt_1 (formatted_prompt)
                  {
                    /* no default format for bool */
                    longval = value_as_long (arg_val);
-                   if (available >= 8 /*?*/)           /* overflow protect */
+                   if (available >= 8 /*? */ )         /* overflow protect */
                      {
                        if (longval)
                          strcpy (outp, "<true>");
@@ -3146,7 +3157,7 @@ get_prompt_1 (formatted_prompt)
                    /* find enum name if possible */
                    for (i = 0; i < len; i++)
                      if (TYPE_FIELD_BITPOS (arg_type, i) == longval)
-                       break;          /* match -- end loop */
+                       break;  /* match -- end loop */
 
                    if (i < len)        /* enum name found */
                      {
@@ -3158,7 +3169,7 @@ get_prompt_1 (formatted_prompt)
                      }
                    else
                      {
-                       if (available >= 16 /*?*/)      /* overflow protect */
+                       if (available >= 16 /*? */ )    /* overflow protect */
                          sprintf (outp, "%d", (long) longval);
                      }
                    break;
@@ -3184,10 +3195,10 @@ get_prompt ()
 {
   static char buf[MAX_PROMPT_SIZE];
 
-  if (catch_errors (get_prompt_1, buf, "bad formatted prompt: ", 
+  if (catch_errors (get_prompt_1, buf, "bad formatted prompt: ",
                    RETURN_MASK_ALL))
     {
-      return &buf[0];  /* successful formatted prompt */
+      return &buf[0];          /* successful formatted prompt */
     }
   else
     {
@@ -3205,16 +3216,16 @@ set_prompt (s)
 {
 /* ??rehrauer: I don't know why this fails, since it looks as though
    assignments to prompt are wrapped in calls to savestring...
-  if (prompt != NULL)
-    free (prompt);
-*/
+   if (prompt != NULL)
+   free (prompt);
+ */
   if (async_p)
     PROMPT (0) = savestring (s, strlen (s));
   else
     gdb_prompt_string = savestring (s, strlen (s));
 }
-
 \f
+
 /* If necessary, make the user confirm that we should quit.  Return
    non-zero if we should quit, zero if we shouldn't.  */
 
@@ -3226,8 +3237,8 @@ quit_confirm ()
       char *s;
 
       /* This is something of a hack.  But there's no reliable way to
-        see if a GUI is running.  The `use_windows' variable doesn't
-        cut it.  */
+         see if a GUI is running.  The `use_windows' variable doesn't
+         cut it.  */
       if (init_ui_hook)
        s = "A debugging session is active.\nDo you still want to close the debugger?";
       else if (attach_flag)
@@ -3235,7 +3246,7 @@ quit_confirm ()
       else
        s = "The program is running.  Exit anyway? ";
 
-      if (! query (s))
+      if (!query (s))
        return 0;
     }
 
@@ -3275,7 +3286,7 @@ quit_force (args, from_tty)
   if (write_history_p && history_filename)
     write_history (history_filename);
 
-  do_final_cleanups(ALL_CLEANUPS);     /* Do any final cleanups before exiting */
+  do_final_cleanups (ALL_CLEANUPS);    /* Do any final cleanups before exiting */
 
 #if defined(TUI)
   /* tuiDo((TuiOpaqueFuncPtr)tuiCleanUp); */
@@ -3284,7 +3295,7 @@ quit_force (args, from_tty)
    * it is tearing it down.
    */
   if (tui_version)
-    tuiCleanUp();
+    tuiCleanUp ();
 #endif
 
   exit (exit_code);
@@ -3297,7 +3308,7 @@ quit_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  if (! quit_confirm ())
+  if (!quit_confirm ())
     error ("Not confirmed.");
   quit_force (args, from_tty);
 }
@@ -3317,12 +3328,13 @@ pwd_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  if (args) error ("The \"pwd\" command does not take an argument: %s", args);
+  if (args)
+    error ("The \"pwd\" command does not take an argument: %s", args);
   getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
 
   if (!STREQ (gdb_dirbuf, current_directory))
     printf_unfiltered ("Working directory %s\n (canonically %s).\n",
-           current_directory, gdb_dirbuf);
+                      current_directory, gdb_dirbuf);
   else
     printf_unfiltered ("Working directory %s.\n", current_directory);
 }
@@ -3351,8 +3363,8 @@ cd_command (dir, from_tty)
     perror_with_name (dir);
 
   len = strlen (dir);
-  dir = savestring (dir, len - (len > 1 && SLASH_P(dir[len-1])));
-  if (ROOTED_P(dir))
+  dir = savestring (dir, len - (len > 1 && SLASH_P (dir[len - 1])));
+  if (ROOTED_P (dir))
     current_directory = dir;
   else
     {
@@ -3376,9 +3388,9 @@ cd_command (dir, from_tty)
          if (found_real_path)
            {
              /* Search backwards for the directory just before the "/.."
-                and obliterate it and the "/..".  */
+                and obliterate it and the "/..".  */
              char *q = p;
-             while (q != current_directory && ! SLASH_P (q[-1]))
+             while (q != current_directory && !SLASH_P (q[-1]))
                --q;
 
              if (q == current_directory)
@@ -3409,7 +3421,8 @@ cd_command (dir, from_tty)
     pwd_command ((char *) 0, 1);
 }
 \f
-struct source_cleanup_lines_args {
+struct source_cleanup_lines_args
+{
   int old_line;
   char *old_file;
   char *old_pre_error;
@@ -3421,7 +3434,7 @@ source_cleanup_lines (args)
      PTR args;
 {
   struct source_cleanup_lines_args *p =
-    (struct source_cleanup_lines_args *)args;
+  (struct source_cleanup_lines_args *) args;
   source_line_number = p->old_line;
   source_file_name = p->old_file;
   source_pre_error = p->old_pre_error;
@@ -3528,8 +3541,8 @@ dont_repeat_command (ignored, from_tty)
      char *ignored;
      int from_tty;
 {
-  *line = 0;           /* Can't call dont_repeat here because we're not
-                          necessarily reading from stdin.  */
+  *line = 0;                   /* Can't call dont_repeat here because we're not
+                                  necessarily reading from stdin.  */
 }
 \f
 /* Functions to manipulate command line editing control variables.  */
@@ -3596,7 +3609,7 @@ show_commands (args, from_tty)
   for (offset = num; offset < num + Hist_print && offset < hist_len; offset++)
     {
       printf_filtered ("%5d  %s\n", history_base + offset,
-             (history_get (history_base + offset))->line);
+                      (history_get (history_base + offset))->line);
     }
 
   /* The next command we want to display is the next one that we haven't
@@ -3680,15 +3693,15 @@ set_verbose (args, from_tty, c)
 
 static void
 float_handler (signo)
-int signo;
+     int signo;
 {
   /* This message is based on ANSI C, section 4.7.  Note that integer
      divide by zero causes this, so "float" is a misnomer.  */
   signal (SIGFPE, float_handler);
   error ("Erroneous arithmetic operation.");
 }
-
 \f
+
 static void
 init_cmd_lists ()
 {
@@ -3722,7 +3735,7 @@ init_cmd_lists ()
  */
 
 void
-init_history()
+init_history ()
 {
   char *tmpenv;
 
@@ -3736,13 +3749,14 @@ init_history()
 
   tmpenv = getenv ("GDBHISTFILE");
   if (tmpenv)
-    history_filename = savestring (tmpenv, strlen(tmpenv));
-  else if (!history_filename) {
-    /* We include the current directory so that if the user changes
-       directories the file written will be the same as the one
-       that was read.  */
-    history_filename = concat (current_directory, "/.gdb_history", NULL);
-  }
+    history_filename = savestring (tmpenv, strlen (tmpenv));
+  else if (!history_filename)
+    {
+      /* We include the current directory so that if the user changes
+         directories the file written will be the same as the one
+         that was read.  */
+      history_filename = concat (current_directory, "/.gdb_history", NULL);
+    }
   read_history (history_filename);
 }
 
@@ -3756,7 +3770,7 @@ init_main ()
   if (!async_p)
     {
 #ifdef DEFAULT_PROMPT
-      gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen(DEFAULT_PROMPT));
+      gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
 #else
       gdb_prompt_string = savestring ("(gdb) ", 6);
 #endif
@@ -3764,17 +3778,17 @@ init_main ()
   else
     {
       /* initialize the prompt stack to a simple "(gdb) " prompt or to
-        whatever the DEFULAT_PROMPT is. */
+         whatever the DEFULAT_PROMPT is. */
       the_prompts.top = 0;
-      PREFIX(0) = "";
+      PREFIX (0) = "";
 #ifdef DEFAULT_PROMPT
-      PROMPT(0) = savestring (DEFAULT_PROMPT, strlen(DEFAULT_PROMPT));
+      PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
 #else
-      PROMPT(0) = savestring ("(gdb) ", 6);
+      PROMPT (0) = savestring ("(gdb) ", 6);
 #endif
-      SUFFIX(0) = "";
+      SUFFIX (0) = "";
       /* Set things up for annotation_level > 1, if the user ever decides
-        to use it. */
+         to use it. */
       async_annotation_suffix = "prompt";
       /* Set the variable associated with the setshow prompt command. */
       new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0)));
@@ -3823,9 +3837,9 @@ The commands below can be used to select other frames by number or address.",
   add_cmd ("running", class_run, NO_FUNCTION, "Running the program.", &cmdlist);
 
   add_com ("pwd", class_files, pwd_command,
-          "Print working directory.  This is used for your program as well.");
+       "Print working directory.  This is used for your program as well.");
   c = add_cmd ("cd", class_files, cd_command,
-          "Set working directory to DIR for debugger and program being debugged.\n\
+              "Set working directory to DIR for debugger and program being debugged.\n\
 The change does not take effect for the program being debugged\n\
 until the next time it is started.", &cmdlist);
   c->completer = filename_completer;
@@ -3837,22 +3851,22 @@ until the next time it is started.", &cmdlist);
   if (!async_p)
     {
       add_show_from_set
-       (add_set_cmd ("prompt", class_support, var_string, 
+       (add_set_cmd ("prompt", class_support, var_string,
                      (char *) &gdb_prompt_string, "Set gdb's prompt",
                      &setlist),
         &showlist);
     }
   else
     {
-      c = add_set_cmd ("prompt", class_support, var_string, 
-                     (char *)&new_async_prompt, "Set gdb's prompt",
+      c = add_set_cmd ("prompt", class_support, var_string,
+                      (char *) &new_async_prompt, "Set gdb's prompt",
                       &setlist);
       add_show_from_set (c, &showlist);
       c->function.sfunc = set_async_prompt;
     }
 
   add_show_from_set
-    (add_set_cmd ("prompt-escape-char", class_support, var_zinteger, 
+    (add_set_cmd ("prompt-escape-char", class_support, var_zinteger,
                  (char *) &gdb_prompt_escape,
                  "Set escape character for formatting of gdb's prompt",
                  &setlist),
@@ -3879,13 +3893,13 @@ Commands defined in this way may have up to ten arguments.");
 
 #ifdef __STDC__
   c = add_cmd ("source", class_support, source_command,
-          "Read commands from a file named FILE.\n\
+              "Read commands from a file named FILE.\n\
 Note that the file \"" GDBINIT_FILENAME "\" is read automatically in this way\n\
 when gdb is started.", &cmdlist);
 #else
   /* Punt file name, we can't help it easily.  */
   c = add_cmd ("source", class_support, source_command,
-          "Read commands from a file named FILE.\n\
+              "Read commands from a file named FILE.\n\
 Note that the file \".gdbinit\" is read automatically in this way\n\
 when gdb is started.", &cmdlist);
 #endif
@@ -3900,10 +3914,10 @@ when gdb is started.", &cmdlist);
 Primarily used inside of user-defined commands that should not be repeated when\n\
 hitting return.");
 
-  c = add_set_cmd ("verbose", class_support, var_boolean, (char *)&info_verbose,
+  c = add_set_cmd ("verbose", class_support, var_boolean, (char *) &info_verbose,
                   "Set ",
                   &setlist),
-  add_show_from_set (c, &showlist);
+    add_show_from_set (c, &showlist);
   c->function.sfunc = set_verbose;
   set_verbose (NULL, 0, c);
 
@@ -3913,7 +3927,7 @@ hitting return.");
   if (!async_p)
     {
       add_show_from_set
-       (add_set_cmd ("editing", class_support, var_boolean, (char *)&command_editing_p,
+       (add_set_cmd ("editing", class_support, var_boolean, (char *) &command_editing_p,
                      "Set editing of command lines as they are typed.\n\
 Use \"on\" to enable the editing, and \"off\" to disable it.\n\
 Without an argument, command line editing is enabled.  To edit, use\n\
@@ -3922,7 +3936,7 @@ EMACS-like or VI-like commands like control-P or ESC.", &setlist),
     }
   else
     {
-      c = add_set_cmd ("editing", class_support, var_boolean, (char *)&async_command_editing_p,
+      c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p,
                       "Set editing of command lines as they are typed.\n\
 Use \"on\" to enable the editing, and \"off\" to disable it.\n\
 Without an argument, command line editing is enabled.  To edit, use\n\
@@ -3940,39 +3954,39 @@ EMACS-like or VI-like commands like control-P or ESC.", &setlist);
                  &showhistlist, "show history ", 0, &showlist);
 
   add_show_from_set
-    (add_set_cmd ("expansion", no_class, var_boolean, (char *)&history_expansion_p,
-          "Set history expansion on command input.\n\
+    (add_set_cmd ("expansion", no_class, var_boolean, (char *) &history_expansion_p,
+                 "Set history expansion on command input.\n\
 Without an argument, history expansion is enabled.", &sethistlist),
      &showhistlist);
 
   add_show_from_set
-    (add_set_cmd ("save", no_class, var_boolean, (char *)&write_history_p,
-          "Set saving of the history record on exit.\n\
+    (add_set_cmd ("save", no_class, var_boolean, (char *) &write_history_p,
+                 "Set saving of the history record on exit.\n\
 Use \"on\" to enable the saving, and \"off\" to disable it.\n\
 Without an argument, saving is enabled.", &sethistlist),
      &showhistlist);
 
-  c = add_set_cmd ("size", no_class, var_integer, (char *)&history_size,
+  c = add_set_cmd ("size", no_class, var_integer, (char *) &history_size,
                   "Set the size of the command history, \n\
 ie. the number of previous commands to keep a record of.", &sethistlist);
   add_show_from_set (c, &showhistlist);
   c->function.sfunc = set_history_size_command;
 
   add_show_from_set
-    (add_set_cmd ("filename", no_class, var_filename, (char *)&history_filename,
-          "Set the filename in which to record the command history\n\
+    (add_set_cmd ("filename", no_class, var_filename, (char *) &history_filename,
+                 "Set the filename in which to record the command history\n\
  (the list of previous commands of which a record is kept).", &sethistlist),
      &showhistlist);
 
   add_show_from_set
     (add_set_cmd ("confirm", class_support, var_boolean,
-                 (char *)&caution,
+                 (char *) &caution,
                  "Set whether to confirm potentially dangerous operations.",
                  &setlist),
      &showlist);
 
   add_prefix_cmd ("info", class_info, info_command,
-        "Generic command for showing things about the program being debugged.",
+     "Generic command for showing things about the program being debugged.",
                  &infolist, "info ", 0, &cmdlist);
   add_com_alias ("i", "info", class_info, 1);
 
@@ -3995,13 +4009,13 @@ the previous command number shown.",
           "Show what version of GDB this is.", &showlist);
 
   add_com ("while", class_support, while_command,
-"Execute nested commands WHILE the conditional expression is non zero.\n\
+          "Execute nested commands WHILE the conditional expression is non zero.\n\
 The conditional expression must follow the word `while' and must in turn be\n\
 followed by a new line.  The nested commands must be entered one per line,\n\
 and should be terminated by the word `end'.");
 
   add_com ("if", class_support, if_command,
-"Execute nested commands once IF the conditional expression is non zero.\n\
+          "Execute nested commands once IF the conditional expression is non zero.\n\
 The conditional expression must follow the word `if' and must in turn be\n\
 followed by a new line.  The nested commands must be entered one per line,\n\
 and should be terminated by the word 'else' or `end'.  If an else clause\n\
@@ -4010,25 +4024,25 @@ is used, the same rules apply to its nested commands as to the first ones.");
   /* If target is open when baud changes, it doesn't take effect until the
      next open (I think, not sure).  */
   add_show_from_set (add_set_cmd ("remotebaud", no_class,
-                                 var_zinteger, (char *)&baud_rate,
+                                 var_zinteger, (char *) &baud_rate,
                                  "Set baud rate for remote serial I/O.\n\
 This value is used to set the speed of the serial port when debugging\n\
 using remote targets.", &setlist),
                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("remotedebug", no_class, var_zinteger, (char *)&remote_debug,
-                  "Set debugging of remote protocol.\n\
+  add_set_cmd ("remotedebug", no_class, var_zinteger, (char *) &remote_debug,
+              "Set debugging of remote protocol.\n\
 When enabled, each packet sent or received with the remote target\n\
 is displayed.", &setlist),
-                    &showlist);
+                     &showlist);
 
   add_show_from_set (
-    add_set_cmd ("remotetimeout", no_class, var_integer, (char *)&remote_timeout,
-                  "Set timeout limit to wait for target to respond.\n\
+                     add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
+                                  "Set timeout limit to wait for target to respond.\n\
 This value is used to set the time limit for gdb to wait for a response\n\
 from the target.", &setlist),
-                    &showlist);
+                     &showlist);
 
   /* The set annotate command is different depending whether or not
      the async version is run. NOTE: this difference is going to
@@ -4036,8 +4050,8 @@ from the target.", &setlist),
      gdb. */
   if (!async_p)
     {
-      c = add_set_cmd ("annotate", class_obscure, var_zinteger, 
-                      (char *)&annotation_level, "Set annotation_level.\n\
+      c = add_set_cmd ("annotate", class_obscure, var_zinteger,
+                      (char *) &annotation_level, "Set annotation_level.\n\
 0 == normal;     1 == fullname (for use when running under emacs)\n\
 2 == output annotated suitably for use by programs that control GDB.",
                       &setlist);
@@ -4045,11 +4059,11 @@ from the target.", &setlist),
     }
   else
     {
-      c = add_set_cmd ("annotate", class_obscure, var_zinteger, 
-                      (char *)&annotation_level, "Set annotation_level.\n\
+      c = add_set_cmd ("annotate", class_obscure, var_zinteger,
+                      (char *) &annotation_level, "Set annotation_level.\n\
 0 == normal;     1 == fullname (for use when running under emacs)\n\
 2 == output annotated suitably for use by programs that control GDB.",
-                      &setlist);     
+                      &setlist);
       add_show_from_set (c, &showlist);
       c->function.sfunc = set_async_annotation_level;
     }
index e05140ada9d3300cf0c05473f6e2ca730541e496..2803aa9fc8ca4415cbcf62240a9f39aa68e52139 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <setjmp.h>
 
@@ -73,8 +74,8 @@ extern void execute_command PARAMS ((char *, int));
 
 /* This function returns a pointer to the string that is used
    by gdb for its command prompt. */
-extern char *get_prompt PARAMS((void));
+extern char *get_prompt PARAMS ((void));
+
 /* This function copies the specified string into the string that
    is used by gdb for its command prompt. */
 extern void set_prompt PARAMS ((char *));
index 1eb39d1549cf812aa854ffed4635861aec6078f4..f4b41f45cc49a309a92aaeb2ec226389e1bd6a15 100644 (file)
@@ -1,21 +1,22 @@
 /* Tracing functionality for remote targets in custom GDB protocol
    Copyright 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -48,18 +49,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    (which includes everything -- including the checksum), and assumes
    the worst case of maximum length for each of the pieces of a
    continuation packet.
-   
+
    NOTE: expressions get mem2hex'ed otherwise this would be twice as
    large.  (400 - 31)/2 == 184 */
 #define MAX_AGENT_EXPR_LEN     184
 
 
 extern int info_verbose;
-extern void (*readline_begin_hook) PARAMS ((char *, ...));
-extern char * (*readline_hook) PARAMS ((char *));
+extern void (*readline_begin_hook) PARAMS ((char *,...));
+extern char *(*readline_hook) PARAMS ((char *));
 extern void (*readline_end_hook) PARAMS ((void));
 extern void x_command PARAMS ((char *, int));
-extern int addressprint;               /* Print machine addresses? */
+extern int addressprint;       /* Print machine addresses? */
 
 /* If this definition isn't overridden by the header files, assume
    that isatty and fileno exist on this system.  */
@@ -90,7 +91,7 @@ extern int addressprint;              /* Print machine addresses? */
    $trace_line  : source line of trace frame currently being debugged.
    $trace_file  : source file of trace frame currently being debugged.
    $tracepoint  : tracepoint number of trace frame currently being debugged.
  */
+ */
 
 
 /* ======= Important global variables: ======= */
@@ -117,36 +118,36 @@ static struct symtab_and_line traceframe_sal;
 static struct cmd_list_element *tfindlist;
 
 /* ======= Important command functions: ======= */
-static void trace_command                 PARAMS ((char *, int));
-static void tracepoints_info              PARAMS ((char *, int));
-static void delete_trace_command          PARAMS ((char *, int));
-static void enable_trace_command          PARAMS ((char *, int));
-static void disable_trace_command         PARAMS ((char *, int));
-static void trace_pass_command            PARAMS ((char *, int));
-static void trace_actions_command         PARAMS ((char *, int));
-static void trace_start_command           PARAMS ((char *, int));
-static void trace_stop_command            PARAMS ((char *, int));
-static void trace_status_command          PARAMS ((char *, int));
-static void trace_find_command            PARAMS ((char *, int));
-static void trace_find_pc_command         PARAMS ((char *, int));
+static void trace_command PARAMS ((char *, int));
+static void tracepoints_info PARAMS ((char *, int));
+static void delete_trace_command PARAMS ((char *, int));
+static void enable_trace_command PARAMS ((char *, int));
+static void disable_trace_command PARAMS ((char *, int));
+static void trace_pass_command PARAMS ((char *, int));
+static void trace_actions_command PARAMS ((char *, int));
+static void trace_start_command PARAMS ((char *, int));
+static void trace_stop_command PARAMS ((char *, int));
+static void trace_status_command PARAMS ((char *, int));
+static void trace_find_command PARAMS ((char *, int));
+static void trace_find_pc_command PARAMS ((char *, int));
 static void trace_find_tracepoint_command PARAMS ((char *, int));
-static void trace_find_line_command       PARAMS ((char *, int));
-static void trace_find_range_command      PARAMS ((char *, int));
-static void trace_find_outside_command    PARAMS ((char *, int));
-static void tracepoint_save_command       PARAMS ((char *, int));
-static void trace_dump_command            PARAMS ((char *, int));
+static void trace_find_line_command PARAMS ((char *, int));
+static void trace_find_range_command PARAMS ((char *, int));
+static void trace_find_outside_command PARAMS ((char *, int));
+static void tracepoint_save_command PARAMS ((char *, int));
+static void trace_dump_command PARAMS ((char *, int));
 
 /* support routines */
-static void trace_mention                 PARAMS ((struct tracepoint *));
+static void trace_mention PARAMS ((struct tracepoint *));
 
 #if __STDC__
 struct collection_list;
 #endif
 static void add_aexpr PARAMS ((struct collection_list *, struct agent_expr *));
-static unsigned char *mem2hex(unsigned char *, unsigned char *, int);
-static void add_register PARAMS ((struct collection_list *collection, unsigned long regno));
+static unsigned char *mem2hex (unsigned char *, unsigned char *, int);
+static void add_register PARAMS ((struct collection_list * collection, unsigned long regno));
 static void free_actions_list PARAMS ((char **actions_list));
-static void free_actions_list_cleanup_wrapper PARAMS ((void*));
+static void free_actions_list_cleanup_wrapper PARAMS ((void *));
 
 extern void _initialize_tracepoint PARAMS ((void));
 
@@ -162,19 +163,19 @@ target_is_remote ()
 }
 
 /* Utility: generate error from an incoming stub packet.  */
-static void 
+static void
 trace_error (buf)
      char *buf;
 {
   if (*buf++ != 'E')
     return;                    /* not an error msg */
-  switch (*buf) 
+  switch (*buf)
     {
     case '1':                  /* malformed packet error */
       if (*++buf == '0')       /*   general case: */
        error ("tracepoint.c: error in outgoing packet.");
       else
-       error ("tracepoint.c: error in outgoing packet at field #%d.", 
+       error ("tracepoint.c: error in outgoing packet at field #%d.",
               strtol (buf, NULL, 16));
     case '2':
       error ("trace API error 0x%s.", ++buf);
@@ -188,9 +189,9 @@ static char *
 remote_get_noisy_reply (buf)
      char *buf;
 {
-  do   /* loop on reply from remote stub */
+  do                           /* loop on reply from remote stub */
     {
-      QUIT;                            /* allow user to bail out with ^C */
+      QUIT;                    /* allow user to bail out with ^C */
       getpkt (buf, 0);
       if (buf[0] == 0)
        error ("Target does not support this command.");
@@ -200,8 +201,9 @@ remote_get_noisy_reply (buf)
               buf[1] != 'K')
        remote_console_output (buf + 1);        /* 'O' message from stub */
       else
-       return buf;                             /* here's the actual reply */
-    } while (1);
+       return buf;             /* here's the actual reply */
+    }
+  while (1);
 }
 
 /* Set tracepoint count to NUM.  */
@@ -242,25 +244,25 @@ set_traceframe_context (trace_pc)
      CORE_ADDR trace_pc;
 {
   static struct type *func_string, *file_string;
-  static struct type *func_range,  *file_range;
-  static value_ptr    func_val,     file_val;
+  static struct type *func_range, *file_range;
+  static value_ptr func_val, file_val;
   static struct type *charstar;
   int len;
 
   if (charstar == (struct type *) NULL)
     charstar = lookup_pointer_type (builtin_type_char);
 
-  if (trace_pc == -1)  /* cease debugging any trace buffers */
+  if (trace_pc == -1)          /* cease debugging any trace buffers */
     {
       traceframe_fun = 0;
       traceframe_sal.pc = traceframe_sal.line = 0;
       traceframe_sal.symtab = NULL;
-      set_internalvar (lookup_internalvar ("trace_func"), 
+      set_internalvar (lookup_internalvar ("trace_func"),
                       value_from_longest (charstar, (LONGEST) 0));
-      set_internalvar (lookup_internalvar ("trace_file"), 
+      set_internalvar (lookup_internalvar ("trace_file"),
                       value_from_longest (charstar, (LONGEST) 0));
       set_internalvar (lookup_internalvar ("trace_line"),
-                      value_from_longest (builtin_type_int, (LONGEST) -1));
+                      value_from_longest (builtin_type_int, (LONGEST) - 1));
       return;
     }
 
@@ -270,46 +272,46 @@ set_traceframe_context (trace_pc)
 
   /* save linenumber as "$trace_line", a debugger variable visible to users */
   set_internalvar (lookup_internalvar ("trace_line"),
-                  value_from_longest (builtin_type_int, 
+                  value_from_longest (builtin_type_int,
                                       (LONGEST) traceframe_sal.line));
 
   /* save func name as "$trace_func", a debugger variable visible to users */
-  if (traceframe_fun == NULL || 
+  if (traceframe_fun == NULL ||
       SYMBOL_NAME (traceframe_fun) == NULL)
-    set_internalvar (lookup_internalvar ("trace_func"), 
+    set_internalvar (lookup_internalvar ("trace_func"),
                     value_from_longest (charstar, (LONGEST) 0));
   else
     {
       len = strlen (SYMBOL_NAME (traceframe_fun));
-      func_range  = create_range_type (func_range,  
-                                      builtin_type_int, 0, len - 1);
-      func_string = create_array_type (func_string, 
+      func_range = create_range_type (func_range,
+                                     builtin_type_int, 0, len - 1);
+      func_string = create_array_type (func_string,
                                       builtin_type_char, func_range);
       func_val = allocate_value (func_string);
       VALUE_TYPE (func_val) = func_string;
-      memcpy (VALUE_CONTENTS_RAW (func_val), 
-             SYMBOL_NAME (traceframe_fun), 
+      memcpy (VALUE_CONTENTS_RAW (func_val),
+             SYMBOL_NAME (traceframe_fun),
              len);
       func_val->modifiable = 0;
       set_internalvar (lookup_internalvar ("trace_func"), func_val);
     }
 
   /* save file name as "$trace_file", a debugger variable visible to users */
-  if (traceframe_sal.symtab == NULL || 
+  if (traceframe_sal.symtab == NULL ||
       traceframe_sal.symtab->filename == NULL)
-    set_internalvar (lookup_internalvar ("trace_file"), 
+    set_internalvar (lookup_internalvar ("trace_file"),
                     value_from_longest (charstar, (LONGEST) 0));
   else
     {
       len = strlen (traceframe_sal.symtab->filename);
-      file_range  = create_range_type (file_range,  
-                                      builtin_type_int, 0, len - 1);
-      file_string = create_array_type (file_string, 
+      file_range = create_range_type (file_range,
+                                     builtin_type_int, 0, len - 1);
+      file_string = create_array_type (file_string,
                                       builtin_type_char, file_range);
       file_val = allocate_value (file_string);
       VALUE_TYPE (file_val) = file_string;
-      memcpy (VALUE_CONTENTS_RAW (file_val), 
-             traceframe_sal.symtab->filename, 
+      memcpy (VALUE_CONTENTS_RAW (file_val),
+             traceframe_sal.symtab->filename,
              len);
       file_val->modifiable = 0;
       set_internalvar (lookup_internalvar ("trace_file"), file_val);
@@ -339,17 +341,17 @@ set_raw_tracepoint (sal)
   if (sal.symtab == NULL)
     t->source_file = NULL;
   else
-    t->source_file = savestring (sal.symtab->filename, 
+    t->source_file = savestring (sal.symtab->filename,
                                 strlen (sal.symtab->filename));
 
-  t->section     = sal.section;
-  t->language    = current_language->la_language;
+  t->section = sal.section;
+  t->language = current_language->la_language;
   t->input_radix = input_radix;
   t->line_number = sal.line;
-  t->enabled     = enabled;
-  t->next        = 0;
-  t->step_count  = 0;
-  t->pass_count  = 0;
+  t->enabled = enabled;
+  t->next = 0;
+  t->step_count = 0;
+  t->pass_count = 0;
   t->addr_string = NULL;
 
   /* Add this tracepoint to the end of the chain
@@ -375,7 +377,7 @@ trace_command (arg, from_tty)
      char *arg;
      int from_tty;
 {
-  char **canonical = (char **)NULL;
+  char **canonical = (char **) NULL;
   struct symtabs_and_lines sals;
   struct symtab_and_line sal;
   struct tracepoint *t;
@@ -389,10 +391,10 @@ trace_command (arg, from_tty)
     printf_filtered ("TRACE %s\n", arg);
 
   addr_start = arg;
-  sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0, &canonical);
-  addr_end   = arg;
-  if (! sals.nelts) 
-    return;    /* ??? Presumably decode_line_1 has already warned? */
+  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical);
+  addr_end = arg;
+  if (!sals.nelts)
+    return;                    /* ??? Presumably decode_line_1 has already warned? */
 
   /* Resolve all line numbers to PC's */
   for (i = 0; i < sals.nelts; i++)
@@ -408,8 +410,8 @@ trace_command (arg, from_tty)
       t->number = tracepoint_count;
 
       /* If a canonical line spec is needed use that instead of the
-        command string.  */
-      if (canonical != (char **)NULL && canonical[i] != NULL)
+         command string.  */
+      if (canonical != (char **) NULL && canonical[i] != NULL)
        t->addr_string = canonical[i];
       else if (addr_start)
        t->addr_string = savestring (addr_start, addr_end - addr_start);
@@ -467,70 +469,70 @@ tracepoints_info (tpnum_exp, from_tty)
 
   ALL_TRACEPOINTS (t)
     if (tpnum == -1 || tpnum == t->number)
-      {
-       extern int addressprint;        /* print machine addresses? */
+    {
+      extern int addressprint; /* print machine addresses? */
 
-       if (!found_a_tracepoint++)
-         {
-           printf_filtered ("Num Enb ");
-           if (addressprint)
-             printf_filtered ("Address    ");
-           printf_filtered ("PassC StepC What\n");
-         }
-       strcpy (wrap_indent, "                           ");
-       if (addressprint)
-         strcat (wrap_indent, "           ");
-
-       printf_filtered ("%-3d %-3s ", t->number, 
-                        t->enabled == enabled ? "y" : "n");
-       if (addressprint)
-         printf_filtered ("%s ", 
-                          local_hex_string_custom ((unsigned long) t->address,
-                                                   "08l"));
-       printf_filtered ("%-5d %-5d ", t->pass_count, t->step_count);
-
-       if (t->source_file)
-         {
-           sym = find_pc_sect_function (t->address, t->section);
-           if (sym)
-             {
-               fputs_filtered ("in ", gdb_stdout);
-               fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
-               wrap_here (wrap_indent);
-               fputs_filtered (" at ", gdb_stdout);
-             }
-           fputs_filtered (t->source_file, gdb_stdout);
-           printf_filtered (":%d", t->line_number);
-         }
-       else
-         print_address_symbolic (t->address, gdb_stdout, demangle, " ");
+      if (!found_a_tracepoint++)
+       {
+         printf_filtered ("Num Enb ");
+         if (addressprint)
+           printf_filtered ("Address    ");
+         printf_filtered ("PassC StepC What\n");
+       }
+      strcpy (wrap_indent, "                           ");
+      if (addressprint)
+       strcat (wrap_indent, "           ");
+
+      printf_filtered ("%-3d %-3s ", t->number,
+                      t->enabled == enabled ? "y" : "n");
+      if (addressprint)
+       printf_filtered ("%s ",
+                        local_hex_string_custom ((unsigned long) t->address,
+                                                 "08l"));
+      printf_filtered ("%-5d %-5d ", t->pass_count, t->step_count);
+
+      if (t->source_file)
+       {
+         sym = find_pc_sect_function (t->address, t->section);
+         if (sym)
+           {
+             fputs_filtered ("in ", gdb_stdout);
+             fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
+             wrap_here (wrap_indent);
+             fputs_filtered (" at ", gdb_stdout);
+           }
+         fputs_filtered (t->source_file, gdb_stdout);
+         printf_filtered (":%d", t->line_number);
+       }
+      else
+       print_address_symbolic (t->address, gdb_stdout, demangle, " ");
 
-       printf_filtered ("\n");
-       if (t->actions)
-         {
-           printf_filtered ("  Actions for tracepoint %d: \n", t->number);
-           for (action = t->actions; action; action = action->next)
-             {
-               printf_filtered ("\t%s\n", action->action);
-             }
-         }
-      }
+      printf_filtered ("\n");
+      if (t->actions)
+       {
+         printf_filtered ("  Actions for tracepoint %d: \n", t->number);
+         for (action = t->actions; action; action = action->next)
+           {
+             printf_filtered ("\t%s\n", action->action);
+           }
+       }
+    }
   if (!found_a_tracepoint)
     {
       if (tpnum == -1)
-        printf_filtered ("No tracepoints.\n");
+       printf_filtered ("No tracepoints.\n");
       else
-        printf_filtered ("No tracepoint number %d.\n", tpnum);
+       printf_filtered ("No tracepoint number %d.\n", tpnum);
     }
 }
 
 /* Optimization: the code to parse an enable, disable, or delete TP command
    is virtually identical except for whether it performs an enable, disable,
    or delete.  Therefore I've combined them into one function with an opcode.
  */
-enum tracepoint_opcode 
+ */
+enum tracepoint_opcode
 {
-  enable, 
+  enable,
   disable,
   delete
 };
@@ -544,42 +546,43 @@ tracepoint_operation (t, from_tty, opcode)
 {
   struct tracepoint *t2;
 
-  switch (opcode) {
-  case enable:
-    t->enabled = enabled;
-    if (modify_tracepoint_hook)
-      modify_tracepoint_hook (t);
-    break;
-  case disable:
-    t->enabled = disabled;
-    if (modify_tracepoint_hook)
-      modify_tracepoint_hook (t);
-    break;
-  case delete:
-    if (tracepoint_chain == t)
-      tracepoint_chain = t->next;
+  switch (opcode)
+    {
+    case enable:
+      t->enabled = enabled;
+      if (modify_tracepoint_hook)
+       modify_tracepoint_hook (t);
+      break;
+    case disable:
+      t->enabled = disabled;
+      if (modify_tracepoint_hook)
+       modify_tracepoint_hook (t);
+      break;
+    case delete:
+      if (tracepoint_chain == t)
+       tracepoint_chain = t->next;
 
-    ALL_TRACEPOINTS (t2)
-      if (t2->next == t)
+      ALL_TRACEPOINTS (t2)
+       if (t2->next == t)
        {
          t2->next = t->next;
          break;
        }
 
-    /* Let the UI know of any deletions */
-    if (delete_tracepoint_hook)
-      delete_tracepoint_hook (t);
+      /* Let the UI know of any deletions */
+      if (delete_tracepoint_hook)
+       delete_tracepoint_hook (t);
 
-    if (t->addr_string)
-      free (t->addr_string);
-    if (t->source_file)
-      free (t->source_file);
-    if (t->actions)
-      free_actions (t);
+      if (t->addr_string)
+       free (t->addr_string);
+      if (t->source_file)
+       free (t->source_file);
+      if (t->actions)
+       free_actions (t);
 
-    free (t);
-    break;
-  }
+      free (t);
+      break;
+    }
 }
 
 /* Utility: parse a tracepoint number and look it up in the list.  */
@@ -600,9 +603,9 @@ get_tracepoint_by_number (arg)
   else if (**arg == '$')       /* handle convenience variable */
     {
       /* Make a copy of the name, so we can null-terminate it
-        to pass to lookup_internalvar().  */
+         to pass to lookup_internalvar().  */
       end = *arg + 1;
-      while (isalnum(*end) || *end == '_')
+      while (isalnum (*end) || *end == '_')
        end++;
       copy = (char *) alloca (end - *arg);
       strncpy (copy, *arg + 1, (end - *arg - 1));
@@ -610,11 +613,12 @@ get_tracepoint_by_number (arg)
       *arg = end;
 
       val = value_of_internalvar (lookup_internalvar (copy));
-      if (TYPE_CODEVALUE_TYPE (val)) != TYPE_CODE_INT)
+      if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_INT)
        error ("Convenience variable must have integral type.");
       tpnum = (int) value_as_long (val);
     }
-  else         /* handle tracepoint number */
+  else
+    /* handle tracepoint number */
     {
       tpnum = strtol (*arg, arg, 0);
       if (tpnum == 0)          /* possible strtol failure */
@@ -623,9 +627,9 @@ get_tracepoint_by_number (arg)
     }
   ALL_TRACEPOINTS (t)
     if (t->number == tpnum)
-      {
-       return t;
-      }
+    {
+      return t;
+    }
   printf_unfiltered ("No tracepoint number %d.\n", tpnum);
   return NULL;
 }
@@ -647,7 +651,7 @@ map_args_over_tracepoints (args, from_tty, opcode)
   else
     while (*args)
       {
-       QUIT;           /* give user option to bail out with ^C */
+       QUIT;                   /* give user option to bail out with ^C */
        t = get_tracepoint_by_number (&args);
        if (t)
          tracepoint_operation (t, from_tty, opcode);
@@ -685,7 +689,7 @@ delete_trace_command (args, from_tty)
   dont_repeat ();
   if (!args || !*args)         /* No args implies all tracepoints; */
     if (from_tty)              /* confirm only if from_tty... */
-      if (tracepoint_chain)    /* and if there are tracepoints to delete! */
+      if (tracepoint_chain)    /* and if there are tracepoints to delete! */
        if (!query ("Delete all tracepoints? "))
          return;
 
@@ -715,7 +719,7 @@ trace_pass_command (args, from_tty)
     args++;
 
   if (*args && strncasecmp (args, "all", 3) == 0)
-    args += 3; /* skip special argument "all" */
+    args += 3;                 /* skip special argument "all" */
   else
     t1 = get_tracepoint_by_number (&args);
 
@@ -723,40 +727,40 @@ trace_pass_command (args, from_tty)
     error ("Junk at end of arguments.");
 
   if (t1 == NULL)
-    return;    /* error, bad tracepoint number */
+    return;                    /* error, bad tracepoint number */
 
   ALL_TRACEPOINTS (t2)
     if (t1 == (struct tracepoint *) -1 || t1 == t2)
-      {
-       t2->pass_count = count;
-        if (modify_tracepoint_hook)
-          modify_tracepoint_hook (t2);
-       if (from_tty)
-         printf_filtered ("Setting tracepoint %d's passcount to %d\n", 
-                          t2->number, count);
-      }
+    {
+      t2->pass_count = count;
+      if (modify_tracepoint_hook)
+       modify_tracepoint_hook (t2);
+      if (from_tty)
+       printf_filtered ("Setting tracepoint %d's passcount to %d\n",
+                        t2->number, count);
+    }
 }
 
 /* ACTIONS functions: */
 
 /* Prototypes for action-parsing utility commands  */
-static void  read_actions PARAMS((struct tracepoint *));
+static void read_actions PARAMS ((struct tracepoint *));
 static char *parse_and_eval_memrange PARAMS ((char *,
-                                             CORE_ADDR, 
+                                             CORE_ADDR,
                                              long *,
                                              bfd_signed_vma *,
                                              long *));
 
 /* The three functions:
-       collect_pseudocommand, 
-       while_stepping_pseudocommand, and 
-       end_actions_pseudocommand
+   collect_pseudocommand, 
+   while_stepping_pseudocommand, and 
+   end_actions_pseudocommand
    are placeholders for "commands" that are actually ONLY to be used
    within a tracepoint action list.  If the actual function is ever called,
    it means that somebody issued the "command" at the top level,
    which is always an error.  */
 
-static void 
+static void
 end_actions_pseudocommand (args, from_tty)
      char *args;
      int from_tty;
@@ -840,13 +844,13 @@ read_actions (t)
        signal (STOP_SIGNAL, handle_stop_sig);
       else
        signal (STOP_SIGNAL, stop_sig);
-    } 
+    }
 #endif
   old_chain = make_cleanup ((make_cleanup_func) free_actions, (void *) t);
   while (1)
     {
       /* Make sure that all output has been output.  Some machines may let
-        you get away with leaving out some of the gdb_flush, but not all.  */
+         you get away with leaving out some of the gdb_flush, but not all.  */
       wrap_here ("");
       gdb_flush (gdb_stdout);
       gdb_flush (gdb_stderr);
@@ -856,7 +860,7 @@ read_actions (t)
       else if (instream == stdin && ISATTY (instream))
        {
          line = readline (prompt);
-         if (line && *line)            /* add it to command history */
+         if (line && *line)    /* add it to command history */
            add_history (line);
        }
       else
@@ -864,7 +868,7 @@ read_actions (t)
 
       linetype = validate_actionline (&line, t);
       if (linetype == BADLINE)
-       continue;       /* already warned -- collect another line */
+       continue;               /* already warned -- collect another line */
 
       temp = xmalloc (sizeof (struct action_line));
       temp->next = NULL;
@@ -895,7 +899,7 @@ read_actions (t)
              prompt = prompt1; /* end of single-stepping actions */
            }
          else
-           { /* end of actions */
+           {                   /* end of actions */
              if (t->actions->next == NULL)
                {
                  /* an "end" all by itself with no other actions means
@@ -926,14 +930,14 @@ validate_actionline (line, t)
   struct cleanup *old_chain = NULL;
   char *p;
 
-  for (p = *line; isspace (*p); )
+  for (p = *line; isspace (*p);)
     p++;
 
   /* symbol lookup etc. */
-  if (*p == '\0')      /* empty line: just prompt for another line. */
+  if (*p == '\0')              /* empty line: just prompt for another line. */
     return BADLINE;
 
-  if (*p == '#')       /* comment line */
+  if (*p == '#')               /* comment line */
     return GENERIC;
 
   c = lookup_cmd (&p, cmdlist, "", -1, 1);
@@ -942,79 +946,81 @@ validate_actionline (line, t)
       warning ("'%s' is not an action that I know, or is ambiguous.", p);
       return BADLINE;
     }
-    
+
   if (c->function.cfunc == collect_pseudocommand)
     {
       struct agent_expr *aexpr;
       struct agent_reqs areqs;
 
-      do {                     /* repeat over a comma-separated list */
-       QUIT;                   /* allow user to bail out with ^C */
-       while (isspace (*p))
-         p++;
+      do
+       {                       /* repeat over a comma-separated list */
+         QUIT;                 /* allow user to bail out with ^C */
+         while (isspace (*p))
+           p++;
 
-       if (*p == '$')                  /* look for special pseudo-symbols */
-         {
-           long typecode, size;
-           bfd_signed_vma offset;
+         if (*p == '$')        /* look for special pseudo-symbols */
+           {
+             long typecode, size;
+             bfd_signed_vma offset;
 
-           if ((0 == strncasecmp ("reg", p + 1, 3)) ||
-               (0 == strncasecmp ("arg", p + 1, 3)) ||
-               (0 == strncasecmp ("loc", p + 1, 3)))
-             {
-               p = strchr (p, ',');
-               continue;
-             }
-           /* else fall thru, treat p as an expression and parse it! */
-         }
-       exp   = parse_exp_1 (&p, block_for_pc (t->address), 1);
-       old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                  &exp);
+             if ((0 == strncasecmp ("reg", p + 1, 3)) ||
+                 (0 == strncasecmp ("arg", p + 1, 3)) ||
+                 (0 == strncasecmp ("loc", p + 1, 3)))
+               {
+                 p = strchr (p, ',');
+                 continue;
+               }
+             /* else fall thru, treat p as an expression and parse it! */
+           }
+         exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
+         old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                                   &exp);
 
-       if (exp->elts[0].opcode == OP_VAR_VALUE)
-         {
-           if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
-             {
-               warning ("%s is constant (value %d): will not be collected.",
-                        SYMBOL_NAME (exp->elts[2].symbol),
-                        SYMBOL_VALUE (exp->elts[2].symbol));
-               return BADLINE;
-             }
-           else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT)
-             {
-               warning ("%s is optimized away and cannot be collected.",
-                        SYMBOL_NAME (exp->elts[2].symbol));
-               return BADLINE;
-             }
-         }
+         if (exp->elts[0].opcode == OP_VAR_VALUE)
+           {
+             if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
+               {
+                 warning ("%s is constant (value %d): will not be collected.",
+                          SYMBOL_NAME (exp->elts[2].symbol),
+                          SYMBOL_VALUE (exp->elts[2].symbol));
+                 return BADLINE;
+               }
+             else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT)
+               {
+                 warning ("%s is optimized away and cannot be collected.",
+                          SYMBOL_NAME (exp->elts[2].symbol));
+                 return BADLINE;
+               }
+           }
 
-       /* we have something to collect, make sure that the expr to
-          bytecode translator can handle it and that it's not too long */
-       aexpr = gen_trace_for_expr (t->address, exp);
-       (void) make_cleanup ((make_cleanup_func) free_agent_expr, aexpr);
+         /* we have something to collect, make sure that the expr to
+            bytecode translator can handle it and that it's not too long */
+         aexpr = gen_trace_for_expr (t->address, exp);
+         (void) make_cleanup ((make_cleanup_func) free_agent_expr, aexpr);
 
-       if (aexpr->len > MAX_AGENT_EXPR_LEN)
-         error ("expression too complicated, try simplifying");
+         if (aexpr->len > MAX_AGENT_EXPR_LEN)
+           error ("expression too complicated, try simplifying");
 
-       ax_reqs(aexpr, &areqs);
-       (void) make_cleanup (free, areqs.reg_mask);
+         ax_reqs (aexpr, &areqs);
+         (void) make_cleanup (free, areqs.reg_mask);
 
-       if (areqs.flaw != agent_flaw_none)
-         error ("malformed expression");
+         if (areqs.flaw != agent_flaw_none)
+           error ("malformed expression");
 
-       if (areqs.min_height < 0)
-         error ("gdb: Internal error: expression has min height < 0");
+         if (areqs.min_height < 0)
+           error ("gdb: Internal error: expression has min height < 0");
 
-       if (areqs.max_height > 20)
-         error ("expression too complicated, try simplifying");
+         if (areqs.max_height > 20)
+           error ("expression too complicated, try simplifying");
 
-       do_cleanups (old_chain);
-      } while (p && *p++ == ',');
+         do_cleanups (old_chain);
+       }
+      while (p && *p++ == ',');
       return GENERIC;
     }
   else if (c->function.cfunc == while_stepping_pseudocommand)
     {
-      char *steparg;   /* in case warning is necessary */
+      char *steparg;           /* in case warning is necessary */
 
       while (isspace (*p))
        p++;
@@ -1038,7 +1044,7 @@ validate_actionline (line, t)
 }
 
 /* worker function */
-void 
+void
 free_actions (t)
      struct tracepoint *t;
 {
@@ -1047,29 +1053,32 @@ free_actions (t)
   for (line = t->actions; line; line = next)
     {
       next = line->next;
-      if (line->action) 
+      if (line->action)
        free (line->action);
       free (line);
     }
   t->actions = NULL;
 }
 
-struct memrange {
-  int type;            /* 0 for absolute memory range, else basereg number */
+struct memrange
+{
+  int type;                    /* 0 for absolute memory range, else basereg number */
   bfd_signed_vma start;
   bfd_signed_vma end;
 };
 
-struct collection_list {
-  unsigned char regs_mask[8];  /* room for up to 256 regs */
-  long listsize;
-  long next_memrange;
-  struct memrange *list;
-  long aexpr_listsize;         /* size of array pointed to by expr_list elt */
-  long next_aexpr_elt;
-  struct agent_expr **aexpr_list;
-  
-} tracepoint_list, stepping_list;
+struct collection_list
+  {
+    unsigned char regs_mask[8];        /* room for up to 256 regs */
+    long listsize;
+    long next_memrange;
+    struct memrange *list;
+    long aexpr_listsize;       /* size of array pointed to by expr_list elt */
+    long next_aexpr_elt;
+    struct agent_expr **aexpr_list;
+
+  }
+tracepoint_list, stepping_list;
 
 /* MEMRANGE functions: */
 
@@ -1086,18 +1095,20 @@ memrange_cmp (va, vb)
   if (a->type < b->type)
     return -1;
   if (a->type > b->type)
-    return  1;
+    return 1;
   if (a->type == 0)
     {
-      if ((bfd_vma) a->start  < (bfd_vma) b->start)  return -1;
-      if ((bfd_vma) a->start  > (bfd_vma) b->start)  return  1;
+      if ((bfd_vma) a->start < (bfd_vma) b->start)
+       return -1;
+      if ((bfd_vma) a->start > (bfd_vma) b->start)
+       return 1;
     }
   else
     {
-      if (a->start  < b->start)
+      if (a->start < b->start)
        return -1;
-      if (a->start  > b->start)
-       return  1;
+      if (a->start > b->start)
+       return 1;
     }
   return 0;
 }
@@ -1109,14 +1120,14 @@ memrange_sortmerge (memranges)
 {
   int a, b;
 
-  qsort (memranges->list, memranges->next_memrange, 
+  qsort (memranges->list, memranges->next_memrange,
         sizeof (struct memrange), memrange_cmp);
   if (memranges->next_memrange > 0)
     {
       for (a = 0, b = 1; b < memranges->next_memrange; b++)
        {
          if (memranges->list[a].type == memranges->list[b].type &&
-             memranges->list[b].start - memranges->list[a].end <= 
+             memranges->list[b].start - memranges->list[a].end <=
              MAX_REGISTER_VIRTUAL_SIZE)
            {
              /* memrange b starts before memrange a ends; merge them.  */
@@ -1126,7 +1137,7 @@ memrange_sortmerge (memranges)
            }
          a++;                  /* next a */
          if (a != b)
-           memcpy (&memranges->list[a], &memranges->list[b], 
+           memcpy (&memranges->list[a], &memranges->list[b],
                    sizeof (struct memrange));
        }
       memranges->next_memrange = a + 1;
@@ -1144,7 +1155,7 @@ add_register (collection, regno)
   if (regno > (8 * sizeof (collection->regs_mask)))
     error ("Internal: register number %d too large for tracepoint",
           regno);
-  collection->regs_mask [regno / 8] |= 1 << (regno  % 8);
+  collection->regs_mask[regno / 8] |= 1 << (regno % 8);
 }
 
 /* Add a memrange to a collection list */
@@ -1158,20 +1169,20 @@ add_memrange (memranges, type, base, len)
   if (info_verbose)
     printf_filtered ("(%d,0x%x,%d)\n", type, base, len);
   /* type: 0 == memory, n == basereg */
-  memranges->list[memranges->next_memrange].type  = type;
+  memranges->list[memranges->next_memrange].type = type;
   /* base: addr if memory, offset if reg relative. */
   memranges->list[memranges->next_memrange].start = base;
   /* len: we actually save end (base + len) for convenience */
-  memranges->list[memranges->next_memrange].end   = base + len;
+  memranges->list[memranges->next_memrange].end = base + len;
   memranges->next_memrange++;
   if (memranges->next_memrange >= memranges->listsize)
     {
       memranges->listsize *= 2;
-      memranges->list = xrealloc (memranges->list, 
+      memranges->list = xrealloc (memranges->list,
                                  memranges->listsize);
     }
 
-  if (type != -1)      /* better collect the base register! */
+  if (type != -1)              /* better collect the base register! */
     add_register (memranges, type);
 }
 
@@ -1183,97 +1194,98 @@ collect_symbol (collect, sym, frame_regno, frame_offset)
      long frame_regno;
      long frame_offset;
 {
-  unsigned long  len;
-  unsigned long  reg;
+  unsigned long len;
+  unsigned long reg;
   bfd_signed_vma offset;
 
-  len  = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
-  switch (SYMBOL_CLASS (sym)) {
-  default:
-    printf_filtered ("%s: don't know symbol class %d\n",
-                    SYMBOL_NAME (sym), SYMBOL_CLASS (sym));
-    break;
-  case LOC_CONST:
-    printf_filtered ("%s is constant, value is %d: will not be collected.\n",
-                    SYMBOL_NAME (sym), SYMBOL_VALUE (sym));
-    break;
-  case LOC_STATIC:
-    offset = SYMBOL_VALUE_ADDRESS (sym); 
-    if (info_verbose)
-      printf_filtered ("LOC_STATIC %s: collect %d bytes at 0x%08x\n",
-                      SYMBOL_NAME (sym), len, offset);
-    add_memrange (collect, -1, offset, len);   /* 0 == memory */
-    break;
-  case LOC_REGISTER:
-  case LOC_REGPARM:
-    reg = SYMBOL_VALUE (sym); 
-    if (info_verbose)
-      printf_filtered ("LOC_REG[parm] %s: ", SYMBOL_NAME (sym));
-    add_register (collect, reg);
-    /* check for doubles stored in two registers */
-    /* FIXME: how about larger types stored in 3 or more regs? */
-    if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
-       len > REGISTER_RAW_SIZE (reg))
-      add_register (collect, reg + 1);
-    break;
-  case LOC_REF_ARG:
-    printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
-    printf_filtered ("       (will not collect %s)\n", 
-                    SYMBOL_NAME (sym));
-    break;
-  case LOC_ARG:
-    reg    = frame_regno;
-    offset = frame_offset + SYMBOL_VALUE (sym);
-    if (info_verbose)
-      {
-       printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset",
-                        SYMBOL_NAME (sym), len);
-       printf_filtered (" %d from frame ptr reg %d\n", offset, reg);
-      }
-    add_memrange (collect, reg, offset, len);
-    break;
-  case LOC_REGPARM_ADDR:
-    reg = SYMBOL_VALUE (sym);
-    offset = 0;
-    if (info_verbose)
-      {
-       printf_filtered ("LOC_REGPARM_ADDR %s: Collect %d bytes at offset",
-                        SYMBOL_NAME (sym), len);
-       printf_filtered (" %d from reg %d\n", offset, reg);
-      }
-    add_memrange (collect, reg, offset, len);
-    break;
-  case LOC_LOCAL:
-  case LOC_LOCAL_ARG:
-    reg    = frame_regno;
-    offset = frame_offset + SYMBOL_VALUE (sym);
-    if (info_verbose)
-      {
-       printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset",
-                        SYMBOL_NAME (sym), len);
-       printf_filtered (" %d from frame ptr reg %d\n", offset, reg);
-      }
-    add_memrange (collect, reg, offset, len);
-    break;
-  case LOC_BASEREG:
-  case LOC_BASEREG_ARG:
-    reg = SYMBOL_BASEREG (sym);
-    offset  = SYMBOL_VALUE (sym);
-    if (info_verbose)
-      {
-       printf_filtered ("LOC_BASEREG %s: collect %d bytes at offset %d from basereg %d\n", 
-                        SYMBOL_NAME (sym), len, offset, reg);
-      }
-    add_memrange (collect, reg, offset, len);
-    break;
-  case LOC_UNRESOLVED:
-    printf_filtered ("Don't know LOC_UNRESOLVED %s\n", SYMBOL_NAME (sym));
-    break;
-  case LOC_OPTIMIZED_OUT:
-    printf_filtered ("%s has been optimized out of existance.\n",
-                    SYMBOL_NAME (sym));
-    break;
-  }
+  len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
+  switch (SYMBOL_CLASS (sym))
+    {
+    default:
+      printf_filtered ("%s: don't know symbol class %d\n",
+                      SYMBOL_NAME (sym), SYMBOL_CLASS (sym));
+      break;
+    case LOC_CONST:
+      printf_filtered ("%s is constant, value is %d: will not be collected.\n",
+                      SYMBOL_NAME (sym), SYMBOL_VALUE (sym));
+      break;
+    case LOC_STATIC:
+      offset = SYMBOL_VALUE_ADDRESS (sym);
+      if (info_verbose)
+       printf_filtered ("LOC_STATIC %s: collect %d bytes at 0x%08x\n",
+                        SYMBOL_NAME (sym), len, offset);
+      add_memrange (collect, -1, offset, len); /* 0 == memory */
+      break;
+    case LOC_REGISTER:
+    case LOC_REGPARM:
+      reg = SYMBOL_VALUE (sym);
+      if (info_verbose)
+       printf_filtered ("LOC_REG[parm] %s: ", SYMBOL_NAME (sym));
+      add_register (collect, reg);
+      /* check for doubles stored in two registers */
+      /* FIXME: how about larger types stored in 3 or more regs? */
+      if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
+         len > REGISTER_RAW_SIZE (reg))
+       add_register (collect, reg + 1);
+      break;
+    case LOC_REF_ARG:
+      printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
+      printf_filtered ("       (will not collect %s)\n",
+                      SYMBOL_NAME (sym));
+      break;
+    case LOC_ARG:
+      reg = frame_regno;
+      offset = frame_offset + SYMBOL_VALUE (sym);
+      if (info_verbose)
+       {
+         printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset",
+                          SYMBOL_NAME (sym), len);
+         printf_filtered (" %d from frame ptr reg %d\n", offset, reg);
+       }
+      add_memrange (collect, reg, offset, len);
+      break;
+    case LOC_REGPARM_ADDR:
+      reg = SYMBOL_VALUE (sym);
+      offset = 0;
+      if (info_verbose)
+       {
+         printf_filtered ("LOC_REGPARM_ADDR %s: Collect %d bytes at offset",
+                          SYMBOL_NAME (sym), len);
+         printf_filtered (" %d from reg %d\n", offset, reg);
+       }
+      add_memrange (collect, reg, offset, len);
+      break;
+    case LOC_LOCAL:
+    case LOC_LOCAL_ARG:
+      reg = frame_regno;
+      offset = frame_offset + SYMBOL_VALUE (sym);
+      if (info_verbose)
+       {
+         printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset",
+                          SYMBOL_NAME (sym), len);
+         printf_filtered (" %d from frame ptr reg %d\n", offset, reg);
+       }
+      add_memrange (collect, reg, offset, len);
+      break;
+    case LOC_BASEREG:
+    case LOC_BASEREG_ARG:
+      reg = SYMBOL_BASEREG (sym);
+      offset = SYMBOL_VALUE (sym);
+      if (info_verbose)
+       {
+         printf_filtered ("LOC_BASEREG %s: collect %d bytes at offset %d from basereg %d\n",
+                          SYMBOL_NAME (sym), len, offset, reg);
+       }
+      add_memrange (collect, reg, offset, len);
+      break;
+    case LOC_UNRESOLVED:
+      printf_filtered ("Don't know LOC_UNRESOLVED %s\n", SYMBOL_NAME (sym));
+      break;
+    case LOC_OPTIMIZED_OUT:
+      printf_filtered ("%s has been optimized out of existance.\n",
+                      SYMBOL_NAME (sym));
+      break;
+    }
 }
 
 /* Add all locals (or args) symbols to collection list */
@@ -1286,40 +1298,41 @@ add_local_symbols (collect, pc, frame_regno, frame_offset, type)
      int type;
 {
   struct symbol *sym;
-  struct block  *block;
+  struct block *block;
   int i, nsyms, count = 0;
 
   block = block_for_pc (pc);
   while (block != 0)
     {
-      QUIT;                            /* allow user to bail out with ^C */
+      QUIT;                    /* allow user to bail out with ^C */
       nsyms = BLOCK_NSYMS (block);
       for (i = 0; i < nsyms; i++)
        {
          sym = BLOCK_SYM (block, i);
-         switch (SYMBOL_CLASS (sym)) {
-         case LOC_LOCAL:
-         case LOC_STATIC:
-         case LOC_REGISTER:
-         case LOC_BASEREG:
-           if (type == 'L')    /* collecting Locals */
-             {
-               count++;
-               collect_symbol (collect, sym, frame_regno, frame_offset);
-             }
-           break;
-         case LOC_ARG:
-         case LOC_LOCAL_ARG:
-         case LOC_REF_ARG:
-         case LOC_REGPARM:
-         case LOC_REGPARM_ADDR:
-         case LOC_BASEREG_ARG:
-           if (type == 'A')    /* collecting Arguments */
-             {
-               count++;
-               collect_symbol (collect, sym, frame_regno, frame_offset);
-             }
-         }
+         switch (SYMBOL_CLASS (sym))
+           {
+           case LOC_LOCAL:
+           case LOC_STATIC:
+           case LOC_REGISTER:
+           case LOC_BASEREG:
+             if (type == 'L')  /* collecting Locals */
+               {
+                 count++;
+                 collect_symbol (collect, sym, frame_regno, frame_offset);
+               }
+             break;
+           case LOC_ARG:
+           case LOC_LOCAL_ARG:
+           case LOC_REF_ARG:
+           case LOC_REGPARM:
+           case LOC_REGPARM_ADDR:
+           case LOC_BASEREG_ARG:
+             if (type == 'A')  /* collecting Arguments */
+               {
+                 count++;
+                 collect_symbol (collect, sym, frame_regno, frame_offset);
+               }
+           }
        }
       if (BLOCK_FUNCTION (block))
        break;
@@ -1340,7 +1353,7 @@ clear_collection_list (list)
   list->next_memrange = 0;
   for (ndx = 0; ndx < list->next_aexpr_elt; ndx++)
     {
-      free_agent_expr(list->aexpr_list[ndx]);
+      free_agent_expr (list->aexpr_list[ndx]);
       list->aexpr_list[ndx] = NULL;
     }
   list->next_aexpr_elt = 0;
@@ -1358,10 +1371,10 @@ stringify_collection_list (list, string)
   int ndx = 0;
   char *(*str_list)[];
   char *end;
-  long  i;
+  long i;
 
   count = 1 + list->next_memrange + list->next_aexpr_elt + 1;
-  str_list = (char *(*)[])xmalloc(count * sizeof (char *));
+  str_list = (char *(*)[]) xmalloc (count * sizeof (char *));
 
   for (i = sizeof (list->regs_mask) - 1; i > 0; i--)
     if (list->regs_mask[i] != 0)       /* skip leading zeroes in regs_mask */
@@ -1371,16 +1384,16 @@ stringify_collection_list (list, string)
       if (info_verbose)
        printf_filtered ("\nCollecting registers (mask): 0x");
       end = temp_buf;
-      *end++='R';
+      *end++ = 'R';
       for (; i >= 0; i--)
        {
-         QUIT;                         /* allow user to bail out with ^C */
+         QUIT;                 /* allow user to bail out with ^C */
          if (info_verbose)
            printf_filtered ("%02X", list->regs_mask[i]);
-         sprintf (end,  "%02X", list->regs_mask[i]);
+         sprintf (end, "%02X", list->regs_mask[i]);
          end += 2;
        }
-      (*str_list)[ndx] = savestring(temp_buf, end - temp_buf);
+      (*str_list)[ndx] = savestring (temp_buf, end - temp_buf);
       ndx++;
     }
   if (info_verbose)
@@ -1391,20 +1404,20 @@ stringify_collection_list (list, string)
     {
       QUIT;                    /* allow user to bail out with ^C */
       if (info_verbose)
-       printf_filtered ("(%d, 0x%x, %d)\n", 
-                        list->list[i].type, 
-                        list->list[i].start, 
+       printf_filtered ("(%d, 0x%x, %d)\n",
+                        list->list[i].type,
+                        list->list[i].start,
                         list->list[i].end - list->list[i].start);
       if (count + 27 > MAX_AGENT_EXPR_LEN)
        {
-         (*str_list)[ndx] = savestring(temp_buf, count);
+         (*str_list)[ndx] = savestring (temp_buf, count);
          ndx++;
          count = 0;
          end = temp_buf;
        }
-      sprintf (end, "M%X,%X,%X", 
-              list->list[i].type, 
-              list->list[i].start, 
+      sprintf (end, "M%X,%X,%X",
+              list->list[i].type,
+              list->list[i].start,
               list->list[i].end - list->list[i].start);
       count += strlen (end);
       end += strlen (end);
@@ -1415,7 +1428,7 @@ stringify_collection_list (list, string)
       QUIT;                    /* allow user to bail out with ^C */
       if ((count + 10 + 2 * list->aexpr_list[i]->len) > MAX_AGENT_EXPR_LEN)
        {
-         (*str_list)[ndx] = savestring(temp_buf, count);
+         (*str_list)[ndx] = savestring (temp_buf, count);
          ndx++;
          count = 0;
          end = temp_buf;
@@ -1424,13 +1437,13 @@ stringify_collection_list (list, string)
       end += 10;               /* 'X' + 8 hex digits + ',' */
       count += 10;
 
-      end = mem2hex(list->aexpr_list[i]->buf, end, list->aexpr_list[i]->len);
+      end = mem2hex (list->aexpr_list[i]->buf, end, list->aexpr_list[i]->len);
       count += 2 * list->aexpr_list[i]->len;
     }
 
   if (count != 0)
     {
-      (*str_list)[ndx] = savestring(temp_buf, count);
+      (*str_list)[ndx] = savestring (temp_buf, count);
       ndx++;
       count = 0;
       end = temp_buf;
@@ -1451,7 +1464,7 @@ free_actions_list_cleanup_wrapper (al)
 }
 
 static void
-free_actions_list(actions_list)
+free_actions_list (actions_list)
      char **actions_list;
 {
   int ndx;
@@ -1460,29 +1473,29 @@ free_actions_list(actions_list)
     return;
 
   for (ndx = 0; actions_list[ndx]; ndx++)
-    free(actions_list[ndx]);
+    free (actions_list[ndx]);
 
-  free(actions_list);
+  free (actions_list);
 }
 
 /* render all actions into gdb protocol */
 static void
 encode_actions (t, tdp_actions, stepping_actions)
-     struct tracepoint  *t;
-     char              ***tdp_actions;
-     char              ***stepping_actions;
+     struct tracepoint *t;
+     char ***tdp_actions;
+     char ***stepping_actions;
 {
-  static char        tdp_buff[2048], step_buff[2048];
-  char               *action_exp;
-  struct expression  *exp = NULL;
+  static char tdp_buff[2048], step_buff[2048];
+  char *action_exp;
+  struct expression *exp = NULL;
   struct action_line *action;
-  bfd_signed_vma      offset;
-  long                i;
-  value_ptr           tempval;
-  struct collection_list  *collect;
+  bfd_signed_vma offset;
+  long i;
+  value_ptr tempval;
+  struct collection_list *collect;
   struct cmd_list_element *cmd;
   struct agent_expr *aexpr;
-  long                frame_reg, frame_offset;
+  long frame_reg, frame_offset;
 
 
   clear_collection_list (&tracepoint_list);
@@ -1510,112 +1523,115 @@ encode_actions (t, tdp_actions, stepping_actions)
 
       if (cmd->function.cfunc == collect_pseudocommand)
        {
-         do {  /* repeat over a comma-separated list */
-           QUIT;               /* allow user to bail out with ^C */
-           while (isspace (*action_exp))
-             action_exp++;
+         do
+           {                   /* repeat over a comma-separated list */
+             QUIT;             /* allow user to bail out with ^C */
+             while (isspace (*action_exp))
+               action_exp++;
 
-           if (0 == strncasecmp ("$reg", action_exp, 4))
-             {
-               for (i = 0; i < NUM_REGS; i++)
-                 add_register (collect, i);
-               action_exp = strchr (action_exp, ','); /* more? */
-             }
-           else if (0 == strncasecmp ("$arg", action_exp, 4))
-             {
-               add_local_symbols (collect, 
-                                  t->address, 
-                                  frame_reg,
-                                  frame_offset,
-                                  'A');
-               action_exp = strchr (action_exp, ','); /* more? */
-             }
-           else if (0 == strncasecmp ("$loc", action_exp, 4))
-             {
-               add_local_symbols (collect, 
-                                  t->address, 
-                                  frame_reg,
-                                  frame_offset,
-                                  'L');
-               action_exp = strchr (action_exp, ','); /* more? */
-             }
-           else
-             {
-               unsigned long addr, len;
-               struct cleanup *old_chain = NULL;
-               struct cleanup *old_chain1 = NULL;
-               struct agent_reqs areqs;
-
-               exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
-               old_chain = make_cleanup ((make_cleanup_func) 
-                                          free_current_contents, &exp);
-
-               switch (exp->elts[0].opcode) {
-               case OP_REGISTER:
-                 i = exp->elts[1].longconst;
-                 if (info_verbose)
-                   printf_filtered ("OP_REGISTER: ");
-                 add_register (collect, i);
-                 break;
-
-               case UNOP_MEMVAL:
-                 /* safe because we know it's a simple expression */
-                 tempval = evaluate_expression (exp);
-                 addr = VALUE_ADDRESS (tempval) + VALUE_OFFSET (tempval);
-                 len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
-                 add_memrange (collect, -1, addr, len);
-                 break;
-
-               case OP_VAR_VALUE:
-                 collect_symbol (collect, 
-                                 exp->elts[2].symbol,
-                                 frame_reg,
-                                 frame_offset);
-                 break;
-
-               default:        /* full-fledged expression */
-                 aexpr = gen_trace_for_expr (t->address, exp);
-
-                 old_chain1 = make_cleanup ((make_cleanup_func) 
-                                             free_agent_expr, aexpr);
-
-                 ax_reqs (aexpr, &areqs);
-                 if (areqs.flaw != agent_flaw_none)
-                   error ("malformed expression");
-
-                 if (areqs.min_height < 0)
-                   error ("gdb: Internal error: expression has min height < 0");
-                 if (areqs.max_height > 20)
-                   error ("expression too complicated, try simplifying");
-
-                 discard_cleanups (old_chain1);
-                 add_aexpr (collect, aexpr);
-
-                 /* take care of the registers */
-                 if (areqs.reg_mask_len > 0)
-                   {
-                     int ndx1;
-                     int ndx2;
+             if (0 == strncasecmp ("$reg", action_exp, 4))
+               {
+                 for (i = 0; i < NUM_REGS; i++)
+                   add_register (collect, i);
+                 action_exp = strchr (action_exp, ',');        /* more? */
+               }
+             else if (0 == strncasecmp ("$arg", action_exp, 4))
+               {
+                 add_local_symbols (collect,
+                                    t->address,
+                                    frame_reg,
+                                    frame_offset,
+                                    'A');
+                 action_exp = strchr (action_exp, ',');        /* more? */
+               }
+             else if (0 == strncasecmp ("$loc", action_exp, 4))
+               {
+                 add_local_symbols (collect,
+                                    t->address,
+                                    frame_reg,
+                                    frame_offset,
+                                    'L');
+                 action_exp = strchr (action_exp, ',');        /* more? */
+               }
+             else
+               {
+                 unsigned long addr, len;
+                 struct cleanup *old_chain = NULL;
+                 struct cleanup *old_chain1 = NULL;
+                 struct agent_reqs areqs;
+
+                 exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
+                 old_chain = make_cleanup ((make_cleanup_func)
+                                           free_current_contents, &exp);
 
-                     for (ndx1 = 0; ndx1 < areqs.reg_mask_len; ndx1++)
+                 switch (exp->elts[0].opcode)
+                   {
+                   case OP_REGISTER:
+                     i = exp->elts[1].longconst;
+                     if (info_verbose)
+                       printf_filtered ("OP_REGISTER: ");
+                     add_register (collect, i);
+                     break;
+
+                   case UNOP_MEMVAL:
+                     /* safe because we know it's a simple expression */
+                     tempval = evaluate_expression (exp);
+                     addr = VALUE_ADDRESS (tempval) + VALUE_OFFSET (tempval);
+                     len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
+                     add_memrange (collect, -1, addr, len);
+                     break;
+
+                   case OP_VAR_VALUE:
+                     collect_symbol (collect,
+                                     exp->elts[2].symbol,
+                                     frame_reg,
+                                     frame_offset);
+                     break;
+
+                   default:    /* full-fledged expression */
+                     aexpr = gen_trace_for_expr (t->address, exp);
+
+                     old_chain1 = make_cleanup ((make_cleanup_func)
+                                                free_agent_expr, aexpr);
+
+                     ax_reqs (aexpr, &areqs);
+                     if (areqs.flaw != agent_flaw_none)
+                       error ("malformed expression");
+
+                     if (areqs.min_height < 0)
+                       error ("gdb: Internal error: expression has min height < 0");
+                     if (areqs.max_height > 20)
+                       error ("expression too complicated, try simplifying");
+
+                     discard_cleanups (old_chain1);
+                     add_aexpr (collect, aexpr);
+
+                     /* take care of the registers */
+                     if (areqs.reg_mask_len > 0)
                        {
-                         QUIT;         /* allow user to bail out with ^C */
-                         if (areqs.reg_mask[ndx1] != 0)
+                         int ndx1;
+                         int ndx2;
+
+                         for (ndx1 = 0; ndx1 < areqs.reg_mask_len; ndx1++)
                            {
-                             /* assume chars have 8 bits */
-                             for (ndx2 = 0; ndx2 < 8; ndx2++)
-                               if (areqs.reg_mask[ndx1] & (1 << ndx2))
-                                 /* it's used -- record it */
-                                 add_register (collect, ndx1 * 8 + ndx2);
+                             QUIT;     /* allow user to bail out with ^C */
+                             if (areqs.reg_mask[ndx1] != 0)
+                               {
+                                 /* assume chars have 8 bits */
+                                 for (ndx2 = 0; ndx2 < 8; ndx2++)
+                                   if (areqs.reg_mask[ndx1] & (1 << ndx2))
+                                     /* it's used -- record it */
+                                     add_register (collect, ndx1 * 8 + ndx2);
+                               }
                            }
                        }
-                   }
-                 break;
-               }       /* switch */
-               do_cleanups (old_chain);
-             }         /* do */
-         while (action_exp && *action_exp++ == ',');
-       }               /* if */
+                     break;
+                   }           /* switch */
+                 do_cleanups (old_chain);
+               }               /* do */
+           }
+         while (action_exp && *action_exp++ == ',');
+       }                       /* if */
       else if (cmd->function.cfunc == while_stepping_pseudocommand)
        {
          collect = &stepping_list;
@@ -1625,18 +1641,18 @@ encode_actions (t, tdp_actions, stepping_actions)
          if (collect == &stepping_list)        /* end stepping actions */
            collect = &tracepoint_list;
          else
-           break;                      /* end tracepoint actions */
+           break;              /* end tracepoint actions */
        }
-    }                  /* for */
-  memrange_sortmerge (&tracepoint_list); 
-  memrange_sortmerge (&stepping_list); 
+    }                          /* for */
+  memrange_sortmerge (&tracepoint_list);
+  memrange_sortmerge (&stepping_list);
 
-  *tdp_actions      = stringify_collection_list (&tracepoint_list, &tdp_buff);
-  *stepping_actions = stringify_collection_list (&stepping_list,   &step_buff);
+  *tdp_actions = stringify_collection_list (&tracepoint_list, &tdp_buff);
+  *stepping_actions = stringify_collection_list (&stepping_list, &step_buff);
 }
 
 static void
-add_aexpr(collect, aexpr)
+add_aexpr (collect, aexpr)
      struct collection_list *collect;
      struct agent_expr *aexpr;
 {
@@ -1644,7 +1660,7 @@ add_aexpr(collect, aexpr)
     {
       collect->aexpr_list =
        xrealloc (collect->aexpr_list,
-                 2 * collect->aexpr_listsize * sizeof (struct agent_expr *));
+               2 * collect->aexpr_listsize * sizeof (struct agent_expr *));
       collect->aexpr_listsize *= 2;
     }
   collect->aexpr_list[collect->next_aexpr_elt] = aexpr;
@@ -1670,20 +1686,20 @@ remote_set_transparent_ranges (void)
   int anysecs = 0;
 
   if (!exec_bfd)
-    return;            /* no information to give. */
+    return;                    /* no information to give. */
 
   strcpy (target_buf, "QTro");
   for (s = exec_bfd->sections; s; s = s->next)
     {
       char tmp[40];
 
-      if ((s->flags & SEC_LOAD)     == 0 ||
-       /* (s->flags & SEC_CODE)     == 0 || */
+      if ((s->flags & SEC_LOAD) == 0 ||
+      /* (s->flags & SEC_CODE)     == 0 || */
          (s->flags & SEC_READONLY) == 0)
        continue;
 
       anysecs = 1;
-      lma  = s->lma;
+      lma = s->lma;
       size = bfd_get_section_size_before_reloc (s);
       sprintf (tmp, ":%x,%x", lma, lma + size);
       strcat (target_buf, tmp);
@@ -1696,7 +1712,7 @@ remote_set_transparent_ranges (void)
 }
 
 /* tstart command:
+
    Tell target to clear any previous trace experiment.
    Walk the list of tracepoints, and send them (and their actions)
    to the target.  If no errors, 
@@ -1706,7 +1722,7 @@ static void
 trace_start_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM MOSTLY_IMPLEMENTED */
+{                              /* STUB_COMM MOSTLY_IMPLEMENTED */
   struct tracepoint *t;
   char buf[2048];
   char **tdp_actions;
@@ -1714,8 +1730,8 @@ trace_start_command (args, from_tty)
   int ndx;
   struct cleanup *old_chain = NULL;
 
-  dont_repeat ();      /* like "run", dangerous to repeat accidentally */
-  
+  dont_repeat ();              /* like "run", dangerous to repeat accidentally */
+
   if (target_is_remote ())
     {
       putpkt ("QTinit");
@@ -1724,67 +1740,67 @@ trace_start_command (args, from_tty)
        error ("Target does not support this command.");
 
       ALL_TRACEPOINTS (t)
-       {
-         int ss_count;         /* if actions include singlestepping */
-         int disable_mask;     /* ??? */
-         int enable_mask;      /* ??? */
-
-         sprintf (buf, "QTDP:%x:%x:%c:%x:%x", t->number, t->address, 
-                  t->enabled == enabled ? 'E' : 'D', 
-                  t->step_count, t->pass_count);
-
-         if (t->actions)
-           strcat (buf, "-");
-         putpkt (buf);
-         remote_get_noisy_reply (target_buf);
-         if (strcmp (target_buf, "OK"))
-           error ("Target does not support tracepoints.");
-
-         if (t->actions)
-           {
-             encode_actions (t, &tdp_actions, &stepping_actions);
-             old_chain = make_cleanup (free_actions_list_cleanup_wrapper,
-                                       tdp_actions);
-             (void) make_cleanup (free_actions_list_cleanup_wrapper,
-                                  stepping_actions);
-
-             /* do_single_steps (t); */
-             if (tdp_actions)
-               {
-                 for (ndx = 0; tdp_actions[ndx]; ndx++)
-                   {
-                     QUIT;             /* allow user to bail out with ^C */
-                     sprintf (buf, "QTDP:-%x:%x:%s%c",
-                              t->number, t->address,
-                              tdp_actions[ndx],
-                              ((tdp_actions[ndx+1] || stepping_actions)
-                               ? '-' : 0));
-                     putpkt (buf);
-                     remote_get_noisy_reply (target_buf);
-                     if (strcmp (target_buf, "OK"))
-                       error ("Error on target while setting tracepoints.");
-                   }
-               }
-             if (stepping_actions)
-               {
-                 for (ndx = 0; stepping_actions[ndx]; ndx++)
-                   {
-                     QUIT;             /* allow user to bail out with ^C */
-                     sprintf (buf, "QTDP:-%x:%x:%s%s%s",
-                              t->number, t->address,
-                              ((ndx == 0) ? "S" : ""),
-                              stepping_actions[ndx],
-                              (stepping_actions[ndx+1] ? "-" : ""));
-                     putpkt (buf);
-                     remote_get_noisy_reply (target_buf);
-                     if (strcmp (target_buf, "OK"))
-                       error ("Error on target while setting tracepoints.");
-                   }
-               }
+      {
+       int ss_count;           /* if actions include singlestepping */
+       int disable_mask;       /* ??? */
+       int enable_mask;        /* ??? */
 
-             do_cleanups (old_chain);
-           }
-       }
+       sprintf (buf, "QTDP:%x:%x:%c:%x:%x", t->number, t->address,
+                t->enabled == enabled ? 'E' : 'D',
+                t->step_count, t->pass_count);
+
+       if (t->actions)
+         strcat (buf, "-");
+       putpkt (buf);
+       remote_get_noisy_reply (target_buf);
+       if (strcmp (target_buf, "OK"))
+         error ("Target does not support tracepoints.");
+
+       if (t->actions)
+         {
+           encode_actions (t, &tdp_actions, &stepping_actions);
+           old_chain = make_cleanup (free_actions_list_cleanup_wrapper,
+                                     tdp_actions);
+           (void) make_cleanup (free_actions_list_cleanup_wrapper,
+                                stepping_actions);
+
+           /* do_single_steps (t); */
+           if (tdp_actions)
+             {
+               for (ndx = 0; tdp_actions[ndx]; ndx++)
+                 {
+                   QUIT;       /* allow user to bail out with ^C */
+                   sprintf (buf, "QTDP:-%x:%x:%s%c",
+                            t->number, t->address,
+                            tdp_actions[ndx],
+                            ((tdp_actions[ndx + 1] || stepping_actions)
+                             ? '-' : 0));
+                   putpkt (buf);
+                   remote_get_noisy_reply (target_buf);
+                   if (strcmp (target_buf, "OK"))
+                     error ("Error on target while setting tracepoints.");
+                 }
+             }
+           if (stepping_actions)
+             {
+               for (ndx = 0; stepping_actions[ndx]; ndx++)
+                 {
+                   QUIT;       /* allow user to bail out with ^C */
+                   sprintf (buf, "QTDP:-%x:%x:%s%s%s",
+                            t->number, t->address,
+                            ((ndx == 0) ? "S" : ""),
+                            stepping_actions[ndx],
+                            (stepping_actions[ndx + 1] ? "-" : ""));
+                   putpkt (buf);
+                   remote_get_noisy_reply (target_buf);
+                   if (strcmp (target_buf, "OK"))
+                     error ("Error on target while setting tracepoints.");
+                 }
+             }
+
+           do_cleanups (old_chain);
+         }
+      }
       /* Tell target to treat text-like sections as transparent */
       remote_set_transparent_ranges ();
       /* Now insert traps and begin collecting data */
@@ -1794,11 +1810,11 @@ trace_start_command (args, from_tty)
        error ("Bogus reply from target: %s", target_buf);
       set_traceframe_num (-1); /* all old traceframes invalidated */
       set_tracepoint_num (-1);
-      set_traceframe_context(-1);
+      set_traceframe_context (-1);
       trace_running_p = 1;
       if (trace_start_stop_hook)
-       trace_start_stop_hook(1, from_tty);
-      
+       trace_start_stop_hook (1, from_tty);
+
     }
   else
     error ("Trace can only be run on remote targets.");
@@ -1809,7 +1825,7 @@ static void
 trace_stop_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM IS_IMPLEMENTED */
+{                              /* STUB_COMM IS_IMPLEMENTED */
   if (target_is_remote ())
     {
       putpkt ("QTStop");
@@ -1818,7 +1834,7 @@ trace_stop_command (args, from_tty)
        error ("Bogus reply from target: %s", target_buf);
       trace_running_p = 0;
       if (trace_start_stop_hook)
-       trace_start_stop_hook(0, from_tty);
+       trace_start_stop_hook (0, from_tty);
     }
   else
     error ("Trace can only be run on remote targets.");
@@ -1831,7 +1847,7 @@ static void
 trace_status_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM IS_IMPLEMENTED */
+{                              /* STUB_COMM IS_IMPLEMENTED */
   if (target_is_remote ())
     {
       putpkt ("qTStatus");
@@ -1860,63 +1876,64 @@ finish_tfind_command (msg, from_tty)
   char *reply;
 
   old_frame_addr = FRAME_FP (get_current_frame ());
-  old_func       = find_pc_function (read_pc ());
+  old_func = find_pc_function (read_pc ());
 
   putpkt (msg);
   reply = remote_get_noisy_reply (msg);
 
   while (reply && *reply)
-    switch (*reply) {
-    case 'F':
-      if ((target_frameno = (int) strtol (++reply, &reply, 16)) == -1)
-       { 
-         /* A request for a non-existant trace frame has failed.
-            Our response will be different, depending on FROM_TTY:
-
-            If FROM_TTY is true, meaning that this command was 
-            typed interactively by the user, then give an error
-            and DO NOT change the state of traceframe_number etc.
-
-            However if FROM_TTY is false, meaning that we're either
-            in a script, a loop, or a user-defined command, then 
-            DON'T give an error, but DO change the state of
-            traceframe_number etc. to invalid.
-
-            The rationalle is that if you typed the command, you
-            might just have committed a typo or something, and you'd
-            like to NOT lose your current debugging state.  However
-            if you're in a user-defined command or especially in a
-            loop, then you need a way to detect that the command
-            failed WITHOUT aborting.  This allows you to write
-            scripts that search thru the trace buffer until the end,
-            and then continue on to do something else.  */
-
-         if (from_tty)
-           error ("Target failed to find requested trace frame.");
-         else
-           {
-             if (info_verbose)
-               printf_filtered ("End of trace buffer.\n");
-             /* The following will not recurse, since it's special-cased */
-             trace_find_command ("-1", from_tty);
-             reply = NULL;     /* break out of loop, 
+    switch (*reply)
+      {
+      case 'F':
+       if ((target_frameno = (int) strtol (++reply, &reply, 16)) == -1)
+         {
+           /* A request for a non-existant trace frame has failed.
+              Our response will be different, depending on FROM_TTY:
+
+              If FROM_TTY is true, meaning that this command was 
+              typed interactively by the user, then give an error
+              and DO NOT change the state of traceframe_number etc.
+
+              However if FROM_TTY is false, meaning that we're either
+              in a script, a loop, or a user-defined command, then 
+              DON'T give an error, but DO change the state of
+              traceframe_number etc. to invalid.
+
+              The rationalle is that if you typed the command, you
+              might just have committed a typo or something, and you'd
+              like to NOT lose your current debugging state.  However
+              if you're in a user-defined command or especially in a
+              loop, then you need a way to detect that the command
+              failed WITHOUT aborting.  This allows you to write
+              scripts that search thru the trace buffer until the end,
+              and then continue on to do something else.  */
+
+           if (from_tty)
+             error ("Target failed to find requested trace frame.");
+           else
+             {
+               if (info_verbose)
+                 printf_filtered ("End of trace buffer.\n");
+               /* The following will not recurse, since it's special-cased */
+               trace_find_command ("-1", from_tty);
+               reply = NULL;   /* break out of loop, 
                                   (avoid recursive nonsense) */
-           }
-       }
-      break;
-    case 'T':
-      if ((target_tracept = (int) strtol (++reply, &reply, 16)) == -1)
-       error ("Target failed to find requested trace frame.");
-      break;
-    case 'O':  /* "OK"? */
-      if (reply[1] == 'K' && reply[2] == '\0')
-       reply += 2;
-      else
+             }
+         }
+       break;
+      case 'T':
+       if ((target_tracept = (int) strtol (++reply, &reply, 16)) == -1)
+         error ("Target failed to find requested trace frame.");
+       break;
+      case 'O':                /* "OK"? */
+       if (reply[1] == 'K' && reply[2] == '\0')
+         reply += 2;
+       else
+         error ("Bogus reply from target: %s", reply);
+       break;
+      default:
        error ("Bogus reply from target: %s", reply);
-      break;
-    default:
-      error ("Bogus reply from target: %s", reply);
-    }
+      }
 
   flush_cached_frames ();
   registers_changed ();
@@ -1933,22 +1950,22 @@ finish_tfind_command (msg, from_tty)
       int source_only;
 
       /* NOTE: in immitation of the step command, try to determine
-        whether we have made a transition from one function to another.
-        If so, we'll print the "stack frame" (ie. the new function and
-        it's arguments) -- otherwise we'll just show the new source line.
-
-        This determination is made by checking (1) whether the current
-        function has changed, and (2) whether the current FP has changed.
-        Hack: if the FP wasn't collected, either at the current or the
-        previous frame, assume that the FP has NOT changed.  */
-
-      if (old_func       == find_pc_function (read_pc ()) &&
-        (old_frame_addr == 0 ||
-         FRAME_FP (get_current_frame ()) == 0 ||
-         old_frame_addr == FRAME_FP (get_current_frame ())))
+         whether we have made a transition from one function to another.
+         If so, we'll print the "stack frame" (ie. the new function and
+         it's arguments) -- otherwise we'll just show the new source line.
+
+         This determination is made by checking (1) whether the current
+         function has changed, and (2) whether the current FP has changed.
+         Hack: if the FP wasn't collected, either at the current or the
+         previous frame, assume that the FP has NOT changed.  */
+
+      if (old_func == find_pc_function (read_pc ()) &&
+         (old_frame_addr == 0 ||
+          FRAME_FP (get_current_frame ()) == 0 ||
+          old_frame_addr == FRAME_FP (get_current_frame ())))
        source_only = -1;
       else
-       source_only =  1;
+       source_only = 1;
 
       print_stack_frame (selected_frame, selected_frame_level, source_only);
       do_displays ();
@@ -1965,16 +1982,16 @@ finish_tfind_command (msg, from_tty)
    target does not give us a frame number or a tracepoint number).
    Instead of that, the target may send us a string containing
    any combination of:
-       F<hexnum>       (gives the selected frame number)
-       T<hexnum>       (gives the selected tracepoint number)
  */
+   F<hexnum>    (gives the selected frame number)
+   T<hexnum>    (gives the selected tracepoint number)
+ */
 
 /* tfind command */
 static void
 trace_find_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   /* this should only be called with a numeric argument */
   int frameno = -1;
   char *tmp;
@@ -1982,10 +1999,10 @@ trace_find_command (args, from_tty)
   if (target_is_remote ())
     {
       if (trace_find_hook)
-       trace_find_hook (args, from_tty);  
-      
+       trace_find_hook (args, from_tty);
+
       if (args == 0 || *args == 0)
-       { /* TFIND with no args means find NEXT trace frame. */
+       {                       /* TFIND with no args means find NEXT trace frame. */
          if (traceframe_number == -1)
            frameno = 0;        /* "next" is first one */
          else
@@ -2045,7 +2062,7 @@ static void
 trace_find_pc_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   CORE_ADDR pc;
   char *tmp;
 
@@ -2068,7 +2085,7 @@ static void
 trace_find_tracepoint_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   int tdp;
   char buf[40], *tmp;
 
@@ -2090,10 +2107,10 @@ trace_find_tracepoint_command (args, from_tty)
 }
 
 /* TFIND LINE command:
+
    This command will take a sourceline for argument, just like BREAK
    or TRACE (ie. anything that "decode_line_1" can handle).  
-   
+
    With no argument, this command will find the next trace frame 
    corresponding to a source line OTHER THAN THE CURRENT ONE.  */
 
@@ -2101,7 +2118,7 @@ static void
 trace_find_line_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   static CORE_ADDR start_pc, end_pc;
   struct symtabs_and_lines sals;
   struct symtab_and_line sal;
@@ -2121,7 +2138,7 @@ trace_find_line_command (args, from_tty)
       else
        {
          sals = decode_line_spec (args, 1);
-         sal  = sals.sals[0];
+         sal = sals.sals[0];
        }
 
       old_chain = make_cleanup (free, sals.sals);
@@ -2131,8 +2148,8 @@ trace_find_line_command (args, from_tty)
          if (sal.pc != 0)
            {
              /* This is useful for "info line *0x7f34".  If we can't tell the
-                user about a source line, at least let them have the symbolic
-                address.  */
+                user about a source line, at least let them have the symbolic
+                address.  */
              printf_filtered (" for address ");
              wrap_here ("  ");
              print_address (sal.pc, gdb_stdout);
@@ -2141,7 +2158,7 @@ trace_find_line_command (args, from_tty)
          else
            {
              printf_filtered (".\n");
-             return;   /* no line, no PC; what can we do? */
+             return;           /* no line, no PC; what can we do? */
            }
        }
       else if (sal.line > 0
@@ -2181,7 +2198,7 @@ trace_find_line_command (args, from_tty)
       do_cleanups (old_chain);
     }
   else
-      error ("Trace can only be run on remote targets.");
+    error ("Trace can only be run on remote targets.");
 }
 
 /* tfind range command */
@@ -2189,37 +2206,37 @@ static void
 trace_find_range_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   static CORE_ADDR start, stop;
   char *tmp;
 
   if (target_is_remote ())
     {
       if (args == 0 || *args == 0)
-       { /* XXX FIXME: what should default behavior be? */
+       {                       /* XXX FIXME: what should default behavior be? */
          printf_filtered ("Usage: tfind range <startaddr>,<endaddr>\n");
          return;
        }
 
-      if (0 != (tmp = strchr (args, ',' )))
+      if (0 != (tmp = strchr (args, ',')))
        {
          *tmp++ = '\0';        /* terminate start address */
          while (isspace (*tmp))
            tmp++;
          start = parse_and_eval_address (args);
-         stop  = parse_and_eval_address (tmp);
+         stop = parse_and_eval_address (tmp);
        }
       else
-       { /* no explicit end address? */
+       {                       /* no explicit end address? */
          start = parse_and_eval_address (args);
-         stop  = start + 1; /* ??? */
+         stop = start + 1;     /* ??? */
        }
 
       sprintf (target_buf, "QTFrame:range:%x:%x", start, stop);
       finish_tfind_command (target_buf, from_tty);
     }
   else
-      error ("Trace can only be run on remote targets.");
+    error ("Trace can only be run on remote targets.");
 }
 
 /* tfind outside command */
@@ -2227,37 +2244,37 @@ static void
 trace_find_outside_command (args, from_tty)
      char *args;
      int from_tty;
-{ /* STUB_COMM PART_IMPLEMENTED */
+{                              /* STUB_COMM PART_IMPLEMENTED */
   CORE_ADDR start, stop;
   char *tmp;
 
   if (target_is_remote ())
     {
       if (args == 0 || *args == 0)
-       { /* XXX FIXME: what should default behavior be? */
+       {                       /* XXX FIXME: what should default behavior be? */
          printf_filtered ("Usage: tfind outside <startaddr>,<endaddr>\n");
          return;
        }
 
-      if (0 != (tmp = strchr (args, ',' )))
+      if (0 != (tmp = strchr (args, ',')))
        {
          *tmp++ = '\0';        /* terminate start address */
          while (isspace (*tmp))
            tmp++;
          start = parse_and_eval_address (args);
-         stop  = parse_and_eval_address (tmp);
+         stop = parse_and_eval_address (tmp);
        }
       else
-       { /* no explicit end address? */
+       {                       /* no explicit end address? */
          start = parse_and_eval_address (args);
-         stop  = start + 1; /* ??? */
+         stop = start + 1;     /* ??? */
        }
 
       sprintf (target_buf, "QTFrame:outside:%x:%x", start, stop);
       finish_tfind_command (target_buf, from_tty);
     }
   else
-      error ("Trace can only be run on remote targets.");
+    error ("Trace can only be run on remote targets.");
 }
 
 /* save-tracepoints command */
@@ -2266,7 +2283,7 @@ tracepoint_save_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  struct tracepoint  *tp;
+  struct tracepoint *tp;
   struct action_line *line;
   FILE *fp;
   char *i1 = "    ", *i2 = "      ";
@@ -2285,42 +2302,42 @@ tracepoint_save_command (args, from_tty)
     error ("Unable to open file '%s' for saving tracepoints");
 
   ALL_TRACEPOINTS (tp)
-    {
-      if (tp->addr_string)
-       fprintf (fp, "trace %s\n", tp->addr_string);
-      else
-       fprintf (fp, "trace *0x%x\n", tp->address);
+  {
+    if (tp->addr_string)
+      fprintf (fp, "trace %s\n", tp->addr_string);
+    else
+      fprintf (fp, "trace *0x%x\n", tp->address);
 
-      if (tp->pass_count)
-       fprintf (fp, "  passcount %d\n", tp->pass_count);
+    if (tp->pass_count)
+      fprintf (fp, "  passcount %d\n", tp->pass_count);
 
-      if (tp->actions)
-       {
-         fprintf (fp, "  actions\n");
-         indent = i1;
-         for (line = tp->actions; line; line = line->next)
-           {
-             struct cmd_list_element *cmd;
+    if (tp->actions)
+      {
+       fprintf (fp, "  actions\n");
+       indent = i1;
+       for (line = tp->actions; line; line = line->next)
+         {
+           struct cmd_list_element *cmd;
 
-             QUIT;                     /* allow user to bail out with ^C */
-             actionline = line->action;
-             while (isspace(*actionline))
-               actionline++;
+           QUIT;               /* allow user to bail out with ^C */
+           actionline = line->action;
+           while (isspace (*actionline))
+             actionline++;
 
-             fprintf (fp, "%s%s\n", indent, actionline);
-             if (*actionline != '#')   /* skip for comment lines */
-               {
-                 cmd = lookup_cmd (&actionline, cmdlist, "", -1, 1);
-                 if (cmd == 0)
-                   error ("Bad action list item: %s", actionline);
-                 if (cmd->function.cfunc == while_stepping_pseudocommand)
-                   indent = i2;
-                 else if (cmd->function.cfunc == end_actions_pseudocommand)
-                   indent = i1;
-               }
-           }
-       }
-    }
+           fprintf (fp, "%s%s\n", indent, actionline);
+           if (*actionline != '#')     /* skip for comment lines */
+             {
+               cmd = lookup_cmd (&actionline, cmdlist, "", -1, 1);
+               if (cmd == 0)
+                 error ("Bad action list item: %s", actionline);
+               if (cmd->function.cfunc == while_stepping_pseudocommand)
+                 indent = i2;
+               else if (cmd->function.cfunc == end_actions_pseudocommand)
+                 indent = i1;
+             }
+         }
+      }
+  }
   fclose (fp);
   if (from_tty)
     printf_filtered ("Tracepoints saved to file '%s'.\n", args);
@@ -2346,7 +2363,7 @@ scope_info (args, from_tty)
 
   sals = decode_line_1 (&args, 1, NULL, 0, &canonical);
   if (sals.nelts == 0)
-    return;            /* presumably decode_line_1 has already warned */
+    return;                    /* presumably decode_line_1 has already warned */
 
   /* Resolve line numbers to PC */
   resolve_sal_pc (&sals.sals[0]);
@@ -2354,107 +2371,108 @@ scope_info (args, from_tty)
 
   while (block != 0)
     {
-      QUIT;                            /* allow user to bail out with ^C */
+      QUIT;                    /* allow user to bail out with ^C */
       nsyms = BLOCK_NSYMS (block);
       for (i = 0; i < nsyms; i++)
        {
-         QUIT;                         /* allow user to bail out with ^C */
+         QUIT;                 /* allow user to bail out with ^C */
          if (count == 0)
            printf_filtered ("Scope for %s:\n", save_args);
          count++;
          sym = BLOCK_SYM (block, i);
          symname = SYMBOL_NAME (sym);
          if (symname == NULL || *symname == '\0')
-           continue;   /* probably botched, certainly useless */
+           continue;           /* probably botched, certainly useless */
 
          printf_filtered ("Symbol %s is ", symname);
-         switch (SYMBOL_CLASS (sym)) {
-         default:
-         case LOC_UNDEF:               /* messed up symbol? */
-           printf_filtered ("a bogus symbol, class %d.\n", 
-                            SYMBOL_CLASS (sym));
-           count--;                    /* don't count this one */
-           continue;
-         case LOC_CONST:
-           printf_filtered ("a constant with value %d (0x%x)", 
-                            SYMBOL_VALUE (sym), SYMBOL_VALUE (sym));
-           break;
-         case LOC_CONST_BYTES:
-           printf_filtered ("constant bytes: ");
-           if (SYMBOL_TYPE (sym))
-             for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
-               fprintf_filtered (gdb_stdout, " %02x",
-                                 (unsigned) SYMBOL_VALUE_BYTES (sym) [j]);
-           break;
-         case LOC_STATIC:
-           printf_filtered ("in static storage at address ");
-           print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
-           break;
-         case LOC_REGISTER:
-           printf_filtered ("a local variable in register $%s",
-                            REGISTER_NAME (SYMBOL_VALUE (sym)));
-           break;
-         case LOC_ARG:
-         case LOC_LOCAL_ARG:
-           printf_filtered ("an argument at stack/frame offset %ld",
-                            SYMBOL_VALUE (sym));
-           break;
-         case LOC_LOCAL:
-           printf_filtered ("a local variable at frame offset %ld",
-                            SYMBOL_VALUE (sym));
-           break;
-         case LOC_REF_ARG:
-           printf_filtered ("a reference argument at offset %ld",
-                            SYMBOL_VALUE (sym));
-           break;
-         case LOC_REGPARM:
-           printf_filtered ("an argument in register $%s",
-                            REGISTER_NAME (SYMBOL_VALUE (sym)));
-           break;
-         case LOC_REGPARM_ADDR:
-           printf_filtered ("the address of an argument, in register $%s",
-                            REGISTER_NAME (SYMBOL_VALUE (sym)));
-           break;
-         case LOC_TYPEDEF:
-           printf_filtered ("a typedef.\n");
-           continue;
-         case LOC_LABEL:
-           printf_filtered ("a label at address ");
-           print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
-           break;
-         case LOC_BLOCK:
-           printf_filtered ("a function at address ");
-           print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), 1,
-                                  gdb_stdout);
-           break;
-         case LOC_BASEREG:
-           printf_filtered ("a variable at offset %d from register $%s",
-                            SYMBOL_VALUE (sym),
-                            REGISTER_NAME  (SYMBOL_BASEREG (sym)));
-           break;
-         case LOC_BASEREG_ARG:
-           printf_filtered ("an argument at offset %d from register $%s",
-                            SYMBOL_VALUE (sym),
-                            REGISTER_NAME  (SYMBOL_BASEREG (sym)));
-           break;
-         case LOC_UNRESOLVED:
-           msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, NULL);
-           if (msym == NULL)
-             printf_filtered ("Unresolved Static");
-           else
-             {
-               printf_filtered ("static storage at address ");
-               print_address_numeric (SYMBOL_VALUE_ADDRESS (msym), 1, 
-                                      gdb_stdout);
-             }
-           break;
-         case LOC_OPTIMIZED_OUT:
-           printf_filtered ("optimized out.\n");
-           continue;
-         }
+         switch (SYMBOL_CLASS (sym))
+           {
+           default:
+           case LOC_UNDEF:     /* messed up symbol? */
+             printf_filtered ("a bogus symbol, class %d.\n",
+                              SYMBOL_CLASS (sym));
+             count--;          /* don't count this one */
+             continue;
+           case LOC_CONST:
+             printf_filtered ("a constant with value %d (0x%x)",
+                              SYMBOL_VALUE (sym), SYMBOL_VALUE (sym));
+             break;
+           case LOC_CONST_BYTES:
+             printf_filtered ("constant bytes: ");
+             if (SYMBOL_TYPE (sym))
+               for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
+                 fprintf_filtered (gdb_stdout, " %02x",
+                                   (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
+             break;
+           case LOC_STATIC:
+             printf_filtered ("in static storage at address ");
+             print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+             break;
+           case LOC_REGISTER:
+             printf_filtered ("a local variable in register $%s",
+                              REGISTER_NAME (SYMBOL_VALUE (sym)));
+             break;
+           case LOC_ARG:
+           case LOC_LOCAL_ARG:
+             printf_filtered ("an argument at stack/frame offset %ld",
+                              SYMBOL_VALUE (sym));
+             break;
+           case LOC_LOCAL:
+             printf_filtered ("a local variable at frame offset %ld",
+                              SYMBOL_VALUE (sym));
+             break;
+           case LOC_REF_ARG:
+             printf_filtered ("a reference argument at offset %ld",
+                              SYMBOL_VALUE (sym));
+             break;
+           case LOC_REGPARM:
+             printf_filtered ("an argument in register $%s",
+                              REGISTER_NAME (SYMBOL_VALUE (sym)));
+             break;
+           case LOC_REGPARM_ADDR:
+             printf_filtered ("the address of an argument, in register $%s",
+                              REGISTER_NAME (SYMBOL_VALUE (sym)));
+             break;
+           case LOC_TYPEDEF:
+             printf_filtered ("a typedef.\n");
+             continue;
+           case LOC_LABEL:
+             printf_filtered ("a label at address ");
+             print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+             break;
+           case LOC_BLOCK:
+             printf_filtered ("a function at address ");
+             print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), 1,
+                                    gdb_stdout);
+             break;
+           case LOC_BASEREG:
+             printf_filtered ("a variable at offset %d from register $%s",
+                              SYMBOL_VALUE (sym),
+                              REGISTER_NAME (SYMBOL_BASEREG (sym)));
+             break;
+           case LOC_BASEREG_ARG:
+             printf_filtered ("an argument at offset %d from register $%s",
+                              SYMBOL_VALUE (sym),
+                              REGISTER_NAME (SYMBOL_BASEREG (sym)));
+             break;
+           case LOC_UNRESOLVED:
+             msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, NULL);
+             if (msym == NULL)
+               printf_filtered ("Unresolved Static");
+             else
+               {
+                 printf_filtered ("static storage at address ");
+                 print_address_numeric (SYMBOL_VALUE_ADDRESS (msym), 1,
+                                        gdb_stdout);
+               }
+             break;
+           case LOC_OPTIMIZED_OUT:
+             printf_filtered ("optimized out.\n");
+             continue;
+           }
          if (SYMBOL_TYPE (sym))
-           printf_filtered (", length %d.\n", 
-                            TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
+           printf_filtered (", length %d.\n",
+                          TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
        }
       if (BLOCK_FUNCTION (block))
        break;
@@ -2480,12 +2498,12 @@ trace_dump_command (args, from_tty)
      char *args;
      int from_tty;
 {
-  struct tracepoint  *t;
+  struct tracepoint *t;
   struct action_line *action;
-  char               *action_exp, *next_comma;
-  struct cleanup     *old_cleanups;
-  int                 stepping_actions = 0;
-  int                 stepping_frame   = 0;
+  char *action_exp, *next_comma;
+  struct cleanup *old_cleanups;
+  int stepping_actions = 0;
+  int stepping_frame = 0;
 
   if (!target_is_remote ())
     {
@@ -2501,34 +2519,34 @@ trace_dump_command (args, from_tty)
 
   ALL_TRACEPOINTS (t)
     if (t->number == tracepoint_number)
-      break;
+    break;
 
   if (t == NULL)
-    error ("No known tracepoint matches 'current' tracepoint #%d.", 
+    error ("No known tracepoint matches 'current' tracepoint #%d.",
           tracepoint_number);
 
   old_cleanups = make_cleanup (null_cleanup, NULL);
 
-  printf_filtered ("Data collected at tracepoint %d, trace frame %d:\n", 
+  printf_filtered ("Data collected at tracepoint %d, trace frame %d:\n",
                   tracepoint_number, traceframe_number);
 
   /* The current frame is a trap frame if the frame PC is equal
      to the tracepoint PC.  If not, then the current frame was
      collected during single-stepping.  */
 
-  stepping_frame = (t->address != read_pc());
+  stepping_frame = (t->address != read_pc ());
 
   for (action = t->actions; action; action = action->next)
     {
       struct cmd_list_element *cmd;
 
-      QUIT;                            /* allow user to bail out with ^C */
+      QUIT;                    /* allow user to bail out with ^C */
       action_exp = action->action;
       while (isspace (*action_exp))
        action_exp++;
 
       /* The collection actions to be done while stepping are
-        bracketed by the commands "while-stepping" and "end".  */
+         bracketed by the commands "while-stepping" and "end".  */
 
       if (*action_exp == '#')  /* comment line */
        continue;
@@ -2550,36 +2568,38 @@ trace_dump_command (args, from_tty)
             STEPPING_FRAME and STEPPING_ACTIONS should be equal.  */
          if (stepping_frame == stepping_actions)
            {
-             do { /* repeat over a comma-separated list */
-               QUIT;           /* allow user to bail out with ^C */
-               if (*action_exp == ',')
-                 action_exp++;
-               while (isspace (*action_exp))
-                 action_exp++;
-
-               next_comma = strchr (action_exp, ',');
-
-               if      (0 == strncasecmp (action_exp, "$reg", 4))
-                 registers_info (NULL, from_tty);
-               else if (0 == strncasecmp (action_exp, "$loc", 4))
-                 locals_info (NULL, from_tty);
-               else if (0 == strncasecmp (action_exp, "$arg", 4))
-                 args_info (NULL, from_tty);
-               else
-                 { /* variable */
-                   if (next_comma)
-                     {
-                       make_cleanup (replace_comma, next_comma);
-                       *next_comma = '\0';
-                     }
-                   printf_filtered ("%s = ", action_exp);
-                   output_command (action_exp, from_tty);
-                   printf_filtered ("\n");
-                 }
-               if (next_comma)
-                 *next_comma = ',';
-               action_exp = next_comma;
-             } while (action_exp && *action_exp == ',');
+             do
+               {               /* repeat over a comma-separated list */
+                 QUIT;         /* allow user to bail out with ^C */
+                 if (*action_exp == ',')
+                   action_exp++;
+                 while (isspace (*action_exp))
+                   action_exp++;
+
+                 next_comma = strchr (action_exp, ',');
+
+                 if (0 == strncasecmp (action_exp, "$reg", 4))
+                   registers_info (NULL, from_tty);
+                 else if (0 == strncasecmp (action_exp, "$loc", 4))
+                   locals_info (NULL, from_tty);
+                 else if (0 == strncasecmp (action_exp, "$arg", 4))
+                   args_info (NULL, from_tty);
+                 else
+                   {           /* variable */
+                     if (next_comma)
+                       {
+                         make_cleanup (replace_comma, next_comma);
+                         *next_comma = '\0';
+                       }
+                     printf_filtered ("%s = ", action_exp);
+                     output_command (action_exp, from_tty);
+                     printf_filtered ("\n");
+                   }
+                 if (next_comma)
+                   *next_comma = ',';
+                 action_exp = next_comma;
+               }
+             while (action_exp && *action_exp == ',');
            }
        }
     }
@@ -2591,10 +2611,10 @@ trace_dump_command (args, from_tty)
  * "stolen" from sparc-stub.c
  */
 
-static const char hexchars[]="0123456789abcdef";
+static const char hexchars[] = "0123456789abcdef";
 
 static unsigned char *
-mem2hex(mem, buf, count)
+mem2hex (mem, buf, count)
      unsigned char *mem;
      unsigned char *buf;
      int count;
@@ -2614,9 +2634,10 @@ mem2hex(mem, buf, count)
   return buf;
 }
 
-int get_traceframe_number()
+int
+get_traceframe_number ()
 {
- return traceframe_number;
 return traceframe_number;
 }
 
 
@@ -2624,20 +2645,20 @@ int get_traceframe_number()
 void
 _initialize_tracepoint ()
 {
-  tracepoint_chain  = 0;
-  tracepoint_count  = 0;
+  tracepoint_chain = 0;
+  tracepoint_count = 0;
   traceframe_number = -1;
   tracepoint_number = -1;
 
-  set_internalvar (lookup_internalvar ("tpnum"), 
+  set_internalvar (lookup_internalvar ("tpnum"),
                   value_from_longest (builtin_type_int, (LONGEST) 0));
-  set_internalvar (lookup_internalvar ("trace_frame"), 
-                  value_from_longest (builtin_type_int, (LONGEST) -1));
+  set_internalvar (lookup_internalvar ("trace_frame"),
+                  value_from_longest (builtin_type_int, (LONGEST) - 1));
 
   if (tracepoint_list.list == NULL)
     {
       tracepoint_list.listsize = 128;
-      tracepoint_list.list = xmalloc 
+      tracepoint_list.list = xmalloc
        (tracepoint_list.listsize * sizeof (struct memrange));
     }
   if (tracepoint_list.aexpr_list == NULL)
@@ -2650,7 +2671,7 @@ _initialize_tracepoint ()
   if (stepping_list.list == NULL)
     {
       stepping_list.listsize = 128;
-      stepping_list.list = xmalloc 
+      stepping_list.list = xmalloc
        (stepping_list.listsize * sizeof (struct memrange));
     }
 
@@ -2661,11 +2682,11 @@ _initialize_tracepoint ()
        (stepping_list.aexpr_listsize * sizeof (struct agent_expr *));
     }
 
-  add_info ("scope", scope_info, 
+  add_info ("scope", scope_info,
            "List the variables local to a scope");
 
-  add_cmd ("tracepoints", class_trace, NO_FUNCTION, 
-          "Tracing of program execution without stopping the program.", 
+  add_cmd ("tracepoints", class_trace, NO_FUNCTION,
+          "Tracing of program execution without stopping the program.",
           &cmdlist);
 
   add_info ("tracepoints", tracepoints_info,
@@ -2675,26 +2696,26 @@ last tracepoint set.");
 
   add_info_alias ("tp", "tracepoints", 1);
 
-  add_com ("save-tracepoints", class_trace, tracepoint_save_command, 
+  add_com ("save-tracepoints", class_trace, tracepoint_save_command,
           "Save current tracepoint definitions as a script.\n\
 Use the 'source' command in another debug session to restore them.");
 
-  add_com ("tdump", class_trace, trace_dump_command, 
+  add_com ("tdump", class_trace, trace_dump_command,
           "Print everything collected at the current tracepoint.");
 
-  add_prefix_cmd ("tfind",  class_trace, trace_find_command,
+  add_prefix_cmd ("tfind", class_trace, trace_find_command,
                  "Select a trace frame;\n\
 No argument means forward by one frame; '-' meand backward by one frame.",
                  &tfindlist, "tfind ", 1, &cmdlist);
 
   add_cmd ("outside", class_trace, trace_find_outside_command,
           "Select a trace frame whose PC is outside the given \
-range.\nUsage: tfind outside addr1, addr2", 
+range.\nUsage: tfind outside addr1, addr2",
           &tfindlist);
 
   add_cmd ("range", class_trace, trace_find_range_command,
           "Select a trace frame whose PC is in the given range.\n\
-Usage: tfind range addr1,addr2", 
+Usage: tfind range addr1,addr2",
           &tfindlist);
 
   add_cmd ("line", class_trace, trace_find_line_command,
@@ -2727,16 +2748,16 @@ De-select any trace frame and resume 'live' debugging.",
           "Select the first trace frame in the trace buffer.",
           &tfindlist);
 
-  add_com ("tstatus",  class_trace, trace_status_command,
+  add_com ("tstatus", class_trace, trace_status_command,
           "Display the status of the current trace data collection.");
 
-  add_com ("tstop",  class_trace, trace_stop_command,
+  add_com ("tstop", class_trace, trace_stop_command,
           "Stop trace data collection.");
 
   add_com ("tstart", class_trace, trace_start_command,
           "Start trace data collection.");
 
-  add_com ("passcount", class_trace, trace_pass_command, 
+  add_com ("passcount", class_trace, trace_pass_command,
           "Set the passcount for a tracepoint.\n\
 The trace will end when the tracepoint has been passed 'count' times.\n\
 Usage: passcount COUNT TPNUM, where TPNUM may also be \"all\";\n\
@@ -2757,10 +2778,10 @@ one or more \"collect\" commands, to specify what to collect\n\
 while single-stepping.\n\n\
 Note: this command can only be used in a tracepoint \"actions\" list.");
 
-  add_com_alias ("ws",         "while-stepping", class_alias, 0);
-  add_com_alias ("stepping",   "while-stepping", class_alias, 0);
+  add_com_alias ("ws", "while-stepping", class_alias, 0);
+  add_com_alias ("stepping", "while-stepping", class_alias, 0);
 
-  add_com ("collect", class_trace, collect_pseudocommand, 
+  add_com ("collect", class_trace, collect_pseudocommand,
           "Specify one or more data items to be collected at a tracepoint.\n\
 Accepts a comma-separated list of (one or more) expressions.  GDB will\n\
 collect all data (variables, registers) referenced by that expression.\n\
@@ -2776,19 +2797,19 @@ Tracepoint actions may include collecting of specified data, \n\
 single-stepping, or enabling/disabling other tracepoints, \n\
 depending on target's capabilities.");
 
-  add_cmd ("tracepoints", class_trace, delete_trace_command, 
+  add_cmd ("tracepoints", class_trace, delete_trace_command,
           "Delete specified tracepoints.\n\
 Arguments are tracepoint numbers, separated by spaces.\n\
 No argument means delete all tracepoints.",
           &deletelist);
 
-  add_cmd ("tracepoints", class_trace, disable_trace_command, 
+  add_cmd ("tracepoints", class_trace, disable_trace_command,
           "Disable specified tracepoints.\n\
 Arguments are tracepoint numbers, separated by spaces.\n\
 No argument means disable all tracepoints.",
           &disablelist);
 
-  add_cmd ("tracepoints", class_trace, enable_trace_command, 
+  add_cmd ("tracepoints", class_trace, enable_trace_command,
           "Enable specified tracepoints.\n\
 Arguments are tracepoint numbers, separated by spaces.\n\
 No argument means enable all tracepoints.",
@@ -2801,9 +2822,8 @@ For a line number or function, trace at the start of its code.\n\
 If an address is specified, trace at that exact address.\n\n\
 Do \"help tracepoints\" for info on other tracepoint commands.");
 
-  add_com_alias ("tp",   "trace", class_alias, 0);
-  add_com_alias ("tr",   "trace", class_alias, 1);
-  add_com_alias ("tra",  "trace", class_alias, 1);
+  add_com_alias ("tp", "trace", class_alias, 0);
+  add_com_alias ("tr", "trace", class_alias, 1);
+  add_com_alias ("tra", "trace", class_alias, 1);
   add_com_alias ("trac", "trace", class_alias, 1);
 }
-
index 4c1ee82d8d7452f9c1286856a47d1b8e0cd47ba3..3f3381703197e0df1affda49a751e28dfae62c82 100644 (file)
 /* Data structures associated with tracepoints in GDB.
    Copyright (C) 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (TRACEPOINT_H)
 #define TRACEPOINT_H 1
 
 #if !defined (BREAKPOINT_H)
-enum enable { disabled, enabled };
+enum enable
+  {
+    disabled, enabled
+  };
 #endif
 /* The data structure for an action: */
-struct action_line 
-{
-  struct action_line *next;
-  char *action;
-};
+struct action_line
+  {
+    struct action_line *next;
+    char *action;
+  };
 
 /* The data structure for a tracepoint: */
 
 struct tracepoint
-{
-  struct tracepoint *next;
+  {
+    struct tracepoint *next;
 
-  enum enable enabled;
+    enum enable enabled;
 
 #if 0
-  /* Type of tracepoint (MVS FIXME: needed?). */
-  enum tptype type;
+    /* Type of tracepoint (MVS FIXME: needed?). */
+    enum tptype type;
 
-  /* What to do with this tracepoint after we hit it MVS FIXME: needed?). */
-  enum tpdisp disposition;
+    /* What to do with this tracepoint after we hit it MVS FIXME: needed?). */
+    enum tpdisp disposition;
 #endif
-  /* Number assigned to distinguish tracepoints.  */
-  int number;
+    /* Number assigned to distinguish tracepoints.  */
+    int number;
 
-  /* Address to trace at, or NULL if not an instruction tracepoint (MVS ?). */
-  CORE_ADDR address;
+    /* Address to trace at, or NULL if not an instruction tracepoint (MVS ?). */
+    CORE_ADDR address;
 
-  /* Line number of this address.  Only matters if address is non-NULL.  */
-  int line_number;
+    /* Line number of this address.  Only matters if address is non-NULL.  */
+    int line_number;
 
-  /* Source file name of this address.  Only matters if address is non-NULL. */
-  char *source_file;
+    /* Source file name of this address.  Only matters if address is non-NULL. */
+    char *source_file;
 
-  /* Number of times this tracepoint should single-step 
-     and collect additional data */
-  long step_count;
+    /* Number of times this tracepoint should single-step 
+       and collect additional data */
+    long step_count;
 
-  /* Number of times this tracepoint should be hit before disabling/ending. */
-  int pass_count;
-  
-  /* Chain of action lines to execute when this tracepoint is hit. */
-  struct action_line *actions;
+    /* Number of times this tracepoint should be hit before disabling/ending. */
+    int pass_count;
 
-  /* Conditional (MVS ?).  */
-  struct expression *cond;
+    /* Chain of action lines to execute when this tracepoint is hit. */
+    struct action_line *actions;
 
-  /* String we used to set the tracepoint (malloc'd).  Only matters if
-     address is non-NULL.  */
-  char *addr_string;
+    /* Conditional (MVS ?).  */
+    struct expression *cond;
 
-  /* Language we used to set the tracepoint.  */
-  enum language language;
+    /* String we used to set the tracepoint (malloc'd).  Only matters if
+       address is non-NULL.  */
+    char *addr_string;
 
-  /* Input radix we used to set the tracepoint.  */
-  int input_radix;
+    /* Language we used to set the tracepoint.  */
+    enum language language;
 
-  /* Count of the number of times this tracepoint was taken, dumped
-     with the info, but not used for anything else.  Useful for
-     seeing how many times you hit a tracepoint prior to the program
-     aborting, so you can back up to just before the abort.  */
-  int hit_count;
+    /* Input radix we used to set the tracepoint.  */
+    int input_radix;
 
-  /* Thread number for thread-specific tracepoint, or -1 if don't care */ 
-  int thread;
+    /* Count of the number of times this tracepoint was taken, dumped
+       with the info, but not used for anything else.  Useful for
+       seeing how many times you hit a tracepoint prior to the program
+       aborting, so you can back up to just before the abort.  */
+    int hit_count;
 
-  /* BFD section, in case of overlays: 
-     no, I don't know if tracepoints are really gonna work with overlays.  */
-  asection *section;
-};
+    /* Thread number for thread-specific tracepoint, or -1 if don't care */
+    int thread;
+
+    /* BFD section, in case of overlays: 
+       no, I don't know if tracepoints are really gonna work with overlays.  */
+    asection *section;
+  };
 
 enum actionline_type
-{
-  BADLINE  = -1,
-  GENERIC  =  0,
-  END      =  1,
-  STEPPING =  2
-};
+  {
+    BADLINE = -1,
+    GENERIC = 0,
+    END = 1,
+    STEPPING = 2
+  };
 
 
 /* The tracepont chain of all tracepoints */
@@ -119,9 +123,9 @@ void (*trace_start_stop_hook) PARAMS ((int start, int from_tty));
 
 struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
 int get_traceframe_number PARAMS ((void));
-void  free_actions PARAMS((struct tracepoint *));
-enum actionline_type validate_actionline PARAMS((char **,
-                                                        struct tracepoint *));
+void free_actions PARAMS ((struct tracepoint *));
+enum actionline_type validate_actionline PARAMS ((char **,
+                                                 struct tracepoint *));
 
 
 /* Walk the following statement or block through all tracepoints.
index f64db4442a869141f6e3d701861b85c0d1782bcc..53b8452df6903a4b8e4b5825de3647222cffc919 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tui.c
-**         General functions for the WDB TUI
-*/
+   ** tui.c
+   **         General functions for the WDB TUI
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -57,8 +57,8 @@ static Opaque _tui_vDo PARAMS ((TuiOpaqueFuncPtr, va_list));
 ************************/
 
 /*
-** tuiInit().
-*/
+   ** tuiInit().
+ */
 void
 #ifdef __STDC__
 tuiInit (char *argv0)
@@ -83,12 +83,12 @@ tuiInit (argv0)
      * the XDB way. However, one thing we do want to do in
      * XDB style is set up the scrolling region to be
      * the bottom of the screen (tuiTermUnsetup()).
-     */
+   */
   fputs_unfiltered_hook = NULL;
   flush_hook = NULL;
   rl_initialize ();            /* need readline initialization to
-                     * create termcap sequences
-                     */
+                                  * create termcap sequences
+                                */
   tuiTermUnsetup (1, cmdWin->detail.commandInfo.curch);
 
   return;
@@ -96,8 +96,8 @@ tuiInit (argv0)
 
 
 /*
-** tuiInitWindows().
-*/
+   ** tuiInitWindows().
+ */
 void
 #ifdef __STDC__
 tuiInitWindows (void)
@@ -120,9 +120,9 @@ tuiInitWindows ()
 
 
 /*
-** tuiCleanUp().
-**        Kill signal handler and cleanup termination method
-*/
+   ** tuiCleanUp().
+   **        Kill signal handler and cleanup termination method
+ */
 void
 #ifdef __STDC__
 tuiResetScreen (void)
@@ -152,9 +152,9 @@ tuiResetScreen ()
 
 
 /*
-** tuiCleanUp().
-**        Kill signal handler and cleanup termination method
-*/
+   ** tuiCleanUp().
+   **        Kill signal handler and cleanup termination method
+ */
 void
 #ifdef __STDC__
 tuiCleanUp (void)
@@ -179,8 +179,8 @@ tuiCleanUp ()
 
 
 /*
-** tuiError().
-*/
+   ** tuiError().
+ */
 void
 #ifdef __STDC__
 tuiError (
@@ -204,9 +204,9 @@ tuiError (string, exitGdb)
 
 
 /*
-** tui_vError()
-**        tuiError with args in a va_list.
-*/
+   ** tui_vError()
+   **        tuiError with args in a va_list.
+ */
 void
 #ifdef __STDC__
 tui_vError (
@@ -229,9 +229,9 @@ tui_vError (args)
 
 
 /*
-** tuiFree()
-**    Wrapper on top of free() to ensure that input address is greater than 0x0
-*/
+   ** tuiFree()
+   **    Wrapper on top of free() to ensure that input address is greater than 0x0
+ */
 void
 #ifdef __STDC__
 tuiFree (
@@ -251,10 +251,10 @@ tuiFree (ptr)
 
 
 /* tuiGetLowDisassemblyAddress().
-**        Determine what the low address will be to display in the TUI's
-**        disassembly window.  This may or may not be the same as the
-**        low address input.
-*/
+   **        Determine what the low address will be to display in the TUI's
+   **        disassembly window.  This may or may not be the same as the
+   **        low address input.
+ */
 Opaque
 #ifdef __STDC__
 tuiGetLowDisassemblyAddress (
@@ -270,9 +270,9 @@ tuiGetLowDisassemblyAddress (low, pc)
   Opaque newLow;
 
   /*
-    ** Determine where to start the disassembly so that the pc is about in the
-    ** middle of the viewport.
-    */
+     ** Determine where to start the disassembly so that the pc is about in the
+     ** middle of the viewport.
+   */
   for (line = 0, newLow = pc;
        (newLow > low &&
        line < (tuiDefaultWinViewportHeight (DISASSEM_WIN,
@@ -289,9 +289,9 @@ tuiGetLowDisassemblyAddress (low, pc)
 
 
 /* tui_vGetLowDisassemblyAddress().
-**        Determine what the low address will be to display in the TUI's
-**        disassembly window with args in a va_list.
-*/
+   **        Determine what the low address will be to display in the TUI's
+   **        disassembly window with args in a va_list.
+ */
 Opaque
 #ifdef __STDC__
 tui_vGetLowDisassemblyAddress (
@@ -315,20 +315,20 @@ tui_vGetLowDisassemblyAddress (args)
 
 
 /*
-** tuiDo().
-**        General purpose function to execute a tui function.  Transitions
-**        between curses and the are handled here.  This function is called
-**        by non-tui gdb functions.
-**
-**        Errors are caught here.
-**        If there is no error, the value returned by 'func' is returned.
-**        If there is an error, then zero is returned.
-**
-**       Must not be called with immediate_quit in effect (bad things might
-**       happen, say we got a signal in the middle of a memcpy to quit_return).
-**       This is an OK restriction; with very few exceptions immediate_quit can
-**       be replaced by judicious use of QUIT.
-*/
+   ** tuiDo().
+   **        General purpose function to execute a tui function.  Transitions
+   **        between curses and the are handled here.  This function is called
+   **        by non-tui gdb functions.
+   **
+   **        Errors are caught here.
+   **        If there is no error, the value returned by 'func' is returned.
+   **        If there is an error, then zero is returned.
+   **
+   **       Must not be called with immediate_quit in effect (bad things might
+   **       happen, say we got a signal in the middle of a memcpy to quit_return).
+   **       This is an OK restriction; with very few exceptions immediate_quit can
+   **       be replaced by judicious use of QUIT.
+ */
 Opaque
 #ifdef __STDC__
 tuiDo (
@@ -345,7 +345,7 @@ tuiDo (func, va_alist)
 
   /* It is an error to be tuiDo'ing if we
      * don't own the terminal.
-     */
+   */
   if (!terminal_is_ours)
     return ret;
 
@@ -367,22 +367,22 @@ tuiDo (func, va_alist)
 
 
 /*
-** tuiDoAndReturnToTop().
-**        General purpose function to execute a tui function.  Transitions
-**        between curses and the are handled here.  This function is called
-**        by non-tui gdb functions who wish to reset gdb to the top level.
-**        After the tuiDo is performed, a return to the top level occurs.
-**
-**        Errors are caught here.
-**        If there is no error, the value returned by 'func' is returned.
-**        If there is an error, then zero is returned.
-**
-**       Must not be called with immediate_quit in effect (bad things might
-**       happen, say we got a signal in the middle of a memcpy to quit_return).
-**       This is an OK restriction; with very few exceptions immediate_quit can
-**       be replaced by judicious use of QUIT.
-**
-*/
+   ** tuiDoAndReturnToTop().
+   **        General purpose function to execute a tui function.  Transitions
+   **        between curses and the are handled here.  This function is called
+   **        by non-tui gdb functions who wish to reset gdb to the top level.
+   **        After the tuiDo is performed, a return to the top level occurs.
+   **
+   **        Errors are caught here.
+   **        If there is no error, the value returned by 'func' is returned.
+   **        If there is an error, then zero is returned.
+   **
+   **       Must not be called with immediate_quit in effect (bad things might
+   **       happen, say we got a signal in the middle of a memcpy to quit_return).
+   **       This is an OK restriction; with very few exceptions immediate_quit can
+   **       be replaced by judicious use of QUIT.
+   **
+ */
 Opaque
 #ifdef __STDC__
 tuiDoAndReturnToTop (
@@ -399,7 +399,7 @@ tuiDoAndReturnToTop (func, va_alist)
 
   /* It is an error to be tuiDo'ing if we
      * don't own the terminal.
-     */
+   */
   if (!terminal_is_ours)
     return ret;
 
@@ -439,9 +439,9 @@ tui_vSelectSourceSymtab (args)
 
 
 /*
-** _initialize_tui().
-**      Function to initialize gdb commands, for tui window manipulation.
-*/
+   ** _initialize_tui().
+   **      Function to initialize gdb commands, for tui window manipulation.
+ */
 void
 _initialize_tui ()
 {
@@ -469,21 +469,21 @@ Usage:\ttoggle $fregs\n\ttoggle breakpoints";
                         "toggle ",
                         1,
                         &cmdlist);
-}                              /* _initialize_tui*/
+}                              /* _initialize_tui */
 
 
 /*
-** va_catch_errors().
-**       General purpose function to execute a function, catching errors.
-**       If there is no error, the value returned by 'func' is returned.
-**       If there is error, then zero is returned.
-**       Note that 'func' must take a variable argument list as well.
-**
-**       Must not be called with immediate_quit in effect (bad things might
-**       happen, say we got a signal in the middle of a memcpy to quit_return).
-**       This is an OK restriction; with very few exceptions immediate_quit can
-**       be replaced by judicious use of QUIT.
-*/
+   ** va_catch_errors().
+   **       General purpose function to execute a function, catching errors.
+   **       If there is no error, the value returned by 'func' is returned.
+   **       If there is error, then zero is returned.
+   **       Note that 'func' must take a variable argument list as well.
+   **
+   **       Must not be called with immediate_quit in effect (bad things might
+   **       happen, say we got a signal in the middle of a memcpy to quit_return).
+   **       This is an OK restriction; with very few exceptions immediate_quit can
+   **       be replaced by judicious use of QUIT.
+ */
 Opaque
 #ifdef __STDC__
 va_catch_errors (
@@ -498,10 +498,10 @@ va_catch_errors (func, args)
   Opaque ret = (Opaque) NULL;
 
   /*
-  ** We could have used catch_errors(), but it doesn't handle variable args.
-  ** Also, for the tui, we always want to catch all errors, so we don't
-  ** need to pass a mask, or an error string.
-  */
+     ** We could have used catch_errors(), but it doesn't handle variable args.
+     ** Also, for the tui, we always want to catch all errors, so we don't
+     ** need to pass a mask, or an error string.
+   */
   jmp_buf saved_error;
   jmp_buf saved_quit;
   jmp_buf tmp_jmp;
@@ -537,11 +537,11 @@ va_catch_errors (func, args)
 }
 
 /*
-** vcatch_errors().
-**        Catch errors occurring in tui or non tui function, handling
-**        variable param lists. Note that 'func' must take a variable
-**        argument list as well.
-*/
+   ** vcatch_errors().
+   **        Catch errors occurring in tui or non tui function, handling
+   **        variable param lists. Note that 'func' must take a variable
+   **        argument list as well.
+ */
 Opaque
 #ifdef __STDC__
 vcatch_errors (
@@ -550,10 +550,10 @@ vcatch_errors (
 vcatch_errors (va_alist)
      va_dcl
 /*
-vcatch_errors(func, va_alist)
-    OpaqueFuncPtr    func;
-    va_dcl
-*/
+   vcatch_errors(func, va_alist)
+   OpaqueFuncPtr    func;
+   va_dcl
+ */
 #endif
 {
   Opaque ret = (Opaque) NULL;
@@ -561,8 +561,8 @@ vcatch_errors(func, va_alist)
 #ifdef __STDC__
   va_start (args, func);
 /*
-    va_arg(args, OpaqueFuncPtr);
-*/
+   va_arg(args, OpaqueFuncPtr);
+ */
 #else
   OpaqueFuncPtr func;
 
@@ -644,20 +644,20 @@ strcat_to_buf_with_fmt (va_alist)
 
 
 /*
-** _tui_vDo().
-**        General purpose function to execute a tui function.  Transitions
-**        between curses and the are handled here.  This function is called
-**        by non-tui gdb functions.
-**
-**        Errors are caught here.
-**        If there is no error, the value returned by 'func' is returned.
-**        If there is an error, then zero is returned.
-**
-**       Must not be called with immediate_quit in effect (bad things might
-**       happen, say we got a signal in the middle of a memcpy to quit_return).
-**       This is an OK restriction; with very few exceptions immediate_quit can
-**       be replaced by judicious use of QUIT.
-*/
+   ** _tui_vDo().
+   **        General purpose function to execute a tui function.  Transitions
+   **        between curses and the are handled here.  This function is called
+   **        by non-tui gdb functions.
+   **
+   **        Errors are caught here.
+   **        If there is no error, the value returned by 'func' is returned.
+   **        If there is an error, then zero is returned.
+   **
+   **       Must not be called with immediate_quit in effect (bad things might
+   **       happen, say we got a signal in the middle of a memcpy to quit_return).
+   **       This is an OK restriction; with very few exceptions immediate_quit can
+   **       be replaced by judicious use of QUIT.
+ */
 static Opaque
 #ifdef __STDC__
 _tui_vDo (
@@ -675,7 +675,7 @@ _tui_vDo (func, args)
 
   /* It is an error to be tuiDo'ing if we
      * don't own the terminal.
-     */
+   */
   if (!terminal_is_ours)
     return ret;
 
@@ -683,7 +683,7 @@ _tui_vDo (func, args)
     {
       /* If doing command window the "XDB way" (command window
          * is unmanaged by curses...
-         */
+       */
       /* Set up terminal for TUI */
       tuiTermSetup (1);
 
@@ -711,13 +711,13 @@ _toggle_command (arg, fromTTY)
   printf_filtered ("Specify feature to toggle.\n%s\n",
                   (tui_version) ? TUI_TOGGLE_USAGE : TOGGLE_USAGE);
 /*
-  tuiDo((TuiOpaqueFuncPtr)_Toggle_command, arg, fromTTY);
-*/
+   tuiDo((TuiOpaqueFuncPtr)_Toggle_command, arg, fromTTY);
+ */
 }
 
 /*
-** _tui_vToggle_command().
-*/
+   ** _tui_vToggle_command().
+ */
 static void
 #ifdef __STDC__
 _tui_vToggle_command (
@@ -745,8 +745,8 @@ _tui_vToggle_command (args)
       if (subsetCompare (ptr, TUI_FLOAT_REGS_NAME))
        tuiToggleFloatRegs ();
 /*        else if (subsetCompare(ptr, "ANOTHER TOGGLE OPTION"))
-            ...
-*/
+   ...
+ */
       else
        printf_filtered (TOGGLE_USAGE);
       tuiFree (ptr);
@@ -766,9 +766,9 @@ _tuiReset ()
   struct termio mode;
 
   /*
-    ** reset the teletype mode bits to a sensible state.
-    ** Copied tset.c
-    */
+     ** reset the teletype mode bits to a sensible state.
+     ** Copied tset.c
+   */
 #if ! defined (USG) && defined (TIOCGETC)
   struct tchars tbuf;
 #endif /* !USG && TIOCGETC */
@@ -804,7 +804,7 @@ _tuiReset ()
 #endif /* CBREAK */
                     | VTDELAY | ALLDELAY);
   mode.sg_flags |= XTABS | ECHO | CRMOD | ANYP;
-#else /*USG*/
+#else /*USG */
   ioctl (FILEDES, TCGETA, &mode);
   mode.c_cc[VINTR] = CHK (mode.c_cc[VINTR], CTRL ('?'));
   mode.c_cc[VQUIT] = CHK (mode.c_cc[VQUIT], CTRL ('\\'));
@@ -818,7 +818,7 @@ _tuiReset ()
   mode.c_cflag &= ~(CSIZE | PARODD | CLOCAL);
 #ifndef hp9000s800
   mode.c_cflag |= (CS8 | CREAD);
-#else /*hp9000s800*/
+#else /*hp9000s800 */
   mode.c_cflag |= (CS8 | CSTOPB | CREAD);
 #endif /* hp9000s800 */
   mode.c_lflag &= ~(XCASE | ECHONL | NOFLSH);
index bc9fb31e64969690adc06d06623be734e214b1a7..b80b0e9fd358a07340ec3fda8053dc77d9386034 100644 (file)
 
 /* Opaque data type */
 typedef char *Opaque;
-typedef Opaque (*OpaqueFuncPtr) PARAMS ((va_list));
-typedef char **OpaqueList;
-typedef OpaqueList OpaquePtr;
+typedef
+Opaque (*OpaqueFuncPtr) PARAMS ((va_list));
+     typedef char **OpaqueList;
+     typedef OpaqueList OpaquePtr;
 
 /* Generic function pointer */
-typedef     void              (*TuiVoidFuncPtr) PARAMS ((va_list));
-typedef     int               (*TuiIntFuncPtr) PARAMS ((va_list));
+     typedef void (*TuiVoidFuncPtr) PARAMS ((va_list));
+     typedef int (*TuiIntFuncPtr) PARAMS ((va_list));
 /*
-typedef     Opaque            (*TuiOpaqueFuncPtr) PARAMS ((va_list));
-*/
-typedef     OpaqueFuncPtr     TuiOpaqueFuncPtr;
+   typedef     Opaque            (*TuiOpaqueFuncPtr) PARAMS ((va_list));
+ */
+     typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
 
-extern Opaque vcatch_errors PARAMS ((OpaqueFuncPtr, ...));
-extern Opaque va_catch_errors PARAMS ((OpaqueFuncPtr, va_list));
+     extern Opaque vcatch_errors PARAMS ((OpaqueFuncPtr,...));
+     extern Opaque va_catch_errors PARAMS ((OpaqueFuncPtr, va_list));
 
-extern void strcat_to_buf PARAMS ((char *, int, char *));
-extern void strcat_to_buf_with_fmt PARAMS ((char *, int, char *, ...));
+     extern void strcat_to_buf PARAMS ((char *, int, char *));
+     extern void strcat_to_buf_with_fmt PARAMS ((char *, int, char *,...));
 
 /* Types of error returns */
-typedef enum {
-    TUI_SUCCESS,
-    TUI_FAILURE
-} TuiStatus, *TuiStatusPtr;
+     typedef enum
+       {
+        TUI_SUCCESS,
+        TUI_FAILURE
+       }
+TuiStatus, *TuiStatusPtr;
 
 /* Types of windows */
-typedef enum {
-    SRC_WIN = 0,
-    DISASSEM_WIN,
-    DATA_WIN,
-    CMD_WIN,
-    /* This must ALWAYS be AFTER the major windows last */
-    MAX_MAJOR_WINDOWS,
-    /* auxillary windows */
-    LOCATOR_WIN,
-    EXEC_INFO_WIN,
-    DATA_ITEM_WIN,
-    /* This must ALWAYS be next to last */
-    MAX_WINDOWS,
-    UNDEFINED_WIN /* LAST */
-} TuiWinType, *TuiWinTypePtr;
+     typedef enum
+       {
+        SRC_WIN = 0,
+        DISASSEM_WIN,
+        DATA_WIN,
+        CMD_WIN,
+        /* This must ALWAYS be AFTER the major windows last */
+        MAX_MAJOR_WINDOWS,
+        /* auxillary windows */
+        LOCATOR_WIN,
+        EXEC_INFO_WIN,
+        DATA_ITEM_WIN,
+        /* This must ALWAYS be next to last */
+        MAX_WINDOWS,
+        UNDEFINED_WIN          /* LAST */
+       }
+TuiWinType, *TuiWinTypePtr;
 
 /* This is a point definition */
-typedef struct _TuiPoint {
-    int x, y;
-} TuiPoint, *TuiPointPtr;
+     typedef struct _TuiPoint
+       {
+        int x, y;
+       }
+TuiPoint, *TuiPointPtr;
 
 /* Generic window information */
-typedef struct _TuiGenWinInfo {
-    WINDOW          *handle; /* window handle */
-    TuiWinType      type; /* type of window */
-    int             width; /* window width */
-    int             height; /* window height */
-    TuiPoint        origin; /* origin of window */
-    OpaquePtr       content; /* content of window */
-    int             contentSize; /* Size of content (# of elements) */
-    int             contentInUse; /* Can it be used, or is it already used? */
-    int             viewportHeight; /* viewport height */
-    int             lastVisibleLine; /* index of last visible line */
-    int             isVisible; /* whether the window is visible or not */
-} TuiGenWinInfo, *TuiGenWinInfoPtr;
+     typedef struct _TuiGenWinInfo
+       {
+        WINDOW *handle;        /* window handle */
+        TuiWinType type;       /* type of window */
+        int width;             /* window width */
+        int height;            /* window height */
+        TuiPoint origin;       /* origin of window */
+        OpaquePtr content;     /* content of window */
+        int contentSize;       /* Size of content (# of elements) */
+        int contentInUse;      /* Can it be used, or is it already used? */
+        int viewportHeight;    /* viewport height */
+        int lastVisibleLine;   /* index of last visible line */
+        int isVisible;         /* whether the window is visible or not */
+       }
+TuiGenWinInfo, *TuiGenWinInfoPtr;
 
 /* GENERAL TUI FUNCTIONS */
 /* tui.c */
-extern void          tuiInit PARAMS ((char *argv0));
-extern void          tuiInitWindows PARAMS ((void));
-extern void          tuiResetScreen PARAMS ((void));
-extern void          tuiCleanUp PARAMS ((void));
-extern void          tuiError PARAMS ((char *, int));
-extern void          tui_vError PARAMS ((va_list));
-extern void          tuiFree PARAMS ((char *));
-extern Opaque        tuiDo PARAMS ((TuiOpaqueFuncPtr, ...));
-extern Opaque        tuiDoAndReturnToTop PARAMS ((TuiOpaqueFuncPtr, ...));
-extern Opaque        tuiGetLowDisassemblyAddress PARAMS ((Opaque, Opaque));
-extern Opaque        tui_vGetLowDisassemblyAddress PARAMS ((va_list));
-extern void          tui_vSelectSourceSymtab PARAMS ((va_list));
+     extern void tuiInit PARAMS ((char *argv0));
+     extern void tuiInitWindows PARAMS ((void));
+     extern void tuiResetScreen PARAMS ((void));
+     extern void tuiCleanUp PARAMS ((void));
+     extern void tuiError PARAMS ((char *, int));
+     extern void tui_vError PARAMS ((va_list));
+     extern void tuiFree PARAMS ((char *));
+     extern Opaque tuiDo PARAMS ((TuiOpaqueFuncPtr,...));
+     extern Opaque tuiDoAndReturnToTop PARAMS ((TuiOpaqueFuncPtr,...));
+     extern Opaque tuiGetLowDisassemblyAddress PARAMS ((Opaque, Opaque));
+     extern Opaque tui_vGetLowDisassemblyAddress PARAMS ((va_list));
+     extern void tui_vSelectSourceSymtab PARAMS ((va_list));
 
 /* tuiDataWin.c */
-extern void            tui_vCheckDataValues PARAMS ((va_list));
+     extern void tui_vCheckDataValues PARAMS ((va_list));
 
 /* tuiIO.c */
-extern void            tui_vStartNewLines PARAMS ((va_list));
+     extern void tui_vStartNewLines PARAMS ((va_list));
 
 /* tuiLayout.c */
-extern void            tui_vAddWinToLayout PARAMS ((va_list));
-extern TuiStatus       tui_vSetLayoutTo PARAMS ((va_list));
+     extern void tui_vAddWinToLayout PARAMS ((va_list));
+     extern TuiStatus tui_vSetLayoutTo PARAMS ((va_list));
 
 /* tuiSourceWin.c */
-extern void            tuiDisplayMainFunction PARAMS ((void));
-extern void            tuiUpdateAllExecInfos PARAMS ((void));
-extern void            tuiUpdateOnEnd PARAMS ((void));
-extern void            tui_vAllSetHasBreakAt PARAMS ((va_list));
-extern void            tui_vUpdateSourceWindowsWithAddr PARAMS ((va_list));
+     extern void tuiDisplayMainFunction PARAMS ((void));
+     extern void tuiUpdateAllExecInfos PARAMS ((void));
+     extern void tuiUpdateOnEnd PARAMS ((void));
+     extern void tui_vAllSetHasBreakAt PARAMS ((va_list));
+     extern void tui_vUpdateSourceWindowsWithAddr PARAMS ((va_list));
 
 /* tuiStack.c */
-extern void            tui_vShowFrameInfo PARAMS ((va_list));
-extern void            tui_vUpdateLocatorFilename PARAMS ((va_list));
+     extern void tui_vShowFrameInfo PARAMS ((va_list));
+     extern void tui_vUpdateLocatorFilename PARAMS ((va_list));
 #endif /* TUI_H */
index 454dc62e8572fa156c4d8f8628b9d5d2ea9e5e3b..699a420ebf83d11e48fe3a980351ec6d21b98b36 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tuiCommand.c
-**     This module contains functions specific to command window processing.
-*/
+   ** tuiCommand.c
+   **     This module contains functions specific to command window processing.
+ */
 
 
 #include "defs.h"
@@ -22,9 +22,9 @@
 ******************************************/
 
 /*
-** tuiDispatchCtrlChar().
-**        Dispatch the correct tui function based upon the control character.
-*/
+   ** tuiDispatchCtrlChar().
+   **        Dispatch the correct tui function based upon the control character.
+ */
 unsigned int
 #ifdef __STDC__
 tuiDispatchCtrlChar (
@@ -37,10 +37,10 @@ tuiDispatchCtrlChar (ch)
   TuiWinInfoPtr winInfo = tuiWinWithFocus ();
 
   /*
-    ** If the command window has the logical focus, or no-one does
-    ** assume it is the command window; in this case, pass the
-    ** character on through and do nothing here.
-    */
+     ** If the command window has the logical focus, or no-one does
+     ** assume it is the command window; in this case, pass the
+     ** character on through and do nothing here.
+   */
   if (winInfo == (TuiWinInfoPtr) NULL || winInfo == cmdWin)
     return ch;
   else
@@ -50,9 +50,9 @@ tuiDispatchCtrlChar (ch)
       char *term;
 
       /* If this is an xterm, page next/prev keys aren't returned
-        ** by keypad as a single char, so we must handle them here.
-        ** Seems like a bug in the curses library?
-        */
+         ** by keypad as a single char, so we must handle them here.
+         ** Seems like a bug in the curses library?
+       */
       term = (char *) getenv ("TERM");
       for (i = 0; (term && term[i]); i++)
        term[i] = toupper (term[i]);
@@ -109,10 +109,10 @@ tuiDispatchCtrlChar (ch)
 
 
 /*
-** tuiIncrCommandCharCountBy()
-**     Increment the current character count in the command window,
-**     checking for overflow.  Returns the new value of the char count.
-*/
+   ** tuiIncrCommandCharCountBy()
+   **     Increment the current character count in the command window,
+   **     checking for overflow.  Returns the new value of the char count.
+ */
 int
 #ifdef __STDC__
 tuiIncrCommandCharCountBy (
@@ -136,10 +136,10 @@ tuiIncrCommandCharCountBy (count)
 
 
 /*
-** tuiDecrCommandCharCountBy()
-**     Decrement the current character count in the command window,
-**     checking for overflow.  Returns the new value of the char count.
-*/
+   ** tuiDecrCommandCharCountBy()
+   **     Decrement the current character count in the command window,
+   **     checking for overflow.  Returns the new value of the char count.
+ */
 int
 #ifdef __STDC__
 tuiDecrCommandCharCountBy (
@@ -163,9 +163,9 @@ tuiDecrCommandCharCountBy (count)
 
 
 /*
-** tuiSetCommandCharCountTo()
-**     Set the character count to count.
-*/
+   ** tuiSetCommandCharCountTo()
+   **     Set the character count to count.
+ */
 int
 #ifdef __STDC__
 tuiSetCommandCharCountTo (
@@ -192,9 +192,9 @@ tuiSetCommandCharCountTo (count)
 
 
 /*
-** tuiClearCommandCharCount()
-**     Clear the character count to count.
-*/
+   ** tuiClearCommandCharCount()
+   **     Clear the character count to count.
+ */
 int
 #ifdef __STDC__
 tuiClearCommandCharCount (void)
index 206d918dd56e3bdd4749dc5d6183416f3718c9a6..68b12e02b46fa853dff90ba81aa38505cac382a1 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_COMMAND_H
 #define _TUI_COMMAND_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
 
 /*****************************************
 ** PUBLIC FUNCTION EXTERNAL DECLS        **
 ******************************************/
 
-extern unsigned int     tuiDispatchCtrlChar PARAMS ((unsigned int));
-extern int              tuiIncrCommandCharCountBy PARAMS ((int));
-extern int              tuiDecrCommandCharCountBy PARAMS ((int));
-extern int              tuiSetCommandCharCountTo PARAMS ((int));
-extern int              tuiClearCommandCharCount PARAMS ((void));
+extern unsigned int tuiDispatchCtrlChar PARAMS ((unsigned int));
+extern int tuiIncrCommandCharCountBy PARAMS ((int));
+extern int tuiDecrCommandCharCountBy PARAMS ((int));
+extern int tuiSetCommandCharCountTo PARAMS ((int));
+extern int tuiClearCommandCharCount PARAMS ((void));
 
-#endif /*_TUI_COMMAND_H*/
+#endif
+/*_TUI_COMMAND_H*/
index 758a6cde492dc9d0f6bc35e6a39e687cfb1bc14f..a4e38f3971df2105cec054fda50c8f1657b7cf93 100644 (file)
@@ -1,8 +1,8 @@
 /*
-** tuiData.c
-**    This module contains functions for manipulating the data
-**    structures used by the TUI
-*/
+   ** tuiData.c
+   **    This module contains functions for manipulating the data
+   **    structures used by the TUI
+ */
 
 #include "defs.h"
 #include "tui.h"
@@ -64,9 +64,9 @@ static void freeContentElements PARAMS ((TuiWinContent, int, TuiWinType));
 ******************************************/
 
 /*
-** tuiWinResized().
-**        Answer a whether the terminal window has been resized or not
-*/
+   ** tuiWinResized().
+   **        Answer a whether the terminal window has been resized or not
+ */
 int
 #ifdef __STDC__
 tuiWinResized (void)
@@ -79,9 +79,9 @@ tuiWinResized ()
 
 
 /*
-** tuiSetWinResized().
-**        Set a whether the terminal window has been resized or not
-*/
+   ** tuiSetWinResized().
+   **        Set a whether the terminal window has been resized or not
+ */
 void
 #ifdef __STDC__
 tuiSetWinResizedTo (
@@ -98,9 +98,9 @@ tuiSetWinResizedTo (resized)
 
 
 /*
-** tuiLayoutDef().
-**        Answer a pointer to the current layout definition
-*/
+   ** tuiLayoutDef().
+   **        Answer a pointer to the current layout definition
+ */
 TuiLayoutDefPtr
 #ifdef __STDC__
 tuiLayoutDef (void)
@@ -113,9 +113,9 @@ tuiLayoutDef ()
 
 
 /*
-** tuiWinWithFocus().
-**        Answer the window with the logical focus
-*/
+   ** tuiWinWithFocus().
+   **        Answer the window with the logical focus
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 tuiWinWithFocus (void)
@@ -128,9 +128,9 @@ tuiWinWithFocus ()
 
 
 /*
-** tuiSetWinWithFocus().
-**        Set the window that has the logical focus
-*/
+   ** tuiSetWinWithFocus().
+   **        Set the window that has the logical focus
+ */
 void
 #ifdef __STDC__
 tuiSetWinWithFocus (
@@ -147,9 +147,9 @@ tuiSetWinWithFocus (winInfo)
 
 
 /*
-** tuiDefaultTabLen().
-**        Answer the length in chars, of tabs
-*/
+   ** tuiDefaultTabLen().
+   **        Answer the length in chars, of tabs
+ */
 int
 #ifdef __STDC__
 tuiDefaultTabLen (void)
@@ -162,9 +162,9 @@ tuiDefaultTabLen ()
 
 
 /*
-** tuiSetDefaultTabLen().
-**        Set the length in chars, of tabs
-*/
+   ** tuiSetDefaultTabLen().
+   **        Set the length in chars, of tabs
+ */
 void
 #ifdef __STDC__
 tuiSetDefaultTabLen (
@@ -181,11 +181,11 @@ tuiSetDefaultTabLen (len)
 
 
 /*
-** currentSourceWin()
-**        Accessor for the current source window.  Usually there is only
-**        one source window (either source or disassembly), but both can
-**        be displayed at the same time.
-*/
+   ** currentSourceWin()
+   **        Accessor for the current source window.  Usually there is only
+   **        one source window (either source or disassembly), but both can
+   **        be displayed at the same time.
+ */
 TuiListPtr
 #ifdef __STDC__
 sourceWindows (void)
@@ -198,11 +198,11 @@ sourceWindows ()
 
 
 /*
-** clearSourceWindows()
-**        Clear the list of source windows.  Usually there is only one
-**        source window (either source or disassembly), but both can be
-**        displayed at the same time.
-*/
+   ** clearSourceWindows()
+   **        Clear the list of source windows.  Usually there is only one
+   **        source window (either source or disassembly), but both can be
+   **        displayed at the same time.
+ */
 void
 #ifdef __STDC__
 clearSourceWindows (void)
@@ -219,9 +219,9 @@ clearSourceWindows ()
 
 
 /*
-** clearSourceWindowsDetail()
-**        Clear the pertinant detail in the source windows.
-*/
+   ** clearSourceWindowsDetail()
+   **        Clear the pertinant detail in the source windows.
+ */
 void
 #ifdef __STDC__
 clearSourceWindowsDetail (void)
@@ -239,11 +239,11 @@ clearSourceWindowsDetail ()
 
 
 /*
-** addSourceWindowToList().
-**       Add a window to the list of source windows.  Usually there is
-**       only one source window (either source or disassembly), but
-**       both can be displayed at the same time.
-*/
+   ** addSourceWindowToList().
+   **       Add a window to the list of source windows.  Usually there is
+   **       only one source window (either source or disassembly), but
+   **       both can be displayed at the same time.
+ */
 void
 #ifdef __STDC__
 addToSourceWindows (
@@ -261,9 +261,9 @@ addToSourceWindows (winInfo)
 
 
 /*
-** clearWinDetail()
-**        Clear the pertinant detail in the windows.
-*/
+   ** clearWinDetail()
+   **        Clear the pertinant detail in the windows.
+ */
 void
 #ifdef __STDC__
 clearWinDetail (
@@ -308,9 +308,9 @@ clearWinDetail (winInfo)
 
 
 /*
-** blankStr()
-**        Accessor for the blank string.
-*/
+   ** blankStr()
+   **        Accessor for the blank string.
+ */
 char *
 #ifdef __STDC__
 blankStr (void)
@@ -323,9 +323,9 @@ blankStr ()
 
 
 /*
-** locationStr()
-**        Accessor for the location string.
-*/
+   ** locationStr()
+   **        Accessor for the location string.
+ */
 char *
 #ifdef __STDC__
 locationStr (void)
@@ -338,9 +338,9 @@ locationStr ()
 
 
 /*
-** breakStr()
-**        Accessor for the break string.
-*/
+   ** breakStr()
+   **        Accessor for the break string.
+ */
 char *
 #ifdef __STDC__
 breakStr (void)
@@ -353,9 +353,9 @@ breakStr ()
 
 
 /*
-** breakLocationStr()
-**        Accessor for the breakLocation string.
-*/
+   ** breakLocationStr()
+   **        Accessor for the breakLocation string.
+ */
 char *
 #ifdef __STDC__
 breakLocationStr (void)
@@ -368,9 +368,9 @@ breakLocationStr ()
 
 
 /*
-** nullStr()
-**        Accessor for the null string.
-*/
+   ** nullStr()
+   **        Accessor for the null string.
+ */
 char *
 #ifdef __STDC__
 nullStr (void)
@@ -383,9 +383,9 @@ nullStr ()
 
 
 /*
-** sourceExecInfoPtr().
-**        Accessor for the source execution info ptr.
-*/
+   ** sourceExecInfoPtr().
+   **        Accessor for the source execution info ptr.
+ */
 TuiGenWinInfoPtr
 #ifdef __STDC__
 sourceExecInfoWinPtr (void)
@@ -398,9 +398,9 @@ sourceExecInfoWinPtr ()
 
 
 /*
-** disassemExecInfoPtr().
-**        Accessor for the disassem execution info ptr.
-*/
+   ** disassemExecInfoPtr().
+   **        Accessor for the disassem execution info ptr.
+ */
 TuiGenWinInfoPtr
 #ifdef __STDC__
 disassemExecInfoWinPtr (void)
@@ -413,10 +413,10 @@ disassemExecInfoWinPtr ()
 
 
 /*
-** locatorWinInfoPtr().
-**        Accessor for the locator win info.  Answers a pointer to the
-**        static locator win info struct.
-*/
+   ** locatorWinInfoPtr().
+   **        Accessor for the locator win info.  Answers a pointer to the
+   **        static locator win info struct.
+ */
 TuiGenWinInfoPtr
 #ifdef __STDC__
 locatorWinInfoPtr (void)
@@ -429,9 +429,9 @@ locatorWinInfoPtr ()
 
 
 /*
-** historyLimit().
-**        Accessor for the history limit
-*/
+   ** historyLimit().
+   **        Accessor for the history limit
+ */
 int
 #ifdef __STDC__
 historyLimit (void)
@@ -444,9 +444,9 @@ historyLimit ()
 
 
 /*
-** setHistoryLimitTo().
-**        Mutator for the history limit
-*/
+   ** setHistoryLimitTo().
+   **        Mutator for the history limit
+ */
 void
 #ifdef __STDC__
 setHistoryLimitTo (
@@ -462,9 +462,9 @@ setHistoryLimitTo (h)
 }                              /* setHistoryLimitTo */
 
 /*
-** termHeight().
-**        Accessor for the termHeight
-*/
+   ** termHeight().
+   **        Accessor for the termHeight
+ */
 int
 #ifdef __STDC__
 termHeight (void)
@@ -477,9 +477,9 @@ termHeight ()
 
 
 /*
-** setTermHeightTo().
-**        Mutator for the term height
-*/
+   ** setTermHeightTo().
+   **        Mutator for the term height
+ */
 void
 #ifdef __STDC__
 setTermHeightTo (
@@ -496,9 +496,9 @@ setTermHeightTo (h)
 
 
 /*
-** termWidth().
-**        Accessor for the termWidth
-*/
+   ** termWidth().
+   **        Accessor for the termWidth
+ */
 int
 #ifdef __STDC__
 termWidth (void)
@@ -511,9 +511,9 @@ termWidth ()
 
 
 /*
-** setTermWidth().
-**        Mutator for the termWidth
-*/
+   ** setTermWidth().
+   **        Mutator for the termWidth
+ */
 void
 #ifdef __STDC__
 setTermWidthTo (
@@ -530,9 +530,9 @@ setTermWidthTo (w)
 
 
 /*
-** currentLayout().
-**        Accessor for the current layout
-*/
+   ** currentLayout().
+   **        Accessor for the current layout
+ */
 TuiLayoutType
 #ifdef __STDC__
 currentLayout (void)
@@ -545,9 +545,9 @@ currentLayout ()
 
 
 /*
-** setCurrentLayoutTo().
-**        Mutator for the current layout
-*/
+   ** setCurrentLayoutTo().
+   **        Mutator for the current layout
+ */
 void
 #ifdef __STDC__
 setCurrentLayoutTo (
@@ -564,9 +564,9 @@ setCurrentLayoutTo (newLayout)
 
 
 /*
-** setGenWinOrigin().
-**        Set the origin of the window
-*/
+   ** setGenWinOrigin().
+   **        Set the origin of the window
+ */
 void
 #ifdef __STDC__
 setGenWinOrigin (
@@ -593,10 +593,10 @@ setGenWinOrigin (winInfo, x, y)
 
 
 /*
-** tuiNextWin().
-**        Answer the next window in the list, cycling back to the top
-**        if necessary
-*/
+   ** tuiNextWin().
+   **        Answer the next window in the list, cycling back to the top
+   **        if necessary
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 tuiNextWin (
@@ -631,10 +631,10 @@ tuiNextWin (curWin)
 
 
 /*
-** tuiPrevWin().
-**        Answer the prev window in the list, cycling back to the bottom
-**        if necessary
-*/
+   ** tuiPrevWin().
+   **        Answer the prev window in the list, cycling back to the bottom
+   **        if necessary
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 tuiPrevWin (
@@ -669,11 +669,11 @@ tuiPrevWin (curWin)
 
 
 /*
-** displayableWinContentOf().
-**        Answer a the content at the location indicated by index.  Note
-**        that if this is a locator window, the string returned should be
-**        freed after use.
-*/
+   ** displayableWinContentOf().
+   **        Answer a the content at the location indicated by index.  Note
+   **        that if this is a locator window, the string returned should be
+   **        freed after use.
+ */
 char *
 #ifdef __STDC__
 displayableWinContentOf (
@@ -691,8 +691,8 @@ displayableWinContentOf (winInfo, elementPtr)
   if (elementPtr != (TuiWinElementPtr) NULL || winInfo->type == LOCATOR_WIN)
     {
       /*
-        ** Now convert the line to a displayable string
-        */
+         ** Now convert the line to a displayable string
+       */
       switch (winInfo->type)
        {
        case SRC_WIN:
@@ -712,12 +712,12 @@ displayableWinContentOf (winInfo, elementPtr)
              register int strSize = termWidth (), i, procWidth, fileWidth;
 
              /*
-                    ** First determine the amount of file/proc name width
-                    ** we have available
-                    */
+                ** First determine the amount of file/proc name width
+                ** we have available
+              */
              i = strSize - (PC_WIDTH + LINE_WIDTH
                             + 25       /* pc and line labels */
-                            + strlen (FILE_PREFIX) + 1 /* file label */
+                            + strlen (FILE_PREFIX) + 1         /* file label */
                             + 15 /* procedure label */ );
              if (i >= FILE_WIDTH + PROC_WIDTH)
                {
@@ -755,11 +755,11 @@ displayableWinContentOf (winInfo, elementPtr)
              else
                strcpy (pc, "??");
              /*
-                    ** Now create the locator line from the string version
-                    ** of the elements.  We could use sprintf() here but
-                    ** that wouldn't ensure that we don't overrun the size
-                    ** of the allocated buffer.  strcat_to_buf() will.
-                    */
+                ** Now create the locator line from the string version
+                ** of the elements.  We could use sprintf() here but
+                ** that wouldn't ensure that we don't overrun the size
+                ** of the allocated buffer.  strcat_to_buf() will.
+              */
              *string = (char) 0;
              /* Filename */
              strcat_to_buf (string, strSize, " ");
@@ -808,9 +808,9 @@ displayableWinContentOf (winInfo, elementPtr)
 
 
 /*
-**    winContentAt().
-**        Answer a the content at the location indicated by index
-*/
+   **    winContentAt().
+   **        Answer a the content at the location indicated by index
+ */
 char *
 #ifdef __STDC__
 displayableWinContentAt (
@@ -827,9 +827,9 @@ displayableWinContentAt (winInfo, index)
 
 
 /*
-** winElementHeight().
-**        Answer the height of the element in lines
-*/
+   ** winElementHeight().
+   **        Answer the height of the element in lines
+ */
 int
 #ifdef __STDC__
 winElementHeight (
@@ -854,9 +854,9 @@ winElementHeight (winInfo, element)
 
 
 /*
-**  winByName().
-**      Answer the window represented by name
-*/
+   **  winByName().
+   **      Answer the window represented by name
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 winByName (
@@ -881,9 +881,9 @@ winByName (name)
 
 
 /*
-**  partialWinByName().
-**      Answer the window represented by name
-*/
+   **  partialWinByName().
+   **      Answer the window represented by name
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 partialWinByName (
@@ -914,9 +914,9 @@ partialWinByName (name)
 
 
 /*
-** winName().
-**      Answer the name of the window
-*/
+   ** winName().
+   **      Answer the name of the window
+ */
 char *
 #ifdef __STDC__
 winName (
@@ -952,8 +952,8 @@ winName (winInfo)
 
 
 /*
-** initializeStaticData
-*/
+   ** initializeStaticData
+ */
 void
 #ifdef __STDC__
 initializeStaticData (void)
@@ -970,8 +970,8 @@ initializeStaticData ()
 
 
 /*
-** allocGenericWinInfo().
-*/
+   ** allocGenericWinInfo().
+ */
 TuiGenWinInfoPtr
 #ifdef __STDC__
 allocGenericWinInfo (void)
@@ -990,8 +990,8 @@ allocGenericWinInfo ()
 
 
 /*
-** initGenericPart().
-*/
+   ** initGenericPart().
+ */
 void
 #ifdef __STDC__
 initGenericPart (
@@ -1018,8 +1018,8 @@ initGenericPart (win)
 
 
 /*
-** initContentElement().
-*/
+   ** initContentElement().
+ */
 void
 #ifdef __STDC__
 initContentElement (
@@ -1075,8 +1075,8 @@ initContentElement (element, type)
 }                              /* initContentElement */
 
 /*
-** initWinInfo().
-*/
+   ** initWinInfo().
+ */
 void
 #ifdef __STDC__
 initWinInfo (
@@ -1122,8 +1122,8 @@ initWinInfo (winInfo)
 
 
 /*
-** allocWinInfo().
-*/
+   ** allocWinInfo().
+ */
 TuiWinInfoPtr
 #ifdef __STDC__
 allocWinInfo (
@@ -1147,9 +1147,9 @@ allocWinInfo (type)
 
 
 /*
-** allocContent().
-**        Allocates the content and elements in a block.
-*/
+   ** allocContent().
+   **        Allocates the content and elements in a block.
+ */
 TuiWinContent
 #ifdef __STDC__
 allocContent (
@@ -1168,10 +1168,10 @@ allocContent (numElements, type)
   if ((content = (TuiWinContent)
   xmalloc (sizeof (TuiWinElementPtr) * numElements)) != (TuiWinContent) NULL)
     {                          /*
-        ** All windows, except the data window, can allocate the elements
-        ** in a chunk.  The data window cannot because items can be
-        ** added/removed from the data display by the user at any time.
-        */
+                                  ** All windows, except the data window, can allocate the elements
+                                  ** in a chunk.  The data window cannot because items can be
+                                  ** added/removed from the data display by the user at any time.
+                                */
       if (type != DATA_WIN)
        {
          if ((elementBlockPtr = (char *)
@@ -1197,13 +1197,13 @@ allocContent (numElements, type)
 
 
 /*
-** addContentElements().
-**        Adds the input number of elements to the windows's content.  If
-**        no content has been allocated yet, allocContent() is called to
-**        do this.  The index of the first element added is returned,
-**        unless there is a memory allocation error, in which case, (-1)
-**        is returned.
-*/
+   ** addContentElements().
+   **        Adds the input number of elements to the windows's content.  If
+   **        no content has been allocated yet, allocContent() is called to
+   **        do this.  The index of the first element added is returned,
+   **        unless there is a memory allocation error, in which case, (-1)
+   **        is returned.
+ */
 int
 #ifdef __STDC__
 addContentElements (
@@ -1236,7 +1236,7 @@ addContentElements (winInfo, numElements)
              initContentElement (elementPtr, winInfo->type);
              winInfo->contentSize++;
            }
-         else                  /* things must be really hosed now! We ran out of memory!?*/
+         else                  /* things must be really hosed now! We ran out of memory!? */
            return (-1);
        }
     }
@@ -1246,10 +1246,10 @@ addContentElements (winInfo, numElements)
 
 
 /*
-**  tuiDelWindow().
-**     Delete all curses windows associated with winInfo, leaving everything
-**     else in tact.
-*/
+   **  tuiDelWindow().
+   **     Delete all curses windows associated with winInfo, leaving everything
+   **     else in tact.
+ */
 void
 #ifdef __STDC__
 tuiDelWindow (
@@ -1311,8 +1311,8 @@ tuiDelWindow (winInfo)
 
 
 /*
-**  freeWindow().
-*/
+   **  freeWindow().
+ */
 void
 #ifdef __STDC__
 freeWindow (
@@ -1385,8 +1385,8 @@ freeWindow (winInfo)
 
 
 /*
-** freeAllSourceWinsContent().
-*/
+   ** freeAllSourceWinsContent().
+ */
 void
 #ifdef __STDC__
 freeAllSourceWinsContent (void)
@@ -1412,8 +1412,8 @@ freeAllSourceWinsContent ()
 
 
 /*
-** freeWinContent().
-*/
+   ** freeWinContent().
+ */
 void
 #ifdef __STDC__
 freeWinContent (
@@ -1437,8 +1437,8 @@ freeWinContent (winInfo)
 
 
 /*
-** freeAllWindows().
-*/
+   ** freeAllWindows().
+ */
 void
 #ifdef __STDC__
 freeAllWindows (void)
@@ -1470,9 +1470,9 @@ tuiDelDataWindows (content, contentSize)
   int i;
 
   /*
-    ** Remember that data window content elements are of type TuiGenWinInfoPtr,
-    ** each of which whose single element is a data element.
-    */
+     ** Remember that data window content elements are of type TuiGenWinInfoPtr,
+     ** each of which whose single element is a data element.
+   */
   for (i = 0; i < contentSize; i++)
     {
       TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow;
@@ -1503,9 +1503,9 @@ freeDataContent (content, contentSize)
   int i;
 
   /*
-    ** Remember that data window content elements are of type TuiGenWinInfoPtr,
-    ** each of which whose single element is a data element.
-    */
+     ** Remember that data window content elements are of type TuiGenWinInfoPtr,
+     ** each of which whose single element is a data element.
+   */
   for (i = 0; i < contentSize; i++)
     {
       TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow;
@@ -1531,8 +1531,8 @@ freeDataContent (content, contentSize)
 
 
 /*
-** freeContent().
-*/
+   ** freeContent().
+ */
 static void
 #ifdef __STDC__
 freeContent (
@@ -1557,8 +1557,8 @@ freeContent (content, contentSize, winType)
 
 
 /*
-** freeContentElements().
-*/
+   ** freeContentElements().
+ */
 static void
 #ifdef __STDC__
 freeContentElements (
@@ -1598,9 +1598,9 @@ freeContentElements (content, contentSize, type)
                      break;
                    case DATA_ITEM_WIN:
                      /*
-                            ** Note that data elements are not allocated
-                            ** in a single block, but individually, as needed.
-                            */
+                        ** Note that data elements are not allocated
+                        ** in a single block, but individually, as needed.
+                      */
                      if (element->whichElement.data.type != TUI_REGISTER)
                        tuiFree ((char *)
                                 element->whichElement.data.name);
index bb4d19c90e2d052979f2ad30b9e3b062deda3f11..dc9c69179cdd7b6627b6d396957ad91bb8b72985 100644 (file)
 #define TUI_GENERAL_SPECIAL_REGS_NAME_LOWER  "$regs"
 
 /* Scroll direction enum */
-typedef enum {
+typedef enum
+  {
     FORWARD_SCROLL,
     BACKWARD_SCROLL,
     LEFT_SCROLL,
     RIGHT_SCROLL
-} TuiScrollDirection, *TuiScrollDirectionPtr;
+  }
+TuiScrollDirection, *TuiScrollDirectionPtr;
 
 
 /* General list struct */
-typedef struct    _TuiList {
-    OpaqueList    list;
-    int            count;
-} TuiList, *TuiListPtr;
+typedef struct _TuiList
+  {
+    OpaqueList list;
+    int count;
+  }
+TuiList, *TuiListPtr;
 
 
 /* The kinds of layouts available */
-typedef enum {
+typedef enum
+  {
     SRC_COMMAND,
     DISASSEM_COMMAND,
     SRC_DISASSEM_COMMAND,
     SRC_DATA_COMMAND,
     DISASSEM_DATA_COMMAND,
     UNDEFINED_LAYOUT
-} TuiLayoutType, *TuiLayoutTypePtr;
+  }
+TuiLayoutType, *TuiLayoutTypePtr;
 
 /* Basic data types that can be displayed in the data window. */
-typedef enum _TuiDataType {
+typedef enum _TuiDataType
+  {
     TUI_REGISTER,
     TUI_SCALAR,
     TUI_COMPLEX,
     TUI_STRUCT
-} TuiDataType, TuiDataTypePtr;
+  }
+TuiDataType, TuiDataTypePtr;
 
 /* Types of register displays */
-typedef enum _TuiRegisterDisplayType {
+typedef enum _TuiRegisterDisplayType
+  {
     TUI_UNDEFINED_REGS,
     TUI_GENERAL_REGS,
     TUI_SFLOAT_REGS,
     TUI_DFLOAT_REGS,
     TUI_SPECIAL_REGS,
     TUI_GENERAL_AND_SPECIAL_REGS
-} TuiRegisterDisplayType, *TuiRegisterDisplayTypePtr;
+  }
+TuiRegisterDisplayType, *TuiRegisterDisplayTypePtr;
 
 /* Structure describing source line or line address */
-typedef union _TuiLineOrAddress {
-    int           lineNo;
-    Opaque        addr;
-} TuiLineOrAddress, *TuiLineOrAddressPtr;
+typedef union _TuiLineOrAddress
+  {
+    int lineNo;
+    Opaque addr;
+  }
+TuiLineOrAddress, *TuiLineOrAddressPtr;
 
 /* Current Layout definition */
-typedef struct _TuiLayoutDef {
-    TuiWinType                 displayMode;
-    int                        split;
-    TuiRegisterDisplayType     regsDisplayType;
-    TuiRegisterDisplayType     floatRegsDisplayType;
-} TuiLayoutDef, *TuiLayoutDefPtr;
+typedef struct _TuiLayoutDef
+  {
+    TuiWinType displayMode;
+    int split;
+    TuiRegisterDisplayType regsDisplayType;
+    TuiRegisterDisplayType floatRegsDisplayType;
+  }
+TuiLayoutDef, *TuiLayoutDefPtr;
 
 /* Elements in the Source/Disassembly Window */
 typedef struct _TuiSourceElement
-{
-    char                *line;
-    TuiLineOrAddress    lineOrAddr;
-    int                 isExecPoint;
-    int                 hasBreak;
-} TuiSourceElement, *TuiSourceElementPtr;
+  {
+    char *line;
+    TuiLineOrAddress lineOrAddr;
+    int isExecPoint;
+    int hasBreak;
+  }
+TuiSourceElement, *TuiSourceElementPtr;
 
 
 /* Elements in the data display window content */
 typedef struct _TuiDataElement
-{
-    char        *name;
-    int         itemNo;    /* the register number, or data display number */
+  {
+    char *name;
+    int itemNo;                        /* the register number, or data display number */
     TuiDataType type;
-    Opaque      value;
-    int         highlight;
-} TuiDataElement, *TuiDataElementPtr;
+    Opaque value;
+    int highlight;
+  }
+TuiDataElement, *TuiDataElementPtr;
 
 
 /* Elements in the command window content */
 typedef struct _TuiCommandElement
-{
-    char    *line;
-} TuiCommandElement, *TuiCommandElementPtr;
+  {
+    char *line;
+  }
+TuiCommandElement, *TuiCommandElementPtr;
 
 
 #define MAX_LOCATOR_ELEMENT_LEN        100
 
 /* Elements in the locator window content */
 typedef struct _TuiLocatorElement
-{
-    char        fileName[MAX_LOCATOR_ELEMENT_LEN];
-    char        procName[MAX_LOCATOR_ELEMENT_LEN];
-    int         lineNo;
-    Opaque      addr;
-} TuiLocatorElement, *TuiLocatorElementPtr;
+  {
+    char fileName[MAX_LOCATOR_ELEMENT_LEN];
+    char procName[MAX_LOCATOR_ELEMENT_LEN];
+    int lineNo;
+    Opaque addr;
+  }
+TuiLocatorElement, *TuiLocatorElementPtr;
 
 
 /* An content element in a window */
 typedef union
-{
-    TuiSourceElement       source; /* the source elements */
-    TuiGenWinInfo          dataWindow; /* data display elements */
-    TuiDataElement         data; /* elements of dataWindow */
-    TuiCommandElement      command; /* command elements */
-    TuiLocatorElement      locator; /* locator elements */
-    char                   *simpleString; /* simple char based elements */
-} TuiWhichElement, *TuiWhichElementPtr;
+  {
+    TuiSourceElement source;   /* the source elements */
+    TuiGenWinInfo dataWindow;  /* data display elements */
+    TuiDataElement data;       /* elements of dataWindow */
+    TuiCommandElement command; /* command elements */
+    TuiLocatorElement locator; /* locator elements */
+    char *simpleString;                /* simple char based elements */
+  }
+TuiWhichElement, *TuiWhichElementPtr;
 
 typedef struct _TuiWinElement
-{
-    int            highlight;
+  {
+    int highlight;
     TuiWhichElement whichElement;
-} TuiWinElement, *TuiWinElementPtr;
+  }
+TuiWinElement, *TuiWinElementPtr;
 
 
 /* This describes the content of the window. */
-typedef        TuiWinElementPtr    *TuiWinContent;
+typedef TuiWinElementPtr *TuiWinContent;
 
 
 /* This struct defines the specific information about a data display window */
-typedef struct _TuiDataInfo {
-    TuiWinContent            dataContent; /* start of data display content */
-    int                      dataContentCount;
-    TuiWinContent            regsContent; /* start of regs display content */
-    int                      regsContentCount;
-    TuiRegisterDisplayType   regsDisplayType;
-    int                      regsColumnCount;
-    int                      displayRegs; /* Should regs be displayed at all? */
-} TuiDataInfo, *TuiDataInfoPtr;
-
-
-typedef struct _TuiSourceInfo {
-    int                 hasLocator; /* Does locator belongs to this window? */
-    TuiGenWinInfoPtr    executionInfo; /* execution information window */
-    int                 horizontalOffset; /* used for horizontal scroll */
-    TuiLineOrAddress    startLineOrAddr;
-} TuiSourceInfo, *TuiSourceInfoPtr;
-
-
-typedef struct _TuiCommandInfo {
-    int            curLine;   /* The current line position */
-    int            curch;     /* The current cursor position */
-} TuiCommandInfo, *TuiCommandInfoPtr;
+typedef struct _TuiDataInfo
+  {
+    TuiWinContent dataContent; /* start of data display content */
+    int dataContentCount;
+    TuiWinContent regsContent; /* start of regs display content */
+    int regsContentCount;
+    TuiRegisterDisplayType regsDisplayType;
+    int regsColumnCount;
+    int displayRegs;           /* Should regs be displayed at all? */
+  }
+TuiDataInfo, *TuiDataInfoPtr;
+
+
+typedef struct _TuiSourceInfo
+  {
+    int hasLocator;            /* Does locator belongs to this window? */
+    TuiGenWinInfoPtr executionInfo;    /* execution information window */
+    int horizontalOffset;      /* used for horizontal scroll */
+    TuiLineOrAddress startLineOrAddr;
+  }
+TuiSourceInfo, *TuiSourceInfoPtr;
+
+
+typedef struct _TuiCommandInfo
+  {
+    int curLine;               /* The current line position */
+    int curch;                 /* The current cursor position */
+  }
+TuiCommandInfo, *TuiCommandInfoPtr;
 
 
 /* This defines information about each logical window */
-typedef struct _TuiWinInfo {
-    TuiGenWinInfo            generic;        /* general window information */
-    union {
-        TuiSourceInfo        sourceInfo;
-        TuiDataInfo          dataDisplayInfo;
-        TuiCommandInfo       commandInfo;
-        Opaque               opaque;
-    } detail;
-    int                 canHighlight; /* Can this window ever be highlighted? */
-    int                 isHighlighted; /* Is this window highlighted? */
-} TuiWinInfo, *TuiWinInfoPtr;
+typedef struct _TuiWinInfo
+  {
+    TuiGenWinInfo generic;     /* general window information */
+    union
+      {
+       TuiSourceInfo sourceInfo;
+       TuiDataInfo dataDisplayInfo;
+       TuiCommandInfo commandInfo;
+       Opaque opaque;
+      }
+    detail;
+    int canHighlight;          /* Can this window ever be highlighted? */
+    int isHighlighted;         /* Is this window highlighted? */
+  }
+TuiWinInfo, *TuiWinInfoPtr;
 
 /* MACROS (prefixed with m_) */
 
@@ -229,8 +259,8 @@ typedef struct _TuiWinInfo {
 
 
 /* Global Data */
-extern TuiWinInfoPtr      winList[MAX_MAJOR_WINDOWS];
-extern int                tui_version;
+extern TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS];
+extern int tui_version;
 
 /* Macros */
 #define srcWin            winList[SRC_WIN]
@@ -239,64 +269,64 @@ extern int                tui_version;
 #define cmdWin            winList[CMD_WIN]
 
 /* Data Manipulation Functions */
-extern void               initializeStaticData PARAMS ((void));
-extern TuiGenWinInfoPtr   allocGenericWinInfo PARAMS ((void));
-extern TuiWinInfoPtr      allocWinInfo PARAMS ((TuiWinType));
-extern void               initGenericPart PARAMS ((TuiGenWinInfoPtr));
-extern void               initWinInfo PARAMS ((TuiWinInfoPtr));
-extern TuiWinContent      allocContent PARAMS ((int, TuiWinType));
-extern int                addContentElements 
-                             PARAMS ((TuiGenWinInfoPtr, int));
-extern void               initContentElement 
-                             PARAMS ((TuiWinElementPtr, TuiWinType));
-extern void               freeWindow PARAMS ((TuiWinInfoPtr));
-extern void               freeAllWindows PARAMS ((void));
-extern void               freeWinContent PARAMS ((TuiGenWinInfoPtr));
-extern void               freeDataContent PARAMS ((TuiWinContent, int));
-extern void               freeAllSourceWinsContent PARAMS ((void));
-extern void               tuiDelWindow PARAMS ((TuiWinInfoPtr));
-extern void               tuiDelDataWindows PARAMS ((TuiWinContent, int));
-extern TuiWinInfoPtr      winByName PARAMS ((char *));
-extern TuiWinInfoPtr      partialWinByName PARAMS ((char *));
-extern char               *winName PARAMS ((TuiGenWinInfoPtr));
-extern char               *displayableWinContentOf 
-                             PARAMS ((TuiGenWinInfoPtr, TuiWinElementPtr));
-extern char               *displayableWinContentAt 
-                             PARAMS ((TuiGenWinInfoPtr, int));
-extern int                winElementHeight 
-                             PARAMS ((TuiGenWinInfoPtr, TuiWinElementPtr));
-extern TuiLayoutType      currentLayout PARAMS ((void));
-extern void               setCurrentLayoutTo PARAMS ((TuiLayoutType));
-extern int                termHeight PARAMS ((void));
-extern void               setTermHeight PARAMS ((int));
-extern int                termWidth PARAMS ((void));
-extern void               setTermWidth PARAMS ((int));
-extern int                historyLimit PARAMS ((void));
-extern void               setHistoryLimit PARAMS ((int));
-extern void               setGenWinOrigin PARAMS ((TuiGenWinInfoPtr, int, int));
-extern TuiGenWinInfoPtr   locatorWinInfoPtr PARAMS ((void));
-extern TuiGenWinInfoPtr   sourceExecInfoWinPtr PARAMS ((void));
-extern TuiGenWinInfoPtr   disassemExecInfoWinPtr PARAMS ((void));
-extern char               *nullStr PARAMS ((void));
-extern char               *blankStr PARAMS ((void));
-extern char               *locationStr PARAMS ((void));
-extern char               *breakStr PARAMS ((void));
-extern char               *breakLocationStr PARAMS ((void));
-extern TuiListPtr         sourceWindows PARAMS ((void));
-extern void               clearSourceWindows PARAMS ((void));
-extern void               clearSourceWindowsDetail PARAMS ((void));
-extern void               clearWinDetail PARAMS ((TuiWinInfoPtr   winInfo));
-extern void               tuiAddToSourceWindows PARAMS ((TuiWinInfoPtr));
-extern int                tuiDefaultTabLen PARAMS ((void));
-extern void               tuiSetDefaultTabLen PARAMS ((int));
-extern TuiWinInfoPtr      tuiWinWithFocus PARAMS ((void));
-extern void               tuiSetWinWithFocus PARAMS ((TuiWinInfoPtr));
-extern TuiLayoutDefPtr    tuiLayoutDef PARAMS ((void));
-extern int                tuiWinResized PARAMS ((void));
-extern void               tuiSetWinResizedTo PARAMS ((int));
-
-extern TuiWinInfoPtr      tuiNextWin PARAMS ((TuiWinInfoPtr));
-extern TuiWinInfoPtr      tuiPrevWin PARAMS ((TuiWinInfoPtr));
+extern void initializeStaticData PARAMS ((void));
+extern TuiGenWinInfoPtr allocGenericWinInfo PARAMS ((void));
+extern TuiWinInfoPtr allocWinInfo PARAMS ((TuiWinType));
+extern void initGenericPart PARAMS ((TuiGenWinInfoPtr));
+extern void initWinInfo PARAMS ((TuiWinInfoPtr));
+extern TuiWinContent allocContent PARAMS ((int, TuiWinType));
+extern int addContentElements
+  PARAMS ((TuiGenWinInfoPtr, int));
+extern void initContentElement
+  PARAMS ((TuiWinElementPtr, TuiWinType));
+extern void freeWindow PARAMS ((TuiWinInfoPtr));
+extern void freeAllWindows PARAMS ((void));
+extern void freeWinContent PARAMS ((TuiGenWinInfoPtr));
+extern void freeDataContent PARAMS ((TuiWinContent, int));
+extern void freeAllSourceWinsContent PARAMS ((void));
+extern void tuiDelWindow PARAMS ((TuiWinInfoPtr));
+extern void tuiDelDataWindows PARAMS ((TuiWinContent, int));
+extern TuiWinInfoPtr winByName PARAMS ((char *));
+extern TuiWinInfoPtr partialWinByName PARAMS ((char *));
+extern char *winName PARAMS ((TuiGenWinInfoPtr));
+extern char *displayableWinContentOf
+  PARAMS ((TuiGenWinInfoPtr, TuiWinElementPtr));
+extern char *displayableWinContentAt
+  PARAMS ((TuiGenWinInfoPtr, int));
+extern int winElementHeight
+  PARAMS ((TuiGenWinInfoPtr, TuiWinElementPtr));
+extern TuiLayoutType currentLayout PARAMS ((void));
+extern void setCurrentLayoutTo PARAMS ((TuiLayoutType));
+extern int termHeight PARAMS ((void));
+extern void setTermHeight PARAMS ((int));
+extern int termWidth PARAMS ((void));
+extern void setTermWidth PARAMS ((int));
+extern int historyLimit PARAMS ((void));
+extern void setHistoryLimit PARAMS ((int));
+extern void setGenWinOrigin PARAMS ((TuiGenWinInfoPtr, int, int));
+extern TuiGenWinInfoPtr locatorWinInfoPtr PARAMS ((void));
+extern TuiGenWinInfoPtr sourceExecInfoWinPtr PARAMS ((void));
+extern TuiGenWinInfoPtr disassemExecInfoWinPtr PARAMS ((void));
+extern char *nullStr PARAMS ((void));
+extern char *blankStr PARAMS ((void));
+extern char *locationStr PARAMS ((void));
+extern char *breakStr PARAMS ((void));
+extern char *breakLocationStr PARAMS ((void));
+extern TuiListPtr sourceWindows PARAMS ((void));
+extern void clearSourceWindows PARAMS ((void));
+extern void clearSourceWindowsDetail PARAMS ((void));
+extern void clearWinDetail PARAMS ((TuiWinInfoPtr winInfo));
+extern void tuiAddToSourceWindows PARAMS ((TuiWinInfoPtr));
+extern int tuiDefaultTabLen PARAMS ((void));
+extern void tuiSetDefaultTabLen PARAMS ((int));
+extern TuiWinInfoPtr tuiWinWithFocus PARAMS ((void));
+extern void tuiSetWinWithFocus PARAMS ((TuiWinInfoPtr));
+extern TuiLayoutDefPtr tuiLayoutDef PARAMS ((void));
+extern int tuiWinResized PARAMS ((void));
+extern void tuiSetWinResizedTo PARAMS ((int));
+
+extern TuiWinInfoPtr tuiNextWin PARAMS ((TuiWinInfoPtr));
+extern TuiWinInfoPtr tuiPrevWin PARAMS ((TuiWinInfoPtr));
 
 
 #endif /* TUI_DATA_H */
index 522730ae2fddc0f42b5f75a0ac3bc4f12e023087..af09627733e306c29decee31e454120ba6979c99 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tuiDataWin.c
-**   This module contains functions to support the data/register window display.
-*/
+   ** tuiDataWin.c
+   **   This module contains functions to support the data/register window display.
+ */
 
 
 #include "defs.h"
 
 
 /*
-** tuiFirstDataItemDisplayed()
-**    Answer the index first element displayed.
-**    If none are displayed, then return (-1).
-*/
+   ** tuiFirstDataItemDisplayed()
+   **    Answer the index first element displayed.
+   **    If none are displayed, then return (-1).
+ */
 int
 #ifdef __STDC__
 tuiFirstDataItemDisplayed (void)
@@ -51,10 +51,10 @@ tuiFirstDataItemDisplayed ()
 
 
 /*
-** tuiFirstDataElementNoInLine()
-**        Answer the index of the first element in lineNo.  If lineNo is
-**        past the data area (-1) is returned.
-*/
+   ** tuiFirstDataElementNoInLine()
+   **        Answer the index of the first element in lineNo.  If lineNo is
+   **        past the data area (-1) is returned.
+ */
 int
 #ifdef __STDC__
 tuiFirstDataElementNoInLine (
@@ -67,13 +67,13 @@ tuiFirstDataElementNoInLine (lineNo)
   int firstElementNo = (-1);
 
   /*
-    ** First see if there is a register on lineNo, and if so, set the
-    ** first element number
-    */
+     ** First see if there is a register on lineNo, and if so, set the
+     ** first element number
+   */
   if ((firstElementNo = tuiFirstRegElementNoInLine (lineNo)) == -1)
     {                          /*
-      ** Looking at the general data, the 1st element on lineNo
-      */
+                                  ** Looking at the general data, the 1st element on lineNo
+                                */
     }
 
   return firstElementNo;
@@ -81,10 +81,10 @@ tuiFirstDataElementNoInLine (lineNo)
 
 
 /*
-** tuiDeleteDataContentWindows()
-**        Function to delete all the item windows in the data window.
-**        This is usually done when the data window is scrolled.
-*/
+   ** tuiDeleteDataContentWindows()
+   **        Function to delete all the item windows in the data window.
+   **        This is usually done when the data window is scrolled.
+ */
 void
 #ifdef __STDC__
 tuiDeleteDataContentWindows (void)
@@ -140,10 +140,10 @@ tuiEraseDataContent (prompt)
 
 
 /*
-** tuiDisplayAllData().
-**        This function displays the data that is in the data window's
-**        content.  It does not set the content.
-*/
+   ** tuiDisplayAllData().
+   **        This function displays the data that is in the data window's
+   **        content.  It does not set the content.
+ */
 void
 #ifdef __STDC__
 tuiDisplayAllData (void)
@@ -160,8 +160,8 @@ tuiDisplayAllData ()
       checkAndDisplayHighlightIfNeeded (dataWin);
       tuiDisplayRegistersFrom (0);
       /*
-        ** Then display the other data
-        */
+         ** Then display the other data
+       */
       if (dataWin->detail.dataDisplayInfo.dataContent !=
          (TuiWinContent) NULL &&
          dataWin->detail.dataDisplayInfo.dataContentCount > 0)
@@ -173,10 +173,10 @@ tuiDisplayAllData ()
 
 
 /*
-** tuiDisplayDataFromLine()
-**        Function to display the data starting at line, lineNo, in the
-**        data window.
-*/
+   ** tuiDisplayDataFromLine()
+   **        Function to display the data starting at line, lineNo, in the
+   **        data window.
+ */
 void
 #ifdef __STDC__
 tuiDisplayDataFromLine (
@@ -205,20 +205,20 @@ tuiDisplayDataFromLine (lineNo)
       /* display regs if we can */
       if (tuiDisplayRegistersFromLine (_lineNo, FALSE) < 0)
        {                       /*
-            ** _lineNo is past the regs display, so calc where the
-            ** start data element is
-            */
+                                  ** _lineNo is past the regs display, so calc where the
+                                  ** start data element is
+                                */
          if (regsLastLine < _lineNo)
            {                   /* figure out how many lines each element is to obtain
-                    the start elementNo */
+                                  the start elementNo */
            }
        }
       else
        {                       /*
-           ** calculate the starting element of the data display, given
-           ** regsLastLine and how many lines each element is, up to
-           ** _lineNo
-           */
+                                  ** calculate the starting element of the data display, given
+                                  ** regsLastLine and how many lines each element is, up to
+                                  ** _lineNo
+                                */
        }
       /* Now display the data , starting at elementNo */
     }
@@ -228,9 +228,9 @@ tuiDisplayDataFromLine (lineNo)
 
 
 /*
-** tuiDisplayDataFrom()
-**        Display data starting at element elementNo
-*/
+   ** tuiDisplayDataFrom()
+   **        Display data starting at element elementNo
+ */
 void
 #ifdef __STDC__
 tuiDisplayDataFrom (
@@ -263,9 +263,9 @@ tuiDisplayDataFrom (elementNo, reuseWindows)
 
 
 /*
-** tuiRefreshDataWin()
-**        Function to redisplay the contents of the data window.
-*/
+   ** tuiRefreshDataWin()
+   **        Function to redisplay the contents of the data window.
+ */
 void
 #ifdef __STDC__
 tuiRefreshDataWin (void)
@@ -287,9 +287,9 @@ tuiRefreshDataWin ()
 
 
 /*
-** tuiCheckDataValues().
-**        Function to check the data values and hilite any that have changed
-*/
+   ** tuiCheckDataValues().
+   **        Function to check the data values and hilite any that have changed
+ */
 void
 #ifdef __STDC__
 tuiCheckDataValues (
@@ -330,10 +330,10 @@ tuiCheckDataValues (frame)
 
 
 /*
-** tui_vCheckDataValues().
-**        Function to check the data values and hilite any that have
-**        changed with args in a va_list
-*/
+   ** tui_vCheckDataValues().
+   **        Function to check the data values and hilite any that have
+   **        changed with args in a va_list
+ */
 void
 #ifdef __STDC__
 tui_vCheckDataValues (
@@ -352,9 +352,9 @@ tui_vCheckDataValues (args)
 
 
 /*
-** tuiVerticalDataScroll()
-**        Scroll the data window vertically forward or backward.
-*/
+   ** tuiVerticalDataScroll()
+   **        Scroll the data window vertically forward or backward.
+ */
 void
 #ifdef __STDC__
 tuiVerticalDataScroll (
@@ -374,8 +374,8 @@ tuiVerticalDataScroll (scrollDirection, numToScroll)
     firstLine = tuiLineFromRegElementNo (firstElementNo);
   else
     {                          /* calculate the first line from the element number which is in
-        ** the general data content
-        */
+                                  ** the general data content
+                                */
     }
 
   if (firstLine >= 0)
index 8f9e46d80e7eecd779a01cb1cd700e471d86d6b9..91ba9ec1b2ad6cfc3f360fb8a18d8221b101f8b3 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_DATAWIN_H
 #define _TUI_DATAWIN_H
 /*
-** This header file supports the display of registers/data in the data window.
-*/
+   ** This header file supports the display of registers/data in the data window.
+ */
 
 
 /*****************************************
 /*****************************************
 ** PUBLIC FUNCTION EXTERNAL DECLS        **
 ******************************************/
-extern void     tuiEraseDataContent PARAMS ((char *));
-extern void     tuiDisplayAllData PARAMS ((void));
-extern void     tuiCheckDataValues PARAMS ((struct frame_info *));
-extern void     tui_vCheckDataValues PARAMS ((va_list));
-extern void     tuiDisplayDataFromLine PARAMS ((int));
-extern int      tuiFirstDataItemDisplayed PARAMS ((void));
-extern int      tuiFirstDataElementNoInLine PARAMS ((int));
-extern void     tuiDeleteDataContentWindows PARAMS ((void));
-extern void     tuiRefreshDataWin PARAMS ((void));
-extern void     tuiDisplayDataFrom PARAMS ((int, int));
-extern void     tuiVerticalDataScroll PARAMS ((TuiScrollDirection, int));
+extern void tuiEraseDataContent PARAMS ((char *));
+extern void tuiDisplayAllData PARAMS ((void));
+extern void tuiCheckDataValues PARAMS ((struct frame_info *));
+extern void tui_vCheckDataValues PARAMS ((va_list));
+extern void tuiDisplayDataFromLine PARAMS ((int));
+extern int tuiFirstDataItemDisplayed PARAMS ((void));
+extern int tuiFirstDataElementNoInLine PARAMS ((int));
+extern void tuiDeleteDataContentWindows PARAMS ((void));
+extern void tuiRefreshDataWin PARAMS ((void));
+extern void tuiDisplayDataFrom PARAMS ((int, int));
+extern void tuiVerticalDataScroll PARAMS ((TuiScrollDirection, int));
 
-#endif /*_TUI_DATAWIN_H*/
+#endif
+/*_TUI_DATAWIN_H*/
index ad0b70f655dfeaf4fc1941bc37ff5b68725351dc..1bc1b95f9195700ff9557a91a31973f125a6843a 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tuiDisassem.c
-**         This module contains functions for handling disassembly display.
-*/
+   ** tuiDisassem.c
+   **         This module contains functions for handling disassembly display.
+ */
 
 
 #include "defs.h"
@@ -28,16 +28,16 @@ static struct breakpoint *_hasBreak PARAMS ((CORE_ADDR));
 ******************************************/
 
 /*
-** tuiSetDisassemContent().
-**        Function to set the disassembly window's content.
-*/
+   ** tuiSetDisassemContent().
+   **        Function to set the disassembly window's content.
+ */
 TuiStatus
 #ifdef __STDC__
 tuiSetDisassemContent (
-                      struct symtab *s,
-                      Opaque startAddr)
+                       struct symtab *s,
+                       Opaque startAddr)
 #else
-     tuiSetDisassemContent (s, startAddr)
+tuiSetDisassemContent (s, startAddr)
      struct symtab *s;
      Opaque startAddr;
 #endif
@@ -66,7 +66,7 @@ tuiSetDisassemContent (
          threshold = (lineWidth - 1) + offset;
 
          /* now init the gdb_file structure */
-          gdb_dis_out = gdb_file_init_astring (threshold);
+         gdb_dis_out = gdb_file_init_astring (threshold);
 
          INIT_DISASSEMBLE_INFO_NO_ARCH (asmInfo, gdb_dis_out, (fprintf_ftype) fprintf_filtered);
          asmInfo.read_memory_func = dis_asm_read_memory;
@@ -77,7 +77,7 @@ tuiSetDisassemContent (
          /* Now construct each line */
          for (curLine = 0, pc = (CORE_ADDR) startAddr; (curLine < maxLines);)
            {
-             TuiWinElementPtr element = (TuiWinElementPtr)disassemWin->generic.content[curLine];
+             TuiWinElementPtr element = (TuiWinElementPtr) disassemWin->generic.content[curLine];
              struct breakpoint *bp;
 
              print_address (pc, gdb_dis_out);
@@ -85,9 +85,9 @@ tuiSetDisassemContent (
              curLen = strlen (gdb_file_get_strbuf (gdb_dis_out));
              i = curLen - ((curLen / tab_len) * tab_len);
 
-              /* adjust buffer length if necessary */
-             gdb_file_adjust_strbuf ((tab_len - i > 0) ? (tab_len - i ) : 0, gdb_dis_out);
-               
+             /* adjust buffer length if necessary */
+             gdb_file_adjust_strbuf ((tab_len - i > 0) ? (tab_len - i) : 0, gdb_dis_out);
+
              /* Add spaces to make the instructions start onthe same column */
              while (i < tab_len)
                {
@@ -107,7 +107,7 @@ tuiSetDisassemContent (
                element->whichElement.source.line[0] = '\0';
              element->whichElement.source.lineOrAddr.addr = (Opaque) pc;
              element->whichElement.source.isExecPoint =
-               (pc == (CORE_ADDR) ((TuiWinElementPtr)locator->content[0])->whichElement.locator.addr);
+               (pc == (CORE_ADDR) ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr);
              bp = _hasBreak (pc);
              element->whichElement.source.hasBreak =
                (bp != (struct breakpoint *) NULL &&
@@ -115,7 +115,7 @@ tuiSetDisassemContent (
                  (bp->disposition != del || bp->hit_count <= 0)));
              curLine++;
              pc = newpc;
-              /* reset the buffer to empty */
+             /* reset the buffer to empty */
              gdb_file_get_strbuf (gdb_dis_out)[0] = '\0';
            }
          gdb_file_deallocate (&gdb_dis_out);
@@ -129,9 +129,9 @@ tuiSetDisassemContent (
 
 
 /*
-** tuiShowDisassem().
-**        Function to display the disassembly window with disassembled code.
-*/
+   ** tuiShowDisassem().
+   **        Function to display the disassembly window with disassembled code.
+ */
 void
 #ifdef __STDC__
 tuiShowDisassem (
@@ -147,9 +147,9 @@ tuiShowDisassem (startAddr)
   tuiAddWinToLayout (DISASSEM_WIN);
   tuiUpdateSourceWindow (disassemWin, s, startAddr, FALSE);
   /*
-    ** if the focus was in the src win, put it in the asm win, if the
-    ** source view isn't split
-    */
+     ** if the focus was in the src win, put it in the asm win, if the
+     ** source view isn't split
+   */
   if (currentLayout () != SRC_DISASSEM_COMMAND && winWithFocus == srcWin)
     tuiSetWinFocusTo (disassemWin);
 
@@ -158,9 +158,9 @@ tuiShowDisassem (startAddr)
 
 
 /*
-** tuiShowDisassemAndUpdateSource().
-**        Function to display the disassembly window.
-*/
+   ** tuiShowDisassemAndUpdateSource().
+   **        Function to display the disassembly window.
+ */
 void
 #ifdef __STDC__
 tuiShowDisassemAndUpdateSource (
@@ -177,9 +177,9 @@ tuiShowDisassemAndUpdateSource (startAddr)
     {
       TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
       /*
-        ** Update what is in the source window if it is displayed too,
-        ** note that it follows what is in the disassembly window and visa-versa
-        */
+         ** Update what is in the source window if it is displayed too,
+         ** note that it follows what is in the disassembly window and visa-versa
+       */
       sal = find_pc_line ((CORE_ADDR) startAddr, 0);
       current_source_symtab = sal.symtab;
       tuiUpdateSourceWindow (srcWin, sal.symtab, (Opaque) sal.line, TRUE);
@@ -191,10 +191,10 @@ tuiShowDisassemAndUpdateSource (startAddr)
 
 
 /*
-** tuiShowDisassemAsIs().
-**        Function to display the disassembly window.  This function shows
-**        the disassembly as specified by the horizontal offset.
-*/
+   ** tuiShowDisassemAsIs().
+   **        Function to display the disassembly window.  This function shows
+   **        the disassembly as specified by the horizontal offset.
+ */
 void
 #ifdef __STDC__
 tuiShowDisassemAsIs (
@@ -207,9 +207,9 @@ tuiShowDisassemAsIs (addr)
   tuiAddWinToLayout (DISASSEM_WIN);
   tuiUpdateSourceWindowAsIs (disassemWin, (struct symtab *) NULL, addr, FALSE);
   /*
-    ** Update what is in the source window if it is displayed too, not that it
-    ** follows what is in the disassembly window and visa-versa
-    */
+     ** Update what is in the source window if it is displayed too, not that it
+     ** follows what is in the disassembly window and visa-versa
+   */
   if (currentLayout () == SRC_DISASSEM_COMMAND)
     tuiShowSourceContent (srcWin);     /*????  Need to do more? */
 
@@ -218,8 +218,8 @@ tuiShowDisassemAsIs (addr)
 
 
 /*
-** tuiGetBeginAsmAddress().
-*/
+   ** tuiGetBeginAsmAddress().
+ */
 Opaque
 #ifdef __STDC__
 tuiGetBeginAsmAddress (void)
@@ -236,7 +236,7 @@ tuiGetBeginAsmAddress ()
 
   if (element->addr == (Opaque) 0)
     {
-      /*the target is not executing, because the pc is 0*/
+      /*the target is not executing, because the pc is 0 */
 
       addr = (Opaque) parse_and_eval_address ("main");
 
@@ -252,9 +252,9 @@ tuiGetBeginAsmAddress ()
 
 
 /*
-** tuiVerticalDisassemScroll().
-**      Scroll the disassembly forward or backward vertically
-*/
+   ** tuiVerticalDisassemScroll().
+   **      Scroll the disassembly forward or backward vertically
+ */
 void
 #ifdef __STDC__
 tuiVerticalDisassemScroll (
@@ -314,10 +314,10 @@ tuiVerticalDisassemScroll (scrollDirection, numToScroll)
 ** STATIC LOCAL FUNCTIONS                 **
 ******************************************/
 /*
-** _hasBreak().
-**      Answer whether there is a break point at the input line in the
-**      source file indicated
-*/
+   ** _hasBreak().
+   **      Answer whether there is a break point at the input line in the
+   **      source file indicated
+ */
 static struct breakpoint *
 #ifdef __STDC__
 _hasBreak (
index 711ac48587d28000ac76f331aefea6c0cfb6e057..404b2f44fa2e24473a6584c009309ead8fefcf52 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_DISASSEM_H
 #define _TUI_DISASSEM_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
 /*****************************************
 ** TYPE DEFINITIONS                        **
 /*****************************************
 ** PUBLIC FUNCTION EXTERNAL DECLS        **
 ******************************************/
-extern TuiStatus        tuiSetDisassemContent PARAMS ((struct symtab *, Opaque));
-extern void             tuiShowDisassem PARAMS ((Opaque));
-extern void             tuiShowDisassemAndUpdateSource PARAMS ((Opaque));
-extern void             tuiVerticalDisassemScroll PARAMS ((TuiScrollDirection, int));
-extern Opaque           tuiGetBeginAsmAddress PARAMS ((void));
+extern TuiStatus tuiSetDisassemContent PARAMS ((struct symtab *, Opaque));
+extern void tuiShowDisassem PARAMS ((Opaque));
+extern void tuiShowDisassemAndUpdateSource PARAMS ((Opaque));
+extern void tuiVerticalDisassemScroll PARAMS ((TuiScrollDirection, int));
+extern Opaque tuiGetBeginAsmAddress PARAMS ((void));
 
-#endif /*_TUI_DISASSEM_H*/
+#endif
+/*_TUI_DISASSEM_H*/
index 5af0cd7a92e8277887e1b08a34b27a7d46b8ff35..b1caf690f7575bbbbab4f7322687a2ee886542d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** TuiGeneralWin.c
-** This module supports general window behavior
-*/
+   ** TuiGeneralWin.c
+   ** This module supports general window behavior
+ */
 
 #include <curses.h>
 #include "defs.h"
@@ -11,8 +11,8 @@
 
 
 /*
-** local support functions
-*/
+   ** local support functions
+ */
 static void _winResize PARAMS ((void));
 
 
@@ -20,9 +20,9 @@ static void _winResize PARAMS ((void));
 ** PUBLIC FUNCTIONS
 ***********************/
 /*
-** tuiRefreshWin()
-**        Refresh the window
-*/
+   ** tuiRefreshWin()
+   **        Refresh the window
+ */
 void
 #ifdef __STDC__
 tuiRefreshWin (
@@ -62,9 +62,9 @@ tuiRefreshWin (winInfo)
 
 
 /*
-** tuiDelwin()
-**        Function to delete the curses window, checking for null
-*/
+   ** tuiDelwin()
+   **        Function to delete the curses window, checking for null
+ */
 void
 #ifdef __STDC__
 tuiDelwin (
@@ -82,8 +82,8 @@ tuiDelwin (window)
 
 
 /*
-** boxWin().
-*/
+   ** boxWin().
+ */
 void
 #ifdef __STDC__
 boxWin (
@@ -101,9 +101,9 @@ boxWin (winInfo, highlightFlag)
        box (winInfo->handle, '|', '-');
       else
        {
-/*            wattron(winInfo->handle, A_DIM);*/
+/*            wattron(winInfo->handle, A_DIM); */
          box (winInfo->handle, ':', '.');
-/*            wattroff(winInfo->handle, A_DIM);*/
+/*            wattroff(winInfo->handle, A_DIM); */
        }
     }
 
@@ -112,8 +112,8 @@ boxWin (winInfo, highlightFlag)
 
 
 /*
-** unhighlightWin().
-*/
+   ** unhighlightWin().
+ */
 void
 #ifdef __STDC__
 unhighlightWin (
@@ -133,8 +133,8 @@ unhighlightWin (winInfo)
 
 
 /*
-** highlightWin().
-*/
+   ** highlightWin().
+ */
 void
 #ifdef __STDC__
 highlightWin (
@@ -155,8 +155,8 @@ highlightWin (winInfo)
 
 
 /*
-** checkAndDisplayHighlightIfNecessay
-*/
+   ** checkAndDisplayHighlightIfNecessay
+ */
 void
 #ifdef __STDC__
 checkAndDisplayHighlightIfNeeded (
@@ -179,8 +179,8 @@ checkAndDisplayHighlightIfNeeded (winInfo)
 
 
 /*
-** makeWindow().
-*/
+   ** makeWindow().
+ */
 void
 #ifdef __STDC__
 makeWindow (
@@ -215,7 +215,7 @@ makeWindow (winInfo, boxIt)
          mvwaddstr (handle, 1, 1, winName (winInfo));
          tuiRefreshWin (winInfo);
        }
-#endif /*FOR_TEST*/
+#endif /*FOR_TEST */
     }
 
   return;
@@ -223,9 +223,9 @@ makeWindow (winInfo, boxIt)
 
 
 /*
-** tuiClearWin().
-**        Clear the window of all contents without calling wclear.
-*/
+   ** tuiClearWin().
+   **        Clear the window of all contents without calling wclear.
+ */
 void
 #ifdef __STDC__
 tuiClearWin (
@@ -251,11 +251,11 @@ tuiClearWin (winInfo)
 
 
 /*
-** makeVisible().
-**        We can't really make windows visible, or invisible.  So we
-**        have to delete the entire window when making it visible,
-**        and create it again when making it visible.
-*/
+   ** makeVisible().
+   **        We can't really make windows visible, or invisible.  So we
+   **        have to delete the entire window when making it visible,
+   **        and create it again when making it visible.
+ */
 void
 #ifdef __STDC__
 makeVisible (
@@ -296,9 +296,9 @@ makeVisible (winInfo, visible)
 
 
 /*
-** makeAllVisible().
-**        Makes all windows invisible (except the command and locator windows)
-*/
+   ** makeAllVisible().
+   **        Makes all windows invisible (except the command and locator windows)
+ */
 void
 #ifdef __STDC__
 makeAllVisible (
@@ -327,8 +327,8 @@ makeAllVisible (visible)
 
 
 /*
-** scrollWinForward
-*/
+   ** scrollWinForward
+ */
 void
 #ifdef __STDC__
 scrollWinForward (
@@ -377,8 +377,8 @@ scrollWinForward (winInfo, numLines)
 
 
 /*
-** scrollWinBackward
-*/
+   ** scrollWinBackward
+ */
 void
 #ifdef __STDC__
 scrollWinBackward (
@@ -426,9 +426,9 @@ scrollWinBackward (winInfo, numLines)
 
 
 /*
-** refreshAll().
-**        Function to refresh all the windows currently displayed
-*/
+   ** refreshAll().
+   **        Function to refresh all the windows currently displayed
+ */
 void
 #ifdef __STDC__
 refreshAll (
index 559f8ab33398c4ff63eb99aacb9261885162eb9d..2c843ef9269e14fe1f05b3b6918e1736462a4d69 100644 (file)
@@ -2,30 +2,30 @@
 #define TUI_GENERAL_WIN_H
 
 /*
-** Functions
-*/
-extern void             tuiClearWin PARAMS ((TuiGenWinInfoPtr));
-extern void             unhighlightWin PARAMS ((TuiWinInfoPtr));
-extern void             makeVisible PARAMS ((TuiGenWinInfoPtr, int));
-extern void             makeAllVisible PARAMS ((int));
-extern void             scrollWinForward PARAMS ((TuiGenWinInfoPtr, int));
-extern void             scrollWinBackward PARAMS ((TuiGenWinInfoPtr, int));
-extern void             makeWindow PARAMS ((TuiGenWinInfoPtr, int));
-extern TuiWinInfoPtr    copyWin PARAMS ((TuiWinInfoPtr));
-extern void             boxWin PARAMS ((TuiGenWinInfoPtr, int));
-extern void             highlightWin PARAMS ((TuiWinInfoPtr));
-extern void             checkAndDisplayHighlightIfNeeded PARAMS ((TuiWinInfoPtr));
-extern void             refreshAll PARAMS ((TuiWinInfoPtr *));
-extern void             tuiDelwin PARAMS ((WINDOW  *window));
-extern void             tuiRefreshWin PARAMS ((TuiGenWinInfoPtr));
+   ** Functions
+ */
+extern void tuiClearWin PARAMS ((TuiGenWinInfoPtr));
+extern void unhighlightWin PARAMS ((TuiWinInfoPtr));
+extern void makeVisible PARAMS ((TuiGenWinInfoPtr, int));
+extern void makeAllVisible PARAMS ((int));
+extern void scrollWinForward PARAMS ((TuiGenWinInfoPtr, int));
+extern void scrollWinBackward PARAMS ((TuiGenWinInfoPtr, int));
+extern void makeWindow PARAMS ((TuiGenWinInfoPtr, int));
+extern TuiWinInfoPtr copyWin PARAMS ((TuiWinInfoPtr));
+extern void boxWin PARAMS ((TuiGenWinInfoPtr, int));
+extern void highlightWin PARAMS ((TuiWinInfoPtr));
+extern void checkAndDisplayHighlightIfNeeded PARAMS ((TuiWinInfoPtr));
+extern void refreshAll PARAMS ((TuiWinInfoPtr *));
+extern void tuiDelwin PARAMS ((WINDOW * window));
+extern void tuiRefreshWin PARAMS ((TuiGenWinInfoPtr));
 
 /*
-** Macros
-*/
+   ** Macros
+ */
 #define    m_beVisible(winInfo)   makeVisible((TuiGenWinInfoPtr)(winInfo), TRUE)
 #define    m_beInvisible(winInfo) \
                             makeVisible((TuiGenWinInfoPtr)(winInfo), FALSE)
 #define    m_allBeVisible()       makeAllVisible(TRUE)
 #define m_allBeInvisible()        makeAllVisible(FALSE)
 
-#endif /*TUI_GENERAL_WIN_H*/
+#endif /*TUI_GENERAL_WIN_H */
index 29a3613f9686401dc6d3163d2da7256c86d73f4c..f443bd00b126405f50022de95a2685049de9f41a 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
-** This module contains functions to support i/o in the TUI
-*/
+   ** This module contains functions to support i/o in the TUI
+ */
 
 
 #include <stdio.h>
@@ -38,14 +38,14 @@ static unsigned int _tuiHandleResizeDuringIO PARAMS ((unsigned int));
 *********************************************************************************/
 
 /*
-** tuiPuts_unfiltered().
-**        Function to put a string to the command window
-**              When running in TUI mode, this is the "hook"
-**              for fputs_unfiltered(). That is, all debugger
-**              output eventually makes it's way to the bottom-level
-**              routine fputs_unfiltered (main.c), which (in TUI
-**              mode), calls tuiPuts_unfiltered().
-*/
+   ** tuiPuts_unfiltered().
+   **        Function to put a string to the command window
+   **              When running in TUI mode, this is the "hook"
+   **              for fputs_unfiltered(). That is, all debugger
+   **              output eventually makes it's way to the bottom-level
+   **              routine fputs_unfiltered (main.c), which (in TUI
+   **              mode), calls tuiPuts_unfiltered().
+ */
 void
 #ifdef __STDC__
 tuiPuts_unfiltered (
@@ -159,11 +159,11 @@ tui_tputs (str, affcnt, putfunc)
       /* Backspace. */
 
       /* We see this on an emacs control-B.
-     * I.e., it's like the left-arrow key (not like the backspace key).
-     * The effect that readline wants when it transmits this
-     * character to us is simply to back up one character
-     * (but not to write a space over the old character).
-     */
+         * I.e., it's like the left-arrow key (not like the backspace key).
+         * The effect that readline wants when it transmits this
+         * character to us is simply to back up one character
+         * (but not to write a space over the old character).
+       */
 
       _updateCommandInfo (-1);
       wmove (cmdWin->generic.handle,
@@ -195,15 +195,15 @@ tui_tputs (str, affcnt, putfunc)
     {
 
       /* This is actually a tgoto() specifying a character position,
-     * followed by either a term_IC/term_DC which [I think] means
-     * insert/delete one character at that position.
-     * There are complications with this one - need to either
-     * extract the position from the string, or have a backdoor
-     * means of communicating it from ../readline/display.c.
-     * So this one is not yet implemented.
-     * Not doing it seems to have no ill effects on command-line-editing
-     * that I've noticed so far. - RT
-     */
+         * followed by either a term_IC/term_DC which [I think] means
+         * insert/delete one character at that position.
+         * There are complications with this one - need to either
+         * extract the position from the string, or have a backdoor
+         * means of communicating it from ../readline/display.c.
+         * So this one is not yet implemented.
+         * Not doing it seems to have no ill effects on command-line-editing
+         * that I've noticed so far. - RT
+       */
 
     }
   else if (str == term_dc)
@@ -228,24 +228,24 @@ tui_tputs (str, affcnt, putfunc)
       insert_mode = 0;
 
       /* Strings we know about but don't handle
-   * specially here are just passed along to tputs().
-   *
-   * These are not handled because (as far as I can tell)
-   * they are not actually emitted by the readline package
-   * in the course of doing command-line editing. Some of them
-   * theoretically could be used in the future, in which case we'd
-   * need to handle them.
-   */
+         * specially here are just passed along to tputs().
+         *
+         * These are not handled because (as far as I can tell)
+         * they are not actually emitted by the readline package
+         * in the course of doing command-line editing. Some of them
+         * theoretically could be used in the future, in which case we'd
+         * need to handle them.
+       */
     }
   else if (str == term_ic ||   /* insert character */
           str == term_cursor_move ||   /* cursor move */
-          str == term_clrpag ||/* clear page */
+          str == term_clrpag ||        /* clear page */
           str == term_mm ||    /* turn on meta key */
           str == term_mo ||    /* turn off meta key */
           str == term_up ||    /* up one line (not expected) */
-          str == term_scroll_region || /* set scroll region */
+          str == term_scroll_region ||         /* set scroll region */
           str == term_memory_lock ||   /* lock screen above cursor */
-          str == term_memory_unlock || /* unlock screen above cursor */
+          str == term_memory_unlock ||         /* unlock screen above cursor */
           str == visible_bell)
     {                          /* flash screen */
       tputs (str, affcnt, putfunc);
@@ -258,9 +258,9 @@ tui_tputs (str, affcnt, putfunc)
 
 
 /*
-** tui_vwgetch()
-**        Wrapper around wgetch with the window in a va_list
-*/
+   ** tui_vwgetch()
+   **        Wrapper around wgetch with the window in a va_list
+ */
 unsigned int
 #ifdef __STDC__
 tui_vwgetch (va_list args)
@@ -279,9 +279,9 @@ tui_vwgetch (args)
 
 
 /*
-** tui_vread()
-**   Wrapper around read() with paramets in a va_list
-*/
+   ** tui_vread()
+   **   Wrapper around read() with paramets in a va_list
+ */
 unsigned int
 #ifdef __STDC__
 tui_vread (va_list args)
@@ -301,9 +301,9 @@ tui_vread (args)
 }                              /* tui_vread() */
 
 /*
-** tuiRead()
-**    Function to perform a read() catching resize events
-*/
+   ** tuiRead()
+   **    Function to perform a read() catching resize events
+ */
 int
 #ifdef __STDC__
 tuiRead (
@@ -327,14 +327,14 @@ tuiRead (filedes, buf, nbytes)
 
 
 /*
-** tuiGetc().
-**        Get a character from the command window.
-**             This is called from the readline package,
-**              that is, we have:
-**                tuiGetc() [here], called from
-**                readline code [in ../readline/], called from
-**                command_line_input() in top.c
-*/
+   ** tuiGetc().
+   **        Get a character from the command window.
+   **           This is called from the readline package,
+   **              that is, we have:
+   **                tuiGetc() [here], called from
+   **                readline code [in ../readline/], called from
+   **                command_line_input() in top.c
+ */
 unsigned int
 #ifdef __STDC__
 tuiGetc (void)
@@ -373,15 +373,15 @@ tuiGetc ()
 
 
 /*
-** tuiBufferGetc().
-*/
+   ** tuiBufferGetc().
+ */
 /*elz: this function reads a line of input from the user and
-puts it in a static buffer. Subsequent calls to this same function
-obtain one char at the time, providing the caller with a behavior
-similar to fgetc. When the input is buffered, the backspaces have
-the needed effect, i.e. ignore the last char active in the buffer*/
+   puts it in a static buffer. Subsequent calls to this same function
+   obtain one char at the time, providing the caller with a behavior
+   similar to fgetc. When the input is buffered, the backspaces have
+   the needed effect, i.e. ignore the last char active in the buffer */
 /* so far this function is called only from the query function in
-utils.c*/
+   utils.c */
 
 unsigned int
 #ifdef __STDC__
@@ -398,7 +398,7 @@ tuiBufferGetc ()
 
   if (length_of_answer == -1)
     {
-      /* this is the first time through, need to read the answer*/
+      /* this is the first time through, need to read the answer */
       do
        {
          /* Call the curses routine that reads one character */
@@ -422,7 +422,7 @@ tuiBufferGetc ()
 
   if (index_read == length_of_answer)
     {
-      /*this is the last time through, reset for next query*/
+      /*this is the last time through, reset for next query */
       index_read = -1;
       length_of_answer = -1;
     }
@@ -434,8 +434,8 @@ tuiBufferGetc ()
 
 
 /*
-** tuiStartNewLines().
-*/
+   ** tuiStartNewLines().
+ */
 void
 #ifdef __STDC__
 tuiStartNewLines (
@@ -464,9 +464,9 @@ tuiStartNewLines (numLines)
 
 
 /*
-** tui_vStartNewLines().
-**        With numLines in a va_list
-*/
+   ** tui_vStartNewLines().
+   **        With numLines in a va_list
+ */
 void
 #ifdef __STDC__
 tui_vStartNewLines (
@@ -490,11 +490,11 @@ tui_vStartNewLines (args)
 
 
 /*
-** _tuiHandleResizeDuringIO
-**    This function manages the cleanup when a resize has occured
-**    From within a call to getch() or read.  Returns the character
-**    to return from getc or read.
-*/
+   ** _tuiHandleResizeDuringIO
+   **    This function manages the cleanup when a resize has occured
+   **    From within a call to getch() or read.  Returns the character
+   **    to return from getc or read.
+ */
 static unsigned int
 #ifdef __STDC__
 _tuiHandleResizeDuringIO (
@@ -518,9 +518,9 @@ _tuiHandleResizeDuringIO (originalCh)
 
 
 /*
-** _updateCommandInfo().
-**        Function to update the command window information.
-*/
+   ** _updateCommandInfo().
+   **        Function to update the command window information.
+ */
 static void
 #ifdef __STDC__
 _updateCommandInfo (
@@ -580,7 +580,7 @@ tuiTermSetup (turn_off_echo)
      * case, since that is what applies on HP-UX. turn_off_echo
      * is 1 except for the case where we're being called
      * on a "quit", in which case we want to leave echo on.
-     */
+   */
   if (turn_off_echo)
     {
 #ifdef HAVE_TERMIOS
@@ -593,7 +593,7 @@ tuiTermSetup (turn_off_echo)
 
   /* Compute the start and end lines of the command
      * region. (Actually we only use end here)
-     */
+   */
   start = winList[CMD_WIN]->generic.origin.y;
   end = start + winList[CMD_WIN]->generic.height - 1;
   endcol = winList[CMD_WIN]->generic.width - 1;
@@ -623,22 +623,22 @@ tuiTermSetup (turn_off_echo)
     }                          /* else we're out of luck */
 
   /* This is an attempt to keep the logical & physical
-       * cursor in synch, going into curses. Without this,
-       * curses seems to be confused by the fact that
-       * GDB has physically moved the curser on it. One
-       * visible effect of removing this code is that the
-       * locator window fails to get updated and the line
-       * of text that *should* go into the locator window
-       * often goes to the wrong place.
-       */
+     * cursor in synch, going into curses. Without this,
+     * curses seems to be confused by the fact that
+     * GDB has physically moved the curser on it. One
+     * visible effect of removing this code is that the
+     * locator window fails to get updated and the line
+     * of text that *should* go into the locator window
+     * often goes to the wrong place.
+   */
   /* What's done here is to  tell curses to write a ' '
-       * at the bottom right corner of the screen.
-       * The idea is to wind up with the cursor in a known
-       * place.
-       * Note I'm relying on refresh()
-       * only writing what changed (the space),
-       * not the whole screen.
-       */
+     * at the bottom right corner of the screen.
+     * The idea is to wind up with the cursor in a known
+     * place.
+     * Note I'm relying on refresh()
+     * only writing what changed (the space),
+     * not the whole screen.
+   */
   standend ();
   move (end, endcol - 1);
   addch (' ');
@@ -677,7 +677,7 @@ tuiTermUnsetup (turn_on_echo, to_column)
   /* We need to turn on echoing, since the TUI turns it off */
   /* Below I only put in the TERMIOS case, since that
      * is what applies on HP-UX.
-     */
+   */
   if (turn_on_echo)
     {
 #ifdef HAVE_TERMIOS
@@ -692,7 +692,7 @@ tuiTermUnsetup (turn_on_echo, to_column)
      * region, as well as the last "real" line of
      * the region (normally same as end, except when
      * we're first populating the region)
-     */
+   */
   start = winList[CMD_WIN]->generic.origin.y;
   end = start + winList[CMD_WIN]->generic.height - 1;
   curline = start + winList[CMD_WIN]->detail.commandInfo.curLine;
@@ -700,7 +700,7 @@ tuiTermUnsetup (turn_on_echo, to_column)
   /* We want to confine target I/O to the command region.
      * In order to do so, we must either have "memory lock"
      * (hpterm's) or "scroll regions" (xterm's).
-     */
+   */
   if (term_cursor_move && term_memory_lock)
     {
 
index bcbeffe4edccb55b1194cdd07e22c48452c81984..adb7b15da191c3805fe84afa62b8f8df29a3b0d2 100644 (file)
@@ -1,21 +1,21 @@
 #ifndef _TUI_IO_H
 #define _TUI_IO_H
 /*
-** This header contains defitions to support tuiIO.c
-*/
+   ** This header contains defitions to support tuiIO.c
+ */
 
 
 #include <stdio.h>
 
-extern void             tuiPuts_unfiltered PARAMS ((const char *, GDB_FILE *));
-extern unsigned int     tuiGetc PARAMS ((void));
-extern unsigned int     tuiBufferGetc PARAMS ((void));
-extern int              tuiRead PARAMS ((int, char *, int));
-extern void             tuiStartNewLines PARAMS ((int));
-extern void             tui_vStartNewLines PARAMS ((va_list));
-extern unsigned int     tui_vwgetch PARAMS ((va_list));
-extern void             tuiTermSetup PARAMS ((int));
-extern void             tuiTermUnsetup PARAMS ((int, int));
+extern void tuiPuts_unfiltered PARAMS ((const char *, GDB_FILE *));
+extern unsigned int tuiGetc PARAMS ((void));
+extern unsigned int tuiBufferGetc PARAMS ((void));
+extern int tuiRead PARAMS ((int, char *, int));
+extern void tuiStartNewLines PARAMS ((int));
+extern void tui_vStartNewLines PARAMS ((va_list));
+extern unsigned int tui_vwgetch PARAMS ((va_list));
+extern void tuiTermSetup PARAMS ((int));
+extern void tuiTermUnsetup PARAMS ((int, int));
 
 
 
@@ -40,4 +40,5 @@ extern void             tuiTermUnsetup PARAMS ((int, int));
 #define m_isXdbStyleCommandChar(ch)     (m_isNextPage(ch) || m_isPrevPage(ch))
 
 
-#endif /*_TUI_IO_H*/
+#endif
+/*_TUI_IO_H*/
index 6aa380cfe41ce3d3e12f0f73d19fb8cc69fef8e1..23cd7d6a1b25a73bcc79f4eb75b08e497aed7543 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tuiLayout.c
-** This module contains procedures for handling the layout of the windows.
-*/
+   ** tuiLayout.c
+   ** This module contains procedures for handling the layout of the windows.
+ */
 
 
 #include "defs.h"
@@ -65,9 +65,9 @@ static TuiLayoutType lastLayout = UNDEFINED_LAYOUT;
 ***************************************/
 
 /*
-** showLayout().
-**        Show the screen layout defined
-*/
+   ** showLayout().
+   **        Show the screen layout defined
+ */
 void
 #ifdef __STDC__
 showLayout (
@@ -82,10 +82,10 @@ showLayout (layout)
   if (layout != curLayout)
     {
       /*
-        ** Since the new layout may cause changes in window size, we
-        ** should free the content and reallocate on next display of
-        ** source/asm
-        */
+         ** Since the new layout may cause changes in window size, we
+         ** should free the content and reallocate on next display of
+         ** source/asm
+       */
       tuiClearAllSourceWinsContent (NO_EMPTY_SOURCE_PROMPT);
       freeAllSourceWinsContent ();
       clearSourceWindows ();
@@ -127,13 +127,13 @@ showLayout (layout)
 
 
 /*
-** tuiSetLayout()
-**    Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
-**    SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
-**    If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
-**    UNDEFINED_LAYOUT, then the data window is populated according
-**    to regsDisplayType.
-*/
+   ** tuiSetLayout()
+   **    Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
+   **    SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
+   **    If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
+   **    UNDEFINED_LAYOUT, then the data window is populated according
+   **    to regsDisplayType.
+ */
 TuiStatus
 #ifdef __STDC__
 tuiSetLayout (
@@ -181,8 +181,8 @@ tuiSetLayout (layoutType, regsDisplayType)
                tuiClearWinFocus ();
              showLayout (newLayout);
              /*
-                ** Now determine where focus should be
-                */
+                ** Now determine where focus should be
+              */
              if (winWithFocus != cmdWin)
                {
                  switch (newLayout)
@@ -194,12 +194,12 @@ tuiSetLayout (layoutType, regsDisplayType)
                      break;
                    case DISASSEM_COMMAND:
                      /* the previous layout was not showing
-                            ** code. this can happen if there is no
-                            ** source available:
-                            ** 1. if the source file is in another dir OR
-                            ** 2. if target was compiled without -g
-                            ** We still want to show the assembly though!
-                            */
+                        ** code. this can happen if there is no
+                        ** source available:
+                        ** 1. if the source file is in another dir OR
+                        ** 2. if target was compiled without -g
+                        ** We still want to show the assembly though!
+                      */
                      addr = vcatch_errors ((OpaqueFuncPtr)
                                            tuiGetBeginAsmAddress);
                      tuiSetWinFocusTo (disassemWin);
@@ -208,12 +208,12 @@ tuiSetLayout (layoutType, regsDisplayType)
                      break;
                    case SRC_DISASSEM_COMMAND:
                      /* the previous layout was not showing
-                            ** code. this can happen if there is no
-                            ** source available:
-                            ** 1. if the source file is in another dir OR
-                            ** 2. if target was compiled without -g
-                            ** We still want to show the assembly though!
-                            */
+                        ** code. this can happen if there is no
+                        ** source available:
+                        ** 1. if the source file is in another dir OR
+                        ** 2. if target was compiled without -g
+                        ** We still want to show the assembly though!
+                      */
                      addr = vcatch_errors ((OpaqueFuncPtr)
                                            tuiGetBeginAsmAddress);
                      if (winWithFocus == srcWin)
@@ -232,12 +232,12 @@ tuiSetLayout (layoutType, regsDisplayType)
                      break;
                    case DISASSEM_DATA_COMMAND:
                      /* the previous layout was not showing
-                            ** code. this can happen if there is no
-                            ** source available:
-                            ** 1. if the source file is in another dir OR
-                            ** 2. if target was compiled without -g
-                            ** We still want to show the assembly though!
-                            */
+                        ** code. this can happen if there is no
+                        ** source available:
+                        ** 1. if the source file is in another dir OR
+                        ** 2. if target was compiled without -g
+                        ** We still want to show the assembly though!
+                      */
                      addr = vcatch_errors ((OpaqueFuncPtr)
                                            tuiGetBeginAsmAddress);
                      if (winWithFocus != dataWin)
@@ -254,8 +254,8 @@ tuiSetLayout (layoutType, regsDisplayType)
              if (newWinWithFocus != (TuiWinInfoPtr) NULL)
                tuiSetWinFocusTo (newWinWithFocus);
              /*
-                ** Now update the window content
-                */
+                ** Now update the window content
+              */
              if (!regsPopulate &&
                  (newLayout == SRC_DATA_COMMAND ||
                   newLayout == DISASSEM_DATA_COMMAND))
@@ -280,10 +280,10 @@ tuiSetLayout (layoutType, regsDisplayType)
 
 
 /*
-** tui_vSetLayoutTo()
-**        Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA,
-**        REGS, $REGS, $GREGS, $FREGS, $SREGS with arguments in a va_list
-*/
+   ** tui_vSetLayoutTo()
+   **        Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA,
+   **        REGS, $REGS, $GREGS, $FREGS, $SREGS with arguments in a va_list
+ */
 TuiStatus
 #ifdef __STDC__
 tui_vSetLayoutTo (
@@ -302,11 +302,11 @@ tui_vSetLayoutTo (args)
 
 
 /*
-** tuiAddWinToLayout().
-**        Add the specified window to the layout in a logical way.
-**        This means setting up the most logical layout given the
-**        window to be added.
-*/
+   ** tuiAddWinToLayout().
+   **        Add the specified window to the layout in a logical way.
+   **        This means setting up the most logical layout given the
+   **        window to be added.
+ */
 void
 #ifdef __STDC__
 tuiAddWinToLayout (
@@ -363,10 +363,10 @@ tuiAddWinToLayout (type)
 
 
 /*
-** tui_vAddWinToLayout().
-**        Add the specified window to the layout in a logical way,
-**        with arguments in a va_list.
-*/
+   ** tui_vAddWinToLayout().
+   **        Add the specified window to the layout in a logical way,
+   **        with arguments in a va_list.
+ */
 void
 #ifdef __STDC__
 tui_vAddWinToLayout (
@@ -385,11 +385,11 @@ tui_vAddWinToLayout (args)
 
 
 /*
-** tuiDefaultWinHeight().
-**        Answer the height of a window.  If it hasn't been created yet,
-**        answer what the height of a window would be based upon its
-**        type and the layout.
-*/
+   ** tuiDefaultWinHeight().
+   **        Answer the height of a window.  If it hasn't been created yet,
+   **        answer what the height of a window would be based upon its
+   **        type and the layout.
+ */
 int
 #ifdef __STDC__
 tuiDefaultWinHeight (
@@ -435,11 +435,11 @@ tuiDefaultWinHeight (type, layout)
 
 
 /*
-** tuiDefaultWinViewportHeight().
-**        Answer the height of a window.  If it hasn't been created yet,
-**        answer what the height of a window would be based upon its
-**        type and the layout.
-*/
+   ** tuiDefaultWinViewportHeight().
+   **        Answer the height of a window.  If it hasn't been created yet,
+   **        answer what the height of a window would be based upon its
+   **        type and the layout.
+ */
 int
 #ifdef __STDC__
 tuiDefaultWinViewportHeight (
@@ -465,10 +465,10 @@ tuiDefaultWinViewportHeight (type, layout)
 
 
 /*
-** _initialize_tuiLayout().
-**        Function to initialize gdb commands, for tui window layout
-**        manipulation.
-*/
+   ** _initialize_tuiLayout().
+   **        Function to initialize gdb commands, for tui window layout
+   **        manipulation.
+ */
 void
 _initialize_tuiLayout ()
 {
@@ -507,10 +507,10 @@ Source/Disassembly/Command layouts.\n");
 
 
 /*
-** _tuiSetLayoutTo()
-**    Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
-**        $REGS, $GREGS, $FREGS, $SREGS.
-*/
+   ** _tuiSetLayoutTo()
+   **    Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, REGS,
+   **        $REGS, $GREGS, $FREGS, $SREGS.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetLayoutTo (
@@ -767,9 +767,9 @@ _tuiLayout_command (arg, fromTTY)
 }                              /* _tuiLayout_command */
 
 /*
-** _nextLayout().
-**        Answer the previous layout to cycle to.
-*/
+   ** _nextLayout().
+   **        Answer the previous layout to cycle to.
+ */
 static TuiLayoutType
 #ifdef __STDC__
 _nextLayout (void)
@@ -794,9 +794,9 @@ _nextLayout ()
 
 
 /*
-** _prevLayout().
-**        Answer the next layout to cycle to.
-*/
+   ** _prevLayout().
+   **        Answer the next layout to cycle to.
+ */
 static TuiLayoutType
 #ifdef __STDC__
 _prevLayout (void)
@@ -822,8 +822,8 @@ _prevLayout ()
 
 
 /*
-** _makeCommandWindow().
-*/
+   ** _makeCommandWindow().
+ */
 static void
 #ifdef __STDC__
 _makeCommandWindow (
@@ -852,8 +852,8 @@ _makeCommandWindow (winInfoPtr, height, originY)
 
 
 /*
-** _makeSourceWindow().
-*/
+   ** _makeSourceWindow().
+ */
 static void
 #ifdef __STDC__
 _makeSourceWindow (
@@ -874,8 +874,8 @@ _makeSourceWindow (winInfoPtr, height, originY)
 
 
 /*
-** _makeDisassemWindow().
-*/
+   ** _makeDisassemWindow().
+ */
 static void
 #ifdef __STDC__
 _makeDisassemWindow (
@@ -896,8 +896,8 @@ _makeDisassemWindow (winInfoPtr, height, originY)
 
 
 /*
-** _makeDataWindow().
-*/
+   ** _makeDataWindow().
+ */
 static void
 #ifdef __STDC__
 _makeDataWindow (
@@ -925,9 +925,9 @@ _makeDataWindow (winInfoPtr, height, originY)
 
 
 /*
-**    _showSourceCommand().
-**        Show the Source/Command layout
-*/
+   **    _showSourceCommand().
+   **        Show the Source/Command layout
+ */
 static void
 #ifdef __STDC__
 _showSourceCommand (void)
@@ -942,9 +942,9 @@ _showSourceCommand ()
 
 
 /*
-**    _showDisassemCommand().
-**        Show the Dissassem/Command layout
-*/
+   **    _showDisassemCommand().
+   **        Show the Dissassem/Command layout
+ */
 static void
 #ifdef __STDC__
 _showDisassemCommand (void)
@@ -959,9 +959,9 @@ _showDisassemCommand ()
 
 
 /*
-**    _showSourceDisassemCommand().
-**        Show the Source/Disassem/Command layout
-*/
+   **    _showSourceDisassemCommand().
+   **        Show the Source/Disassem/Command layout
+ */
 static void
 #ifdef __STDC__
 _showSourceDisassemCommand (void)
@@ -1081,9 +1081,9 @@ _showSourceDisassemCommand ()
 
 
 /*
-**    _showData().
-**        Show the Source/Data/Command or the Dissassembly/Data/Command layout
-*/
+   **    _showData().
+   **        Show the Source/Data/Command or the Dissassembly/Data/Command layout
+ */
 static void
 #ifdef __STDC__
 _showData (
@@ -1156,8 +1156,8 @@ _showData (newLayout)
 }                              /* _showData */
 
 /*
-** _initGenWinInfo().
-*/
+   ** _initGenWinInfo().
+ */
 static void
 #ifdef __STDC__
 _initGenWinInfo (
@@ -1197,8 +1197,8 @@ _initGenWinInfo (winInfo, type, height, width, originX, originY)
 }                              /* _initGenWinInfo */
 
 /*
-** _initAndMakeWin().
-*/
+   ** _initAndMakeWin().
+ */
 static void
 #ifdef __STDC__
 _initAndMakeWin (
@@ -1257,8 +1257,8 @@ _initAndMakeWin (winInfoPtr, winType, height, width, originX, originY, boxIt)
 
 
 /*
-** _makeSourceOrDisassemWindow().
-*/
+   ** _makeSourceOrDisassemWindow().
+ */
 static void
 #ifdef __STDC__
 _makeSourceOrDisassemWindow (
@@ -1277,8 +1277,8 @@ _makeSourceOrDisassemWindow (winInfoPtr, type, height, originY)
   TuiGenWinInfoPtr executionInfo = (TuiGenWinInfoPtr) NULL;
 
   /*
-    ** Create the exeuction info window.
-    */
+     ** Create the exeuction info window.
+   */
   if (type == SRC_WIN)
     executionInfo = sourceExecInfoWinPtr ();
   else
@@ -1291,8 +1291,8 @@ _makeSourceOrDisassemWindow (winInfoPtr, type, height, originY)
                   originY,
                   DONT_BOX_WINDOW);
   /*
-    ** Now create the source window.
-    */
+     ** Now create the source window.
+   */
   _initAndMakeWin ((Opaque *) winInfoPtr,
                   type,
                   height,
@@ -1308,9 +1308,9 @@ _makeSourceOrDisassemWindow (winInfoPtr, type, height, originY)
 
 
 /*
-**    _showSourceOrDisassemAndCommand().
-**        Show the Source/Command or the Disassem layout
-*/
+   **    _showSourceOrDisassemAndCommand().
+   **        Show the Source/Command or the Disassem layout
+ */
 static void
 #ifdef __STDC__
 _showSourceOrDisassemAndCommand (
index 57d8bbc90b6ed64c3974667ab3bf44031264adeb..81d69158098225bd9674b56c13b940a315003a62 100644 (file)
@@ -1,15 +1,15 @@
 #ifndef TUI_LAYOUT_H
 #define TUI_LAYOUT_H
 
-extern void             showLayout PARAMS ((TuiLayoutType));
-extern void             tuiAddWinToLayout PARAMS ((TuiWinType));
-extern void             tui_vAddWinToLayout PARAMS ((va_list));
-extern int              tuiDefaultWinHeight 
-                             PARAMS ((TuiWinType, TuiLayoutType));
-extern int              tuiDefaultWinViewportHeight 
-                             PARAMS ((TuiWinType, TuiLayoutType));
-extern TuiStatus        tuiSetLayout 
-                             PARAMS ((TuiLayoutType, TuiRegisterDisplayType));
-extern TuiStatus        tui_vSetLayoutTo PARAMS ((va_list));
+extern void showLayout PARAMS ((TuiLayoutType));
+extern void tuiAddWinToLayout PARAMS ((TuiWinType));
+extern void tui_vAddWinToLayout PARAMS ((va_list));
+extern int tuiDefaultWinHeight
+  PARAMS ((TuiWinType, TuiLayoutType));
+extern int tuiDefaultWinViewportHeight
+  PARAMS ((TuiWinType, TuiLayoutType));
+extern TuiStatus tuiSetLayout
+  PARAMS ((TuiLayoutType, TuiRegisterDisplayType));
+extern TuiStatus tui_vSetLayoutTo PARAMS ((va_list));
 
-#endif /*TUI_LAYOUT_H*/
+#endif /*TUI_LAYOUT_H */
index b78b9bc873cd62914cbedf8834f25a1516279299..92eec56881ac58e7d8dcfdce0cfd54e5aad7c079 100644 (file)
@@ -1,9 +1,9 @@
 
 /*
-** tuiRegs.c
-**         This module contains functions to support display of registers
-**         in the data window.
-*/
+   ** tuiRegs.c
+   **         This module contains functions to support display of registers
+   **         in the data window.
+ */
 
 
 #include "defs.h"
@@ -32,7 +32,7 @@
 
 #define SINGLE_LABEL_WIDTH    10
 #define SINGLE_LABEL_FMT      "%10.10s: "
-#define SINGLE_VALUE_WIDTH    14/* minimum of 8 but may be in sci notation */
+#define SINGLE_VALUE_WIDTH    14       /* minimum of 8 but may be in sci notation */
 
 /* In the code HP gave Cygnus, this was actually a function call to a
    PA-specific function, which was supposed to determine whether the
@@ -86,10 +86,10 @@ static void _tui_vShowRegisters_commandSupport PARAMS ((va_list));
 ******************************************/
 
 /*
-** tuiLastRegsLineNo()
-**        Answer the number of the last line in the regs display.
-**        If there are no registers (-1) is returned.
-*/
+   ** tuiLastRegsLineNo()
+   **        Answer the number of the last line in the regs display.
+   **        If there are no registers (-1) is returned.
+ */
 int
 #ifdef __STDC__
 tuiLastRegsLineNo (void)
@@ -112,11 +112,11 @@ tuiLastRegsLineNo ()
 
 
 /*
-** tuiLineFromRegElementNo()
-**        Answer the line number that the register element at elementNo is
-**        on.  If elementNo is greater than the number of register elements
-**        there are, -1 is returned.
-*/
+   ** tuiLineFromRegElementNo()
+   **        Answer the line number that the register element at elementNo is
+   **        on.  If elementNo is greater than the number of register elements
+   **        there are, -1 is returned.
+ */
 int
 #ifdef __STDC__
 tuiLineFromRegElementNo (
@@ -148,10 +148,10 @@ tuiLineFromRegElementNo (elementNo)
 
 
 /*
-** tuiFirstRegElementNoInLine()
-**        Answer the index of the first element in lineNo.  If lineNo is
-**        past the register area (-1) is returned.
-*/
+   ** tuiFirstRegElementNoInLine()
+   **        Answer the index of the first element in lineNo.  If lineNo is
+   **        past the register area (-1) is returned.
+ */
 int
 #ifdef __STDC__
 tuiFirstRegElementNoInLine (
@@ -172,10 +172,10 @@ tuiFirstRegElementNoInLine (lineNo)
 
 
 /*
-** tuiLastRegElementNoInLine()
-**        Answer the index of the last element in lineNo.  If lineNo is past
-**        the register area (-1) is returned.
-*/
+   ** tuiLastRegElementNoInLine()
+   **        Answer the index of the last element in lineNo.  If lineNo is past
+   **        the register area (-1) is returned.
+ */
 int
 #ifdef __STDC__
 tuiLastRegElementNoInLine (
@@ -195,10 +195,10 @@ tuiLastRegElementNoInLine (lineNo)
 
 
 /*
-** tuiCalculateRegsColumnCount
-**        Calculate the number of columns that should be used to display
-**        the registers.
-*/
+   ** tuiCalculateRegsColumnCount
+   **        Calculate the number of columns that should be used to display
+   **        the registers.
+ */
 int
 #ifdef __STDC__
 tuiCalculateRegsColumnCount (
@@ -226,11 +226,11 @@ tuiCalculateRegsColumnCount (dpyType)
 
 
 /*
-** tuiShowRegisters().
-**        Show the registers int the data window as indicated by dpyType.
-**        If there is any other registers being displayed, then they are
-**        cleared.  What registers are displayed is dependent upon dpyType.
-*/
+   ** tuiShowRegisters().
+   **        Show the registers int the data window as indicated by dpyType.
+   **        If there is any other registers being displayed, then they are
+   **        cleared.  What registers are displayed is dependent upon dpyType.
+ */
 void
 #ifdef __STDC__
 tuiShowRegisters (
@@ -304,12 +304,12 @@ tuiShowRegisters (dpyType)
 
 
 /*
-** tuiDisplayRegistersFrom().
-**        Function to display the registers in the content from
-**        'startElementNo' until the end of the register content or the
-**        end of the display height.  No checking for displaying past
-**        the end of the registers is done here.
-*/
+   ** tuiDisplayRegistersFrom().
+   **        Function to display the registers in the content from
+   **        'startElementNo' until the end of the register content or the
+   **        end of the display height.  No checking for displaying past
+   **        the end of the registers is done here.
+ */
 void
 #ifdef __STDC__
 tuiDisplayRegistersFrom (
@@ -351,8 +351,8 @@ tuiDisplayRegistersFrom (startElementNo)
        }
       itemWinWidth = valueCharsWide + labelWidth;
       /*
-        ** Now create each data "sub" window, and write the display into it.
-        */
+         ** Now create each data "sub" window, and write the display into it.
+       */
       curY = 1;
       while (i < dataWin->detail.dataDisplayInfo.regsContentCount &&
             curY <= dataWin->generic.viewportHeight)
@@ -364,7 +364,7 @@ tuiDisplayRegistersFrom (startElementNo)
              TuiGenWinInfoPtr dataItemWin;
              TuiDataElementPtr dataElementPtr;
 
-             /* create the window if necessary*/
+             /* create the window if necessary */
              dataItemWin = &dataWin->detail.dataDisplayInfo.
                regsContent[i]->whichElement.dataWindow;
              dataElementPtr = &((TuiWinElementPtr)
@@ -379,9 +379,9 @@ tuiDisplayRegistersFrom (startElementNo)
                  makeWindow (dataItemWin, DONT_BOX_WINDOW);
                }
              /*
-                ** Get the printable representation of the register
-                ** and display it
-                */
+                ** Get the printable representation of the register
+                ** and display it
+              */
              _tuiDisplayRegister (
                            dataElementPtr->itemNo, dataItemWin, precision);
              i++;              /* next register */
@@ -395,13 +395,13 @@ tuiDisplayRegistersFrom (startElementNo)
 
 
 /*
-** tuiDisplayRegElementAtLine().
-**        Function to display the registers in the content from
-**        'startElementNo' on 'startLineNo' until the end of the
-**        register content or the end of the display height.
-**        This function checks that we won't display off the end
-**        of the register display.
-*/
+   ** tuiDisplayRegElementAtLine().
+   **        Function to display the registers in the content from
+   **        'startElementNo' on 'startLineNo' until the end of the
+   **        register content or the end of the display height.
+   **        This function checks that we won't display off the end
+   **        of the register display.
+ */
 void
 #ifdef __STDC__
 tuiDisplayRegElementAtLine (
@@ -427,10 +427,10 @@ tuiDisplayRegElementAtLine (startElementNo, startLineNo)
          if (firstLineOnLastPage < 0)
            firstLineOnLastPage = 0;
          /*
-            ** If there is no other data displayed except registers,
-            ** and the elementNo causes us to scroll past the end of the
-            ** registers, adjust what element to really start the display at.
-            */
+            ** If there is no other data displayed except registers,
+            ** and the elementNo causes us to scroll past the end of the
+            ** registers, adjust what element to really start the display at.
+          */
          if (dataWin->detail.dataDisplayInfo.dataContentCount <= 0 &&
              startLineNo > firstLineOnLastPage)
            elementNo = tuiFirstRegElementNoInLine (firstLineOnLastPage);
@@ -444,11 +444,11 @@ tuiDisplayRegElementAtLine (startElementNo, startLineNo)
 
 
 /*
-** tuiDisplayRegistersFromLine().
-**        Function to display the registers starting at line lineNo in
-**        the data window.  Answers the line number that the display
-**        actually started from.  If nothing is displayed (-1) is returned.
-*/
+   ** tuiDisplayRegistersFromLine().
+   **        Function to display the registers starting at line lineNo in
+   **        the data window.  Answers the line number that the display
+   **        actually started from.  If nothing is displayed (-1) is returned.
+ */
 int
 #ifdef __STDC__
 tuiDisplayRegistersFromLine (
@@ -470,9 +470,9 @@ tuiDisplayRegistersFromLine (lineNo, forceDisplay)
        line = 0;
       else if (forceDisplay)
        {                       /*
-            ** If we must display regs (forceDisplay is true), then make
-            ** sure that we don't display off the end of the registers.
-            */
+                                  ** If we must display regs (forceDisplay is true), then make
+                                  ** sure that we don't display off the end of the registers.
+                                */
          if (lineNo >= tuiLastRegsLineNo ())
            {
              if ((line = tuiLineFromRegElementNo (
@@ -499,11 +499,11 @@ tuiDisplayRegistersFromLine (lineNo, forceDisplay)
 
 
 /*
-** tuiCheckRegisterValues()
-**        This function check all displayed registers for changes in
-**        values, given a particular frame.  If the values have changed,
-**        they are updated with the new value and highlighted.
-*/
+   ** tuiCheckRegisterValues()
+   **        This function check all displayed registers for changes in
+   **        values, given a particular frame.  If the values have changed,
+   **        they are updated with the new value and highlighted.
+ */
 void
 #ifdef __STDC__
 tuiCheckRegisterValues (
@@ -566,8 +566,8 @@ tuiCheckRegisterValues (frame)
 
 
 /*
-** tuiToggleFloatRegs().
-*/
+   ** tuiToggleFloatRegs().
+ */
 void
 #ifdef __STDC__
 tuiToggleFloatRegs (void)
@@ -626,9 +626,9 @@ registers.\n",
 
 
 /*
-** _tuiRegisterName().
-**        Return the register name.
-*/
+   ** _tuiRegisterName().
+   **        Return the register name.
+ */
 static char *
 #ifdef __STDC__
 _tuiRegisterName (
@@ -646,10 +646,10 @@ _tuiRegisterName (regNum)
 
 
 /*
-** _tuiRegisterFormat
-**        Function to format the register name and value into a buffer,
-**        suitable for printing or display
-*/
+   ** _tuiRegisterFormat
+   **        Function to format the register name and value into a buffer,
+   **        suitable for printing or display
+ */
 static void
 #ifdef __STDC__
 _tuiRegisterFormat (
@@ -671,10 +671,10 @@ _tuiRegisterFormat (buf, bufLen, regNum, dataElement, precision)
   char *fmt;
   GDB_FILE *stream;
 
-  stream = gdb_file_init_astring(bufLen);
+  stream = gdb_file_init_astring (bufLen);
   pa_do_strcat_registers_info (regNum, 0, stream, precision);
-  strcpy (buf, gdb_file_get_strbuf(stream));
-  gdb_file_deallocate(&stream);
+  strcpy (buf, gdb_file_get_strbuf (stream));
+  gdb_file_deallocate (&stream);
 
   return;
 }                              /* _tuiRegisterFormat */
@@ -682,9 +682,9 @@ _tuiRegisterFormat (buf, bufLen, regNum, dataElement, precision)
 
 #define NUM_GENERAL_REGS    32
 /*
-** _tuiSetGeneralRegsContent().
-**      Set the content of the data window to consist of the general registers.
-*/
+   ** _tuiSetGeneralRegsContent().
+   **      Set the content of the data window to consist of the general registers.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetGeneralRegsContent (
@@ -705,9 +705,9 @@ _tuiSetGeneralRegsContent (refreshValuesOnly)
 
 #define START_SPECIAL_REGS    PCOQ_HEAD_REGNUM
 /*
-** _tuiSetSpecialRegsContent().
-**      Set the content of the data window to consist of the special registers.
-*/
+   ** _tuiSetSpecialRegsContent().
+   **      Set the content of the data window to consist of the special registers.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetSpecialRegsContent (
@@ -738,9 +738,9 @@ _tuiSetSpecialRegsContent (refreshValuesOnly)
 
 
 /*
-** _tuiSetGeneralAndSpecialRegsContent().
-**      Set the content of the data window to consist of the special registers.
-*/
+   ** _tuiSetGeneralAndSpecialRegsContent().
+   **      Set the content of the data window to consist of the special registers.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetGeneralAndSpecialRegsContent (
@@ -767,9 +767,9 @@ _tuiSetGeneralAndSpecialRegsContent (refreshValuesOnly)
 }                              /* _tuiSetGeneralAndSpecialRegsContent */
 
 /*
-** _tuiSetFloatRegsContent().
-**        Set the content of the data window to consist of the float registers.
-*/
+   ** _tuiSetFloatRegsContent().
+   **        Set the content of the data window to consist of the float registers.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetFloatRegsContent (
@@ -802,10 +802,10 @@ _tuiSetFloatRegsContent (dpyType, refreshValuesOnly)
 
 
 /*
-** _tuiRegValueHasChanged().
-**        Answer TRUE if the register's value has changed, FALSE otherwise.
-**        If TRUE, newValue is filled in with the new value.
-*/
+   ** _tuiRegValueHasChanged().
+   **        Answer TRUE if the register's value has changed, FALSE otherwise.
+   **        If TRUE, newValue is filled in with the new value.
+ */
 static int
 #ifdef __STDC__
 _tuiRegValueHasChanged (
@@ -845,9 +845,9 @@ _tuiRegValueHasChanged (dataElement, frame, newValue)
 
 
 /*
-** _tuiGetRegisterRawValue().
-**        Get the register raw value.  The raw value is returned in regValue.
-*/
+   ** _tuiGetRegisterRawValue().
+   **        Get the register raw value.  The raw value is returned in regValue.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiGetRegisterRawValue (
@@ -875,10 +875,10 @@ _tuiGetRegisterRawValue (regNum, regValue, frame)
 
 
 /*
-** _tuiSetRegisterElement().
-**       Function to initialize a data element with the input and
-**       the register value.
-*/
+   ** _tuiSetRegisterElement().
+   **       Function to initialize a data element with the input and
+   **       the register value.
+ */
 static void
 #ifdef __STDC__
 _tuiSetRegisterElement (
@@ -913,11 +913,11 @@ _tuiSetRegisterElement (regNum, frame, dataElement, refreshValueOnly)
 
 
 /*
-** _tuiSetRegsContent().
-**        Set the content of the data window to consist of the registers
-**        numbered from startRegNum to endRegNum.  Note that if
-**        refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
-*/
+   ** _tuiSetRegsContent().
+   **        Set the content of the data window to consist of the registers
+   **        numbered from startRegNum to endRegNum.  Note that if
+   **        refreshValuesOnly is TRUE, startRegNum and endRegNum are ignored.
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiSetRegsContent (
@@ -967,8 +967,8 @@ _tuiSetRegsContent (startRegNum, endRegNum, frame, dpyType, refreshValuesOnly)
          dataWin->detail.dataDisplayInfo.regsContentCount = numRegs;
        }
       /*
-        ** Now set the register names and values
-        */
+         ** Now set the register names and values
+       */
       for (i = startRegNum; (i <= endRegNum); i++)
        {
          TuiGenWinInfoPtr dataItemWin;
@@ -1002,15 +1002,15 @@ _tuiSetRegsContent (startRegNum, endRegNum, frame, dpyType, refreshValuesOnly)
 
 
 /*
-** _tuiDisplayRegister().
-**        Function to display a register in a window.  If hilite is TRUE,
-**        than the value will be displayed in reverse video
-*/
+   ** _tuiDisplayRegister().
+   **        Function to display a register in a window.  If hilite is TRUE,
+   **        than the value will be displayed in reverse video
+ */
 static void
 #ifdef __STDC__
 _tuiDisplayRegister (
                      int regNum,
-                     TuiGenWinInfoPtr winInfo, /* the data item window */
+                     TuiGenWinInfoPtr winInfo,         /* the data item window */
                      enum precision_type precision)
 #else
 _tuiDisplayRegister (regNum, winInfo, precision)
index 4a777ec9a9b66b20ae227f11b62786c4f124ca71..a9f077d186064a72ce03b58d1930d0e2e8b767a9 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_REGS_H
 #define _TUI_REGS_H
 /*
-** This header file supports the display of registers in the data window.
-*/
+   ** This header file supports the display of registers in the data window.
+ */
 
 /*****************************************
 ** TYPE DEFINITIONS                        **
 /*****************************************
 ** PUBLIC FUNCTION EXTERNAL DECLS        **
 ******************************************/
-extern void     tuiCheckRegisterValues PARAMS ((struct frame_info *));
-extern void     tuiShowRegisters PARAMS ((TuiRegisterDisplayType));
-extern void     tuiDisplayRegistersFrom PARAMS ((int));
-extern int      tuiDisplayRegistersFromLine PARAMS ((int, int));
-extern int      tuiLastRegsLineNo PARAMS ((void));
-extern int      tuiFirstRegElementInLine PARAMS ((int));
-extern int      tuiLastRegElementInLine PARAMS ((int));
-extern int      tuiLineFromRegElementNo PARAMS ((int));
-extern void     tuiToggleFloatRegs PARAMS ((void));
-extern int      tuiCalculateRegsColumnCount PARAMS ((TuiRegisterDisplayType));
+extern void tuiCheckRegisterValues PARAMS ((struct frame_info *));
+extern void tuiShowRegisters PARAMS ((TuiRegisterDisplayType));
+extern void tuiDisplayRegistersFrom PARAMS ((int));
+extern int tuiDisplayRegistersFromLine PARAMS ((int, int));
+extern int tuiLastRegsLineNo PARAMS ((void));
+extern int tuiFirstRegElementInLine PARAMS ((int));
+extern int tuiLastRegElementInLine PARAMS ((int));
+extern int tuiLineFromRegElementNo PARAMS ((int));
+extern void tuiToggleFloatRegs PARAMS ((void));
+extern int tuiCalculateRegsColumnCount PARAMS ((TuiRegisterDisplayType));
 
 
-#endif /*_TUI_REGS_H*/
+#endif
+/*_TUI_REGS_H*/
index e0259d014b430cf0ce607cdcd8f00333f1b6e587..36c1e7cd9a21c6590dbd3234f3fb6ca1faa09562 100644 (file)
@@ -1,7 +1,7 @@
 /*
-** tuiSource.c
-**         This module contains functions for displaying source in the source window
-*/
+   ** tuiSource.c
+   **         This module contains functions for displaying source in the source window
+ */
 
 #include "defs.h"
 #include <ctype.h>
@@ -51,9 +51,9 @@ static struct breakpoint *_hasBreak PARAMS ((char *, int));
 *********************************/
 
 /*
-** tuiSetSourceContent().
-**    Function to display source in the source window.
-*/
+   ** tuiSetSourceContent().
+   **    Function to display source in the source window.
+ */
 TuiStatus
 #ifdef __STDC__
 tuiSetSourceContent (
@@ -79,9 +79,9 @@ tuiSetSourceContent (s, lineNo, noerror)
        {
          lineWidth = srcWin->generic.width - 1;
          /*
-            ** Take hilite (window border) into account, when calculating
-            ** the number of lines
-            */
+            ** Take hilite (window border) into account, when calculating
+            ** the number of lines
+          */
          nlines = (lineNo + (srcWin->generic.height - 2)) - lineNo;
          desc = open_source_file (s);
          if (desc < 0)
@@ -116,9 +116,9 @@ tuiSetSourceContent (s, lineNo, noerror)
                  register int offset, curLineNo, curLine, curLen, threshold;
                  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
                  /*
-                    ** Determine the threshold for the length of the line
-                    ** and the offset to start the display
-                    */
+                    ** Determine the threshold for the length of the line
+                    ** and the offset to start the display
+                  */
                  offset = srcWin->detail.sourceInfo.horizontalOffset;
                  threshold = (lineWidth - 1) + offset;
                  stream = fdopen (desc, FOPEN_RT);
@@ -156,9 +156,9 @@ tuiSetSourceContent (s, lineNo, noerror)
                      srcLine[curLen] = (char) 0;
 
                      /*
-                        ** Set whether element is the execution point and
-                        ** whether there is a break point on it.
-                        */
+                        ** Set whether element is the execution point and
+                        ** whether there is a break point on it.
+                      */
                      element->whichElement.source.lineOrAddr.lineNo =
                        curLineNo;
                      element->whichElement.source.isExecPoint =
@@ -192,12 +192,12 @@ tuiSetSourceContent (s, lineNo, noerror)
                                    }
                                  else
                                    {   /*
-                                        ** Store the charcter in the line
-                                        ** buffer.  If it is a tab, then
-                                        ** translate to the correct number of
-                                        ** chars so we don't overwrite our
-                                        ** buffer.
-                                        */
+                                          ** Store the charcter in the line
+                                          ** buffer.  If it is a tab, then
+                                          ** translate to the correct number of
+                                          ** chars so we don't overwrite our
+                                          ** buffer.
+                                        */
                                      if (c == '\t')
                                        {
                                          int j, maxTabLen = tuiDefaultTabLen ();
@@ -217,9 +217,9 @@ tuiSetSourceContent (s, lineNo, noerror)
                                }
                              else
                                {       /*
-                                    ** if we have not reached EOL, then eat
-                                    ** chars until we do
-                                    */
+                                          ** if we have not reached EOL, then eat
+                                          ** chars until we do
+                                        */
                                  while (c != EOF && c != '\n' && c != '\r')
                                    c = fgetc (stream);
                                }
@@ -256,7 +256,7 @@ tuiSetSourceContent (s, lineNo, noerror)
    except for a line in the middle with a warning message about the
    source not being available. This function is called by
    tuiEraseSourceContents, which in turn is invoked when the source files
-   cannot be accessed*/
+   cannot be accessed */
 
 void
 #ifdef __STDC__
@@ -277,12 +277,12 @@ tuiSetSourceContentNil (winInfo, warning_string)
   nLines = winInfo->generic.height - 2;
 
   /* set to empty each line in the window, except for the one
-    which contains the message*/
+     which contains the message */
   while (curr_line < winInfo->generic.contentSize)
     {
       /* set the information related to each displayed line
-     to null: i.e. the line number is 0, there is no bp,
-     it is not where the program is stopped */
+         to null: i.e. the line number is 0, there is no bp,
+         it is not where the program is stopped */
 
       TuiWinElementPtr element =
       (TuiWinElementPtr) winInfo->generic.content[curr_line];
@@ -290,14 +290,14 @@ tuiSetSourceContentNil (winInfo, warning_string)
       element->whichElement.source.isExecPoint = FALSE;
       element->whichElement.source.hasBreak = FALSE;
 
-      /* set the contents of the line to blank*/
+      /* set the contents of the line to blank */
       element->whichElement.source.line[0] = (char) 0;
 
       /* if the current line is in the middle of the screen, then we want to
-     display the 'no source available' message in it.
-     Note: the 'weird' arithmetic with the line width and height comes from
-     the function tuiEraseSourceContent. We need to keep the screen and the
-     window's actual contents in synch */
+         display the 'no source available' message in it.
+         Note: the 'weird' arithmetic with the line width and height comes from
+         the function tuiEraseSourceContent. We need to keep the screen and the
+         window's actual contents in synch */
 
       if (curr_line == (nLines / 2 + 1))
        {
@@ -327,18 +327,18 @@ tuiSetSourceContentNil (winInfo, warning_string)
 
       curr_line++;
 
-    }                          /* end while*/
+    }                          /* end while */
 
-}                              /*tuiSetSourceContentNil*/
+}                              /*tuiSetSourceContentNil */
 
 
 
 
 /*
-** tuiShowSource().
-**        Function to display source in the source window.  This function
-**        initializes the horizontal scroll to 0.
-*/
+   ** tuiShowSource().
+   **        Function to display source in the source window.  This function
+   **        initializes the horizontal scroll to 0.
+ */
 void
 #ifdef __STDC__
 tuiShowSource (
@@ -360,9 +360,9 @@ tuiShowSource (s, line, noerror)
 
 
 /*
-** tuiSourceIsDisplayed().
-**        Answer whether the source is currently displayed in the source window.
-*/
+   ** tuiSourceIsDisplayed().
+   **        Answer whether the source is currently displayed in the source window.
+ */
 int
 #ifdef __STDC__
 tuiSourceIsDisplayed (
@@ -379,9 +379,9 @@ tuiSourceIsDisplayed (fname)
 
 
 /*
-** tuiVerticalSourceScroll().
-**      Scroll the source forward or backward vertically
-*/
+   ** tuiVerticalSourceScroll().
+   **      Scroll the source forward or backward vertically
+ */
 void
 #ifdef __STDC__
 tuiVerticalSourceScroll (
@@ -410,8 +410,8 @@ tuiVerticalSourceScroll (scrollDirection, numToScroll)
          line = content[0]->whichElement.source.lineOrAddr.lineNo +
            numToScroll;
          if (line > s->nlines)
-           /*line = s->nlines - winInfo->generic.contentSize + 1;*/
-           /*elz: fix for dts 23398*/
+           /*line = s->nlines - winInfo->generic.contentSize + 1; */
+           /*elz: fix for dts 23398 */
            line = content[0]->whichElement.source.lineOrAddr.lineNo;
        }
       else
@@ -433,10 +433,10 @@ tuiVerticalSourceScroll (scrollDirection, numToScroll)
 ******************************************/
 
 /*
-** _hasBreak().
-**        Answer whether there is a break point at the input line in
-**        the source file indicated
-*/
+   ** _hasBreak().
+   **        Answer whether there is a break point at the input line in
+   **        the source file indicated
+ */
 static struct breakpoint *
 #ifdef __STDC__
 _hasBreak (
index f898c611c71403b8692569ab82adea19744b223c..8545c1fa3c9189e8733b464729722d52f93fbe40 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_SOURCE_H
 #define _TUI_SOURCE_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
 
 #include "defs.h"
 #include "breakpoint.h"
 #endif
 
-extern TuiStatus    tuiSetSourceContent PARAMS ((struct symtab *, int, int));
-extern void         tuiShowSource PARAMS ((struct symtab *, Opaque, int));
-extern void         tuiShowSourceAsIs PARAMS ((struct symtab *, Opaque, int));
-extern int          tuiSourceIsDisplayed PARAMS ((char *));
-extern void         tuiVerticalSourceScroll PARAMS ((TuiScrollDirection, int));
+extern TuiStatus tuiSetSourceContent PARAMS ((struct symtab *, int, int));
+extern void tuiShowSource PARAMS ((struct symtab *, Opaque, int));
+extern void tuiShowSourceAsIs PARAMS ((struct symtab *, Opaque, int));
+extern int tuiSourceIsDisplayed PARAMS ((char *));
+extern void tuiVerticalSourceScroll PARAMS ((TuiScrollDirection, int));
 
 
 /*******************
@@ -24,4 +24,5 @@ extern void         tuiVerticalSourceScroll PARAMS ((TuiScrollDirection, int));
 #define m_tuiShowSourceAsIs(s, line, noerror)    tuiUpdateSourceWindowAsIs(srcWin, s, line, noerror)
 
 
-#endif /*_TUI_SOURCE_H*/
+#endif
+/*_TUI_SOURCE_H*/
index e20392598ad7a8bd5f83b135cb41eab1ca38f9d5..4b9d50c63f6aa84a3037e671895c889db8eef4ff 100644 (file)
@@ -1,8 +1,8 @@
 /*
-** tuiSourceWin.c
-**         This module contains functions for displaying source or assembly in the "source" window.
-*        The "source" window may be the assembly or the source windows.
-*/
+   ** tuiSourceWin.c
+   **         This module contains functions for displaying source or assembly in the "source" window.
+   *        The "source" window may be the assembly or the source windows.
+ */
 
 #include "defs.h"
 #include <ctype.h>
@@ -47,8 +47,8 @@ extern struct symtab *current_source_symtab;
 *********************************/
 
 /*
-** tuiSrcWinIsDisplayed().
-*/
+   ** tuiSrcWinIsDisplayed().
+ */
 int
 #ifdef __STDC__
 tuiSrcWinIsDisplayed (void)
@@ -61,8 +61,8 @@ tuiSrcWinIsDisplayed ()
 
 
 /*
-** tuiAsmWinIsDisplayed().
-*/
+   ** tuiAsmWinIsDisplayed().
+ */
 int
 #ifdef __STDC__
 tuiAsmWinIsDisplayed (void)
@@ -75,9 +75,9 @@ tuiAsmWinIsDisplayed ()
 
 
 /*
-** tuiDisplayMainFunction().
-**        Function to display the "main" routine"
-*/
+   ** tuiDisplayMainFunction().
+   **        Function to display the "main" routine"
+ */
 void
 #ifdef __STDC__
 tuiDisplayMainFunction (void)
@@ -108,10 +108,10 @@ tuiDisplayMainFunction ()
 
 
 /*
-** tuiUpdateSourceWindow().
-**    Function to display source in the source window.  This function
-**    initializes the horizontal scroll to 0.
-*/
+   ** tuiUpdateSourceWindow().
+   **    Function to display source in the source window.  This function
+   **    initializes the horizontal scroll to 0.
+ */
 void
 #ifdef __STDC__
 tuiUpdateSourceWindow (
@@ -135,10 +135,10 @@ tuiUpdateSourceWindow (winInfo, s, lineOrAddr, noerror)
 
 
 /*
-** tuiUpdateSourceWindowAsIs().
-**        Function to display source in the source/asm window.  This
-**        function shows the source as specified by the horizontal offset.
-*/
+   ** tuiUpdateSourceWindowAsIs().
+   **        Function to display source in the source/asm window.  This
+   **        function shows the source as specified by the horizontal offset.
+ */
 void
 #ifdef __STDC__
 tuiUpdateSourceWindowAsIs (
@@ -177,9 +177,9 @@ tuiUpdateSourceWindowAsIs (winInfo, s, lineOrAddr, noerror)
            (winInfo->generic.contentSize - 2);
          current_source_symtab = s;
          /*
-            ** If the focus was in the asm win, put it in the src
-            ** win if we don't have a split layout
-            */
+            ** If the focus was in the asm win, put it in the src
+            ** win if we don't have a split layout
+          */
          if (tuiWinWithFocus () == disassemWin &&
              currentLayout () != SRC_DISASSEM_COMMAND)
            tuiSetWinFocusTo (srcWin);
@@ -192,10 +192,10 @@ tuiUpdateSourceWindowAsIs (winInfo, s, lineOrAddr, noerror)
 
 
 /*
-** tuiUpdateSourceWindowsWithAddr().
-**        Function to ensure that the source and/or disassemly windows
-**        reflect the input address.
-*/
+   ** tuiUpdateSourceWindowsWithAddr().
+   **        Function to ensure that the source and/or disassemly windows
+   **        reflect the input address.
+ */
 void
 #ifdef __STDC__
 tuiUpdateSourceWindowsWithAddr (
@@ -244,9 +244,9 @@ tuiUpdateSourceWindowsWithAddr (addr)
 
 
 /*
-** tui_vUpdateSourceWindowsWithAddr()
-**        Update the source window with the address in a va_list
-*/
+   ** tui_vUpdateSourceWindowsWithAddr()
+   **        Update the source window with the address in a va_list
+ */
 void
 #ifdef __STDC__
 tui_vUpdateSourceWindowsWithAddr (
@@ -265,10 +265,10 @@ tui_vUpdateSourceWindowsWithAddr (args)
 
 
 /*
-** tuiUpdateSourceWindowsWithLine().
-**        Function to ensure that the source and/or disassemly windows
-**        reflect the input address.
-*/
+   ** tuiUpdateSourceWindowsWithLine().
+   **        Function to ensure that the source and/or disassemly windows
+   **        reflect the input address.
+ */
 void
 #ifdef __STDC__
 tuiUpdateSourceWindowsWithLine (
@@ -298,9 +298,9 @@ tuiUpdateSourceWindowsWithLine (s, line)
 
 
 /*
-** tui_vUpdateSourceWindowsWithLine()
-**        Update the source window with the line number in a va_list
-*/
+   ** tui_vUpdateSourceWindowsWithLine()
+   **        Update the source window with the line number in a va_list
+ */
 void
 #ifdef __STDC__
 tui_vUpdateSourceWindowsWithLine (
@@ -320,8 +320,8 @@ tui_vUpdateSourceWindowsWithLine (args)
 
 
 /*
-** tuiClearSourceContent().
-*/
+   ** tuiClearSourceContent().
+ */
 void
 #ifdef __STDC__
 tuiClearSourceContent (
@@ -353,8 +353,8 @@ tuiClearSourceContent (winInfo, displayPrompt)
 
 
 /*
-** tuiClearAllSourceWinsContent().
-*/
+   ** tuiClearAllSourceWinsContent().
+ */
 void
 #ifdef __STDC__
 tuiClearAllSourceWinsContent (
@@ -375,8 +375,8 @@ tuiClearAllSourceWinsContent (displayPrompt)
 
 
 /*
-** tuiEraseSourceContent().
-*/
+   ** tuiEraseSourceContent().
+ */
 void
 #ifdef __STDC__
 tuiEraseSourceContent (
@@ -413,9 +413,9 @@ tuiEraseSourceContent (winInfo, displayPrompt)
                     noSrcStr);
 
          /* elz: added this function call to set the real contents of
-                   the window to what is on the  screen, so that later calls
-                   to refresh, do display
-                   the correct stuff, and not the old image */
+            the window to what is on the  screen, so that later calls
+            to refresh, do display
+            the correct stuff, and not the old image */
 
          tuiSetSourceContentNil (winInfo, noSrcStr);
        }
@@ -426,8 +426,8 @@ tuiEraseSourceContent (winInfo, displayPrompt)
 
 
 /*
-** tuiEraseAllSourceContent().
-*/
+   ** tuiEraseAllSourceContent().
+ */
 void
 #ifdef __STDC__
 tuiEraseAllSourceWinsContent (
@@ -448,8 +448,8 @@ tuiEraseAllSourceWinsContent (displayPrompt)
 
 
 /*
-** tuiShowSourceContent().
-*/
+   ** tuiShowSourceContent().
+ */
 void
 #ifdef __STDC__
 tuiShowSourceContent (
@@ -483,8 +483,8 @@ tuiShowSourceContent (winInfo)
 
 
 /*
-** tuiShowAllSourceWinsContent()
-*/
+   ** tuiShowAllSourceWinsContent()
+ */
 void
 #ifdef __STDC__
 tuiShowAllSourceWinsContent (void)
@@ -502,9 +502,9 @@ tuiShowAllSourceWinsContent ()
 
 
 /*
-** tuiHorizontalSourceScroll().
-**      Scroll the source forward or backward horizontally
-*/
+   ** tuiHorizontalSourceScroll().
+   **      Scroll the source forward or backward horizontally
+ */
 void
 #ifdef __STDC__
 tuiHorizontalSourceScroll (
@@ -553,9 +553,9 @@ tuiHorizontalSourceScroll (winInfo, direction, numToScroll)
 
 
 /*
-** tuiSetHasExecPointAt().
-**        Set or clear the hasBreak flag in the line whose line is lineNo.
-*/
+   ** tuiSetHasExecPointAt().
+   **        Set or clear the hasBreak flag in the line whose line is lineNo.
+ */
 void
 #ifdef __STDC__
 tuiSetIsExecPointAt (
@@ -585,9 +585,9 @@ tuiSetIsExecPointAt (lineOrAddr, winInfo)
 
 
 /*
-** tuiSetHasBreakAt().
-**        Set or clear the hasBreak flag in the line whose line is lineNo.
-*/
+   ** tuiSetHasBreakAt().
+   **        Set or clear the hasBreak flag in the line whose line is lineNo.
+ */
 void
 #ifdef __STDC__
 tuiSetHasBreakAt (
@@ -643,9 +643,9 @@ tuiSetHasBreakAt (bp, winInfo, hasBreak)
 
 
 /*
-** tuiAllSetHasBreakAt().
-**        Set or clear the hasBreak flag in all displayed source windows.
-*/
+   ** tuiAllSetHasBreakAt().
+   **        Set or clear the hasBreak flag in all displayed source windows.
+ */
 void
 #ifdef __STDC__
 tuiAllSetHasBreakAt (
@@ -668,10 +668,10 @@ tuiAllSetHasBreakAt (bp, hasBreak)
 
 
 /*
-** tui_vAllSetHasBreakAt()
-**        Set or clear the hasBreak flag in all displayed source windows,
-**        with params in a va_list
-*/
+   ** tui_vAllSetHasBreakAt()
+   **        Set or clear the hasBreak flag in all displayed source windows,
+   **        with params in a va_list
+ */
 void
 #ifdef __STDC__
 tui_vAllSetHasBreakAt (
@@ -696,11 +696,11 @@ tui_vAllSetHasBreakAt (args)
 *********************************/
 
 /*
-** tuiSetExecInfoContent().
-**      Function to initialize the content of the execution info window,
-**      based upon the input window which is either the source or
-**      disassembly window.
-*/
+   ** tuiSetExecInfoContent().
+   **      Function to initialize the content of the execution info window,
+   **      based upon the input window which is either the source or
+   **      disassembly window.
+ */
 TuiStatus
 #ifdef __STDC__
 tuiSetExecInfoContent (
@@ -732,10 +732,10 @@ tuiSetExecInfoContent (winInfo)
              element = (TuiWinElementPtr) execInfoPtr->content[i];
              srcElement = (TuiWinElementPtr) winInfo->generic.content[i];
              /*
-                ** First check to see if we have a breakpoint that is
-                ** temporary.  If so, and this is our current execution point,
-                ** then clear the break indicator.
-                */
+                ** First check to see if we have a breakpoint that is
+                ** temporary.  If so, and this is our current execution point,
+                ** then clear the break indicator.
+              */
              if (srcElement->whichElement.source.hasBreak &&
                  srcElement->whichElement.source.isExecPoint)
                {
@@ -762,9 +762,9 @@ tuiSetExecInfoContent (winInfo)
                    srcElement->whichElement.source.hasBreak = FALSE;
                }
              /*
-                ** Now update the exec info content based upon the state
-                ** of each line as indicated by the source content.
-                */
+                ** Now update the exec info content based upon the state
+                ** of each line as indicated by the source content.
+              */
              if (srcElement->whichElement.source.hasBreak &&
                  srcElement->whichElement.source.isExecPoint)
                element->whichElement.simpleString = breakLocationStr ();
@@ -786,8 +786,8 @@ tuiSetExecInfoContent (winInfo)
 
 
 /*
-** tuiShowExecInfoContent().
-*/
+   ** tuiShowExecInfoContent().
+ */
 void
 #ifdef __STDC__
 tuiShowExecInfoContent (
@@ -816,8 +816,8 @@ tuiShowExecInfoContent (winInfo)
 
 
 /*
-** tuiShowAllExecInfosContent()
-*/
+   ** tuiShowAllExecInfosContent()
+ */
 void
 #ifdef __STDC__
 tuiShowAllExecInfosContent (void)
@@ -835,8 +835,8 @@ tuiShowAllExecInfosContent ()
 
 
 /*
-** tuiEraseExecInfoContent().
-*/
+   ** tuiEraseExecInfoContent().
+ */
 void
 #ifdef __STDC__
 tuiEraseExecInfoContent (
@@ -856,8 +856,8 @@ tuiEraseExecInfoContent (winInfo)
 
 
 /*
-** tuiEraseAllExecInfosContent()
-*/
+   ** tuiEraseAllExecInfosContent()
+ */
 void
 #ifdef __STDC__
 tuiEraseAllExecInfosContent (void)
@@ -875,8 +875,8 @@ tuiEraseAllExecInfosContent ()
 
 
 /*
-** tuiClearExecInfoContent().
-*/
+   ** tuiClearExecInfoContent().
+ */
 void
 #ifdef __STDC__
 tuiClearExecInfoContent (
@@ -894,8 +894,8 @@ tuiClearExecInfoContent (winInfo)
 
 
 /*
-** tuiClearAllExecInfosContent()
-*/
+   ** tuiClearAllExecInfosContent()
+ */
 void
 #ifdef __STDC__
 tuiClearAllExecInfosContent (void)
@@ -913,9 +913,9 @@ tuiClearAllExecInfosContent ()
 
 
 /*
-** tuiUpdateExecInfo().
-**        Function to update the execution info window
-*/
+   ** tuiUpdateExecInfo().
+   **        Function to update the execution info window
+ */
 void
 #ifdef __STDC__
 tuiUpdateExecInfo (
@@ -930,9 +930,9 @@ tuiUpdateExecInfo (winInfo)
 }                              /* tuiUpdateExecInfo
 
 
-/*
-** tuiUpdateAllExecInfos()
-*/
+                                  /*
+                                  ** tuiUpdateAllExecInfos()
+                                */
 void
 #ifdef __STDC__
 tuiUpdateAllExecInfos (void)
@@ -946,16 +946,16 @@ tuiUpdateAllExecInfos ()
     tuiUpdateExecInfo ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
 
   return;
-}                              /* tuiUpdateAllExecInfos*/
+}                              /* tuiUpdateAllExecInfos */
 
 
 
 /* tuiUpdateOnEnd()
-**       elz: This function clears the execution info from the source windows
-**       and resets the locator to display no line info, procedure info, pc
-**       info.  It is called by stack_publish_stopped_with_no_frame, which
-**       is called then the target terminates execution
-*/
+   **       elz: This function clears the execution info from the source windows
+   **       and resets the locator to display no line info, procedure info, pc
+   **       info.  It is called by stack_publish_stopped_with_no_frame, which
+   **       is called then the target terminates execution
+ */
 void
 #ifdef __STDC__
 tuiUpdateOnEnd (void)
@@ -977,11 +977,11 @@ tuiUpdateOnEnd ()
 
       tuiSetIsExecPointAt ((Opaque) - 1, winInfo);     /* the target is'n running */
       /* -1 should not match any line number or pc */
-      tuiSetExecInfoContent (winInfo); /*set winInfo so that > is'n displayed*/
-      tuiShowExecInfoContent (winInfo);        /* display the new contents */
+      tuiSetExecInfoContent (winInfo); /*set winInfo so that > is'n displayed */
+      tuiShowExecInfoContent (winInfo);                /* display the new contents */
     }
 
-  /*now update the locator*/
+  /*now update the locator */
   tuiClearLocatorDisplay ();
   tuiGetLocatorFilename (locator, &filename);
   tuiSetLocatorInfo (
@@ -1013,10 +1013,10 @@ tuiAllocSourceBuffer (winInfo)
   maxLines = winInfo->generic.height;  /* less the highlight box */
   lineWidth = winInfo->generic.width - 1;
   /*
-    ** Allocate the buffer for the source lines.  Do this only once since they
-    ** will be re-used for all source displays.  The only other time this will
-    ** be done is when a window's size changes.
-    */
+     ** Allocate the buffer for the source lines.  Do this only once since they
+     ** will be re-used for all source displays.  The only other time this will
+     ** be done is when a window's size changes.
+   */
   if (winInfo->generic.content == (OpaquePtr) NULL)
     {
       srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
@@ -1051,10 +1051,10 @@ tuiAllocSourceBuffer (winInfo)
 
 
 /*
-** tuiLineIsDisplayed().
-**      Answer whether the a particular line number or address is displayed
-**      in the current source window.
-*/
+   ** tuiLineIsDisplayed().
+   **      Answer whether the a particular line number or address is displayed
+   **      in the current source window.
+ */
 int
 #ifdef __STDC__
 tuiLineIsDisplayed (
index 13f3a78ab180159486c1d677f5de6ed8f9d5c2ea..2da01910a5ed4b2ad2bdc8648cb550d4f229abfd 100644 (file)
@@ -1,57 +1,57 @@
 #ifndef _TUI_SOURCEWIN_H
 #define _TUI_SOURCEWIN_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
 
-extern void         tuiDisplayMainFunction PARAMS ((void));
-extern void         tuiUpdateSourceWindow PARAMS 
-                       ((TuiWinInfoPtr, struct symtab *, Opaque, int));
-extern void         tuiUpdateSourceWindowAsIs PARAMS 
-                        ((TuiWinInfoPtr, struct symtab *, Opaque, int));
-extern void         tuiUpdateSourceWindowsWithAddr PARAMS ((Opaque));
-extern void         tui_vUpdateSourceWindowsWithAddr PARAMS ((va_list));
-extern void         tuiUpdateSourceWindowsWithLine PARAMS ((struct symtab *, int));
-extern void         tui_vUpdateSourceWindowsWithLine PARAMS ((va_list));
-extern void         tuiUpdateSourceWindowsFromLocator PARAMS ((void));
-extern void         tuiClearSourceContent PARAMS ((TuiWinInfoPtr, int));
-extern void         tuiClearAllSourceWinsContent PARAMS ((int));
-extern void         tuiEraseSourceContent PARAMS ((TuiWinInfoPtr, int));
-extern void         tuiEraseAllSourceWinsContent PARAMS ((int));
-extern void         tuiSetSourceContentNil PARAMS ((TuiWinInfoPtr, char *));
-extern void         tuiShowSourceContent PARAMS ((TuiWinInfoPtr));
-extern void         tuiShowAllSourceWinsContent PARAMS ((void));
-extern void         tuiHorizontalSourceScroll PARAMS ((TuiWinInfoPtr, TuiScrollDirection, int));
-extern void         tuiUpdateOnEnd PARAMS ((void));
+extern void tuiDisplayMainFunction PARAMS ((void));
+extern void tuiUpdateSourceWindow PARAMS
+  ((TuiWinInfoPtr, struct symtab *, Opaque, int));
+extern void tuiUpdateSourceWindowAsIs PARAMS
+  ((TuiWinInfoPtr, struct symtab *, Opaque, int));
+extern void tuiUpdateSourceWindowsWithAddr PARAMS ((Opaque));
+extern void tui_vUpdateSourceWindowsWithAddr PARAMS ((va_list));
+extern void tuiUpdateSourceWindowsWithLine PARAMS ((struct symtab *, int));
+extern void tui_vUpdateSourceWindowsWithLine PARAMS ((va_list));
+extern void tuiUpdateSourceWindowsFromLocator PARAMS ((void));
+extern void tuiClearSourceContent PARAMS ((TuiWinInfoPtr, int));
+extern void tuiClearAllSourceWinsContent PARAMS ((int));
+extern void tuiEraseSourceContent PARAMS ((TuiWinInfoPtr, int));
+extern void tuiEraseAllSourceWinsContent PARAMS ((int));
+extern void tuiSetSourceContentNil PARAMS ((TuiWinInfoPtr, char *));
+extern void tuiShowSourceContent PARAMS ((TuiWinInfoPtr));
+extern void tuiShowAllSourceWinsContent PARAMS ((void));
+extern void tuiHorizontalSourceScroll PARAMS ((TuiWinInfoPtr, TuiScrollDirection, int));
+extern void tuiUpdateOnEnd PARAMS ((void));
 
-extern TuiStatus    tuiSetExecInfoContent PARAMS ((TuiWinInfoPtr));
-extern void         tuiShowExecInfoContent PARAMS ((TuiWinInfoPtr));
-extern void         tuiShowAllExecInfosContent PARAMS ((void));
-extern void         tuiEraseExecInfoContent PARAMS ((TuiWinInfoPtr));
-extern void         tuiEraseAllExecInfosContent PARAMS ((void));
-extern void         tuiClearExecInfoContent PARAMS ((TuiWinInfoPtr));
-extern void         tuiClearAllExecInfosContent PARAMS ((void));
-extern void         tuiUpdateExecInfo PARAMS ((TuiWinInfoPtr));
-extern void         tuiUpdateAllExecInfos PARAMS ((void));
+extern TuiStatus tuiSetExecInfoContent PARAMS ((TuiWinInfoPtr));
+extern void tuiShowExecInfoContent PARAMS ((TuiWinInfoPtr));
+extern void tuiShowAllExecInfosContent PARAMS ((void));
+extern void tuiEraseExecInfoContent PARAMS ((TuiWinInfoPtr));
+extern void tuiEraseAllExecInfosContent PARAMS ((void));
+extern void tuiClearExecInfoContent PARAMS ((TuiWinInfoPtr));
+extern void tuiClearAllExecInfosContent PARAMS ((void));
+extern void tuiUpdateExecInfo PARAMS ((TuiWinInfoPtr));
+extern void tuiUpdateAllExecInfos PARAMS ((void));
 
-extern void         tuiSetIsExecPointAt PARAMS ((Opaque, TuiWinInfoPtr));
-extern void         tuiSetHasBreakAt PARAMS ((struct breakpoint *, TuiWinInfoPtr, int));
-extern void         tuiAllSetHasBreakAt PARAMS ((struct breakpoint *, int));
-extern void         tui_vAllSetHasBreakAt PARAMS ((va_list));
-extern TuiStatus    tuiAllocSourceBuffer PARAMS ((TuiWinInfoPtr));
-extern int          tuiLineIsDisplayed PARAMS ((Opaque, TuiWinInfoPtr, int));
+extern void tuiSetIsExecPointAt PARAMS ((Opaque, TuiWinInfoPtr));
+extern void tuiSetHasBreakAt PARAMS ((struct breakpoint *, TuiWinInfoPtr, int));
+extern void tuiAllSetHasBreakAt PARAMS ((struct breakpoint *, int));
+extern void tui_vAllSetHasBreakAt PARAMS ((va_list));
+extern TuiStatus tuiAllocSourceBuffer PARAMS ((TuiWinInfoPtr));
+extern int tuiLineIsDisplayed PARAMS ((Opaque, TuiWinInfoPtr, int));
 
 
 /*
-** Constant definitions
-*/
-#define        SCROLL_THRESHOLD            2 /* threshold for lazy scroll */
+   ** Constant definitions
+ */
+#define        SCROLL_THRESHOLD            2   /* threshold for lazy scroll */
 
 
 /*
-** Macros 
-*/
+   ** Macros 
+ */
 #define    m_tuiSetBreakAt(bp, winInfo)       tuiSetHasBreakAt((bp, winInfo, TRUE)
 #define    m_tuiClearBreakAt(bp, winInfo)     tuiSetHasBreakAt(bp, winInfo, FALSE)
 
@@ -71,4 +71,5 @@ extern int          tuiLineIsDisplayed PARAMS ((Opaque, TuiWinInfoPtr, int));
 
 
 
-#endif /*_TUI_SOURCEWIN_H */
+#endif
+/*_TUI_SOURCEWIN_H */
index 401dfe23d82c48c8a866c32c79ae361596cb115c..c9c95d2766d425b0120b7bfb88d1dcc2c9ac20d9 100644 (file)
@@ -1,6 +1,6 @@
 /*
-** This module contains functions for displaying the locator information in the locator window.
-*/
+   ** This module contains functions for displaying the locator information in the locator window.
+ */
 
 #include "defs.h"
 #include "symtab.h"
@@ -27,8 +27,8 @@ static void _tuiUpdateLocation_command PARAMS ((char *, int));
 ******************************************/
 
 /*
-** tuiClearLocatorDisplay()
-*/
+   ** tuiClearLocatorDisplay()
+ */
 void
 #ifdef __STDC__
 tuiClearLocatorDisplay (void)
@@ -43,7 +43,7 @@ tuiClearLocatorDisplay ()
     {
       /* No need to werase, since writing a line of
          * blanks which we do below, is equivalent.
-         */
+       */
       /* werase(locator->handle); */
       wmove (locator->handle, 0, 0);
       wstandout (locator->handle);
@@ -60,8 +60,8 @@ tuiClearLocatorDisplay ()
 
 
 /*
-** tuiShowLocatorContent()
-*/
+   ** tuiShowLocatorContent()
+ */
 void
 #ifdef __STDC__
 tuiShowLocatorContent (void)
@@ -96,9 +96,9 @@ tuiShowLocatorContent ()
 
 
 /*
-** tuiSetLocatorInfo().
-**        Function to update the locator, with the provided arguments.
-*/
+   ** tuiSetLocatorInfo().
+   **        Function to update the locator, with the provided arguments.
+ */
 void
 #ifdef __STDC__
 tuiSetLocatorInfo (
@@ -145,9 +145,9 @@ tuiSetLocatorInfo (fname, procname, lineNo, addr, element)
 
 
 /*
-** tuiUpdateLocatorFilename().
-**        Update only the filename portion of the locator.
-*/
+   ** tuiUpdateLocatorFilename().
+   **        Update only the filename portion of the locator.
+ */
 void
 #ifdef __STDC__
 tuiUpdateLocatorFilename (
@@ -173,9 +173,9 @@ tuiUpdateLocatorFilename (fileName)
 
 
 /*
-** tui_vUpdateLocatorFilename().
-**        Update only the filename portion of the locator with args in a va_list.
-*/
+   ** tui_vUpdateLocatorFilename().
+   **        Update only the filename portion of the locator with args in a va_list.
+ */
 void
 #ifdef __STDC__
 tui_vUpdateLocatorFilename (
@@ -195,10 +195,10 @@ tui_vUpdateLocatorFilename (args)
 
 
 /*
-** tuiSwitchFilename().
-**   Update the filename portion of the locator. Clear the other info in locator.
-** (elz)
-*/
+   ** tuiSwitchFilename().
+   **   Update the filename portion of the locator. Clear the other info in locator.
+   ** (elz)
+ */
 void
 #ifdef __STDC__
 tuiSwitchFilename (
@@ -227,10 +227,10 @@ tuiSwitchFilename (fileName)
 
 
 /*
-** tuiGetLocatorFilename().
-**   Get the filename portion of the locator.
-** (elz)
-*/
+   ** tuiGetLocatorFilename().
+   **   Get the filename portion of the locator.
+   ** (elz)
+ */
 void
 #ifdef __STDC__
 tuiGetLocatorFilename (
@@ -260,9 +260,9 @@ tuiGetLocatorFilename (locator, filename)
 
 
 /*
-** tuiUpdateLocatorInfoFromFrame().
-**        Function to update the locator, with the information extracted from frameInfo
-*/
+   ** tuiUpdateLocatorInfoFromFrame().
+   **        Function to update the locator, with the information extracted from frameInfo
+ */
 void
 #ifdef __STDC__
 tuiUpdateLocatorInfoFromFrame (
@@ -299,9 +299,9 @@ tuiUpdateLocatorInfoFromFrame (frameInfo, element)
 
 
 /*
-** tuiSetLocatorContent().
-**        Function to set the content of the locator
-*/
+   ** tuiSetLocatorContent().
+   **        Function to set the content of the locator
+ */
 void
 #ifdef __STDC__
 tuiSetLocatorContent (
@@ -339,9 +339,9 @@ tuiSetLocatorContent (frameInfo)
 
 
 /*
-** tuiUpdateLocatorDisplay().
-**        Function to update the locator display
-*/
+   ** tuiUpdateLocatorDisplay().
+   **        Function to update the locator display
+ */
 void
 #ifdef __STDC__
 tuiUpdateLocatorDisplay (
@@ -360,9 +360,9 @@ tuiUpdateLocatorDisplay (frameInfo)
 
 
 /*
-** tuiShowFrameInfo().
-**        Function to print the frame inforrmation for the TUI.
-*/
+   ** tuiShowFrameInfo().
+   **        Function to print the frame inforrmation for the TUI.
+ */
 void
 #ifdef __STDC__
 tuiShowFrameInfo (
@@ -449,9 +449,9 @@ tuiShowFrameInfo (fi)
 
 
 /*
-** tui_vShowFrameInfo().
-**        Function to print the frame inforrmation for the TUI with args in a va_list.
-*/
+   ** tui_vShowFrameInfo().
+   **        Function to print the frame inforrmation for the TUI with args in a va_list.
+ */
 void
 #ifdef __STDC__
 tui_vShowFrameInfo (
@@ -471,9 +471,9 @@ tui_vShowFrameInfo (args)
 
 
 /*
-** _initialize_tuiStack().
-**      Function to initialize gdb commands, for tui window stack manipulation.
-*/
+   ** _initialize_tuiStack().
+   **      Function to initialize gdb commands, for tui window stack manipulation.
+ */
 void
 _initialize_tuiStack ()
 {
@@ -492,8 +492,8 @@ _initialize_tuiStack ()
 ******************************************/
 
 /*
-**    _getFuncNameFromFrame().
-*/
+   **    _getFuncNameFromFrame().
+ */
 static char *
 #ifdef __STDC__
 _getFuncNameFromFrame (
@@ -514,9 +514,9 @@ _getFuncNameFromFrame (frameInfo)
 
 
 /*
-** _tuiUpdateLocation_command().
-**        Command to update the display with the current execution point
-*/
+   ** _tuiUpdateLocation_command().
+   **        Command to update the display with the current execution point
+ */
 static void
 #ifdef __STDC__
 _tuiUpdateLocation_command (
index 20e9a92c61c2b19ada704b3a54c86dea84f54c6a..4d7f2f0a5b441141ca49fde9ee81bb360bf6ec74 100644 (file)
@@ -1,22 +1,23 @@
 #ifndef _TUI_STACK_H
 #define _TUI_STACK_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
-extern void         tuiSetLocatorInfo PARAMS ((char *, char *, int, Opaque, TuiLocatorElementPtr));
-extern void         tuiUpdateLocatorFilename PARAMS ((char *));
-extern void         tui_vUpdateLocatorFilename PARAMS ((va_list));
-extern void         tuiUpdateLocatorInfoFromFrame 
-                        PARAMS ((struct frame_info *, TuiLocatorElementPtr));
-extern void         tuiUpdateLocatorDisplay PARAMS ((struct frame_info *));
-extern void         tuiSetLocatorContent PARAMS ((struct frame_info *));
-extern void         tuiShowLocatorContent PARAMS ((void));
-extern void         tuiClearLocatorContent PARAMS ((void));
-extern void         tuiSwitchFilename PARAMS ((char *));
-extern void         tuiShowFrameInfo PARAMS ((struct frame_info *));
-extern void         tui_vShowFrameInfo PARAMS ((va_list));
-extern void         tuiGetLocatorFilename PARAMS ((TuiGenWinInfoPtr, char **));
+extern void tuiSetLocatorInfo PARAMS ((char *, char *, int, Opaque, TuiLocatorElementPtr));
+extern void tuiUpdateLocatorFilename PARAMS ((char *));
+extern void tui_vUpdateLocatorFilename PARAMS ((va_list));
+extern void tuiUpdateLocatorInfoFromFrame
+  PARAMS ((struct frame_info *, TuiLocatorElementPtr));
+extern void tuiUpdateLocatorDisplay PARAMS ((struct frame_info *));
+extern void tuiSetLocatorContent PARAMS ((struct frame_info *));
+extern void tuiShowLocatorContent PARAMS ((void));
+extern void tuiClearLocatorContent PARAMS ((void));
+extern void tuiSwitchFilename PARAMS ((char *));
+extern void tuiShowFrameInfo PARAMS ((struct frame_info *));
+extern void tui_vShowFrameInfo PARAMS ((va_list));
+extern void tuiGetLocatorFilename PARAMS ((TuiGenWinInfoPtr, char **));
 
 
-#endif /*_TUI_STACK_H*/
+#endif
+/*_TUI_STACK_H*/
index 45bb0f6a4e921f8f2b961281d7829caff1c982a5..9e09911cd8964a716c642e26d7baa7231dac4e85 100644 (file)
@@ -1,10 +1,10 @@
 /*
-** tuiWin.c
-**    This module contains procedures for handling tui window functions
-**    like resize, scrolling, scrolling, changing focus, etc.
-**
-** Author: Susan B. Macchia
-*/
+   ** tuiWin.c
+   **    This module contains procedures for handling tui window functions
+   **    like resize, scrolling, scrolling, changing focus, etc.
+   **
+   ** Author: Susan B. Macchia
+ */
 
 
 #include <string.h>
@@ -58,9 +58,9 @@ static void _parseScrollingArgs PARAMS ((char *, TuiWinInfoPtr *, int *));
 ***************************************/
 
 /*
-** _initialize_tuiWin().
-**        Function to initialize gdb commands, for tui window manipulation.
-*/
+   ** _initialize_tuiWin().
+   **        Function to initialize gdb commands, for tui window manipulation.
+ */
 void
 _initialize_tuiWin ()
 {
@@ -112,9 +112,9 @@ Usage: w <#lines>\n");
 
 
 /*
-** tuiClearWinFocusFrom
-**        Clear the logical focus from winInfo
-*/
+   ** tuiClearWinFocusFrom
+   **        Clear the logical focus from winInfo
+ */
 void
 #ifdef __STDC__
 tuiClearWinFocusFrom (
@@ -136,9 +136,9 @@ tuiClearWinFocusFrom (winInfo)
 
 
 /*
-** tuiClearWinFocus().
-**        Clear the window that has focus.
-*/
+   ** tuiClearWinFocus().
+   **        Clear the window that has focus.
+ */
 void
 #ifdef __STDC__
 tuiClearWinFocus (void)
@@ -153,9 +153,9 @@ tuiClearWinFocus ()
 
 
 /*
-** tuiSetWinFocusTo
-**        Set the logical focus to winInfo
-*/
+   ** tuiSetWinFocusTo
+   **        Set the logical focus to winInfo
+ */
 void
 #ifdef __STDC__
 tuiSetWinFocusTo (
@@ -203,8 +203,8 @@ tuiStrDup (str)
 
 
 /*
-** tuiScrollForward().
-*/
+   ** tuiScrollForward().
+ */
 void
 #ifdef __STDC__
 tuiScrollForward (
@@ -223,11 +223,11 @@ tuiScrollForward (winToScroll, numToScroll)
       if (numToScroll == 0)
        _numToScroll = winToScroll->generic.height - 3;
       /*
-        ** If we are scrolling the source or disassembly window, do a
-        ** "psuedo" scroll since not all of the source is in memory,
-        ** only what is in the viewport.  If winToScroll is the
-        ** command window do nothing since the term should handle it.
-        */
+         ** If we are scrolling the source or disassembly window, do a
+         ** "psuedo" scroll since not all of the source is in memory,
+         ** only what is in the viewport.  If winToScroll is the
+         ** command window do nothing since the term should handle it.
+       */
       if (winToScroll == srcWin)
        tuiVerticalSourceScroll (FORWARD_SCROLL, _numToScroll);
       else if (winToScroll == disassemWin)
@@ -241,8 +241,8 @@ tuiScrollForward (winToScroll, numToScroll)
 
 
 /*
-** tuiScrollBackward().
-*/
+   ** tuiScrollBackward().
+ */
 void
 #ifdef __STDC__
 tuiScrollBackward (
@@ -261,11 +261,11 @@ tuiScrollBackward (winToScroll, numToScroll)
       if (numToScroll == 0)
        _numToScroll = winToScroll->generic.height - 3;
       /*
-        ** If we are scrolling the source or disassembly window, do a
-        ** "psuedo" scroll since not all of the source is in memory,
-        ** only what is in the viewport.  If winToScroll is the
-        ** command window do nothing since the term should handle it.
-        */
+         ** If we are scrolling the source or disassembly window, do a
+         ** "psuedo" scroll since not all of the source is in memory,
+         ** only what is in the viewport.  If winToScroll is the
+         ** command window do nothing since the term should handle it.
+       */
       if (winToScroll == srcWin)
        tuiVerticalSourceScroll (BACKWARD_SCROLL, _numToScroll);
       else if (winToScroll == disassemWin)
@@ -278,8 +278,8 @@ tuiScrollBackward (winToScroll, numToScroll)
 
 
 /*
-** tuiScrollLeft().
-*/
+   ** tuiScrollLeft().
+ */
 void
 #ifdef __STDC__
 tuiScrollLeft (
@@ -298,11 +298,11 @@ tuiScrollLeft (winToScroll, numToScroll)
       if (_numToScroll == 0)
        _numToScroll = 1;
       /*
-        ** If we are scrolling the source or disassembly window, do a
-        ** "psuedo" scroll since not all of the source is in memory,
-        ** only what is in the viewport. If winToScroll is the
-        ** command window do nothing since the term should handle it.
-        */
+         ** If we are scrolling the source or disassembly window, do a
+         ** "psuedo" scroll since not all of the source is in memory,
+         ** only what is in the viewport. If winToScroll is the
+         ** command window do nothing since the term should handle it.
+       */
       if (winToScroll == srcWin || winToScroll == disassemWin)
        tuiHorizontalSourceScroll (winToScroll, LEFT_SCROLL, _numToScroll);
     }
@@ -311,8 +311,8 @@ tuiScrollLeft (winToScroll, numToScroll)
 
 
 /*
-** tuiScrollRight().
-*/
+   ** tuiScrollRight().
+ */
 void
 #ifdef __STDC__
 tuiScrollRight (
@@ -331,11 +331,11 @@ tuiScrollRight (winToScroll, numToScroll)
       if (_numToScroll == 0)
        _numToScroll = 1;
       /*
-        ** If we are scrolling the source or disassembly window, do a
-        ** "psuedo" scroll since not all of the source is in memory,
-        ** only what is in the viewport. If winToScroll is the
-        ** command window do nothing since the term should handle it.
-        */
+         ** If we are scrolling the source or disassembly window, do a
+         ** "psuedo" scroll since not all of the source is in memory,
+         ** only what is in the viewport. If winToScroll is the
+         ** command window do nothing since the term should handle it.
+       */
       if (winToScroll == srcWin || winToScroll == disassemWin)
        tuiHorizontalSourceScroll (winToScroll, RIGHT_SCROLL, _numToScroll);
     }
@@ -344,9 +344,9 @@ tuiScrollRight (winToScroll, numToScroll)
 
 
 /*
-** tui_vScroll().
-**    Scroll a window.  Arguments are passed through a va_list.
-*/
+   ** tui_vScroll().
+   **    Scroll a window.  Arguments are passed through a va_list.
+ */
 void
 #ifdef __STDC__
 tui_vScroll (
@@ -383,8 +383,8 @@ tui_vScroll (args)
 
 
 /*
-** tuiRefreshAll().
-*/
+   ** tuiRefreshAll().
+ */
 void
 #ifdef __STDC__
 tuiRefreshAll (void)
@@ -427,10 +427,10 @@ tuiRefreshAll ()
 
 
 /*
-** tuiResizeAll().
-**      Resize all the windows based on the the terminal size.  This
-**      function gets called from within the readline sinwinch handler.
-*/
+   ** tuiResizeAll().
+   **      Resize all the windows based on the the terminal size.  This
+   **      function gets called from within the readline sinwinch handler.
+ */
 void
 #ifdef __STDC__
 tuiResizeAll (void)
@@ -439,7 +439,7 @@ tuiResizeAll ()
 #endif
 {
   int heightDiff, widthDiff;
-  extern int screenheight, screenwidth;        /* in readline */
+  extern int screenheight, screenwidth;                /* in readline */
 
   widthDiff = screenwidth - termWidth ();
   heightDiff = screenheight - termHeight ();
@@ -571,9 +571,9 @@ tuiResizeAll ()
          break;
        }
       /*
-        ** Now remove all invisible windows, and their content so that they get
-        ** created again when called for with the new size
-        */
+         ** Now remove all invisible windows, and their content so that they get
+         ** created again when called for with the new size
+       */
       for (winType = SRC_WIN; (winType < MAX_MAJOR_WINDOWS); winType++)
        {
          if (winType != CMD_WIN && m_winPtrNotNull (winList[winType]) &&
@@ -593,11 +593,11 @@ tuiResizeAll ()
 
 
 /*
-** tuiSigwinchHandler()
-**    SIGWINCH signal handler for the tui.  This signal handler is
-**    always called, even when the readline package clears signals
-**    because it is set as the old_sigwinch() (TUI only)
-*/
+   ** tuiSigwinchHandler()
+   **    SIGWINCH signal handler for the tui.  This signal handler is
+   **    always called, even when the readline package clears signals
+   **    because it is set as the old_sigwinch() (TUI only)
+ */
 void
 #ifdef __STDC__
 tuiSigwinchHandler (
@@ -608,9 +608,9 @@ tuiSigwinchHandler (signal)
 #endif
 {
   /*
-    ** Say that a resize was done so that the readline can do it
-    ** later when appropriate.
-    */
+     ** Say that a resize was done so that the readline can do it
+     ** later when appropriate.
+   */
   tuiSetWinResizedTo (TRUE);
 
   return;
@@ -624,8 +624,8 @@ tuiSigwinchHandler (signal)
 
 
 /*
-** _tuiScrollForward_command().
-*/
+   ** _tuiScrollForward_command().
+ */
 static void
 #ifdef __STDC__
 _tuiScrollForward_command (
@@ -654,8 +654,8 @@ _tuiScrollForward_command (arg, fromTTY)
 
 
 /*
-** _tuiScrollBackward_command().
-*/
+   ** _tuiScrollBackward_command().
+ */
 static void
 #ifdef __STDC__
 _tuiScrollBackward_command (
@@ -684,8 +684,8 @@ _tuiScrollBackward_command (arg, fromTTY)
 
 
 /*
-** _tuiScrollLeft_command().
-*/
+   ** _tuiScrollLeft_command().
+ */
 static void
 #ifdef __STDC__
 _tuiScrollLeft_command (
@@ -711,8 +711,8 @@ _tuiScrollLeft_command (arg, fromTTY)
 
 
 /*
-** _tuiScrollRight_command().
-*/
+   ** _tuiScrollRight_command().
+ */
 static void
 #ifdef __STDC__
 _tuiScrollRight_command (
@@ -738,9 +738,9 @@ _tuiScrollRight_command (arg, fromTTY)
 
 
 /*
-** _tuiSetFocus().
-**     Set focus to the window named by 'arg'
-*/
+   ** _tuiSetFocus().
+   **     Set focus to the window named by 'arg'
+ */
 static void
 #ifdef __STDC__
 _tuiSetFocus (
@@ -791,8 +791,8 @@ The window name specified must be valid and visible.\n");
 
 
 /*
-** _tui_vSetFocus()
-*/
+   ** _tui_vSetFocus()
+ */
 static void
 #ifdef __STDC__
 _tui_vSetFocus (
@@ -812,8 +812,8 @@ _tui_vSetFocus (args)
 
 
 /*
-** _tuiSetFocus_command()
-*/
+   ** _tuiSetFocus_command()
+ */
 static void
 #ifdef __STDC__
 _tuiSetFocus_command (
@@ -832,8 +832,8 @@ _tuiSetFocus_command (arg, fromTTY)
 
 
 /*
-** _tuiAllWindowsInfo().
-*/
+   ** _tuiAllWindowsInfo().
+ */
 static void
 #ifdef __STDC__
 _tuiAllWindowsInfo (
@@ -866,8 +866,8 @@ _tuiAllWindowsInfo (arg, fromTTY)
 
 
 /*
-** _tuiRefreshAll_command().
-*/
+   ** _tuiRefreshAll_command().
+ */
 static void
 #ifdef __STDC__
 _tuiRefreshAll_command (
@@ -884,9 +884,9 @@ _tuiRefreshAll_command (arg, fromTTY)
 
 
 /*
-** _tuiSetWinTabWidth_command().
-**        Set the height of the specified window.
-*/
+   ** _tuiSetWinTabWidth_command().
+   **        Set the height of the specified window.
+ */
 static void
 #ifdef __STDC__
 _tuiSetTabWidth_command (
@@ -914,9 +914,9 @@ _tuiSetTabWidth_command (arg, fromTTY)
 
 
 /*
-** _tuiSetWinHeight().
-**        Set the height of the specified window.
-*/
+   ** _tuiSetWinHeight().
+   **        Set the height of the specified window.
+ */
 static void
 #ifdef __STDC__
 _tuiSetWinHeight (
@@ -943,8 +943,8 @@ _tuiSetWinHeight (arg, fromTTY)
          *bufPtr = (char) 0;
 
          /*
-            ** Validate the window name
-            */
+            ** Validate the window name
+          */
          for (i = 0; i < strlen (wname); i++)
            wname[i] = toupper (wname[i]);
          winInfo = partialWinByName (wname);
@@ -981,9 +981,9 @@ The window name specified must be valid and visible.\n");
                      else
                        newHeight = winInfo->generic.height + inputNo;
                      /*
-                        ** Now change the window's height, and adjust all
-                        ** other windows around it
-                        */
+                        ** Now change the window's height, and adjust all
+                        ** other windows around it
+                      */
                      if (_tuiAdjustWinHeights (winInfo,
                                                newHeight) == TUI_FAILURE)
                        warning ("Invalid window height specified.\n%s",
@@ -1011,9 +1011,9 @@ The window name specified must be valid and visible.\n");
 
 
 /*
-** _tui_vSetWinHeight().
-**        Set the height of the specified window, with va_list.
-*/
+   ** _tui_vSetWinHeight().
+   **        Set the height of the specified window, with va_list.
+ */
 static void
 #ifdef __STDC__
 _tui_vSetWinHeight (
@@ -1033,9 +1033,9 @@ _tui_vSetWinHeight (args)
 
 
 /*
-** _tuiSetWinHeight_command().
-**        Set the height of the specified window, with va_list.
-*/
+   ** _tuiSetWinHeight_command().
+   **        Set the height of the specified window, with va_list.
+ */
 static void
 #ifdef __STDC__
 _tuiSetWinHeight_command (
@@ -1054,10 +1054,10 @@ _tuiSetWinHeight_command (arg, fromTTY)
 
 
 /*
-** _tuiXDBsetWinHeight().
-**        XDB Compatibility command for setting the window height.  This will
-**        increase or decrease the command window by the specified amount.
-*/
+   ** _tuiXDBsetWinHeight().
+   **        XDB Compatibility command for setting the window height.  This will
+   **        increase or decrease the command window by the specified amount.
+ */
 static void
 #ifdef __STDC__
 _tuiXDBsetWinHeight (
@@ -1095,9 +1095,9 @@ _tuiXDBsetWinHeight (arg, fromTTY)
 
 
 /*
-** _tui_vXDBsetWinHeight().
-**        Set the height of the specified window, with va_list.
-*/
+   ** _tui_vXDBsetWinHeight().
+   **        Set the height of the specified window, with va_list.
+ */
 static void
 #ifdef __STDC__
 _tui_vXDBsetWinHeight (
@@ -1117,9 +1117,9 @@ _tui_vXDBsetWinHeight (args)
 
 
 /*
-** _tuiSetWinHeight_command().
-**        Set the height of the specified window, with va_list.
-*/
+   ** _tuiSetWinHeight_command().
+   **        Set the height of the specified window, with va_list.
+ */
 static void
 #ifdef __STDC__
 _tuiXDBsetWinHeight_command (
@@ -1138,9 +1138,9 @@ _tuiXDBsetWinHeight_command (arg, fromTTY)
 
 
 /*
-** _tuiAdjustWinHeights().
-**        Function to adjust all window heights around the primary
-*/
+   ** _tuiAdjustWinHeights().
+   **        Function to adjust all window heights around the primary
+ */
 static TuiStatus
 #ifdef __STDC__
 _tuiAdjustWinHeights (
@@ -1204,9 +1204,9 @@ _tuiAdjustWinHeights (primaryWinInfo, newHeight)
                }
              if (primaryWinInfo == cmdWin)
                {               /*
-                    ** Split the change in height accross the 1st & 2nd windows
-                    ** adjusting them as well.
-                    */
+                                  ** Split the change in height accross the 1st & 2nd windows
+                                  ** adjusting them as well.
+                                */
                  int firstSplitDiff = diff / 2;        /* subtract the locator */
                  int secondSplitDiff = firstSplitDiff;
 
@@ -1250,9 +1250,9 @@ _tuiAdjustWinHeights (primaryWinInfo, newHeight)
                {
                  if ((cmdWin->generic.height + diff) < 1)
                    {           /*
-                        ** If there is no way to increase the command window
-                        ** take real estate from the 1st or 2nd window.
-                        */
+                                  ** If there is no way to increase the command window
+                                  ** take real estate from the 1st or 2nd window.
+                                */
                      if ((cmdWin->generic.height + diff) < 1)
                        {
                          int i;
@@ -1299,10 +1299,10 @@ _tuiAdjustWinHeights (primaryWinInfo, newHeight)
 
 
 /*
-** _makeInvisibleAndSetNewHeight().
-**        Function make the target window (and auxillary windows associated
-**        with the targer) invisible, and set the new height and location.
-*/
+   ** _makeInvisibleAndSetNewHeight().
+   **        Function make the target window (and auxillary windows associated
+   **        with the targer) invisible, and set the new height and location.
+ */
 static void
 #ifdef __STDC__
 _makeInvisibleAndSetNewHeight (
@@ -1370,11 +1370,11 @@ _makeInvisibleAndSetNewHeight (winInfo, height)
 
 
 /*
-** _makeVisibleWithNewHeight().
-**        Function to make the windows with new heights visible.
-**        This means re-creating the windows' content since the window
-**        had to be destroyed to be made invisible.
-*/
+   ** _makeVisibleWithNewHeight().
+   **        Function to make the windows with new heights visible.
+   **        This means re-creating the windows' content since the window
+   **        had to be destroyed to be made invisible.
+ */
 static void
 #ifdef __STDC__
 _makeVisibleWithNewHeight (
@@ -1505,14 +1505,14 @@ _newHeightOk (primaryWinInfo, newHeight)
              secondWin = (TuiWinInfoPtr) (sourceWindows ())->list[0];
            }
          /*
-            ** We could simply add all the heights to obtain the same result
-            ** but below is more explicit since we subtract 1 for the
-            ** line that the first and second windows share, and add one
-            ** for the locator.
-            */
+            ** We could simply add all the heights to obtain the same result
+            ** but below is more explicit since we subtract 1 for the
+            ** line that the first and second windows share, and add one
+            ** for the locator.
+          */
          curTotalHeight =
            (firstWin->generic.height + secondWin->generic.height - 1)
-           + cmdWin->generic.height + 1 /*locator*/ ;
+           + cmdWin->generic.height + 1 /*locator */ ;
          if (primaryWinInfo == cmdWin)
            {
              /* locator included since first & second win share a line */
@@ -1531,16 +1531,16 @@ _newHeightOk (primaryWinInfo, newHeight)
            {
              minHeight = MIN_WIN_HEIGHT;
              /*
-                ** First see if we can increase/decrease the command
-                ** window.  And make sure that the command window is
-                ** at least 1 line
-                */
+                ** First see if we can increase/decrease the command
+                ** window.  And make sure that the command window is
+                ** at least 1 line
+              */
              ok = ((cmdWin->generic.height + diff) > 0);
              if (!ok)
                {               /*
-                     ** Looks like we have to increase/decrease one of
-                     ** the other windows
-                     */
+                                  ** Looks like we have to increase/decrease one of
+                                  ** the other windows
+                                */
                  if (primaryWinInfo == firstWin)
                    ok = (secondWin->generic.height + diff) >= minHeight;
                  else
@@ -1559,9 +1559,9 @@ _newHeightOk (primaryWinInfo, newHeight)
                }
            }
          /*
-            ** Now make sure that the proposed total height doesn't exceed
-            ** the old total height.
-            */
+            ** Now make sure that the proposed total height doesn't exceed
+            ** the old total height.
+          */
          if (ok)
            ok = (newHeight >= minHeight && totalHeight <= curTotalHeight);
        }
@@ -1572,8 +1572,8 @@ _newHeightOk (primaryWinInfo, newHeight)
 
 
 /*
-** _parseScrollingArgs().
-*/
+   ** _parseScrollingArgs().
+ */
 static void
 #ifdef __STDC__
 _parseScrollingArgs (
@@ -1592,9 +1592,9 @@ _parseScrollingArgs (arg, winToScroll, numToScroll)
   *winToScroll = tuiWinWithFocus ();
 
   /*
-    ** First set up the default window to scroll, in case there is no
-    ** window name arg
-    */
+     ** First set up the default window to scroll, in case there is no
+     ** window name arg
+   */
   if (arg != (char *) NULL)
     {
       char *buf, *bufPtr;
index cb8455dd8e0813f030de0ce84c33971514c44ff7..70bf68b221875bdc2e787cde2cd7b8fae461b911 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TUI_WIN_H
 #define _TUI_WIN_H
 /*
-** This header file supports
-*/
+   ** This header file supports
+ */
 
 /*****************************************
 ** TYPE DEFINITIONS                        **
 /*****************************************
 ** PUBLIC FUNCTION EXTERNAL DECLS        **
 ******************************************/
-extern void             tuiScrollForward PARAMS ((TuiWinInfoPtr, int));
-extern void             tuiScrollBackward PARAMS ((TuiWinInfoPtr, int));
-extern void             tuiScrollLeft PARAMS ((TuiWinInfoPtr, int));
-extern void             tuiScrollRight PARAMS ((TuiWinInfoPtr, int));
-extern void             tui_vScroll PARAMS ((va_list));
-extern void             tuiSetWinFocusTo PARAMS ((TuiWinInfoPtr));
-extern void             tuiClearWinFocusFrom PARAMS ((TuiWinInfoPtr));
-extern void             tuiClearWinFocus PARAMS ((void));
-extern void             tuiResizeAll PARAMS ((void));
-extern void             tuiRefreshAll PARAMS ((void));
-extern void             tuiSigwinchHandler PARAMS ((int));
+extern void tuiScrollForward PARAMS ((TuiWinInfoPtr, int));
+extern void tuiScrollBackward PARAMS ((TuiWinInfoPtr, int));
+extern void tuiScrollLeft PARAMS ((TuiWinInfoPtr, int));
+extern void tuiScrollRight PARAMS ((TuiWinInfoPtr, int));
+extern void tui_vScroll PARAMS ((va_list));
+extern void tuiSetWinFocusTo PARAMS ((TuiWinInfoPtr));
+extern void tuiClearWinFocusFrom PARAMS ((TuiWinInfoPtr));
+extern void tuiClearWinFocus PARAMS ((void));
+extern void tuiResizeAll PARAMS ((void));
+extern void tuiRefreshAll PARAMS ((void));
+extern void tuiSigwinchHandler PARAMS ((int));
 
-#endif /*_TUI_WIN_H*/
+#endif
+/*_TUI_WIN_H*/
index 9f8bd4f6ae7e2b51454af9fcf322d22f1ec6adc7..e892e5e6da2cb81f412e4d82a3d9594828bfd7af 100644 (file)
@@ -1,21 +1,22 @@
 /* Language independent support for printing types for GDB, the GNU debugger.
    Copyright 1986, 88, 89, 91, 92, 93, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "obstack.h"
@@ -44,7 +45,7 @@ static void
 ptype_command PARAMS ((char *, int));
 
 static struct type *
-ptype_eval PARAMS ((struct expression *));
+  ptype_eval PARAMS ((struct expression *));
 
 static void
 whatis_command PARAMS ((char *, int));
@@ -80,7 +81,7 @@ whatis_exp (exp, show)
   struct expression *expr;
   register value_ptr val;
   register struct cleanup *old_chain = NULL;
-  struct type * real_type = NULL;
+  struct type *real_type = NULL;
   int full = 0;
   int top = -1;
   int using_enc = 0;
@@ -88,8 +89,8 @@ whatis_exp (exp, show)
   if (exp)
     {
       expr = parse_expression (exp);
-      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                &expr);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                               &expr);
       val = evaluate_type (expr);
     }
   else
@@ -101,8 +102,8 @@ whatis_exp (exp, show)
 
   if (real_type && objectprint)
     printf_filtered ("/* real type = %s%s */\n",
-                     TYPE_NAME (real_type),
-                     full ? "" : " (incomplete object)");
+                    TYPE_NAME (real_type),
+                    full ? "" : " (incomplete object)");
   /* FIXME: maybe better to use type_print (real_type, "", gdb_stdout, -1); */
 
   type_print (VALUE_TYPE (val), "", gdb_stdout, show);
@@ -160,8 +161,8 @@ ptype_command (typename, from_tty)
   else
     {
       expr = parse_expression (typename);
-      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, 
-                                &expr);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+                               &expr);
       type = ptype_eval (expr);
       if (type != NULL)
        {
@@ -279,30 +280,30 @@ maintenance_print_type (typename, from_tty)
   struct expression *expr;
 
   if (typename != NULL)
-  {
-    expr = parse_expression (typename);
-    old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
-    if (expr -> elts[0].opcode == OP_TYPE)
-      {
-       /* The user expression names a type directly, just use that type. */
-       type = expr -> elts[1].type;
-      }
-    else
-      {
-       /* The user expression may name a type indirectly by naming an
-          object of that type.  Find that indirectly named type. */
-       val = evaluate_type (expr);
-       type = VALUE_TYPE (val);
-      }
-    if (type != NULL)
-      {
-       recursive_dump_type (type, 0);
-      }
-    do_cleanups (old_chain);
-  }
+    {
+      expr = parse_expression (typename);
+      old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+      if (expr->elts[0].opcode == OP_TYPE)
+       {
+         /* The user expression names a type directly, just use that type. */
+         type = expr->elts[1].type;
+       }
+      else
+       {
+         /* The user expression may name a type indirectly by naming an
+            object of that type.  Find that indirectly named type. */
+         val = evaluate_type (expr);
+         type = VALUE_TYPE (val);
+       }
+      if (type != NULL)
+       {
+         recursive_dump_type (type, 0);
+       }
+      do_cleanups (old_chain);
+    }
 }
-
 \f
+
 void
 _initialize_typeprint ()
 {
index be4d81a3cb17ac96716ce680c33f803365c14353..0d13a3810b368249060a46181c4c2e8df26e5234 100644 (file)
@@ -2,24 +2,25 @@
    Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1999
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 void
-print_type_scalar PARAMS ((struct type *type, LONGEST, GDB_FILE *));
+print_type_scalar PARAMS ((struct type * type, LONGEST, GDB_FILE *));
 
 void
 c_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *, int, int, int));
index 2b84cdd89429b83dd940e253054cf8335f446845..de8e33b0412ba5699f56831b9576c673f974076d 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
    Contributed by David Wood (wood@nyu.edu) at New York University.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define DEBUG
 #include "defs.h"
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/param.h>
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>  
+#include <fcntl.h>
 
 #include "gdbcore.h"
 
@@ -50,7 +51,7 @@ static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
 #define        ULTRA3
 
 #if !defined (offsetof)
-# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
 #endif
 
 extern int errno;
@@ -64,65 +65,74 @@ struct ptrace_user pt_struct;
 
 void
 fetch_inferior_registers (regno)
-  int regno;
+     int regno;
 {
-  register int i,j,ret_val=0;
+  register int i, j, ret_val = 0;
   char buf[128];
 
-  if (regno != -1) {
-    fetch_register (regno);
-    return;
-  }
+  if (regno != -1)
+    {
+      fetch_register (regno);
+      return;
+    }
 
 /* Global Registers */
 #ifdef ULTRA3
   errno = 0;
   ptrace (PT_READ_STRUCT, inferior_pid,
-         (PTRACE_ARG3_TYPE) register_addr(GR96_REGNUM,0), 
-         (int)&pt_struct.pt_gr[0], 32*4);
-  if (errno != 0) {
+         (PTRACE_ARG3_TYPE) register_addr (GR96_REGNUM, 0),
+         (int) &pt_struct.pt_gr[0], 32 * 4);
+  if (errno != 0)
+    {
       perror_with_name ("reading global registers");
       ret_val = -1;
-  } else for (regno=GR96_REGNUM, j=0 ; j<32 ; regno++, j++)  {
-      supply_register (regno, &pt_struct.pt_gr[j]);
-  }
+    }
+  else
+    for (regno = GR96_REGNUM, j = 0; j < 32; regno++, j++)
+      {
+       supply_register (regno, &pt_struct.pt_gr[j]);
+      }
 #else
-  for (regno=GR96_REGNUM ; !ret_val && regno < GR96_REGNUM+32 ; regno++)
-    fetch_register(regno);
+  for (regno = GR96_REGNUM; !ret_val && regno < GR96_REGNUM + 32; regno++)
+    fetch_register (regno);
 #endif
 
 /* Local Registers */
 #ifdef ULTRA3
   errno = 0;
   ptrace (PT_READ_STRUCT, inferior_pid,
-         (PTRACE_ARG3_TYPE) register_addr(LR0_REGNUM,0), 
-         (int)&pt_struct.pt_lr[0], 128*4);
-  if (errno != 0) {
+         (PTRACE_ARG3_TYPE) register_addr (LR0_REGNUM, 0),
+         (int) &pt_struct.pt_lr[0], 128 * 4);
+  if (errno != 0)
+    {
       perror_with_name ("reading local registers");
       ret_val = -1;
-  } else for (regno=LR0_REGNUM, j=0 ; j<128 ; regno++, j++)  {
-      supply_register (regno, &pt_struct.pt_lr[j]);
-  }
+    }
+  else
+    for (regno = LR0_REGNUM, j = 0; j < 128; regno++, j++)
+      {
+       supply_register (regno, &pt_struct.pt_lr[j]);
+      }
 #else
-  for (regno=LR0_REGNUM ; !ret_val && regno < LR0_REGNUM+128 ; regno++)
-    fetch_register(regno);
+  for (regno = LR0_REGNUM; !ret_val && regno < LR0_REGNUM + 128; regno++)
+    fetch_register (regno);
 #endif
 
 /* Special Registers */
-  fetch_register(GR1_REGNUM);
-  fetch_register(CPS_REGNUM);
-  fetch_register(PC_REGNUM);
-  fetch_register(NPC_REGNUM);
-  fetch_register(PC2_REGNUM);
-  fetch_register(IPC_REGNUM);
-  fetch_register(IPA_REGNUM);
-  fetch_register(IPB_REGNUM);
-  fetch_register(Q_REGNUM);
-  fetch_register(BP_REGNUM);
-  fetch_register(FC_REGNUM);
-
-/* Fake any registers that are in REGISTER_NAMES, but not available to gdb */ 
-  registers_fetched();
+  fetch_register (GR1_REGNUM);
+  fetch_register (CPS_REGNUM);
+  fetch_register (PC_REGNUM);
+  fetch_register (NPC_REGNUM);
+  fetch_register (PC2_REGNUM);
+  fetch_register (IPC_REGNUM);
+  fetch_register (IPA_REGNUM);
+  fetch_register (IPB_REGNUM);
+  fetch_register (Q_REGNUM);
+  fetch_register (BP_REGNUM);
+  fetch_register (FC_REGNUM);
+
+/* Fake any registers that are in REGISTER_NAMES, but not available to gdb */
+  registers_fetched ();
 }
 
 /* Store our register values back into the inferior.
@@ -140,12 +150,12 @@ store_inferior_registers (regno)
 
   if (regno >= 0)
     {
-      if (CANNOT_STORE_REGISTER(regno)) 
+      if (CANNOT_STORE_REGISTER (regno))
        return;
       regaddr = register_addr (regno, 0);
       errno = 0;
       ptrace (PT_WRITE_U, inferior_pid,
-             (PTRACE_ARG3_TYPE) regaddr, read_register(regno));
+             (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
       if (errno != 0)
        {
          sprintf (buf, "writing register %s (#%d)", REGISTER_NAME (regno), regno);
@@ -155,57 +165,57 @@ store_inferior_registers (regno)
   else
     {
 #ifdef ULTRA3
-      pt_struct.pt_gr1 = read_register(GR1_REGNUM);
-      for (regno = GR96_REGNUM; regno < GR96_REGNUM+32; regno++)
-       pt_struct.pt_gr[regno] = read_register(regno);
-      for (regno = LR0_REGNUM; regno < LR0_REGNUM+128; regno++)
-       pt_struct.pt_gr[regno] = read_register(regno);
+      pt_struct.pt_gr1 = read_register (GR1_REGNUM);
+      for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++)
+       pt_struct.pt_gr[regno] = read_register (regno);
+      for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++)
+       pt_struct.pt_gr[regno] = read_register (regno);
       errno = 0;
       ptrace (PT_WRITE_STRUCT, inferior_pid,
-             (PTRACE_ARG3_TYPE) register_addr(GR1_REGNUM,0), 
-             (int)&pt_struct.pt_gr1,(1*32*128)*4);
+             (PTRACE_ARG3_TYPE) register_addr (GR1_REGNUM, 0),
+             (int) &pt_struct.pt_gr1, (1 * 32 * 128) * 4);
       if (errno != 0)
        {
-          sprintf (buf, "writing all local/global registers");
-          perror_with_name (buf);
+         sprintf (buf, "writing all local/global registers");
+         perror_with_name (buf);
        }
-      pt_struct.pt_psr = read_register(CPS_REGNUM);
-      pt_struct.pt_pc0 = read_register(NPC_REGNUM);
-      pt_struct.pt_pc1 = read_register(PC_REGNUM);
-      pt_struct.pt_pc2 = read_register(PC2_REGNUM);
-      pt_struct.pt_ipc = read_register(IPC_REGNUM);
-      pt_struct.pt_ipa = read_register(IPA_REGNUM);
-      pt_struct.pt_ipb = read_register(IPB_REGNUM);
-      pt_struct.pt_q   = read_register(Q_REGNUM);
-      pt_struct.pt_bp  = read_register(BP_REGNUM);
-      pt_struct.pt_fc  = read_register(FC_REGNUM);
+      pt_struct.pt_psr = read_register (CPS_REGNUM);
+      pt_struct.pt_pc0 = read_register (NPC_REGNUM);
+      pt_struct.pt_pc1 = read_register (PC_REGNUM);
+      pt_struct.pt_pc2 = read_register (PC2_REGNUM);
+      pt_struct.pt_ipc = read_register (IPC_REGNUM);
+      pt_struct.pt_ipa = read_register (IPA_REGNUM);
+      pt_struct.pt_ipb = read_register (IPB_REGNUM);
+      pt_struct.pt_q = read_register (Q_REGNUM);
+      pt_struct.pt_bp = read_register (BP_REGNUM);
+      pt_struct.pt_fc = read_register (FC_REGNUM);
       errno = 0;
       ptrace (PT_WRITE_STRUCT, inferior_pid,
-             (PTRACE_ARG3_TYPE) register_addr(CPS_REGNUM,0), 
-             (int)&pt_struct.pt_psr,(10)*4);
+             (PTRACE_ARG3_TYPE) register_addr (CPS_REGNUM, 0),
+             (int) &pt_struct.pt_psr, (10) * 4);
       if (errno != 0)
        {
-          sprintf (buf, "writing all special registers");
-          perror_with_name (buf);
-          return;
+         sprintf (buf, "writing all special registers");
+         perror_with_name (buf);
+         return;
        }
 #else
-      store_inferior_registers(GR1_REGNUM);
-      for (regno=GR96_REGNUM ; regno<GR96_REGNUM+32 ; regno++)
-       store_inferior_registers(regno);
-      for (regno=LR0_REGNUM ; regno<LR0_REGNUM+128 ; regno++)
-       store_inferior_registers(regno);
-      store_inferior_registers(CPS_REGNUM);
-      store_inferior_registers(PC_REGNUM);
-      store_inferior_registers(NPC_REGNUM);
-      store_inferior_registers(PC2_REGNUM);
-      store_inferior_registers(IPC_REGNUM);
-      store_inferior_registers(IPA_REGNUM);
-      store_inferior_registers(IPB_REGNUM);
-      store_inferior_registers(Q_REGNUM);
-      store_inferior_registers(BP_REGNUM);
-      store_inferior_registers(FC_REGNUM);
-#endif /* ULTRA3 */
+      store_inferior_registers (GR1_REGNUM);
+      for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++)
+       store_inferior_registers (regno);
+      for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++)
+       store_inferior_registers (regno);
+      store_inferior_registers (CPS_REGNUM);
+      store_inferior_registers (PC_REGNUM);
+      store_inferior_registers (NPC_REGNUM);
+      store_inferior_registers (PC2_REGNUM);
+      store_inferior_registers (IPC_REGNUM);
+      store_inferior_registers (IPA_REGNUM);
+      store_inferior_registers (IPB_REGNUM);
+      store_inferior_registers (Q_REGNUM);
+      store_inferior_registers (BP_REGNUM);
+      store_inferior_registers (FC_REGNUM);
+#endif /* ULTRA3 */
     }
 }
 
@@ -219,22 +229,28 @@ fetch_register (regno)
      int regno;
 {
   char buf[128];
-  int  val;
-
-  if (CANNOT_FETCH_REGISTER(regno)) {
-    val = -1;
-    supply_register (regno, &val);
-  } else {
-    errno = 0;
-    val = ptrace (PT_READ_U, inferior_pid,
-                 (PTRACE_ARG3_TYPE) register_addr(regno,0), 0);
-    if (errno != 0) {
-      sprintf(buf,"reading register %s (#%d)",REGISTER_NAME (regno), regno);
-      perror_with_name (buf);
-    } else {
+  int val;
+
+  if (CANNOT_FETCH_REGISTER (regno))
+    {
+      val = -1;
       supply_register (regno, &val);
     }
-  }
+  else
+    {
+      errno = 0;
+      val = ptrace (PT_READ_U, inferior_pid,
+                   (PTRACE_ARG3_TYPE) register_addr (regno, 0), 0);
+      if (errno != 0)
+       {
+         sprintf (buf, "reading register %s (#%d)", REGISTER_NAME (regno), regno);
+         perror_with_name (buf);
+       }
+      else
+       {
+         supply_register (regno, &val);
+       }
+    }
 }
 
 
@@ -251,24 +267,27 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      CORE_ADDR reg_addr;       /* Unused in this version */
 {
   register int regno;
-  int  val;
-  char buf[4];
-
-  for (regno = 0 ; regno < NUM_REGS; regno++) {
-    if (!CANNOT_FETCH_REGISTER(regno)) {
-      val = bfd_seek (core_bfd, (file_ptr) register_addr (regno, 0), SEEK_SET);
-      if (val < 0 || (val = bfd_read (buf, sizeof buf, 1, core_bfd)) < 0) {
-        char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) + 35);
-        strcpy (buffer, "Reading core register ");
-        strcat (buffer, REGISTER_NAME (regno));
-        perror_with_name (buffer);
-      }
-      supply_register (regno, buf);
+  int val;
+  char buf[4];
+
+  for (regno = 0; regno < NUM_REGS; regno++)
+    {
+      if (!CANNOT_FETCH_REGISTER (regno))
+       {
+         val = bfd_seek (core_bfd, (file_ptr) register_addr (regno, 0), SEEK_SET);
+         if (val < 0 || (val = bfd_read (buf, sizeof buf, 1, core_bfd)) < 0)
+           {
+             char *buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) + 35);
+             strcpy (buffer, "Reading core register ");
+             strcat (buffer, REGISTER_NAME (regno));
+             perror_with_name (buffer);
+           }
+         supply_register (regno, buf);
+       }
     }
-  }
 
-  /* Fake any registers that are in REGISTER_NAMES, but not available to gdb */ 
-  registers_fetched();
+  /* Fake any registers that are in REGISTER_NAMES, but not available to gdb */
+  registers_fetched ();
 }
 
 
@@ -282,36 +301,53 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
  * will cause ptrace() to fail is returned.
  */
 CORE_ADDR
-register_addr (regno,blockend)
-     int       regno;
-     CORE_ADDR blockend;
+register_addr (regno, blockend)
+     int regno;
+     CORE_ADDR blockend;
 {
-  if ((regno >= LR0_REGNUM) && (regno < LR0_REGNUM + 128)) {
-    return(offsetof(struct ptrace_user,pt_lr[regno-LR0_REGNUM]));
-  } else if ((regno >= GR96_REGNUM) && (regno < GR96_REGNUM + 32)) {
-    return(offsetof(struct ptrace_user,pt_gr[regno-GR96_REGNUM]));
-  } else {
-    switch (regno) {
-       case GR1_REGNUM: return(offsetof(struct ptrace_user,pt_gr1));
-       case CPS_REGNUM: return(offsetof(struct ptrace_user,pt_psr));
-       case NPC_REGNUM: return(offsetof(struct ptrace_user,pt_pc0));
-       case PC_REGNUM:  return(offsetof(struct ptrace_user,pt_pc1));
-       case PC2_REGNUM: return(offsetof(struct ptrace_user,pt_pc2));
-       case IPC_REGNUM: return(offsetof(struct ptrace_user,pt_ipc));
-       case IPA_REGNUM: return(offsetof(struct ptrace_user,pt_ipa));
-       case IPB_REGNUM: return(offsetof(struct ptrace_user,pt_ipb));
-       case Q_REGNUM:   return(offsetof(struct ptrace_user,pt_q));
-       case BP_REGNUM:  return(offsetof(struct ptrace_user,pt_bp));
-       case FC_REGNUM:  return(offsetof(struct ptrace_user,pt_fc));
+  if ((regno >= LR0_REGNUM) && (regno < LR0_REGNUM + 128))
+    {
+      return (offsetof (struct ptrace_user, pt_lr[regno - LR0_REGNUM]));
+    }
+  else if ((regno >= GR96_REGNUM) && (regno < GR96_REGNUM + 32))
+    {
+      return (offsetof (struct ptrace_user, pt_gr[regno - GR96_REGNUM]));
+    }
+  else
+    {
+      switch (regno)
+       {
+       case GR1_REGNUM:
+         return (offsetof (struct ptrace_user, pt_gr1));
+       case CPS_REGNUM:
+         return (offsetof (struct ptrace_user, pt_psr));
+       case NPC_REGNUM:
+         return (offsetof (struct ptrace_user, pt_pc0));
+       case PC_REGNUM:
+         return (offsetof (struct ptrace_user, pt_pc1));
+       case PC2_REGNUM:
+         return (offsetof (struct ptrace_user, pt_pc2));
+       case IPC_REGNUM:
+         return (offsetof (struct ptrace_user, pt_ipc));
+       case IPA_REGNUM:
+         return (offsetof (struct ptrace_user, pt_ipa));
+       case IPB_REGNUM:
+         return (offsetof (struct ptrace_user, pt_ipb));
+       case Q_REGNUM:
+         return (offsetof (struct ptrace_user, pt_q));
+       case BP_REGNUM:
+         return (offsetof (struct ptrace_user, pt_bp));
+       case FC_REGNUM:
+         return (offsetof (struct ptrace_user, pt_fc));
        default:
-            fprintf_filtered(gdb_stderr,"register_addr():Bad register %s (%d)\n", 
-                             REGISTER_NAME (regno), regno);
-            return(0xffffffff);        /* Should make ptrace() fail */
+         fprintf_filtered (gdb_stderr, "register_addr():Bad register %s (%d)\n",
+                           REGISTER_NAME (regno), regno);
+         return (0xffffffff);  /* Should make ptrace() fail */
+       }
     }
-  }
 }
-
 \f
+
 /* Register that we are able to handle ultra3 core file formats.
    FIXME: is this really bfd_target_unknown_flavour? */
 
index 57bab86e3bfdc317e16b22656504839ac95b7f69..83aa7709bcdc21a2ead881510f0bb9f36832c4aa 100644 (file)
@@ -2,21 +2,22 @@
    Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
    Contributed by David Wood (wood@nyu.edu) at New York University.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #define DEBUG
 #include "defs.h"
@@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/param.h>
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>  
+#include <fcntl.h>
 
 #include "gdbcore.h"
 
@@ -42,77 +43,89 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* FIXME: Kludge this for now. It really should be system call. */
 int
-getpagesize()
-{ return(8192); }
+getpagesize ()
+{
+  return (8192);
+}
 
 /* FIXME: Fake out the fcntl() call, which we don't have.  */
-fcntl(fd, cmd, arg)
-int fd, cmd, arg;
+fcntl (fd, cmd, arg)
+     int fd, cmd, arg;
 {
 
-  switch (cmd) {
-       case F_GETFL: return(O_RDONLY); break;
-       default:        
-               printf_unfiltered("Ultra3's fcntl() failing, cmd = %d.\n",cmd);
-               return(-1);
-  }
+  switch (cmd)
+    {
+    case F_GETFL:
+      return (O_RDONLY);
+      break;
+    default:
+      printf_unfiltered ("Ultra3's fcntl() failing, cmd = %d.\n", cmd);
+      return (-1);
+    }
 }
 
 
 /* 
  * 4.2 Signal support, requires linking with libjobs.
  */
-static int     _SigMask;
+static int _SigMask;
 #define sigbit(s)       (1L << ((s)-1))
 
-init_SigMask()
+init_SigMask ()
 {
-       /* Taken from the sym1 kernel in machdep.c:startup() */
-       _SigMask = sigbit (SIGTSTP) | sigbit (SIGTTOU) | sigbit (SIGTTIN) |
-                        sigbit (SIGCHLD) | sigbit (SIGTINT);
+  /* Taken from the sym1 kernel in machdep.c:startup() */
+  _SigMask = sigbit (SIGTSTP) | sigbit (SIGTTOU) | sigbit (SIGTTIN) |
+    sigbit (SIGCHLD) | sigbit (SIGTINT);
 }
 
-sigmask(signo)
-       int signo;
+sigmask (signo)
+     int signo;
 {
-       return (1 << (signo-1));
+  return (1 << (signo - 1));
 }
 
-sigsetmask(sigmask)
-unsigned int sigmask;
+sigsetmask (sigmask)
+     unsigned int sigmask;
 {
-       int i, mask = 1;
-       int lastmask = _SigMask;
-
-       for (i=0 ; i<NSIG ; i++) {
-               if (sigmask & mask) { 
-                       if (!(_SigMask & mask)) {
-                               sighold(i+1);
-                               _SigMask |= mask;
-                       }
-               } else if (_SigMask & mask) {
-                       sigrelse(i+1);
-                       _SigMask &= ~mask;
-               }
-               mask <<= 1;
+  int i, mask = 1;
+  int lastmask = _SigMask;
+
+  for (i = 0; i < NSIG; i++)
+    {
+      if (sigmask & mask)
+       {
+         if (!(_SigMask & mask))
+           {
+             sighold (i + 1);
+             _SigMask |= mask;
+           }
+       }
+      else if (_SigMask & mask)
+       {
+         sigrelse (i + 1);
+         _SigMask &= ~mask;
        }
-       return (lastmask);
+      mask <<= 1;
+    }
+  return (lastmask);
 }
 
-sigblock(sigmask)
-unsigned int sigmask;
+sigblock (sigmask)
+     unsigned int sigmask;
 {
-       int i, mask = 1;
-       int lastmask = _SigMask;
-
-       for (i=0 ; i<NSIG ; i++) {
-               if ((sigmask & mask) && !(_SigMask & mask)) {
-                       sighold(i+1);
-                       _SigMask |= mask;
-               }
-               mask <<= 1;
+  int i, mask = 1;
+  int lastmask = _SigMask;
+
+  for (i = 0; i < NSIG; i++)
+    {
+      if ((sigmask & mask) && !(_SigMask & mask))
+       {
+         sighold (i + 1);
+         _SigMask |= mask;
        }
-       return (lastmask);
+      mask <<= 1;
+    }
+  return (lastmask);
 }
 #endif /* SYM1 */
 
@@ -123,6 +136,6 @@ void
 _initialize_ultra3 ()
 {
 #ifdef SYM1
-       init_SigMask();
+  init_SigMask ();
 #endif
 }
index ad2d3e49dba4ca55ad2e10954cbb1c68c2abfe4c..75e088ce967231b6bc8eb984a4424c7e1b32ebca 100644 (file)
@@ -1,21 +1,22 @@
 /* umax host stuff.
    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -67,7 +68,7 @@ core_file_command (filename, from_tty)
     {
       filename = tilde_expand (filename);
       make_cleanup (free, filename);
-      
+
       if (have_inferior_p ())
        error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
@@ -93,7 +94,7 @@ core_file_command (filename, from_tty)
        printf_unfiltered ("Core file is from \"%s\".\n", u.pt_comm);
        if (u.pt_signal > 0)
          printf_unfiltered ("Program terminated with signal %d, %s.\n",
-                 u.pt_signal, safe_strsignal (u.pt_signal));
+                            u.pt_signal, safe_strsignal (u.pt_signal));
 
        /* Read the register values out of the core file and store
           them where `read_register' will find them.  */
@@ -109,7 +110,7 @@ core_file_command (filename, from_tty)
              if (val < 0)
                perror_with_name (filename);
 
-             val = myread (corechan, buf, sizeof buf);
+             val = myread (corechan, buf, sizeof buf);
              if (val < 0)
                perror_with_name (filename);
              supply_register (regno, buf);
index 0e7c8234bf8c719916e898372719a3535522cd74..f181d0cbdc6369a0895b2fa49c1ed4dd6e35aead 100644 (file)
@@ -1,21 +1,22 @@
 /* General utility routines for GDB, the GNU debugger.
    Copyright 1986, 89, 90, 91, 92, 95, 96, 1998 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <ctype.h>
@@ -65,12 +66,12 @@ static void malloc_botch PARAMS ((void));
 #endif
 
 static void
-fatal_dump_core PARAMS((char *, ...));
+fatal_dump_core PARAMS ((char *,...));
 
 static void
 prompt_for_continue PARAMS ((void));
 
-static void 
+static void
 set_width_command PARAMS ((char *, int, struct cmd_list_element *));
 
 static void
@@ -83,16 +84,16 @@ set_width PARAMS ((void));
 #endif
 
 #ifndef GDB_FILE_ISATTY
-#define GDB_FILE_ISATTY(GDB_FILE_PTR)   (gdb_file_isatty(GDB_FILE_PTR))   
+#define GDB_FILE_ISATTY(GDB_FILE_PTR)   (gdb_file_isatty(GDB_FILE_PTR))
 #endif
 
 /* Chain of cleanup actions established with make_cleanup,
    to be executed if an error happens.  */
 
-static struct cleanup *cleanup_chain; /* cleaned up after a failed command */
-static struct cleanup *final_cleanup_chain; /* cleaned up when gdb exits */
-static struct cleanup *run_cleanup_chain; /* cleaned up on each 'run' */
-static struct cleanup *exec_cleanup_chain; /* cleaned up on each execution command */
+static struct cleanup *cleanup_chain;  /* cleaned up after a failed command */
+static struct cleanup *final_cleanup_chain;    /* cleaned up when gdb exits */
+static struct cleanup *run_cleanup_chain;      /* cleaned up on each 'run' */
+static struct cleanup *exec_cleanup_chain;     /* cleaned up on each execution command */
 
 /* Pointer to what is left to do for an execution command after the
    target stops. Used only in asynchronous mode, by targets that
@@ -151,8 +152,8 @@ char *quit_pre_print;
 char *warning_pre_print = "\nwarning: ";
 
 int pagination_enabled = 1;
-
 \f
+
 /* Add a new cleanup to the cleanup_chain,
    and return the previous chain pointer
    to be passed later to do_cleanups or discard_cleanups.
@@ -163,7 +164,7 @@ make_cleanup (function, arg)
      void (*function) PARAMS ((PTR));
      PTR arg;
 {
-    return make_my_cleanup (&cleanup_chain, function, arg);
+  return make_my_cleanup (&cleanup_chain, function, arg);
 }
 
 struct cleanup *
@@ -171,7 +172,7 @@ make_final_cleanup (function, arg)
      void (*function) PARAMS ((PTR));
      PTR arg;
 {
-    return make_my_cleanup (&final_cleanup_chain, function, arg);
+  return make_my_cleanup (&final_cleanup_chain, function, arg);
 }
 
 struct cleanup *
@@ -179,7 +180,7 @@ make_run_cleanup (function, arg)
      void (*function) PARAMS ((PTR));
      PTR arg;
 {
-    return make_my_cleanup (&run_cleanup_chain, function, arg);
+  return make_my_cleanup (&run_cleanup_chain, function, arg);
 }
 
 struct cleanup *
@@ -187,14 +188,14 @@ make_exec_cleanup (function, arg)
      void (*function) PARAMS ((PTR));
      PTR arg;
 {
-    return make_my_cleanup (&exec_cleanup_chain, function, arg);
+  return make_my_cleanup (&exec_cleanup_chain, function, arg);
 }
 
 static void
 do_freeargv (arg)
      void *arg;
 {
-  freeargv ((char**) arg);
+  freeargv ((char **) arg);
 }
 
 struct cleanup *
@@ -211,7 +212,7 @@ make_my_cleanup (pmy_chain, function, arg)
      PTR arg;
 {
   register struct cleanup *new
-    = (struct cleanup *) xmalloc (sizeof (struct cleanup));
+  = (struct cleanup *) xmalloc (sizeof (struct cleanup));
   register struct cleanup *old_chain = *pmy_chain;
 
   new->next = *pmy_chain;
@@ -229,28 +230,28 @@ void
 do_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    do_my_cleanups (&cleanup_chain, old_chain);
+  do_my_cleanups (&cleanup_chain, old_chain);
 }
 
 void
 do_final_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    do_my_cleanups (&final_cleanup_chain, old_chain);
+  do_my_cleanups (&final_cleanup_chain, old_chain);
 }
 
 void
 do_run_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    do_my_cleanups (&run_cleanup_chain, old_chain);
+  do_my_cleanups (&run_cleanup_chain, old_chain);
 }
 
 void
 do_exec_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    do_my_cleanups (&exec_cleanup_chain, old_chain);
+  do_my_cleanups (&exec_cleanup_chain, old_chain);
 }
 
 void
@@ -274,14 +275,14 @@ void
 discard_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    discard_my_cleanups (&cleanup_chain, old_chain);
+  discard_my_cleanups (&cleanup_chain, old_chain);
 }
 
 void
 discard_final_cleanups (old_chain)
      register struct cleanup *old_chain;
 {
-    discard_my_cleanups (&final_cleanup_chain, old_chain);
+  discard_my_cleanups (&final_cleanup_chain, old_chain);
 }
 
 void
@@ -293,7 +294,7 @@ discard_my_cleanups (pmy_chain, old_chain)
   while ((ptr = *pmy_chain) != old_chain)
     {
       *pmy_chain = ptr->next;
-      free ((PTR)ptr);
+      free ((PTR) ptr);
     }
 }
 
@@ -301,18 +302,18 @@ discard_my_cleanups (pmy_chain, old_chain)
 struct cleanup *
 save_cleanups ()
 {
-    return save_my_cleanups (&cleanup_chain);
+  return save_my_cleanups (&cleanup_chain);
 }
 
 struct cleanup *
 save_final_cleanups ()
 {
-    return save_my_cleanups (&final_cleanup_chain);
+  return save_my_cleanups (&final_cleanup_chain);
 }
 
 struct cleanup *
 save_my_cleanups (pmy_chain)
-    struct cleanup **pmy_chain;
+     struct cleanup **pmy_chain;
 {
   struct cleanup *old_chain = *pmy_chain;
 
@@ -325,14 +326,14 @@ void
 restore_cleanups (chain)
      struct cleanup *chain;
 {
-    restore_my_cleanups (&cleanup_chain, chain);
+  restore_my_cleanups (&cleanup_chain, chain);
 }
 
 void
 restore_final_cleanups (chain)
      struct cleanup *chain;
 {
-    restore_my_cleanups (&final_cleanup_chain, chain);
+  restore_my_cleanups (&final_cleanup_chain, chain);
 }
 
 void
@@ -346,8 +347,8 @@ restore_my_cleanups (pmy_chain, chain)
 /* This function is useful for cleanups.
    Do
 
-     foo = xmalloc (...);
-     old_chain = make_cleanup (free_current_contents, &foo);
+   foo = xmalloc (...);
+   old_chain = make_cleanup (free_current_contents, &foo);
 
    to arrange to free the object thus allocated.  */
 
@@ -368,7 +369,7 @@ free_current_contents (location)
 /* ARGSUSED */
 void
 null_cleanup (arg)
-    PTR arg;
+     PTR arg;
 {
 }
 
@@ -376,35 +377,35 @@ null_cleanup (arg)
    cmd_continuation. */
 void
 add_continuation (continuation_hook, arg_list)
-  void (*continuation_hook) PARAMS ((struct continuation_arg *));
-  struct continuation_arg *arg_list;
+     void (*continuation_hook) PARAMS ((struct continuation_arg *));
+     struct continuation_arg *arg_list;
 {
- struct continuation *continuation_ptr;
 struct continuation *continuation_ptr;
 
- continuation_ptr = (struct continuation *) xmalloc (sizeof (struct continuation));
- continuation_ptr->continuation_hook = continuation_hook;
- continuation_ptr->arg_list = arg_list;
- continuation_ptr->next = cmd_continuation;
- cmd_continuation = continuation_ptr;
 continuation_ptr = (struct continuation *) xmalloc (sizeof (struct continuation));
 continuation_ptr->continuation_hook = continuation_hook;
 continuation_ptr->arg_list = arg_list;
 continuation_ptr->next = cmd_continuation;
 cmd_continuation = continuation_ptr;
 }
 
 /* Walk down the cmd_continuation list, and execute all the
    continuations. */
-void 
+void
 do_all_continuations ()
 {
- struct continuation *continuation_ptr;
 struct continuation *continuation_ptr;
 
- while (cmd_continuation)
-   {
-     (cmd_continuation->continuation_hook) (cmd_continuation->arg_list);
-     continuation_ptr = cmd_continuation;
-     cmd_continuation = continuation_ptr->next;
-     free (continuation_ptr);
-   }
 while (cmd_continuation)
+    {
+      (cmd_continuation->continuation_hook) (cmd_continuation->arg_list);
+      continuation_ptr = cmd_continuation;
+      cmd_continuation = continuation_ptr->next;
+      free (continuation_ptr);
+    }
 }
-
 \f
+
 /* Print a warning message.  Way to use this is to call warning_begin,
    output the warning message (use unfiltered output to gdb_stderr),
    ending in a newline.  There is not currently a warning_end that you
@@ -418,7 +419,7 @@ void
 warning_begin ()
 {
   target_terminal_ours ();
-  wrap_here("");                       /* Force out any buffered output */
+  wrap_here ("");              /* Force out any buffered output */
   gdb_flush (gdb_stdout);
   if (warning_pre_print)
     fprintf_unfiltered (gdb_stderr, warning_pre_print);
@@ -433,7 +434,7 @@ warning_begin ()
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-warning (const char *string, ...)
+warning (const char *string,...)
 #else
 warning (va_alist)
      va_dcl
@@ -451,12 +452,12 @@ warning (va_alist)
   if (warning_hook)
     (*warning_hook) (string, args);
   else
-  {
-    warning_begin ();
-    vfprintf_unfiltered (gdb_stderr, string, args);
-    fprintf_unfiltered (gdb_stderr, "\n");
-    va_end (args);
-  }
+    {
+      warning_begin ();
+      vfprintf_unfiltered (gdb_stderr, string, args);
+      fprintf_unfiltered (gdb_stderr, "\n");
+      va_end (args);
+    }
 }
 
 /* Start the printing of an error message.  Way to use this is to call
@@ -473,7 +474,7 @@ error_begin ()
     error_begin_hook ();
 
   target_terminal_ours ();
-  wrap_here ("");                      /* Force out any buffered output */
+  wrap_here ("");              /* Force out any buffered output */
   gdb_flush (gdb_stdout);
 
   annotate_error_begin ();
@@ -489,7 +490,7 @@ error_begin ()
 /* VARARGS */
 NORETURN void
 #ifdef ANSI_PROTOTYPES
-error (const char *string, ...)
+error (const char *string,...)
 #else
 error (va_alist)
      va_dcl
@@ -503,7 +504,7 @@ error (va_alist)
 #endif
   if (error_hook)
     (*error_hook) ();
-  else 
+  else
     {
       error_begin ();
 #ifdef ANSI_PROTOTYPES
@@ -533,7 +534,7 @@ error (va_alist)
 /* VARARGS */
 NORETURN void
 #ifdef ANSI_PROTOTYPES
-fatal (char *string, ...)
+fatal (char *string,...)
 #else
 fatal (va_alist)
      va_dcl
@@ -560,7 +561,7 @@ fatal (va_alist)
 /* VARARGS */
 static void
 #ifdef ANSI_PROTOTYPES
-fatal_dump_core (char *string, ...)
+fatal_dump_core (char *string,...)
 #else
 fatal_dump_core (va_alist)
      va_dcl
@@ -650,7 +651,7 @@ perror_with_name (string)
   bfd_set_error (bfd_error_no_error);
   errno = 0;
 
-  error ("%s.", combined); 
+  error ("%s.", combined);
 }
 
 /* Print the system error message for ERRCODE, and also mention STRING
@@ -691,7 +692,7 @@ quit ()
      too):  */
 
   /* 1.  The _filtered buffer.  */
-  wrap_here ((char *)0);
+  wrap_here ((char *) 0);
 
   /* 2.  The stdio buffer.  */
   gdb_flush (gdb_stdout);
@@ -708,13 +709,13 @@ quit ()
     fprintf_unfiltered (gdb_stderr, quit_pre_print);
 
   if (job_control
-      /* If there is no terminal switching for this target, then we can't
-        possibly get screwed by the lack of job control.  */
+  /* If there is no terminal switching for this target, then we can't
+     possibly get screwed by the lack of job control.  */
       || current_target.to_terminal_ours == NULL)
     fprintf_unfiltered (gdb_stderr, "Quit\n");
   else
     fprintf_unfiltered (gdb_stderr,
-            "Quit (expect signal SIGINT when the program is resumed)\n");
+              "Quit (expect signal SIGINT when the program is resumed)\n");
   return_to_top_level (RETURN_QUIT);
 }
 
@@ -725,7 +726,7 @@ quit ()
    Called from #define QUIT pollquit() in xm-go32.h. */
 
 void
-notice_quit()
+notice_quit ()
 {
   if (kbhit ())
     switch (getkey ())
@@ -744,7 +745,7 @@ notice_quit()
       }
 }
 
-#elif defined(_MSC_VER) /* should test for wingdb instead? */
+#elif defined(_MSC_VER)                /* should test for wingdb instead? */
 
 /*
  * Windows translates all keyboard and mouse events 
@@ -752,9 +753,10 @@ notice_quit()
  * queue for the process.
  */
 
-void notice_quit()
+void
+notice_quit ()
 {
-  int k = win32pollquit();
+  int k = win32pollquit ();
   if (k == 1)
     quit_flag = 1;
   else if (k == 2)
@@ -763,7 +765,8 @@ void notice_quit()
 
 #else /* !defined(__GO32__) && !defined(_MSC_VER) */
 
-void notice_quit()
+void
+notice_quit ()
 {
   /* Done by signals */
 }
@@ -784,7 +787,7 @@ request_quit (signo)
 #ifdef REQUEST_QUIT
   REQUEST_QUIT;
 #else
-  if (immediate_quit) 
+  if (immediate_quit)
     quit ();
 #endif
 }
@@ -815,7 +818,7 @@ mrealloc (md, ptr, size)
      PTR ptr;
      size_t size;
 {
-  if (ptr == 0)                /* Guard against old realloc's */
+  if (ptr == 0)                        /* Guard against old realloc's */
     return malloc (size);
   else
     return realloc (ptr, size);
@@ -829,7 +832,7 @@ mfree (md, ptr)
   free (ptr);
 }
 
-#endif /* USE_MMALLOC */
+#endif /* USE_MMALLOC */
 
 #if !defined (USE_MMALLOC) || defined (NO_MMCHECK)
 
@@ -872,8 +875,8 @@ init_malloc (md)
   if (!mmcheckf (md, malloc_botch, MMCHECK_FORCE))
     {
       /* Don't use warning(), which relies on current_target being set
-        to something other than dummy_target, until after
-        initialize_all_files(). */
+         to something other than dummy_target, until after
+         initialize_all_files(). */
 
       fprintf_unfiltered
        (gdb_stderr, "warning: failed to install memory consistency checks; ");
@@ -970,8 +973,8 @@ xrealloc (ptr, size)
 {
   return (xmrealloc ((PTR) NULL, ptr, size));
 }
-
 \f
+
 /* My replacement for the read system call.
    Used like `read' but keeps going if `read' returns too soon.  */
 
@@ -1062,7 +1065,7 @@ gdb_print_address (addr, stream)
      way of knowing whether this host supports it.  But the following
      should work on the Alpha and on 32 bit machines.  */
 
-  fprintf_filtered (stream, "0x%lx", (unsigned long)addr);
+  fprintf_filtered (stream, "0x%lx", (unsigned long) addr);
 }
 
 /* Ask user a y-or-n question and return 1 iff answer is yes.
@@ -1073,7 +1076,7 @@ gdb_print_address (addr, stream)
 /* VARARGS */
 int
 #ifdef ANSI_PROTOTYPES
-query (char *ctlstr, ...)
+query (char *ctlstr,...)
 #else
 query (va_alist)
      va_dcl
@@ -1122,47 +1125,45 @@ query (va_alist)
 
 #ifdef MPW
       /* If not in MacGDB, move to a new line so the entered line doesn't
-        have a prompt on the front of it. */
+         have a prompt on the front of it. */
       if (!mac_app)
        fputs_unfiltered ("\n", gdb_stdout);
 #endif /* MPW */
 
-      wrap_here("");
+      wrap_here ("");
       gdb_flush (gdb_stdout);
 
 #if defined(TUI)
-      if (!tui_version || cmdWin == tuiWinWithFocus())
+      if (!tui_version || cmdWin == tuiWinWithFocus ())
 #endif
        answer = fgetc (stdin);
 #if defined(TUI)
       else
-
-        answer = (unsigned char)tuiBufferGetc();
+       answer = (unsigned char) tuiBufferGetc ();
 
 #endif
       clearerr (stdin);                /* in case of C-d */
       if (answer == EOF)       /* C-d */
-        {
+       {
          retval = 1;
          break;
        }
       /* Eat rest of input line, to EOF or newline */
       if ((answer != '\n') || (tui_version && answer != '\r'))
-       do 
+       do
          {
 #if defined(TUI)
-           if (!tui_version || cmdWin == tuiWinWithFocus())
+           if (!tui_version || cmdWin == tuiWinWithFocus ())
 #endif
              ans2 = fgetc (stdin);
 #if defined(TUI)
            else
-
-              ans2 = (unsigned char)tuiBufferGetc(); 
+             ans2 = (unsigned char) tuiBufferGetc ();
 #endif
            clearerr (stdin);
          }
-        while (ans2 != EOF && ans2 != '\n' && ans2 != '\r');
-      TUIDO(((TuiOpaqueFuncPtr)tui_vStartNewLines, 1));
+       while (ans2 != EOF && ans2 != '\n' && ans2 != '\r');
+      TUIDO (((TuiOpaqueFuncPtr) tui_vStartNewLines, 1));
 
       if (answer >= 'a')
        answer -= 040;
@@ -1183,8 +1184,8 @@ query (va_alist)
     printf_filtered ("\n\032\032post-query\n");
   return retval;
 }
-
 \f
+
 /* Parse a C escape sequence.  STRING_PTR points to a variable
    containing a pointer to the string to parse.  That pointer
    should point to the character after the \.  That pointer
@@ -1235,7 +1236,7 @@ parse_escape (string_ptr)
       if (c == '?')
        return 0177;
       return (c & 0200) | (c & 037);
-      
+
     case '0':
     case '1':
     case '2':
@@ -1281,44 +1282,47 @@ gdb_printchar (c, stream, quoter)
 
   c &= 0xFF;                   /* Avoid sign bit follies */
 
-  if (              c < 0x20  ||               /* Low control chars */ 
-      (c >= 0x7F && c < 0xA0) ||               /* DEL, High controls */
-      (sevenbit_strings && c >= 0x80)) {       /* high order bit set */
-    switch (c)
-      {
-      case '\n':
-       fputs_filtered ("\\n", stream);
-       break;
-      case '\b':
-       fputs_filtered ("\\b", stream);
-       break;
-      case '\t':
-       fputs_filtered ("\\t", stream);
-       break;
-      case '\f':
-       fputs_filtered ("\\f", stream);
-       break;
-      case '\r':
-       fputs_filtered ("\\r", stream);
-       break;
-      case '\033':
-       fputs_filtered ("\\e", stream);
-       break;
-      case '\007':
-       fputs_filtered ("\\a", stream);
-       break;
-      default:
-       fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
-       break;
-      }
-  } else {
-    if (c == '\\' || c == quoter)
-      fputs_filtered ("\\", stream);
-    fprintf_filtered (stream, "%c", c);
-  }
+  if (c < 0x20 ||              /* Low control chars */
+      (c >= 0x7F && c < 0xA0) ||       /* DEL, High controls */
+      (sevenbit_strings && c >= 0x80))
+    {                          /* high order bit set */
+      switch (c)
+       {
+       case '\n':
+         fputs_filtered ("\\n", stream);
+         break;
+       case '\b':
+         fputs_filtered ("\\b", stream);
+         break;
+       case '\t':
+         fputs_filtered ("\\t", stream);
+         break;
+       case '\f':
+         fputs_filtered ("\\f", stream);
+         break;
+       case '\r':
+         fputs_filtered ("\\r", stream);
+         break;
+       case '\033':
+         fputs_filtered ("\\e", stream);
+         break;
+       case '\007':
+         fputs_filtered ("\\a", stream);
+         break;
+       default:
+         fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
+         break;
+       }
+    }
+  else
+    {
+      if (c == '\\' || c == quoter)
+       fputs_filtered ("\\", stream);
+      fprintf_filtered (stream, "%c", c);
+    }
 }
-
 \f
+
 /* Number of lines per page or UINT_MAX if paging is disabled.  */
 static unsigned int lines_per_page;
 /* Number of chars per line or UNIT_MAX is line folding is disabled.  */
@@ -1349,14 +1353,14 @@ static char *wrap_indent;
 /* Column number on the screen where wrap_buffer begins, or 0 if wrapping
    is not in effect.  */
 static int wrap_column;
-
 \f
+
 /* Inialize the lines and chars per page */
 void
-init_page_info()
+init_page_info ()
 {
 #if defined(TUI)
-  if (tui_version && m_winPtrNotNull(cmdWin))
+  if (tui_version && m_winPtrNotNull (cmdWin))
     {
       lines_per_page = cmdWin->generic.height;
       chars_per_line = cmdWin->generic.width;
@@ -1367,9 +1371,9 @@ init_page_info()
       /* These defaults will be used if we are unable to get the correct
          values from termcap.  */
 #if defined(__GO32__)
-      lines_per_page = ScreenRows();
-      chars_per_line = ScreenCols();
-#else  
+      lines_per_page = ScreenRows ();
+      chars_per_line = ScreenCols ();
+#else
       lines_per_page = 24;
       chars_per_line = 80;
 
@@ -1378,38 +1382,38 @@ init_page_info()
          by looking at worksheet or console window sizes. */
       /* Initialize the screen height and width from termcap.  */
       {
-        char *termtype = getenv ("TERM");
+       char *termtype = getenv ("TERM");
 
-        /* Positive means success, nonpositive means failure.  */
-        int status;
+       /* Positive means success, nonpositive means failure.  */
+       int status;
 
-        /* 2048 is large enough for all known terminals, according to the
-           GNU termcap manual.  */
-        char term_buffer[2048];
+       /* 2048 is large enough for all known terminals, according to the
+          GNU termcap manual.  */
+       char term_buffer[2048];
 
-        if (termtype)
-          {
+       if (termtype)
+         {
            status = tgetent (term_buffer, termtype);
            if (status > 0)
              {
-               int val;
+               int val;
                int running_in_emacs = getenv ("EMACS") != NULL;
-           
-               val = tgetnum ("li");
-               if (val >= 0 && !running_in_emacs)
-                 lines_per_page = val;
-               else
-                 /* The number of lines per page is not mentioned
+
+               val = tgetnum ("li");
+               if (val >= 0 && !running_in_emacs)
+                 lines_per_page = val;
+               else
+                 /* The number of lines per page is not mentioned
                     in the terminal description.  This probably means
                     that paging is not useful (e.g. emacs shell window),
                     so disable paging.  */
-                 lines_per_page = UINT_MAX;
-           
-               val = tgetnum ("co");
-               if (val >= 0)
-                 chars_per_line = val;
+                 lines_per_page = UINT_MAX;
+
+               val = tgetnum ("co");
+               if (val >= 0)
+                 chars_per_line = val;
              }
-          }
+         }
       }
 #endif /* MPW */
 
@@ -1421,16 +1425,16 @@ init_page_info()
 #endif
       /* If the output is not a terminal, don't paginate it.  */
       if (!GDB_FILE_ISATTY (gdb_stdout))
-        lines_per_page = UINT_MAX;
-  } /* the command_line_version */
-  set_width();
+       lines_per_page = UINT_MAX;
+    }                          /* the command_line_version */
+  set_width ();
 }
 
 static void
-set_width()
+set_width ()
 {
   if (chars_per_line == 0)
-    init_page_info();
+    init_page_info ();
 
   if (!wrap_buffer)
     {
@@ -1439,11 +1443,11 @@ set_width()
     }
   else
     wrap_buffer = (char *) xrealloc (wrap_buffer, chars_per_line + 2);
-  wrap_pointer = wrap_buffer;   /* Start it at the beginning */
+  wrap_pointer = wrap_buffer;  /* Start it at the beginning */
 }
 
 /* ARGSUSED */
-static void 
+static void
 set_width_command (args, from_tty, c)
      char *args;
      int from_tty;
@@ -1500,7 +1504,7 @@ prompt_for_continue ()
          if (!async_p)
            request_quit (SIGINT);
          else
-           async_request_quit (0); 
+           async_request_quit (0);
        }
       free (ignore);
     }
@@ -1544,7 +1548,7 @@ reinitialize_more_filter ()
    used to force out output from the wrap_buffer.  */
 
 void
-wrap_here(indent)
+wrap_here (indent)
      char *indent;
 {
   /* This should have been allocated, but be paranoid anyway. */
@@ -1558,7 +1562,7 @@ wrap_here(indent)
     }
   wrap_pointer = wrap_buffer;
   wrap_buffer[0] = '\0';
-  if (chars_per_line == UINT_MAX)              /* No line overflow checking */
+  if (chars_per_line == UINT_MAX)      /* No line overflow checking */
     {
       wrap_column = 0;
     }
@@ -1600,17 +1604,17 @@ begin_line ()
 static gdb_file_fputs_ftype stdio_file_fputs;
 static gdb_file_isatty_ftype stdio_file_isatty;
 static gdb_file_delete_ftype stdio_file_delete;
-static struct gdb_file *stdio_file_new PARAMS ((FILE *file, int close_p));
+static struct gdb_file *stdio_file_new PARAMS ((FILE * file, int close_p));
 static gdb_file_flush_ftype stdio_file_flush;
 
 static int stdio_file_magic;
 
 struct stdio_file
-{
-  int *magic;
-  FILE *file;
-  int close_p;
-};
+  {
+    int *magic;
+    FILE *file;
+    int close_p;
+  };
 
 static struct gdb_file *
 stdio_file_new (file, close_p)
@@ -1719,7 +1723,7 @@ tui_file_delete (file)
   if (tmpstream->ts_magic != &tui_file_magic)
     error ("Internal error: bad magic number");
   if ((tmpstream->ts_streamtype == astring) &&
-      (tmpstream->ts_strbuf != NULL)) 
+      (tmpstream->ts_strbuf != NULL))
     {
       free (tmpstream->ts_strbuf);
     }
@@ -1739,21 +1743,22 @@ tui_fileopen (stream)
   return file;
 }
 
-static int 
+static int
 tui_file_isatty (file)
-    struct gdb_file *file;
+     struct gdb_file *file;
 {
   struct tui_stream *stream = gdb_file_data (file);
   if (stream->ts_magic != &tui_file_magic)
     error ("Internal error: bad magic number");
   if (stream->ts_streamtype == afile)
-     return (isatty(fileno(stream->ts_filestream)));
-  else return 0;
+    return (isatty (fileno (stream->ts_filestream)));
+  else
+    return 0;
 }
 
 static void
 tui_file_rewind (file)
-    struct gdb_file *file;
+     struct gdb_file *file;
 {
   struct tui_stream *stream = gdb_file_data (file);
   if (stream->ts_magic != &tui_file_magic)
@@ -1763,8 +1768,8 @@ tui_file_rewind (file)
 
 static void
 tui_file_put (file, dest)
-    struct gdb_file *file;
-    struct gdb_file *dest;
+     struct gdb_file *file;
+     struct gdb_file *dest;
 {
   struct tui_stream *stream = gdb_file_data (file);
   if (stream->ts_magic != &tui_file_magic)
@@ -1777,7 +1782,7 @@ tui_file_put (file, dest)
 
 GDB_FILE *
 gdb_file_init_astring (n)
-    int n;
+     int n;
 {
   struct gdb_file *file = tui_file_new ();
   struct tui_stream *tmpstream = gdb_file_data (file);
@@ -1788,11 +1793,11 @@ gdb_file_init_astring (n)
   tmpstream->ts_filestream = NULL;
   if (n > 0)
     {
-      tmpstream->ts_strbuf = xmalloc ((n + 1)*sizeof(char));
+      tmpstream->ts_strbuf = xmalloc ((n + 1) * sizeof (char));
       tmpstream->ts_strbuf[0] = '\0';
     }
   else
-     tmpstream->ts_strbuf = NULL;
+    tmpstream->ts_strbuf = NULL;
   tmpstream->ts_buflen = n;
 
   return file;
@@ -1800,12 +1805,12 @@ gdb_file_init_astring (n)
 
 void
 gdb_file_deallocate (streamptr)
-    GDB_FILE **streamptr;
+     GDB_FILE **streamptr;
 {
   gdb_file_delete (*streamptr);
   *streamptr = NULL;
 }
+
 char *
 gdb_file_get_strbuf (file)
      GDB_FILE *file;
@@ -1830,27 +1835,27 @@ gdb_file_adjust_strbuf (n, file)
 
   if (stream->ts_streamtype != astring)
     return;
-  
+
   if (stream->ts_strbuf)
     {
       /* There is already a buffer allocated */
-      non_null_chars = strlen(stream->ts_strbuf);
-      if (n > (stream->ts_buflen - non_null_chars - 1)) 
-        {
-          stream->ts_buflen = n + non_null_chars + 1;
-          stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen);
-        }  
-    }  
+      non_null_chars = strlen (stream->ts_strbuf);
+
+      if (n > (stream->ts_buflen - non_null_chars - 1))
+       {
+         stream->ts_buflen = n + non_null_chars + 1;
+         stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen);
+       }
+    }
   else
     /* No buffer yet, so allocate one of the desired size */
     stream->ts_strbuf = xmalloc ((n + 1) * sizeof (char));
-} 
+}
 
 GDB_FILE *
 gdb_fopen (name, mode)
-     char * name;
-     char * mode;
+     char *name;
+     char *mode;
 {
   FILE *f = fopen (name, mode);
   if (f == NULL)
@@ -1877,7 +1882,7 @@ tui_file_flush (file)
 }
 
 void
-gdb_fclose(streamptr)
+gdb_fclose (streamptr)
      GDB_FILE **streamptr;
 {
   gdb_file_delete (*streamptr);
@@ -1895,15 +1900,15 @@ static gdb_file_rewind_ftype null_file_rewind;
 static gdb_file_put_ftype null_file_put;
 
 struct gdb_file
-{
-  gdb_file_flush_ftype *to_flush;
-  gdb_file_fputs_ftype *to_fputs;
-  gdb_file_delete_ftype *to_delete;
-  gdb_file_isatty_ftype *to_isatty;
-  gdb_file_rewind_ftype *to_rewind;
-  gdb_file_put_ftype *to_put;
-  void *to_data;
-};
+  {
+    gdb_file_flush_ftype *to_flush;
+    gdb_file_fputs_ftype *to_fputs;
+    gdb_file_delete_ftype *to_delete;
+    gdb_file_isatty_ftype *to_isatty;
+    gdb_file_rewind_ftype *to_rewind;
+    gdb_file_put_ftype *to_put;
+    void *to_data;
+  };
 
 struct gdb_file *
 gdb_file_new ()
@@ -2090,7 +2095,7 @@ fputs_maybe_filtered (linebuffer, stream, filter)
 
   /* Don't do any filtering if it is disabled.  */
   if ((stream != gdb_stdout) || !pagination_enabled
-   || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
+      || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
     {
       fputs_unfiltered (linebuffer, stream);
       return;
@@ -2099,7 +2104,7 @@ fputs_maybe_filtered (linebuffer, stream, filter)
   /* Go through and output each character.  Show line extension
      when this is necessary; prompt user for new page when this is
      necessary.  */
-  
+
   lineptr = linebuffer;
   while (*lineptr)
     {
@@ -2119,7 +2124,7 @@ fputs_maybe_filtered (linebuffer, stream, filter)
                fputc_unfiltered ('\t', stream);
              /* Shifting right by 3 produces the number of tab stops
                 we have already passed, and then adding one and
-                shifting left 3 advances to the next tab stop.  */
+                shifting left 3 advances to the next tab stop.  */
              chars_printed = ((chars_printed >> 3) + 1) << 3;
              lineptr++;
            }
@@ -2128,11 +2133,11 @@ fputs_maybe_filtered (linebuffer, stream, filter)
              if (wrap_column)
                *wrap_pointer++ = *lineptr;
              else
-               fputc_unfiltered (*lineptr, stream);
+               fputc_unfiltered (*lineptr, stream);
              chars_printed++;
              lineptr++;
            }
-      
+
          if (chars_printed >= chars_per_line)
            {
              unsigned int save_chars = chars_printed;
@@ -2140,8 +2145,8 @@ fputs_maybe_filtered (linebuffer, stream, filter)
              chars_printed = 0;
              lines_printed++;
              /* If we aren't actually wrapping, don't output newline --
-                if chars_per_line is right, we probably just overflowed
-                anyway; if it's wrong, let us keep going.  */
+                if chars_per_line is right, we probably just overflowed
+                anyway; if it's wrong, let us keep going.  */
              if (wrap_column)
                fputc_unfiltered ('\n', stream);
 
@@ -2153,8 +2158,8 @@ fputs_maybe_filtered (linebuffer, stream, filter)
              if (wrap_column)
                {
                  fputs_unfiltered (wrap_indent, stream);
-                 *wrap_pointer = '\0'; /* Null-terminate saved stuff */
-                 fputs_unfiltered (wrap_buffer, stream); /* and eject it */
+                 *wrap_pointer = '\0';         /* Null-terminate saved stuff */
+                 fputs_unfiltered (wrap_buffer, stream);       /* and eject it */
                  /* FIXME, this strlen is what prevents wrap_indent from
                     containing tabs.  However, if we recurse to print it
                     and count its chars, we risk trouble if wrap_indent is
@@ -2162,18 +2167,18 @@ fputs_maybe_filtered (linebuffer, stream, filter)
                     Note also that this can set chars_printed > chars_per_line
                     if we are printing a long string.  */
                  chars_printed = strlen (wrap_indent)
-                               + (save_chars - wrap_column);
+                   + (save_chars - wrap_column);
                  wrap_pointer = wrap_buffer;   /* Reset buffer */
                  wrap_buffer[0] = '\0';
-                 wrap_column = 0;              /* And disable fancy wrap */
-               }
+                 wrap_column = 0;      /* And disable fancy wrap */
+               }
            }
        }
 
       if (*lineptr == '\n')
        {
          chars_printed = 0;
-         wrap_here ((char *)0);  /* Spit out chars, cancel further wraps */
+         wrap_here ((char *) 0);       /* Spit out chars, cancel further wraps */
          lines_printed++;
          fputc_unfiltered ('\n', stream);
          lineptr++;
@@ -2204,7 +2209,7 @@ putchar_unfiltered (c)
 int
 fputc_unfiltered (c, stream)
      int c;
-     GDB_FILE * stream;
+     GDB_FILE *stream;
 {
   char buf[2];
 
@@ -2217,7 +2222,7 @@ fputc_unfiltered (c, stream)
 int
 fputc_filtered (c, stream)
      int c;
-     GDB_FILE * stream;
+     GDB_FILE *stream;
 {
   char buf[2];
 
@@ -2249,7 +2254,7 @@ puts_debug (prefix, string, suffix)
 
   /* If the prefix is changing, print the previous suffix, a new line,
      and the new prefix.  */
-  if ((return_p || (strcmp(prev_prefix, prefix) != 0)) && !new_line)
+  if ((return_p || (strcmp (prev_prefix, prefix) != 0)) && !new_line)
     {
       fputs_unfiltered (prev_suffix, gdb_stdlog);
       fputs_unfiltered ("\n", gdb_stdlog);
@@ -2270,7 +2275,7 @@ puts_debug (prefix, string, suffix)
   while ((ch = *string++) != '\0')
     {
       switch (ch)
-        {
+       {
        default:
          if (isprint (ch))
            fputc_unfiltered (ch, gdb_stdlog);
@@ -2279,15 +2284,29 @@ puts_debug (prefix, string, suffix)
            fprintf_unfiltered (gdb_stdlog, "\\x%02x", ch & 0xff);
          break;
 
-       case '\\': fputs_unfiltered ("\\\\",  gdb_stdlog);      break;
-       case '\b': fputs_unfiltered ("\\b",   gdb_stdlog);      break;
-       case '\f': fputs_unfiltered ("\\f",   gdb_stdlog);      break;
-       case '\n': new_line = 1;
-                  fputs_unfiltered ("\\n",   gdb_stdlog);      break;
-       case '\r': fputs_unfiltered ("\\r",   gdb_stdlog);      break;
-       case '\t': fputs_unfiltered ("\\t",   gdb_stdlog);      break;
-       case '\v': fputs_unfiltered ("\\v",   gdb_stdlog);      break;
-        }
+       case '\\':
+         fputs_unfiltered ("\\\\", gdb_stdlog);
+         break;
+       case '\b':
+         fputs_unfiltered ("\\b", gdb_stdlog);
+         break;
+       case '\f':
+         fputs_unfiltered ("\\f", gdb_stdlog);
+         break;
+       case '\n':
+         new_line = 1;
+         fputs_unfiltered ("\\n", gdb_stdlog);
+         break;
+       case '\r':
+         fputs_unfiltered ("\\r", gdb_stdlog);
+         break;
+       case '\t':
+         fputs_unfiltered ("\\t", gdb_stdlog);
+         break;
+       case '\v':
+         fputs_unfiltered ("\\v", gdb_stdlog);
+         break;
+       }
 
       return_p = ch == '\r';
     }
@@ -2385,7 +2404,7 @@ vprintf_unfiltered (format, args)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-fprintf_filtered (GDB_FILE *stream, const char *format, ...)
+fprintf_filtered (GDB_FILE * stream, const char *format,...)
 #else
 fprintf_filtered (va_alist)
      va_dcl
@@ -2409,7 +2428,7 @@ fprintf_filtered (va_alist)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-fprintf_unfiltered (GDB_FILE *stream, const char *format, ...)
+fprintf_unfiltered (GDB_FILE * stream, const char *format,...)
 #else
 fprintf_unfiltered (va_alist)
      va_dcl
@@ -2436,7 +2455,7 @@ fprintf_unfiltered (va_alist)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-fprintfi_filtered (int spaces, GDB_FILE *stream, const char *format, ...)
+fprintfi_filtered (int spaces, GDB_FILE * stream, const char *format,...)
 #else
 fprintfi_filtered (va_alist)
      va_dcl
@@ -2465,7 +2484,7 @@ fprintfi_filtered (va_alist)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-printf_filtered (const char *format, ...)
+printf_filtered (const char *format,...)
 #else
 printf_filtered (va_alist)
      va_dcl
@@ -2488,7 +2507,7 @@ printf_filtered (va_alist)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-printf_unfiltered (const char *format, ...)
+printf_unfiltered (const char *format,...)
 #else
 printf_unfiltered (va_alist)
      va_dcl
@@ -2513,7 +2532,7 @@ printf_unfiltered (va_alist)
 /* VARARGS */
 void
 #ifdef ANSI_PROTOTYPES
-printfi_filtered (int spaces, const char *format, ...)
+printfi_filtered (int spaces, const char *format,...)
 #else
 printfi_filtered (va_alist)
      va_dcl
@@ -2568,8 +2587,8 @@ n_spaces (n)
     {
       if (spaces)
        free (spaces);
-      spaces = (char *) xmalloc (n+1);
-      for (t = spaces+n; t != spaces;)
+      spaces = (char *) xmalloc (n + 1);
+      for (t = spaces + n; t != spaces;)
        *--t = ' ';
       spaces[n] = '\0';
       max_spaces = n;
@@ -2639,7 +2658,7 @@ fprintf_symbol_filtered (stream, name, lang, arg_mode)
 /* Do a strcmp() type operation on STRING1 and STRING2, ignoring any
    differences in whitespace.  Returns 0 if they match, non-zero if they
    don't (slightly different than strcmp()'s range of return values).
-   
+
    As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO".
    This "feature" is useful when searching for matching C++ function names
    (such as if the user types 'break FOO', where FOO is a mangled C++
@@ -2672,25 +2691,25 @@ strcmp_iw (string1, string2)
     }
   return (*string1 != '\0' && *string1 != '(') || (*string2 != '\0');
 }
-
 \f
+
 /*
-** subset_compare()
-**    Answer whether string_to_compare is a full or partial match to
-**    template_string.  The partial match must be in sequence starting
-**    at index 0.
-*/
+   ** subset_compare()
+   **    Answer whether string_to_compare is a full or partial match to
+   **    template_string.  The partial match must be in sequence starting
+   **    at index 0.
+ */
 int
 subset_compare (string_to_compare, template_string)
-    char *string_to_compare;
-    char *template_string;
+     char *string_to_compare;
+     char *template_string;
 {
   int match;
-  if (template_string != (char *)NULL && string_to_compare != (char *)NULL &&
-      strlen(string_to_compare) <= strlen(template_string))
-    match = (strncmp(template_string,
-                    string_to_compare,
-                    strlen(string_to_compare)) == 0);
+  if (template_string != (char *) NULL && string_to_compare != (char *) NULL &&
+      strlen (string_to_compare) <= strlen (template_string))
+    match = (strncmp (template_string,
+                     string_to_compare,
+                     strlen (string_to_compare)) == 0);
   else
     match = 0;
   return match;
@@ -2700,8 +2719,8 @@ subset_compare (string_to_compare, template_string)
 static void pagination_on_command PARAMS ((char *arg, int from_tty));
 static void
 pagination_on_command (arg, from_tty)
-  char *arg;
-  int from_tty;
+     char *arg;
+     int from_tty;
 {
   pagination_enabled = 1;
 }
@@ -2709,70 +2728,70 @@ pagination_on_command (arg, from_tty)
 static void pagination_on_command PARAMS ((char *arg, int from_tty));
 static void
 pagination_off_command (arg, from_tty)
-  char *arg;
-  int from_tty;
+     char *arg;
+     int from_tty;
 {
   pagination_enabled = 0;
 }
-
 \f
+
 void
 initialize_utils ()
 {
   struct cmd_list_element *c;
 
-  c = add_set_cmd ("width", class_support, var_uinteger, 
-                 (char *)&chars_per_line,
-                 "Set number of characters gdb thinks are in a line.",
-                 &setlist);
+  c = add_set_cmd ("width", class_support, var_uinteger,
+                  (char *) &chars_per_line,
+                  "Set number of characters gdb thinks are in a line.",
+                  &setlist);
   add_show_from_set (c, &showlist);
   c->function.sfunc = set_width_command;
 
   add_show_from_set
     (add_set_cmd ("height", class_support,
-                 var_uinteger, (char *)&lines_per_page,
+                 var_uinteger, (char *) &lines_per_page,
                  "Set number of lines gdb thinks are in a page.", &setlist),
      &showlist);
-  
+
   init_page_info ();
 
   /* If the output is not a terminal, don't paginate it.  */
   if (!GDB_FILE_ISATTY (gdb_stdout))
     lines_per_page = UINT_MAX;
 
-  set_width_command ((char *)NULL, 0, c);
+  set_width_command ((char *) NULL, 0, c);
 
   add_show_from_set
-    (add_set_cmd ("demangle", class_support, var_boolean, 
-                 (char *)&demangle,
-               "Set demangling of encoded C++ names when displaying symbols.",
+    (add_set_cmd ("demangle", class_support, var_boolean,
+                 (char *) &demangle,
+            "Set demangling of encoded C++ names when displaying symbols.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
     (add_set_cmd ("pagination", class_support,
-                 var_boolean, (char *)&pagination_enabled,
+                 var_boolean, (char *) &pagination_enabled,
                  "Set state of pagination.", &setlist),
      &showlist);
   if (xdb_commands)
     {
-      add_com("am", class_support, pagination_on_command, 
-              "Enable pagination");
-      add_com("sm", class_support, pagination_off_command, 
-              "Disable pagination");
+      add_com ("am", class_support, pagination_on_command,
+              "Enable pagination");
+      add_com ("sm", class_support, pagination_off_command,
+              "Disable pagination");
     }
 
   add_show_from_set
-    (add_set_cmd ("sevenbit-strings", class_support, var_boolean, 
-                 (char *)&sevenbit_strings,
-   "Set printing of 8-bit characters in strings as \\nnn.",
+    (add_set_cmd ("sevenbit-strings", class_support, var_boolean,
+                 (char *) &sevenbit_strings,
+                 "Set printing of 8-bit characters in strings as \\nnn.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
-    (add_set_cmd ("asm-demangle", class_support, var_boolean, 
-                 (char *)&asm_demangle,
-       "Set demangling of C++ names in disassembly listings.",
+    (add_set_cmd ("asm-demangle", class_support, var_boolean,
+                 (char *) &asm_demangle,
+                 "Set demangling of C++ names in disassembly listings.",
                  &setprintlist),
      &showprintlist);
 }
@@ -2780,7 +2799,7 @@ initialize_utils ()
 /* Machine specific function to handle SIGWINCH signal. */
 
 #ifdef  SIGWINCH_HANDLER_BODY
-        SIGWINCH_HANDLER_BODY
+SIGWINCH_HANDLER_BODY
 #endif
 \f
 /* Support for converting target fp numbers into host DOUBLEST format.  */
@@ -2838,7 +2857,7 @@ get_field (data, order, total_len, start, len)
           this field.  */
        result |=
          (*(data + cur_byte) & ((1 << (len - cur_bitshift)) - 1))
-           << cur_bitshift;
+         << cur_bitshift;
       else
        result |= *(data + cur_byte) << cur_bitshift;
       cur_bitshift += FLOATFORMAT_CHAR_BIT;
@@ -2849,7 +2868,7 @@ get_field (data, order, total_len, start, len)
     }
   return result;
 }
-  
+
 /* Convert from FMT to a DOUBLEST.
    FROM is the address of the extended float.
    Store the DOUBLEST in *TO.  */
@@ -2860,7 +2879,7 @@ floatformat_to_doublest (fmt, from, to)
      char *from;
      DOUBLEST *to;
 {
-  unsigned char *ufrom = (unsigned char *)from;
+  unsigned char *ufrom = (unsigned char *) from;
   DOUBLEST dto;
   long exponent;
   unsigned long mant;
@@ -2879,18 +2898,18 @@ floatformat_to_doublest (fmt, from, to)
      than sizeof(long) for the target.  FIXME: Assumes sizeof(long)
      for the target is 4. */
 
-  if (fmt -> byteorder == floatformat_littlebyte_bigword)
+  if (fmt->byteorder == floatformat_littlebyte_bigword)
     {
       static unsigned char *newfrom;
       unsigned char *swapin, *swapout;
       int longswaps;
 
-      longswaps = fmt -> totalsize / FLOATFORMAT_CHAR_BIT;
+      longswaps = fmt->totalsize / FLOATFORMAT_CHAR_BIT;
       longswaps >>= 3;
-      
+
       if (newfrom == NULL)
        {
-         newfrom = (unsigned char *) xmalloc (fmt -> totalsize);
+         newfrom = (unsigned char *) xmalloc (fmt->totalsize);
        }
       swapout = newfrom;
       swapin = ufrom;
@@ -2945,9 +2964,9 @@ floatformat_to_doublest (fmt, from, to)
       mant_bits = min (mant_bits_left, 32);
 
       mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
-                        mant_off, mant_bits);
+                       mant_off, mant_bits);
 
-      dto += ldexp ((double)mant, exponent - mant_bits);
+      dto += ldexp ((double) mant, exponent - mant_bits);
       exponent -= mant_bits;
       mant_off += mant_bits;
       mant_bits_left -= mant_bits;
@@ -3059,7 +3078,7 @@ ldfrexp (value, eptr)
     }
 
   *eptr = exp;
-  return value/tmp;
+  return value / tmp;
 }
 #endif /* HAVE_LONG_DOUBLE */
 
@@ -3079,7 +3098,7 @@ floatformat_from_doublest (fmt, from, to)
   DOUBLEST mant;
   unsigned int mant_bits, mant_off;
   int mant_bits_left;
-  unsigned char *uto = (unsigned char *)to;
+  unsigned char *uto = (unsigned char *) to;
 
   memcpy (&dfrom, from, sizeof (dfrom));
   memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
@@ -3131,13 +3150,13 @@ floatformat_from_doublest (fmt, from, to)
       mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;
 
       mant *= 4294967296.0;
-      mant_long = (unsigned long)mant;
+      mant_long = (unsigned long) mant;
       mant -= mant_long;
 
       /* If the integer bit is implicit, then we need to discard it.
-        If we are discarding a zero, we should be (but are not) creating
-        a denormalized number which means adjusting the exponent
-        (I think).  */
+         If we are discarding a zero, we should be (but are not) creating
+         a denormalized number which means adjusting the exponent
+         (I think).  */
       if (mant_bits_left == fmt->man_len
          && fmt->intbit == floatformat_intbit_no)
        {
@@ -3157,7 +3176,7 @@ floatformat_from_doublest (fmt, from, to)
       mant_off += mant_bits;
       mant_bits_left -= mant_bits;
     }
-  if (fmt -> byteorder == floatformat_littlebyte_bigword)
+  if (fmt->byteorder == floatformat_littlebyte_bigword)
     {
       int count;
       unsigned char *swaplow = uto;
@@ -3176,12 +3195,13 @@ floatformat_from_doublest (fmt, from, to)
 /* temporary storage using circular buffer */
 #define NUMCELLS 16
 #define CELLSIZE 32
-static char*
-get_cell()
+static char *
+get_cell ()
 {
   static char buf[NUMCELLS][CELLSIZE];
-  static int cell=0;
-  if (++cell>=NUMCELLS) cell=0;
+  static int cell = 0;
+  if (++cell >= NUMCELLS)
+    cell = 0;
   return buf[cell];
 }
 
@@ -3202,106 +3222,106 @@ get_cell()
 
 static int thirty_two = 32;    /* eliminate warning from compiler on 32-bit systems */
 
-char
-paddr(addr)
-  t_addr addr;
+char *
+paddr (addr)
+     t_addr addr;
 {
-  char *paddr_str=get_cell();
-  switch (sizeof(t_addr))
+  char *paddr_str = get_cell ();
+  switch (sizeof (t_addr))
     {
-      case 8:
-        sprintf (paddr_str, "%08lx%08lx",
-               (unsigned long) (addr >> thirty_two), (unsigned long) (addr & 0xffffffff));
-       break;
-      case 4:
-        sprintf (paddr_str, "%08lx", (unsigned long) addr);
-       break;
-      case 2:
-        sprintf (paddr_str, "%04x", (unsigned short) (addr & 0xffff));
-       break;
-      default:
-        sprintf (paddr_str, "%lx", (unsigned long) addr);
+    case 8:
+      sprintf (paddr_str, "%08lx%08lx",
+              (unsigned long) (addr >> thirty_two), (unsigned long) (addr & 0xffffffff));
+      break;
+    case 4:
+      sprintf (paddr_str, "%08lx", (unsigned long) addr);
+      break;
+    case 2:
+      sprintf (paddr_str, "%04x", (unsigned short) (addr & 0xffff));
+      break;
+    default:
+      sprintf (paddr_str, "%lx", (unsigned long) addr);
     }
   return paddr_str;
 }
 
-char
-preg(reg)
-  t_reg reg;
+char *
+preg (reg)
+     t_reg reg;
 {
-  char *preg_str=get_cell();
-  switch (sizeof(t_reg))
+  char *preg_str = get_cell ();
+  switch (sizeof (t_reg))
     {
-      case 8:
-        sprintf (preg_str, "%08lx%08lx",
-               (unsigned long) (reg >> thirty_two), (unsigned long) (reg & 0xffffffff));
-       break;
-      case 4:
-        sprintf (preg_str, "%08lx", (unsigned long) reg);
-       break;
-      case 2:
-        sprintf (preg_str, "%04x", (unsigned short) (reg & 0xffff));
-       break;
-      default:
-        sprintf (preg_str, "%lx", (unsigned long) reg);
+    case 8:
+      sprintf (preg_str, "%08lx%08lx",
+              (unsigned long) (reg >> thirty_two), (unsigned long) (reg & 0xffffffff));
+      break;
+    case 4:
+      sprintf (preg_str, "%08lx", (unsigned long) reg);
+      break;
+    case 2:
+      sprintf (preg_str, "%04x", (unsigned short) (reg & 0xffff));
+      break;
+    default:
+      sprintf (preg_str, "%lx", (unsigned long) reg);
     }
   return preg_str;
 }
 
-char*
-paddr_nz(addr)
-  t_addr addr;
+char *
+paddr_nz (addr)
+     t_addr addr;
 {
-  char *paddr_str=get_cell();
-  switch (sizeof(t_addr))
+  char *paddr_str = get_cell ();
+  switch (sizeof (t_addr))
     {
-      case 8:
-       {
-         unsigned long high = (unsigned long) (addr >> thirty_two);
-         if (high == 0)
-           sprintf (paddr_str, "%lx", (unsigned long) (addr & 0xffffffff));
-         else
-           sprintf (paddr_str, "%lx%08lx",
-                   high, (unsigned long) (addr & 0xffffffff));
-         break;
-       }
-      case 4:
-        sprintf (paddr_str, "%lx", (unsigned long) addr);
-       break;
-      case 2:
-        sprintf (paddr_str, "%x", (unsigned short) (addr & 0xffff));
+    case 8:
+      {
+       unsigned long high = (unsigned long) (addr >> thirty_two);
+       if (high == 0)
+         sprintf (paddr_str, "%lx", (unsigned long) (addr & 0xffffffff));
+       else
+         sprintf (paddr_str, "%lx%08lx",
+                  high, (unsigned long) (addr & 0xffffffff));
        break;
-      default:
-        sprintf (paddr_str,"%lx", (unsigned long) addr);
+      }
+    case 4:
+      sprintf (paddr_str, "%lx", (unsigned long) addr);
+      break;
+    case 2:
+      sprintf (paddr_str, "%x", (unsigned short) (addr & 0xffff));
+      break;
+    default:
+      sprintf (paddr_str, "%lx", (unsigned long) addr);
     }
   return paddr_str;
 }
 
-char*
-preg_nz(reg)
-  t_reg reg;
+char *
+preg_nz (reg)
+     t_reg reg;
 {
-  char *preg_str=get_cell();
-  switch (sizeof(t_reg))
+  char *preg_str = get_cell ();
+  switch (sizeof (t_reg))
     {
-      case 8:
-       {
-         unsigned long high = (unsigned long) (reg >> thirty_two);
-         if (high == 0)
-           sprintf (preg_str, "%lx", (unsigned long) (reg & 0xffffffff));
-         else
-           sprintf (preg_str, "%lx%08lx",
-                   high, (unsigned long) (reg & 0xffffffff));
-         break;
-       }
-      case 4:
-        sprintf (preg_str, "%lx", (unsigned long) reg);
-       break;
-      case 2:
-        sprintf (preg_str, "%x", (unsigned short) (reg & 0xffff));
+    case 8:
+      {
+       unsigned long high = (unsigned long) (reg >> thirty_two);
+       if (high == 0)
+         sprintf (preg_str, "%lx", (unsigned long) (reg & 0xffffffff));
+       else
+         sprintf (preg_str, "%lx%08lx",
+                  high, (unsigned long) (reg & 0xffffffff));
        break;
-      default:
-        sprintf (preg_str, "%lx", (unsigned long) reg);
+      }
+    case 4:
+      sprintf (preg_str, "%lx", (unsigned long) reg);
+      break;
+    case 2:
+      sprintf (preg_str, "%x", (unsigned short) (reg & 0xffff));
+      break;
+    default:
+      sprintf (preg_str, "%lx", (unsigned long) reg);
     }
   return preg_str;
 }
@@ -3322,5 +3342,3 @@ core_addr_greaterthan (lhs, rhs)
 {
   return (lhs > rhs);
 }
-
-
index 6bb8a70474e68fc2088c4d794176593b66622ed8..c6e605b423c0b7b47aada6906a81e921724bbc3a 100644 (file)
@@ -1,21 +1,22 @@
 /* Target-dependent code for the NEC V850 for GDB, the GNU debugger.
    Copyright 1996, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -47,37 +48,49 @@ static char *v850e_reg_names[] =
 char **v850_register_names = v850_generic_reg_names;
 
 struct
+  {
+    char **regnames;
+    int mach;
+  }
+v850_processor_type_table[] =
 {
-  char **regnames;
-  int mach;
-} v850_processor_type_table[] =
-{
-  { v850_generic_reg_names, bfd_mach_v850 },
-  { v850e_reg_names, bfd_mach_v850e },
-  { v850e_reg_names, bfd_mach_v850ea },
-  { NULL, 0 }
+  {
+    v850_generic_reg_names, bfd_mach_v850
+  }
+  ,
+  {
+    v850e_reg_names, bfd_mach_v850e
+  }
+  ,
+  {
+    v850e_reg_names, bfd_mach_v850ea
+  }
+  ,
+  {
+    NULL, 0
+  }
 };
 
 /* Info gleaned from scanning a function's prologue.  */
 
 struct pifsr                   /* Info about one saved reg */
-{
-  int framereg;                        /* Frame reg (SP or FP) */
-  int offset;                  /* Offset from framereg */
-  int cur_frameoffset;         /* Current frameoffset */
-  int reg;                     /* Saved register number */
-};
+  {
+    int framereg;              /* Frame reg (SP or FP) */
+    int offset;                        /* Offset from framereg */
+    int cur_frameoffset;       /* Current frameoffset */
+    int reg;                   /* Saved register number */
+  };
 
 struct prologue_info
-{
-  int framereg;
-  int frameoffset;
-  int start_function;
-  struct pifsr *pifsrs;
-};
+  {
+    int framereg;
+    int frameoffset;
+    int start_function;
+    struct pifsr *pifsrs;
+  };
 
-static CORE_ADDR v850_scan_prologue PARAMS ((CORE_ADDR pc, 
-                                            struct prologue_info *fs));
+static CORE_ADDR v850_scan_prologue PARAMS ((CORE_ADDR pc,
+                                            struct prologue_info * fs));
 
 
 /* Should call_function allocate stack space for a struct return?  */
@@ -88,11 +101,11 @@ v850_use_struct_convention (gcc_p, type)
 {
   return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 4);
 }
-
 \f
 
+
 /* Structure for mapping bits in register lists to register numbers. */
-struct reg_list 
+struct reg_list
 {
   long mask;
   int regno;
@@ -101,7 +114,7 @@ struct reg_list
 /* Helper function for v850_scan_prologue to handle prepare instruction. */
 
 static void
-handle_prepare (int insn, int insn2, CORE_ADDR *current_pc_ptr,
+handle_prepare (int insn, int insn2, CORE_ADDR * current_pc_ptr,
                struct prologue_info *pi, struct pifsr **pifsr_ptr)
 
 {
@@ -110,25 +123,25 @@ handle_prepare (int insn, int insn2, CORE_ADDR *current_pc_ptr,
   long next = insn2 & 0xffff;
   long list12 = ((insn & 1) << 16) + (next & 0xffe0);
   long offset = (insn & 0x3e) << 1;
-  static struct reg_list reg_table [] =
+  static struct reg_list reg_table[] =
   {
-    { 0x00800, 20 },   /* r20 */
-    { 0x00400, 21 },   /* r21 */
-    { 0x00200, 22 },   /* r22 */
-    { 0x00100, 23 },   /* r23 */
-    { 0x08000, 24 },   /* r24 */
-    { 0x04000, 25 },   /* r25 */
-    { 0x02000, 26 },   /* r26 */
-    { 0x01000, 27 },   /* r27 */
-    { 0x00080, 28 },   /* r28 */
-    { 0x00040, 29 },   /* r29 */
-    { 0x10000, 30 },   /* ep */
-    { 0x00020, 31 },   /* lp */
-    { 0, 0 }           /* end of table */
+    {0x00800, 20},             /* r20 */
+    {0x00400, 21},             /* r21 */
+    {0x00200, 22},             /* r22 */
+    {0x00100, 23},             /* r23 */
+    {0x08000, 24},             /* r24 */
+    {0x04000, 25},             /* r25 */
+    {0x02000, 26},             /* r26 */
+    {0x01000, 27},             /* r27 */
+    {0x00080, 28},             /* r28 */
+    {0x00040, 29},             /* r29 */
+    {0x10000, 30},             /* ep */
+    {0x00020, 31},             /* lp */
+    {0, 0}                     /* end of table */
   };
   int i;
 
-  if ((next & 0x1f) == 0x0b)           /* skip imm16 argument */
+  if ((next & 0x1f) == 0x0b)   /* skip imm16 argument */
     current_pc += 2;
   else if ((next & 0x1f) == 0x13)      /* skip imm16 argument */
     current_pc += 2;
@@ -156,9 +169,9 @@ handle_prepare (int insn, int insn2, CORE_ADDR *current_pc_ptr,
              pifsr->reg = reg;
              pifsr->offset = offset;
              pifsr->cur_frameoffset = pi->frameoffset;
-    #ifdef DEBUG
+#ifdef DEBUG
              printf_filtered ("\tSaved register r%d, offset %d", reg, pifsr->offset);
-    #endif
+#endif
              pifsr++;
            }
        }
@@ -179,51 +192,51 @@ handle_prepare (int insn, int insn2, CORE_ADDR *current_pc_ptr,
 
 static void
 handle_pushm (int insn, int insn2, struct prologue_info *pi,
-            struct pifsr **pifsr_ptr)
+             struct pifsr **pifsr_ptr)
 
 {
   struct pifsr *pifsr = *pifsr_ptr;
   long list12 = ((insn & 0x0f) << 16) + (insn2 & 0xfff0);
   long offset = 0;
-  static struct reg_list pushml_reg_table [] =
+  static struct reg_list pushml_reg_table[] =
   {
-    { 0x80000, PS_REGNUM },    /* PSW */
-    { 0x40000, 1 },            /* r1 */
-    { 0x20000, 2 },            /* r2 */
-    { 0x10000, 3 },            /* r3 */
-    { 0x00800, 4 },            /* r4 */
-    { 0x00400, 5 },            /* r5 */
-    { 0x00200, 6 },            /* r6 */
-    { 0x00100, 7 },            /* r7 */
-    { 0x08000, 8 },            /* r8 */
-    { 0x04000, 9 },            /* r9 */
-    { 0x02000, 10 },           /* r10 */
-    { 0x01000, 11 },           /* r11 */
-    { 0x00080, 12 },           /* r12 */
-    { 0x00040, 13 },           /* r13 */
-    { 0x00020, 14 },           /* r14 */
-    { 0x00010, 15 },           /* r15 */
-    { 0, 0 }           /* end of table */
+    {0x80000, PS_REGNUM},      /* PSW */
+    {0x40000, 1},              /* r1 */
+    {0x20000, 2},              /* r2 */
+    {0x10000, 3},              /* r3 */
+    {0x00800, 4},              /* r4 */
+    {0x00400, 5},              /* r5 */
+    {0x00200, 6},              /* r6 */
+    {0x00100, 7},              /* r7 */
+    {0x08000, 8},              /* r8 */
+    {0x04000, 9},              /* r9 */
+    {0x02000, 10},             /* r10 */
+    {0x01000, 11},             /* r11 */
+    {0x00080, 12},             /* r12 */
+    {0x00040, 13},             /* r13 */
+    {0x00020, 14},             /* r14 */
+    {0x00010, 15},             /* r15 */
+    {0, 0}                     /* end of table */
   };
-  static struct reg_list pushmh_reg_table [] =
+  static struct reg_list pushmh_reg_table[] =
   {
-    { 0x80000, 16 },           /* r16 */
-    { 0x40000, 17 },           /* r17 */
-    { 0x20000, 18 },           /* r18 */
-    { 0x10000, 19 },           /* r19 */
-    { 0x00800, 20 },           /* r20 */
-    { 0x00400, 21 },           /* r21 */
-    { 0x00200, 22 },           /* r22 */
-    { 0x00100, 23 },           /* r23 */
-    { 0x08000, 24 },           /* r24 */
-    { 0x04000, 25 },           /* r25 */
-    { 0x02000, 26 },           /* r26 */
-    { 0x01000, 27 },           /* r27 */
-    { 0x00080, 28 },           /* r28 */
-    { 0x00040, 29 },           /* r29 */
-    { 0x00010, 30 },           /* r30 */
-    { 0x00020, 31 },           /* r31 */
-    { 0, 0 }           /* end of table */
+    {0x80000, 16},             /* r16 */
+    {0x40000, 17},             /* r17 */
+    {0x20000, 18},             /* r18 */
+    {0x10000, 19},             /* r19 */
+    {0x00800, 20},             /* r20 */
+    {0x00400, 21},             /* r21 */
+    {0x00200, 22},             /* r22 */
+    {0x00100, 23},             /* r23 */
+    {0x08000, 24},             /* r24 */
+    {0x04000, 25},             /* r25 */
+    {0x02000, 26},             /* r26 */
+    {0x01000, 27},             /* r27 */
+    {0x00080, 28},             /* r28 */
+    {0x00040, 29},             /* r29 */
+    {0x00010, 30},             /* r30 */
+    {0x00020, 31},             /* r31 */
+    {0, 0}                     /* end of table */
   };
   struct reg_list *reg_table;
   int i;
@@ -255,9 +268,9 @@ handle_pushm (int insn, int insn2, struct prologue_info *pi,
              pifsr->reg = reg;
              pifsr->offset = offset;
              pifsr->cur_frameoffset = pi->frameoffset;
-    #ifdef DEBUG
+#ifdef DEBUG
              printf_filtered ("\tSaved register r%d, offset %d", reg, pifsr->offset);
-    #endif
+#endif
              pifsr++;
            }
        }
@@ -269,10 +282,10 @@ handle_pushm (int insn, int insn2, struct prologue_info *pi,
   /* Set result parameters. */
   *pifsr_ptr = pifsr;
 }
+\f
 
 
 
-\f
 /* 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
@@ -329,7 +342,7 @@ v850_scan_prologue (pc, pi)
 
   /* Now, search the prologue looking for instructions that setup fp, save
      rp, adjust sp and such.  We also record the frame offset of any saved
-     registers. */ 
+     registers. */
 
   pi->frameoffset = 0;
   pi->framereg = SP_REGNUM;
@@ -343,21 +356,21 @@ v850_scan_prologue (pc, pi)
 
 #ifdef DEBUG
   printf_filtered ("Current_pc = 0x%.8lx, prologue_end = 0x%.8lx\n",
-                  (long)func_addr, (long)prologue_end);
+                  (long) func_addr, (long) prologue_end);
 #endif
 
-  for (current_pc = func_addr; current_pc < prologue_end; )
+  for (current_pc = func_addr; current_pc < prologue_end;)
     {
       int insn, insn2;
 
 #ifdef DEBUG
-      printf_filtered ("0x%.8lx ", (long)current_pc);
+      printf_filtered ("0x%.8lx ", (long) current_pc);
       (*tm_print_insn) (current_pc, &tm_print_insn_info);
 #endif
 
       insn = read_memory_unsigned_integer (current_pc, 2);
       current_pc += 2;
-      if ((insn & 0x0780) >= 0x0600) /* Four byte instruction? */
+      if ((insn & 0x0780) >= 0x0600)   /* Four byte instruction? */
        {
          insn2 = read_memory_unsigned_integer (current_pc, 2);
          current_pc += 2;
@@ -365,9 +378,9 @@ v850_scan_prologue (pc, pi)
 
       if ((insn & 0xffc0) == ((10 << 11) | 0x0780) && !regsave_func_p)
        {                       /* jarl <func>,10 */
-         long low_disp = insn2 & ~ (long) 1;
+         long low_disp = insn2 & ~(long) 1;
          long disp = (((((insn & 0x3f) << 16) + low_disp)
-                       & ~ (long) 1) ^ 0x00200000) - 0x00200000;
+                       & ~(long) 1) ^ 0x00200000) - 0x00200000;
 
          save_pc = current_pc;
          save_end = prologue_end;
@@ -375,14 +388,14 @@ v850_scan_prologue (pc, pi)
          current_pc += disp - 4;
          prologue_end = (current_pc
                          + (2 * 3)     /* moves to/from ep */
-                         + 4           /* addi <const>,sp,sp */
-                         + 2           /* jmp [r10] */
+                         + 4   /* addi <const>,sp,sp */
+                         + 2   /* jmp [r10] */
                          + (2 * 12)    /* sst.w to save r2, r20-r29, r31 */
                          + 20);        /* slop area */
 
 #ifdef DEBUG
          printf_filtered ("\tfound jarl <func>,r10, disp = %ld, low_disp = %ld, new pc = 0x%.8lx\n",
-                          disp, low_disp, (long)current_pc + 2);
+                          disp, low_disp, (long) current_pc + 2);
 #endif
          continue;
        }
@@ -397,12 +410,12 @@ v850_scan_prologue (pc, pi)
          current_pc = ctbp + (read_memory_unsigned_integer (adr, 2) & 0xffff);
          prologue_end = (current_pc
                          + (2 * 3)     /* prepare list2,imm5,sp/imm */
-                         + 4           /* ctret */
+                         + 4   /* ctret */
                          + 20);        /* slop area */
 
 #ifdef DEBUG
          printf_filtered ("\tfound callt,  ctbp = 0x%.8lx, adr = %.8lx, new pc = 0x%.8lx\n",
-                          ctbp, adr, (long)current_pc);
+                          ctbp, adr, (long) current_pc);
 #endif
          continue;
        }
@@ -443,7 +456,7 @@ v850_scan_prologue (pc, pi)
 #ifdef DEBUG
          printf_filtered ("\n");
 #endif
-         break;                                /* Ran into end of prologue */
+         break;                /* Ran into end of prologue */
        }
 
       else if ((insn & 0xffe0) == ((SP_REGNUM << 11) | 0x0240))                /* add <imm>,sp */
@@ -460,19 +473,19 @@ v850_scan_prologue (pc, pi)
        r12_tmp = insn2 << 16;
       else if (insn == ((R12_REGNUM << 11) | 0x0620 | R12_REGNUM))     /* movea lo(const),r12,r12 */
        r12_tmp += insn2;
-      else if (insn == ((SP_REGNUM << 11) | 0x01c0 | R12_REGNUM) && r12_tmp) /* add r12,sp */
+      else if (insn == ((SP_REGNUM << 11) | 0x01c0 | R12_REGNUM) && r12_tmp)   /* add r12,sp */
        pi->frameoffset = r12_tmp;
       else if (insn == ((EP_REGNUM << 11) | 0x0000 | SP_REGNUM))       /* mov sp,ep */
        ep_used = 1;
       else if (insn == ((EP_REGNUM << 11) | 0x0000 | R1_REGNUM))       /* mov r1,ep */
        ep_used = 0;
-      else if (((insn & 0x07ff) == (0x0760 | SP_REGNUM)                        /* st.w <reg>,<offset>[sp] */
+      else if (((insn & 0x07ff) == (0x0760 | SP_REGNUM)                /* st.w <reg>,<offset>[sp] */
                || (fp_used
                    && (insn & 0x07ff) == (0x0760 | FP_RAW_REGNUM)))    /* st.w <reg>,<offset>[fp] */
               && pifsr
               && (((reg = (insn >> 11) & 0x1f) >= SAVE1_START_REGNUM && reg <= SAVE1_END_REGNUM)
                   || (reg >= SAVE2_START_REGNUM && reg <= SAVE2_END_REGNUM)
-                  || (reg >= SAVE3_START_REGNUM && reg <= SAVE3_END_REGNUM)))
+                || (reg >= SAVE3_START_REGNUM && reg <= SAVE3_END_REGNUM)))
        {
          pifsr->reg = reg;
          pifsr->offset = insn2 & ~1;
@@ -483,12 +496,12 @@ v850_scan_prologue (pc, pi)
          pifsr++;
        }
 
-      else if (ep_used                                         /* sst.w <reg>,<offset>[ep] */
+      else if (ep_used         /* sst.w <reg>,<offset>[ep] */
               && ((insn & 0x0781) == 0x0501)
               && pifsr
               && (((reg = (insn >> 11) & 0x1f) >= SAVE1_START_REGNUM && reg <= SAVE1_END_REGNUM)
                   || (reg >= SAVE2_START_REGNUM && reg <= SAVE2_END_REGNUM)
-                  || (reg >= SAVE3_START_REGNUM && reg <= SAVE3_END_REGNUM)))
+                || (reg >= SAVE3_START_REGNUM && reg <= SAVE3_END_REGNUM)))
        {
          pifsr->reg = reg;
          pifsr->offset = (insn & 0x007e) << 1;
@@ -516,7 +529,7 @@ v850_scan_prologue (pc, pi)
 
 #ifdef DEBUG
       printf_filtered ("Saved register r%d, offset = %d, framereg = r%d\n",
-                      pifsr_tmp->reg, pifsr_tmp->offset, pifsr_tmp->framereg);
+                   pifsr_tmp->reg, pifsr_tmp->offset, pifsr_tmp->framereg);
 #endif
     }
 
@@ -555,7 +568,7 @@ v850_init_extra_frame_info (fi)
   /* The call dummy doesn't save any registers on the stack, so we can return
      now.  */
   if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
-      return;
+    return;
 
   pi.pifsrs = pifsrs;
 
@@ -591,8 +604,8 @@ v850_frame_chain (fi)
   callers_pc = FRAME_SAVED_PC (fi);
   /* If caller is a call-dummy, then our FP bears no relation to his FP! */
   fp = v850_find_callers_reg (fi, FP_RAW_REGNUM);
-  if (PC_IN_CALL_DUMMY(callers_pc, fp, fp))
-    return fp; /* caller is call-dummy: return oldest value of FP */
+  if (PC_IN_CALL_DUMMY (callers_pc, fp, fp))
+    return fp;                 /* caller is call-dummy: return oldest value of FP */
 
   /* Caller is NOT a call-dummy, so everything else should just work.
      Even if THIS frame is a call-dummy! */
@@ -626,8 +639,8 @@ v850_find_callers_reg (fi, regnum)
     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_memory_unsigned_integer (fi->fsr.regs[regnum],
+                                          REGISTER_RAW_SIZE (regnum));
 
   return read_register (regnum);
 }
@@ -672,7 +685,7 @@ v850_pop_frame (frame)
 {
   int regnum;
 
-  if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
+  if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
     generic_pop_dummy_frame ();
   else
     {
@@ -681,8 +694,8 @@ v850_pop_frame (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)));
+                     read_memory_unsigned_integer (frame->fsr.regs[regnum],
+                                              REGISTER_RAW_SIZE (regnum)));
 
       write_register (SP_REGNUM, FRAME_FP (frame));
     }
@@ -699,7 +712,7 @@ v850_pop_frame (frame)
    in as a secret first argument (always in R6).
 
    Stack space for the args has NOT been allocated: that job is up to us.
  */
+ */
 
 CORE_ADDR
 v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
@@ -719,15 +732,15 @@ v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
 
   /* 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... */
-               /* (you might think we could allocate 16 bytes */
-               /* less, but the ABI seems to use it all! )  */
+    len += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
+  sp -= len;                   /* possibly over-allocating, but it works... */
+  /* (you might think we could allocate 16 bytes */
+  /* less, but the ABI seems to use it all! )  */
   argreg = ARG0_REGNUM;
 
   /* the struct_return pointer occupies the first parameter-passing reg */
   if (struct_return)
-      write_register (argreg++, struct_addr);
+    write_register (argreg++, struct_addr);
 
   stack_offset = 16;
   /* The offset onto the stack at which we will start copying parameters
@@ -741,7 +754,7 @@ v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
     {
       int len;
       char *val;
-      char valbuf[REGISTER_RAW_SIZE(ARG0_REGNUM)];
+      char valbuf[REGISTER_RAW_SIZE (ARG0_REGNUM)];
 
       if (TYPE_CODE (VALUE_TYPE (*args)) == TYPE_CODE_STRUCT
          && TYPE_LENGTH (VALUE_TYPE (*args)) > 8)
@@ -753,11 +766,11 @@ v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
       else
        {
          len = TYPE_LENGTH (VALUE_TYPE (*args));
-         val = (char *)VALUE_CONTENTS (*args);
+         val = (char *) VALUE_CONTENTS (*args);
        }
 
       while (len > 0)
-       if  (argreg <= ARGLAST_REGNUM)
+       if (argreg <= ARGLAST_REGNUM)
          {
            CORE_ADDR regval;
 
@@ -784,7 +797,7 @@ v850_push_arguments (nargs, args, sp, struct_return, struct_addr)
 /* Function: push_return_address (pc)
    Set up the return address for the inferior function call.
    Needed for targets where we don't actually execute a JSR/BSR instruction */
+
 CORE_ADDR
 v850_push_return_address (pc, sp)
      CORE_ADDR pc;
@@ -793,7 +806,7 @@ v850_push_return_address (pc, sp)
   write_register (RP_REGNUM, CALL_DUMMY_ADDRESS ());
   return sp;
 }
+
 /* 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
@@ -805,8 +818,8 @@ CORE_ADDR
 v850_frame_saved_pc (fi)
      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);
+  if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+    return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
   else
     return v850_find_callers_reg (fi, RP_REGNUM);
 }
@@ -815,9 +828,9 @@ v850_frame_saved_pc (fi)
 /* 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
  */
+   jarl <offset24>, r31
+   trap
+ */
 
 int
 v850_fix_call_dummy (dummy, sp, fun, nargs, args, type, gcc_p)
@@ -835,8 +848,8 @@ v850_fix_call_dummy (dummy, sp, fun, nargs, args, type, gcc_p)
   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);
+  store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff);
+  store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16);
   return 0;
 }
 
index da2b4c97b7c82dd72c6b9cae057aeebe8cfaeaae..fc04e28fea7c1c7e4bc49feac1457f4e741b5000 100644 (file)
@@ -1,21 +1,22 @@
 /* ICE interface for the NEC V850 for GDB, the GNU debugger.
    Copyright 1996, Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -31,17 +32,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "command.h"
 
 #include <windows.h>
-#include <winuser.h> /* for WM_USER */
+#include <winuser.h>           /* for WM_USER */
+
+extern unsigned long int strtoul (const char *nptr, char **endptr,
+                                 int base);
 
-extern unsigned long int strtoul(const char *nptr, char **endptr,
-                                 int base);
 /* Local data definitions */
 struct MessageIO
-{
-  int    size;   /* length of input or output in bytes         */
-  char * buf;    /* buffer having the input/output information */
-};
+  {
+    int size;                  /* length of input or output in bytes         */
+    char *buf;                 /* buffer having the input/output information */
+  };
 
 /* Prototypes for functions located in other files */
 extern void break_command PARAMS ((char *, int));
@@ -59,18 +60,18 @@ static int init_hidden_window PARAMS ((void));
 
 static LRESULT CALLBACK v850ice_wndproc PARAMS ((HWND, UINT, WPARAM, LPARAM));
 
-static void v850ice_files_info PARAMS ((struct target_ops *ignore));
+static void v850ice_files_info PARAMS ((struct target_ops * ignore));
 
 static int v850ice_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
                                        int len, int should_write,
-                                       struct target_ops *target));
+                                       struct target_ops * target));
 
 static void v850ice_prepare_to_store PARAMS ((void));
 
 static void v850ice_fetch_registers PARAMS ((int regno));
 
 static void v850ice_resume PARAMS ((int pid, int step,
-                                  enum target_signal siggnal));
+                                   enum target_signal siggnal));
 
 static void v850ice_open PARAMS ((char *name, int from_tty));
 
@@ -82,7 +83,7 @@ static void v850ice_store_registers PARAMS ((int regno));
 
 static void v850ice_mourn PARAMS ((void));
 
-static int v850ice_wait PARAMS ((int pid, struct target_waitstatus *status));
+static int v850ice_wait PARAMS ((int pid, struct target_waitstatus * status));
 
 static void v850ice_kill PARAMS ((void));
 
@@ -122,49 +123,49 @@ static void do_gdb (char *, char *, void (*func) PARAMS ((char *, int)), int);
 
 
 /* Globals */
-static HWND hidden_hwnd;                 /* HWND for messages */
+static HWND hidden_hwnd;       /* HWND for messages */
 
-long (__stdcall *ExeAppReq) PARAMS ((char *, long, char *, struct MessageIO *));
+long (__stdcall * ExeAppReq) PARAMS ((char *, long, char *, struct MessageIO *));
 
-long (__stdcall *RegisterClient) PARAMS ((HWND));
+long (__stdcall * RegisterClient) PARAMS ((HWND));
 
-long (__stdcall *UnregisterClient) PARAMS ((void));
+long (__stdcall * UnregisterClient) PARAMS ((void));
 
 
 /* Globals local to this file only */
-static int ice_open = 0;        /* Is ICE open? */
+static int ice_open = 0;       /* Is ICE open? */
 
-static char * v850_CB_Result;   /* special char array for saving 'callback' results */
+static char *v850_CB_Result;   /* special char array for saving 'callback' results */
 
-static int SimulateCallback;    /* simulate a callback event */
+static int SimulateCallback;   /* simulate a callback event */
 
-#define MAX_BLOCK_SIZE    64*1024   /* Cannot transfer memory in blocks bigger
-                                       than this */
+#define MAX_BLOCK_SIZE    64*1024      /* Cannot transfer memory in blocks bigger
+                                          than this */
 /* MDI/ICE Message IDs */
-#define GSINGLESTEP     0x200   /* single-step target          */
-#define GRESUME         0x201   /* resume target               */
-#define GREADREG        0x202   /* read a register             */
-#define GWRITEREG       0x203   /* write a register            */
-#define GWRITEBLOCK     0x204   /* write a block of memory     */
-#define GREADBLOCK      0x205   /* read a block of memory      */
-#define GSETBREAK       0x206   /* set a breakpoint            */
-#define GREMOVEBREAK    0x207   /* remove a breakpoint         */
-#define GHALT           0x208   /* ??? */
-#define GCHECKSTATUS    0x209   /* check status of ICE         */
-#define GMDIREPLY       0x210   /* Reply for previous query - NOT USED */
-#define GDOWNLOAD       0x211   /* something for MDI           */
-#define GCOMMAND        0x212   /* execute command in ice      */
-#define GLOADFILENAME   0x213   /* retrieve load filename      */
-#define GWRITEMEM       0x214   /* write word, half-word, or byte */
+#define GSINGLESTEP     0x200  /* single-step target          */
+#define GRESUME         0x201  /* resume target               */
+#define GREADREG        0x202  /* read a register             */
+#define GWRITEREG       0x203  /* write a register            */
+#define GWRITEBLOCK     0x204  /* write a block of memory     */
+#define GREADBLOCK      0x205  /* read a block of memory      */
+#define GSETBREAK       0x206  /* set a breakpoint            */
+#define GREMOVEBREAK    0x207  /* remove a breakpoint         */
+#define GHALT           0x208  /* ??? */
+#define GCHECKSTATUS    0x209  /* check status of ICE         */
+#define GMDIREPLY       0x210  /* Reply for previous query - NOT USED */
+#define GDOWNLOAD       0x211  /* something for MDI           */
+#define GCOMMAND        0x212  /* execute command in ice      */
+#define GLOADFILENAME   0x213  /* retrieve load filename      */
+#define GWRITEMEM       0x214  /* write word, half-word, or byte */
 
 /* GCHECKSTATUS return codes: */
 #define ICE_Idle        0x00
-#define ICE_Breakpoint  0x01    /* hit a breakpoint */
-#define ICE_Stepped     0x02    /* have stepped     */
-#define ICE_Exception   0x03    /* have exception   */
-#define ICE_Halted      0x04    /* hit a user halt  */
-#define ICE_Exited      0x05    /* called exit      */
-#define ICE_Terminated  0x06    /* user terminated  */
+#define ICE_Breakpoint  0x01   /* hit a breakpoint */
+#define ICE_Stepped     0x02   /* have stepped     */
+#define ICE_Exception   0x03   /* have exception   */
+#define ICE_Halted      0x04   /* hit a user halt  */
+#define ICE_Exited      0x05   /* called exit      */
+#define ICE_Terminated  0x06   /* user terminated  */
 #define ICE_Running     0x07
 #define ICE_Unknown     0x99
 
@@ -176,13 +177,13 @@ static int SimulateCallback;    /* simulate a callback event */
 #define WM_SOURCE       WM_USER+105
 
 /* STATE_CHANGE codes */
-#define STATE_CHANGE_REGS   1   /* Register(s) changed */
-#define STATE_CHANGE_LOAD   2   /* HW reset            */
-#define STATE_CHANGE_RESET  3   /* Load new file       */
-#define STATE_CHANGE_CONT   4   /* Run target          */
-#define STATE_CHANGE_STOP   5   /* Stop target         */
-#define STATE_CHANGE_STEPI  6   /* Stepi target        */
-#define STATE_CHANGE_NEXTI  7   /* Nexti target        */
+#define STATE_CHANGE_REGS   1  /* Register(s) changed */
+#define STATE_CHANGE_LOAD   2  /* HW reset            */
+#define STATE_CHANGE_RESET  3  /* Load new file       */
+#define STATE_CHANGE_CONT   4  /* Run target          */
+#define STATE_CHANGE_STOP   5  /* Stop target         */
+#define STATE_CHANGE_STEPI  6  /* Stepi target        */
+#define STATE_CHANGE_NEXTI  7  /* Nexti target        */
 
 static struct target_ops v850ice_ops;  /* Forward decl */
 
@@ -206,12 +207,12 @@ init_hidden_window ()
   class.hIcon = NULL;
   class.hCursor = NULL;
 
-  if (! RegisterClass (&class))
+  if (!RegisterClass (&class))
     return 0;
 
   hidden_hwnd = CreateWindow ("gdb_v850ice", "gdb_v850ice", WS_TILED,
-                              0, 0, 0, 0, NULL, NULL, class.hInstance,
-                              NULL);
+                             0, 0, 0, 0, NULL, NULL, class.hInstance,
+                             NULL);
   if (hidden_hwnd == NULL)
     {
       char buf[200];
@@ -219,7 +220,7 @@ init_hidden_window ()
 
       err = GetLastError ();
       FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
-                     0, buf, 200, NULL);
+                    0, buf, 200, NULL);
       printf_unfiltered ("Could not create window: %s", buf);
       return 0;
     }
@@ -236,7 +237,7 @@ init_hidden_window ()
    WM_ADDR_TO_SYM   | Not implemented at NEC's request
    WM_DISASSEMBLY  /
    WM_STATE_CHANGE - tells us that a state change has occured in the ICE
-*/
+ */
 static LRESULT CALLBACK
 v850ice_wndproc (hwnd, message, wParam, lParam)
      HWND hwnd;
@@ -258,50 +259,50 @@ v850ice_wndproc (hwnd, message, wParam, lParam)
       break;
     case WM_STATE_CHANGE:
       switch (wParam)
-        {
-        case STATE_CHANGE_LOAD:
-          {
-            struct MessageIO iob;
-            char buf[128];
-
-            iob.buf  = buf;
-            iob.size = 128;
-
-            /* Load in a new file... Need filename */
-            ExeAppReq ("GDB", GLOADFILENAME, NULL, &iob);
-            if (!catch_errors ((catch_errors_ftype *) ice_file, iob.buf, "", RETURN_MASK_ALL))
-              printf_unfiltered ("load errored\n");
-          }
-          break;
-        case STATE_CHANGE_RESET:
-          registers_changed ();
-          flush_cached_frames ();
-          togdb_force_update ();
-          result = TRUE;
-          break;
-        case STATE_CHANGE_REGS:
-          registers_changed ();
-          togdb_force_update ();
-          result = TRUE;
-          break;
-        case STATE_CHANGE_CONT:
-          if (!catch_errors ((catch_errors_ftype *)ice_cont, NULL, "", RETURN_MASK_ALL))
-            printf_unfiltered ("continue errored\n");
-          result = TRUE;
-          break;
-        case STATE_CHANGE_STEPI:
-          if (!catch_errors ((catch_errors_ftype *)ice_stepi, (PTR)(int) lParam, "",
-                             RETURN_MASK_ALL))
-            printf_unfiltered ("stepi errored\n");
-          result = TRUE;
-          break;
-        case STATE_CHANGE_NEXTI:
-          if (!catch_errors ((catch_errors_ftype *)ice_nexti, (PTR)(int) lParam, "",
-                             RETURN_MASK_ALL))
-            printf_unfiltered ("nexti errored\n");
-          result = TRUE;
-          break;
-        }
+       {
+       case STATE_CHANGE_LOAD:
+         {
+           struct MessageIO iob;
+           char buf[128];
+
+           iob.buf = buf;
+           iob.size = 128;
+
+           /* Load in a new file... Need filename */
+           ExeAppReq ("GDB", GLOADFILENAME, NULL, &iob);
+           if (!catch_errors ((catch_errors_ftype *) ice_file, iob.buf, "", RETURN_MASK_ALL))
+             printf_unfiltered ("load errored\n");
+         }
+         break;
+       case STATE_CHANGE_RESET:
+         registers_changed ();
+         flush_cached_frames ();
+         togdb_force_update ();
+         result = TRUE;
+         break;
+       case STATE_CHANGE_REGS:
+         registers_changed ();
+         togdb_force_update ();
+         result = TRUE;
+         break;
+       case STATE_CHANGE_CONT:
+         if (!catch_errors ((catch_errors_ftype *) ice_cont, NULL, "", RETURN_MASK_ALL))
+           printf_unfiltered ("continue errored\n");
+         result = TRUE;
+         break;
+       case STATE_CHANGE_STEPI:
+         if (!catch_errors ((catch_errors_ftype *) ice_stepi, (PTR) (int) lParam, "",
+                            RETURN_MASK_ALL))
+           printf_unfiltered ("stepi errored\n");
+         result = TRUE;
+         break;
+       case STATE_CHANGE_NEXTI:
+         if (!catch_errors ((catch_errors_ftype *) ice_nexti, (PTR) (int) lParam, "",
+                            RETURN_MASK_ALL))
+           printf_unfiltered ("nexti errored\n");
+         result = TRUE;
+         break;
+       }
     }
 
   if (result == FALSE)
@@ -339,20 +340,20 @@ v850ice_open (name, from_tty)
     {
       handle = LoadLibrary ("necmsg.dll");
       if (handle == NULL)
-        error ("Cannot load necmsg.dll");
+       error ("Cannot load necmsg.dll");
 
-      ExeAppReq = (long (*) PARAMS ((char *, long, char *, struct MessageIO *)))
-        GetProcAddress (handle, "ExeAppReq");
-      RegisterClient = (long (*) PARAMS ((HWND)))
-        GetProcAddress (handle, "RegisterClient");
-      UnregisterClient = (long (*) PARAMS ((void)))
-        GetProcAddress (handle, "UnregisterClient");
+      ExeAppReq = (long (*)PARAMS ((char *, long, char *, struct MessageIO *)))
+       GetProcAddress (handle, "ExeAppReq");
+      RegisterClient = (long (*)PARAMS ((HWND)))
+       GetProcAddress (handle, "RegisterClient");
+      UnregisterClient = (long (*)PARAMS ((void)))
+       GetProcAddress (handle, "UnregisterClient");
 
       if (ExeAppReq == NULL || RegisterClient == NULL || UnregisterClient == NULL)
-        error ("Could not find requisite functions in necmsg.dll.");
+       error ("Could not find requisite functions in necmsg.dll.");
 
       if (!init_hidden_window ())
-        error ("could not initialize message handling");
+       error ("could not initialize message handling");
     }
 
   /* Tell the DLL we are here */
@@ -415,12 +416,12 @@ v850ice_resume (pid, step, siggnal)
      int pid, step;
      enum target_signal siggnal;
 {
-  long              retval;
-  char              buf[256];
-  struct MessageIO  iob;
+  long retval;
+  char buf[256];
+  struct MessageIO iob;
 
   iob.size = 0;
-  iob.buf  = buf;
+  iob.buf = buf;
 
   if (step)
     retval = ExeAppReq ("GDB", GSINGLESTEP, "step", &iob);
@@ -443,54 +444,54 @@ v850ice_wait (pid, status)
 {
   long v850_status;
   char buf[256];
-  struct MessageIO  iob;
+  struct MessageIO iob;
   int done = 0;
   int count = 0;
 
   iob.size = 0;
-  iob.buf  = buf;
-  
+  iob.buf = buf;
+
   do
     {
       if (count++ % 100000)
-        {
-          ui_loop_hook (0);
+       {
+         ui_loop_hook (0);
          count = 0;
-        }
+       }
 
       v850_status = ExeAppReq ("GDB", GCHECKSTATUS, NULL, &iob);
 
       switch (v850_status)
-        {
-        case ICE_Idle:
-        case ICE_Breakpoint:
-        case ICE_Stepped:
-        case ICE_Halted:
-          status->kind = TARGET_WAITKIND_STOPPED;
-          status->value.sig = TARGET_SIGNAL_TRAP;
-          done = 1;
-          break;
-        case ICE_Exception:
-          status->kind = TARGET_WAITKIND_SIGNALLED;
-          status->value.sig = TARGET_SIGNAL_SEGV;
-          done = 1;
-          break;
-        case ICE_Exited:
-          status->kind = TARGET_WAITKIND_EXITED;
-          status->value.integer = 0;
-          done = 1;
-          break;
-        case ICE_Terminated:
-          status->kind = TARGET_WAITKIND_SIGNALLED;
-          status->value.sig = TARGET_SIGNAL_KILL;
-          done = 1;
-          break;
-        default:
-          break;
-        }
+       {
+       case ICE_Idle:
+       case ICE_Breakpoint:
+       case ICE_Stepped:
+       case ICE_Halted:
+         status->kind = TARGET_WAITKIND_STOPPED;
+         status->value.sig = TARGET_SIGNAL_TRAP;
+         done = 1;
+         break;
+       case ICE_Exception:
+         status->kind = TARGET_WAITKIND_SIGNALLED;
+         status->value.sig = TARGET_SIGNAL_SEGV;
+         done = 1;
+         break;
+       case ICE_Exited:
+         status->kind = TARGET_WAITKIND_EXITED;
+         status->value.integer = 0;
+         done = 1;
+         break;
+       case ICE_Terminated:
+         status->kind = TARGET_WAITKIND_SIGNALLED;
+         status->value.sig = TARGET_SIGNAL_KILL;
+         done = 1;
+         break;
+       default:
+         break;
+       }
     }
   while (!done);
-      
+
   return inferior_pid;
 }
 
@@ -529,7 +530,7 @@ v850ice_fetch_registers (regno)
   if (regno == -1)
     {
       for (regno = 0; regno < NUM_REGS; regno++)
-        v850ice_fetch_registers (regno);
+       v850ice_fetch_registers (regno);
       return;
     }
 
@@ -546,7 +547,7 @@ v850ice_fetch_registers (regno)
   regval = strtoul (val, NULL, 16);
   if (regval == 0 && p == val)
     error ("v850ice_fetch_registers (%d):  bad value from ICE: %s.",
-           regno, val);
+          regno, val);
 
   store_unsigned_integer (val, REGISTER_RAW_SIZE (regno), regval);
   supply_register (regno, val);
@@ -575,7 +576,7 @@ v850ice_store_registers (regno)
     }
 
   regval = extract_unsigned_integer (&registers[REGISTER_BYTE (regno)],
-                                     REGISTER_RAW_SIZE (regno));
+                                    REGISTER_RAW_SIZE (regno));
   strcpy (cmd, "reg ");
   if (!convert_register (regno, &cmd[4]))
     return;
@@ -589,7 +590,7 @@ v850ice_store_registers (regno)
 /* Prepare to store registers.  Nothing to do here, since the ICE can write one
    register at a time.  */
 
-static void 
+static void
 v850ice_prepare_to_store ()
 {
 }
@@ -607,7 +608,7 @@ v850ice_xfer_memory (memaddr, myaddr, len, should_write, target)
      char *myaddr;
      int len;
      int should_write;
-     struct target_ops *target;                        /* ignored */
+     struct target_ops *target;        /* ignored */
 {
   long retval;
   char cmd[100];
@@ -617,102 +618,102 @@ v850ice_xfer_memory (memaddr, myaddr, len, should_write, target)
   if (should_write)
     {
       if (len == 4 || len == 2 || len == 1)
-        {
-          long value = 0;
-          char buf[256];
-          char c;
-
-          iob.size = 0;
-          iob.buf  = buf;
-
-          sent = 0;
-          switch (len)
-            {
-            case 4:
-              c = 'w';
-              value |= (long) ((myaddr[3] << 24) & 0xff000000);
-              value |= (long) ((myaddr[2] << 16) & 0x00ff0000);
-              value |= (long) ((myaddr[1] << 8)  & 0x0000ff00);
-              value |= (long) (myaddr[0] & 0x000000ff);
+       {
+         long value = 0;
+         char buf[256];
+         char c;
+
+         iob.size = 0;
+         iob.buf = buf;
+
+         sent = 0;
+         switch (len)
+           {
+           case 4:
+             c = 'w';
+             value |= (long) ((myaddr[3] << 24) & 0xff000000);
+             value |= (long) ((myaddr[2] << 16) & 0x00ff0000);
+             value |= (long) ((myaddr[1] << 8) & 0x0000ff00);
+             value |= (long) (myaddr[0] & 0x000000ff);
+             break;
+           case 2:
+             c = 'h';
+             value |= (long) ((myaddr[1] << 8) & 0xff00);
+             value |= (long) (myaddr[0] & 0x00ff);
              break;
-            case 2:
-              c = 'h';
-              value |= (long) ((myaddr[1] << 8) & 0xff00);
-              value |= (long) (myaddr[0] & 0x00ff);
-              break;
-            case 1:
-              c = 'b';
-              value |= (long) (myaddr[0] & 0xff);
-              break;
-            }
-
-          sprintf (cmd, "memory %c c 0x%x=0x%x", c, (int) memaddr, value);
-          retval = ExeAppReq ("GDB", GWRITEMEM, cmd, &iob);
-          if (retval == 0)
-            sent = len;
-        }
-      else 
-        {
-          sent = 0;
-          do 
-            {
-              iob.size  = len > MAX_BLOCK_SIZE ? MAX_BLOCK_SIZE : len;
-              iob.buf   = myaddr;
-              sprintf (cmd, "memory b c 0x%x=0x00 l=%d", (int) memaddr, iob.size);
-              retval = ExeAppReq ("GDB", GWRITEBLOCK, cmd, &iob);
-              if (retval != 0)
-                break;
-              len      -= iob.size;
-              memaddr  += iob.size;
-              myaddr   += iob.size;
-              sent     += iob.size;
-            }
-          while (len > 0);
-        }
+           case 1:
+             c = 'b';
+             value |= (long) (myaddr[0] & 0xff);
+             break;
+           }
+
+         sprintf (cmd, "memory %c c 0x%x=0x%x", c, (int) memaddr, value);
+         retval = ExeAppReq ("GDB", GWRITEMEM, cmd, &iob);
+         if (retval == 0)
+           sent = len;
+       }
+      else
+       {
+         sent = 0;
+         do
+           {
+             iob.size = len > MAX_BLOCK_SIZE ? MAX_BLOCK_SIZE : len;
+             iob.buf = myaddr;
+             sprintf (cmd, "memory b c 0x%x=0x00 l=%d", (int) memaddr, iob.size);
+             retval = ExeAppReq ("GDB", GWRITEBLOCK, cmd, &iob);
+             if (retval != 0)
+               break;
+             len -= iob.size;
+             memaddr += iob.size;
+             myaddr += iob.size;
+             sent += iob.size;
+           }
+         while (len > 0);
+       }
     }
   else
     {
       unsigned char *tmp;
       unsigned char *t;
       int i;
-      
+
       tmp = alloca (len + 100);
       t = tmp;
       memset (tmp + len, 0xff, 100);
 
       sent = 0;
       do
-        {
-          iob.size = len > MAX_BLOCK_SIZE ? MAX_BLOCK_SIZE : len;
-          iob.buf  = tmp;
-          sprintf (cmd, "memory b 0x%x l=%d", (int)memaddr, iob.size);
-          retval = ExeAppReq ("GDB", GREADBLOCK, cmd, &iob);
-          if (retval != 0)
-            break;
-          len     -= iob.size;
-          memaddr += iob.size;
-          sent    += iob.size;
-          tmp     += iob.size;
-        }
+       {
+         iob.size = len > MAX_BLOCK_SIZE ? MAX_BLOCK_SIZE : len;
+         iob.buf = tmp;
+         sprintf (cmd, "memory b 0x%x l=%d", (int) memaddr, iob.size);
+         retval = ExeAppReq ("GDB", GREADBLOCK, cmd, &iob);
+         if (retval != 0)
+           break;
+         len -= iob.size;
+         memaddr += iob.size;
+         sent += iob.size;
+         tmp += iob.size;
+       }
       while (len > 0);
 
       if (retval == 0)
-        {
-          for (i = 0; i <  100; i++)
-            {
-              if (t[sent + i] != 0xff)
-                {
-                  warning ("GREADBLOCK trashed bytes after transfer area.");
-                  break;
-                }
-            }
-          memcpy (myaddr, t, sent);
-        }
+       {
+         for (i = 0; i < 100; i++)
+           {
+             if (t[sent + i] != 0xff)
+               {
+                 warning ("GREADBLOCK trashed bytes after transfer area.");
+                 break;
+               }
+           }
+         memcpy (myaddr, t, sent);
+       }
     }
+
   if (retval != 0)
     error ("3: ExeAppReq returned %d: cmd = %s", retval, cmd);
-  
+
   return sent;
 }
 
@@ -734,7 +735,7 @@ v850ice_insert_breakpoint (addr, contents_cache)
   struct MessageIO iob;
 
   iob.size = 0;
-  iob.buf  = buf;
+  iob.buf = buf;
   sprintf (cmd, "%d, ", addr);
 
   retval = ExeAppReq ("GDB", GSETBREAK, cmd, &iob);
@@ -755,7 +756,7 @@ v850ice_remove_breakpoint (addr, contents_cache)
   struct MessageIO iob;
 
   iob.size = 0;
-  iob.buf  = buf;
+  iob.buf = buf;
 
   sprintf (cmd, "%d, ", addr);
 
@@ -780,15 +781,15 @@ v850ice_mourn ()
 
 static void
 v850ice_load (filename, from_tty)
-  char * filename; 
-  int from_tty;
+     char *filename;
+     int from_tty;
 {
   struct MessageIO iob;
   char buf[256];
 
   iob.size = 0;
-  iob.buf  = buf;
-  generic_load(filename, from_tty);
+  iob.buf = buf;
+  generic_load (filename, from_tty);
   ExeAppReq ("GDB", GDOWNLOAD, filename, &iob);
 }
 
@@ -797,7 +798,7 @@ ice_file (arg)
      char *arg;
 {
   char *s;
-  
+
   target_detach (NULL, 0);
   pop_target ();
 
@@ -807,12 +808,12 @@ ice_file (arg)
   while (*s != '\0')
     {
       if (*s == '\\')
-        *s = '/';
+       *s = '/';
       s++;
     }
 
   /* Safegaurd against confusing the breakpoint routines... */
-  delete_command(NULL, 0);
+  delete_command (NULL, 0);
 
   /* Must supress from_tty, otherwise we could start asking if the
      user really wants to load a new symbol table, etc... */
@@ -831,7 +832,7 @@ ice_file (arg)
 
 static int
 ice_cont (c)
-  char *c;
+     char *c;
 {
   printf_filtered ("continue (ice)\n");
   ReplyMessage ((LRESULT) 1);
@@ -861,7 +862,7 @@ do_gdb (cmd, str, func, count)
 
 static int
 ice_stepi (c)
-  char *c;
+     char *c;
 {
   int count = (int) c;
 
@@ -871,7 +872,7 @@ ice_stepi (c)
 
 static int
 ice_nexti (c)
-  char *c;
+     char *c;
 {
   int count = (int) c;
 
@@ -881,8 +882,8 @@ ice_nexti (c)
 
 static void
 v850ice_command (arg, from_tty)
-  char *arg;
-  int   from_tty;
+     char *arg;
+     int from_tty;
 {
   struct MessageIO iob;
   char buf[256];
@@ -900,55 +901,55 @@ togdb_force_update (void)
 
 /* Define the target subroutine names */
 
-static void 
-init_850ice_ops(void)
+static void
+init_850ice_ops (void)
 {
-  v850ice_ops.to_shortname   =   "ice";                
-  v850ice_ops.to_longname    =   "NEC V850 ICE interface";
-  v850ice_ops.to_doc         =   "Debug a system controlled by a NEC 850 ICE.";
-  v850ice_ops.to_open        =   v850ice_open;         
-  v850ice_ops.to_close       =   v850ice_close;        
-  v850ice_ops.to_attach      =   NULL;
-  v850ice_ops.to_post_attach =   NULL;
-  v850ice_ops.to_require_attach = NULL;                
-  v850ice_ops.to_detach      =   v850ice_detach;
-  v850ice_ops.to_require_detach = NULL;        
-  v850ice_ops.to_resume      =   v850ice_resume;       
-  v850ice_ops.to_wait        =   v850ice_wait;
-  v850ice_ops.to_post_wait = NULL;     
-  v850ice_ops.to_fetch_registers  =   v850ice_fetch_registers;
-  v850ice_ops.to_store_registers  =   v850ice_store_registers;
-  v850ice_ops.to_prepare_to_store =   v850ice_prepare_to_store;
-  v850ice_ops.to_xfer_memory =   v850ice_xfer_memory;  
-  v850ice_ops.to_files_info  =   v850ice_files_info;   
-  v850ice_ops.to_insert_breakpoint =   v850ice_insert_breakpoint;
-  v850ice_ops.to_remove_breakpoint =   v850ice_remove_breakpoint;
-  v850ice_ops.to_terminal_init    =   NULL;            
-  v850ice_ops.to_terminal_inferior =   NULL;           
-  v850ice_ops.to_terminal_ours_for_output =   NULL;    
-  v850ice_ops.to_terminal_ours   =   NULL;             
-  v850ice_ops.to_terminal_info   =   NULL;             
-  v850ice_ops.to_kill            =   v850ice_kill;             
-  v850ice_ops.to_load            =   v850ice_load;             
-  v850ice_ops.to_lookup_symbol   =   NULL;             
-  v850ice_ops.to_create_inferior =   NULL;
-  v850ice_ops.to_mourn_inferior  =   v850ice_mourn;
-  v850ice_ops.to_can_run         =   0;                
-  v850ice_ops.to_notice_signals  =   0;                
-  v850ice_ops.to_thread_alive    =    NULL;    
-  v850ice_ops.to_stop            =   v850ice_stop;
+  v850ice_ops.to_shortname = "ice";
+  v850ice_ops.to_longname = "NEC V850 ICE interface";
+  v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
+  v850ice_ops.to_open = v850ice_open;
+  v850ice_ops.to_close = v850ice_close;
+  v850ice_ops.to_attach = NULL;
+  v850ice_ops.to_post_attach = NULL;
+  v850ice_ops.to_require_attach = NULL;
+  v850ice_ops.to_detach = v850ice_detach;
+  v850ice_ops.to_require_detach = NULL;
+  v850ice_ops.to_resume = v850ice_resume;
+  v850ice_ops.to_wait = v850ice_wait;
+  v850ice_ops.to_post_wait = NULL;
+  v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
+  v850ice_ops.to_store_registers = v850ice_store_registers;
+  v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
+  v850ice_ops.to_xfer_memory = v850ice_xfer_memory;
+  v850ice_ops.to_files_info = v850ice_files_info;
+  v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
+  v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
+  v850ice_ops.to_terminal_init = NULL;
+  v850ice_ops.to_terminal_inferior = NULL;
+  v850ice_ops.to_terminal_ours_for_output = NULL;
+  v850ice_ops.to_terminal_ours = NULL;
+  v850ice_ops.to_terminal_info = NULL;
+  v850ice_ops.to_kill = v850ice_kill;
+  v850ice_ops.to_load = v850ice_load;
+  v850ice_ops.to_lookup_symbol = NULL;
+  v850ice_ops.to_create_inferior = NULL;
+  v850ice_ops.to_mourn_inferior = v850ice_mourn;
+  v850ice_ops.to_can_run = 0;
+  v850ice_ops.to_notice_signals = 0;
+  v850ice_ops.to_thread_alive = NULL;
+  v850ice_ops.to_stop = v850ice_stop;
   v850ice_ops.to_pid_to_exec_file = NULL;
-  v850ice_ops.to_core_file_to_sym_file = NULL;                 
-  v850ice_ops.to_stratum         =   process_stratum;  
-  v850ice_ops.DONT_USE           =   NULL;             
-  v850ice_ops.to_has_all_memory  =   1;                
-  v850ice_ops.to_has_memory      =   1;                
-  v850ice_ops.to_has_stack       =   1;                
-  v850ice_ops.to_has_registers   =   1;                
-  v850ice_ops.to_has_execution   =   1;                
-  v850ice_ops.to_sections        =   NULL;             
-  v850ice_ops.to_sections_end    =   NULL;             
-  v850ice_ops.to_magic           =   OPS_MAGIC ;
+  v850ice_ops.to_core_file_to_sym_file = NULL;
+  v850ice_ops.to_stratum = process_stratum;
+  v850ice_ops.DONT_USE = NULL;
+  v850ice_ops.to_has_all_memory = 1;
+  v850ice_ops.to_has_memory = 1;
+  v850ice_ops.to_has_stack = 1;
+  v850ice_ops.to_has_registers = 1;
+  v850ice_ops.to_has_execution = 1;
+  v850ice_ops.to_sections = NULL;
+  v850ice_ops.to_sections_end = NULL;
+  v850ice_ops.to_magic = OPS_MAGIC;
 }
 
 void
@@ -958,5 +959,5 @@ _initialize_v850ice ()
   add_target (&v850ice_ops);
 
   add_com ("ice", class_obscure, v850ice_command,
-           "Send command to ICE");
+          "Send command to ICE");
 }
index 0a3aa4d8e360f0308ed2d92118dfcddecfc9a94f..170071624cc657c2f648f6292203a945a06efce9 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "value.h"
@@ -38,8 +39,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 static value_ptr value_subscripted_rvalue PARAMS ((value_ptr, value_ptr, int));
 
 void _initialize_valarith PARAMS ((void));
-
 \f
+
 value_ptr
 value_add (arg1, arg2)
      value_ptr arg1, arg2;
@@ -109,12 +110,12 @@ value_sub (arg1, arg2)
        }
       else if (TYPE_CODE (type2) == TYPE_CODE_PTR
               && TYPE_LENGTH (TYPE_TARGET_TYPE (type1))
-                 == TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
+              == TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
        {
          /* pointer to <type x> - pointer to <type x>.  */
          LONGEST sz = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1)));
          return value_from_longest
-           (builtin_type_long,         /* FIXME -- should be ptrdiff_t */
+           (builtin_type_long, /* FIXME -- should be ptrdiff_t */
             (value_as_long (arg1) - value_as_long (arg2)) / sz);
        }
       else
@@ -187,7 +188,7 @@ value_subscript (array, idx)
        error ("bitstring index out of range");
       index -= lowerbound;
       offset = index / TARGET_CHAR_BIT;
-      byte = *((char*)VALUE_CONTENTS (array) + offset);
+      byte = *((char *) VALUE_CONTENTS (array) + offset);
       bit_index = index % TARGET_CHAR_BIT;
       byte >>= (BITS_BIG_ENDIAN ? TARGET_CHAR_BIT - 1 - bit_index : bit_index);
       v = value_from_longest (LA_BOOL_TYPE, byte & 1);
@@ -271,7 +272,8 @@ binop_user_defined_p (op, arg1, arg2)
 
    For now, we do not overload the `&' operator.  */
 
-int unop_user_defined_p (op, arg1)
+int
+unop_user_defined_p (op, arg1)
      enum exp_opcode op;
      value_ptr arg1;
 {
@@ -305,7 +307,7 @@ value_x_binop (arg1, arg2, op, otherop, noside)
      enum exp_opcode op, otherop;
      enum noside noside;
 {
-  value_ptr * argvec;
+  value_ptr *argvec;
   char *ptr;
   char tstr[13];
   int static_memfuncp;
@@ -319,63 +321,123 @@ value_x_binop (arg1, arg2, op, otherop, noside)
      arg vector and find the right function to call it with.  */
 
   if (TYPE_CODE (check_typedef (VALUE_TYPE (arg1))) != TYPE_CODE_STRUCT)
-    error ("Can't do that binary op on that type");  /* FIXME be explicit */
+    error ("Can't do that binary op on that type");    /* FIXME be explicit */
 
   argvec = (value_ptr *) alloca (sizeof (value_ptr) * 4);
   argvec[1] = value_addr (arg1);
   argvec[2] = arg2;
   argvec[3] = 0;
 
-  /* make the right function name up */  
-  strcpy(tstr, "operator__");
-  ptr = tstr+8;
+  /* make the right function name up */
+  strcpy (tstr, "operator__");
+  ptr = tstr + 8;
   switch (op)
     {
-    case BINOP_ADD:            strcpy(ptr,"+"); break;
-    case BINOP_SUB:            strcpy(ptr,"-"); break;
-    case BINOP_MUL:            strcpy(ptr,"*"); break;
-    case BINOP_DIV:            strcpy(ptr,"/"); break;
-    case BINOP_REM:            strcpy(ptr,"%"); break;
-    case BINOP_LSH:            strcpy(ptr,"<<"); break;
-    case BINOP_RSH:            strcpy(ptr,">>"); break;
-    case BINOP_BITWISE_AND:    strcpy(ptr,"&"); break;
-    case BINOP_BITWISE_IOR:    strcpy(ptr,"|"); break;
-    case BINOP_BITWISE_XOR:    strcpy(ptr,"^"); break;
-    case BINOP_LOGICAL_AND:    strcpy(ptr,"&&"); break;
-    case BINOP_LOGICAL_OR:     strcpy(ptr,"||"); break;
-    case BINOP_MIN:            strcpy(ptr,"<?"); break;
-    case BINOP_MAX:            strcpy(ptr,">?"); break;
-    case BINOP_ASSIGN:         strcpy(ptr,"="); break;
-    case BINOP_ASSIGN_MODIFY:  
+    case BINOP_ADD:
+      strcpy (ptr, "+");
+      break;
+    case BINOP_SUB:
+      strcpy (ptr, "-");
+      break;
+    case BINOP_MUL:
+      strcpy (ptr, "*");
+      break;
+    case BINOP_DIV:
+      strcpy (ptr, "/");
+      break;
+    case BINOP_REM:
+      strcpy (ptr, "%");
+      break;
+    case BINOP_LSH:
+      strcpy (ptr, "<<");
+      break;
+    case BINOP_RSH:
+      strcpy (ptr, ">>");
+      break;
+    case BINOP_BITWISE_AND:
+      strcpy (ptr, "&");
+      break;
+    case BINOP_BITWISE_IOR:
+      strcpy (ptr, "|");
+      break;
+    case BINOP_BITWISE_XOR:
+      strcpy (ptr, "^");
+      break;
+    case BINOP_LOGICAL_AND:
+      strcpy (ptr, "&&");
+      break;
+    case BINOP_LOGICAL_OR:
+      strcpy (ptr, "||");
+      break;
+    case BINOP_MIN:
+      strcpy (ptr, "<?");
+      break;
+    case BINOP_MAX:
+      strcpy (ptr, ">?");
+      break;
+    case BINOP_ASSIGN:
+      strcpy (ptr, "=");
+      break;
+    case BINOP_ASSIGN_MODIFY:
       switch (otherop)
        {
-       case BINOP_ADD:         strcpy(ptr,"+="); break;
-       case BINOP_SUB:         strcpy(ptr,"-="); break;
-       case BINOP_MUL:         strcpy(ptr,"*="); break;
-       case BINOP_DIV:         strcpy(ptr,"/="); break;
-       case BINOP_REM:         strcpy(ptr,"%="); break;
-       case BINOP_BITWISE_AND: strcpy(ptr,"&="); break;
-       case BINOP_BITWISE_IOR: strcpy(ptr,"|="); break;
-       case BINOP_BITWISE_XOR: strcpy(ptr,"^="); break;
-       case BINOP_MOD:         /* invalid */
+       case BINOP_ADD:
+         strcpy (ptr, "+=");
+         break;
+       case BINOP_SUB:
+         strcpy (ptr, "-=");
+         break;
+       case BINOP_MUL:
+         strcpy (ptr, "*=");
+         break;
+       case BINOP_DIV:
+         strcpy (ptr, "/=");
+         break;
+       case BINOP_REM:
+         strcpy (ptr, "%=");
+         break;
+       case BINOP_BITWISE_AND:
+         strcpy (ptr, "&=");
+         break;
+       case BINOP_BITWISE_IOR:
+         strcpy (ptr, "|=");
+         break;
+       case BINOP_BITWISE_XOR:
+         strcpy (ptr, "^=");
+         break;
+       case BINOP_MOD: /* invalid */
        default:
          error ("Invalid binary operation specified.");
        }
       break;
-    case BINOP_SUBSCRIPT: strcpy(ptr,"[]"); break;
-    case BINOP_EQUAL:    strcpy(ptr,"=="); break;
-    case BINOP_NOTEQUAL:  strcpy(ptr,"!="); break;
-    case BINOP_LESS:      strcpy(ptr,"<"); break;
-    case BINOP_GTR:       strcpy(ptr,">"); break;
-    case BINOP_GEQ:       strcpy(ptr,">="); break;
-    case BINOP_LEQ:       strcpy(ptr,"<="); break;
-    case BINOP_MOD:      /* invalid */
+    case BINOP_SUBSCRIPT:
+      strcpy (ptr, "[]");
+      break;
+    case BINOP_EQUAL:
+      strcpy (ptr, "==");
+      break;
+    case BINOP_NOTEQUAL:
+      strcpy (ptr, "!=");
+      break;
+    case BINOP_LESS:
+      strcpy (ptr, "<");
+      break;
+    case BINOP_GTR:
+      strcpy (ptr, ">");
+      break;
+    case BINOP_GEQ:
+      strcpy (ptr, ">=");
+      break;
+    case BINOP_LEQ:
+      strcpy (ptr, "<=");
+      break;
+    case BINOP_MOD:            /* invalid */
     default:
       error ("Invalid binary operation specified.");
     }
 
-  argvec[0] = value_struct_elt (&arg1, argvec+1, tstr, &static_memfuncp, "structure");
-  
+  argvec[0] = value_struct_elt (&arg1, argvec + 1, tstr, &static_memfuncp, "structure");
+
   if (argvec[0])
     {
       if (static_memfuncp)
@@ -410,7 +472,7 @@ value_x_unop (arg1, op, noside)
      enum exp_opcode op;
      enum noside noside;
 {
-  value_ptr * argvec;
+  value_ptr *argvec;
   char *ptr, *mangle_ptr;
   char tstr[13], mangle_tstr[13];
   int static_memfuncp;
@@ -422,32 +484,48 @@ value_x_unop (arg1, op, noside)
      arg vector and find the right function to call it with.  */
 
   if (TYPE_CODE (check_typedef (VALUE_TYPE (arg1))) != TYPE_CODE_STRUCT)
-    error ("Can't do that unary op on that type");  /* FIXME be explicit */
+    error ("Can't do that unary op on that type");     /* FIXME be explicit */
 
   argvec = (value_ptr *) alloca (sizeof (value_ptr) * 3);
   argvec[1] = value_addr (arg1);
   argvec[2] = 0;
 
-  /* make the right function name up */  
-  strcpy(tstr,"operator__");
-  ptr = tstr+8;
-  strcpy(mangle_tstr, "__");
-  mangle_ptr = mangle_tstr+2;
+  /* make the right function name up */
+  strcpy (tstr, "operator__");
+  ptr = tstr + 8;
+  strcpy (mangle_tstr, "__");
+  mangle_ptr = mangle_tstr + 2;
   switch (op)
     {
-    case UNOP_PREINCREMENT:    strcpy(ptr,"++"); break;
-    case UNOP_PREDECREMENT:    strcpy(ptr,"++"); break;
-    case UNOP_POSTINCREMENT:   strcpy(ptr,"++"); break;
-    case UNOP_POSTDECREMENT:   strcpy(ptr,"++"); break;
-    case UNOP_LOGICAL_NOT:     strcpy(ptr,"!"); break;
-    case UNOP_COMPLEMENT:      strcpy(ptr,"~"); break;
-    case UNOP_NEG:             strcpy(ptr,"-"); break;
-    case UNOP_IND:             strcpy(ptr,"*"); break;
+    case UNOP_PREINCREMENT:
+      strcpy (ptr, "++");
+      break;
+    case UNOP_PREDECREMENT:
+      strcpy (ptr, "++");
+      break;
+    case UNOP_POSTINCREMENT:
+      strcpy (ptr, "++");
+      break;
+    case UNOP_POSTDECREMENT:
+      strcpy (ptr, "++");
+      break;
+    case UNOP_LOGICAL_NOT:
+      strcpy (ptr, "!");
+      break;
+    case UNOP_COMPLEMENT:
+      strcpy (ptr, "~");
+      break;
+    case UNOP_NEG:
+      strcpy (ptr, "-");
+      break;
+    case UNOP_IND:
+      strcpy (ptr, "*");
+      break;
     default:
       error ("Invalid unary operation specified.");
     }
 
-  argvec[0] = value_struct_elt (&arg1, argvec+1, tstr, &static_memfuncp, "structure");
+  argvec[0] = value_struct_elt (&arg1, argvec + 1, tstr, &static_memfuncp, "structure");
 
   if (argvec[0])
     {
@@ -466,30 +544,30 @@ value_x_unop (arg1, op, noside)
       return call_function_by_hand (argvec[0], 1 - static_memfuncp, argvec + 1);
     }
   error ("member function %s not found", tstr);
-  return 0;  /* For lint -- never reached */
+  return 0;                    /* For lint -- never reached */
 }
-
 \f
+
 /* Concatenate two values with the following conditions:
 
-   (1) Both values must be either bitstring values or character string
-       values and the resulting value consists of the concatenation of
-       ARG1 followed by ARG2.
+   (1)  Both values must be either bitstring values or character string
+   values and the resulting value consists of the concatenation of
+   ARG1 followed by ARG2.
 
-       or
+   or
 
-       One value must be an integer value and the other value must be
-       either a bitstring value or character string value, which is
-       to be repeated by the number of times specified by the integer
-       value.
+   One value must be an integer value and the other value must be
+   either a bitstring value or character string value, which is
+   to be repeated by the number of times specified by the integer
+   value.
 
 
-    (2)        Boolean values are also allowed and are treated as bit string
-       values of length 1.
+   (2)  Boolean values are also allowed and are treated as bit string
+   values of length 1.
 
-    (3)        Character values are also allowed and are treated as character
-       string values of length 1.
-*/
+   (3)  Character values are also allowed and are treated as character
+   string values of length 1.
+ */
 
 value_ptr
 value_concat (arg1, arg2)
@@ -531,7 +609,7 @@ value_concat (arg1, arg2)
   if (TYPE_CODE (type1) == TYPE_CODE_INT)
     {
       /* We have a repeat count.  Validate the second value and then
-        construct a value repeated that many times. */
+         construct a value repeated that many times. */
       if (TYPE_CODE (type2) == TYPE_CODE_STRING
          || TYPE_CODE (type2) == TYPE_CODE_CHAR)
        {
@@ -568,7 +646,7 @@ value_concat (arg1, arg2)
        }
     }
   else if (TYPE_CODE (type1) == TYPE_CODE_STRING
-      || TYPE_CODE (type1) == TYPE_CODE_CHAR)
+          || TYPE_CODE (type1) == TYPE_CODE_CHAR)
     {
       /* We have two character strings to concatenate. */
       if (TYPE_CODE (type2) != TYPE_CODE_STRING
@@ -589,7 +667,7 @@ value_concat (arg1, arg2)
        }
       if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
        {
-         *(ptr + inval1len) = 
+         *(ptr + inval1len) =
            (char) unpack_long (type2, VALUE_CONTENTS (inval2));
        }
       else
@@ -608,7 +686,7 @@ value_concat (arg1, arg2)
          error ("Bitstrings or booleans can only be concatenated with other bitstrings or booleans.");
        }
       error ("unimplemented support for bitstring/boolean concatenation.");
-    }      
+    }
   else
     {
       /* We don't know how to concatenate these operands. */
@@ -616,9 +694,9 @@ value_concat (arg1, arg2)
     }
   return (outval);
 }
-
 \f
 
+
 /* Perform a binary operation on two operands which have reasonable
    representations as integers or floats.  This includes booleans,
    characters, integers, or floats.
@@ -658,8 +736,8 @@ value_binop (arg1, arg2, op)
       TYPE_CODE (type2) == TYPE_CODE_FLT)
     {
       /* FIXME-if-picky-about-floating-accuracy: Should be doing this
-        in target format.  real.c in GCC probably has the necessary
-        code.  */
+         in target format.  real.c in GCC probably has the necessary
+         code.  */
       DOUBLEST v1, v2, v;
       v1 = value_as_double (arg1);
       v2 = value_as_double (arg2);
@@ -686,10 +764,10 @@ value_binop (arg1, arg2, op)
        }
 
       /* If either arg was long double, make sure that value is also long
-        double.  */
+         double.  */
 
-      if (TYPE_LENGTH(type1) * 8 > TARGET_DOUBLE_BIT
-         || TYPE_LENGTH(type2) * 8 > TARGET_DOUBLE_BIT)
+      if (TYPE_LENGTH (type1) * 8 > TARGET_DOUBLE_BIT
+         || TYPE_LENGTH (type2) * 8 > TARGET_DOUBLE_BIT)
        val = allocate_value (builtin_type_long_double);
       else
        val = allocate_value (builtin_type_double);
@@ -700,34 +778,34 @@ value_binop (arg1, arg2, op)
   else if (TYPE_CODE (type1) == TYPE_CODE_BOOL
           &&
           TYPE_CODE (type2) == TYPE_CODE_BOOL)
-      {
-         LONGEST v1, v2, v;
-         v1 = value_as_long (arg1);
-         v2 = value_as_long (arg2);
-         
-         switch (op)
-           {
-           case BINOP_BITWISE_AND:
-             v = v1 & v2;
-             break;
-             
-           case BINOP_BITWISE_IOR:
-             v = v1 | v2;
-             break;
-             
-           case BINOP_BITWISE_XOR:
-             v = v1 ^ v2;
-             break;
-             
-           default:
-             error ("Invalid operation on booleans.");
-           }
-         
-         val = allocate_value (type1);
-         store_signed_integer (VALUE_CONTENTS_RAW (val),
-                               TYPE_LENGTH (type1),
-                               v);
-      }
+    {
+      LONGEST v1, v2, v;
+      v1 = value_as_long (arg1);
+      v2 = value_as_long (arg2);
+
+      switch (op)
+       {
+       case BINOP_BITWISE_AND:
+         v = v1 & v2;
+         break;
+
+       case BINOP_BITWISE_IOR:
+         v = v1 | v2;
+         break;
+
+       case BINOP_BITWISE_XOR:
+         v = v1 ^ v2;
+         break;
+
+       default:
+         error ("Invalid operation on booleans.");
+       }
+
+      val = allocate_value (type1);
+      store_signed_integer (VALUE_CONTENTS_RAW (val),
+                           TYPE_LENGTH (type1),
+                           v);
+    }
   else
     /* Integral operations here.  */
     /* FIXME:  Also mixed integral/booleans, with result an integer. */
@@ -742,7 +820,7 @@ value_binop (arg1, arg2, op)
       int unsigned_operation;
 
       /* Determine type length and signedness after promotion for
-        both operands.  */
+         both operands.  */
       if (promoted_len1 < TYPE_LENGTH (builtin_type_int))
        {
          is_unsigned1 = 0;
@@ -755,10 +833,10 @@ value_binop (arg1, arg2, op)
        }
 
       /* Determine type length of the result, and if the operation should
-        be done unsigned.
-        Use the signedness of the operand with the greater length.
-        If both operands are of equal length, use unsigned operation
-        if one of the operands is unsigned.  */
+         be done unsigned.
+         Use the signedness of the operand with the greater length.
+         If both operands are of equal length, use unsigned operation
+         if one of the operands is unsigned.  */
       if (promoted_len1 > promoted_len2)
        {
          unsigned_operation = is_unsigned1;
@@ -787,34 +865,34 @@ value_binop (arg1, arg2, op)
              v1 &= ((LONGEST) 1 << HOST_CHAR_BIT * result_len) - 1;
              v2 &= ((LONGEST) 1 << HOST_CHAR_BIT * result_len) - 1;
            }
-         
+
          switch (op)
            {
            case BINOP_ADD:
              v = v1 + v2;
              break;
-             
+
            case BINOP_SUB:
              v = v1 - v2;
              break;
-             
+
            case BINOP_MUL:
              v = v1 * v2;
              break;
-             
+
            case BINOP_DIV:
              v = v1 / v2;
              break;
-             
+
            case BINOP_REM:
              v = v1 % v2;
              break;
-             
+
            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
+             if (current_language->la_language == language_chill
                  && value_as_long (arg2) <= 0)
                {
                  error ("Second operand of MOD must be greater than zero.");
@@ -825,44 +903,44 @@ value_binop (arg1, arg2, op)
                }
              else
                {
-                 v = v1/v2;
+                 v = v1 / v2;
                  /* Note floor(v1/v2) == v1/v2 for unsigned. */
                  v = v1 - (v2 * v);
                }
              break;
-             
+
            case BINOP_LSH:
              v = v1 << v2;
              break;
-             
+
            case BINOP_RSH:
              v = v1 >> v2;
              break;
-             
+
            case BINOP_BITWISE_AND:
              v = v1 & v2;
              break;
-             
+
            case BINOP_BITWISE_IOR:
              v = v1 | v2;
              break;
-             
+
            case BINOP_BITWISE_XOR:
              v = v1 ^ v2;
              break;
-             
+
            case BINOP_LOGICAL_AND:
              v = v1 && v2;
              break;
-             
+
            case BINOP_LOGICAL_OR:
              v = v1 || v2;
              break;
-             
+
            case BINOP_MIN:
              v = v1 < v2 ? v1 : v2;
              break;
-             
+
            case BINOP_MAX:
              v = v1 > v2 ? v1 : v2;
              break;
@@ -874,7 +952,7 @@ value_binop (arg1, arg2, op)
            case BINOP_LESS:
              v = v1 < v2;
              break;
-             
+
            default:
              error ("Invalid binary operation on numbers.");
            }
@@ -901,34 +979,34 @@ value_binop (arg1, arg2, op)
          LONGEST v1, v2, v;
          v1 = value_as_long (arg1);
          v2 = value_as_long (arg2);
-         
+
          switch (op)
            {
            case BINOP_ADD:
              v = v1 + v2;
              break;
-             
+
            case BINOP_SUB:
              v = v1 - v2;
              break;
-             
+
            case BINOP_MUL:
              v = v1 * v2;
              break;
-             
+
            case BINOP_DIV:
              v = v1 / v2;
              break;
-             
+
            case BINOP_REM:
              v = v1 % v2;
              break;
-             
+
            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
+             if (current_language->la_language == language_chill
                  && v2 <= 0)
                {
                  error ("Second operand of MOD must be greater than zero.");
@@ -939,7 +1017,7 @@ value_binop (arg1, arg2, op)
                }
              else
                {
-                 v = v1/v2;
+                 v = v1 / v2;
                  /* Compute floor. */
                  if (TRUNCATION_TOWARDS_ZERO && (v < 0) && ((v1 % v2) != 0))
                    {
@@ -948,39 +1026,39 @@ value_binop (arg1, arg2, op)
                  v = v1 - (v2 * v);
                }
              break;
-             
+
            case BINOP_LSH:
              v = v1 << v2;
              break;
-             
+
            case BINOP_RSH:
              v = v1 >> v2;
              break;
-             
+
            case BINOP_BITWISE_AND:
              v = v1 & v2;
              break;
-             
+
            case BINOP_BITWISE_IOR:
              v = v1 | v2;
              break;
-             
+
            case BINOP_BITWISE_XOR:
              v = v1 ^ v2;
              break;
-             
+
            case BINOP_LOGICAL_AND:
              v = v1 && v2;
              break;
-             
+
            case BINOP_LOGICAL_OR:
              v = v1 || v2;
              break;
-             
+
            case BINOP_MIN:
              v = v1 < v2 ? v1 : v2;
              break;
-             
+
            case BINOP_MAX:
              v = v1 > v2 ? v1 : v2;
              break;
@@ -992,7 +1070,7 @@ value_binop (arg1, arg2, op)
            case BINOP_LESS:
              v = v1 < v2;
              break;
-             
+
            default:
              error ("Invalid binary operation on numbers.");
            }
@@ -1100,7 +1178,7 @@ value_equal (arg1, arg2)
   else
     {
       error ("Invalid type combination in equality test.");
-      return 0;  /* For lint -- never reached */
+      return 0;                        /* For lint -- never reached */
     }
 }
 
@@ -1162,20 +1240,21 @@ value_neg (arg1)
   type = check_typedef (VALUE_TYPE (arg1));
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    return value_from_double (result_type, - value_as_double (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 ?  */
+         FIXME: What about FORTRAN and chill ?  */
       if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
        result_type = builtin_type_int;
 
-      return value_from_longest (result_type, - value_as_long (arg1));
+      return value_from_longest (result_type, -value_as_long (arg1));
+    }
+  else
+    {
+      error ("Argument to negate operation not a number.");
+      return 0;                        /* For lint -- never reached */
     }
-  else {
-    error ("Argument to negate operation not a number.");
-    return 0;  /* For lint -- never reached */
-  }
 }
 
 value_ptr
@@ -1184,7 +1263,7 @@ value_complement (arg1)
 {
   register struct type *type;
   register struct type *result_type = VALUE_TYPE (arg1);
-  int typecode; 
+  int typecode;
 
   COERCE_REF (arg1);
   COERCE_ENUM (arg1);
@@ -1200,7 +1279,7 @@ value_complement (arg1)
   if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
     result_type = builtin_type_int;
 
-  return value_from_longest (result_type, ~ value_as_long (arg1));
+  return value_from_longest (result_type, ~value_as_long (arg1));
 }
 \f
 /* The INDEX'th bit of SET value whose VALUE_TYPE is TYPE,
index c7db8361b6f3fa3646a263a7edf5ae35e99a91cd..3c30d8ff9bec475aec0d09c1d77722a4729a5480 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -49,7 +50,7 @@ extern int hp_som_som_object_present;
 
 /* Local functions.  */
 
-static int typecmp PARAMS ((int staticp, struct type *t1[], value_ptr t2[]));
+static int typecmp PARAMS ((int staticp, struct type * t1[], value_ptr t2[]));
 
 static CORE_ADDR find_function_addr PARAMS ((value_ptr, struct type **));
 static value_ptr value_arg_coerce PARAMS ((value_ptr, struct type *, int));
@@ -61,8 +62,8 @@ static value_ptr search_struct_field PARAMS ((char *, value_ptr, int,
                                              struct type *, int));
 
 static value_ptr search_struct_field_aux PARAMS ((char *, value_ptr, int,
-                                                  struct type *, int, int *, char *,
-                                                  struct type **));
+                                         struct type *, int, int *, char *,
+                                                 struct type **));
 
 static value_ptr search_struct_method PARAMS ((char *, value_ptr *,
                                               value_ptr *,
@@ -74,7 +75,7 @@ static CORE_ADDR allocate_space_in_inferior PARAMS ((int));
 
 static value_ptr cast_into_complex PARAMS ((struct type *, value_ptr));
 
-static struct fn_field *find_method_list PARAMS ((value_ptr *argp, char * method, int offset, int * static_memfuncp, struct type * type, int * num_fns, struct type ** basetype, int * boffset));
+static struct fn_field *find_method_list PARAMS ((value_ptr * argp, char *method, int offset, int *static_memfuncp, struct type * type, int *num_fns, struct type ** basetype, int *boffset));
 
 void _initialize_valops PARAMS ((void));
 
@@ -87,9 +88,9 @@ static int auto_abandon = 0;
 #endif
 
 int overload_resolution = 0;
+\f
 
 
-\f
 /* Find the address of function name NAME in the inferior.  */
 
 value_ptr
@@ -109,7 +110,7 @@ find_function_in_inferior (name)
     }
   else
     {
-      struct minimal_symbol *msymbol = lookup_minimal_symbol(name, NULL, NULL);
+      struct minimal_symbol *msymbol = lookup_minimal_symbol (name, NULL, NULL);
       if (msymbol != NULL)
        {
          struct type *type;
@@ -122,9 +123,9 @@ find_function_in_inferior (name)
        }
       else
        {
-          if (!target_has_execution)
+         if (!target_has_execution)
            error ("evaluation of this expression requires the target program to be active");
-          else
+         else
            error ("evaluation of this expression requires the program to have a function \"%s\".", name);
        }
     }
@@ -145,9 +146,9 @@ value_allocate_space_in_inferior (len)
   if (value_logical_not (val))
     {
       if (!target_has_execution)
-        error ("No memory available to program now: you need to start the target first");
-      else 
-        error ("No memory available to program: call to malloc failed");
+       error ("No memory available to program now: you need to start the target first");
+      else
+       error ("No memory available to program: call to malloc failed");
     }
   return val;
 }
@@ -175,13 +176,13 @@ value_cast (type, arg2)
   struct type *type2;
 
   int convert_to_boolean = 0;
-  
+
   if (VALUE_TYPE (arg2) == type)
     return arg2;
 
   CHECK_TYPEDEF (type);
   code1 = TYPE_CODE (type);
-  COERCE_REF(arg2);
+  COERCE_REF (arg2);
   type2 = check_typedef (VALUE_TYPE (arg2));
 
   /* A cast to an undetermined-length array_type, such as (TYPE [])OBJECT,
@@ -192,7 +193,7 @@ value_cast (type, arg2)
       struct type *element_type = TYPE_TARGET_TYPE (type);
       unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
       if (element_length > 0
-         && TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
+       && TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
        {
          struct type *range_type = TYPE_INDEX_TYPE (type);
          int val_length = TYPE_LENGTH (type2);
@@ -201,7 +202,7 @@ value_cast (type, arg2)
            low_bound = 0, high_bound = 0;
          new_length = val_length / element_length;
          if (val_length % element_length != 0)
-           warning("array element type size does not divide object size in cast");
+           warning ("array element type size does not divide object size in cast");
          /* FIXME-type-allocation: need a way to free this type when we are
             done with it.  */
          range_type = create_range_type ((struct type *) NULL,
@@ -240,13 +241,13 @@ value_cast (type, arg2)
   scalar = (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_FLT
            || code2 == TYPE_CODE_ENUM || code2 == TYPE_CODE_RANGE);
 
-  if (   code1 == TYPE_CODE_STRUCT
+  if (code1 == TYPE_CODE_STRUCT
       && code2 == TYPE_CODE_STRUCT
       && TYPE_NAME (type) != 0)
     {
       /* Look in the type of the source to see if it contains the
-        type of the target as a superclass.  If so, we'll need to
-        offset the object in addition to changing its type.  */
+         type of the target as a superclass.  If so, we'll need to
+         offset the object in addition to changing its type.  */
       value_ptr v = search_struct_field (type_name_no_tag (type),
                                         arg2, 0, type2, 1);
       if (v)
@@ -262,30 +263,30 @@ value_cast (type, arg2)
           && (scalar || code2 == TYPE_CODE_PTR))
     {
       LONGEST longest;
-      
-      if (hp_som_som_object_present &&  /* if target compiled by HP aCC */ 
-          (code2 == TYPE_CODE_PTR))
-        {
-          unsigned int * ptr;
-          value_ptr retvalp;
-          
-          switch (TYPE_CODE (TYPE_TARGET_TYPE (type2)))
-            {
-              /* With HP aCC, pointers to data members have a bias */ 
-              case TYPE_CODE_MEMBER:
-                retvalp = value_from_longest (type, value_as_long (arg2));
-                ptr = (unsigned int *) VALUE_CONTENTS (retvalp); /* force evaluation */
-                *ptr &= ~0x20000000; /* zap 29th bit to remove bias */ 
-                return retvalp;
-
-              /* While pointers to methods don't really point to a function */ 
-              case TYPE_CODE_METHOD:
-                error ("Pointers to methods not supported with HP aCC");
-
-              default:
-                break; /* fall out and go to normal handling */ 
-            }
-        }
+
+      if (hp_som_som_object_present && /* if target compiled by HP aCC */
+         (code2 == TYPE_CODE_PTR))
+       {
+         unsigned int *ptr;
+         value_ptr retvalp;
+
+         switch (TYPE_CODE (TYPE_TARGET_TYPE (type2)))
+           {
+             /* With HP aCC, pointers to data members have a bias */
+           case TYPE_CODE_MEMBER:
+             retvalp = value_from_longest (type, value_as_long (arg2));
+             ptr = (unsigned int *) VALUE_CONTENTS (retvalp);  /* force evaluation */
+             *ptr &= ~0x20000000;      /* zap 29th bit to remove bias */
+             return retvalp;
+
+             /* While pointers to methods don't really point to a function */
+           case TYPE_CODE_METHOD:
+             error ("Pointers to methods not supported with HP aCC");
+
+           default:
+             break;            /* fall out and go to normal handling */
+           }
+       }
       longest = value_as_long (arg2);
       return value_from_longest (type, convert_to_boolean ? (LONGEST) (longest ? 1 : 0) : longest);
     }
@@ -295,15 +296,15 @@ value_cast (type, arg2)
        {
          struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
          struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
-         if (   TYPE_CODE (t1) == TYPE_CODE_STRUCT
+         if (TYPE_CODE (t1) == TYPE_CODE_STRUCT
              && TYPE_CODE (t2) == TYPE_CODE_STRUCT
              && !value_logical_not (arg2))
            {
              value_ptr v;
 
              /* Look in the type of the source to see if it contains the
-                type of the target as a superclass.  If so, we'll need to
-                offset the pointer rather than just change its type.  */
+                type of the target as a superclass.  If so, we'll need to
+                offset the pointer rather than just change its type.  */
              if (TYPE_NAME (t1) != NULL)
                {
                  v = search_struct_field (type_name_no_tag (t1),
@@ -317,18 +318,18 @@ value_cast (type, arg2)
                }
 
              /* Look in the type of the target to see if it contains the
-                type of the source as a superclass.  If so, we'll need to
-                offset the pointer rather than just change its type.
-                FIXME: This fails silently with virtual inheritance.  */
+                type of the source as a superclass.  If so, we'll need to
+                offset the pointer rather than just change its type.
+                FIXME: This fails silently with virtual inheritance.  */
              if (TYPE_NAME (t2) != NULL)
                {
                  v = search_struct_field (type_name_no_tag (t2),
-                                          value_zero (t1, not_lval), 0, t1, 1);
+                                      value_zero (t1, not_lval), 0, t1, 1);
                  if (v)
                    {
                      value_ptr v2 = value_ind (arg2);
                      VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v)
-                                           + VALUE_OFFSET (v);
+                       + VALUE_OFFSET (v);
                      v2 = value_addr (v2);
                      VALUE_TYPE (v2) = type;
                      return v2;
@@ -338,8 +339,8 @@ value_cast (type, arg2)
          /* No superclass found, just fall through to change ptr type.  */
        }
       VALUE_TYPE (arg2) = type;
-      VALUE_ENCLOSING_TYPE (arg2) = type;  /* pai: chk_val */
-      VALUE_POINTED_TO_OFFSET (arg2) = 0;  /* pai: chk_val */
+      VALUE_ENCLOSING_TYPE (arg2) = type;      /* pai: chk_val */
+      VALUE_POINTED_TO_OFFSET (arg2) = 0;      /* pai: chk_val */
       return arg2;
     }
   else if (chill_varying_type (type))
@@ -357,7 +358,7 @@ value_cast (type, arg2)
          || (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) */ )))
+      /* || 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);
@@ -366,7 +367,7 @@ value_cast (type, arg2)
       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 */
+       count1 = -1, count2 = 0;        /* To force error before */
       else
        count2 = high_bound - low_bound + 1;
       if (count2 > count1)
@@ -454,14 +455,14 @@ value_at (type, addr, sect)
       store_address (VALUE_CONTENTS_RAW (val), 4, num);
     }
   else if (GDB_TARGET_IS_D10V
-          && TYPE_CODE(type) == TYPE_CODE_PTR)
+          && TYPE_CODE (type) == TYPE_CODE_PTR)
     {
       /* pointer to data */
       unsigned long num;
       unsigned short snum;
       snum = read_memory_unsigned_integer (addr, 2);
       num = D10V_MAKE_DADDR (snum);
-      store_address (VALUE_CONTENTS_RAW (val), 4, num); 
+      store_address (VALUE_CONTENTS_RAW (val), 4, num);
     }
   else
     read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), TYPE_LENGTH (type), sect);
@@ -515,7 +516,7 @@ value_fetch_lazy (val)
   CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
   int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val));
 
-  struct type *type = VALUE_TYPE(val);
+  struct type *type = VALUE_TYPE (val);
   if (GDB_TARGET_IS_D10V
       && TYPE_CODE (type) == TYPE_CODE_PTR
       && TYPE_TARGET_TYPE (type)
@@ -525,18 +526,18 @@ value_fetch_lazy (val)
       unsigned long num;
       unsigned short snum;
       snum = read_memory_unsigned_integer (addr, 2);
-      num = D10V_MAKE_IADDR(snum);
-      store_address ( VALUE_CONTENTS_RAW (val), 4, num);
+      num = D10V_MAKE_IADDR (snum);
+      store_address (VALUE_CONTENTS_RAW (val), 4, num);
     }
   else if (GDB_TARGET_IS_D10V
-          && TYPE_CODE(type) == TYPE_CODE_PTR)
+          && TYPE_CODE (type) == TYPE_CODE_PTR)
     {
       /* pointer to data */
       unsigned long num;
       unsigned short snum;
       snum = read_memory_unsigned_integer (addr, 2);
-      num = D10V_MAKE_DADDR(snum);
-      store_address ( VALUE_CONTENTS_RAW (val), 4, num); 
+      num = D10V_MAKE_DADDR (snum);
+      store_address (VALUE_CONTENTS_RAW (val), 4, num);
     }
   else if (length)
     read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), length,
@@ -608,18 +609,18 @@ value_assign (toval, fromval)
     case lval_memory:
       {
        char *dest_buffer;
-        CORE_ADDR changed_addr;
-        int changed_len;
+       CORE_ADDR changed_addr;
+       int changed_len;
 
-        if (VALUE_BITSIZE (toval))
-          {
+       if (VALUE_BITSIZE (toval))
+         {
            char buffer[sizeof (LONGEST)];
            /* We assume that the argument to read_memory is in units of
               host chars.  FIXME:  Is that correct?  */
            changed_len = (VALUE_BITPOS (toval)
-                    + VALUE_BITSIZE (toval)
-                    + HOST_CHAR_BIT - 1)
-                   / HOST_CHAR_BIT;
+                          + VALUE_BITSIZE (toval)
+                          + HOST_CHAR_BIT - 1)
+             / HOST_CHAR_BIT;
 
            if (changed_len > (int) sizeof (LONGEST))
              error ("Can't handle bitfields which don't fit in a %d bit word.",
@@ -655,7 +656,7 @@ value_assign (toval, fromval)
       if (VALUE_BITSIZE (toval))
        {
          char buffer[sizeof (LONGEST)];
-          int len = REGISTER_RAW_SIZE (VALUE_REGNO (toval));
+         int len = REGISTER_RAW_SIZE (VALUE_REGNO (toval));
 
          if (len > (int) sizeof (LONGEST))
            error ("Can't handle bitfields in registers larger than %d bits.",
@@ -668,35 +669,35 @@ value_assign (toval, fromval)
            error ("\
 Can't handle bitfield which doesn't fit in a single register.");
 
-          read_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
-                               buffer, len);
-          modify_field (buffer, value_as_long (fromval),
-                        VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
-          write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
-                                buffer, len);
+         read_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
+                              buffer, len);
+         modify_field (buffer, value_as_long (fromval),
+                       VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
+         write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
+                               buffer, len);
        }
       else if (use_buffer)
        write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
                              raw_buffer, use_buffer);
       else
-        {
+       {
          /* Do any conversion necessary when storing this type to more
             than one register.  */
 #ifdef REGISTER_CONVERT_FROM_TYPE
          memcpy (raw_buffer, VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
-         REGISTER_CONVERT_FROM_TYPE(VALUE_REGNO (toval), type, raw_buffer);
+         REGISTER_CONVERT_FROM_TYPE (VALUE_REGNO (toval), type, raw_buffer);
          write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
                                raw_buffer, TYPE_LENGTH (type));
 #else
          write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
-                               VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
+                             VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
 #endif
        }
       /* 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
-        on all assignments to registers for simplicity; I doubt the slowdown
-        matters.  */
+         (architecture and calling convention specific) registers may
+         cause the frame cache to be out of date.  We just do this
+         on all assignments to registers for simplicity; I doubt the slowdown
+         matters.  */
       reinit_frame_cache ();
       break;
 
@@ -737,8 +738,8 @@ Can't handle bitfield which doesn't fit in a single register.");
             amount_copied += reg_size, regno++)
          {
            get_saved_register (buffer + amount_copied,
-                               (int *)NULL, (CORE_ADDR *)NULL,
-                               frame, regno, (enum lval_type *)NULL);
+                               (int *) NULL, (CORE_ADDR *) NULL,
+                               frame, regno, (enum lval_type *) NULL);
          }
 
        /* Modify what needs to be modified.  */
@@ -763,9 +764,9 @@ Can't handle bitfield which doesn't fit in a single register.");
            int optim;
 
            /* Just find out where to put it.  */
-           get_saved_register ((char *)NULL,
-                               &optim, &addr, frame, regno, &lval);
-           
+           get_saved_register ((char *) NULL,
+                               &optim, &addr, frame, regno, &lval);
+
            if (optim)
              error ("Attempt to assign to a value that was optimized out.");
            if (lval == lval_memory)
@@ -780,7 +781,7 @@ Can't handle bitfield which doesn't fit in a single register.");
          register_changed_hook (-1);
       }
       break;
-       
+
 
     default:
       error ("Left operand of assignment is not an lvalue.");
@@ -808,7 +809,7 @@ Can't handle bitfield which doesn't fit in a single register.");
   VALUE_ENCLOSING_TYPE (val) = VALUE_ENCLOSING_TYPE (fromval);
   VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (fromval);
   VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (fromval);
-  
+
   return val;
 }
 
@@ -851,14 +852,14 @@ value_of_variable (var, b)
     {
       frame = block_innermost_frame (b);
       if (!frame)
-        {
+       {
          if (BLOCK_FUNCTION (b)
              && SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)))
            error ("No frame is currently executing in block %s.",
                   SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)));
          else
            error ("No frame is currently executing in specified block");
-        }
+       }
     }
 
   val = read_var_value (var, frame);
@@ -889,7 +890,7 @@ value_of_variable (var, b)
    had an address somewhere before the actual first element of the array,
    and the information about the lower bound would be lost because of
    the coercion to pointer type.
  */
+ */
 
 value_ptr
 value_coerce_array (arg1)
@@ -901,7 +902,7 @@ value_coerce_array (arg1)
     error ("Attempt to take address of value not located in memory.");
 
   return value_from_longest (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
-                      (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
+                   (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
 }
 
 /* Given a value which is a function, return a value which is a pointer
@@ -917,10 +918,10 @@ value_coerce_function (arg1)
     error ("Attempt to take address of value not located in memory.");
 
   retval = value_from_longest (lookup_pointer_type (VALUE_TYPE (arg1)),
-                              (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
+                   (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
   VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (arg1);
   return retval;
-}  
+}
 
 /* Return a pointer value for the object for which ARG1 is the contents.  */
 
@@ -934,8 +935,8 @@ value_addr (arg1)
   if (TYPE_CODE (type) == TYPE_CODE_REF)
     {
       /* Copy the value, but change the type from (T&) to (T*).
-        We keep the same location information, which is efficient,
-        and allows &(&X) to get the location containing the reference. */
+         We keep the same location information, which is efficient,
+         and allows &(&X) to get the location containing the reference. */
       arg2 = value_copy (arg1);
       VALUE_TYPE (arg2) = lookup_pointer_type (TYPE_TARGET_TYPE (type));
       return arg2;
@@ -946,17 +947,17 @@ value_addr (arg1)
   if (VALUE_LVAL (arg1) != lval_memory)
     error ("Attempt to take address of value not located in memory.");
 
-  /* Get target memory address */  
+  /* Get target memory address */
   arg2 = value_from_longest (lookup_pointer_type (VALUE_TYPE (arg1)),
-                              (LONGEST) (VALUE_ADDRESS (arg1) 
-                                         + VALUE_OFFSET (arg1)
-                                         + VALUE_EMBEDDED_OFFSET (arg1)));
+                            (LONGEST) (VALUE_ADDRESS (arg1)
+                                       + VALUE_OFFSET (arg1)
+                                       + VALUE_EMBEDDED_OFFSET (arg1)));
 
   /* This may be a pointer to a base subobject; so remember the
-     full derived object's type ... */ 
+     full derived object's type ... */
   VALUE_ENCLOSING_TYPE (arg2) = lookup_pointer_type (VALUE_ENCLOSING_TYPE (arg1));
-  /* ... and also the relative position of the subobject in the full object */ 
-  VALUE_POINTED_TO_OFFSET (arg2) = VALUE_EMBEDDED_OFFSET (arg1);  
+  /* ... and also the relative position of the subobject in the full object */
+  VALUE_POINTED_TO_OFFSET (arg2) = VALUE_EMBEDDED_OFFSET (arg1);
   VALUE_BFD_SECTION (arg2) = VALUE_BFD_SECTION (arg1);
   return arg2;
 }
@@ -990,14 +991,14 @@ value_ind (arg1)
     {
       struct type *enc_type;
       /* We may be pointing to something embedded in a larger object */
-      /* Get the real type of the enclosing object */ 
+      /* Get the real type of the enclosing object */
       enc_type = check_typedef (VALUE_ENCLOSING_TYPE (arg1));
       enc_type = TYPE_TARGET_TYPE (enc_type);
-      /* Retrieve the enclosing object pointed to */ 
-      arg2 =  value_at_lazy (enc_type, 
-                            value_as_pointer (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
-                             VALUE_BFD_SECTION (arg1));
-      /* Re-adjust type */ 
+      /* Retrieve the enclosing object pointed to */
+      arg2 = value_at_lazy (enc_type,
+                  value_as_pointer (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
+                           VALUE_BFD_SECTION (arg1));
+      /* Re-adjust type */
       VALUE_TYPE (arg2) = TYPE_TARGET_TYPE (base_type);
       /* Add embedding info */
       VALUE_ENCLOSING_TYPE (arg2) = enc_type;
@@ -1009,7 +1010,7 @@ value_ind (arg1)
     }
 
   error ("Attempt to take contents of a non-pointer value.");
-  return 0;  /* For lint -- never reached */
+  return 0;                    /* For lint -- never reached */
 }
 \f
 /* Pushing small parts of stack frames.  */
@@ -1124,7 +1125,7 @@ value_arg_coerce (arg, param_type, is_prototyped)
 {
   register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
   register struct type *type
-    = param_type ? check_typedef (param_type) : arg_type;
+  = param_type ? check_typedef (param_type) : arg_type;
 
   switch (TYPE_CODE (type))
     {
@@ -1147,16 +1148,16 @@ value_arg_coerce (arg, param_type, is_prototyped)
            type = builtin_type_int;
        }
       /* Currently all target ABIs require at least the width of an integer
-        type for an argument.  We may have to conditionalize the following
-        type coercion for future targets.  */
+         type for an argument.  We may have to conditionalize the following
+         type coercion for future targets.  */
       if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
        type = builtin_type_int;
       break;
     case TYPE_CODE_FLT:
       /* FIXME: We should always convert floats to doubles in the
-        non-prototyped case.  As many debugging formats include
-        no information about prototyping, we have to live with
-        COERCE_FLOAT_TO_DOUBLE for now.  */
+         non-prototyped case.  As many debugging formats include
+         no information about prototyping, we have to live with
+         COERCE_FLOAT_TO_DOUBLE for now.  */
       if (!is_prototyped && COERCE_FLOAT_TO_DOUBLE)
        {
          if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
@@ -1235,7 +1236,7 @@ find_function_addr (function, retval_type)
   else if (code == TYPE_CODE_INT)
     {
       /* Handle the case of functions lacking debugging info.
-        Their values are characters since their addresses are char */
+         Their values are characters since their addresses are char */
       if (TYPE_LENGTH (ftype) == 1)
        funaddr = value_as_pointer (value_addr (function));
       else
@@ -1269,7 +1270,7 @@ find_function_addr (function, retval_type)
 
    ARGS is modified to contain coerced values. */
 
-static value_ptr hand_function_call PARAMS ((value_ptr function, int nargs, value_ptr *args));
+static value_ptr hand_function_call PARAMS ((value_ptr function, int nargs, value_ptr * args));
 static value_ptr
 hand_function_call (function, nargs, args)
      value_ptr function;
@@ -1285,13 +1286,13 @@ hand_function_call (function, nargs, args)
      bigger than REGISTER_SIZE.  
 
      NOTE: This is pretty wierd, as the call dummy is actually a
-           sequence of instructions.  But CISC machines will have
-           to pack the instructions into REGISTER_SIZE units (and
-           so will RISC machines for which INSTRUCTION_SIZE is not
-           REGISTER_SIZE).
+     sequence of instructions.  But CISC machines will have
+     to pack the instructions into REGISTER_SIZE units (and
+     so will RISC machines for which INSTRUCTION_SIZE is not
+     REGISTER_SIZE).
 
      NOTE: This is pretty stupid.  CALL_DUMMY should be in strict
-           target byte order. */
+     target byte order. */
 
   static ULONGEST *dummy;
   int sizeof_dummy1;
@@ -1303,7 +1304,7 @@ hand_function_call (function, nargs, args)
   struct inferior_status *inf_status;
   struct cleanup *old_chain;
   CORE_ADDR funaddr;
-  int using_gcc;       /* Set to version of gcc in use, or zero if not gcc */
+  int using_gcc;               /* Set to version of gcc in use, or zero if not gcc */
   CORE_ADDR real_pc;
   struct type *param_type = NULL;
   struct type *ftype = check_typedef (SYMBOL_TYPE (function));
@@ -1314,11 +1315,11 @@ hand_function_call (function, nargs, args)
   memcpy (dummy, CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS);
 
   if (!target_has_execution)
-    noprocess();
+    noprocess ();
 
   inf_status = save_inferior_status (1);
-  old_chain = make_cleanup ((make_cleanup_func) restore_inferior_status, 
-                            inf_status);
+  old_chain = make_cleanup ((make_cleanup_func) 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)
@@ -1360,7 +1361,7 @@ hand_function_call (function, nargs, args)
   for (i = 0; i < (int) (SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0])); i++)
     store_unsigned_integer (&dummy1[i * REGISTER_SIZE],
                            REGISTER_SIZE,
-                           (ULONGEST)dummy[i]);
+                           (ULONGEST) dummy[i]);
 
 #ifdef GDB_TARGET_IS_HPPA
   real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
@@ -1373,7 +1374,7 @@ hand_function_call (function, nargs, args)
 
   if (CALL_DUMMY_LOCATION == ON_STACK)
     {
-      write_memory (start_sp, (char *)dummy1, sizeof_dummy1);
+      write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
     }
 
   if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END)
@@ -1389,16 +1390,16 @@ hand_function_call (function, nargs, args)
       checked = 1;
       sp = old_sp;
       real_pc = text_end - sizeof_dummy1;
-      write_memory (real_pc, (char *)dummy1, sizeof_dummy1);
+      write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
     }
-  
+
   if (CALL_DUMMY_LOCATION == AFTER_TEXT_END)
     {
       extern CORE_ADDR text_end;
       int errcode;
       sp = old_sp;
       real_pc = text_end;
-      errcode = target_write_memory (real_pc, (char *)dummy1, sizeof_dummy1);
+      errcode = target_write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
       if (errcode != 0)
        error ("Cannot write text segment -- call_function failed");
     }
@@ -1409,7 +1410,7 @@ hand_function_call (function, nargs, args)
     }
 
 #ifdef lint
-  sp = old_sp;         /* It really is used, for some ifdef's... */
+  sp = old_sp;                 /* It really is used, for some ifdef's... */
 #endif
 
   if (nargs < TYPE_NFIELDS (ftype))
@@ -1418,12 +1419,12 @@ hand_function_call (function, nargs, args)
   for (i = nargs - 1; i >= 0; i--)
     {
       /* 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.  */
+         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);
 
-      else 
+      else
        {
          int is_prototyped = TYPE_FLAGS (ftype) & TYPE_FLAG_PROTOTYPED;
          param_type = TYPE_FIELD_TYPE (ftype, i);
@@ -1432,35 +1433,35 @@ hand_function_call (function, nargs, args)
        }
 
       /*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 
-       is the address of a function and not a pointer to function variable.
-       In aCC compiled code, the calls through pointers to functions (in the body
-       of the function called by hand) are made via $$dyncall_external which
-       requires some registers setting, this is taken care of if we call 
-       via a function pointer variable, but not via a function address. 
-       In cc this is not a problem. */
+         has a pointer to function as parameter and the corresponding actual argument 
+         is the address of a function and not a pointer to function variable.
+         In aCC compiled code, the calls through pointers to functions (in the body
+         of the function called by hand) are made via $$dyncall_external which
+         requires some registers setting, this is taken care of if we call 
+         via a function pointer variable, but not via a function address. 
+         In cc this is not a problem. */
 
       if (using_gcc == 0)
        if (param_type)
-         /* if this parameter is a pointer to function*/
+         /* if this parameter is a pointer to function */
          if (TYPE_CODE (param_type) == TYPE_CODE_PTR)
            if (TYPE_CODE (param_type->target_type) == TYPE_CODE_FUNC)
              /* elz: FIXME here should go the test about the compiler used 
-                    to compile the target. We want to issue the error
-                    message only if the compiler used was HP's aCC. 
-                    If we used HP's cc, then there is no problem and no need 
-                    to return at this point */
-             if (using_gcc == 0) /* && compiler == aCC*/
+                to compile the target. We want to issue the error
+                message only if the compiler used was HP's aCC. 
+                If we used HP's cc, then there is no problem and no need 
+                to return at this point */
+             if (using_gcc == 0)       /* && compiler == aCC */
                /* go see if the actual parameter is a variable of type
-                pointer to function or just a function */
+                  pointer to function or just a function */
                if (args[i]->lval == not_lval)
                  {
                    char *arg_name;
-                   if (find_pc_partial_function((CORE_ADDR)args[i]->aligner.contents[0], &arg_name, NULL, NULL))
-                     error("\
+                   if (find_pc_partial_function ((CORE_ADDR) args[i]->aligner.contents[0], &arg_name, NULL, NULL))
+                     error ("\
 You cannot use function <%s> as argument. \n\
 You must use a pointer to function type variable. Command ignored.", arg_name);
-                 }   
+                 }
     }
 
 #if defined (REG_STRUCT_HAS_ADDR)
@@ -1478,19 +1479,19 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
             || TYPE_CODE (arg_type) == TYPE_CODE_SET
             || (TYPE_CODE (arg_type) == TYPE_CODE_FLT
                 && TYPE_LENGTH (arg_type) > 8)
-            )
-         && REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
+           )
+           && REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
          {
            CORE_ADDR addr;
-           int len; /*  = TYPE_LENGTH (arg_type); */ 
-            int aligned_len;
-            arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i])); 
-            len = TYPE_LENGTH (arg_type);
+           int len;            /*  = TYPE_LENGTH (arg_type); */
+           int aligned_len;
+           arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i]));
+           len = TYPE_LENGTH (arg_type);
 
 #ifdef STACK_ALIGN
-  /* MVS 11/22/96: I think at least some of this stack_align code is
-     really broken.  Better to let PUSH_ARGUMENTS adjust the stack in
-     a target-defined manner.  */
+           /* MVS 11/22/96: I think at least some of this stack_align code is
+              really broken.  Better to let PUSH_ARGUMENTS adjust the stack in
+              a target-defined manner.  */
            aligned_len = STACK_ALIGN (len);
 #else
            aligned_len = len;
@@ -1522,8 +1523,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
            /* The value we're going to pass is the address of the thing
               we just pushed.  */
            /*args[i] = value_from_longest (lookup_pointer_type (value_type),
-                                         (LONGEST) addr);*/
-           args[i] = value_from_longest (lookup_pointer_type (arg_type), 
+              (LONGEST) addr); */
+           args[i] = value_from_longest (lookup_pointer_type (arg_type),
                                          (LONGEST) addr);
          }
       }
@@ -1537,9 +1538,9 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
     {
       int len = TYPE_LENGTH (value_type);
 #ifdef STACK_ALIGN
-  /* MVS 11/22/96: I think at least some of this stack_align code is
-     really broken.  Better to let PUSH_ARGUMENTS adjust the stack in
-     a target-defined manner.  */
+      /* MVS 11/22/96: I think at least some of this stack_align code is
+         really broken.  Better to let PUSH_ARGUMENTS adjust the stack in
+         a target-defined manner.  */
       len = STACK_ALIGN (len);
 #endif
       if (INNER_THAN (1, 2))
@@ -1559,7 +1560,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
 /* elz: on HPPA no need for this extra alignment, maybe it is needed
    on other architectures. This is because all the alignment is taken care
    of in the above code (ifdef REG_STRUCT_HAS_ADDR) and in 
-   hppa_push_arguments*/
+   hppa_push_arguments */
 #ifndef NO_EXTRA_ALIGNMENT_NEEDED
 
 #if defined(STACK_ALIGN)
@@ -1592,14 +1593,14 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
      as appropriate.  Formerly this has been done in PUSH_ARGUMENTS, 
      but that's overloading its functionality a bit, so I'm making it
      explicit to do it here.  */
-  sp = PUSH_RETURN_ADDRESS(real_pc, sp);
-#endif /* PUSH_RETURN_ADDRESS */
+  sp = PUSH_RETURN_ADDRESS (real_pc, sp);
+#endif /* PUSH_RETURN_ADDRESS */
 
 #if defined(STACK_ALIGN)
-  if (! INNER_THAN (1, 2))
+  if (!INNER_THAN (1, 2))
     {
       /* If stack grows up, we must leave a hole at the bottom, note
-        that sp already has been advanced for the arguments!  */
+         that sp already has been advanced for the arguments!  */
       if (CALL_DUMMY_STACK_ADJUST_P)
        sp += CALL_DUMMY_STACK_ADJUST;
       sp = STACK_ALIGN (sp);
@@ -1709,7 +1710,7 @@ the function call).", name);
    We cannot assume on the pa that r28 still contains the address of the returned
    structure. Usually this will be overwritten by the callee.
    I don't know about other architectures, so I defined this macro
-*/
+ */
 
 #ifdef VALUE_RETURNED_FROM_STACK
     if (struct_return)
@@ -1735,9 +1736,9 @@ call_function_by_hand (function, nargs, args)
       error ("Cannot invoke functions on this machine.");
     }
 }
+\f
 
 
-\f
 /* Create a value for an array by allocating space in the inferior, copying
    the data into that space, and then setting up an array value.
 
@@ -1781,8 +1782,8 @@ value_array (lowbound, highbound, elemvec)
 
   rangetype = create_range_type ((struct type *) NULL, builtin_type_int,
                                 lowbound, highbound);
-  arraytype = create_array_type ((struct type *) NULL, 
-                                VALUE_ENCLOSING_TYPE (elemvec[0]), rangetype);
+  arraytype = create_array_type ((struct type *) NULL,
+                             VALUE_ENCLOSING_TYPE (elemvec[0]), rangetype);
 
   if (!current_language->c_style_arrays)
     {
@@ -1834,7 +1835,7 @@ value_string (ptr, len)
                                              builtin_type_int,
                                              lowbound, len + lowbound - 1);
   struct type *stringtype
-    = create_string_type ((struct type *) NULL, rangetype);
+  = create_string_type ((struct type *) NULL, rangetype);
   CORE_ADDR addr;
 
   if (current_language->c_style_arrays == 0)
@@ -1863,7 +1864,7 @@ value_bitstring (ptr, len)
   value_ptr val;
   struct type *domain_type = create_range_type (NULL, builtin_type_int,
                                                0, len - 1);
-  struct type *type = create_set_type ((struct type*) NULL, domain_type);
+  struct type *type = create_set_type ((struct type *) NULL, domain_type);
   TYPE_CODE (type) = TYPE_CODE_BITSTRING;
   val = allocate_value (type);
   memcpy (VALUE_CONTENTS_RAW (val), ptr, TYPE_LENGTH (type));
@@ -1899,17 +1900,19 @@ typecmp (staticp, t1, t2)
     return t2[1] != 0;
   if (t1 == 0)
     return 1;
-  if (TYPE_CODE (t1[0]) == TYPE_CODE_VOID) return 0;
-  if (t1[!staticp] == 0) return 0;
+  if (TYPE_CODE (t1[0]) == TYPE_CODE_VOID)
+    return 0;
+  if (t1[!staticp] == 0)
+    return 0;
   for (i = !staticp; t1[i] && TYPE_CODE (t1[i]) != TYPE_CODE_VOID; i++)
     {
-    struct type *tt1, *tt2;
-      if (! t2[i])
-       return i+1;
+      struct type *tt1, *tt2;
+      if (!t2[i])
+       return i + 1;
       tt1 = check_typedef (t1[i]);
-      tt2 = check_typedef (VALUE_TYPE(t2[i]));
+      tt2 = check_typedef (VALUE_TYPE (t2[i]));
       if (TYPE_CODE (tt1) == TYPE_CODE_REF
-         /* We should be doing hairy argument matching, as below.  */
+      /* We should be doing hairy argument matching, as below.  */
          && (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (tt1))) == TYPE_CODE (tt2)))
        {
          if (TYPE_CODE (tt2) == TYPE_CODE_ARRAY)
@@ -1920,23 +1923,25 @@ typecmp (staticp, t1, t2)
        }
 
       while (TYPE_CODE (tt1) == TYPE_CODE_PTR
-         && (   TYPE_CODE (tt2) == TYPE_CODE_ARRAY
-             || TYPE_CODE (tt2) == TYPE_CODE_PTR))
+            && (TYPE_CODE (tt2) == TYPE_CODE_ARRAY
+                || TYPE_CODE (tt2) == TYPE_CODE_PTR))
        {
-          tt1 = check_typedef (TYPE_TARGET_TYPE(tt1)); 
-          tt2 = check_typedef (TYPE_TARGET_TYPE(tt2));
+         tt1 = check_typedef (TYPE_TARGET_TYPE (tt1));
+         tt2 = check_typedef (TYPE_TARGET_TYPE (tt2));
        }
-      if (TYPE_CODE(tt1) == TYPE_CODE(tt2)) continue;
+      if (TYPE_CODE (tt1) == TYPE_CODE (tt2))
+       continue;
       /* Array to pointer is a `trivial conversion' according to the ARM.  */
 
       /* 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.  */
+         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])))
-       return i+1;
+       return i + 1;
     }
-  if (!t1[i]) return 0;
-  return t2[i] ? i+1 : 0;
+  if (!t1[i])
+    return 0;
+  return t2[i] ? i + 1 : 0;
 }
 
 /* Helper function used by value_struct_elt to recurse through baseclasses.
@@ -1960,7 +1965,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
 
   CHECK_TYPEDEF (type);
 
-  if (! looking_for_baseclass)
+  if (!looking_for_baseclass)
     for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
       {
        char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -1973,7 +1978,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
            else
              v = value_primitive_field (arg1, offset, i, type);
            if (v == 0)
-             error("there is no field named %s", name);
+             error ("there is no field named %s", name);
            return v;
          }
 
@@ -1994,7 +1999,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
                   each member of the union represents a <variant alternative>.
                   Each <variant alternative> is represented as a struct,
                   with a member for each <variant field>.  */
-                  
+
                value_ptr v;
                int new_offset = offset;
 
@@ -2016,13 +2021,13 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
          }
       }
 
-  for (i = 0;  i < nbases;  i++)
+  for (i = 0; i < nbases; i++)
     {
       value_ptr v;
       struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
       /* If we are looking for baseclasses, this is what we get when we
-        hit them.  But it could happen that the base part's member name
-        is not yet filled in.  */
+         hit them.  But it could happen that the base part's member name
+         is not yet filled in.  */
       int found_baseclass = (looking_for_baseclass
                             && TYPE_BASECLASS_NAME (type, i) != NULL
                             && STREQ (name, TYPE_BASECLASS_NAME (type, i)));
@@ -2035,7 +2040,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
          boffset = baseclass_offset (type, i,
                                      VALUE_CONTENTS (arg1) + offset,
                                      VALUE_ADDRESS (arg1)
-                                       + VALUE_OFFSET (arg1) + offset);
+                                     + VALUE_OFFSET (arg1) + offset);
          if (boffset == -1)
            error ("virtual baseclass botch");
 
@@ -2047,7 +2052,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
          if (boffset < 0 || boffset >= TYPE_LENGTH (type))
            {
              CORE_ADDR base_addr;
-       
+
              base_addr = VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1) + boffset;
              if (target_read_memory (base_addr, VALUE_CONTENTS_RAW (v2),
                                      TYPE_LENGTH (basetype)) != 0)
@@ -2077,9 +2082,10 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
        v = value_primitive_field (arg1, offset, i, type);
       else
        v = search_struct_field (name, arg1,
-                                offset + TYPE_BASECLASS_BITPOS (type, i) / 8,
+                              offset + TYPE_BASECLASS_BITPOS (type, i) / 8,
                                 basetype, looking_for_baseclass);
-      if (v) return v;
+      if (v)
+       return v;
     }
   return NULL;
 }
@@ -2104,37 +2110,37 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
  * conventions.  */
 
 void
-find_rt_vbase_offset(type, basetype, valaddr, offset, boffset_p, skip_p)
-  struct type * type;
-  struct type * basetype;
-  char * valaddr;
-  int offset;
-  int * boffset_p;
-  int * skip_p;
+find_rt_vbase_offset (type, basetype, valaddr, offset, boffset_p, skip_p)
+     struct type *type;
+     struct type *basetype;
+     char *valaddr;
+     int offset;
+     int *boffset_p;
+     int *skip_p;
 {
-  int boffset;           /* offset of virtual base */
-  int index;             /* displacement to use in virtual table */
+  int boffset;                 /* offset of virtual base */
+  int index;                   /* displacement to use in virtual table */
   int skip;
-  
-  value_ptr vp;      
-  CORE_ADDR vtbl;      /* the virtual table pointer */
-  struct type * pbc;   /* the primary base class */
+
+  value_ptr vp;
+  CORE_ADDR vtbl;              /* the virtual table pointer */
+  struct type *pbc;            /* the primary base class */
 
   /* Look for the virtual base recursively in the primary base, first.
    * This is because the derived class object and its primary base
    * subobject share the primary virtual table.  */
-  
+
   boffset = 0;
-  pbc = TYPE_PRIMARY_BASE(type);
+  pbc = TYPE_PRIMARY_BASE (type);
   if (pbc)
     {
       find_rt_vbase_offset (pbc, basetype, valaddr, offset, &boffset, &skip);
       if (skip < 0)
-        {
-          *boffset_p = boffset;
-          *skip_p = -1;
-          return;
-        }
+       {
+         *boffset_p = boffset;
+         *skip_p = -1;
+         return;
+       }
     }
   else
     skip = 0;
@@ -2144,17 +2150,18 @@ find_rt_vbase_offset(type, basetype, valaddr, offset, boffset_p, skip_p)
      runtime spec. (Depth-first, left-to-right.)  */
   index = virtual_base_index_skip_primaries (basetype, type);
 
-  if (index < 0) {
-    *skip_p = skip + virtual_base_list_length_skip_primaries (type);
-    *boffset_p = 0;
-    return;
-  }
+  if (index < 0)
+    {
+      *skip_p = skip + virtual_base_list_length_skip_primaries (type);
+      *boffset_p = 0;
+      return;
+    }
 
-  /* pai: FIXME -- 32x64 possible problem */ 
+  /* pai: FIXME -- 32x64 possible problem */
   /* First word (4 bytes) in object layout is the vtable pointer */
-  vtbl = * (CORE_ADDR *) (valaddr + offset);
+  vtbl = *(CORE_ADDR *) (valaddr + offset);
 
-  /* Before the constructor is invoked, things are usually zero'd out. */ 
+  /* Before the constructor is invoked, things are usually zero'd out. */
   if (vtbl == 0)
     error ("Couldn't find virtual table -- object may not be constructed yet.");
 
@@ -2164,12 +2171,12 @@ find_rt_vbase_offset(type, basetype, valaddr, offset, boffset_p, skip_p)
    * HP_ACC_VBASE_START for the vtable slots before the start of the
    * virtual base entries.  Offset is negative -- virtual base entries
    * appear _before_ the address point of the virtual table. */
-  
+
   /* pai: FIXME -- 32x64 problem, if word = 8 bytes, change multiplier 
-     & use long type */ 
+     & use long type */
 
   /* epstein : FIXME -- added param for overlay section. May not be correct */
-   vp = value_at (builtin_type_int, vtbl + 4 * (- skip - index - HP_ACC_VBASE_START), NULL);
+  vp = value_at (builtin_type_int, vtbl + 4 * (-skip - index - HP_ACC_VBASE_START), NULL);
   boffset = value_as_long (vp);
   *skip_p = -1;
   *boffset_p = boffset;
@@ -2200,20 +2207,20 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type)
     {
       char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
       /* FIXME!  May need to check for ARM demangling here */
-      if (strncmp(t_field_name, "__", 2)==0 ||
-       strncmp(t_field_name, "op", 2)==0 ||
-       strncmp(t_field_name, "type", 4)==0 )
+      if (strncmp (t_field_name, "__", 2) == 0 ||
+         strncmp (t_field_name, "op", 2) == 0 ||
+         strncmp (t_field_name, "type", 4) == 0)
        {
-         if (cplus_demangle_opname(t_field_name, dem_opname, DMGL_ANSI))
+         if (cplus_demangle_opname (t_field_name, dem_opname, DMGL_ANSI))
+           t_field_name = dem_opname;
+         else if (cplus_demangle_opname (t_field_name, dem_opname, 0))
            t_field_name = dem_opname;
-         else if (cplus_demangle_opname(t_field_name, dem_opname, 0))
-           t_field_name = dem_opname; 
        }
       if (t_field_name && STREQ (t_field_name, name))
        {
          int j = TYPE_FN_FIELDLIST_LENGTH (type, i) - 1;
          struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
-         name_matched = 1; 
+         name_matched = 1;
 
          if (j > 0 && args == 0)
            error ("cannot resolve overloaded method `%s': no arguments supplied", name);
@@ -2229,7 +2236,8 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type)
                  if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp)
                    *static_memfuncp = 1;
                  v = value_fn_field (arg1p, f, j, type, offset);
-                 if (v != NULL) return v;
+                 if (v != NULL)
+                   return v;
                }
              j--;
            }
@@ -2242,66 +2250,68 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type)
 
       if (BASETYPE_VIA_VIRTUAL (type, i))
        {
-         if (TYPE_HAS_VTABLE (type))
-            {
-              /* HP aCC compiled type, search for virtual base offset
-                 according to HP/Taligent runtime spec.  */
-              int skip;
-              find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
-                                    VALUE_CONTENTS_ALL (*arg1p),
-                                    offset + VALUE_EMBEDDED_OFFSET (*arg1p),
-                                    &base_offset, &skip);
-              if (skip >= 0)
-                error ("Virtual base class offset not found in vtable");
-            }
-         else
-           {
-             struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
-            char *base_valaddr;
-
-            /* The virtual base class pointer might have been clobbered by the
-               user program. Make sure that it still points to a valid memory
-               location.  */
-
-            if (offset < 0 || offset >= TYPE_LENGTH (type))
-              {
-                base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
-                if (target_read_memory (VALUE_ADDRESS (*arg1p)
-                                        + VALUE_OFFSET (*arg1p) + offset,
-                                        base_valaddr,
-                                        TYPE_LENGTH (baseclass)) != 0)
-                  error ("virtual baseclass botch");
-              }
-           else
-              base_valaddr = VALUE_CONTENTS (*arg1p) + offset;
-
-           base_offset =
-              baseclass_offset (type, i, base_valaddr,
-                                VALUE_ADDRESS (*arg1p)
-                                  + VALUE_OFFSET (*arg1p) + offset);
-           if (base_offset == -1)
-              error ("virtual baseclass botch");
-          }
-        }
+         if (TYPE_HAS_VTABLE (type))
+           {
+             /* HP aCC compiled type, search for virtual base offset
+                according to HP/Taligent runtime spec.  */
+             int skip;
+             find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
+                                   VALUE_CONTENTS_ALL (*arg1p),
+                                   offset + VALUE_EMBEDDED_OFFSET (*arg1p),
+                                   &base_offset, &skip);
+             if (skip >= 0)
+               error ("Virtual base class offset not found in vtable");
+           }
+         else
+           {
+             struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+             char *base_valaddr;
+
+             /* The virtual base class pointer might have been clobbered by the
+                user program. Make sure that it still points to a valid memory
+                location.  */
+
+             if (offset < 0 || offset >= TYPE_LENGTH (type))
+               {
+                 base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
+                 if (target_read_memory (VALUE_ADDRESS (*arg1p)
+                                         + VALUE_OFFSET (*arg1p) + offset,
+                                         base_valaddr,
+                                         TYPE_LENGTH (baseclass)) != 0)
+                   error ("virtual baseclass botch");
+               }
+             else
+               base_valaddr = VALUE_CONTENTS (*arg1p) + offset;
+
+             base_offset =
+               baseclass_offset (type, i, base_valaddr,
+                                 VALUE_ADDRESS (*arg1p)
+                                 + VALUE_OFFSET (*arg1p) + offset);
+             if (base_offset == -1)
+               error ("virtual baseclass botch");
+           }
+       }
       else
        {
          base_offset = TYPE_BASECLASS_BITPOS (type, i) / 8;
-        }
+       }
       v = search_struct_method (name, arg1p, args, base_offset + offset,
                                static_memfuncp, TYPE_BASECLASS (type, i));
-      if (v == (value_ptr) -1)
+      if (v == (value_ptr) - 1)
        {
          name_matched = 1;
        }
       else if (v)
        {
 /* FIXME-bothner:  Why is this commented out?  Why is it here?  */
-/*       *arg1p = arg1_tmp;*/
+/*        *arg1p = arg1_tmp; */
          return v;
-        }
+       }
     }
-  if (name_matched) return (value_ptr) -1;
-  else return NULL;
+  if (name_matched)
+    return (value_ptr) - 1;
+  else
+    return NULL;
 }
 
 /* Given *ARGP, a value of type (pointer to a)* structure/union,
@@ -2346,20 +2356,20 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
   if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
     error ("not implemented: member type in value_struct_elt");
 
-  if (   TYPE_CODE (t) != TYPE_CODE_STRUCT
+  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);
 
   /* Assume it's not, unless we see that it is.  */
   if (static_memfuncp)
-    *static_memfuncp =0;
+    *static_memfuncp = 0;
 
   if (!args)
     {
       /* if there are no arguments ...do this...  */
 
       /* Try as a field first, because if we succeed, there
-        is less work to be done.  */
+         is less work to be done.  */
       v = search_struct_field (name, *argp, 0, t, 0);
       if (v)
        return v;
@@ -2372,7 +2382,7 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
 
       v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
 
-      if (v == (value_ptr) -1)
+      if (v == (value_ptr) - 1)
        error ("Cannot take address of a method");
       else if (v == 0)
        {
@@ -2410,15 +2420,15 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
   else
     v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
 
-  if (v == (value_ptr) -1)
+  if (v == (value_ptr) - 1)
     {
-       error("Argument list of %s mismatch with component in the structure.", name);
+      error ("Argument list of %s mismatch with component in the structure.", name);
     }
   else if (v == 0)
     {
       /* See if user tried to invoke data as function.  If so,
-        hand it back.  If it's not callable (i.e., a pointer to function),
-        gdb should give an error.  */
+         hand it back.  If it's not callable (i.e., a pointer to function),
+         gdb should give an error.  */
       v = search_struct_field (name, *argp, 0, t, 0);
     }
 
@@ -2443,74 +2453,75 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
 static struct fn_field *
 find_method_list (argp, method, offset, static_memfuncp, type, num_fns, basetype, boffset)
      value_ptr *argp;
-     char * method;
+     char *method;
      int offset;
-     int * static_memfuncp;
-     struct type * type;
-     int * num_fns;
-     struct type ** basetype;
-     int * boffset;
+     int *static_memfuncp;
+     struct type *type;
+     int *num_fns;
+     struct type **basetype;
+     int *boffset;
 {
   int i;
-  struct fn_field * f;
+  struct fn_field *f;
   CHECK_TYPEDEF (type);
 
   *num_fns = 0;
 
-  /* First check in object itself */ 
-  for (i = TYPE_NFN_FIELDS (type) -1; i >= 0; i--)
+  /* First check in object itself */
+  for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
     {
       /* pai: FIXME What about operators and type conversions? */
-      char * fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+      char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
       if (fn_field_name && STREQ (fn_field_name, method))
-        {
-          *num_fns = TYPE_FN_FIELDLIST_LENGTH (type, i);
-          *basetype = type;
-          *boffset = offset;
-          return TYPE_FN_FIELDLIST1 (type, i);
-        }
-    }
-  
+       {
+         *num_fns = TYPE_FN_FIELDLIST_LENGTH (type, i);
+         *basetype = type;
+         *boffset = offset;
+         return TYPE_FN_FIELDLIST1 (type, i);
+       }
+    }
+
   /* Not found in object, check in base subobjects */
   for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
     {
       int base_offset;
       if (BASETYPE_VIA_VIRTUAL (type, i))
        {
-          if (TYPE_HAS_VTABLE (type))
-            {
-              /* HP aCC compiled type, search for virtual base offset
-               * according to HP/Taligent runtime spec.  */
-              int skip;
-              find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
-                                    VALUE_CONTENTS_ALL (*argp),
-                                    offset + VALUE_EMBEDDED_OFFSET (*argp),
-                                    &base_offset, &skip);
-              if (skip >= 0)
-                error ("Virtual base class offset not found in vtable");
-            }
-          else
-            {
-              /* probably g++ runtime model */ 
-              base_offset = VALUE_OFFSET (*argp) + offset;
-              base_offset =
-                baseclass_offset (type, i,
-                                  VALUE_CONTENTS (*argp) + base_offset,
-                                  VALUE_ADDRESS (*argp) + base_offset);
-              if (base_offset == -1)
-                error ("virtual baseclass botch");
-            }
-        }
-      else /* non-virtual base, simply use bit position from debug info */
+         if (TYPE_HAS_VTABLE (type))
+           {
+             /* HP aCC compiled type, search for virtual base offset
+              * according to HP/Taligent runtime spec.  */
+             int skip;
+             find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
+                                   VALUE_CONTENTS_ALL (*argp),
+                                   offset + VALUE_EMBEDDED_OFFSET (*argp),
+                                   &base_offset, &skip);
+             if (skip >= 0)
+               error ("Virtual base class offset not found in vtable");
+           }
+         else
+           {
+             /* probably g++ runtime model */
+             base_offset = VALUE_OFFSET (*argp) + offset;
+             base_offset =
+               baseclass_offset (type, i,
+                                 VALUE_CONTENTS (*argp) + base_offset,
+                                 VALUE_ADDRESS (*argp) + base_offset);
+             if (base_offset == -1)
+               error ("virtual baseclass botch");
+           }
+       }
+      else
+       /* non-virtual base, simply use bit position from debug info */
        {
          base_offset = TYPE_BASECLASS_BITPOS (type, i) / 8;
-        }
+       }
       f = find_method_list (argp, method, base_offset + offset,
-                            static_memfuncp, TYPE_BASECLASS (type, i), num_fns, basetype, boffset);
+      static_memfuncp, TYPE_BASECLASS (type, i), num_fns, basetype, boffset);
       if (f)
-        return f;
+       return f;
     }
-  return NULL;  
+  return NULL;
 }
 
 /* Return the list of overloaded methods of a specified name.
@@ -2524,20 +2535,20 @@ find_method_list (argp, method, offset, static_memfuncp, type, num_fns, basetype
 
 struct fn_field *
 value_find_oload_method_list (argp, method, offset, static_memfuncp, num_fns, basetype, boffset)
-  value_ptr *argp;
-  char * method;
-  int offset;
-  int * static_memfuncp;
-  int * num_fns;
-  struct type ** basetype;
-  int * boffset;
+     value_ptr *argp;
+     char *method;
+     int offset;
+     int *static_memfuncp;
+     int *num_fns;
+     struct type **basetype;
+     int *boffset;
 {
-  struct type * t;
+  struct type *t;
   value_ptr v;
 
   t = check_typedef (VALUE_TYPE (*argp));
 
-  /* code snarfed from value_struct_elt */ 
+  /* code snarfed from value_struct_elt */
   while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF)
     {
       *argp = value_ind (*argp);
@@ -2546,20 +2557,20 @@ value_find_oload_method_list (argp, method, offset, static_memfuncp, num_fns, ba
        COERCE_ARRAY (*argp);
       t = check_typedef (VALUE_TYPE (*argp));
     }
-  
+
   if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
     error ("Not implemented: member type in value_find_oload_lis");
-  
-  if (   TYPE_CODE (t) != TYPE_CODE_STRUCT
-         && TYPE_CODE (t) != TYPE_CODE_UNION)
+
+  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 struct or union");
-  
+
   /* Assume it's not static, unless we see that it is.  */
   if (static_memfuncp)
-    *static_memfuncp =0;
+    *static_memfuncp = 0;
 
   return find_method_list (argp, method, 0, static_memfuncp, t, num_fns, basetype, boffset);
-  
+
 }
 
 /* Given an array of argument types (ARGTYPES) (which includes an
@@ -2588,46 +2599,46 @@ value_find_oload_method_list (argp, method, offset, static_memfuncp, num_fns, ba
    Note: This function does *not* check the value of
    overload_resolution.  Caller must check it to see whether overload
    resolution is permitted.
  */
+ */
 
 int
 find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp, staticp)
-  struct type ** arg_types;
-  int nargs;
-  char * name;
-  int method;
-  int lax;
-  value_ptr obj;
-  struct symbol * fsym;
-  value_ptr * valp;
-  struct symbol ** symp;
-  int * staticp;
+     struct type **arg_types;
+     int nargs;
+     char *name;
+     int method;
+     int lax;
+     value_ptr obj;
+     struct symbol *fsym;
+     value_ptr *valp;
+     struct symbol **symp;
+     int *staticp;
 {
   int nparms;
-  struct type ** parm_types;
+  struct type **parm_types;
   int champ_nparms = 0;
-  
-  short oload_champ = -1;          /* Index of best overloaded function */
-  short oload_ambiguous = 0;       /* Current ambiguity state for overload resolution */
-                                   /* 0 => no ambiguity, 1 => two good funcs, 2 => incomparable funcs */
-  short oload_ambig_champ = -1;    /* 2nd contender for best match */ 
-  short oload_non_standard = 0;    /* did we have to use non-standard conversions? */ 
-  short oload_incompatible = 0;    /* are args supplied incompatible with any function? */
-  
-  struct badness_vector * bv;      /* A measure of how good an overloaded instance is */ 
-  struct badness_vector * oload_champ_bv = NULL; /* The measure for the current best match */ 
-  
+
+  short oload_champ = -1;      /* Index of best overloaded function */
+  short oload_ambiguous = 0;   /* Current ambiguity state for overload resolution */
+  /* 0 => no ambiguity, 1 => two good funcs, 2 => incomparable funcs */
+  short oload_ambig_champ = -1;        /* 2nd contender for best match */
+  short oload_non_standard = 0;        /* did we have to use non-standard conversions? */
+  short oload_incompatible = 0;        /* are args supplied incompatible with any function? */
+
+  struct badness_vector *bv;   /* A measure of how good an overloaded instance is */
+  struct badness_vector *oload_champ_bv = NULL;                /* The measure for the current best match */
+
   value_ptr temp = obj;
-  struct fn_field * fns_ptr = NULL;   /* For methods, the list of overloaded methods */ 
-  struct symbol ** oload_syms = NULL; /* For non-methods, the list of overloaded function symbols */
-  int num_fns = 0;                    /* Number of overloaded instances being considered */ 
-  struct type * basetype = NULL;   
+  struct fn_field *fns_ptr = NULL;     /* For methods, the list of overloaded methods */
+  struct symbol **oload_syms = NULL;   /* For non-methods, the list of overloaded function symbols */
+  int num_fns = 0;             /* Number of overloaded instances being considered */
+  struct type *basetype = NULL;
   int boffset;
   register int jj;
   register int ix;
 
-  char * obj_type_name = NULL;
-  char * func_name = NULL;
+  char *obj_type_name = NULL;
+  char *func_name = NULL;
 
   /* Get the list of overloaded methods or functions */
   if (method)
@@ -2636,18 +2647,18 @@ find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp,
       /* Hack: evaluate_subexp_standard often passes in a pointer
          value rather than the object itself, so try again */
       if ((!obj_type_name || !*obj_type_name) &&
-          (TYPE_CODE (VALUE_TYPE (obj)) == TYPE_CODE_PTR))
-        obj_type_name = TYPE_NAME (TYPE_TARGET_TYPE (VALUE_TYPE (obj)));
+         (TYPE_CODE (VALUE_TYPE (obj)) == TYPE_CODE_PTR))
+       obj_type_name = TYPE_NAME (TYPE_TARGET_TYPE (VALUE_TYPE (obj)));
 
       fns_ptr = value_find_oload_method_list (&temp, name, 0,
-                                              staticp,
-                                              &num_fns,
-                                              &basetype, &boffset);
+                                             staticp,
+                                             &num_fns,
+                                             &basetype, &boffset);
       if (!fns_ptr || !num_fns)
-        error ("Couldn't find method %s%s%s",
-               obj_type_name,
-               (obj_type_name && *obj_type_name) ? "::" : "",
-               name);
+       error ("Couldn't find method %s%s%s",
+              obj_type_name,
+              (obj_type_name && *obj_type_name) ? "::" : "",
+              name);
     }
   else
     {
@@ -2656,126 +2667,126 @@ find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp,
 
       oload_syms = make_symbol_overload_list (fsym);
       while (oload_syms[++i])
-        num_fns++;
+       num_fns++;
       if (!num_fns)
-        error ("Couldn't find function %s", func_name);
+       error ("Couldn't find function %s", func_name);
     }
-  
+
   oload_champ_bv = NULL;
 
-  /* Consider each candidate in turn */ 
+  /* Consider each candidate in turn */
   for (ix = 0; ix < num_fns; ix++)
     {
       int jj;
 
-      /* Number of parameters for current candidate */ 
+      /* Number of parameters for current candidate */
       nparms = method ? TYPE_NFIELDS (fns_ptr[ix].type)
-                      : TYPE_NFIELDS (SYMBOL_TYPE (oload_syms[ix]));
+       : TYPE_NFIELDS (SYMBOL_TYPE (oload_syms[ix]));
 
-      /* Prepare array of parameter types */ 
+      /* Prepare array of parameter types */
       parm_types = (struct type **) xmalloc (nparms * (sizeof (struct type *)));
       for (jj = 0; jj < nparms; jj++)
-        parm_types[jj] = method ? TYPE_FIELD_TYPE (fns_ptr[ix].type, jj)
-                                : TYPE_FIELD_TYPE (SYMBOL_TYPE (oload_syms[ix]), jj);
+       parm_types[jj] = method ? TYPE_FIELD_TYPE (fns_ptr[ix].type, jj)
+         : TYPE_FIELD_TYPE (SYMBOL_TYPE (oload_syms[ix]), jj);
 
       /* Compare parameter types to supplied argument types */
       bv = rank_function (parm_types, nparms, arg_types, nargs);
-      
+
       if (!oload_champ_bv)
-        {
-          oload_champ_bv = bv;
-          oload_champ = 0;
-          champ_nparms = nparms;
-        }
+       {
+         oload_champ_bv = bv;
+         oload_champ = 0;
+         champ_nparms = nparms;
+       }
       else
-        /* See whether current candidate is better or worse than previous best */ 
-        switch (compare_badness (bv, oload_champ_bv))
-          {
-            case 0:
-              oload_ambiguous = 1;    /* top two contenders are equally good */ 
-              oload_ambig_champ = ix;
-              break;
-            case 1:
-              oload_ambiguous = 2;    /* incomparable top contenders */ 
-              oload_ambig_champ = ix;
-              break;
-            case 2:
-              oload_champ_bv = bv;    /* new champion, record details */ 
-              oload_ambiguous = 0;
-              oload_champ = ix;
-              oload_ambig_champ = -1;
-              champ_nparms = nparms;
-              break;
-            case 3:
-            default:
-              break;
-          }
+       /* See whether current candidate is better or worse than previous best */
+       switch (compare_badness (bv, oload_champ_bv))
+         {
+         case 0:
+           oload_ambiguous = 1;        /* top two contenders are equally good */
+           oload_ambig_champ = ix;
+           break;
+         case 1:
+           oload_ambiguous = 2;        /* incomparable top contenders */
+           oload_ambig_champ = ix;
+           break;
+         case 2:
+           oload_champ_bv = bv;        /* new champion, record details */
+           oload_ambiguous = 0;
+           oload_champ = ix;
+           oload_ambig_champ = -1;
+           champ_nparms = nparms;
+           break;
+         case 3:
+         default:
+           break;
+         }
       free (parm_types);
 #ifdef DEBUG_OLOAD
       if (method)
-        printf("Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
+       printf ("Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
       else
-        printf("Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME(oload_syms[ix]),nparms); 
+       printf ("Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME (oload_syms[ix]), nparms);
       for (jj = 0; jj <= nargs; jj++)
-        printf("...Badness @ %d : %d\n", jj, bv->rank[jj]);
-      printf("Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
+       printf ("...Badness @ %d : %d\n", jj, bv->rank[jj]);
+      printf ("Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
 #endif
-    } /* end loop over all candidates */ 
+    }                          /* end loop over all candidates */
 
   if (oload_ambiguous)
     {
       if (method)
-        error ("Cannot resolve overloaded method %s%s%s to unique instance; disambiguate by specifying function signature",
-               obj_type_name,
-               (obj_type_name && *obj_type_name) ? "::" : "",
-               name);
+       error ("Cannot resolve overloaded method %s%s%s to unique instance; disambiguate by specifying function signature",
+              obj_type_name,
+              (obj_type_name && *obj_type_name) ? "::" : "",
+              name);
       else
-        error ("Cannot resolve overloaded function %s to unique instance; disambiguate by specifying function signature",
-               func_name);
+       error ("Cannot resolve overloaded function %s to unique instance; disambiguate by specifying function signature",
+              func_name);
     }
 
-  /* Check how bad the best match is */ 
+  /* Check how bad the best match is */
   for (ix = 1; ix <= nargs; ix++)
     {
       switch (oload_champ_bv->rank[ix])
-        {
-          case 10:
-            oload_non_standard = 1;  /* non-standard type conversions needed */ 
-            break;
-          case 100:
-            oload_incompatible = 1;  /* truly mismatched types */ 
-            break;
-        }
+       {
+       case 10:
+         oload_non_standard = 1;       /* non-standard type conversions needed */
+         break;
+       case 100:
+         oload_incompatible = 1;       /* truly mismatched types */
+         break;
+       }
     }
   if (oload_incompatible)
     {
       if (method)
-        error ("Cannot resolve method %s%s%s to any overloaded instance",
-               obj_type_name,
-               (obj_type_name && *obj_type_name) ? "::" : "",
-               name);
+       error ("Cannot resolve method %s%s%s to any overloaded instance",
+              obj_type_name,
+              (obj_type_name && *obj_type_name) ? "::" : "",
+              name);
       else
-        error ("Cannot resolve function %s to any overloaded instance",
-               func_name);
+       error ("Cannot resolve function %s to any overloaded instance",
+              func_name);
     }
   else if (oload_non_standard)
     {
       if (method)
-        warning ("Using non-standard conversion to match method %s%s%s to supplied arguments",
-                 obj_type_name,
-                 (obj_type_name && *obj_type_name) ? "::" : "",
-                 name);
+       warning ("Using non-standard conversion to match method %s%s%s to supplied arguments",
+                obj_type_name,
+                (obj_type_name && *obj_type_name) ? "::" : "",
+                name);
       else
-        warning ("Using non-standard conversion to match function %s to supplied arguments",
-                 func_name);
+       warning ("Using non-standard conversion to match function %s to supplied arguments",
+                func_name);
     }
 
   if (method)
     {
       if (TYPE_FN_FIELD_VIRTUAL_P (fns_ptr, oload_champ))
-        *valp = value_virtual_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
+       *valp = value_virtual_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
       else
-        *valp = value_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
+       *valp = value_fn_field (&temp, fns_ptr, oload_champ, basetype, boffset);
     }
   else
     {
@@ -2853,7 +2864,7 @@ check_field_in (type, name)
   for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
     if (check_field_in (TYPE_BASECLASS (type, i), name))
       return 1;
-      
+
   return 0;
 }
 
@@ -2886,7 +2897,7 @@ check_field (arg1, name)
   if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
     error ("not implemented: member type in check_field");
 
-  if (   TYPE_CODE (t) != TYPE_CODE_STRUCT
+  if (TYPE_CODE (t) != TYPE_CODE_STRUCT
       && TYPE_CODE (t) != TYPE_CODE_UNION)
     error ("Internal error: `this' is not an aggregate");
 
@@ -2910,14 +2921,14 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
   register int i;
   value_ptr v;
 
-  if (   TYPE_CODE (t) != TYPE_CODE_STRUCT
+  if (TYPE_CODE (t) != TYPE_CODE_STRUCT
       && TYPE_CODE (t) != TYPE_CODE_UNION)
     error ("Internal error: non-aggregate type to value_struct_elt_for_reference");
 
   for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--)
     {
       char *t_field_name = TYPE_FIELD_NAME (t, i);
-      
+
       if (t_field_name && STREQ (t_field_name, name))
        {
          if (TYPE_FIELD_STATIC (t, i))
@@ -2930,7 +2941,7 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
            }
          if (TYPE_FIELD_PACKED (t, i))
            error ("pointers to bitfield members not allowed");
-         
+
          return value_from_longest
            (lookup_reference_type (lookup_member_type (TYPE_FIELD_TYPE (t, i),
                                                        domain)),
@@ -2956,20 +2967,20 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
       char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i);
       char dem_opname[64];
 
-      if (strncmp(t_field_name, "__", 2)==0 ||
-       strncmp(t_field_name, "op", 2)==0 ||
-       strncmp(t_field_name, "type", 4)==0 )
+      if (strncmp (t_field_name, "__", 2) == 0 ||
+         strncmp (t_field_name, "op", 2) == 0 ||
+         strncmp (t_field_name, "type", 4) == 0)
        {
-         if (cplus_demangle_opname(t_field_name, dem_opname, DMGL_ANSI))
+         if (cplus_demangle_opname (t_field_name, dem_opname, DMGL_ANSI))
+           t_field_name = dem_opname;
+         else if (cplus_demangle_opname (t_field_name, dem_opname, 0))
            t_field_name = dem_opname;
-         else if (cplus_demangle_opname(t_field_name, dem_opname, 0))
-           t_field_name = dem_opname; 
        }
       if (t_field_name && STREQ (t_field_name, name))
        {
          int j = TYPE_FN_FIELDLIST_LENGTH (t, i);
          struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i);
-         
+
          if (intype == 0 && j > 1)
            error ("non-unique member `%s' requires type instantiation", name);
          if (intype)
@@ -2982,7 +2993,7 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
            }
          else
            j = 0;
-         
+
          if (TYPE_FN_FIELD_STUB (f, j))
            check_stub_method (t, i, j);
          if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
@@ -3055,13 +3066,13 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
 
 struct type *
 value_rtti_type (v, full, top, using_enc)
-  value_ptr v;
-  int * full;
-  int * top;
-  int * using_enc;
+     value_ptr v;
+     int *full;
+     int *top;
+     int *using_enc;
 {
-  struct type * known_type;
-  struct type * rtti_type;
+  struct type *known_type;
+  struct type *rtti_type;
   CORE_ADDR coreptr;
   value_ptr vp;
   int using_enclosing = 0;
@@ -3075,10 +3086,10 @@ value_rtti_type (v, full, top, using_enc)
   if (using_enc)
     *using_enc = 0;
 
-  /* Get declared type */ 
+  /* Get declared type */
   known_type = VALUE_TYPE (v);
   CHECK_TYPEDEF (known_type);
-  /* RTTI works only or class objects */ 
+  /* RTTI works only or class objects */
   if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
     return NULL;
 
@@ -3090,8 +3101,8 @@ value_rtti_type (v, full, top, using_enc)
       known_type = VALUE_ENCLOSING_TYPE (v);
       CHECK_TYPEDEF (known_type);
       if ((TYPE_CODE (known_type) != TYPE_CODE_CLASS) ||
-          !TYPE_HAS_VTABLE (known_type))
-        return NULL; /* No RTTI, or not HP-compiled types */
+         !TYPE_HAS_VTABLE (known_type))
+       return NULL;            /* No RTTI, or not HP-compiled types */
       CHECK_TYPEDEF (known_type);
       using_enclosing = 1;
     }
@@ -3100,17 +3111,17 @@ value_rtti_type (v, full, top, using_enc)
     *using_enc = 1;
 
   /* First get the virtual table address */
-  coreptr = * (CORE_ADDR *) ((VALUE_CONTENTS_ALL (v))
-                             + VALUE_OFFSET (v) 
-                             + (using_enclosing ? 0 : VALUE_EMBEDDED_OFFSET (v)));
+  coreptr = *(CORE_ADDR *) ((VALUE_CONTENTS_ALL (v))
+                           + VALUE_OFFSET (v)
+                      + (using_enclosing ? 0 : VALUE_EMBEDDED_OFFSET (v)));
   if (coreptr == 0)
-    return NULL; /* return silently -- maybe called on gdb-generated value */
+    return NULL;               /* return silently -- maybe called on gdb-generated value */
 
-  /* Fetch the top offset of the object */ 
+  /* Fetch the top offset of the object */
   /* FIXME possible 32x64 problem with pointer size & arithmetic */
-  vp = value_at (builtin_type_int, 
-                 coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET, 
-                 VALUE_BFD_SECTION (v));
+  vp = value_at (builtin_type_int,
+                coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET,
+                VALUE_BFD_SECTION (v));
   top_offset = value_as_long (vp);
   if (top)
     *top = top_offset;
@@ -3120,48 +3131,48 @@ value_rtti_type (v, full, top, using_enc)
   vp = value_at (builtin_type_int, coreptr + 4 * HP_ACC_TYPEINFO_OFFSET, VALUE_BFD_SECTION (v));
   /* Indirect through the typeinfo pointer and retrieve the pointer
    * to the string name */
-  coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
+  coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
   if (!coreptr)
     error ("Retrieved null typeinfo pointer in trying to determine run-time type");
-  vp = value_at (builtin_type_int, coreptr + 4, VALUE_BFD_SECTION (v));  /* 4 -> offset of name field */
-                                                  /* FIXME possible 32x64 problem */
+  vp = value_at (builtin_type_int, coreptr + 4, VALUE_BFD_SECTION (v));                /* 4 -> offset of name field */
+  /* FIXME possible 32x64 problem */
 
-  coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
+  coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
 
   read_memory_string (coreptr, rtti_type_name, 256);
 
   if (strlen (rtti_type_name) == 0)
     error ("Retrieved null type name from typeinfo");
-  
+
   /* search for type */
   rtti_type = lookup_typename (rtti_type_name, (struct block *) 0, 1);
-  
+
   if (!rtti_type)
     error ("Could not find run-time type: invalid type name %s in typeinfo??", rtti_type_name);
   CHECK_TYPEDEF (rtti_type);
 
-#if 0 /* debugging*/
-  printf("RTTI type name %s, tag %s, full? %d\n", TYPE_NAME (rtti_type), TYPE_TAG_NAME (rtti_type), full ? *full : -1); 
+#if 0                          /* debugging */
+  printf ("RTTI type name %s, tag %s, full? %d\n", TYPE_NAME (rtti_type), TYPE_TAG_NAME (rtti_type), full ? *full : -1);
 #endif
 
   /* Check whether we have the entire object */
-  if (full /* Non-null pointer passed */ 
+  if (full                     /* Non-null pointer passed */
 
       &&
-           /* Either we checked on the whole object in hand and found the
-              top offset to be zero */
-      (((top_offset == 0) &&         
-       using_enclosing &&     
-       TYPE_LENGTH (known_type) == TYPE_LENGTH (rtti_type))
-      ||
-           /* Or we checked on the embedded object and top offset was the
-              same as the embedded offset */
-      ((top_offset == VALUE_EMBEDDED_OFFSET (v)) &&
-       !using_enclosing &&
-       TYPE_LENGTH (VALUE_ENCLOSING_TYPE (v)) == TYPE_LENGTH (rtti_type))))
-    
+  /* Either we checked on the whole object in hand and found the
+     top offset to be zero */
+      (((top_offset == 0) &&
+       using_enclosing &&
+       TYPE_LENGTH (known_type) == TYPE_LENGTH (rtti_type))
+       ||
+  /* Or we checked on the embedded object and top offset was the
+     same as the embedded offset */
+       ((top_offset == VALUE_EMBEDDED_OFFSET (v)) &&
+       !using_enclosing &&
+       TYPE_LENGTH (VALUE_ENCLOSING_TYPE (v)) == TYPE_LENGTH (rtti_type))))
+
     *full = 1;
-  
+
   return rtti_type;
 }
 
@@ -3172,10 +3183,10 @@ value_rtti_type (v, full, top, using_enc)
 
 struct type *
 value_rtti_target_type (v, full, top, using_enc)
-  value_ptr v;
-  int * full;
-  int * top;
-  int * using_enc;
+     value_ptr v;
+     int *full;
+     int *top;
+     int *using_enc;
 {
   value_ptr target;
 
@@ -3196,14 +3207,14 @@ value_rtti_target_type (v, full, top, using_enc)
 
 value_ptr
 value_full_object (argp, rtype, xfull, xtop, xusing_enc)
-  value_ptr argp;
-  struct type * rtype;
-  int xfull;
-  int xtop;
-  int xusing_enc;
-  
+     value_ptr argp;
+     struct type *rtype;
+     int xfull;
+     int xtop;
+     int xusing_enc;
+
 {
-  struct type * real_type;
+  struct type *real_type;
   int full = 0;
   int top = -1;
   int using_enc = 0;
@@ -3224,7 +3235,7 @@ value_full_object (argp, rtype, xfull, xtop, xusing_enc)
     return argp;
 
   /* If we have the full object, but for some reason the enclosing
-     type is wrong, set it */ /* pai: FIXME -- sounds iffy */
+     type is wrong, set it *//* pai: FIXME -- sounds iffy */
   if (full)
     {
       VALUE_ENCLOSING_TYPE (argp) = real_type;
@@ -3235,17 +3246,17 @@ value_full_object (argp, rtype, xfull, xtop, xusing_enc)
   if (VALUE_LVAL (argp) != lval_memory)
     {
       warning ("Couldn't retrieve complete object of RTTI type %s; object may be in register(s).", TYPE_NAME (real_type));
-      
+
       return argp;
     }
-  
+
   /* All other cases -- retrieve the complete object */
   /* Go back by the computed top_offset from the beginning of the object,
      adjusting for the embedded offset of argp if that's what value_rtti_type
      used for its computation. */
   new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
-                           (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)), 
-                           VALUE_BFD_SECTION (argp));
+                          (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)),
+                          VALUE_BFD_SECTION (argp));
   VALUE_TYPE (new_val) = VALUE_TYPE (argp);
   VALUE_EMBEDDED_OFFSET (new_val) = using_enc ? top + VALUE_EMBEDDED_OFFSET (argp) : top;
   return new_val;
@@ -3271,8 +3282,9 @@ value_of_this (complain)
   if (selected_frame == 0)
     {
       if (complain)
-        error ("no frame selected");
-      else return 0;
+       error ("no frame selected");
+      else
+       return 0;
     }
 
   func = get_frame_function (selected_frame);
@@ -3280,7 +3292,8 @@ value_of_this (complain)
     {
       if (complain)
        error ("no `this' in nameless context");
-      else return 0;
+      else
+       return 0;
     }
 
   b = SYMBOL_BLOCK_VALUE (func);
@@ -3288,8 +3301,9 @@ value_of_this (complain)
   if (i <= 0)
     {
       if (complain)
-        error ("no args, no `this'");
-      else return 0;
+       error ("no args, no `this'");
+      else
+       return 0;
     }
 
   /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
@@ -3333,19 +3347,19 @@ value_slice (array, lowbound, length)
     error ("slice from bad array or bitstring");
   if (lowbound < lowerbound || length < 0
       || lowbound + length - 1 > upperbound
-      /* Chill allows zero-length strings but not arrays. */
+  /* Chill allows zero-length strings but not arrays. */
       || (current_language->la_language == language_chill
          && 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.  */
-  slice_range_type = create_range_type ((struct type*) NULL,
+  slice_range_type = create_range_type ((struct type *) NULL,
                                        TYPE_TARGET_TYPE (range_type),
                                        lowbound, lowbound + length - 1);
   if (TYPE_CODE (array_type) == TYPE_CODE_BITSTRING)
     {
       int i;
-      slice_type = create_set_type ((struct type*) NULL, slice_range_type);
+      slice_type = create_set_type ((struct type *) NULL, slice_range_type);
       TYPE_CODE (slice_type) = TYPE_CODE_BITSTRING;
       slice = value_zero (slice_type, not_lval);
       for (i = 0; i < length; i++)
@@ -3364,15 +3378,15 @@ value_slice (array, lowbound, length)
            }
        }
       /* We should set the address, bitssize, and bitspos, so the clice
-        can be used on the LHS, but that may require extensions to
-        value_assign.  For now, just leave as a non_lval.  FIXME.  */
+         can be used on the LHS, but that may require extensions to
+         value_assign.  For now, just leave as a non_lval.  FIXME.  */
     }
   else
     {
       struct type *element_type = TYPE_TARGET_TYPE (array_type);
       offset
        = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
-      slice_type = create_array_type ((struct type*) NULL, element_type,
+      slice_type = create_array_type ((struct type *) NULL, element_type,
                                      slice_range_type);
       TYPE_CODE (slice_type) = TYPE_CODE (array_type);
       slice = allocate_value (slice_type);
@@ -3409,7 +3423,7 @@ varying_to_slice (varray)
    the time values are coerced to COMPLEX*16 (i.e. a complex number 
    composed of 2 doubles.  This really should be a smarter routine 
    that figures out precision inteligently as opposed to assuming 
-   doubles. FIXME: fmb */ 
+   doubles. FIXME: fmb */
 
 value_ptr
 value_literal_complex (arg1, arg2, type)
@@ -3449,7 +3463,7 @@ cast_into_complex (type, val)
              VALUE_CONTENTS (val), TYPE_LENGTH (val_real_type));
       memcpy (VALUE_CONTENTS_RAW (im_val),
              VALUE_CONTENTS (val) + TYPE_LENGTH (val_real_type),
-              TYPE_LENGTH (val_real_type));
+             TYPE_LENGTH (val_real_type));
 
       return value_literal_complex (re_val, im_val, type);
     }
@@ -3465,14 +3479,14 @@ _initialize_valops ()
 {
 #if 0
   add_show_from_set
-    (add_set_cmd ("abandon", class_support, var_boolean, (char *)&auto_abandon,
+    (add_set_cmd ("abandon", class_support, var_boolean, (char *) &auto_abandon,
                  "Set automatic abandonment of expressions upon failure.",
                  &setlist),
      &showlist);
 #endif
 
   add_show_from_set
-    (add_set_cmd ("overload-resolution", class_support, var_boolean, (char *)&overload_resolution,
+    (add_set_cmd ("overload-resolution", class_support, var_boolean, (char *) &overload_resolution,
                  "Set overload resolution in evaluating C++ functions.",
                  &setlist),
      &showlist);
index ddbbebbc21b53e9fef601dc087100b75fe9bb213..2f07114ff962697f2ad4d37fe887c56d0b5a08b9 100644 (file)
@@ -1,22 +1,23 @@
 /* Print values for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1998
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -36,8 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Prototypes for local functions */
 
-static void print_hex_chars PARAMS ((GDB_FILE *, unsigned char *, 
-                                     unsigned int));
+static void print_hex_chars PARAMS ((GDB_FILE *, unsigned char *,
+                                    unsigned int));
 
 static void show_print PARAMS ((char *, int));
 
@@ -97,8 +98,8 @@ int unionprint;                       /* Controls printing of nested unions.  */
 /* If nonzero, causes machine addresses to be printed in certain contexts. */
 
 int addressprint;              /* Controls printing of machine addresses */
-
 \f
+
 /* 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 using TYPE).
@@ -121,7 +122,7 @@ int addressprint;           /* Controls printing of machine addresses */
 
 int
 val_print (type, valaddr, embedded_offset, address,
-           stream, format, deref_ref, recurse, pretty)
+          stream, format, deref_ref, recurse, pretty)
      struct type *type;
      char *valaddr;
      int embedded_offset;
@@ -137,7 +138,7 @@ val_print (type, valaddr, embedded_offset, address,
     {
       pretty = prettyprint_structs ? Val_prettyprint : Val_no_prettyprint;
     }
-  
+
   QUIT;
 
   /* Ensure that the type is complete and not just a stub.  If the type is
@@ -150,9 +151,9 @@ val_print (type, valaddr, embedded_offset, address,
       gdb_flush (stream);
       return (0);
     }
-  
+
   return (LA_VAL_PRINT (type, valaddr, embedded_offset, address,
-                        stream, format, deref_ref, recurse, pretty));
+                       stream, format, deref_ref, recurse, pretty));
 }
 
 /* Print the value VAL in C-ish syntax on stream STREAM.
@@ -233,10 +234,10 @@ val_print_type_code_int (type, valaddr, stream)
    format it according to the current language (this should be used for most
    integers which GDB prints, the exception is things like protocols where
    the format of the integer is a protocol thing, not a user-visible thing).
  */
+ */
 
 #if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG)
-static void print_decimal PARAMS ((GDB_FILE *stream, char *sign, int use_local, ULONGEST val_ulong));
+static void print_decimal PARAMS ((GDB_FILE * stream, char *sign, int use_local, ULONGEST val_ulong));
 static void
 print_decimal (stream, sign, use_local, val_ulong)
      GDB_FILE *stream;
@@ -343,7 +344,7 @@ print_longest (stream, format, use_local, val_long)
     case 'd':
       fprintf_filtered (stream,
                        use_local ? local_decimal_format_custom ("ll")
-                                 : "%lld",
+                       : "%lld",
                        val_long);
       break;
     case 'u':
@@ -352,13 +353,13 @@ print_longest (stream, format, use_local, val_long)
     case 'x':
       fprintf_filtered (stream,
                        use_local ? local_hex_format_custom ("ll")
-                                 : "%llx",
+                       : "%llx",
                        val_long);
       break;
     case 'o':
       fprintf_filtered (stream,
                        use_local ? local_octal_format_custom ("ll")
-                                 : "%llo",
+                       : "%llo",
                        val_long);
       break;
     case 'b':
@@ -376,7 +377,7 @@ print_longest (stream, format, use_local, val_long)
     default:
       abort ();
     }
-#else /* !CC_HAS_LONG_LONG || !PRINTF_HAS_LONG_LONG*/
+#else /* !CC_HAS_LONG_LONG || !PRINTF_HAS_LONG_LONG */
   /* In the following it is important to coerce (val_long) to a long. It does
      nothing if !LONG_LONG, but it will chop off the top half (which we know
      we can ignore) if the host supports long longs.  */
@@ -386,7 +387,7 @@ print_longest (stream, format, use_local, val_long)
     case 'd':
       fprintf_filtered (stream,
                        use_local ? local_decimal_format_custom ("l")
-                                 : "%ld",
+                       : "%ld",
                        (long) val_long);
       break;
     case 'u':
@@ -395,13 +396,13 @@ print_longest (stream, format, use_local, val_long)
     case 'x':
       fprintf_filtered (stream,
                        use_local ? local_hex_format_custom ("l")
-                                 : "%lx",
+                       : "%lx",
                        (unsigned long) val_long);
       break;
     case 'o':
       fprintf_filtered (stream,
                        use_local ? local_octal_format_custom ("l")
-                                 : "%lo",
+                       : "%lo",
                        (unsigned long) val_long);
       break;
     case 'b':
@@ -442,7 +443,7 @@ strcat_longest (format, use_local, val_long, buf, buflen)
   vbot = (long) val_long;
 
   if ((format == 'd' && (val_long < INT_MIN || val_long > INT_MAX))
-      || ((format == 'u' || format == 'x') && (unsigned long long)val_long > UINT_MAX))
+      || ((format == 'u' || format == 'x') && (unsigned long long) val_long > UINT_MAX))
     {
       sprintf (buf, "0x%lx%08lx", vtop, vbot);
       return;
@@ -454,34 +455,34 @@ strcat_longest (format, use_local, val_long, buf, buflen)
     {
     case 'd':
       sprintf (buf,
-              (use_local ? local_decimal_format_custom ("ll") : "%lld"), 
+              (use_local ? local_decimal_format_custom ("ll") : "%lld"),
               val_long);
       break;
     case 'u':
-      sprintf (buf, "%llu",  val_long);
+      sprintf (buf, "%llu", val_long);
       break;
     case 'x':
       sprintf (buf,
-              (use_local ? local_hex_format_custom ("ll") : "%llx"), 
-                       
+              (use_local ? local_hex_format_custom ("ll") : "%llx"),
+
               val_long);
       break;
     case 'o':
       sprintf (buf,
-              (use_local ? local_octal_format_custom ("ll") : "%llo"), 
+              (use_local ? local_octal_format_custom ("ll") : "%llo"),
               val_long);
       break;
     case 'b':
-      sprintf (buf, local_hex_format_custom ("02ll"),  val_long);
+      sprintf (buf, local_hex_format_custom ("02ll"), val_long);
       break;
     case 'h':
-      sprintf (buf, local_hex_format_custom ("04ll"),  val_long);
+      sprintf (buf, local_hex_format_custom ("04ll"), val_long);
       break;
     case 'w':
-      sprintf (buf, local_hex_format_custom ("08ll"),  val_long);
+      sprintf (buf, local_hex_format_custom ("08ll"), val_long);
       break;
     case 'g':
-      sprintf (buf, local_hex_format_custom ("016ll"),  val_long);
+      sprintf (buf, local_hex_format_custom ("016ll"), val_long);
       break;
     default:
       abort ();
@@ -494,30 +495,30 @@ strcat_longest (format, use_local, val_long, buf, buflen)
   switch (format)
     {
     case 'd':
-      sprintf (buf, (use_local ? local_decimal_format_custom ("l") : "%ld"), 
-                                                                ((long) val_long));
+      sprintf (buf, (use_local ? local_decimal_format_custom ("l") : "%ld"),
+              ((long) val_long));
       break;
     case 'u':
-      sprintf (buf, "%lu",  ((unsigned long) val_long));
+      sprintf (buf, "%lu", ((unsigned long) val_long));
       break;
     case 'x':
-      sprintf (buf, (use_local ? local_hex_format_custom ("l") : "%lx"), 
+      sprintf (buf, (use_local ? local_hex_format_custom ("l") : "%lx"),
               ((long) val_long));
       break;
     case 'o':
-      sprintf (buf, (use_local ? local_octal_format_custom ("l") : "%lo"), 
+      sprintf (buf, (use_local ? local_octal_format_custom ("l") : "%lo"),
               ((long) val_long));
       break;
     case 'b':
-      sprintf (buf, local_hex_format_custom ("02l"), 
+      sprintf (buf, local_hex_format_custom ("02l"),
               ((long) val_long));
       break;
     case 'h':
-      sprintf (buf, local_hex_format_custom ("04l"), 
+      sprintf (buf, local_hex_format_custom ("04l"),
               ((long) val_long));
       break;
     case 'w':
-      sprintf (buf, local_hex_format_custom ("08l"), 
+      sprintf (buf, local_hex_format_custom ("08l"),
               ((long) val_long));
       break;
     case 'g':
@@ -527,7 +528,7 @@ strcat_longest (format, use_local, val_long, buf, buflen)
     default:
       abort ();
     }
-    
+
 #endif /* !PRINTF_HAS_LONG_LONG */
 }
 #endif
@@ -568,7 +569,7 @@ print_floating (valaddr, type, stream)
   DOUBLEST doub;
   int inv;
   unsigned len = TYPE_LENGTH (type);
-  
+
 #if defined (IEEE_FLOAT)
 
   /* Check for NaN's.  Note that this code does not depend on us being
@@ -595,7 +596,7 @@ print_floating (valaddr, type, stream)
           integer byte order.  */
        low = extract_unsigned_integer (valaddr, 4);
        nonnegative = ((low & 0x80000000) == 0);
-       is_nan = ((((low >> 23) & 0xFF) == 0xFF) 
+       is_nan = ((((low >> 23) & 0xFF) == 0xFF)
                  && 0 != (low & 0x7FFFFF));
        low &= 0x7fffff;
        high = 0;
@@ -618,13 +619,13 @@ print_floating (valaddr, type, stream)
          }
        nonnegative = ((high & 0x80000000) == 0);
        is_nan = (((high >> 20) & 0x7ff) == 0x7ff
-                 && ! ((((high & 0xfffff) == 0)) && (low == 0)));
+                 && !((((high & 0xfffff) == 0)) && (low == 0)));
        high &= 0xfffff;
       }
     else
       /* Extended.  We can't detect NaNs for extendeds yet.  Also note
-        that currently extendeds get nuked to double in
-        REGISTER_CONVERTIBLE.  */
+         that currently extendeds get nuked to double in
+         REGISTER_CONVERTIBLE.  */
       is_nan = 0;
 
     if (is_nan)
@@ -651,9 +652,9 @@ print_floating (valaddr, type, stream)
     }
 
   if (len < sizeof (double))
-    fprintf_filtered (stream, "%.9g", (double) doub);
+      fprintf_filtered (stream, "%.9g", (double) doub);
   else if (len == sizeof (double))
-    fprintf_filtered (stream, "%.17g", (double) doub);
+      fprintf_filtered (stream, "%.17g", (double) doub);
   else
 #ifdef PRINTF_HAS_LONG_DOUBLE
     fprintf_filtered (stream, "%.35Lg", doub);
@@ -663,7 +664,7 @@ print_floating (valaddr, type, stream)
 #endif
 }
 
-void 
+void
 print_binary_chars (stream, valaddr, len)
      GDB_FILE *stream;
      unsigned char *valaddr;
@@ -673,13 +674,13 @@ print_binary_chars (stream, valaddr, len)
 #define BITS_IN_BYTES 8
 
   unsigned char *p;
-  int            i;
-  int            b;
+  int i;
+  int b;
 
   /* Declared "int" so it will be signed.
    * This ensures that right shift will shift in zeros.
    */
-  const int      mask = 0x080;
+  const int mask = 0x080;
 
   /* FIXME: We should be not printing leading zeroes in most cases.  */
 
@@ -690,17 +691,18 @@ print_binary_chars (stream, valaddr, len)
           p < valaddr + len;
           p++)
        {
-          /* Every byte has 8 binary characters; peel off
-           * and print from the MSB end.
-           */
-          for( i = 0; i < (BITS_IN_BYTES * sizeof( *p )); i++ ) {
-              if( *p & ( mask >> i ))
-                  b = 1;
-              else
-                  b = 0;
-
-             fprintf_filtered (stream, "%1d", b);
-          }
+         /* Every byte has 8 binary characters; peel off
+          * and print from the MSB end.
+          */
+         for (i = 0; i < (BITS_IN_BYTES * sizeof (*p)); i++)
+           {
+             if (*p & (mask >> i))
+               b = 1;
+             else
+               b = 0;
+
+             fprintf_filtered (stream, "%1d", b);
+           }
        }
     }
   else
@@ -709,14 +711,15 @@ print_binary_chars (stream, valaddr, len)
           p >= valaddr;
           p--)
        {
-          for( i = 0; i < (BITS_IN_BYTES * sizeof( *p )); i++ ) {
-              if( *p & ( mask >> i ))
-                  b = 1;
-              else
-                  b = 0;
-
-             fprintf_filtered (stream, "%1d", b);
-          }
+         for (i = 0; i < (BITS_IN_BYTES * sizeof (*p)); i++)
+           {
+             if (*p & (mask >> i))
+               b = 1;
+             else
+               b = 0;
+
+             fprintf_filtered (stream, "%1d", b);
+           }
        }
     }
   fprintf_filtered (stream, local_binary_format_suffix ());
@@ -733,8 +736,8 @@ print_octal_chars (stream, valaddr, len)
 {
   unsigned char *p;
   unsigned char octa1, octa2, octa3, carry;
-  int           cycle;
-  
+  int cycle;
+
   /* FIXME: We should be not printing leading zeroes in most cases.  */
 
 
@@ -770,7 +773,7 @@ print_octal_chars (stream, valaddr, len)
    */
   cycle = (len * BITS_IN_BYTES) % BITS_IN_OCTAL;
   carry = 0;
-  
+
   fprintf_filtered (stream, local_octal_format_prefix ());
   if (TARGET_BYTE_ORDER == BIG_ENDIAN)
     {
@@ -778,47 +781,48 @@ print_octal_chars (stream, valaddr, len)
           p < valaddr + len;
           p++)
        {
-          switch (cycle) {
-              case 0:
-                 /* No carry in, carry out two bits.
-                  */
-                 octa1 = (HIGH_ZERO  & *p) >> 5;
-                 octa2 = (LOW_ZERO   & *p) >> 2;
-                 carry = (CARRY_ZERO & *p);
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                 break;
-
-              case 1:
-                 /* Carry in two bits, carry out one bit.
-                  */
-                 octa1 = (carry << 1) | ((HIGH_ONE & *p) >> 7);
-                 octa2 = (MID_ONE   & *p) >> 4;
-                 octa3 = (LOW_ONE   & *p) >> 1;
-                 carry = (CARRY_ONE & *p);
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                fprintf_filtered (stream, "%o", octa3);
-                 break;
-
-              case 2:
-                 /* Carry in one bit, no carry out.
-                  */
-                 octa1 = (carry << 2) | ((HIGH_TWO & *p) >> 6);
-                 octa2 = (MID_TWO & *p) >> 3;
-                 octa3 = (LOW_TWO & *p);
-                 carry = 0;
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                fprintf_filtered (stream, "%o", octa3);
-                 break;
-                 
-              default:
-                 error( "Internal error in octal conversion;" );
-          }
-
-          cycle++;
-          cycle = cycle % BITS_IN_OCTAL;
+         switch (cycle)
+           {
+           case 0:
+             /* No carry in, carry out two bits.
+              */
+             octa1 = (HIGH_ZERO & *p) >> 5;
+             octa2 = (LOW_ZERO & *p) >> 2;
+             carry = (CARRY_ZERO & *p);
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             break;
+
+           case 1:
+             /* Carry in two bits, carry out one bit.
+              */
+             octa1 = (carry << 1) | ((HIGH_ONE & *p) >> 7);
+             octa2 = (MID_ONE & *p) >> 4;
+             octa3 = (LOW_ONE & *p) >> 1;
+             carry = (CARRY_ONE & *p);
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             fprintf_filtered (stream, "%o", octa3);
+             break;
+
+           case 2:
+             /* Carry in one bit, no carry out.
+              */
+             octa1 = (carry << 2) | ((HIGH_TWO & *p) >> 6);
+             octa2 = (MID_TWO & *p) >> 3;
+             octa3 = (LOW_TWO & *p);
+             carry = 0;
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             fprintf_filtered (stream, "%o", octa3);
+             break;
+
+           default:
+             error ("Internal error in octal conversion;");
+           }
+
+         cycle++;
+         cycle = cycle % BITS_IN_OCTAL;
        }
     }
   else
@@ -827,44 +831,45 @@ print_octal_chars (stream, valaddr, len)
           p >= valaddr;
           p--)
        {
-          switch (cycle) {
-              case 0:
-                 /* Carry out, no carry in */
-                 octa1 = (HIGH_ZERO  & *p) >> 5;
-                 octa2 = (LOW_ZERO   & *p) >> 2;
-                 carry = (CARRY_ZERO & *p);
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                 break;
-
-              case 1:
-                 /* Carry in, carry out */
-                 octa1 = (carry << 1) | ((HIGH_ONE & *p) >> 7);
-                 octa2 = (MID_ONE   & *p) >> 4;
-                 octa3 = (LOW_ONE   & *p) >> 1;
-                 carry = (CARRY_ONE & *p);
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                fprintf_filtered (stream, "%o", octa3);
-                 break;
-
-              case 2:
-                 /* Carry in, no carry out */
-                 octa1 = (carry << 2) | ((HIGH_TWO & *p) >> 6);
-                 octa2 = (MID_TWO & *p) >> 3;
-                 octa3 = (LOW_TWO & *p);
-                 carry = 0;
-                fprintf_filtered (stream, "%o", octa1);
-                fprintf_filtered (stream, "%o", octa2);
-                fprintf_filtered (stream, "%o", octa3);
-                 break;
-                 
-              default:
-                 error( "Internal error in octal conversion;" );
-          }
-
-          cycle++;
-          cycle = cycle % BITS_IN_OCTAL;
+         switch (cycle)
+           {
+           case 0:
+             /* Carry out, no carry in */
+             octa1 = (HIGH_ZERO & *p) >> 5;
+             octa2 = (LOW_ZERO & *p) >> 2;
+             carry = (CARRY_ZERO & *p);
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             break;
+
+           case 1:
+             /* Carry in, carry out */
+             octa1 = (carry << 1) | ((HIGH_ONE & *p) >> 7);
+             octa2 = (MID_ONE & *p) >> 4;
+             octa3 = (LOW_ONE & *p) >> 1;
+             carry = (CARRY_ONE & *p);
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             fprintf_filtered (stream, "%o", octa3);
+             break;
+
+           case 2:
+             /* Carry in, no carry out */
+             octa1 = (carry << 2) | ((HIGH_TWO & *p) >> 6);
+             octa2 = (MID_TWO & *p) >> 3;
+             octa3 = (LOW_TWO & *p);
+             carry = 0;
+             fprintf_filtered (stream, "%o", octa1);
+             fprintf_filtered (stream, "%o", octa2);
+             fprintf_filtered (stream, "%o", octa3);
+             break;
+
+           default:
+             error ("Internal error in octal conversion;");
+           }
+
+         cycle++;
+         cycle = cycle % BITS_IN_OCTAL;
        }
     }
 
@@ -882,7 +887,7 @@ print_decimal_chars (stream, valaddr, len)
 {
 #define TEN             10
 #define TWO_TO_FOURTH   16
-#define CARRY_OUT(  x ) ((x) / TEN)  /* extend char to int */
+#define CARRY_OUT(  x ) ((x) / TEN)    /* extend char to int */
 #define CARRY_LEFT( x ) ((x) % TEN)
 #define SHIFT( x )      ((x) << 4)
 #define START_P \
@@ -896,23 +901,24 @@ print_decimal_chars (stream, valaddr, len)
 
   unsigned char *p;
   unsigned char *digits;
-  int            carry;
-  int            decimal_len;
-  int            i, j, decimal_digits;
-  int            dummy;
-  int            flip;
-  
+  int carry;
+  int decimal_len;
+  int i, j, decimal_digits;
+  int dummy;
+  int flip;
+
   /* Base-ten number is less than twice as many digits
    * as the base 16 number, which is 2 digits per byte.
    */
   decimal_len = len * 2 * 2;
-  digits = (unsigned char *) malloc( decimal_len );
-  if( digits == NULL )
-      error( "Can't allocate memory for conversion to decimal." );
+  digits = (unsigned char *) malloc (decimal_len);
+  if (digits == NULL)
+    error ("Can't allocate memory for conversion to decimal.");
 
-  for( i = 0; i < decimal_len; i++ ) {
+  for (i = 0; i < decimal_len; i++)
+    {
       digits[i] = 0;
-  }
+    }
 
   fprintf_filtered (stream, local_decimal_format_prefix ());
 
@@ -929,38 +935,42 @@ print_decimal_chars (stream, valaddr, len)
    * Outer loop is per nibble (hex digit) of input, from MSD end to
    * LSD end.
    */
-  decimal_digits = 0;  /* Number of decimal digits so far */
+  decimal_digits = 0;          /* Number of decimal digits so far */
   p = START_P;
   flip = 0;
-  while( NOT_END_P ) {
+  while (NOT_END_P)
+    {
       /*
        * Multiply current base-ten number by 16 in place.
        * Each digit was between 0 and 9, now is between
        * 0 and 144.
        */
-      for( j = 0; j < decimal_digits; j++ ) {
-           digits[j] = SHIFT( digits[j] );
-      }
-    
+      for (j = 0; j < decimal_digits; j++)
+       {
+         digits[j] = SHIFT (digits[j]);
+       }
+
       /* Take the next nibble off the input and add it to what
        * we've got in the LSB position.  Bottom 'digit' is now
        * between 0 and 159.
        *
        * "flip" is used to run this loop twice for each byte.
        */
-      if( flip == 0 ) {
-          /* Take top nibble.
-           */
-          digits[0] += HIGH_NIBBLE( *p );
-          flip = 1;
-      }
-      else {
-          /* Take low nibble and bump our pointer "p".
-           */
-          digits[0] += LOW_NIBBLE( *p );
-          NEXT_P;
-          flip = 0;
-      }
+      if (flip == 0)
+       {
+         /* Take top nibble.
+          */
+         digits[0] += HIGH_NIBBLE (*p);
+         flip = 1;
+       }
+      else
+       {
+         /* Take low nibble and bump our pointer "p".
+          */
+         digits[0] += LOW_NIBBLE (*p);
+         NEXT_P;
+         flip = 0;
+       }
 
       /* Re-decimalize.  We have to do this often enough
        * that we don't overflow, but once per nibble is
@@ -971,39 +981,42 @@ print_decimal_chars (stream, valaddr, len)
        * the carrying beyond the last current digit.
        */
       carry = 0;
-      for( j = 0; j < decimal_len - 1; j++ ) {
-          digits[j] += carry;
-
-          /* "/" won't handle an unsigned char with
-           * a value that if signed would be negative.
-           * So extend to longword int via "dummy".
-           */
-          dummy     = digits[j];
-          carry     = CARRY_OUT(  dummy );
-          digits[j] = CARRY_LEFT( dummy );
-
-          if( j >= decimal_digits && carry == 0 ) {
-              /*
-               * All higher digits are 0 and we
-               * no longer have a carry.
-               *
-               * Note: "j" is 0-based, "decimal_digits" is
-               *       1-based.
-               */
-              decimal_digits = j + 1;
-              break;
-          }
-      }
-  }
+      for (j = 0; j < decimal_len - 1; j++)
+       {
+         digits[j] += carry;
+
+         /* "/" won't handle an unsigned char with
+          * a value that if signed would be negative.
+          * So extend to longword int via "dummy".
+          */
+         dummy = digits[j];
+         carry = CARRY_OUT (dummy);
+         digits[j] = CARRY_LEFT (dummy);
+
+         if (j >= decimal_digits && carry == 0)
+           {
+             /*
+              * All higher digits are 0 and we
+              * no longer have a carry.
+              *
+              * Note: "j" is 0-based, "decimal_digits" is
+              *       1-based.
+              */
+             decimal_digits = j + 1;
+             break;
+           }
+       }
+    }
 
   /* Ok, now "digits" is the decimal representation, with
    * the "decimal_digits" actual digits.  Print!
    */
-  for( i = decimal_digits - 1; i >= 0; i-- ) {
-      fprintf_filtered( stream, "%1d", digits[i] );
-  }
-  free( digits );
-  
+  for (i = decimal_digits - 1; i >= 0; i--)
+    {
+      fprintf_filtered (stream, "%1d", digits[i]);
+    }
+  free (digits);
+
   fprintf_filtered (stream, local_decimal_format_suffix ());
 }
 
@@ -1042,13 +1055,13 @@ print_hex_chars (stream, valaddr, len)
 }
 
 /*  Called by various <lang>_val_print routines to print elements of an
-    array in the form "<elem1>, <elem2>, <elem3>, ...".
+   array in the form "<elem1>, <elem2>, <elem3>, ...".
 
-    (FIXME?)  Assumes array element separator is a comma, which is correct
-    for all languages currently handled.
-    (FIXME?)  Some languages have a notation for repeated array elements,
-    perhaps we should try to use that notation when appropriate.
   */
+   (FIXME?)  Assumes array element separator is a comma, which is correct
+   for all languages currently handled.
+   (FIXME?)  Some languages have a notation for repeated array elements,
+   perhaps we should try to use that notation when appropriate.
+ */
 
 void
 val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
@@ -1072,7 +1085,7 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
   unsigned int rep1;
   /* Number of repetitions we have detected so far.  */
   unsigned int reps;
-      
+
   elttype = TYPE_TARGET_TYPE (type);
   eltlen = TYPE_LENGTH (check_typedef (elttype));
   len = TYPE_LENGTH (type) / eltlen;
@@ -1097,7 +1110,7 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
 
       rep1 = i + 1;
       reps = 1;
-      while ((rep1 < len) && 
+      while ((rep1 < len) &&
             !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
        {
          ++reps;
@@ -1131,19 +1144,19 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
 }
 
 /*  Print a string from the inferior, starting at ADDR and printing up to LEN
-    characters, of WIDTH bytes a piece, to STREAM.  If LEN is -1, printing
-    stops at the first null byte, otherwise printing proceeds (including null
-    bytes) until either print_max or LEN characters have been printed,
-    whichever is smaller. */
+   characters, of WIDTH bytes a piece, to STREAM.  If LEN is -1, printing
+   stops at the first null byte, otherwise printing proceeds (including null
+   bytes) until either print_max or LEN characters have been printed,
+   whichever is smaller. */
 
 /* FIXME: Use target_read_string.  */
 
 int
 val_print_string (addr, len, width, stream)
-    CORE_ADDR addr;
-    int len;
-    int width;
-    GDB_FILE *stream;
+     CORE_ADDR addr;
+     int len;
+     int width;
+     GDB_FILE *stream;
 {
   int force_ellipsis = 0;      /* Force ellipsis to be printed if nonzero. */
   int errcode;                 /* Errno returned from bad reads. */
@@ -1153,7 +1166,7 @@ val_print_string (addr, len, width, stream)
   char *buffer = NULL;         /* Dynamically growable fetch buffer. */
   char *bufptr;                        /* Pointer to next available byte in buffer. */
   char *limit;                 /* First location past end of fetch buffer. */
-  struct cleanup *old_chain = NULL; /* Top of the old cleanup chain. */
+  struct cleanup *old_chain = NULL;    /* Top of the old cleanup chain. */
   int found_nul;               /* Non-zero if we found the nul char */
 
   /* First we need to figure out the limit on the number of characters we are
@@ -1216,7 +1229,7 @@ val_print_string (addr, len, width, stream)
 
          /* Read as much as we can. */
          nfetch = target_read_memory_partial (addr, bufptr, nfetch * width, &errcode)
-                  / width;
+           / width;
 
          /* Scan this chunk for the null byte that terminates the string
             to print.  If found, we don't need to fetch any more.  Note
@@ -1242,9 +1255,9 @@ val_print_string (addr, len, width, stream)
                }
            }
        }
-    while (errcode == 0                                      /* no error */
-          && bufptr - buffer < fetchlimit * width   /* no overrun */
-          && !found_nul);                            /* haven't found nul yet */
+      while (errcode == 0      /* no error */
+            && bufptr - buffer < fetchlimit * width    /* no overrun */
+            && !found_nul);    /* haven't found nul yet */
     }
   else
     {                          /* length of string is really 0! */
@@ -1263,8 +1276,8 @@ val_print_string (addr, len, width, stream)
       char *peekbuf;
 
       /* We didn't find a null terminator we were looking for.  Attempt
-        to peek at the next character.  If not successful, or it is not
-        a null byte, then force ellipsis to be printed.  */
+         to peek at the next character.  If not successful, or it is not
+         a null byte, then force ellipsis to be printed.  */
 
       peekbuf = (char *) alloca (width);
 
@@ -1272,11 +1285,11 @@ val_print_string (addr, len, width, stream)
          && extract_unsigned_integer (peekbuf, width) != 0)
        force_ellipsis = 1;
     }
-  else if ((len >= 0 && errcode != 0) || (len > (bufptr - buffer)/width))
+  else if ((len >= 0 && errcode != 0) || (len > (bufptr - buffer) / width))
     {
       /* Getting an error when we have a requested length, or fetching less
-        than the number of characters actually requested, always make us
-        print ellipsis. */
+         than the number of characters actually requested, always make us
+         print ellipsis. */
       force_ellipsis = 1;
     }
 
@@ -1291,7 +1304,7 @@ val_print_string (addr, len, width, stream)
        {
          fputs_filtered (" ", stream);
        }
-      LA_PRINT_STRING (stream, buffer, (bufptr - buffer)/width, width, force_ellipsis);
+      LA_PRINT_STRING (stream, buffer, (bufptr - buffer) / width, width, force_ellipsis);
     }
 
   if (errcode != 0)
@@ -1311,10 +1324,10 @@ val_print_string (addr, len, width, stream)
     }
   gdb_flush (stream);
   do_cleanups (old_chain);
-  return ((bufptr - buffer)/width);
+  return ((bufptr - buffer) / width);
 }
-
 \f
+
 /* Validate an input or output radix setting, and make sure the user
    knows what they really did here.  Radix setting is confusing, e.g.
    setting the input radix to "10" never changes it!  */
@@ -1326,7 +1339,7 @@ set_input_radix (args, from_tty, c)
      int from_tty;
      struct cmd_list_element *c;
 {
-  set_input_radix_1 (from_tty, *(unsigned *)c->var);
+  set_input_radix_1 (from_tty, *(unsigned *) c->var);
 }
 
 /* ARGSUSED */
@@ -1362,7 +1375,7 @@ set_output_radix (args, from_tty, c)
      int from_tty;
      struct cmd_list_element *c;
 {
-  set_output_radix_1 (from_tty, *(unsigned *)c->var);
+  set_output_radix_1 (from_tty, *(unsigned *) c->var);
 }
 
 static void
@@ -1375,13 +1388,13 @@ set_output_radix_1 (from_tty, radix)
   switch (radix)
     {
     case 16:
-      output_format = 'x';             /* hex */
+      output_format = 'x';     /* hex */
       break;
     case 10:
-      output_format = 0;               /* decimal */
+      output_format = 0;       /* decimal */
       break;
     case 8:
-      output_format = 'o';             /* octal */
+      output_format = 'o';     /* octal */
       break;
     default:
       error ("Unsupported output radix ``decimal %u''; output radix unchanged.",
@@ -1422,7 +1435,7 @@ set_radix (arg, from_tty)
 
 /* Show both the input and output radices. */
 
-/*ARGSUSED*/
+/*ARGSUSED */
 static void
 show_radix (arg, from_tty)
      char *arg;
@@ -1444,20 +1457,20 @@ show_radix (arg, from_tty)
        }
     }
 }
-
 \f
-/*ARGSUSED*/
+
+/*ARGSUSED */
 static void
 set_print (arg, from_tty)
      char *arg;
      int from_tty;
 {
   printf_unfiltered (
-"\"set print\" must be followed by the name of a print subcommand.\n");
+     "\"set print\" must be followed by the name of a print subcommand.\n");
   help_list (setprintlist, "set print ", -1, gdb_stdout);
 }
 
-/*ARGSUSED*/
+/*ARGSUSED */
 static void
 show_print (args, from_tty)
      char *args;
@@ -1474,18 +1487,18 @@ _initialize_valprint ()
   add_prefix_cmd ("print", no_class, set_print,
                  "Generic command for setting how things print.",
                  &setprintlist, "set print ", 0, &setlist);
-  add_alias_cmd ("p", "print", no_class, 1, &setlist); 
-  /* prefer set print to set prompt */ 
+  add_alias_cmd ("p", "print", no_class, 1, &setlist);
+  /* prefer set print to set prompt */
   add_alias_cmd ("pr", "print", no_class, 1, &setlist);
 
   add_prefix_cmd ("print", no_class, show_print,
                  "Generic command for showing print settings.",
                  &showprintlist, "show print ", 0, &showlist);
-  add_alias_cmd ("p", "print", no_class, 1, &showlist); 
-  add_alias_cmd ("pr", "print", no_class, 1, &showlist); 
+  add_alias_cmd ("p", "print", no_class, 1, &showlist);
+  add_alias_cmd ("pr", "print", no_class, 1, &showlist);
 
   add_show_from_set
-    (add_set_cmd ("elements", no_class, var_uinteger, (char *)&print_max,
+    (add_set_cmd ("elements", no_class, var_uinteger, (char *) &print_max,
                  "Set limit on string chars or array elements to print.\n\
 \"set print elements 0\" causes there to be no limit.",
                  &setprintlist),
@@ -1493,14 +1506,14 @@ _initialize_valprint ()
 
   add_show_from_set
     (add_set_cmd ("null-stop", no_class, var_boolean,
-                 (char *)&stop_print_at_null,
+                 (char *) &stop_print_at_null,
                  "Set printing of char arrays to stop at first null char.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
     (add_set_cmd ("repeats", no_class, var_uinteger,
-                 (char *)&repeat_count_threshold,
+                 (char *) &repeat_count_threshold,
                  "Set threshold for repeated print elements.\n\
 \"set print repeats 0\" causes all elements to be individually printed.",
                  &setprintlist),
@@ -1508,41 +1521,41 @@ _initialize_valprint ()
 
   add_show_from_set
     (add_set_cmd ("pretty", class_support, var_boolean,
-                 (char *)&prettyprint_structs,
+                 (char *) &prettyprint_structs,
                  "Set prettyprinting of structures.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
-    (add_set_cmd ("union", class_support, var_boolean, (char *)&unionprint,
+    (add_set_cmd ("union", class_support, var_boolean, (char *) &unionprint,
                  "Set printing of unions interior to structures.",
                  &setprintlist),
      &showprintlist);
-  
+
   add_show_from_set
     (add_set_cmd ("array", class_support, var_boolean,
-                 (char *)&prettyprint_arrays,
+                 (char *) &prettyprint_arrays,
                  "Set prettyprinting of arrays.",
                  &setprintlist),
      &showprintlist);
 
   add_show_from_set
-    (add_set_cmd ("address", class_support, var_boolean, (char *)&addressprint,
+    (add_set_cmd ("address", class_support, var_boolean, (char *) &addressprint,
                  "Set printing of addresses.",
                  &setprintlist),
      &showprintlist);
 
   c = add_set_cmd ("input-radix", class_support, var_uinteger,
-                  (char *)&input_radix,
-                 "Set default input radix for entering numbers.",
-                 &setlist);
+                  (char *) &input_radix,
+                  "Set default input radix for entering numbers.",
+                  &setlist);
   add_show_from_set (c, &showlist);
   c->function.sfunc = set_input_radix;
 
   c = add_set_cmd ("output-radix", class_support, var_uinteger,
-                  (char *)&output_radix,
-                 "Set default output radix for printing of values.",
-                 &setlist);
+                  (char *) &output_radix,
+                  "Set default output radix for printing of values.",
+                  &setlist);
   add_show_from_set (c, &showlist);
   c->function.sfunc = set_output_radix;
 
index e6edb15c650414349ae3f74572369e7fa948884b..fa4860ad53cf8bc8e4b4e5c5c19cc173c0686c4a 100644 (file)
@@ -1,22 +1,23 @@
 /* Declarations for value printing routines for GDB, the GNU debugger.
    Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
-             Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 extern int prettyprint_arrays; /* Controls pretty printing of arrays.  */
@@ -33,7 +34,7 @@ extern unsigned int print_max;        /* Max # of chars for strings/vectors */
 
 extern int output_format;
 
-extern int stop_print_at_null;  /* Stop printing at null char? */
+extern int stop_print_at_null; /* Stop printing at null char? */
 
 extern void
 val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
@@ -45,10 +46,9 @@ val_print_type_code_int PARAMS ((struct type *, char *, GDB_FILE *));
 
 extern void
 print_binary_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
+
 extern void
 print_octal_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
+
 extern void
 print_decimal_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
-
index 9dcfac20d2f4052e4857d299a741cb312a735fc0..c4a33f59ef0e27b0e01633e85999e6827f8ac251 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if !defined (VALUE_H)
 #define VALUE_H 1
@@ -26,22 +27,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  * be possible for a program lval value to survive over a call to the inferior
  * (ie to be put into the history list or an internal variable).
  */
-enum lval_type {
-  /* Not an lval.  */
-  not_lval,
-  /* In memory.  Could be a saved register.  */
-  lval_memory,
-  /* In a register.  */
-  lval_register,
-  /* In a gdb internal variable.  */
-  lval_internalvar,
-  /* Part of a gdb internal variable (structure field).  */
-  lval_internalvar_component,
-  /* In a register series in a frame not the current one, which may have been
-     partially saved or saved in different places (otherwise would be
-     lval_register or lval_memory).  */
-  lval_reg_frame_relative
-};
+enum lval_type
+  {
+    /* Not an lval.  */
+    not_lval,
+    /* In memory.  Could be a saved register.  */
+    lval_memory,
+    /* In a register.  */
+    lval_register,
+    /* In a gdb internal variable.  */
+    lval_internalvar,
+    /* Part of a gdb internal variable (structure field).  */
+    lval_internalvar_component,
+    /* In a register series in a frame not the current one, which may have been
+       partially saved or saved in different places (otherwise would be
+       lval_register or lval_memory).  */
+    lval_reg_frame_relative
+  };
 
 struct value
   {
@@ -60,11 +62,12 @@ struct value
        /* Number of register.  Only used with
           lval_reg_frame_relative.  */
        int regnum;
-      } location;
+      }
+    location;
     /* Describes offset of a value within lval of a structure in bytes.
        This is used in retrieving contents from target memory. [Note also
        the member embedded_offset below.] */
-    int offset;        
+    int offset;
     /* Only used for bitfields; number of bits contained in them.  */
     int bitsize;
     /* Only used for bitfields; position of start of field.
@@ -94,10 +97,12 @@ struct value
     struct value *next;
 
     /* ??? When is this used?  */
-    union {
-      CORE_ADDR memaddr;
-      char *myaddr;
-    } substring_addr;
+    union
+      {
+       CORE_ADDR memaddr;
+       char *myaddr;
+      }
+    substring_addr;
 
     /* Register number if the value is from a register.  Is not kept
        if you take a field of a structure that is stored in a
@@ -133,12 +138,14 @@ struct value
        Target byte-order.  We force it to be aligned properly for any
        possible value.  Note that a value therefore extends beyond
        what is declared here.  */
-    union {
-      long contents[1];
-      double force_double_align;
-      LONGEST force_longlong_align;
-      char *literal_data;
-    } aligner;
+    union
+      {
+       long contents[1];
+       double force_double_align;
+       LONGEST force_longlong_align;
+       char *literal_data;
+      }
+    aligner;
     /* Do not add any new members here -- contents above will trash them */
   };
 
@@ -164,12 +171,12 @@ typedef struct value *value_ptr;
 
 /* The ALL variants of the above two macros do not adjust the returned
    pointer by the embedded_offset value. */
-  
+
 #define VALUE_CONTENTS_ALL_RAW(val) ((char *) (val)->aligner.contents)
 #define VALUE_CONTENTS_ALL(val) ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)),\
                                  VALUE_CONTENTS_ALL_RAW(val))
-  
-  
+
+
 extern int value_fetch_lazy PARAMS ((value_ptr val));
 
 #define VALUE_LVAL(val) (val)->lval
@@ -231,19 +238,19 @@ do { COERCE_REF(arg);                                                     \
    are recorded as a chain of these structures.  */
 
 struct internalvar
-{
-  struct internalvar *next;
-  char *name;
-  value_ptr value;
-};
+  {
+    struct internalvar *next;
+    char *name;
+    value_ptr value;
+  };
 
 /* Pointer to member function.  Depends on compiler implementation. */
 
 #define METHOD_PTR_IS_VIRTUAL(ADDR)  ((ADDR) & 0x80000000)
 #define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET))
 #define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR))
-
 \f
+
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
@@ -262,45 +269,45 @@ extern DOUBLEST value_as_double PARAMS ((value_ptr val));
 
 extern CORE_ADDR value_as_pointer PARAMS ((value_ptr val));
 
-extern LONGEST unpack_long PARAMS ((struct type *type, char *valaddr));
+extern LONGEST unpack_long PARAMS ((struct type * type, char *valaddr));
 
-extern DOUBLEST unpack_double PARAMS ((struct type *type, char *valaddr,
+extern DOUBLEST unpack_double PARAMS ((struct type * type, char *valaddr,
                                       int *invp));
 
-extern CORE_ADDR unpack_pointer PARAMS ((struct type *type, char *valaddr));
+extern CORE_ADDR unpack_pointer PARAMS ((struct type * type, char *valaddr));
 
-extern LONGEST unpack_field_as_long PARAMS ((struct type *type, char *valaddr,
+extern LONGEST unpack_field_as_long PARAMS ((struct type * type, char *valaddr,
                                             int fieldno));
 
-extern value_ptr value_from_longest PARAMS ((struct type *type, LONGEST num));
+extern value_ptr value_from_longest PARAMS ((struct type * type, LONGEST num));
 
-extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
+extern value_ptr value_from_double PARAMS ((struct type * type, DOUBLEST num));
 
 extern value_ptr value_from_string PARAMS ((char *string));
 
-extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
+extern value_ptr value_at PARAMS ((struct type * type, CORE_ADDR addr, asection * sect));
 
-extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
+extern value_ptr value_at_lazy PARAMS ((struct type * type, CORE_ADDR addr, asection * sect));
 
-extern value_ptr value_from_register PARAMS ((struct type *type, int regnum,
-                                         struct frame_info * frame));
+extern value_ptr value_from_register PARAMS ((struct type * type, int regnum,
+                                             struct frame_info * frame));
 
-extern value_ptr value_of_variable PARAMS ((struct symbol *var,
-                                           struct block *b));
+extern value_ptr value_of_variable PARAMS ((struct symbol * var,
+                                           struct block * b));
 
 extern value_ptr value_of_register PARAMS ((int regnum));
 
 extern int symbol_read_needs_frame PARAMS ((struct symbol *));
 
-extern value_ptr read_var_value PARAMS ((struct symbol *var,
-                                        struct frame_info *frame));
+extern value_ptr read_var_value PARAMS ((struct symbol * var,
+                                        struct frame_info * frame));
 
-extern value_ptr locate_var_value PARAMS ((struct symbol *var,
-                                      struct frame_info *frame));
+extern value_ptr locate_var_value PARAMS ((struct symbol * var,
+                                          struct frame_info * frame));
 
-extern value_ptr allocate_value PARAMS ((struct type *type));
+extern value_ptr allocate_value PARAMS ((struct type * type));
 
-extern value_ptr allocate_repeat_value PARAMS ((struct type *type, int count));
+extern value_ptr allocate_repeat_value PARAMS ((struct type * type, int count));
 
 extern value_ptr value_mark PARAMS ((void));
 
@@ -310,7 +317,7 @@ extern value_ptr value_string PARAMS ((char *ptr, int len));
 extern value_ptr value_bitstring PARAMS ((char *ptr, int len));
 
 extern value_ptr value_array PARAMS ((int lowbound, int highbound,
-                                     value_ptr *elemvec));
+                                     value_ptr * elemvec));
 
 extern value_ptr value_concat PARAMS ((value_ptr arg1, value_ptr arg2));
 
@@ -335,64 +342,64 @@ extern value_ptr value_neg PARAMS ((value_ptr arg1));
 
 extern value_ptr value_complement PARAMS ((value_ptr arg1));
 
-extern value_ptr value_struct_elt PARAMS ((value_ptr *argp, value_ptr *args,
+extern value_ptr value_struct_elt PARAMS ((value_ptr * argp, value_ptr * args,
                                           char *name,
                                           int *static_memfuncp, char *err));
 
-extern value_ptr value_struct_elt_for_reference PARAMS ((struct type *domain,
+extern value_ptr value_struct_elt_for_reference PARAMS ((struct type * domain,
                                                         int offset,
-                                                        struct type *curtype,
+                                                     struct type * curtype,
                                                         char *name,
-                                                        struct type *intype));
+                                                    struct type * intype));
 
-extern value_ptr value_static_field PARAMS ((struct type *type, int fieldno));
+extern value_ptr value_static_field PARAMS ((struct type * type, int fieldno));
 
 extern struct fn_field *value_find_oload_method_list PARAMS ((value_ptr *, char *, int, int *, int *, struct type **, int *));
 
-extern int find_overload_match PARAMS ((struct type ** arg_types, int nargs, char * name, int method, int lax, value_ptr obj, struct symbol *fsym, value_ptr *valp, struct symbol **symp, int *staticp));
+extern int find_overload_match PARAMS ((struct type ** arg_types, int nargs, char *name, int method, int lax, value_ptr obj, struct symbol * fsym, value_ptr * valp, struct symbol ** symp, int *staticp));
 
 extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
 
 extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
                                                int fieldno,
-                                               struct type *arg_type));
+                                               struct type * arg_type));
 
 extern struct type *
-value_rtti_type PARAMS ((value_ptr, int *, int *, int *));
+  value_rtti_type PARAMS ((value_ptr, int *, int *, int *));
 
 extern struct type *
-value_rtti_target_type PARAMS ((value_ptr, int *, int *, int *));
+  value_rtti_target_type PARAMS ((value_ptr, int *, int *, int *));
 
 extern value_ptr
-value_full_object PARAMS ((value_ptr, struct type *, int, int, int));
+  value_full_object PARAMS ((value_ptr, struct type *, int, int, int));
 
-extern value_ptr value_cast PARAMS ((struct type *type, value_ptr arg2));
+extern value_ptr value_cast PARAMS ((struct type * type, value_ptr arg2));
 
-extern value_ptr value_zero PARAMS ((struct type *type, enum lval_type lv));
+extern value_ptr value_zero PARAMS ((struct type * type, enum lval_type lv));
 
 extern value_ptr value_repeat PARAMS ((value_ptr arg1, int count));
 
 extern value_ptr value_subscript PARAMS ((value_ptr array, value_ptr idx));
 
 extern value_ptr value_from_vtable_info PARAMS ((value_ptr arg,
-                                                struct type *type));
+                                                struct type * type));
 
-extern value_ptr value_being_returned PARAMS ((struct type *valtype, 
+extern value_ptr value_being_returned PARAMS ((struct type * valtype,
                                               char *retbuf,
                                               int struct_return));
 
 extern value_ptr value_in PARAMS ((value_ptr element, value_ptr set));
 
-extern int value_bit_index PARAMS ((struct type *type, char *addr, int index));
+extern int value_bit_index PARAMS ((struct type * type, char *addr, int index));
 
 extern int using_struct_return PARAMS ((value_ptr function, CORE_ADDR funcaddr,
-                                       struct type *value_type, int gcc_p));
+                                     struct type * value_type, int gcc_p));
 
 extern void set_return_value PARAMS ((value_ptr val));
 
-extern value_ptr evaluate_expression PARAMS ((struct expression *exp));
+extern value_ptr evaluate_expression PARAMS ((struct expression * exp));
 
-extern value_ptr evaluate_type PARAMS ((struct expression *exp));
+extern value_ptr evaluate_type PARAMS ((struct expression * exp));
 
 extern value_ptr evaluate_subexp_with_coercion PARAMS ((struct expression *,
                                                        int *, enum noside));
@@ -409,11 +416,11 @@ extern CORE_ADDR parse_and_eval_address_1 PARAMS ((char **expptr));
 
 extern value_ptr access_value_history PARAMS ((int num));
 
-extern value_ptr value_of_internalvar PARAMS ((struct internalvar *var));
+extern value_ptr value_of_internalvar PARAMS ((struct internalvar * var));
 
-extern void set_internalvar PARAMS ((struct internalvar *var, value_ptr val));
+extern void set_internalvar PARAMS ((struct internalvar * var, value_ptr val));
 
-extern void set_internalvar_component PARAMS ((struct internalvar *var,
+extern void set_internalvar_component PARAMS ((struct internalvar * var,
                                               int offset,
                                               int bitpos, int bitsize,
                                               value_ptr newvalue));
@@ -438,13 +445,13 @@ extern value_ptr value_x_binop PARAMS ((value_ptr arg1, value_ptr arg2,
 extern value_ptr value_x_unop PARAMS ((value_ptr arg1, enum exp_opcode op,
                                       enum noside noside));
 
-extern value_ptr value_fn_field PARAMS ((value_ptr *arg1p, struct fn_field *f,
+extern value_ptr value_fn_field PARAMS ((value_ptr * arg1p, struct fn_field * f,
                                         int j,
-                                        struct type* type, int offset));
+                                        struct type * type, int offset));
 
-extern value_ptr value_virtual_fn_field PARAMS ((value_ptr *arg1p,
-                                                struct fn_field *f, int j,
-                                                struct type *type,
+extern value_ptr value_virtual_fn_field PARAMS ((value_ptr * arg1p,
+                                                struct fn_field * f, int j,
+                                                struct type * type,
                                                 int offset));
 
 extern int binop_user_defined_p PARAMS ((enum exp_opcode op,
@@ -453,7 +460,7 @@ extern int binop_user_defined_p PARAMS ((enum exp_opcode op,
 extern int unop_user_defined_p PARAMS ((enum exp_opcode op, value_ptr arg1));
 
 extern int destructor_name_p PARAMS ((const char *name,
-                                     const struct type *type));
+                                     const struct type * type));
 
 #define value_free(val) free ((PTR)val)
 
@@ -473,10 +480,10 @@ extern void
 read_register_gen PARAMS ((int regno, char *myaddr));
 
 extern CORE_ADDR
-read_register PARAMS ((int regno));
+  read_register PARAMS ((int regno));
 
 extern CORE_ADDR
-read_register_pid PARAMS ((int regno, int pid));
+  read_register_pid PARAMS ((int regno, int pid));
 
 extern void
 write_register PARAMS ((int regno, LONGEST val));
@@ -488,57 +495,57 @@ extern void
 supply_register PARAMS ((int regno, char *val));
 
 extern void get_saved_register PARAMS ((char *raw_buffer, int *optimized,
-                                       CORE_ADDR *addrp,
-                                       struct frame_info *frame,
-                                       int regnum, enum lval_type *lval));
+                                       CORE_ADDR * addrp,
+                                       struct frame_info * frame,
+                                       int regnum, enum lval_type * lval));
 
 extern void
 modify_field PARAMS ((char *addr, LONGEST fieldval, int bitpos, int bitsize));
 
 extern void
-type_print PARAMS ((struct type *type, char *varstring, GDB_FILE *stream,
+type_print PARAMS ((struct type * type, char *varstring, GDB_FILE * stream,
                    int show));
 
-extern char *baseclass_addr PARAMS ((struct type *type, int index,
+extern char *baseclass_addr PARAMS ((struct type * type, int index,
                                     char *valaddr,
-                                    value_ptr *valuep, int *errp));
+                                    value_ptr * valuep, int *errp));
 
 extern void
-print_longest PARAMS ((GDB_FILE *stream, int format, int use_local,
+print_longest PARAMS ((GDB_FILE * stream, int format, int use_local,
                       LONGEST val));
 
 extern void
-print_floating PARAMS ((char *valaddr, struct type *type, GDB_FILE *stream));
+print_floating PARAMS ((char *valaddr, struct type * type, GDB_FILE * stream));
 
-extern int value_print PARAMS ((value_ptr val, GDB_FILE *stream, int format,
+extern int value_print PARAMS ((value_ptr val, GDB_FILE * stream, int format,
                                enum val_prettyprint pretty));
 
 extern void
-value_print_array_elements PARAMS ((value_ptr val, GDB_FILE* stream,
-                                   int format, enum val_prettyprint pretty));
+value_print_array_elements PARAMS ((value_ptr val, GDB_FILE * stream,
+                                 int format, enum val_prettyprint pretty));
 
 extern value_ptr
-value_release_to_mark PARAMS ((value_ptr mark));
+  value_release_to_mark PARAMS ((value_ptr mark));
 
 extern int
-val_print PARAMS ((struct type *type, char *valaddr, int embedded_offset, CORE_ADDR address,
-                  GDB_FILE *stream, int format, int deref_ref,
+val_print PARAMS ((struct type * type, char *valaddr, int embedded_offset, CORE_ADDR address,
+                  GDB_FILE * stream, int format, int deref_ref,
                   int recurse, enum val_prettyprint pretty));
 
 extern int
-val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE *stream));
+val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE * stream));
 
 extern void
-print_variable_value PARAMS ((struct symbol *var, struct frame_info *frame,
-                             GDB_FILE *stream));
+print_variable_value PARAMS ((struct symbol * var, struct frame_info * frame,
+                             GDB_FILE * stream));
 
 extern int check_field PARAMS ((value_ptr, const char *));
 
 extern void
-c_typedef_print PARAMS ((struct type *type, struct symbol *news, GDB_FILE *stream));
+c_typedef_print PARAMS ((struct type * type, struct symbol * news, GDB_FILE * stream));
 
 extern char *
-internalvar_name PARAMS ((struct internalvar *var));
+  internalvar_name PARAMS ((struct internalvar * var));
 
 extern void
 clear_value_history PARAMS ((void));
@@ -560,7 +567,7 @@ extern value_ptr value_slice PARAMS ((value_ptr, int, int));
 
 extern value_ptr call_function_by_hand PARAMS ((value_ptr, int, value_ptr *));
 
-extern value_ptr value_literal_complex PARAMS ((value_ptr, value_ptr, struct type*));
+extern value_ptr value_literal_complex PARAMS ((value_ptr, value_ptr, struct type *));
 
 extern void find_rt_vbase_offset PARAMS ((struct type *, struct type *, char *, int, int *, int *));
 
@@ -568,9 +575,9 @@ extern value_ptr find_function_in_inferior PARAMS ((char *));
 
 extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
 
-extern CORE_ADDR default_push_arguments PARAMS ((int nargs, value_ptr *args,
+extern CORE_ADDR default_push_arguments PARAMS ((int nargs, value_ptr * args,
                                                 CORE_ADDR sp,
                                                 int struct_return,
                                                 CORE_ADDR struct_addr));
 
-#endif /* !defined (VALUE_H) */
+#endif /* !defined (VALUE_H) */
index b3cc82f447a506a7501ba3bf41a315fae0d105dd..b4381cda54800ff1e91f220dc4d17250357ad2d5 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1986, 87, 89, 91, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdb_string.h"
@@ -56,10 +57,10 @@ static int vb_match PARAMS ((struct type *, int, struct type *));
 #define VALUE_HISTORY_CHUNK 60
 
 struct value_history_chunk
-{
-  struct value_history_chunk *next;
-  value_ptr values[VALUE_HISTORY_CHUNK];
-};
+  {
+    struct value_history_chunk *next;
+    value_ptr values[VALUE_HISTORY_CHUNK];
+  };
 
 /* Chain of chunks now in use.  */
 
@@ -111,12 +112,12 @@ allocate_repeat_value (type, count)
      struct type *type;
      int count;
 {
-  int low_bound = current_language->string_lower_bound; /* ??? */
+  int low_bound = current_language->string_lower_bound;                /* ??? */
   /* FIXME-type-allocation: need a way to free this type when we are
      done with it.  */
   struct type *range_type
-    = create_range_type ((struct type *) NULL, builtin_type_int,
-                        low_bound, count + low_bound - 1);
+  = create_range_type ((struct type *) NULL, builtin_type_int,
+                      low_bound, count + low_bound - 1);
   /* FIXME-type-allocation: need a way to free this type when we are
      done with it.  */
   return allocate_value (create_array_type ((struct type *) NULL,
@@ -273,8 +274,8 @@ record_latest_value (val)
   if (i == 0)
     {
       register struct value_history_chunk *new
-       = (struct value_history_chunk *)
-         xmalloc (sizeof (struct value_history_chunk));
+      = (struct value_history_chunk *)
+      xmalloc (sizeof (struct value_history_chunk));
       memset (new->values, 0, sizeof new->values);
       new->next = value_history_chain;
       value_history_chain = new;
@@ -340,9 +341,9 @@ clear_value_history ()
     {
       for (i = 0; i < VALUE_HISTORY_CHUNK; i++)
        if ((val = value_history_chain->values[i]) != NULL)
-         free ((PTR)val);
+         free ((PTR) val);
       next = value_history_chain->next;
-      free ((PTR)value_history_chain);
+      free ((PTR) value_history_chain);
       value_history_chain = next;
     }
   value_history_count = 0;
@@ -359,8 +360,8 @@ show_values (num_exp, from_tty)
 
   if (num_exp)
     {
-       /* "info history +" should print from the stored position.
-          "info history <exp>" should print around value number <exp>.  */
+      /* "info history +" should print from the stored position.
+         "info history <exp>" should print around value number <exp>.  */
       if (num_exp[0] != '+' || num_exp[1] != '\0')
        num = parse_and_eval_address (num_exp) - 5;
     }
@@ -435,7 +436,7 @@ value_of_internalvar (var)
 #ifdef IS_TRAPPED_INTERNALVAR
   if (IS_TRAPPED_INTERNALVAR (var->name))
     return VALUE_OF_TRAPPED_INTERNALVAR (var);
-#endif 
+#endif
 
   val = value_copy (var->value);
   if (VALUE_LAZY (val))
@@ -492,7 +493,7 @@ set_internalvar (var, val)
      something in the value chain (i.e., before release_value is
      called), because after the error free_all_values will get called before
      long.  */
-  free ((PTR)var->value);
+  free ((PTR) var->value);
   var->value = newval;
   release_value (newval);
   /* End code which must not call error().  */
@@ -517,9 +518,9 @@ clear_internalvars ()
     {
       var = internalvars;
       internalvars = var->next;
-      free ((PTR)var->name);
-      free ((PTR)var->value);
-      free ((PTR)var);
+      free ((PTR) var->name);
+      free ((PTR) var->value);
+      free ((PTR) var);
     }
 }
 
@@ -573,7 +574,7 @@ value_as_double (val)
 {
   DOUBLEST foo;
   int inv;
-  
+
   foo = unpack_double (VALUE_TYPE (val), VALUE_CONTENTS (val), &inv);
   if (inv)
     error ("Invalid floating value found in program.");
@@ -591,7 +592,7 @@ value_as_pointer (val)
   /* ADDR_BITS_REMOVE is wrong if we are being called for a
      non-address (e.g. argument to "signal", "info break", etc.), or
      for pointers to char, in which the low bits *are* significant.  */
-  return ADDR_BITS_REMOVE(value_as_long (val));
+  return ADDR_BITS_REMOVE (value_as_long (val));
 #else
   return value_as_long (val);
 #endif
@@ -644,10 +645,10 @@ unpack_long (type, valaddr)
     case TYPE_CODE_PTR:
     case TYPE_CODE_REF:
       /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
-        whether we want this to be true eventually.  */
+         whether we want this to be true eventually.  */
       if (GDB_TARGET_IS_D10V
          && len == 2)
-         return D10V_MAKE_DADDR (extract_address (valaddr, len));
+       return D10V_MAKE_DADDR (extract_address (valaddr, len));
       return extract_address (valaddr, len);
 
     case TYPE_CODE_MEMBER:
@@ -656,7 +657,7 @@ unpack_long (type, valaddr)
     default:
       error ("Value can't be converted to integer.");
     }
-  return 0; /* Placate lint.  */
+  return 0;                    /* Placate lint.  */
 }
 
 /* Return a double value from the specified type and address.
@@ -752,12 +753,12 @@ value_static_field (type, fieldno)
       if (sym == NULL)
        {
          /* With some compilers, e.g. HP aCC, static data members are reported
-            as non-debuggable symbols */ 
-         struct minimal_symbol * msym = lookup_minimal_symbol (phys_name, NULL, NULL);
+            as non-debuggable symbols */
+         struct minimal_symbol *msym = lookup_minimal_symbol (phys_name, NULL, NULL);
          if (!msym)
            return NULL;
          else
-           {     
+           {
              addr = SYMBOL_VALUE_ADDRESS (msym);
              sect = SYMBOL_BFD_SECTION (msym);
            }
@@ -797,7 +798,7 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
       v = value_from_longest (type,
                              unpack_field_as_long (arg_type,
                                                    VALUE_CONTENTS (arg1)
-                                                     + offset,
+                                                   + offset,
                                                    fieldno));
       VALUE_BITPOS (v) = TYPE_FIELD_BITPOS (arg_type, fieldno) % 8;
       VALUE_BITSIZE (v) = TYPE_FIELD_BITSIZE (arg_type, fieldno);
@@ -816,9 +817,9 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
                TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg1)));
       VALUE_OFFSET (v) = VALUE_OFFSET (arg1);
       VALUE_EMBEDDED_OFFSET (v)
-        = offset + 
-          VALUE_EMBEDDED_OFFSET (arg1) + 
-          TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
+       = offset +
+       VALUE_EMBEDDED_OFFSET (arg1) +
+       TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
     }
   else
     {
@@ -838,7 +839,7 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
     VALUE_LVAL (v) = lval_internalvar_component;
   VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
 /*  VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
-                    + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
+   + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
   return v;
 }
 
@@ -872,26 +873,26 @@ value_fn_field (arg1p, f, j, type, offset)
 
   sym = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
                       0, VAR_NAMESPACE, 0, NULL);
-  if (! sym) 
-       return NULL;
+  if (!sym)
+    return NULL;
 /*
-       error ("Internal error: could not find physical method named %s",
-                   TYPE_FN_FIELD_PHYSNAME (f, j));
-*/
-  
+   error ("Internal error: could not find physical method named %s",
+   TYPE_FN_FIELD_PHYSNAME (f, j));
+ */
+
   v = allocate_value (ftype);
   VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
   VALUE_TYPE (v) = ftype;
 
   if (arg1p)
-   {
-    if (type != VALUE_TYPE (*arg1p))
-      *arg1p = value_ind (value_cast (lookup_pointer_type (type),
-                                     value_addr (*arg1p)));
-
-    /* Move the `this' pointer according to the offset. 
-    VALUE_OFFSET (*arg1p) += offset;
-    */
+    {
+      if (type != VALUE_TYPE (*arg1p))
+       *arg1p = value_ind (value_cast (lookup_pointer_type (type),
+                                       value_addr (*arg1p)));
+
+      /* Move the `this' pointer according to the offset. 
+         VALUE_OFFSET (*arg1p) += offset;
+       */
     }
 
   return v;
@@ -920,115 +921,115 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
     {
       /* Deal with HP/Taligent runtime model for virtual functions */
       value_ptr vp;
-      value_ptr argp;        /* arg1 cast to base */
-      CORE_ADDR vfunc_addr;  /* address of virtual method */
-      CORE_ADDR coreptr;     /* pointer to target address */ 
-      int class_index;       /* which class segment pointer to use */
-      struct type * ftype = TYPE_FN_FIELD_TYPE (f, j);   /* method type */
+      value_ptr argp;          /* arg1 cast to base */
+      CORE_ADDR vfunc_addr;    /* address of virtual method */
+      CORE_ADDR coreptr;       /* pointer to target address */
+      int class_index;         /* which class segment pointer to use */
+      struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);  /* method type */
 
       argp = value_cast (type, *arg1p);
 
       if (VALUE_ADDRESS (argp) == 0)
-        error ("Address of object is null; object may not have been created.");
-      
+       error ("Address of object is null; object may not have been created.");
+
       /* pai: FIXME -- 32x64 possible problem? */
       /* First word (4 bytes) in object layout is the vtable pointer */
-      coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (argp)); /* pai: (temp)  */
-                                 /* + offset + VALUE_EMBEDDED_OFFSET (argp)); */ 
+      coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (argp));                /* pai: (temp)  */
+      /* + offset + VALUE_EMBEDDED_OFFSET (argp)); */
 
       if (!coreptr)
-        error ("Virtual table pointer is null for object; object may not have been created.");
-      
+       error ("Virtual table pointer is null for object; object may not have been created.");
+
       /* pai/1997-05-09
        * FIXME: The code here currently handles only
        * the non-RRBC case of the Taligent/HP runtime spec; when RRBC
        * is introduced, the condition for the "if" below will have to
        * be changed to be a test for the RRBC case.  */
-       
+
       if (1)
-        {
-          /* Non-RRBC case; the virtual function pointers are stored at fixed
-           * offsets in the virtual table. */
-
-          /* Retrieve the offset in the virtual table from the debug
-           * info.  The offset of the vfunc's entry is in words from
-           * the beginning of the vtable; but first we have to adjust
-           * by HP_ACC_VFUNC_START to account for other entries */
-          
-          /* pai: FIXME: 32x64 problem here, a word may be 8 bytes in
-           * which case the multiplier should be 8 and values should be long */
-          vp = value_at (builtin_type_int,
-                         coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) + HP_ACC_VFUNC_START), NULL);
-          
-          coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
-          /* coreptr now contains the address of the virtual function */
-          /* (Actually, it contains the pointer to the plabel for the function. */
-        }
+       {
+         /* Non-RRBC case; the virtual function pointers are stored at fixed
+          * offsets in the virtual table. */
+
+         /* Retrieve the offset in the virtual table from the debug
+          * info.  The offset of the vfunc's entry is in words from
+          * the beginning of the vtable; but first we have to adjust
+          * by HP_ACC_VFUNC_START to account for other entries */
+
+         /* pai: FIXME: 32x64 problem here, a word may be 8 bytes in
+          * which case the multiplier should be 8 and values should be long */
+         vp = value_at (builtin_type_int,
+                        coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) + HP_ACC_VFUNC_START), NULL);
+
+         coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
+         /* coreptr now contains the address of the virtual function */
+         /* (Actually, it contains the pointer to the plabel for the function. */
+       }
       else
-        {
-          /* RRBC case; the virtual function pointers are found by double
-           * indirection through the class segment tables. */
-          
-          /* Choose class segment depending on type we were passed */ 
-          class_index = class_index_in_primary_list (type);
-      
-          /* Find class segment pointer.  These are in the vtable slots after
-           * some other entries, so adjust by HP_ACC_VFUNC_START for that. */
-          /* pai: FIXME 32x64 problem here, if words are 8 bytes long
-           * the multiplier below has to be 8 and value should be long. */
-          vp = value_at (builtin_type_int,
-                         coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
-          /* Indirect once more, offset by function index */
-          /* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
-          coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp) + 4 * TYPE_FN_FIELD_VOFFSET (f, j));
-          vp = value_at (builtin_type_int, coreptr, NULL);
-          coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
-          
-          /* coreptr now contains the address of the virtual function */
-          /* (Actually, it contains the pointer to the plabel for the function.) */
-          
-        }
+       {
+         /* RRBC case; the virtual function pointers are found by double
+          * indirection through the class segment tables. */
+
+         /* Choose class segment depending on type we were passed */
+         class_index = class_index_in_primary_list (type);
+
+         /* Find class segment pointer.  These are in the vtable slots after
+          * some other entries, so adjust by HP_ACC_VFUNC_START for that. */
+         /* pai: FIXME 32x64 problem here, if words are 8 bytes long
+          * the multiplier below has to be 8 and value should be long. */
+         vp = value_at (builtin_type_int,
+                   coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
+         /* Indirect once more, offset by function index */
+         /* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
+         coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp) + 4 * TYPE_FN_FIELD_VOFFSET (f, j));
+         vp = value_at (builtin_type_int, coreptr, NULL);
+         coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
+
+         /* coreptr now contains the address of the virtual function */
+         /* (Actually, it contains the pointer to the plabel for the function.) */
+
+       }
 
       if (!coreptr)
-        error ("Address of virtual function is null; error in virtual table?");
+       error ("Address of virtual function is null; error in virtual table?");
 
-      /* Wrap this addr in a value and return pointer */ 
+      /* Wrap this addr in a value and return pointer */
       vp = allocate_value (ftype);
       VALUE_TYPE (vp) = ftype;
       VALUE_ADDRESS (vp) = coreptr;
-      
+
       /* pai: (temp) do we need the value_ind stuff in value_fn_field? */
       return vp;
     }
-  else  
-    { /* Not using HP/Taligent runtime conventions; so try to
-       * use g++ conventions for virtual table */
-      
+  else
+    {                          /* Not using HP/Taligent runtime conventions; so try to
+                                * use g++ conventions for virtual table */
+
       struct type *entry_type;
       /* First, get the virtual function table pointer.  That comes
          with a strange type, so cast it to type `pointer to long' (which
          should serve just fine as a function type).  Then, index into
          the table, and convert final value to appropriate function type.  */
       value_ptr entry, vfn, vtbl;
-      value_ptr vi = value_from_longest (builtin_type_int, 
-                                         (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
+      value_ptr vi = value_from_longest (builtin_type_int,
+                                   (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
       struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
       struct type *context;
       if (fcontext == NULL)
-       /* We don't have an fcontext (e.g. the program was compiled with
-          g++ version 1).  Try to get the vtbl from the TYPE_VPTR_BASETYPE.
-          This won't work right for multiple inheritance, but at least we
-          should do as well as GDB 3.x did.  */
-        fcontext = TYPE_VPTR_BASETYPE (type);
+       /* We don't have an fcontext (e.g. the program was compiled with
+          g++ version 1).  Try to get the vtbl from the TYPE_VPTR_BASETYPE.
+          This won't work right for multiple inheritance, but at least we
+          should do as well as GDB 3.x did.  */
+       fcontext = TYPE_VPTR_BASETYPE (type);
       context = lookup_pointer_type (fcontext);
       /* Now context is a pointer to the basetype containing the vtbl.  */
       if (TYPE_TARGET_TYPE (context) != type1)
-        {
+       {
          value_ptr tmp = value_cast (context, value_addr (arg1));
          VALUE_POINTED_TO_OFFSET (tmp) = 0;
-          arg1 = value_ind (tmp);
-          type1 = check_typedef (VALUE_TYPE (arg1));
-        }
+         arg1 = value_ind (tmp);
+         type1 = check_typedef (VALUE_TYPE (arg1));
+       }
 
       context = type1;
       /* Now context is the basetype containing the vtbl.  */
@@ -1037,17 +1038,17 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
          was.  If so, fill in the virtual function table entry for the
          type now.  */
       if (TYPE_VPTR_FIELDNO (context) < 0)
-        fill_in_vptr_fieldno (context);
+       fill_in_vptr_fieldno (context);
 
       /* The virtual function table is now an array of structures
          which have the form { int16 offset, delta; void *pfn; }.  */
       vtbl = value_primitive_field (arg1, 0, TYPE_VPTR_FIELDNO (context),
                                    TYPE_VPTR_BASETYPE (context));
-      
+
       /* With older versions of g++, the vtbl field pointed to an array
-        of structures.  Nowadays it points directly to the structure. */
+         of structures.  Nowadays it points directly to the structure. */
       if (TYPE_CODE (VALUE_TYPE (vtbl)) == TYPE_CODE_PTR
-         && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (vtbl))) == TYPE_CODE_ARRAY)
+      && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (vtbl))) == TYPE_CODE_ARRAY)
        {
          /* Handle the case where the vtbl field points to an
             array of structures. */
@@ -1069,22 +1070,22 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
       entry_type = check_typedef (VALUE_TYPE (entry));
 
       if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
-        {
-          /* Move the `this' pointer according to the virtual function table. */
-          VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
-
-          if (! VALUE_LAZY (arg1))
-            {
-              VALUE_LAZY (arg1) = 1;
-              value_fetch_lazy (arg1);
-            }
-
-          vfn = value_field (entry, 2);
-        }
+       {
+         /* Move the `this' pointer according to the virtual function table. */
+         VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
+
+         if (!VALUE_LAZY (arg1))
+           {
+             VALUE_LAZY (arg1) = 1;
+             value_fetch_lazy (arg1);
+           }
+
+         vfn = value_field (entry, 2);
+       }
       else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
-        vfn = entry;
+       vfn = entry;
       else
-        error ("I'm confused:  virtual function table has bad type");
+       error ("I'm confused:  virtual function table has bad type");
       /* Reinstantiate the function pointer with the correct type.  */
       VALUE_TYPE (vfn) = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
 
@@ -1131,9 +1132,9 @@ value_headof (in_arg, btype, dtype)
       || !VTBL_PREFIX_P (demangled_name))
     {
       /* If we expected to find a vtable, but did not, let the user
-        know that we aren't happy, but don't throw an error.
-        FIXME: there has to be a better way to do this.  */
-      struct type *error_type = (struct type *)xmalloc (sizeof (struct type));
+         know that we aren't happy, but don't throw an error.
+         FIXME: there has to be a better way to do this.  */
+      struct type *error_type = (struct type *) xmalloc (sizeof (struct type));
       memcpy (error_type, VALUE_TYPE (in_arg), sizeof (struct type));
       TYPE_NAME (error_type) = savestring ("suspicious *", sizeof ("suspicious *"));
       VALUE_TYPE (in_arg) = error_type;
@@ -1145,8 +1146,8 @@ value_headof (in_arg, btype, dtype)
   nelems = longest_to_int (value_as_long (value_field (entry, 2)));
   for (i = 1; i <= nelems; i++)
     {
-      entry = value_subscript (vtbl, value_from_longest (builtin_type_int, 
-                                                     (LONGEST) i));
+      entry = value_subscript (vtbl, value_from_longest (builtin_type_int,
+                                                        (LONGEST) i));
       /* This won't work if we're using thunks. */
       if (TYPE_CODE (check_typedef (VALUE_TYPE (entry))) != TYPE_CODE_STRUCT)
        break;
@@ -1167,7 +1168,7 @@ value_headof (in_arg, btype, dtype)
        * But we leave it in for future use, when we will hopefully
        * have optimizes the vtable to use thunks instead of offsets. */
       /* Use the name of vtable itself to extract a base type. */
-      demangled_name += 4;  /* Skip _vt$ prefix. */
+      demangled_name += 4;     /* Skip _vt$ prefix. */
     }
   else
     {
@@ -1185,7 +1186,8 @@ value_headof (in_arg, btype, dtype)
       arg = value_add (value_cast (builtin_type_int, arg),
                       value_field (best_entry, 0));
     }
-  else arg = in_arg;
+  else
+    arg = in_arg;
   VALUE_TYPE (arg) = lookup_pointer_type (SYMBOL_TYPE (sym));
   return arg;
 }
@@ -1282,23 +1284,23 @@ baseclass_offset (type, index, valaddr, address)
       register int n_baseclasses = TYPE_N_BASECLASSES (type);
 
       /* First look for the virtual baseclass pointer
-        in the fields.  */
+         in the fields.  */
       for (i = n_baseclasses; i < len; i++)
        {
          if (vb_match (type, i, basetype))
            {
              CORE_ADDR addr
-               = unpack_pointer (TYPE_FIELD_TYPE (type, i),
-                                 valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
+             = unpack_pointer (TYPE_FIELD_TYPE (type, i),
+                               valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
 
              return addr - (LONGEST) address;
            }
        }
       /* Not in the fields, so try looking through the baseclasses.  */
-      for (i = index+1; i < n_baseclasses; i++)
+      for (i = index + 1; i < n_baseclasses; i++)
        {
          int boffset =
-             baseclass_offset (type, i, valaddr, address);
+         baseclass_offset (type, i, valaddr, address);
          if (boffset)
            return boffset;
        }
@@ -1388,10 +1390,10 @@ modify_field (addr, fieldval, bitpos, bitsize)
 
   /* Warn if value is too big to fit in the field in question.  */
   if (bitsize < (8 * (int) sizeof (fieldval))
-      && 0 != (fieldval & ~((1<<bitsize)-1)))
+      && 0 != (fieldval & ~((1 << bitsize) - 1)))
     {
       /* FIXME: would like to include fieldval in the message, but
-        we don't have a sprintf_longest.  */
+         we don't have a sprintf_longest.  */
       warning ("Value does not fit in %d bits.", bitsize);
 
       /* Truncate it, otherwise adjoining fields may be corrupted.  */
@@ -1406,9 +1408,9 @@ modify_field (addr, fieldval, bitpos, bitsize)
 
   /* Mask out old value, while avoiding shifts >= size of oword */
   if (bitsize < 8 * (int) sizeof (oword))
-    oword &= ~(((((ULONGEST)1) << bitsize) - 1) << bitpos);
+    oword &= ~(((((ULONGEST) 1) << bitsize) - 1) << bitpos);
   else
-    oword &= ~((~(ULONGEST)0) << bitpos);
+    oword &= ~((~(ULONGEST) 0) << bitpos);
   oword |= fieldval << bitpos;
 
   store_signed_integer (addr, sizeof oword, oword);
@@ -1424,7 +1426,7 @@ value_from_longest (type, num)
   register value_ptr val = allocate_value (type);
   register enum type_code code;
   register int len;
- retry:
+retry:
   code = TYPE_CODE (type);
   len = TYPE_LENGTH (type);
 
@@ -1440,14 +1442,14 @@ value_from_longest (type, num)
     case TYPE_CODE_RANGE:
       store_signed_integer (VALUE_CONTENTS_RAW (val), len, num);
       break;
-      
+
     case TYPE_CODE_REF:
     case TYPE_CODE_PTR:
       /* This assumes that all pointers of a given length
-        have the same form.  */
+         have the same form.  */
       store_address (VALUE_CONTENTS_RAW (val), len, (CORE_ADDR) num);
       break;
-      
+
     default:
       error ("Unexpected type (%d) encountered for integer constant.", code);
     }
@@ -1464,16 +1466,16 @@ value_from_string (ptr)
      char *ptr;
 {
   value_ptr val;
-  int   len = strlen (ptr);
+  int len = strlen (ptr);
   int lowbound = current_language->string_lower_bound;
-  struct type *rangetype = 
-    create_range_type ((struct type *) NULL, 
-                      builtin_type_int,
-                      lowbound, len + lowbound - 1);
-  struct type *stringtype = 
-    create_array_type ((struct type *) NULL, 
-                      *current_language->string_char_type, 
-                      rangetype);
+  struct type *rangetype =
+  create_range_type ((struct type *) NULL,
+                    builtin_type_int,
+                    lowbound, len + lowbound - 1);
+  struct type *stringtype =
+  create_array_type ((struct type *) NULL,
+                    *current_language->string_char_type,
+                    rangetype);
 
   val = allocate_value (stringtype);
   memcpy (VALUE_CONTENTS_RAW (val), ptr, len);
@@ -1519,7 +1521,7 @@ value_being_returned (valtype, retbuf, struct_return)
      register struct type *valtype;
      char *retbuf;
      int struct_return;
-     /*ARGSUSED*/
+     /*ARGSUSED */
 {
   register value_ptr val;
   CORE_ADDR addr;
@@ -1560,12 +1562,12 @@ int
 generic_use_struct_convention (gcc_p, value_type)
      int gcc_p;
      struct type *value_type;
-{     
+{
   return !((gcc_p == 1)
-           && (TYPE_LENGTH (value_type) == 1
-               || TYPE_LENGTH (value_type) == 2
-               || TYPE_LENGTH (value_type) == 4
-               || TYPE_LENGTH (value_type) == 8));
+          && (TYPE_LENGTH (value_type) == 1
+              || TYPE_LENGTH (value_type) == 2
+              || TYPE_LENGTH (value_type) == 4
+              || TYPE_LENGTH (value_type) == 8));
 }
 
 #ifndef USE_STRUCT_CONVENTION
@@ -1593,7 +1595,7 @@ using_struct_return (function, funcaddr, value_type, gcc_p)
      CORE_ADDR funcaddr;
      struct type *value_type;
      int gcc_p;
-     /*ARGSUSED*/
+     /*ARGSUSED */
 {
   register enum type_code code = TYPE_CODE (value_type);
 
@@ -1623,7 +1625,7 @@ set_return_value (val)
   if (code == TYPE_CODE_ERROR)
     error ("Function return type unknown.");
 
-  if (   code == TYPE_CODE_STRUCT
+  if (code == TYPE_CODE_STRUCT
       || code == TYPE_CODE_UNION)      /* FIXME, implement struct return.  */
     error ("GDB does not support specifying a struct or union return value.");
 
@@ -1634,7 +1636,7 @@ void
 _initialize_values ()
 {
   add_cmd ("convenience", no_class, show_convenience,
-           "Debugger convenience (\"$foo\") variables.\n\
+          "Debugger convenience (\"$foo\") variables.\n\
 These variables are created when you assign them values;\n\
 thus, \"print $foo=1\" gives \"$foo\" the value 1.  Values may be any type.\n\n\
 A few convenience variables are given values automatically:\n\
index a629da6f369411f50124697e2be2901547721bee..c344b4334c85ca04146e809261acba75264db25f 100644 (file)
@@ -1,21 +1,22 @@
 /* Print VAX instructions for GDB, the GNU debugger.
    Copyright 1986, 1989, 1991, 1992, 1996 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -38,24 +39,24 @@ vax_skip_prologue (pc)
 {
   register int op = (unsigned char) read_memory_integer (pc, 1);
   if (op == 0x11)
-    pc += 2;  /* skip brb */
+    pc += 2;                   /* skip brb */
   if (op == 0x31)
-    pc += 3;  /* skip brw */
+    pc += 3;                   /* skip brw */
   if (op == 0xC2
-      && ((unsigned char) read_memory_integer (pc+2, 1)) == 0x5E)
-    pc += 3;  /* skip subl2 */
+      && ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5E)
+    pc += 3;                   /* skip subl2 */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xAE
-      && ((unsigned char) read_memory_integer(pc+3, 1)) == 0x5E)
-    pc += 4;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xAE
+      && ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5E)
+    pc += 4;                   /* skip movab */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xCE
-      && ((unsigned char) read_memory_integer(pc+4, 1)) == 0x5E)
-    pc += 5;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xCE
+      && ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5E)
+    pc += 5;                   /* skip movab */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc+1, 1)) == 0xEE
-      && ((unsigned char) read_memory_integer(pc+6, 1)) == 0x5E)
-    pc += 7;  /* skip movab */
+      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xEE
+      && ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5E)
+    pc += 7;                   /* skip movab */
   return pc;
 }
 
@@ -94,7 +95,7 @@ vax_print_insn (memaddr, info)
 
   for (i = 0; i < NOPCODES; i++)
     if (votstrs[i].detail.code == buffer[0]
-       || votstrs[i].detail.code == *(unsigned short *)buffer)
+       || votstrs[i].detail.code == *(unsigned short *) buffer)
       break;
 
   /* Handle undefined instructions.  */
@@ -140,7 +141,7 @@ print_insn_arg (d, p, addr, info)
        (*info->fprintf_func) (info->stream, "0x%x", addr + *p++ + 1);
       else
        {
-         (*info->fprintf_func) (info->stream, "0x%x", addr + *(short *)p + 2);
+         (*info->fprintf_func) (info->stream, "0x%x", addr + *(short *) p + 2);
          p += 2;
        }
     }
@@ -153,7 +154,7 @@ print_insn_arg (d, p, addr, info)
       case 3:                  /* Literal mode */
        if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
          {
-           *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
+           *(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
            (*info->fprintf_func) (info->stream, "$%f", floatlitbuf);
          }
        else
@@ -180,7 +181,7 @@ print_insn_arg (d, p, addr, info)
        if (regnum == PC_REGNUM)
          {
            (*info->fprintf_func) (info->stream, "#");
-           info->target = *(long *)p;
+           info->target = *(long *) p;
            (*info->print_address_func) (info->target, info);
            p += 4;
            break;
@@ -196,25 +197,25 @@ print_insn_arg (d, p, addr, info)
                break;
 
              case 'w':
-               (*info->fprintf_func) (info->stream, "%d", *(short *)p);
+               (*info->fprintf_func) (info->stream, "%d", *(short *) p);
                p += 2;
                break;
 
              case 'l':
-               (*info->fprintf_func) (info->stream, "%d", *(long *)p);
+               (*info->fprintf_func) (info->stream, "%d", *(long *) p);
                p += 4;
                break;
 
              case 'q':
                (*info->fprintf_func) (info->stream, "0x%x%08x",
-                                      ((long *)p)[1], ((long *)p)[0]);
+                                      ((long *) p)[1], ((long *) p)[0]);
                p += 8;
                break;
 
              case 'o':
                (*info->fprintf_func) (info->stream, "0x%x%08x%08x%08x",
-                                      ((long *)p)[3], ((long *)p)[2],
-                                      ((long *)p)[1], ((long *)p)[0]);
+                                      ((long *) p)[3], ((long *) p)[2],
+                                      ((long *) p)[1], ((long *) p)[0]);
                p += 16;
                break;
 
@@ -232,7 +233,7 @@ print_insn_arg (d, p, addr, info)
                if (INVALID_FLOAT (p, 8))
                  (*info->fprintf_func) (info->stream,
                                         "<<invalid float 0x%x%08x>>",
-                                        ((long *)p)[1], ((long *)p)[0]);
+                                        ((long *) p)[1], ((long *) p)[0]);
                else
                  (*info->fprintf_func) (info->stream, "%f", *(double *) p);
                p += 8;
@@ -272,12 +273,12 @@ print_insn_arg (d, p, addr, info)
       case 12:                 /* Word displacement */
        if (regnum == PC_REGNUM)
          {
-           info->target = addr + *(short *)p + 3;
+           info->target = addr + *(short *) p + 3;
            (*info->print_address_func) (info->target, info);
          }
        else
          (*info->fprintf_func) (info->stream, "%d(%s)",
-                                *(short *)p, REGISTER_NAME (regnum));
+                                *(short *) p, REGISTER_NAME (regnum));
        p += 2;
        break;
 
@@ -286,12 +287,12 @@ print_insn_arg (d, p, addr, info)
       case 14:                 /* Long displacement */
        if (regnum == PC_REGNUM)
          {
-           info->target = addr + *(short *)p + 5;
+           info->target = addr + *(short *) p + 5;
            (*info->print_address_func) (info->target, info);
          }
        else
          (*info->fprintf_func) (info->stream, "%d(%s)",
-                                *(long *)p, REGISTER_NAME (regnum));
+                                *(long *) p, REGISTER_NAME (regnum));
        p += 4;
       }
 
index 9546616af4e922968baac41fd1fc070272cd8e67..e575ff72809634aa3b729c5e32ed7bcbdbbca255 100644 (file)
@@ -15,7 +15,8 @@
 
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
    Contributed by Steve Chamberlain
@@ -159,7 +160,7 @@ gb (x)
   return read_memory_integer (x, 1) & 0xff;
 }
 
-extern CORE_ADDR 
+extern CORE_ADDR
 w65_skip_prologue (pc)
      CORE_ADDR pc;
 {
index d01a26582a7690d6d200ec551b059906f680512a..ff98186865b83666a8fa1f5646e92bea736daef4 100644 (file)
@@ -3,21 +3,22 @@
 
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
@@ -159,7 +160,7 @@ w89k_supply_register (regname, regnamelen, val, vallen)
 
 static int hashmark = 1;       /* flag set by "set hash" */
 
-extern struct monitor_ops w89k_cmds; /* fwd decl */
+extern struct monitor_ops w89k_cmds;   /* fwd decl */
 
 static void
 w89k_load (desc, file, hashmark)
@@ -186,7 +187,7 @@ w89k_load (desc, file, hashmark)
       printf_filtered ("File is not an object file\n");
       return;
     }
-  
+
   for (s = abfd->sections; s; s = s->next)
     if (s->flags & SEC_LOAD)
       {
@@ -228,8 +229,8 @@ w89k_load (desc, file, hashmark)
 
        putchar_unfiltered ('\n');
       }                                /* Loadable sections */
-  
-  if (hashmark) 
+
+  if (hashmark)
     putchar_unfiltered ('\n');
 }
 
@@ -241,60 +242,61 @@ w89k_load (desc, file, hashmark)
 
 static struct target_ops w89k_ops;
 
-static char *w89k_inits[] = {"\n", NULL};
+static char *w89k_inits[] =
+{"\n", NULL};
 
-static struct monitor_ops w89k_cmds ;
+static struct monitor_ops w89k_cmds;
 static void
-init_w89k_cmds(void)
+init_w89k_cmds (void)
 {
-  w89k_cmds.flags =   MO_GETMEM_NEEDS_RANGE|MO_FILL_USES_ADDR; /* flags */
-  w89k_cmds.init =   w89k_inits;               /* Init strings */
-  w89k_cmds.cont =   "g\n";                    /* continue command */
-  w89k_cmds.step =   "t\n";                    /* single step */
-  w89k_cmds.stop =   "\003";                   /* Interrupt char (^C) */
-  w89k_cmds.set_break =   "bp %x\n";           /* set a breakpoint */
-  w89k_cmds.clr_break =   "bc %x\n";           /* clear a breakpoint */
-  w89k_cmds.clr_all_break =   "bc *\n";                /* clear all breakpoints */
-  w89k_cmds.fill =   "f %x %x %x\n";           /* memory fill cmd */
-  w89k_cmds.setmem.cmdb =     "eb %x %x\n";    /* setmem.cmdb (addr, value) */
-  w89k_cmds.setmem.cmdw =     "eh %x %x\n";    /* setmem.cmdw (addr, value) */
-  w89k_cmds.setmem.cmdl =     "ew %x %x\n";    /* setmem.cmdl (addr, value) */
-  w89k_cmds.setmem.cmdll =     NULL;           /* setmem.cmdll (addr, value) */
-  w89k_cmds.setmem.resp_delim =     NULL;      /* setreg.resp_delim */
-  w89k_cmds.setmem.term =     NULL;            /* setreg.term */
-  w89k_cmds.setmem.term_cmd =     NULL;                /* setreg.term_cmd */
-  w89k_cmds.getmem.cmdb =     "db %x %x\n";/* getmem.cmdb (startaddr, endaddr) */
-  w89k_cmds.getmem.cmdw =     "dh %x %x\n";/* getmem.cmdw (startaddr, endaddr) */
-  w89k_cmds.getmem.cmdl =     "dw %x %x\n";/* getmem.cmdl (startaddr, endaddr) */
-  w89k_cmds.getmem.cmdll =     NULL;     /* getmem.cmdll (startaddr, endaddr) */
-  w89k_cmds.getmem.resp_delim =     "  ";      /* getmem.resp_delim */
-  w89k_cmds.getmem.term =     NULL;            /* getmem.term */
-  w89k_cmds.getmem.term_cmd =     NULL;                /* getmem.term_cmd */
-  w89k_cmds.setreg.cmd =     "r %s %x\n";      /* setreg.cmd (name, value) */
-  w89k_cmds.setreg.resp_delim =     NULL;      /* setreg.resp_delim */
-  w89k_cmds.setreg.term =     NULL;            /* setreg.term */
-  w89k_cmds.setreg.term_cmd =     NULL;                /* setreg.term_cmd */
-  w89k_cmds.getreg.cmd =     "r %s\n";         /* getreg.cmd (name) */
-  w89k_cmds.getreg.resp_delim =     "\r";      /* getreg.resp_delim */
-  w89k_cmds.getreg.term =     NULL;            /* getreg.term */
-  w89k_cmds.getreg.term_cmd =     NULL;                /* getreg.term_cmd */
-  w89k_cmds.dump_registers =   "r\n";          /* dump_registers */
-  w89k_cmds.register_pattern =   "\\(\\w+\\)\\( +[0-9a-fA-F]+\\b\\)+";
-  w89k_cmds.supply_register =   w89k_supply_register;          /* supply_register */
-  w89k_cmds.load_routine =   w89k_load;                /* load routine */
-  w89k_cmds.load =   "u %x\n";                 /* download command */
-  w89k_cmds.loadresp =   "\021";               /* load response (^Q) */
-  w89k_cmds.prompt =   "ROM>";                 /* monitor command prompt */
-  w89k_cmds.line_term =   "\n";                        /* end-of-line terminator */
-  w89k_cmds.cmd_end =   NULL;                  /* optional command terminator */
-  w89k_cmds.target =   &w89k_ops;              /* target operations */
-  w89k_cmds.stopbits =   SERIAL_1_STOPBITS;    /* number of stop bits */
-  w89k_cmds.regnames =   w89k_regnames;                /* register names */
-  w89k_cmds.magic =   MONITOR_OPS_MAGIC        ;       /* magic */
-} /* init_w89k_cmds */
-    
+  w89k_cmds.flags = MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR; /* flags */
+  w89k_cmds.init = w89k_inits; /* Init strings */
+  w89k_cmds.cont = "g\n";      /* continue command */
+  w89k_cmds.step = "t\n";      /* single step */
+  w89k_cmds.stop = "\003";     /* Interrupt char (^C) */
+  w89k_cmds.set_break = "bp %x\n";     /* set a breakpoint */
+  w89k_cmds.clr_break = "bc %x\n";     /* clear a breakpoint */
+  w89k_cmds.clr_all_break = "bc *\n";  /* clear all breakpoints */
+  w89k_cmds.fill = "f %x %x %x\n";     /* memory fill cmd */
+  w89k_cmds.setmem.cmdb = "eb %x %x\n";                /* setmem.cmdb (addr, value) */
+  w89k_cmds.setmem.cmdw = "eh %x %x\n";                /* setmem.cmdw (addr, value) */
+  w89k_cmds.setmem.cmdl = "ew %x %x\n";                /* setmem.cmdl (addr, value) */
+  w89k_cmds.setmem.cmdll = NULL;       /* setmem.cmdll (addr, value) */
+  w89k_cmds.setmem.resp_delim = NULL;  /* setreg.resp_delim */
+  w89k_cmds.setmem.term = NULL;        /* setreg.term */
+  w89k_cmds.setmem.term_cmd = NULL;    /* setreg.term_cmd */
+  w89k_cmds.getmem.cmdb = "db %x %x\n";                /* getmem.cmdb (startaddr, endaddr) */
+  w89k_cmds.getmem.cmdw = "dh %x %x\n";                /* getmem.cmdw (startaddr, endaddr) */
+  w89k_cmds.getmem.cmdl = "dw %x %x\n";                /* getmem.cmdl (startaddr, endaddr) */
+  w89k_cmds.getmem.cmdll = NULL;       /* getmem.cmdll (startaddr, endaddr) */
+  w89k_cmds.getmem.resp_delim = "  ";  /* getmem.resp_delim */
+  w89k_cmds.getmem.term = NULL;        /* getmem.term */
+  w89k_cmds.getmem.term_cmd = NULL;    /* getmem.term_cmd */
+  w89k_cmds.setreg.cmd = "r %s %x\n";  /* setreg.cmd (name, value) */
+  w89k_cmds.setreg.resp_delim = NULL;  /* setreg.resp_delim */
+  w89k_cmds.setreg.term = NULL;        /* setreg.term */
+  w89k_cmds.setreg.term_cmd = NULL;    /* setreg.term_cmd */
+  w89k_cmds.getreg.cmd = "r %s\n";     /* getreg.cmd (name) */
+  w89k_cmds.getreg.resp_delim = "\r";  /* getreg.resp_delim */
+  w89k_cmds.getreg.term = NULL;        /* getreg.term */
+  w89k_cmds.getreg.term_cmd = NULL;    /* getreg.term_cmd */
+  w89k_cmds.dump_registers = "r\n";    /* dump_registers */
+  w89k_cmds.register_pattern = "\\(\\w+\\)\\( +[0-9a-fA-F]+\\b\\)+";
+  w89k_cmds.supply_register = w89k_supply_register;    /* supply_register */
+  w89k_cmds.load_routine = w89k_load;  /* load routine */
+  w89k_cmds.load = "u %x\n";   /* download command */
+  w89k_cmds.loadresp = "\021"; /* load response (^Q) */
+  w89k_cmds.prompt = "ROM>";   /* monitor command prompt */
+  w89k_cmds.line_term = "\n";  /* end-of-line terminator */
+  w89k_cmds.cmd_end = NULL;    /* optional command terminator */
+  w89k_cmds.target = &w89k_ops;        /* target operations */
+  w89k_cmds.stopbits = SERIAL_1_STOPBITS;      /* number of stop bits */
+  w89k_cmds.regnames = w89k_regnames;  /* register names */
+  w89k_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
+}                              /* init_w89k_cmds */
+
 static void
-w89k_open(args, from_tty)
+w89k_open (args, from_tty)
      char *args;
      int from_tty;
 {
@@ -304,7 +306,7 @@ w89k_open(args, from_tty)
 void
 _initialize_w89k ()
 {
-  init_w89k_cmds() ;
+  init_w89k_cmds ();
   init_monitor_ops (&w89k_ops);
 
   w89k_ops.to_shortname = "w89k";
index fa19797a6b001e4ff66921be3e0aaa0929ba51e3..71d8efd580932161e0dea165b05d6c6a1d17b7f1 100644 (file)
@@ -16,8 +16,9 @@
 
    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.
-*/
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+ */
 
 /* by Steve Chamberlain, sac@cygnus.com */
 
@@ -84,16 +85,18 @@ static int last_sig = 0;    /* Set if a signal was received from the
 /* Thread information structure used to track information that is
    not available in gdb's thread structure. */
 typedef struct thread_info_struct
-{
-  struct thread_info_struct *next;
-  DWORD id;
-  HANDLE h;
-  char *name;
-  int suspend_count;
-  CONTEXT context;
-} thread_info;
+  {
+    struct thread_info_struct *next;
+    DWORD id;
+    HANDLE h;
+    char *name;
+    int suspend_count;
+    CONTEXT context;
+  }
+thread_info;
 
-static thread_info thread_head = {NULL};
+static thread_info thread_head =
+{NULL};
 
 /* The process and thread handles for the above context. */
 
@@ -101,7 +104,7 @@ static DEBUG_EVENT current_event;   /* The current debug event from
                                           WaitForDebugEvent */
 static HANDLE current_process_handle;  /* Currently executing process */
 static thread_info *current_thread;    /* Info on currently selected thread */
-static DWORD main_thread_id;           /* Thread ID of the main thread */
+static DWORD main_thread_id;   /* Thread ID of the main thread */
 
 /* Counts of things. */
 static int exception_count = 0;
@@ -110,9 +113,9 @@ static int event_count = 0;
 /* User options. */
 static int new_console = 0;
 static int new_group = 0;
-static int debug_exec = 0;             /* show execution */
-static int debug_events = 0;           /* show events from kernel */
-static int debug_memory = 0;           /* show target memory accesses */
+static int debug_exec = 0;     /* show execution */
+static int debug_events = 0;   /* show events from kernel */
+static int debug_memory = 0;   /* show target memory accesses */
 static int debug_exceptions = 0;       /* show target exceptions */
 
 /* This vector maps GDB's idea of a register's number into an address
@@ -131,30 +134,30 @@ static int debug_exceptions = 0;  /* show target exceptions */
 #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
 static const int mappings[] =
 {
-  context_offset(Eax),
-  context_offset(Ecx),
-  context_offset(Edx),
-  context_offset(Ebx),
-  context_offset(Esp),
-  context_offset(Ebp),
-  context_offset(Esi),
-  context_offset(Edi),
-  context_offset(Eip),
-  context_offset(EFlags),
-  context_offset(SegCs),
-  context_offset(SegSs),
-  context_offset(SegDs),
-  context_offset(SegEs),
-  context_offset(SegFs),
-  context_offset(SegGs),
-  context_offset(FloatSave.RegisterArea[0 * 10]),
-  context_offset(FloatSave.RegisterArea[1 * 10]),
-  context_offset(FloatSave.RegisterArea[2 * 10]),
-  context_offset(FloatSave.RegisterArea[3 * 10]),
-  context_offset(FloatSave.RegisterArea[4 * 10]),
-  context_offset(FloatSave.RegisterArea[5 * 10]),
-  context_offset(FloatSave.RegisterArea[6 * 10]),
-  context_offset(FloatSave.RegisterArea[7 * 10]),
+  context_offset (Eax),
+  context_offset (Ecx),
+  context_offset (Edx),
+  context_offset (Ebx),
+  context_offset (Esp),
+  context_offset (Ebp),
+  context_offset (Esi),
+  context_offset (Edi),
+  context_offset (Eip),
+  context_offset (EFlags),
+  context_offset (SegCs),
+  context_offset (SegSs),
+  context_offset (SegDs),
+  context_offset (SegEs),
+  context_offset (SegFs),
+  context_offset (SegGs),
+  context_offset (FloatSave.RegisterArea[0 * 10]),
+  context_offset (FloatSave.RegisterArea[1 * 10]),
+  context_offset (FloatSave.RegisterArea[2 * 10]),
+  context_offset (FloatSave.RegisterArea[3 * 10]),
+  context_offset (FloatSave.RegisterArea[4 * 10]),
+  context_offset (FloatSave.RegisterArea[5 * 10]),
+  context_offset (FloatSave.RegisterArea[6 * 10]),
+  context_offset (FloatSave.RegisterArea[7 * 10]),
 };
 
 /* This vector maps the target's idea of an exception (extracted
@@ -184,7 +187,7 @@ thread_rec (DWORD id, int get_context)
 {
   thread_info *th;
 
-  for (th = &thread_head; (th = th->next) != NULL; )
+  for (th = &thread_head; (th = th->next) != NULL;)
     if (th->id == id)
       {
        if (!th->suspend_count && get_context)
@@ -205,7 +208,7 @@ thread_rec (DWORD id, int get_context)
 
 /* Add a thread to the thread list */
 static thread_info *
-child_add_thread(DWORD id, HANDLE h)
+child_add_thread (DWORD id, HANDLE h)
 {
   thread_info *th;
 
@@ -213,7 +216,7 @@ child_add_thread(DWORD id, HANDLE h)
     return th;
 
   th = (thread_info *) xmalloc (sizeof (*th));
-  memset(th, 0, sizeof (*th));
+  memset (th, 0, sizeof (*th));
   th->id = id;
   th->h = h;
   th->next = thread_head.next;
@@ -316,7 +319,7 @@ child_store_inferior_registers (int r)
 static int
 handle_load_dll (PTR dummy)
 {
-  LOAD_DLL_DEBUG_INFO * event = &current_event.u.LoadDll;
+  LOAD_DLL_DEBUG_INFO *event = &current_event.u.LoadDll;
   DWORD dll_name_ptr;
   DWORD done;
   char dll_buf[MAX_PATH + 1];
@@ -324,7 +327,7 @@ handle_load_dll (PTR dummy)
   struct objfile *objfile;
   MEMORY_BASIC_INFORMATION minfo;
 
-  dll_buf[0] = dll_buf[sizeof(dll_buf) - 1] = '\0';
+  dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0';
 
   /* The following code attempts to find the name of the dll by reading the
      name from the processes memory.  Unfortunately it doesn't work right.
@@ -332,7 +335,8 @@ handle_load_dll (PTR dummy)
 #ifdef DOESNT_WORK
   memset (&minfo, 0, sizeof minfo);
   if (VirtualQueryEx (current_process_handle, (LPCVOID) event->lpBaseOfDll,
-                     &minfo, sizeof(minfo)) && minfo.BaseAddress) {
+                     &minfo, sizeof (minfo)) && minfo.BaseAddress)
+    {
       DWORD len;
       IMAGE_DOS_HEADER *hmm0 = (IMAGE_DOS_HEADER *) minfo.BaseAddress;
       HMODULE hmm = (HMODULE) (((DWORD) hmm0) + hmm0->e_lfanew);
@@ -342,7 +346,7 @@ handle_load_dll (PTR dummy)
          dll_name = dll_buf;
          dll_name[len] = '\0';
        }
-  }
+    }
 #endif
 
   /* Attempt to read the name of the dll that was detected.
@@ -360,7 +364,7 @@ handle_load_dll (PTR dummy)
                         sizeof (dll_name_ptr), &done);
 
       /* See if we could read the address of a string, and that the
-        address isn't null. */
+         address isn't null. */
 
       if (done != sizeof (dll_name_ptr) || !dll_name_ptr)
        return 1;
@@ -410,23 +414,23 @@ handle_load_dll (PTR dummy)
   /* FIXME!! It would be nice to define one symbol which pointed to the
      front of the dll if we can't find any symbols. */
 
-  if (!(dll_basename = strrchr(dll_name, '/')))
+  if (!(dll_basename = strrchr (dll_name, '/')))
     dll_basename = dll_name;
   else
     dll_basename++;
 
-  ALL_OBJFILES(objfile)
-    {
-      char *objfile_basename;
-      objfile_basename = strrchr(objfile->name, '/');
+  ALL_OBJFILES (objfile)
+  {
+    char *objfile_basename;
+    objfile_basename = strrchr (objfile->name, '/');
 
-      if (objfile_basename &&
-         strcmp(dll_basename, objfile_basename + 1) == 0)
-       {
-         printf_unfiltered ("%x:%s (symbols previously loaded)\n",
-                            event->lpBaseOfDll, dll_name);
-         goto out;
-       }
+    if (objfile_basename &&
+       strcmp (dll_basename, objfile_basename + 1) == 0)
+      {
+       printf_unfiltered ("%x:%s (symbols previously loaded)\n",
+                          event->lpBaseOfDll, dll_name);
+       goto out;
+      }
   }
 
   /* The symbols in a dll are offset by 0x1000, which is the
@@ -453,18 +457,18 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
   int gotasig = FALSE;
 
   if (!target_read_string
-      ((CORE_ADDR) current_event.u.DebugString.lpDebugStringData, &s, 1024, 0)
+    ((CORE_ADDR) current_event.u.DebugString.lpDebugStringData, &s, 1024, 0)
       || !s || !*s)
     return gotasig;
 
-  if (strncmp(s, CYGWIN_SIGNAL_STRING, sizeof(CYGWIN_SIGNAL_STRING) - 1))
+  if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1))
     {
       warning (s);
     }
   else
     {
       char *p;
-      /*last_sig = */strtol(s + sizeof(CYGWIN_SIGNAL_STRING) - 1, &p, 0);
+      /*last_sig = */ strtol (s + sizeof (CYGWIN_SIGNAL_STRING) - 1, &p, 0);
       gotasig = target_signal_from_host (last_sig);
       ourstatus->value.sig = gotasig;
       if (gotasig)
@@ -491,41 +495,41 @@ handle_exception (struct target_waitstatus *ourstatus)
     {
     case EXCEPTION_ACCESS_VIOLATION:
       DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08x\n",
-                    current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+              current_event.u.Exception.ExceptionRecord.ExceptionAddress));
       ourstatus->value.sig = TARGET_SIGNAL_SEGV;
       break;
     case STATUS_STACK_OVERFLOW:
       DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
-                    current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+              current_event.u.Exception.ExceptionRecord.ExceptionAddress));
       ourstatus->value.sig = TARGET_SIGNAL_SEGV;
       break;
     case EXCEPTION_BREAKPOINT:
       DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08x\n",
-                    current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+              current_event.u.Exception.ExceptionRecord.ExceptionAddress));
       ourstatus->value.sig = TARGET_SIGNAL_TRAP;
       break;
     case DBG_CONTROL_C:
       DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08x\n",
-                    current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+              current_event.u.Exception.ExceptionRecord.ExceptionAddress));
       ourstatus->value.sig = TARGET_SIGNAL_INT;
       /* User typed CTRL-C.  Continue with this status */
       last_sig = SIGINT;       /* FIXME - should check pass state */
       break;
     case EXCEPTION_SINGLE_STEP:
       DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08x\n",
-                    current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+              current_event.u.Exception.ExceptionRecord.ExceptionAddress));
       ourstatus->value.sig = TARGET_SIGNAL_TRAP;
       break;
     default:
       /* This may be a structured exception handling exception.  In
-        that case, we want to let the program try to handle it, and
-        only break if we see the exception a second time.  */
+         that case, we want to let the program try to handle it, and
+         only break if we see the exception a second time.  */
       if (current_event.u.Exception.dwFirstChance)
        return 0;
 
       printf_unfiltered ("gdb: unknown target exception 0x%08x at 0x%08x\n",
-                        current_event.u.Exception.ExceptionRecord.ExceptionCode,
-                        current_event.u.Exception.ExceptionRecord.ExceptionAddress);
+                   current_event.u.Exception.ExceptionRecord.ExceptionCode,
+               current_event.u.Exception.ExceptionRecord.ExceptionAddress);
       ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
       break;
     }
@@ -548,7 +552,7 @@ child_continue (DWORD continue_status, int id)
                            current_event.dwThreadId,
                            continue_status);
   if (res)
-    for (th = &thread_head; (th = th->next) != NULL; )
+    for (th = &thread_head; (th = th->next) != NULL;)
       if (((id == -1) || (id == th->id)) && th->suspend_count)
        {
          for (i = 0; i < th->suspend_count; i++)
@@ -586,38 +590,38 @@ child_wait (int pid, struct target_waitstatus *ourstatus)
            {
            case CREATE_THREAD_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%x code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "CREATE_THREAD_DEBUG_EVENT"));
              /* Record the existence of this thread */
              child_add_thread (current_event.dwThreadId,
                                current_event.u.CreateThread.hThread);
              if (info_verbose)
                printf_unfiltered ("[New %s]\n",
-                                  target_pid_to_str (current_event.dwThreadId));
+                             target_pid_to_str (current_event.dwThreadId));
              break;
 
            case EXIT_THREAD_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "EXIT_THREAD_DEBUG_EVENT"));
              child_delete_thread (current_event.dwThreadId);
              break;
 
            case CREATE_PROCESS_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "CREATE_PROCESS_DEBUG_EVENT"));
              current_process_handle = current_event.u.CreateProcessInfo.hProcess;
 
              main_thread_id = inferior_pid = current_event.dwThreadId;
              /* Add the main thread */
              current_thread = child_add_thread (inferior_pid,
-                                                current_event.u.CreateProcessInfo.hThread);
+                                current_event.u.CreateProcessInfo.hThread);
              break;
 
            case EXIT_PROCESS_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "EXIT_PROCESS_DEBUG_EVENT"));
              ourstatus->kind = TARGET_WAITKIND_EXITED;
              ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
@@ -627,30 +631,30 @@ child_wait (int pid, struct target_waitstatus *ourstatus)
 
            case LOAD_DLL_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "LOAD_DLL_DEBUG_EVENT"));
              catch_errors (handle_load_dll, NULL, "", RETURN_MASK_ALL);
-             registers_changed();          /* mark all regs invalid */
+             registers_changed ();     /* mark all regs invalid */
              break;
 
            case UNLOAD_DLL_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "UNLOAD_DLL_DEBUG_EVENT"));
-             break;    /* FIXME: don't know what to do here */
+             break;            /* FIXME: don't know what to do here */
 
            case EXCEPTION_DEBUG_EVENT:
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "EXCEPTION_DEBUG_EVENT"));
              if (handle_exception (ourstatus))
                return current_event.dwThreadId;
              continue_status = DBG_EXCEPTION_NOT_HANDLED;
              break;
 
-           case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */
+           case OUTPUT_DEBUG_STRING_EVENT:     /* message from the kernel */
              DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n",
-                            current_event.dwProcessId, current_event.dwThreadId,
+                       current_event.dwProcessId, current_event.dwThreadId,
                             "OUTPUT_DEBUG_STRING_EVENT"));
              if (handle_output_debug_string (ourstatus))
                return main_thread_id;
@@ -769,7 +773,7 @@ child_create_inferior (exec_file, allargs, env)
   char real_path[MAXPATHLEN];
   char *winenv;
   char *temp;
-  int  envlen;
+  int envlen;
   int i;
 
   STARTUPINFO si;
@@ -815,10 +819,10 @@ child_create_inferior (exec_file, allargs, env)
        to posix style if necessary.  */
 
     static const char *conv_path_names[] =
-      {
-       "PATH=",
-       0
-      };
+    {
+      "PATH=",
+      0
+    };
 
     /* CreateProcess takes the environment list as a null terminated set of
        strings (i.e. two nulls terminate the list).  */
@@ -878,7 +882,7 @@ child_create_inferior (exec_file, allargs, env)
   }
 
   ret = CreateProcess (0,
-                      args,    /* command line */
+                      args,    /* command line */
                       NULL,    /* Security */
                       NULL,    /* thread */
                       TRUE,    /* inherit handles */
@@ -888,7 +892,7 @@ child_create_inferior (exec_file, allargs, env)
                       &si,
                       &pi);
   if (!ret)
-    error ("Error creating process %s, (error %d)\n", exec_file, GetLastError());
+    error ("Error creating process %s, (error %d)\n", exec_file, GetLastError ());
 
   exception_count = 0;
   event_count = 0;
@@ -926,7 +930,7 @@ child_stop ()
 {
   DEBUG_EVENTS (("gdb: GenerateConsoleCtrlEvent (CTRLC_EVENT, 0)\n"));
   CHECK (GenerateConsoleCtrlEvent (CTRL_C_EVENT, 0));
-  registers_changed();         /* refresh register state */
+  registers_changed ();                /* refresh register state */
 }
 
 int
@@ -971,7 +975,7 @@ child_kill_inferior (void)
 
   /* this may fail in an attached process so don't check. */
   (void) CloseHandle (current_thread->h);
-  target_mourn_inferior();     /* or just child_mourn_inferior? */
+  target_mourn_inferior ();    /* or just child_mourn_inferior? */
 }
 
 void
@@ -980,7 +984,7 @@ child_resume (int pid, int step, enum target_signal sig)
   int i;
   thread_info *th;
   DWORD continue_status = last_sig > 0 && last_sig < NSIG ?
-                         DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE;
+  DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE;
 
   DEBUG_EXEC (("gdb: child_resume (pid=%d, step=%d, sig=%d);\n",
               pid, step, sig));
@@ -1029,58 +1033,58 @@ child_close ()
   DEBUG_EVENTS (("gdb: child_close, inferior_pid=%d\n", inferior_pid));
 }
 
-struct target_ops child_ops ;
+struct target_ops child_ops;
 
-static void 
-init_child_ops(void)
+static void
+init_child_ops (void)
 {
-  child_ops.to_shortname =   "child";
-  child_ops.to_longname =   "Win32 child process";
-  child_ops.to_doc =   "Win32 child process (started by the \"run\" command).";
-  child_ops.to_open =   child_open;
-  child_ops.to_close =   child_close;
-  child_ops.to_attach =   child_attach;
-  child_ops.to_detach =   child_detach;
-  child_ops.to_resume =   child_resume;
-  child_ops.to_wait  =   child_wait;
-  child_ops.to_fetch_registers  =   child_fetch_inferior_registers;
-  child_ops.to_store_registers  =   child_store_inferior_registers;
-  child_ops.to_prepare_to_store =   child_prepare_to_store;
-  child_ops.to_xfer_memory  =   child_xfer_memory;
-  child_ops.to_files_info  =   child_files_info;
-  child_ops.to_insert_breakpoint =   memory_insert_breakpoint;
-  child_ops.to_remove_breakpoint =   memory_remove_breakpoint;
-  child_ops.to_terminal_init  =   terminal_init_inferior;
-  child_ops.to_terminal_inferior =   terminal_inferior;
-  child_ops.to_terminal_ours_for_output =   terminal_ours_for_output;
-  child_ops.to_terminal_ours  =   terminal_ours;
-  child_ops.to_terminal_info  =   child_terminal_info;
-  child_ops.to_kill  =   child_kill_inferior;
-  child_ops.to_load  =   0;
-  child_ops.to_lookup_symbol =   0;
-  child_ops.to_create_inferior =   child_create_inferior;
-  child_ops.to_mourn_inferior =   child_mourn_inferior;
-  child_ops.to_can_run  =   child_can_run;
-  child_ops.to_notice_signals =   0;
-  child_ops.to_thread_alive  =   win32_child_thread_alive;
-  child_ops.to_stop  =   child_stop;
-  child_ops.to_stratum =   process_stratum;
-  child_ops.DONT_USE =   0;
-  child_ops.to_has_all_memory =   1;
-  child_ops.to_has_memory =   1;
-  child_ops.to_has_stack =   1;
-  child_ops.to_has_registers =   1;
-  child_ops.to_has_execution =   1;
-  child_ops.to_sections =   0;
-  child_ops.to_sections_end =   0;
-  child_ops.to_magic =   OPS_MAGIC;
+  child_ops.to_shortname = "child";
+  child_ops.to_longname = "Win32 child process";
+  child_ops.to_doc = "Win32 child process (started by the \"run\" command).";
+  child_ops.to_open = child_open;
+  child_ops.to_close = child_close;
+  child_ops.to_attach = child_attach;
+  child_ops.to_detach = child_detach;
+  child_ops.to_resume = child_resume;
+  child_ops.to_wait = child_wait;
+  child_ops.to_fetch_registers = child_fetch_inferior_registers;
+  child_ops.to_store_registers = child_store_inferior_registers;
+  child_ops.to_prepare_to_store = child_prepare_to_store;
+  child_ops.to_xfer_memory = child_xfer_memory;
+  child_ops.to_files_info = child_files_info;
+  child_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  child_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  child_ops.to_terminal_init = terminal_init_inferior;
+  child_ops.to_terminal_inferior = terminal_inferior;
+  child_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  child_ops.to_terminal_ours = terminal_ours;
+  child_ops.to_terminal_info = child_terminal_info;
+  child_ops.to_kill = child_kill_inferior;
+  child_ops.to_load = 0;
+  child_ops.to_lookup_symbol = 0;
+  child_ops.to_create_inferior = child_create_inferior;
+  child_ops.to_mourn_inferior = child_mourn_inferior;
+  child_ops.to_can_run = child_can_run;
+  child_ops.to_notice_signals = 0;
+  child_ops.to_thread_alive = win32_child_thread_alive;
+  child_ops.to_stop = child_stop;
+  child_ops.to_stratum = process_stratum;
+  child_ops.DONT_USE = 0;
+  child_ops.to_has_all_memory = 1;
+  child_ops.to_has_memory = 1;
+  child_ops.to_has_stack = 1;
+  child_ops.to_has_registers = 1;
+  child_ops.to_has_execution = 1;
+  child_ops.to_sections = 0;
+  child_ops.to_sections_end = 0;
+  child_ops.to_magic = OPS_MAGIC;
 }
 
 void
 _initialize_inftarg ()
 {
   struct cmd_list_element *c;
-  init_child_ops() ;
+  init_child_ops ();
 
   add_show_from_set
     (add_set_cmd ("new-console", class_support, var_boolean,
@@ -1120,7 +1124,7 @@ _initialize_inftarg ()
   add_show_from_set
     (add_set_cmd ("debugexceptions", class_support, var_boolean,
                  (char *) &debug_exceptions,
-                 "Set whether to display kernel exceptions in child process.",
+              "Set whether to display kernel exceptions in child process.",
                  &setlist),
      &showlist);
 
@@ -1133,8 +1137,8 @@ _initialize_inftarg ()
 static int
 win32_child_thread_alive (int pid)
 {
-  return WaitForSingleObject(thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ?
-        FALSE : TRUE;
+  return WaitForSingleObject (thread_rec (pid, FALSE)->h, 0) == WAIT_OBJECT_0 ?
+    FALSE : TRUE;
 }
 
 /* Convert pid to printable format. */
index f5f2670a2c60863858803808633877fc4842010c..cb040bbf9c7cab5b6ff952c8ab02421ce3ebe44f 100644 (file)
@@ -1,24 +1,25 @@
 /* Read AIX xcoff symbol tables and convert to internal format, for GDB.
    Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997
-            Free Software Foundation, Inc.
+   Free Software Foundation, Inc.
    Derived from coffread.c, dbxread.c, and a lot of hacking.
    Contributed by IBM Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
@@ -54,19 +55,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "aout/stab_gnu.h"
 
 /* For interface with partial-stab.h.  */
-#define N_UNDF 0       /* Undefined symbol */
+#define N_UNDF 0               /* Undefined symbol */
 #undef N_ABS
 #define N_ABS 2
-#define N_TEXT         4       /* Text sym -- defined at offset in text seg */
-#define N_DATA         6       /* Data sym -- defined at offset in data seg */
-#define N_BSS  8       /* BSS  sym -- defined at offset in zero'd seg */
-#define        N_COMM  0x12    /* Common symbol (visible after shared lib dynlink) */
-#define N_FN   0x1f    /* File name of .o file */
-#define        N_FN_SEQ 0x0C   /* N_FN from Sequent compilers (sigh) */
+#define N_TEXT         4               /* Text sym -- defined at offset in text seg */
+#define N_DATA         6               /* Data sym -- defined at offset in data seg */
+#define N_BSS  8               /* BSS  sym -- defined at offset in zero'd seg */
+#define        N_COMM  0x12            /* Common symbol (visible after shared lib dynlink) */
+#define N_FN   0x1f            /* File name of .o file */
+#define        N_FN_SEQ 0x0C           /* N_FN from Sequent compilers (sigh) */
 /* Note: N_EXT can only be usefully OR-ed with N_UNDF, N_ABS, N_TEXT,
    N_DATA, or N_BSS.  When the low-order bit of other types is set,
    (e.g. N_WARNING versus N_FN), they are two different types.  */
-#define N_EXT  1       /* External symbol (as opposed to local-to-this-file) */
+#define N_EXT  1               /* External symbol (as opposed to local-to-this-file) */
 #define N_INDR 0x0a
 
 /* The following symbols refer to set elements.
@@ -92,40 +93,42 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.  */
 
-struct symloc {
+struct symloc
+  {
 
-  /* First symbol number for this file.  */
+    /* First symbol number for this file.  */
 
-  int first_symnum;
+    int first_symnum;
 
-  /* Number of symbols in 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).  If numsyms is 0, the only
-     reason for this thing's existence is the dependency list.  Nothing
-     else will happen when it is read in.  */
+    /* Number of symbols in 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).  If numsyms is 0, the only
+       reason for this thing's existence is the dependency list.  Nothing
+       else will happen when it is read in.  */
 
-  int numsyms;
+    int numsyms;
 
-  /* Position of the start of the line number information for this psymtab.  */
-  unsigned int lineno_off;
-};
+    /* Position of the start of the line number information for this psymtab.  */
+    unsigned int lineno_off;
+  };
 
 /* Remember what we deduced to be the source language of this psymtab. */
 
 static enum language psymtab_language = language_unknown;
-
 \f
+
 /* Simplified internal version of coff symbol table information */
 
-struct coff_symbol {
-  char *c_name;
-  int c_symnum;                /* symbol number of this entry */
-  int c_naux;          /* 0 if syment only, 1 if syment + auxent */
-  long c_value;
-  unsigned char c_sclass;
-  int c_secnum;
-  unsigned int c_type;
-};
+struct coff_symbol
+  {
+    char *c_name;
+    int c_symnum;              /* symbol number of this entry */
+    int c_naux;                        /* 0 if syment only, 1 if syment + auxent */
+    long c_value;
+    unsigned char c_sclass;
+    int c_secnum;
+    unsigned int c_type;
+  };
 
 /* last function's saved coff symbol `cs' */
 
@@ -157,39 +160,40 @@ int within_function;
    there is any reason not to just use a #define, but might as well
    ask BFD for the size and store it here, I guess.  */
 
-static unsigned        local_symesz;
+static unsigned local_symesz;
 
-struct coff_symfile_info {
-  file_ptr min_lineno_offset;          /* Where in file lowest line#s are */
-  file_ptr max_lineno_offset;          /* 1+last byte of line#s in file */
+struct coff_symfile_info
+  {
+    file_ptr min_lineno_offset;        /* Where in file lowest line#s are */
+    file_ptr max_lineno_offset;        /* 1+last byte of line#s in file */
 
-  /* Pointer to the string table.  */
-  char *strtbl;
+    /* Pointer to the string table.  */
+    char *strtbl;
 
-  /* Pointer to debug section.  */
-  char *debugsec;
+    /* Pointer to debug section.  */
+    char *debugsec;
 
-  /* Pointer to the a.out symbol table.  */
-  char *symtbl;
+    /* Pointer to the a.out symbol table.  */
+    char *symtbl;
 
-  /* Number of symbols in symtbl.  */
-  int symtbl_num_syms;
+    /* Number of symbols in symtbl.  */
+    int symtbl_num_syms;
 
-  /* Offset in data section to TOC anchor.  */
-  CORE_ADDR toc_offset;
-};
+    /* Offset in data section to TOC anchor.  */
+    CORE_ADDR toc_offset;
+  };
 
 static struct complaint storclass_complaint =
-  {"Unexpected storage class: %d", 0, 0};
+{"Unexpected storage class: %d", 0, 0};
 
 static struct complaint bf_notfound_complaint =
-  {"line numbers off, `.bf' symbol not found", 0, 0};
+{"line numbers off, `.bf' symbol not found", 0, 0};
 
-static struct complaint ef_complaint = 
-  {"Mismatched .ef symbol ignored starting at symnum %d", 0, 0};
+static struct complaint ef_complaint =
+{"Mismatched .ef symbol ignored starting at symnum %d", 0, 0};
 
-static struct complaint eb_complaint = 
-  {"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
+static struct complaint eb_complaint =
+{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
 
 static void
 xcoff_initial_scan PARAMS ((struct objfile *, struct section_offsets *, int));
@@ -198,7 +202,7 @@ static void
 scan_xcoff_symtab PARAMS ((struct section_offsets *, struct objfile *));
 
 static char *
-xcoff_next_symbol_text PARAMS ((struct objfile *));
+  xcoff_next_symbol_text PARAMS ((struct objfile *));
 
 static void
 record_include_begin PARAMS ((struct coff_symbol *));
@@ -220,13 +224,13 @@ static void
 xcoff_symfile_finish PARAMS ((struct objfile *));
 
 static struct section_offsets *
-xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
+  xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
 
 static void
 find_linenos PARAMS ((bfd *, sec_ptr, PTR));
 
 static char *
-coff_getfilename PARAMS ((union internal_auxent *, struct objfile *));
+  coff_getfilename PARAMS ((union internal_auxent *, struct objfile *));
 
 static void
 read_symbol PARAMS ((struct internal_syment *, int));
@@ -238,7 +242,7 @@ static int
 read_symbol_nvalue PARAMS ((int));
 
 static struct symbol *
-process_xcoff_symbol PARAMS ((struct coff_symbol *, struct objfile *));
+  process_xcoff_symbol PARAMS ((struct coff_symbol *, struct objfile *));
 
 static void
 read_xcoff_symtab PARAMS ((struct partial_symtab *));
@@ -252,34 +256,36 @@ static int
 compare_lte PARAMS ((const void *, const void *));
 
 static struct linetable *
-arrange_linetable PARAMS ((struct linetable *));
+  arrange_linetable PARAMS ((struct linetable *));
 
 static void
 record_include_end PARAMS ((struct coff_symbol *));
 
 static void
 process_linenos PARAMS ((CORE_ADDR, CORE_ADDR));
-
 \f
+
 /* Translate from a COFF section number (target_index) to a SECT_OFF_*
    code.  */
 static int secnum_to_section PARAMS ((int, struct objfile *));
-static asection * secnum_to_bfd_section PARAMS ((int, struct objfile *));
+static asection *secnum_to_bfd_section PARAMS ((int, struct objfile *));
 
-struct find_targ_sec_arg {
-  int targ_index;
-  int *resultp;
-  asection **bfd_sect;
-};
+struct find_targ_sec_arg
+  {
+    int targ_index;
+    int *resultp;
+    asection **bfd_sect;
+  };
 
 static void find_targ_sec PARAMS ((bfd *, asection *, void *));
 
-static void find_targ_sec (abfd, sect, obj)
+static void
+find_targ_sec (abfd, sect, obj)
      bfd *abfd;
      asection *sect;
      PTR obj;
 {
-  struct find_targ_sec_arg *args = (struct find_targ_sec_arg *)obj;
+  struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
   if (sect->target_index == args->targ_index)
     {
       /* This is the section.  Figure out what SECT_OFF_* code it is.  */
@@ -331,82 +337,84 @@ secnum_to_bfd_section (secnum, objfile)
 
 static void
 add_stab_to_list (stabname, stabvector)
-char *stabname;
-struct pending_stabs **stabvector;
+     char *stabname;
+     struct pending_stabs **stabvector;
 {
-  if ( *stabvector == NULL) {
-    *stabvector = (struct pending_stabs *)
-       xmalloc (sizeof (struct pending_stabs) + 
-                       INITIAL_STABVECTOR_LENGTH * sizeof (char*));
-    (*stabvector)->count = 0;
-    (*stabvector)->length = INITIAL_STABVECTOR_LENGTH;
-  }
-  else if ((*stabvector)->count >= (*stabvector)->length) {
-    (*stabvector)->length += INITIAL_STABVECTOR_LENGTH;
-    *stabvector = (struct pending_stabs *)
-       xrealloc ((char *) *stabvector, sizeof (struct pending_stabs) + 
-       (*stabvector)->length * sizeof (char*));
-  }
-  (*stabvector)->stab [(*stabvector)->count++] = stabname;
+  if (*stabvector == NULL)
+    {
+      *stabvector = (struct pending_stabs *)
+       xmalloc (sizeof (struct pending_stabs) +
+                INITIAL_STABVECTOR_LENGTH * sizeof (char *));
+      (*stabvector)->count = 0;
+      (*stabvector)->length = INITIAL_STABVECTOR_LENGTH;
+    }
+  else if ((*stabvector)->count >= (*stabvector)->length)
+    {
+      (*stabvector)->length += INITIAL_STABVECTOR_LENGTH;
+      *stabvector = (struct pending_stabs *)
+       xrealloc ((char *) *stabvector, sizeof (struct pending_stabs) +
+                   (*stabvector)->length * sizeof (char *));
+    }
+  (*stabvector)->stab[(*stabvector)->count++] = stabname;
 }
 
 #endif
-
-\f
-/* *INDENT-OFF* */
+\f/* *INDENT-OFF* */
 /* Linenos are processed on a file-by-file basis.
 
    Two reasons:
 
-    1) xlc (IBM's native c compiler) postpones static function code
-       emission to the end of a compilation unit. This way it can
-       determine if those functions (statics) are needed or not, and
-       can do some garbage collection (I think). This makes line
-       numbers and corresponding addresses unordered, and we end up
-       with a line table like:
-       
-
-               lineno  addr
-        foo()    10    0x100
-                 20    0x200
-                 30    0x300
-
-       foo3()    70    0x400
-                 80    0x500
-                 90    0x600
-
-       static foo2()
-                 40    0x700
-                 50    0x800
-                 60    0x900           
-
-       and that breaks gdb's binary search on line numbers, if the
-       above table is not sorted on line numbers. And that sort
-       should be on function based, since gcc can emit line numbers
-       like:
-       
-               10      0x100   - for the init/test part of a for stmt.
-               20      0x200
-               30      0x300
-               10      0x400   - for the increment part of a for stmt.
-
-       arrange_linetable() will do this sorting.               
-
-     2)        aix symbol table might look like:
-
-               c_file          // beginning of a new file
-               .bi             // beginning of include file
-               .ei             // end of include file
-               .bi
-               .ei
-
-       basically, .bi/.ei pairs do not necessarily encapsulate
-       their scope. They need to be recorded, and processed later
-       on when we come the end of the compilation unit.
-       Include table (inclTable) and process_linenos() handle
-       that.  */
+   1) xlc (IBM's native c compiler) postpones static function code
+   emission to the end of a compilation unit. This way it can
+   determine if those functions (statics) are needed or not, and
+   can do some garbage collection (I think). This makes line
+   numbers and corresponding addresses unordered, and we end up
+   with a line table like:
+
+
+   lineno       addr
+   foo()          10    0x100
+   20   0x200
+   30   0x300
+
+   foo3()         70    0x400
+   80   0x500
+   90   0x600
+
+   static foo2()
+   40   0x700
+   50   0x800
+   60   0x900           
+
+   and that breaks gdb's binary search on line numbers, if the
+   above table is not sorted on line numbers. And that sort
+   should be on function based, since gcc can emit line numbers
+   like:
+
+   10   0x100   - for the init/test part of a for stmt.
+   20   0x200
+   30   0x300
+   10   0x400   - for the increment part of a for stmt.
+
+   arrange_linetable() will do this sorting.            
+
+   2)   aix symbol table might look like:
+
+   c_file               // beginning of a new file
+   .bi          // beginning of include file
+   .ei          // end of include file
+   .bi
+   .ei
+
+   basically, .bi/.ei pairs do not necessarily encapsulate
+   their scope. They need to be recorded, and processed later
+   on when we come the end of the compilation unit.
+   Include table (inclTable) and process_linenos() handle
+   that.  */
 /* *INDENT-ON* */
 
+
+
 /* compare line table entry addresses. */
 
 static int
@@ -427,71 +435,75 @@ compare_lte (lte1p, lte2p)
 
 static struct linetable *
 arrange_linetable (oldLineTb)
-     struct linetable *oldLineTb;                      /* old linetable */
+     struct linetable *oldLineTb;      /* old linetable */
 {
-  int ii, jj, 
-      newline,                                         /* new line count */
-      function_count;                          /* # of functions */
+  int ii, jj, newline,         /* new line count */
+    function_count;            /* # of functions */
 
-  struct linetable_entry *fentry;              /* function entry vector */
-  int fentry_size;                             /* # of function entries */
-  struct linetable *newLineTb;                 /* new line table */
+  struct linetable_entry *fentry;      /* function entry vector */
+  int fentry_size;             /* # of function entries */
+  struct linetable *newLineTb; /* new line table */
 
 #define NUM_OF_FUNCTIONS 20
 
   fentry_size = NUM_OF_FUNCTIONS;
-  fentry = (struct linetable_entry*)
+  fentry = (struct linetable_entry *)
     xmalloc (fentry_size * sizeof (struct linetable_entry));
 
-  for (function_count=0, ii=0; ii <oldLineTb->nitems; ++ii) {
+  for (function_count = 0, ii = 0; ii < oldLineTb->nitems; ++ii)
+    {
 
-    if (oldLineTb->item[ii].line == 0) {       /* function entry found. */
+      if (oldLineTb->item[ii].line == 0)
+       {                       /* function entry found. */
 
-      if (function_count >= fentry_size) {     /* make sure you have room. */
-       fentry_size *= 2;
-       fentry = (struct linetable_entry*) 
-         xrealloc (fentry, fentry_size * sizeof (struct linetable_entry));
-      }
-      fentry[function_count].line = ii;
-      fentry[function_count].pc = oldLineTb->item[ii].pc;
-      ++function_count;
+         if (function_count >= fentry_size)
+           {                   /* make sure you have room. */
+             fentry_size *= 2;
+             fentry = (struct linetable_entry *)
+               xrealloc (fentry, fentry_size * sizeof (struct linetable_entry));
+           }
+         fentry[function_count].line = ii;
+         fentry[function_count].pc = oldLineTb->item[ii].pc;
+         ++function_count;
+       }
     }
-  }
 
-  if (function_count == 0) {
-    free (fentry);
-    return oldLineTb;
-  }
+  if (function_count == 0)
+    {
+      free (fentry);
+      return oldLineTb;
+    }
   else if (function_count > 1)
-    qsort (fentry, function_count, sizeof(struct linetable_entry), compare_lte);
+    qsort (fentry, function_count, sizeof (struct linetable_entry), compare_lte);
 
   /* allocate a new line table. */
   newLineTb = (struct linetable *)
     xmalloc
-      (sizeof (struct linetable) + 
-       (oldLineTb->nitems - function_count) * sizeof (struct linetable_entry));
+    (sizeof (struct linetable) +
+    (oldLineTb->nitems - function_count) * sizeof (struct linetable_entry));
 
   /* if line table does not start with a function beginning, copy up until
      a function begin. */
 
   newline = 0;
   if (oldLineTb->item[0].line != 0)
-    for (newline=0; 
-       newline < oldLineTb->nitems && oldLineTb->item[newline].line; ++newline)
+    for (newline = 0;
+    newline < oldLineTb->nitems && oldLineTb->item[newline].line; ++newline)
       newLineTb->item[newline] = oldLineTb->item[newline];
 
   /* Now copy function lines one by one. */
 
-  for (ii=0; ii < function_count; ++ii) {
-    for (jj = fentry[ii].line + 1;
-                jj < oldLineTb->nitems && oldLineTb->item[jj].line != 0; 
-                                                        ++jj, ++newline)
-      newLineTb->item[newline] = oldLineTb->item[jj];
-  }
+  for (ii = 0; ii < function_count; ++ii)
+    {
+      for (jj = fentry[ii].line + 1;
+          jj < oldLineTb->nitems && oldLineTb->item[jj].line != 0;
+          ++jj, ++newline)
+       newLineTb->item[newline] = oldLineTb->item[jj];
+    }
   free (fentry);
   newLineTb->nitems = oldLineTb->nitems - function_count;
-  return newLineTb;  
-}     
+  return newLineTb;
+}
 
 /* include file support: C_BINCL/C_EINCL pairs will be kept in the 
    following `IncludeChain'. At the end of each symtab (end_symtab),
@@ -499,63 +511,67 @@ arrange_linetable (oldLineTb)
    represent if (the include files. */
 
 
-typedef struct _inclTable {
-  char         *name;                          /* include filename */
+typedef struct _inclTable
+{
+  char *name;                  /* include filename */
 
   /* Offsets to the line table.  end points to the last entry which is
      part of this include file.  */
-  int          begin, end;
-  
+  int begin, end;
+
   struct subfile *subfile;
-  unsigned     funStartLine;                   /* start line # of its function */
-} InclTable;
+  unsigned funStartLine;       /* start line # of its function */
+}
+InclTable;
 
 #define        INITIAL_INCLUDE_TABLE_LENGTH    20
-static InclTable  *inclTable;                  /* global include table */
-static int       inclIndx;                     /* last entry to table */
-static int       inclLength;                   /* table length */
-static int       inclDepth;                    /* nested include depth */
+static InclTable *inclTable;   /* global include table */
+static int inclIndx;           /* last entry to table */
+static int inclLength;         /* table length */
+static int inclDepth;          /* nested include depth */
 
 static void allocate_include_entry PARAMS ((void));
 
 static void
 record_include_begin (cs)
-struct coff_symbol *cs;
+     struct coff_symbol *cs;
 {
   if (inclDepth)
     {
       /* In xcoff, we assume include files cannot be nested (not in .c files
-        of course, but in corresponding .s files.).  */
+         of course, but in corresponding .s files.).  */
 
       /* This can happen with old versions of GCC.
-        GCC 2.3.3-930426 does not exhibit this on a test case which
-        a user said produced the message for him.  */
-      static struct complaint msg = {"Nested C_BINCL symbols", 0, 0};
+         GCC 2.3.3-930426 does not exhibit this on a test case which
+         a user said produced the message for him.  */
+      static struct complaint msg =
+      {"Nested C_BINCL symbols", 0, 0};
       complain (&msg);
     }
   ++inclDepth;
 
   allocate_include_entry ();
 
-  inclTable [inclIndx].name  = cs->c_name;
-  inclTable [inclIndx].begin = cs->c_value;
+  inclTable[inclIndx].name = cs->c_name;
+  inclTable[inclIndx].begin = cs->c_value;
 }
 
 static void
 record_include_end (cs)
-struct coff_symbol *cs;
+     struct coff_symbol *cs;
 {
-  InclTable *pTbl;  
+  InclTable *pTbl;
 
   if (inclDepth == 0)
     {
-      static struct complaint msg = {"Mismatched C_BINCL/C_EINCL pair", 0, 0};
+      static struct complaint msg =
+      {"Mismatched C_BINCL/C_EINCL pair", 0, 0};
       complain (&msg);
     }
 
   allocate_include_entry ();
 
-  pTbl = &inclTable [inclIndx];
+  pTbl = &inclTable[inclIndx];
   pTbl->end = cs->c_value;
 
   --inclDepth;
@@ -567,7 +583,7 @@ allocate_include_entry ()
 {
   if (inclTable == NULL)
     {
-      inclTable = (InclTable *) 
+      inclTable = (InclTable *)
        xmalloc (sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH);
       memset (inclTable,
              '\0', sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH);
@@ -577,10 +593,10 @@ allocate_include_entry ()
   else if (inclIndx >= inclLength)
     {
       inclLength += INITIAL_INCLUDE_TABLE_LENGTH;
-      inclTable = (InclTable *) 
+      inclTable = (InclTable *)
        xrealloc (inclTable, sizeof (InclTable) * inclLength);
-      memset (inclTable + inclLength - INITIAL_INCLUDE_TABLE_LENGTH, 
-             '\0', sizeof (InclTable)*INITIAL_INCLUDE_TABLE_LENGTH);
+      memset (inclTable + inclLength - INITIAL_INCLUDE_TABLE_LENGTH,
+             '\0', sizeof (InclTable) * INITIAL_INCLUDE_TABLE_LENGTH);
     }
 }
 
@@ -597,8 +613,8 @@ process_linenos (start, end)
 {
   int offset, ii;
   file_ptr max_offset =
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->max_lineno_offset;
+  ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+  ->max_lineno_offset;
 
   /* subfile structure for the main compilation unit.  */
   struct subfile main_subfile;
@@ -613,7 +629,7 @@ process_linenos (start, end)
   unsigned *firstLine;
 
   offset =
-    ((struct symloc *)this_symtab_psymtab->read_symtab_private)->lineno_off;
+    ((struct symloc *) this_symtab_psymtab->read_symtab_private)->lineno_off;
   if (offset == 0)
     goto return_after_cleanup;
 
@@ -622,14 +638,14 @@ process_linenos (start, end)
   if (inclIndx == 0)
     /* All source lines were in the main source file. None in include files. */
 
-    enter_line_range (&main_subfile, offset, 0, start, end, 
-                                               &main_source_baseline);
+    enter_line_range (&main_subfile, offset, 0, start, end,
+                     &main_source_baseline);
 
   else
     {
       /* There was source with line numbers in include files.  */
       main_source_baseline = 0;
-      for (ii=0; ii < inclIndx; ++ii)
+      for (ii = 0; ii < inclIndx; ++ii)
        {
          struct subfile *tmpSubfile;
 
@@ -650,7 +666,7 @@ process_linenos (start, end)
          firstLine = &(inclTable[ii].funStartLine);
 
          /* Enter include file's lines now.  */
-         enter_line_range (tmpSubfile, inclTable[ii].begin, 
+         enter_line_range (tmpSubfile, inclTable[ii].begin,
                            inclTable[ii].end, start, 0, firstLine);
 
          if (offset <= inclTable[ii].end)
@@ -658,10 +674,10 @@ process_linenos (start, end)
        }
 
       /* All the include files' line have been processed at this point.  Now,
-        enter remaining lines of the main file, if any left.  */
+         enter remaining lines of the main file, if any left.  */
       if (offset < max_offset + 1 - LINESZ)
        {
-         enter_line_range (&main_subfile, offset, 0, start, end, 
+         enter_line_range (&main_subfile, offset, 0, start, end,
                            &main_source_baseline);
        }
     }
@@ -674,7 +690,7 @@ process_linenos (start, end)
       lv = main_subfile.line_vector;
 
       /* Line numbers are not necessarily ordered. xlc compilation will
-        put static function to the end. */
+         put static function to the end. */
 
       lineTb = arrange_linetable (lv);
       if (lv == lineTb)
@@ -689,15 +705,15 @@ process_linenos (start, end)
          current_subfile->line_vector = lineTb;
        }
 
-      current_subfile->line_vector_length = 
+      current_subfile->line_vector_length =
        current_subfile->line_vector->nitems;
     }
 
   /* Now, process included files' line numbers.  */
 
-  for (ii=0; ii < inclIndx; ++ii)
+  for (ii = 0; ii < inclIndx; ++ii)
     {
-      if ((inclTable[ii].subfile)->line_vector) /* Useless if!!! FIXMEmgo */
+      if ((inclTable[ii].subfile)->line_vector)                /* Useless if!!! FIXMEmgo */
        {
          struct linetable *lineTb, *lv;
 
@@ -713,11 +729,11 @@ process_linenos (start, end)
          /* For the same include file, we might want to have more than one
             subfile.  This happens if we have something like:
 
-               ......
-               #include "foo.h"
-               ......
-               #include "foo.h"
-               ......
+            ......
+            #include "foo.h"
+            ......
+            #include "foo.h"
+            ......
 
             while foo.h including code in it. (stupid but possible)
             Since start_subfile() looks at the name and uses an
@@ -725,7 +741,7 @@ process_linenos (start, end)
             fool it.  */
 
 #if 0
-         start_subfile (inclTable[ii].name, (char*)0);
+         start_subfile (inclTable[ii].name, (char *) 0);
 #else
          {
            /* Pick a fake name that will produce the same results as this
@@ -734,7 +750,7 @@ process_linenos (start, end)
            char *fakename = strrchr (inclTable[ii].name, '.');
            if (fakename == NULL)
              fakename = " ?";
-           start_subfile (fakename, (char*)0);
+           start_subfile (fakename, (char *) 0);
            free (current_subfile->name);
          }
          current_subfile->name = strdup (inclTable[ii].name);
@@ -744,8 +760,8 @@ process_linenos (start, end)
            {
              current_subfile->line_vector =
                (struct linetable *) xrealloc
-                 (lv, (sizeof (struct linetable)
-                       + lv->nitems * sizeof (struct linetable_entry)));
+               (lv, (sizeof (struct linetable)
+                     + lv->nitems * sizeof (struct linetable_entry)));
 
            }
          else
@@ -754,13 +770,13 @@ process_linenos (start, end)
              current_subfile->line_vector = lineTb;
            }
 
-         current_subfile->line_vector_length = 
+         current_subfile->line_vector_length =
            current_subfile->line_vector->nitems;
-         start_subfile (pop_subfile (), (char*)0);
+         start_subfile (pop_subfile (), (char *) 0);
        }
     }
 
- return_after_cleanup:
+return_after_cleanup:
 
   /* We don't want to keep alloc/free'ing the global include file table.  */
   inclIndx = 0;
@@ -779,8 +795,8 @@ aix_process_linenos ()
 
 /* Enter a given range of lines into the line vector.
    can be called in the following two ways:
-     enter_line_range (subfile, beginoffset, endoffset, startaddr, 0, firstLine)  or
-     enter_line_range (subfile, beginoffset, 0, startaddr, endaddr, firstLine)
+   enter_line_range (subfile, beginoffset, endoffset, startaddr, 0, firstLine)  or
+   enter_line_range (subfile, beginoffset, 0, startaddr, endaddr, firstLine)
 
    endoffset points to the last line table entry that we should pay
    attention to.  */
@@ -789,9 +805,9 @@ static void
 enter_line_range (subfile, beginoffset, endoffset, startaddr, endaddr,
                  firstLine)
      struct subfile *subfile;
-     unsigned   beginoffset, endoffset;        /* offsets to line table */
-     CORE_ADDR  startaddr, endaddr;
-     unsigned   *firstLine;
+     unsigned beginoffset, endoffset;  /* offsets to line table */
+     CORE_ADDR startaddr, endaddr;
+     unsigned *firstLine;
 {
   unsigned int curoffset;
   CORE_ADDR addr;
@@ -804,15 +820,15 @@ enter_line_range (subfile, beginoffset, endoffset, startaddr, endaddr,
     return;
   curoffset = beginoffset;
   limit_offset =
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->max_lineno_offset;
+    ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+    ->max_lineno_offset;
 
   if (endoffset != 0)
     {
       if (endoffset >= limit_offset)
        {
          static struct complaint msg =
-           {"Bad line table offset in C_EINCL directive", 0, 0};
+         {"Bad line table offset in C_EINCL directive", 0, 0};
          complain (&msg);
          return;
        }
@@ -884,7 +900,7 @@ enter_line_range (subfile, beginoffset, endoffset, startaddr, endaddr,
 /* xcoff has static blocks marked in `.bs', `.es' pairs. They cannot be
    nested. At any given time, a symbol can only be in one static block.
    This is the base address of current static block, zero if non exists. */
-   
+
 static int static_block_base = 0;
 
 /* Section number for the current static block.  */
@@ -908,7 +924,7 @@ xcoff_next_symbol_text (objfile)
 {
   struct internal_syment symbol;
   static struct complaint msg =
-    {"Unexpected symbol continuation", 0, 0};
+  {"Unexpected symbol continuation", 0, 0};
   char *retval;
   /* FIXME: is this the same as the passed arg? */
   objfile = this_symtab_psymtab->objfile;
@@ -919,14 +935,14 @@ xcoff_next_symbol_text (objfile)
       complain (&msg);
 
       /* Return something which points to '\0' and hope the symbol reading
-        code does something reasonable.  */
+         code does something reasonable.  */
       retval = "";
     }
   else if (symbol.n_sclass & 0x80)
     {
       retval =
-       ((struct coff_symfile_info *)objfile->sym_private)->debugsec
-         + symbol.n_offset;
+       ((struct coff_symfile_info *) objfile->sym_private)->debugsec
+       + symbol.n_offset;
       raw_symbol +=
        coff_data (objfile->obfd)->local_symesz;
       ++symnum;
@@ -936,7 +952,7 @@ xcoff_next_symbol_text (objfile)
       complain (&msg);
 
       /* Return something which points to '\0' and hope the symbol reading
-        code does something reasonable.  */
+         code does something reasonable.  */
       retval = "";
     }
   return retval;
@@ -951,9 +967,9 @@ read_xcoff_symtab (pst)
   struct objfile *objfile = pst->objfile;
   bfd *abfd = objfile->obfd;
   char *raw_auxptr;            /* Pointer to first raw aux entry for sym */
-  char *strtbl = ((struct coff_symfile_info *)objfile->sym_private)->strtbl;
+  char *strtbl = ((struct coff_symfile_info *) objfile->sym_private)->strtbl;
   char *debugsec =
-    ((struct coff_symfile_info *)objfile->sym_private)->debugsec;
+  ((struct coff_symfile_info *) objfile->sym_private)->debugsec;
 
   struct internal_syment symbol[1];
   union internal_auxent main_aux;
@@ -975,7 +991,7 @@ read_xcoff_symtab (pst)
 
   char *filestring = " _start_ ";      /* Name of the current file. */
 
-  char *last_csect_name;               /* last seen csect's name and value */
+  char *last_csect_name;       /* last seen csect's name and value */
   CORE_ADDR last_csect_val;
   int last_csect_sec;
 
@@ -990,16 +1006,16 @@ read_xcoff_symtab (pst)
   last_csect_val = 0;
 
   start_stabs ();
-  start_symtab (filestring, (char *)NULL, file_start_addr);
+  start_symtab (filestring, (char *) NULL, file_start_addr);
   record_debugformat ("XCOFF");
-  symnum = ((struct symloc *)pst->read_symtab_private)->first_symnum;
+  symnum = ((struct symloc *) pst->read_symtab_private)->first_symnum;
   max_symnum =
-    symnum + ((struct symloc *)pst->read_symtab_private)->numsyms;
+    symnum + ((struct symloc *) pst->read_symtab_private)->numsyms;
   first_object_file_end = 0;
 
   raw_symbol =
     ((struct coff_symfile_info *) objfile->sym_private)->symtbl
-      + symnum * local_symesz;
+    + symnum * local_symesz;
 
   while (symnum < max_symnum)
     {
@@ -1008,10 +1024,10 @@ read_xcoff_symtab (pst)
 
       /* READ_ONE_SYMBOL (symbol, cs, symname_alloced); */
       /* read one symbol into `cs' structure. After processing the
-        whole symbol table, only string table will be kept in memory,
-        symbol table and debug section of xcoff will be freed. Thus
-        we can mark symbols with names in string table as
-        `alloced'. */
+         whole symbol table, only string table will be kept in memory,
+         symbol table and debug section of xcoff will be freed. Thus
+         we can mark symbols with names in string table as
+         `alloced'. */
       {
        int ii;
 
@@ -1026,7 +1042,7 @@ read_xcoff_symtab (pst)
            /* We must use the original, unswapped, name here so the name field
               pointed to by cs->c_name will persist throughout xcoffread.  If
               we use the new field, it gets overwritten for each symbol.  */
-           cs->c_name = ((struct external_syment *)raw_symbol)->e.e_name;
+           cs->c_name = ((struct external_syment *) raw_symbol)->e.e_name;
            /* If it's exactly E_SYMNMLEN characters long it isn't
               '\0'-terminated.  */
            if (cs->c_name[E_SYMNMLEN - 1] != '\0')
@@ -1047,13 +1063,13 @@ read_xcoff_symtab (pst)
        else
          {
            /* in string table */
-           cs->c_name = strtbl + (int)symbol->n_offset;
+           cs->c_name = strtbl + (int) symbol->n_offset;
            symname_alloced = 1;
          }
        cs->c_value = symbol->n_value;
        cs->c_sclass = symbol->n_sclass;
        cs->c_secnum = symbol->n_scnum;
-       cs->c_type = (unsigned)symbol->n_type;
+       cs->c_type = (unsigned) symbol->n_type;
 
        raw_symbol += coff_data (abfd)->local_symesz;
        ++symnum;
@@ -1084,14 +1100,14 @@ read_xcoff_symtab (pst)
            }
 
          start_stabs ();
-         start_symtab ("_globals_", (char *)NULL, (CORE_ADDR)0);
+         start_symtab ("_globals_", (char *) NULL, (CORE_ADDR) 0);
          record_debugformat ("XCOFF");
          cur_src_end_addr = first_object_file_end;
          /* done with all files, everything from here on is globals */
        }
 
       /* if explicitly specified as a function, treat is as one. */
-      if (ISFCN(cs->c_type) && cs->c_sclass != C_TPDEF)
+      if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF)
        {
          bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
                                0, cs->c_naux, &main_aux);
@@ -1130,15 +1146,15 @@ read_xcoff_symtab (pst)
                    {
 
                      /* A program csect is seen.  We have to allocate one
-                        symbol table for each program csect.  Normally gdb
-                        prefers one symtab for each source file.  In case
-                        of AIX, one source file might include more than one
-                        [PR] csect, and they don't have to be adjacent in
-                        terms of the space they occupy in memory. Thus, one
-                        single source file might get fragmented in the
-                        memory and gdb's file start and end address
-                        approach does not work!  GCC (and I think xlc) seem
-                        to put all the code in the unnamed program csect.  */
+                        symbol table for each program csect.  Normally gdb
+                        prefers one symtab for each source file.  In case
+                        of AIX, one source file might include more than one
+                        [PR] csect, and they don't have to be adjacent in
+                        terms of the space they occupy in memory. Thus, one
+                        single source file might get fragmented in the
+                        memory and gdb's file start and end address
+                        approach does not work!  GCC (and I think xlc) seem
+                        to put all the code in the unnamed program csect.  */
 
                      if (last_csect_name)
                        {
@@ -1149,12 +1165,12 @@ read_xcoff_symtab (pst)
                          start_stabs ();
                          /* Give all csects for this source file the same
                             name.  */
-                         start_symtab (filestring, NULL, (CORE_ADDR)0);
+                         start_symtab (filestring, NULL, (CORE_ADDR) 0);
                          record_debugformat ("XCOFF");
                        }
 
                      /* If this is the very first csect seen,
-                        basically `__start'. */
+                        basically `__start'. */
                      if (just_started)
                        {
                          first_object_file_end
@@ -1278,7 +1294,7 @@ read_xcoff_symtab (pst)
            filestring = cs->c_name;
 
          start_stabs ();
-         start_symtab (filestring, (char *)NULL, (CORE_ADDR)0);
+         start_symtab (filestring, (char *) NULL, (CORE_ADDR) 0);
          record_debugformat ("XCOFF");
          last_csect_name = 0;
 
@@ -1303,7 +1319,7 @@ read_xcoff_symtab (pst)
 
              new = push_context (0, fcn_start_addr + off);
 
-             new->name = define_symbol 
+             new->name = define_symbol
                (fcn_cs_saved.c_value + off,
                 fcn_stab_saved.c_name, 0, 0, objfile);
              if (new->name != NULL)
@@ -1316,9 +1332,9 @@ read_xcoff_symtab (pst)
                                    0, cs->c_naux, &main_aux);
 
              /* The value of .ef is the address of epilogue code;
-                not useful for gdb.  */
+                not useful for gdb.  */
              /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
-                contains number of lines to '}' */
+                contains number of lines to '}' */
 
              if (context_stack_depth <= 0)
                {               /* We attempted to pop an empty context stack */
@@ -1373,7 +1389,7 @@ read_xcoff_symtab (pst)
        case C_ENTAG:
          {
            static struct complaint msg =
-             {"Unrecognized storage class %d.", 0, 0};
+           {"Unrecognized storage class %d.", 0, 0};
            complain (&msg, cs->c_sclass);
          }
          break;
@@ -1466,8 +1482,8 @@ read_xcoff_symtab (pst)
   (SYMBOL2) = (struct symbol *)                \
        obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); \
   *(SYMBOL2) = *(SYMBOL1);
-  
+
+
 #define        SYMNAME_ALLOC(NAME, ALLOCED)    \
   (ALLOCED) ? (NAME) : obsavestring ((NAME), strlen (NAME), &objfile->symbol_obstack);
 
@@ -1479,8 +1495,8 @@ static struct type *var_symbol_type;
 
 static struct symbol *
 process_xcoff_symbol (cs, objfile)
-  register struct coff_symbol *cs;
-  struct objfile *objfile;
+     register struct coff_symbol *cs;
+     struct objfile *objfile;
 {
   struct symbol onesymbol;
   register struct symbol *sym = &onesymbol;
@@ -1493,7 +1509,7 @@ process_xcoff_symbol (cs, objfile)
   if (cs->c_secnum < 0)
     {
       /* The value is a register number, offset within a frame, etc.,
-        and does not get relocated.  */
+         and does not get relocated.  */
       off = 0;
       sec = -1;
     }
@@ -1517,8 +1533,8 @@ process_xcoff_symbol (cs, objfile)
   if (ISFCN (cs->c_type))
     {
       /* At this point, we don't know the type of the function.  This
-        will be patched with the type from its stab entry later on in
-        patch_block_stabs (), unless the file was compiled without -g.  */
+         will be patched with the type from its stab entry later on in
+         patch_block_stabs (), unless the file was compiled without -g.  */
 
       SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
       SYMBOL_TYPE (sym) = func_symbol_type;
@@ -1539,8 +1555,8 @@ process_xcoff_symbol (cs, objfile)
       switch (cs->c_sclass)
        {
 #if 0
-       /* The values of functions and global symbols are now resolved
-          via the global_sym_chain in stabsread.c.  */
+         /* The values of functions and global symbols are now resolved
+            via the global_sym_chain in stabsread.c.  */
        case C_FUN:
          if (fcn_cs_saved.c_sclass == C_EXT)
            add_stab_to_list (name, &global_stabs);
@@ -1591,7 +1607,7 @@ process_xcoff_symbol (cs, objfile)
             where we need to, which is not necessarily super-clean,
             but seems workable enough.  */
 
-         if (*name == ':' || (pp = (char *) strchr(name, ':')) == NULL)
+         if (*name == ':' || (pp = (char *) strchr (name, ':')) == NULL)
            return NULL;
 
          ++pp;
@@ -1625,7 +1641,7 @@ coff_getfilename (aux_entry, objfile)
 
   if (aux_entry->x_file.x_n.x_zeroes == 0)
     strcpy (buffer,
-           ((struct coff_symfile_info *)objfile->sym_private)->strtbl
+           ((struct coff_symfile_info *) objfile->sym_private)->strtbl
            + aux_entry->x_file.x_n.x_offset);
   else
     {
@@ -1642,25 +1658,25 @@ read_symbol (symbol, symno)
      int symno;
 {
   int nsyms =
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->symtbl_num_syms;
-  char *stbl = 
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->symtbl;
+  ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+  ->symtbl_num_syms;
+  char *stbl =
+  ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+  ->symtbl;
   if (symno < 0 || symno >= nsyms)
     {
       static struct complaint msg =
-       {"Invalid symbol offset", 0, 0};
+      {"Invalid symbol offset", 0, 0};
       complain (&msg);
       symbol->n_value = 0;
       symbol->n_scnum = -1;
       return;
     }
   bfd_coff_swap_sym_in (this_symtab_psymtab->objfile->obfd,
-                       stbl + (symno*local_symesz),
+                       stbl + (symno * local_symesz),
                        symbol);
 }
-  
+
 /* Get value corresponding to symbol number symno in symtbl.  */
 
 static int
@@ -1670,7 +1686,7 @@ read_symbol_nvalue (symno)
   struct internal_syment symbol[1];
 
   read_symbol (symbol, symno);
-  return symbol->n_value;  
+  return symbol->n_value;
 }
 
 
@@ -1682,11 +1698,11 @@ read_symbol_lineno (symno)
      int symno;
 {
   int nsyms =
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->symtbl_num_syms;
-  char *stbl = 
-    ((struct coff_symfile_info *)this_symtab_psymtab->objfile->sym_private)
-      ->symtbl;
+  ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+  ->symtbl_num_syms;
+  char *stbl =
+  ((struct coff_symfile_info *) this_symtab_psymtab->objfile->sym_private)
+  ->symtbl;
   struct internal_syment symbol[1];
   union internal_auxent main_aux[1];
 
@@ -1745,7 +1761,7 @@ static void
 find_linenos (abfd, asect, vpinfo)
      bfd *abfd;
      sec_ptr asect;
-     PTR vpinfo; 
+     PTR vpinfo;
 {
   struct coff_symfile_info *info;
   int size, count;
@@ -1757,7 +1773,7 @@ find_linenos (abfd, asect, vpinfo)
     return;
 
   size = count * coff_data (abfd)->local_linesz;
-  info = (struct coff_symfile_info *)vpinfo;
+  info = (struct coff_symfile_info *) vpinfo;
   offset = asect->line_filepos;
   maxoff = offset + size;
 
@@ -1776,7 +1792,7 @@ xcoff_psymtab_to_symtab_1 (pst)
 {
   struct cleanup *old_chain;
   int i;
-  
+
   if (!pst)
     return;
 
@@ -1800,13 +1816,13 @@ xcoff_psymtab_to_symtab_1 (pst)
            fputs_filtered ("and ", gdb_stdout);
            wrap_here ("");
            printf_filtered ("%s...", pst->dependencies[i]->filename);
-           wrap_here ("");             /* Flush output */
+           wrap_here ("");     /* Flush output */
            gdb_flush (gdb_stdout);
          }
        xcoff_psymtab_to_symtab_1 (pst->dependencies[i]);
       }
 
-  if (((struct symloc *)pst->read_symtab_private)->numsyms != 0)
+  if (((struct symloc *) pst->read_symtab_private)->numsyms != 0)
     {
       /* Init stuff necessary for reading in symbols.  */
       stabsread_init ();
@@ -1844,11 +1860,11 @@ xcoff_psymtab_to_symtab (pst)
       return;
     }
 
-  if (((struct symloc *)pst->read_symtab_private)->numsyms != 0
+  if (((struct symloc *) pst->read_symtab_private)->numsyms != 0
       || pst->number_of_dependencies)
     {
       /* Print the message now, before reading the string table,
-        to avoid disconcerting pauses.  */
+         to avoid disconcerting pauses.  */
       if (info_verbose)
        {
          printf_filtered ("Reading in symbols for %s...", pst->filename);
@@ -1880,7 +1896,7 @@ xcoff_new_init (objfile)
 }
 
 /* Do initialization in preparation for reading symbols from OBJFILE.
+
    We will only be called if this is an XCOFF or XCOFF-like file.
    BFD handles figuring out the format of the file, and code in symfile.c
    uses BFD's determination to vector to us.  */
@@ -1890,8 +1906,8 @@ xcoff_symfile_init (objfile)
      struct objfile *objfile;
 {
   /* Allocate struct to keep track of the symfile */
-  objfile -> sym_private = xmmalloc (objfile -> md,
-                                    sizeof (struct coff_symfile_info));
+  objfile->sym_private = xmmalloc (objfile->md,
+                                  sizeof (struct coff_symfile_info));
 
   /* XCOFF objects may be reordered, so set OBJF_REORDERED.  If we
      find this causes a significant slowdown in gdb then we could
@@ -1910,9 +1926,9 @@ static void
 xcoff_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (objfile -> sym_private != NULL)
+  if (objfile->sym_private != NULL)
     {
-      mfree (objfile -> md, objfile -> sym_private);
+      mfree (objfile->md, objfile->sym_private);
     }
 
   /* Start with a fresh include table for the next objfile.  */
@@ -1936,13 +1952,13 @@ init_stringtab (abfd, offset, objfile)
   unsigned char lengthbuf[4];
   char *strtbl;
 
-  ((struct coff_symfile_info *)objfile->sym_private)->strtbl = NULL;
+  ((struct coff_symfile_info *) objfile->sym_private)->strtbl = NULL;
 
   if (bfd_seek (abfd, offset, SEEK_SET) < 0)
     error ("cannot seek to string table in %s: %s",
           bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
 
-  val = bfd_read ((char *)lengthbuf, 1, sizeof lengthbuf, abfd);
+  val = bfd_read ((char *) lengthbuf, 1, sizeof lengthbuf, abfd);
   length = bfd_h_get_32 (abfd, lengthbuf);
 
   /* If no string table is needed, then the file may end immediately
@@ -1955,7 +1971,7 @@ init_stringtab (abfd, offset, objfile)
      as long as we have its symbol table around. */
 
   strtbl = (char *) obstack_alloc (&objfile->symbol_obstack, length);
-  ((struct coff_symfile_info *)objfile->sym_private)->strtbl = strtbl;
+  ((struct coff_symfile_info *) objfile->sym_private)->strtbl = strtbl;
 
   /* Copy length buffer, the first byte is usually zero and is
      used for stabs with a name length of zero.  */
@@ -2002,15 +2018,15 @@ xcoff_start_psymtab (objfile, section_offsets,
      struct partial_symbol **static_syms;
 {
   struct partial_symtab *result =
-    start_psymtab_common (objfile, section_offsets,
-                         filename,
-                         /* We fill in textlow later.  */
-                         0,
-                         global_syms, static_syms);
+  start_psymtab_common (objfile, section_offsets,
+                       filename,
+  /* We fill in textlow later.  */
+                       0,
+                       global_syms, static_syms);
 
   result->read_symtab_private = (char *)
-    obstack_alloc (&objfile -> psymbol_obstack, sizeof (struct symloc));
-  ((struct symloc *)result->read_symtab_private)->first_symnum = first_symnum;
+    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+  ((struct symloc *) result->read_symtab_private)->first_symnum = first_symnum;
   result->read_symtab = xcoff_psymtab_to_symtab;
 
   /* Deduce the source language from the filename for this psymtab. */
@@ -2043,13 +2059,13 @@ xcoff_end_psymtab (pst, include_list, num_includes, capping_symbol_number,
      int textlow_not_set;
 {
   int i;
-  struct objfile *objfile = pst -> objfile;
+  struct objfile *objfile = pst->objfile;
 
   if (capping_symbol_number != -1)
-    ((struct symloc *)pst->read_symtab_private)->numsyms =
+    ((struct symloc *) pst->read_symtab_private)->numsyms =
       capping_symbol_number
-       - ((struct symloc *)pst->read_symtab_private)->first_symnum;
-  ((struct symloc *)pst->read_symtab_private)->lineno_off =
+      - ((struct symloc *) pst->read_symtab_private)->first_symnum;
+  ((struct symloc *) pst->read_symtab_private)->lineno_off =
     first_fun_line_offset;
   first_fun_line_offset = 0;
   pst->n_global_syms =
@@ -2062,9 +2078,9 @@ xcoff_end_psymtab (pst, include_list, num_includes, capping_symbol_number,
     {
       pst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+                   number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
-            number_dependencies * sizeof (struct partial_symtab *));
+             number_dependencies * sizeof (struct partial_symtab *));
     }
   else
     pst->dependencies = 0;
@@ -2072,19 +2088,19 @@ xcoff_end_psymtab (pst, include_list, num_includes, capping_symbol_number,
   for (i = 0; i < num_includes; i++)
     {
       struct partial_symtab *subpst =
-       allocate_psymtab (include_list[i], objfile);
+      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));
-      ((struct symloc *)subpst->read_symtab_private)->first_symnum = 0;
-      ((struct symloc *)subpst->read_symtab_private)->numsyms = 0;
+       (char *) obstack_alloc (&objfile->psymbol_obstack,
+                               sizeof (struct symloc));
+      ((struct symloc *) subpst->read_symtab_private)->first_symnum = 0;
+      ((struct symloc *) subpst->read_symtab_private)->numsyms = 0;
       subpst->textlow = 0;
       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.  */
+         shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
        obstack_alloc (&objfile->psymbol_obstack,
                       sizeof (struct partial_symtab *));
@@ -2093,8 +2109,8 @@ xcoff_end_psymtab (pst, include_list, num_includes, capping_symbol_number,
 
       subpst->globals_offset =
        subpst->n_global_syms =
-         subpst->statics_offset =
-           subpst->n_static_syms = 0;
+       subpst->statics_offset =
+       subpst->n_static_syms = 0;
 
       subpst->readin = 0;
       subpst->symtab = 0;
@@ -2114,14 +2130,14 @@ xcoff_end_psymtab (pst, include_list, num_includes, capping_symbol_number,
       && 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.  */
+         it is on the obstack, but we can forget to chain it on the list.  */
       /* Empty psymtabs happen as a result of header files which don't have
-        any symbols in them.  There can be a lot of them.  */
+         any symbols in them.  There can be a lot of them.  */
 
       discard_psymtab (pst);
 
       /* Indicate that psymtab was thrown away.  */
-      pst = (struct partial_symtab *)NULL;
+      pst = (struct partial_symtab *) NULL;
     }
   return pst;
 }
@@ -2148,7 +2164,7 @@ swap_sym (symbol, aux, name, raw, symnump, objfile)
   if (symbol->n_zeroes)
     {
       /* If it's exactly E_SYMNMLEN characters long it isn't
-        '\0'-terminated.  */
+         '\0'-terminated.  */
       if (symbol->n_name[E_SYMNMLEN - 1] != '\0')
        {
          /* FIXME: wastes memory for symbols which we don't end up putting
@@ -2162,16 +2178,16 @@ swap_sym (symbol, aux, name, raw, symnump, objfile)
       else
        /* Point to the unswapped name as that persists as long as the
           objfile does.  */
-       *name = ((struct external_syment *)*raw)->e.e_name;
+       *name = ((struct external_syment *) *raw)->e.e_name;
     }
   else if (symbol->n_sclass & 0x80)
     {
-      *name = ((struct coff_symfile_info *)objfile->sym_private)->debugsec
+      *name = ((struct coff_symfile_info *) objfile->sym_private)->debugsec
        + symbol->n_offset;
     }
   else
     {
-      *name = ((struct coff_symfile_info *)objfile->sym_private)->strtbl
+      *name = ((struct coff_symfile_info *) objfile->sym_private)->strtbl
        + symbol->n_offset;
     }
   ++*symnump;
@@ -2191,7 +2207,7 @@ scan_xcoff_symtab (section_offsets, objfile)
      struct section_offsets *section_offsets;
      struct objfile *objfile;
 {
-  CORE_ADDR toc_offset = 0;            /* toc offset value in data section. */
+  CORE_ADDR toc_offset = 0;    /* toc offset value in data section. */
   char *filestring = NULL;
 
   char *namestring;
@@ -2217,10 +2233,10 @@ scan_xcoff_symtab (section_offsets, objfile)
   union internal_auxent main_aux;
   unsigned int ssymnum;
 
-  char *last_csect_name = NULL;                /* last seen csect's name and value */
+  char *last_csect_name = NULL;        /* last seen csect's name and value */
   CORE_ADDR last_csect_val = 0;
   int last_csect_sec = 0;
-  int  misc_func_recorded = 0;         /* true if any misc. function */
+  int misc_func_recorded = 0;  /* true if any misc. function */
   int textlow_not_set = 1;
 
   pst = (struct partial_symtab *) 0;
@@ -2240,16 +2256,16 @@ scan_xcoff_symtab (section_offsets, objfile)
 
   abfd = objfile->obfd;
 
-  sraw_symbol = ((struct coff_symfile_info *)objfile->sym_private)->symtbl;
-  nsyms = ((struct coff_symfile_info *)objfile->sym_private)->symtbl_num_syms;
+  sraw_symbol = ((struct coff_symfile_info *) objfile->sym_private)->symtbl;
+  nsyms = ((struct coff_symfile_info *) objfile->sym_private)->symtbl_num_syms;
   ssymnum = 0;
   while (ssymnum < nsyms)
     {
-      int sclass = ((struct external_syment *)sraw_symbol)->e_sclass[0] & 0xff;
+      int sclass = ((struct external_syment *) sraw_symbol)->e_sclass[0] & 0xff;
       /* This is the type we pass to partial-stab.h.  A less kludgy solution
-        would be to break out partial-stab.h into its various parts--shuffle
-        off the DBXREAD_ONLY stuff to dbxread.c, and make separate
-        pstab-norm.h (for most types), pstab-sol.h (for N_SOL), etc.  */
+         would be to break out partial-stab.h into its various parts--shuffle
+         off the DBXREAD_ONLY stuff to dbxread.c, and make separate
+         pstab-norm.h (for most types), pstab-sol.h (for N_SOL), etc.  */
       int stype;
 
       QUIT;
@@ -2269,7 +2285,7 @@ scan_xcoff_symtab (section_offsets, objfile)
              {
                bfd_coff_swap_aux_in
                  (objfile->obfd,
-                  sraw_symbol - coff_data(abfd)->local_symesz,
+                  sraw_symbol - coff_data (abfd)->local_symesz,
                   symbol.n_type,
                   symbol.n_sclass,
                   symbol.n_numaux - 1,
@@ -2336,7 +2352,7 @@ scan_xcoff_symtab (section_offsets, objfile)
                    if (pst != NULL)
                      {
                        CORE_ADDR highval =
-                         symbol.n_value + csect_aux.x_csect.x_scnlen.l;
+                       symbol.n_value + csect_aux.x_csect.x_scnlen.l;
                        if (highval > pst->texthigh)
                          pst->texthigh = highval;
                        if (pst->textlow == 0 || symbol.n_value < pst->textlow)
@@ -2511,7 +2527,7 @@ scan_xcoff_symtab (section_offsets, objfile)
        default:
          {
            static struct complaint msg =
-             {"Storage class %d not recognized during scan", 0, 0};
+           {"Storage class %d not recognized during scan", 0, 0};
            complain (&msg, sclass);
          }
          /* FALLTHROUGH */
@@ -2562,7 +2578,7 @@ scan_xcoff_symtab (section_offsets, objfile)
            /* We probably could save a few instructions by assuming that
               C_LSYM, C_PSYM, etc., never have auxents.  */
            int naux1 =
-             ((struct external_syment *)sraw_symbol)->e_numaux[0] + 1;
+           ((struct external_syment *) sraw_symbol)->e_numaux[0] + 1;
            ssymnum += naux1;
            sraw_symbol += sizeof (struct external_syment) * naux1;
          }
@@ -2596,7 +2612,7 @@ scan_xcoff_symtab (section_offsets, objfile)
 #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
   do {} while (0)
 /* We have already set the namestring.  */
-#define SET_NAMESTRING() /* */
+#define SET_NAMESTRING()       /* */
 
 #include "partial-stab.h"
        }
@@ -2641,26 +2657,26 @@ static void
 xcoff_initial_scan (objfile, section_offsets, mainline)
      struct objfile *objfile;
      struct section_offsets *section_offsets;
-     int mainline;     /* FIXME comments above */
+     int mainline;             /* FIXME comments above */
 {
   bfd *abfd;
   int val;
   struct cleanup *back_to;
-  int num_symbols;                     /* # of symbols */
-  file_ptr symtab_offset;              /* symbol table and */
-  file_ptr stringtab_offset;           /* string table file offsets */
+  int num_symbols;             /* # of symbols */
+  file_ptr symtab_offset;      /* symbol table and */
+  file_ptr stringtab_offset;   /* string table file offsets */
   struct coff_symfile_info *info;
   char *name;
   unsigned int size;
 
-  info = (struct coff_symfile_info *) objfile -> sym_private;
+  info = (struct coff_symfile_info *) objfile->sym_private;
   symfile_bfd = abfd = objfile->obfd;
   name = objfile->name;
 
   num_symbols = bfd_get_symcount (abfd);       /* # of symbols */
   symtab_offset = obj_sym_filepos (abfd);      /* symbol table file offset */
   stringtab_offset = symtab_offset +
-    num_symbols * coff_data(abfd)->local_symesz;
+    num_symbols * coff_data (abfd)->local_symesz;
 
   info->min_lineno_offset = 0;
   info->max_lineno_offset = 0;
@@ -2694,7 +2710,7 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
                  }
              }
          }
-       ((struct coff_symfile_info *)objfile->sym_private)->debugsec =
+       ((struct coff_symfile_info *) objfile->sym_private)->debugsec =
          debugsec;
       }
     }
@@ -2706,12 +2722,12 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
     error ("Error reading symbols from %s: %s",
           name, bfd_errmsg (bfd_get_error ()));
   size = coff_data (abfd)->local_symesz * num_symbols;
-  ((struct coff_symfile_info *)objfile->sym_private)->symtbl =
+  ((struct coff_symfile_info *) objfile->sym_private)->symtbl =
     obstack_alloc (&objfile->symbol_obstack, size);
-  ((struct coff_symfile_info *)objfile->sym_private)->symtbl_num_syms =
+  ((struct coff_symfile_info *) objfile->sym_private)->symtbl_num_syms =
     num_symbols;
 
-  val = bfd_read (((struct coff_symfile_info *)objfile->sym_private)->symtbl,
+  val = bfd_read (((struct coff_symfile_info *) objfile->sym_private)->symtbl,
                  size, 1, abfd);
   if (val != size)
     perror_with_name ("reading symbol table");
@@ -2756,9 +2772,9 @@ xcoff_symfile_offsets (objfile, addr)
   objfile->num_sections = SECT_OFF_MAX;
   section_offsets = (struct section_offsets *)
     obstack_alloc
-      (&objfile -> psymbol_obstack,
-       sizeof (struct section_offsets)
-       + sizeof (section_offsets->offsets) * objfile->num_sections);
+    (&objfile->psymbol_obstack,
+     sizeof (struct section_offsets)
+     + sizeof (section_offsets->offsets) * objfile->num_sections);
 
   /* syms_from_objfile kindly subtracts from addr the bfd_section_vma
      of the .text section.  This strikes me as wrong--whether the
@@ -2789,20 +2805,20 @@ static struct sym_fns xcoff_sym_fns =
      xcoffread.c reads all the symbols and does in fact randomly access them
      (in C_BSTAT and line number processing).  */
 
-  (enum bfd_flavour)-1,
+  (enum bfd_flavour) -1,
 
-  xcoff_new_init,      /* sym_new_init: init anything gbl to entire symtab */
-  xcoff_symfile_init,  /* sym_init: read initial info, setup for sym_read() */
-  xcoff_initial_scan,  /* sym_read: read a symbol file into symtab */
-  xcoff_symfile_finish, /* sym_finish: finished with file, cleanup */
-  xcoff_symfile_offsets, /* sym_offsets: xlate offsets ext->int form */
-  NULL                 /* next: pointer to next struct sym_fns */
+  xcoff_new_init,              /* sym_new_init: init anything gbl to entire symtab */
+  xcoff_symfile_init,          /* sym_init: read initial info, setup for sym_read() */
+  xcoff_initial_scan,          /* sym_read: read a symbol file into symtab */
+  xcoff_symfile_finish,                /* sym_finish: finished with file, cleanup */
+  xcoff_symfile_offsets,       /* sym_offsets: xlate offsets ext->int form */
+  NULL                         /* next: pointer to next struct sym_fns */
 };
 
 void
 _initialize_xcoffread ()
 {
-  add_symtab_fns(&xcoff_sym_fns);
+  add_symtab_fns (&xcoff_sym_fns);
 
   func_symbol_type = init_type (TYPE_CODE_FUNC, 1, 0,
                                "<function, no debug info>", NULL);
index 13d8065ea1d3c213933c56eca4959fc8db992477..bb286eba031ed9dedefd054a86ed09936b002635 100644 (file)
@@ -2,21 +2,22 @@
    Copyright 1991, 1992 Free Software Foundation.
    Contributed by IBM Corporation.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #if 0
 #include <sys/types.h>
@@ -38,7 +39,7 @@ void (*xcoff_relocate_symtab_hook) PARAMS ((unsigned int)) = NULL;
 #ifdef SOLIB_SYMBOLS_MANUAL
 
 extern struct symtab *current_source_symtab;
-extern int           current_source_line;
+extern int current_source_line;
 
 /* The real work of adding a shared library file to the symtab and
    the section list.  */
@@ -48,85 +49,91 @@ solib_add (arg_string, from_tty, target)
      char *arg_string;
      int from_tty;
      struct target_ops *target;
-{      
+{
   char *val;
   struct vmap *vp = vmap;
   struct objfile *obj;
   struct symtab *saved_symtab;
   int saved_line;
 
-  int loaded = 0;                      /* true if any shared obj loaded */
-  int matched = 0;                     /* true if any shared obj matched */
+  int loaded = 0;              /* true if any shared obj loaded */
+  int matched = 0;             /* true if any shared obj matched */
 
   if (arg_string == 0)
-      re_comp (".");
-  else if (val = (char *) re_comp (arg_string)) {
+    re_comp (".");
+  else if (val = (char *) re_comp (arg_string))
+    {
       error ("Invalid regexp: %s", val);
-  }
+    }
   if (!vp || !vp->nxt)
     return;
 
   /* save current symbol table and line number, in case they get changed
      in symbol loading process. */
+
   saved_symtab = current_source_symtab;
   saved_line = current_source_line;
 
   /* skip over the first vmap, it is the main program, always loaded. */
   vp = vp->nxt;
 
-  for (; vp; vp = vp->nxt) {
-
-    if (re_exec (vp->name) || (*vp->member && re_exec (vp->member))) {
-
-      matched = 1;
-
-      /* if already loaded, continue with the next one. */
-      if (vp->loaded) {
-       
-       printf_unfiltered ("%s%s%s%s: already loaded.\n",
-         *vp->member ? "(" : "",
-         vp->member,
-         *vp->member ? ") " : "",
-         vp->name);
-       continue;
-      }
+  for (; vp; vp = vp->nxt)
+    {
 
-      printf_unfiltered ("Loading  %s%s%s%s...",
-         *vp->member ? "(" : "",
-         vp->member,
-         *vp->member ? ") " : "",
-         vp->name);
-      gdb_flush (gdb_stdout);
-
-      /* This is gross and doesn't work.  If this code is re-enabled,
-        just stick a objfile member into the struct vmap; that's the
-        way solib.c (for SunOS/SVR4) does it.  */
-       obj = lookup_objfile_bfd (vp->bfd);
-       if (!obj) {
-         warning ("\nObj structure for the shared object not found. Loading failed.");
-         continue;
+      if (re_exec (vp->name) || (*vp->member && re_exec (vp->member)))
+       {
+
+         matched = 1;
+
+         /* if already loaded, continue with the next one. */
+         if (vp->loaded)
+           {
+
+             printf_unfiltered ("%s%s%s%s: already loaded.\n",
+                                *vp->member ? "(" : "",
+                                vp->member,
+                                *vp->member ? ") " : "",
+                                vp->name);
+             continue;
+           }
+
+         printf_unfiltered ("Loading  %s%s%s%s...",
+                            *vp->member ? "(" : "",
+                            vp->member,
+                            *vp->member ? ") " : "",
+                            vp->name);
+         gdb_flush (gdb_stdout);
+
+         /* This is gross and doesn't work.  If this code is re-enabled,
+            just stick a objfile member into the struct vmap; that's the
+            way solib.c (for SunOS/SVR4) does it.  */
+         obj = lookup_objfile_bfd (vp->bfd);
+         if (!obj)
+           {
+             warning ("\nObj structure for the shared object not found. Loading failed.");
+             continue;
+           }
+
+         syms_from_objfile (obj, 0, 0, 0);
+         new_symfile_objfile (obj, 0, 0);
+         vmap_symtab (vp, 0, 0);
+         printf_unfiltered ("Done.\n");
+         loaded = vp->loaded = 1;
        }
-
-       syms_from_objfile (obj, 0, 0, 0);
-       new_symfile_objfile (obj, 0, 0);
-       vmap_symtab (vp, 0, 0);
-       printf_unfiltered ("Done.\n");
-       loaded = vp->loaded = 1;
     }
-  }
   /* if any shared object is loaded, then misc_func_vector needs sorting. */
-  if (loaded) {
+  if (loaded)
+    {
 #if 0
-    sort_misc_function_vector ();
+      sort_misc_function_vector ();
 #endif
-    current_source_symtab = saved_symtab;
-    current_source_line = saved_line;
+      current_source_symtab = saved_symtab;
+      current_source_line = saved_line;
 
-    /* Getting new symbols might change our opinion about what is frameless.
-       Is this correct?? FIXME. */
+      /* Getting new symbols might change our opinion about what is frameless.
+         Is this correct?? FIXME. */
 /*    reinit_frame_cache(); */
-  }
+    }
   else if (!matched)
     printf_unfiltered ("No matching shared object found.\n");
 }
@@ -137,23 +144,25 @@ solib_add (arg_string, from_tty, target)
 
 char *
 pc_load_segment_name (addr)
-CORE_ADDR addr;
+     CORE_ADDR addr;
 {
-   static char buffer [BUFSIZ];
-   struct vmap *vp = vmap;
-
-   buffer [0] = buffer [1] = '\0';
-   for (; vp; vp = vp->nxt)
-     if (vp->tstart <= addr && addr < vp->tend) {
-       if (*vp->member) {
-         buffer [0] = '(';
-         strcat (&buffer[1], vp->member);
-         strcat (buffer, ")");
-       }
+  static char buffer[BUFSIZ];
+  struct vmap *vp = vmap;
+
+  buffer[0] = buffer[1] = '\0';
+  for (; vp; vp = vp->nxt)
+    if (vp->tstart <= addr && addr < vp->tend)
+      {
+       if (*vp->member)
+         {
+           buffer[0] = '(';
+           strcat (&buffer[1], vp->member);
+           strcat (buffer, ")");
+         }
        strcat (buffer, vp->name);
        return buffer;
-     }
-   return "(unknown load module)";
+      }
+  return "(unknown load module)";
 }
 
 static void solib_info PARAMS ((char *, int));
@@ -171,7 +180,7 @@ solib_info (args, from_tty)
 
   if (vp == NULL || vp->nxt == NULL)
     {
-      printf_unfiltered ("No shared libraries loaded at this time.\n");        
+      printf_unfiltered ("No shared libraries loaded at this time.\n");
       return;
     }
 
@@ -206,15 +215,15 @@ sharedlibrary_command (args, from_tty)
     (*xcoff_relocate_symtab_hook) (inferior_pid);
 
 #ifdef SOLIB_SYMBOLS_MANUAL
-  solib_add (args, from_tty, (struct target_ops *)0);
+  solib_add (args, from_tty, (struct target_ops *) 0);
 #endif /* SOLIB_SYMBOLS_MANUAL */
 }
 
 void
-_initialize_solib()
+_initialize_solib ()
 {
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           "Load shared object library symbols for files matching REGEXP.");
-  add_info ("sharedlibrary", solib_info, 
+  add_info ("sharedlibrary", solib_info,
            "Status of loaded shared object libraries");
 }
index 77d691bda83a91c45db1e84f7d3521d3735b0e0f..7069493375967873dabcee51d67ac2458916a2c8 100644 (file)
@@ -1,21 +1,22 @@
 /* Data structures for RS/6000 shared libraries, for GDB.
    Copyright 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* The vmap struct is used to describe the virtual address space of
    the target we are manipulating.  The first entry is always the "exec"
@@ -25,31 +26,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    shared libraries are loaded, or a "load" system call, followed by the
    user's issuance of a "load" command.  */
 
-struct vmap {
-  struct vmap *nxt;    /* ptr to next in chain                 */
-  bfd *bfd;            /* BFD for mappable object library      */
-  char *name;          /* ptr to object file name              */
-  char *member;                /* ptr to member name                   */
-  CORE_ADDR tstart;    /* virtual addr where member is mapped  */
-  CORE_ADDR tend;      /* virtual upper bound of member        */
-  CORE_ADDR tvma;      /* virtual addr of text section in object file */
-  CORE_ADDR toffs;     /* offset of text section in object file */
-  CORE_ADDR dstart;    /* virtual address of data start        */
-  CORE_ADDR dend;      /* virtual address of data end          */
-  CORE_ADDR dvma;      /* virtual addr of data section in object file */
-
-  /* This is NULL for the exec-file.  */
-  struct objfile *objfile;
-  
-  unsigned  loaded:1;  /* True if symbols are loaded           */
-  unsigned  padding:15;
-};
-
-
-struct vmap_and_bfd {
-  bfd *pbfd;
-  struct vmap *pvmap;
-};
+struct vmap
+  {
+    struct vmap *nxt;          /* ptr to next in chain                 */
+    bfd *bfd;                  /* BFD for mappable object library      */
+    char *name;                        /* ptr to object file name              */
+    char *member;              /* ptr to member name                   */
+    CORE_ADDR tstart;          /* virtual addr where member is mapped  */
+    CORE_ADDR tend;            /* virtual upper bound of member        */
+    CORE_ADDR tvma;            /* virtual addr of text section in object file */
+    CORE_ADDR toffs;           /* offset of text section in object file */
+    CORE_ADDR dstart;          /* virtual address of data start        */
+    CORE_ADDR dend;            /* virtual address of data end          */
+    CORE_ADDR dvma;            /* virtual addr of data section in object file */
+
+    /* This is NULL for the exec-file.  */
+    struct objfile *objfile;
+
+    unsigned loaded:1;         /* True if symbols are loaded           */
+    unsigned padding:15;
+  };
+
+
+struct vmap_and_bfd
+  {
+    bfd *pbfd;
+    struct vmap *pvmap;
+  };
 
 extern struct vmap *vmap;
 
index d4faa42db3f058b657e7a636e614b59464a2902d..8257ea806bff84d1d2c862b79ce157c88455e78e 100644 (file)
@@ -1,21 +1,22 @@
 /* XMODEM support for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -87,7 +88,7 @@ crcinit ()
            crc ^= CRC16;
        }
 
-      crctab [val] = crc;
+      crctab[val] = crc;
     }
 
   crctab_inited = 1;
@@ -103,7 +104,7 @@ docrc (p, len)
   unsigned short crc = 0;
 
   while (len-- > 0)
-    crc = (crc << 8) ^ crctab [(crc >> 8) ^ *p++];
+    crc = (crc << 8) ^ crctab[(crc >> 8) ^ *p++];
 
   return crc;
 }
@@ -144,17 +145,17 @@ xmodem_init_xfer (desc)
 }
 
 /* Take 128 bytes of data and make a packet out of it.
- *
- *     Each packet looks like this:
- *     +-----+-------+-------+------+-----+
- *     | SOH | Seq1. | Seq2. | data | SUM |
- *     +-----+-------+-------+------+-----+
- *     SOH  = 0x01
- *     Seq1 = The sequence number.
- *     Seq2 = The complement of the sequence number.
- *     Data = A 128 bytes of data.
- *     SUM  = Add the contents of the 128 bytes and use the low-order
- *            8 bits of the result.
+
+ *      Each packet looks like this:
+ *      +-----+-------+-------+------+-----+
+ *      | SOH | Seq1. | Seq2. | data | SUM |
+ *      +-----+-------+-------+------+-----+
+ *      SOH  = 0x01
+ *      Seq1 = The sequence number.
+ *      Seq2 = The complement of the sequence number.
+ *      Data = A 128 bytes of data.
+ *      SUM  = Add the contents of the 128 bytes and use the low-order
+ *             8 bits of the result.
  *
  * send_xmodem_packet fills in the XMODEM fields of PACKET and sends it to the
  * remote system.  PACKET must be XMODEM_PACKETSIZE bytes long.  The data must
@@ -174,14 +175,14 @@ xmodem_send_packet (desc, packet, len, hashmark)
   int retries;
   int pktlen;
   int datasize;
-  
+
   /* build the packet header */
 
   packet[1] = blknum;
   packet[2] = ~blknum;
 
   blknum++;
-  
+
   if (len <= XMODEM_DATASIZE)
     {
       packet[0] = SOH;
@@ -217,7 +218,7 @@ xmodem_send_packet (desc, packet, len, hashmark)
       for (i = 3; i < datasize + 3; i++)
        sum += packet[i];
 
-      packet[3 + datasize] = sum; /* add the checksum */
+      packet[3 + datasize] = sum;      /* add the checksum */
       pktlen = datasize + 4;
     }
 
@@ -246,7 +247,7 @@ xmodem_send_packet (desc, packet, len, hashmark)
        }
     }
 
-  SERIAL_WRITE (desc, "\004", 1); /* Send an EOT */
+  SERIAL_WRITE (desc, "\004", 1);      /* Send an EOT */
 
   error ("xmodem_send_packet:  Excessive retries.");
 }
@@ -263,7 +264,7 @@ xmodem_finish_xfer (desc)
     {
       int c;
 
-      SERIAL_WRITE (desc, "\004", 1); /* Send an EOT */
+      SERIAL_WRITE (desc, "\004", 1);  /* Send an EOT */
 
       c = readchar (desc, 3);
       switch (c)
index 03036120fc6c250d172c4611cb7297a0b2a49d2a..71f4cd9b4c587b711eb64e486c1e07a6f316c742 100644 (file)
@@ -1,21 +1,22 @@
 /* XMODEM support for GDB, the GNU debugger.
    Copyright 1995 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 int xmodem_init_xfer PARAMS ((serial_t desc));
 void send_xmodem_packet PARAMS ((serial_t desc, unsigned char *packet, int len,
@@ -25,5 +26,5 @@ void xmodem_finish_xfer PARAMS ((serial_t desc));
 #define XMODEM_DATASIZE        128     /* The data size is ALWAYS 128 */
 #define XMODEM_1KDATASIZE 1024 /* Unless it's 1024!!! */
 #define XMODEM_PACKETSIZE 133  /* data + packet headers and crc */
-#define XMODEM_1KPACKETSIZE 1024 + 5 /* data + packet headers and crc */
+#define XMODEM_1KPACKETSIZE 1024 + 5   /* data + packet headers and crc */
 #define XMODEM_DATAOFFSET 3    /* Offset to start of actual data */
index 0b5c1c29aff1bfadd10d4da00b7dc136a4324f9c..b3f85bd0f82adde0db5a7e23b35a87ccf15167f6 100644 (file)
@@ -1,25 +1,26 @@
 /* Target-machine dependent code for Zilog Z8000, for GDB.
    Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /*
- Contributed by Steve Chamberlain
-                sac@cygnus.com
  Contributed by Steve Chamberlain
+   sac@cygnus.com
  */
 
 #include "defs.h"
@@ -80,7 +81,7 @@ skip_adjust (pc, size)
   return pc;
 }
 
-static CORE_ADDR examine_frame PARAMS ((CORE_ADDR, CORE_ADDR *regs, CORE_ADDR));
+static CORE_ADDR examine_frame PARAMS ((CORE_ADDR, CORE_ADDR * regs, CORE_ADDR));
 static CORE_ADDR
 examine_frame (pc, regs, sp)
      CORE_ADDR pc;
@@ -120,8 +121,8 @@ examine_frame (pc, regs, sp)
   else if (IS_SUB_SP (w))
     {
       /* Subtracting a value from the sp, so were in a function
-       which needs stack space for locals, but has no fp.  We fake up
-       the values as if we had an fp */
+         which needs stack space for locals, but has no fp.  We fake up
+         the values as if we had an fp */
       regs[FP_REGNUM] = sp;
     }
   else
@@ -130,7 +131,7 @@ examine_frame (pc, regs, sp)
       regs[SP_REGNUM] = sp;
     }
   /* stack pointer contains address of next frame */
-  /*  regs[fp_regnum()] = fp;*/
+  /*  regs[fp_regnum()] = fp; */
   regs[SP_REGNUM] = sp;
   return pc;
 }
@@ -220,7 +221,7 @@ gdb_print_insn_z8k (memaddr, info)
 /* 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.*/
+   of the instruction. */
 
 CORE_ADDR
 NEXT_PROLOGUE_INSN (addr, lim, pword1)
@@ -296,7 +297,7 @@ frame_find_saved_regs (fip, fsrp)
 int
 saved_pc_after_call ()
 {
-  return ADDR_BITS_REMOVE 
+  return ADDR_BITS_REMOVE
     (read_memory_integer (read_register (SP_REGNUM), PTR_SIZE));
 }
 
@@ -329,7 +330,7 @@ write_return_value (type, valbuf)
   int len;
 
   for (len = 0; len < TYPE_LENGTH (type); len += 2)
-    write_register_bytes (REGISTER_BYTE (len / 2  + 2), valbuf + len, 2);
+    write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2);
 }
 
 void